[gnome-builder] Revert "start abstracting single editor into GbEditorFrame."



commit 50e9fab4aca29c2872b276ea663e52be18f6841a
Author: Christian Hergert <christian hergert me>
Date:   Fri Nov 28 14:48:22 2014 -0800

    Revert "start abstracting single editor into GbEditorFrame."
    
    This reverts commit 5a6f23502e3b69c1f69647cd5d327dd36920bffa.

 src/editor/gb-editor-document.c           |   81 +----
 src/editor/gb-editor-document.h           |    3 -
 src/editor/gb-editor-frame.c              |  587 -----------------------------
 src/editor/gb-editor-frame.h              |   63 ---
 src/gnome-builder.mk                      |    2 -
 src/resources/gnome-builder.gresource.xml |    1 -
 src/resources/ui/gb-editor-frame.ui       |  106 ------
 7 files changed, 3 insertions(+), 840 deletions(-)
---
diff --git a/src/editor/gb-editor-document.c b/src/editor/gb-editor-document.c
index 9d61dbb..f7956fa 100644
--- a/src/editor/gb-editor-document.c
+++ b/src/editor/gb-editor-document.c
@@ -23,14 +23,8 @@
 
 #include "gb-editor-document.h"
 
-struct _GbEditorDocumentPrivate
-{
-  GtkSourceFile *file;
-};
-
 enum {
   PROP_0,
-  PROP_FILE,
   PROP_STYLE_SCHEME_NAME,
   LAST_PROP
 };
@@ -40,7 +34,7 @@ enum {
   LAST_SIGNAL
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (GbEditorDocument, gb_editor_document, GTK_SOURCE_TYPE_BUFFER)
+G_DEFINE_TYPE (GbEditorDocument, gb_editor_document, GTK_SOURCE_TYPE_BUFFER)
 
 static  GParamSpec *gParamSpecs [LAST_PROP];
 static guint gSignals [LAST_SIGNAL];
@@ -51,29 +45,6 @@ gb_editor_document_new (void)
   return g_object_new (GB_TYPE_EDITOR_DOCUMENT, NULL);
 }
 
-GtkSourceFile *
-gb_editor_document_get_file (GbEditorDocument *document)
-{
-  g_return_val_if_fail (GB_IS_EDITOR_DOCUMENT (document), NULL);
-
-  return document->priv->file;
-}
-
-void
-gb_editor_document_set_file (GbEditorDocument *document,
-                             GtkSourceFile    *file)
-{
-  g_return_if_fail (GB_IS_EDITOR_DOCUMENT (document));
-  g_return_if_fail (!file || GTK_SOURCE_IS_FILE (file));
-
-  if (file != document->priv->file)
-    {
-      g_clear_object (&document->priv->file);
-      document->priv->file = file ? g_object_ref (file) : NULL;
-      g_object_notify_by_pspec (G_OBJECT (document), gParamSpecs [PROP_FILE]);
-    }
-}
-
 static void
 gb_editor_document_set_style_scheme_name (GbEditorDocument *document,
                                           const gchar      *style_scheme_name)
@@ -98,7 +69,7 @@ gb_editor_document_mark_set (GtkTextBuffer     *buffer,
     GTK_TEXT_BUFFER_CLASS (gb_editor_document_parent_class)->mark_set (buffer, iter, mark);
 
   if (mark == gtk_text_buffer_get_insert (buffer))
-    g_signal_emit (buffer, gSignals [CURSOR_MOVED], 0);
+    g_signal_emit (buffer, gSignals[CURSOR_MOVED], 0);
 }
 
 static void
@@ -106,41 +77,12 @@ gb_editor_document_changed (GtkTextBuffer *buffer)
 {
   g_assert (GB_IS_EDITOR_DOCUMENT (buffer));
 
-  g_signal_emit (buffer, gSignals [CURSOR_MOVED], 0);
+  g_signal_emit (buffer, gSignals[CURSOR_MOVED], 0);
 
   GTK_TEXT_BUFFER_CLASS (gb_editor_document_parent_class)->changed (buffer);
 }
 
 static void
