diff options
author | Chris Toshok <toshok@ximian.com> | 2003-04-03 15:55:09 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-04-03 15:55:09 +0800 |
commit | 8045179fe84e6da2071f4c1ff50da1e2c73c116c (patch) | |
tree | e9419d6d645690e74a0e59d4dd3a876f0ba02c53 /widgets/text/e-text.c | |
parent | edc0d3e040c037689cf6fb1c7fca70becf3e4f61 (diff) | |
download | gsoc2013-evolution-8045179fe84e6da2071f4c1ff50da1e2c73c116c.tar.gz gsoc2013-evolution-8045179fe84e6da2071f4c1ff50da1e2c73c116c.tar.zst gsoc2013-evolution-8045179fe84e6da2071f4c1ff50da1e2c73c116c.zip |
ifdef gtk_widget_get_clipboard since we need to build against gtk 2.0.
2003-04-02 Chris Toshok <toshok@ximian.com>
* gal/e-text/e-text.c (e_text_copy_clipboard): ifdef
gtk_widget_get_clipboard since we need to build against gtk 2.0.
(e_text_update_primary_selection): same.
(e_text_paste): same.
(e_text_do_popup): same.
svn path=/trunk/; revision=20657
Diffstat (limited to 'widgets/text/e-text.c')
-rw-r--r-- | widgets/text/e-text.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 2800baac3e..a8d4c4509b 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -2323,8 +2323,13 @@ e_text_copy_clipboard (EText *text) str = g_strndup (text->text + selection_start_pos, selection_end_pos - selection_start_pos); - gtk_clipboard_set_text (gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + gtk_clipboard_set_text ( +#ifdef GTK_2_2 + gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), GDK_SELECTION_CLIPBOARD), +#else + gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), +#endif str, -1); g_free (str); } @@ -2417,7 +2422,11 @@ e_text_update_primary_selection (EText *text) }; GtkClipboard *clipboard; +#ifdef GTK_2_2 clipboard = gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), GDK_SELECTION_PRIMARY); +#else + clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY); +#endif if (text->selection_start != text->selection_end) { if (!gtk_clipboard_set_with_owner (clipboard, targets, G_N_ELEMENTS (targets), @@ -2451,8 +2460,14 @@ static void e_text_paste (EText *text, GdkAtom selection) { g_object_ref (text); - gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + gtk_clipboard_request_text ( +#ifdef GTK_2_2 + + gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), selection), +#else + gtk_clipboard_get (selection), +#endif paste_received, text); } @@ -2556,8 +2571,14 @@ e_text_do_popup (EText *text, GdkEventButton *button, int position) closure->button = button; closure->position = position; - gtk_clipboard_request_contents (gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + gtk_clipboard_request_contents ( +#ifdef GTK_2_2 + + gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), GDK_SELECTION_CLIPBOARD), +#else + gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), +#endif gdk_atom_intern ("TARGETS", FALSE), popup_targets_received, closure); |