[gtk+/wip/otte/snapshot: 11/30] snapshot: Add a snapshot function to GtkCssCustomGadget



commit b01785454e64479c7fbc8c812624b501bd264599
Author: Benjamin Otte <otte redhat com>
Date:   Sun Nov 13 21:08:34 2016 +0100

    snapshot: Add a snapshot function to GtkCssCustomGadget

 gtk/gtkactionbar.c              |    1 +
 gtk/gtkbbox.c                   |    1 +
 gtk/gtkbox.c                    |    1 +
 gtk/gtkbutton.c                 |    1 +
 gtk/gtkcellview.c               |    1 +
 gtk/gtkcolorswatch.c            |    1 +
 gtk/gtkcombobox.c               |    1 +
 gtk/gtkcsscustomgadget.c        |   43 +++++++++++++++++++++++++++++++++++++++
 gtk/gtkcsscustomgadgetprivate.h |    9 ++++++++
 gtk/gtkentry.c                  |    2 +
 gtk/gtkflowbox.c                |    2 +
 gtk/gtkframe.c                  |   18 +++++++++-------
 gtk/gtkgrid.c                   |    1 +
 gtk/gtkheaderbar.c              |    1 +
 gtk/gtkimage.c                  |    1 +
 gtk/gtklabel.c                  |    1 +
 gtk/gtklevelbar.c               |    2 +
 gtk/gtklistbox.c                |    2 +
 gtk/gtkmenubar.c                |    1 +
 gtk/gtkmenuitem.c               |    1 +
 gtk/gtkmodelbutton.c            |    1 +
 gtk/gtknotebook.c               |    3 ++
 gtk/gtkpaned.c                  |    2 +
 gtk/gtkprogressbar.c            |    4 +++
 gtk/gtkrange.c                  |    4 +++
 gtk/gtkscale.c                  |    6 +++++
 gtk/gtkscrolledwindow.c         |    1 +
 gtk/gtkseparator.c              |    1 +
 gtk/gtkseparatortoolitem.c      |    1 +
 gtk/gtkstack.c                  |    1 +
 gtk/gtkswitch.c                 |    2 +
 gtk/gtktoolbar.c                |    1 +
 gtk/gtkviewport.c               |    1 +
 33 files changed, 111 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkactionbar.c b/gtk/gtkactionbar.c
index 9de2de0..3bf456a 100644
--- a/gtk/gtkactionbar.c
+++ b/gtk/gtkactionbar.c
@@ -351,6 +351,7 @@ gtk_action_bar_init (GtkActionBar *action_bar)
                                                      gtk_action_bar_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 }
 
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c
index 111a638..98f8710 100644
--- a/gtk/gtkbbox.c
+++ b/gtk/gtkbbox.c
@@ -237,6 +237,7 @@ gtk_button_box_init (GtkButtonBox *button_box)
                                                          gtk_button_box_allocate,
                                                          NULL,
                                                          NULL,
+                                                         NULL,
                                                          NULL);
 }
 
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 6c1c3b7..4f4f395 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -1971,6 +1971,7 @@ gtk_box_init (GtkBox *box)
                                                         gtk_box_allocate_contents,
                                                         NULL,
                                                         NULL,
+                                                        NULL,
                                                         NULL);
 
   _gtk_orientable_set_style_classes (GTK_ORIENTABLE (box));
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 62b7109..f63a725 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -475,6 +475,7 @@ gtk_button_init (GtkButton *button)
                                                      gtk_button_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
 }
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index 2ae9e93..9e831f7 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -515,6 +515,7 @@ gtk_cell_view_init (GtkCellView *cellview)
                                                                gtk_cell_view_allocate,
                                                                gtk_cell_view_render,
                                                                NULL,
+                                                               NULL,
                                                                NULL);
 }
 
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index 4aedcc3..15f6b6c 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -739,6 +739,7 @@ gtk_color_swatch_init (GtkColorSwatch *swatch)
                                                              NULL,
                                                              gtk_color_swatch_render,
                                                              NULL,
