[gtk+/wip/matthiasc/help-overlay] Rename some private classes



commit bfd9579dcdf0374e078790ed8fbf44cffcdfdebf
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Oct 13 00:37:15 2015 -0400

    Rename some private classes
    
    GtkShortcutsView is now GtkShortcutsSection to better match
    the terminology in the design.

 demos/gtk-demo/shortcuts.ui                       |   36 ++++----
 gtk/Makefile.am                                   |    4 +-
 gtk/{gtkshortcutsview.c => gtkshortcutssection.c} |   78 ++++++++--------
 gtk/gtkshortcutssectionprivate.h                  |   45 +++++++++
 gtk/gtkshortcutsviewprivate.h                     |   45 ---------
 gtk/gtkshortcutswindow.c                          |  106 ++++++++++----------
 6 files changed, 157 insertions(+), 157 deletions(-)
---
diff --git a/demos/gtk-demo/shortcuts.ui b/demos/gtk-demo/shortcuts.ui
index db9b243..f340cfe 100644
--- a/demos/gtk-demo/shortcuts.ui
+++ b/demos/gtk-demo/shortcuts.ui
@@ -33,8 +33,8 @@
   <object class="GtkShortcutsWindow" id="builder-shortcuts">
     <property name="transient-for">window1</property>
     <property name="modal">1</property>
-    <views>
-      <view name="editor">
+    <sections>
+      <section name="editor">
         <property name="title" translatable="yes">Editor Shortcuts</property>
         <page>
           <column>
@@ -240,19 +240,19 @@
               </shortcut>
               <shortcut>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Up</property>
-                <property name="title" translatable="yes">Move viewport up within the file</property>
+                <property name="title" translatable="yes">Move sectionport up within the file</property>
               </shortcut>
               <shortcut>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Down</property>
-                <property name="title" translatable="yes">Move viewport down within the file</property>
+                <property name="title" translatable="yes">Move sectionport down within the file</property>
               </shortcut>
               <shortcut>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;End</property>
-                <property name="title" translatable="yes">Move viewport to end of file</property>
+                <property name="title" translatable="yes">Move sectionport to end of file</property>
               </shortcut>
               <shortcut>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Home</property>
-                <property name="title" translatable="yes">Move viewport to beginning of file</property>
+                <property name="title" translatable="yes">Move sectionport to beginning of file</property>
               </shortcut>
               <shortcut>
                 <property name="accelerator">&lt;ctrl&gt;percent</property>
@@ -272,8 +272,8 @@
             </group>
           </column>
         </page>
-      </view>
-      <view name="terminal">
+      </section>
+      <section name="terminal">
         <property name="title" translatable="yes">Terminal Shortcuts</property>
         <page>
           <column>
@@ -315,16 +315,16 @@
             </group>
           </column>
         </page>
-      </view>
-    </views>
-    <property name="view-name">editor</property>
+      </section>
+    </sections>
+    <property name="section-name">editor</property>
   </object>
 
   <object class="GtkShortcutsWindow" id="clocks-shortcuts">
     <property name="transient-for">window1</property>
     <property name="modal">1</property>
-    <views>
-      <view name="shortcuts">
+    <sections>
+      <section name="shortcuts">
         <property name="title" translatable="yes">Shortcuts</property>
         <page>
           <column>
@@ -332,11 +332,11 @@
               <property name="title" translatable="yes">General</property>
               <shortcut>
                 <property name="accelerator">&lt;ctrl&gt;Page_Down</property>
-                <property name="title" translatable="yes">Go to the next view</property>
+                <property name="title" translatable="yes">Go to the next section</property>
               </shortcut>
               <shortcut>
                 <property name="accelerator">&lt;ctrl&gt;Page_Up</property>
-                <property name="title" translatable="yes">Go to the previous view</property>
+                <property name="title" translatable="yes">Go to the previous section</property>
               </shortcut>
               <shortcut>
                 <property name="accelerator">&lt;alt&gt;Q</property>
