]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-view.c
Implement Edit->Copy
[evince.git] / shell / ev-view.c
index bd50b38b6c0209e428d31b159ef3ea2ead5461ac..9936ce1efb251646492a5ae35e7317005662f04c 100644 (file)
@@ -421,6 +421,19 @@ ev_view_expose_event (GtkWidget      *widget,
        return FALSE;
 }
 
+void
+ev_view_copy (EvView *ev_view)
+{
+       GtkClipboard *clipboard;
+       char *text;
+
+       text = ev_document_get_text (ev_view->document, &ev_view->selection);
+       clipboard = gtk_widget_get_clipboard (GTK_WIDGET (ev_view),
+                                             GDK_SELECTION_CLIPBOARD);
+       gtk_clipboard_set_text (clipboard, text, -1);
+       g_free (text);
+}
+
 static void
 ev_view_primary_get_cb (GtkClipboard     *clipboard,
                        GtkSelectionData *selection_data,