im.pidgin.pidgin.2.2.3: 55035961668e7ec8a5d3226a7ad3b46f0f5e0b5a

datallah at pidgin.im datallah at pidgin.im
Thu Oct 25 00:45:42 EDT 2007


-----------------------------------------------------------------
Revision: 55035961668e7ec8a5d3226a7ad3b46f0f5e0b5a
Ancestor: 6eb9d70596f75e6d69aa71408632a5bc08aca65b
Author: datallah at pidgin.im
Date: 2007-10-25T04:39:54
Branch: im.pidgin.pidgin.2.2.3

Modified files:
        pidgin/gtkimhtml.c

ChangeLog: 

applied changes from 19bcca8f96fcaa68dcad666f4fd3753a279184ba
             through 1d22d94af90b1e45912ef1b50960e676dd578f35

-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c	2f8838fe6822470043664e2ca164fdd6101f7354
+++ pidgin/gtkimhtml.c	b2a9bf7c96686dd53eeca404a8d7493b744db65d
@@ -138,7 +138,7 @@ static char *text_clipboard = NULL;
 
 static char *html_clipboard = NULL;
 static char *text_clipboard = NULL;
-GtkClipboard *clipboard_selection = NULL;
+static GtkClipboard *clipboard_selection = NULL;
 
 static GtkTargetEntry selection_targets[] = {
 #ifndef _WIN32
@@ -898,10 +898,9 @@ static void gtk_imhtml_clipboard_get(Gtk
 	char *text = NULL;
 	gboolean primary = (clipboard != clipboard_selection);
 	GtkTextIter start, end;
-	GtkTextMark *sel = NULL;
-	GtkTextMark *ins = NULL; 
 
-	if (primary) { 
+	if (primary) {
+		GtkTextMark *sel = NULL, *ins = NULL;
 		ins = gtk_text_buffer_get_insert(imhtml->text_buffer);
 		sel = gtk_text_buffer_get_selection_bound(imhtml->text_buffer);
 		gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &start, sel);
@@ -969,20 +968,16 @@ static void copy_clipboard_cb(GtkIMHtml 
 	if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, &start, &end)) {
 		if (!clipboard_selection)
 			clipboard_selection = gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD);
-		gtk_clipboard_set_with_owner(clipboard_selection,
+		gtk_clipboard_set_with_data(clipboard_selection,
 						 selection_targets, sizeof(selection_targets) / sizeof(GtkTargetEntry),
 						 (GtkClipboardGetFunc)gtk_imhtml_clipboard_get,
-						 (GtkClipboardClearFunc)gtk_imhtml_clipboard_clear, G_OBJECT(imhtml));
+						 (GtkClipboardClearFunc)gtk_imhtml_clipboard_clear, NULL);
 
 		g_free(html_clipboard);
 		g_free(text_clipboard);
 
-		imhtml->clipboard_html_string = gtk_imhtml_get_markup_range(imhtml, &start, &end);
-		imhtml->clipboard_text_string = gtk_imhtml_get_text(imhtml, &start, &end);
-
-		text_clipboard = imhtml->clipboard_text_string;
-		html_clipboard = imhtml->clipboard_html_string;
-	
+		html_clipboard = gtk_imhtml_get_markup_range(imhtml, &start, &end);
+		text_clipboard = gtk_imhtml_get_text(imhtml, &start, &end);
 	}
 
 	g_signal_stop_emission_by_name(imhtml, "copy-clipboard");
@@ -994,20 +989,17 @@ static void cut_clipboard_cb(GtkIMHtml *
 	if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, &start, &end)) {
 		if (!clipboard_selection)
 			clipboard_selection = gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD);
-		gtk_clipboard_set_with_owner(clipboard_selection,
+		gtk_clipboard_set_with_data(clipboard_selection,
 						 selection_targets, sizeof(selection_targets) / sizeof(GtkTargetEntry),
 						 (GtkClipboardGetFunc)gtk_imhtml_clipboard_get,
-						 (GtkClipboardClearFunc)gtk_imhtml_clipboard_clear, G_OBJECT(imhtml));
+						 (GtkClipboardClearFunc)gtk_imhtml_clipboard_clear, NULL);
 
 		g_free(html_clipboard);
 		g_free(text_clipboard);
 
-		imhtml->clipboard_html_string = gtk_imhtml_get_markup_range(imhtml, &start, &end);
-		imhtml->clipboard_text_string = gtk_imhtml_get_text(imhtml, &start, &end);
+		html_clipboard = gtk_imhtml_get_markup_range(imhtml, &start, &end);
+		text_clipboard = gtk_imhtml_get_text(imhtml, &start, &end);
 
-		text_clipboard = imhtml->clipboard_text_string;
-		html_clipboard = imhtml->clipboard_html_string;
-
 		if (imhtml->editable)
 			gtk_text_buffer_delete_selection(imhtml->text_buffer, FALSE, FALSE);
 	}
@@ -1269,11 +1261,6 @@ gtk_imhtml_finalize (GObject *object)
 	g_free(imhtml->search_string);
 	g_object_unref(imhtml->undo_manager);
 	G_OBJECT_CLASS(parent_class)->finalize (object);
-	if (clipboard_selection)
-		gtk_clipboard_set_with_owner(clipboard_selection,
-        	                             selection_targets, sizeof(selection_targets) / sizeof(GtkTargetEntry),
-                	                     (GtkClipboardGetFunc)gtk_imhtml_clipboard_get,
-                        	             (GtkClipboardClearFunc)NULL, G_OBJECT(imhtml));
 
 }
 
@@ -1464,9 +1451,6 @@ static void gtk_imhtml_init (GtkIMHtml *
 	gtk_widget_add_events(GTK_WIDGET(imhtml),
 			GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK);
 
-	imhtml->clipboard_text_string = NULL;
-	imhtml->clipboard_html_string = NULL;
-
 	imhtml->tip = NULL;
 	imhtml->tip_timer = 0;
 	imhtml->tip_window = NULL;


More information about the Commits mailing list