[gnome-builder] sourceview: remove unused code



commit 0a04aa8ffc7d5a811b931e9ef355241709590839
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 11 23:37:17 2017 -0700

    sourceview: remove unused code

 src/libide/sourceview/ide-source-view.c |  122 -------------------------------
 src/libide/sourceview/ide-source-view.h |    3 -
 2 files changed, 0 insertions(+), 125 deletions(-)
---
diff --git a/src/libide/sourceview/ide-source-view.c b/src/libide/sourceview/ide-source-view.c
index aff3857..4694148 100644
--- a/src/libide/sourceview/ide-source-view.c
+++ b/src/libide/sourceview/ide-source-view.c
@@ -96,16 +96,10 @@ typedef struct
   IdeSourceViewCapture        *capture;
   gchar                       *display_name;
   IdeSourceViewMode           *mode;
-  GList                       *providers;
-  GtkTextMark                 *rubberband_mark;
-  GtkTextMark                 *rubberband_insert_mark;
   GtkTextMark                 *scroll_mark;
-  gchar                       *saved_search_text;
-  GtkDirectionType             search_direction;
   GQueue                      *selections;
   GQueue                      *snippets;
   GtkSourceCompletionProvider *snippets_provider;
-  GtkSourceSearchContext      *search_context;
   DzlAnimation                *hadj_animation;
   DzlAnimation                *vadj_animation;
   IdeOmniGutterRenderer       *omni_renderer;
@@ -169,7 +163,6 @@ typedef struct
   guint                        insert_matching_brace : 1;
   guint                        overwrite_braces : 1;
   guint                        recording_macro : 1;
-  guint                        rubberband_search : 1;
   guint                        scrolling_to_scroll_mark : 1;
   guint                        show_grid_lines : 1;
   guint                        show_search_bubbles : 1;
@@ -207,7 +200,6 @@ enum {
   PROP_INSERT_MATCHING_BRACE,
   PROP_MODE_DISPLAY_NAME,
   PROP_OVERWRITE_BRACES,
-  PROP_RUBBERBAND_SEARCH,
   PROP_SCROLL_OFFSET,
   PROP_SHOW_GRID_LINES,
   PROP_SHOW_LINE_CHANGES,
@@ -380,30 +372,6 @@ ide_source_view_can_animate (IdeSourceView *self)
   return can_animate;
 }
 
-static void
-ide_source_view_sync_rubberband_mark (IdeSourceView *self)
-{
-  IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
-  GtkTextBuffer *buffer;
-  GtkTextMark *insert;
-  GtkTextIter iter;
-
-  g_assert (IDE_IS_SOURCE_VIEW (self));
-
-  /*
-   * Occasionally, we need to sync the rubberband mark with the insert mark so
-   * that forward searching does not jump around in the buffer. Good times to
-   * do so are when focus leaves the buffer, or when the ::set_search_text()
-   * vfunc is activated.
-   */
-
-  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
-  insert = gtk_text_buffer_get_insert (buffer);
-  gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-  gtk_text_buffer_move_mark (buffer, priv->rubberband_mark, &iter);
-  gtk_text_buffer_move_mark (buffer, priv->rubberband_insert_mark, &iter);
-}
-
 void
 _ide_source_view_set_count (IdeSourceView *self,
                             gint           count)
@@ -1514,12 +1482,6 @@ ide_source_view_bind_buffer (IdeSourceView  *self,
   gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (buffer), &iter);
   priv->scroll_mark = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (buffer), NULL, &iter, TRUE);
 
-  /* Create rubberband mark used by search rubberbanding */
-  priv->rubberband_mark =
-    gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (buffer), NULL, &iter, TRUE);
-  priv->rubberband_insert_mark =
-    gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (buffer), NULL, &iter, TRUE);
-
   /* Marks used for definition highlights */
   priv->definition_highlight_start_mark =
     gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (buffer), NULL, &iter, TRUE);