@@ -403,9 +403,9 @@
             </group>
           </column>
         </page>
-      </view>
-    </views>
-    <property name="view-name">shortcuts</property>
+      </section>
+    </sections>
+    <property name="section-name">shortcuts</property>
   </object>
 
 </interface>
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 7a0adcc..921bc26 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -512,7 +512,7 @@ gtk_private_h_sources =             \
        gtkshortcutlabelprivate.h       \
        gtkshortcutsshortcutprivate.h   \
        gtkshortcutspageprivate.h       \
-       gtkshortcutsviewprivate.h       \
+       gtkshortcutssectionprivate.h    \
        gtksizegroup-private.h  \
        gtksizerequestcacheprivate.h    \
        gtksocketprivate.h      \
@@ -819,7 +819,7 @@ gtk_base_c_sources =                \
        gtkshortcutlabel.c      \
        gtkshortcutspage.c      \
        gtkshortcutsshortcut.c  \
-       gtkshortcutsview.c      \
+       gtkshortcutssection.c   \
        gtkshortcutswindow.c    \
        gtksidebarrow.c         \
        gtksizegroup.c          \
diff --git a/gtk/gtkshortcutsview.c b/gtk/gtkshortcutssection.c
similarity index 69%
rename from gtk/gtkshortcutsview.c
rename to gtk/gtkshortcutssection.c
index ce94f9a..c96c219 100644
--- a/gtk/gtkshortcutsview.c
+++ b/gtk/gtkshortcutssection.c
@@ -1,4 +1,4 @@
-/* gtkshortcutsview.c
+/* gtkshortcutssection.c
  *
  * Copyright (C) 2015 Christian Hergert <christian hergert me>
  *
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include "gtkshortcutsviewprivate.h"
+#include "gtkshortcutssectionprivate.h"
 
 #include "gtkshortcutspageprivate.h"
 #include "gtkstack.h"
@@ -28,7 +28,7 @@
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
-struct _GtkShortcutsView
+struct _GtkShortcutsSection
 {
   GtkBox            parent_instance;
 
@@ -41,17 +41,17 @@ struct _GtkShortcutsView
   guint             last_page_num;
 };
 
-struct _GtkShortcutsViewClass
+struct _GtkShortcutsSectionClass
 {
   GtkBoxClass parent_class;
 };
 
-G_DEFINE_TYPE (GtkShortcutsView, gtk_shortcuts_view, GTK_TYPE_BOX)
+G_DEFINE_TYPE (GtkShortcutsSection, gtk_shortcuts_section, GTK_TYPE_BOX)
 
 enum {
   PROP_0,
   PROP_TITLE,
-  PROP_VIEW_NAME,
+  PROP_SECTION_NAME,
   LAST_PROP
 };
 
@@ -74,10 +74,10 @@ adjust_page_buttons (GtkWidget *widget,
 }
 
 static void
-gtk_shortcuts_view_add (GtkContainer *container,
-                        GtkWidget    *child)
+gtk_shortcuts_section_add (GtkContainer *container,
+                           GtkWidget    *child)
 {
-  GtkShortcutsView *self = (GtkShortcutsView *)container;
+  GtkShortcutsSection *self = (GtkShortcutsSection *)container;
 
   if (GTK_IS_SHORTCUTS_PAGE (child))
     {
@@ -95,32 +95,32 @@ gtk_shortcuts_view_add (GtkContainer *container,
     }
   else
     {
-      GTK_CONTAINER_CLASS (gtk_shortcuts_view_parent_class)->add (container, child);
+      GTK_CONTAINER_CLASS (gtk_shortcuts_section_parent_class)->add (container, child);
     }
 }
 
 static void
-gtk_shortcuts_view_finalize (GObject *object)
+gtk_shortcuts_section_finalize (GObject *object)
 {
-  GtkShortcutsView *self = (GtkShortcutsView *)object;
+  GtkShortcutsSection *self = (GtkShortcutsSection *)object;
 
   g_clear_pointer (&self->name, g_free);
   g_clear_pointer (&self->title, g_free);
 
-  G_OBJECT_CLASS (gtk_shortcuts_view_parent_class)->finalize (object);
+  G_OBJECT_CLASS (gtk_shortcuts_section_parent_class)->finalize (object);
 }
 
 static void
-gtk_shortcuts_view_get_property (GObject    *object,
-                                 guint       prop_id,
-                                 GValue     *value,
-                                 GParamSpec *pspec)
+gtk_shortcuts_section_get_property (GObject    *object,
+                                    guint       prop_id,
+                                    GValue     *value,
+                                    GParamSpec *pspec)
 {
-  GtkShortcutsView *self = (GtkShortcutsView *)object;
+  GtkShortcutsSection *self = (GtkShortcutsSection *)object;
 
   switch (prop_id)
     {
-    case PROP_VIEW_NAME:
+    case PROP_SECTION_NAME:
       g_value_set_string (value, self->name);
       break;
 
@@ -134,16 +134,16 @@ gtk_shortcuts_view_get_property (GObject    *object,
 }
 
 static void
-gtk_shortcuts_view_set_property (GObject      *object,
-                                 guint         prop_id,
-                                 const GValue *value,
-                                 GParamSpec   *pspec)
+gtk_shortcuts_section_set_property (GObject      *object,
+                                    guint         prop_id,
+                                    const GValue *value,
+                                    GParamSpec   *pspec)
 {
-  GtkShortcutsView *self = (GtkShortcutsView *)object;
+  GtkShortcutsSection *self = (GtkShortcutsSection *)object;
 
   switch (prop_id)
     {
-    case PROP_VIEW_NAME:
+    case PROP_SECTION_NAME:
       g_free (self->name);
       self->name = g_value_dup_string (value);
       break;
@@ -159,21 +159,21 @@ gtk_shortcuts_view_set_property (GObject      *object,
 }
 
 static void
-gtk_shortcuts_view_class_init (GtkShortcutsViewClass *klass)
+gtk_shortcuts_section_class_init (GtkShortcutsSectionClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
 
-  object_class->finalize = gtk_shortcuts_view_finalize;
-  object_class->get_property = gtk_shortcuts_view_get_property;
-  object_class->set_property = gtk_shortcuts_view_set_property;
+  object_class->finalize = gtk_shortcuts_section_finalize;
+  object_class->get_property = gtk_shortcuts_section_get_property;
+  object_class->set_property = gtk_shortcuts_section_set_property;
 
-  container_class->add = gtk_shortcuts_view_add;
+  container_class->add = gtk_shortcuts_section_add;
 
-  properties[PROP_VIEW_NAME] =
-    g_param_spec_string ("view-name",
-                         P_("View Name"),
-                         P_("View Name"),
+  properties[PROP_SECTION_NAME] =
+    g_param_spec_string ("section-name",
+                         P_("Section Name"),
+                         P_("Section Name"),
                          NULL,
                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
@@ -188,7 +188,7 @@ gtk_shortcuts_view_class_init (GtkShortcutsViewClass *klass)
 }
 
 static void
-gtk_shortcuts_view_init (GtkShortcutsView *self)
+gtk_shortcuts_section_init (GtkShortcutsSection *self)
 {
   gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
   gtk_box_set_homogeneous (GTK_BOX (self), FALSE);
@@ -215,17 +215,17 @@ gtk_shortcuts_view_init (GtkShortcutsView *self)
 }
 
 const gchar *
-gtk_shortcuts_view_get_view_name (GtkShortcutsView *self)
+gtk_shortcuts_section_get_section_name (GtkShortcutsSection *self)
 {
-  g_return_val_if_fail (GTK_IS_SHORTCUTS_VIEW (self), NULL);
+  g_return_val_if_fail (GTK_IS_SHORTCUTS_SECTION (self), NULL);
 
   return self->name;
 }
 
 const gchar *
-gtk_shortcuts_view_get_title (GtkShortcutsView *self)
+gtk_shortcuts_section_get_title (GtkShortcutsSection *self)
 {
-  g_return_val_if_fail (GTK_IS_SHORTCUTS_VIEW (self), NULL);
+  g_return_val_if_fail (GTK_IS_SHORTCUTS_SECTION (self), NULL);
 
   return self->title;
 }
diff --git a/gtk/gtkshortcutssectionprivate.h b/gtk/gtkshortcutssectionprivate.h
new file mode 100644
index 0000000..8ad21ec
--- /dev/null
+++ b/gtk/gtkshortcutssectionprivate.h
@@ -0,0 +1,45 @@
+/* gtkshortcutssectionprivate.h
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public License as
+ *  published by the Free Software Foundation; either version 2 of the
+ *  License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GTK_SHORTCUTS_SECTION_H__
+#define __GTK_SHORTCUTS_SECTION_H__
+
+#include <gtk/gtkbox.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_SHORTCUTS_SECTION (gtk_shortcuts_section_get_type ())
+#define GTK_SHORTCUTS_SECTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GTK_TYPE_SHORTCUTS_SECTION, GtkShortcutsSection))
+#define GTK_SHORTCUTS_SECTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SHORTCUTS_SECTION, 
GtkShortcutsSectionClass))
+#define GTK_IS_SHORTCUTS_SECTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GTK_TYPE_SHORTCUTS_SECTION))
+#define GTK_IS_SHORTCUTS_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SHORTCUTS_SECTION))
+#define GTK_SHORTCUTS_SECTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SHORTCUTS_SECTION, 
GtkShortcutsSectionClass))
+
+
+typedef struct _GtkShortcutsSection      GtkShortcutsSection;
+typedef struct _GtkShortcutsSectionClass GtkShortcutsSectionClass;
+
+
+GType        gtk_shortcuts_section_get_type (void) G_GNUC_CONST;
+
+const gchar *gtk_shortcuts_section_get_section_name (GtkShortcutsSection *self);
+const gchar *gtk_shortcuts_section_get_title        (GtkShortcutsSection *self);
+
+G_END_DECLS
+
+#endif /* __GTK_SHORTCUTS_SECTION_H__ */
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 723cc7c..19068e1 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -25,7 +25,7 @@
 #include "gtkshortcutsgroupprivate.h"
 #include "gtkshortcutspageprivate.h"
 #include "gtkshortcutsshortcutprivate.h"
