return TRUE;
}
-static GtkWidgetPath *
-gtk_css_node_real_create_widget_path (GtkCssNode *cssnode)
-{
- return gtk_widget_path_new ();
-}
-
-static const GtkWidgetPath *
-gtk_css_node_real_get_widget_path (GtkCssNode *cssnode)
-{
- return NULL;
-}
-
static GtkStyleProvider *
gtk_css_node_real_get_style_provider (GtkCssNode *cssnode)
{
klass->queue_validate = gtk_css_node_real_queue_validate;
klass->dequeue_validate = gtk_css_node_real_dequeue_validate;
klass->init_matcher = gtk_css_node_real_init_matcher;
- klass->create_widget_path = gtk_css_node_real_create_widget_path;
- klass->get_widget_path = gtk_css_node_real_get_widget_path;
klass->get_style_provider = gtk_css_node_real_get_style_provider;
klass->get_frame_clock = gtk_css_node_real_get_frame_clock;
return GTK_CSS_NODE_GET_CLASS (cssnode)->init_matcher (cssnode, matcher);
}
-GtkWidgetPath *
-gtk_css_node_create_widget_path (GtkCssNode *cssnode)
-{
- return GTK_CSS_NODE_GET_CLASS (cssnode)->create_widget_path (cssnode);
-}
-
-const GtkWidgetPath *
-gtk_css_node_get_widget_path (GtkCssNode *cssnode)
-{
- return GTK_CSS_NODE_GET_CLASS (cssnode)->get_widget_path (cssnode);
-}
-
GtkStyleProvider *
gtk_css_node_get_style_provider (GtkCssNode *cssnode)
{
gboolean (* init_matcher) (GtkCssNode *cssnode,
GtkCssMatcher *matcher);
- GtkWidgetPath * (* create_widget_path) (GtkCssNode *cssnode);
- const GtkWidgetPath * (* get_widget_path) (GtkCssNode *cssnode);
/* get style provider to use or NULL to use parent's */
GtkStyleProvider * (* get_style_provider) (GtkCssNode *cssnode);
/* get frame clock or NULL (only relevant for root node) */
gboolean gtk_css_node_init_matcher (GtkCssNode *cssnode,
GtkCssMatcher *matcher);
-GtkWidgetPath * gtk_css_node_create_widget_path (GtkCssNode *cssnode);
-const GtkWidgetPath * gtk_css_node_get_widget_path (GtkCssNode *cssnode) G_GNUC_PURE;
GtkStyleProvider * gtk_css_node_get_style_provider (GtkCssNode *cssnode) G_GNUC_PURE;
void gtk_css_node_print (GtkCssNode *cssnode,
gtk_css_node_get_declaration (node));
}
-static GtkWidgetPath *
-gtk_css_path_node_real_create_widget_path (GtkCssNode *node)
-{
- GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);
- GtkWidgetPath *path;
- guint length;
-
- if (path_node->path == NULL)
- path = gtk_widget_path_new ();
- else
- path = gtk_widget_path_copy (path_node->path);
-
- length = gtk_widget_path_length (path);
- if (length > 0)
- {
- gtk_css_node_declaration_add_to_widget_path (gtk_css_node_get_declaration (node),
- path,
- length - 1);
- }
-
- return path;
-}
-
-static const GtkWidgetPath *
-gtk_css_path_node_real_get_widget_path (GtkCssNode *node)
-{
- GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);
-
- return path_node->path;
-}
-
static GtkCssStyle *
gtk_css_path_node_update_style (GtkCssNode *cssnode,
GtkCssChange change,
node_class->invalidate = gtk_css_path_node_invalidate;
node_class->update_style = gtk_css_path_node_update_style;
node_class->init_matcher = gtk_css_path_node_real_init_matcher;
- node_class->create_widget_path = gtk_css_path_node_real_create_widget_path;
- node_class->get_widget_path = gtk_css_path_node_real_get_widget_path;
node_class->get_style_provider = gtk_css_path_node_get_style_provider;
}
G_DEFINE_TYPE (GtkCssTransientNode, gtk_css_transient_node, GTK_TYPE_CSS_NODE)
-static GtkWidgetPath *
-gtk_css_transient_node_create_widget_path (GtkCssNode *node)
-{
- GtkWidgetPath *result;
- GtkCssNode *parent;
-
- parent = gtk_css_node_get_parent (node);
- if (parent == NULL)
- result = gtk_widget_path_new ();
- else
- result = gtk_css_node_create_widget_path (parent);
-
- gtk_widget_path_append_type (result, gtk_css_node_get_widget_type (node));
- gtk_css_node_declaration_add_to_widget_path (gtk_css_node_get_declaration (node), result, -1);
-
- return result;
-}
-
-static const GtkWidgetPath *
-gtk_css_transient_node_get_widget_path (GtkCssNode *node)
-{
- GtkCssNode *parent;
-
- parent = gtk_css_node_get_parent (node);
- if (parent == NULL)
- return NULL;
-
- return gtk_css_node_get_widget_path (parent);
-}
-
static GtkCssStyle *
gtk_css_transient_node_update_style (GtkCssNode *cssnode,
GtkCssChange change,
{
GtkCssNodeClass *node_class = GTK_CSS_NODE_CLASS (klass);
- node_class->create_widget_path = gtk_css_transient_node_create_widget_path;
- node_class->get_widget_path = gtk_css_transient_node_get_widget_path;
node_class->update_style = gtk_css_transient_node_update_style;
}
G_OBJECT_CLASS (gtk_css_widget_node_parent_class)->finalize (object);
}
-static void
-gtk_css_widget_node_style_changed (GtkCssNode *cssnode,
- GtkCssStyleChange *change)
-{
- GtkCssWidgetNode *node;
-
- node = GTK_CSS_WIDGET_NODE (cssnode);
-
- if (node->widget)
- gtk_widget_clear_path (node->widget);
-
- GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->style_changed (cssnode, change);
-}
-
static gboolean
gtk_css_widget_node_queue_callback (GtkWidget *widget,
GdkFrameClock *frame_clock,
return GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->init_matcher (node, matcher);
}
-static GtkWidgetPath *
-gtk_css_widget_node_create_widget_path (GtkCssNode *node)
-{
- GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
- GtkWidgetPath *path;
- guint length;
-
- if (widget_node->widget == NULL)
- path = gtk_widget_path_new ();
- else
- path = _gtk_widget_create_path (widget_node->widget);
-
- length = gtk_widget_path_length (path);
- if (length > 0)
- {
- gtk_css_node_declaration_add_to_widget_path (gtk_css_node_get_declaration (node),
- path,
- length - 1);
- }
-
- return path;
-}
-
-static const GtkWidgetPath *
-gtk_css_widget_node_get_widget_path (GtkCssNode *node)
-{
- GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
-
- if (widget_node->widget == NULL)
- return NULL;
-
- return gtk_widget_get_path (widget_node->widget);
-}
-
static GtkStyleProvider *
gtk_css_widget_node_get_style_provider (GtkCssNode *node)
{
node_class->queue_validate = gtk_css_widget_node_queue_validate;
node_class->dequeue_validate = gtk_css_widget_node_dequeue_validate;
node_class->init_matcher = gtk_css_widget_node_init_matcher;
- node_class->create_widget_path = gtk_css_widget_node_create_widget_path;
- node_class->get_widget_path = gtk_css_widget_node_get_widget_path;
node_class->get_style_provider = gtk_css_widget_node_get_style_provider;
node_class->get_frame_clock = gtk_css_widget_node_get_frame_clock;
- node_class->style_changed = gtk_css_widget_node_style_changed;
}
static void