summaryrefslogtreecommitdiff
path: root/pango/pango-layout.h
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-04-24 03:37:20 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-04-24 03:37:20 +0000
commit744df757571eb00e6766b450d941ccfe9b70b68f (patch)
tree423924e5c2b4819421451e725bf8e1a05e1bdbd8 /pango/pango-layout.h
parent3f3fc34bed071b73bd43bcec98edad6b81fcdf90 (diff)
downloadpango-744df757571eb00e6766b450d941ccfe9b70b68f.tar.gz
New function for visual (left-right, not forward-back) cursor navigation
Sun Apr 23 23:33:10 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_move_cursor_visually): New function for visual (left-right, not forward-back) cursor navigation within a layout. Thu Apr 20 22:16:39 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_line_x_to_index): As a hack, for x-positions at the edge of a line, fudge the position to be one before the line end (which is, for programs that don't properly handle the trailing flag), instead of at the end of the line. This works fine for whitespace-broken languages, but won't work right for languages that don't use whitespace to break lines. (GtkText* needs to keep track of whether a cursor is trailing or not) * pango/pango-layout.c (pango_layout_check_lines): Prohibit breaking a line at a non-whitespace -> space transition. (So that we never put wrap single character of whitespace at the beginning of a line) * pango/break.c (pango_break): Always allow a break before the first char. * pango/pango-layout.c (pango_layout_line_x_to_index): Remove the return value from the function, make it return the appropriate index depending on the base direction of the layoutt.
Diffstat (limited to 'pango/pango-layout.h')
-rw-r--r--pango/pango-layout.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/pango/pango-layout.h b/pango/pango-layout.h
index 02fef3b0..2a01055d 100644
--- a/pango/pango-layout.h
+++ b/pango/pango-layout.h
@@ -88,21 +88,27 @@ void pango_layout_get_log_attrs (PangoLayout *layout,
PangoLogAttr **attrs,
gint *n_attrs);
-void pango_layout_index_to_pos (PangoLayout *layout,
- int index,
- PangoRectangle *pos);
-void pango_layout_get_cursor_pos (PangoLayout *layout,
- int index,
- PangoRectangle *strong_pos,
- PangoRectangle *weak_pos);
-gboolean pango_layout_xy_to_index (PangoLayout *layout,
- int x,
- int y,
- int *index,
- gboolean *trailing);
-void pango_layout_get_extents (PangoLayout *layout,
- PangoRectangle *ink_rect,
- PangoRectangle *logical_rect);
+void pango_layout_index_to_pos (PangoLayout *layout,
+ int index,
+ PangoRectangle *pos);
+void pango_layout_get_cursor_pos (PangoLayout *layout,
+ int index,
+ PangoRectangle *strong_pos,
+ PangoRectangle *weak_pos);
+void pango_layout_move_cursor_visually (PangoLayout *layout,
+ int old_index,
+ int old_trailing,
+ int direction,
+ int *new_index,
+ int *new_trailing);
+gboolean pango_layout_xy_to_index (PangoLayout *layout,
+ int x,
+ int y,
+ int *index,
+ gboolean *trailing);
+void pango_layout_get_extents (PangoLayout *layout,
+ PangoRectangle *ink_rect,
+ PangoRectangle *logical_rect);
int pango_layout_get_line_count (PangoLayout *layout);
PangoLayoutLine *pango_layout_get_line (PangoLayout *layout,
@@ -111,7 +117,7 @@ GSList * pango_layout_get_lines (PangoLayout *layout);
void pango_layout_line_ref (PangoLayoutLine *line);
void pango_layout_line_unref (PangoLayoutLine *line);
-gboolean pango_layout_line_x_to_index (PangoLayoutLine *line,
+void pango_layout_line_x_to_index (PangoLayoutLine *line,
int x_pos,
int *index,
int *trailing);