-#include "gtkshortcutsviewprivate.h"
+#include "gtkshortcutssectionprivate.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
@@ -45,8 +45,8 @@
 typedef struct
 {
   GHashTable     *keywords;
-  gchar          *initial_view;
-  gchar          *last_view_name;
+  gchar          *initial_section;
+  gchar          *last_section_name;
   GtkSizeGroup   *search_text_group;
   GtkSizeGroup   *search_image_group;
   GHashTable     *search_items_hash;
@@ -88,7 +88,7 @@ enum {
 
 enum {
   PROP_0,
-  PROP_VIEW_NAME,
+  PROP_SECTION_NAME,
   LAST_PROP
 };
 
@@ -96,8 +96,8 @@ static GParamSpec *properties[LAST_PROP];
 static guint signals[LAST_SIGNAL];
 
 static void
-gtk_shortcuts_window_add_view (GtkShortcutsWindow *self,
-                               GtkShortcutsView   *view)
+gtk_shortcuts_window_add_section (GtkShortcutsWindow  *self,
+                                  GtkShortcutsSection *section)
 {
   GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
   GtkListBoxRow *row;
@@ -105,15 +105,15 @@ gtk_shortcuts_window_add_view (GtkShortcutsWindow *self,
   const gchar *name;
   GtkWidget *label;
 
-  name = gtk_shortcuts_view_get_view_name (view);
-  title = gtk_shortcuts_view_get_title (view);
+  name = gtk_shortcuts_section_get_section_name (section);
+  title = gtk_shortcuts_section_get_title (section);
 
-  gtk_stack_add_titled (priv->stack, GTK_WIDGET (view), name, title);
+  gtk_stack_add_titled (priv->stack, GTK_WIDGET (section), name, title);
 
   row = g_object_new (GTK_TYPE_LIST_BOX_ROW,
                       "visible", TRUE,
                       NULL);
-  g_object_set_data_full (G_OBJECT (row), "GTK_SHORTCUTS_VIEW_NAME", g_strdup (name), g_free);
+  g_object_set_data_full (G_OBJECT (row), "GTK_SHORTCUTS_SECTION_NAME", g_strdup (name), g_free);
   label = g_object_new (GTK_TYPE_LABEL,
                         "margin", 6,
                         "label", title,
@@ -130,8 +130,8 @@ gtk_shortcuts_window_add (GtkContainer *container,
 {
   GtkShortcutsWindow *self = (GtkShortcutsWindow *)container;
 
-  if (GTK_IS_SHORTCUTS_VIEW (widget))
-    gtk_shortcuts_window_add_view (self, GTK_SHORTCUTS_VIEW (widget));
+  if (GTK_IS_SHORTCUTS_SECTION (widget))
+    gtk_shortcuts_window_add_section (self, GTK_SHORTCUTS_SECTION (widget));
   else
     GTK_CONTAINER_CLASS (gtk_shortcuts_window_parent_class)->add (container, widget);
 }
@@ -159,13 +159,13 @@ gtk_shortcuts_window__stack__notify_visible_child (GtkShortcutsWindow *self,
 
   visible_child = gtk_stack_get_visible_child (stack);
 
-  if (GTK_IS_SHORTCUTS_VIEW (visible_child))
+  if (GTK_IS_SHORTCUTS_SECTION (visible_child))
     {
       if (number_of_children (GTK_CONTAINER (stack)) > 3)
         {
           const gchar *title;
-          gtk_stack_set_visible_child_name (priv->title_stack, "views");
-          title = gtk_shortcuts_view_get_title (GTK_SHORTCUTS_VIEW (visible_child));
+          gtk_stack_set_visible_child_name (priv->title_stack, "sections");
+          title = gtk_shortcuts_section_get_title (GTK_SHORTCUTS_SECTION (visible_child));
           gtk_label_set_label (priv->menu_label, title);
         }
       else
@@ -187,7 +187,7 @@ gtk_shortcuts_window__list_box__row_activated (GtkShortcutsWindow *self,
   GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
   const gchar *name;
 
-  name = g_object_get_data (G_OBJECT (row), "GTK_SHORTCUTS_VIEW_NAME");
+  name = g_object_get_data (G_OBJECT (row), "GTK_SHORTCUTS_SECTION_NAME");
   gtk_stack_set_visible_child_name (priv->stack, name);
   gtk_widget_hide (GTK_WIDGET (priv->popover));
 }
@@ -286,7 +286,7 @@ gtk_shortcuts_window__entry__changed (GtkShortcutsWindow *self,
   gchar *downcase = NULL;
   GHashTableIter iter;
   const gchar *text;
-  const gchar *last_view_name;
+  const gchar *last_section_name;
   gpointer key;
   gpointer value;
   gboolean has_result;
@@ -295,20 +295,20 @@ gtk_shortcuts_window__entry__changed (GtkShortcutsWindow *self,
 
   if (!text || !*text)
     {
-      if (priv->last_view_name != NULL)
+      if (priv->last_section_name != NULL)
         {
-          gtk_stack_set_visible_child_name (priv->stack, priv->last_view_name);
+          gtk_stack_set_visible_child_name (priv->stack, priv->last_section_name);
           return;
         }
     }
 
-  last_view_name = gtk_stack_get_visible_child_name (priv->stack);
+  last_section_name = gtk_stack_get_visible_child_name (priv->stack);
 
-  if (g_strcmp0 (last_view_name, "internal-search") != 0 &&
-      g_strcmp0 (last_view_name, "no-search-results") != 0)
+  if (g_strcmp0 (last_section_name, "internal-search") != 0 &&
+      g_strcmp0 (last_section_name, "no-search-results") != 0)
     {
-      g_free (priv->last_view_name);
-      priv->last_view_name = g_strdup (last_view_name);
+      g_free (priv->last_section_name);
+      priv->last_section_name = g_strdup (last_section_name);
     }
 
   downcase = g_utf8_strdown (text, -1);
@@ -342,9 +342,9 @@ gtk_shortcuts_window__search_mode__changed (GtkShortcutsWindow *self)
 
   if (!gtk_search_bar_get_search_mode (priv->search_bar))
     {
-      if (priv->last_view_name != NULL)
+      if (priv->last_section_name != NULL)
         {
-          gtk_stack_set_visible_child_name (priv->stack, priv->last_view_name);
+          gtk_stack_set_visible_child_name (priv->stack, priv->last_section_name);
           return;
         }
     }
@@ -381,7 +381,7 @@ check_parent (GMarkupParseContext  *context,
 }
 
 static void
-views_parser_start_element (GMarkupParseContext  *context,
+sections_parser_start_element (GMarkupParseContext  *context,
                             const gchar          *element_name,
                             const gchar         **attribute_names,
                             const gchar         **attribute_values,
@@ -391,14 +391,14 @@ views_parser_start_element (GMarkupParseContext  *context,
   ViewsParserData *parser_data = user_data;
   GtkWidget *item;
 
-  if (g_strcmp0 (element_name, "views") == 0)
+  if (g_strcmp0 (element_name, "sections") == 0)
     {
     }
-  else if (g_strcmp0 (element_name, "view") == 0)
+  else if (g_strcmp0 (element_name, "section") == 0)
     {
       const gchar *name = NULL;
 
-      if (!check_parent (context, "views", error))
+      if (!check_parent (context, "sections", error))
         return;
 
       if (!g_markup_collect_attributes (element_name, attribute_names, attribute_values, error,
@@ -406,8 +406,8 @@ views_parser_start_element (GMarkupParseContext  *context,
                                         G_MARKUP_COLLECT_INVALID))
         return;
 
-      item = g_object_new (GTK_TYPE_SHORTCUTS_VIEW,
-                           "view-name", name,
+      item = g_object_new (GTK_TYPE_SHORTCUTS_SECTION,
+                           "section-name", name,
                            "visible", TRUE,
                            NULL);
 
@@ -415,7 +415,7 @@ views_parser_start_element (GMarkupParseContext  *context,
     }
   else if (g_strcmp0 (element_name, "page") == 0)
     {
-      if (!check_parent (context, "view", error))
+      if (!check_parent (context, "section", error))
         return;
 
       item = g_object_new (GTK_TYPE_SHORTCUTS_PAGE,
@@ -543,7 +543,7 @@ views_parser_start_element (GMarkupParseContext  *context,
 }
 
 static void
-views_parser_end_element (GMarkupParseContext  *context,
+sections_parser_end_element (GMarkupParseContext  *context,
                           const gchar          *element_name,
                           gpointer              user_data,
                           GError              **error)
@@ -551,10 +551,10 @@ views_parser_end_element (GMarkupParseContext  *context,
   ViewsParserData *parser_data = user_data;
   GtkWidget *item;
 
-  if (g_strcmp0 (element_name, "view") == 0)
+  if (g_strcmp0 (element_name, "section") == 0)
     {
       item = g_queue_pop_head (parser_data->stack);
-      gtk_shortcuts_window_add_view (parser_data->self, GTK_SHORTCUTS_VIEW (item));
+      gtk_shortcuts_window_add_section (parser_data->self, GTK_SHORTCUTS_SECTION (item));
       g_object_unref (item);
     }
   else if ((g_strcmp0 (element_name, "page") == 0) ||
@@ -596,7 +596,7 @@ views_parser_end_element (GMarkupParseContext  *context,
 }
 
 static void
-views_parser_text (GMarkupParseContext  *context,
+sections_parser_text (GMarkupParseContext  *context,
                    const gchar          *text,
                    gsize                 text_len,
                    gpointer              user_data,
@@ -663,9 +663,9 @@ views_parser_text (GMarkupParseContext  *context,
 }
 
 static GMarkupParser ViewsParser = {
-  views_parser_start_element,
-  views_parser_end_element,
-  views_parser_text,
+  sections_parser_start_element,
+  sections_parser_end_element,
+  sections_parser_text,
 };
 
 static gboolean
@@ -676,7 +676,7 @@ gtk_shortcuts_window_custom_tag_start (GtkBuildable  *buildable,
                                       GMarkupParser *parser,
                                       gpointer      *data)
 {
-  if (g_strcmp0 (tagname, "views") == 0)
+  if (g_strcmp0 (tagname, "sections") == 0)
     {
       ViewsParserData *parser_data;
 
@@ -703,7 +703,7 @@ gtk_shortcuts_window_custom_finished (GtkBuildable *buildable,
                                      const gchar  *tagname,
                                      gpointer      user_data)
 {
-  if (g_strcmp0 (tagname, "views") == 0)
+  if (g_strcmp0 (tagname, "sections") == 0)
     {
       ViewsParserData *parser_data = user_data;
 
@@ -730,8 +730,8 @@ gtk_shortcuts_window_constructed (GObject *object)
 
   G_OBJECT_CLASS (gtk_shortcuts_window_parent_class)->constructed (object);
 
-  if (priv->initial_view != NULL)
-    gtk_stack_set_visible_child_name (priv->stack, priv->initial_view);
+  if (priv->initial_section != NULL)
+    gtk_stack_set_visible_child_name (priv->stack, priv->initial_section);
 }
 
 static void
@@ -741,8 +741,8 @@ gtk_shortcuts_window_finalize (GObject *object)
   GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
 
   g_clear_pointer (&priv->keywords, g_hash_table_unref);
-  g_clear_pointer (&priv->initial_view, g_free);
-  g_clear_pointer (&priv->last_view_name, g_free);
+  g_clear_pointer (&priv->initial_section, g_free);
+  g_clear_pointer (&priv->last_section_name, g_free);
   g_clear_pointer (&priv->search_items_hash, g_hash_table_unref);
 
   g_clear_object (&priv->search_image_group);
@@ -769,7 +769,7 @@ gtk_shortcuts_window_get_property (GObject    *object,
 
   switch (prop_id)
     {
-    case PROP_VIEW_NAME:
+    case PROP_SECTION_NAME:
       {
         GtkWidget *child = gtk_stack_get_visible_child (priv->stack);
 
@@ -801,9 +801,9 @@ gtk_shortcuts_window_set_property (GObject      *object,
 
   switch (prop_id)
     {
-    case PROP_VIEW_NAME:
-      g_free (priv->initial_view);
-      priv->initial_view = g_value_dup_string (value);
+    case PROP_SECTION_NAME:
+      g_free (priv->initial_section);
+      priv->initial_section = g_value_dup_string (value);
       gtk_stack_set_visible_child_name (priv->stack, g_value_get_string (value));
       break;
 
@@ -828,8 +828,8 @@ gtk_shortcuts_window_class_init (GtkShortcutsWindowClass *klass)
 
   klass->close = gtk_shortcuts_window_real_close;
 
-  properties[PROP_VIEW_NAME] =
-    g_param_spec_string ("view-name",
+  properties[PROP_SECTION_NAME] =
+    g_param_spec_string ("section-name",
                          P_("View Name"),
                          P_("View Name"),
                          NULL,
@@ -947,7 +947,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
                                     "visible", TRUE,
                                     NULL);
   gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (priv->menu_button)), "flat");
-  gtk_stack_add_named (priv->title_stack, GTK_WIDGET (priv->menu_button), "views");
+  gtk_stack_add_named (priv->title_stack, GTK_WIDGET (priv->menu_button), "sections");
 
   menu_box = g_object_new (GTK_TYPE_BOX,
                            "orientation", GTK_ORIENTATION_HORIZONTAL,


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