]> www.fi.muni.cz Git - evince.git/commitdiff
Implement Edit->Copy
authorMarco Pesenti Gritti <marco@gnome.org>
Wed, 5 Jan 2005 16:18:13 +0000 (16:18 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Wed, 5 Jan 2005 16:18:13 +0000 (16:18 +0000)
2005-01-05  Marco Pesenti Gritti  <marco@gnome.org>

        * shell/ev-view.c: (ev_view_copy):
        * shell/ev-view.h:
        * shell/ev-window.c: (ev_window_cmd_edit_copy):

        Implement Edit->Copy

ChangeLog
shell/ev-view.c
shell/ev-view.h
shell/ev-window.c

index 5ea38fb90018368f0cd2d76cb31706e90db92528..797cce47e422d801ab9e5be671445fe8de2ff04a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-01-05  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * shell/ev-view.c: (ev_view_copy):
+       * shell/ev-view.h:
+       * shell/ev-window.c: (ev_window_cmd_edit_copy):
+
+       Implement Edit->Copy
+
 2005-01-05  Marco Pesenti Gritti  <marco@gnome.org>
 
        * backend/ev-document.c: (ev_document_get_text):
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,
index 600c7b94eaa9ee7b45ed204b3f1ae2f6bc7ab574..cddd27453d620ddcc44c8dbfe5da25a8da249c0a 100644 (file)
@@ -34,20 +34,19 @@ G_BEGIN_DECLS
 typedef struct _EvView       EvView;
 typedef struct _EvViewClass  EvViewClass;
 
-GType     ev_view_get_type (void) G_GNUC_CONST;
-GtkWidget* ev_view_new      (void);
-
-void ev_view_set_document (EvView     *view,
-                          EvDocument *document);
-void ev_view_set_page     (EvView     *view,
-                          int         page);
-int  ev_view_get_page     (EvView     *view);
-
-void ev_view_zoom_in     (EvView *view);
-void ev_view_zoom_out    (EvView *view);
-void ev_view_normal_size (EvView *view);
-void ev_view_best_fit    (EvView *view);
-void ev_view_fit_width   (EvView *view);
+GType          ev_view_get_type        (void) G_GNUC_CONST;
+GtkWidget*     ev_view_new             (void);
+void           ev_view_copy            (EvView     *view);
+void           ev_view_set_document    (EvView     *view,
+                                        EvDocument *document);
+void           ev_view_set_page        (EvView     *view,
+                                        int         page);
+int            ev_view_get_page        (EvView     *view);
+void           ev_view_zoom_in         (EvView     *view);
+void           ev_view_zoom_out        (EvView     *view);
+void           ev_view_normal_size     (EvView     *view);
+void           ev_view_best_fit        (EvView     *view);
+void           ev_view_fit_width       (EvView     *view);
 
 char* ev_view_get_find_status_message (EvView *view);
 
index 5b1375cc78eaa77e34b15e1d38c12d7cecaabc9e..e110e1db984484ecef74d025227976997c2d5831 100644 (file)
@@ -607,7 +607,7 @@ ev_window_cmd_edit_copy (GtkAction *action, EvWindow *ev_window)
 {
         g_return_if_fail (EV_IS_WINDOW (ev_window));
 
-        /* FIXME */
+       ev_view_copy (EV_VIEW (ev_window->priv->view));
 }
 
 static void