summaryrefslogtreecommitdiff
path: root/typing-break/drw-utils.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-12-02 00:45:36 +0300
committermonsta <[email protected]>2016-12-02 00:50:14 +0300
commit0c27d18ab5efb721a2f02549767016c81fc6ce2c (patch)
tree76b7b89cface072e011a3757a833e9090bab44f2 /typing-break/drw-utils.c
parent1aa83d45ebf9599c6d4d3f47211c3961282e98f0 (diff)
downloadmate-control-center-0c27d18ab5efb721a2f02549767016c81fc6ce2c.tar.bz2
mate-control-center-0c27d18ab5efb721a2f02549767016c81fc6ce2c.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require libmatekbd, libmate-desktop, marco, m-s-d >= 1.17
Diffstat (limited to 'typing-break/drw-utils.c')
-rw-r--r--typing-break/drw-utils.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/typing-break/drw-utils.c b/typing-break/drw-utils.c
index 5c28db98..974f47ac 100644
--- a/typing-break/drw-utils.c
+++ b/typing-break/drw-utils.c
@@ -90,44 +90,15 @@ create_tile_pixbuf (GdkPixbuf *dest_pixbuf,
}
static gboolean
-#if GTK_CHECK_VERSION (3, 0, 0)
window_draw_event (GtkWidget *widget,
cairo_t *cr,
-#else
-window_expose_event (GtkWidget *widget,
- GdkEventExpose *event,
-#endif
gpointer data)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *context;
- cairo_t *cr;
- cairo_surface_t *surface;
-#endif
int width;
int height;
gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- context = gdk_cairo_create (gtk_widget_get_window (widget));
-
- cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
-
- surface = cairo_surface_create_similar (cairo_get_target (context),
- CAIRO_CONTENT_COLOR_ALPHA,
- width,
- height);
-
- if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) {
- goto done;
- }
-
- cr = cairo_create (surface);
- if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
- goto done;
- }
-#endif
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_paint (cr);
@@ -137,18 +108,6 @@ window_expose_event (GtkWidget *widget,
cairo_set_source_rgba (cr, 0.2, 0.2, 0.2, 0.5);
cairo_fill (cr);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_destroy (cr);
-
- cairo_set_source_surface (context, surface, 0, 0);
- cairo_paint (context);
- done:
- if (surface != NULL) {
- cairo_surface_destroy (surface);
- }
- cairo_destroy (context);
-#endif
-
return FALSE;
}
@@ -168,21 +127,10 @@ set_pixmap_background (GtkWidget *window)
width = gdk_screen_get_width (screen);
height = gdk_screen_get_height (screen);
-#if GTK_CHECK_VERSION (3, 0, 0)
tmp_pixbuf = gdk_pixbuf_get_from_window (gdk_screen_get_root_window (screen),
0,
0,
width, height);
-#else
- tmp_pixbuf = gdk_pixbuf_get_from_drawable (NULL,
- gdk_screen_get_root_window (screen),
- gdk_screen_get_system_colormap (screen),
- 0,
- 0,
- 0,
- 0,
- width, height);
-#endif
pixbuf = gdk_pixbuf_new_from_file (IMAGEDIR "/ocean-stripes.png", NULL);
@@ -231,31 +179,13 @@ void
drw_setup_background (GtkWidget *window)
{
GdkScreen *screen;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkColormap *colormap;
-#endif
gboolean is_composited;
screen = gtk_widget_get_screen (window);
-#if GTK_CHECK_VERSION (3, 0, 0)
is_composited = gdk_screen_is_composited (screen);
-#else
- colormap = gdk_screen_get_rgba_colormap (screen);
-
- if (colormap != NULL && gdk_screen_is_composited (screen)) {
- gtk_widget_set_colormap (GTK_WIDGET (window), colormap);
- is_composited = TRUE;
- } else {
- is_composited = FALSE;
- }
-#endif
if (is_composited) {
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect (window, "draw", G_CALLBACK (window_draw_event), window);
-#else
- g_signal_connect (window, "expose-event", G_CALLBACK (window_expose_event), window);
-#endif
} else {
set_pixmap_background (window);
}