[krb5-auth-dialog] Use cairo_region_t instead of GdkRegion
- From: Guido Günther <guidog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [krb5-auth-dialog] Use cairo_region_t instead of GdkRegion
- Date: Thu, 1 Jul 2010 19:34:09 +0000 (UTC)
commit d7946754b453e4facaa03ddf3c6be41333f06244
Author: Guido Günther <agx sigxcpu org>
Date: Wed Jun 30 21:46:31 2010 +0200
Use cairo_region_t instead of GdkRegion
the later doesn't exist in GTK+3
gtksecentry/gtksecentry.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gtksecentry/gtksecentry.c b/gtksecentry/gtksecentry.c
index 177eab8..f68f094 100644
--- a/gtksecentry/gtksecentry.c
+++ b/gtksecentry/gtksecentry.c
@@ -2317,7 +2317,11 @@ gtk_secure_entry_draw_text(GtkSecureEntry * entry)
g_utf8_offset_to_pointer(text, start_pos) - text;
gint end_index =
g_utf8_offset_to_pointer(text, end_pos) - text;
+#if GTK_CHECK_VERSION(2, 90, 5)
+ cairo_region_t *clip_region = cairo_region_create();
+#else
GdkRegion *clip_region = gdk_region_new();
+#endif
GdkGC *text_gc;
GdkGC *selection_gc;
@@ -2350,15 +2354,22 @@ gtk_secure_entry_draw_text(GtkSecureEntry * entry)
gdk_draw_rectangle(entry->text_area, selection_gc, TRUE,
rect.x, rect.y, rect.width,
rect.height);
-
+#if GTK_CHECK_VERSION(2, 90, 5)
+ cairo_region_union_rectangle (clip_region, &rect);
+#else
gdk_region_union_with_rect(clip_region, &rect);
+#endif
}
gdk_gc_set_clip_region(text_gc, clip_region);
gdk_draw_layout(entry->text_area, text_gc, x, y, layout);
gdk_gc_set_clip_region(text_gc, NULL);
+#if GTK_CHECK_VERSION(2, 90, 5)
+ cairo_region_destroy(clip_region);
+#else
gdk_region_destroy(clip_region);
+#endif
g_free(ranges);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]