Commit cc8dfcfc authored by Tristan Van Berkom's avatar Tristan Van Berkom

* Made GladeWidgetAdaptor internalize *everything* into a private data structure,

	21 files changed, 694 insertions(+), 670 deletions(-)
parent f2a93372
......@@ -19,6 +19,9 @@
project when the appropriate data changes (speeds up editing, with latest changes editing labels
in huge projects is smooth).
* Made GladeWidgetAdaptor internalize *everything* into a private data structure,
21 files changed, 694 insertions(+), 670 deletions(-)
2011-01-01 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-command.[ch], Added GladeProject member to base command structure, now
......
......@@ -547,7 +547,7 @@ glade_catalog_load_all (void)
{
GladeWidgetAdaptor *adaptor = l->data;
if (adaptor->missing_icon)
if (glade_widget_adaptor_get_missing_icon (adaptor))
{
if (!icon_warning)
icon_warning = g_string_new ("Glade needs artwork; "
......@@ -556,7 +556,8 @@ glade_catalog_load_all (void)
g_string_append_printf (icon_warning,
"\n\t%s\tneeds an icon named '%s'",
adaptor->name, adaptor->missing_icon);
glade_widget_adaptor_get_name (adaptor),
glade_widget_adaptor_get_missing_icon (adaptor));
}
}
......
......@@ -2399,9 +2399,9 @@ glade_eprop_object_populate_view_real (GtkTreeStore * model,
has_decendant = !parentless && glade_widget_has_decendant
(widget, object_type);
good_type = (adaptor->type == object_type ||
g_type_is_a (adaptor->type, object_type) ||
glade_util_class_implements_interface (adaptor->type,
good_type = (glade_widget_adaptor_get_object_type (adaptor) == object_type ||
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), object_type) ||
glade_util_class_implements_interface (glade_widget_adaptor_get_object_type (adaptor),
object_type));
if (parentless)
......@@ -2415,7 +2415,7 @@ glade_eprop_object_populate_view_real (GtkTreeStore * model,
OBJ_COLUMN_WIDGET, widget,
OBJ_COLUMN_WIDGET_NAME,
glade_eprop_object_name (glade_widget_get_name (widget), model, parent_iter),
OBJ_COLUMN_WIDGET_CLASS, adaptor->title,
OBJ_COLUMN_WIDGET_CLASS, glade_widget_adaptor_get_title (adaptor),
/* Selectable if its a compatible type and
* its not itself.
*/
......@@ -2618,7 +2618,7 @@ glade_eprop_object_dialog_title (GladeEditorProperty * eprop)
else if ((adaptor =
glade_widget_adaptor_get_by_type
(eprop->klass->pspec->value_type)) != NULL)
return g_strdup_printf (format, adaptor->title);
return g_strdup_printf (format, glade_widget_adaptor_get_title (adaptor));
/* Fallback on type name (which would look like "GtkButton"
* instead of "Button" and maybe not translated).
......@@ -2931,7 +2931,7 @@ glade_eprop_object_show_dialog (GtkWidget * dialog_button,
/* translators: Creating 'a widget' for 'a property' of 'a widget' */
glade_command_push_group (_("Creating %s for %s of %s"),
create_adaptor->name,
glade_widget_adaptor_get_name (create_adaptor),
eprop->klass->name,
glade_widget_get_name (widget));
......
......@@ -287,11 +287,13 @@ property_class_comp (gconstpointer a, gconstpointer b)
static GList *
get_sorted_properties (GladeWidgetAdaptor * adaptor, GladeEditorPageType type)
{
GList *l, *list = NULL, *properties;
const GList *l, *properties;
GList *list = NULL;
properties =
(type ==
GLADE_PAGE_PACKING) ? adaptor->packing_props : adaptor->properties;
(type == GLADE_PAGE_PACKING) ?
glade_widget_adaptor_get_packing_props (adaptor) :
glade_widget_adaptor_get_properties (adaptor);
for (l = properties; l; l = g_list_next (l))
{
......@@ -323,7 +325,7 @@ append_item (GladeEditorTable * table,
klass, from_query_dialog == FALSE)))
{
g_critical ("Unable to create editor for property '%s' of class '%s'",
klass->id, GLADE_WIDGET_ADAPTOR (klass->handle)->name);
klass->id, glade_widget_adaptor_get_name (GLADE_WIDGET_ADAPTOR (klass->handle)));
return NULL;
}
......
......@@ -255,7 +255,7 @@ glade_editor_on_docs_click (GtkButton * button, GladeEditor * editor)
{
g_object_get (editor->loaded_adaptor, "book", &book, NULL);
glade_editor_search_doc_search (editor, book,
editor->loaded_adaptor->name,
glade_widget_adaptor_get_name (editor->loaded_adaptor),
NULL);
g_free (book);
}
......@@ -325,14 +325,14 @@ glade_editor_update_class_field (GladeEditor * editor)
gchar *text;
gtk_image_set_from_icon_name (GTK_IMAGE (editor->class_icon),
editor->loaded_adaptor->icon_name,
glade_widget_adaptor_get_icon_name (editor->loaded_adaptor),
GTK_ICON_SIZE_BUTTON);
gtk_widget_show (editor->class_icon);
/* translators: referring to the properties of a widget named '%s [%s]' */
text = g_strdup_printf (_("%s Properties - %s [%s]"),
editor->loaded_adaptor->title,
editor->loaded_adaptor->name,
glade_widget_adaptor_get_title (editor->loaded_adaptor),
glade_widget_adaptor_get_name (editor->loaded_adaptor),
glade_widget_get_name (widget));
gtk_label_set_text (GTK_LABEL (editor->class_label), text);
g_free (text);
......@@ -837,7 +837,7 @@ glade_editor_query_dialog (GladeEditor * editor, GladeWidget * widget)
adaptor = glade_widget_get_adaptor (widget);
title = g_strdup_printf (_("Create a %s"), adaptor->name);
title = g_strdup_printf (_("Create a %s"), glade_widget_adaptor_get_name (adaptor));
dialog = gtk_dialog_new_with_buttons (title, NULL,
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
......
......@@ -527,20 +527,21 @@ glade_palette_item_refresh (GtkWidget * item)
GTK_STOCK_DIALOG_WARNING);
else
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item),
adaptor->icon_name);
glade_widget_adaptor_get_icon_name (adaptor));
/* prepend widget title */
text = g_strdup_printf ("%s: %s", adaptor->title, warning);
text = g_strdup_printf ("%s: %s", glade_widget_adaptor_get_title (adaptor), warning);
gtk_widget_set_tooltip_text (item, text);
g_free (text);
g_free (warning);
}
else
{
gtk_widget_set_tooltip_text (GTK_WIDGET (item), adaptor->title);
gtk_widget_set_tooltip_text (GTK_WIDGET (item),
glade_widget_adaptor_get_title (adaptor));
gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item),
adaptor->icon_name);
glade_widget_adaptor_get_icon_name (adaptor));
}
}
......@@ -575,7 +576,7 @@ glade_palette_new_item (GladePalette * palette, GladeWidgetAdaptor * adaptor)
/* Add a box to avoid the ellipsize on the items */
box = gtk_hbox_new (FALSE, 0);
label = gtk_label_new (adaptor->title);
label = gtk_label_new (glade_widget_adaptor_get_title (adaptor));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_show (label);
gtk_widget_show (box);
......
......@@ -137,9 +137,9 @@ glade_placeholder_notify_parent (GObject * gobject,
if (parent)
parent_adaptor = glade_widget_get_adaptor (parent);
if (parent_adaptor && parent_adaptor->packing_actions)
if (parent_adaptor)
placeholder->packing_actions =
glade_widget_adaptor_pack_actions_new (parent_adaptor);
glade_widget_adaptor_pack_actions_new (parent_adaptor);
}
static void
......
......@@ -99,19 +99,6 @@ glade_popup_placeholder_add_cb (GtkMenuItem * item,
}
}
static void
glade_popup_action_add_cb (GtkMenuItem * item, GladeWidget * group)
{
GladeWidgetAdaptor *adaptor;
adaptor = glade_palette_get_current_item (glade_app_get_palette ());
g_return_if_fail (adaptor != NULL);
glade_command_create (adaptor, group, NULL, glade_widget_get_project (group));
glade_palette_deselect_current_item (glade_app_get_palette (), TRUE);
}
static void
glade_popup_root_add_cb (GtkMenuItem * item, gpointer * user_data)
{
......@@ -223,7 +210,8 @@ glade_popup_docs_cb (GtkMenuItem * item, GladeWidgetAdaptor * adaptor)
g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
g_object_get (adaptor, "book", &book, NULL);
glade_editor_search_doc_search (glade_app_get_editor (), book, adaptor->name,
glade_editor_search_doc_search (glade_app_get_editor (), book,
glade_widget_adaptor_get_name (adaptor),
NULL);
g_free (book);
}
......@@ -430,43 +418,25 @@ static GtkWidget *
glade_popup_create_menu (GladeWidget * widget,
GladePlaceholder * placeholder, gboolean packing)
{
GladeWidgetAdaptor *current_item;
GtkWidget *popup_menu;
GtkWidget *separator;
gboolean sensitive;
GladePlaceholder *tmp_placeholder;
gchar *book;
sensitive = (current_item =
glade_palette_get_current_item (glade_app_get_palette ())) !=
NULL;
popup_menu = gtk_menu_new ();
if (current_item)
if (glade_palette_get_current_item (glade_app_get_palette ()))
{
/* Special case for GtkAction accelerators */
if (widget && GTK_IS_ACTION_GROUP (glade_widget_get_object (widget)) &&
(current_item->type == GTK_TYPE_ACTION ||
g_type_is_a (current_item->type, GTK_TYPE_ACTION)))
{
glade_popup_append_item (popup_menu, NULL, _("_Add widget here"),
NULL, TRUE, glade_popup_action_add_cb,
widget);
}
else
{
tmp_placeholder = placeholder;
if (!tmp_placeholder && widget)
tmp_placeholder =
find_placeholder (glade_widget_get_object (widget));
glade_popup_append_item (popup_menu, NULL, _("_Add widget here"),
NULL, tmp_placeholder != NULL,
glade_popup_placeholder_add_cb,
tmp_placeholder);
}
tmp_placeholder = placeholder;
if (!tmp_placeholder && widget)
tmp_placeholder =
find_placeholder (glade_widget_get_object (widget));
glade_popup_append_item (popup_menu, NULL, _("_Add widget here"),
NULL, tmp_placeholder != NULL,
glade_popup_placeholder_add_cb,
tmp_placeholder);
glade_popup_append_item (popup_menu, NULL, _("Add widget as _toplevel"),
NULL, TRUE, glade_popup_root_add_cb, NULL);
......
......@@ -2088,7 +2088,8 @@ glade_project_verify_property_internal (GladeProject * project,
PROP_VERSION_CONFLICT_FMT,
path_name,
pclass->name,
adaptor->title, catalog,
glade_widget_adaptor_get_title (adaptor),
catalog,
pclass->version_since_major,
pclass->version_since_minor);
}
......@@ -2167,7 +2168,7 @@ glade_project_verify_signal_internal (GladeWidget * widget,
SIGNAL_VERSION_CONFLICT_FMT,
path_name,
signal->name,
signal_class->adaptor->title,
glade_widget_adaptor_get_title (signal_class->adaptor),
catalog,
signal_class->version_since_major,
signal_class->version_since_minor);
......@@ -2368,7 +2369,9 @@ glade_project_verify_adaptor (GladeProject * project,
else
g_string_append_printf (string,
WIDGET_VERSION_CONFLICT_FMT,
path_name, adaptor_iter->title, catalog,
path_name,
glade_widget_adaptor_get_title (adaptor_iter),
catalog,
GWA_VERSION_SINCE_MAJOR (adaptor_iter),
GWA_VERSION_SINCE_MINOR (adaptor_iter));
......@@ -2386,8 +2389,9 @@ glade_project_verify_adaptor (GladeProject * project,
}
else
g_string_append_printf (string, WIDGET_DEPRECATED_FMT,
path_name, adaptor_iter->title, catalog,
target_major, target_minor);
path_name,
glade_widget_adaptor_get_title (adaptor_iter),
catalog, target_major, target_minor);
support_mask |= GLADE_SUPPORT_DEPRECATED;
}
......
......@@ -1109,7 +1109,7 @@ gpc_read_displayable_values_from_node (GladeXmlNode * node,
if (n_values != registered_values)
g_message ("%d missing displayable value for %s::%s",
n_values - registered_values,
((GladeWidgetAdaptor *) klass->handle)->name, klass->id);
glade_widget_adaptor_get_name ((GladeWidgetAdaptor *) klass->handle), klass->id);
g_type_class_unref (the_class);
......
......@@ -734,7 +734,9 @@ glade_signal_editor_devhelp_cb (GtkCellRenderer * cell,
g_object_get (signal_class->adaptor, "book", &book, NULL);
glade_editor_search_doc_search (glade_app_get_editor (),
book, signal_class->adaptor->name, search);
book,
glade_widget_adaptor_get_name (signal_class->adaptor),
search);
g_free (search);
g_free (book);
......@@ -1162,7 +1164,7 @@ void
glade_signal_editor_load_widget (GladeSignalEditor * editor,
GladeWidget * widget)
{
GList *list;
const GList *list;
const gchar *last_type = "";
GtkTreeIter iter;
GtkTreeIter parent_class;
......@@ -1205,7 +1207,7 @@ glade_signal_editor_load_widget (GladeSignalEditor * editor,
/* Loop over every signal type
*/
for (list = priv->adaptor->signals; list; list = list->next)
for (list = glade_widget_adaptor_get_signals (priv->adaptor); list; list = list->next)
{
GladeSignalClass *signal = (GladeSignalClass *) list->data;
GladeSignal *sig =
......
......@@ -288,8 +288,10 @@ glade_util_check_and_warn_scrollable (GladeWidget * parent,
glade_util_ui_message (parent_widget,
GLADE_UI_INFO, NULL,
_("Cannot add non scrollable %s widget to a %s directly.\n"
"Add a %s first."), child_adaptor->title,
parent_adaptor->title, vadaptor->title);
"Add a %s first."),
glade_widget_adaptor_get_title (child_adaptor),
glade_widget_adaptor_get_title (parent_adaptor),
glade_widget_adaptor_get_title (vadaptor));
return TRUE;
}
return FALSE;
......
This diff is collapsed.
This diff is collapsed.
......@@ -216,9 +216,8 @@ glade_widget_set_packing_actions (GladeWidget * widget,
widget->priv->packing_actions = NULL;
}
if (parent->priv->adaptor->packing_actions)
widget->priv->packing_actions =
glade_widget_adaptor_pack_actions_new (parent->priv->adaptor);
widget->priv->packing_actions =
glade_widget_adaptor_pack_actions_new (parent->priv->adaptor);
}
static void
......@@ -533,22 +532,22 @@ static GParameter *
glade_widget_template_params (GladeWidget * widget,
gboolean construct, guint * n_params)
{
GladeWidgetAdaptor *klass;
GArray *params;
GObjectClass *oclass;
GParamSpec **pspec;
GladeProperty *glade_property;
GladeWidgetAdaptor *adaptor;
GArray *params;
GObjectClass *oclass;
GParamSpec **pspec;
GladeProperty *glade_property;
GladePropertyClass *pclass;
guint n_props, i;
guint n_props, i;
g_return_val_if_fail (GLADE_IS_WIDGET (widget), NULL);
g_return_val_if_fail (n_params != NULL, NULL);
klass = widget->priv->adaptor;
adaptor = widget->priv->adaptor;
/* As a slight optimization, we never unref the class
*/
oclass = g_type_class_ref (klass->type);
oclass = g_type_class_ref (glade_widget_adaptor_get_object_type (adaptor));
pspec = g_object_class_list_properties (oclass, &n_props);
params = g_array_new (FALSE, FALSE, sizeof (GParameter));
......@@ -583,7 +582,8 @@ glade_widget_template_params (GladeWidget * widget,
pspec[i]->value_type) == FALSE)
{
g_critical ("Type mismatch on %s property of %s",
parameter.name, klass->name);
parameter.name,
glade_widget_adaptor_get_name (adaptor));
continue;
}
......@@ -832,9 +832,11 @@ glade_widget_constructor (GType type,
}
else if (gwidget->priv->project)
gwidget->priv->name = glade_project_new_widget_name
(gwidget->priv->project, gwidget, gwidget->priv->adaptor->generic_name);
(gwidget->priv->project, gwidget,
glade_widget_adaptor_get_generic_name (gwidget->priv->adaptor));
else
gwidget->priv->name = g_strdup (gwidget->priv->adaptor->generic_name);
gwidget->priv->name =
g_strdup (glade_widget_adaptor_get_generic_name (gwidget->priv->adaptor));
}
if (gwidget->priv->construct_template)
......@@ -1430,9 +1432,9 @@ glade_widget_set_default_packing_properties (GladeWidget * container,
GladeWidget * child)
{
GladePropertyClass *property_class;
GList *l;
const GList *l;
for (l = container->priv->adaptor->packing_props; l; l = l->next)
for (l = glade_widget_adaptor_get_packing_props (container->priv->adaptor); l; l = l->next)
{
const gchar *def;
GValue *value;
......@@ -1853,29 +1855,13 @@ glade_widget_set_properties (GladeWidget * widget, GList * properties)
}
}
static void
glade_widget_set_actions (GladeWidget * widget, GladeWidgetAdaptor * adaptor)
{
GList *l;
for (l = adaptor->actions; l; l = g_list_next (l))
{
GWActionClass *action = l->data;
GObject *obj = g_object_new (GLADE_TYPE_WIDGET_ACTION,
"class", action, NULL);
widget->priv->actions = g_list_prepend (widget->priv->actions,
GLADE_WIDGET_ACTION (obj));
}
widget->priv->actions = g_list_reverse (widget->priv->actions);
}
static void
glade_widget_set_adaptor (GladeWidget * widget, GladeWidgetAdaptor * adaptor)
{
GladePropertyClass *property_class;
GladeProperty *property;
GList *list, *properties = NULL;
GladeProperty *property;
const GList *list;
GList *properties = NULL;
g_return_if_fail (GLADE_IS_WIDGET (widget));
g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
......@@ -1888,7 +1874,7 @@ glade_widget_set_adaptor (GladeWidget * widget, GladeWidgetAdaptor * adaptor)
*/
if (!widget->priv->properties)
{
for (list = adaptor->properties; list; list = list->next)
for (list = glade_widget_adaptor_get_properties (adaptor); list; list = list->next)
{
property_class = GLADE_PROPERTY_CLASS (list->data);
if ((property = glade_property_new (property_class,
......@@ -1903,7 +1889,7 @@ glade_widget_set_adaptor (GladeWidget * widget, GladeWidgetAdaptor * adaptor)
}
/* Create actions from adaptor */
glade_widget_set_actions (widget, adaptor);
widget->priv->actions = glade_widget_adaptor_actions_new (adaptor);
}
static gboolean
......@@ -1971,13 +1957,14 @@ glade_widget_create_packing_properties (GladeWidget * container,
GladeWidget * widget)
{
GladePropertyClass *property_class;
GladeProperty *property;
GList *list, *packing_props = NULL;
GladeProperty *property;
const GList *list;
GList *packing_props = NULL;
/* XXX TODO: by checking with some GladePropertyClass metadata, decide
* which packing properties go on which type of children.
*/
for (list = container->priv->adaptor->packing_props;
for (list = glade_widget_adaptor_get_packing_props (container->priv->adaptor);
list && list->data; list = list->next)
{
property_class = list->data;
......@@ -3423,7 +3410,7 @@ glade_widget_set_object (GladeWidget * gwidget, GObject * new_object,
g_return_if_fail (GLADE_IS_WIDGET (gwidget));
g_return_if_fail (new_object == NULL ||
g_type_is_a (G_OBJECT_TYPE (new_object),
gwidget->priv->adaptor->type));
glade_widget_adaptor_get_object_type (gwidget->priv->adaptor)));
if (gwidget->priv->object == new_object)
return;
......@@ -3445,7 +3432,7 @@ glade_widget_set_object (GladeWidget * gwidget, GObject * new_object,
g_object_set_qdata (G_OBJECT (new_object), glade_widget_name_quark,
gwidget);
if (g_type_is_a (gwidget->priv->adaptor->type, GTK_TYPE_WIDGET))
if (g_type_is_a (glade_widget_adaptor_get_object_type (gwidget->priv->adaptor), GTK_TYPE_WIDGET))
{
/* Disable any built-in DnD
*/
......@@ -3537,7 +3524,7 @@ glade_widget_set_parent (GladeWidget * widget, GladeWidget * parent)
(parent->priv->adaptor, parent->priv->object, widget->priv->object))
{
if (old_parent == NULL || widget->priv->packing_properties == NULL ||
old_parent->priv->adaptor->type != parent->priv->adaptor->type)
old_parent->priv->adaptor != parent->priv->adaptor)
glade_widget_set_packing_properties (widget, parent);
else
glade_widget_sync_packing_props (widget);
......@@ -3692,10 +3679,11 @@ glade_widget_has_decendant (GladeWidget * widget, GType type)
gboolean found = FALSE;
if (G_TYPE_IS_INTERFACE (type) &&
glade_util_class_implements_interface (widget->priv->adaptor->type, type))
glade_util_class_implements_interface
(glade_widget_adaptor_get_object_type (widget->priv->adaptor), type))
return TRUE;
else if (G_TYPE_IS_INTERFACE (type) == FALSE &&
g_type_is_a (widget->priv->adaptor->type, type))
g_type_is_a (glade_widget_adaptor_get_object_type (widget->priv->adaptor), type))
return TRUE;
if ((children = glade_widget_adaptor_get_children
......@@ -4001,7 +3989,7 @@ glade_widget_write (GladeWidget * widget,
/* Set class and id */
glade_xml_node_set_property_string (widget_node,
GLADE_XML_TAG_CLASS,
widget->priv->adaptor->name);
glade_widget_adaptor_get_name (widget->priv->adaptor));
glade_xml_node_set_property_string (widget_node,
GLADE_XML_TAG_ID, widget->priv->name);
......
......@@ -207,20 +207,21 @@ glade_eprop_accel_populate_view (GladeEditorProperty * eprop,
GtkTreeIter iter;
GladeEpropIterTab *parent_tab;
GladeAccelInfo *info;
GList *list, *l, *found, *accelerators;
GList *l, *found, *accelerators;
gchar *name, *accel_text;
const GList *list;
accelerators = g_value_get_boxed (glade_property_inline_value (eprop->property));
/* First make parent iters...
*/
for (list = adaptor->signals; list; list = list->next)
for (list = glade_widget_adaptor_get_signals (adaptor); list; list = list->next)
{
sclass = list->data;
/* Special case for GtkAction accelerators */
if (adaptor->type == GTK_TYPE_ACTION ||
g_type_is_a (adaptor->type, GTK_TYPE_ACTION))
if (glade_widget_adaptor_get_object_type (adaptor) == GTK_TYPE_ACTION ||
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), GTK_TYPE_ACTION))
{
if (g_strcmp0 (sclass->type, "GtkAction") != 0 ||
g_strcmp0 (sclass->name, "activate") != 0)
......@@ -251,13 +252,13 @@ glade_eprop_accel_populate_view (GladeEditorProperty * eprop,
/* Now we populate...
*/
for (list = adaptor->signals; list; list = list->next)
for (list = glade_widget_adaptor_get_signals (adaptor); list; list = list->next)
{
sclass = list->data;
/* Special case for GtkAction accelerators */
if (adaptor->type == GTK_TYPE_ACTION ||
g_type_is_a (adaptor->type, GTK_TYPE_ACTION))
if (glade_widget_adaptor_get_object_type (adaptor) == GTK_TYPE_ACTION ||
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), GTK_TYPE_ACTION))
{
if (g_strcmp0 (sclass->type, "GtkAction") != 0 ||
g_strcmp0 (sclass->name, "activate") != 0)
......@@ -303,8 +304,8 @@ glade_eprop_accel_populate_view (GladeEditorProperty * eprop,
}
/* Special case for GtkAction accelerators */
if ((adaptor->type == GTK_TYPE_ACTION ||
g_type_is_a (adaptor->type, GTK_TYPE_ACTION)) &&
if ((glade_widget_adaptor_get_object_type (adaptor) == GTK_TYPE_ACTION ||
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), GTK_TYPE_ACTION)) &&
g_list_length (accelerators) > 0)
continue;
......@@ -346,8 +347,8 @@ accel_edited (GtkCellRendererAccel * accel,
&iter, path_string))
return;
is_action = (adaptor->type == GTK_TYPE_ACTION ||
g_type_is_a (adaptor->type, GTK_TYPE_ACTION));
is_action = (glade_widget_adaptor_get_object_type (adaptor) == GTK_TYPE_ACTION ||
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), GTK_TYPE_ACTION));
gtk_tree_model_get (eprop_accel->model, &iter,
ACCEL_COLUMN_KEY_ENTERED, &key_was_set, -1);
......
......@@ -310,9 +310,10 @@ property_class_comp (gconstpointer a, gconstpointer b)
static GList *
get_sorted_properties (GladeWidgetAdaptor * adaptor, GladeEditorPageType type)
{
GList *l, *list = NULL;
GList *list = NULL;
const GList *l;
for (l = adaptor->properties; l; l = g_list_next (l))
for (l = glade_widget_adaptor_get_properties (adaptor); l; l = l->next)
{
GladePropertyClass *klass = l->data;
......
......@@ -54,15 +54,16 @@ static void
column_types_store_populate_enums_flags (GtkListStore * store, gboolean enums)
{
GtkTreeIter iter;
GList *types = NULL, *list, *l;
GList *types = NULL, *list;
GList *adaptors = glade_widget_adaptor_list_adaptors ();
const GList *l;
for (list = adaptors; list; list = list->next)
{
GladeWidgetAdaptor *adaptor = list->data;
GladePropertyClass *pclass;
for (l = adaptor->properties; l; l = l->next)
for (l = glade_widget_adaptor_get_properties (adaptor); l; l = l->next)
{
pclass = l->data;
......
......@@ -841,7 +841,8 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor * adaptor,
return;
glade_command_push_group (_("Adding parent %s for %s"),
adaptor->title, glade_widget_get_name (gwidget));
glade_widget_adaptor_get_title (adaptor),
glade_widget_get_name (gwidget));
/* Record packing properties */
saved_props =
......@@ -9993,11 +9994,11 @@ glade_gtk_cell_renderer_deep_post_create (GladeWidgetAdaptor * adaptor,
GladePropertyClass *pclass;
GladeProperty *property;
GladeWidget *widget;
GList *l;
const GList *l;
widget = glade_widget_get_from_gobject (object);
for (l = adaptor->properties; l; l = l->next)
for (l = glade_widget_adaptor_get_properties (adaptor); l; l = l->next)
{
pclass = l->data;
......
......@@ -274,7 +274,7 @@ custom_toggled (GtkWidget * widget, GladeImageItemEditor * item_editor)
/* Now setup default label and create image... */
property = glade_widget_get_property (item_editor->loaded_widget, "label");
glade_command_set_property (property, adaptor->generic_name);
glade_command_set_property (property, glade_widget_adaptor_get_generic_name (adaptor));
property = glade_widget_get_property (item_editor->loaded_widget, "use-underline");
glade_command_set_property (property, FALSE);
......
......@@ -203,8 +203,8 @@ glade_store_editor_new (GladeWidgetAdaptor * adaptor, GladeEditable * embed)
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (eprop), FALSE, FALSE, 4);
if (adaptor->type == GTK_TYPE_LIST_STORE ||
g_type_is_a (adaptor->type, GTK_TYPE_LIST_STORE))
if (glade_widget_adaptor_get_object_type (adaptor) == GTK_TYPE_LIST_STORE ||
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), GTK_TYPE_LIST_STORE))
{
/* -------------- The data area here -------------- */
/* Label item in frame label widget on top.. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment