[glade/modern-ui: 17/31] Rename GladeAdaptorChooser to GladeAdaptorChooserWidget



commit 1396e9e96cc5139b5471a756496e82565f5f44c7
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Sat Jun 24 22:45:25 2017 -0300

    Rename GladeAdaptorChooser to GladeAdaptorChooserWidget

 gladeui/Makefile.am                                |    6 +-
 ...or-chooser.c => glade-adaptor-chooser-widget.c} |  159 ++++++++++----------
 gladeui/glade-adaptor-chooser-widget.h             |   79 ++++++++++
 ...-chooser.ui => glade-adaptor-chooser-widget.ui} |    2 +-
 gladeui/glade-adaptor-chooser.h                    |   87 -----------
 gladeui/glade-design-view.c                        |   18 ++-
 gladeui/glade-placeholder.c                        |   19 ++-
 gladeui/gladeui-resources.gresource.xml            |    2 +-
 8 files changed, 184 insertions(+), 188 deletions(-)
---
diff --git a/gladeui/Makefile.am b/gladeui/Makefile.am
index 7510084..c1cc302 100644
--- a/gladeui/Makefile.am
+++ b/gladeui/Makefile.am
@@ -60,7 +60,7 @@ UI_FILES =                            \
        glade-design-layout.css         \
        glade-editor.ui                 \
        glade-project-properties.ui     \
-       glade-adaptor-chooser.ui        \
+       glade-adaptor-chooser-widget.ui \
        glade-property-label.ui
 
 GRAPHICS_FILES = \
@@ -85,7 +85,7 @@ libgladeui_2_la_SOURCES = \
        glade-accumulators.c \
        glade-app.c \
        glade-base-editor.c \
-       glade-adaptor-chooser.c \
+       glade-adaptor-chooser-widget.c \
        glade-builtins.c \
        glade-catalog.c \
        glade-cell-renderer-icon.c \
@@ -188,7 +188,7 @@ libgladeuiinclude_HEADERS = \
 
 noinst_HEADERS = \
        glade-accumulators.h \
-       glade-adaptor-chooser.h \
+       glade-adaptor-chooser-widget.h \
        glade-design-layout.h \
        glade-design-private.h \
        glade-marshallers.h \
diff --git a/gladeui/glade-adaptor-chooser.c b/gladeui/glade-adaptor-chooser-widget.c
similarity index 68%
rename from gladeui/glade-adaptor-chooser.c
rename to gladeui/glade-adaptor-chooser-widget.c
index ca46e09..36b7fad 100644
--- a/gladeui/glade-adaptor-chooser.c
+++ b/gladeui/glade-adaptor-chooser-widget.c
@@ -1,5 +1,5 @@
 /*
- * glade-adaptor-chooser.c
+ * glade-adaptor-chooser-widget.c
  *
  * Copyright (C) 2014-2017 Juan Pablo Ugarte
  *
@@ -23,7 +23,7 @@
 
 #include "glade-app.h"
 #include "gladeui-enum-types.h"
-#include "glade-adaptor-chooser.h"
+#include "glade-adaptor-chooser-widget.h"
 
 #include <string.h>
 
@@ -35,7 +35,7 @@ enum
   N_COLUMN
 };
 
-struct _GladeAdaptorChooserPrivate
+struct _GladeAdaptorChooserWidgetPrivate
 {
   GtkListStore       *store;
   GtkTreeModelFilter *treemodelfilter;
@@ -49,7 +49,7 @@ struct _GladeAdaptorChooserPrivate
   GtkCellRenderer   *adaptor_cell;
 
   /* Properties */
-  _GladeAdaptorChooserFlags flags;
+  _GladeAdaptorChooserWidgetFlags flags;
   GladeProject *project;
 };
 
@@ -70,31 +70,31 @@ enum
 
 static guint adaptor_chooser_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (_GladeAdaptorChooser, _glade_adaptor_chooser, GTK_TYPE_BOX);
+G_DEFINE_TYPE_WITH_PRIVATE (_GladeAdaptorChooserWidget, _glade_adaptor_chooser_widget, GTK_TYPE_BOX);
 
