[gtk-theme-engine-clearlooks] Implement render_extension()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-theme-engine-clearlooks] Implement render_extension()
- Date: Mon, 6 Dec 2010 21:21:32 +0000 (UTC)
commit b4354ad6d313960483080367337ea8f8899706a8
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 16 00:56:18 2010 +0100
Implement render_extension()
src/clearlooks_engine.c | 52 ++++++++++++++++++++++++++++++++--------------
1 files changed, 36 insertions(+), 16 deletions(-)
---
diff --git a/src/clearlooks_engine.c b/src/clearlooks_engine.c
index b471767..375a0fd 100644
--- a/src/clearlooks_engine.c
+++ b/src/clearlooks_engine.c
@@ -347,24 +347,40 @@ clearlooks_style_draw_box_gap (DRAW_ARGS,
}
}
+#endif
+
static void
-clearlooks_style_draw_extension (DRAW_ARGS, GtkPositionType gap_side)
+clearlooks_engine_render_extension (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side)
{
- ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
- ClearlooksColors *colors = &clearlooks_style->colors;
+ ClearlooksStyleFunctions *style_functions;
- CHECK_ARGS
+ GE_CAIRO_INIT
+
+ clearlooks_lookup_functions (CLEARLOOKS_ENGINE (engine),
+ &style_functions, NULL);
- if (DETAIL ("tab"))
+ if (gtk_theming_engine_has_region (engine, GTK_STYLE_REGION_TAB, NULL))
{
- WidgetParameters params;
TabParameters tab;
FocusParameters focus;
+ CairoColor *bg_color, *focus_color;
+ GtkStateFlags state;
- clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "background-color", &bg_color,
+ "-clearlooks-focus-color", &focus_color,
+ NULL);
- tab.gap_side = (ClearlooksGapSide)gap_side;
+ tab.gap_side = (ClearlooksGapSide) gap_side;
+#if 0
switch (gap_side)
{
case CL_GAP_TOP:
@@ -380,29 +396,32 @@ clearlooks_style_draw_extension (DRAW_ARGS, GtkPositionType gap_side)
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
break;
}
+#endif
/* Focus color */
- if (clearlooks_style->has_focus_color)
+ if (focus_color)
{
- ge_gdk_color_to_cairo (&clearlooks_style->focus_color, &focus.color);
+ focus.color = *focus_color;
focus.has_color = TRUE;
+ gdk_rgba_free ((GdkRGBA *) focus_color);
}
else
- focus.color = colors->bg[GTK_STATE_SELECTED];
+ focus.color = *bg_color;
tab.focus = focus;
- STYLE_FUNCTION(draw_tab) (cr, colors, ¶ms, &tab,
- x, y, width, height);
+ style_functions->draw_tab (cr, engine, &tab,
+ x, y, width, height);
+
+ gdk_rgba_free ((GdkRGBA *) bg_color);
}
else
{
- GTK_STYLE_CLASS (clearlooks_style_parent_class)->draw_extension (style, cr, state_type, shadow_type,
- widget, detail, x, y, width, height,
- gap_side);
+ GTK_THEMING_ENGINE_CLASS (clearlooks_engine_parent_class)->render_extension (engine, cr, x, y, width, height, gap_side);
}
}
+#if 0
static void
clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
{
@@ -1697,6 +1716,7 @@ clearlooks_engine_class_init (ClearlooksEngineClass * klass)
engine_class->render_check = clearlooks_engine_render_check;
engine_class->render_option = clearlooks_engine_render_option;
engine_class->render_slider = clearlooks_engine_render_slider;
+ engine_class->render_extension = clearlooks_engine_render_extension;
engine_class->render_background = clearlooks_engine_render_background;
engine_class->render_frame = clearlooks_engine_render_frame;
engine_class->render_layout = clearlooks_engine_render_layout;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]