+                                                             NULL,
                                                              NULL);
   gtk_css_gadget_add_class (swatch->priv->gadget, "activatable");
 
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 2a007a3..929b8be 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1166,6 +1166,7 @@ gtk_combo_box_init (GtkComboBox *combo_box)
                                                      gtk_combo_box_measure,
                                                      gtk_combo_box_allocate,
                                                      NULL,
+                                                     NULL,
                                                      NULL, NULL);
 }
 
diff --git a/gtk/gtkcsscustomgadget.c b/gtk/gtkcsscustomgadget.c
index 7cf9096..7d54884 100644
--- a/gtk/gtkcsscustomgadget.c
+++ b/gtk/gtkcsscustomgadget.c
@@ -95,6 +95,23 @@
  * Typically, GtkCssDrawFunc will draw sub-gadgets and child widgets
  * that are placed relative to the gadget, as well as custom content
  * such as icons, checkmarks, arrows or text.
+ *
+ * GtkCssSnapshotFunc:
+ * @gadget: the #GtkCssCustomGadget
+ * @snapshot: the snapshot to snapshot to
+ * @x: the x origin of the content area
+ * @y: the y origin of the content area
+ * @width: the width of the content area
+ * @height: the height of the content area
+ * @data: data provided when registering the callback
+ *
+ * The GtkCssSnapshotFunc is called to snapshot the gadget's content in
+ * gtk_css_gadget_snapshot(). It gets passed an untransformed cairo context
+ * and the coordinates of the area to draw the content in.
+ *
+ * Typically, GtkCssSnapshotFunc will draw sub-gadgets and child widgets
+ * that are placed relative to the gadget, as well as custom content
+ * such as icons, checkmarks, arrows or text.
  */
 
 typedef struct _GtkCssCustomGadgetPrivate GtkCssCustomGadgetPrivate;
@@ -102,6 +119,7 @@ struct _GtkCssCustomGadgetPrivate {
   GtkCssPreferredSizeFunc          preferred_size_func;
   GtkCssAllocateFunc               allocate_func;
   GtkCssDrawFunc                   draw_func;
+  GtkCssSnapshotFunc               snapshot_func;
   gpointer                         data;
   GDestroyNotify                   destroy_func;
 };
@@ -162,6 +180,24 @@ gtk_css_custom_gadget_draw (GtkCssGadget *gadget,
 }
 
 static gboolean
+gtk_css_custom_gadget_snapshot (GtkCssGadget *gadget,
+                                GtkSnapshot  *snapshot,
+                                int           x,
+                                int           y,
+                                int           width,
+                                int           height)
+{
+  GtkCssCustomGadgetPrivate *priv = gtk_css_custom_gadget_get_instance_private (GTK_CSS_CUSTOM_GADGET 
(gadget));
+
+  if (priv->snapshot_func)
+    return priv->snapshot_func (gadget, snapshot, x, y, width, height, priv->data);
+  else if (priv->draw_func)
+    return GTK_CSS_GADGET_CLASS (gtk_css_custom_gadget_parent_class)->snapshot (gadget, snapshot, x, y, 
width, height);
+  else
+    return FALSE;
+}
+
+static gboolean
 gtk_css_custom_gadget_has_content (GtkCssGadget *gadget)
 {
   GtkCssCustomGadgetPrivate *priv = gtk_css_custom_gadget_get_instance_private (GTK_CSS_CUSTOM_GADGET 
(gadget));
@@ -191,6 +227,7 @@ gtk_css_custom_gadget_class_init (GtkCssCustomGadgetClass *klass)
   gadget_class->get_preferred_size = gtk_css_custom_gadget_get_preferred_size;
   gadget_class->allocate = gtk_css_custom_gadget_allocate;
   gadget_class->draw = gtk_css_custom_gadget_draw;
+  gadget_class->snapshot = gtk_css_custom_gadget_snapshot;
   gadget_class->has_content = gtk_css_custom_gadget_has_content;
 }
 
