diff options
author | Robert Staudinger <robsta@gnome.org> | 2009-08-10 18:37:06 +0200 |
---|---|---|
committer | Robert Staudinger <robsta@gnome.org> | 2009-08-10 18:37:06 +0200 |
commit | 5df8a82fdda1c97cb8bf9ad7698f45415e0f2c21 (patch) | |
tree | f6f58865c183cc21f50c8498f95da62198c54849 | |
parent | 29e7d7a44cf33fa19b8118ee89002fb628f512d5 (diff) |
[property] Rename "ccss_property_base_t" to "ccss_property_t".
30 files changed, 164 insertions, 166 deletions
diff --git a/ccss-cairo/ccss-cairo-appearance.h b/ccss-cairo/ccss-cairo-appearance.h index 0c6fd0f..9741554 100644 --- a/ccss-cairo/ccss-cairo-appearance.h +++ b/ccss-cairo/ccss-cairo-appearance.h @@ -52,10 +52,10 @@ typedef struct { } ccss_cairo_appearance_module_t; typedef struct { - ccss_property_base_t base; - char *appearance; - ccss_cairo_appearance_module_t *module; - ccss_cairo_appearance_draw_f draw_function; + ccss_property_t base; + char *appearance; + ccss_cairo_appearance_module_t *module; + ccss_cairo_appearance_draw_f draw_function; } ccss_cairo_appearance_t; CCSS_END_DECLS diff --git a/ccss-cairo/ccss-cairo-style.c b/ccss-cairo/ccss-cairo-style.c index 8197a7f..4d0fbcc 100644 --- a/ccss-cairo/ccss-cairo-style.c +++ b/ccss-cairo/ccss-cairo-style.c @@ -31,17 +31,17 @@ #include "config.h" typedef struct { - ccss_property_base_t base; - ccss_cairo_gap_side_t side; + ccss_property_t base; + ccss_cairo_gap_side_t side; } gap_side_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; double start; } gap_start_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; double width; } gap_width_t; @@ -80,16 +80,16 @@ struct { }; /* Look up a property, take fallback into account. */ -static ccss_property_base_t const * +static ccss_property_t const * lookup_property_r (ccss_style_t const *self, char const *property_name) { - GQuark property_id; - ccss_property_base_t const *property = NULL; + GQuark property_id; + ccss_property_t const *property = NULL; property_id = g_quark_try_string (property_name); if (property_id) { - property = (ccss_property_base_t const *) + property = (ccss_property_t const *) g_hash_table_lookup (self->properties, (gpointer) property_id); } @@ -282,7 +282,7 @@ ccss_cairo_style_draw_rectangle (ccss_style_t const *self, ccss_cairo_appearance_t *appearance = NULL; if (ccss_style_get_property (self, "ccss-appearance", - (ccss_property_base_t const **) &appearance) && + (ccss_property_t const **) &appearance) && appearance->base.state == CCSS_PROPERTY_STATE_SET && appearance->draw_function) { @@ -393,7 +393,7 @@ ccss_cairo_style_draw_rectangle_with_gap (ccss_style_t const *self, ccss_cairo_appearance_t *appearance = NULL; if (ccss_style_get_property (self, "ccss-appearance", - (ccss_property_base_t const **) &appearance) && + (ccss_property_t const **) &appearance) && appearance->base.state == CCSS_PROPERTY_STATE_SET && appearance->draw_function) { @@ -679,7 +679,7 @@ ccss_cairo_style_get_double (ccss_style_t const *self, char const *property_name, double *value) { - ccss_property_base_t const *property; + ccss_property_t const *property; g_return_val_if_fail (self && property_name && value, false); @@ -713,7 +713,7 @@ ccss_cairo_style_get_string (ccss_style_t const *self, char const *property_name, char **value) { - ccss_property_base_t const *property; + ccss_property_t const *property; g_return_val_if_fail (self && property_name && value, false); @@ -743,9 +743,9 @@ ccss_cairo_style_get_string (ccss_style_t const *self, * Returns: %TRUE if the property was found. **/ bool -ccss_cairo_style_get_property (ccss_style_t const *self, - char const *property_name, - ccss_property_base_t const **property) +ccss_cairo_style_get_property (ccss_style_t const *self, + char const *property_name, + ccss_property_t const **property) { g_return_val_if_fail (self && property_name && property, false); @@ -755,7 +755,7 @@ ccss_cairo_style_get_property (ccss_style_t const *self, } static void -gap_destroy_nop (ccss_property_base_t *property) +gap_destroy_nop (ccss_property_t *property) { /* Gap properties are stack-allocated. */ } diff --git a/ccss-cairo/ccss-cairo-style.h b/ccss-cairo/ccss-cairo-style.h index 84ae228..dcf77f3 100644 --- a/ccss-cairo/ccss-cairo-style.h +++ b/ccss-cairo/ccss-cairo-style.h @@ -79,9 +79,9 @@ ccss_cairo_style_get_string (ccss_style_t const *self, char **value); bool -ccss_cairo_style_get_property (ccss_style_t const *self, - char const *property_name, - ccss_property_base_t const **property); +ccss_cairo_style_get_property (ccss_style_t const *self, + char const *property_name, + ccss_property_t const **property); CCSS_END_DECLS diff --git a/ccss-doc/ccss-sections.txt b/ccss-doc/ccss-sections.txt index 91f4bd2..dcf10cd 100644 --- a/ccss-doc/ccss-sections.txt +++ b/ccss-doc/ccss-sections.txt @@ -80,6 +80,9 @@ ccss_stylesheet_dump <SECTION> <TITLE>ccss_property_t</TITLE> <FILE>property</FILE> +ccss_property_class_t +ccss_property_t +ccss_property_generic_t ccss_property_state_t ccss_property_type_t ccss_property_create_f @@ -88,9 +91,6 @@ ccss_property_convert_f ccss_property_factory_f ccss_property_inherit_f ccss_property_serialize_f -ccss_property_class_t -ccss_property_base_t -ccss_property_generic_t ccss_property_init </SECTION> diff --git a/ccss-gtk/ccss-gtk-property.c b/ccss-gtk/ccss-gtk-property.c index d6e631e..2c9caea 100644 --- a/ccss-gtk/ccss-gtk-property.c +++ b/ccss-gtk/ccss-gtk-property.c @@ -565,7 +565,7 @@ ccss_gtk_property_set_fallback_class (ccss_property_class_t const *property_clas } bool -ccss_gtk_property_is_style_property (ccss_property_base_t const *self) +ccss_gtk_property_is_style_property (ccss_property_t const *self) { return self->property_class->destroy == (ccss_property_destroy_f) property_destroy; diff --git a/ccss-gtk/ccss-gtk-property.h b/ccss-gtk/ccss-gtk-property.h index c2c201c..62c03dc 100644 --- a/ccss-gtk/ccss-gtk-property.h +++ b/ccss-gtk/ccss-gtk-property.h @@ -32,7 +32,7 @@ #include <gtk/gtk.h> typedef struct { - ccss_property_base_t base; + ccss_property_t base; char *class_name; char *property_name; GType gtype; @@ -52,7 +52,7 @@ typedef struct { } ccss_gtk_property_t; bool -ccss_gtk_property_is_style_property (ccss_property_base_t const *self); +ccss_gtk_property_is_style_property (ccss_property_t const *self); ccss_property_class_t const * ccss_gtk_property_get_property_classes (void); diff --git a/ccss-gtk/ccss-gtk-stylesheet.c b/ccss-gtk/ccss-gtk-stylesheet.c index 2532285..0d249af 100644 --- a/ccss-gtk/ccss-gtk-stylesheet.c +++ b/ccss-gtk/ccss-gtk-stylesheet.c @@ -104,7 +104,7 @@ style_iterator (ccss_style_t const *style, char const *property_name, GSList **style_properties) { - ccss_property_base_t const *property; + ccss_property_t const *property; ccss_gtk_property_t const *self; char *prefix; char *rc_string; diff --git a/ccss-tests/test-parser.c b/ccss-tests/test-parser.c index 0638b1a..5363031 100644 --- a/ccss-tests/test-parser.c +++ b/ccss-tests/test-parser.c @@ -84,7 +84,7 @@ test_color (void) color = NULL; ret = ccss_style_get_property (style, "color", - (ccss_property_base_t const **) &color); + (ccss_property_t const **) &color); g_assert (ret); g_assert (color->base.state == CCSS_PROPERTY_STATE_SET); diff --git a/ccss/ccss-background-parser.c b/ccss/ccss-background-parser.c index 1e35888..4fcdf51 100644 --- a/ccss/ccss-background-parser.c +++ b/ccss/ccss-background-parser.c @@ -36,7 +36,7 @@ /* Dummy property to hook up the inheritance function. */ typedef struct { - ccss_property_base_t base; + ccss_property_t base; ccss_background_attachment_t const *bg_attachment; ccss_background_image_t const *bg_image; ccss_background_position_t const *bg_position; @@ -340,8 +340,8 @@ static bool background_inherit (ccss_style_t const *container_style, ccss_style_t *style) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; ret = false; @@ -412,7 +412,7 @@ background_inherit (ccss_style_t const *container_style, return ret; } -static ccss_property_base_t * +static ccss_property_t * background_attachment_create (ccss_grammar_t const *grammar, CRTerm const *values, void *user_data) @@ -461,7 +461,7 @@ background_attachment_convert (ccss_background_attachment_t const *property, return true; } -static ccss_property_base_t * +static ccss_property_t * background_image_create (ccss_grammar_t const *grammar, CRTerm const *values, void *user_data) @@ -511,7 +511,7 @@ background_image_convert (ccss_background_image_t const *property, return true; } -static ccss_property_base_t * +static ccss_property_t * background_position_create (ccss_grammar_t const *grammar, CRTerm const *values, void *user_data) @@ -541,7 +541,7 @@ background_position_convert (ccss_background_position_t const *property, return false; } -static ccss_property_base_t * +static ccss_property_t * background_repeat_create (ccss_grammar_t const *grammar, CRTerm const *values, void *user_data) @@ -596,7 +596,7 @@ background_repeat_convert (ccss_background_repeat_t const *property, return true; } -static ccss_property_base_t * +static ccss_property_t * background_size_create (ccss_grammar_t const *grammar, CRTerm const *values, void *user_data) diff --git a/ccss/ccss-background.h b/ccss/ccss-background.h index a3693fe..c511d76 100644 --- a/ccss/ccss-background.h +++ b/ccss/ccss-background.h @@ -32,7 +32,7 @@ CCSS_BEGIN_DECLS typedef struct { - ccss_property_base_t base; + ccss_property_t base; enum ccss_background_attachment { CCSS_BACKGROUND_SCROLL, @@ -41,20 +41,20 @@ typedef struct { } ccss_background_attachment_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; char *uri; } ccss_background_image_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; ccss_position_t hpos; ccss_position_t vpos; } ccss_background_position_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; enum ccss_background_repeat { CCSS_BACKGROUND_REPEAT = 0, @@ -65,14 +65,14 @@ typedef struct { } ccss_background_repeat_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; ccss_position_t width; ccss_position_t height; } ccss_background_size_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; ccss_background_attachment_t bg_attachment; ccss_color_t bg_color; diff --git a/ccss/ccss-block.c b/ccss/ccss-block.c index 5d40290..fd10d0e 100644 --- a/ccss/ccss-block.c +++ b/ccss/ccss-block.c @@ -72,7 +72,7 @@ ccss_block_reference (ccss_block_t *self) void ccss_block_add_property (ccss_block_t *self, char const *property_name, - ccss_property_base_t *property) + ccss_property_t *property) { GQuark property_id; @@ -91,10 +91,10 @@ ccss_block_add_property (ccss_block_t *self, void ccss_block_dump (ccss_block_t const *self) { - GHashTableIter iter; - GQuark property_id; - ccss_property_base_t const *property; - char *strval; + GHashTableIter iter; + GQuark property_id; + ccss_property_t const *property; + char *strval; g_hash_table_iter_init (&iter, self->properties); while (g_hash_table_iter_next (&iter, (gpointer *) &property_id, (gpointer *) &property)) { diff --git a/ccss/ccss-block.h b/ccss/ccss-block.h index 1d45d3e..a8ac8dd 100644 --- a/ccss/ccss-block.h +++ b/ccss/ccss-block.h @@ -32,7 +32,7 @@ typedef struct ccss_block_ ccss_block_t; void ccss_block_add_property (ccss_block_t *self, char const *property_name, - ccss_property_base_t *property); + ccss_property_t *property); CCSS_END_DECLS diff --git a/ccss/ccss-border-image-parser.c b/ccss/ccss-border-image-parser.c index e18fd69..77ada45 100644 --- a/ccss/ccss-border-image-parser.c +++ b/ccss/ccss-border-image-parser.c @@ -89,7 +89,7 @@ border_image_parse (ccss_border_image_t *image, /* * FIXME: create all the border-image tiles here and save some time while painting. */ -static ccss_property_base_t * +static ccss_property_t * border_image_create (ccss_grammar_t const *grammar, CRTerm const *values, void *user_data) diff --git a/ccss/ccss-border-image.h b/ccss/ccss-border-image.h index ad0a4ed..137bebd 100644 --- a/ccss/ccss-border-image.h +++ b/ccss/ccss-border-image.h @@ -36,7 +36,7 @@ typedef enum { } ccss_border_image_tiling_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; char *uri; ccss_position_t top; diff --git a/ccss/ccss-border-parser.c b/ccss/ccss-border-parser.c index 0aafb08..bb3bdad 100644 --- a/ccss/ccss-border-parser.c +++ b/ccss/ccss-border-parser.c @@ -69,7 +69,7 @@ (CCSS_PROPERTY_STATE_INHERIT == property_->state) typedef struct { - ccss_property_base_t base; + ccss_property_t base; ccss_border_width_t *width; ccss_border_style_t *style; ccss_color_t const *color; @@ -256,8 +256,8 @@ static bool border_color_inherit (ccss_style_t const *container_style, ccss_style_t *style) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; ret = false; @@ -386,8 +386,8 @@ static bool border_style_inherit (ccss_style_t const *container_style, ccss_style_t *style) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; ret = false; @@ -516,8 +516,8 @@ static bool border_width_inherit (ccss_style_t const *container_style, ccss_style_t *style) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; if (ccss_style_get_property (container_style, "border-width", &property)) { @@ -721,9 +721,9 @@ border_side_inherit_impl (ccss_style_t const *container_style, char const *side, ccss_style_t *style) { - ccss_property_base_t const *property; - char *property_name; - bool ret; + ccss_property_t const *property; + char *property_name; + bool ret; g_return_val_if_fail (container_style && side && style, false); @@ -830,7 +830,7 @@ border_inherit (ccss_style_t const *container_style, return ret; } -static ccss_property_base_t * +static ccss_property_t * border_radius_create (ccss_grammar_t const *grammar, CRTerm const *value, void *user_data) @@ -920,8 +920,8 @@ static bool border_radius_inherit (ccss_style_t const *container_style, ccss_style_t *style) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; ret = false; @@ -999,7 +999,7 @@ border_radius_convert (ccss_border_join_t const *property, return false; } -static ccss_property_base_t * +static ccss_property_t * border_style_create (ccss_grammar_t const *grammar, CRTerm const *value, void *user_data) @@ -1034,7 +1034,7 @@ border_style_convert (ccss_border_style_t const *property, return true; } -static ccss_property_base_t * +static ccss_property_t * border_width_create (ccss_grammar_t const *grammar, CRTerm const *value, void *user_data) @@ -1076,7 +1076,7 @@ border_width_convert (ccss_border_width_t const *property, return false; } -static ccss_property_base_t * +static ccss_property_t * border_spacing_create (ccss_grammar_t const *grammar, CRTerm const *value, void *user_data) diff --git a/ccss/ccss-border.h b/ccss/ccss-border.h index 938724e..52116d7 100644 --- a/ccss/ccss-border.h +++ b/ccss/ccss-border.h @@ -57,13 +57,13 @@ typedef enum { } ccss_border_drawing_flags_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; ccss_border_style_type_t style; } ccss_border_style_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; double width; } ccss_border_width_t; @@ -78,7 +78,7 @@ typedef struct { } ccss_border_stroke_t; typedef struct { - ccss_property_base_t base; + ccss_property_t base; double radius; } ccss_border_join_t; /* FIXME: rename to `border-radius'? */ diff --git a/ccss/ccss-color.h b/ccss/ccss-color.h index 28ac4ab..3aae8ba 100644 --- a/ccss/ccss-color.h +++ b/ccss/ccss-color.h @@ -30,12 +30,12 @@ CCSS_BEGIN_DECLS typedef struct { - ccss_property_base_t base; + ccss_property_t base; - float red; - float green; - float blue; - float alpha; + float red; + float green; + float blue; + float alpha; } ccss_color_t; CCSS_END_DECLS diff --git a/ccss/ccss-grammar-parse.c b/ccss/ccss-grammar-parse.c index 106a89a..0366faa 100644 --- a/ccss/ccss-grammar-parse.c +++ b/ccss/ccss-grammar-parse.c @@ -321,7 +321,7 @@ property_cb (CRDocHandler *handler, ccss_block_t *block; char const *property_name; ccss_property_class_t const *property_class; - ccss_property_base_t *property; + ccss_property_t *property; info = HANDLER_GET_INFO (handler); diff --git a/ccss/ccss-padding-parser.c b/ccss/ccss-padding-parser.c index cd9fc5f..b4a2e55 100644 --- a/ccss/ccss-padding-parser.c +++ b/ccss/ccss-padding-parser.c @@ -62,7 +62,7 @@ parse_padding (CRTerm const **value, return false; } -static ccss_property_base_t * +static ccss_property_t * padding_create (ccss_grammar_t const *grammar, CRTerm const *value, void *user_data) @@ -182,8 +182,8 @@ static bool padding_inherit (ccss_style_t const *container_style, ccss_style_t *style) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; if (ccss_style_get_property (container_style, "padding", &property)) { diff --git a/ccss/ccss-padding.h b/ccss/ccss-padding.h index abe936c..db89cc7 100644 --- a/ccss/ccss-padding.h +++ b/ccss/ccss-padding.h @@ -28,9 +28,9 @@ CCSS_BEGIN_DECLS typedef struct { - ccss_property_base_t base; + ccss_property_t base; - double padding; + double padding; } ccss_padding_t; CCSS_END_DECLS diff --git a/ccss/ccss-property-generic.h b/ccss/ccss-property-generic.h index b7b7b2c..2e0765b 100644 --- a/ccss/ccss-property-generic.h +++ b/ccss/ccss-property-generic.h @@ -38,7 +38,7 @@ CCSS_BEGIN_DECLS * Implementation of a generic, single-value property. **/ typedef struct { - ccss_property_base_t base; + ccss_property_t base; char *name; CRTerm *values; diff --git a/ccss/ccss-property.c b/ccss/ccss-property.c index ae47df4..949417f 100644 --- a/ccss/ccss-property.c +++ b/ccss/ccss-property.c @@ -27,14 +27,14 @@ /** * ccss_property_init: - * @self: a #ccss_property_base_t. + * @self: a #ccss_property_t. * @property_class: a #ccss_property_class_t vtable. * * Initializes @self, needs to be called before the property is * registered with ccss. **/ void -ccss_property_init (ccss_property_base_t *self, +ccss_property_init (ccss_property_t *self, ccss_property_class_t const *property_class) { g_assert (self && property_class); @@ -44,7 +44,7 @@ ccss_property_init (ccss_property_base_t *self, } void -ccss_property_destroy (ccss_property_base_t *self) +ccss_property_destroy (ccss_property_t *self) { g_return_if_fail (self); g_return_if_fail (self->property_class); diff --git a/ccss/ccss-property.h b/ccss/ccss-property.h index 9fa9c6d..63ed6eb 100644 --- a/ccss/ccss-property.h +++ b/ccss/ccss-property.h @@ -68,7 +68,7 @@ typedef enum { CCSS_PROPERTY_TYPE_STRING } ccss_property_type_t; -typedef struct ccss_property_base_ ccss_property_base_t; +typedef struct ccss_property_ ccss_property_t; /** * ccss_property_create_f: @@ -80,9 +80,9 @@ typedef struct ccss_property_base_ ccss_property_base_t; * * Returns: pointer to the allocated property instance or %NULL if parsing fails. **/ -typedef ccss_property_base_t * (*ccss_property_create_f) (struct ccss_grammar_ const *grammar, - CRTerm const *values, - void *user_data); +typedef ccss_property_t * (*ccss_property_create_f) (struct ccss_grammar_ const *grammar, + CRTerm const *values, + void *user_data); /** * ccss_property_destroy_f: @@ -90,7 +90,7 @@ typedef ccss_property_base_t * (*ccss_property_create_f) (struct ccss_grammar_ c * * Hook function for deallocating a property instance. **/ -typedef void (*ccss_property_destroy_f) (ccss_property_base_t *self); +typedef void (*ccss_property_destroy_f) (ccss_property_t *self); /** * ccss_property_convert_f: @@ -102,7 +102,7 @@ typedef void (*ccss_property_destroy_f) (ccss_property_base_t *self); * * Returns: %TRUE if the conversion was successful. **/ -typedef bool (*ccss_property_convert_f) (ccss_property_base_t const *self, +typedef bool (*ccss_property_convert_f) (ccss_property_t const *self, ccss_property_type_t target, void *value); @@ -144,7 +144,7 @@ typedef bool (*ccss_property_inherit_f) (struct ccss_style_ const *container_sty * * Returns: %TRUE if property inheritance could be resolved. **/ -typedef char * (*ccss_property_serialize_f) (ccss_property_base_t const *self); +typedef char * (*ccss_property_serialize_f) (ccss_property_t const *self); /** * ccss_property_class_t: @@ -175,25 +175,23 @@ typedef struct { } ccss_property_class_t; /** - * ccss_property_base_t: + * ccss_property_t: * @property_class: class descriptor, see #ccss_property_class_t. * @state: property state, see #ccss_property_state_t. * * This structure has to be embedded at the beginning of every custom property. - * - * TODO: Rename to ccss_property_t. **/ -struct ccss_property_base_ { +struct ccss_property_ { ccss_property_class_t const *property_class; ccss_property_state_t state; }; void -ccss_property_init (ccss_property_base_t *self, +ccss_property_init (ccss_property_t *self, ccss_property_class_t const *property_class); void -ccss_property_destroy (ccss_property_base_t *self); +ccss_property_destroy (ccss_property_t *self); ccss_property_state_t ccss_property_parse_state (CRTerm const **value); diff --git a/ccss/ccss-selector.c b/ccss/ccss-selector.c index 92e5b97..6a1b1cc 100644 --- a/ccss/ccss-selector.c +++ b/ccss/ccss-selector.c @@ -1056,7 +1056,7 @@ ccss_selector_apply (ccss_selector_t const *self, #ifdef CCSS_DEBUG /* Track where the property comes from. */ ccss_style_set_property_selector (style, - (ccss_property_base_t const *) value, + (ccss_property_t const *) value, self); #endif } diff --git a/ccss/ccss-style-priv.h b/ccss/ccss-style-priv.h index 8784258..c761a2e 100644 --- a/ccss/ccss-style-priv.h +++ b/ccss/ccss-style-priv.h @@ -50,14 +50,14 @@ ccss_style_t * ccss_style_create (void); void -ccss_style_set_property_selector (ccss_style_t *self, - ccss_property_base_t const *property, - ccss_selector_t const *selector); +ccss_style_set_property_selector (ccss_style_t *self, + ccss_property_t const *property, + ccss_selector_t const *selector); void -ccss_style_set_property_selector_string (ccss_style_t *self, - ccss_property_base_t const *property, - char const *selector); +ccss_style_set_property_selector_string (ccss_style_t *self, + ccss_property_t const *property, + char const *selector); CCSS_END_DECLS diff --git a/ccss/ccss-style.c b/ccss/ccss-style.c index 4a36e9d..833ea8d 100644 --- a/ccss/ccss-style.c +++ b/ccss/ccss-style.c @@ -92,12 +92,12 @@ ccss_style_hash (ccss_style_t const *self) g_return_val_if_fail (g_hash_table_size (self->properties), 0); { - ccss_property_base_t const *property; - GHashTableIter iter; - int n_properties = g_hash_table_size (self->properties); - void *property_ptrs[n_properties * sizeof (void *) + 1]; - char const *property_str = (char const *) property_ptrs; - int i = 0; + ccss_property_t const *property; + GHashTableIter iter; + int n_properties = g_hash_table_size (self->properties); + void *property_ptrs[n_properties * sizeof (void *) + 1]; + char const *property_str = (char const *) property_ptrs; + int i = 0; /* Accumulate string of property pointers. */ g_hash_table_iter_init (&iter, self->properties); @@ -147,8 +147,8 @@ ccss_style_get_double (ccss_style_t const *self, char const *property_name, double *value) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; g_return_val_if_fail (self && property_name && value, false); @@ -185,8 +185,8 @@ ccss_style_get_string (ccss_style_t const *self, char const *property_name, char **value) { - ccss_property_base_t const *property; - bool ret; + ccss_property_t const *property; + bool ret; g_return_val_if_fail (self && property_name && value, false); @@ -219,9 +219,9 @@ ccss_style_get_string (ccss_style_t const *self, * Returns: %TRUE if the property was found. **/ bool -ccss_style_get_property (ccss_style_t const *self, - char const *property_name, - ccss_property_base_t const **property) +ccss_style_get_property (ccss_style_t const *self, + char const *property_name, + ccss_property_t const **property) { GQuark property_id; @@ -247,9 +247,9 @@ ccss_style_get_property (ccss_style_t const *self, * Insert custom property. This is for custom property implementations only. **/ void -ccss_style_set_property (ccss_style_t *self, - char const *property_name, - ccss_property_base_t const *value) +ccss_style_set_property (ccss_style_t *self, + char const *property_name, + ccss_property_t const *value) { GQuark property_id; @@ -270,9 +270,9 @@ ccss_style_set_property (ccss_style_t *self, * annotated with selector information. **/ void -ccss_style_set_property_selector (ccss_style_t *self, - ccss_property_base_t const *property, - ccss_selector_t const *selector) +ccss_style_set_property_selector (ccss_style_t *self, + ccss_property_t const *property, + ccss_selector_t const *selector) { #ifdef CCSS_DEBUG GString *annotation; @@ -306,9 +306,9 @@ ccss_style_set_property_selector (ccss_style_t *self, * See: #ccss_style_set_property_selector **/ void -ccss_style_set_property_selector_string (ccss_style_t *self, - ccss_property_base_t const *property, - char const *selector) +ccss_style_set_property_selector_string (ccss_style_t *self, + ccss_property_t const *property, + char const *selector) { #ifdef CCSS_DEBUG g_return_if_fail (self); @@ -338,7 +338,7 @@ ccss_style_interpret_property (ccss_style_t const *self, char const *property_name, ccss_property_create_f property_ctor, void *user_data, - ccss_property_base_t **property) + ccss_property_t **property) { GQuark property_id; ccss_property_generic_t const *generic_property; @@ -404,10 +404,10 @@ ccss_style_foreach (ccss_style_t const *self, void ccss_style_dump (ccss_style_t const *self) { - GHashTableIter iter; - GQuark property_id; - ccss_property_base_t const *property; - char *strval; + GHashTableIter iter; + GQuark property_id; + ccss_property_t const *property; + char *strval; g_hash_table_iter_init (&iter, self->properties); while (g_hash_table_iter_next (&iter, (gpointer *) &property_id, (gpointer *) &property)) { diff --git a/ccss/ccss-style.h b/ccss/ccss-style.h index ce2cf97..4fe14ed 100644 --- a/ccss/ccss-style.h +++ b/ccss/ccss-style.h @@ -59,21 +59,21 @@ ccss_style_get_string (ccss_style_t const *self, char **value); bool -ccss_style_get_property (ccss_style_t const *self, - char const *property_name, - ccss_property_base_t const **value); +ccss_style_get_property (ccss_style_t const *self, + char const *property_name, + ccss_property_t const **value); void -ccss_style_set_property (ccss_style_t *self, - char const *property_name, - ccss_property_base_t const *value); +ccss_style_set_property (ccss_style_t *self, + char const *property_name, + ccss_property_t const *value); bool ccss_style_interpret_property (ccss_style_t const *self, char const *property_name, ccss_property_create_f property_ctor, void *user_data, - ccss_property_base_t **property); + ccss_property_t **property); /** * ccss_style_iterator_f: diff --git a/ccss/ccss-stylesheet.c b/ccss/ccss-stylesheet.c index 576b9f0..337aef3 100644 --- a/ccss/ccss-stylesheet.c +++ b/ccss/ccss-stylesheet.c @@ -423,10 +423,10 @@ inherit_container_style (ccss_style_t const *container_style, GHashTable *inherit, ccss_style_t *style) { - GHashTableIter iter; - GQuark property_id; - ccss_property_base_t const *property; - GSList *removals; + GHashTableIter iter; + GQuark property_id; + ccss_property_t const *property; + GSList *removals; /* Check which properties from the `inherit' set can be resolved. */ removals = NULL; @@ -434,7 +434,7 @@ inherit_container_style (ccss_style_t const *container_style, while (g_hash_table_iter_next (&iter, (gpointer *) &property_id, NULL)) { /* Look up property in the container's style. */ - property = (ccss_property_base_t const *) + property = (ccss_property_t const *) g_hash_table_lookup (container_style->properties, (gpointer) property_id); if (property && @@ -554,12 +554,12 @@ ccss_style_t * ccss_stylesheet_query (ccss_stylesheet_t *self, ccss_node_t *node) { - GHashTable *inherit; - GHashTableIter iter; - GQuark property_id; - ccss_property_base_t const *property; - ccss_style_t *style; - bool ret; + GHashTable *inherit; + GHashTableIter iter; + GQuark property_id; + ccss_property_t const *property; + ccss_style_t *style; + bool ret; g_return_val_if_fail (self, NULL); g_return_val_if_fail (node, NULL); diff --git a/examples/example-4-2.c b/examples/example-4-2.c index f3930a3..93bf99e 100644 --- a/examples/example-4-2.c +++ b/examples/example-4-2.c @@ -8,11 +8,11 @@ #include "config.h" typedef struct { - ccss_property_base_t base; - char const *font_family; /* Owned by the stylesheet. */ + ccss_property_t base; + char const *font_family; /* Owned by the stylesheet. */ } font_family_t; -static ccss_property_base_t * +static ccss_property_t * font_family_new (ccss_grammar_t *grammar, CRTerm const *values, void *user_data) @@ -34,7 +34,7 @@ font_family_new (ccss_grammar_t *grammar, ; } - return (ccss_property_base_t *) self; + return (ccss_property_t *) self; } static gboolean @@ -51,7 +51,7 @@ expose_cb (GtkWidget *widget, ccss_style_interpret_property (style, "font-family", (ccss_property_create_f) font_family_new, NULL, - (ccss_property_base_t **) &property); + (ccss_property_t **) &property); if (property) { PangoContext *context; PangoLayout *layout; diff --git a/examples/example-4.c b/examples/example-4.c index 0702d0c..48d6580 100644 --- a/examples/example-4.c +++ b/examples/example-4.c @@ -15,11 +15,11 @@ peek_property_class (void); */ typedef struct { - ccss_property_base_t base; - char *font_family; + ccss_property_t base; + char *font_family; } font_family_t; -static ccss_property_base_t * +static ccss_property_t * font_family_new (ccss_grammar_t *grammar, CRTerm const *values, void *user_data) @@ -34,7 +34,7 @@ font_family_new (ccss_grammar_t *grammar, case TERM_IDENT: case TERM_STRING: self = g_new0 (font_family_t, 1); - ccss_property_init ((ccss_property_base_t *) self, peek_property_class ()); + ccss_property_init ((ccss_property_t *) self, peek_property_class ()); self->font_family = g_strdup (cr_string_peek_raw_str (values->content.str)); break; default: @@ -42,7 +42,7 @@ font_family_new (ccss_grammar_t *grammar, ; } - return (ccss_property_base_t *) self; + return (ccss_property_t *) self; } static void @@ -96,10 +96,10 @@ expose_cb (GtkWidget *widget, GdkEventExpose *event, ccss_style_t const *style) { - cairo_t *cr; - ccss_property_base_t const *property; - PangoContext *context; - PangoLayout *layout; + cairo_t *cr; + ccss_property_t const *property; + PangoContext *context; + PangoLayout *layout; cr = gdk_cairo_create (widget->window); |