diff options
author | Robert Staudinger <robsta@gnome.org> | 2009-08-31 17:05:05 +0200 |
---|---|---|
committer | Robert Staudinger <robsta@gnome.org> | 2009-08-31 17:05:05 +0200 |
commit | 65056d1fac4b761f603f8a32bed20160c7ea6637 (patch) | |
tree | c2faae01c52950b4b6b5992da320c1814ac7f230 | |
parent | eabd50c08427f1d2dfc974a55bdd06f5c5b9d4f8 (diff) |
[background] Deprecate struct fields.
-rw-r--r-- | ccss/Makefile.am | 1 | ||||
-rw-r--r-- | ccss/ccss-background-parser.c | 2 | ||||
-rw-r--r-- | ccss/ccss-background.c | 128 | ||||
-rw-r--r-- | ccss/ccss-background.h | 103 | ||||
-rw-r--r-- | ccss/ccss.sym | 13 |
5 files changed, 215 insertions, 32 deletions
diff --git a/ccss/Makefile.am b/ccss/Makefile.am index 13166bd..106e976 100644 --- a/ccss/Makefile.am +++ b/ccss/Makefile.am @@ -26,6 +26,7 @@ libccss_1_la_LIBADD = \ libccss_1_la_SOURCES = \ $(headers_DATA) \ + ccss-background.c \ ccss-background-parser.c \ ccss-background-parser.h \ ccss-block.c \ diff --git a/ccss/ccss-background-parser.c b/ccss/ccss-background-parser.c index 8230690..aca7a77 100644 --- a/ccss/ccss-background-parser.c +++ b/ccss/ccss-background-parser.c @@ -52,7 +52,7 @@ peek_property_class (char const *property_name); static const struct { char const *name; - const enum ccss_background_repeat repeat; + const ccss_background_repeat_type_t repeat; } _repeat_map[] = { { "repeat", CCSS_BACKGROUND_REPEAT }, { "repeat-x", CCSS_BACKGROUND_REPEAT_X }, diff --git a/ccss/ccss-background.c b/ccss/ccss-background.c new file mode 100644 index 0000000..993cc3c --- /dev/null +++ b/ccss/ccss-background.c @@ -0,0 +1,128 @@ +/* vim: set ts=8 sw=8 noexpandtab: */ + +/* The `C' CSS Library. + * Copyright (C) 2008 Robert Staudinger + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include <glib.h> +#include "ccss-background.h" + +ccss_background_attachment_type_t +ccss_background_attachment_get_attachment (ccss_background_attachment_t const *self) +{ + g_return_val_if_fail (self, 0); + + return self->attachment; +} + +char const * +ccss_background_image_get_uri (ccss_background_image_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return self->uri; +} + +ccss_position_t const * +ccss_background_position_get_horizontal_position (ccss_background_position_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->hpos; +} + +ccss_position_t const * +ccss_background_position_get_vertical_position (ccss_background_position_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->vpos; +} + +ccss_background_repeat_type_t +ccss_background_repeat_get_repeat (ccss_background_repeat_t const *self) +{ + g_return_val_if_fail (self, 0); + + return self->repeat; +} + +ccss_position_t const * +ccss_background_size_get_height (ccss_background_size_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->height; +} + +ccss_position_t const * +ccss_background_size_get_width (ccss_background_size_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->width; +} + +ccss_background_attachment_t const * +ccss_background_get_attachment (ccss_background_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->bg_attachment; +} + +ccss_color_t const * +ccss_background_get_color (ccss_background_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->bg_color; +} + +ccss_background_image_t const * +ccss_background_get_image (ccss_background_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->bg_image; +} + +ccss_background_position_t const * +ccss_background_get_position (ccss_background_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->bg_position; +} + +ccss_background_repeat_t const * +ccss_background_get_repeat (ccss_background_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->bg_repeat; +} + +ccss_background_size_t const * +ccss_background_get_size (ccss_background_t const *self) +{ + g_return_val_if_fail (self, NULL); + + return &self->bg_size; +} + diff --git a/ccss/ccss-background.h b/ccss/ccss-background.h index a44f5d3..d5048bf 100644 --- a/ccss/ccss-background.h +++ b/ccss/ccss-background.h @@ -22,65 +22,106 @@ #ifndef CCSS_BACKGROUND_H #define CCSS_BACKGROUND_H -#include <stdbool.h> -#include <stdint.h> #include <ccss/ccss-macros.h> #include <ccss/ccss-color.h> #include <ccss/ccss-position.h> CCSS_BEGIN_DECLS +typedef enum { + CCSS_BACKGROUND_SCROLL = 0, + CCSS_BACKGROUND_FIXED +} ccss_background_attachment_type_t; + typedef struct { - ccss_property_t base; + CCSS_DEPRECATED (ccss_property_t base); - enum ccss_background_attachment { - CCSS_BACKGROUND_SCROLL, - CCSS_BACKGROUND_FIXED - } attachment; + CCSS_DEPRECATED (ccss_background_attachment_type_t attachment); } ccss_background_attachment_t; +ccss_background_attachment_type_t +ccss_background_attachment_get_attachment (ccss_background_attachment_t const *self); + typedef struct { - ccss_property_t base; + CCSS_DEPRECATED (ccss_property_t base); - char *uri; + CCSS_DEPRECATED (char *uri); } ccss_background_image_t; +char const * +ccss_background_image_get_uri (ccss_background_image_t const *self); + typedef struct { - ccss_property_t base; + CCSS_DEPRECATED (ccss_property_t base); - ccss_position_t hpos; - ccss_position_t vpos; + CCSS_DEPRECATED (ccss_position_t hpos); + CCSS_DEPRECATED (ccss_position_t vpos); } ccss_background_position_t; +ccss_position_t const * +ccss_background_position_get_horizontal_position (ccss_background_position_t const *self); + +ccss_position_t const * +ccss_background_position_get_vertical_position (ccss_background_position_t const *self); + +typedef enum { + CCSS_BACKGROUND_REPEAT = 0, + CCSS_BACKGROUND_REPEAT_X, + CCSS_BACKGROUND_REPEAT_Y, + CCSS_BACKGROUND_NO_REPEAT +} ccss_background_repeat_type_t; + typedef struct { - ccss_property_t base; - - enum ccss_background_repeat { - CCSS_BACKGROUND_REPEAT = 0, - CCSS_BACKGROUND_REPEAT_X, - CCSS_BACKGROUND_REPEAT_Y, - CCSS_BACKGROUND_NO_REPEAT - } repeat; + CCSS_DEPRECATED (ccss_property_t base); + + CCSS_DEPRECATED (ccss_background_repeat_type_t repeat); } ccss_background_repeat_t; +ccss_background_repeat_type_t +ccss_background_repeat_get_repeat (ccss_background_repeat_t const *self); + typedef struct { - ccss_property_t base; + CCSS_DEPRECATED (ccss_property_t base); - ccss_position_t width; - ccss_position_t height; + CCSS_DEPRECATED (ccss_position_t width); + CCSS_DEPRECATED (ccss_position_t height); } ccss_background_size_t; +ccss_position_t const * +ccss_background_size_get_height (ccss_background_size_t const *self); + +ccss_position_t const * +ccss_background_size_get_width (ccss_background_size_t const *self); + typedef struct { - ccss_property_t base; - - ccss_background_attachment_t bg_attachment; - ccss_color_t bg_color; - ccss_background_image_t bg_image; - ccss_background_position_t bg_position; - ccss_background_repeat_t bg_repeat; - ccss_background_size_t bg_size; + CCSS_DEPRECATED (ccss_property_t base); + + CCSS_DEPRECATED (ccss_background_attachment_t bg_attachment); + CCSS_DEPRECATED (ccss_color_t bg_color); + CCSS_DEPRECATED (ccss_background_image_t bg_image); + CCSS_DEPRECATED (ccss_background_position_t bg_position); + CCSS_DEPRECATED (ccss_background_repeat_t bg_repeat); + CCSS_DEPRECATED (ccss_background_size_t bg_size); } ccss_background_t; +ccss_background_attachment_t const * +ccss_background_get_attachment (ccss_background_t const *self); + +ccss_color_t const * +ccss_background_get_color (ccss_background_t const *self); + +ccss_background_image_t const * +ccss_background_get_image (ccss_background_t const *self); + +ccss_background_position_t const * +ccss_background_get_position (ccss_background_t const *self); + +ccss_background_repeat_t const * +ccss_background_get_repeat (ccss_background_t const *self); + +ccss_background_size_t const * +ccss_background_get_size (ccss_background_t const *self); + CCSS_END_DECLS #endif /* CCSS_BACKGROUND_H */ diff --git a/ccss/ccss.sym b/ccss/ccss.sym index 2fe74ec..eddeb45 100644 --- a/ccss/ccss.sym +++ b/ccss/ccss.sym @@ -1,3 +1,16 @@ +ccss_background_attachment_get_attachment +ccss_background_get_attachment +ccss_background_get_color +ccss_background_get_image +ccss_background_get_position +ccss_background_get_repeat +ccss_background_get_size +ccss_background_image_get_uri +ccss_background_position_get_horizontal_position +ccss_background_position_get_vertical_position +ccss_background_repeat_get_repeat +ccss_background_size_get_height +ccss_background_size_get_width ccss_block_add_property ccss_border_image_get_bottom ccss_border_image_get_left |