@@ -207,6 +244,7 @@ gtk_css_custom_gadget_init (GtkCssCustomGadget *custom_gadget)
  * @preferred_size_func: (nullable): the GtkCssPreferredSizeFunc to use
  * @allocate_func: (nullable): the GtkCssAllocateFunc to use
  * @draw_func: (nullable): the GtkCssDrawFunc to use
+ * @snapshot_func: (nullable): the GtkCssSnapshotFunc to use
  * @data: (nullable): user data to pass to the callbacks
  * @destroy_func: (nullable): destroy notify for @data
  *
@@ -227,6 +265,7 @@ gtk_css_custom_gadget_new_for_node (GtkCssNode                 *node,
                                     GtkCssPreferredSizeFunc     preferred_size_func,
                                     GtkCssAllocateFunc          allocate_func,
                                     GtkCssDrawFunc              draw_func,
+                                    GtkCssSnapshotFunc          snapshot_func,
                                     gpointer                    data,
                                     GDestroyNotify              destroy_func)
 {
@@ -243,6 +282,7 @@ gtk_css_custom_gadget_new_for_node (GtkCssNode                 *node,
   priv->preferred_size_func = preferred_size_func;
   priv->allocate_func = allocate_func;
   priv->draw_func = draw_func;
+  priv->snapshot_func = snapshot_func;
   priv->data = data;
   priv->destroy_func = destroy_func;
 
@@ -258,6 +298,7 @@ gtk_css_custom_gadget_new_for_node (GtkCssNode                 *node,
  * @preferred_size_func: (nullable): the GtkCssPreferredSizeFunc to use
  * @allocate_func: (nullable): the GtkCssAllocateFunc to use
  * @draw_func: (nullable): the GtkCssDrawFunc to use
+ * @snapshot_func: (nullable): the GtkCssSnapshotFunc to use
  * @data: (nullable): user data to pass to the callbacks
  * @destroy_func: (nullable): destroy notify for @data
  *
@@ -274,6 +315,7 @@ gtk_css_custom_gadget_new (const char                 *name,
                            GtkCssPreferredSizeFunc     preferred_size_func,
                            GtkCssAllocateFunc          allocate_func,
                            GtkCssDrawFunc              draw_func,
+                           GtkCssSnapshotFunc          snapshot_func,
                            gpointer                    data,
                            GDestroyNotify              destroy_func)
 {
@@ -292,6 +334,7 @@ gtk_css_custom_gadget_new (const char                 *name,
                                                preferred_size_func,
                                                allocate_func,
                                                draw_func,
+                                               snapshot_func,
                                                data,
                                                destroy_func);
 
diff --git a/gtk/gtkcsscustomgadgetprivate.h b/gtk/gtkcsscustomgadgetprivate.h
index 994237a..0d1d33f 100644
--- a/gtk/gtkcsscustomgadgetprivate.h
+++ b/gtk/gtkcsscustomgadgetprivate.h
@@ -54,6 +54,13 @@ typedef gboolean (* GtkCssDrawFunc)                     (GtkCssGadget
                                                          int                     width,
                                                          int                     height,
                                                          gpointer                data);
+typedef gboolean (* GtkCssSnapshotFunc)                 (GtkCssGadget           *gadget,
+                                                         GtkSnapshot            *snapshot,
+                                                         int                     x,
+                                                         int                     y,
+                                                         int                     width,
+                                                         int                     height,
+                                                         gpointer                data);
 struct _GtkCssCustomGadget
 {
   GtkCssGadget parent;
@@ -73,6 +80,7 @@ GtkCssGadget *  gtk_css_custom_gadget_new                      (const char
                                                                 GtkCssPreferredSizeFunc          
get_preferred_size_func,
                                                                 GtkCssAllocateFunc               
allocate_func,
                                                                 GtkCssDrawFunc                   draw_func,
+                                                                GtkCssSnapshotFunc               
snapshot_func,
                                                                 gpointer                         data,
                                                                 GDestroyNotify                   
destroy_func);
 GtkCssGadget *  gtk_css_custom_gadget_new_for_node             (GtkCssNode                      *node,
@@ -80,6 +88,7 @@ GtkCssGadget *  gtk_css_custom_gadget_new_for_node             (GtkCssNode
                                                                 GtkCssPreferredSizeFunc          
preferred_size_func,
                                                                 GtkCssAllocateFunc               
allocate_func,
                                                                 GtkCssDrawFunc                   draw_func,
+                                                                GtkCssSnapshotFunc               
snapshot_func,
                                                                 gpointer                         data,
                                                                 GDestroyNotify                   
destroy_func);
 
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index b57a1ac..5f71e8e 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2515,6 +2515,7 @@ gtk_entry_init (GtkEntry *entry)
                                                      gtk_entry_allocate,
                                                      gtk_entry_render,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
   for (i = 0; i < 2; i++)
@@ -9907,6 +9908,7 @@ gtk_entry_ensure_progress_gadget (GtkEntry *entry)
                                                      NULL,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
   gtk_css_gadget_set_state (priv->progress_gadget,
       gtk_css_node_get_state (gtk_widget_get_css_node (GTK_WIDGET (entry))));
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index bac2cfa..f08a725 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -599,6 +599,7 @@ gtk_flow_box_child_init (GtkFlowBoxChild *child)
                                                      gtk_flow_box_child_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 }
 
@@ -4098,6 +4099,7 @@ gtk_flow_box_init (GtkFlowBox *box)
                                                      gtk_flow_box_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 }
 
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index d362de7..de8a018 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -297,16 +297,18 @@ gtk_frame_init (GtkFrame *frame)
                                                      gtk_frame_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
   priv->border_gadget = gtk_css_custom_gadget_new ("border",
-                                                       GTK_WIDGET (frame),
-                                                       priv->gadget,
-                                                       NULL,
-                                                       gtk_frame_measure_border,
-                                                       gtk_frame_allocate_border,
-                                                       NULL,
-                                                       NULL,
-                                                       NULL);
+                                                   GTK_WIDGET (frame),
+                                                   priv->gadget,
+                                                   NULL,
+                                                   gtk_frame_measure_border,
+                                                   gtk_frame_allocate_border,
+                                                   NULL,
+                                                   NULL,
+                                                   NULL,
+                                                   NULL);
 
   gtk_css_gadget_set_state (priv->border_gadget, gtk_widget_get_state_flags (GTK_WIDGET (frame)));
 }
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index 729904c..8c6a258 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -1793,6 +1793,7 @@ gtk_grid_init (GtkGrid *grid)
                                                      gtk_grid_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
 
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 592abe3..49e1e8d 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -2069,6 +2069,7 @@ gtk_header_bar_init (GtkHeaderBar *bar)
                                                      gtk_header_bar_allocate_contents,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
 }
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 7d5e99f..8712d81 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -367,6 +367,7 @@ gtk_image_init (GtkImage *image)
                                                      gtk_image_get_content_size,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL, NULL);
 }
 
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 16943f9..5461d3f 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1372,6 +1372,7 @@ gtk_label_init (GtkLabel *label)
                                                      NULL,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 }
 
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index 33bf44c..4d454bd 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -594,6 +594,7 @@ update_block_nodes (GtkLevelBar *self)
                                                              GTK_WIDGET (self),
                                                              priv->trough_gadget,
                                                              NULL,