-#define GET_PRIVATE(d) ((_GladeAdaptorChooserPrivate *) 
_glade_adaptor_chooser_get_instance_private((_GladeAdaptorChooser*)d))
+#define GET_PRIVATE(d) ((_GladeAdaptorChooserWidgetPrivate *) 
_glade_adaptor_chooser_widget_get_instance_private((_GladeAdaptorChooserWidget*)d))
 
 static void
-_glade_adaptor_chooser_init (_GladeAdaptorChooser *chooser)
+_glade_adaptor_chooser_widget_init (_GladeAdaptorChooserWidget *chooser)
 {
   gtk_widget_init_template (GTK_WIDGET (chooser));
 }
 
 static void
-_glade_adaptor_chooser_finalize (GObject *object)
+_glade_adaptor_chooser_widget_finalize (GObject *object)
 {
-  G_OBJECT_CLASS (_glade_adaptor_chooser_parent_class)->finalize (object);
+  G_OBJECT_CLASS (_glade_adaptor_chooser_widget_parent_class)->finalize (object);
 }
 
 static void
-_glade_adaptor_chooser_set_property (GObject      *object, 
-                                     guint         prop_id,
-                                     const GValue *value,
-                                     GParamSpec   *pspec)
+_glade_adaptor_chooser_widget_set_property (GObject      *object, 
+                                            guint         prop_id,
+                                            const GValue *value,
+                                            GParamSpec   *pspec)
 { 
-  _GladeAdaptorChooserPrivate *priv;
+  _GladeAdaptorChooserWidgetPrivate *priv;
   
-  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER (object));
+  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER_WIDGET (object));
 
   priv = GET_PRIVATE (object);
 
@@ -104,8 +104,8 @@ _glade_adaptor_chooser_set_property (GObject      *object,
         priv->flags = g_value_get_flags (value);
       break;
       case PROP_PROJECT:
-        _glade_adaptor_chooser_set_project (GLADE_ADAPTOR_CHOOSER (object),
-                                            g_value_get_object (value));
+        _glade_adaptor_chooser_widget_set_project (GLADE_ADAPTOR_CHOOSER_WIDGET (object),
+                                                   g_value_get_object (value));
       break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -114,14 +114,14 @@ _glade_adaptor_chooser_set_property (GObject      *object,
 }
 
 static void
-_glade_adaptor_chooser_get_property (GObject    *object,
-                                     guint       prop_id,
-                                     GValue     *value,
-                                     GParamSpec *pspec)
+_glade_adaptor_chooser_widget_get_property (GObject    *object,
+                                            guint       prop_id,
+                                            GValue     *value,
+                                            GParamSpec *pspec)
 {
-  _GladeAdaptorChooserPrivate *priv;
+  _GladeAdaptorChooserWidgetPrivate *priv;
 
-  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER (object));
+  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER_WIDGET (object));
 
   priv = GET_PRIVATE (object);
 
@@ -162,10 +162,10 @@ store_append_adaptor (GtkListStore *store, GladeWidgetAdaptor *adaptor)
 }
 
 static void
