- 2,
- 2,
- gtk_default_draw_hline,
- gtk_default_draw_vline,
- gtk_default_draw_shadow,
- gtk_default_draw_polygon,
- gtk_default_draw_arrow,
- gtk_default_draw_diamond,
- gtk_default_draw_oval,
- gtk_default_draw_string,
- gtk_default_draw_box,
- gtk_default_draw_flat_box,
- gtk_default_draw_check,
- gtk_default_draw_option,
- gtk_default_draw_cross,
- gtk_default_draw_ramp,
- gtk_default_draw_tab,
- gtk_default_draw_shadow_gap,
- gtk_default_draw_box_gap,
- gtk_default_draw_extension,
- gtk_default_draw_focus,
- gtk_default_draw_slider,
- gtk_default_draw_handle
+ 2,
+ 2,
+ gtk_default_draw_hline,
+ gtk_default_draw_vline,
+ gtk_default_draw_shadow,
+ gtk_default_draw_polygon,
+ gtk_default_draw_arrow,
+ gtk_default_draw_diamond,
+ gtk_default_draw_oval,
+ gtk_default_draw_string,
+ gtk_default_draw_box,
+ gtk_default_draw_flat_box,
+ gtk_default_draw_check,
+ gtk_default_draw_option,
+ gtk_default_draw_cross,
+ gtk_default_draw_ramp,
+ gtk_default_draw_tab,
+ gtk_default_draw_shadow_gap,
+ gtk_default_draw_box_gap,
+ gtk_default_draw_extension,
+ gtk_default_draw_focus,
+ gtk_default_draw_slider,
+ gtk_default_draw_handle
- gint thickness_light;
- gint thickness_dark;
- gint i;
-
- g_return_if_fail (style != NULL);
- g_return_if_fail (window != NULL);
-
- thickness_light = style->klass->ythickness / 2;
- thickness_dark = style->klass->ythickness - thickness_light;
-
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
- gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
- }
-
- if (detail && !strcmp (detail, "label"))
- {
- if (state_type == GTK_STATE_INSENSITIVE)
- gdk_draw_line (window, style->white_gc, x1 + 1, y + 1, x2 + 1, y + 1);
- gdk_draw_line (window, style->fg_gc[state_type], x1, y, x2, y);
- }
- else
- {
- 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);
- }
-
- 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);
- }
+ gint thickness_light;
+ gint thickness_dark;
+ gint i;
+
+ g_return_if_fail (style != NULL);
+ g_return_if_fail (window != NULL);
+
+ thickness_light = style->klass->ythickness / 2;
+ thickness_dark = style->klass->ythickness - thickness_light;
+
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
+ gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
+ }
+
+ if (detail && !strcmp (detail, "label"))
+ {
+ if (state_type == GTK_STATE_INSENSITIVE)
+ gdk_draw_line (window, style->white_gc, x1 + 1, y + 1, x2 + 1, y + 1);
+ gdk_draw_line (window, style->fg_gc[state_type], x1, y, x2, y);
+ }
+ else
+ {
+ 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);
+ }
+
+ 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);
+ }
- GdkGC *gc1;
- GdkGC *gc2;
- GdkGC *gc3;
- GdkGC *gc4;
- gint half_width;
- gint half_height;
- GdkPoint points[3];
-
- g_return_if_fail (style != NULL);
- g_return_if_fail (window != NULL);
-
- switch (shadow_type)
- {
- case GTK_SHADOW_IN:
- gc1 = style->bg_gc[state_type];
- gc2 = style->dark_gc[state_type];
- gc3 = style->light_gc[state_type];
- gc4 = style->black_gc;
- break;
- case GTK_SHADOW_OUT:
- gc1 = style->dark_gc[state_type];
- gc2 = style->light_gc[state_type];
- gc3 = style->black_gc;
- gc4 = style->bg_gc[state_type];
- break;
- case GTK_SHADOW_ETCHED_IN:
- gc1 = style->light_gc[state_type];
- gc2 = style->dark_gc[state_type];
- gc3 = NULL;
- gc4 = NULL;
- break;
- case GTK_SHADOW_ETCHED_OUT:
- gc1 = style->dark_gc[state_type];
- gc2 = style->light_gc[state_type];
- gc3 = NULL;
- gc4 = NULL;
- break;
- default:
- return;
- }
-
- if ((width == -1) && (height == -1))
- gdk_window_get_size (window, &width, &height);
- else if (width == -1)
- gdk_window_get_size (window, &width, NULL);
- else if (height == -1)
- gdk_window_get_size (window, NULL, &height);
-
- half_width = width / 2;
- half_height = height / 2;
-
- if (area)
- {
- gdk_gc_set_clip_rectangle (gc1, area);
- gdk_gc_set_clip_rectangle (gc2, area);
- if ((gc3) && (gc4))
- {
- gdk_gc_set_clip_rectangle (gc3, area);
- gdk_gc_set_clip_rectangle (gc4, area);
- }
- }
-
- switch (arrow_type)
- {
- case GTK_ARROW_UP:
- if (fill)
- {
- points[0].x = x + half_width;
- points[0].y = y;
- points[1].x = x;
- points[1].y = y + height - 1;
- points[2].x = x + width - 1;
- points[2].y = y + height - 1;
-
- gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
- }
-
- switch (shadow_type)
- {
- case GTK_SHADOW_IN:
- case GTK_SHADOW_OUT:
-
- gdk_draw_line (window, gc1,
- x + 1, y + height - 2,
- x + width - 2, y + height - 2);
- gdk_draw_line (window, gc3,
- x + 0, y + height - 1,
- x + width - 1, y + height - 1);
-
- gdk_draw_line (window, gc1,
- x + width - 2, y + height - 1,
- x + half_width, y + 1);
- gdk_draw_line (window, gc3,
- x + width - 1, y + height - 1,
- x + half_width, y);
-
- gdk_draw_line (window, gc4,
- x + half_width, y + 1,
- x + 1, y + height - 1);
- gdk_draw_line (window, gc2,
- x + half_width, y,
- x, y + height - 1);
- break;
-
- case GTK_SHADOW_ETCHED_IN:
- case GTK_SHADOW_ETCHED_OUT:
- gdk_draw_line (window, gc1,
- x + half_width, y + 1,
- x + 1, y + height - 1);
- gdk_draw_line (window, gc1,
- x + 1, y + height - 1,
- x + width - 1, y + height - 1);
- gdk_draw_line (window, gc1,
- x + width - 1, y + height - 1,
- x + half_width + 1, y + 1);
-
- points[0].x = x + half_width;
- points[0].y = y;
- points[1].x = x;
- points[1].y = y + height - 2;
- points[2].x = x + width - 2;
- points[2].y = y + height - 2;
-
- gdk_draw_polygon (window, gc2, FALSE, points, 3);
- break;
-
- default:
- break;
- }
- break;
-
- case GTK_ARROW_DOWN:
- if (fill)
- {
- points[0].x = x + width - 1;
- points[0].y = y;
+ GdkGC *gc1;
+ GdkGC *gc2;
+ GdkGC *gc3;
+ GdkGC *gc4;
+ gint half_width;
+ gint half_height;
+ GdkPoint points[3];
+
+ g_return_if_fail (style != NULL);
+ g_return_if_fail (window != NULL);
+
+ switch (shadow_type)
+ {
+ case GTK_SHADOW_IN:
+ gc1 = style->bg_gc[state_type];
+ gc2 = style->dark_gc[state_type];
+ gc3 = style->light_gc[state_type];
+ gc4 = style->black_gc;
+ break;
+ case GTK_SHADOW_OUT:
+ gc1 = style->dark_gc[state_type];
+ gc2 = style->light_gc[state_type];
+ gc3 = style->black_gc;
+ gc4 = style->bg_gc[state_type];
+ break;
+ case GTK_SHADOW_ETCHED_IN:
+ gc1 = style->light_gc[state_type];
+ gc2 = style->dark_gc[state_type];
+ gc3 = NULL;
+ gc4 = NULL;
+ break;
+ case GTK_SHADOW_ETCHED_OUT:
+ gc1 = style->dark_gc[state_type];
+ gc2 = style->light_gc[state_type];
+ gc3 = NULL;
+ gc4 = NULL;
+ break;
+ default:
+ return;
+ }
+
+ if ((width == -1) && (height == -1))
+ gdk_window_get_size (window, &width, &height);
+ else if (width == -1)
+ gdk_window_get_size (window, &width, NULL);
+ else if (height == -1)
+ gdk_window_get_size (window, NULL, &height);
+
+ half_width = width / 2;
+ half_height = height / 2;
+
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (gc1, area);
+ gdk_gc_set_clip_rectangle (gc2, area);
+ if ((gc3) && (gc4))
+ {
+ gdk_gc_set_clip_rectangle (gc3, area);
+ gdk_gc_set_clip_rectangle (gc4, area);
+ }
+ }
+
+ switch (arrow_type)
+ {
+ case GTK_ARROW_UP:
+ if (fill)
+ {
+ points[0].x = x + half_width;
+ points[0].y = y;
+ points[1].x = x;
+ points[1].y = y + height - 1;
+ points[2].x = x + width - 1;
+ points[2].y = y + height - 1;
+
+ gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+ }
+
+ switch (shadow_type)
+ {
+ case GTK_SHADOW_IN:
+ case GTK_SHADOW_OUT:
+
+ gdk_draw_line (window, gc1,
+ x + 1, y + height - 2,
+ x + width - 2, y + height - 2);
+ gdk_draw_line (window, gc3,
+ x + 0, y + height - 1,
+ x + width - 1, y + height - 1);
+
+ gdk_draw_line (window, gc1,
+ x + width - 2, y + height - 1,
+ x + half_width, y + 1);
+ gdk_draw_line (window, gc3,
+ x + width - 1, y + height - 1,
+ x + half_width, y);
+
+ gdk_draw_line (window, gc4,
+ x + half_width, y + 1,
+ x + 1, y + height - 1);
+ gdk_draw_line (window, gc2,
+ x + half_width, y,
+ x, y + height - 1);
+ break;
+
+ case GTK_SHADOW_ETCHED_IN:
+ case GTK_SHADOW_ETCHED_OUT:
+ gdk_draw_line (window, gc1,
+ x + half_width, y + 1,
+ x + 1, y + height - 1);
+ gdk_draw_line (window, gc1,
+ x + 1, y + height - 1,
+ x + width - 1, y + height - 1);
+ gdk_draw_line (window, gc1,
+ x + width - 1, y + height - 1,
+ x + half_width + 1, y + 1);
+
+ points[0].x = x + half_width;
+ points[0].y = y;
+ points[1].x = x;
+ points[1].y = y + height - 2;
+ points[2].x = x + width - 2;
+ points[2].y = y + height - 2;
+
+ gdk_draw_polygon (window, gc2, FALSE, points, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case GTK_ARROW_DOWN:
+ if (fill)
+ {
+ points[0].x = x + width - 1;
+ points[0].y = y;
- points[1].y = y;
- points[2].x = x + half_width;
- points[2].y = y + height - 1;
-
- gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
- }
- switch (shadow_type)
- {
- case GTK_SHADOW_IN:
- case GTK_SHADOW_OUT:
- gdk_draw_line (window, gc4,
- x + width - 2,
- y + 1, x + 1, y + 1);
- gdk_draw_line (window, gc2,
- x + width - 1, y,
- x, y);
-
- gdk_draw_line (window, gc4,
- x + 1, y,
- x + half_width, y + height - 2);
- gdk_draw_line (window, gc2,
- x, y,
- x + half_width, y + height - 1);
-
- gdk_draw_line (window, gc1,
- x + half_width, y + height - 2,
- x + width - 2, y);
- gdk_draw_line (window, gc3,
- x + half_width, y + height - 1,
- x + width - 1, y);
- break;
-
- case GTK_SHADOW_ETCHED_IN:
- case GTK_SHADOW_ETCHED_OUT:
- gdk_draw_line (window, gc1,
- x + width - 1, y + 1,
- x + 1, y + 1);
- gdk_draw_line (window, gc1,
- x + 1, y + 1,
- x + half_width + 1, y + height - 1);
- gdk_draw_line (window, gc1,
- x + half_width + 1, y + height - 2,
- x + width - 1, y);
-
- points[0].x = x + width - 2;
- points[0].y = y;
- points[1].x = x;
- points[1].y = y;
- points[2].x = x + half_width;
- points[2].y = y + height - 2;
-
- gdk_draw_polygon (window, gc2, FALSE, points, 3);
- break;
-
- default:
- break;
- }
- break;
- case GTK_ARROW_LEFT:
+ points[1].y = y;
+ points[2].x = x + half_width;
+ points[2].y = y + height - 1;
+
+ gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+ }
+ switch (shadow_type)
+ {
+ case GTK_SHADOW_IN:
+ case GTK_SHADOW_OUT:
+ gdk_draw_line (window, gc4,
+ x + width - 2,
+ y + 1, x + 1, y + 1);
+ gdk_draw_line (window, gc2,
+ x + width - 1, y,
+ x, y);
+
+ gdk_draw_line (window, gc4,
+ x + 1, y,
+ x + half_width, y + height - 2);
+ gdk_draw_line (window, gc2,
+ x, y,
+ x + half_width, y + height - 1);
+
+ gdk_draw_line (window, gc1,
+ x + half_width, y + height - 2,
+ x + width - 2, y);
+ gdk_draw_line (window, gc3,
+ x + half_width, y + height - 1,
+ x + width - 1, y);
+ break;
+
+ case GTK_SHADOW_ETCHED_IN:
+ case GTK_SHADOW_ETCHED_OUT:
+ gdk_draw_line (window, gc1,
+ x + width - 1, y + 1,
+ x + 1, y + 1);
+ gdk_draw_line (window, gc1,
+ x + 1, y + 1,
+ x + half_width + 1, y + height - 1);
+ gdk_draw_line (window, gc1,
+ x + half_width + 1, y + height - 2,
+ x + width - 1, y);
+
+ points[0].x = x + width - 2;
+ points[0].y = y;
+ points[1].x = x;
+ points[1].y = y;
+ points[2].x = x + half_width;
+ points[2].y = y + height - 2;
+
+ gdk_draw_polygon (window, gc2, FALSE, points, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
+ case GTK_ARROW_LEFT:
- {
- points[0].x = x;
- points[0].y = y + half_height;
- points[1].x = x + width - 1;
- points[1].y = y + height - 1;
- points[2].x = x + width - 1;
- points[2].y = y;
-
- gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
- }
-
- switch (shadow_type)
- {
- case GTK_SHADOW_IN:
- case GTK_SHADOW_OUT:
- gdk_draw_line (window, gc1,
- x + 1, y + half_height,
- x + width - 1, y + height - 1);
- gdk_draw_line (window, gc3,
- x, y + half_height,
- x + width - 1, y + height - 1);
-
- gdk_draw_line (window, gc1,
- x + width - 2, y + height - 1,
- x + width - 2, y + 1);
- gdk_draw_line (window, gc3,
- x + width - 1, y + height - 1,
- x + width - 1, y);
-
- gdk_draw_line (window, gc4,
- x + width - 1, y + 1,
- x + 1, y + half_height);
- gdk_draw_line (window, gc2,
- x + width - 1, y,
- x, y + half_height);
- break;
-
- case GTK_SHADOW_ETCHED_IN:
- case GTK_SHADOW_ETCHED_OUT:
- gdk_draw_line (window, gc1,
- x + width - 1, y + 1,
- x + 1, y + half_height);
- gdk_draw_line (window, gc1,
- x + 1, y + half_height + 1,
- x + width - 1, y + height - 1);
- gdk_draw_line (window, gc1,
- x + width - 1, y + height - 1,
- x + width - 1, y + 1);
-
- points[0].x = x + width - 2;
- points[0].y = y;
- points[1].x = x;
- points[1].y = y + half_height;
- points[2].x = x + width - 2;
- points[2].y = y + height - 2;
-
- gdk_draw_polygon (window, gc2, FALSE, points, 3);
- break;
-
- default:
- break;
- }
- break;
- case GTK_ARROW_RIGHT:
- if (fill)
- {
- points[0].x = x + width - 1;
- points[0].y = y + half_height;
- points[1].x = x;
- points[1].y = y;
- points[2].x = x;
- points[2].y = y + height - 1;
-
- gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
- }
-
- switch (shadow_type)
- {
- case GTK_SHADOW_IN:
- case GTK_SHADOW_OUT:
- gdk_draw_line (window, gc4,
- x + width - 1, y + half_height,
- x + 1, y + 1);
- gdk_draw_line (window, gc2,
- x + width - 1, y + half_height,
- x, y);
- gdk_draw_line (window, gc4,
- x + 1, y + 1,
- x + 1, y + height - 2);
- gdk_draw_line (window, gc2,
- x, y,
- x, y + height - 1);
-
- gdk_draw_line (window, gc1,
- x + 1, y + height - 2,
- x + width - 1, y + half_height);
- gdk_draw_line (window, gc3,
- x, y + height - 1,
- x + width - 1, y + half_height);
- break;
-
- case GTK_SHADOW_ETCHED_IN:
+ {
+ points[0].x = x;
+ points[0].y = y + half_height;
+ points[1].x = x + width - 1;
+ points[1].y = y + height - 1;
+ points[2].x = x + width - 1;
+ points[2].y = y;
+
+ gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+ }
+
+ switch (shadow_type)
+ {
+ case GTK_SHADOW_IN:
+ case GTK_SHADOW_OUT:
+ gdk_draw_line (window, gc1,
+ x + 1, y + half_height,
+ x + width - 1, y + height - 1);
+ gdk_draw_line (window, gc3,
+ x, y + half_height,
+ x + width - 1, y + height - 1);
+
+ gdk_draw_line (window, gc1,
+ x + width - 2, y + height - 1,
+ x + width - 2, y + 1);
+ gdk_draw_line (window, gc3,
+ x + width - 1, y + height - 1,
+ x + width - 1, y);
+
+ gdk_draw_line (window, gc4,
+ x + width - 1, y + 1,
+ x + 1, y + half_height);
+ gdk_draw_line (window, gc2,
+ x + width - 1, y,
+ x, y + half_height);
+ break;
+
+ case GTK_SHADOW_ETCHED_IN:
- gdk_draw_line (window, gc1,
- x + width - 1, y + half_height + 1,
- x + 1, y + 1);
- gdk_draw_line (window, gc1,
- x + 1, y + 1,
- x + 1, y + height - 1);
- gdk_draw_line (window, gc1,
- x + 1, y + height - 1,
- x + width - 1, y + half_height + 1);
-
- points[0].x = x + width - 2;
- points[0].y = y + half_height;
- points[1].x = x;
- points[1].y = y;
- points[2].x = x;
- points[2].y = y + height - 1;
-
- gdk_draw_polygon (window, gc2, FALSE, points, 3);
- break;
-
- default:
- break;
- }
- break;
- }
- if (area)
- {
- gdk_gc_set_clip_rectangle (gc1, NULL);
- gdk_gc_set_clip_rectangle (gc2, NULL);
- if (gc3)
- {
- gdk_gc_set_clip_rectangle (gc3, NULL);
- gdk_gc_set_clip_rectangle (gc4, NULL);
- }
- }
+ gdk_draw_line (window, gc1,
+ x + width - 1, y + 1,
+ x + 1, y + half_height);
+ gdk_draw_line (window, gc1,
+ x + 1, y + half_height + 1,
+ x + width - 1, y + height - 1);
+ gdk_draw_line (window, gc1,
+ x + width - 1, y + height - 1,
+ x + width - 1, y + 1);
+
+ points[0].x = x + width - 2;
+ points[0].y = y;
+ points[1].x = x;
+ points[1].y = y + half_height;
+ points[2].x = x + width - 2;
+ points[2].y = y + height - 2;
+
+ gdk_draw_polygon (window, gc2, FALSE, points, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
+ case GTK_ARROW_RIGHT:
+ if (fill)
+ {
+ points[0].x = x + width - 1;
+ points[0].y = y + half_height;
+ points[1].x = x;
+ points[1].y = y;
+ points[2].x = x;
+ points[2].y = y + height - 1;
+
+ gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+ }
+
+ switch (shadow_type)
+ {
+ case GTK_SHADOW_IN:
+ case GTK_SHADOW_OUT:
+ gdk_draw_line (window, gc4,
+ x + width - 1, y + half_height,
+ x + 1, y + 1);
+ gdk_draw_line (window, gc2,
+ x + width - 1, y + half_height,
+ x, y);
+ gdk_draw_line (window, gc4,
+ x + 1, y + 1,
+ x + 1, y + height - 2);
+ gdk_draw_line (window, gc2,
+ x, y,
+ x, y + height - 1);
+
+ gdk_draw_line (window, gc1,
+ x + 1, y + height - 2,
+ x + width - 1, y + half_height);
+ gdk_draw_line (window, gc3,
+ x, y + height - 1,
+ x + width - 1, y + half_height);
+ break;
+
+ case GTK_SHADOW_ETCHED_IN:
+ case GTK_SHADOW_ETCHED_OUT:
+ gdk_draw_line (window, gc1,
+ x + width - 1, y + half_height + 1,
+ x + 1, y + 1);
+ gdk_draw_line (window, gc1,
+ x + 1, y + 1,
+ x + 1, y + height - 1);
+ gdk_draw_line (window, gc1,
+ x + 1, y + height - 1,
+ x + width - 1, y + half_height + 1);
+
+ points[0].x = x + width - 2;
+ points[0].y = y + half_height;
+ points[1].x = x;
+ points[1].y = y;
+ points[2].x = x;
+ points[2].y = y + height - 1;
+
+ gdk_draw_polygon (window, gc2, FALSE, points, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
+ }
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (gc1, NULL);
+ gdk_gc_set_clip_rectangle (gc2, NULL);
+ if (gc3)
+ {
+ gdk_gc_set_clip_rectangle (gc3, NULL);
+ gdk_gc_set_clip_rectangle (gc4, NULL);
+ }
+ }
- gint half_width;
- gint half_height;
-
- g_return_if_fail (style != NULL);
- g_return_if_fail (window != NULL);
-
- if ((width == -1) && (height == -1))
- gdk_window_get_size (window, &width, &height);
- else if (width == -1)
- gdk_window_get_size (window, &width, NULL);
- else if (height == -1)
- gdk_window_get_size (window, NULL, &height);
-
- half_width = width / 2;
- half_height = height / 2;
-
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
- gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
- gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
- gdk_gc_set_clip_rectangle (style->black_gc, area);
- }
- switch (shadow_type)
- {
- case GTK_SHADOW_IN:
- gdk_draw_line (window, style->bg_gc[state_type],
- x + 2, y + half_height,
- x + half_width, y + height - 2);
- gdk_draw_line (window, style->bg_gc[state_type],
- x + half_width, y + height - 2,
- x + width - 2, y + half_height);
- gdk_draw_line (window, style->light_gc[state_type],
- x + 1, y + half_height,
- x + half_width, y + height - 1);
- gdk_draw_line (window, style->light_gc[state_type],
- x + half_width, y + height - 1,
- x + width - 1, y + half_height);
- gdk_draw_line (window, style->light_gc[state_type],
- x, y + half_height,
- x + half_width, y + height);
- gdk_draw_line (window, style->light_gc[state_type],
- x + half_width, y + height,
+ gint half_width;
+ gint half_height;
+
+ g_return_if_fail (style != NULL);
+ g_return_if_fail (window != NULL);
+
+ if ((width == -1) && (height == -1))
+ gdk_window_get_size (window, &width, &height);
+ else if (width == -1)
+ gdk_window_get_size (window, &width, NULL);
+ else if (height == -1)
+ gdk_window_get_size (window, NULL, &height);
+
+ half_width = width / 2;
+ half_height = height / 2;
+
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
+ gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
+ gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
+ gdk_gc_set_clip_rectangle (style->black_gc, area);
+ }
+ switch (shadow_type)
+ {
+ case GTK_SHADOW_IN:
+ gdk_draw_line (window, style->bg_gc[state_type],
+ x + 2, y + half_height,
+ x + half_width, y + height - 2);
+ gdk_draw_line (window, style->bg_gc[state_type],
+ x + half_width, y + height - 2,
+ x + width - 2, y + half_height);
+ gdk_draw_line (window, style->light_gc[state_type],
+ x + 1, y + half_height,
+ x + half_width, y + height - 1);
+ gdk_draw_line (window, style->light_gc[state_type],
+ x + half_width, y + height - 1,
+ x + width - 1, y + half_height);
+ gdk_draw_line (window, style->light_gc[state_type],
+ x, y + half_height,
+ x + half_width, y + height);
+ gdk_draw_line (window, style->light_gc[state_type],
+ x + half_width, y + height,
- gdk_draw_line (window, style->dark_gc[state_type],
- x + half_width, y + 1,
- x + width - 1, y + half_height);
- gdk_draw_line (window, style->dark_gc[state_type],
- x, y + half_height,
- x + half_width, y);
- gdk_draw_line (window, style->dark_gc[state_type],
- x + half_width, y,
- x + width, y + half_height);
- break;
- case GTK_SHADOW_OUT:
- gdk_draw_line (window, style->dark_gc[state_type],
- x + 2, y + half_height,
- x + half_width, y + height - 2);
- gdk_draw_line (window, style->dark_gc[state_type],
- x + half_width, y + height - 2,
- x + width - 2, y + half_height);
- gdk_draw_line (window, style->dark_gc[state_type],
- x + 1, y + half_height,
- x + half_width, y + height - 1);
- gdk_draw_line (window, style->dark_gc[state_type],
- x + half_width, y + height - 1,
- x + width - 1, y + half_height);
- gdk_draw_line (window, style->black_gc,
- x, y + half_height,
- x + half_width, y + height);
- gdk_draw_line (window, style->black_gc,
- x + half_width, y + height,
- x + width, y + half_height);
-
- gdk_draw_line (window, style->bg_gc[state_type],
- x + 2, y + half_height,
- x + half_width, y + 2);
- gdk_draw_line (window, style->bg_gc[state_type],
- x + half_width, y + 2,
- x + width - 2, y + half_height);
- gdk_draw_line (window, style->light_gc[state_type],
- x + 1, y + half_height,
- x + half_width, y + 1);
- gdk_draw_line (window, style->light_gc[state_type],
- x + half_width, y + 1,
+ gdk_draw_line (window, style->dark_gc[state_type],
+ x + half_width, y + 1,
+ x + width - 1, y + half_height);
+ gdk_draw_line (window, style->dark_gc[state_type],
+ x, y + half_height,
+ x + half_width, y);
+ gdk_draw_line (window, style->dark_gc[state_type],
+ x + half_width, y,
+ x + width, y + half_height);
+ break;
+ case GTK_SHADOW_OUT:
+ gdk_draw_line (window, style->dark_gc[state_type],
+ x + 2, y + half_height,
+ x + half_width, y + height - 2);
+ gdk_draw_line (window, style->dark_gc[state_type],
+ x + half_width, y + height - 2,
+ x + width - 2, y + half_height);
+ gdk_draw_line (window, style->dark_gc[state_type],
+ x + 1, y + half_height,
+ x + half_width, y + height - 1);
+ gdk_draw_line (window, style->dark_gc[state_type],
+ x + half_width, y + height - 1,
+ x + width - 1, y + half_height);
+ gdk_draw_line (window, style->black_gc,
+ x, y + half_height,
+ x + half_width, y + height);
+ gdk_draw_line (window, style->black_gc,
+ x + half_width, y + height,
+ x + width, y + half_height);
+
+ gdk_draw_line (window, style->bg_gc[state_type],
+ x + 2, y + half_height,
+ x + half_width, y + 2);
+ gdk_draw_line (window, style->bg_gc[state_type],
+ x + half_width, y + 2,
+ x + width - 2, y + half_height);
+ gdk_draw_line (window, style->light_gc[state_type],
+ x + 1, y + half_height,
+ x + half_width, y + 1);
+ gdk_draw_line (window, style->light_gc[state_type],
+ x + half_width, y + 1,
-
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->white_gc, area);
- gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area);
- }
- if (state_type == GTK_STATE_INSENSITIVE)
- gdk_draw_string (window, style->font, style->white_gc, x + 1, y + 1, string);
- gdk_draw_string (window, style->font, style->fg_gc[state_type], x, y, string);
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->white_gc, NULL);
- gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL);
- }
+
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (style->white_gc, area);
+ gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area);
+ }
+ if (state_type == GTK_STATE_INSENSITIVE)
+ gdk_draw_string (window, style->font, style->white_gc, x + 1, y + 1, string);
+ gdk_draw_string (window, style->font, style->fg_gc[state_type], x, y, string);
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (style->white_gc, NULL);
+ gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL);
+ }
- g_return_if_fail (style != NULL);
- g_return_if_fail (window != NULL);
-
- if ((width == -1) && (height == -1))
- {
- gdk_window_get_size (window, &width, &height);
- width -= 1;
- height -= 1;
- }
- else if (width == -1)
- {
- gdk_window_get_size (window, &width, NULL);
- width -= 1;
- }
- else if (height == -1)
- {
- gdk_window_get_size (window, NULL, &height);
- height -= 1;
- }
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->black_gc, area);
- }
- if (detail && !strcmp (detail, "add-mode"))
- {
- gdk_gc_set_line_attributes (style->black_gc, 1, GDK_LINE_ON_OFF_DASH, 0, 0);
- gdk_gc_set_dashes (style->black_gc, 0, "\4\4", 2);
-
- gdk_draw_rectangle (window,
- style->black_gc, FALSE,
- x, y, width, height);
-
- gdk_gc_set_line_attributes (style->black_gc, 1, GDK_LINE_SOLID, 0, 0);
- }
- else
- {
- gdk_draw_rectangle (window,
- style->black_gc, FALSE,
- x, y, width, height);
- }
- if (area)
- {
- gdk_gc_set_clip_rectangle (style->black_gc, NULL);
- }
+ g_return_if_fail (style != NULL);
+ g_return_if_fail (window != NULL);
+
+ if ((width == -1) && (height == -1))
+ {
+ gdk_window_get_size (window, &width, &height);
+ width -= 1;
+ height -= 1;
+ }
+ else if (width == -1)
+ {
+ gdk_window_get_size (window, &width, NULL);
+ width -= 1;
+ }
+ else if (height == -1)
+ {
+ gdk_window_get_size (window, NULL, &height);
+ height -= 1;
+ }
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (style->black_gc, area);
+ }
+ if (detail && !strcmp (detail, "add-mode"))
+ {
+ gdk_gc_set_line_attributes (style->black_gc, 1, GDK_LINE_ON_OFF_DASH, 0, 0);
+ gdk_gc_set_dashes (style->black_gc, 0, "\4\4", 2);
+
+ gdk_draw_rectangle (window,
+ style->black_gc, FALSE,
+ x, y, width, height);
+
+ gdk_gc_set_line_attributes (style->black_gc, 1, GDK_LINE_SOLID, 0, 0);
+ }
+ else
+ {
+ gdk_draw_rectangle (window,
+ style->black_gc, FALSE,
+ x, y, width, height);
+ }
+ if (area)
+ {
+ gdk_gc_set_clip_rectangle (style->black_gc, NULL);
+ }
- g_return_if_fail (style != NULL);
- g_return_if_fail (window != NULL);
-
- if ((width == -1) && (height == -1))
- gdk_window_get_size (window, &width, &height);
- else if (width == -1)
- gdk_window_get_size (window, &width, NULL);
- else if (height == -1)
- gdk_window_get_size (window, NULL, &height);
-
- gtk_paint_box (style, window, state_type, shadow_type,
- area, widget, detail, x, y, width, height);
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_paint_vline (style, window, state_type, area, widget, detail,
+ g_return_if_fail (style != NULL);
+ g_return_if_fail (window != NULL);
+
+ if ((width == -1) && (height == -1))
+ gdk_window_get_size (window, &width, &height);
+ else if (width == -1)
+ gdk_window_get_size (window, &width, NULL);
+ else if (height == -1)
+ gdk_window_get_size (window, NULL, &height);
+
+ gtk_paint_box (style, window, state_type, shadow_type,
+ area, widget, detail, x, y, width, height);
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ gtk_paint_vline (style, window, state_type, area, widget, detail,
- gint xx, yy;
- gint xthick, ythick;
- GdkGC *light_gc, *dark_gc;
- GdkRectangle dest;
-
- g_return_if_fail (style != NULL);
- g_return_if_fail (window != NULL);
-
- if ((width == -1) && (height == -1))
- gdk_window_get_size (window, &width, &height);
- else if (width == -1)
- gdk_window_get_size (window, &width, NULL);
- else if (height == -1)
- gdk_window_get_size (window, NULL, &height);
-
- gtk_paint_box (style, window, state_type, shadow_type, area, widget,
- detail, x, y, width, height);
-
- light_gc = style->light_gc[state_type];
- dark_gc = style->dark_gc[state_type];
-
- xthick = style->klass->xthickness;
- ythick = style->klass->ythickness;
-
- dest.x = x + xthick;
- dest.y = y + ythick;
- dest.width = width - (xthick * 2);
- dest.height = height - (ythick * 2);
-
- gdk_gc_set_clip_rectangle (light_gc, &dest);
- gdk_gc_set_clip_rectangle (dark_gc, &dest);
-
- for (yy = y + ythick; yy < (y + height - ythick); yy += 3)
- for (xx = x + xthick; xx < (x + width - xthick); xx += 6)
- {
+ gint xx, yy;
+ gint xthick, ythick;
+ GdkGC *light_gc, *dark_gc;
+ GdkRectangle dest;
+
+ g_return_if_fail (style != NULL);
+ g_return_if_fail (window != NULL);
+
+ if ((width == -1) && (height == -1))
+ gdk_window_get_size (window, &width, &height);
+ else if (width == -1)
+ gdk_window_get_size (window, &width, NULL);
+ else if (height == -1)
+ gdk_window_get_size (window, NULL, &height);
+
+ gtk_paint_box (style, window, state_type, shadow_type, area, widget,
+ detail, x, y, width, height);
+
+ light_gc = style->light_gc[state_type];
+ dark_gc = style->dark_gc[state_type];
+
+ xthick = style->klass->xthickness;
+ ythick = style->klass->ythickness;
+
+ dest.x = x + xthick;
+ dest.y = y + ythick;
+ dest.width = width - (xthick * 2);
+ dest.height = height - (ythick * 2);
+
+ gdk_gc_set_clip_rectangle (light_gc, &dest);
+ gdk_gc_set_clip_rectangle (dark_gc, &dest);
+
+ for (yy = y + ythick; yy < (y + height - ythick); yy += 3)
+ for (xx = x + xthick; xx < (x + width - xthick); xx += 6)
+ {