'libs/clearlooks-newer' - Clearlooks needs to be buildable as conventional 'C' but...
authorJohn Emmas <johne53@tiscali.co.uk>
Tue, 27 Aug 2013 16:07:53 +0000 (17:07 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Tue, 27 Aug 2013 16:07:53 +0000 (17:07 +0100)
libs/clearlooks-newer/animation.c
libs/clearlooks-newer/clearlooks_draw.c
libs/clearlooks-newer/clearlooks_draw_glossy.c
libs/clearlooks-newer/clearlooks_draw_gummy.c
libs/clearlooks-newer/clearlooks_rc_style.c
libs/clearlooks-newer/clearlooks_style.c

index 2c6a6fdc420312336ffce220441d5c67b679c03e..8339ed7c195dceb36c92411b873a3a72f1837d8a 100644 (file)
@@ -159,11 +159,12 @@ add_animation (const GtkWidget *widget, gdouble stop_time)
 static gboolean
 update_animation_info (gpointer key, gpointer value, gpointer user_data)
 {
-       (void) user_data;
-       
-       AnimationInfo *animation_info = value;
+       AnimationInfo *animation_info;
        GtkWidget *widget = key;
        
+       animation_info = value;
+       (void) user_data;
+       
        g_assert ((widget != NULL) && (animation_info != NULL));
        
        /* remove the widget from the hash table if it is not drawable */
@@ -217,9 +218,10 @@ animation_timeout_handler (gpointer data)
 static void
 on_checkbox_toggle (GtkWidget *widget, gpointer data)
 {
+       AnimationInfo *animation_info;
        (void) data;
        
-       AnimationInfo *animation_info = lookup_animation_info (widget);
+       animation_info = lookup_animation_info (widget);
        
        if (animation_info != NULL)
        {
index e44610b4ee5e597e6c5f0d1133960a6bc0206322..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);
@@ -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);
@@ -1809,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);
 
@@ -1837,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);
 /*
@@ -1924,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. */
@@ -1996,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;
 
index 62f17f3f950e97e23e8033403070f524e12e8d29..0e573e1b53d809ad58a0c0208c9d36f6921b0f7d 100644 (file)
@@ -1088,13 +1088,16 @@ clearlooks_glossy_draw_toolbar (cairo_t *cr,
                          const ToolbarParameters         *toolbar,
                          int x, int y, int width, int height)
 {
+       CairoColor light;
+       const CairoColor *dark;
+       
+       const CairoColor *fill  = &colors->bg[GTK_STATE_NORMAL];
+       dark  = &colors->shade[3];
+
        (void) widget;
        (void) width;
        (void) height;
-       
-       const CairoColor *fill  = &colors->bg[GTK_STATE_NORMAL];
-       const CairoColor *dark  = &colors->shade[3];
-       CairoColor light;
+
        ge_shade_color (fill, 1.1, &light);
        
        cairo_set_line_width (cr, 1.0);
@@ -1232,9 +1235,6 @@ clearlooks_glossy_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;
@@ -1243,6 +1243,9 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
        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;
 
index 0d736b5acc4c0d933604e5041022ff87e7fee4c4..ca208c2ebc2e58bfb7b58ead479fdf224743741a 100644 (file)
@@ -790,10 +790,10 @@ clearlooks_gummy_draw_separator (cairo_t                   *cr,
                                  const SeparatorParameters *separator,
                                  int x, int y, int width, int height)
 {
-       (void) widget;
-       
-       CairoColor color = colors->shade[3];
        CairoColor hilight;
+       CairoColor color = colors->shade[3];
+
+       (void) widget;
        ge_shade_color (&color, 1.3, &hilight);
 
        cairo_save (cr);
@@ -1162,11 +1162,14 @@ clearlooks_gummy_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, toolbar->style == 1 ? 1.1 : 1.05, &light);
 
        cairo_set_line_width (cr, 1.0);
@@ -1302,12 +1305,12 @@ clearlooks_gummy_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.3, &hilight);
 
        cairo_set_line_width  (cr, 1);