+                                                             NULL,
                                                              NULL, NULL, NULL,
                                                              NULL, NULL);
           gtk_css_gadget_set_state (priv->block_gadget[i], gtk_css_node_get_state (trough_node));
@@ -1109,6 +1110,7 @@ gtk_level_bar_init (GtkLevelBar *self)
                                                    gtk_level_bar_measure_trough,
                                                    gtk_level_bar_allocate_trough,
                                                    gtk_level_bar_render_trough,
+                                                   NULL,
                                                    NULL, NULL);
   trough_node = gtk_css_gadget_get_node (priv->trough_gadget);
   gtk_css_node_set_parent (trough_node, widget_node);
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 6d796bb..86d6969 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -654,6 +654,7 @@ gtk_list_box_init (GtkListBox *box)
                                                      gtk_list_box_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
 }
@@ -3765,6 +3766,7 @@ gtk_list_box_row_init (GtkListBoxRow *row)
                                                      gtk_list_box_row_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
   gtk_css_gadget_add_class (ROW_PRIV (row)->gadget, "activatable");
 }
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index f8094ef..fa56e09 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -247,6 +247,7 @@ gtk_menu_bar_init (GtkMenuBar *menu_bar)
                                                      gtk_menu_bar_measure,
                                                      gtk_menu_bar_allocate,
                                                      gtk_menu_bar_render,
