mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
Update to clearlooks from gtk-engines-2.16.0
git-svn-id: svn://localhost/ardour2/branches/3.0@3857 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9a8eda6930
commit
8635f0e897
21 changed files with 2859 additions and 2092 deletions
|
|
@ -16,7 +16,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#ifdef HAVE_ANIMATION
|
||||
#include <gtk/gtk.h>
|
||||
|
|
|
|||
|
|
@ -1,121 +0,0 @@
|
|||
static unsigned char dot_intensity[] = {
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x98,0xb9,0xc6,0xb9,0x91,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0xb9,0xbd,0xac,0x9e,0x65,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0xc6,0xac,0x9e,0x96,0x5c,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0xb9,0x9e,0x96,0x62,0x55,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x91,0x65,0x5c,0x55,0x68,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,0x6e,
|
||||
};
|
||||
static unsigned char dot_alpha[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x66,0xc4,0xff,0xc4,0x66,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x66,0xdf,0xff,0xff,0xff,0xdf,0x66,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xc4,0xff,0xff,0xff,0xff,0xff,0xc4,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xc4,0xff,0xff,0xff,0xff,0xff,0xc4,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x66,0xdf,0xff,0xff,0xff,0xdf,0x66,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x66,0xc4,0xff,0xc4,0x66,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char circle_alpha[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x23,0x62,0x92,0xb3,0xb2,0x95,0x2b,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3e,0xab,0xc9,0xeb,0xf9,0xf5,0xfd,0xff,0x57,0x00,0x00,
|
||||
0x00,0x1f,0xb5,0xd8,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x2b,0x00,
|
||||
0x00,0x67,0xb9,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9c,0x00,
|
||||
0x00,0x9a,0xe2,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0x00,
|
||||
0x00,0xba,0xeb,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xc0,0xfa,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0x00,
|
||||
0x00,0x9b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9c,0x00,
|
||||
0x00,0x2b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2b,0x00,
|
||||
0x00,0x00,0x57,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x57,0x00,0x00,
|
||||
0x00,0x00,0x00,0x2b,0x9c,0xe5,0xff,0xe5,0x9c,0x2b,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
static unsigned char outline_alpha[] = {
|
||||
0x00,0x00,0x00,0x4a,0xac,0xe9,0xff,0xe9,0xac,0x4a,0x00,0x00,0x00,
|
||||
0x00,0x00,0x98,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x98,0x00,0x00,
|
||||
0x00,0x98,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x98,0x00,
|
||||
0x4a,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x4a,
|
||||
0xac,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xac,
|
||||
0xe9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe9,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xe9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe9,
|
||||
0xac,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xac,
|
||||
0x4a,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x4a,
|
||||
0x00,0x98,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x98,0x00,
|
||||
0x00,0x00,0x98,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x98,0x00,0x00,
|
||||
0x00,0x00,0x00,0x4a,0xac,0xe9,0xff,0xe9,0xac,0x4a,0x00,0x00,0x00,
|
||||
};
|
||||
static unsigned char inconsistent_alpha[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
static unsigned char check_base_alpha[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0xea,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
static unsigned char check_alpha[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, 137, 151,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, 183, 172, 7,0x00,0x00,
|
||||
0x00,0x00, 12, 18,0x00,0x00, 3, 161, 233, 27,0x00,0x00,0x00,
|
||||
0x00,0x00, 199, 239, 101,0x00, 85, 253, 108,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00, 83, 245, 250, 75, 206, 230, 8,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 104, 252, 243, 253, 124,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 2, 162, 255, 241, 28,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00, 18, 228, 163,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00, 78, 62,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
static unsigned char check_inconsistent_alpha[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
|
||||
0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
|
||||
0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
|
@ -81,31 +81,31 @@ ge_color_from_hsb (gdouble hue,
|
|||
gdouble m1, m2, m3;
|
||||
|
||||
if (!color) return;
|
||||
|
||||
|
||||
if (brightness <= 0.5)
|
||||
m2 = brightness * (1 + saturation);
|
||||
else
|
||||
m2 = brightness + saturation - brightness * saturation;
|
||||
|
||||
|
||||
m1 = 2 * brightness - m2;
|
||||
|
||||
|
||||
hue_shift[0] = hue + 120;
|
||||
hue_shift[1] = hue;
|
||||
hue_shift[2] = hue - 120;
|
||||
|
||||
|
||||
color_shift[0] = color_shift[1] = color_shift[2] = brightness;
|
||||
|
||||
|
||||
i = (saturation == 0)?3:0;
|
||||
|
||||
|
||||
for (; i < 3; i++)
|
||||
{
|
||||
m3 = hue_shift[i];
|
||||
|
||||
|
||||
if (m3 > 360)
|
||||
m3 = MODULA(m3, 360);
|
||||
else if (m3 < 0)
|
||||
m3 = 360 - MODULA(ABS(m3), 360);
|
||||
|
||||
|
||||
if (m3 < 60)
|
||||
color_shift[i] = m1 + (m2 - m1) * m3 / 60;
|
||||
else if (m3 < 180)
|
||||
|
|
@ -114,8 +114,8 @@ ge_color_from_hsb (gdouble hue,
|
|||
color_shift[i] = m1 + (m2 - m1) * (240 - m3) / 60;
|
||||
else
|
||||
color_shift[i] = m1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
color->r = color_shift[0];
|
||||
color->g = color_shift[1];
|
||||
color->b = color_shift[2];
|
||||
|
|
@ -163,7 +163,7 @@ ge_gtk_style_to_cairo_color_cube (GtkStyle * style, CairoColorCube *cube)
|
|||
g_return_if_fail (style && cube);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
{
|
||||
ge_gdk_color_to_cairo (&style->bg[i], &cube->bg[i]);
|
||||
ge_gdk_color_to_cairo (&style->fg[i], &cube->fg[i]);
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ ge_gtk_style_to_cairo_color_cube (GtkStyle * style, CairoColorCube *cube)
|
|||
ge_gdk_color_to_cairo (&style->base[i], &cube->base[i]);
|
||||
ge_gdk_color_to_cairo (&style->text[i], &cube->text[i]);
|
||||
ge_gdk_color_to_cairo (&style->text_aa[i], &cube->text_aa[i]);
|
||||
}
|
||||
}
|
||||
|
||||
cube->black.r = cube->black.g = cube->black.b = 0;
|
||||
cube->black.a = 1;
|
||||
|
|
@ -189,17 +189,27 @@ ge_shade_color(const CairoColor *base, gdouble shade_ratio, CairoColor *composit
|
|||
gdouble hue = 0;
|
||||
gdouble saturation = 0;
|
||||
gdouble brightness = 0;
|
||||
|
||||
|
||||
g_return_if_fail (base && composite);
|
||||
|
||||
if (shade_ratio == 1.0)
|
||||
{
|
||||
composite->r = base->r;
|
||||
composite->g = base->g;
|
||||
composite->b = base->b;
|
||||
composite->a = base->a;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ge_hsb_from_color (base, &hue, &saturation, &brightness);
|
||||
|
||||
|
||||
brightness = MIN(brightness*shade_ratio, 1.0);
|
||||
brightness = MAX(brightness, 0.0);
|
||||
|
||||
|
||||
saturation = MIN(saturation*shade_ratio, 1.0);
|
||||
saturation = MAX(saturation, 0.0);
|
||||
|
||||
|
||||
ge_color_from_hsb (hue, saturation, brightness, composite);
|
||||
composite->a = base->a;
|
||||
}
|
||||
|
|
@ -210,7 +220,7 @@ ge_saturate_color (const CairoColor *base, gdouble saturate_level, CairoColor *c
|
|||
gdouble hue = 0;
|
||||
gdouble saturation = 0;
|
||||
gdouble brightness = 0;
|
||||
|
||||
|
||||
g_return_if_fail (base && composite);
|
||||
|
||||
ge_hsb_from_color (base, &hue, &saturation, &brightness);
|
||||
|
|
@ -223,7 +233,7 @@ ge_saturate_color (const CairoColor *base, gdouble saturate_level, CairoColor *c
|
|||
}
|
||||
|
||||
void
|
||||
ge_mix_color (const CairoColor *color1, const CairoColor *color2,
|
||||
ge_mix_color (const CairoColor *color1, const CairoColor *color2,
|
||||
gdouble mix_factor, CairoColor *composite)
|
||||
{
|
||||
g_return_if_fail (color1 && color2 && composite);
|
||||
|
|
@ -246,7 +256,7 @@ ge_gdk_drawable_to_cairo (GdkDrawable *window, GdkRectangle *area)
|
|||
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
|
||||
cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
|
||||
|
||||
if (area)
|
||||
if (area)
|
||||
{
|
||||
cairo_rectangle (cr, area->x, area->y, area->width, area->height);
|
||||
cairo_clip_preserve (cr);
|
||||
|
|
@ -277,8 +287,8 @@ ge_cairo_set_gdk_color_with_alpha (cairo_t *cr, const GdkColor *color, gdouble a
|
|||
|
||||
void
|
||||
ge_cairo_pattern_add_color_stop_color (cairo_pattern_t *pattern,
|
||||
gfloat offset,
|
||||
const CairoColor *color)
|
||||
gfloat offset,
|
||||
const CairoColor *color)
|
||||
{
|
||||
g_return_if_fail (pattern && color);
|
||||
|
||||
|
|
@ -286,10 +296,10 @@ ge_cairo_pattern_add_color_stop_color (cairo_pattern_t *pattern,
|
|||
}
|
||||
|
||||
void
|
||||
ge_cairo_pattern_add_color_stop_shade(cairo_pattern_t *pattern,
|
||||
gdouble offset,
|
||||
const CairoColor *color,
|
||||
gdouble shade)
|
||||
ge_cairo_pattern_add_color_stop_shade (cairo_pattern_t *pattern,
|
||||
gdouble offset,
|
||||
const CairoColor *color,
|
||||
gdouble shade)
|
||||
{
|
||||
CairoColor shaded;
|
||||
|
||||
|
|
@ -302,12 +312,14 @@ ge_cairo_pattern_add_color_stop_shade(cairo_pattern_t *pattern,
|
|||
ge_shade_color(color, shade, &shaded);
|
||||
}
|
||||
|
||||
ge_cairo_pattern_add_color_stop_color(pattern, offset, &shaded);
|
||||
ge_cairo_pattern_add_color_stop_color(pattern, offset, &shaded);
|
||||
}
|
||||
|
||||
/* This function will draw a rounded corner at position x,y. If the radius
|
||||
/*
|
||||
* This function will draw a rounded corner at position x,y. If the radius
|
||||
* is very small (or negative) it will instead just do a line_to.
|
||||
* ge_cairo_rounded_corner assumes clockwise drawing. */
|
||||
* ge_cairo_rounded_corner assumes clockwise drawing.
|
||||
*/
|
||||
void
|
||||
ge_cairo_rounded_corner (cairo_t *cr,
|
||||
double x,
|
||||
|
|
@ -321,28 +333,29 @@ ge_cairo_rounded_corner (cairo_t *cr,
|
|||
}
|
||||
else
|
||||
{
|
||||
switch (corner) {
|
||||
case CR_CORNER_NONE:
|
||||
cairo_line_to (cr, x, y);
|
||||
break;
|
||||
case CR_CORNER_TOPLEFT:
|
||||
cairo_arc (cr, x + radius, y + radius, radius, G_PI, G_PI * 3/2);
|
||||
break;
|
||||
case CR_CORNER_TOPRIGHT:
|
||||
cairo_arc (cr, x - radius, y + radius, radius, G_PI * 3/2, G_PI * 2);
|
||||
break;
|
||||
case CR_CORNER_BOTTOMRIGHT:
|
||||
cairo_arc (cr, x - radius, y - radius, radius, 0, G_PI * 1/2);
|
||||
break;
|
||||
case CR_CORNER_BOTTOMLEFT:
|
||||
cairo_arc (cr, x + radius, y - radius, radius, G_PI * 1/2, G_PI);
|
||||
break;
|
||||
switch (corner)
|
||||
{
|
||||
case CR_CORNER_NONE:
|
||||
cairo_line_to (cr, x, y);
|
||||
break;
|
||||
case CR_CORNER_TOPLEFT:
|
||||
cairo_arc (cr, x + radius, y + radius, radius, G_PI, G_PI * 3/2);
|
||||
break;
|
||||
case CR_CORNER_TOPRIGHT:
|
||||
cairo_arc (cr, x - radius, y + radius, radius, G_PI * 3/2, G_PI * 2);
|
||||
break;
|
||||
case CR_CORNER_BOTTOMRIGHT:
|
||||
cairo_arc (cr, x - radius, y - radius, radius, 0, G_PI * 1/2);
|
||||
break;
|
||||
case CR_CORNER_BOTTOMLEFT:
|
||||
cairo_arc (cr, x + radius, y - radius, radius, G_PI * 1/2, G_PI);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* A bitfield and not a sane value ... */
|
||||
g_assert_not_reached ();
|
||||
cairo_line_to (cr, x, y);
|
||||
return;
|
||||
default:
|
||||
/* A bitfield and not a sane value ... */
|
||||
g_assert_not_reached ();
|
||||
cairo_line_to (cr, x, y);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -395,9 +408,9 @@ ge_cairo_rounded_rectangle (cairo_t *cr,
|
|||
|
||||
/* ge_cairo_stroke_rectangle.
|
||||
*
|
||||
* A simple function to stroke the rectangle { x, y, w, h}.
|
||||
* (This function only exists because of a cairo performance bug that
|
||||
* has been fixed and it may be a good idea to get rid of it again.)
|
||||
* A simple function to stroke the rectangle { x, y, w, h}.
|
||||
* (This function only exists because of a cairo performance bug that
|
||||
* has been fixed and it may be a good idea to get rid of it again.)
|
||||
*/
|
||||
void
|
||||
ge_cairo_stroke_rectangle (cairo_t *cr, double x, double y, double w, double h)
|
||||
|
|
@ -406,19 +419,48 @@ ge_cairo_stroke_rectangle (cairo_t *cr, double x, double y, double w, double h)
|
|||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
void
|
||||
ge_cairo_inner_rectangle (cairo_t *cr,
|
||||
double x, double y,
|
||||
double width, double height)
|
||||
{
|
||||
double line_width = cairo_get_line_width (cr);
|
||||
|
||||
cairo_rectangle (cr, x + line_width / 2.0,
|
||||
y + line_width / 2.0,
|
||||
width - line_width,
|
||||
height - line_width);
|
||||
}
|
||||
|
||||
void
|
||||
ge_cairo_inner_rounded_rectangle (cairo_t *cr,
|
||||
double x, double y,
|
||||
double width, double height,
|
||||
double radius, CairoCorners corners)
|
||||
{
|
||||
double line_width = cairo_get_line_width (cr);
|
||||
|
||||
ge_cairo_rounded_rectangle (cr,
|
||||
x + line_width / 2.0,
|
||||
y + line_width / 2.0,
|
||||
width - line_width,
|
||||
height - line_width,
|
||||
radius, corners);
|
||||
}
|
||||
|
||||
/***********************************************
|
||||
* ge_cairo_simple_border -
|
||||
*
|
||||
* A simple routine to draw thin squared
|
||||
* borders with a topleft and bottomright color.
|
||||
*
|
||||
*
|
||||
* It originated in Smooth-Engine.
|
||||
***********************************************/
|
||||
void
|
||||
ge_cairo_simple_border (cairo_t *cr,
|
||||
const CairoColor * tl, const CairoColor * br,
|
||||
gint x, gint y, gint width, gint height,
|
||||
gboolean topleft_overlap)
|
||||
const CairoColor * tl, const CairoColor * br,
|
||||
gint x, gint y, gint width, gint height,
|
||||
gboolean topleft_overlap)
|
||||
{
|
||||
gboolean solid_color;
|
||||
|
||||
|
|
@ -445,7 +487,7 @@ ge_cairo_simple_border (cairo_t *cr,
|
|||
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
|
||||
ge_cairo_set_color(cr, tl);
|
||||
|
||||
cairo_move_to(cr, x + 0.5, y + height - 0.5);
|
||||
|
|
@ -471,9 +513,9 @@ ge_cairo_simple_border (cairo_t *cr,
|
|||
}
|
||||
|
||||
void ge_cairo_polygon (cairo_t *cr,
|
||||
const CairoColor *color,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
const CairoColor *color,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
|
|
@ -503,12 +545,12 @@ void ge_cairo_polygon (cairo_t *cr,
|
|||
}
|
||||
|
||||
void ge_cairo_line (cairo_t *cr,
|
||||
const CairoColor *color,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2)
|
||||
{
|
||||
const CairoColor *color,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2)
|
||||
{
|
||||
cairo_save(cr);
|
||||
|
||||
ge_cairo_set_color(cr, color);
|
||||
|
|
@ -584,18 +626,19 @@ ge_cairo_exchange_axis (cairo_t *cr,
|
|||
***********************************************/
|
||||
void
|
||||
ge_cairo_pattern_fill(cairo_t *canvas,
|
||||
CairoPattern *pattern,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
CairoPattern *pattern,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
cairo_matrix_t original_matrix, current_matrix;
|
||||
|
||||
if (pattern->operator == CAIRO_OPERATOR_DEST)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
cairo_pattern_get_matrix(pattern->handle, &original_matrix);
|
||||
current_matrix = original_matrix;
|
||||
|
|
@ -641,7 +684,7 @@ ge_cairo_pattern_fill(cairo_t *canvas,
|
|||
cairo_save(canvas);
|
||||
|
||||
cairo_set_source(canvas, pattern->handle);
|
||||
cairo_set_operator(canvas, pattern->operator);
|
||||
cairo_set_operator(canvas, pattern->operator);
|
||||
cairo_rectangle(canvas, x, y, width, height);
|
||||
|
||||
cairo_fill (canvas);
|
||||
|
|
@ -658,7 +701,7 @@ ge_cairo_pattern_fill(cairo_t *canvas,
|
|||
***********************************************/
|
||||
CairoPattern*
|
||||
ge_cairo_color_pattern(CairoColor *base)
|
||||
{
|
||||
{
|
||||
CairoPattern * result = g_new0(CairoPattern, 1);
|
||||
|
||||
#if ((CAIRO_VERSION_MAJOR < 1) || ((CAIRO_VERSION_MAJOR == 1) && (CAIRO_VERSION_MINOR < 2)))
|
||||
|
|
@ -668,10 +711,10 @@ ge_cairo_color_pattern(CairoColor *base)
|
|||
result->scale = GE_DIRECTION_NONE;
|
||||
result->translate = GE_DIRECTION_NONE;
|
||||
|
||||
result->handle = cairo_pattern_create_rgba(base->r,
|
||||
base->g,
|
||||
base->b,
|
||||
base->a);
|
||||
result->handle = cairo_pattern_create_rgba(base->r,
|
||||
base->g,
|
||||
base->b,
|
||||
base->a);
|
||||
|
||||
result->operator = CAIRO_OPERATOR_SOURCE;
|
||||
|
||||
|
|
@ -685,14 +728,14 @@ ge_cairo_color_pattern(CairoColor *base)
|
|||
***********************************************/
|
||||
CairoPattern*
|
||||
ge_cairo_pixbuf_pattern(GdkPixbuf *pixbuf)
|
||||
{
|
||||
{
|
||||
CairoPattern * result = g_new0(CairoPattern, 1);
|
||||
|
||||
cairo_t *canvas;
|
||||
cairo_surface_t * surface;
|
||||
gint width, height;
|
||||
|
||||
#if ((CAIRO_VERSION_MAJOR < 1) || ((CAIRO_VERSION_MAJOR == 1) && (CAIRO_VERSION_MINOR < 2)))
|
||||
#if ((CAIRO_VERSION_MAJOR < 1) || ((CAIRO_VERSION_MAJOR == 1) && (CAIRO_VERSION_MINOR < 2)))
|
||||
result->type = CAIRO_PATTERN_TYPE_SURFACE;
|
||||
#endif
|
||||
|
||||
|
|
@ -737,8 +780,8 @@ ge_cairo_pixmap_pattern(GdkPixmap *pixmap)
|
|||
gdk_drawable_get_size (GDK_DRAWABLE (pixmap), &width, &height);
|
||||
|
||||
pixbuf = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE (pixmap),
|
||||
gdk_drawable_get_colormap(GDK_DRAWABLE (pixmap)),
|
||||
0, 0, 0, 0, width, height);
|
||||
gdk_drawable_get_colormap(GDK_DRAWABLE (pixmap)),
|
||||
0, 0, 0, 0, width, height);
|
||||
|
||||
result = ge_cairo_pixbuf_pattern(pixbuf);
|
||||
|
||||
|
|
@ -757,9 +800,9 @@ ge_cairo_pixmap_pattern(GdkPixmap *pixmap)
|
|||
***********************************************/
|
||||
CairoPattern *
|
||||
ge_cairo_linear_shade_gradient_pattern(CairoColor *base,
|
||||
gdouble shade1,
|
||||
gdouble shade2,
|
||||
gboolean vertical)
|
||||
gdouble shade1,
|
||||
gdouble shade2,
|
||||
gboolean vertical)
|
||||
{
|
||||
CairoPattern * result = g_new0(CairoPattern, 1);
|
||||
|
||||
|
|
@ -796,12 +839,13 @@ ge_cairo_pattern_destroy(CairoPattern *pattern)
|
|||
{
|
||||
if (pattern->handle)
|
||||
cairo_pattern_destroy(pattern->handle);
|
||||
|
||||
|
||||
g_free(pattern);
|
||||
}
|
||||
}
|
||||
|
||||
/* The following function will be called by GTK+ when the module
|
||||
/*
|
||||
* The following function will be called by GTK+ when the module
|
||||
* is loaded and checks to see if we are compatible with the
|
||||
* version of GTK+ that loads us.
|
||||
*/
|
||||
|
|
@ -809,7 +853,7 @@ GE_EXPORT const gchar* g_module_check_init (GModule *module);
|
|||
const gchar*
|
||||
g_module_check_init (GModule *module)
|
||||
{
|
||||
return gtk_check_version (GTK_MAJOR_VERSION,
|
||||
GTK_MINOR_VERSION,
|
||||
GTK_MICRO_VERSION - GTK_INTERFACE_AGE);
|
||||
return gtk_check_version (GTK_MAJOR_VERSION,
|
||||
GTK_MINOR_VERSION,
|
||||
GTK_MICRO_VERSION - GTK_INTERFACE_AGE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@ GE_INTERNAL void ge_cairo_rounded_corner (cairo_t *cr, double x, double y, doubl
|
|||
GE_INTERNAL void ge_cairo_rounded_rectangle (cairo_t *cr, double x, double y, double w, double h, double radius, CairoCorners corners);
|
||||
|
||||
GE_INTERNAL void ge_cairo_stroke_rectangle (cairo_t *cr, double x, double y, double w, double h);
|
||||
GE_INTERNAL void ge_cairo_inner_rectangle (cairo_t *cr, double x, double y, double width, double height);
|
||||
GE_INTERNAL void ge_cairo_inner_rounded_rectangle (cairo_t *cr, double x, double y, double width, double height, double radius, CairoCorners corners);
|
||||
GE_INTERNAL void ge_cairo_simple_border (cairo_t *cr, const CairoColor * tl, const CairoColor * br, gint x, gint y, gint width, gint height, gboolean topleft_overlap);
|
||||
|
||||
GE_INTERNAL void ge_cairo_line (cairo_t *cr, const CairoColor *color, gint x1, gint y1, gint x2, gint y2);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -9,9 +9,16 @@
|
|||
|
||||
#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_inverted (ClearlooksStyleFunctions *functions);
|
||||
GE_INTERNAL void clearlooks_register_style_classic (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants);
|
||||
GE_INTERNAL void clearlooks_register_style_glossy (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants);
|
||||
GE_INTERNAL void clearlooks_register_style_gummy (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants);
|
||||
GE_INTERNAL void clearlooks_register_style_inverted (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants);
|
||||
|
||||
/* 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 */
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@
|
|||
|
||||
static void
|
||||
clearlooks_draw_glossy_gradient (cairo_t *cr,
|
||||
double x, double y, int width, int height,
|
||||
const CairoColor *color,
|
||||
gboolean disabled, gboolean radius, CairoCorners corners)
|
||||
double x, double y, int width, int height,
|
||||
const CairoColor *color,
|
||||
gboolean disabled, gboolean radius, CairoCorners corners)
|
||||
{
|
||||
CairoColor a, b, c, d;
|
||||
cairo_pattern_t *pt;
|
||||
|
|
@ -49,10 +49,10 @@ clearlooks_draw_glossy_gradient (cairo_t *cr,
|
|||
ge_shade_color (color, disabled? 1.02 : 1.08, &d);
|
||||
|
||||
pt = cairo_pattern_create_linear (x, y, x, y+height);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 0.0, a.r, a.g, a.b);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 0.5, b.r, b.g, b.b);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 0.5, c.r, c.g, c.b);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 1.0, d.r, d.g, d.b);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 0.0, a.r, a.g, a.b);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 0.5, b.r, b.g, b.b);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 0.5, c.r, c.g, c.b);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 1.0, d.r, d.g, d.b);
|
||||
|
||||
cairo_set_source (cr, pt);
|
||||
ge_cairo_rounded_rectangle (cr, x, y, width, height, radius, corners);
|
||||
|
|
@ -73,60 +73,66 @@ clearlooks_set_mixed_color (cairo_t *cr,
|
|||
ge_cairo_set_color (cr, &composite);
|
||||
}
|
||||
|
||||
/* This draw_inset implementation only differes in the shades values from the
|
||||
* default one. */
|
||||
static void
|
||||
clearlooks_glossy_draw_inset (cairo_t *cr,
|
||||
const CairoColor *bg_color,
|
||||
double x, double y, double w, double h,
|
||||
double x, double y, double width, double height,
|
||||
double radius, uint8 corners)
|
||||
{
|
||||
CairoColor shadow;
|
||||
CairoColor highlight;
|
||||
double line_width;
|
||||
double min = MIN (width, height);
|
||||
|
||||
line_width = cairo_get_line_width (cr);
|
||||
|
||||
/* not really sure of shading ratios... we will think */
|
||||
ge_shade_color (bg_color, 0.93, &shadow);
|
||||
ge_shade_color (bg_color, 1.07, &highlight);
|
||||
|
||||
/* highlight */
|
||||
cairo_move_to (cr, x + w + (radius * -0.2928932188), y - (radius * -0.2928932188)); /* 0.2928932... 1-sqrt(2)/2 gives middle of curve */
|
||||
cairo_save (cr);
|
||||
|
||||
if (corners & CR_CORNER_TOPRIGHT)
|
||||
cairo_arc (cr, x + w - radius, y + radius, radius, G_PI * 1.75, G_PI * 2);
|
||||
else
|
||||
cairo_line_to (cr, x + w, y);
|
||||
cairo_move_to (cr, x, y + height);
|
||||
cairo_line_to (cr, x + min / 2.0, y + height - min / 2.0);
|
||||
cairo_line_to (cr, x + width - min / 2.0, y + min / 2.0);
|
||||
cairo_line_to (cr, x + width, y);
|
||||
cairo_line_to (cr, x, y);
|
||||
cairo_close_path (cr);
|
||||
|
||||
cairo_clip (cr);
|
||||
|
||||
if (corners & CR_CORNER_BOTTOMRIGHT)
|
||||
cairo_arc (cr, x + w - radius, y + h - radius, radius, 0, G_PI * 0.5);
|
||||
else
|
||||
cairo_line_to (cr, x + w, y + h);
|
||||
ge_cairo_rounded_rectangle (cr, x + line_width / 2.0, y + line_width / 2.0,
|
||||
width - line_width, height - line_width,
|
||||
radius, corners);
|
||||
|
||||
if (corners & CR_CORNER_BOTTOMLEFT)
|
||||
cairo_arc (cr, x + radius, y + h - radius, radius, G_PI * 0.5, G_PI * 0.75);
|
||||
else
|
||||
cairo_line_to (cr, x, y + h);
|
||||
ge_cairo_set_color (cr, &shadow);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_restore (cr);
|
||||
|
||||
/* shadow */
|
||||
cairo_save (cr);
|
||||
|
||||
cairo_move_to (cr, x, y + height);
|
||||
cairo_line_to (cr, x + min / 2.0, y + height - min / 2.0);
|
||||
cairo_line_to (cr, x + width - min / 2.0, y + min / 2.0);
|
||||
cairo_line_to (cr, x + width, y);
|
||||
cairo_line_to (cr, x + width, y + height);
|
||||
cairo_close_path (cr);
|
||||
|
||||
cairo_clip (cr);
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, x + line_width / 2.0, y + line_width / 2.0,
|
||||
width - line_width, height - line_width,
|
||||
radius, corners);
|
||||
|
||||
ge_cairo_set_color (cr, &highlight);
|
||||
cairo_stroke (cr);
|
||||
|
||||
/* shadow */
|
||||
cairo_move_to (cr, x + (radius * 0.2928932188), y + h + (radius * -0.2928932188));
|
||||
|
||||
if (corners & CR_CORNER_BOTTOMLEFT)
|
||||
cairo_arc (cr, x + radius, y + h - radius, radius, M_PI * 0.75, M_PI);
|
||||
else
|
||||
cairo_line_to (cr, x, y + h);
|
||||
|
||||
if (corners & CR_CORNER_TOPLEFT)
|
||||
cairo_arc (cr, x + radius, y + radius, radius, M_PI, M_PI * 1.5);
|
||||
else
|
||||
cairo_line_to (cr, x, y);
|
||||
|
||||
if (corners & CR_CORNER_TOPRIGHT)
|
||||
cairo_arc (cr, x + w - radius, y + radius, radius, M_PI * 1.5, M_PI * 1.75);
|
||||
else
|
||||
cairo_line_to (cr, x + w, y);
|
||||
|
||||
ge_cairo_set_color (cr, &shadow);
|
||||
cairo_stroke (cr);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -167,17 +173,17 @@ clearlooks_glossy_draw_light_inset (cairo_t *cr,
|
|||
cairo_move_to (cr, x + (radius * 0.2928932188), y + h + (radius * -0.2928932188));
|
||||
|
||||
if (corners & CR_CORNER_BOTTOMLEFT)
|
||||
cairo_arc (cr, x + radius, y + h - radius, radius, M_PI * 0.75, M_PI);
|
||||
cairo_arc (cr, x + radius, y + h - radius, radius, G_PI * 0.75, G_PI);
|
||||
else
|
||||
cairo_line_to (cr, x, y + h);
|
||||
|
||||
if (corners & CR_CORNER_TOPLEFT)
|
||||
cairo_arc (cr, x + radius, y + radius, radius, M_PI, M_PI * 1.5);
|
||||
cairo_arc (cr, x + radius, y + radius, radius, G_PI, G_PI * 1.5);
|
||||
else
|
||||
cairo_line_to (cr, x, y);
|
||||
|
||||
if (corners & CR_CORNER_TOPRIGHT)
|
||||
cairo_arc (cr, x + w - radius, y + radius, radius, M_PI * 1.5, M_PI * 1.75);
|
||||
cairo_arc (cr, x + w - radius, y + radius, radius, G_PI * 1.5, G_PI * 1.75);
|
||||
else
|
||||
cairo_line_to (cr, x + w, y);
|
||||
|
||||
|
|
@ -185,6 +191,7 @@ clearlooks_glossy_draw_light_inset (cairo_t *cr,
|
|||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
/* This function currently assumes that the input is translated by 0.5px! */
|
||||
static void
|
||||
clearlooks_glossy_draw_highlight_and_shade (cairo_t *cr,
|
||||
const CairoColor *bg_color,
|
||||
|
|
@ -241,9 +248,9 @@ clearlooks_glossy_draw_highlight_and_shade (cairo_t *cr,
|
|||
|
||||
static void
|
||||
clearlooks_glossy_draw_button (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *params,
|
||||
int x, int y, int width, int height)
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *params,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
double xoffset = 0, yoffset = 0;
|
||||
CairoColor fill = colors->bg[params->state_type];
|
||||
|
|
@ -257,7 +264,7 @@ clearlooks_glossy_draw_button (cairo_t *cr,
|
|||
cairo_translate (cr, x, y);
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
|
||||
/* Shadows and Glow */
|
||||
/* Shadows and shadow */
|
||||
if (params->xthickness == 3 || params->ythickness == 3)
|
||||
{
|
||||
if (params->xthickness == 3)
|
||||
|
|
@ -270,35 +277,32 @@ clearlooks_glossy_draw_button (cairo_t *cr,
|
|||
|
||||
if (params->xthickness == 3 || params->ythickness == 3)
|
||||
{
|
||||
cairo_translate (cr, 0.5, 0.5);
|
||||
|
||||
/* if (params->enable_glow && !params->active && !params->disabled) */
|
||||
if (params->prelight && params->enable_glow && !params->active)
|
||||
/* if (params->enable_shadow && !params->active && !params->disabled) */
|
||||
if (!params->active && (params->prelight || params->enable_shadow))
|
||||
{
|
||||
/* Glow becomes a shadow to have 3d prelight buttons :) */
|
||||
CairoColor glow;
|
||||
/* shadow becomes a shadow to have 3d prelight buttons :) */
|
||||
CairoColor shadow;
|
||||
|
||||
radius = MIN (params->radius, MIN ((width - 2.0 - 2*xoffset) / 2.0 - 1.0, (height - 2.0 - 2*yoffset) / 2.0 - 1.0));
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius+1, params->corners);
|
||||
ge_shade_color (¶ms->parentbg, 0.96, &glow);
|
||||
ge_cairo_set_color (cr, &glow);
|
||||
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius+1, params->corners);
|
||||
ge_shade_color (¶ms->parentbg, 0.96, &shadow);
|
||||
ge_cairo_set_color (cr, &shadow);
|
||||
cairo_stroke (cr);
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius+1, params->corners);
|
||||
ge_shade_color (¶ms->parentbg, 0.92, &glow);
|
||||
ge_cairo_set_color (cr, &glow);
|
||||
ge_cairo_rounded_rectangle (cr, 1.5, 1.5, width-2, height-2, radius+1, params->corners);
|
||||
ge_shade_color (¶ms->parentbg, 0.92, &shadow);
|
||||
ge_cairo_set_color (cr, &shadow);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
/* if (!(params->enable_glow && !params->active && !params->disabled)) */
|
||||
if (!(params->prelight && params->enable_glow && !params->active))
|
||||
else
|
||||
{
|
||||
if (!(params->disabled))
|
||||
params->style_functions->draw_inset (cr, ¶ms->parentbg, 0, 0, width-1, height-1, params->radius+1, params->corners);
|
||||
params->style_functions->draw_inset (cr, ¶ms->parentbg, 0, 0, width, height, params->radius+1, params->corners);
|
||||
else
|
||||
/*Draw a lighter inset */
|
||||
clearlooks_glossy_draw_light_inset (cr, ¶ms->parentbg, 0, 0, width-1, height-1, params->radius+1, params->corners);
|
||||
cairo_translate (cr, -0.5, -0.5);
|
||||
clearlooks_glossy_draw_light_inset (cr, ¶ms->parentbg, 0, 0, width, height, params->radius+1, params->corners);
|
||||
}
|
||||
}
|
||||
|
||||
clearlooks_draw_glossy_gradient (cr, xoffset+1, yoffset+1,
|
||||
|
|
@ -339,30 +343,30 @@ clearlooks_glossy_draw_button (cairo_t *cr,
|
|||
/* Default button highlight */
|
||||
if (params->is_default && !params->active && !params->disabled)
|
||||
{
|
||||
const CairoColor *glow = &colors->spot[0];
|
||||
const CairoColor *shadow = &colors->spot[0];
|
||||
double hh = (height-5)/2.0 + 1;
|
||||
|
||||
cairo_rectangle (cr, 3.5, 3.5, width-7, height-7);
|
||||
ge_cairo_set_color (cr, glow);
|
||||
ge_cairo_set_color (cr, shadow);
|
||||
cairo_stroke (cr);
|
||||
|
||||
glow = &colors->spot[0];
|
||||
shadow = &colors->spot[0];
|
||||
cairo_move_to (cr, 2.5, 2.5+hh); cairo_rel_line_to (cr, 0, -hh);
|
||||
cairo_rel_line_to (cr, width-5, 0); cairo_rel_line_to (cr, 0, hh);
|
||||
ge_cairo_set_color (cr, glow);
|
||||
ge_cairo_set_color (cr, shadow);
|
||||
cairo_stroke (cr);
|
||||
|
||||
hh--;
|
||||
|
||||
glow = &colors->spot[1];
|
||||
shadow = &colors->spot[1];
|
||||
cairo_move_to (cr, 2.5, 2.5+hh); cairo_rel_line_to (cr, 0, hh);
|
||||
cairo_rel_line_to (cr, width-5, 0); cairo_rel_line_to (cr, 0, -hh);
|
||||
ge_cairo_set_color (cr, glow);
|
||||
ge_cairo_set_color (cr, shadow);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
/* Border */
|
||||
if (params->is_default || (params->prelight && params->enable_glow))
|
||||
if (params->is_default || (params->prelight && params->enable_shadow))
|
||||
border_normal = colors->spot[2];
|
||||
/* ge_mix_color (&border_normal, &colors->spot[2], 0.5, &border_normal); */
|
||||
if (params->disabled)
|
||||
|
|
@ -391,12 +395,6 @@ clearlooks_glossy_draw_progressbar_trough (cairo_t *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_fill (cr);
|
||||
|
||||
/* Create trough box */
|
||||
ge_cairo_rounded_rectangle (cr, x+1, y+1, width-2, height-2, radius, params->corners);
|
||||
ge_cairo_set_color (cr, &colors->shade[2]);
|
||||
|
|
@ -604,20 +602,21 @@ clearlooks_glossy_scale_draw_gradient (cairo_t *cr,
|
|||
{
|
||||
cairo_pattern_t *pattern;
|
||||
|
||||
pattern = cairo_pattern_create_linear (0, 0, horizontal ? 0 : width, horizontal ? height : 0);
|
||||
pattern = cairo_pattern_create_linear (0.5, 0.5, horizontal ? 0.5 : width + 1, horizontal ? height + 1 : 0.5);
|
||||
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, y, width, height);
|
||||
cairo_set_source (cr, pattern);
|
||||
cairo_fill (cr);
|
||||
cairo_pattern_destroy (pattern);
|
||||
|
||||
clearlooks_set_mixed_color (cr, c3, c1, 0.3);
|
||||
ge_cairo_stroke_rectangle (cr, x, y, width, height);
|
||||
ge_cairo_inner_rectangle (cr, x, y, width, height);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
#define TROUGH_SIZE 6
|
||||
#define TROUGH_SIZE 7
|
||||
static void
|
||||
clearlooks_glossy_draw_scale_trough (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
|
|
@ -628,43 +627,44 @@ clearlooks_glossy_draw_scale_trough (cairo_t *cr,
|
|||
int trough_width, trough_height;
|
||||
double translate_x, translate_y;
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
if (slider->horizontal)
|
||||
{
|
||||
trough_width = width-3;
|
||||
trough_height = TROUGH_SIZE-2;
|
||||
trough_width = width;
|
||||
trough_height = TROUGH_SIZE;
|
||||
|
||||
translate_x = x + 0.5;
|
||||
translate_y = y + 0.5 + (height/2) - (TROUGH_SIZE/2);
|
||||
translate_x = x;
|
||||
translate_y = y + (height/2) - (TROUGH_SIZE/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
trough_width = TROUGH_SIZE-2;
|
||||
trough_height = height-3;
|
||||
trough_width = TROUGH_SIZE;
|
||||
trough_height = height;
|
||||
|
||||
translate_x = x + 0.5 + (width/2) - (TROUGH_SIZE/2);
|
||||
translate_y = y + 0.5;
|
||||
translate_x = x + (width/2) - (TROUGH_SIZE/2);
|
||||
translate_y = y;
|
||||
}
|
||||
|
||||
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);
|
||||
params->style_functions->draw_inset (cr, ¶ms->parentbg, 0, 0, trough_width, trough_height, 0, 0);
|
||||
|
||||
if (!slider->lower && !slider->fill_level)
|
||||
clearlooks_glossy_scale_draw_gradient (cr, &colors->shade[3], /* top */
|
||||
&colors->shade[2], /* bottom */
|
||||
&colors->shade[6], /* border */
|
||||
0, 0, trough_width, trough_height,
|
||||
1.0, 1.0, trough_width - 2, trough_height - 2,
|
||||
slider->horizontal);
|
||||
else
|
||||
clearlooks_glossy_scale_draw_gradient (cr, &colors->spot[1], /* top */
|
||||
&colors->spot[0], /* bottom */
|
||||
&colors->spot[2], /* border */
|
||||
0, 0, trough_width, trough_height,
|
||||
1.0, 1.0, trough_width - 2, trough_height - 2,
|
||||
slider->horizontal);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -685,6 +685,7 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
|
||||
double radius;
|
||||
double strip_size;
|
||||
double length;
|
||||
|
||||
radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
|
||||
|
||||
|
|
@ -703,6 +704,7 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
if (tab->gap_side == CL_GAP_TOP || tab->gap_side == CL_GAP_BOTTOM)
|
||||
{
|
||||
height += 3.0;
|
||||
length = height;
|
||||
strip_size = 2.0/height; /* 2 pixel high strip */
|
||||
|
||||
if (tab->gap_side == CL_GAP_TOP)
|
||||
|
|
@ -711,6 +713,7 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
else
|
||||
{
|
||||
width += 3.0;
|
||||
length = width;
|
||||
strip_size = 2.0/width;
|
||||
|
||||
if (tab->gap_side == CL_GAP_LEFT)
|
||||
|
|
@ -738,6 +741,8 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
shadow.shadow = CL_SHADOW_OUT;
|
||||
shadow.corners = params->corners;
|
||||
|
||||
/* This is the only usage of clearlooks_glossy_draw_highlight_and_shade,
|
||||
* the function assumes currently that the input is translated by 0.5 px. */
|
||||
clearlooks_glossy_draw_highlight_and_shade (cr, &colors->bg[0], &shadow,
|
||||
width,
|
||||
height, radius);
|
||||
|
|
@ -747,10 +752,23 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
{
|
||||
CairoColor shadow, hilight, f1, f2;
|
||||
|
||||
pattern = cairo_pattern_create_linear (tab->gap_side == CL_GAP_LEFT ? width-1 : 0,
|
||||
tab->gap_side == CL_GAP_TOP ? height-2 : 1,
|
||||
tab->gap_side == CL_GAP_RIGHT ? width : 0,
|
||||
tab->gap_side == CL_GAP_BOTTOM ? height : 0);
|
||||
switch (tab->gap_side)
|
||||
{
|
||||
case CL_GAP_TOP:
|
||||
pattern = cairo_pattern_create_linear (0, height-2, 0, 0);
|
||||
break;
|
||||
case CL_GAP_BOTTOM:
|
||||
pattern = cairo_pattern_create_linear (0, 1, 0, height);
|
||||
break;
|
||||
case CL_GAP_LEFT:
|
||||
pattern = cairo_pattern_create_linear (width-2, 0, 1, 0);
|
||||
break;
|
||||
case CL_GAP_RIGHT:
|
||||
pattern = cairo_pattern_create_linear (1, 0, width-2, 0);
|
||||
break;
|
||||
default:
|
||||
pattern = NULL;
|
||||
}
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
|
||||
|
||||
|
|
@ -760,8 +778,8 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
ge_shade_color (fill, 1.06, &f2);
|
||||
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 0.0, hilight.r, hilight.g, hilight.b);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 1.0/height, hilight.r, hilight.g, hilight.b);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 1.0/height, f1.r, f1.g, f1.b);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 1.0/length, hilight.r, hilight.g, hilight.b);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 1.0/length, f1.r, f1.g, f1.b);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 0.45, f2.r, f2.g, f2.b);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 0.45, fill->r, fill->g, fill->b);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 1.0, shadow.r, shadow.g, shadow.b);
|
||||
|
|
@ -772,10 +790,23 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
else
|
||||
{
|
||||
/* Draw shade */
|
||||
pattern = cairo_pattern_create_linear (tab->gap_side == CL_GAP_LEFT ? width-2 : 0,
|
||||
tab->gap_side == CL_GAP_TOP ? height-2 : 0,
|
||||
tab->gap_side == CL_GAP_RIGHT ? width : 0,
|
||||
tab->gap_side == CL_GAP_BOTTOM ? height : 0);
|
||||
switch (tab->gap_side)
|
||||
{
|
||||
case CL_GAP_TOP:
|
||||
pattern = cairo_pattern_create_linear (0, height-2, 0, 0);
|
||||
break;
|
||||
case CL_GAP_BOTTOM:
|
||||
pattern = cairo_pattern_create_linear (0, 0, 0, height);
|
||||
break;
|
||||
case CL_GAP_LEFT:
|
||||
pattern = cairo_pattern_create_linear (width-2, 0, 0, 0);
|
||||
break;
|
||||
case CL_GAP_RIGHT:
|
||||
pattern = cairo_pattern_create_linear (0, 0, width, 0);
|
||||
break;
|
||||
default:
|
||||
pattern = NULL;
|
||||
}
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
|
||||
|
||||
|
|
@ -796,10 +827,23 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
|
|||
}
|
||||
else
|
||||
{
|
||||
pattern = cairo_pattern_create_linear (tab->gap_side == CL_GAP_LEFT ? width-2 : 2,
|
||||
tab->gap_side == CL_GAP_TOP ? height-2 : 2,
|
||||
tab->gap_side == CL_GAP_RIGHT ? width : 2,
|
||||
tab->gap_side == CL_GAP_BOTTOM ? height : 2);
|
||||
switch (tab->gap_side)
|
||||
{
|
||||
case CL_GAP_TOP:
|
||||
pattern = cairo_pattern_create_linear (2, height-2, 2, 2);
|
||||
break;
|
||||
case CL_GAP_BOTTOM:
|
||||
pattern = cairo_pattern_create_linear (2, 2, 2, height);
|
||||
break;
|
||||
case CL_GAP_LEFT:
|
||||
pattern = cairo_pattern_create_linear (width-2, 2, 2, 2);
|
||||
break;
|
||||
case CL_GAP_RIGHT:
|
||||
pattern = cairo_pattern_create_linear (2, 2, width, 2);
|
||||
break;
|
||||
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, 0.8, border->r, border->g, border->b);
|
||||
|
|
@ -824,8 +868,6 @@ clearlooks_glossy_draw_slider (cairo_t *cr,
|
|||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_translate (cr, x, y);
|
||||
|
||||
cairo_translate (cr, -0.5, -0.5);
|
||||
|
||||
ge_shade_color (&colors->bg[params->state_type], 1.0, &fill);
|
||||
if (params->prelight)
|
||||
ge_shade_color (&fill, 1.1, &fill);
|
||||
|
|
@ -871,9 +913,8 @@ clearlooks_glossy_draw_slider_button (cairo_t *cr,
|
|||
if (!slider->horizontal)
|
||||
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
|
||||
|
||||
cairo_translate (cr, x+0.5, y+0.5);
|
||||
|
||||
params->style_functions->draw_shadow (cr, colors, radius, width-1, height-1);
|
||||
cairo_translate (cr, x, y);
|
||||
params->style_functions->draw_shadow (cr, colors, radius, width, height);
|
||||
params->style_functions->draw_slider (cr, colors, params, 1, 1, width-2, height-2);
|
||||
}
|
||||
|
||||
|
|
@ -930,16 +971,12 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
|
|||
cairo_fill (cr);
|
||||
cairo_pattern_destroy (pattern);
|
||||
|
||||
cairo_translate (cr, 0.5, 0.5);
|
||||
cairo_translate (cr, -0.5, -0.5);
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, corners);
|
||||
ge_cairo_inner_rounded_rectangle (cr, 0, 0, width, height, radius, corners);
|
||||
clearlooks_set_mixed_color (cr, border, &fill, 0.2);
|
||||
if (widget->prelight)
|
||||
ge_cairo_set_color (cr, &colors->spot[2]);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_translate (cr, 0.5, 0.5);
|
||||
shadow.shadow = CL_SHADOW_OUT;
|
||||
shadow.corners = corners;
|
||||
}
|
||||
|
|
@ -1054,7 +1091,7 @@ clearlooks_glossy_draw_list_view_header (cairo_t *cr,
|
|||
cairo_pattern_destroy (pattern);
|
||||
|
||||
/* Draw highlight */
|
||||
if (header->order == CL_ORDER_FIRST)
|
||||
if (header->order & CL_ORDER_FIRST)
|
||||
{
|
||||
cairo_move_to (cr, 0.5, height-1);
|
||||
cairo_line_to (cr, 0.5, 0.5);
|
||||
|
|
@ -1068,8 +1105,8 @@ clearlooks_glossy_draw_list_view_header (cairo_t *cr,
|
|||
cairo_stroke (cr);
|
||||
|
||||
/* Draw resize grip */
|
||||
if ((params->ltr && header->order != CL_ORDER_LAST) ||
|
||||
(!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
|
||||
if ((params->ltr && !(header->order & CL_ORDER_LAST)) ||
|
||||
(!params->ltr && !(header->order & CL_ORDER_FIRST)) || header->resizable)
|
||||
{
|
||||
SeparatorParameters separator;
|
||||
separator.horizontal = FALSE;
|
||||
|
|
@ -1237,6 +1274,13 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
|
|||
cairo_pattern_t *pt;
|
||||
gboolean inconsistent;
|
||||
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
|
||||
gdouble w, h, cx, cy, radius;
|
||||
|
||||
w = (gdouble) width;
|
||||
h = (gdouble) height;
|
||||
cx = width / 2.0;
|
||||
cy = height / 2.0;
|
||||
radius = MIN (width, height) / 2.0;
|
||||
|
||||
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
|
||||
draw_bullet |= inconsistent;
|
||||
|
|
@ -1258,7 +1302,7 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
|
|||
ge_shade_color (&widget->parentbg, 0.9, &shadow);
|
||||
ge_shade_color (&widget->parentbg, 1.1, &highlight);
|
||||
|
||||
pt = cairo_pattern_create_linear (0, 0, 13, 13);
|
||||
pt = cairo_pattern_create_linear (0, 0, radius * 2.0, radius * 2.0);
|
||||
cairo_pattern_add_color_stop_rgb (pt, 0.0, shadow.r, shadow.b, shadow.g);
|
||||
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);
|
||||
|
|
@ -1266,15 +1310,15 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
|
|||
|
||||
cairo_translate (cr, x, y);
|
||||
|
||||
cairo_set_line_width (cr, 2);
|
||||
cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
|
||||
cairo_set_line_width (cr, MAX (1.0, floor (radius/3)));
|
||||
cairo_arc (cr, ceil (cx), ceil (cy), floor (radius - 0.1), 0, G_PI*2);
|
||||
cairo_set_source (cr, pt);
|
||||
cairo_stroke (cr);
|
||||
cairo_pattern_destroy (pt);
|
||||
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_set_line_width (cr, MAX (1.0, floor (radius/6)));
|
||||
|
||||
cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
|
||||
cairo_arc (cr, ceil (cx), ceil (cy), MAX (1.0, ceil (radius) - 1.5), 0, G_PI*2);
|
||||
|
||||
if (!widget->disabled)
|
||||
{
|
||||
|
|
@ -1293,21 +1337,21 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
|
|||
if (inconsistent)
|
||||
{
|
||||
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
|
||||
cairo_set_line_width (cr, 4);
|
||||
cairo_set_line_width (cr, ceil (radius * 2 / 3));
|
||||
|
||||
cairo_move_to(cr, 5, 7);
|
||||
cairo_line_to(cr, 9, 7);
|
||||
cairo_move_to (cr, ceil (cx - radius/3.0), ceil (cy));
|
||||
cairo_line_to (cr, ceil (cx + radius/3.0), ceil (cy));
|
||||
|
||||
ge_cairo_set_color (cr, dot);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
|
||||
cairo_arc (cr, ceil (cx), ceil (cy), floor (radius/2.0), 0, G_PI*2);
|
||||
ge_cairo_set_color (cr, dot);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_arc (cr, 6, 6, 1, 0, G_PI*2);
|
||||
cairo_arc (cr, floor (cx - radius/10.0), floor (cy - radius/10.0), floor (radius/6.0), 0, G_PI*2);
|
||||
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
|
@ -1348,8 +1392,8 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr,
|
|||
|
||||
if (widget->xthickness > 2 && widget->ythickness > 2)
|
||||
{
|
||||
widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5,
|
||||
width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
|
||||
widget->style_functions->draw_inset (cr, &widget->parentbg, 0, 0,
|
||||
width, height, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
|
||||
|
||||
/* Draw the rectangle for the checkbox itself */
|
||||
ge_cairo_rounded_rectangle (cr, 1.5, 1.5,
|
||||
|
|
@ -1400,7 +1444,7 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr,
|
|||
}
|
||||
|
||||
void
|
||||
clearlooks_register_style_glossy (ClearlooksStyleFunctions *functions)
|
||||
clearlooks_register_style_glossy (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants)
|
||||
{
|
||||
functions->draw_inset = clearlooks_glossy_draw_inset;
|
||||
functions->draw_button = clearlooks_glossy_draw_button;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -29,29 +29,6 @@
|
|||
#include <cairo.h>
|
||||
|
||||
|
||||
static void
|
||||
clearlooks_draw_top_left_highlight (cairo_t *cr,
|
||||
const CairoColor *color,
|
||||
const WidgetParameters *params,
|
||||
int width, int height, gdouble radius)
|
||||
{
|
||||
CairoColor hilight;
|
||||
|
||||
double light_top = params->ythickness-1,
|
||||
light_bottom = height - params->ythickness - 1,
|
||||
light_left = params->xthickness-1,
|
||||
light_right = width - params->xthickness - 1;
|
||||
|
||||
ge_shade_color (color, 1.3, &hilight);
|
||||
cairo_move_to (cr, light_left, light_bottom - (int)radius/2);
|
||||
|
||||
ge_cairo_rounded_corner (cr, light_left, light_top, radius, params->corners & CR_CORNER_TOPLEFT);
|
||||
|
||||
cairo_line_to (cr, light_right - (int)radius/2, light_top);
|
||||
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.7);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
clearlooks_set_border_gradient (cairo_t *cr, const CairoColor *color, double hilight, int width, int height)
|
||||
{
|
||||
|
|
@ -101,9 +78,7 @@ clearlooks_inverted_draw_button (cairo_t *cr,
|
|||
|
||||
if (params->xthickness == 3 || params->ythickness == 3)
|
||||
{
|
||||
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);
|
||||
params->style_functions->draw_inset (cr, ¶ms->parentbg, 0, 0, width, height, radius+1, params->corners);
|
||||
}
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1,
|
||||
|
|
@ -185,15 +160,17 @@ clearlooks_inverted_draw_button (cairo_t *cr,
|
|||
/* Draw the "shadow" */
|
||||
if (!params->active)
|
||||
{
|
||||
cairo_translate (cr, 0.5, 0.5);
|
||||
/* Draw right shadow */
|
||||
cairo_move_to (cr, width-params->xthickness, params->ythickness - 1);
|
||||
cairo_line_to (cr, width-params->xthickness, height - params->ythickness - 1);
|
||||
cairo_move_to (cr, width-xoffset-1.5, yoffset + radius);
|
||||
cairo_line_to (cr, width-xoffset-1.5, height - yoffset - radius);
|
||||
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);
|
||||
params->style_functions->draw_top_left_highlight (cr, fill, params,
|
||||
xoffset+1, yoffset+1,
|
||||
width-2*(xoffset+1), height-2*(yoffset+1),
|
||||
radius, params->corners);
|
||||
}
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
|
@ -436,6 +413,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
|
|||
|
||||
double radius;
|
||||
double strip_size;
|
||||
double length;
|
||||
|
||||
radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
|
||||
|
||||
|
|
@ -454,6 +432,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
|
|||
if (tab->gap_side == CL_GAP_TOP || tab->gap_side == CL_GAP_BOTTOM)
|
||||
{
|
||||
height += 3.0;
|
||||
length = height;
|
||||
strip_size = 2.0/height; /* 2 pixel high strip */
|
||||
|
||||
if (tab->gap_side == CL_GAP_TOP)
|
||||
|
|
@ -462,6 +441,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
|
|||
else
|
||||
{
|
||||
width += 3.0;
|
||||
length = width;
|
||||
strip_size = 2.0/width;
|
||||
|
||||
if (tab->gap_side == CL_GAP_LEFT)
|
||||
|
|
@ -496,10 +476,23 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
|
|||
|
||||
if (params->active)
|
||||
{
|
||||
pattern = cairo_pattern_create_linear ( tab->gap_side == CL_GAP_LEFT ? width-1 : 0,
|
||||
tab->gap_side == CL_GAP_TOP ? height-2 : 1,
|
||||
tab->gap_side == CL_GAP_RIGHT ? width : 0,
|
||||
tab->gap_side == CL_GAP_BOTTOM ? height : 0 );
|
||||
switch (tab->gap_side)
|
||||
{
|
||||
case CL_GAP_TOP:
|
||||
pattern = cairo_pattern_create_linear (0, height-2, 0, 0);
|
||||
break;
|
||||
case CL_GAP_BOTTOM:
|
||||
pattern = cairo_pattern_create_linear (0, 1, 0, height);
|
||||
break;
|
||||
case CL_GAP_LEFT:
|
||||
pattern = cairo_pattern_create_linear (width-2, 0, 1, 0);
|
||||
break;
|
||||
case CL_GAP_RIGHT:
|
||||
pattern = cairo_pattern_create_linear (1, 0, width-2, 0);
|
||||
break;
|
||||
default:
|
||||
pattern = NULL;
|
||||
}
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
|
||||
|
||||
|
|
@ -516,10 +509,23 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
|
|||
else
|
||||
{
|
||||
/* Draw shade */
|
||||
pattern = cairo_pattern_create_linear ( tab->gap_side == CL_GAP_LEFT ? width-2 : 0,
|
||||
tab->gap_side == CL_GAP_TOP ? height-2 : 0,
|
||||
tab->gap_side == CL_GAP_RIGHT ? width : 0,
|
||||
tab->gap_side == CL_GAP_BOTTOM ? height : 0 );
|
||||
switch (tab->gap_side)
|
||||
{
|
||||
case CL_GAP_TOP:
|
||||
pattern = cairo_pattern_create_linear (0, height-2, 0, 0);
|
||||
break;
|
||||
case CL_GAP_BOTTOM:
|
||||
pattern = cairo_pattern_create_linear (0, 0, 0, height);
|
||||
break;
|
||||
case CL_GAP_LEFT:
|
||||
pattern = cairo_pattern_create_linear (width-2, 0, 0, 0);
|
||||
break;
|
||||
case CL_GAP_RIGHT:
|
||||
pattern = cairo_pattern_create_linear (0, 0, width, 0);
|
||||
break;
|
||||
default:
|
||||
pattern = NULL;
|
||||
}
|
||||
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
|
||||
|
||||
|
|
@ -542,10 +548,23 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
|
|||
}
|
||||
else
|
||||
{
|
||||
pattern = cairo_pattern_create_linear ( tab->gap_side == CL_GAP_LEFT ? width-2 : 2,
|
||||
tab->gap_side == CL_GAP_TOP ? height-2 : 2,
|
||||
tab->gap_side == CL_GAP_RIGHT ? width : 2,
|
||||
tab->gap_side == CL_GAP_BOTTOM ? height : 2 );
|
||||
switch (tab->gap_side)
|
||||
{
|
||||
case CL_GAP_TOP:
|
||||
pattern = cairo_pattern_create_linear (2, height-2, 2, 2);
|
||||
break;
|
||||
case CL_GAP_BOTTOM:
|
||||
pattern = cairo_pattern_create_linear (2, 2, 2, height);
|
||||
break;
|
||||
case CL_GAP_LEFT:
|
||||
pattern = cairo_pattern_create_linear (width-2, 2, 2, 2);
|
||||
break;
|
||||
case CL_GAP_RIGHT:
|
||||
pattern = cairo_pattern_create_linear (2, 2, width, 2);
|
||||
break;
|
||||
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);
|
||||
|
|
@ -581,7 +600,7 @@ clearlooks_inverted_draw_slider (cairo_t *cr,
|
|||
border = &colors->shade[6];
|
||||
|
||||
/* fill the widget */
|
||||
cairo_rectangle (cr, 0.5, 0.5, width-2, height-2);
|
||||
cairo_rectangle (cr, 1.0, 1.0, width-2, height-2);
|
||||
|
||||
/* Fake light */
|
||||
if (!params->disabled)
|
||||
|
|
@ -599,20 +618,20 @@ clearlooks_inverted_draw_slider (cairo_t *cr,
|
|||
else
|
||||
{
|
||||
ge_cairo_set_color (cr, fill);
|
||||
cairo_rectangle (cr, 0.5, 0.5, width-2, height-2);
|
||||
cairo_rectangle (cr, 1.0, 1.0, width-2, height-2);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
/* Set the clip */
|
||||
cairo_save (cr);
|
||||
cairo_rectangle (cr, 0.5, 0.5, 6, height-2);
|
||||
cairo_rectangle (cr, width-7.5, 0.5, 6 , height-2);
|
||||
cairo_rectangle (cr, 1.0, 1.0, 6, height-2);
|
||||
cairo_rectangle (cr, width-7.0, 1.0, 6, height-2);
|
||||
cairo_clip_preserve (cr);
|
||||
|
||||
cairo_new_path (cr);
|
||||
|
||||
/* Draw the handles */
|
||||
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, params->corners);
|
||||
ge_cairo_rounded_rectangle (cr, 1.0, 1.0, width-1, height-1, radius, params->corners);
|
||||
pattern = cairo_pattern_create_linear (0.5, 0.5, 0.5, 0.5+height);
|
||||
|
||||
if (params->prelight)
|
||||
|
|
@ -635,7 +654,7 @@ clearlooks_inverted_draw_slider (cairo_t *cr,
|
|||
cairo_restore (cr);
|
||||
|
||||
/* Draw the border */
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
|
||||
ge_cairo_inner_rounded_rectangle (cr, 0, 0, width, height, radius, params->corners);
|
||||
if (params->prelight || params->disabled)
|
||||
ge_cairo_set_color (cr, border);
|
||||
else
|
||||
|
|
@ -645,11 +664,11 @@ clearlooks_inverted_draw_slider (cairo_t *cr,
|
|||
/* Draw handle lines */
|
||||
if (width > 14)
|
||||
{
|
||||
cairo_move_to (cr, 6, 0.5);
|
||||
cairo_line_to (cr, 6, height-1);
|
||||
cairo_move_to (cr, 6.5, 1.0);
|
||||
cairo_line_to (cr, 6.5, height-1);
|
||||
|
||||
cairo_move_to (cr, width-7, 0.5);
|
||||
cairo_line_to (cr, width-7, height-1);
|
||||
cairo_move_to (cr, width-6.5, 1.0);
|
||||
cairo_line_to (cr, width-6.5, height-1);
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_set_source_rgba (cr, border->r,
|
||||
|
|
@ -660,27 +679,6 @@ clearlooks_inverted_draw_slider (cairo_t *cr,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clearlooks_inverted_draw_slider_button (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *params,
|
||||
const SliderParameters *slider,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
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);
|
||||
|
||||
params->style_functions->draw_shadow (cr, colors, radius, width-1, height-1);
|
||||
params->style_functions->draw_slider (cr, colors, params, 1, 1, width-2, height-2);
|
||||
|
||||
if (width > 24)
|
||||
params->style_functions->draw_gripdots (cr, colors, 0, 0, width-2, height-2, 3, 3, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
clearlooks_inverted_draw_list_view_header (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
|
|
@ -703,7 +701,7 @@ clearlooks_inverted_draw_list_view_header (cairo_t *cr,
|
|||
cairo_set_line_width (cr, 1.0);
|
||||
|
||||
/* Draw highlight */
|
||||
if (header->order == CL_ORDER_FIRST)
|
||||
if (header->order & CL_ORDER_FIRST)
|
||||
{
|
||||
cairo_move_to (cr, 0.5, height-1);
|
||||
cairo_line_to (cr, 0.5, 0.5);
|
||||
|
|
@ -733,8 +731,8 @@ clearlooks_inverted_draw_list_view_header (cairo_t *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)
|
||||
if ((params->ltr && !(header->order & CL_ORDER_LAST)) ||
|
||||
(!params->ltr && !(header->order & CL_ORDER_FIRST)) || header->resizable)
|
||||
{
|
||||
SeparatorParameters separator;
|
||||
separator.horizontal = FALSE;
|
||||
|
|
@ -761,7 +759,6 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
|
|||
CairoColor border;
|
||||
CairoColor s1, s2, s3;
|
||||
cairo_pattern_t *pattern;
|
||||
ShadowParameters shadow;
|
||||
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
|
||||
|
||||
ge_shade_color(&colors->shade[6], 1.05, &border);
|
||||
|
|
@ -801,19 +798,11 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
|
|||
cairo_fill (cr);
|
||||
cairo_pattern_destroy (pattern);
|
||||
|
||||
clearlooks_draw_top_left_highlight (cr, &s1, widget, width, height, radius);
|
||||
widget->style_functions->draw_top_left_highlight (cr, &s1, widget, 1, 1, width-2, height-2, radius, corners);
|
||||
|
||||
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));
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_translate (cr, 0.5, 0.5);
|
||||
shadow.shadow = CL_SHADOW_OUT;
|
||||
shadow.corners = corners;
|
||||
/*
|
||||
clearlooks_draw_highlight_and_shade (cr, &shadow,
|
||||
width,
|
||||
height, params->radius);*/
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -909,7 +898,7 @@ clearlooks_inverted_draw_scrollbar_slider (cairo_t *cr,
|
|||
cairo_fill(cr);
|
||||
cairo_pattern_destroy(pattern);
|
||||
|
||||
clearlooks_draw_top_left_highlight (cr, &s2, widget, width, height, 0);
|
||||
widget->style_functions->draw_top_left_highlight (cr, &s2, widget, 1, 1, width-2, height-2, 0, widget->corners);
|
||||
|
||||
clearlooks_set_border_gradient (cr, &border, 1.2, 0, height);
|
||||
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
|
||||
|
|
@ -985,11 +974,10 @@ clearlooks_inverted_draw_selected_cell (cairo_t *cr,
|
|||
}
|
||||
|
||||
void
|
||||
clearlooks_register_style_inverted (ClearlooksStyleFunctions *functions)
|
||||
clearlooks_register_style_inverted (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants)
|
||||
{
|
||||
functions->draw_button = clearlooks_inverted_draw_button;
|
||||
functions->draw_slider = clearlooks_inverted_draw_slider;
|
||||
functions->draw_slider_button = clearlooks_inverted_draw_slider_button;
|
||||
functions->draw_progressbar_fill = clearlooks_inverted_draw_progressbar_fill;
|
||||
functions->draw_menuitem = clearlooks_inverted_draw_menuitem;
|
||||
functions->draw_menubaritem = clearlooks_inverted_draw_menubaritem;
|
||||
|
|
@ -998,5 +986,8 @@ clearlooks_register_style_inverted (ClearlooksStyleFunctions *functions)
|
|||
functions->draw_scrollbar_stepper = clearlooks_inverted_draw_scrollbar_stepper;
|
||||
functions->draw_scrollbar_slider = clearlooks_inverted_draw_scrollbar_slider;
|
||||
functions->draw_selected_cell = clearlooks_inverted_draw_selected_cell;
|
||||
|
||||
constants->topleft_highlight_shade = 1.3;
|
||||
constants->topleft_highlight_alpha = 0.7;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
/* Clearlooks theme engine
|
||||
* Copyright (C) 2005 Richard Stellingwerff.
|
||||
* Copyright (C) 2005 Richard Stellingwerff
|
||||
* Copyright (C) 2007 Benjamin Berg
|
||||
* Copyright (C) 2007 Andrea Cimitan
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
|
@ -22,35 +24,32 @@
|
|||
* Modified by Kulyk Nazar <schamane@myeburg.net>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <widget-information.h>
|
||||
#include "clearlooks_style.h"
|
||||
#include "clearlooks_rc_style.h"
|
||||
|
||||
#include "animation.h"
|
||||
|
||||
static void clearlooks_rc_style_init (ClearlooksRcStyle *style);
|
||||
#ifdef HAVE_ANIMATION
|
||||
static void clearlooks_rc_style_finalize (GObject *object);
|
||||
#endif
|
||||
static void clearlooks_rc_style_class_init (ClearlooksRcStyleClass *klass);
|
||||
static GtkStyle *clearlooks_rc_style_create_style (GtkRcStyle *rc_style);
|
||||
static guint clearlooks_rc_style_parse (GtkRcStyle *rc_style,
|
||||
GtkSettings *settings,
|
||||
GScanner *scanner);
|
||||
GtkSettings *settings,
|
||||
GScanner *scanner);
|
||||
static void clearlooks_rc_style_merge (GtkRcStyle *dest,
|
||||
GtkRcStyle *src);
|
||||
|
||||
|
||||
static GtkRcStyleClass *clearlooks_parent_rc_class;
|
||||
|
||||
GType clearlooks_type_rc_style = 0;
|
||||
GtkRcStyle *src);
|
||||
|
||||
enum
|
||||
{
|
||||
TOKEN_SCROLLBARCOLOR = G_TOKEN_LAST + 1,
|
||||
TOKEN_FOCUSCOLOR = G_TOKEN_LAST + 1,
|
||||
TOKEN_SCROLLBARCOLOR,
|
||||
TOKEN_COLORIZESCROLLBAR,
|
||||
TOKEN_CONTRAST,
|
||||
TOKEN_SUNKENMENU,
|
||||
TOKEN_PROGRESSBARSTYLE,
|
||||
TOKEN_RELIEFSTYLE,
|
||||
TOKEN_MENUBARSTYLE,
|
||||
TOKEN_TOOLBARSTYLE,
|
||||
TOKEN_MENUITEMSTYLE,
|
||||
|
|
@ -58,6 +57,7 @@ enum
|
|||
TOKEN_ANIMATION,
|
||||
TOKEN_STYLE,
|
||||
TOKEN_RADIUS,
|
||||
TOKEN_HINT,
|
||||
|
||||
TOKEN_CLASSIC,
|
||||
TOKEN_GLOSSY,
|
||||
|
|
@ -65,60 +65,42 @@ enum
|
|||
TOKEN_GUMMY,
|
||||
|
||||
TOKEN_TRUE,
|
||||
TOKEN_FALSE
|
||||
TOKEN_FALSE,
|
||||
|
||||
TOKEN_LAST
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
const gchar *name;
|
||||
guint token;
|
||||
}
|
||||
clearlooks_gtk2_rc_symbols[] =
|
||||
{
|
||||
{ "scrollbar_color", TOKEN_SCROLLBARCOLOR },
|
||||
{ "colorize_scrollbar", TOKEN_COLORIZESCROLLBAR },
|
||||
{ "contrast", TOKEN_CONTRAST },
|
||||
{ "sunkenmenubar", TOKEN_SUNKENMENU },
|
||||
{ "progressbarstyle", TOKEN_PROGRESSBARSTYLE },
|
||||
{ "menubarstyle", TOKEN_MENUBARSTYLE },
|
||||
{ "toolbarstyle", TOKEN_TOOLBARSTYLE },
|
||||
{ "menuitemstyle", TOKEN_MENUITEMSTYLE },
|
||||
{ "listviewitemstyle", TOKEN_LISTVIEWITEMSTYLE },
|
||||
{ "animation", TOKEN_ANIMATION },
|
||||
{ "style", TOKEN_STYLE },
|
||||
{ "radius", TOKEN_RADIUS },
|
||||
static gchar* clearlooks_rc_symbols =
|
||||
"focus_color\0"
|
||||
"scrollbar_color\0"
|
||||
"colorize_scrollbar\0"
|
||||
"contrast\0"
|
||||
"sunkenmenubar\0"
|
||||
"progressbarstyle\0"
|
||||
"reliefstyle\0"
|
||||
"menubarstyle\0"
|
||||
"toolbarstyle\0"
|
||||
"menuitemstyle\0"
|
||||
"listviewitemstyle\0"
|
||||
"animation\0"
|
||||
"style\0"
|
||||
"radius\0"
|
||||
"hint\0"
|
||||
|
||||
{ "CLASSIC", TOKEN_CLASSIC },
|
||||
{ "GLOSSY", TOKEN_GLOSSY },
|
||||
{ "INVERTED", TOKEN_INVERTED },
|
||||
{ "GUMMY", TOKEN_GUMMY },
|
||||
"CLASSIC\0"
|
||||
"GLOSSY\0"
|
||||
"INVERTED\0"
|
||||
"GUMMY\0"
|
||||
|
||||
{ "TRUE", TOKEN_TRUE },
|
||||
{ "FALSE", TOKEN_FALSE }
|
||||
};
|
||||
"TRUE\0"
|
||||
"FALSE\0";
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE (ClearlooksRcStyle, clearlooks_rc_style, GTK_TYPE_RC_STYLE)
|
||||
|
||||
void
|
||||
clearlooks_rc_style_register_type (GTypeModule *module)
|
||||
clearlooks_rc_style_register_types (GTypeModule *module)
|
||||
{
|
||||
static const GTypeInfo object_info =
|
||||
{
|
||||
sizeof (ClearlooksRcStyleClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) clearlooks_rc_style_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (ClearlooksRcStyle),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) clearlooks_rc_style_init,
|
||||
NULL
|
||||
};
|
||||
|
||||
clearlooks_type_rc_style = g_type_module_register_type (module,
|
||||
GTK_TYPE_RC_STYLE,
|
||||
"ClearlooksRcStyle",
|
||||
&object_info, 0);
|
||||
clearlooks_rc_style_register_type (module);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -129,11 +111,13 @@ clearlooks_rc_style_init (ClearlooksRcStyle *clearlooks_rc)
|
|||
clearlooks_rc->flags = 0;
|
||||
|
||||
clearlooks_rc->contrast = 1.0;
|
||||
clearlooks_rc->reliefstyle = 0;
|
||||
clearlooks_rc->menubarstyle = 0;
|
||||
clearlooks_rc->toolbarstyle = 0;
|
||||
clearlooks_rc->animation = FALSE;
|
||||
clearlooks_rc->colorize_scrollbar = FALSE;
|
||||
clearlooks_rc->radius = 3.0;
|
||||
clearlooks_rc->hint = 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ANIMATION
|
||||
|
|
@ -143,8 +127,8 @@ clearlooks_rc_style_finalize (GObject *object)
|
|||
/* cleanup all the animation stuff */
|
||||
clearlooks_animation_cleanup ();
|
||||
|
||||
if (G_OBJECT_CLASS (clearlooks_parent_rc_class)->finalize != NULL)
|
||||
G_OBJECT_CLASS (clearlooks_parent_rc_class)->finalize(object);
|
||||
if (G_OBJECT_CLASS (clearlooks_rc_style_parent_class)->finalize != NULL)
|
||||
G_OBJECT_CLASS (clearlooks_rc_style_parent_class)->finalize (object);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -157,8 +141,6 @@ clearlooks_rc_style_class_init (ClearlooksRcStyleClass *klass)
|
|||
GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
|
||||
#endif
|
||||
|
||||
clearlooks_parent_rc_class = g_type_class_peek_parent (klass);
|
||||
|
||||
rc_style_class->parse = clearlooks_rc_style_parse;
|
||||
rc_style_class->create_style = clearlooks_rc_style_create_style;
|
||||
rc_style_class->merge = clearlooks_rc_style_merge;
|
||||
|
|
@ -168,10 +150,15 @@ clearlooks_rc_style_class_init (ClearlooksRcStyleClass *klass)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
clearlooks_rc_style_class_finalize (ClearlooksRcStyleClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
static guint
|
||||
clearlooks_gtk2_rc_parse_boolean (GtkSettings *settings,
|
||||
GScanner *scanner,
|
||||
gboolean *retval)
|
||||
GScanner *scanner,
|
||||
gboolean *retval)
|
||||
{
|
||||
guint token;
|
||||
token = g_scanner_get_next_token(scanner);
|
||||
|
|
@ -193,8 +180,9 @@ clearlooks_gtk2_rc_parse_boolean (GtkSettings *settings,
|
|||
|
||||
static guint
|
||||
clearlooks_gtk2_rc_parse_color(GtkSettings *settings,
|
||||
GScanner *scanner,
|
||||
GdkColor *color)
|
||||
GScanner *scanner,
|
||||
GtkRcStyle *style,
|
||||
GdkColor *color)
|
||||
{
|
||||
guint token;
|
||||
|
||||
|
|
@ -205,7 +193,7 @@ clearlooks_gtk2_rc_parse_color(GtkSettings *settings,
|
|||
if (token != G_TOKEN_EQUAL_SIGN)
|
||||
return G_TOKEN_EQUAL_SIGN;
|
||||
|
||||
return gtk_rc_parse_color (scanner, color);
|
||||
return gtk_rc_parse_color_full (scanner, style, color);
|
||||
}
|
||||
|
||||
static guint
|
||||
|
|
@ -233,12 +221,12 @@ clearlooks_gtk2_rc_parse_double (GtkSettings *settings,
|
|||
|
||||
static guint
|
||||
clearlooks_gtk2_rc_parse_int (GtkSettings *settings,
|
||||
GScanner *scanner,
|
||||
guint8 *progressbarstyle)
|
||||
GScanner *scanner,
|
||||
guint8 *progressbarstyle)
|
||||
{
|
||||
guint token;
|
||||
|
||||
/* Skip 'sunkenmenubar' */
|
||||
/* Skip option name */
|
||||
token = g_scanner_get_next_token(scanner);
|
||||
|
||||
token = g_scanner_get_next_token(scanner);
|
||||
|
|
@ -271,7 +259,7 @@ clearlooks_gtk2_rc_parse_style (GtkSettings *settings,
|
|||
return G_TOKEN_EQUAL_SIGN;
|
||||
|
||||
token = g_scanner_get_next_token (scanner);
|
||||
|
||||
|
||||
switch (token)
|
||||
{
|
||||
case TOKEN_CLASSIC:
|
||||
|
|
@ -319,16 +307,14 @@ clearlooks_gtk2_rc_parse_dummy (GtkSettings *settings,
|
|||
|
||||
static guint
|
||||
clearlooks_rc_style_parse (GtkRcStyle *rc_style,
|
||||
GtkSettings *settings,
|
||||
GScanner *scanner)
|
||||
|
||||
GtkSettings *settings,
|
||||
GScanner *scanner)
|
||||
{
|
||||
static GQuark scope_id = 0;
|
||||
ClearlooksRcStyle *clearlooks_style = CLEARLOOKS_RC_STYLE (rc_style);
|
||||
|
||||
guint old_scope;
|
||||
guint token;
|
||||
guint i;
|
||||
|
||||
/* Set up a new scope in this scanner. */
|
||||
|
||||
|
|
@ -344,13 +330,18 @@ clearlooks_rc_style_parse (GtkRcStyle *rc_style,
|
|||
* (in some previous call to clearlooks_rc_style_parse for the
|
||||
* same scanner.
|
||||
*/
|
||||
if (!g_scanner_lookup_symbol(scanner, clearlooks_rc_symbols)) {
|
||||
gchar *current_symbol = clearlooks_rc_symbols;
|
||||
gint i = G_TOKEN_LAST + 1;
|
||||
|
||||
if (!g_scanner_lookup_symbol(scanner, clearlooks_gtk2_rc_symbols[0].name))
|
||||
{
|
||||
for (i = 0; i < G_N_ELEMENTS (clearlooks_gtk2_rc_symbols); i++)
|
||||
g_scanner_scope_add_symbol(scanner, scope_id,
|
||||
clearlooks_gtk2_rc_symbols[i].name,
|
||||
GINT_TO_POINTER(clearlooks_gtk2_rc_symbols[i].token));
|
||||
/* Add our symbols */
|
||||
while ((current_symbol[0] != '\0') && (i < TOKEN_LAST)) {
|
||||
g_scanner_scope_add_symbol(scanner, scope_id, current_symbol, GINT_TO_POINTER (i));
|
||||
|
||||
current_symbol += strlen(current_symbol) + 1;
|
||||
i++;
|
||||
}
|
||||
g_assert (i == TOKEN_LAST && current_symbol[0] == '\0');
|
||||
}
|
||||
|
||||
/* We're ready to go, now parse the top level */
|
||||
|
|
@ -360,8 +351,12 @@ clearlooks_rc_style_parse (GtkRcStyle *rc_style,
|
|||
{
|
||||
switch (token)
|
||||
{
|
||||
case TOKEN_FOCUSCOLOR:
|
||||
token = clearlooks_gtk2_rc_parse_color (settings, scanner, rc_style, &clearlooks_style->focus_color);
|
||||
clearlooks_style->flags |= CL_FLAG_FOCUS_COLOR;
|
||||
break;
|
||||
case TOKEN_SCROLLBARCOLOR:
|
||||
token = clearlooks_gtk2_rc_parse_color (settings, scanner, &clearlooks_style->scrollbar_color);
|
||||
token = clearlooks_gtk2_rc_parse_color (settings, scanner, rc_style, &clearlooks_style->scrollbar_color);
|
||||
clearlooks_style->flags |= CL_FLAG_SCROLLBAR_COLOR;
|
||||
break;
|
||||
case TOKEN_COLORIZESCROLLBAR:
|
||||
|
|
@ -372,6 +367,10 @@ clearlooks_rc_style_parse (GtkRcStyle *rc_style,
|
|||
token = clearlooks_gtk2_rc_parse_double (settings, scanner, &clearlooks_style->contrast);
|
||||
clearlooks_style->flags |= CL_FLAG_CONTRAST;
|
||||
break;
|
||||
case TOKEN_RELIEFSTYLE:
|
||||
token = clearlooks_gtk2_rc_parse_int (settings, scanner, &clearlooks_style->reliefstyle);
|
||||
clearlooks_style->flags |= CL_FLAG_RELIEFSTYLE;
|
||||
break;
|
||||
case TOKEN_MENUBARSTYLE:
|
||||
token = clearlooks_gtk2_rc_parse_int (settings, scanner, &clearlooks_style->menubarstyle);
|
||||
clearlooks_style->flags |= CL_FLAG_MENUBARSTYLE;
|
||||
|
|
@ -392,6 +391,10 @@ clearlooks_rc_style_parse (GtkRcStyle *rc_style,
|
|||
token = clearlooks_gtk2_rc_parse_double (settings, scanner, &clearlooks_style->radius);
|
||||
clearlooks_style->flags |= CL_FLAG_RADIUS;
|
||||
break;
|
||||
case TOKEN_HINT:
|
||||
token = ge_rc_parse_hint (scanner, &clearlooks_style->hint);
|
||||
clearlooks_style->flags |= CL_FLAG_HINT;
|
||||
break;
|
||||
|
||||
/* stuff to ignore */
|
||||
case TOKEN_SUNKENMENU:
|
||||
|
|
@ -428,12 +431,12 @@ clearlooks_rc_style_parse (GtkRcStyle *rc_style,
|
|||
|
||||
static void
|
||||
clearlooks_rc_style_merge (GtkRcStyle *dest,
|
||||
GtkRcStyle *src)
|
||||
GtkRcStyle *src)
|
||||
{
|
||||
ClearlooksRcStyle *dest_w, *src_w;
|
||||
ClearlooksRcFlags flags;
|
||||
|
||||
clearlooks_parent_rc_class->merge (dest, src);
|
||||
GTK_RC_STYLE_CLASS (clearlooks_rc_style_parent_class)->merge (dest, src);
|
||||
|
||||
if (!CLEARLOOKS_IS_RC_STYLE (src))
|
||||
return;
|
||||
|
|
@ -447,10 +450,14 @@ clearlooks_rc_style_merge (GtkRcStyle *dest,
|
|||
dest_w->style = src_w->style;
|
||||
if (flags & CL_FLAG_CONTRAST)
|
||||
dest_w->contrast = src_w->contrast;
|
||||
if (flags & CL_FLAG_RELIEFSTYLE)
|
||||
dest_w->reliefstyle = src_w->reliefstyle;
|
||||
if (flags & CL_FLAG_MENUBARSTYLE)
|
||||
dest_w->menubarstyle = src_w->menubarstyle;
|
||||
if (flags & CL_FLAG_TOOLBARSTYLE)
|
||||
dest_w->toolbarstyle = src_w->toolbarstyle;
|
||||
if (flags & CL_FLAG_FOCUS_COLOR)
|
||||
dest_w->focus_color = src_w->focus_color;
|
||||
if (flags & CL_FLAG_SCROLLBAR_COLOR)
|
||||
dest_w->scrollbar_color = src_w->scrollbar_color;
|
||||
if (flags & CL_FLAG_COLORIZE_SCROLLBAR)
|
||||
|
|
@ -459,6 +466,8 @@ clearlooks_rc_style_merge (GtkRcStyle *dest,
|
|||
dest_w->animation = src_w->animation;
|
||||
if (flags & CL_FLAG_RADIUS)
|
||||
dest_w->radius = src_w->radius;
|
||||
if (flags & CL_FLAG_HINT)
|
||||
dest_w->hint = src_w->hint;
|
||||
|
||||
dest_w->flags |= src_w->flags;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
/* Clearlooks Theme Engine
|
||||
* Copyright (C) 2005 Richard Stellingwerff.
|
||||
/* Clearlooks theme engine
|
||||
* Copyright (C) 2005 Richard Stellingwerff
|
||||
* Copyright (C) 2007 Benjamin Berg
|
||||
* Copyright (C) 2007 Andrea Cimitan
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
|
@ -25,12 +27,13 @@
|
|||
#include <gtk/gtkrc.h>
|
||||
#include "clearlooks_types.h"
|
||||
|
||||
#ifndef CLEARLOOKS_RC_STYLE_H
|
||||
#define CLEARLOOKS_RC_STYLE_H
|
||||
|
||||
typedef struct _ClearlooksRcStyle ClearlooksRcStyle;
|
||||
typedef struct _ClearlooksRcStyleClass ClearlooksRcStyleClass;
|
||||
|
||||
GE_INTERNAL extern GType clearlooks_type_rc_style;
|
||||
|
||||
#define CLEARLOOKS_TYPE_RC_STYLE clearlooks_type_rc_style
|
||||
#define CLEARLOOKS_TYPE_RC_STYLE (clearlooks_rc_style_get_type ())
|
||||
#define CLEARLOOKS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), CLEARLOOKS_TYPE_RC_STYLE, ClearlooksRcStyle))
|
||||
#define CLEARLOOKS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLEARLOOKS_TYPE_RC_STYLE, ClearlooksRcStyleClass))
|
||||
#define CLEARLOOKS_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), CLEARLOOKS_TYPE_RC_STYLE))
|
||||
|
|
@ -40,15 +43,19 @@ GE_INTERNAL extern GType clearlooks_type_rc_style;
|
|||
/* XXX: needs fixing! */
|
||||
typedef enum {
|
||||
CL_FLAG_STYLE = 1 << 0,
|
||||
CL_FLAG_SCROLLBAR_COLOR = 1 << 1,
|
||||
CL_FLAG_COLORIZE_SCROLLBAR = 1 << 2,
|
||||
CL_FLAG_CONTRAST = 1 << 3,
|
||||
CL_FLAG_MENUBARSTYLE = 1 << 4,
|
||||
CL_FLAG_TOOLBARSTYLE = 1 << 5,
|
||||
CL_FLAG_ANIMATION = 1 << 6,
|
||||
CL_FLAG_RADIUS = 1 << 7
|
||||
CL_FLAG_FOCUS_COLOR = 1 << 1,
|
||||
CL_FLAG_SCROLLBAR_COLOR = 1 << 2,
|
||||
CL_FLAG_COLORIZE_SCROLLBAR = 1 << 3,
|
||||
CL_FLAG_CONTRAST = 1 << 4,
|
||||
CL_FLAG_RELIEFSTYLE = 1 << 5,
|
||||
CL_FLAG_MENUBARSTYLE = 1 << 6,
|
||||
CL_FLAG_TOOLBARSTYLE = 1 << 7,
|
||||
CL_FLAG_ANIMATION = 1 << 8,
|
||||
CL_FLAG_RADIUS = 1 << 9,
|
||||
CL_FLAG_HINT = 1 << 10
|
||||
} ClearlooksRcFlags;
|
||||
|
||||
|
||||
struct _ClearlooksRcStyle
|
||||
{
|
||||
GtkRcStyle parent_instance;
|
||||
|
|
@ -57,18 +64,24 @@ struct _ClearlooksRcStyle
|
|||
|
||||
ClearlooksStyles style;
|
||||
|
||||
GdkColor focus_color;
|
||||
GdkColor scrollbar_color;
|
||||
gboolean colorize_scrollbar;
|
||||
double contrast;
|
||||
guint8 reliefstyle;
|
||||
guint8 menubarstyle;
|
||||
guint8 toolbarstyle;
|
||||
gboolean animation;
|
||||
double radius;
|
||||
GQuark hint;
|
||||
};
|
||||
|
||||
struct _ClearlooksRcStyleClass
|
||||
{
|
||||
GtkRcStyleClass parent_class;
|
||||
GtkRcStyleClass parent_class;
|
||||
};
|
||||
|
||||
GE_INTERNAL void clearlooks_rc_style_register_type (GTypeModule *module);
|
||||
GE_INTERNAL void clearlooks_rc_style_register_types (GTypeModule *module);
|
||||
GE_INTERNAL GType clearlooks_rc_style_get_type (void);
|
||||
|
||||
#endif /* CLEARLOOKS_RC_STYLE_H */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,7 @@
|
|||
/* Clearlooks Engine
|
||||
/* Clearlooks theme engine
|
||||
* Copyright (C) 2005 Richard Stellingwerff.
|
||||
* Copyright (C) 2006 Benjamin Berg
|
||||
* Copyright (C) 2007 Benjamin Berg
|
||||
* Copyright (C) 2007 Andrea Cimitan
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
* and by Alexander Larsson <alexl@redhat.com>
|
||||
* Modified by Richard Stellingwerff <remenic@gmail.com>
|
||||
*/
|
||||
|
||||
#include <gtk/gtkstyle.h>
|
||||
|
||||
#ifndef CLEARLOOKS_STYLE_H
|
||||
|
|
@ -32,9 +34,7 @@
|
|||
typedef struct _ClearlooksStyle ClearlooksStyle;
|
||||
typedef struct _ClearlooksStyleClass ClearlooksStyleClass;
|
||||
|
||||
GE_INTERNAL extern GType clearlooks_type_style;
|
||||
|
||||
#define CLEARLOOKS_TYPE_STYLE clearlooks_type_style
|
||||
#define CLEARLOOKS_TYPE_STYLE (clearlooks_style_get_type ())
|
||||
#define CLEARLOOKS_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), CLEARLOOKS_TYPE_STYLE, ClearlooksStyle))
|
||||
#define CLEARLOOKS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLEARLOOKS_TYPE_STYLE, ClearlooksStyleClass))
|
||||
#define CLEARLOOKS_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), CLEARLOOKS_TYPE_STYLE))
|
||||
|
|
@ -48,9 +48,12 @@ struct _ClearlooksStyle
|
|||
ClearlooksColors colors;
|
||||
|
||||
ClearlooksStyles style;
|
||||
|
||||
|
||||
guint8 reliefstyle;
|
||||
guint8 menubarstyle;
|
||||
guint8 toolbarstyle;
|
||||
GdkColor focus_color;
|
||||
gboolean has_focus_color;
|
||||
GdkColor scrollbar_color;
|
||||
gboolean colorize_scrollbar;
|
||||
gboolean has_scrollbar_color;
|
||||
|
|
@ -63,8 +66,10 @@ struct _ClearlooksStyleClass
|
|||
GtkStyleClass parent_class;
|
||||
|
||||
ClearlooksStyleFunctions style_functions[CL_NUM_STYLES];
|
||||
ClearlooksStyleConstants style_constants[CL_NUM_STYLES];
|
||||
};
|
||||
|
||||
GE_INTERNAL void clearlooks_style_register_type (GTypeModule *module);
|
||||
GE_INTERNAL void clearlooks_style_register_types (GTypeModule *module);
|
||||
GE_INTERNAL GType clearlooks_style_get_type (void);
|
||||
|
||||
#endif /* CLEARLOOKS_STYLE_H */
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
GE_EXPORT void
|
||||
theme_init (GTypeModule *module)
|
||||
{
|
||||
clearlooks_rc_style_register_type (module);
|
||||
clearlooks_style_register_type (module);
|
||||
clearlooks_rc_style_register_types (module);
|
||||
clearlooks_style_register_types (module);
|
||||
}
|
||||
|
||||
GE_EXPORT void
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
typedef unsigned char boolean;
|
||||
typedef unsigned char uint8;
|
||||
typedef struct _ClearlooksStyleFunctions ClearlooksStyleFunctions;
|
||||
typedef struct _ClearlooksStyleConstants ClearlooksStyleConstants;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
|
@ -16,7 +17,6 @@ typedef enum
|
|||
CL_NUM_STYLES = 4
|
||||
} ClearlooksStyles;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CL_STATE_NORMAL,
|
||||
|
|
@ -43,11 +43,17 @@ typedef enum
|
|||
|
||||
typedef enum
|
||||
{
|
||||
CL_ORDER_FIRST,
|
||||
CL_ORDER_MIDDLE,
|
||||
CL_ORDER_LAST
|
||||
CL_ORDER_FIRST = 1 << 0,
|
||||
CL_ORDER_LAST = 1 << 1,
|
||||
} ClearlooksOrder;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CL_CONT_NONE = 0,
|
||||
CL_CONT_LEFT = 1 << 0,
|
||||
CL_CONT_RIGHT = 1 << 1
|
||||
} ClearlooksContinue;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CL_ORIENTATION_LEFT_TO_RIGHT,
|
||||
|
|
@ -85,6 +91,23 @@ typedef enum
|
|||
CL_ARROW_COMBO
|
||||
} ClearlooksArrowType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CL_FOCUS_BUTTON,
|
||||
CL_FOCUS_BUTTON_FLAT,
|
||||
CL_FOCUS_LABEL,
|
||||
CL_FOCUS_TREEVIEW,
|
||||
CL_FOCUS_TREEVIEW_HEADER,
|
||||
CL_FOCUS_TREEVIEW_ROW,
|
||||
CL_FOCUS_TREEVIEW_DND,
|
||||
CL_FOCUS_SCALE,
|
||||
CL_FOCUS_TAB,
|
||||
CL_FOCUS_COLOR_WHEEL_DARK,
|
||||
CL_FOCUS_COLOR_WHEEL_LIGHT,
|
||||
CL_FOCUS_UNKNOWN
|
||||
} ClearlooksFocusType;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CL_DIRECTION_UP,
|
||||
|
|
@ -138,7 +161,7 @@ typedef struct
|
|||
boolean focus;
|
||||
boolean is_default;
|
||||
boolean ltr;
|
||||
boolean enable_glow;
|
||||
boolean enable_shadow;
|
||||
|
||||
gfloat radius;
|
||||
|
||||
|
|
@ -151,8 +174,21 @@ typedef struct
|
|||
CairoColor parentbg;
|
||||
|
||||
ClearlooksStyleFunctions *style_functions;
|
||||
ClearlooksStyleConstants *style_constants;
|
||||
} WidgetParameters;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ClearlooksFocusType type;
|
||||
ClearlooksContinue continue_side;
|
||||
CairoColor color;
|
||||
boolean has_color;
|
||||
gint line_width;
|
||||
gint padding;
|
||||
guint8* dash_list;
|
||||
boolean interior;
|
||||
} FocusParameters;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
boolean lower;
|
||||
|
|
@ -184,12 +220,13 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
ClearlooksGapSide gap_side;
|
||||
FocusParameters focus;
|
||||
} TabParameters;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CairoCorners corners;
|
||||
ClearlooksShadowType shadow;
|
||||
ClearlooksShadowType shadow;
|
||||
} ShadowParameters;
|
||||
|
||||
typedef struct
|
||||
|
|
@ -206,7 +243,7 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
CairoColor color;
|
||||
ClearlooksJunction junction; /* On which sides the slider junctions */
|
||||
ClearlooksJunction junction; /* On which sides the slider junctions */
|
||||
boolean horizontal;
|
||||
boolean has_color;
|
||||
} ScrollBarParameters;
|
||||
|
|
@ -219,7 +256,7 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
ClearlooksStepper stepper; /* Which stepper to draw */
|
||||
ClearlooksStepper stepper; /* Which stepper to draw */
|
||||
} ScrollBarStepperParameters;
|
||||
|
||||
typedef struct
|
||||
|
|
@ -251,193 +288,211 @@ typedef struct
|
|||
boolean topmost;
|
||||
} ToolbarParameters;
|
||||
|
||||
struct _ClearlooksStyleConstants
|
||||
{
|
||||
gdouble topleft_highlight_shade;
|
||||
gdouble topleft_highlight_alpha;
|
||||
};
|
||||
|
||||
struct _ClearlooksStyleFunctions
|
||||
{
|
||||
void (*draw_button) (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *widget,
|
||||
void (*draw_top_left_highlight) (cairo_t *cr,
|
||||
const CairoColor *color,
|
||||
const WidgetParameters *params,
|
||||
int x, int y, int width, int height,
|
||||
gdouble radius,
|
||||
CairoCorners corners);
|
||||
|
||||
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_checkbox) (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *widget,
|
||||
|
||||
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,
|
||||
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,
|
||||
gfloat radius,
|
||||
int width, int height);
|
||||
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,
|
||||
|
|
@ -447,9 +502,9 @@ struct _ClearlooksStyleFunctions
|
|||
};
|
||||
|
||||
|
||||
#define CLEARLOOKS_RECTANGLE_SET(rect, _x, _y, _w, _h) rect.x = _x; \
|
||||
rect.y = _y; \
|
||||
rect.width = _w; \
|
||||
rect.height = _h;
|
||||
#define CLEARLOOKS_RECTANGLE_SET(rect, _x, _y, _w, _h) (rect).x = (_x); \
|
||||
(rect).y = (_y); \
|
||||
(rect).width = (_w); \
|
||||
(rect).height = (_h);
|
||||
|
||||
#endif /* CLEARLOOKS_TYPES_H */
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
/* engines/clearlooks/src/config.h. Generated from config.h.in by configure. */
|
||||
/* engines/clearlooks/src/config.h.in. Generated from configure.ac by autoheader. */
|
||||
/* engines/support/config.h. Generated from config.h.in by configure. */
|
||||
/* engines/support/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* always defined to indicate that i18n is enabled */
|
||||
#define ENABLE_NLS 1
|
||||
|
||||
/* Defines whether to enable runtime widget checks as a fallback to hints from
|
||||
the theme. */
|
||||
#define ENABLE_WIDGET_CHECKS 1
|
||||
|
||||
/* Gettext package */
|
||||
#define GETTEXT_PACKAGE "gtk-engines"
|
||||
|
||||
|
|
@ -55,6 +59,9 @@
|
|||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "gtk-engines"
|
||||
|
||||
|
|
@ -65,16 +72,16 @@
|
|||
#define PACKAGE_NAME "gtk-engines"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "gtk-engines 2.12.2"
|
||||
#define PACKAGE_STRING "gtk-engines 2.16.0"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "gtk-engines"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "2.12.2"
|
||||
#define PACKAGE_VERSION "2.16.0"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "2.12.2"
|
||||
#define VERSION "2.16.0"
|
||||
|
|
|
|||
|
|
@ -5,5 +5,4 @@
|
|||
#include "cairo-support.h"
|
||||
#include "widget-information.h"
|
||||
|
||||
|
||||
#endif /* GE_SUPPORT_H */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef __GENERAL_SUPPORT_H
|
||||
#define __GENERAL_SUPPORT_H
|
||||
|
||||
#include <gmodule.h>
|
||||
#include <glib.h>
|
||||
|
|
@ -37,3 +39,5 @@
|
|||
# define GE_EXPORT __global
|
||||
# define GE_INTERNAL __hidden
|
||||
#endif
|
||||
|
||||
#endif /* __GENERAL_SUPPORT_H */
|
||||
|
|
|
|||
|
|
@ -66,14 +66,34 @@ clearlooks_get_parent_bg (const GtkWidget *widget, CairoColor *color)
|
|||
GtkStateType state_type;
|
||||
const GtkWidget *parent;
|
||||
GdkColor *gcolor;
|
||||
gboolean stop;
|
||||
|
||||
if (widget == NULL)
|
||||
return;
|
||||
|
||||
parent = widget->parent;
|
||||
stop = FALSE;
|
||||
|
||||
while (parent && GTK_WIDGET_NO_WINDOW (parent) && !((GTK_IS_NOTEBOOK (parent)) || (GTK_IS_TOOLBAR (parent))))
|
||||
parent = parent->parent;
|
||||
while (parent && !stop)
|
||||
{
|
||||
stop = FALSE;
|
||||
|
||||
stop |= !GTK_WIDGET_NO_WINDOW (parent);
|
||||
stop |= GTK_IS_NOTEBOOK (parent) &&
|
||||
gtk_notebook_get_show_tabs (GTK_NOTEBOOK (parent)) &&
|
||||
gtk_notebook_get_show_border (GTK_NOTEBOOK (parent));
|
||||
|
||||
if (GTK_IS_TOOLBAR (parent))
|
||||
{
|
||||
GtkShadowType shadow = GTK_SHADOW_OUT;
|
||||
gtk_widget_style_get (GTK_WIDGET (parent), "shadow-type", &shadow, NULL);
|
||||
|
||||
stop |= (shadow != GTK_SHADOW_NONE);
|
||||
}
|
||||
|
||||
if (!stop)
|
||||
parent = parent->parent;
|
||||
}
|
||||
|
||||
if (parent == NULL)
|
||||
return;
|
||||
|
|
@ -151,8 +171,10 @@ clearlooks_scrollbar_visible_steppers (GtkWidget *widget)
|
|||
{
|
||||
ClearlooksStepper steppers = 0;
|
||||
|
||||
/* If this is not a range widget, assume that the primary steppers
|
||||
* are present. */
|
||||
if (!GE_IS_RANGE (widget))
|
||||
return 0;
|
||||
return CL_STEPPER_A | CL_STEPPER_D;
|
||||
|
||||
if (GTK_RANGE (widget)->has_stepper_a)
|
||||
steppers |= CL_STEPPER_A;
|
||||
|
|
@ -183,20 +205,29 @@ clearlooks_scrollbar_get_junction (GtkWidget *widget)
|
|||
if (adj->value <= adj->lower &&
|
||||
(GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b))
|
||||
{
|
||||
junction |= CL_JUNCTION_BEGIN;
|
||||
if (!gtk_range_get_inverted (GTK_RANGE (widget)))
|
||||
junction |= CL_JUNCTION_BEGIN;
|
||||
else
|
||||
junction |= CL_JUNCTION_END;
|
||||
}
|
||||
|
||||
if (adj->value >= adj->upper - adj->page_size &&
|
||||
(GTK_RANGE (widget)->has_stepper_c || GTK_RANGE (widget)->has_stepper_d))
|
||||
{
|
||||
junction |= CL_JUNCTION_END;
|
||||
if (!gtk_range_get_inverted (GTK_RANGE (widget)))
|
||||
junction |= CL_JUNCTION_END;
|
||||
else
|
||||
junction |= CL_JUNCTION_BEGIN;
|
||||
}
|
||||
|
||||
return junction;
|
||||
}
|
||||
|
||||
void
|
||||
clearlooks_set_toolbar_parameters (ToolbarParameters *toolbar, GtkWidget *widget, GdkWindow *window, gint x, gint y)
|
||||
clearlooks_set_toolbar_parameters (ToolbarParameters *toolbar,
|
||||
GtkWidget *widget,
|
||||
GdkWindow *window,
|
||||
gint x, gint y)
|
||||
{
|
||||
toolbar->topmost = FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,169 @@
|
|||
|
||||
#include "general-support.h"
|
||||
#include "widget-information.h"
|
||||
#include "config.h"
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
static gchar ge_widget_hints[] =
|
||||
"treeview\0"
|
||||
"treeview-header\0"
|
||||
"statusbar\0"
|
||||
"comboboxentry\0"
|
||||
"spinbutton\0"
|
||||
"scale\0"
|
||||
"vscale\0"
|
||||
"hscale\0"
|
||||
"scrollbar\0"
|
||||
"vscrollbar\0"
|
||||
"hscrollbar\0"
|
||||
"progressbar\0"
|
||||
"menubar\0";
|
||||
|
||||
gboolean
|
||||
ge_check_hint (GEHint hint,
|
||||
GQuark style_hint,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
static GEHint quark_hint_lookup[GE_HINT_COUNT] = {0};
|
||||
|
||||
g_assert ((hint >= 0) && (hint < GE_HINT_COUNT));
|
||||
|
||||
/* Initilize lookup table */
|
||||
if (G_UNLIKELY (quark_hint_lookup[0] == 0))
|
||||
{
|
||||
guint i = 0;
|
||||
gchar *cur_hint_str = ge_widget_hints;
|
||||
while ((i < GE_HINT_COUNT) && cur_hint_str[0])
|
||||
{
|
||||
/* Can't use _from_static_string as the engine may be unloaded. */
|
||||
quark_hint_lookup[i] = g_quark_from_string (cur_hint_str);
|
||||
cur_hint_str += strlen(cur_hint_str) + 1;
|
||||
i++;
|
||||
}
|
||||
g_assert (i == GE_HINT_COUNT && cur_hint_str[0] == '\0');
|
||||
}
|
||||
|
||||
|
||||
if (quark_hint_lookup[hint] == style_hint)
|
||||
return TRUE;
|
||||
|
||||
|
||||
/* Try to decide based on other hints, eg. hscale is also a scale. */
|
||||
if (hint == GE_HINT_SCALE)
|
||||
if (ge_check_hint (GE_HINT_VSCALE, style_hint, widget) ||
|
||||
ge_check_hint (GE_HINT_HSCALE, style_hint, widget))
|
||||
return TRUE;
|
||||
if (hint == GE_HINT_SCROLLBAR)
|
||||
if (ge_check_hint (GE_HINT_VSCROLLBAR, style_hint, widget) ||
|
||||
ge_check_hint (GE_HINT_HSCROLLBAR, style_hint, widget))
|
||||
return TRUE;
|
||||
if (hint == GE_HINT_TREEVIEW)
|
||||
if (ge_check_hint (GE_HINT_TREEVIEW_HEADER, style_hint, widget))
|
||||
return TRUE;
|
||||
|
||||
|
||||
/* These may be caused by applications so we never want to disable them.
|
||||
* TODO: This does not catch the case where the theme uses appears-as-list
|
||||
* and the application turns it off again. Though this case
|
||||
* is even less likely. */
|
||||
switch (hint) {
|
||||
case GE_HINT_COMBOBOX_ENTRY:
|
||||
if (widget && ge_object_is_a (G_OBJECT (widget), "GtkComboBox"))
|
||||
{
|
||||
gboolean appears_as_list = FALSE;
|
||||
|
||||
gtk_widget_style_get (widget, "appears-as-list", &appears_as_list, NULL);
|
||||
|
||||
if (appears_as_list)
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_WIDGET_CHECKS
|
||||
/* If a style_hint *was* set, and nothing matched, just give up right away.
|
||||
* A theme shall either support it fully, or not at all. */
|
||||
if (style_hint != 0)
|
||||
return FALSE;
|
||||
|
||||
/* No widget? Just give up. Nothing we can do. */
|
||||
if (widget == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Try to do something based on the passed in widget pointer. */
|
||||
switch (hint) {
|
||||
case GE_HINT_TREEVIEW:
|
||||
if (widget->parent && (ge_object_is_a (G_OBJECT (widget->parent), "GtkTreeView")))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_TREEVIEW_HEADER:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkButton") && widget->parent &&
|
||||
(ge_object_is_a (G_OBJECT (widget->parent), "GtkTreeView") || ge_object_is_a (G_OBJECT (widget->parent), "GtkCList") ||
|
||||
ge_object_is_a (G_OBJECT (widget->parent), "GtkCTree")))
|
||||
return TRUE;
|
||||
if (widget->parent && ge_object_is_a (G_OBJECT (widget->parent), "ETreeView"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_COMBOBOX_ENTRY:
|
||||
if (ge_is_in_combo_box (widget))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_SPINBUTTON:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkSpinButton"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_STATUSBAR:
|
||||
if (widget->parent && ge_object_is_a (G_OBJECT (widget), "GtkStatusbar"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_SCALE:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkScale"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_HSCALE:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkHScale"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_VSCALE:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkVScale"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_SCROLLBAR:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkScrollbar"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_HSCROLLBAR:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkHScrollbar"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_VSCROLLBAR:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkVScrollbar"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_PROGRESSBAR:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkProgressBar"))
|
||||
return TRUE;
|
||||
break;
|
||||
case GE_HINT_MENUBAR:
|
||||
if (ge_object_is_a (G_OBJECT (widget), "GtkMenuBar") ||
|
||||
ge_object_is_a (G_OBJECT (widget->parent), "GtkMenuBar"))
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Widget Type Lookups/Macros
|
||||
|
||||
Based on/modified from functions in
|
||||
|
|
@ -40,21 +200,14 @@ ge_is_combo_box_entry (GtkWidget * widget)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
ge_combo_box_is_using_list (GtkWidget * widget)
|
||||
{
|
||||
gboolean result = FALSE;
|
||||
|
||||
if (GE_IS_COMBO_BOX (widget))
|
||||
{
|
||||
gboolean *tmp = NULL;
|
||||
|
||||
gtk_widget_style_get (widget, "appears-as-list", &result, NULL);
|
||||
|
||||
if (tmp)
|
||||
result = *tmp;
|
||||
}
|
||||
gtk_widget_style_get (widget, "appears-as-list", &result, NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -242,8 +395,8 @@ ge_find_combo_box_widget_parent (GtkWidget * widget)
|
|||
***********************************************/
|
||||
void
|
||||
ge_option_menu_get_props (GtkWidget * widget,
|
||||
GtkRequisition * indicator_size,
|
||||
GtkBorder * indicator_spacing)
|
||||
GtkRequisition * indicator_size,
|
||||
GtkBorder * indicator_spacing)
|
||||
{
|
||||
GtkRequisition default_size = { 9, 5 };
|
||||
GtkBorder default_spacing = { 7, 5, 2, 2 };
|
||||
|
|
@ -293,7 +446,6 @@ ge_button_get_default_border (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
ge_widget_is_ltr (GtkWidget *widget)
|
||||
{
|
||||
|
|
@ -310,3 +462,26 @@ ge_widget_is_ltr (GtkWidget *widget)
|
|||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
guint
|
||||
ge_rc_parse_hint (GScanner *scanner,
|
||||
GQuark *quark)
|
||||
{
|
||||
guint token;
|
||||
|
||||
/* Skip 'hint' */
|
||||
token = g_scanner_get_next_token(scanner);
|
||||
|
||||
token = g_scanner_get_next_token(scanner);
|
||||
if (token != G_TOKEN_EQUAL_SIGN)
|
||||
return G_TOKEN_EQUAL_SIGN;
|
||||
|
||||
token = g_scanner_get_next_token(scanner);
|
||||
if (token != G_TOKEN_STRING)
|
||||
return G_TOKEN_STRING;
|
||||
|
||||
*quark = g_quark_from_string (scanner->value.v_string);
|
||||
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,45 @@
|
|||
|
||||
#ifndef WIDGET_INFORMATION_H
|
||||
#define WIDGET_INFORMATION_H
|
||||
|
||||
#include "general-support.h"
|
||||
#include <glib.h>
|
||||
#include <gtk/gtkwidget.h>
|
||||
|
||||
typedef enum {
|
||||
GE_HINT_TREEVIEW,
|
||||
GE_HINT_TREEVIEW_HEADER,
|
||||
GE_HINT_STATUSBAR,
|
||||
GE_HINT_COMBOBOX_ENTRY,
|
||||
GE_HINT_SPINBUTTON,
|
||||
GE_HINT_SCALE,
|
||||
GE_HINT_VSCALE,
|
||||
GE_HINT_HSCALE,
|
||||
GE_HINT_SCROLLBAR,
|
||||
GE_HINT_VSCROLLBAR,
|
||||
GE_HINT_HSCROLLBAR,
|
||||
GE_HINT_PROGRESSBAR,
|
||||
GE_HINT_MENUBAR,
|
||||
GE_HINT_COUNT
|
||||
} GEHint;
|
||||
|
||||
/* ALL OF THE FOLLOWING SHOULD DIE ...
|
||||
* instead the hint system will be used, and a huge switch ;-) */
|
||||
|
||||
/* Object Type Lookups/Macros
|
||||
|
||||
Based on/modified from functions in
|
||||
Smooth-Engine.
|
||||
*/
|
||||
#define GE_IS_WIDGET(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkWidget"))
|
||||
#define GE_IS_CONTAINER(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkContainer"))
|
||||
#define GE_IS_BIN(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkBin"))
|
||||
#define GE_IS_WIDGET(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkWidget"))
|
||||
#define GE_IS_CONTAINER(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkContainer"))
|
||||
#define GE_IS_BIN(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkBin"))
|
||||
|
||||
#define GE_IS_ARROW(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkArrow"))
|
||||
#define GE_IS_ARROW(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkArrow"))
|
||||
|
||||
#define GE_IS_SEPARATOR(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkSeparator"))
|
||||
#define GE_IS_VSEPARATOR(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkVSeparator"))
|
||||
#define GE_IS_HSEPARATOR(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkHSeparator"))
|
||||
#define GE_IS_SEPARATOR(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkSeparator"))
|
||||
#define GE_IS_VSEPARATOR(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkVSeparator"))
|
||||
#define GE_IS_HSEPARATOR(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkHSeparator"))
|
||||
|
||||
#define GE_IS_HANDLE_BOX(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkHandleBox"))
|
||||
#define GE_IS_HANDLE_BOX_ITEM(object) ((object) && GE_IS_HANDLE_BOX(object->parent))
|
||||
|
|
@ -73,6 +100,9 @@
|
|||
|
||||
#define GE_WIDGET_HAS_DEFAULT(object) ((object) && GE_IS_WIDGET(object) && GTK_WIDGET_HAS_DEFAULT(object))
|
||||
|
||||
|
||||
GE_INTERNAL gboolean ge_check_hint (GEHint hint, GQuark style_hint, GtkWidget *widget);
|
||||
|
||||
GE_INTERNAL gboolean ge_object_is_a (const GObject * object, const gchar * type_name);
|
||||
|
||||
GE_INTERNAL gboolean ge_is_combo_box_entry (GtkWidget * widget);
|
||||
|
|
@ -97,3 +127,6 @@ GE_INTERNAL void ge_button_get_default_border (GtkWidget *widget,
|
|||
|
||||
GE_INTERNAL gboolean ge_widget_is_ltr (GtkWidget *widget);
|
||||
|
||||
GE_INTERNAL guint ge_rc_parse_hint (GScanner *scanner, GQuark *quark);
|
||||
|
||||
#endif /* WIDGET_INFORMATION_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue