After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 118543 - Dynamic bidi base direction for GtkTextView
Dynamic bidi base direction for GtkTextView
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 70451
Blocks:
 
 
Reported: 2003-07-29 03:48 UTC by Owen Taylor
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Revised version of GtkText* patch (20.59 KB, patch)
2003-07-30 21:04 UTC, Owen Taylor
none Details | Review

Description Owen Taylor 2003-07-29 03:48:14 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 ]
Comment 1 Owen Taylor 2003-07-30 21:03:50 UTC
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
Comment 2 Owen Taylor 2003-07-30 21:04:16 UTC
Created attachment 18768 [details] [review]
Revised version of GtkText* patch
Comment 3 Owen Taylor 2003-07-30 21:07:23 UTC
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?
Comment 4 Owen Taylor 2004-03-01 16:05:03 UTC
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.