+                                                     NULL,
                                                      NULL, NULL);
 }
 
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index f77ea0a..fd8ce98 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -784,6 +784,7 @@ gtk_menu_item_init (GtkMenuItem *menu_item)
                                                      gtk_menu_item_measure,
                                                      gtk_menu_item_allocate,
                                                      gtk_menu_item_render,
+                                                     NULL,
                                                      NULL, NULL);
 }
 
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 26b647c..443abc1 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -1148,6 +1148,7 @@ gtk_model_button_init (GtkModelButton *button)
                                                        gtk_model_button_allocate,
                                                        NULL,
                                                        NULL,
+                                                       NULL,
                                                        NULL);
   button->indicator_gadget = gtk_builtin_icon_new ("check",
                                                    GTK_WIDGET (button),
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 53e3957..5f0144f 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1217,6 +1217,7 @@ gtk_notebook_init (GtkNotebook *notebook)
                                                   gtk_notebook_allocate_stack,
                                                   gtk_notebook_draw_stack,
                                                   NULL,
+                                                  NULL,
                                                   NULL);
   gtk_css_gadget_set_state (priv->stack_gadget, gtk_css_node_get_state (widget_node));
   gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), -1, priv->stack_gadget, TRUE, GTK_ALIGN_FILL);
@@ -1238,6 +1239,7 @@ gtk_notebook_init (GtkNotebook *notebook)
                                                  gtk_notebook_allocate_tabs,
                                                  gtk_notebook_draw_tabs,
                                                  NULL,
+                                                 NULL,
                                                  NULL);
   gtk_css_gadget_set_state (priv->tabs_gadget, gtk_css_node_get_state (widget_node));
   gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->header_gadget), 0, priv->tabs_gadget, TRUE, 
GTK_ALIGN_FILL);
@@ -4637,6 +4639,7 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
                                             measure_tab,
                                             allocate_tab,
                                             draw_tab,
