Merge remote-tracking branch 'remotes/origin/cairocanvas' into windows
[ardour.git] / libs / clearlooks-newer / clearlooks_draw.c
index c614e90918c3293cb54070273cfbf4ee0009b958..1f98485ce57b57f2bbeaaf55fe8054774d7c8511 100644 (file)
@@ -945,12 +945,12 @@ clearlooks_draw_menubar0 (cairo_t *cr,
                           const MenuBarParameters *menubar,
                           int x, int y, int width, int height)
 {
-       (void) params;
-       (void) menubar;
-       
 /*     const CairoColor *light = &colors->shade[0]; */
        const CairoColor *dark = &colors->shade[3];
 
+       (void) params;
+       (void) menubar;
+
        cairo_set_line_width (cr, 1);
        cairo_translate (cr, x, y+0.5);
 
@@ -972,12 +972,12 @@ clearlooks_draw_menubar2 (cairo_t *cr,
                           const MenuBarParameters *menubar,
                           int x, int y, int width, int height)
 {
-       (void) params;
-       (void) menubar;
-       
        CairoColor lower;
        cairo_pattern_t *pattern;
 
+       (void) params;
+       (void) menubar;
+
        ge_shade_color (&colors->bg[0], 0.96, &lower);
        
        cairo_translate (cr, x, y);
@@ -1034,7 +1034,7 @@ clearlooks_draw_menubar (cairo_t *cr,
                          const MenuBarParameters *menubar,
                          int x, int y, int width, int height)
 {
-       if (menubar->style < 0 || menubar->style > 3)
+       if (menubar->style < 0 || menubar->style >= 3)
                return;
 
        clearlooks_menubar_draw[menubar->style](cr, colors, params, menubar,
@@ -1088,7 +1088,7 @@ clearlooks_draw_frame            (cairo_t *cr,
                                   int x, int y, int width, int height)
 {
        const CairoColor *border = frame->border;
-       const CairoColor *dark   = (CairoColor*)&colors->shade[4];
+       const CairoColor *dark   = (const CairoColor*)&colors->shade[4];
        ClearlooksRectangle bevel_clip = {0, 0, 0, 0};
        ClearlooksRectangle frame_clip = {0, 0, 0, 0};
        double radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
@@ -1316,10 +1316,10 @@ clearlooks_draw_separator (cairo_t *cr,
                            const SeparatorParameters  *separator,
                            int x, int y, int width, int height)
 {
-       (void) widget;
-       
+       CairoColor hilight;
        CairoColor color = colors->shade[3];
-       CairoColor hilight; 
+
+       (void) widget;
        ge_shade_color (&color, 1.4, &hilight);
 
        cairo_save (cr);
@@ -1432,11 +1432,12 @@ clearlooks_draw_toolbar (cairo_t *cr,
                          const ToolbarParameters         *toolbar,
                          int x, int y, int width, int height)
 {
-       (void) widget;
-
-       const CairoColor *fill  = &colors->bg[GTK_STATE_NORMAL];
-       const CairoColor *dark  = &colors->shade[3];
        CairoColor light;
+       const CairoColor *dark;
+       const CairoColor *fill  = &colors->bg[GTK_STATE_NORMAL];
+
+       (void) widget;
+       dark  = &colors->shade[3];
        ge_shade_color (fill, 1.1, &light);
        
        cairo_set_line_width (cr, 1.0);
@@ -1575,13 +1576,13 @@ clearlooks_draw_scrollbar_trough (cairo_t *cr,
                                   const ScrollBarParameters        *scrollbar,
                                   int x, int y, int width, int height)
 {
-       (void) widget;
-
-       const CairoColor *bg     = &colors->shade[2];
-       const CairoColor *border = &colors->shade[5];
+       const CairoColor *bg;
        CairoColor        bg_shade;
-       cairo_pattern_t *pattern;
+       cairo_pattern_t  *pattern;
+       const CairoColor *border = &colors->shade[5];
        
+       (void) widget;
+       bg = &colors->shade[2];
        ge_shade_color (bg, 0.95, &bg_shade);
        
        cairo_set_line_width (cr, 1);
@@ -1623,7 +1624,6 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
        CairoColor   border;
        CairoColor   s1, s2, s3, s4;
        cairo_pattern_t *pattern;
-       ShadowParameters shadow;
        double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
 
        ge_shade_color(&colors->shade[6], 1.05, &border);
@@ -1675,12 +1675,6 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
        cairo_stroke (cr);
        
        cairo_translate (cr, 0.5, 0.5);
-       shadow.shadow  = CL_SHADOW_OUT;
-       shadow.corners = corners;
-       /*
-       clearlooks_draw_highlight_and_shade (cr, &shadow,
-                                            width,
-                                            height, params->radius);*/
 }
 
 static void
@@ -1816,11 +1810,11 @@ clearlooks_draw_statusbar (cairo_t *cr,
                            const WidgetParameters          *widget,
                            int x, int y, int width, int height)
 {
+       CairoColor hilight;
+       const CairoColor *dark = &colors->shade[3];
+
        (void) widget;
        (void) height;
-       
-       const CairoColor *dark = &colors->shade[3];
-       CairoColor hilight;
 
        ge_shade_color (dark, 1.4, &hilight);
 
@@ -1844,9 +1838,9 @@ clearlooks_draw_menu_frame (cairo_t *cr,
                             const WidgetParameters          *widget,
                             int x, int y, int width, int height)
 {
+       const CairoColor *border = &colors->shade[5];
        (void) widget;
 
-       const CairoColor *border = &colors->shade[5];
        cairo_translate      (cr, x, y);
        cairo_set_line_width (cr, 1);
 /*
@@ -1892,17 +1886,14 @@ clearlooks_draw_handle (cairo_t *cr,
 {
        const CairoColor *fill  = &colors->bg[params->state_type];
        int num_bars = 6; /* shut up gcc warnings */
-       int bar_spacing;
        
        switch (handle->type)
        {
                case CL_HANDLE_TOOLBAR:
                        num_bars    = 6;
-                       bar_spacing = 3;
                break;
                case CL_HANDLE_SPLITTER:
                        num_bars    = 16;
-                       bar_spacing = 3;
                break;
        }
 
@@ -1934,15 +1925,15 @@ clearlooks_draw_resize_grip (cairo_t *cr,
                              const ResizeGripParameters      *grip,
                              int x, int y, int width, int height)
 {
-       (void) widget;
-       
-       const CairoColor *dark   = &colors->shade[4];
        CairoColor hilight;
        int lx, ly;
        int x_down;
        int y_down;
        int dots;
-       
+       const CairoColor *dark   = &colors->shade[4];
+
+       (void) widget;
+
        ge_shade_color (dark, 1.5, &hilight);
 
        /* The number of dots fitting into the area. Just hardcoded to 4 right now. */
@@ -2006,17 +1997,18 @@ clearlooks_draw_radiobutton (cairo_t *cr,
                              const CheckboxParameters *checkbox,
                              int x, int y, int width, int height)
 {
-       (void) width;
-       (void) height;
-       
        const CairoColor *border;
        const CairoColor *dot;
        CairoColor shadow;
        CairoColor highlight;
        cairo_pattern_t *pt;
        gboolean inconsistent;
+
        gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
 
+       (void) width;
+       (void) height;
+
        inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
        draw_bullet |= inconsistent;