-on_treeview_row_activated (GtkTreeView         *tree_view,
-                           GtkTreePath         *path,
-                           GtkTreeViewColumn   *column,
-                           _GladeAdaptorChooser *chooser)
+on_treeview_row_activated (GtkTreeView                *tree_view,
+                           GtkTreePath                *path,
+                           GtkTreeViewColumn          *column,
+                           _GladeAdaptorChooserWidget *chooser)
 {
   GtkTreeModel *model = gtk_tree_view_get_model (tree_view); 
   GtkTreeIter iter;
@@ -184,9 +184,9 @@ on_treeview_row_activated (GtkTreeView         *tree_view,
 }
 
 static void
-on_searchentry_activate (GtkEntry *entry, _GladeAdaptorChooser *chooser)
+on_searchentry_activate (GtkEntry *entry, _GladeAdaptorChooserWidget *chooser)
 {
-  _GladeAdaptorChooserPrivate *priv = GET_PRIVATE (chooser);
+  _GladeAdaptorChooserWidgetPrivate *priv = GET_PRIVATE (chooser);
   const gchar *text = gtk_entry_get_text (entry);
   GladeWidgetAdaptor *adaptor;
 
@@ -232,10 +232,10 @@ on_searchentry_activate (GtkEntry *entry, _GladeAdaptorChooser *chooser)
 }
 
 static gboolean
-chooser_match_func (_GladeAdaptorChooser *chooser,
-                    GtkTreeModel         *model,
-                    const gchar          *key,
-                    GtkTreeIter          *iter)
+chooser_match_func (_GladeAdaptorChooserWidget *chooser,
+                    GtkTreeModel               *model,
+                    const gchar                *key,
+                    GtkTreeIter                *iter)
 {
   gboolean visible;
   gint name_len;
@@ -258,7 +258,7 @@ chooser_match_func (_GladeAdaptorChooser *chooser,
 static gboolean
 treemodelfilter_visible_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 {
-  _GladeAdaptorChooserPrivate *priv = GET_PRIVATE (data);
+  _GladeAdaptorChooserWidgetPrivate *priv = GET_PRIVATE (data);
   GladeWidgetAdaptor *adaptor = NULL;
   gboolean visible = TRUE;
 
@@ -279,16 +279,16 @@ treemodelfilter_visible_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer d
   if (visible && adaptor && priv->flags)
     {
       GType type = glade_widget_adaptor_get_object_type (adaptor);
-      _GladeAdaptorChooserFlags flags = priv->flags;
+      _GladeAdaptorChooserWidgetFlags flags = priv->flags;
 
        /* Skip adaptors according to flags */
-       if (flags & GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED && GWA_DEPRECATED (adaptor))
+       if (flags & GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_DEPRECATED && GWA_DEPRECATED (adaptor))
          visible = FALSE;
-       else if (flags & GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL && GWA_IS_TOPLEVEL (adaptor))
+       else if (flags & GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_TOPLEVEL && GWA_IS_TOPLEVEL (adaptor))
          visible = FALSE;
-       else if (flags & GLADE_ADAPTOR_CHOOSER_WIDGET && !g_type_is_a (type, GTK_TYPE_WIDGET))
+       else if (flags & GLADE_ADAPTOR_CHOOSER_WIDGET_WIDGET && !g_type_is_a (type, GTK_TYPE_WIDGET))
          visible = FALSE;
-       else if (flags & GLADE_ADAPTOR_CHOOSER_TOPLEVEL && !GWA_IS_TOPLEVEL (adaptor))
+       else if (flags & GLADE_ADAPTOR_CHOOSER_WIDGET_TOPLEVEL && !GWA_IS_TOPLEVEL (adaptor))
          visible = FALSE;
     }
 
@@ -329,10 +329,10 @@ adaptor_cell_data_func (GtkTreeViewColumn *tree_column,
 }
 
 static void
-_glade_adaptor_chooser_constructed (GObject *object)
+_glade_adaptor_chooser_widget_constructed (GObject *object)
 {
-  _GladeAdaptorChooser *chooser = GLADE_ADAPTOR_CHOOSER (object);
-  _GladeAdaptorChooserPrivate *priv = GET_PRIVATE (chooser);
+  _GladeAdaptorChooserWidget *chooser = GLADE_ADAPTOR_CHOOSER_WIDGET (object);
+  _GladeAdaptorChooserWidgetPrivate *priv = GET_PRIVATE (chooser);
 
   /* Set cell data function: this save us from alocating name and icon name for each adaptor. */
   gtk_tree_view_column_set_cell_data_func (priv->column_icon,
@@ -356,39 +356,39 @@ _glade_adaptor_chooser_constructed (GObject *object)
 }
 
 static GType
-_glade_adaptor_chooser_flags_get_type (void)
+_glade_adaptor_chooser_widget_flags_get_type (void)
 {
     static GType etype = 0;
     if (G_UNLIKELY(etype == 0)) {
         static const GFlagsValue values[] = {
-            { GLADE_ADAPTOR_CHOOSER_WIDGET, "GLADE_ADAPTOR_CHOOSER_WIDGET", "widget" },
-            { GLADE_ADAPTOR_CHOOSER_TOPLEVEL, "GLADE_ADAPTOR_CHOOSER_TOPLEVEL", "toplevel" },
-            { GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL, "GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL", "skip-toplevel" },
-            { GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED, "GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED", 
"skip-deprecated" },
+            { GLADE_ADAPTOR_CHOOSER_WIDGET_WIDGET, "GLADE_ADAPTOR_CHOOSER_WIDGET_WIDGET", "widget" },
+            { GLADE_ADAPTOR_CHOOSER_WIDGET_TOPLEVEL, "GLADE_ADAPTOR_CHOOSER_WIDGET_TOPLEVEL", "toplevel" },
+            { GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_TOPLEVEL, "GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_TOPLEVEL", 
"skip-toplevel" },
+            { GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_DEPRECATED, "GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_DEPRECATED", 
"skip-deprecated" },
             { 0, NULL, NULL }
         };
-        etype = g_flags_register_static (g_intern_static_string ("_GladeAdaptorChooserFlag"), values);
+        etype = g_flags_register_static (g_intern_static_string ("_GladeAdaptorChooserWidgetFlag"), values);
     }
     return etype;
 }
 
 static void
-_glade_adaptor_chooser_class_init (_GladeAdaptorChooserClass *klass)
+_glade_adaptor_chooser_widget_class_init (_GladeAdaptorChooserWidgetClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-  object_class->finalize = _glade_adaptor_chooser_finalize;
-  object_class->set_property = _glade_adaptor_chooser_set_property;
-  object_class->get_property = _glade_adaptor_chooser_get_property;
-  object_class->constructed = _glade_adaptor_chooser_constructed;
+  object_class->finalize = _glade_adaptor_chooser_widget_finalize;
+  object_class->set_property = _glade_adaptor_chooser_widget_set_property;
+  object_class->get_property = _glade_adaptor_chooser_widget_get_property;
+  object_class->constructed = _glade_adaptor_chooser_widget_constructed;
 
   g_object_class_install_property (object_class,
                                    PROP_SHOW_FLAGS,
                                    g_param_spec_flags ("show-flags",
                                                        "Show flags",
                                                        "Widget adaptors show flags",
-                                                       _glade_adaptor_chooser_flags_get_type (),
+                                                       _glade_adaptor_chooser_widget_flags_get_type (),
                                                        0,
                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
   g_object_class_install_property (object_class,
@@ -405,35 +405,35 @@ _glade_adaptor_chooser_class_init (_GladeAdaptorChooserClass *klass)
                   G_TYPE_NONE, 1,
                   GLADE_TYPE_WIDGET_ADAPTOR);
 
-  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/gladeui/glade-adaptor-chooser.ui");
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, store);
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, treemodelfilter);
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, searchentry);
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, entrycompletion);
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, column_icon);
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, icon_cell);
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, column_adaptor);
-  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooser, adaptor_cell);
+  gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/gladeui/glade-adaptor-chooser-widget.ui");
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, store);
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, treemodelfilter);
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, searchentry);
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, entrycompletion);
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, column_icon);
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, icon_cell);
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, column_adaptor);
+  gtk_widget_class_bind_template_child_private (widget_class, _GladeAdaptorChooserWidget, adaptor_cell);
   gtk_widget_class_bind_template_callback (widget_class, on_treeview_row_activated);
   gtk_widget_class_bind_template_callback (widget_class, on_searchentry_activate);
 }
 
 GtkWidget *
