gtk-engines r1122 - in trunk: . engines/crux/src
- From: thos svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk-engines r1122 - in trunk: . engines/crux/src
- Date: Mon, 3 Mar 2008 21:05:54 +0000 (GMT)
Author: thos
Date: Mon Mar 3 21:05:53 2008
New Revision: 1122
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1122&view=rev
Log:
2008-03-03 Thomas Wood <thos gnome org>
* engines/crux/src/crux-draw.c: (draw_hline), (draw_vline): Convert
hline and vline functions to cairo
Modified:
trunk/ChangeLog
trunk/engines/crux/src/crux-draw.c
Modified: trunk/engines/crux/src/crux-draw.c
==============================================================================
--- trunk/engines/crux/src/crux-draw.c (original)
+++ trunk/engines/crux/src/crux-draw.c Mon Mar 3 21:05:53 2008
@@ -742,44 +742,28 @@
const gchar *detail,
gint x1, gint x2, gint y)
{
- gint thickness_light;
- gint thickness_dark;
- gint i;
-
- CHECK_ARGS
-
- debug ("draw_hline: detail=%s state=%d x1=%d x2=%d y=%d\n",
- detail, state_type, x1, x2, y);
+ CairoColor base, light, dark;
+ cairo_t *cr;
- thickness_light = style->ythickness / 2;
- thickness_dark = style->ythickness - thickness_light;
+ CHECK_ARGS
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
- gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
- }
- for (i = 0; i < thickness_dark; i++)
- {
- gdk_draw_line (window, style->light_gc[state_type], x2 - i - 1,
- y + i, x2, y + i);
- gdk_draw_line (window, style->dark_gc[state_type], x1, y + i,
- x2 - i - 1, y + i);
- }
+ debug ("draw_hline: detail=%s state=%d x1=%d x2=%d y=%d\n",
+ detail, state_type, x1, x2, y);
- y += thickness_dark;
- for (i = 0; i < thickness_light; i++)
- {
- gdk_draw_line (window, style->dark_gc[state_type], x1, y + i,
- x1 + thickness_light - i - 1, y + i);
- gdk_draw_line (window, style->light_gc[state_type],
- x1 + thickness_light - i - 1, y + i, x2, y + i);
- }
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL);
- gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL);
- }
+ cr = ge_gdk_drawable_to_cairo (window, area);
+ ge_gdk_color_to_cairo (&style->bg[state_type], &base);
+ ge_shade_color (&base, 0.88, &dark);
+ ge_shade_color (&base, 1.12, &light);
+ ge_cairo_set_color (cr, &dark);
+ cairo_move_to (cr, x1 + 0.5, y + 0.5);
+ cairo_line_to (cr, x2 + 0.5, y + 0.5);
+ cairo_stroke (cr);
+ y++;
+ ge_cairo_set_color (cr, &light);
+ cairo_move_to (cr, x1 + 0.5, y + 0.5);
+ cairo_line_to (cr, x2 + 0.5, y + 0.5);
+ cairo_stroke (cr);
+ cairo_destroy (cr);
}
static void
@@ -789,44 +773,28 @@
GdkRectangle *area,
GtkWidget *widget, const gchar *detail, gint y1, gint y2, gint x)
{
- gint thickness_light;
- gint thickness_dark;
- gint i;
-
- CHECK_ARGS
-
- debug ("draw_vline: detail=%s state=%d x=%d y1=%d y2=%d\n",
- detail, state_type, x, y1, y2);
+ CairoColor base, light, dark;
+ cairo_t *cr;
- thickness_light = style->xthickness / 2;
- thickness_dark = style->xthickness - thickness_light;
+ CHECK_ARGS
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
- gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
- }
- for (i = 0; i < thickness_dark; i++)
- {
- gdk_draw_line (window, style->light_gc[state_type], x + i,
- y2 - i - 1, x + i, y2);
- gdk_draw_line (window, style->dark_gc[state_type], x + i, y1, x + i,
- y2 - i - 1);
- }
+ debug ("draw_vline: detail=%s state=%d x=%d y1=%d y2=%d\n",
+ detail, state_type, x, y1, y2);
- x += thickness_dark;
- for (i = 0; i < thickness_light; i++)
- {
- gdk_draw_line (window, style->dark_gc[state_type], x + i, y1, x + i,
- y1 + thickness_light - i);
- gdk_draw_line (window, style->light_gc[state_type], x + i,
- y1 + thickness_light - i, x + i, y2);
- }
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL);
- gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL);
- }
+ cr = ge_gdk_drawable_to_cairo (window, area);
+ ge_gdk_color_to_cairo (&style->bg[state_type], &base);
+ ge_shade_color (&base, 0.88, &dark);
+ ge_shade_color (&base, 1.12, &light);
+ ge_cairo_set_color (cr, &dark);
+ cairo_move_to (cr, x + 0.5, y1 + 0.5);
+ cairo_line_to (cr, x + 0.5, y2 + 0.5);
+ cairo_stroke (cr);
+ x++;
+ ge_cairo_set_color (cr, &light);
+ cairo_move_to (cr, x + 0.5, y1 + 0.5);
+ cairo_line_to (cr, x + 0.5, y2 + 0.5);
+ cairo_stroke (cr);
+ cairo_destroy (cr);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]