mozilla-gtk3_20.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Tue, 07 Jun 2016 17:58:57 +0200
branchfirefox46
changeset 914 20bd16d68ed2
parent 909 c6717354928b
child 919 6838f0c032f8
permissions -rw-r--r--
46.0.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
     1
diff -up firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20 firefox-46.0/widget/gtk/gtk3drawing.c
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
     2
--- firefox-46.0/widget/gtk/gtk3drawing.c.gtk3-20	2016-04-22 02:37:27.000000000 +0200
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
     3
+++ firefox-46.0/widget/gtk/gtk3drawing.c	2016-04-25 14:56:19.006992927 +0200
908
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) {
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   375
@@ -530,9 +721,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
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   400
@@ -638,6 +841,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),
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   412
@@ -752,7 +960,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);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   421
@@ -765,7 +973,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);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   430
@@ -778,13 +986,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;
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   447
@@ -821,7 +1028,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
 
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   456
@@ -844,7 +1051,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
 
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   465
@@ -935,7 +1142,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);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   474
@@ -956,15 +1163,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
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   493
@@ -983,11 +1189,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;
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   508
@@ -995,13 +1199,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
     }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   528
@@ -1010,15 +1216,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
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   548
@@ -1035,8 +1240,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;
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   559
@@ -1099,9 +1304,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
 
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   571
@@ -1181,25 +1386,22 @@ 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
 
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   579
-    if (widget ==  MOZ_GTK_SCROLLBAR_HORIZONTAL)
907
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);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   585
-    
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   586
     if (flags & MOZ_GTK_TRACK_OPAQUE) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   587
         style = gtk_widget_get_style_context(GTK_WIDGET(gProtoWindow));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   588
         gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   589
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   590
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   591
-    style = gtk_widget_get_style_context(GTK_WIDGET(scrollbar));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   592
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   593
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   594
+     if (widget == MOZ_GTK_SCROLLBAR_HORIZONTAL) {
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   595
+        gtk_widget_set_direction(GTK_WIDGET(gHorizScrollbar.widget), direction);
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   596
+        style = gHorizScrollbar.scroll.style;
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   597
+    }
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   598
+    else {
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   599
+        gtk_widget_set_direction(GTK_WIDGET(gVertScrollbar.widget), direction);
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   600
+        style = gVertScrollbar.scroll.style;
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   601
+    }
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   602
 
907
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);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   605
@@ -1208,7 +1410,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   606
         gtk_render_focus(style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   607
                          rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   608
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   609
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   610
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   611
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   612
 
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   613
@@ -1220,24 +1421,20 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   614
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   615
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   616
     GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   617
-    GtkScrollbar *scrollbar;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   618
     GtkBorder margin;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   619
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   620
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   621
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   622
-    if (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   623
-        scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   624
-    else
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   625
-        scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   626
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   627
-    gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   628
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   629
-    style = gtk_widget_get_style_context(GTK_WIDGET(scrollbar));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   630
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   631
+    if (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   632
+        style = gHorizScrollbar.scroll.styleSlider;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   633
+        gtk_widget_set_direction(GTK_WIDGET(gHorizScrollbar.widget), direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   634
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   635
+    else {
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   636
+        style = gVertScrollbar.scroll.styleSlider; 
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   637
+        gtk_widget_set_direction(GTK_WIDGET(gVertScrollbar.widget), direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   638
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   639
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   640
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_SLIDER);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   641
     gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   642
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   643
     gtk_style_context_get_margin (style, state_flags, &margin);
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_render_slider(style, cr,
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   646
@@ -1248,8 +1445,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   647
                      (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ?
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   648
                      GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   649
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   650
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   651
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   652
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   653
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   654
 
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   655
@@ -1260,8 +1455,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   656
     GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   657
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   658
     ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   659
-    gtk_widget_set_direction(gSpinWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   660
-    style = gtk_widget_get_style_context(gSpinWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   661
+    gtk_widget_set_direction(gSpin.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   662
+    style = gSpin.spin.style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   663
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   664
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   665
     gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   666
@@ -1280,11 +1475,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   667
     GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   668
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   669
     ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   670
-    style = gtk_widget_get_style_context(gSpinWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   671
+    style = gSpin.spin.style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   672
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   673
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   674
     gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   675
-    gtk_widget_set_direction(gSpinWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   676
+    gtk_widget_set_direction(gSpin.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   677
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   678
     gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   679
     gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   680
@@ -1450,15 +1644,13 @@ moz_gtk_vpaned_paint(cairo_t *cr, GdkRec
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   681
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   682
 moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   683
                     GtkWidgetState* state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   684
-                    GtkWidget* widget, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   685
+                    MozGtkWidget* w, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   686
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   687
     gint x = rect->x, y = rect->y, width = rect->width, height = rect->height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   688
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   689
     int draw_focus_outline_only = state->depressed; // NS_THEME_FOCUS_OUTLINE
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   690
+    GtkStyleContext* style = w->entry.style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   691
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   692
-    gtk_widget_set_direction(widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   693
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   694
-    style = gtk_widget_get_style_context(widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   695
+    gtk_widget_set_direction(w->widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   696
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   697
     if (draw_focus_outline_only) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   698
         // Inflate the given 'rect' with the focus outline size.
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   699
@@ -1478,10 +1670,9 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRect
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   700
      * textarea window uses gtk_paint_flat_box when exposed */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   701
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   702
     /* This gets us a lovely greyish disabledish look */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   703
-    gtk_widget_set_sensitive(widget, !state->disabled);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   704
+    gtk_widget_set_sensitive(w->widget, !state->disabled);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   705
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   706
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   707
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_ENTRY);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   708
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   709
     /* Now paint the shadow and focus border.
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   710
      * We do like in gtk_entry_draw_frame, we first draw the shadow, a tad
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   711
@@ -1531,7 +1722,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   712
     style = gtk_widget_get_style_context(gScrolledWindowWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   713
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   714
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME);    
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   715
-    gtk_style_context_get_border(style, state_flags, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   716
+    moz_gtk_get_style_border(style, state_flags, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   717
     xthickness = border.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   718
     ythickness = border.top;    
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   719
 
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   720
@@ -1702,7 +1893,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   721
         if (direction == GTK_TEXT_DIR_LTR) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   722
             GtkBorder padding;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   723
             GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   724
-            gtk_style_context_get_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   725
+            moz_gtk_get_style_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   726
             arrow_rect.x -= padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   727
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   728
         else
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   729
@@ -1804,29 +1995,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   730
                         gboolean isradio, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   731
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   732
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   733
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   734
-    GtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   735
+    MozGtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   736
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   737
     if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   738
         ensure_radiobutton_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   739
-        widget = gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   740
+        widget = &gRadiobutton;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   741
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   742
         ensure_checkbox_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   743
-        widget = gCheckboxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   744
+        widget = &gCheckbox;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   745
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   746
-    gtk_widget_set_direction(widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   747
+    gtk_widget_set_direction(widget->widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   748
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   749
-    style = gtk_widget_get_style_context(widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   750
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   751
-    gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   752
+    gtk_style_context_save(widget->check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   753
+    gtk_style_context_set_state(widget->check.style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   754
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   755
     /* this is for drawing a prelight box */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   756
     if (state_flags & GTK_STATE_FLAG_PRELIGHT) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   757
-        gtk_render_background(style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   758
+        gtk_render_background(widget->check.style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   759
                               rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   760
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   761
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   762
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   763
+    gtk_style_context_restore(widget->check.style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   764
   
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   765
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   766
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   767
@@ -1836,32 +2025,26 @@ moz_gtk_toggle_label_paint(cairo_t *cr,
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   768
                            GtkWidgetState* state, 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   769
                            gboolean isradio, GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   770
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   771
-    GtkStyleContext *style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   772
-    GtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   773
+    MozGtkWidget *widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   774
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   775
     if (!state->focused)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   776
         return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   777
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   778
     if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   779
         ensure_radiobutton_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   780
-        widget = gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   781
+        widget = &gRadiobutton;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   782
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   783
         ensure_checkbox_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   784
-        widget = gCheckboxWidget;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   785
+        widget = &gCheckbox;
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   786
     }
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   787
-    style = gtk_widget_get_style_context(widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   788
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   789
-    if (isradio) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   790
-      gtk_style_context_add_class(style, GTK_STYLE_CLASS_RADIO);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   791
-    } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   792
-      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
   793
-    }
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   794
-    gtk_widget_set_direction(widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   795
+    gtk_style_context_save(widget->check.styleLabel);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   796
+    gtk_widget_set_direction(widget->widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   797
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   798
-    gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   799
-    gtk_render_focus(style, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   800
+    gtk_style_context_set_state(widget->check.styleLabel, 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   801
+                                GetStateFlagsFromGtkWidgetState(state));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   802
+    gtk_render_focus(widget->check.styleLabel, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   803
                     rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   804
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   805
+    gtk_style_context_restore(widget->check.styleLabel);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   806
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   807
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   808
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   809
@@ -1922,7 +2105,7 @@ moz_gtk_toolbar_separator_paint(cairo_t
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   810
                           rect->height * (end_fraction - start_fraction));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   811
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   812
         GtkBorder padding;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   813
-        gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   814
+        gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   815
     
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   816
         paint_width = padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   817
         if (paint_width > rect->width)
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   818
@@ -2006,18 +2189,13 @@ static gint
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   819
 moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   820
                           GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   821
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   822
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   823
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   824
     ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   825
-    gtk_widget_set_direction(gProgressWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   826
+    gtk_widget_set_direction(gProgressBar.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   827
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   828
-    style = gtk_widget_get_style_context(gProgressWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   829
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   830
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   831
-    
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   832
-    gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   833
-    gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   834
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   835
+    gtk_render_background(gProgressBar.progress.styleTrough, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   836
+                          rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   837
+    gtk_render_frame(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
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   840
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   841
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   842
@@ -2027,15 +2205,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   843
                              GtkTextDirection direction,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   844
                              GtkThemeWidgetType widget)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   845
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   846
-    GtkStyleContext* style;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   847
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   848
     ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   849
-    gtk_widget_set_direction(gProgressWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   850
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   851
-    style = gtk_widget_get_style_context(gProgressWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   852
-    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   853
-    gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   854
-    gtk_style_context_add_class(style, GTK_STYLE_CLASS_PROGRESSBAR);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   855
+    gtk_widget_set_direction(gProgressBar.widget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   856
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   857
     if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE ||
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   858
         widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) {
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   859
@@ -2074,12 +2245,14 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   860
     // gtk_render_activity was used to render progress chunks on GTK versions
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   861
     // before 3.13.7, see bug 1173907.
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   862
     if (!gtk_check_version(3, 13, 7)) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   863
-      gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   864
-      gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   865
+      gtk_render_background(gProgressBar.progress.styleProgress, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   866
+                            rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   867
+      gtk_render_frame(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
     } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   870
-      gtk_render_activity(style, cr, rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   871
+      gtk_render_activity(gProgressBar.progress.styleProgress, cr,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   872
+                          rect->x, rect->y, rect->width, rect->height);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   873
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   874
-    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   875
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   876
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   877
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   878
@@ -2096,7 +2269,7 @@ moz_gtk_get_tab_thickness(void)
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   879
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   880
     style = gtk_widget_get_style_context(gTabWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   881
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   882
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   883
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   884
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   885
     if (border.top < 2)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   886
         return 2; /* some themes don't set ythickness correctly */
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   887
@@ -2292,7 +2465,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   888
       gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   889
       moz_gtk_tab_prepare_style_context(style, flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   890
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   891
-      gtk_style_context_get_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   892
+      moz_gtk_get_style_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   893
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   894
       focusRect.x += padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   895
       focusRect.width -= (padding.left + padding.right);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   896
@@ -2408,7 +2581,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t *
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   897
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   898
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   899
 static gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   900
-moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   901
+moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   902
                        GtkTextDirection direction)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   903
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   904
     GtkStyleContext* style;
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
   905
@@ -2468,7 +2641,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   906
     border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   907
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   908
     style = gtk_widget_get_style_context(gMenuSeparatorWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   909
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   910
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   911
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   912
     x = rect->x + border_width;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   913
     y = rect->y + border_width;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   914
@@ -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
   915
             item_widget = gMenuItemWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   916
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   917
         style = gtk_widget_get_style_context(item_widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   918
-        gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   919
+// TODO - FIX!
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
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   922
         if (flags & MOZ_TOPLEVEL_MENU_ITEM) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   923
             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
   924
@@ -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
   925
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   926
         gtk_render_background(style, cr, x, y, w, h);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   927
         gtk_render_frame(style, cr, x, y, w, h);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   928
-        gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   929
+//        gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   930
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   931
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   932
     return MOZ_GTK_SUCCESS;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   933
@@ -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
   934
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   935
     ensure_menu_item_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   936
     gtk_widget_set_direction(gMenuItemWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   937
-
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   938
+/*
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   939
+    state_flags |= (direction == GTK_TEXT_DIR_LTR) ? GTK_STATE_FLAG_DIR_LTR :
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   940
+                                                     GTK_STATE_FLAG_DIR_RTL;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   941
+*/
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   942
     style = gtk_widget_get_style_context(gMenuItemWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   943
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   944
     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
   945
@@ -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
   946
     }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   947
     
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   948
     gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   949
-    gtk_style_context_get_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   950
+    moz_gtk_get_style_padding(style, state_flags, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   951
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   952
     offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) +
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   953
                                             padding.left + 2;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   954
@@ -2658,7 +2835,7 @@ moz_gtk_add_style_border(GtkStyleContext
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   955
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   956
     GtkBorder border;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   957
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   958
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   959
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   960
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   961
     *left += border.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   962
     *right += border.right;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   963
@@ -2667,12 +2844,22 @@ moz_gtk_add_style_border(GtkStyleContext
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   964
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   965
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   966
 static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   967
+moz_gtk_get_style_border(GtkStyleContext* style, GtkStateFlags state_flags,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   968
+                         GtkBorder *border)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   969
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   970
+    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   971
+    gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   972
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   973
+    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   974
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   975
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   976
+static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   977
 moz_gtk_add_style_padding(GtkStyleContext* style,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   978
                           gint* left, gint* top, gint* right, gint* bottom)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   979
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   980
     GtkBorder padding;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   981
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   982
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   983
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   984
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   985
     *left += padding.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   986
     *right += padding.right;
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
   987
@@ -2680,6 +2867,16 @@ moz_gtk_add_style_padding(GtkStyleContex
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   988
     *bottom += padding.bottom;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   989
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   990
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   991
+static void
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   992
+moz_gtk_get_style_padding(GtkStyleContext* style, GtkStateFlags state_flags,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   993
+                          GtkBorder *padding)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   994
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   995
+    gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   996
+    gtk_style_context_set_state(style, state_flags);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   997
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   998
+    gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   999
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1000
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1001
 gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1002
 moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1003
                           gint* right, gint* bottom, GtkTextDirection direction,
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1004
@@ -2694,36 +2891,27 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1005
     case MOZ_GTK_TOOLBAR_BUTTON:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1006
         {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1007
             ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1008
-            style = gtk_widget_get_style_context(gButtonWidget);
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1009
-
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1010
-            *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
  1011
 
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1012
-            if (widget == MOZ_GTK_TOOLBAR_BUTTON) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1013
-                gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1014
-                gtk_style_context_add_class(style, "image-button");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1015
-            }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1016
-              
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1017
-            moz_gtk_add_style_padding(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1018
-                
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1019
-            if (widget == MOZ_GTK_TOOLBAR_BUTTON)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1020
-                gtk_style_context_restore(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1021
+            *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButton.widget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1022
+            moz_gtk_add_style_padding(gButton.button.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1023
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1024
             // XXX: Subtract 1 pixel from the border to account for the added
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1025
             // -moz-focus-inner border (Bug 1228281).
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1026
             *left -= 1; *top -= 1; *right -= 1; *bottom -= 1;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1027
-            moz_gtk_add_style_border(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1028
+            moz_gtk_add_style_border(gButton.button.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1029
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1030
             return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1031
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1032
     case MOZ_GTK_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1033
         {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1034
             ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1035
-            style = gtk_widget_get_style_context(gEntryWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1036
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1037
             // XXX: Subtract 1 pixel from the padding to account for the default
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1038
             // padding in forms.css. See bug 1187385.
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1039
             *left = *top = *right = *bottom = -1;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1040
-            moz_gtk_add_style_padding(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1041
-            moz_gtk_add_style_border(style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1042
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1043
+            moz_gtk_add_style_padding(gEntry.entry.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1044
+            moz_gtk_add_style_border(gEntry.entry.style, left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1045
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1046
             return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1047
         }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1048
@@ -2759,7 +2947,7 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1049
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1050
     case MOZ_GTK_DROPDOWN_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1051
         ensure_combo_box_entry_widgets();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1052
-        w = gComboBoxEntryTextareaWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1053
+        w = gComboBoxEntryTextarea.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1054
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1055
     case MOZ_GTK_DROPDOWN_ARROW:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1056
         ensure_combo_box_entry_widgets();
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1057
@@ -2795,7 +2983,7 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1058
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1059
                 if (!wide_separators) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1060
                     style = gtk_widget_get_style_context(gComboBoxSeparatorWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1061
-                    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1062
+                    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1063
                     separator_width = border.left;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1064
                 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1065
             }
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1066
@@ -2814,14 +3002,17 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1067
         w = gTabWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1068
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1069
     case MOZ_GTK_PROGRESSBAR:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1070
-        ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1071
-        w = gProgressWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1072
-        break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1073
+        {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1074
+            ensure_progress_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1075
+            moz_gtk_add_style_border(gProgressBar.progress.styleTrough,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1076
+                                     left, top, right, bottom);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1077
+            return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1078
+        }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1079
     case MOZ_GTK_SPINBUTTON_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1080
     case MOZ_GTK_SPINBUTTON_UP:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1081
     case MOZ_GTK_SPINBUTTON_DOWN:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1082
         ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1083
-        w = gSpinWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1084
+        w = gSpin.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1085
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1086
     case MOZ_GTK_SCALE_HORIZONTAL:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1087
         ensure_scale_widget();
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1088
@@ -2840,12 +3031,13 @@ moz_gtk_get_widget_border(GtkThemeWidget
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1089
         {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1090
             if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1091
                 ensure_checkbox_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1092
-                w = gCheckboxWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1093
+                w = gCheckbox.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1094
+                style = gCheckbox.check.styleCheck;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1095
             } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1096
                 ensure_radiobutton_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1097
-                w = gRadiobuttonWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1098
+                w = gRadiobutton.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1099
+                style = gRadiobutton.check.styleCheck;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1100
             }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1101
-            style = gtk_widget_get_style_context(w);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1102
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1103
             *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1104
             moz_gtk_add_style_border(style,
908
b29b47737173 sync from mozilla:Factory
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 907
diff changeset
  1105
@@ -2978,6 +3170,32 @@ moz_gtk_get_combo_box_entry_button_size(
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1106
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1107
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1108
 gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1109
+moz_gtk_get_entry_height(gint* height)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1110
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1111
+    GtkRequisition requisition;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1112
+    ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1113
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1114
+    gtk_widget_get_preferred_size(gEntry.widget, NULL, &requisition);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1115
+    *height = requisition.height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1116
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1117
+    return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1118
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1119
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1120
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1121
+gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1122
+moz_gtk_get_button_height(gint* height)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1123
+{
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1124
+    GtkRequisition requisition;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1125
+    ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1126
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1127
+    gtk_widget_get_preferred_size(gButton.widget, NULL, &requisition);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1128
+    *height = requisition.height;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1129
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1130
+    return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1131
+}
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1132
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1133
+
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1134
+gint
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1135
 moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height)
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1136
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1137
     gint arrow_size;
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1138
@@ -3030,7 +3248,7 @@ moz_gtk_get_toolbar_separator_width(gint
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1139
                          "separator-width", &separator_width,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1140
                          NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1141
     /* Just in case... */
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1142
-    gtk_style_context_get_border(style, 0, &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1143
+    gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1144
     *size = MAX(*size, (wide_separators ? separator_width : border.left));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1145
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1146
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1147
@@ -3072,7 +3290,7 @@ moz_gtk_get_menu_separator_height(gint *
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1148
     border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1149
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1150
     style = gtk_widget_get_style_context(gMenuSeparatorWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1151
-    gtk_style_context_get_padding(style, 0, &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1152
+    gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1153
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1154
     gtk_style_context_save(style);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1155
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1156
@@ -3130,15 +3348,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1157
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1158
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1159
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1160
-    gtk_widget_style_get (gHorizScrollbarWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1161
+    gtk_widget_style_get (gHorizScrollbar.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1162
                           "slider_width", &metrics->slider_width,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1163
                           "trough_border", &metrics->trough_border,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1164
                           "stepper_size", &metrics->stepper_size,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1165
                           "stepper_spacing", &metrics->stepper_spacing,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1166
                           NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1167
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1168
-    metrics->min_slider_size = 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1169
-        gtk_range_get_min_slider_size(GTK_RANGE(gHorizScrollbarWidget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1170
+    if (!gtk_check_version(3,19,7)) {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1171
+        gtk_style_context_get(gVertScrollbar.scroll.styleSlider, 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1172
+                              gtk_style_context_get_state(gVertScrollbar.scroll.styleSlider), 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1173
+                              "min-height", &metrics->min_slider_size, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1174
+    } else {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1175
+        metrics->min_slider_size = 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1176
+            gtk_range_get_min_slider_size(GTK_RANGE(gVertScrollbar.widget));
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1177
+    }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1178
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1179
     return MOZ_GTK_SUCCESS;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1180
 }
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1181
@@ -3163,7 +3387,7 @@ moz_gtk_images_in_buttons()
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1182
     GtkSettings* settings;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1183
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1184
     ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1185
-    settings = gtk_widget_get_settings(gButtonWidget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1186
+    settings = gtk_widget_get_settings(gButton.widget);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1187
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1188
     g_object_get(settings, "gtk-button-images", &result, NULL);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1189
     return result;
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1190
@@ -3191,7 +3415,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1191
         }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1192
         ensure_button_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1193
         return moz_gtk_button_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1194
-                                    (GtkReliefStyle) flags, gButtonWidget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1195
+                                    (GtkReliefStyle) flags, gButton.widget,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1196
                                     direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1197
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1198
     case MOZ_GTK_CHECKBUTTON:
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1199
@@ -3241,7 +3465,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1200
     case MOZ_GTK_SPINBUTTON_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1201
         ensure_spin_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1202
         return moz_gtk_entry_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1203
-                                   gSpinWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1204
+                                   &gSpin, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1205
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1206
     case MOZ_GTK_GRIPPER:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1207
         return moz_gtk_gripper_paint(cr, rect, state,
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1208
@@ -3268,7 +3492,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1209
     case MOZ_GTK_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1210
         ensure_entry_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1211
         return moz_gtk_entry_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1212
-                                   gEntryWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1213
+                                   &gEntry, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1214
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1215
     case MOZ_GTK_DROPDOWN:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1216
         return moz_gtk_combo_box_paint(cr, rect, state, direction);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1217
@@ -3280,7 +3504,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1218
     case MOZ_GTK_DROPDOWN_ENTRY:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1219
         ensure_combo_box_entry_widgets();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1220
         return moz_gtk_entry_paint(cr, rect, state,
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1221
-                                   gComboBoxEntryTextareaWidget, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1222
+                                   &gComboBoxEntryTextarea, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1223
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1224
     case MOZ_GTK_CHECKBUTTON_CONTAINER:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1225
     case MOZ_GTK_RADIOBUTTON_CONTAINER:
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1226
@@ -3332,7 +3556,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1227
                                               (GtkArrowType) flags, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1228
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1229
     case MOZ_GTK_MENUBAR:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1230
-        return moz_gtk_menu_bar_paint(cr, rect, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1231
+        return moz_gtk_menu_bar_paint(cr, rect, state, direction);
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1232
         break;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1233
     case MOZ_GTK_MENUPOPUP:
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1234
         return moz_gtk_menu_popup_paint(cr, rect, direction);
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1235
@@ -3383,7 +3607,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget(
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1236
 {
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1237
     MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1238
     ensure_scrollbar_widget();
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1239
-    return gHorizScrollbarWidget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1240
+    return gVertScrollbar.widget;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1241
 }
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1242
 
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1243
 gboolean moz_gtk_has_scrollbar_buttons(void)
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 908
diff changeset
  1244
@@ -3391,7 +3615,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v
907
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1245
     gboolean backward, forward, secondary_backward, secondary_forward;
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1246
     MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()");
3ccb278a9ceb prepare gtk3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1247
     ensure_scrollbar_widget();