-_glade_adaptor_chooser_new (_GladeAdaptorChooserFlags flags, GladeProject *project)
+_glade_adaptor_chooser_widget_new (_GladeAdaptorChooserWidgetFlags flags, GladeProject *project)
 {
-  return GTK_WIDGET (g_object_new (GLADE_TYPE_ADAPTOR_CHOOSER,
+  return GTK_WIDGET (g_object_new (GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET,
                                    "show-flags", flags,
                                    "project", project,
                                    NULL));
 }
 
 void
-_glade_adaptor_chooser_set_project (_GladeAdaptorChooser *chooser,
-                                    GladeProject        *project)
+_glade_adaptor_chooser_widget_set_project (_GladeAdaptorChooserWidget *chooser,
+                                           GladeProject               *project)
 {
-  _GladeAdaptorChooserPrivate *priv;
+  _GladeAdaptorChooserWidgetPrivate *priv;
 
-  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER (chooser));
+  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER_WIDGET (chooser));
   priv = GET_PRIVATE (chooser);
 
   g_clear_object (&priv->project);
@@ -445,38 +445,39 @@ _glade_adaptor_chooser_set_project (_GladeAdaptorChooser *chooser,
 }
 
 void
-_glade_adaptor_chooser_populate (_GladeAdaptorChooser *chooser)
+_glade_adaptor_chooser_widget_populate (_GladeAdaptorChooserWidget *chooser)
 {
   GList *l;
 
   for (l = glade_app_get_catalogs (); l; l = g_list_next (l))
-    _glade_adaptor_chooser_add_catalog (chooser, l->data);
+    _glade_adaptor_chooser_widget_add_catalog (chooser, l->data);
 }
 
 void
-_glade_adaptor_chooser_add_catalog (_GladeAdaptorChooser *chooser,
-                                    GladeCatalog         *catalog)
+_glade_adaptor_chooser_widget_add_catalog (_GladeAdaptorChooserWidget *chooser,
+                                           GladeCatalog                *catalog)
 {
   GList *groups;
 
-  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER (chooser));
+  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER_WIDGET (chooser));
 
   for (groups = glade_catalog_get_widget_groups (catalog); groups;
        groups = g_list_next (groups))
