diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2005-01-05 16:18:13 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-01-05 16:18:13 (GMT) |
commit | 8195f1f7c4693838e73f23ab95ba60707faf6446 (patch) | |
tree | f63f58eadfb22cf3dbe992da5e60c5572f59eed7 /shell | |
parent | 9c1e6ba4d99cb7f937b2b3998814a7486b88c4ce (diff) |
Implement Edit->Copy
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
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ev-view.c | 13 | ||||
-rw-r--r-- | shell/ev-view.h | 27 | ||||
-rw-r--r-- | shell/ev-window.c | 2 |
3 files changed, 27 insertions, 15 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index bd50b38..9936ce1 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -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, diff --git a/shell/ev-view.h b/shell/ev-view.h index 600c7b9..cddd274 100644 --- a/shell/ev-view.h +++ b/shell/ev-view.h @@ -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); diff --git a/shell/ev-window.c b/shell/ev-window.c index 5b1375c..e110e1d 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -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 |