GNOME Bugzilla – Bug 118543
Dynamic bidi base direction for GtkTextView
Last modified: 2011-02-04 16:16:03 UTC
The base direction for GtkTextView should be based on the contents of the text view and the keyboard direction rather statically determined by gtk_widget_get_direction(). This requires changes in GtkTextBuffer to propagate the automatically determined direction. See bug 70451. [ Filing separate bugs for each widget, since I find bugs with lots of different things going on hard to work with ]
Changes from your version: -_gtk_text_btree_resolve_bidi() had if (last_strong == PANGO_DIRECTION_NEUTRAL) last_strong = PANGO_DIRECTION_NEUTRAL; which turned out to be completely unused - Fix references to wrong variables in _gtk_text_btree_resolve_bidi comments. - Fixed comment /* The last character to invalidate is the last line before the * line with the strong character. Or in case of the end of the should be is 'The last character...' - Make dir_strong/dir_propagated_back/dir_propagated_forward guchar to save 8 bytes per text-line. - Use instance-private-data to avoid changing the size of the GtkTextLayout structure. - Split gtk_text_layout_set_cursor_and_keyboard_direction into gtk_text_layout_set_cursor_direction and gtk_text_layout_set_cursor_direction - Indentation and cleanups
Created attachment 18768 [details] [review] Revised version of GtkText* patch
It seems to me that direction explicitely set on the GtkTextView using text tags should override the automatically determined direction; why would it be set if the application didn't know the property paragraph direction?
Applied the attached patch. Mon Mar 1 10:41:27 2004 Owen Taylor <otaylor@redhat.com> Patch from Dov Grobgeld to implement auto-bidi-direction for GtkTextView (#118543) * gtk/gtktextbtree.[ch]: Resolve bidi base direction for each line by propagating backwards/forwards as necessary. * gtk/gtktextlayout.[ch] gtk/gtktextview.c: Set the bidi base direction for the ;ine with the cursor from the keyboard direction. Add gtk_text_layout_set_keyboard_direction(). Filed bug 135836 about the question of explicit tags set by the application.