-    _glade_adaptor_chooser_add_group (chooser, groups->data);
+    _glade_adaptor_chooser_widget_add_group (chooser, groups->data);
 }
 
 void
-_glade_adaptor_chooser_add_group (_GladeAdaptorChooser *chooser,
-                                  GladeWidgetGroup     *group)
+_glade_adaptor_chooser_widget_add_group (_GladeAdaptorChooserWidget *chooser,
+                                         GladeWidgetGroup            *group)
 {
-  _GladeAdaptorChooserPrivate *priv;
+  _GladeAdaptorChooserWidgetPrivate *priv;
   const GList *adaptors;
 
-  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER (chooser));
+  g_return_if_fail (GLADE_IS_ADAPTOR_CHOOSER_WIDGET (chooser));
   priv = GET_PRIVATE (chooser);
 
   for (adaptors = glade_widget_group_get_adaptors (group); adaptors;
        adaptors = g_list_next (adaptors))
     store_append_adaptor (priv->store, adaptors->data);
 }
+
diff --git a/gladeui/glade-adaptor-chooser-widget.h b/gladeui/glade-adaptor-chooser-widget.h
new file mode 100644
index 0000000..d6be155
--- /dev/null
+++ b/gladeui/glade-adaptor-chooser-widget.h
@@ -0,0 +1,79 @@
+/*
+ * glade-adaptor-chooser-widget.h
+ *
+ * Copyright (C) 2014-2017 Juan Pablo Ugarte
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public 
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Authors:
+ *   Juan Pablo Ugarte <juanpablougarte gmail com>
+ */
+
+#ifndef _GLADE_ADAPTOR_CHOOSER_WIDGET_H_
+#define _GLADE_ADAPTOR_CHOOSER_WIDGET_H_
+
+#include <gladeui/glade-widget-adaptor.h>
+
+G_BEGIN_DECLS
+
+#define GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET           (_glade_adaptor_chooser_widget_get_type ())
+#define GLADE_ADAPTOR_CHOOSER_WIDGET(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET, _GladeAdaptorChooserWidget))
+#define GLADE_ADAPTOR_CHOOSER_WIDGET_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), 
GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET, _GladeAdaptorChooserWidgetClass))
+#define GLADE_IS_ADAPTOR_CHOOSER_WIDGET(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET))
+#define GLADE_IS_ADAPTOR_CHOOSER_WIDGET_CLASS(klass)(G_TYPE_CHECK_CLASS_TYPE ((klass), 
GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET))
+#define GLADE_ADAPTOR_CHOOSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET, _GladeAdaptorChooserWidgetClass))
+
+typedef struct _GladeAdaptorChooserWidgetClass   _GladeAdaptorChooserWidgetClass;
+typedef struct _GladeAdaptorChooserWidget        _GladeAdaptorChooserWidget;
+typedef struct _GladeAdaptorChooserWidgetPrivate _GladeAdaptorChooserWidgetPrivate;
+
+typedef enum
+{
+  GLADE_ADAPTOR_CHOOSER_WIDGET_WIDGET          = 1 << 0,
+  GLADE_ADAPTOR_CHOOSER_WIDGET_TOPLEVEL        = 1 << 1,
+  GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_TOPLEVEL   = 1 << 2,
+  GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_DEPRECATED = 1 << 3
+} _GladeAdaptorChooserWidgetFlags;
+
+struct _GladeAdaptorChooserWidgetClass
+{
+  GtkBoxClass parent_class;
+};
+
+struct _GladeAdaptorChooserWidget
+{
+  GtkBox parent_instance;
+};
+
+GType _glade_adaptor_chooser_widget_get_type (void) G_GNUC_CONST;
+
+GtkWidget *_glade_adaptor_chooser_widget_new (_GladeAdaptorChooserWidgetFlags  flags,
+                                              GladeProject                    *project);
+
+void      _glade_adaptor_chooser_widget_set_project (_GladeAdaptorChooserWidget *chooser,
+                                                     GladeProject               *project);
+
+void      _glade_adaptor_chooser_widget_populate    (_GladeAdaptorChooserWidget *chooser);
+
+void      _glade_adaptor_chooser_widget_add_catalog (_GladeAdaptorChooserWidget *chooser,
+                                                     GladeCatalog               *catalog);
+
+void      _glade_adaptor_chooser_widget_add_group   (_GladeAdaptorChooserWidget *chooser,
+                                                     GladeWidgetGroup           *group);
+
+G_END_DECLS
+
+#endif /* _GLADE_ADAPTOR_CHOOSER_WIDGET_H_ */
+
diff --git a/gladeui/glade-adaptor-chooser.ui b/gladeui/glade-adaptor-chooser-widget.ui
similarity index 98%
rename from gladeui/glade-adaptor-chooser.ui
rename to gladeui/glade-adaptor-chooser-widget.ui
index 0095eea..4ff85df 100644
--- a/gladeui/glade-adaptor-chooser.ui
+++ b/gladeui/glade-adaptor-chooser-widget.ui
@@ -22,7 +22,7 @@
     <property name="popup_completion">False</property>
     <property name="popup_single_match">False</property>
   </object>
