mozilla-gtk3_20.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Sun, 24 Apr 2016 08:20:10 +0200
branchfirefox45
changeset 908 b29b47737173
parent 907 3ccb278a9ceb
child 909 c6717354928b
permissions -rw-r--r--
sync from mozilla:Factory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
     1
diff -up firefox-45.0.2/widget/gtk/gtk3drawing.c.gtk3-20 firefox-45.0.2/widget/gtk/gtk3drawing.c
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
     2
--- firefox-45.0.2/widget/gtk/gtk3drawing.c.gtk3-20	2016-04-08 01:55:04.000000000 +0200
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
     3
+++ firefox-45.0.2/widget/gtk/gtk3drawing.c	2016-04-20 18:49:52.897795872 +0200
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
     4
@@ -17,32 +17,79 @@
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     6
 #include <math.h>
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     7
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
+#define MOZ_WIDGET_STYLES 4
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     9
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    10
+typedef struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    11
+    GtkWidget*            widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    12
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    13
+    union {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    14
+        struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
+            GtkStyleContext*  style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
+            GtkStyleContext*  styleSelection;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
+        } entry;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
+        struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
+            GtkStyleContext*  style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
+        } button;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
+        struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
+            GtkStyleContext*  style;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
    25
+            GtkStyleContext*  styleContents;
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
+            GtkStyleContext*  styleTrough;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    27
+            GtkStyleContext*  styleSlider;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    28
+        } scroll;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    29
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    30
+        struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    31
+            GtkStyleContext*  style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    32
+            GtkStyleContext*  styleCheck;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    33
+            GtkStyleContext*  styleLabel;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    34
+        } check;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    35
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    36
+        struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    37
+            GtkStyleContext*  style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    38
+            GtkStyleContext*  styleTrough;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    39
+            GtkStyleContext*  styleProgress;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    40
+        } progress;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    41
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    42
+        struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    43
+            GtkStyleContext*  style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    44
+            GtkStyleContext*  styleEntry;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    45
+            GtkStyleContext*  styleButtonUp;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    46
+            GtkStyleContext*  styleButtonDown;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    47
+        } spin;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    48
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    49
+        struct {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
+            GtkStyleContext*  style[MOZ_WIDGET_STYLES];
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    51
+        } all;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    52
+    };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    53
+} MozGtkWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    54
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    55
 static GtkWidget* gProtoWindow;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    56
 static GtkWidget* gProtoLayout;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    57
-static GtkWidget* gButtonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    58
+static MozGtkWidget gButton;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    59
 static GtkWidget* gToggleButtonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    60
 static GtkWidget* gButtonArrowWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    61
-static GtkWidget* gCheckboxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    62
-static GtkWidget* gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    63
-static GtkWidget* gHorizScrollbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    64
-static GtkWidget* gVertScrollbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    65
-static GtkWidget* gSpinWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    66
+static MozGtkWidget gCheckbox;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    67
+static MozGtkWidget gRadiobutton;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    68
+static MozGtkWidget gVertScrollbar;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    69
+static MozGtkWidget gHorizScrollbar;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    70
+static MozGtkWidget gSpin;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    71
 static GtkWidget* gHScaleWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    72
 static GtkWidget* gVScaleWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    73
-static GtkWidget* gEntryWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    74
+static MozGtkWidget gEntry;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    75
 static GtkWidget* gComboBoxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    76
 static GtkWidget* gComboBoxButtonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    77
 static GtkWidget* gComboBoxArrowWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    78
 static GtkWidget* gComboBoxSeparatorWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    79
 static GtkWidget* gComboBoxEntryWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    80
-static GtkWidget* gComboBoxEntryTextareaWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    81
+static MozGtkWidget gComboBoxEntryTextarea;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    82
 static GtkWidget* gComboBoxEntryButtonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    83
 static GtkWidget* gComboBoxEntryArrowWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    84
 static GtkWidget* gHandleBoxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    85
 static GtkWidget* gToolbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    86
 static GtkWidget* gFrameWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    87
 static GtkWidget* gStatusbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    88
-static GtkWidget* gProgressWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    89
+static MozGtkWidget gProgressBar;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    90
 static GtkWidget* gTabWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    91
 static GtkWidget* gTooltipWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    92
 static GtkWidget* gMenuBarWidget;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
    93
