diff options
author | Robert Staudinger <robsta@gnome.org> | 2009-08-05 15:39:13 +0200 |
---|---|---|
committer | Robert Staudinger <robsta@gnome.org> | 2009-08-05 15:39:13 +0200 |
commit | a4a678e38cdb995b9fcc00a9586f4bb2368ace2a (patch) | |
tree | 754b8d5e44f5a61db9fe721e7fc32a606df6ad1f /ccss-cairo/ccss-cairo-style.c | |
parent | 3c26429f902a3adfd89533f350ff67529eaa7f30 (diff) |
[cairo] Implement pluggable appearance renderers.
A ccss-cairo consumer can install an appearance rendering module
into the plugin directory and refer to the drawing functions
from the CSS.
For the CSS statement
box {
appearance: custom_box example-8;
}
the module "libexample-8.so" is loaded, and the symbol "custom_box()"
is invoked for rendering.
Diffstat (limited to 'ccss-cairo/ccss-cairo-style.c')
-rw-r--r-- | ccss-cairo/ccss-cairo-style.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ccss-cairo/ccss-cairo-style.c b/ccss-cairo/ccss-cairo-style.c index c595646..0752e61 100644 --- a/ccss-cairo/ccss-cairo-style.c +++ b/ccss-cairo/ccss-cairo-style.c @@ -22,6 +22,7 @@ #include <string.h> #include <glib.h> #include <ccss/ccss-style-priv.h> /* PONDERING: use only public headers? */ +#include "ccss-cairo-appearance.h" #include "ccss-cairo-background.h" #include "ccss-cairo-border.h" #include "ccss-cairo-border-image.h" @@ -344,6 +345,16 @@ ccss_cairo_style_draw_rectangle (ccss_style_t const *self, int32_t l, t, w, h; + ccss_cairo_appearance_t *appearance = NULL; + if (ccss_style_get_property (self, + "appearance", + (ccss_property_base_t const **) &appearance) && + appearance->draw_function) { + + ccss_cairo_appearance_draw (appearance, self, cr, x, y, width, height); + return; + } + gather_outline (self, &bottom, &left, &right, &top, &bottom_left, &bottom_right, &top_left, &top_right); |