Commit 3277f95c authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

moved signal and children serialization from

	
	* gladeui/glade-widget.c, gladeui/glade-widget-adaptor.c: moved signal and
	children serialization from glade_widget_adaptor_object_write_widget() to
	glade_widget_write() (bug #559531)


svn path=/trunk/; revision=2019
parent bde43f1a
2008-11-07 Juan Pablo Ugarte <juanpablougarte@gmail.com>
* gladeui/glade-widget.c, gladeui/glade-widget-adaptor.c: moved signal and
children serialization from glade_widget_adaptor_object_write_widget() to
glade_widget_write() (bug #559531)
2008-11-07 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/gtk+.xml.in: Faked the accel-group property and added
......
......@@ -900,40 +900,13 @@ glade_widget_adaptor_object_read_widget (GladeWidgetAdaptor *adaptor,
}
}
typedef struct {
GladeXmlContext *context;
GladeXmlNode *node;
} WriteSignalsInfo;
static void
glade_widget_adaptor_write_signals (gpointer key,
gpointer value,
gpointer user_data)
{
WriteSignalsInfo *info;
GPtrArray *signals;
guint i;
info = (WriteSignalsInfo *) user_data;
signals = (GPtrArray *) value;
for (i = 0; i < signals->len; i++)
{
GladeSignal *signal = g_ptr_array_index (signals, i);
glade_signal_write (signal,
info->context,
info->node);
}
}
static void
glade_widget_adaptor_object_write_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlContext *context,
GladeXmlNode *node)
{
GList *props, *l, *list;
WriteSignalsInfo info = { context, node };
GList *props;
/* Write the properties */
for (props = widget->properties;
......@@ -943,29 +916,6 @@ glade_widget_adaptor_object_write_widget (GladeWidgetAdaptor *adaptor,
GLADE_PROPERTY (props->data)->enabled)
glade_property_write (GLADE_PROPERTY (props->data), context, node);
}
/* Write the signals */
g_hash_table_foreach (widget->signals,
glade_widget_adaptor_write_signals,
&info);
/* Write the children */
if ((list =
glade_widget_adaptor_get_children (adaptor, widget->object)) != NULL)
{
for (l = list; l; l = l->next)
{
GladeWidget *child = glade_widget_get_from_gobject (l->data);
if (child)
glade_widget_write_child (widget, child, context, node);
else if (GLADE_IS_PLACEHOLDER (l->data))
glade_widget_write_placeholder (widget,
G_OBJECT (l->data),
context, node);
}
g_list_free (list);
}
}
static void
......
......@@ -3710,6 +3710,31 @@ glade_widget_write_placeholder (GladeWidget *parent,
}
}
typedef struct {
GladeXmlContext *context;
GladeXmlNode *node;
} WriteSignalsInfo;
static void
glade_widget_adaptor_write_signals (gpointer key,
gpointer value,
gpointer user_data)
{
WriteSignalsInfo *info;
GPtrArray *signals;
guint i;
info = (WriteSignalsInfo *) user_data;
signals = (GPtrArray *) value;
for (i = 0; i < signals->len; i++)
{
GladeSignal *signal = g_ptr_array_index (signals, i);
glade_signal_write (signal,
info->context,
info->node);
}
}
/**
* glade_widget_write:
* @widget: The #GladeWidget
......@@ -3725,6 +3750,8 @@ glade_widget_write (GladeWidget *widget,
GladeXmlNode *node)
{
GladeXmlNode *widget_node;
WriteSignalsInfo info;
GList *l, *list;
widget_node =
glade_xml_node_new
......@@ -3741,6 +3768,31 @@ glade_widget_write (GladeWidget *widget,
/* Write out widget content (properties and signals) */
glade_widget_adaptor_write_widget (widget->adaptor, widget, context, widget_node);
/* Write the signals */
info.context = context;
info.node = widget_node;
g_hash_table_foreach (widget->signals,
glade_widget_adaptor_write_signals,
&info);
/* Write the children */
if ((list =
glade_widget_adaptor_get_children (widget->adaptor, widget->object)) != NULL)
{
for (l = list; l; l = l->next)
{
GladeWidget *child = glade_widget_get_from_gobject (l->data);
if (child)
glade_widget_write_child (widget, child, context, widget_node);
else if (GLADE_IS_PLACEHOLDER (l->data))
glade_widget_write_placeholder (widget,
G_OBJECT (l->data),
context, widget_node);
}
g_list_free (list);
}
}
......
......@@ -336,6 +336,13 @@ embedded in another object</_tooltip>
<write-widget-function>glade_gtk_window_write_widget</write-widget-function>
<properties>
<!-- Virtual accel-groups property to record accel groups -->
<property id="accel-groups" name="Accel Groups" ignore="True" save="False">
<parameter-spec>
<type>GladeParamObjects</type>
<value-type>GtkAccelGroup</value-type>
</parameter-spec>
</property>
<property id="opacity" since="2.12" ignore="True"/>
<property id="startup-id" since="2.12"/>
<property id="deletable" since="2.10"/>
......@@ -400,13 +407,6 @@ embedded in another object</_tooltip>
</displayable-values>
</property>
<property id="accept-focus" ignore="True"/>
<!-- Virtual accel-groups property to record accel groups -->
<property id="accel-groups" name="Accel Groups" ignore="True" save="False">
<parameter-spec>
<type>GladeParamObjects</type>
<value-type>GtkAccelGroup</value-type>
</parameter-spec>
</property>
</properties>
</glade-widget-class>
......
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