summaryrefslogtreecommitdiff
path: root/ccss-gtk
diff options
context:
space:
mode:
authorRobert Staudinger <robsta@gnome.org>2009-09-01 14:53:59 +0200
committerRobert Staudinger <robsta@gnome.org>2009-09-01 14:53:59 +0200
commit4e7867badc228edbed1aedb69b7690e2771c3e9b (patch)
tree757524cad3940c786dafb6817439c71a34dac8a3 /ccss-gtk
parent22a09db8093b039b435322d756b7bbc4c6eca90f (diff)
[function] Make function objects dynamically creatable and ref-counted.
Diffstat (limited to 'ccss-gtk')
-rw-r--r--ccss-gtk/ccss-gtk-functions.c26
-rw-r--r--ccss-gtk/ccss-gtk-functions.h3
-rw-r--r--ccss-gtk/ccss-gtk-grammar.c3
3 files changed, 17 insertions, 15 deletions
diff --git a/ccss-gtk/ccss-gtk-functions.c b/ccss-gtk/ccss-gtk-functions.c
index c2c5106..aabd24d 100644
--- a/ccss-gtk/ccss-gtk-functions.c
+++ b/ccss-gtk/ccss-gtk-functions.c
@@ -367,20 +367,20 @@ darker (GSList const *args,
result.blue / 65535.0);
}
-static ccss_function_t const _functions[] =
-{
- { "url", url, NULL },
- { "gtk-color", color, NULL },
- { "gtk-mix", mix, NULL },
- { "gtk-shade", shade, NULL },
- { "gtk-lighter", lighter, NULL },
- { "gtk-darker", darker, NULL },
- { NULL }
-};
-
-ccss_function_t const *
-ccss_gtk_functions_get_vtable (void)
+ccss_function_t *
+ccss_gtk_functions_peek_vtable (void)
{
+ static ccss_function_t _functions[] =
+ {
+ { "url", url, 1 },
+ { "gtk-color", color, 1 },
+ { "gtk-mix", mix, 1 },
+ { "gtk-shade", shade, 1 },
+ { "gtk-lighter", lighter, 1 },
+ { "gtk-darker", darker, 1 },
+ { NULL }
+ };
+
return _functions;
}
diff --git a/ccss-gtk/ccss-gtk-functions.h b/ccss-gtk/ccss-gtk-functions.h
index b79de14..f6a8fed 100644
--- a/ccss-gtk/ccss-gtk-functions.h
+++ b/ccss-gtk/ccss-gtk-functions.h
@@ -32,7 +32,8 @@
CCSS_BEGIN_DECLS
-ccss_function_t const * ccss_gtk_functions_get_vtable (void);
+ccss_function_t *
+ccss_gtk_functions_peek_vtable (void);
CCSS_END_DECLS
diff --git a/ccss-gtk/ccss-gtk-grammar.c b/ccss-gtk/ccss-gtk-grammar.c
index e1fe3c0..8cc8b7c 100644
--- a/ccss-gtk/ccss-gtk-grammar.c
+++ b/ccss-gtk/ccss-gtk-grammar.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <gtk/gtk.h>
#include <ccss-cairo/ccss-cairo.h>
+#include <ccss/ccss-function-impl.h>
#include "ccss-gtk-grammar.h"
#include "ccss-gtk-functions.h"
#include "ccss-gtk-property.h"
@@ -50,7 +51,7 @@ ccss_gtk_grammar_create (void)
ccss_gtk_property_set_fallback_class (fallback_property_class);
ccss_grammar_add_properties (self, ccss_gtk_property_get_property_classes ());
- ccss_grammar_add_functions (self, ccss_gtk_functions_get_vtable ());
+ ccss_grammar_add_functions (self, ccss_gtk_functions_peek_vtable ());
return self;
}