[glade3] * gladeui/glade-editor.[ch]: Privatized members of GladeEditor.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] * gladeui/glade-editor.[ch]: Privatized members of GladeEditor.
- Date: Tue, 4 Jan 2011 07:44:28 +0000 (UTC)
commit 8f34c79a9a5574e36e88f8d66e5615044fa325be
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Tue Jan 4 16:43:14 2011 +0900
* gladeui/glade-editor.[ch]: Privatized members of GladeEditor.
ChangeLog | 2 +
gladeui/glade-editor.c | 305 +++++++++++++++++++++++++++++-------------------
gladeui/glade-editor.h | 109 ++---------------
3 files changed, 199 insertions(+), 217 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b706763..1d042e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,8 @@
* Adding padding to classes in various files.
+ * gladeui/glade-editor.[ch]: Privatized members of GladeEditor.
+
2011-01-03 Tristan Van Berkom <tristanvb openismus com>
* gladeui/glade-app.[ch]:
diff --git a/gladeui/glade-editor.c b/gladeui/glade-editor.c
index ee1e5c3..34c2470 100644
--- a/gladeui/glade-editor.c
+++ b/gladeui/glade-editor.c
@@ -61,6 +61,80 @@ enum
static GtkVBoxClass *parent_class = NULL;
+struct _GladeEditorPrivate
+{
+
+ GtkWidget *notebook; /* The notebook widget */
+
+ GladeWidget *loaded_widget; /* A handy pointer to the GladeWidget
+ * that is loaded in the editor. NULL
+ * if no widgets are selected
+ */
+
+ GladeWidgetAdaptor *loaded_adaptor; /* A pointer to the loaded
+ * GladeWidgetAdaptor. Note that we can
+ * have a class loaded without a
+ * loaded_widget. For this reason we
+ * can't use loaded_widget->adaptor.
+ * When a widget is selected we load
+ * this class in the editor first and
+ * then fill the values of the inputs
+ * with the GladeProperty items.
+ * This is usefull for not having
+ * to redraw/container_add the widgets
+ * when we switch from widgets of the
+ * same class
+ */
+
+ GtkWidget *page_widget;
+ GtkWidget *page_packing;
+ GtkWidget *page_common;
+ GtkWidget *page_signals;
+ GtkWidget *page_atk;
+
+ GladeSignalEditor *signal_editor; /* The signal editor packed into vbox_signals
+ */
+
+ GList *editables; /* A list of GladeEditables. We have a widget
+ * for each GladeWidgetAdaptor and we only load
+ * them on demand
+ */
+
+ GtkWidget *packing_page; /* Packing pages are dynamicly created each
+ * selection, this pointer is only to free
+ * the last packing page.
+ */
+
+ gboolean loading; /* Use when loading a GladeWidget into the editor
+ * we set this flag so that we can ignore the
+ * "changed" signal of the name entry text since
+ * the name has not really changed, just a new name
+ * was loaded.
+ */
+
+ gulong project_closed_signal_id; /* Unload widget when widget's project closes */
+ gulong project_removed_signal_id; /* Unload widget when its removed from the project. */
+ gulong widget_warning_id; /* Update when widget changes warning messages. */
+ gulong widget_name_id; /* Update class field when widget name changes */
+
+ GtkWidget *reset_button; /* The reset button */
+ GtkWidget *info_button; /* The actual informational button */
+
+ GtkWidget *class_field; /* The class header */
+
+ GtkWidget *warning; /* A pointer to an icon we can show in the class
+ * field to publish tooltips for class related
+ * versioning errors.
+ */
+
+ GtkWidget *class_icon; /* An image with the current widget's class icon. */
+ GtkWidget *class_label; /* A label with the current class label. */
+ GtkWidget *widget_label; /* A label with the current widget name. */
+
+ gboolean show_info; /* Whether or not to show an informational button */
+};
+
+
static void glade_editor_reset_dialog (GladeEditor * editor);
static void
@@ -97,10 +171,10 @@ glade_editor_get_property (GObject * object,
switch (prop_id)
{
case PROP_SHOW_INFO:
- g_value_set_boolean (value, editor->show_info);
+ g_value_set_boolean (value, editor->priv->show_info);
break;
case PROP_WIDGET:
- g_value_set_object (value, editor->loaded_widget);
+ g_value_set_object (value, editor->priv->loaded_widget);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -136,6 +210,7 @@ glade_editor_class_init (GladeEditorClass * klass)
_("The currently loaded widget in this editor"),
GLADE_TYPE_WIDGET, G_PARAM_READWRITE));
+ g_type_class_add_private (klass, sizeof (GladeEditorPrivate));
}
static GtkWidget *
@@ -176,7 +251,7 @@ glade_editor_notebook_page (GladeEditor * editor, const gchar * name)
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 0, 0);
gtk_container_set_border_width (GTK_CONTAINER (alignment), 6);
- gtk_notebook_insert_page (GTK_NOTEBOOK (editor->notebook), alignment,
+ gtk_notebook_insert_page (GTK_NOTEBOOK (editor->priv->notebook), alignment,
label_widget, page++);
}
else
@@ -190,7 +265,7 @@ glade_editor_notebook_page (GladeEditor * editor, const gchar * name)
GTK_WIDGET (alignment));
gtk_container_set_border_width (GTK_CONTAINER (sw), 6);
- gtk_notebook_insert_page (GTK_NOTEBOOK (editor->notebook), sw,
+ gtk_notebook_insert_page (GTK_NOTEBOOK (editor->priv->notebook), sw,
label_widget, page++);
}
@@ -209,11 +284,11 @@ glade_editor_on_docs_click (GtkButton * button, GladeEditor * editor)
{
gchar *book;
- if (editor->loaded_widget)
+ if (editor->priv->loaded_widget)
{
- g_object_get (editor->loaded_adaptor, "book", &book, NULL);
+ g_object_get (editor->priv->loaded_adaptor, "book", &book, NULL);
glade_app_search_docs (book,
- glade_widget_adaptor_get_name (editor->loaded_adaptor),
+ glade_widget_adaptor_get_name (editor->priv->loaded_adaptor),
NULL);
g_free (book);
}
@@ -266,43 +341,43 @@ glade_editor_update_class_warning_cb (GladeWidget * widget,
GParamSpec * pspec, GladeEditor * editor)
{
if (glade_widget_support_warning (widget))
- gtk_widget_show (editor->warning);
+ gtk_widget_show (editor->priv->warning);
else
- gtk_widget_hide (editor->warning);
+ gtk_widget_hide (editor->priv->warning);
- gtk_widget_set_tooltip_text (editor->warning, glade_widget_support_warning (widget));
+ gtk_widget_set_tooltip_text (editor->priv->warning, glade_widget_support_warning (widget));
}
static void
glade_editor_update_class_field (GladeEditor * editor)
{
- if (editor->loaded_widget)
+ if (editor->priv->loaded_widget)
{
- GladeWidget *widget = editor->loaded_widget;
+ GladeWidget *widget = editor->priv->loaded_widget;
gchar *text;
- gtk_image_set_from_icon_name (GTK_IMAGE (editor->class_icon),
- glade_widget_adaptor_get_icon_name (editor->loaded_adaptor),
+ gtk_image_set_from_icon_name (GTK_IMAGE (editor->priv->class_icon),
+ glade_widget_adaptor_get_icon_name (editor->priv->loaded_adaptor),
GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (editor->class_icon);
+ gtk_widget_show (editor->priv->class_icon);
/* translators: referring to the properties of a widget named '%s [%s]' */
text = g_strdup_printf (_("%s Properties - %s [%s]"),
- glade_widget_adaptor_get_title (editor->loaded_adaptor),
- glade_widget_adaptor_get_name (editor->loaded_adaptor),
+ glade_widget_adaptor_get_title (editor->priv->loaded_adaptor),
+ glade_widget_adaptor_get_name (editor->priv->loaded_adaptor),
glade_widget_get_name (widget));
- gtk_label_set_text (GTK_LABEL (editor->class_label), text);
+ gtk_label_set_text (GTK_LABEL (editor->priv->class_label), text);
g_free (text);
- glade_editor_update_class_warning_cb (editor->loaded_widget, NULL,
+ glade_editor_update_class_warning_cb (editor->priv->loaded_widget, NULL,
editor);
}
else
{
- gtk_widget_hide (editor->class_icon);
- gtk_widget_hide (editor->warning);
- gtk_label_set_text (GTK_LABEL (editor->class_label), _("Properties"));
+ gtk_widget_hide (editor->priv->class_icon);
+ gtk_widget_hide (editor->priv->warning);
+ gtk_label_set_text (GTK_LABEL (editor->priv->class_label), _("Properties"));
}
}
@@ -320,21 +395,21 @@ glade_editor_setup_class_field (GladeEditor * editor)
hbox = gtk_hbox_new (FALSE, 4);
- editor->class_icon = gtk_image_new ();
- editor->class_label = gtk_label_new (NULL);
- editor->warning = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
+ editor->priv->class_icon = gtk_image_new ();
+ editor->priv->class_label = gtk_label_new (NULL);
+ editor->priv->warning = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_MENU);
- gtk_widget_set_no_show_all (editor->warning, TRUE);
- gtk_widget_set_no_show_all (editor->class_icon, TRUE);
+ gtk_widget_set_no_show_all (editor->priv->warning, TRUE);
+ gtk_widget_set_no_show_all (editor->priv->class_icon, TRUE);
- gtk_misc_set_alignment (GTK_MISC (editor->class_label), 0.0, 0.5);
- gtk_label_set_ellipsize (GTK_LABEL (editor->class_label),
+ gtk_misc_set_alignment (GTK_MISC (editor->priv->class_label), 0.0, 0.5);
+ gtk_label_set_ellipsize (GTK_LABEL (editor->priv->class_label),
PANGO_ELLIPSIZE_END);
- gtk_box_pack_start (GTK_BOX (hbox), editor->class_icon, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), editor->warning, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), editor->class_label, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), editor->priv->class_icon, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), editor->priv->warning, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), editor->priv->class_label, TRUE, TRUE, 0);
glade_editor_update_class_field (editor);
gtk_widget_show_all (hbox);
@@ -348,21 +423,24 @@ glade_editor_init (GladeEditor * editor)
GtkSizeGroup *size_group;
GtkWidget *hbox;
- editor->notebook = gtk_notebook_new ();
- editor->page_widget = glade_editor_notebook_page (editor, _("_General"));
- editor->page_packing = glade_editor_notebook_page (editor, _("_Packing"));
- editor->page_common = glade_editor_notebook_page (editor, _("_Common"));
- editor->page_signals = glade_editor_notebook_page (editor, _("_Signals"));
- editor->page_atk = glade_editor_notebook_page (editor, _("Accessibility"));
- editor->editables = NULL;
- editor->loading = FALSE;
+ editor->priv =
+ G_TYPE_INSTANCE_GET_PRIVATE ((editor), GLADE_TYPE_EDITOR, GladeEditorPrivate);
+
+ editor->priv->notebook = gtk_notebook_new ();
+ editor->priv->page_widget = glade_editor_notebook_page (editor, _("_General"));
+ editor->priv->page_packing = glade_editor_notebook_page (editor, _("_Packing"));
+ editor->priv->page_common = glade_editor_notebook_page (editor, _("_Common"));
+ editor->priv->page_signals = glade_editor_notebook_page (editor, _("_Signals"));
+ editor->priv->page_atk = glade_editor_notebook_page (editor, _("Accessibility"));
+ editor->priv->editables = NULL;
+ editor->priv->loading = FALSE;
- editor->class_field = glade_editor_setup_class_field (editor);
+ editor->priv->class_field = glade_editor_setup_class_field (editor);
- gtk_container_set_border_width (GTK_CONTAINER (editor->notebook), 0);
+ gtk_container_set_border_width (GTK_CONTAINER (editor->priv->notebook), 0);
- gtk_box_pack_start (GTK_BOX (editor), editor->class_field, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (editor), editor->notebook, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (editor), editor->priv->class_field, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (editor), editor->priv->notebook, TRUE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
@@ -371,22 +449,22 @@ glade_editor_init (GladeEditor * editor)
size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
/* Reset button */
- editor->reset_button = glade_editor_create_reset_button (editor);
- gtk_box_pack_end (GTK_BOX (hbox), editor->reset_button, FALSE, FALSE, 0);
- gtk_size_group_add_widget (size_group, editor->reset_button);
+ editor->priv->reset_button = glade_editor_create_reset_button (editor);
+ gtk_box_pack_end (GTK_BOX (hbox), editor->priv->reset_button, FALSE, FALSE, 0);
+ gtk_size_group_add_widget (size_group, editor->priv->reset_button);
/* Documentation button */
- editor->info_button = glade_editor_create_info_button (editor);
- gtk_box_pack_end (GTK_BOX (hbox), editor->info_button, FALSE, FALSE, 0);
- gtk_size_group_add_widget (size_group, editor->info_button);
+ editor->priv->info_button = glade_editor_create_info_button (editor);
+ gtk_box_pack_end (GTK_BOX (hbox), editor->priv->info_button, FALSE, FALSE, 0);
+ gtk_size_group_add_widget (size_group, editor->priv->info_button);
g_object_unref (size_group);
gtk_widget_show_all (GTK_WIDGET (editor));
- if (editor->show_info)
- gtk_widget_show (editor->info_button);
+ if (editor->priv->show_info)
+ gtk_widget_show (editor->priv->info_button);
else
- gtk_widget_hide (editor->info_button);
+ gtk_widget_hide (editor->priv->info_button);
gtk_widget_hide (GTK_WIDGET (editor));
}
@@ -441,7 +519,7 @@ glade_editor_get_editable_by_adaptor (GladeEditor * editor,
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
- for (list = editor->editables; list; list = list->next)
+ for (list = editor->priv->editables; list; list = list->next)
{
editable = list->data;
if (type !=
@@ -462,7 +540,7 @@ glade_editor_get_editable_by_adaptor (GladeEditor * editor,
if (type != GLADE_PAGE_PACKING)
{
- editor->editables = g_list_prepend (editor->editables, editable);
+ editor->priv->editables = g_list_prepend (editor->priv->editables, editable);
g_object_ref_sink (editable);
}
@@ -482,16 +560,16 @@ glade_editor_load_editable_in_page (GladeEditor * editor,
switch (type)
{
case GLADE_PAGE_GENERAL:
- container = GTK_CONTAINER (editor->page_widget);
+ container = GTK_CONTAINER (editor->priv->page_widget);
break;
case GLADE_PAGE_COMMON:
- container = GTK_CONTAINER (editor->page_common);
+ container = GTK_CONTAINER (editor->priv->page_common);
break;
case GLADE_PAGE_PACKING:
- container = GTK_CONTAINER (editor->page_packing);
+ container = GTK_CONTAINER (editor->priv->page_packing);
break;
case GLADE_PAGE_ATK:
- container = GTK_CONTAINER (editor->page_atk);
+ container = GTK_CONTAINER (editor->priv->page_atk);
break;
case GLADE_PAGE_QUERY:
default:
@@ -541,24 +619,24 @@ void
glade_editor_set_signal_editor (GladeEditor * editor,
GladeSignalEditor * signal_editor)
{
- if (editor->signal_editor)
+ if (editor->priv->signal_editor)
{
- gtk_container_remove (GTK_CONTAINER (editor->page_signals),
- GTK_WIDGET (editor->signal_editor));
+ gtk_container_remove (GTK_CONTAINER (editor->priv->page_signals),
+ GTK_WIDGET (editor->priv->signal_editor));
}
- editor->signal_editor = signal_editor;
- gtk_container_add (GTK_CONTAINER (editor->page_signals),
- GTK_WIDGET (editor->signal_editor));
+ editor->priv->signal_editor = signal_editor;
+ gtk_container_add (GTK_CONTAINER (editor->priv->page_signals),
+ GTK_WIDGET (editor->priv->signal_editor));
}
static void
glade_editor_load_signal_page (GladeEditor * editor)
{
- if (editor->signal_editor == NULL)
+ if (editor->priv->signal_editor == NULL)
{
- editor->signal_editor = glade_signal_editor_new ((gpointer) editor);
- gtk_container_add (GTK_CONTAINER (editor->page_signals),
- GTK_WIDGET (editor->signal_editor));
+ editor->priv->signal_editor = glade_signal_editor_new ((gpointer) editor);
+ gtk_container_add (GTK_CONTAINER (editor->priv->page_signals),
+ GTK_WIDGET (editor->priv->signal_editor));
}
}
@@ -573,7 +651,7 @@ glade_editor_load_widget_class (GladeEditor * editor,
glade_editor_load_signal_page (editor);
- editor->loaded_adaptor = adaptor;
+ editor->priv->loaded_adaptor = adaptor;
}
static void
@@ -592,7 +670,7 @@ glade_editor_removed_cb (GladeProject * project,
/* Widget we were viewing was removed from project,
* detatch from editor.
*/
- if (widget == editor->loaded_widget)
+ if (widget == editor->priv->loaded_widget)
glade_editor_load_widget (editor, NULL);
}
@@ -638,7 +716,7 @@ clear_editables (GladeEditor * editor)
GladeEditable *editable;
GList *l;
- for (l = editor->editables; l; l = l->next)
+ for (l = editor->priv->editables; l; l = l->next)
{
editable = l->data;
glade_editable_load (editable, NULL);
@@ -653,38 +731,38 @@ glade_editor_load_widget_real (GladeEditor * editor, GladeWidget * widget)
gchar *book;
/* Disconnect from last widget */
- if (editor->loaded_widget != NULL)
+ if (editor->priv->loaded_widget != NULL)
{
/* better pay a small price now and avoid unseen editables
* waking up on project metadata changes.
*/
clear_editables (editor);
- project = glade_widget_get_project (editor->loaded_widget);
+ project = glade_widget_get_project (editor->priv->loaded_widget);
g_signal_handler_disconnect (G_OBJECT (project),
- editor->project_closed_signal_id);
+ editor->priv->project_closed_signal_id);
g_signal_handler_disconnect (G_OBJECT (project),
- editor->project_removed_signal_id);
- g_signal_handler_disconnect (G_OBJECT (editor->loaded_widget),
- editor->widget_warning_id);
- g_signal_handler_disconnect (G_OBJECT (editor->loaded_widget),
- editor->widget_name_id);
+ editor->priv->project_removed_signal_id);
+ g_signal_handler_disconnect (G_OBJECT (editor->priv->loaded_widget),
+ editor->priv->widget_warning_id);
+ g_signal_handler_disconnect (G_OBJECT (editor->priv->loaded_widget),
+ editor->priv->widget_name_id);
}
/* Load the GladeWidgetClass */
adaptor = widget ? glade_widget_get_adaptor (widget) : NULL;
- if (editor->loaded_adaptor != adaptor || adaptor == NULL)
+ if (editor->priv->loaded_adaptor != adaptor || adaptor == NULL)
glade_editor_load_widget_class (editor, adaptor);
- glade_signal_editor_load_widget (editor->signal_editor, widget);
+ glade_signal_editor_load_widget (editor->priv->signal_editor, widget);
/* we are just clearing, we are done */
if (widget == NULL)
{
- gtk_widget_set_sensitive (editor->reset_button, FALSE);
- gtk_widget_set_sensitive (editor->info_button, FALSE);
+ gtk_widget_set_sensitive (editor->priv->reset_button, FALSE);
+ gtk_widget_set_sensitive (editor->priv->info_button, FALSE);
- editor->loaded_widget = NULL;
+ editor->priv->loaded_widget = NULL;
/* Clear class header */
glade_editor_update_class_field (editor);
@@ -692,13 +770,13 @@ glade_editor_load_widget_real (GladeEditor * editor, GladeWidget * widget)
g_object_notify (G_OBJECT (editor), "widget");
return;
}
- gtk_widget_set_sensitive (editor->reset_button, TRUE);
+ gtk_widget_set_sensitive (editor->priv->reset_button, TRUE);
- g_object_get (editor->loaded_adaptor, "book", &book, NULL);
- gtk_widget_set_sensitive (editor->info_button, book != NULL);
+ g_object_get (editor->priv->loaded_adaptor, "book", &book, NULL);
+ gtk_widget_set_sensitive (editor->priv->info_button, book != NULL);
g_free (book);
- editor->loading = TRUE;
+ editor->priv->loading = TRUE;
/* Load each GladeEditorProperty from 'widget' */
glade_editor_load_editable (editor, widget, GLADE_PAGE_GENERAL);
@@ -706,25 +784,25 @@ glade_editor_load_widget_real (GladeEditor * editor, GladeWidget * widget)
glade_editor_load_editable (editor, widget, GLADE_PAGE_ATK);
glade_editor_load_editable (editor, widget, GLADE_PAGE_PACKING);
- editor->loaded_widget = widget;
- editor->loading = FALSE;
+ editor->priv->loaded_widget = widget;
+ editor->priv->loading = FALSE;
/* Update class header */
glade_editor_update_class_field (editor);
/* Connect to new widget */
- project = glade_widget_get_project (editor->loaded_widget);
- editor->project_closed_signal_id =
+ project = glade_widget_get_project (editor->priv->loaded_widget);
+ editor->priv->project_closed_signal_id =
g_signal_connect (G_OBJECT (project), "close",
G_CALLBACK (glade_editor_close_cb), editor);
- editor->project_removed_signal_id =
+ editor->priv->project_removed_signal_id =
g_signal_connect (G_OBJECT (project), "remove-widget",
G_CALLBACK (glade_editor_removed_cb), editor);
- editor->widget_warning_id =
+ editor->priv->widget_warning_id =
g_signal_connect (G_OBJECT (widget), "notify::support-warning",
G_CALLBACK (glade_editor_update_class_warning_cb),
editor);
- editor->widget_name_id =
+ editor->priv->widget_name_id =
g_signal_connect (G_OBJECT (widget), "notify::name",
G_CALLBACK (glade_editor_update_widget_name_cb),
editor);
@@ -747,25 +825,12 @@ glade_editor_load_widget (GladeEditor * editor, GladeWidget * widget)
g_return_if_fail (GLADE_IS_EDITOR (editor));
g_return_if_fail (widget == NULL || GLADE_IS_WIDGET (widget));
- if (editor->loaded_widget == widget)
+ if (editor->priv->loaded_widget == widget)
return;
glade_editor_load_widget_real (editor, widget);
}
-/**
- * glade_editor_refresh:
- * @editor: a #GladeEditor
- *
- * Synchronize @editor with the currently loaded widget.
- */
-void
-glade_editor_refresh (GladeEditor * editor)
-{
- g_return_if_fail (GLADE_IS_EDITOR (editor));
- glade_editor_load_widget_real (editor, editor->loaded_widget);
-}
-
static void
query_dialog_style_set_cb (GtkWidget * dialog,
GtkStyle * previous_style, gpointer user_data)
@@ -937,7 +1002,7 @@ glade_editor_populate_reset_view (GladeEditor * editor, GtkTreeView * tree_view)
GladePropertyClass *pclass;
gboolean def;
- g_return_if_fail (editor->loaded_widget != NULL);
+ g_return_if_fail (editor->priv->loaded_widget != NULL);
gtk_tree_store_append (model, &general_iter, NULL);
gtk_tree_store_set (model, &general_iter,
@@ -964,7 +1029,7 @@ glade_editor_populate_reset_view (GladeEditor * editor, GtkTreeView * tree_view)
COLUMN_DEFAULT, FALSE, COLUMN_NDEFAULT, FALSE, -1);
/* General & Common */
- for (list = glade_widget_get_properties (editor->loaded_widget); list; list = list->next)
+ for (list = glade_widget_get_properties (editor->priv->loaded_widget); list; list = list->next)
{
property = list->data;
pclass = glade_property_get_class (property);
@@ -1129,7 +1194,7 @@ glade_editor_reset_properties (GList * props)
}
static void
-glade_editor_reset_dialog (GladeEditor * editor)
+glade_editor_reset_dialog (GladeEditor *editor)
{
GtkTreeSelection *selection;
GtkWidget *dialog, *parent;
@@ -1171,7 +1236,7 @@ glade_editor_reset_dialog (GladeEditor * editor)
tree_view = glade_editor_reset_view (editor);
- if (editor->loaded_widget)
+ if (editor->priv->loaded_widget)
glade_editor_populate_reset_view (editor, GTK_TREE_VIEW (tree_view));
gtk_tree_view_expand_all (GTK_TREE_VIEW (tree_view));
@@ -1253,10 +1318,10 @@ glade_editor_show_info (GladeEditor * editor)
{
g_return_if_fail (GLADE_IS_EDITOR (editor));
- if (editor->show_info != TRUE)
+ if (editor->priv->show_info != TRUE)
{
- editor->show_info = TRUE;
- gtk_widget_show (editor->info_button);
+ editor->priv->show_info = TRUE;
+ gtk_widget_show (editor->priv->info_button);
g_object_notify (G_OBJECT (editor), "show-info");
}
@@ -1267,10 +1332,10 @@ glade_editor_hide_info (GladeEditor * editor)
{
g_return_if_fail (GLADE_IS_EDITOR (editor));
- if (editor->show_info != FALSE)
+ if (editor->priv->show_info != FALSE)
{
- editor->show_info = FALSE;
- gtk_widget_hide (editor->info_button);
+ editor->priv->show_info = FALSE;
+ gtk_widget_hide (editor->priv->info_button);
g_object_notify (G_OBJECT (editor), "show-info");
}
diff --git a/gladeui/glade-editor.h b/gladeui/glade-editor.h
index 4f64b26..e0d83b6 100644
--- a/gladeui/glade-editor.h
+++ b/gladeui/glade-editor.h
@@ -16,6 +16,7 @@ G_BEGIN_DECLS
typedef struct _GladeEditor GladeEditor;
typedef struct _GladeEditorClass GladeEditorClass;
+typedef struct _GladeEditorPrivate GladeEditorPrivate;
/* The GladeEditor is a window that is used to display and modify widget
* properties. The glade editor contains the details of the selected
@@ -23,89 +24,9 @@ typedef struct _GladeEditorClass GladeEditorClass;
*/
struct _GladeEditor
{
- GtkVBox vbox; /* The editor is a vbox */
+ GtkVBox vbox; /* The editor is a vbox */
- GtkWidget *notebook; /* The notebook widget */
-
- GladeWidget *loaded_widget; /* A handy pointer to the GladeWidget
- * that is loaded in the editor. NULL
- * if no widgets are selected
- */
-
- GladeWidgetAdaptor *loaded_adaptor; /* A pointer to the loaded
- * GladeWidgetAdaptor. Note that we can
- * have a class loaded without a
- * loaded_widget. For this reason we
- * can't use loaded_widget->adaptor.
- * When a widget is selected we load
- * this class in the editor first and
- * then fill the values of the inputs
- * with the GladeProperty items.
- * This is usefull for not having
- * to redraw/container_add the widgets
- * when we switch from widgets of the
- * same class
- */
-
- GtkWidget *page_widget;
- GtkWidget *page_packing;
- GtkWidget *page_common;
- GtkWidget *page_signals;
- GtkWidget *page_atk;
-
- GladeSignalEditor *signal_editor; /* The signal editor packed into vbox_signals
- */
-
- GList *editables; /* A list of GladeEditables. We have a widget
- * for each GladeWidgetAdaptor and we only load
- * them on demand
- */
-
- GtkWidget *packing_page; /* Packing pages are dynamicly created each
- * selection, this pointer is only to free
- * the last packing page.
- */
-
- gboolean loading; /* Use when loading a GladeWidget into the editor
- * we set this flag so that we can ignore the
- * "changed" signal of the name entry text since
- * the name has not really changed, just a new name
- * was loaded.
- */
-
- gulong project_closed_signal_id; /* Unload widget when widget's project closes.
- */
- gulong project_removed_signal_id; /* Unload widget when its removed from the project.
- */
- gulong widget_warning_id; /* Update when widget changes warning messages.
- */
- gulong widget_name_id; /* Update class field when widget name changes
- */
- GtkWidget *reset_button; /* The reset button
- */
-
- GtkWidget *info_button; /* The actual informational button
- */
-
- GtkWidget *class_field; /* The class header
- */
-
- GtkWidget *warning; /* A pointer to an icon we can show in the class
- * field to publish tooltips for class related
- * versioning errors.
- */
-
- GtkWidget *class_icon; /* An image with the current widget's class icon.
- */
-
- GtkWidget *class_label; /* A label with the current class label.
- */
-
- GtkWidget *widget_label; /* A label with the current widget name.
- */
-
- gboolean show_info; /* Whether or not to show an informational button
- */
+ GladeEditorPrivate *priv;
};
struct _GladeEditorClass
@@ -122,21 +43,15 @@ struct _GladeEditorClass
GType glade_editor_get_type (void);
GladeEditor *glade_editor_new (void);
-
-GtkWidget *glade_editor_dialog_for_widget (GladeWidget *widget);
-
-void glade_editor_load_widget (GladeEditor *editor,
- GladeWidget *widget);
-
-void glade_editor_refresh (GladeEditor *editor);
-
-gboolean glade_editor_query_dialog (GladeWidget *widget);
-
-void glade_editor_show_info (GladeEditor *editor);
-
-void glade_editor_hide_info (GladeEditor *editor);
-
-void glade_editor_set_signal_editor (GladeEditor *editor, GladeSignalEditor *signal_editor);
+void glade_editor_load_widget (GladeEditor *editor,
+ GladeWidget *widget);
+void glade_editor_show_info (GladeEditor *editor);
+void glade_editor_hide_info (GladeEditor *editor);
+void glade_editor_set_signal_editor (GladeEditor *editor,
+ GladeSignalEditor *signal_editor);
+
+gboolean glade_editor_query_dialog (GladeWidget *widget);
+GtkWidget *glade_editor_dialog_for_widget (GladeWidget *widget);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]