diff options
author | Robert Staudinger <robsta@gnome.org> | 2009-09-09 15:43:39 +0200 |
---|---|---|
committer | Robert Staudinger <robsta@gnome.org> | 2009-09-09 15:43:39 +0200 |
commit | aaed6b2b1a206b7a0c55a786b980bdec21004a93 (patch) | |
tree | 1b375feb018800431ef41bdec4595e6996642e69 /ccss-gtk | |
parent | 9a989b7b319ab7ab79c95e6a7a756f5843ece087 (diff) |
All structs except node-class are removed from the public API.
The ccss-node struct is no more embeddable, a new user-data
API makes up for that.
Diffstat (limited to 'ccss-gtk')
-rw-r--r-- | ccss-gtk/ccss-gtk-property.h | 1 | ||||
-rw-r--r-- | ccss-gtk/ccss-gtk-stylesheet.c | 56 |
2 files changed, 33 insertions, 24 deletions
diff --git a/ccss-gtk/ccss-gtk-property.h b/ccss-gtk/ccss-gtk-property.h index 62c03dc..c4164a2 100644 --- a/ccss-gtk/ccss-gtk-property.h +++ b/ccss-gtk/ccss-gtk-property.h @@ -28,6 +28,7 @@ #endif #endif +#include <ccss/ccss-property-impl.h> #include <ccss-cairo/ccss-cairo.h> #include <gtk/gtk.h> diff --git a/ccss-gtk/ccss-gtk-stylesheet.c b/ccss-gtk/ccss-gtk-stylesheet.c index 44d070a..04e3691 100644 --- a/ccss-gtk/ccss-gtk-stylesheet.c +++ b/ccss-gtk/ccss-gtk-stylesheet.c @@ -25,42 +25,47 @@ #include "config.h" /* - * Node implementation for querying the stylesheet. + * Widget implementation for querying the stylesheet. */ typedef struct { - ccss_node_t parent; char const *type_name; char const *id; char const *pseudo_classes[2]; -} Node; +} Widget; static char const * -get_type (Node const *self) +get_type (ccss_node_t const *self) { - return self->type_name; + Widget *w = ccss_node_get_user_data (self); + + return w->type_name; } static char const * -get_id (Node const *self) +get_id (ccss_node_t const *self) { - return self->id; + Widget *w = ccss_node_get_user_data (self); + + return w->id; } static char const ** -get_pseudo_classes (Node const *self) +get_pseudo_classes (ccss_node_t const *self) { - return (char const **) self->pseudo_classes; + Widget *w = ccss_node_get_user_data (self); + + return (char const **) w->pseudo_classes; } static ccss_node_class_t _node_class = { .is_a = NULL, .get_container = NULL, .get_base_style = NULL, - .get_id = (ccss_node_get_id_f) get_id, - .get_type = (ccss_node_get_type_f) get_type, + .get_id = get_id, + .get_type = get_type, .get_classes = NULL, - .get_pseudo_classes = (ccss_node_get_pseudo_classes_f) get_pseudo_classes, + .get_pseudo_classes = get_pseudo_classes, .get_attribute = NULL, .get_viewport = NULL, .release = NULL @@ -243,18 +248,21 @@ accumulate_state (ccss_stylesheet_t *stylesheet, struct RcState *state, GSList **style_properties) { - ccss_style_t *style; - Node node; - char *color; - gboolean ret; - - ccss_node_init (&node.parent, &_node_class); - node.type_name = type_name; - node.id = NULL; - node.pseudo_classes[0] = state_name; - node.pseudo_classes[1] = NULL; - - style = ccss_stylesheet_query (stylesheet, &node.parent); + ccss_style_t *style; + ccss_node_t *node; + Widget widget; + char *color; + gboolean ret; + + widget.type_name = type_name; + widget.id = NULL; + widget.pseudo_classes[0] = state_name; + widget.pseudo_classes[1] = NULL; + node = ccss_node_create (&_node_class, + CCSS_NODE_CLASS_N_METHODS (_node_class), + &widget); + style = ccss_stylesheet_query (stylesheet, node); + ccss_node_destroy (node); if (!style) { return false; } |