Implement gradients for StWidget

Rather than having gradients be individually implemented by higher
level JS widgets, move basic gradient functionality into StWidget.
There is prior art in WebKit for CSS gradients:

http://webkit.org/blog/175/introducing-css-gradients/

However, implementing this would be quite a lot of work; all we
need in the Shell design at the moment is basic horizontal/vertical
linear gradients.  So, the syntax now supported is:

background-gradient-type: [vertical|horizontal]
background-gradient-start: color;
background-gradient-end: color;

https://bugzilla.gnome.org/show_bug.cgi?id=602131
This commit is contained in:
Colin Walters
2009-11-14 16:39:22 -05:00
parent 0bc578230f
commit 7b9f5b7643
3 changed files with 218 additions and 4 deletions

View File

@@ -57,6 +57,12 @@ typedef enum {
ST_TEXT_DECORATION_BLINK = 1 << 3
} StTextDecoration;
typedef enum {
ST_GRADIENT_NONE,
ST_GRADIENT_VERTICAL,
ST_GRADIENT_HORIZONTAL
} StGradientType;
GType st_theme_node_get_type (void) G_GNUC_CONST;
StThemeNode *st_theme_node_new (StThemeContext *context,
@@ -103,6 +109,10 @@ void st_theme_node_get_background_color (StThemeNode *node,
ClutterColor *color);
void st_theme_node_get_foreground_color (StThemeNode *node,
ClutterColor *color);
void st_theme_node_get_background_gradient (StThemeNode *node,
StGradientType *type,
ClutterColor *start,
ClutterColor *end);
const char *st_theme_node_get_background_image (StThemeNode *node);