Changeset 29824
- Timestamp:
- 01/27/08 16:04:31 (10 months ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 modified
-
ChangeLog (modified) (1 diff)
-
platform/gtk/RenderThemeGtk.cpp (modified) (3 diffs)
-
platform/gtk/gtk2drawing.c (modified) (80 diffs)
-
platform/gtk/gtkdrawing.h (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r29821 r29824 1 2008-01-27 Alp Toker <alp@atoker.com> 2 3 Reviewed by Mark Rowe. 4 5 http://bugs.webkit.org/show_bug.cgi?id=17029 6 Use of deprecated class function but declares GTK_DISABLE_DEPRECATED 7 8 Sync gtkdrawing.h (1.51) and gtk2drawing.c (1.71) from Mozilla 9 upstream. 10 11 Adapt RenderThemeGtk.cpp to track minor changes. 12 13 * platform/gtk/RenderThemeGtk.cpp: 14 (WebCore::gtkTextDirection): 15 (WebCore::adjustMozStyle): 16 (WebCore::setMozState): 17 (WebCore::paintMozWidget): 18 * platform/gtk/gtk2drawing.c: 19 (setup_widget_prototype): 20 (ensure_hpaned_widget): 21 (ensure_vpaned_widget): 22 (ensure_toggle_button_widget): 23 (ensure_combo_box_entry_widget): 24 (ensure_dropdown_entry_widget): 25 (moz_gtk_get_dropdown_button): 26 (ensure_arrow_widget): 27 (ensure_toolbar_separator_widget): 28 (ensure_statusbar_widget): 29 (ensure_frame_widget): 30 (ensure_menu_separator_widget): 31 (ensure_tree_view_widget): 32 (ensure_tree_header_cell_widget): 33 (ensure_expander_widget): 34 (ConvertGtkState): 35 (moz_gtk_button_paint): 36 (moz_gtk_widget_get_focus): 37 (moz_gtk_splitter_get_metrics): 38 (moz_gtk_toggle_paint): 39 (moz_gtk_scrollbar_button_paint): 40 (moz_gtk_scrollbar_trough_paint): 41 (moz_gtk_scrollbar_thumb_paint): 42 (moz_gtk_spin_paint): 43 (moz_gtk_spin_updown_paint): 44 (moz_gtk_scale_paint): 45 (moz_gtk_scale_thumb_paint): 46 (moz_gtk_gripper_paint): 47 (moz_gtk_hpaned_paint): 48 (moz_gtk_vpaned_paint): 49 (moz_gtk_entry_paint): 50 (moz_gtk_treeview_paint): 51 (moz_gtk_tree_header_cell_paint): 52 (moz_gtk_tree_header_sort_arrow_paint): 53 (moz_gtk_treeview_expander_paint): 54 (moz_gtk_expander_paint): 55 (moz_gtk_option_menu_paint): 56 (moz_gtk_downarrow_paint): 57 (moz_gtk_dropdown_arrow_paint): 58 (moz_gtk_container_paint): 59 (moz_gtk_toggle_label_paint): 60 (moz_gtk_toolbar_paint): 61 (moz_gtk_toolbar_separator_paint): 62 (moz_gtk_tooltip_paint): 63 (moz_gtk_resizer_paint): 64 (moz_gtk_frame_paint): 65 (moz_gtk_progressbar_paint): 66 (moz_gtk_progress_chunk_paint): 67 (moz_gtk_get_tab_thickness): 68 (moz_gtk_tab_paint): 69 (moz_gtk_tabpanels_paint): 70 (moz_gtk_menu_bar_paint): 71 (moz_gtk_menu_popup_paint): 72 (moz_gtk_menu_separator_paint): 73 (moz_gtk_menu_item_paint): 74 (moz_gtk_menu_arrow_paint): 75 (moz_gtk_check_menu_item_paint): 76 (moz_gtk_window_paint): 77 (moz_gtk_get_widget_border): 78 (moz_gtk_get_dropdown_arrow_size): 79 (moz_gtk_get_toolbar_separator_width): 80 (moz_gtk_get_expander_size): 81 (moz_gtk_get_treeview_expander_size): 82 (moz_gtk_get_menu_separator_height): 83 (moz_gtk_widget_paint): 84 (moz_gtk_shutdown): 85 * platform/gtk/gtkdrawing.h: 86 1 87 2008-01-27 Jan Michael Alonzo <jmalonzo@unpluggable.com> 2 88 -
trunk/WebCore/platform/gtk/RenderThemeGtk.cpp
r27905 r29824 80 80 } 81 81 82 static GtkTextDirection gtkTextDirection(TextDirection direction) 83 { 84 switch (direction) { 85 case RTL: 86 return GTK_TEXT_DIR_RTL; 87 case LTR: 88 return GTK_TEXT_DIR_LTR; 89 default: 90 return GTK_TEXT_DIR_NONE; 91 } 92 } 93 82 94 static void adjustMozStyle(RenderStyle* style, GtkThemeWidgetType type) 83 95 { 84 96 gint left, top, right, bottom; 97 GtkTextDirection direction = gtkTextDirection(style->direction()); 85 98 gboolean inhtml = true; 86 99 87 if (moz_gtk_get_widget_border(type, &left, &top, &right, &bottom, inhtml) != MOZ_GTK_SUCCESS)100 if (moz_gtk_get_widget_border(type, &left, &top, &right, &bottom, direction, inhtml) != MOZ_GTK_SUCCESS) 88 101 return; 89 102 … … 107 120 state->isDefault = false; 108 121 state->canDefault = false; 122 state->depressed = false; 109 123 } 110 124 … … 140 154 IntPoint pos = i.context->translatePoint(rect.location()); 141 155 GdkRectangle gdkRect = IntRect(pos.x(), pos.y(), rect.width(), rect.height()); 156 GtkTextDirection direction = gtkTextDirection(o->style()->direction()); 142 157 143 158 // FIXME: Pass the real clip region. 144 return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkRect, &mozState, flags ) != MOZ_GTK_SUCCESS;159 return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS; 145 160 } 146 161 -
trunk/WebCore/platform/gtk/gtk2drawing.c
r29672 r29824 57 57 static GtkWidget* gProtoWindow; 58 58 static GtkWidget* gButtonWidget; 59 static GtkWidget* gToggleButtonWidget; 59 60 static GtkWidget* gCheckboxWidget; 60 61 static GtkWidget* gRadiobuttonWidget; … … 67 68 static GtkWidget* gArrowWidget; 68 69 static GtkWidget* gOptionMenuWidget; 70 static GtkWidget* gComboBoxEntryWidget; 71 static GtkWidget* gDropdownEntryWidget; 69 72 static GtkWidget* gDropdownButtonWidget; 70 73 static GtkWidget* gHandleBoxWidget; 71 74 static GtkWidget* gToolbarWidget; 72 75 static GtkWidget* gFrameWidget; 76 static GtkWidget* gStatusbarWidget; 73 77 static GtkWidget* gProgressWidget; 74 78 static GtkWidget* gTabWidget; … … 79 83 static GtkWidget* gMenuItemWidget; 80 84 static GtkWidget* gCheckMenuItemWidget; 85 static GtkWidget* gTreeViewWidget; 86 static GtkWidget* gTreeHeaderCellWidget; 87 static GtkWidget* gTreeHeaderSortArrowWidget; 88 static GtkWidget* gExpanderWidget; 89 static GtkWidget* gToolbarSeparatorWidget; 90 static GtkWidget* gMenuSeparatorWidget; 91 static GtkWidget* gHPanedWidget; 92 static GtkWidget* gVPanedWidget; 81 93 82 94 static GtkShadowType gMenuBarShadowType; … … 110 122 ensure_window_widget(); 111 123 if (!protoLayout) { 112 protoLayout = gtk_ hbox_new(FALSE, 0);124 protoLayout = gtk_fixed_new(); 113 125 gtk_container_add(GTK_CONTAINER(gProtoWindow), protoLayout); 114 126 } … … 127 139 } 128 140 return MOZ_GTK_SUCCESS; 141 } 142 143 static gint 144 ensure_hpaned_widget() 145 { 146 if (!gHPanedWidget) { 147 gHPanedWidget = gtk_hpaned_new(); 148 setup_widget_prototype(gHPanedWidget); 149 } 150 return MOZ_GTK_SUCCESS; 151 } 152 153 static gint 154 ensure_vpaned_widget() 155 { 156 if (!gVPanedWidget) { 157 gVPanedWidget = gtk_vpaned_new(); 158 setup_widget_prototype(gVPanedWidget); 159 } 160 return MOZ_GTK_SUCCESS; 161 } 162 163 static gint 164 ensure_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; 129 173 } 130 174 … … 208 252 209 253 static gint 254 ensure_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 263 static gint 264 ensure_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 275 static void 276 moz_gtk_get_dropdown_button(GtkWidget *widget, 277 gpointer client_data) 278 { 279 if (GTK_IS_TOGGLE_BUTTON(widget)) 280 gDropdownButtonWidget = widget; 281 } 282 283 static gint 210 284 ensure_arrow_widget() 211 285 { 212 286 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 215 293 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); 217 296 gtk_widget_realize(gArrowWidget); 218 297 } … … 245 324 246 325 static gint 326 ensure_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 336 static gint 247 337 ensure_tooltip_widget() 248 338 { … … 275 365 276 366 static gint 367 ensure_statusbar_widget() 368 { 369 if (!gStatusbarWidget) { 370 gStatusbarWidget = gtk_statusbar_new(); 371 setup_widget_prototype(gStatusbarWidget); 372 } 373 return MOZ_GTK_SUCCESS; 374 } 375 376 static gint 277 377 ensure_frame_widget() 278 378 { 279 379 if (!gFrameWidget) { 380 ensure_statusbar_widget(); 280 381 gFrameWidget = gtk_frame_new(NULL); 281 setup_widget_prototype(gFrameWidget); 382 gtk_container_add(GTK_CONTAINER(gStatusbarWidget), gFrameWidget); 383 gtk_widget_realize(gFrameWidget); 282 384 } 283 385 return MOZ_GTK_SUCCESS; … … 336 438 337 439 static gint 440 ensure_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 452 static gint 338 453 ensure_check_menu_item_widget() 339 454 { … … 348 463 } 349 464 465 static gint 466 ensure_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 475 static gint 476 ensure_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 493 static gint 494 ensure_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 350 503 static GtkStateType 351 504 ConvertGtkState(GtkWidgetState* state) … … 353 506 if (state->disabled) 354 507 return GTK_STATE_INSENSITIVE; 508 else if (state->depressed) 509 return (state->inHover ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE); 355 510 else if (state->inHover) 356 511 return (state->active ? GTK_STATE_ACTIVE : GTK_STATE_PRELIGHT); … … 387 542 moz_gtk_button_paint(GdkDrawable* drawable, GdkRectangle* rect, 388 543 GdkRectangle* cliprect, GtkWidgetState* state, 389 GtkReliefStyle relief, GtkWidget* widget) 544 GtkReliefStyle relief, GtkWidget* widget, 545 GtkTextDirection direction) 390 546 { 391 547 GtkShadowType shadow_type; … … 397 553 gint focus_width, focus_pad; 398 554 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); 400 556 401 557 if (WINDOW_IS_MAPPED(drawable)) { … … 406 562 407 563 gtk_widget_set_state(widget, button_state); 564 gtk_widget_set_direction(widget, direction); 408 565 409 566 if (state->isDefault) … … 417 574 } 418 575 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)) { 423 587 TSOffsetStyleGCs(style, x, y); 424 588 /* the following line can trigger an assertion (Crux theme) … … 489 653 490 654 gint 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, 655 moz_gtk_widget_get_focus(GtkWidget* widget, gboolean* interior_focus, 656 gint* focus_width, gint* focus_pad) 657 { 658 gtk_widget_style_get (widget, 527 659 "interior-focus", interior_focus, 528 660 "focus-line-width", focus_width, … … 572 704 } 573 705 706 gint 707 moz_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 574 719 static gint 575 720 moz_gtk_toggle_paint(GdkDrawable* drawable, GdkRectangle* rect, 576 721 GdkRectangle* cliprect, GtkWidgetState* state, 577 gboolean selected, gboolean isradio) 722 gboolean selected, gboolean isradio, 723 GtkTextDirection direction) 578 724 { 579 725 GtkStateType state_type = ConvertGtkState(state); … … 602 748 603 749 gtk_widget_set_sensitive(w, !state->disabled); 750 gtk_widget_set_direction(w, direction); 604 751 GTK_TOGGLE_BUTTON(w)->active = selected; 605 752 … … 651 798 moz_gtk_scrollbar_button_paint(GdkDrawable* drawable, GdkRectangle* rect, 652 799 GdkRectangle* cliprect, GtkWidgetState* state, 653 GtkArrowType type) 800 GtkScrollbarButtonFlags flags, 801 GtkTextDirection direction) 654 802 { 655 803 GtkStateType state_type = ConvertGtkState(state); … … 659 807 GdkRectangle arrow_rect; 660 808 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"; 663 813 664 814 ensure_scrollbar_widget(); 665 815 666 if ( type < 2)667 scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget);816 if (flags & MOZ_GTK_STEPPER_VERTICAL) 817 scrollbar = gVertScrollbarWidget; 668 818 else 669 scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget); 819 scrollbar = gHorizScrollbarWidget; 820 821 gtk_widget_set_direction(scrollbar, direction); 670 822 671 823 /* Some theme engines (i.e., ClearLooks) check the scrollbar's allocation … … 673 825 We need to trick them into drawing the buttons the way we want them. */ 674 826 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 } 684 846 } 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; 691 862 692 863 ensure_arrow_widget(); … … 696 867 697 868 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); 702 871 703 872 arrow_rect.width = button_rect.width / 2; … … 708 877 709 878 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); 714 881 715 882 return MOZ_GTK_SUCCESS; … … 719 886 moz_gtk_scrollbar_trough_paint(GtkThemeWidgetType widget, 720 887 GdkDrawable* drawable, GdkRectangle* rect, 721 GdkRectangle* cliprect, GtkWidgetState* state) 888 GdkRectangle* cliprect, GtkWidgetState* state, 889 GtkTextDirection direction) 722 890 { 723 891 GtkStyle* style; … … 731 899 scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget); 732 900 901 gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction); 902 733 903 style = GTK_WIDGET(scrollbar)->style; 734 904 … … 754 924 moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget, 755 925 GdkDrawable* drawable, GdkRectangle* rect, 756 GdkRectangle* cliprect, GtkWidgetState* state) 926 GdkRectangle* cliprect, GtkWidgetState* state, 927 GtkTextDirection direction) 757 928 { 758 929 GtkStateType state_type = (state->inHover || state->active) ? … … 768 939 else 769 940 scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget); 941 942 gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction); 770 943 771 944 /* Make sure to set the scrollbar range before painting so that … … 812 985 813 986 static gint 814 moz_gtk_spin_paint(GdkDrawable* drawable, GdkRectangle* rect, gboolean isDown, 815 GtkWidgetState* state) 987 moz_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 1003 static gint 1004 moz_gtk_spin_updown_paint(GdkDrawable* drawable, GdkRectangle* rect, 1005 gboolean isDown, GtkWidgetState* state, 1006 GtkTextDirection direction) 816 1007 { 817 1008 GdkRectangle arrow_rect; 818 1009 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; 820 1012 GtkStyle* style; 821 1013 822 1014 ensure_spin_widget(); 823 1015 style = gSpinWidget->style; <