summaryrefslogtreecommitdiff
path: root/eel/eel-editable-label.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-31 07:16:33 +0200
committerJasmine Hassan <[email protected]>2012-11-02 16:25:25 +0200
commitea7bc87871154c2239f25d84191add2d4b630022 (patch)
treecc0b5ae5daec37c715d4cfa3f60eea8be72b7811 /eel/eel-editable-label.c
parentec92a520965f420af7d00ad8e347f62106bbc578 (diff)
downloadcaja-ea7bc87871154c2239f25d84191add2d4b630022.tar.bz2
caja-ea7bc87871154c2239f25d84191add2d4b630022.tar.xz
[eel] Use GdkRegion on GTK2, cairo_region_t on GTK3
http://git.gnome.org/browse/nautilus/commit/?id=3b671558f1d8ac1ee72e8af13d4ede6ab549a400
Diffstat (limited to 'eel/eel-editable-label.c')
-rw-r--r--eel/eel-editable-label.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 7780fe7f..2c7ea7b0 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -37,6 +37,12 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+/* Some compatibility defines to let us build on both Gtk2 and Gtk3 */
+#if !GTK_CHECK_VERSION (3, 0, 0)
+#define cairo_region_t GdkRegion
+#define cairo_region_destroy gdk_region_destroy
+#endif
+
enum
{
MOVE_CURSOR,
@@ -1580,7 +1586,7 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, gint xoffset, gint yof
}
else /* Block cursor */
{
- GdkRegion *clip;
+ cairo_region_t *clip;
gdk_draw_rectangle (gtk_widget_get_window (widget), label->primary_cursor_gc, TRUE,
xoffset + PANGO_PIXELS (strong_pos.x),
@@ -1608,7 +1614,7 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, gint xoffset, gint yof
NULL);
gdk_gc_set_clip_region (label->primary_cursor_gc, NULL);
- gdk_region_destroy (clip);
+ cairo_region_destroy (clip);
}
}
}
@@ -1650,7 +1656,7 @@ eel_editable_label_expose (GtkWidget *widget,
{
gint range[2];
const char *text;
- GdkRegion *clip;
+ cairo_region_t *clip;
GtkStateType state;
range[0] = label->selection_anchor;
@@ -1695,7 +1701,7 @@ eel_editable_label_expose (GtkWidget *widget,
&style->base[state]);
gdk_gc_set_clip_region (style->black_gc, NULL);
- gdk_region_destroy (clip);
+ cairo_region_destroy (clip);
}
else if (gtk_widget_has_focus (widget))
eel_editable_label_draw_cursor (label, x, y);