-  <template class="_GladeAdaptorChooser" parent="GtkBox">
+  <template class="_GladeAdaptorChooserWidget" parent="GtkBox">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
diff --git a/gladeui/glade-design-view.c b/gladeui/glade-design-view.c
index 2d5abe8..fcd0035 100644
--- a/gladeui/glade-design-view.c
+++ b/gladeui/glade-design-view.c
@@ -41,7 +41,7 @@
 #include "glade-design-layout.h"
 #include "glade-design-private.h"
 #include "glade-path.h"
-#include "glade-adaptor-chooser.h"
+#include "glade-adaptor-chooser-widget.h"
 
 #include <glib.h>
 #include <glib/gi18n.h>
@@ -326,9 +326,9 @@ logo_draw (GtkWidget *widget, cairo_t *cr, GdkRGBA *c)
 }
 
 static void
-on_chooser_adaptor_selected (_GladeAdaptorChooser *chooser,
-                             GladeWidgetAdaptor   *adaptor,
-                             GladeProject         *project)
+on_chooser_adaptor_widget_selected (_GladeAdaptorChooserWidget *chooser,
+                                    GladeWidgetAdaptor         *adaptor,
+                                    GladeProject               *project)
 
 {
   glade_command_create (adaptor, NULL, NULL, project);
@@ -351,11 +351,13 @@ glade_design_view_viewport_button_press (GtkWidget       *widget,
   gtk_popover_set_pointing_to (GTK_POPOVER (pop), &rect);
   gtk_popover_set_position (GTK_POPOVER (pop), GTK_POS_BOTTOM);
   
-  chooser = _glade_adaptor_chooser_new (GLADE_ADAPTOR_CHOOSER_TOPLEVEL |
-                                        GLADE_ADAPTOR_CHOOSER_WIDGET,
-                                        priv->project);
+  chooser = _glade_adaptor_chooser_widget_new (GLADE_ADAPTOR_CHOOSER_WIDGET_TOPLEVEL |
+                                               GLADE_ADAPTOR_CHOOSER_WIDGET_WIDGET |
+                                               GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_DEPRECATED,
+                                               priv->project);
+  _glade_adaptor_chooser_widget_populate (GLADE_ADAPTOR_CHOOSER_WIDGET (chooser));
   g_signal_connect (chooser, "adaptor-selected",
-                    G_CALLBACK (on_chooser_adaptor_selected),
+                    G_CALLBACK (on_chooser_adaptor_widget_selected),
                     priv->project);
 
   gtk_container_add (GTK_CONTAINER (pop), chooser);
diff --git a/gladeui/glade-placeholder.c b/gladeui/glade-placeholder.c
index d363168..cf33946 100644
--- a/gladeui/glade-placeholder.c
+++ b/gladeui/glade-placeholder.c
@@ -45,7 +45,7 @@
 #include "glade-cursor.h"
 #include "glade-widget.h"
 #include "glade-app.h"
-#include "glade-adaptor-chooser.h"
+#include "glade-adaptor-chooser-widget.h"
 #include <math.h>
 
 #include "glade-dnd.h"
@@ -386,9 +386,9 @@ glade_placeholder_motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
 }
 
 static void
-on_chooser_adaptor_selected (_GladeAdaptorChooser *chooser,
-                             GladeWidgetAdaptor  *adaptor,
-                             GladePlaceholder    *placeholder)
+on_chooser_adaptor_widget_selected (_GladeAdaptorChooserWidget *chooser,
+                                    GladeWidgetAdaptor         *adaptor,
+                                    GladePlaceholder           *placeholder)
 
 {
   glade_command_create (adaptor, glade_placeholder_get_parent (placeholder),
@@ -402,12 +402,13 @@ glade_placeholder_popover_new (GladePlaceholder *placeholder, GtkWidget *relativ
   GtkWidget *pop = gtk_popover_new (relative_to);
   GtkWidget *chooser;
 
-  chooser = _glade_adaptor_chooser_new (GLADE_ADAPTOR_CHOOSER_WIDGET |
-                                        GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL,
-                                        glade_placeholder_get_project (placeholder));
-
+  chooser = _glade_adaptor_chooser_widget_new (GLADE_ADAPTOR_CHOOSER_WIDGET_WIDGET |
+                                               GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_TOPLEVEL |
+                                               GLADE_ADAPTOR_CHOOSER_WIDGET_SKIP_DEPRECATED,
+                                               glade_placeholder_get_project (placeholder));
+  _glade_adaptor_chooser_widget_populate (GLADE_ADAPTOR_CHOOSER_WIDGET (chooser));
   g_signal_connect (chooser, "adaptor-selected",
-                    G_CALLBACK (on_chooser_adaptor_selected),
+                    G_CALLBACK (on_chooser_adaptor_widget_selected),
                     placeholder);
   gtk_popover_set_position (GTK_POPOVER (pop), GTK_POS_BOTTOM);
   gtk_container_add (GTK_CONTAINER (pop), chooser);
diff --git a/gladeui/gladeui-resources.gresource.xml b/gladeui/gladeui-resources.gresource.xml
index cb35689..205f83e 100644
--- a/gladeui/gladeui-resources.gresource.xml
+++ b/gladeui/gladeui-resources.gresource.xml
@@ -6,6 +6,6 @@
     <file compressed="true" preprocess="xml-stripblanks">glade-editor.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">glade-project-properties.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">glade-property-label.ui</file>
-    <file compressed="true" preprocess="xml-stripblanks">glade-adaptor-chooser.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">glade-adaptor-chooser-widget.ui</file>
   </gresource>
 </gresources>


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