[gtk-theme-engine-clearlooks/gtk-style-context: 16/21] Implement render_handle



commit b9720189eff0aec862ba51b295d2b782dd8ae364
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 16 00:58:09 2010 +0100

    Implement render_handle

 src/clearlooks_engine.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/src/clearlooks_engine.c b/src/clearlooks_engine.c
index 3ba674f..4a043a0 100644
--- a/src/clearlooks_engine.c
+++ b/src/clearlooks_engine.c
@@ -399,53 +399,52 @@ clearlooks_engine_render_extension (GtkThemingEngine *engine,
 	}
 }
 
-#if 0
 static void
-clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
+clearlooks_engine_render_handle (GtkThemingEngine *engine,
+				 cairo_t          *cr,
+				 gdouble           x,
+				 gdouble           y,
+				 gdouble           width,
+				 gdouble           height)
 {
-	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 ("handlebox"))
+	if (gtk_theming_engine_has_class (engine, "dock"))
 	{
-		WidgetParameters params;
 		HandleParameters handle;
 
-		clearlooks_set_widget_parameters (widget, style, state_type, &params);
 		handle.type = CL_HANDLE_TOOLBAR;
-		handle.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
+		handle.horizontal = (width > height);
 
-		STYLE_FUNCTION(draw_handle) (cr, colors, &params, &handle,
-		                             x, y, width, height);
+		style_functions->draw_handle (cr, engine, &handle,
+					      x, y, width, height);
 	}
-	else if (DETAIL ("paned"))
+	else if (gtk_theming_engine_has_class (engine, "paned"))
 	{
-		WidgetParameters params;
 		HandleParameters handle;
 
-		clearlooks_set_widget_parameters (widget, style, state_type, &params);
 		handle.type = CL_HANDLE_SPLITTER;
-		handle.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
+		handle.horizontal = (width > height);
 
-		STYLE_FUNCTION(draw_handle) (cr, colors, &params, &handle,
-		                             x, y, width, height);
+		style_functions->draw_handle (cr, engine, &handle,
+					      x, y, width, height);
 	}
 	else
 	{
-		WidgetParameters params;
 		HandleParameters handle;
 
-		clearlooks_set_widget_parameters (widget, style, state_type, &params);
 		handle.type = CL_HANDLE_TOOLBAR;
-		handle.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
+		handle.horizontal = (width > height);
 
-		STYLE_FUNCTION(draw_handle) (cr, colors, &params, &handle,
-		                             x, y, width, height);
+		style_functions->draw_handle (cr, engine, &handle,
+					      x, y, width, height);
 	}
 }
-#endif
 
 static void
 clearlooks_engine_render_frame (GtkThemingEngine *engine,
@@ -1713,6 +1712,7 @@ clearlooks_engine_class_init (ClearlooksEngineClass * klass)
 	engine_class->render_background = clearlooks_engine_render_background;
 	engine_class->render_frame = clearlooks_engine_render_frame;
 	engine_class->render_frame_gap = clearlooks_engine_render_frame_gap;
+	engine_class->render_handle = clearlooks_engine_render_handle;
 	engine_class->render_layout = clearlooks_engine_render_layout;
 	engine_class->render_icon_pixbuf = clearlooks_engine_render_icon_pixbuf;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]