changeset 8786:f3d063680a45

[gaim-migrate @ 9548] Tim "marv" Ringenbach brazenly busted Gtk2.0 compatability, but then he amicably fixed it. That's the kind of crazy patch-writing we like to see. Only maybe next time it can be before release, and not after. ;-) committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Sat, 24 Apr 2004 00:45:58 +0000
parents a871dec1c9d6
children 163199223fb9
files ChangeLog src/gtkimhtml.c
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Apr 24 00:28:39 2004 +0000
+++ b/ChangeLog	Sat Apr 24 00:45:58 2004 +0000
@@ -10,6 +10,7 @@
 	* Compiles again with gcc 2.96 (Ignacio J. Elia)
 	* Dialogs opened from a conversation window are now closed when
 	  the conversation window is closed, preventing a crash (Kevin Stange)
+        * Gtk2.0 compatability fixes (Tim Ringenbach)
 
 version 0.77 (04/22/2004):
 	New Features:
--- a/src/gtkimhtml.c	Sat Apr 24 00:28:39 2004 +0000
+++ b/src/gtkimhtml.c	Sat Apr 24 00:45:58 2004 +0000
@@ -66,6 +66,11 @@
 
 #define TOOLTIP_TIMEOUT 500
 
+/* GTK+ 2.0 hack */
+#if (!GTK_CHECK_VERSION(2,2,0))
+#define gtk_widget_get_clipboard(x, y) gtk_clipboard_get(y)
+#endif
+
 static void preinsert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml);
 static void insert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml);
 static gboolean gtk_imhtml_is_amp_escape (const gchar *string, gchar **replace, gint *length);
@@ -536,7 +541,6 @@
 	return FALSE;
 }
 
-#if GTK_CHECK_VERSION(2,2,0)
 static void gtk_imhtml_clipboard_get(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, GtkIMHtml *imhtml) {
 	char *text;
 	gboolean primary;
@@ -806,7 +810,6 @@
 	gtk_text_buffer_add_selection_clipboard(GTK_IMHTML(imhtml)->text_buffer,
 	                                        gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_PRIMARY));
 }
-#endif
 
 static void mark_set_so_update_selection_cb(GtkTextBuffer *buffer, GtkTextIter *arg1, GtkTextMark *mark, GtkIMHtml *imhtml)
 {
@@ -989,14 +992,12 @@
 			  GDK_ACTION_COPY);
 	g_signal_connect(G_OBJECT(imhtml), "drag_data_received", G_CALLBACK(gtk_imhtml_link_drag_rcv_cb), imhtml);
 
-#if GTK_CHECK_VERSION(2,2,0)
 	g_signal_connect(G_OBJECT(imhtml), "copy-clipboard", G_CALLBACK(copy_clipboard_cb), NULL);
 	g_signal_connect(G_OBJECT(imhtml), "cut-clipboard", G_CALLBACK(cut_clipboard_cb), NULL);
 	g_signal_connect(G_OBJECT(imhtml), "paste-clipboard", G_CALLBACK(paste_clipboard_cb), NULL);
 	//g_signal_connect_after(G_OBJECT(imhtml), "button-release-event", G_CALLBACK(button_release_cb), imhtml);
 	g_signal_connect_after(G_OBJECT(imhtml), "realize", G_CALLBACK(imhtml_realized_remove_primary), NULL);
 	g_signal_connect(G_OBJECT(imhtml), "unrealize", G_CALLBACK(imhtml_destroy_add_primary), NULL);
-#endif                                                                             
 
 	g_signal_connect_after(G_OBJECT(GTK_IMHTML(imhtml)->text_buffer), "mark-set",
 		               G_CALLBACK(mark_set_so_update_selection_cb), imhtml);