@@ -4495,7 +4457,6 @@ ide_source_view_focus_out_event (GtkWidget     *widget,
    * another view into the same buffer has caused the insert mark to jump.
    */
   ide_source_view_real_save_insert_mark (self);
-  ide_source_view_sync_rubberband_mark (self);
 
   ret = GTK_WIDGET_CLASS (ide_source_view_parent_class)->focus_out_event (widget, event);
 
@@ -5837,7 +5798,6 @@ ide_source_view_finalize (GObject *object)
   g_clear_pointer (&priv->selections, g_queue_free);
   g_clear_pointer (&priv->snippets, g_queue_free);
   g_clear_pointer (&priv->include_regex, g_regex_unref);
-  g_clear_pointer (&priv->saved_search_text, g_free);
 
   DZL_COUNTER_DEC (instances);
 
@@ -5899,10 +5859,6 @@ ide_source_view_get_property (GObject    *object,
       g_value_set_boolean (value, ide_source_view_get_overwrite_braces (self));
       break;
 
-    case PROP_RUBBERBAND_SEARCH:
-      g_value_set_boolean (value, ide_source_view_get_rubberband_search (self));
-      break;
-
     case PROP_SCROLL_OFFSET:
       g_value_set_uint (value, ide_source_view_get_scroll_offset (self));
       break;
@@ -5996,10 +5952,6 @@ ide_source_view_set_property (GObject      *object,
       ide_source_view_set_overwrite_braces (self, g_value_get_boolean (value));
       break;
 
-    case PROP_RUBBERBAND_SEARCH:
-      ide_source_view_set_rubberband_search (self, g_value_get_boolean (value));
-      break;
-
     case PROP_SCROLL_OFFSET:
       ide_source_view_set_scroll_offset (self, g_value_get_uint (value));
       break;
@@ -6196,13 +6148,6 @@ ide_source_view_class_init (IdeSourceViewClass *klass)
                           FALSE,
                           (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
-  properties [PROP_RUBBERBAND_SEARCH] =
-    g_param_spec_boolean ("rubberband-search",
-                          "Rubberband Search",
-                          "Auto scroll to next search result without moving insertion caret.",
-                          FALSE,
-                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
   properties [PROP_SCROLL_OFFSET] =
     g_param_spec_uint ("scroll-offset",
                        "Scroll Offset",
@@ -8330,73 +8275,6 @@ ide_source_view_set_count (IdeSourceView *self,
     }
 }
 
-gboolean
-ide_source_view_get_rubberband_search (IdeSourceView *self)
-{
-  IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
-
-  g_return_val_if_fail (IDE_IS_SOURCE_VIEW (self), FALSE);
-
-  return priv->rubberband_search;
-}
-
-void
-ide_source_view_set_rubberband_search (IdeSourceView *self,
-                                       gboolean       rubberband_search)
-{
-  IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
-
-  g_return_if_fail (IDE_IS_SOURCE_VIEW (self));
-
-  rubberband_search = !!rubberband_search;
-
-  if (rubberband_search != priv->rubberband_search)
-    {
-      priv->rubberband_search = rubberband_search;
-
-      if (priv->rubberband_search && (priv->rubberband_mark != NULL))
-        {
-          GtkTextBuffer *buffer;
-          GtkTextMark *insert;
-          GtkTextIter iter;
-          GdkRectangle rect;
-
-          /*
-           * The rubberband_mark is the top-left position of the sourceview
-           * currently (for the beginning of the search). We use this so that
-           * we can restore the sourceview vadjustment to the proper position
-           * when rubberbanding back to the original position. The
-           * rubberband_insert_mark is the position after the current insert
-           * mark so that we will begin incremental searches after the current
-           * cursor.
-           */
-
-          buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
-          insert = gtk_text_buffer_get_insert (buffer);
-
-          gtk_text_view_get_visible_rect (GTK_TEXT_VIEW (self), &rect);
-          gtk_text_view_get_iter_at_location (GTK_TEXT_VIEW (self), &iter, rect.x+1, rect.y+1);
-          gtk_text_buffer_move_mark (buffer, priv->rubberband_mark, &iter);
-
-          gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-          gtk_text_iter_forward_char (&iter);
-          gtk_text_buffer_move_mark (buffer, priv->rubberband_insert_mark, &iter);
-        }
-
-      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_RUBBERBAND_SEARCH]);
-    }
-}
-
-void
-ide_source_view_rollback_search (IdeSourceView *self)
-{
-  IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
-
-  g_return_if_fail (IDE_IS_SOURCE_VIEW (self));
-
-  ide_source_view_scroll_mark_onscreen (self, priv->rubberband_mark, TRUE, 0.5, 0.5);
-}
-
 GtkTextMark *
 _ide_source_view_get_scroll_mark (IdeSourceView *self)
 {
diff --git a/src/libide/sourceview/ide-source-view.h b/src/libide/sourceview/ide-source-view.h
index 7e29a2e..3ec1874 100644
--- a/src/libide/sourceview/ide-source-view.h
+++ b/src/libide/sourceview/ide-source-view.h
@@ -361,7 +361,6 @@ const gchar                *ide_source_view_get_mode_display_name     (IdeSource
 const gchar                *ide_source_view_get_mode_name             (IdeSourceView              *self);
 gboolean                    ide_source_view_get_overwrite_braces      (IdeSourceView              *self);
 gboolean                    ide_source_view_get_overwrite             (IdeSourceView              *self);
-gboolean                    ide_source_view_get_rubberband_search     (IdeSourceView              *self);
 guint                       ide_source_view_get_scroll_offset         (IdeSourceView              *self);
 gboolean                    ide_source_view_get_show_grid_lines       (IdeSourceView              *self);
 gboolean                    ide_source_view_get_show_line_changes     (IdeSourceView              *self);
@@ -400,8 +399,6 @@ void                        ide_source_view_set_misspelled_word       (IdeSource
                                                                        GtkTextIter                *end);
 void                        ide_source_view_set_overwrite_braces      (IdeSourceView              *self,
                                                                        gboolean                    
overwrite_braces);
-void                        ide_source_view_set_rubberband_search     (IdeSourceView              *self,
-                                                                       gboolean                    
rubberband_search);
 void                        ide_source_view_set_scroll_offset         (IdeSourceView              *self,
                                                                        guint                       
scroll_offset);
 void                        ide_source_view_set_show_grid_lines       (IdeSourceView              *self,


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