@@ -1331,9 +1334,6 @@ clearlooks_gummy_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;
@@ -1342,6 +1342,9 @@ clearlooks_gummy_draw_radiobutton (cairo_t                  *cr,
        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;
 
index c9a30ff6b4877f9d5e9d4ba16cbc92bcc8cff589..b54abebb4de159d005907d4a347f7b8432d6d525 100644 (file)
@@ -173,9 +173,9 @@ clearlooks_gtk2_rc_parse_boolean (GtkSettings *settings,
                      GScanner     *scanner,
                      gboolean *retval)
 {
-       (void) settings;
-       
        guint token;
+
+       (void) settings;
        token = g_scanner_get_next_token(scanner);
 
        token = g_scanner_get_next_token(scanner);
@@ -198,10 +198,10 @@ clearlooks_gtk2_rc_parse_color(GtkSettings  *settings,
                  GScanner     *scanner,
                  GdkColor     *color)
 {
-       (void) settings;
-       
        guint token;
 
+       (void) settings;
+
        /* Skip 'blah_color' */
        token = g_scanner_get_next_token(scanner);
 
@@ -217,10 +217,10 @@ clearlooks_gtk2_rc_parse_double (GtkSettings  *settings,
                                  GScanner     *scanner,
                                  gdouble      *val)
 {
-       (void) settings;
-       
        guint token;
 
+       (void) settings;
+
        /* Skip 'blah' */
        token = g_scanner_get_next_token(scanner);
 
@@ -242,10 +242,10 @@ clearlooks_gtk2_rc_parse_int (GtkSettings  *settings,
                         GScanner     *scanner,
                         guint8       *progressbarstyle)
 {
-       (void) settings;
-
        guint token;
 
+       (void) settings;
+
        /* Skip 'sunkenmenubar' */
        token = g_scanner_get_next_token(scanner);
 
@@ -267,10 +267,10 @@ clearlooks_gtk2_rc_parse_style (GtkSettings      *settings,
                                 GScanner         *scanner,
                                 ClearlooksStyles *style)
 {
-       (void) settings;
-
        guint token;
 
+       (void) settings;
+
        g_assert (CL_NUM_STYLES == CL_STYLE_GUMMY + 1); /* so that people don't forget ;-) */
 
        /* Skip 'style' */
@@ -308,10 +308,10 @@ clearlooks_gtk2_rc_parse_dummy (GtkSettings      *settings,
                                 GScanner         *scanner,
                                 gchar            *name)
 {
-       (void) settings;
-
        guint token;
 
+       (void) settings;
+
        /* Skip option */
        token = g_scanner_get_next_token (scanner);
 
index f1b46a54268b34c97e00e0e6100b6d8b01748aa6..d1ac8d5d3991e88024fa1687ac6f1164d8fb08cd 100644 (file)
@@ -956,14 +956,14 @@ clearlooks_style_draw_slider (DRAW_ARGS, GtkOrientation orientation)
 static void
 clearlooks_style_draw_option (DRAW_ARGS)
 {
-       (void) detail;
-               
-       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
        const ClearlooksColors *colors;
        WidgetParameters params;
        CheckboxParameters checkbox;
        cairo_t *cr;
+       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
        
+       (void) detail;
+
        CHECK_ARGS
        SANITIZE_SIZE
 
@@ -1019,14 +1019,17 @@ clearlooks_style_draw_vline (GtkStyle               *style,
                              gint                    y2,
                              gint                    x)
 {
+       const ClearlooksColors *colors;
+       SeparatorParameters separator;
+       cairo_t *cr;
+
+       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
+
        (void) state_type;
        (void) widget;
        (void) detail;
-       
-       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-       const ClearlooksColors *colors;
-       SeparatorParameters separator = { FALSE };
-       cairo_t *cr;
+
+       separator.horizontal = FALSE;
 
        CHECK_ARGS
 
@@ -1053,13 +1056,13 @@ clearlooks_style_draw_hline (GtkStyle               *style,
                              gint                    x2,
                              gint                    y)
 {
-       (void) state_type;
-       (void) widget;
-       
-       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
        const ClearlooksColors *colors;
        cairo_t *cr;
        SeparatorParameters separator;
+       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
+
+       (void) state_type;
+       (void) widget;
 
        CHECK_ARGS
 
@@ -1136,13 +1139,14 @@ clearlooks_style_draw_resize_grip (GtkStyle       *style,
                   gint            width,
                   gint            height)
 {
-       (void) detail;
-       
-       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-       ClearlooksColors *colors = &clearlooks_style->colors;
+       ClearlooksColors *colors;
        cairo_t *cr;
        WidgetParameters params;
        ResizeGripParameters grip;
+       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
+
+       (void) detail;
+       colors = &clearlooks_style->colors;
 
        CHECK_ARGS
        SANITIZE_SIZE
@@ -1164,14 +1168,15 @@ clearlooks_style_draw_resize_grip (GtkStyle       *style,
 static void
 clearlooks_style_draw_tab (DRAW_ARGS)
 {
-       (void) shadow_type;
-       (void) detail;
-       
-       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-       ClearlooksColors *colors = &clearlooks_style->colors;
+       ClearlooksColors *colors;
        WidgetParameters params;
        ArrowParameters  arrow;          
        cairo_t *cr;
+       ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
+
+       (void) shadow_type;
+       (void) detail;
+       colors = &clearlooks_style->colors;
 
        CHECK_ARGS
        SANITIZE_SIZE
@@ -1202,15 +1207,18 @@ clearlooks_style_draw_arrow (GtkStyle  *style,
                        gint           width,
                        gint           height)
 {
+       ClearlooksColors *colors;
+       WidgetParameters params;
+       ArrowParameters  arrow;
+       cairo_t *cr;
+       ClearlooksStyle  *clearlooks_style = CLEARLOOKS_STYLE (style);
+
        (void) shadow;
        (void) detail;
        (void) fill;
-       
-       ClearlooksStyle  *clearlooks_style = CLEARLOOKS_STYLE (style);
-       ClearlooksColors *colors = &clearlooks_style->colors;
-       WidgetParameters params;
-       ArrowParameters  arrow;
-       cairo_t *cr = ge_gdk_drawable_to_cairo (window, area);
+
+       cr = ge_gdk_drawable_to_cairo (window, area);
+       colors = &clearlooks_style->colors;
 
        CHECK_ARGS
        SANITIZE_SIZE
@@ -1475,10 +1483,9 @@ clearlooks_style_draw_layout (GtkStyle * style,
             GtkWidget * widget,
             const gchar * detail, gint x, gint y, PangoLayout * layout)
 {
-       (void) detail;
-
        GdkGC *gc;
 
+       (void) detail;
        g_return_if_fail (GTK_IS_STYLE (style));
        g_return_if_fail (window != NULL);
 
@@ -1525,17 +1532,20 @@ clearlooks_style_draw_render_icon (GtkStyle            *style,
              GtkWidget           *widget,
              const char          *detail)
 {
-       (void) direction;
-       (void) detail;
-       
-       int width = 1;
-       int height = 1;
+       int width;
+       int height;
        GdkPixbuf *scaled;
        GdkPixbuf *stated;
        GdkPixbuf *base_pixbuf;
        GdkScreen *screen;
        GtkSettings *settings;
-       
+
+       width = 1;
+       height = 1;
+
+       (void) direction;
+       (void) detail;
+
        /* Oddly, style can be NULL in this function, because
         * GtkIconSet can be used without a style and if so
         * it uses this function.