@@ -78,6 +125,37 @@ static gboolean is_initialized;
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    94
 #define GTK_STATE_FLAG_CHECKED (1 << 11)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    95
 #endif
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    96
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    97
+void moz_gtk_widget_free(MozGtkWidget *aMozWidget)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    98
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    99
+    // This was removed as a child of gProtoWindow
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   100
+    if (aMozWidget->widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   101
+        aMozWidget->widget = NULL;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   102
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   103
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   104
+    for(int i = 0; i < MOZ_WIDGET_STYLES; i++) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   105
+        if (aMozWidget->all.style[i]) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   106
+            g_object_unref(aMozWidget->all.style[i]);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   107
+            aMozWidget->all.style[i] = NULL;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   108
+        }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   109
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   110
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   111
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   112
+// TODO - weak dep!! (dlsym)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   113
+#if GTK_CHECK_VERSION(3, 19, 2)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   114
+#define moz_gtk_path_set_class_name    gtk_widget_path_iter_set_object_name
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   115
+#else
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   116
+#define moz_gtk_path_set_class_name    gtk_widget_path_iter_add_class
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   117
+#endif
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   118
+//gtk_widget_path_iter_get_state
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   119
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   120
+static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   121
+moz_gtk_get_style_border(GtkStyleContext* style, GtkStateFlags state_flags,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   122
+                         GtkBorder *border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   123
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   124
+static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   125
+moz_gtk_get_style_padding(GtkStyleContext* style, GtkStateFlags state_flags,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   126
+                          GtkBorder *padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   127
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   128
 static GtkStateFlags
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   129
 GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   130
 {
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   131
@@ -97,6 +175,41 @@ GetStateFlagsFromGtkWidgetState(GtkWidge
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   132
     return stateFlags;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   133
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   134
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   135
+GtkStyleContext *
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   136
+moz_gtk_style_create(GtkCssNode *node, GtkStyleContext *parent)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   137
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   138
+  GtkWidgetPath *path;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   139
+  GtkStyleContext *context;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   140
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   141
+  if (parent)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   142
+    path = gtk_widget_path_copy (gtk_style_context_get_path (parent));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   143
+  else
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   144
+    path = gtk_widget_path_new ();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   145
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   146
+  gtk_widget_path_append_type (path, node->type);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   147
+  if (node->name)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   148
+    moz_gtk_path_set_class_name(path, -1, node->name);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   149
+  if (node->class1)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   150
+    gtk_widget_path_iter_add_class(path, -1, node->class1);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   151
+  if (node->class2)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   152
+    gtk_widget_path_iter_add_class(path, -1, node->class2);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   153
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   154
+  context = gtk_style_context_new ();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   155
+  gtk_style_context_set_path (context, path);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   156
+  gtk_style_context_set_parent (context, parent);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   157
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   158
+  if(!gtk_check_version(3, 14, 0)) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   159
+      /* Unfortunately, we have to explicitly set the state again here
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   160
+       * for it to take effect
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   161
+       */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   162
+      gtk_style_context_set_state (context, gtk_widget_path_iter_get_state (path, -1));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   163
+  }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   164
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   165
+  gtk_widget_path_unref (path);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   166
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   167
+  return context;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   168
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   169
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   170
 /* Because we have such an unconventional way of drawing widgets, signal to the GTK theme engine
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   171
    that they are drawing for Mozilla instead of a conventional GTK app so they can do any specific
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   172
    things they may want to do. */
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   173
@@ -141,9 +254,16 @@ setup_widget_prototype(GtkWidget* widget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   174
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   175
 ensure_button_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   176
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   177
-    if (!gButtonWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   178
-        gButtonWidget = gtk_button_new_with_label("M");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   179
-        setup_widget_prototype(gButtonWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   180
+    if (!gButton.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   181
+        GtkCssNode path[] = { 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   182
+            { GTK_TYPE_BUTTON, "button", NULL, NULL }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   183
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   184
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   185
+        gButton.widget = gtk_button_new_with_label("M");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   186
+        setup_widget_prototype(gButton.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   187
+        gtk_widget_show(gButton.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   188
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   189
+        gButton.button.style = moz_gtk_style_create(&path[0], NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   190
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   191
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   192
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   193
@@ -195,9 +315,21 @@ ensure_button_arrow_widget()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   194
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   195
 ensure_checkbox_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   196
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   197
-    if (!gCheckboxWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   198
-        gCheckboxWidget = gtk_check_button_new_with_label("M");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   199
-        setup_widget_prototype(gCheckboxWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   200
+   if (!gCheckbox.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   201
+        GtkCssNode path[] = {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   202
+           { GTK_TYPE_TOGGLE_BUTTON, "checkbutton", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   203
+           { G_TYPE_NONE, "check", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   204
+           { G_TYPE_NONE, "label", NULL, NULL }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   205
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   206
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   207
+        gCheckbox.widget = gtk_check_button_new_with_label("M");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   208
+        setup_widget_prototype(gCheckbox.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   209
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   210
+        gCheckbox.check.style = moz_gtk_style_create(&path[0], NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   211
+        gCheckbox.check.styleCheck = moz_gtk_style_create(&path[1],
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   212
+                                       gCheckbox.check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   213
+        gCheckbox.check.styleLabel = moz_gtk_style_create(&path[2],
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   214
+                                       gCheckbox.check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   215
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   216
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   217
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   218
@@ -205,9 +337,21 @@ ensure_checkbox_widget()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   219
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   220
 ensure_radiobutton_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   221
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   222
-    if (!gRadiobuttonWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   223
-        gRadiobuttonWidget = gtk_radio_button_new_with_label(NULL, "M");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   224
-        setup_widget_prototype(gRadiobuttonWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   225
+    if (!gRadiobutton.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   226
+        GtkCssNode path[] = {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   227
+           { GTK_TYPE_TOGGLE_BUTTON, "radiobutton", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   228
+           { G_TYPE_NONE, "radio", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   229
+           { G_TYPE_NONE, "label", NULL, NULL }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   230
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   231
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   232
+        gRadiobutton.widget = gtk_radio_button_new_with_label(NULL, "M");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   233
+        setup_widget_prototype(gRadiobutton.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   234
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   235
+        gRadiobutton.check.style = moz_gtk_style_create(&path[0], NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   236
+        gRadiobutton.check.styleCheck = moz_gtk_style_create(&path[1],
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   237
+                                          gRadiobutton.check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   238
+        gRadiobutton.check.styleLabel = moz_gtk_style_create(&path[2],
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   239
+                                          gRadiobutton.check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   240
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   241
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   242
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   243
@@ -215,25 +359,62 @@ ensure_radiobutton_widget()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   244
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   245
 ensure_scrollbar_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   246
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   247
-    if (!gVertScrollbarWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   248
-        gVertScrollbarWidget = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   249
-        setup_widget_prototype(gVertScrollbarWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   250
-    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   251
-    if (!gHorizScrollbarWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   252
-        gHorizScrollbarWidget = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   253
-        setup_widget_prototype(gHorizScrollbarWidget);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   254
-    }
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   255
+    if (!gVertScrollbar.widget && !gHorizScrollbar.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   256
+        GtkCssNode path[] = {
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   257
+            { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", "bottom"},
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   258
+            { GTK_TYPE_SCROLLBAR, "scrollbar", "vertical", "right" },
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   259
+            { G_TYPE_NONE, "contents", NULL, NULL },
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   260
+            { G_TYPE_NONE, "trough", NULL, NULL },
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   261
+            { G_TYPE_NONE, "slider", NULL, NULL }
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   262
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   263
+
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   264
+        gHorizScrollbar.widget = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL);
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   265
+        setup_widget_prototype(gHorizScrollbar.widget);
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   266
+
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   267
+        gHorizScrollbar.scroll.style = moz_gtk_style_create(path, NULL);
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   268
+        gHorizScrollbar.scroll.styleContents = moz_gtk_style_create(path+2, 
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   269
+                                               gHorizScrollbar.scroll.style);
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   270
+        gHorizScrollbar.scroll.styleTrough = moz_gtk_style_create(path+3, 
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   271
+                                               gHorizScrollbar.scroll.styleContents);
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   272
+        gHorizScrollbar.scroll.styleSlider = moz_gtk_style_create(path+4, 
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   273
+                                               gHorizScrollbar.scroll.styleTrough);
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   274
+
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   275
+        gVertScrollbar.widget = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   276
+        setup_widget_prototype(gVertScrollbar.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   277
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   278
+        gVertScrollbar.scroll.style = moz_gtk_style_create(path+1, NULL);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   279
+        gVertScrollbar.scroll.styleContents = moz_gtk_style_create(path+2, 
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   280
+                                              gVertScrollbar.scroll.style);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   281
+        gVertScrollbar.scroll.styleTrough = moz_gtk_style_create(path+3, 
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   282
+                                              gVertScrollbar.scroll.styleContents);
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   283
+        gVertScrollbar.scroll.styleSlider = moz_gtk_style_create(path+4, 
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   284
+                                              gVertScrollbar.scroll.styleTrough);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   285
+
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   286
+     }
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   287
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   288
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   289
 
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   290
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   291
 ensure_spin_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   292
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   293
-  if (!gSpinWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   294
-    gSpinWidget = gtk_spin_button_new(NULL, 1, 0);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   295
-    setup_widget_prototype(gSpinWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   296
-  }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   297
-  return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   298
+    if (!gSpin.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   299
+        GtkCssNode path[] = {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   300
+            { GTK_TYPE_SPIN_BUTTON, "spinbutton", "horizontal", NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   301
+            { GTK_TYPE_SPIN_BUTTON, "spinbutton", "vertical", NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   302
+            { GTK_TYPE_ENTRY, "entry", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   303
+            { G_TYPE_NONE, "button", "up", NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   304
+            { G_TYPE_NONE, "button", "down", NULL }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   305
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   306
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   307
+        gSpin.widget = gtk_spin_button_new(NULL, 1, 0);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   308
+        setup_widget_prototype(gSpin.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   309
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   310
+        gSpin.spin.style = moz_gtk_style_create(path, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   311
+        gSpin.spin.styleButtonUp = moz_gtk_style_create(path+3, gSpin.spin.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   312
+        gSpin.spin.styleButtonDown = moz_gtk_style_create(path+4, gSpin.spin.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   313
+        gSpin.spin.styleEntry = moz_gtk_style_create(path+2, gSpin.spin.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   314
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   315
+    return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   316
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   317
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   318
 static gint
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   319
@@ -253,9 +434,19 @@ ensure_scale_widget()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   320
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   321
 ensure_entry_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   322
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   323
-    if (!gEntryWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   324
-        gEntryWidget = gtk_entry_new();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   325
-        setup_widget_prototype(gEntryWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   326
+    if (!gEntry.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   327
+        GtkCssNode path[] = { 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   328
+            { GTK_TYPE_ENTRY, "entry", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   329
+            { G_TYPE_NONE, "selection", NULL, NULL }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   330
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   331
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   332
+        gEntry.widget = gtk_entry_new();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   333
+        setup_widget_prototype(gEntry.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   334
+        gtk_widget_show(gEntry.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   335
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   336
+        gEntry.entry.style = moz_gtk_style_create(&path[0], NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   337
+        gEntry.entry.styleSelection = moz_gtk_style_create(&path[1], 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   338
+                                                           gEntry.entry.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   339
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   340
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   341
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   342
@@ -387,9 +578,9 @@ moz_gtk_get_combo_box_entry_inner_widget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   343
         g_object_add_weak_pointer(G_OBJECT(widget),
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   344
                                   (gpointer) &gComboBoxEntryButtonWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   345
     } else if (GTK_IS_ENTRY(widget)) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   346
-        gComboBoxEntryTextareaWidget = widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   347
+        gComboBoxEntryTextarea.widget = widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   348
         g_object_add_weak_pointer(G_OBJECT(widget),
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   349
-                                  (gpointer) &gComboBoxEntryTextareaWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   350
+                                  (gpointer) &gComboBoxEntryTextarea.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   351
     } else
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   352
         return;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   353
     gtk_widget_realize(widget);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   354
@@ -411,7 +602,7 @@ ensure_combo_box_entry_widgets()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   355
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   356
     GtkWidget* buttonChild;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   357
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   358
-    if (gComboBoxEntryTextareaWidget &&
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   359
+    if (gComboBoxEntryTextarea.widget &&
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   360
             gComboBoxEntryButtonWidget &&
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   361
             gComboBoxEntryArrowWidget)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   362
         return MOZ_GTK_SUCCESS;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   363
@@ -427,9 +618,9 @@ ensure_combo_box_entry_widgets()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   364
                          moz_gtk_get_combo_box_entry_inner_widgets,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   365
                          NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   366
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   367
-    if (!gComboBoxEntryTextareaWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   368
+    if (!gComboBoxEntryTextarea.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   369
         ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   370
-        gComboBoxEntryTextareaWidget = gEntryWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   371
+        gComboBoxEntryTextarea.widget = gEntry.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   372
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   373
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   374
     if (gComboBoxEntryButtonWidget) {
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   375
@@ -528,9 +719,21 @@ ensure_tab_widget()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   376
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   377
 ensure_progress_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   378
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   379
-    if (!gProgressWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   380
-        gProgressWidget = gtk_progress_bar_new();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   381
-        setup_widget_prototype(gProgressWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   382
+    if (!gProgressBar.widget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   383
+        GtkCssNode path[] = {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   384
+           { GTK_TYPE_LABEL, "progressbar", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   385
+           { G_TYPE_NONE, "trough", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   386
+           { G_TYPE_NONE, "progress", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   387
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   388
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   389
+        gProgressBar.widget = gtk_progress_bar_new();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   390
+        setup_widget_prototype(gProgressBar.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   391
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   392
+        gProgressBar.progress.style = moz_gtk_style_create(&path[0], NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   393
+        gProgressBar.progress.styleTrough = moz_gtk_style_create(&path[1],
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   394
+                                              gProgressBar.progress.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   395
+        gProgressBar.progress.styleProgress = moz_gtk_style_create(&path[2],
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   396
+                                                gProgressBar.progress.styleTrough);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   397
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   398
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   399
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   400
@@ -636,6 +839,11 @@ static gint
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   401
 ensure_check_menu_item_widget()
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   402
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   403
     if (!gCheckMenuItemWidget) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   404
+        GtkCssNode path[] = {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   405
+           { GTK_TYPE_CHECK_MENU_ITEM, "menuitem", NULL, NULL },
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   406
+           { G_TYPE_NONE, "check", NULL, NULL }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   407
+        };
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   408
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   409
         ensure_menu_popup_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   410
         gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   411
         gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget),
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   412
@@ -757,7 +965,7 @@ moz_gtk_checkbox_get_metrics(gint* indic
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   413
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   414
     ensure_checkbox_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   415
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   416
-    gtk_widget_style_get (gCheckboxWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   417
+    gtk_widget_style_get (gCheckbox.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   418
                           "indicator_size", indicator_size,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   419
                           "indicator_spacing", indicator_spacing,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   420
                           NULL);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   421
@@ -770,7 +978,7 @@ moz_gtk_radio_get_metrics(gint* indicato
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   422
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   423
     ensure_radiobutton_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   424
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   425
-    gtk_widget_style_get (gRadiobuttonWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   426
+    gtk_widget_style_get (gRadiobutton.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   427
                           "indicator_size", indicator_size,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   428
                           "indicator_spacing", indicator_spacing,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   429
                           NULL);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   430
@@ -783,13 +991,12 @@ moz_gtk_get_focus_outline_size(gint* foc
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   431
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   432
     GtkBorder border;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   433
     GtkBorder padding;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   434
-    GtkStyleContext *style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   435
+    GtkStyleContext* style = gEntry.entry.style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   436
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   437
     ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   438
-    style = gtk_widget_get_style_context(gEntryWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   439
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   440
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   441
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   442
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   443
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   444
     *focus_h_width = border.left + padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   445
     *focus_v_width = border.top + padding.top;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   446
     return MOZ_GTK_SUCCESS;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   447
@@ -826,7 +1033,7 @@ moz_gtk_button_get_default_overflow(gint
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   448
     GtkBorder* default_outside_border;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   449
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   450
     ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   451
-    gtk_widget_style_get(gButtonWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   452
+    gtk_widget_style_get(gButton.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   453
                          "default-outside-border", &default_outside_border,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   454
                          NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   455
 
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   456
@@ -849,7 +1056,7 @@ moz_gtk_button_get_default_border(gint*
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   457
     GtkBorder* default_border;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   458
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   459
     ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   460
-    gtk_widget_style_get(gButtonWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   461
+    gtk_widget_style_get(gButton.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   462
                          "default-border", &default_border,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   463
                          NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   464
 
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   465
@@ -940,7 +1147,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   466
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   467
     if (state->focused) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   468
         GtkBorder border;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   469
-        gtk_style_context_get_border(style, state_flags, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   470
+        moz_gtk_get_style_border(style, state_flags, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   471
         x += border.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   472
         y += border.top;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   473
         width -= (border.left + border.right);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   474
@@ -961,15 +1168,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   475
     gint indicator_size, indicator_spacing;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   476
     gint x, y, width, height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   477
     gint focus_x, focus_y, focus_width, focus_height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   478
-    GtkWidget *w;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   479
-    GtkStyleContext *style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   480
+    MozGtkWidget *w;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   481
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   482
     if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   483
         moz_gtk_radio_get_metrics(&indicator_size, &indicator_spacing);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   484
-        w = gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   485
+        w = &gRadiobutton;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   486
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   487
         moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   488
-        w = gCheckboxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   489
+        w = &gCheckbox;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   490
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   491
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   492
     // XXX we should assert rect->height >= indicator_size too
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   493
@@ -988,11 +1194,9 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   494
     focus_width = width + 2 * indicator_spacing;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   495
     focus_height = height + 2 * indicator_spacing;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   496
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   497
-    style = gtk_widget_get_style_context(w);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   498
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   499
-    gtk_widget_set_sensitive(w, !state->disabled);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   500
-    gtk_widget_set_direction(w, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   501
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   502
+    gtk_widget_set_sensitive(w->widget, !state->disabled);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   503
+    gtk_widget_set_direction(w->widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   504
+    gtk_style_context_save(w->check.styleCheck);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   505
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   506
     if (selected)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   507
         state_flags |= checkbox_check_state;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   508
@@ -1000,13 +1204,15 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   509
     if (inconsistent)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   510
         state_flags |= GTK_STATE_FLAG_INCONSISTENT;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   511
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   512
-    gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   513
+    gtk_style_context_set_state(w->check.styleCheck, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   514
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   515
+    gtk_render_background(w->check.styleCheck, cr, x, y, width, height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   516
+    gtk_render_frame(w->check.styleCheck, cr, x, y, width, height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   517
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   518
     if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   519
-        gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   520
-        gtk_render_option(style, cr, x, y, width, height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   521
+        gtk_render_option(w->check.styleCheck, cr, x, y, width, height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   522
         if (state->focused) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   523
-            gtk_render_focus(style, cr, focus_x, focus_y,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   524
+            gtk_render_focus(w->check.styleCheck, cr, focus_x, focus_y,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   525
                             focus_width, focus_height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   526
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   527
     }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   528
@@ -1015,15 +1221,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   529
         * 'indeterminate' type on checkboxes. In GTK, the shadow type
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   530
         * must also be changed for the state to be drawn.
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   531
         */        
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   532
-        gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   533
-        gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gCheckboxWidget), inconsistent);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   534
-        gtk_render_check(style, cr, x, y, width, height);        
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   535
+        gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(w->widget), inconsistent);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   536
+        gtk_render_check(w->check.styleCheck, cr, x, y, width, height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   537
         if (state->focused) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   538
-            gtk_render_focus(style, cr, 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   539
+            gtk_render_focus(w->check.styleCheck, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   540
                              focus_x, focus_y, focus_width, focus_height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   541
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   542
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   543
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   544
+    gtk_style_context_restore(w->check.styleCheck);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   545
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   546
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   547
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   548
@@ -1040,8 +1245,8 @@ calculate_button_inner_rect(GtkWidget* b
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   549
     style = gtk_widget_get_style_context(button);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   550
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   551
     /* This mirrors gtkbutton's child positioning */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   552
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   553
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   554
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   555
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   556
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   557
     inner_rect->x = rect->x + border.left + padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   558
     inner_rect->y = rect->y + padding.top + border.top;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   559
@@ -1107,9 +1312,9 @@ moz_gtk_scrollbar_button_paint(cairo_t *
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   560
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   561
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   562
     if (flags & MOZ_GTK_STEPPER_VERTICAL)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   563
-        scrollbar = gVertScrollbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   564
+        scrollbar = gVertScrollbar.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   565
     else
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   566
-        scrollbar = gHorizScrollbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   567
+        scrollbar = gHorizScrollbar.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   568
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   569
     gtk_widget_set_direction(scrollbar, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   570
 
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   571
@@ -1175,26 +1380,23 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   572
                                GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   573
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   574
     GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   575
-    GtkScrollbar *scrollbar;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   576
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   577
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   578
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   579
-    if (widget ==  MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   580
-        scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   581
-    else
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   582
-        scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   583
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   584
-    gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   585
+    if (widget == MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   586
+        gtk_widget_set_direction(GTK_WIDGET(gHorizScrollbar.widget), direction);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   587
+        style = gHorizScrollbar.scroll.style;
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   588
+    } 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   589
+    else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   590
+        gtk_widget_set_direction(GTK_WIDGET(gVertScrollbar.widget), direction);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   591
+        style = gVertScrollbar.scroll.style;
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   592
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   593
     
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   594
     if (flags & MOZ_GTK_TRACK_OPAQUE) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   595
         style = gtk_widget_get_style_context(GTK_WIDGET(gProtoWindow));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   596
         gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   597
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   598
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   599
-    style = gtk_widget_get_style_context(GTK_WIDGET(scrollbar));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   600
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   601
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   602
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   603
     gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   604
     gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   605
 
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   606
@@ -1202,7 +1404,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   607
         gtk_render_focus(style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   608
                          rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   609
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   610
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   611
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   612
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   613
 
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   614
@@ -1214,25 +1415,21 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   615
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   616
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   617
     GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   618
-    GtkScrollbar *scrollbar;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   619
     GtkAdjustment *adj;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   620
     GtkBorder margin;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   621
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   622
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   623
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   624
-    if (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   625
-        scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   626
-    else
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   627
-        scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   628
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   629
-    gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   630
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   631
-    style = gtk_widget_get_style_context(GTK_WIDGET(scrollbar));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   632
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   633
+    if (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   634
+        style = gHorizScrollbar.scroll.styleSlider;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   635
+        gtk_widget_set_direction(GTK_WIDGET(gHorizScrollbar.widget), direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   636
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   637
+    else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   638
+        style = gVertScrollbar.scroll.styleSlider;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   639
+        gtk_widget_set_direction(GTK_WIDGET(gVertScrollbar.widget), direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   640
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   641
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   642
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_SLIDER);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   643
     gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   644
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   645
     gtk_style_context_get_margin (style, state_flags, &margin);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   646
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   647
     gtk_render_slider(style, cr,
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   648
@@ -1243,8 +1440,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   649
                      (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ?
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   650
                      GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   651
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   652
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   653
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   654
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   655
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   656
 
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   657
@@ -1255,8 +1450,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   658
     GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   659
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   660
     ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   661
-    gtk_widget_set_direction(gSpinWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   662
-    style = gtk_widget_get_style_context(gSpinWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   663
+    gtk_widget_set_direction(gSpin.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   664
+    style = gSpin.spin.style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   665
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   666
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   667
     gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   668
@@ -1275,11 +1470,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   669
     GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   670
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   671
     ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   672
-    style = gtk_widget_get_style_context(gSpinWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   673
+    style = gSpin.spin.style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   674
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   675
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   676
     gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   677
-    gtk_widget_set_direction(gSpinWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   678
+    gtk_widget_set_direction(gSpin.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   679
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   680
     gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   681
     gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   682
@@ -1445,15 +1639,13 @@ moz_gtk_vpaned_paint(cairo_t *cr, GdkRec
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   683
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   684
 moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   685
                     GtkWidgetState* state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   686
-                    GtkWidget* widget, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   687
+                    MozGtkWidget* w, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   688
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   689
     gint x = rect->x, y = rect->y, width = rect->width, height = rect->height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   690
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   691
     int draw_focus_outline_only = state->depressed; // NS_THEME_FOCUS_OUTLINE
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   692
+    GtkStyleContext* style = w->entry.style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   693
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   694
-    gtk_widget_set_direction(widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   695
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   696
-    style = gtk_widget_get_style_context(widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   697
+    gtk_widget_set_direction(w->widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   698
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   699
     if (draw_focus_outline_only) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   700
         // Inflate the given 'rect' with the focus outline size.
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   701
@@ -1473,10 +1665,9 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRect
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   702
      * textarea window uses gtk_paint_flat_box when exposed */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   703
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   704
     /* This gets us a lovely greyish disabledish look */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   705
-    gtk_widget_set_sensitive(widget, !state->disabled);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   706
+    gtk_widget_set_sensitive(w->widget, !state->disabled);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   707
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   708
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   709
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_ENTRY);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   710
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   711
     /* Now paint the shadow and focus border.
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   712
      * We do like in gtk_entry_draw_frame, we first draw the shadow, a tad
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   713
@@ -1526,7 +1717,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   714
     style = gtk_widget_get_style_context(gScrolledWindowWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   715
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   716
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME);    
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   717
-    gtk_style_context_get_border(style, state_flags, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   718
+    moz_gtk_get_style_border(style, state_flags, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   719
     xthickness = border.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   720
     ythickness = border.top;    
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   721
 
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   722
@@ -1697,7 +1888,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   723
         if (direction == GTK_TEXT_DIR_LTR) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   724
             GtkBorder padding;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   725
             GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   726
-            gtk_style_context_get_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   727
+            moz_gtk_get_style_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   728
             arrow_rect.x -= padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   729
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   730
         else
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   731
@@ -1799,29 +1990,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   732
                         gboolean isradio, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   733
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   734
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   735
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   736
-    GtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   737
+    MozGtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   738
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   739
     if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   740
         ensure_radiobutton_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   741
-        widget = gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   742
+        widget = &gRadiobutton;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   743
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   744
         ensure_checkbox_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   745
-        widget = gCheckboxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   746
+        widget = &gCheckbox;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   747
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   748
-    gtk_widget_set_direction(widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   749
+    gtk_widget_set_direction(widget->widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   750
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   751
-    style = gtk_widget_get_style_context(widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   752
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   753
-    gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   754
+    gtk_style_context_save(widget->check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   755
+    gtk_style_context_set_state(widget->check.style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   756
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   757
     /* this is for drawing a prelight box */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   758
     if (state_flags & GTK_STATE_FLAG_PRELIGHT) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   759
-        gtk_render_background(style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   760
+        gtk_render_background(widget->check.style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   761
                               rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   762
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   763
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   764
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   765
+    gtk_style_context_restore(widget->check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   766
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   767
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   768
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   769
@@ -1831,32 +2020,26 @@ moz_gtk_toggle_label_paint(cairo_t *cr,
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   770
                            GtkWidgetState* state, 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   771
                            gboolean isradio, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   772
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   773
-    GtkStyleContext *style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   774
-    GtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   775
+    MozGtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   776
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   777
     if (!state->focused)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   778
         return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   779
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   780
     if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   781
         ensure_radiobutton_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   782
-        widget = gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   783
+        widget = &gRadiobutton;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   784
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   785
         ensure_checkbox_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   786
-        widget = gCheckboxWidget;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   787
+        widget = &gCheckbox;
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   788
     }
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   789
-    style = gtk_widget_get_style_context(widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   790
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   791
-    if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   792
-      gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   793
-    } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   794
-      gtk_style_context_add_class(style, GTK_STYLE_CLASS_CHECK);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   795
-    }
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   796
-    gtk_widget_set_direction(widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   797
+    gtk_style_context_save(widget->check.styleLabel);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   798
+    gtk_widget_set_direction(widget->widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   799
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   800
-    gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   801
-    gtk_render_focus(style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   802
+    gtk_style_context_set_state(widget->check.styleLabel, 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   803
+                                GetStateFlagsFromGtkWidgetState(state));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   804
+    gtk_render_focus(widget->check.styleLabel, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   805
                     rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   806
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   807
+    gtk_style_context_restore(widget->check.styleLabel);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   808
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   809
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   810
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   811
@@ -1917,7 +2100,7 @@ moz_gtk_toolbar_separator_paint(cairo_t
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   812
                           rect->height * (end_fraction - start_fraction));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   813
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   814
         GtkBorder padding;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   815
-        gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   816
+        gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   817
     
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   818
         paint_width = padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   819
         if (paint_width > rect->width)
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   820
@@ -2004,18 +2187,13 @@ static gint
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   821
 moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   822
                           GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   823
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   824
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   825
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   826
     ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   827
-    gtk_widget_set_direction(gProgressWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   828
+    gtk_widget_set_direction(gProgressBar.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   829
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   830
-    style = gtk_widget_get_style_context(gProgressWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   831
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   832
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   833
-    
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   834
-    gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   835
-    gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   836
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   837
+    gtk_render_background(gProgressBar.progress.styleTrough, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   838
+                          rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   839
+    gtk_render_frame(gProgressBar.progress.styleTrough, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   840
+                     rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   841
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   842
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   843
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   844
@@ -2025,15 +2203,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   845
                              GtkTextDirection direction,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   846
                              GtkThemeWidgetType widget)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   847
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   848
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   849
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   850
     ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   851
-    gtk_widget_set_direction(gProgressWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   852
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   853
-    style = gtk_widget_get_style_context(gProgressWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   854
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   855
-    gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   856
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_PROGRESSBAR);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   857
+    gtk_widget_set_direction(gProgressBar.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   858
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   859
     if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE ||
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   860
         widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) {
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   861
@@ -2072,12 +2243,14 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   862
     // gtk_render_activity was used to render progress chunks on GTK versions
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   863
     // before 3.13.7, see bug 1173907.
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   864
     if (!gtk_check_version(3, 13, 7)) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   865
-      gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   866
-      gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   867
+      gtk_render_background(gProgressBar.progress.styleProgress, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   868
+                            rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   869
+      gtk_render_frame(gProgressBar.progress.styleProgress, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   870
+                       rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   871
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   872
-      gtk_render_activity(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   873
+      gtk_render_activity(gProgressBar.progress.styleProgress, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   874
+                          rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   875
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   876
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   877
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   878
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   879
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   880
@@ -2094,7 +2267,7 @@ moz_gtk_get_tab_thickness(void)
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   881
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   882
     style = gtk_widget_get_style_context(gTabWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   883
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   884
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   885
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   886
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   887
     if (border.top < 2)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   888
         return 2; /* some themes don't set ythickness correctly */
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   889
@@ -2290,7 +2463,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   890
       gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   891
       moz_gtk_tab_prepare_style_context(style, flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   892
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   893
-      gtk_style_context_get_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   894
+      moz_gtk_get_style_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   895
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   896
       focusRect.x += padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   897
       focusRect.width -= (padding.left + padding.right);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   898
@@ -2406,7 +2579,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t *
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   899
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   900
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   901
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   902
-moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   903
+moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   904
                        GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   905
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   906
     GtkStyleContext* style;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   907
@@ -2467,7 +2640,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   908
     border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   909
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   910
     style = gtk_widget_get_style_context(gMenuSeparatorWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   911
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   912
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   913
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   914
     x = rect->x + border_width;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   915
     y = rect->y + border_width;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   916
@@ -2521,7 +2694,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   917
             item_widget = gMenuItemWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   918
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   919
         style = gtk_widget_get_style_context(item_widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   920
-        gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   921
+// TODO - FIX!
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   922
+//        gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   923
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   924
         if (flags & MOZ_TOPLEVEL_MENU_ITEM) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   925
             gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   926
@@ -2540,7 +2714,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   927
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   928
         gtk_render_background(style, cr, x, y, w, h);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   929
         gtk_render_frame(style, cr, x, y, w, h);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   930
-        gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   931
+//        gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   932
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   933
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   934
     return MOZ_GTK_SUCCESS;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   935
@@ -2556,7 +2730,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   936
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   937
     ensure_menu_item_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   938
     gtk_widget_set_direction(gMenuItemWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   939
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   940
+/*
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   941
+    state_flags |= (direction == GTK_TEXT_DIR_LTR) ? GTK_STATE_FLAG_DIR_LTR :
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   942
+                                                     GTK_STATE_FLAG_DIR_RTL;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   943
+*/
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   944
     style = gtk_widget_get_style_context(gMenuItemWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   945
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   946
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUITEM);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   947
@@ -2606,7 +2783,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   948
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   949
     
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   950
     gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   951
-    gtk_style_context_get_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   952
+    moz_gtk_get_style_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   953
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   954
     offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) +
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   955
                                             padding.left + 2;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   956
@@ -2658,7 +2835,7 @@ moz_gtk_add_style_border(GtkStyleContext
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   957
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   958
     GtkBorder border;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   959
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   960
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   961
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   962
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   963
     *left += border.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   964
     *right += border.right;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   965
@@ -2667,12 +2844,22 @@ moz_gtk_add_style_border(GtkStyleContext
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   966
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   967
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   968
 static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   969
+moz_gtk_get_style_border(GtkStyleContext* style, GtkStateFlags state_flags,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   970
+                         GtkBorder *border)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   971
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   972
+    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   973
+    gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   974
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   975
+    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   976
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   977
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   978
+static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   979
 moz_gtk_add_style_padding(GtkStyleContext* style,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   980
                           gint* left, gint* top, gint* right, gint* bottom)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   981
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   982
     GtkBorder padding;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   983
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   984
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   985
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   986
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   987
     *left += padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   988
     *right += padding.right;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   989
@@ -2680,6 +2867,16 @@ moz_gtk_add_style_padding(GtkStyleContex
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   990
     *bottom += padding.bottom;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   991
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   992
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   993
+static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   994
+moz_gtk_get_style_padding(GtkStyleContext* style, GtkStateFlags state_flags,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   995
+                          GtkBorder *padding)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   996
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   997
+    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   998
+    gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   999
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1000
+    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1001
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1002
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1003
 gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1004
 moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1005
                           gint* right, gint* bottom, GtkTextDirection direction,
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1006
@@ -2694,36 +2891,27 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1007
     case MOZ_GTK_TOOLBAR_BUTTON:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1008
         {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1009
             ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1010
-            style = gtk_widget_get_style_context(gButtonWidget);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1011
-
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1012
-            *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget));
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1013
 
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1014
-            if (widget == MOZ_GTK_TOOLBAR_BUTTON) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1015
-                gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1016
-                gtk_style_context_add_class(style, "image-button");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1017
-            }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1018
-              
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1019
-            moz_gtk_add_style_padding(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1020
-                
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1021
-            if (widget == MOZ_GTK_TOOLBAR_BUTTON)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1022
-                gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1023
+            *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButton.widget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1024
+            moz_gtk_add_style_padding(gButton.button.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1025
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1026
             // XXX: Subtract 1 pixel from the border to account for the added
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1027
             // -moz-focus-inner border (Bug 1228281).
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1028
             *left -= 1; *top -= 1; *right -= 1; *bottom -= 1;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1029
-            moz_gtk_add_style_border(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1030
+            moz_gtk_add_style_border(gButton.button.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1031
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1032
             return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1033
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1034
     case MOZ_GTK_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1035
         {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1036
             ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1037
-            style = gtk_widget_get_style_context(gEntryWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1038
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1039
             // XXX: Subtract 1 pixel from the padding to account for the default
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1040
             // padding in forms.css. See bug 1187385.
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1041
             *left = *top = *right = *bottom = -1;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1042
-            moz_gtk_add_style_padding(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1043
-            moz_gtk_add_style_border(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1044
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1045
+            moz_gtk_add_style_padding(gEntry.entry.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1046
+            moz_gtk_add_style_border(gEntry.entry.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1047
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1048
             return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1049
         }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1050
@@ -2759,7 +2947,7 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1051
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1052
     case MOZ_GTK_DROPDOWN_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1053
         ensure_combo_box_entry_widgets();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1054
-        w = gComboBoxEntryTextareaWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1055
+        w = gComboBoxEntryTextarea.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1056
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1057
     case MOZ_GTK_DROPDOWN_ARROW:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1058
         ensure_combo_box_entry_widgets();
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1059
@@ -2795,7 +2983,7 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1060
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1061
                 if (!wide_separators) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1062
                     style = gtk_widget_get_style_context(gComboBoxSeparatorWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1063
-                    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1064
+                    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1065
                     separator_width = border.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1066
                 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1067
             }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1068
@@ -2814,14 +3002,17 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1069
         w = gTabWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1070
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1071
     case MOZ_GTK_PROGRESSBAR:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1072
-        ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1073
-        w = gProgressWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1074
-        break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1075
+        {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1076
+            ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1077
+            moz_gtk_add_style_border(gProgressBar.progress.styleTrough,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1078
+                                     left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1079
+            return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1080
+        }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1081
     case MOZ_GTK_SPINBUTTON_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1082
     case MOZ_GTK_SPINBUTTON_UP:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1083
     case MOZ_GTK_SPINBUTTON_DOWN:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1084
         ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1085
-        w = gSpinWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1086
+        w = gSpin.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1087
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1088
     case MOZ_GTK_SCALE_HORIZONTAL:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1089
         ensure_scale_widget();
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1090
@@ -2840,12 +3031,13 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1091
         {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1092
             if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1093
                 ensure_checkbox_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1094
-                w = gCheckboxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1095
+                w = gCheckbox.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1096
+                style = gCheckbox.check.styleCheck;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1097
             } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1098
                 ensure_radiobutton_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1099
-                w = gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1100
+                w = gRadiobutton.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1101
+                style = gRadiobutton.check.styleCheck;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1102
             }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1103
-            style = gtk_widget_get_style_context(w);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1104
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1105
             *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1106
             moz_gtk_add_style_border(style,
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1107
@@ -2978,6 +3170,32 @@ moz_gtk_get_combo_box_entry_button_size(
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1108
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1109
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1110
 gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1111
+moz_gtk_get_entry_height(gint* height)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1112
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1113
+    GtkRequisition requisition;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1114
+    ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1115
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1116
+    gtk_widget_get_preferred_size(gEntry.widget, NULL, &requisition);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1117
+    *height = requisition.height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1118
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1119
+    return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1120
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1121
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1122
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1123
+gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1124
+moz_gtk_get_button_height(gint* height)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1125
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1126
+    GtkRequisition requisition;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1127
+    ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1128
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1129
+    gtk_widget_get_preferred_size(gButton.widget, NULL, &requisition);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1130
+    *height = requisition.height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1131
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1132
+    return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1133
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1134
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1135
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1136
+gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1137
 moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1138
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1139
     gint arrow_size;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1140
@@ -3022,7 +3240,7 @@ moz_gtk_get_toolbar_separator_width(gint
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1141
                          "separator-width", &separator_width,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1142
                          NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1143
     /* Just in case... */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1144
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1145
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1146
     *size = MAX(*size, (wide_separators ? separator_width : border.left));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1147
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1148
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1149
@@ -3064,7 +3282,7 @@ moz_gtk_get_menu_separator_height(gint *
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1150
     border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1151
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1152
     style = gtk_widget_get_style_context(gMenuSeparatorWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1153
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1154
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1155
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1156
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1157
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1158
@@ -3122,15 +3340,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1159
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1160
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1161
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1162
-    gtk_widget_style_get (gHorizScrollbarWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1163
+    gtk_widget_style_get (gHorizScrollbar.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1164
                           "slider_width", &metrics->slider_width,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1165
                           "trough_border", &metrics->trough_border,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1166
                           "stepper_size", &metrics->stepper_size,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1167
                           "stepper_spacing", &metrics->stepper_spacing,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1168
                           NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1169
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1170
-    metrics->min_slider_size = 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1171
-        gtk_range_get_min_slider_size(GTK_RANGE(gHorizScrollbarWidget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1172
+    if (!gtk_check_version(3,19,7)) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1173
+        gtk_style_context_get(gVertScrollbar.scroll.styleSlider, 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1174
+                              gtk_style_context_get_state(gVertScrollbar.scroll.styleSlider), 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1175
+                              "min-height", &metrics->min_slider_size, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1176
+    } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1177
+        metrics->min_slider_size = 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1178
+            gtk_range_get_min_slider_size(GTK_RANGE(gVertScrollbar.widget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1179
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1180
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1181
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1182
 }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1183
@@ -3155,7 +3379,7 @@ moz_gtk_images_in_buttons()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1184
     GtkSettings* settings;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1185
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1186
     ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1187
-    settings = gtk_widget_get_settings(gButtonWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1188
+    settings = gtk_widget_get_settings(gButton.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1189
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1190
     g_object_get(settings, "gtk-button-images", &result, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1191
     return result;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1192
@@ -3183,7 +3407,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1193
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1194
         ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1195
         return moz_gtk_button_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1196
-                                    (GtkReliefStyle) flags, gButtonWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1197
+                                    (GtkReliefStyle) flags, gButton.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1198
                                     direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1199
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1200
     case MOZ_GTK_CHECKBUTTON:
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1201
@@ -3233,7 +3457,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1202
     case MOZ_GTK_SPINBUTTON_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1203
         ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1204
         return moz_gtk_entry_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1205
-                                   gSpinWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1206
+                                   &gSpin, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1207
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1208
     case MOZ_GTK_GRIPPER:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1209
         return moz_gtk_gripper_paint(cr, rect, state,
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1210
@@ -3260,7 +3484,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1211
     case MOZ_GTK_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1212
         ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1213
         return moz_gtk_entry_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1214
-                                   gEntryWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1215
+                                   &gEntry, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1216
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1217
     case MOZ_GTK_DROPDOWN:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1218
         return moz_gtk_combo_box_paint(cr, rect, state, direction);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1219
@@ -3272,7 +3496,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1220
     case MOZ_GTK_DROPDOWN_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1221
         ensure_combo_box_entry_widgets();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1222
         return moz_gtk_entry_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1223
-                                   gComboBoxEntryTextareaWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1224
+                                   &gComboBoxEntryTextarea, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1225
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1226
     case MOZ_GTK_CHECKBUTTON_CONTAINER:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1227
     case MOZ_GTK_RADIOBUTTON_CONTAINER:
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1228
@@ -3324,7 +3548,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1229
                                               (GtkArrowType) flags, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1230
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1231
     case MOZ_GTK_MENUBAR:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1232
-        return moz_gtk_menu_bar_paint(cr, rect, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1233
+        return moz_gtk_menu_bar_paint(cr, rect, state, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1234
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1235
     case MOZ_GTK_MENUPOPUP:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1236
         return moz_gtk_menu_popup_paint(cr, rect, direction);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1237
@@ -3375,7 +3599,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget(
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1238
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1239
     MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1240
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1241
-    return gHorizScrollbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1242
+    return gVertScrollbar.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1243
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1244
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1245
 gboolean moz_gtk_has_scrollbar_buttons(void)
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1246
@@ -3383,7 +3607,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1247