-gb_editor_document_finalize (GObject *object)
-{
-  GbEditorDocumentPrivate *priv = GB_EDITOR_DOCUMENT (object)->priv;
-
-  g_clear_object (&priv->file);
-
-  G_OBJECT_CLASS(gb_editor_document_parent_class)->finalize (object);
-}
-
-static void
-gb_editor_document_get_property (GObject    *object,
-                                 guint       prop_id,
-                                 GValue     *value,
-                                 GParamSpec *pspec)
-{
-  GbEditorDocument *self = (GbEditorDocument *)object;
-
-  switch (prop_id)
-    {
-    case PROP_FILE:
-      g_value_set_object (value, gb_editor_document_get_file (self));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-    }
-}
-
-static void
 gb_editor_document_set_property (GObject      *object,
                                  guint         prop_id,
                                  const GValue *value,
@@ -150,10 +92,6 @@ gb_editor_document_set_property (GObject      *object,
 
   switch (prop_id)
     {
-    case PROP_FILE:
-      gb_editor_document_set_file (self, g_value_get_object (value));
-      break;
-
     case PROP_STYLE_SCHEME_NAME:
       gb_editor_document_set_style_scheme_name (self,
                                                 g_value_get_string (value));
@@ -171,22 +109,11 @@ gb_editor_document_class_init (GbEditorDocumentClass *klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkTextBufferClass *text_buffer_class = GTK_TEXT_BUFFER_CLASS (klass);
 
-  object_class->finalize = gb_editor_document_finalize;
-  object_class->get_property = gb_editor_document_get_property;
   object_class->set_property = gb_editor_document_set_property;
 
   text_buffer_class->mark_set = gb_editor_document_mark_set;
   text_buffer_class->changed = gb_editor_document_changed;
 
-  gParamSpecs [PROP_FILE] =
-    g_param_spec_object ("file",
-                         _("File"),
-                         _("The backing file for the document."),
-                         GTK_SOURCE_TYPE_FILE,
-                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-  g_object_class_install_property (object_class, PROP_FILE,
-                                   gParamSpecs [PROP_FILE]);
-
   gParamSpecs [PROP_STYLE_SCHEME_NAME] =
     g_param_spec_string ("style-scheme-name",
                          _("Style Scheme Name"),
@@ -212,6 +139,4 @@ static void
 gb_editor_document_init (GbEditorDocument *document)
 {
   document->priv = gb_editor_document_get_instance_private (document);
-
-  document->priv->file = gtk_source_file_new ();
 }
diff --git a/src/editor/gb-editor-document.h b/src/editor/gb-editor-document.h
index a03ad1d..2ba022a 100644
--- a/src/editor/gb-editor-document.h
+++ b/src/editor/gb-editor-document.h
@@ -52,9 +52,6 @@ struct _GbEditorDocumentClass
 
 GbEditorDocument *gb_editor_document_new      (void);
 GType             gb_editor_document_get_type (void) G_GNUC_CONST;
-GtkSourceFile    *gb_editor_document_get_file (GbEditorDocument *document);
-void              gb_editor_document_set_file (GbEditorDocument *document,
-                                               GtkSourceFile    *file);
 
 G_END_DECLS
 
diff --git a/src/gnome-builder.mk b/src/gnome-builder.mk
index 989fa96..18e42f7 100644
--- a/src/gnome-builder.mk
+++ b/src/gnome-builder.mk
@@ -55,8 +55,6 @@ libgnome_builder_la_SOURCES = \
        src/editor/gb-editor-file-mark.h \
        src/editor/gb-editor-file-marks.c \
        src/editor/gb-editor-file-marks.h \
-       src/editor/gb-editor-frame.c \
-       src/editor/gb-editor-frame.h \
        src/editor/gb-editor-navigation-item.c \
        src/editor/gb-editor-navigation-item.h \
        src/editor/gb-editor-settings-widget.c \
diff --git a/src/resources/gnome-builder.gresource.xml b/src/resources/gnome-builder.gresource.xml
index 8eb09a0..5ee89cd 100644
--- a/src/resources/gnome-builder.gresource.xml
+++ b/src/resources/gnome-builder.gresource.xml
@@ -23,7 +23,6 @@
     <file>ui/gb-credits-widget.ui</file>
     <file>ui/gb-devhelp-tab.ui</file>
     <file>ui/gb-editor-settings-widget.ui</file>
-    <file>ui/gb-editor-frame.ui</file>
     <file>ui/gb-editor-tab.ui</file>
     <file>ui/gb-editor-workspace.ui</file>
     <file>ui/gb-preferences-window.ui</file>


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