[evince/wip/gpoo/gtk4-rebase-port: 79/96] ev-view: toss some commented code




commit 262b0ecda8aa0fa3b30ae86a4ffa15f41cfbd27f
Author: Qiu Wenbo <qiuwenbo kylinos com cn>
Date:   Fri Aug 27 14:52:16 2021 +0800

    ev-view: toss some commented code
    
    Signed-off-by: Qiu Wenbo <qiuwenbo kylinos com cn>

 libview/ev-view.c | 156 ------------------------------------------------------
 1 file changed, 156 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 51102925e..4665062f6 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -314,14 +314,6 @@ static void       clear_selection                            (EvView
 static void       clear_link_selected                        (EvView             *view);
 static void       selection_free                             (EvViewSelection    *selection);
 static char*      get_selected_text                          (EvView             *ev_view);
-#if 0
-static void       ev_view_primary_get_cb                     (GtkClipboard       *clipboard,
-                                                             GtkSelectionData   *selection_data,
-                                                             guint               info,
-                                                             gpointer            data);
-static void       ev_view_primary_clear_cb                   (GtkClipboard       *clipboard,
-                                                             gpointer            data);
-#endif
 static void       ev_view_update_primary_selection           (EvView             *ev_view);
 
 /*** Caret navigation ***/
@@ -5895,53 +5887,6 @@ ev_view_motion_notify_event (GtkEventControllerMotion    *self,
                return;
        }
 
-#if 0
-       if (view->selection_info.in_drag) {
-               if (gtk_drag_check_threshold (widget,
-                                             view->selection_info.start.x,
-                                             view->selection_info.start.y,
-                                             x, y)) {
-                       GtkTargetList *target_list = gtk_target_list_new (NULL, 0);
-
-                       gtk_target_list_add_text_targets (target_list, TARGET_DND_TEXT);
-
-                       gtk_drag_begin_with_coordinates (widget, target_list,
-                                                        GDK_ACTION_COPY,
-                                                        1, (GdkEvent *)event,
-                                                        -1, -1);
-
-                       view->selection_info.in_drag = FALSE;
-                       view->pressed_button = -1;
-
-                       gtk_target_list_unref (target_list);
-
-                       return TRUE;
-               }
-       } else if (view->image_dnd_info.in_drag) {
-               if (gtk_drag_check_threshold (widget,
-                                             view->selection_info.start.x,
-                                             view->selection_info.start.y,
-                                             x, y)) {
-                       GtkTargetList *target_list = gtk_target_list_new (NULL, 0);
-
-                       gtk_target_list_add_uri_targets (target_list, TARGET_DND_URI);
-                       gtk_target_list_add_image_targets (target_list, TARGET_DND_IMAGE, TRUE);
-
-                       gtk_drag_begin_with_coordinates (widget, target_list,
-                                                        GDK_ACTION_COPY,
-                                                        1, (GdkEvent *)event,
-                                                        -1, -1);
-
-                       view->image_dnd_info.in_drag = FALSE;
-                       view->pressed_button = -1;
-
-                       gtk_target_list_unref (target_list);
-
-                       return TRUE;
-               }
-       }
-#endif
-
        switch (view->pressed_button) {
        case GDK_BUTTON_PRIMARY:
                /* For the Evince 0.4.x release, we limit selection to un-rotated
@@ -6391,39 +6336,6 @@ ev_view_button_release_event(GtkGestureClick             *self,
        }
 }
 
-
-#if 0
-static gboolean
-ev_view_forward_key_event_to_focused_child (EvView      *view,
-                                           GdkEventKey *event)
-{
-       GtkWidget   *child_widget = NULL;
-       GdkEventKey *new_event;
-       gboolean     handled;
-
-       if (view->window_child_focus) {
-               child_widget = view->window_child_focus->window;
-       } else if (view->children) {
-               EvViewChild *child = (EvViewChild *)view->children->data;
-
-               child_widget = child->widget;
-       } else {
-               return FALSE;
-       }
-
-       new_event = (GdkEventKey *) gdk_event_copy ((GdkEvent *)event);
-       g_object_unref (new_event->window);
-       new_event->window = gtk_widget_get_window (child_widget);
-       if (new_event->window)
-               g_object_ref (new_event->window);
-       gtk_widget_realize (child_widget);
-       handled = gtk_widget_event (child_widget, (GdkEvent *)new_event);
-       gdk_event_free ((GdkEvent *)new_event);
-
-       return handled;
-}
-#endif
-
 static gint
 go_to_next_page (EvView *view,
                 gint    page)
@@ -9928,73 +9840,6 @@ ev_view_copy (EvView *ev_view)
        g_free (text);
 }
 
-#if 0
-static void
-ev_view_primary_get_cb (GtkClipboard     *clipboard,
-                       GtkSelectionData *selection_data,
-                       guint             info,
-                       gpointer          data)
-{
-       EvView *ev_view = EV_VIEW (data);
-
-       if (ev_view->link_selected) {
-               gtk_selection_data_set_text (selection_data,
-                                            ev_link_action_get_uri (ev_view->link_selected),
-                                            -1);
-       } else if (EV_IS_SELECTION (ev_view->document) &&
-                  ev_view->selection_info.selections) {
-               gchar *text;
-
-               text = get_selected_text (ev_view);
-               if (text) {
-                       gtk_selection_data_set_text (selection_data, text, -1);
-                       g_free (text);
-               }
-       }
-}
-
-static void
-ev_view_primary_clear_cb (GtkClipboard *clipboard,
-                         gpointer      data)
-{
-       EvView *view = EV_VIEW (data);
-
-       clear_selection (view);
-       clear_link_selected (view);
-}
-
-static void
-ev_view_update_primary_selection (EvView *ev_view)
-{
-       GtkClipboard *clipboard;
-
-       clipboard = gtk_widget_get_clipboard (GTK_WIDGET (ev_view),
-                                              GDK_SELECTION_PRIMARY);
-
-       if (ev_view->selection_info.selections || ev_view->link_selected) {
-                GtkTargetList *target_list;
-                GtkTargetEntry *targets;
-                int n_targets;
-
-                target_list = gtk_target_list_new (NULL, 0);
-                gtk_target_list_add_text_targets (target_list, 0);
-                targets = gtk_target_table_new_from_list (target_list, &n_targets);
-                gtk_target_list_unref (target_list);
-
-               gtk_clipboard_set_with_owner (clipboard,
-                                             targets, n_targets,
-                                             ev_view_primary_get_cb,
-                                             ev_view_primary_clear_cb,
-                                             G_OBJECT (ev_view));
-
-                gtk_target_table_free (targets, n_targets);
-       } else {
-               if (gtk_clipboard_get_owner (clipboard) == G_OBJECT (ev_view))
-                       gtk_clipboard_clear (clipboard);
-       }
-}
-#endif
-
 static void
 clear_link_selected (EvView *view)
 {
@@ -10013,7 +9858,6 @@ ev_view_copy_link_address (EvView       *view,
        ev_view_clipboard_copy (view, ev_link_action_get_uri (action));
 
        view->link_selected = g_object_ref (action);
-       // ev_view_update_primary_selection (view);
 }
 
 /*** Cursor operations ***/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]