X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fclearlooks-newer%2Fclearlooks_draw_gummy.c;h=caba5202d52d2962588a04e43b97a0f3af869d82;hb=9488201a2c08eaa66ef97c2f55d91166beac1dfb;hp=0d736b5acc4c0d933604e5041022ff87e7fee4c4;hpb=81506ea41c40ed9ce6a433550549e0e25f0fe1a3;p=ardour.git diff --git a/libs/clearlooks-newer/clearlooks_draw_gummy.c b/libs/clearlooks-newer/clearlooks_draw_gummy.c index 0d736b5acc..caba5202d5 100644 --- a/libs/clearlooks-newer/clearlooks_draw_gummy.c +++ b/libs/clearlooks-newer/clearlooks_draw_gummy.c @@ -77,9 +77,9 @@ clearlooks_draw_gummy_gradient (cairo_t *cr, } static void -clearlooks_set_mixed_color (cairo_t *cr, - const CairoColor *color1, - const CairoColor *color2, +clearlooks_set_mixed_color (cairo_t *cr, + const CairoColor *color1, + const CairoColor *color2, gdouble mix_factor) { CairoColor composite; @@ -89,7 +89,7 @@ clearlooks_set_mixed_color (cairo_t *cr, } static void -clearlooks_gummy_draw_highlight_and_shade (cairo_t *cr, +clearlooks_gummy_draw_highlight_and_shade (cairo_t *cr, const CairoColor *bg_color, const ShadowParameters *params, int width, int height, gdouble radius) @@ -123,7 +123,7 @@ clearlooks_gummy_draw_highlight_and_shade (cairo_t *cr, cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5); else cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.5); - + cairo_stroke (cr); /* Bottom/Right highlight -- this includes the corners */ @@ -147,7 +147,7 @@ clearlooks_gummy_draw_top_left_highlight (cairo_t *cr, const CairoColor *color, const WidgetParameters *params, int width, int height, gdouble radius) { - CairoColor hilight; + CairoColor hilight; double light_top = params->ythickness-1, light_bottom = height - params->ythickness - 1, @@ -230,8 +230,8 @@ clearlooks_gummy_draw_button (cairo_t *cr, cairo_translate (cr, -0.5, -0.5); } - clearlooks_draw_gummy_gradient (cr, xoffset+1, yoffset+1, - width-(xoffset*2)-2, height-(yoffset*2)-2, + clearlooks_draw_gummy_gradient (cr, xoffset+1, yoffset+1, + width-(xoffset*2)-2, height-(yoffset*2)-2, &fill, params->disabled, radius, params->corners); /* Pressed button shadow */ @@ -242,7 +242,7 @@ clearlooks_gummy_draw_button (cairo_t *cr, cairo_save (cr); - ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, height, radius, + ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, height, radius, params->corners & (CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMLEFT)); cairo_clip (cr); cairo_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, 3); @@ -323,7 +323,7 @@ clearlooks_gummy_draw_entry (cairo_t *cr, } else { - CairoColor shadow; + CairoColor shadow; ge_shade_color (&border, 0.92, &shadow); cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, params->disabled ? 0.09 : 0.18); @@ -465,7 +465,7 @@ clearlooks_gummy_draw_progressbar_fill (cairo_t *cr, cairo_line_to (cr, stroke_width-x_step, 0); cairo_line_to (cr, stroke_width/2-x_step, height); cairo_line_to (cr, -x_step, height); - + cairo_translate (cr, stroke_width, 0); tile_pos += stroke_width; } @@ -622,13 +622,13 @@ clearlooks_gummy_draw_scale_trough (cairo_t *cr, cairo_translate (cr, 1, 1); if (!slider->lower && !slider->fill_level) - clearlooks_gummy_scale_draw_gradient (cr, + clearlooks_gummy_scale_draw_gradient (cr, &colors->shade[2], /* bottom */ &colors->shade[6], /* border */ 0, 0, trough_width, trough_height, slider->horizontal, TRUE); else if (!slider->fill_level) - clearlooks_gummy_scale_draw_gradient (cr, + clearlooks_gummy_scale_draw_gradient (cr, &colors->spot[1], /* bottom */ &colors->spot[2], /* border */ 0, 0, trough_width, trough_height, @@ -640,7 +640,7 @@ clearlooks_gummy_draw_scale_trough (cairo_t *cr, c1.a = 0.25; c2.a = 0.25; - clearlooks_gummy_scale_draw_gradient (cr, + clearlooks_gummy_scale_draw_gradient (cr, &c1, /* bottom */ &c2, /* border */ 0, 0, trough_width, trough_height, @@ -690,7 +690,7 @@ clearlooks_gummy_draw_tab (cairo_t *cr, { width += 3.0; - if (tab->gap_side == CL_GAP_LEFT) + if (tab->gap_side == CL_GAP_LEFT) cairo_translate (cr, -3.0, 0.0); /* gap at the other side */ } @@ -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); @@ -846,7 +846,7 @@ clearlooks_gummy_draw_slider (cairo_t *cr, int bar_x, i; int shift_x; - cairo_set_line_width (cr, 1.0); + cairo_set_line_width (cr, 1.0); cairo_translate (cr, x, y); cairo_translate (cr, -0.5, -0.5); @@ -953,8 +953,8 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t *cr, fill = colors->bg[widget->state_type]; ge_shade_color(&fill, SHADE_TOP, &shade1); - ge_shade_color(&fill, SHADE_CENTER_TOP, &shade2); - ge_shade_color(&fill, SHADE_BOTTOM, &shade3); + ge_shade_color(&fill, SHADE_CENTER_TOP, &shade2); + ge_shade_color(&fill, SHADE_BOTTOM, &shade3); cairo_pattern_add_color_stop_rgb(pattern, 0, shade1.r, shade1.g, shade1.b); cairo_pattern_add_color_stop_rgb(pattern, 0.5, shade2.r, shade2.g, shade2.b); @@ -1055,7 +1055,7 @@ clearlooks_gummy_draw_scrollbar_slider (cairo_t *cr, cairo_fill (cr); cairo_pattern_destroy (pattern); - if (scrollbar->has_color) + if (scrollbar->has_color) { cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.2); ge_cairo_stroke_rectangle (cr, 1.5, 1.5, width-3, height-3); @@ -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,18 +1334,18 @@ 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; CairoColor highlight; cairo_pattern_t *pt; gboolean inconsistent; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + (void) width; + (void) height; + + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) @@ -1426,11 +1429,11 @@ clearlooks_gummy_draw_checkbox (cairo_t *cr, int x, int y, int width, int height) { const CairoColor *border; - const CairoColor *dot; + const CairoColor *dot; gboolean inconsistent = FALSE; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) @@ -1442,7 +1445,7 @@ clearlooks_gummy_draw_checkbox (cairo_t *cr, { if (widget->prelight) border = &colors->spot[2]; - else + else border = &colors->shade[6]; dot = &colors->text[GTK_STATE_NORMAL]; } @@ -1452,25 +1455,25 @@ clearlooks_gummy_draw_checkbox (cairo_t *cr, if (widget->xthickness > 2 && widget->ythickness > 2) { - widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5, + widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL); - + /* Draw the rectangle for the checkbox itself */ - ge_cairo_rounded_rectangle (cr, 1.5, 1.5, + ge_cairo_rounded_rectangle (cr, 1.5, 1.5, width-3, height-3, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL); } else { /* Draw the rectangle for the checkbox itself */ - ge_cairo_rounded_rectangle (cr, 0.5, 0.5, + ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL); } - + if (!widget->disabled) - { + { if (widget->prelight) clearlooks_set_mixed_color (cr, &colors->base[0], &colors->spot[1], 0.5); - else + else ge_cairo_set_color (cr, &colors->base[0]); cairo_fill_preserve (cr); }