gtk-engines r1025 - in trunk: . engines/clearlooks engines/clearlooks/src
- From: acimitan svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk-engines r1025 - in trunk: . engines/clearlooks engines/clearlooks/src
- Date: Mon, 21 Jan 2008 23:18:10 +0000 (GMT)
Author: acimitan
Date: Mon Jan 21 23:18:09 2008
New Revision: 1025
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1025&view=rev
Log:
2008-01-22 Andrea Cimitan <andrea cimitan gmail com>
* engines/clearlooks/src/clearlooks_draw.c:
* engines/clearlooks/src/clearlooks_draw.h:
* engines/clearlooks/src/clearlooks_draw_gummy.c:
(clearlooks_gummy_draw_tab), (clearlooks_gummy_draw_focus):
* engines/clearlooks/src/clearlooks_style.c:
(clearlooks_style_draw_extension):
Fixed #509226 and minor changes to intends.
To benzea: Check if you like the current fallback behaviour
Modified:
trunk/ChangeLog
trunk/engines/clearlooks/Makefile.am
trunk/engines/clearlooks/src/clearlooks_draw.c
trunk/engines/clearlooks/src/clearlooks_draw.h
trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
trunk/engines/clearlooks/src/clearlooks_style.c
trunk/engines/clearlooks/src/clearlooks_types.h
Modified: trunk/engines/clearlooks/Makefile.am
==============================================================================
--- trunk/engines/clearlooks/Makefile.am (original)
+++ trunk/engines/clearlooks/Makefile.am Mon Jan 21 23:18:09 2008
@@ -5,11 +5,11 @@
engine_LTLIBRARIES = libclearlooks.la
libclearlooks_la_SOURCES = \
- ./src/clearlooks_rc_style.c \
- ./src/clearlooks_rc_style.h \
- ./src/clearlooks_style.c \
- ./src/clearlooks_style.h \
- ./src/clearlooks_theme_main.c \
+ ./src/clearlooks_rc_style.c \
+ ./src/clearlooks_rc_style.h \
+ ./src/clearlooks_style.c \
+ ./src/clearlooks_style.h \
+ ./src/clearlooks_theme_main.c \
./src/support.c \
./src/animation.c \
./src/animation.h \
Modified: trunk/engines/clearlooks/src/clearlooks_draw.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw.c (original)
+++ trunk/engines/clearlooks/src/clearlooks_draw.c Mon Jan 21 23:18:09 2008
@@ -38,9 +38,9 @@
int x, int y, int width, int height);
static void
-clearlooks_draw_inset (cairo_t *cr,
- const CairoColor *bg_color,
- double x, double y, double w, double h,
+clearlooks_draw_inset (cairo_t *cr,
+ const CairoColor *bg_color,
+ double x, double y, double w, double h,
double radius, uint8 corners)
{
CairoColor shadow;
@@ -96,13 +96,13 @@
static void
clearlooks_draw_shadow (cairo_t *cr, const ClearlooksColors *colors, gfloat radius, int width, int height)
{
- CairoColor shadow;
+ CairoColor shadow;
ge_shade_color (&colors->shade[6], 0.92, &shadow);
cairo_set_line_width (cr, 1.0);
-
+
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.1);
-
+
cairo_move_to (cr, width, radius);
ge_cairo_rounded_corner (cr, width, height, radius, CR_CORNER_BOTTOMRIGHT);
cairo_line_to (cr, radius, height);
@@ -115,7 +115,7 @@
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,
@@ -152,42 +152,42 @@
width -= 3;
height -= 3;
-
+
cairo_save (cr);
-
+
/* Top/Left highlight */
if (corners & CR_CORNER_BOTTOMLEFT)
cairo_move_to (cr, x, y+height-radius);
else
cairo_move_to (cr, x, y+height);
-
+
ge_cairo_rounded_corner (cr, x, y, radius, corners & CR_CORNER_TOPLEFT);
if (corners & CR_CORNER_TOPRIGHT)
cairo_line_to (cr, x+width-radius, y);
else
cairo_line_to (cr, x+width, y);
-
+
if (params->shadow & CL_SHADOW_OUT)
ge_cairo_set_color (cr, &hilight);
else
ge_cairo_set_color (cr, &shadow);
-
+
cairo_stroke (cr);
-
+
/* Bottom/Right highlight -- this includes the corners */
cairo_move_to (cr, x+width-radius, y); /* topright and by radius to the left */
ge_cairo_rounded_corner (cr, x+width, y, radius, corners & CR_CORNER_TOPRIGHT);
ge_cairo_rounded_corner (cr, x+width, y+height, radius, corners & CR_CORNER_BOTTOMRIGHT);
ge_cairo_rounded_corner (cr, x, y+height, radius, corners & CR_CORNER_BOTTOMLEFT);
-
+
if (params->shadow & CL_SHADOW_OUT)
ge_cairo_set_color (cr, &shadow);
else
ge_cairo_set_color (cr, &hilight);
-
+
cairo_stroke (cr);
-
+
cairo_restore (cr);
}
@@ -202,7 +202,7 @@
pattern = cairo_pattern_create_linear (0, 0, width, height);
cairo_pattern_add_color_stop_rgb (pattern, 0, color->r, color->g, color->b);
cairo_pattern_add_color_stop_rgb (pattern, 1, bottom_shade.r, bottom_shade.g, bottom_shade.b);
-
+
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}
@@ -219,13 +219,13 @@
ge_shade_color (dark, 1.5, &hilight);
- for ( i = 0; i < xr; i++ )
+ for ( i = 0; i < xr; i++ )
{
for ( j = 0; j < yr; j++ )
{
xoff = x -(xr * 3 / 2) + 3 * i;
- yoff = y -(yr * 3 / 2) + 3 * j;
-
+ yoff = y -(yr * 3 / 2) + 3 * j;
+
cairo_rectangle (cr, width/2+0.5+xoff, height/2+0.5+yoff, 2, 2);
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.8+contrast);
cairo_fill (cr);
@@ -250,9 +250,9 @@
CairoColor shadow;
ge_shade_color (border_normal, 0.925, &shadow);
-
+
cairo_save (cr);
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1.0);
@@ -271,23 +271,23 @@
cairo_translate (cr, 0.5, 0.5);
params->style_functions->draw_inset (cr, ¶ms->parentbg, 0, 0, width-1, height-1, radius+1, params->corners);
cairo_translate (cr, -0.5, -0.5);
- }
-
+ }
+
ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1,
width-(xoffset*2)-2,
height-(yoffset*2)-2,
radius, params->corners);
-
+
if (!params->active)
{
cairo_pattern_t *pattern;
gdouble shade_size = ((100.0/height)*8.0)/100.0;
CairoColor top_shade, bottom_shade, middle_shade;
-
+
ge_shade_color (fill, 1.1, &top_shade);
ge_shade_color (fill, 0.98, &middle_shade);
ge_shade_color (fill, 0.93, &bottom_shade);
-
+
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, top_shade.r, top_shade.g, top_shade.b);
cairo_pattern_add_color_stop_rgb (pattern, shade_size, fill->r, fill->g, fill->b);
@@ -303,7 +303,7 @@
else
{
cairo_pattern_t *pattern;
-
+
ge_cairo_set_color (cr, fill);
cairo_fill_preserve (cr);
@@ -342,19 +342,19 @@
ge_cairo_set_color (cr, d);
ge_cairo_stroke_rectangle (cr, 3.5, 3.5, width-7, height-7);
}
-
+
ge_cairo_rounded_rectangle (cr, xoffset + 0.5, yoffset + 0.5, width-(xoffset*2)-1, height-(yoffset*2)-1, radius, params->corners);
if (params->disabled)
ge_cairo_set_color (cr, border_disabled);
else
if (!params->active)
- clearlooks_set_border_gradient (cr, border_normal, 1.32, 0, height);
+ clearlooks_set_border_gradient (cr, border_normal, 1.32, 0, height);
else
ge_cairo_set_color (cr, border_normal);
-
+
cairo_stroke (cr);
-
+
/* Draw the "shadow" */
if (!params->active)
{
@@ -364,7 +364,7 @@
cairo_line_to (cr, width-params->xthickness, height - params->ythickness - 1);
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.1);
cairo_stroke (cr);
-
+
/* Draw topleft shadow */
clearlooks_draw_top_left_highlight (cr, fill, params, width, height, radius);
}
@@ -380,13 +380,13 @@
const CairoColor *base = &colors->base[params->state_type];
CairoColor border = colors->shade[params->disabled ? 4 : 6];
double radius = MIN (params->radius, MIN ((width - 4.0) / 2.0, (height - 4.0) / 2.0));
-
+
if (params->focus)
border = colors->spot[2];
cairo_translate (cr, x+0.5, y+0.5);
cairo_set_line_width (cr, 1.0);
-
+
/* Fill the background (shouldn't have to) */
cairo_rectangle (cr, -0.5, -0.5, width, height);
ge_cairo_set_color (cr, ¶ms->parentbg);
@@ -396,7 +396,7 @@
cairo_rectangle (cr, 1.5, 1.5, width-4, height-4);
ge_cairo_set_color (cr, base);
cairo_fill (cr);
-
+
params->style_functions->draw_inset (cr, ¶ms->parentbg, 0, 0, width-1, height-1, radius+1, params->corners);
/* Draw the inner shadow */
@@ -408,7 +408,7 @@
}
else
{
- CairoColor shadow;
+ CairoColor shadow;
ge_shade_color (&border, 0.925, &shadow);
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, params->disabled ? 0.05 : 0.1);
@@ -426,7 +426,7 @@
if (params->focus || params->disabled)
ge_cairo_set_color (cr, &border);
else
- clearlooks_set_border_gradient (cr, &border, 1.32, 0, height);
+ clearlooks_set_border_gradient (cr, &border, 1.32, 0, height);
cairo_stroke (cr);
}
@@ -437,7 +437,7 @@
int x, int y, int width, int height)
{
const CairoColor *border = &colors->shade[!params->disabled ? 5 : 3];
- CairoColor hilight;
+ CairoColor hilight;
params->style_functions->draw_button (cr, colors, params, x, y, width, height);
@@ -464,24 +464,24 @@
{
cairo_pattern_t *pattern;
double radius = MIN (params->radius, MIN ((width - 4.0) / 2.0, (height - 4.0) / 2.0));
- CairoColor shadow;
+ CairoColor shadow;
ge_shade_color (&colors->bg[GTK_STATE_NORMAL], 0.8, &shadow);
cairo_translate (cr, x+1, y+1);
-
+
ge_cairo_rounded_rectangle (cr, 1, 1, width-4, height-4, radius, params->corners);
-
+
ge_cairo_set_color (cr, &colors->bg[params->state_type]);
-
+
cairo_fill_preserve (cr);
-
+
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, shadow.r, shadow.g, shadow.b);
cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.0);
-
+
cairo_set_source (cr, pattern);
cairo_fill (cr);
-
+
cairo_pattern_destroy (pattern);
}
@@ -499,13 +499,13 @@
cairo_pattern_add_color_stop_rgb (pattern, 0.0, c1->r, c1->g, c1->b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, c2->r, c2->g, c2->b);
- cairo_rectangle (cr, x+0.5, y+0.5, width-1, height-1);
+ cairo_rectangle (cr, x+0.5, y+0.5, width-1, height-1);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
ge_cairo_set_color (cr, c3);
- ge_cairo_stroke_rectangle (cr, x, y, width, height);
+ ge_cairo_stroke_rectangle (cr, x, y, width, height);
}
#define TROUGH_SIZE 6
@@ -523,7 +523,7 @@
{
trough_width = width-3;
trough_height = TROUGH_SIZE-2;
-
+
translate_x = x + 0.5;
translate_y = y + 0.5 + (height/2) - (TROUGH_SIZE/2);
}
@@ -531,19 +531,19 @@
{
trough_width = TROUGH_SIZE-2;
trough_height = height-3;
-
+
translate_x = x + 0.5 + (width/2) - (TROUGH_SIZE/2);
translate_y = y + 0.5;
}
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, translate_x, translate_y);
-
+
if (!slider->fill_level)
params->style_functions->draw_inset (cr, ¶ms->parentbg, 0, 0, trough_width+2, trough_height+2, 0, 0);
-
+
cairo_translate (cr, 1, 1);
-
+
if (!slider->lower && ! slider->fill_level)
clearlooks_scale_draw_gradient (cr, &colors->shade[3], /* top */
&colors->shade[2], /* bottom */
@@ -571,7 +571,7 @@
cairo_pattern_t *pattern;
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
if (params->prelight)
@@ -615,14 +615,14 @@
if (params->prelight)
{
CairoColor highlight;
- ge_shade_color (spot, 1.5, &highlight);
+ ge_shade_color (spot, 1.5, &highlight);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, highlight.r, highlight.g, highlight.b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, spot->r, spot->g, spot->b);
cairo_set_source (cr, pattern);
}
- else
+ else
{
- CairoColor hilight;
+ CairoColor hilight;
ge_shade_color (fill, 1.5, &hilight);
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.5);
}
@@ -638,7 +638,7 @@
if (params->prelight || params->disabled)
ge_cairo_set_color (cr, border);
else
- clearlooks_set_border_gradient (cr, border, 1.2, 0, height);
+ clearlooks_set_border_gradient (cr, border, 1.2, 0, height);
cairo_stroke (cr);
/* Draw handle lines */
@@ -646,10 +646,10 @@
{
cairo_move_to (cr, 6, 0.5);
cairo_line_to (cr, 6, height-1);
-
+
cairo_move_to (cr, width-7, 0.5);
cairo_line_to (cr, width-7, height-1);
-
+
cairo_set_line_width (cr, 1.0);
cairo_set_source_rgba (cr, border->r,
border->g,
@@ -668,7 +668,7 @@
{
double radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
cairo_set_line_width (cr, 1.0);
-
+
if (!slider->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
cairo_translate (cr, x+0.5, y+0.5);
@@ -690,15 +690,15 @@
CairoColor shadow;
cairo_pattern_t *pattern;
double radius = MIN (params->radius, MIN ((height-2.0) / 2.0, (width-2.0) / 2.0));
-
+
cairo_save (cr);
cairo_set_line_width (cr, 1.0);
-
+
/* Fill with bg color */
ge_cairo_set_color (cr, &colors->bg[params->state_type]);
-
- cairo_rectangle (cr, x, y, width, height);
+
+ cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
/* Create trough box */
@@ -772,7 +772,7 @@
stroke_width = height*2;
x_step = (((float)stroke_width/10)*offset); /* This looks weird ... */
-
+
cairo_translate (cr, x, y);
cairo_save (cr);
@@ -800,16 +800,16 @@
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;
}
-
+
cairo_set_source_rgba (cr, colors->spot[2].r,
colors->spot[2].g,
colors->spot[2].b,
0.15);
-
+
cairo_fill (cr);
cairo_restore (cr); /* rounded clip region */
@@ -889,7 +889,7 @@
ge_cairo_set_color (cr, &shadow);
cairo_stroke (cr);
}
-
+
cairo_restore (cr);
cairo_restore (cr); /* rotation, mirroring */
@@ -904,9 +904,9 @@
{
SeparatorParameters separator;
int offset = params->ythickness + 2;
-
+
params->style_functions->draw_button (cr, colors, params, x, y, width, height);
-
+
separator.horizontal = FALSE;
params->style_functions->draw_separator (cr, colors, params, &separator, x+optionmenu->linepos, y + offset, 2, height - offset*2);
}
@@ -967,10 +967,10 @@
cairo_pattern_t *pattern;
ge_shade_color (&colors->bg[0], 0.96, &lower);
-
+
cairo_translate (cr, x, y);
cairo_rectangle (cr, 0, 0, width, height);
-
+
/* Draw the gradient */
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, colors->bg[0].r,
@@ -982,7 +982,7 @@
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw bottom line */
cairo_set_line_width (cr, 1.0);
cairo_move_to (cr, 0, height-0.5);
@@ -1009,10 +1009,10 @@
static menubar_draw_proto clearlooks_menubar_draw[3] =
-{
- clearlooks_draw_menubar0,
+{
+ clearlooks_draw_menubar0,
clearlooks_draw_menubar1,
- clearlooks_draw_menubar2
+ clearlooks_draw_menubar2
};
static void
@@ -1030,7 +1030,7 @@
}
static void
-clearlooks_get_frame_gap_clip (int x, int y, int width, int height,
+clearlooks_get_frame_gap_clip (int x, int y, int width, int height,
const FrameParameters *frame,
ClearlooksRectangle *bevel,
ClearlooksRectangle *border)
@@ -1047,21 +1047,21 @@
CLEARLOOKS_RECTANGLE_SET ((*bevel), 1.5 + frame->gap_x, height - 2.5,
frame->gap_width - 3, 2.0);
CLEARLOOKS_RECTANGLE_SET ((*border), 0.5 + frame->gap_x, height - 1.5,
- frame->gap_width - 2, 2.0);
+ frame->gap_width - 2, 2.0);
}
else if (frame->gap_side == CL_GAP_LEFT)
{
CLEARLOOKS_RECTANGLE_SET ((*bevel), -0.5, 1.5 + frame->gap_x,
2.0, frame->gap_width - 3);
CLEARLOOKS_RECTANGLE_SET ((*border), -0.5, 0.5 + frame->gap_x,
- 1.0, frame->gap_width - 2);
+ 1.0, frame->gap_width - 2);
}
else if (frame->gap_side == CL_GAP_RIGHT)
{
CLEARLOOKS_RECTANGLE_SET ((*bevel), width - 2.5, 1.5 + frame->gap_x,
2.0, frame->gap_width - 3);
CLEARLOOKS_RECTANGLE_SET ((*border), width - 1.5, 0.5 + frame->gap_x,
- 1.0, frame->gap_width - 2);
+ 1.0, frame->gap_width - 2);
}
}
@@ -1080,17 +1080,17 @@
CairoColor hilight;
ge_shade_color (&colors->bg[GTK_STATE_NORMAL], 1.05, &hilight);
-
+
if (frame->shadow == CL_SHADOW_NONE)
return;
-
+
if (frame->gap_x != -1)
clearlooks_get_frame_gap_clip (x, y, width, height,
frame, &bevel_clip, &frame_clip);
-
+
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x+0.5, y+0.5);
-
+
/* save everything */
cairo_save (cr);
/* Set clip for the bevel */
@@ -1102,7 +1102,7 @@
cairo_rectangle (cr, bevel_clip.x, bevel_clip.y, bevel_clip.width, bevel_clip.height);
cairo_clip (cr);
}
-
+
/* Draw the bevel */
if (frame->shadow == CL_SHADOW_ETCHED_IN || frame->shadow == CL_SHADOW_ETCHED_OUT)
{
@@ -1120,7 +1120,7 @@
shadow.shadow = frame->shadow;
clearlooks_draw_highlight_and_shade (cr, colors, &shadow, width, height, 0);
}
-
+
/* restore the previous clip region */
cairo_restore (cr);
cairo_save (cr);
@@ -1167,7 +1167,7 @@
CairoColor hilight;
cairo_pattern_t *pattern;
-
+
double radius;
double strip_size;
double length;
@@ -1179,7 +1179,7 @@
cairo_clip (cr);
cairo_new_path (cr);
- /* Translate and set line width */
+ /* Translate and set line width */
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x+0.5, y+0.5);
@@ -1191,7 +1191,7 @@
height += 3.0;
length = height;
strip_size = 2.0/height; /* 2 pixel high strip */
-
+
if (tab->gap_side == CL_GAP_TOP)
cairo_translate (cr, 0.0, -3.0); /* gap at the other side */
}
@@ -1200,18 +1200,18 @@
width += 3.0;
length = width;
strip_size = 2.0/width;
-
- 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 */
}
-
+
/* Set the fill color */
fill = &colors->bg[params->state_type];
/* Set tab shape */
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1,
radius, params->corners);
-
+
/* Draw fill */
ge_cairo_set_color (cr, fill);
cairo_fill (cr);
@@ -1223,15 +1223,15 @@
if (!params->active)
{
ShadowParameters shadow;
-
+
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = params->corners;
-
+
clearlooks_draw_highlight_and_shade (cr, colors, &shadow,
width,
height, radius);
}
-
+
if (params->active)
{
@@ -1255,7 +1255,7 @@
}
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
ge_shade_color (fill, 0.92, &shadow);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, hilight.r, hilight.g, hilight.b, 0.4);
@@ -1286,9 +1286,9 @@
default:
pattern = NULL;
}
-
+
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_fill->r, stripe_fill->g, stripe_fill->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_fill->r, stripe_fill->g, stripe_fill->b);
cairo_pattern_add_color_stop_rgba (pattern, strip_size, hilight.r, hilight.g, hilight.b, 0.5);
@@ -1299,7 +1299,7 @@
}
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
if (params->active)
{
ge_cairo_set_color (cr, border2);
@@ -1324,7 +1324,7 @@
default:
pattern = NULL;
}
-
+
cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_border->r, stripe_border->g, stripe_border->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_border->r, stripe_border->g, stripe_border->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, border1->r, border1->g, border1->b);
@@ -1343,7 +1343,7 @@
int x, int y, int width, int height)
{
CairoColor color = colors->shade[3];
- CairoColor hilight;
+ CairoColor hilight;
ge_shade_color (&color, 1.4, &hilight);
cairo_save (cr);
@@ -1353,12 +1353,12 @@
{
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y+0.5);
-
+
cairo_move_to (cr, 0.0, 0.0);
cairo_line_to (cr, width, 0.0);
ge_cairo_set_color (cr, &color);
cairo_stroke (cr);
-
+
cairo_move_to (cr, 0.0, 1.0);
cairo_line_to (cr, width, 1.0);
ge_cairo_set_color (cr, &hilight);
@@ -1368,12 +1368,12 @@
{
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x+0.5, y);
-
+
cairo_move_to (cr, 0.0, 0.0);
cairo_line_to (cr, 0.0, height);
ge_cairo_set_color (cr, &color);
cairo_stroke (cr);
-
+
cairo_move_to (cr, 1.0, 0.0);
cairo_line_to (cr, 1.0, height);
ge_cairo_set_color (cr, &hilight);
@@ -1392,15 +1392,15 @@
{
const CairoColor *border = &colors->shade[5];
cairo_pattern_t *pattern;
- CairoColor hilight;
+ CairoColor hilight;
CairoColor shadow;
- ge_shade_color (border, 1.5, &hilight);
- ge_shade_color (border, 0.925, &shadow);
+ ge_shade_color (border, 1.5, &hilight);
+ ge_shade_color (border, 0.925, &shadow);
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1.0);
-
+
/* Draw highlight */
if (header->order == CL_ORDER_FIRST)
{
@@ -1409,19 +1409,19 @@
}
else
cairo_move_to (cr, 0.0, 0.5);
-
+
cairo_line_to (cr, width, 0.5);
-
+
ge_cairo_set_color (cr, &hilight);
cairo_stroke (cr);
-
+
/* Draw bottom border */
cairo_move_to (cr, 0.0, height-0.5);
cairo_line_to (cr, width, height-0.5);
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
- /* Draw bottom shade */
+ /* Draw bottom shade */
pattern = cairo_pattern_create_linear (0.0, height-5.0, 0.0, height-1.0);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.0);
cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.3);
@@ -1430,14 +1430,14 @@
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw resize grip */
if ((params->ltr && header->order != CL_ORDER_LAST) ||
(!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
{
SeparatorParameters separator;
separator.horizontal = FALSE;
-
+
if (params->ltr)
params->style_functions->draw_separator (cr, colors, params, &separator,
width-1.5, 4.0, 2, height-8.0);
@@ -1460,14 +1460,14 @@
const CairoColor *dark = &colors->shade[3];
CairoColor light;
ge_shade_color (fill, 1.1, &light);
-
+
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
ge_cairo_set_color (cr, fill);
cairo_paint (cr);
- if (!toolbar->topmost)
+ if (!toolbar->topmost)
{
/* Draw highlight */
cairo_move_to (cr, 0, 0.5);
@@ -1522,10 +1522,10 @@
CairoColor fill_shade;
CairoColor border = colors->spot[2];
cairo_pattern_t *pattern;
-
+
ge_shade_color (&border, 1.05, &border);
ge_shade_color (fill, 0.85, &fill_shade);
-
+
cairo_set_line_width (cr, 1.0);
ge_cairo_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1, height, widget->radius, widget->corners);
@@ -1552,7 +1552,7 @@
CairoColor border;
cairo_pattern_t *pattern;
cairo_save (cr);
-
+
cairo_translate (cr, x, y);
if (params->focus)
@@ -1575,8 +1575,8 @@
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
- ge_shade_color(&upper_color, 0.8, &border);
+
+ ge_shade_color(&upper_color, 0.8, &border);
cairo_move_to (cr, 0, 0.5);
cairo_rel_line_to (cr, width, 0);
@@ -1601,16 +1601,16 @@
const CairoColor *border = &colors->shade[5];
CairoColor bg_shade;
cairo_pattern_t *pattern;
-
+
ge_shade_color (bg, 0.95, &bg_shade);
-
+
cairo_set_line_width (cr, 1);
/* cairo_translate (cr, x, y); */
-
+
if (scrollbar->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
- cairo_translate (cr, x, y);
+ cairo_translate (cr, x, y);
/* Draw fill */
cairo_rectangle (cr, 1, 0, width-2, height);
@@ -1620,12 +1620,12 @@
/* Draw shadow */
pattern = cairo_pattern_create_linear (1, 0, 3, 0);
cairo_pattern_add_color_stop_rgb (pattern, 0, bg_shade.r, bg_shade.g, bg_shade.b);
- cairo_pattern_add_color_stop_rgb (pattern, 1.0, bg->r, bg->g, bg->b);
+ cairo_pattern_add_color_stop_rgb (pattern, 1.0, bg->r, bg->g, bg->b);
cairo_rectangle (cr, 1, 0, 4, height);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw border */
ge_cairo_set_color (cr, border);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
@@ -1647,7 +1647,7 @@
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);
-
+
if (scrollbar->horizontal)
{
if (stepper->stepper == CL_STEPPER_A)
@@ -1662,22 +1662,22 @@
else if (stepper->stepper == CL_STEPPER_D)
corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
}
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1);
-
+
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius, corners);
-
+
if (scrollbar->horizontal)
pattern = cairo_pattern_create_linear (0, 0, 0, height);
else
pattern = cairo_pattern_create_linear (0, 0, width, 0);
-
+
s2 = colors->bg[widget->state_type];
ge_shade_color(&s2, 1.06, &s1);
- ge_shade_color(&s2, 0.98, &s3);
- ge_shade_color(&s2, 0.94, &s4);
-
+ ge_shade_color(&s2, 0.98, &s3);
+ ge_shade_color(&s2, 0.94, &s4);
+
cairo_pattern_add_color_stop_rgb(pattern, 0, s1.r, s1.g, s1.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.5, s2.r, s2.g, s2.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.7, s3.r, s3.g, s3.b);
@@ -1685,15 +1685,15 @@
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
cairo_translate (cr, 0.5, 0.5);
clearlooks_draw_top_left_highlight (cr, &s2, widget, width, height, (stepper->stepper == CL_STEPPER_A) ? radius : 0);
cairo_translate (cr, -0.5, -0.5);
-
+
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, corners);
- clearlooks_set_border_gradient (cr, &border, 1.2, (scrollbar->horizontal ? 0 : width), (scrollbar->horizontal ? height: 0));
+ clearlooks_set_border_gradient (cr, &border, 1.2, (scrollbar->horizontal ? 0 : width), (scrollbar->horizontal ? height: 0));
cairo_stroke (cr);
-
+
cairo_translate (cr, 0.5, 0.5);
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = corners;
@@ -1730,11 +1730,11 @@
else
height += 1;
}
-
+
if (!scrollbar->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
- cairo_translate (cr, x, y);
+ cairo_translate (cr, x, y);
if (scrollbar->has_color)
{
@@ -1746,27 +1746,27 @@
if (widget->prelight)
ge_shade_color (&fill, 1.1, &fill);
-
+
cairo_set_line_width (cr, 1);
-
+
ge_shade_color (&fill, 1.3, &hilight);
ge_shade_color (&fill, 1.1, &shade1);
ge_shade_color (&fill, 1.05, &shade2);
ge_shade_color (&fill, 0.98, &shade3);
-
+
pattern = cairo_pattern_create_linear (1, 1, 1, height-2);
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);
- cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade3.r, shade3.g, shade3.b);
+ cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade3.r, shade3.g, shade3.b);
cairo_pattern_add_color_stop_rgb (pattern, 1, fill.r, fill.g, fill.b);
cairo_rectangle (cr, 1, 1, width-2, height-2);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.5);
ge_cairo_stroke_rectangle (cr, 1.5, 1.5, width-3, height-3);
-
+
ge_cairo_set_color (cr, border);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
}
@@ -1780,12 +1780,12 @@
int bar_x, i;
ge_shade_color(&colors->shade[6], 1.05, &border);
-
+
s2 = colors->bg[widget->state_type];
ge_shade_color(&s2, 1.06, &s1);
- ge_shade_color(&s2, 0.98, &s3);
- ge_shade_color(&s2, 0.94, &s4);
-
+ ge_shade_color(&s2, 0.98, &s3);
+ ge_shade_color(&s2, 0.94, &s4);
+
pattern = cairo_pattern_create_linear(1, 1, 1, height-1);
cairo_pattern_add_color_stop_rgb(pattern, 0, s1.r, s1.g, s1.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.5, s2.r, s2.g, s2.b);
@@ -1796,20 +1796,20 @@
cairo_set_source(cr, pattern);
cairo_fill(cr);
cairo_pattern_destroy(pattern);
-
- clearlooks_set_border_gradient (cr, &border, 1.2, 0, height);
+
+ clearlooks_set_border_gradient (cr, &border, 1.2, 0, height);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
-
+
cairo_move_to (cr, 1.5, height-1.5);
cairo_line_to (cr, 1.5, 1.5);
cairo_line_to (cr, width-1.5, 1.5);
ge_shade_color (&s2, 1.3, &s5);
cairo_set_source_rgba (cr, s5.r, s5.g, s5.b, 0.5);
cairo_stroke(cr);
-
+
/* draw handles */
cairo_set_line_width (cr, 1);
-
+
bar_x = width/2 - 4;
cairo_translate(cr, 0.5, 0.5);
for (i=0; i<3; i++)
@@ -1818,16 +1818,16 @@
cairo_line_to (cr, bar_x, height-5);
ge_cairo_set_color (cr, dark);
cairo_stroke (cr);
-
+
cairo_move_to (cr, bar_x+1, 4);
cairo_line_to (cr, bar_x+1, height-5);
ge_cairo_set_color (cr, light);
cairo_stroke (cr);
-
+
bar_x += 3;
}
}
-
+
}
static void
@@ -1908,7 +1908,7 @@
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:
@@ -1927,11 +1927,11 @@
ge_cairo_set_color (cr, fill);
cairo_fill (cr);
}
-
+
cairo_translate (cr, x+0.5, y+0.5);
-
+
cairo_set_line_width (cr, 1);
-
+
if (handle->horizontal)
{
params->style_functions->draw_gripdots (cr, colors, 0, 0, width, height, num_bars, 2, 0.1);
@@ -1955,7 +1955,7 @@
int x_down;
int y_down;
int dots;
-
+
ge_shade_color (dark, 1.5, &hilight);
/* The number of dots fitting into the area. Just hardcoded to 4 right now. */
@@ -2049,28 +2049,28 @@
cairo_pattern_add_color_stop_rgba (pt, 0.5, shadow.r, shadow.b, shadow.g, 0.5);
cairo_pattern_add_color_stop_rgba (pt, 0.5, highlight.r, highlight.g, highlight.b, 0.5);
cairo_pattern_add_color_stop_rgb (pt, 1.0, highlight.r, highlight.g, highlight.b);
-
+
cairo_translate (cr, x, y);
-
+
cairo_set_line_width (cr, 2);
- cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
+ cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
cairo_set_source (cr, pt);
cairo_stroke (cr);
cairo_pattern_destroy (pt);
cairo_set_line_width (cr, 1);
- cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
-
+ cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
+
if (!widget->disabled)
{
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}
-
+
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
-
+
if (draw_bullet)
{
if (inconsistent)
@@ -2089,7 +2089,7 @@
cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
ge_cairo_set_color (cr, dot);
cairo_fill (cr);
-
+
cairo_arc (cr, 6, 6, 1, 0, G_PI*2);
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
cairo_fill (cr);
@@ -2111,7 +2111,7 @@
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
-
+
if (widget->disabled)
{
border = &colors->shade[5];
@@ -2125,11 +2125,11 @@
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1);
-
+
if (widget->xthickness > 2 && widget->ythickness > 2)
{
widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, 1, CR_CORNER_ALL);
-
+
/* Draw the rectangle for the checkbox itself */
ge_cairo_rounded_rectangle (cr, 1.5, 1.5, width-3, height-3, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
@@ -2138,13 +2138,13 @@
/* Draw the rectangle for the checkbox itself */
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
-
+
if (!widget->disabled)
{
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}
-
+
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
@@ -2161,13 +2161,13 @@
cairo_set_line_width (cr, 1.7);
cairo_move_to (cr, 0.5 + (width*0.2), (height*0.5));
cairo_line_to (cr, 0.5 + (width*0.4), (height*0.7));
-
+
cairo_curve_to (cr, 0.5 + (width*0.4), (height*0.7),
0.5 + (width*0.5), (height*0.4),
0.5 + (width*0.70), (height*0.25));
}
-
+
ge_cairo_set_color (cr, dot);
cairo_stroke (cr);
}
@@ -2186,7 +2186,7 @@
arrow_width = MIN (height * 2.0 + MAX (1.0, ceil (height * 2.0 / 6.0 * 2.0) / 2.0) / 2.0, width);
line_width_2 = MAX (1.0, ceil (arrow_width / 6.0 * 2.0) / 2.0) / 2.0;
arrow_height = arrow_width / 2.0 + line_width_2;
-
+
cairo_translate (cr, x, y - arrow_height / 2.0);
cairo_move_to (cr, -arrow_width / 2.0, line_width_2);
@@ -2197,10 +2197,10 @@
cairo_line_to (cr, arrow_width / 2.0, line_width_2);
cairo_line_to (cr, 0, arrow_height);
cairo_close_path (cr);
-
+
ge_cairo_set_color (cr, color);
cairo_fill (cr);
-
+
cairo_restore (cr);
}
@@ -2211,13 +2211,13 @@
double arrow_width = MIN (height * 2 / 3.0, width);
double arrow_height = arrow_width / 2.0;
double gap_size = 1.0 * arrow_height;
-
+
cairo_save (cr);
cairo_translate (cr, x, y - (arrow_height + gap_size) / 2.0);
cairo_rotate (cr, G_PI);
clearlooks_draw_normal_arrow (cr, color, 0, 0, arrow_width, arrow_height);
cairo_restore (cr);
-
+
clearlooks_draw_normal_arrow (cr, color, x, y + (arrow_height + gap_size) / 2.0, arrow_width, arrow_height);
}
@@ -2227,7 +2227,7 @@
double x, double y, double width, double height)
{
double rotate;
-
+
if (dir == CL_DIRECTION_LEFT)
rotate = G_PI*1.5;
else if (dir == CL_DIRECTION_RIGHT)
@@ -2238,7 +2238,7 @@
rotate = 0;
else
return;
-
+
if (type == CL_ARROW_NORMAL)
{
cairo_translate (cr, x, y);
@@ -2254,17 +2254,17 @@
static void
clearlooks_draw_arrow (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const ArrowParameters *arrow,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const ArrowParameters *arrow,
int x, int y, int width, int height)
{
const CairoColor *color = &colors->fg[widget->state_type];
gdouble tx, ty;
-
+
tx = x + width/2.0;
ty = y + height/2.0;
-
+
if (widget->disabled)
{
_clearlooks_draw_arrow (cr, &colors->shade[0],
@@ -2273,16 +2273,16 @@
}
cairo_identity_matrix (cr);
-
+
_clearlooks_draw_arrow (cr, color, arrow->direction, arrow->type,
tx, ty, width, height);
}
-static void
+void
clearlooks_draw_focus (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const FocusParameters *focus,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const FocusParameters *focus,
int x, int y, int width, int height)
{
if (focus->has_color)
Modified: trunk/engines/clearlooks/src/clearlooks_draw.h
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw.h (original)
+++ trunk/engines/clearlooks/src/clearlooks_draw.h Mon Jan 21 23:18:09 2008
@@ -10,8 +10,15 @@
#include <cairo.h>
GE_INTERNAL void clearlooks_register_style_classic (ClearlooksStyleFunctions *functions);
-GE_INTERNAL void clearlooks_register_style_glossy (ClearlooksStyleFunctions *functions);
-GE_INTERNAL void clearlooks_register_style_gummy (ClearlooksStyleFunctions *functions);
+GE_INTERNAL void clearlooks_register_style_glossy (ClearlooksStyleFunctions *functions);
+GE_INTERNAL void clearlooks_register_style_gummy (ClearlooksStyleFunctions *functions);
GE_INTERNAL void clearlooks_register_style_inverted (ClearlooksStyleFunctions *functions);
+/* Fallback focus function */
+GE_INTERNAL void clearlooks_draw_focus (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const FocusParameters *focus,
+ int x, int y, int width, int height);
+
#endif /* CLEARLOOKS_DRAW_H */
Modified: trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw_gummy.c (original)
+++ trunk/engines/clearlooks/src/clearlooks_draw_gummy.c Mon Jan 21 23:18:09 2008
@@ -651,7 +651,6 @@
const TabParameters *tab,
int x, int y, int width, int height)
{
-
const CairoColor *border = &colors->shade[5];
const CairoColor *stripe_fill = &colors->spot[1];
const CairoColor *stripe_border = &colors->spot[2];
@@ -683,11 +682,11 @@
{
if (params->ythickness == 3)
stripe_size = 3.0;
-
+
height += 3.0;
stripe_fill_size = (tab->gap_side == CL_GAP_TOP ? stripe_size/height : stripe_size/(height-2));
stripe_border_pos = (tab->gap_side == CL_GAP_TOP ? (stripe_size+1.0)/height : (stripe_size+1.0)/(height-2));
-
+
horizontal = TRUE;
if (tab->gap_side == CL_GAP_TOP)
@@ -697,7 +696,7 @@
{
if (params->xthickness == 3)
stripe_size = 3.0;
-
+
width += 3.0;
stripe_fill_size = (tab->gap_side == CL_GAP_LEFT ? stripe_size/width : stripe_size/(width-2));
stripe_border_pos = (tab->gap_side == CL_GAP_LEFT ? (stripe_size+1.0)/width : (stripe_size+1.0)/(width-2));
@@ -733,7 +732,7 @@
{
CairoColor hilight;
CairoColor shade1, shade2, shade3;
-
+
ge_shade_color (fill, 1.15, &hilight);
ge_shade_color (fill, SHADE_TOP, &shade1);
ge_shade_color (fill, SHADE_CENTER_TOP, &shade2);
@@ -770,9 +769,9 @@
else
{
CairoColor shade1;
-
+
ge_shade_color (fill, SHADE_TOP, &shade1);
-
+
switch (tab->gap_side)
{
case CL_GAP_TOP:
@@ -1561,7 +1560,7 @@
CairoColor fill = focus->color;
CairoColor fill_shade1, fill_shade2, fill_shade3;
CairoColor border;
-
+
/* Default values */
double xoffset = 1.5;
double yoffset = 1.5;
@@ -1572,12 +1571,12 @@
boolean focus_fill = TRUE;
boolean focus_border = TRUE;
boolean focus_shadow = FALSE;
-
+
ge_shade_color (&fill, 0.65, &border);
ge_shade_color (&fill, 1.18, &fill_shade1);
ge_shade_color (&fill, 1.02, &fill_shade2);
ge_shade_color (&fill, 0.84, &fill_shade3);
-
+
/* Do some useful things to adjust focus */
switch (focus->type)
{
@@ -1624,26 +1623,27 @@
focus_fill = FALSE;
break;
case CL_FOCUS_TAB:
- radius--;
break;
case CL_FOCUS_SCALE:
break;
case CL_FOCUS_UNKNOWN:
+ /* Fallback to classic function, dots */
+ clearlooks_draw_focus (cr, colors, widget, focus, x, y, width, height);
return;
break;
default:
break;
};
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, focus->line_width);
-
+
ge_cairo_rounded_rectangle (cr, xoffset, yoffset, width-(xoffset*2), height-(yoffset*2), radius, widget->corners);
-
+
if (focus_fill)
{
cairo_pattern_t *pattern;
-
+
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, fill_shade1.r, fill_shade1.g, fill_shade1.b, fill_alpha);
cairo_pattern_add_color_stop_rgba (pattern, 0.5, fill_shade2.r, fill_shade2.g, fill_shade2.b, fill_alpha);
@@ -1651,16 +1651,16 @@
cairo_pattern_add_color_stop_rgba (pattern, 1.0, fill_shade3.r, fill_shade3.g, fill_shade3.b, fill_alpha);
cairo_set_source (cr, pattern);
cairo_fill_preserve (cr);
-
+
cairo_pattern_destroy (pattern);
}
-
+
if (focus_border)
{
clearlooks_set_mixed_color (cr, &widget->parentbg, &border, border_alpha);
cairo_stroke (cr);
}
-
+
if (focus_shadow)
{
if (radius > 0)
Modified: trunk/engines/clearlooks/src/clearlooks_style.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_style.c (original)
+++ trunk/engines/clearlooks/src/clearlooks_style.c Mon Jan 21 23:18:09 2008
@@ -78,7 +78,7 @@
params->xthickness = style->xthickness;
params->ythickness = style->ythickness;
-
+
/* This is used in GtkEntry to fake transparency. The reason to do this
* is that the entry has it's entire background filled with base[STATE].
* This is not a very good solution as it will eg. fail if one changes
@@ -90,7 +90,7 @@
static void
clearlooks_style_draw_flat_box (DRAW_ARGS)
{
- if (detail &&
+ if (detail &&
state_type == GTK_STATE_SELECTED && (
!strncmp ("cell_even", detail, 9) ||
!strncmp ("cell_odd", detail, 8)))
@@ -162,7 +162,7 @@
(DETAIL ("frame") && CHECK_HINT (GE_HINT_COMBOBOX_ENTRY)))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
/* Override the entries state type, because we are too lame to handle this via
@@ -175,20 +175,20 @@
width += style->xthickness;
if (!params.ltr)
x -= style->xthickness;
-
+
if (params.ltr)
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
else
params.corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
}
-
+
STYLE_FUNCTION (draw_entry) (cr, &clearlooks_style->colors, ¶ms,
x, y, width, height);
}
else if (DETAIL ("frame") && CHECK_HINT (GE_HINT_STATUSBAR))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
gtk_style_apply_default_background (style, window, TRUE, state_type,
@@ -204,10 +204,10 @@
frame.shadow = shadow_type;
frame.gap_x = -1; /* No gap will be drawn */
frame.border = &colors->shade[4];
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = CR_CORNER_NONE;
-
+
if (widget && !g_str_equal ("XfcePanelWindow", gtk_widget_get_name (gtk_widget_get_toplevel (widget))))
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame,
x, y, width, height);
@@ -230,14 +230,14 @@
frame.border = &colors->shade[5];
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = CR_CORNER_ALL;
-
+
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame, x, y, width, height);
}
-
+
cairo_destroy (cr);
}
-static void
+static void
clearlooks_style_draw_box_gap (DRAW_ARGS,
GtkPositionType gap_side,
gint gap_x,
@@ -257,13 +257,13 @@
WidgetParameters params;
FrameParameters frame;
gboolean start, end;
-
+
frame.shadow = shadow_type;
frame.gap_side = gap_side;
frame.gap_x = gap_x;
frame.gap_width = gap_width;
frame.border = &colors->shade[5];
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
clearlooks_get_notebook_tab_position (widget, &start, &end);
@@ -294,7 +294,7 @@
params.corners ^= CR_CORNER_BOTTOMLEFT;
if (end)
params.corners ^= CR_CORNER_BOTTOMRIGHT;
- }
+ }
else
{
if (start)
@@ -321,7 +321,7 @@
ge_cairo_rounded_rectangle (cr, x, y, width, height, params.radius, params.corners);
ge_cairo_set_color (cr, &colors->bg[GTK_STATE_NORMAL]);
cairo_fill (cr);
-
+
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame,
x, y, width, height);
}
@@ -332,8 +332,8 @@
x, y, width, height,
gap_side, gap_x, gap_width);
}
-
- cairo_destroy (cr);
+
+ cairo_destroy (cr);
}
static void
@@ -347,16 +347,16 @@
SANITIZE_SIZE
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
if (DETAIL ("tab"))
{
WidgetParameters params;
TabParameters tab;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
tab.gap_side = (ClearlooksGapSide)gap_side;
-
+
switch (gap_side)
{
case CL_GAP_TOP:
@@ -372,7 +372,7 @@
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
break;
}
-
+
STYLE_FUNCTION(draw_tab) (cr, colors, ¶ms, &tab,
x, y, width, height);
}
@@ -381,24 +381,23 @@
clearlooks_parent_class->draw_extension (style, window, state_type, shadow_type, area,
widget, detail, x, y, width, height,
gap_side);
-
}
-
+
cairo_destroy (cr);
}
-static void
+static void
clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
ClearlooksColors *colors = &clearlooks_style->colors;
cairo_t *cr;
-
+
CHECK_ARGS
SANITIZE_SIZE
-
+
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
if (DETAIL ("handlebox"))
{
WidgetParameters params;
@@ -407,7 +406,7 @@
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
handle.type = CL_HANDLE_TOOLBAR;
handle.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
-
+
STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &handle,
x, y, width, height);
}
@@ -419,7 +418,7 @@
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
handle.type = CL_HANDLE_SPLITTER;
handle.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
-
+
STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &handle,
x, y, width, height);
}
@@ -431,7 +430,7 @@
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
handle.type = CL_HANDLE_TOOLBAR;
handle.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
-
+
STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &handle,
x, y, width, height);
}
@@ -456,7 +455,7 @@
{
WidgetParameters params;
MenuBarParameters menubar;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
menubar.style = clearlooks_style->menubarstyle;
@@ -468,18 +467,18 @@
{
WidgetParameters params;
ListViewHeaderParameters header;
-
+
gint columns, column_index;
gboolean resizable = TRUE;
-
+
/* XXX: This makes unknown treeview header CL_ORDER_MIDDLE, in need for something nicer */
columns = 3;
column_index = 1;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
params.corners = CR_CORNER_NONE;
-
+
if (GE_IS_TREE_VIEW (widget->parent))
{
clearlooks_treeview_get_header_index (GTK_TREE_VIEW(widget->parent),
@@ -491,18 +490,18 @@
clearlooks_clist_get_header_index (GTK_CLIST(widget->parent),
widget, &column_index, &columns);
}
-
+
header.resizable = resizable;
-
+
if (column_index == 0)
header.order = params.ltr ? CL_ORDER_FIRST : CL_ORDER_LAST;
else if (column_index == columns-1)
header.order = params.ltr ? CL_ORDER_LAST : CL_ORDER_FIRST;
else
header.order = CL_ORDER_MIDDLE;
-
+
gtk_style_apply_default_background (style, window, FALSE, state_type, area, x, y, width, height);
-
+
STYLE_FUNCTION(draw_list_view_header) (cr, colors, ¶ms, &header,
x, y, width, height);
}
@@ -519,7 +518,7 @@
params.corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
else
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
-
+
shadow.shadow = CL_SHADOW_IN;
if (params.xthickness > 2)
@@ -534,7 +533,7 @@
params.corners = CR_CORNER_ALL;
params.enable_glow = TRUE;
}
-
+
STYLE_FUNCTION(draw_button) (cr, &clearlooks_style->colors, ¶ms,
x, y, width, height);
}
@@ -544,14 +543,14 @@
{
WidgetParameters params;
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
if (style->xthickness == 3)
{
width++;
if (params.ltr)
x--;
}
-
+
if (DETAIL ("spinbutton_up"))
{
height+=2;
@@ -567,28 +566,28 @@
else
params.corners = CR_CORNER_BOTTOMLEFT;
}
-
+
STYLE_FUNCTION(draw_spinbutton_down) (cr, &clearlooks_style->colors, ¶ms, x, y, width, height);
}
}
else if (DETAIL ("spinbutton"))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
if (params.ltr)
params.corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
else
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
-
+
if (style->xthickness == 3)
{
if (params.ltr)
x--;
width++;
}
-
+
STYLE_FUNCTION(draw_spinbutton) (cr, &clearlooks_style->colors, ¶ms,
x, y, width, height);
}
@@ -596,10 +595,10 @@
{
WidgetParameters params;
SliderParameters slider;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = CR_CORNER_NONE;
-
+
slider.lower = DETAIL ("trough-lower");
slider.fill_level = DETAIL ("trough-fill-level") || DETAIL ("trough-fill-level-full");
@@ -609,7 +608,7 @@
slider.horizontal = FALSE;
else /* Fallback based on the size... */
slider.horizontal = width >= height;
-
+
STYLE_FUNCTION(draw_scale_trough) (cr, &clearlooks_style->colors,
¶ms, &slider,
x, y, width, height);
@@ -617,24 +616,24 @@
else if (DETAIL ("trough") && CHECK_HINT (GE_HINT_PROGRESSBAR))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
- STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, ¶ms,
+
+ STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, ¶ms,
x, y, width, height);
}
else if (DETAIL ("trough") && CHECK_HINT (GE_HINT_SCROLLBAR))
{
WidgetParameters params;
ScrollBarParameters scrollbar;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = CR_CORNER_NONE;
-
+
scrollbar.horizontal = TRUE;
scrollbar.junction = clearlooks_scrollbar_get_junction (widget);
-
-
+
+
if (CHECK_HINT (GE_HINT_HSCROLLBAR))
scrollbar.horizontal = TRUE;
else if (CHECK_HINT (GE_HINT_VSCROLLBAR))
@@ -653,7 +652,7 @@
y += 2;
height -= 4;
}
-
+
STYLE_FUNCTION(draw_scrollbar_trough) (cr, colors, ¶ms, &scrollbar,
x, y, width, height);
}
@@ -665,10 +664,10 @@
#ifdef HAVE_ANIMATION
if(clearlooks_style->animation && CL_IS_PROGRESS_BAR (widget))
- {
+ {
gboolean activity_mode = GTK_PROGRESS (widget)->activity_mode;
-
- if (!activity_mode)
+
+ if (!activity_mode)
clearlooks_animation_progressbar_add ((gpointer)widget);
}
@@ -689,7 +688,7 @@
progressbar.value = 0;
progressbar.pulsing = FALSE;
}
-
+
if (!params.ltr)
{
if (progressbar.orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
@@ -733,12 +732,12 @@
tmp.height += 2;
}
}
-
+
cairo_reset_clip (cr);
gdk_cairo_rectangle (cr, &tmp);
cairo_clip (cr);
}
-
+
STYLE_FUNCTION(draw_progressbar_fill) (cr, colors, ¶ms, &progressbar,
x, y, width, height,
10 - (int)(elapsed * 10.0) % 10);
@@ -747,21 +746,21 @@
{
WidgetParameters params;
OptionMenuParameters optionmenu;
-
+
GtkRequisition indicator_size;
GtkBorder indicator_spacing;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
params.enable_glow = TRUE;
ge_option_menu_get_props (widget, &indicator_size, &indicator_spacing);
-
+
if (ge_widget_is_ltr (widget))
optionmenu.linepos = width - (indicator_size.width + indicator_spacing.left + indicator_spacing.right) - 1;
else
optionmenu.linepos = (indicator_size.width + indicator_spacing.left + indicator_spacing.right) + 1;
-
+
STYLE_FUNCTION(draw_optionmenu) (cr, colors, ¶ms, &optionmenu,
x, y, width, height);
}
@@ -769,7 +768,7 @@
{
WidgetParameters params;
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
if (CHECK_HINT (GE_HINT_MENUBAR))
{
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT;
@@ -777,7 +776,7 @@
STYLE_FUNCTION(draw_menubaritem) (cr, colors, ¶ms, x, y, width, height);
}
else
- {
+ {
params.corners = CR_CORNER_ALL;
STYLE_FUNCTION(draw_menuitem) (cr, colors, ¶ms, x, y, width, height);
}
@@ -788,15 +787,15 @@
ScrollBarParameters scrollbar;
ScrollBarStepperParameters stepper;
GdkRectangle this_rectangle;
-
+
this_rectangle.x = x;
this_rectangle.y = y;
this_rectangle.width = width;
this_rectangle.height = height;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = CR_CORNER_NONE;
-
+
scrollbar.has_color = FALSE;
scrollbar.horizontal = TRUE;
scrollbar.junction = clearlooks_scrollbar_get_junction (widget);
@@ -805,7 +804,7 @@
scrollbar.has_color = TRUE;
scrollbar.horizontal = DETAIL ("hscrollbar");
-
+
stepper.stepper = clearlooks_scrollbar_get_stepper (widget, &this_rectangle);
STYLE_FUNCTION(draw_scrollbar_stepper) (cr, colors, ¶ms, &scrollbar, &stepper,
@@ -832,9 +831,9 @@
else if (DETAIL ("menu"))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
STYLE_FUNCTION(draw_menu_frame) (cr, colors, ¶ms, x, y, width, height);
}
else if (DETAIL ("hseparator") || DETAIL ("vseparator"))
@@ -852,7 +851,7 @@
{
gtk_paint_hline (style, window, state_type, area, widget, new_detail,
x, x + width - 1, y + height/2);
- }
+ }
else
gtk_paint_vline (style, window, state_type, area, widget, new_detail,
y, y + height - 1, x + width/2);
@@ -862,7 +861,7 @@
clearlooks_parent_class->draw_box (style, window, state_type, shadow_type, area,
widget, detail, x, y, width, height);
}
-
+
cairo_destroy (cr);
}
@@ -878,21 +877,21 @@
CHECK_ARGS
SANITIZE_SIZE
-
+
if (DETAIL ("hscale") || DETAIL ("vscale"))
{
WidgetParameters params;
SliderParameters slider;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
slider.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
slider.lower = FALSE;
slider.fill_level = FALSE;
-
+
if (clearlooks_style->style == CL_STYLE_GLOSSY) /* XXX! */
params.corners = CR_CORNER_ALL;
-
+
STYLE_FUNCTION(draw_slider_button) (cr, &clearlooks_style->colors,
¶ms, &slider,
x, y, width, height);
@@ -925,7 +924,7 @@
if ((clearlooks_style->style == CL_STYLE_GLOSSY || clearlooks_style->style == CL_STYLE_GUMMY)
&& !scrollbar.has_color)
scrollbar.color = colors->bg[0];
-
+
STYLE_FUNCTION(draw_scrollbar_slider) (cr, colors, ¶ms, &scrollbar,
x, y, width, height);
}
@@ -946,18 +945,18 @@
WidgetParameters params;
CheckboxParameters checkbox;
cairo_t *cr;
-
+
CHECK_ARGS
SANITIZE_SIZE
cr = ge_gdk_drawable_to_cairo (window, area);
colors = &clearlooks_style->colors;
-
+
checkbox.shadow_type = shadow_type;
checkbox.in_menu = (widget && GTK_IS_MENU(widget->parent));
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
STYLE_FUNCTION(draw_radiobutton) (cr, colors, ¶ms, &checkbox, x, y, width, height);
cairo_destroy (cr);
@@ -975,11 +974,11 @@
SANITIZE_SIZE
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
-
+
params.corners = CR_CORNER_ALL;
-
+
checkbox.shadow_type = shadow_type;
checkbox.in_cell = DETAIL("cellcheck");
@@ -987,7 +986,7 @@
STYLE_FUNCTION(draw_checkbox) (cr, &clearlooks_style->colors, ¶ms, &checkbox,
x, y, width, height);
-
+
cairo_destroy (cr);
}
@@ -1017,7 +1016,7 @@
* (and even if, a normal one should be better on menu bars) */
STYLE_FUNCTION(draw_separator) (cr, colors, NULL, &separator,
x, y1, 2, y2-y1+1);
-
+
cairo_destroy (cr);
}
@@ -1042,20 +1041,20 @@
colors = &clearlooks_style->colors;
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
separator.horizontal = TRUE;
-
+
if (!DETAIL ("menuitem"))
STYLE_FUNCTION(draw_separator) (cr, colors, NULL, &separator,
x1, y, x2-x1+1, 2);
else
STYLE_FUNCTION(draw_menu_item_separator) (cr, colors, NULL, &separator,
x1, y, x2-x1+1, 2);
-
+
cairo_destroy (cr);
}
-static void
+static void
clearlooks_style_draw_shadow_gap (DRAW_ARGS,
GtkPositionType gap_side,
gint gap_x,
@@ -1070,32 +1069,32 @@
cr = ge_gdk_drawable_to_cairo (window, area);
colors = &clearlooks_style->colors;
-
+
if (DETAIL ("frame"))
{
WidgetParameters params;
FrameParameters frame;
-
+
frame.shadow = shadow_type;
frame.gap_side = gap_side;
frame.gap_x = gap_x;
frame.gap_width = gap_width;
frame.border = &colors->shade[5];
-
+
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = CR_CORNER_ALL;
-
+
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame,
x, y, width, height);
}
else
{
clearlooks_parent_class->draw_shadow_gap (style, window, state_type, shadow_type, area,
- widget, detail, x, y, width, height,
- gap_side, gap_x, gap_width);
+ widget, detail, x, y, width, height,
+ gap_side, gap_x, gap_width);
}
-
+
cairo_destroy (cr);
}
@@ -1127,7 +1126,7 @@
cr = ge_gdk_drawable_to_cairo (window, area);
- clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
+ clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
STYLE_FUNCTION(draw_resize_grip) (cr, colors, ¶ms, &grip,
x, y, width, height);
@@ -1146,7 +1145,7 @@
CHECK_ARGS
SANITIZE_SIZE
-
+
cr = ge_gdk_drawable_to_cairo (window, area);
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
@@ -1196,7 +1195,7 @@
{
arrow.type = CL_ARROW_COMBO;
}
-
+
/* I have no idea why, but the arrow of GtkCombo is larger than in other places.
* Subtracting 3 seems to fix this. */
if (widget && widget->parent && GE_IS_COMBO (widget->parent->parent))
@@ -1218,12 +1217,12 @@
GtkRcStyle * rc_style)
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-
+
clearlooks_parent_class->init_from_rc (style, rc_style);
-
+
g_assert ((CLEARLOOKS_RC_STYLE (rc_style)->style >= 0) && (CLEARLOOKS_RC_STYLE (rc_style)->style < CL_NUM_STYLES));
clearlooks_style->style = CLEARLOOKS_RC_STYLE (rc_style)->style;
-
+
clearlooks_style->menubarstyle = CLEARLOOKS_RC_STYLE (rc_style)->menubarstyle;
clearlooks_style->toolbarstyle = CLEARLOOKS_RC_STYLE (rc_style)->toolbarstyle;
clearlooks_style->has_focus_color = CLEARLOOKS_RC_STYLE (rc_style)->flags & CL_FLAG_FOCUS_COLOR;
@@ -1251,7 +1250,7 @@
clearlooks_parent_class->realize (style);
contrast = CLEARLOOKS_RC_STYLE (style->rc_style)->contrast;
-
+
/* Lighter to darker */
ge_gdk_color_to_cairo (&style->bg[GTK_STATE_NORMAL], &bg_normal);
@@ -1331,7 +1330,7 @@
focus.dash_list = dash_list;
else
focus.dash_list = (guint8*) g_strdup ("\1\1");
-
+
/* Focus type */
if (DETAIL("button"))
{
@@ -1345,7 +1344,7 @@
/* Check for the shadow type. */
if (widget && GTK_IS_BUTTON (widget))
g_object_get (G_OBJECT (widget), "relief", &relief, NULL);
-
+
if (relief == GTK_RELIEF_NORMAL)
focus.type = CL_FOCUS_BUTTON;
else
@@ -1389,7 +1388,7 @@
else
focus.continue_side = CL_CONT_LEFT | CL_CONT_RIGHT;
}
-
+
}
else if (detail && g_str_has_prefix (detail, "trough") && CHECK_HINT (GE_HINT_SCALE))
{
@@ -1418,7 +1417,7 @@
{
focus.type = CL_FOCUS_UNKNOWN; /* Custom widgets (Beagle) and something unknown */
}
-
+
/* Focus color */
if (clearlooks_style->has_focus_color)
{
@@ -1490,7 +1489,7 @@
{
/* The "4" is the number of chars per pixel, in this case, RGBA,
the 3 means "skip to the alpha" */
- current = data + (y * rowstride) + (x * 4) + 3;
+ current = data + (y * rowstride) + (x * 4) + 3;
*(current) = (guchar) (*(current) * alpha_percent);
}
}
@@ -1550,7 +1549,7 @@
ge_shade_color (¶ms.parentbg, 1.2, &temp);
else
ge_shade_color (&colors->bg[widget->state], 1.2, &temp);
-
+
etched.red = (int) (temp.r * 65535);
etched.green = (int) (temp.g * 65535);
etched.blue = (int) (temp.b * 65535);
@@ -1581,16 +1580,16 @@
GdkPixbuf *base_pixbuf;
GdkScreen *screen;
GtkSettings *settings;
-
+
/* Oddly, style can be NULL in this function, because
* GtkIconSet can be used without a style and if so
* it uses this function.
*/
-
+
base_pixbuf = gtk_icon_source_get_pixbuf (source);
-
+
g_return_val_if_fail (base_pixbuf != NULL, NULL);
-
+
if (widget && gtk_widget_has_screen (widget))
{
screen = gtk_widget_get_screen (widget);
@@ -1621,7 +1620,7 @@
scaled = scale_or_ref (base_pixbuf, width, height);
else
scaled = g_object_ref (base_pixbuf);
-
+
/* If the state was wildcarded, then generate a state. */
if (gtk_icon_source_get_state_wildcarded (source))
{
@@ -1629,15 +1628,15 @@
{
stated = set_transparency (scaled, 0.3);
gdk_pixbuf_saturate_and_pixelate (stated, stated, 0.1, FALSE);
-
+
g_object_unref (scaled);
- }
+ }
else if (state == GTK_STATE_PRELIGHT)
{
stated = gdk_pixbuf_copy (scaled);
-
+
gdk_pixbuf_saturate_and_pixelate (scaled, stated, 1.2, FALSE);
-
+
g_object_unref (scaled);
}
else
@@ -1660,7 +1659,7 @@
clearlooks_style_class_init (ClearlooksStyleClass * klass)
{
GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
-
+
clearlooks_style_class = CLEARLOOKS_STYLE_CLASS (klass);
clearlooks_parent_class = g_type_class_peek_parent (klass);
Modified: trunk/engines/clearlooks/src/clearlooks_types.h
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_types.h (original)
+++ trunk/engines/clearlooks/src/clearlooks_types.h Mon Jan 21 23:18:09 2008
@@ -288,196 +288,196 @@
struct _ClearlooksStyleFunctions
{
- void (*draw_button) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_button) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_scale_trough) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const SliderParameters *slider,
+ void (*draw_scale_trough) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const SliderParameters *slider,
int x, int y, int width, int height);
- void (*draw_progressbar_trough) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_progressbar_trough) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_progressbar_fill) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_progressbar_fill) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
const ProgressBarParameters *progressbar,
int x, int y, int width, int height, gint offset);
- void (*draw_slider_button) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const SliderParameters *slider,
+ void (*draw_slider_button) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const SliderParameters *slider,
int x, int y, int width, int height);
- void (*draw_entry) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_entry) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_spinbutton) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_spinbutton) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_spinbutton_down) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_spinbutton_down) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_optionmenu) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_optionmenu) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
const OptionMenuParameters *optionmenu,
int x, int y, int width, int height);
- void (*draw_inset) (cairo_t *cr,
- const CairoColor *bg_color,
+ void (*draw_inset) (cairo_t *cr,
+ const CairoColor *bg_color,
double x, double y, double w, double h,
double radius, uint8 corners);
- void (*draw_menubar) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const MenuBarParameters *menubar,
+ void (*draw_menubar) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const MenuBarParameters *menubar,
int x, int y, int width, int height);
- void (*draw_tab) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const TabParameters *tab,
+ void (*draw_tab) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const TabParameters *tab,
int x, int y, int width, int height);
- void (*draw_frame) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const FrameParameters *frame,
+ void (*draw_frame) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const FrameParameters *frame,
int x, int y, int width, int height);
- void (*draw_separator) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const SeparatorParameters *separator,
+ void (*draw_separator) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const SeparatorParameters *separator,
int x, int y, int width, int height);
- void (*draw_menu_item_separator) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const SeparatorParameters *separator,
+ void (*draw_menu_item_separator) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const SeparatorParameters *separator,
int x, int y, int width, int height);
- void (*draw_list_view_header) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const ListViewHeaderParameters *header,
+ void (*draw_list_view_header) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const ListViewHeaderParameters *header,
int x, int y, int width, int height);
- void (*draw_toolbar) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const ToolbarParameters *toolbar,
+ void (*draw_toolbar) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const ToolbarParameters *toolbar,
int x, int y, int width, int height);
- void (*draw_menuitem) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_menuitem) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_menubaritem) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_menubaritem) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_selected_cell) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_selected_cell) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_scrollbar_stepper) (cairo_t *cr,
+ void (*draw_scrollbar_stepper) (cairo_t *cr,
const ClearlooksColors *colors,
const WidgetParameters *widget,
const ScrollBarParameters *scrollbar,
const ScrollBarStepperParameters *stepper,
int x, int y, int width, int height);
- void (*draw_scrollbar_slider) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_scrollbar_slider) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height);
- void (*draw_scrollbar_trough) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_scrollbar_trough) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height);
- void (*draw_statusbar) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_statusbar) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_menu_frame) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_menu_frame) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_tooltip) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_tooltip) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
- void (*draw_handle) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const HandleParameters *handle,
+ void (*draw_handle) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const HandleParameters *handle,
int x, int y, int width, int height);
- void (*draw_resize_grip) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_resize_grip) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
const ResizeGripParameters *grip,
int x, int y, int width, int height);
- void (*draw_arrow) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const ArrowParameters *arrow,
+ void (*draw_arrow) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const ArrowParameters *arrow,
int x, int y, int width, int height);
- void (*draw_focus) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const FocusParameters *focus,
+ void (*draw_focus) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
+ const FocusParameters *focus,
int x, int y, int width, int height);
- void (*draw_checkbox) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_checkbox) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
const CheckboxParameters *checkbox,
int x, int y, int width, int height);
- void (*draw_radiobutton) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_radiobutton) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
const CheckboxParameters *checkbox,
int x, int y, int width, int height);
/* Style internal functions */
/* XXX: Only used by slider_button, inline it? */
- void (*draw_shadow) (cairo_t *cr,
- const ClearlooksColors *colors,
+ void (*draw_shadow) (cairo_t *cr,
+ const ClearlooksColors *colors,
gfloat radius, int width, int height);
- void (*draw_slider) (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
+ void (*draw_slider) (cairo_t *cr,
+ const ClearlooksColors *colors,
+ const WidgetParameters *widget,
int x, int y, int width, int height);
void (*draw_gripdots) (cairo_t *cr,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]