diff options
author | John Emmas <johne53@tiscali.co.uk> | 2013-08-27 17:07:53 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2013-08-27 17:07:53 +0100 |
commit | 909fcf4b2df24e4c0794c9af2c00ae9476040548 (patch) | |
tree | fea50a6403aaa95178c34595176fefdeb8a64f88 | |
parent | 060c56cc3fa05201894d56e30cc36e853a958472 (diff) |
'libs/clearlooks-newer' - Clearlooks needs to be buildable as conventional 'C' but many 'C' compilers require that variables be declared at the top of each function. Move declarations as necessary to accommodate this.
-rw-r--r-- | libs/clearlooks-newer/animation.c | 10 | ||||
-rw-r--r-- | libs/clearlooks-newer/clearlooks_draw.c | 60 | ||||
-rw-r--r-- | libs/clearlooks-newer/clearlooks_draw_glossy.c | 17 | ||||
-rw-r--r-- | libs/clearlooks-newer/clearlooks_draw_gummy.c | 29 | ||||
-rw-r--r-- | libs/clearlooks-newer/clearlooks_rc_style.c | 24 | ||||
-rw-r--r-- | libs/clearlooks-newer/clearlooks_style.c | 80 |
6 files changed, 120 insertions, 100 deletions
diff --git a/libs/clearlooks-newer/animation.c b/libs/clearlooks-newer/animation.c index 2c6a6fdc42..8339ed7c19 100644 --- a/libs/clearlooks-newer/animation.c +++ b/libs/clearlooks-newer/animation.c @@ -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) { diff --git a/libs/clearlooks-newer/clearlooks_draw.c b/libs/clearlooks-newer/clearlooks_draw.c index e44610b4ee..1f98485ce5 100644 --- a/libs/clearlooks-newer/clearlooks_draw.c +++ b/libs/clearlooks-newer/clearlooks_draw.c @@ -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; diff --git a/libs/clearlooks-newer/clearlooks_draw_glossy.c b/libs/clearlooks-newer/clearlooks_draw_glossy.c index 62f17f3f95..0e573e1b53 100644 --- a/libs/clearlooks-newer/clearlooks_draw_glossy.c +++ b/libs/clearlooks-newer/clearlooks_draw_glossy.c @@ -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; diff --git a/libs/clearlooks-newer/clearlooks_draw_gummy.c b/libs/clearlooks-newer/clearlooks_draw_gummy.c index 0d736b5acc..ca208c2ebc 100644 --- a/libs/clearlooks-newer/clearlooks_draw_gummy.c +++ b/libs/clearlooks-newer/clearlooks_draw_gummy.c @@ -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; diff --git a/libs/clearlooks-newer/clearlooks_rc_style.c b/libs/clearlooks-newer/clearlooks_rc_style.c index c9a30ff6b4..b54abebb4d 100644 --- a/libs/clearlooks-newer/clearlooks_rc_style.c +++ b/libs/clearlooks-newer/clearlooks_rc_style.c @@ -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); diff --git a/libs/clearlooks-newer/clearlooks_style.c b/libs/clearlooks-newer/clearlooks_style.c index f1b46a5426..d1ac8d5d39 100644 --- a/libs/clearlooks-newer/clearlooks_style.c +++ b/libs/clearlooks-newer/clearlooks_style.c @@ -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. |