summaryrefslogtreecommitdiff
path: root/src/ui/draw-workspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/draw-workspace.c')
-rw-r--r--src/ui/draw-workspace.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/src/ui/draw-workspace.c b/src/ui/draw-workspace.c
index 694dcae1..bec502a5 100644
--- a/src/ui/draw-workspace.c
+++ b/src/ui/draw-workspace.c
@@ -88,42 +88,24 @@ get_background_color (GtkStyleContext *context,
static void
draw_window (GtkWidget *widget,
- #if GTK_CHECK_VERSION(3, 0, 0)
cairo_t *cr,
- #else
- GdkDrawable *drawable,
- #endif
const WnckWindowDisplayInfo *win,
const GdkRectangle *winrect,
GtkStateType state)
{
- #if !GTK_CHECK_VERSION(3, 0, 0)
- cairo_t *cr;
- #endif
-
GdkPixbuf *icon;
int icon_x, icon_y, icon_w, icon_h;
gboolean is_active;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
GtkStyleContext *style;
-#else
- GdkColor *color;
- GtkStyle *style;
-#endif
is_active = win->is_active;
- #if GTK_CHECK_VERSION(3, 0, 0)
cairo_save (cr);
- #else
- cr = gdk_cairo_create (drawable);
- #endif
cairo_rectangle (cr, winrect->x, winrect->y, winrect->width, winrect->height);
cairo_clip (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
style = gtk_widget_get_style_context (widget);
if (is_active)
meta_gtk_style_get_light_color (style, state, &color);
@@ -134,17 +116,6 @@ draw_window (GtkWidget *widget,
gtk_style_context_get_background_color (style, state, &color);
#endif
gdk_cairo_set_source_rgba (cr, &color);
-#else
- style = gtk_widget_get_style (widget);
- if (is_active)
- color = &style->light[state];
- else
- color = &style->bg[state];
- cairo_set_source_rgb (cr,
- color->red / 65535.,
- color->green / 65535.,
- color->blue / 65535.);
-#endif
cairo_rectangle (cr,
winrect->x + 1, winrect->y + 1,
@@ -195,37 +166,21 @@ draw_window (GtkWidget *widget,
cairo_restore (cr);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_style_context_get_color (style, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
-#else
- color = &style->fg[state];
- cairo_set_source_rgb (cr,
- color->red / 65535.,
- color->green / 65535.,
- color->blue / 65535.);
-#endif
cairo_set_line_width (cr, 1.0);
cairo_rectangle (cr,
winrect->x + 0.5, winrect->y + 0.5,
MAX (0, winrect->width - 1), MAX (0, winrect->height - 1));
cairo_stroke (cr);
- #if GTK_CHECK_VERSION(3, 0, 0)
cairo_restore(cr);
- #else
- cairo_destroy (cr);
- #endif
}
void
wnck_draw_workspace (GtkWidget *widget,
- #if GTK_CHECK_VERSION(3, 0, 0)
cairo_t *cr,
- #else
- GdkDrawable *drawable,
- #endif
int x,
int y,
int width,
@@ -239,13 +194,8 @@ wnck_draw_workspace (GtkWidget *widget,
{
int i;
GdkRectangle workspace_rect;
-#if GTK_CHECK_VERSION(3, 0, 0)
GtkStateFlags state;
GtkStyleContext *style;
-#else
- GtkStateType state;
- cairo_t *cr;
-#endif
workspace_rect.x = x;
workspace_rect.y = y;
@@ -253,30 +203,14 @@ wnck_draw_workspace (GtkWidget *widget,
workspace_rect.height = height;
if (is_active)
-#if GTK_CHECK_VERSION (3, 0, 0)
state = GTK_STATE_FLAG_SELECTED;
-#else
- state = GTK_STATE_SELECTED;
-#endif
else if (workspace_background)
-#if GTK_CHECK_VERSION (3, 0, 0)
state = GTK_STATE_FLAG_PRELIGHT;
-#else
- state = GTK_STATE_PRELIGHT;
-#endif
else
-#if GTK_CHECK_VERSION (3, 0, 0)
state = GTK_STATE_FLAG_NORMAL;
-#else
- state = GTK_STATE_NORMAL;
-#endif
- #if GTK_CHECK_VERSION(3, 0, 0)
style = gtk_widget_get_style_context (widget);
cairo_save (cr);
- #else
- cr = gdk_cairo_create (drawable);
- #endif
if (workspace_background)
{
@@ -285,22 +219,14 @@ wnck_draw_workspace (GtkWidget *widget,
}
else
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
meta_gtk_style_get_dark_color (style,state, &color);
gdk_cairo_set_source_rgba (cr, &color);
-#else
- gdk_cairo_set_source_color (cr, &gtk_widget_get_style (widget)->dark[state]);
-#endif
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
}
- #if !GTK_CHECK_VERSION(3, 0, 0)
- cairo_destroy (cr);
- #endif
-
i = 0;
while (i < n_windows)
{
@@ -311,11 +237,7 @@ wnck_draw_workspace (GtkWidget *widget,
screen_height, &workspace_rect, &winrect);
draw_window (widget,
- #if GTK_CHECK_VERSION(3, 0, 0)
cr,
- #else
- drawable,
- #endif
win,
&winrect,
state);
@@ -323,7 +245,5 @@ wnck_draw_workspace (GtkWidget *widget,
++i;
}
- #if GTK_CHECK_VERSION(3, 0, 0)
cairo_restore(cr);
- #endif
}