+                                            NULL,
                                             page,
                                             NULL);
   if (priv->tabs_reversed)
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 99ce300..d55bfb8 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -1753,6 +1753,7 @@ gtk_paned_init (GtkPaned *paned)
                                                      gtk_paned_allocate,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
   priv->handle_gadget = gtk_css_custom_gadget_new ("separator",
                                                    GTK_WIDGET (paned),
@@ -1762,6 +1763,7 @@ gtk_paned_init (GtkPaned *paned)
                                                    NULL,
                                                    NULL,
                                                    NULL,
+                                                   NULL,
                                                    NULL);
   update_node_state (GTK_WIDGET (paned));
 }
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index d42f7f4..6a0c8e8 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -441,6 +441,7 @@ gtk_progress_bar_init (GtkProgressBar *pbar)
                                                      gtk_progress_bar_allocate,
                                                      gtk_progress_bar_render,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
   priv->trough_gadget = gtk_css_custom_gadget_new ("trough",
@@ -451,6 +452,7 @@ gtk_progress_bar_init (GtkProgressBar *pbar)
                                                    gtk_progress_bar_allocate_trough,
                                                    gtk_progress_bar_render_trough,
                                                    NULL,
+                                                   NULL,
                                                    NULL);
 
   priv->progress_gadget = gtk_css_custom_gadget_new ("progress",
@@ -461,6 +463,7 @@ gtk_progress_bar_init (GtkProgressBar *pbar)
                                                      NULL,
                                                      NULL,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
   update_node_state (pbar);
@@ -1323,6 +1326,7 @@ gtk_progress_bar_set_show_text (GtkProgressBar *pbar,
                                                      NULL,
                                                      gtk_progress_bar_render_text,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
       g_signal_connect (gtk_css_gadget_get_node (priv->text_gadget), "style-changed",
                         G_CALLBACK (gtk_progress_bar_text_style_changed), pbar);
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 5b1f2dc..a7658e2 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -668,6 +668,7 @@ gtk_range_init (GtkRange *range)
                                                      gtk_range_measure,
                                                      gtk_range_allocate,
                                                      gtk_range_render,
+                                                     NULL,
                                                      NULL, NULL);
   priv->contents_gadget = gtk_box_gadget_new ("contents",
                                               GTK_WIDGET (range),
@@ -678,6 +679,7 @@ gtk_range_init (GtkRange *range)
                                                    gtk_range_measure_trough,
                                                    gtk_range_allocate_trough,
                                                    gtk_range_render_trough,
+                                                   NULL,
                                                    NULL, NULL);
   gtk_css_gadget_set_state (priv->trough_gadget,
                             gtk_css_node_get_state (widget_node));
@@ -1390,6 +1392,7 @@ gtk_range_set_show_fill_level (GtkRange *range,
                                                      GTK_WIDGET (range),
                                                      priv->trough_gadget, NULL,
                                                      NULL, NULL, NULL,
+                                                     NULL,
                                                      NULL, NULL);
       gtk_css_gadget_set_state (priv->fill_gadget,
                                 gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
@@ -3609,6 +3612,7 @@ _gtk_range_set_has_origin (GtkRange *range,
                                                           GTK_WIDGET (range),
                                                           priv->trough_gadget, NULL,
                                                           NULL, NULL, NULL,
+                                                          NULL,
                                                           NULL, NULL);
       gtk_css_gadget_set_state (priv->highlight_gadget,
                                 gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index f621ab4..82edd96 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1289,6 +1289,7 @@ gtk_scale_set_draw_value (GtkScale *scale,
                                                           gtk_scale_measure_value,
                                                           NULL,
                                                           gtk_scale_render_value,
+                                                          NULL,
                                                           NULL, NULL);
           g_signal_connect (gtk_css_gadget_get_node (priv->value_gadget), "style-changed",
                             G_CALLBACK (gtk_scale_value_style_changed), scale);
@@ -2165,6 +2166,7 @@ gtk_scale_add_mark (GtkScale        *scale,
                                        gtk_scale_measure_marks,
                                        gtk_scale_allocate_marks,
                                        gtk_scale_render_marks,
+                                       NULL,
                                        NULL, NULL);
           gtk_css_node_insert_after (widget_node,
                                      gtk_css_gadget_get_node (priv->top_marks_gadget),
@@ -2186,6 +2188,7 @@ gtk_scale_add_mark (GtkScale        *scale,
                                        gtk_scale_measure_marks,
                                        gtk_scale_allocate_marks,
                                        gtk_scale_render_marks,
+                                       NULL,
                                        NULL, NULL);
           gtk_css_node_insert_before (widget_node,
                                       gtk_css_gadget_get_node (priv->bottom_marks_gadget),
@@ -2204,6 +2207,7 @@ gtk_scale_add_mark (GtkScale        *scale,
                                gtk_scale_measure_mark,
                                gtk_scale_allocate_mark,
                                gtk_scale_render_mark,
+                               NULL,
                                mark, NULL);
   gtk_css_gadget_set_state (mark->gadget, gtk_css_node_get_state (marks_node));
 
@@ -2213,6 +2217,7 @@ gtk_scale_add_mark (GtkScale        *scale,
                                NULL,
                                NULL,
                                gtk_scale_render_mark_indicator,
+                               NULL,
                                mark, NULL);
   if (mark->markup && *mark->markup)
     {
@@ -2224,6 +2229,7 @@ gtk_scale_add_mark (GtkScale        *scale,
                                    gtk_scale_measure_mark_label,
                                    NULL,
                                    gtk_scale_render_mark_label,
+                                   NULL,
                                    mark, NULL);
       g_signal_connect (gtk_css_gadget_get_node (mark->label_gadget), "style-changed",
                         G_CALLBACK (gtk_scale_mark_style_changed), mark);
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index a662234..b3da720 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -2075,6 +2075,7 @@ gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window)
                                                      gtk_scrolled_window_measure,
                                                      gtk_scrolled_window_allocate,
                                                      gtk_scrolled_window_render,
+                                                     NULL,
                                                      NULL, NULL);
   for (i = 0; i < 4; i++)
     {
diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c
index c3f9978..ef211f3 100644
--- a/gtk/gtkseparator.c
+++ b/gtk/gtkseparator.c
@@ -161,6 +161,7 @@ gtk_separator_init (GtkSeparator *separator)
   separator->priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
                                                                 GTK_WIDGET (separator),
                                                                 NULL, NULL, NULL,
+                                                                NULL,
                                                                 NULL, NULL);
 }
 
diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c
index 219955e..650dd5f 100644
--- a/gtk/gtkseparatortoolitem.c
+++ b/gtk/gtkseparatortoolitem.c
@@ -166,6 +166,7 @@ gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item)
     gtk_css_custom_gadget_new_for_node (widget_node,
                                         widget,
                                         NULL, NULL, NULL,
+                                        NULL,
                                         NULL, NULL);
 }
 
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index b865104..f1c6ec1 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2393,6 +2393,7 @@ gtk_stack_init (GtkStack *stack)
                                                      gtk_stack_allocate,
                                                      gtk_stack_render,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
 }
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index 28760f1..1ac6df5 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -879,6 +879,7 @@ gtk_switch_init (GtkSwitch *self)
                                                      gtk_switch_allocate_contents,
                                                      gtk_switch_render_trough,
                                                      NULL,
+                                                     NULL,
                                                      NULL);
 
   priv->slider_gadget = gtk_css_custom_gadget_new ("slider",
@@ -889,6 +890,7 @@ gtk_switch_init (GtkSwitch *self)
                                                    NULL,
                                                    gtk_switch_render_slider,
                                                    NULL,
+                                                   NULL,
                                                    NULL);
 
   gesture = gtk_gesture_multi_press_new (GTK_WIDGET (self));
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index fd2f4f1..03d887e 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -648,6 +648,7 @@ gtk_toolbar_init (GtkToolbar *toolbar)
                                                      gtk_toolbar_measure,
                                                      gtk_toolbar_allocate,
                                                      gtk_toolbar_render,
+                                                     NULL,
                                                      NULL, NULL);
 
   priv->arrow_button = gtk_toggle_button_new ();
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 0a199ae..8360dba 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -477,6 +477,7 @@ gtk_viewport_init (GtkViewport *viewport)
                                                      gtk_viewport_measure,
                                                      gtk_viewport_allocate,
                                                      gtk_viewport_render,
+                                                     NULL,
                                                      NULL, NULL);
 
   gtk_css_gadget_add_class (priv->gadget, GTK_STYLE_CLASS_FRAME);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]