Show
Ignore:
Timestamp:
01/27/08 16:04:31 (10 months ago)
Author:
alp@webkit.org
Message:

2008-01-27 Alp Toker <alp@atoker.com>

Reviewed by Mark Rowe.

http://bugs.webkit.org/show_bug.cgi?id=17029
Use of deprecated class function but declares GTK_DISABLE_DEPRECATED

Sync gtkdrawing.h (1.51) and gtk2drawing.c (1.71) from Mozilla
upstream.

Adapt RenderThemeGtk.cpp to track minor changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/platform/gtk/gtk2drawing.c

    r29672 r29824  
    5757static GtkWidget* gProtoWindow; 
    5858static GtkWidget* gButtonWidget; 
     59static GtkWidget* gToggleButtonWidget; 
    5960static GtkWidget* gCheckboxWidget; 
    6061static GtkWidget* gRadiobuttonWidget; 
     
    6768static GtkWidget* gArrowWidget; 
    6869static GtkWidget* gOptionMenuWidget; 
     70static GtkWidget* gComboBoxEntryWidget; 
     71static GtkWidget* gDropdownEntryWidget; 
    6972static GtkWidget* gDropdownButtonWidget; 
    7073static GtkWidget* gHandleBoxWidget; 
    7174static GtkWidget* gToolbarWidget; 
    7275static GtkWidget* gFrameWidget; 
     76static GtkWidget* gStatusbarWidget; 
    7377static GtkWidget* gProgressWidget; 
    7478static GtkWidget* gTabWidget; 
     
    7983static GtkWidget* gMenuItemWidget; 
    8084static GtkWidget* gCheckMenuItemWidget; 
     85static GtkWidget* gTreeViewWidget; 
     86static GtkWidget* gTreeHeaderCellWidget; 
     87static GtkWidget* gTreeHeaderSortArrowWidget; 
     88static GtkWidget* gExpanderWidget; 
     89static GtkWidget* gToolbarSeparatorWidget; 
     90static GtkWidget* gMenuSeparatorWidget; 
     91static GtkWidget* gHPanedWidget; 
     92static GtkWidget* gVPanedWidget; 
    8193 
    8294static GtkShadowType gMenuBarShadowType; 
     
    110122    ensure_window_widget(); 
    111123    if (!protoLayout) { 
    112         protoLayout = gtk_hbox_new(FALSE, 0); 
     124        protoLayout = gtk_fixed_new(); 
    113125        gtk_container_add(GTK_CONTAINER(gProtoWindow), protoLayout); 
    114126    } 
     
    127139    } 
    128140    return MOZ_GTK_SUCCESS; 
     141} 
     142 
     143static gint 
     144ensure_hpaned_widget() 
     145{ 
     146    if (!gHPanedWidget) { 
     147        gHPanedWidget = gtk_hpaned_new(); 
     148        setup_widget_prototype(gHPanedWidget); 
     149    } 
     150    return MOZ_GTK_SUCCESS; 
     151} 
     152 
     153static gint 
     154ensure_vpaned_widget() 
     155{ 
     156    if (!gVPanedWidget) { 
     157        gVPanedWidget = gtk_vpaned_new(); 
     158        setup_widget_prototype(gVPanedWidget); 
     159    } 
     160    return MOZ_GTK_SUCCESS; 
     161} 
     162 
     163static gint 
     164ensure_toggle_button_widget() 
     165{ 
     166    if (!gToggleButtonWidget) { 
     167        gToggleButtonWidget = gtk_toggle_button_new(); 
     168        setup_widget_prototype(gToggleButtonWidget); 
     169        /* toggle button must be set active to get the right style on hover. */ 
     170        GTK_TOGGLE_BUTTON(gToggleButtonWidget)->active = TRUE; 
     171  } 
     172  return MOZ_GTK_SUCCESS; 
    129173} 
    130174 
     
    208252 
    209253static gint 
     254ensure_combo_box_entry_widget() 
     255{ 
     256    if (!gComboBoxEntryWidget) { 
     257        gComboBoxEntryWidget = gtk_combo_box_entry_new(); 
     258        setup_widget_prototype(gComboBoxEntryWidget); 
     259    } 
     260    return MOZ_GTK_SUCCESS; 
     261} 
     262 
     263static gint 
     264ensure_dropdown_entry_widget() 
     265{ 
     266    if (!gDropdownEntryWidget) { 
     267        ensure_combo_box_entry_widget(); 
     268 
     269        gDropdownEntryWidget = GTK_BIN(gComboBoxEntryWidget)->child; 
     270        gtk_widget_realize(gDropdownEntryWidget); 
     271    } 
     272    return MOZ_GTK_SUCCESS; 
     273} 
     274 
     275static void 
     276moz_gtk_get_dropdown_button(GtkWidget *widget, 
     277                            gpointer client_data) 
     278{ 
     279    if (GTK_IS_TOGGLE_BUTTON(widget)) 
     280        gDropdownButtonWidget = widget; 
     281} 
     282 
     283static gint 
    210284ensure_arrow_widget() 
    211285{ 
    212286    if (!gArrowWidget) { 
    213         gDropdownButtonWidget = gtk_button_new(); 
    214         setup_widget_prototype(gDropdownButtonWidget); 
     287        ensure_combo_box_entry_widget(); 
     288 
     289        gtk_container_forall(GTK_CONTAINER(gComboBoxEntryWidget), 
     290                             moz_gtk_get_dropdown_button, 
     291                             NULL); 
     292 
    215293        gArrowWidget = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT); 
    216         gtk_container_add(GTK_CONTAINER(gDropdownButtonWidget), gArrowWidget); 
     294        gtk_container_add(GTK_CONTAINER(GTK_BIN(gDropdownButtonWidget)->child), 
     295                          gArrowWidget); 
    217296        gtk_widget_realize(gArrowWidget); 
    218297    } 
     
    245324 
    246325static gint 
     326ensure_toolbar_separator_widget() 
     327{ 
     328    if (!gToolbarSeparatorWidget) { 
     329        ensure_toolbar_widget(); 
     330        gToolbarSeparatorWidget = GTK_WIDGET(gtk_separator_tool_item_new()); 
     331        setup_widget_prototype(gToolbarSeparatorWidget); 
     332    } 
     333    return MOZ_GTK_SUCCESS; 
     334} 
     335 
     336static gint 
    247337ensure_tooltip_widget() 
    248338{ 
     
    275365 
    276366static gint 
     367ensure_statusbar_widget() 
     368{ 
     369    if (!gStatusbarWidget) { 
     370      gStatusbarWidget = gtk_statusbar_new(); 
     371      setup_widget_prototype(gStatusbarWidget); 
     372    } 
     373    return MOZ_GTK_SUCCESS; 
     374} 
     375 
     376static gint 
    277377ensure_frame_widget() 
    278378{ 
    279379    if (!gFrameWidget) { 
     380        ensure_statusbar_widget(); 
    280381        gFrameWidget = gtk_frame_new(NULL); 
    281         setup_widget_prototype(gFrameWidget); 
     382        gtk_container_add(GTK_CONTAINER(gStatusbarWidget), gFrameWidget); 
     383        gtk_widget_realize(gFrameWidget); 
    282384    } 
    283385    return MOZ_GTK_SUCCESS; 
     
    336438 
    337439static gint 
     440ensure_menu_separator_widget() 
     441{ 
     442    if (!gMenuSeparatorWidget) { 
     443        ensure_menu_popup_widget(); 
     444        gMenuSeparatorWidget = gtk_separator_menu_item_new(); 
     445        gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget), 
     446                              gMenuSeparatorWidget); 
     447        gtk_widget_realize(gMenuSeparatorWidget); 
     448    } 
     449    return MOZ_GTK_SUCCESS; 
     450} 
     451 
     452static gint 
    338453ensure_check_menu_item_widget() 
    339454{ 
     
    348463} 
    349464 
     465static gint 
     466ensure_tree_view_widget() 
     467{ 
     468    if (!gTreeViewWidget) { 
     469        gTreeViewWidget = gtk_tree_view_new(); 
     470        setup_widget_prototype(gTreeViewWidget); 
     471    } 
     472    return MOZ_GTK_SUCCESS; 
     473} 
     474 
     475static gint 
     476ensure_tree_header_cell_widget() 
     477{ 
     478    if(!gTreeHeaderCellWidget) { 
     479        GtkTreeViewColumn* treeViewColumn; 
     480        ensure_tree_view_widget(); 
     481 
     482        treeViewColumn = gtk_tree_view_column_new(); 
     483        gtk_tree_view_column_set_title(treeViewColumn, "M"); 
     484 
     485        gtk_tree_view_append_column(GTK_TREE_VIEW(gTreeViewWidget), treeViewColumn); 
     486        gTreeHeaderCellWidget = treeViewColumn->button; 
     487        gtk_tree_view_column_set_sort_indicator(treeViewColumn, TRUE); 
     488        gTreeHeaderSortArrowWidget = treeViewColumn->arrow; 
     489    } 
     490    return MOZ_GTK_SUCCESS; 
     491} 
     492 
     493static gint 
     494ensure_expander_widget() 
     495{ 
     496    if (!gExpanderWidget) { 
     497        gExpanderWidget = gtk_expander_new("M"); 
     498        setup_widget_prototype(gExpanderWidget); 
     499    } 
     500    return MOZ_GTK_SUCCESS; 
     501} 
     502 
    350503static GtkStateType 
    351504ConvertGtkState(GtkWidgetState* state) 
     
    353506    if (state->disabled) 
    354507        return GTK_STATE_INSENSITIVE; 
     508    else if (state->depressed) 
     509        return (state->inHover ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE); 
    355510    else if (state->inHover) 
    356511        return (state->active ? GTK_STATE_ACTIVE : GTK_STATE_PRELIGHT); 
     
    387542moz_gtk_button_paint(GdkDrawable* drawable, GdkRectangle* rect, 
    388543                     GdkRectangle* cliprect, GtkWidgetState* state, 
    389                      GtkReliefStyle relief, GtkWidget* widget) 
     544                     GtkReliefStyle relief, GtkWidget* widget, 
     545                     GtkTextDirection direction) 
    390546{ 
    391547    GtkShadowType shadow_type; 
     
    397553    gint focus_width, focus_pad; 
    398554 
    399     moz_gtk_button_get_focus(&interior_focus, &focus_width, &focus_pad); 
     555    moz_gtk_widget_get_focus(widget, &interior_focus, &focus_width, &focus_pad); 
    400556 
    401557    if (WINDOW_IS_MAPPED(drawable)) { 
     
    406562 
    407563    gtk_widget_set_state(widget, button_state); 
     564    gtk_widget_set_direction(widget, direction); 
    408565 
    409566    if (state->isDefault) 
     
    417574    } 
    418575 
    419     shadow_type = button_state == GTK_STATE_ACTIVE ? GTK_SHADOW_IN : GTK_SHADOW_OUT; 
    420  
    421     if (relief != GTK_RELIEF_NONE || (button_state != GTK_STATE_NORMAL && 
    422                                       button_state != GTK_STATE_INSENSITIVE)) { 
     576    shadow_type = button_state == GTK_STATE_ACTIVE || 
     577                      state->depressed ? GTK_SHADOW_IN : GTK_SHADOW_OUT; 
     578  
     579    if (state->isDefault && GTK_BUTTON(widget)->relief == GTK_RELIEF_NORMAL) { 
     580        gtk_paint_box(style, drawable, button_state, shadow_type, cliprect, 
     581                      widget, "buttondefault", x, y, width, height);                    
     582    } 
     583  
     584    if (relief != GTK_RELIEF_NONE || state->depressed || 
     585           (button_state != GTK_STATE_NORMAL && 
     586            button_state != GTK_STATE_INSENSITIVE)) { 
    423587        TSOffsetStyleGCs(style, x, y); 
    424588        /* the following line can trigger an assertion (Crux theme) 
     
    489653 
    490654gint 
    491 moz_gtk_checkbox_get_focus(gboolean* interior_focus, 
    492                            gint* focus_width, gint* focus_pad) 
    493 { 
    494     ensure_checkbox_widget(); 
    495  
    496     gtk_widget_style_get (gCheckboxWidget, 
    497                           "interior-focus", interior_focus, 
    498                           "focus-line-width", focus_width, 
    499                           "focus-padding", focus_pad, 
    500                           NULL); 
    501  
    502     return MOZ_GTK_SUCCESS; 
    503 } 
    504  
    505 gint 
    506 moz_gtk_radio_get_focus(gboolean* interior_focus, 
    507                         gint* focus_width, gint* focus_pad) 
    508 { 
    509     ensure_radiobutton_widget(); 
    510  
    511     gtk_widget_style_get (gRadiobuttonWidget, 
    512                           "interior-focus", interior_focus, 
    513                           "focus-line-width", focus_width, 
    514                           "focus-padding", focus_pad, 
    515                           NULL); 
    516  
    517     return MOZ_GTK_SUCCESS; 
    518 } 
    519  
    520 gint 
    521 moz_gtk_button_get_focus(gboolean* interior_focus, 
    522                          gint* focus_width, gint* focus_pad) 
    523 { 
    524     ensure_button_widget(); 
    525  
    526     gtk_widget_style_get (gButtonWidget, 
     655moz_gtk_widget_get_focus(GtkWidget* widget, gboolean* interior_focus, 
     656                         gint* focus_width, gint* focus_pad)  
     657{ 
     658    gtk_widget_style_get (widget, 
    527659                          "interior-focus", interior_focus, 
    528660                          "focus-line-width", focus_width, 
     
    572704} 
    573705 
     706gint 
     707moz_gtk_splitter_get_metrics(gint orientation, gint* size) 
     708{ 
     709    if (orientation == GTK_ORIENTATION_HORIZONTAL) { 
     710        ensure_hpaned_widget(); 
     711        gtk_widget_style_get(gHPanedWidget, "handle_size", size, NULL); 
     712    } else { 
     713        ensure_vpaned_widget(); 
     714        gtk_widget_style_get(gVPanedWidget, "handle_size", size, NULL); 
     715    } 
     716    return MOZ_GTK_SUCCESS; 
     717} 
     718 
    574719static gint 
    575720moz_gtk_toggle_paint(GdkDrawable* drawable, GdkRectangle* rect, 
    576721                     GdkRectangle* cliprect, GtkWidgetState* state, 
    577                      gboolean selected, gboolean isradio) 
     722                     gboolean selected, gboolean isradio, 
     723                     GtkTextDirection direction) 
    578724{ 
    579725    GtkStateType state_type = ConvertGtkState(state); 
     
    602748 
    603749    gtk_widget_set_sensitive(w, !state->disabled); 
     750    gtk_widget_set_direction(w, direction); 
    604751    GTK_TOGGLE_BUTTON(w)->active = selected; 
    605752       
     
    651798moz_gtk_scrollbar_button_paint(GdkDrawable* drawable, GdkRectangle* rect, 
    652799                               GdkRectangle* cliprect, GtkWidgetState* state, 
    653                                GtkArrowType type) 
     800                               GtkScrollbarButtonFlags flags, 
     801                               GtkTextDirection direction) 
    654802{ 
    655803    GtkStateType state_type = ConvertGtkState(state); 
     
    659807    GdkRectangle arrow_rect; 
    660808    GtkStyle* style; 
    661     GtkAdjustment *adj; 
    662     GtkScrollbar *scrollbar; 
     809    GtkWidget *scrollbar; 
     810    GtkArrowType arrow_type; 
     811    const char* detail = (flags & MOZ_GTK_STEPPER_VERTICAL) ? 
     812                           "vscrollbar" : "hscrollbar"; 
    663813 
    664814    ensure_scrollbar_widget(); 
    665815 
    666     if (type < 2) 
    667         scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget); 
     816    if (flags & MOZ_GTK_STEPPER_VERTICAL) 
     817        scrollbar = gVertScrollbarWidget; 
    668818    else 
    669         scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget); 
     819        scrollbar = gHorizScrollbarWidget; 
     820 
     821    gtk_widget_set_direction(scrollbar, direction); 
    670822 
    671823    /* Some theme engines (i.e., ClearLooks) check the scrollbar's allocation 
     
    673825       We need to trick them into drawing the buttons the way we want them. */ 
    674826 
    675     GTK_WIDGET(scrollbar)->allocation.x = rect->x; 
    676     GTK_WIDGET(scrollbar)->allocation.y = rect->y; 
    677     GTK_WIDGET(scrollbar)->allocation.width = rect->width; 
    678     GTK_WIDGET(scrollbar)->allocation.height = rect->height; 
    679  
    680     if (type < 2) { 
    681         GTK_WIDGET(scrollbar)->allocation.height *= 3; 
    682         if (type == GTK_ARROW_DOWN) 
    683             GTK_WIDGET(scrollbar)->allocation.y -= 2 * rect->height; 
     827    scrollbar->allocation.x = rect->x; 
     828    scrollbar->allocation.y = rect->y; 
     829    scrollbar->allocation.width = rect->width; 
     830    scrollbar->allocation.height = rect->height; 
     831 
     832    if (flags & MOZ_GTK_STEPPER_VERTICAL) { 
     833        scrollbar->allocation.height *= 5; 
     834        if (flags & MOZ_GTK_STEPPER_DOWN) { 
     835            arrow_type = GTK_ARROW_DOWN; 
     836            if (flags & MOZ_GTK_STEPPER_BOTTOM) 
     837                scrollbar->allocation.y -= 4 * rect->height; 
     838            else 
     839                scrollbar->allocation.y -= rect->height; 
     840 
     841        } else { 
     842            arrow_type = GTK_ARROW_UP; 
     843            if (flags & MOZ_GTK_STEPPER_BOTTOM) 
     844                scrollbar->allocation.y -= 3 * rect->height; 
     845        } 
    684846    } else { 
    685         GTK_WIDGET(scrollbar)->allocation.width *= 3; 
    686         if (type == GTK_ARROW_RIGHT) 
    687             GTK_WIDGET(scrollbar)->allocation.x -= 2 * rect->width; 
    688     } 
    689  
    690     style = GTK_WIDGET(scrollbar)->style; 
     847        scrollbar->allocation.width *= 5; 
     848        if (flags & MOZ_GTK_STEPPER_DOWN) { 
     849            arrow_type = GTK_ARROW_RIGHT; 
     850            if (flags & MOZ_GTK_STEPPER_BOTTOM) 
     851                scrollbar->allocation.x -= 4 * rect->width; 
     852            else 
     853                scrollbar->allocation.x -= rect->width; 
     854        } else { 
     855            arrow_type = GTK_ARROW_LEFT; 
     856            if (flags & MOZ_GTK_STEPPER_BOTTOM) 
     857                scrollbar->allocation.x -= 3 * rect->width; 
     858        } 
     859    } 
     860 
     861    style = scrollbar->style; 
    691862 
    692863    ensure_arrow_widget(); 
     
    696867 
    697868    gtk_paint_box(style, drawable, state_type, shadow_type, cliprect, 
    698                   GTK_WIDGET(scrollbar), 
    699                   (type < 2) ? "vscrollbar" : "hscrollbar", 
    700                   button_rect.x, button_rect.y, button_rect.width, 
    701                   button_rect.height); 
     869                  scrollbar, detail, button_rect.x, button_rect.y, 
     870                  button_rect.width, button_rect.height); 
    702871 
    703872    arrow_rect.width = button_rect.width / 2; 
     
    708877 
    709878    gtk_paint_arrow(style, drawable, state_type, shadow_type, cliprect, 
    710                     GTK_WIDGET(scrollbar), (type < 2) ? 
    711                     "vscrollbar" : "hscrollbar",  
    712                     type, TRUE, arrow_rect.x, arrow_rect.y, arrow_rect.width, 
    713                     arrow_rect.height); 
     879                    scrollbar, detail, arrow_type, TRUE, arrow_rect.x, 
     880                    arrow_rect.y, arrow_rect.width, arrow_rect.height); 
    714881 
    715882    return MOZ_GTK_SUCCESS; 
     
    719886moz_gtk_scrollbar_trough_paint(GtkThemeWidgetType widget, 
    720887                               GdkDrawable* drawable, GdkRectangle* rect, 
    721                                GdkRectangle* cliprect, GtkWidgetState* state) 
     888                               GdkRectangle* cliprect, GtkWidgetState* state, 
     889                               GtkTextDirection direction) 
    722890{ 
    723891    GtkStyle* style; 
     
    731899        scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget); 
    732900 
     901    gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction); 
     902 
    733903    style = GTK_WIDGET(scrollbar)->style; 
    734904 
     
    754924moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget, 
    755925                              GdkDrawable* drawable, GdkRectangle* rect, 
    756                               GdkRectangle* cliprect, GtkWidgetState* state) 
     926                              GdkRectangle* cliprect, GtkWidgetState* state, 
     927                              GtkTextDirection direction) 
    757928{ 
    758929    GtkStateType state_type = (state->inHover || state->active) ? 
     
    768939    else 
    769940        scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget); 
     941 
     942    gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction); 
    770943 
    771944    /* Make sure to set the scrollbar range before painting so that 
     
    812985 
    813986static gint 
    814 moz_gtk_spin_paint(GdkDrawable* drawable, GdkRectangle* rect, gboolean isDown, 
    815                    GtkWidgetState* state) 
     987moz_gtk_spin_paint(GdkDrawable* drawable, GdkRectangle* rect, 
     988                   GtkTextDirection direction) 
     989{ 
     990    GtkStyle* style; 
     991 
     992    ensure_spin_widget(); 
     993    gtk_widget_set_direction(gSpinWidget, direction); 
     994    style = gSpinWidget->style; 
     995 
     996    TSOffsetStyleGCs(style, rect->x, rect->y); 
     997    gtk_paint_box(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, NULL, 
     998                  gSpinWidget, "spinbutton", 
     999                  rect->x, rect->y, rect->width, rect->height); 
     1000    return MOZ_GTK_SUCCESS; 
     1001} 
     1002 
     1003static gint 
     1004moz_gtk_spin_updown_paint(GdkDrawable* drawable, GdkRectangle* rect, 
     1005                          gboolean isDown, GtkWidgetState* state, 
     1006                          GtkTextDirection direction) 
    8161007{ 
    8171008    GdkRectangle arrow_rect; 
    8181009    GtkStateType state_type = ConvertGtkState(state); 
    819     GtkShadowType shadow_type = state_type == GTK_STATE_ACTIVE ? GTK_SHADOW_IN : GTK_SHADOW_OUT; 
     1010    GtkShadowType shadow_type = state_type == GTK_STATE_ACTIVE ? 
     1011                                  GTK_SHADOW_IN : GTK_SHADOW_OUT; 
    8201012    GtkStyle* style; 
    8211013 
    8221014    ensure_spin_widget(); 
    8231015    style = gSpinWidget->style; 
     1016    gtk_widget_set_direction(gSpinWidget, direction); 
    8241017 
    8251018    TSOffsetStyleGCs(style, rect->x, rect->y); 
     
    8471040moz_gtk_scale_paint(GdkDrawable* drawable, GdkRectangle* rect, 
    8481041                    GdkRectangle* cliprect, GtkWidgetState* state, 
    849                     GtkOrientation flags) 
     1042                    GtkOrientation flags, GtkTextDirection direction) 
    8501043{ 
    8511044  gint x = 0, y = 0; 
     
    8561049  ensure_scale_widget(); 
    8571050  widget = ((flags == GTK_ORIENTATION_HORIZONTAL) ? gHScaleWidget : gVScaleWidget); 
     1051  gtk_widget_set_direction(widget, direction); 
     1052 
    8581053  style = widget->style; 
    8591054 
     
    8861081moz_gtk_scale_thumb_paint(GdkDrawable* drawable, GdkRectangle* rect, 
    8871082                          GdkRectangle* cliprect, GtkWidgetState* state, 
    888                           GtkOrientation flags) 
     1083                          GtkOrientation flags, GtkTextDirection direction) 
    8891084{ 
    8901085  GtkStateType state_type = ConvertGtkState(state); 
     
    8951090  ensure_scale_widget(); 
    8961091  widget = ((flags == GTK_ORIENTATION_HORIZONTAL) ? gHScaleWidget : gVScaleWidget); 
     1092  gtk_widget_set_direction(widget, direction); 
     1093 
    8971094  style = widget->style; 
    8981095 
     
    9191116static gint 
    9201117moz_gtk_gripper_paint(GdkDrawable* drawable, GdkRectangle* rect, 
    921                       GdkRectangle* cliprect, GtkWidgetState* state) 
     1118                      GdkRectangle* cliprect, GtkWidgetState* state, 
     1119                      GtkTextDirection direction) 
    9221120{ 
    9231121    GtkStateType state_type = ConvertGtkState(state); 
     
    9261124 
    9271125    ensure_handlebox_widget(); 
     1126    gtk_widget_set_direction(gHandleBoxWidget, direction); 
     1127 
    9281128    style = gHandleBoxWidget->style; 
    9291129    shadow_type = GTK_HANDLE_BOX(gHandleBoxWidget)->shadow_type; 
     
    9381138 
    9391139static gint 
     1140moz_gtk_hpaned_paint(GdkDrawable* drawable, GdkRectangle* rect, 
     1141                     GdkRectangle* cliprect, GtkWidgetState* state) 
     1142{ 
     1143    GtkStateType hpaned_state = ConvertGtkState(state); 
     1144 
     1145    ensure_hpaned_widget(); 
     1146    gtk_paint_handle(gHPanedWidget->style, drawable, hpaned_state, 
     1147                     GTK_SHADOW_NONE, cliprect, gHPanedWidget, "paned", 
     1148                     rect->x, rect->y, rect->width, rect->height, 
     1149                     GTK_ORIENTATION_VERTICAL); 
     1150 
     1151    return MOZ_GTK_SUCCESS; 
     1152} 
     1153 
     1154static gint 
     1155moz_gtk_vpaned_paint(GdkDrawable* drawable, GdkRectangle* rect, 
     1156                     GdkRectangle* cliprect, GtkWidgetState* state) 
     1157{ 
     1158    GtkStateType vpaned_state = ConvertGtkState(state); 
     1159 
     1160    ensure_vpaned_widget(); 
     1161    gtk_paint_handle(gVPanedWidget->style, drawable, vpaned_state, 
     1162                     GTK_SHADOW_NONE, cliprect, gVPanedWidget, "paned", 
     1163                     rect->x, rect->y, rect->width, rect->height, 
     1164                     GTK_ORIENTATION_HORIZONTAL); 
     1165 
     1166    return MOZ_GTK_SUCCESS; 
     1167} 
     1168 
     1169static gint 
    9401170moz_gtk_entry_paint(GdkDrawable* drawable, GdkRectangle* rect, 
    941                     GdkRectangle* cliprect, GtkWidgetState* state) 
     1171                    GdkRectangle* cliprect, GtkWidgetState* state, 
     1172                    GtkWidget* widget, GtkTextDirection direction) 
    9421173{ 
    9431174    gint x, y, width = rect->width, height = rect->height; 
     
    9461177    gint focus_width; 
    9471178 
    948     ensure_entry_widget(); 
    949     style = gEntryWidget->style; 
     1179    gtk_widget_set_direction(widget, direction); 
     1180 
     1181    style = widget->style; 
    9501182 
    9511183    /* paint the background first */ 
     
    9541186 
    9551187    /* This gets us a lovely greyish disabledish look */ 
    956     gtk_widget_set_sensitive(gEntryWidget, !state->disabled); 
     1188    gtk_widget_set_sensitive(widget, !state->disabled); 
    9571189 
    9581190    TSOffsetStyleGCs(style, rect->x + x, rect->y + y); 
    9591191    gtk_paint_flat_box(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, 
    960                        cliprect, gEntryWidget, "entry_bg",  rect->x + x, 
     1192                       cliprect, widget, "entry_bg",  rect->x + x, 
    9611193                       rect->y + y, rect->width - 2*x, rect->height - 2*y); 
    9621194 
    963     gtk_widget_style_get(gEntryWidget, 
     1195    gtk_widget_style_get(widget, 
    9641196                         "interior-focus", &interior_focus, 
    9651197                         "focus-line-width", &focus_width, 
     
    9821214    if (state->focused && !state->disabled) { 
    9831215         /* This will get us the lit borders that focused textboxes enjoy on some themes. */ 
    984         GTK_WIDGET_SET_FLAGS(gEntryWidget, GTK_HAS_FOCUS); 
     1216        GTK_WIDGET_SET_FLAGS(widget, GTK_HAS_FOCUS); 
    9851217 
    9861218        if (!interior_focus) {