Commit 14feeffc authored by Tristan Van Berkom's avatar Tristan Van Berkom

Added parameter-spec parsing, need to updated docs still.


	* gladeui/glade-xml-utils.c, gladeui/glade-property-class.c: Added 
	parameter-spec parsing, need to updated docs still.

	* plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-attributes.c,
	plugins/gtk+/glade-icon-sources.c, plugins/gtk+/glade-accels.c, plugins/gtk+/glade-model-data.c,
	plugins/gtk+/glade-column-types.c:
	- Removed all custom parameter spec implementations in the plugin and replaced them
	  with automatically generated ones parsed by the xml.
	- Fixed hierarchy bugs, some classes were not saving.


svn path=/trunk/; revision=2016
parent 55db023b
2008-11-05 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-xml-utils.c, gladeui/glade-property-class.c: Added
parameter-spec parsing, need to updated docs still.
* plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-attributes.c,
plugins/gtk+/glade-icon-sources.c, plugins/gtk+/glade-accels.c, plugins/gtk+/glade-model-data.c,
plugins/gtk+/glade-column-types.c:
- Removed all custom parameter spec implementations in the plugin and replaced them
with automatically generated ones parsed by the xml.
- Fixed hierarchy bugs, some classes were not saving.
2008-10-31 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/glade-image-item-editor.[ch], plugins/gtk+/glade-gtk.c:
......
......@@ -1251,6 +1251,168 @@ glade_property_class_make_adjustment (GladePropertyClass *property_class)
return adjustment;
}
static GParamSpec *
glade_property_class_parse_specifications (GladePropertyClass *klass,
GladeXmlNode *spec_node)
{
gchar *string;
GType spec_type = 0, value_type = 0;
GParamSpec *pspec = NULL;
if ((string = glade_xml_get_value_string_required
(spec_node, GLADE_TAG_TYPE, "Need a type of GParamSpec to define")) != NULL)
spec_type = glade_util_get_type_from_name (string, FALSE);
g_free (string);
g_return_val_if_fail (spec_type != 0, NULL);
if (spec_type == G_TYPE_PARAM_ENUM ||
spec_type == G_TYPE_PARAM_FLAGS ||
spec_type == G_TYPE_PARAM_BOXED ||
spec_type == G_TYPE_PARAM_OBJECT ||
spec_type == GLADE_TYPE_PARAM_OBJECTS)
{
if ((string = glade_xml_get_value_string_required
(spec_node, GLADE_TAG_VALUE_TYPE,
"Need a value type to define enums flags boxed and object specs")) != NULL)
value_type = glade_util_get_type_from_name (string, FALSE);
g_free (string);
g_return_val_if_fail (value_type != 0, NULL);
if (spec_type == G_TYPE_PARAM_ENUM)
{
GEnumClass *eclass = g_type_class_ref (value_type);
pspec = g_param_spec_enum ("dummy", "dummy", "dummy",
value_type, eclass->minimum, G_PARAM_READABLE|G_PARAM_WRITABLE);
g_type_class_unref (eclass);
}
else if (spec_type == G_TYPE_PARAM_FLAGS)
pspec = g_param_spec_flags ("dummy", "dummy", "dummy",
value_type, 0, G_PARAM_READABLE|G_PARAM_WRITABLE);
else if (spec_type == G_TYPE_PARAM_OBJECT)
pspec = g_param_spec_object ("dummy", "dummy", "dummy",
value_type, G_PARAM_READABLE|G_PARAM_WRITABLE);
else if (spec_type == GLADE_TYPE_PARAM_OBJECTS)
pspec = glade_param_spec_objects ("dummy", "dummy", "dummy",
value_type, G_PARAM_READABLE|G_PARAM_WRITABLE);
else/* if (spec_type == G_TYPE_PARAM_BOXED) */
pspec = g_param_spec_boxed ("dummy", "dummy", "dummy",
value_type, G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_STRING)
pspec = g_param_spec_string ("dummy", "dummy", "dummy",
NULL, G_PARAM_READABLE|G_PARAM_WRITABLE);
else if (spec_type == G_TYPE_PARAM_BOOLEAN)
pspec = g_param_spec_boolean ("dummy", "dummy", "dummy",
FALSE, G_PARAM_READABLE|G_PARAM_WRITABLE);
else
{
gchar *minstr, *maxstr;
minstr = glade_xml_get_value_string (spec_node, GLADE_TAG_MIN_VALUE);
maxstr = glade_xml_get_value_string (spec_node, GLADE_TAG_MAX_VALUE);
if (spec_type == G_TYPE_PARAM_CHAR)
{
gint8 min = minstr ? minstr[0]: G_MININT8;
gint8 max = maxstr ? maxstr[0]: G_MAXINT8;
pspec = g_param_spec_char ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_UCHAR)
{
guint8 min = minstr ? minstr[0]: 0;
guint8 max = maxstr ? maxstr[0]: G_MAXUINT8;
pspec = g_param_spec_uchar ("dummy", "dummy", "dummy",
min, max, 0,
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_INT)
{
gint min = minstr ? g_ascii_strtoll (minstr, NULL, 10): G_MININT;
gint max = maxstr ? g_ascii_strtoll (maxstr, NULL, 10): G_MAXINT;
pspec = g_param_spec_int ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_UINT)
{
guint min = minstr ? g_ascii_strtoll (minstr, NULL, 10): 0;
guint max = maxstr ? g_ascii_strtoll (maxstr, NULL, 10): G_MAXUINT;
pspec = g_param_spec_uint ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_LONG)
{
glong min = minstr ? g_ascii_strtoll (minstr, NULL, 10): G_MINLONG;
glong max = maxstr ? g_ascii_strtoll (maxstr, NULL, 10): G_MAXLONG;
pspec = g_param_spec_long ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_ULONG)
{
gulong min = minstr ? g_ascii_strtoll (minstr, NULL, 10): 0;
gulong max = maxstr ? g_ascii_strtoll (maxstr, NULL, 10): G_MAXULONG;
pspec = g_param_spec_ulong ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_INT64)
{
gint64 min = minstr ? g_ascii_strtoll (minstr, NULL, 10): G_MININT64;
gint64 max = maxstr ? g_ascii_strtoll (maxstr, NULL, 10): G_MAXINT64;
pspec = g_param_spec_int64 ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_UINT64)
{
guint64 min = minstr ? g_ascii_strtoll (minstr, NULL, 10): 0;
guint64 max = maxstr ? g_ascii_strtoll (maxstr, NULL, 10): G_MAXUINT64;
pspec = g_param_spec_uint64 ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_FLOAT)
{
gfloat min = minstr ? (float) g_ascii_strtod (minstr, NULL) : G_MINFLOAT;
gfloat max = maxstr ? (float) g_ascii_strtod (maxstr, NULL) : G_MAXFLOAT;
pspec = g_param_spec_float ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else if (spec_type == G_TYPE_PARAM_DOUBLE)
{
gdouble min = minstr ? g_ascii_strtod (minstr, NULL) : G_MINFLOAT;
gdouble max = maxstr ? g_ascii_strtod (maxstr, NULL) : G_MAXFLOAT;
pspec = g_param_spec_float ("dummy", "dummy", "dummy",
min, max, CLAMP (0, min, max),
G_PARAM_READABLE|G_PARAM_WRITABLE);
}
else
g_critical ("Unsupported pspec type %s (value -> string)", g_type_name (spec_type));
}
return pspec;
}
/**
* glade_property_class_update_from_node:
* @node: the property node
......@@ -1273,8 +1435,9 @@ glade_property_class_update_from_node (GladeXmlNode *node,
const gchar *domain)
{
GladePropertyClass *klass;
GParamSpec *pspec = NULL;
gchar *buf, *translated;
GladeXmlNode *child;
GladeXmlNode *child, *spec_node;
g_return_val_if_fail (property_class != NULL, FALSE);
......@@ -1301,45 +1464,48 @@ glade_property_class_update_from_node (GladeXmlNode *node,
return TRUE;
}
/* ...the spec... we could be introducing a new one or even overriding an existing spec... */
buf = glade_xml_get_value_string (node, GLADE_TAG_SPEC);
if (buf)
if ((spec_node = glade_xml_search_child (node, GLADE_TAG_SPECIFICATIONS)) != NULL)
pspec = glade_property_class_parse_specifications (klass, spec_node);
else if ((buf = glade_xml_get_value_string (node, GLADE_TAG_SPEC)) != NULL)
{
/* ... get the tooltip from the pspec ... */
if ((klass->pspec = glade_utils_get_pspec_from_funcname (buf)) != NULL)
{
/* Make sure we can tell properties apart by there
* owning class.
*/
klass->pspec->owner_type = object_type;
/* We overrode the pspec, now it *is* a virtual property. */
klass->virt = TRUE;
if (klass->tooltip) g_free (klass->tooltip);
if (klass->name) g_free (klass->name);
klass->tooltip = g_strdup (g_param_spec_get_blurb (klass->pspec));
klass->name = g_strdup (g_param_spec_get_nick (klass->pspec));
if (klass->pspec->flags & G_PARAM_CONSTRUCT_ONLY)
klass->construct_only = TRUE;
if (klass->orig_def) {
g_value_unset (klass->orig_def);
g_free (klass->orig_def);
}
klass->orig_def = glade_property_class_get_default_from_spec (klass->pspec);
pspec = glade_utils_get_pspec_from_funcname (buf);
g_free (buf);
}
if (klass->def) {
g_value_unset (klass->def);
g_free (klass->def);
}
klass->def = glade_property_class_get_default_from_spec (klass->pspec);
/* ... get the tooltip from the pspec ... */
if (pspec != NULL)
{
klass->pspec = pspec;
/* Make sure we can tell properties apart by there
* owning class.
*/
klass->pspec->owner_type = object_type;
/* We overrode the pspec, now it *is* a virtual property. */
klass->virt = TRUE;
if (klass->tooltip) g_free (klass->tooltip);
if (klass->name) g_free (klass->name);
klass->tooltip = g_strdup (g_param_spec_get_blurb (klass->pspec));
klass->name = g_strdup (g_param_spec_get_nick (klass->pspec));
if (klass->pspec->flags & G_PARAM_CONSTRUCT_ONLY)
klass->construct_only = TRUE;
if (klass->orig_def) {
g_value_unset (klass->orig_def);
g_free (klass->orig_def);
}
g_free (buf);
klass->orig_def = glade_property_class_get_default_from_spec (klass->pspec);
if (klass->def) {
g_value_unset (klass->def);
g_free (klass->def);
}
klass->def = glade_property_class_get_default_from_spec (klass->pspec);
}
else if (!klass->pspec)
{
......@@ -1534,7 +1700,7 @@ glade_property_class_compare (GladePropertyClass *klass,
g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (klass), -1);
/* GLib does not know how to compare a boxed real value */
if (G_VALUE_HOLDS_BOXED (value1))
if (G_VALUE_HOLDS_BOXED (value1) || G_VALUE_HOLDS_BOXED (value2))
{
gchar *val1, *val2;
......
......@@ -146,6 +146,10 @@ typedef enum {
#define GLADE_TAG_ACTION "action"
#define GLADE_TAG_TYPE "type"
#define GLADE_TAG_SPEC "spec"
#define GLADE_TAG_SPECIFICATIONS "parameter-spec"
#define GLADE_TAG_MAX_VALUE "max"
#define GLADE_TAG_MIN_VALUE "min"
#define GLADE_TAG_VALUE_TYPE "value-type"
#define GLADE_TAG_TOOLTIP "tooltip"
#define GLADE_TAG_PARAMETERS "parameters"
#define GLADE_TAG_PARAMETER "parameter"
......
......@@ -31,18 +31,6 @@
#define GLADE_RESPONSE_CLEAR 42
/**************************************************************
* GParamSpec stuff here
**************************************************************/
struct _GladeParamSpecAccel {
GParamSpec parent_instance;
GType type; /* The type this accel key is for; this allows
* us to verify the validity of any signals for
* this type.
*/
};
GList *
glade_accel_list_copy (GList *accels)
{
......@@ -93,121 +81,6 @@ glade_accel_glist_get_type (void)
return type_id;
}
static void
param_accel_init (GParamSpec *pspec)
{
GladeParamSpecAccel *ospec = GLADE_PARAM_SPEC_ACCEL (pspec);
ospec->type = G_TYPE_OBJECT;
}
static void
param_accel_set_default (GParamSpec *pspec,
GValue *value)
{
if (value->data[0].v_pointer != NULL)
{
/* XXX FIXME ?? */
g_free (value->data[0].v_pointer);
}
value->data[0].v_pointer = NULL;
}
static gboolean
param_accel_validate (GParamSpec *pspec,
GValue *value)
{
/* GladeParamSpecAccel *aspec = GLADE_PARAM_SPEC_ACCEL (pspec); */
GList *accels, *list, *toremove = NULL;
GladeAccelInfo *info;
accels = value->data[0].v_pointer;
for (list = accels; list; list = list->next)
{
info = list->data;
if (/* Does the modifier contain any unwanted bits ? */
info->modifiers & GDK_MODIFIER_MASK ||
/* Do we have a signal ? */
/* FIXME: Check if the signal is valid for 'type' */
info->signal == NULL)
toremove = g_list_prepend (toremove, info);
}
for (list = toremove; list; list = list->next)
accels = g_list_remove (accels, list->data);
if (toremove) g_list_free (toremove);
value->data[0].v_pointer = accels;
return toremove != NULL;
}
static gint
param_accel_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2)
{
guint8 *p1 = value1->data[0].v_pointer;
guint8 *p2 = value2->data[0].v_pointer;
/* not much to compare here, try to at least provide stable lesser/greater result */
return p1 < p2 ? -1 : p1 > p2;
}
GType
glade_param_accel_get_type (void)
{
static GType accel_type = 0;
if (accel_type == 0)
{
static /* const */ GParamSpecTypeInfo pspec_info = {
sizeof (GladeParamSpecAccel), /* instance_size */
16, /* n_preallocs */
param_accel_init, /* instance_init */
0xdeadbeef, /* value_type, assigned further down */
NULL, /* finalize */
param_accel_set_default, /* value_set_default */
param_accel_validate, /* value_validate */
param_accel_values_cmp, /* values_cmp */
};
pspec_info.value_type = GLADE_TYPE_ACCEL_GLIST;
accel_type = g_param_type_register_static
("GladeParamAccel", &pspec_info);
}
return accel_type;
}
GParamSpec *
glade_param_spec_accel (const gchar *name,
const gchar *nick,
const gchar *blurb,
GType widget_type,
GParamFlags flags)
{
GladeParamSpecAccel *pspec;
pspec = g_param_spec_internal (GLADE_TYPE_PARAM_ACCEL,
name, nick, blurb, flags);
pspec->type = widget_type;
return G_PARAM_SPEC (pspec);
}
/* Accelerator spec */
GParamSpec *
glade_standard_accel_spec (void)
{
return glade_param_spec_accel ("accelerators", _("Accelerators"),
_("A list of accelerator keys"),
GTK_TYPE_WIDGET,
G_PARAM_READWRITE);
}
/* This is not used to save in the glade file... and its a one-way conversion.
* its only usefull to show the values in the UI.
*/
......@@ -623,7 +496,7 @@ glade_eprop_accel_show_dialog (GtkWidget *dialog_button,
GladeEPropAccel *eprop_accel = GLADE_EPROP_ACCEL (eprop);
GtkWidget *dialog, *parent, *vbox, *sw, *tree_view;
GladeProject *project;
GValue *value;
GValue value = { 0, };
GList *accelerators = NULL;
gint res;
......@@ -672,25 +545,20 @@ glade_eprop_accel_show_dialog (GtkWidget *dialog_button,
(GtkTreeModelForeachFunc)
glade_eprop_accel_accum_accelerators, &accelerators);
value = g_new0 (GValue, 1);
g_value_init (value, GLADE_TYPE_ACCEL_GLIST);
g_value_take_boxed (value, accelerators);
glade_editor_property_commit (eprop, value);
g_value_init (&value, GLADE_TYPE_ACCEL_GLIST);
g_value_take_boxed (&value, accelerators);
g_value_unset (value);
g_free (value);
glade_editor_property_commit (eprop, &value);
g_value_unset (&value);
}
else if (res == GLADE_RESPONSE_CLEAR)
{
value = g_new0 (GValue, 1);
g_value_init (value, GLADE_TYPE_ACCEL_GLIST);
g_value_set_boxed (value, NULL);
g_value_init (&value, GLADE_TYPE_ACCEL_GLIST);
g_value_set_boxed (&value, NULL);
glade_editor_property_commit (eprop, value);
glade_editor_property_commit (eprop, &value);
g_value_unset (value);
g_free (value);
g_value_unset (&value);
}
/* Clean up ...
......
......@@ -7,19 +7,11 @@
G_BEGIN_DECLS
#define GLADE_TYPE_PARAM_ACCEL (glade_param_accel_get_type())
#define GLADE_TYPE_ACCEL_GLIST (glade_accel_glist_get_type())
#define GLADE_TYPE_EPROP_ACCEL (glade_eprop_accel_get_type())
#define GLADE_IS_PARAM_SPEC_ACCEL(pspec) \
(G_TYPE_CHECK_INSTANCE_TYPE ((pspec), \
GLADE_TYPE_PARAM_ACCEL))
#define GLADE_PARAM_SPEC_ACCEL(pspec) \
(G_TYPE_CHECK_INSTANCE_CAST ((pspec), \
GLADE_TYPE_PARAM_ACCEL, GladeParamSpecAccel))
typedef struct _GladeKey GladeKey;
typedef struct _GladeParamSpecAccel GladeParamSpecAccel;
typedef struct _GladeAccelInfo GladeAccelInfo;
struct _GladeAccelInfo {
......@@ -40,22 +32,12 @@ extern const GladeKey GladeKeys[];
#define GLADE_KEYS_LAST_KP "KP_9"
#define GLADE_KEYS_LAST_FKEY "F35"
GType glade_param_accel_get_type (void) G_GNUC_CONST;
GType glade_accel_glist_get_type (void) G_GNUC_CONST;
GType glade_eprop_accel_get_type (void) G_GNUC_CONST;
GType glade_accel_glist_get_type (void) G_GNUC_CONST;
GType glade_eprop_accel_get_type (void) G_GNUC_CONST;
GList *glade_accel_list_copy (GList *accels);
void glade_accel_list_free (GList *accels);
GParamSpec *glade_param_spec_accel (const gchar *name,
const gchar *nick,
const gchar *blurb,
GType widget_type,
GParamFlags flags);
GParamSpec *glade_standard_accel_spec (void);
gchar *glade_accels_make_string (GList *accels);
G_END_DECLS
......
......@@ -36,12 +36,6 @@
#define GLADE_RESPONSE_CLEAR 42
struct _GladeParamSpecAttributes {
GParamSpec parent_instance;
};
static GList *
glade_attr_list_copy (GList *attrs)
{
......@@ -94,92 +88,6 @@ glade_attr_glist_get_type (void)
return type_id;
}
static void
param_attributes_init (GParamSpec *pspec)
{
}
static void
param_attributes_set_default (GParamSpec *pspec,
GValue *value)
{
if (value->data[0].v_pointer != NULL)
{
glade_attr_list_free (value->data[0].v_pointer);
}
value->data[0].v_pointer = NULL;
}
static gboolean
param_attributes_validate (GParamSpec *pspec,
GValue *value)
{
return TRUE;
}
static gint
param_attributes_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2)
{
guint8 *p1 = value1->data[0].v_pointer;
guint8 *p2 = value2->data[0].v_pointer;
/* not much to compare here, try to at least provide stable lesser/greater result */
return p1 < p2 ? -1 : p1 > p2;
}
GType
glade_param_attributes_get_type (void)
{
static GType attributes_type = 0;
if (attributes_type == 0)
{
static /* const */ GParamSpecTypeInfo pspec_info = {
sizeof (GladeParamSpecAttributes), /* instance_size */
16, /* n_preallocs */
param_attributes_init, /* instance_init */
0xdeadbeef, /* value_type, assigned further down */
NULL, /* finalize */
param_attributes_set_default, /* value_set_default */
param_attributes_validate, /* value_validate */
param_attributes_values_cmp, /* values_cmp */
};
pspec_info.value_type = GLADE_TYPE_ATTR_GLIST;
attributes_type = g_param_type_register_static
("GladeParamAttributes", &pspec_info);
}
return attributes_type;
}
GParamSpec *
glade_param_spec_attributes (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags)
{
GladeParamSpecAttributes *pspec;
pspec = g_param_spec_internal (GLADE_TYPE_PARAM_ATTRIBUTES,
name, nick, blurb, flags);
return G_PARAM_SPEC (pspec);
}
GParamSpec *
glade_gtk_attributes_spec (void)
{
return glade_param_spec_attributes ("attributes", _("Attributes"),
_("A list of attributes"),
G_PARAM_READWRITE);
}
/**************************************************************
* GladeEditorProperty stuff here
**************************************************************/
......@@ -1180,20 +1088,16 @@ glade_eprop_attrs_load (GladeEditorProperty *eprop,
GladeProperty *property)
{
GladeEditorPropertyClass *parent_class =
g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop));
GladeEPropAttrs *eprop_attrs = GLADE_EPROP_ATTRS (eprop);
g_type_class_peek_parent (G_OBJECT_GET_CLASS (eprop));
/* Chain up first */
/* No displayable attributes in eprop, just a button. */
parent_class->load (eprop, property);
if (property == NULL) return;
}
static GtkWidget *
glade_eprop_attrs_create_input (GladeEditorProperty *eprop)
{
GladeEPropAttrs *eprop_attrs = GLADE_EPROP_ATTRS (eprop);
GtkWidget *hbox;
GtkWidget *button;
......
......@@ -9,18 +9,9 @@ G_BEGIN_DECLS
#define GLADE_TYPE_EPROP_ATTRS (glade_eprop_attrs_get_type())
#define GLADE_TYPE_PARAM_ATTRIBUTES (glade_param_attributes_get_type())
#define GLADE_TYPE_ATTR_GLIST (glade_attr_glist_get_type())
#define GLADE_IS_PARAM_SPEC_ATTRIBUTES(pspec) \
(G_TYPE_CHECK_INSTANCE_TYPE ((pspec), \
GLADE_TYPE_PARAM_ATTRIBUTES))
#define GLADE_PARAM_SPEC_ATTRIBUTES(pspec) \
(G_TYPE_CHECK_INSTANCE_CAST ((pspec), \
GLADE_TYPE_PARAM_ATTRIBUTES, GladeParamSpecAttributes))
/* The GladeParamSpecAttributes is a GList * of GladeAttribute structs */
typedef struct _GladeParamSpecAttributes GladeParamSpecAttributes;
typedef struct _GladeAttribute GladeAttribute;
struct _GladeAttribute {
......@@ -32,18 +23,10 @@ struct _GladeAttribute {
guint end;
};
GType glade_param_attributes_get_type (void) G_GNUC_CONST;
GType glade_eprop_attrs_get_type (void) G_GNUC_CONST;
GType glade_attr_glist_get_type (void) G_GNUC_CONST;
GParamSpec *glade_param_spec_attributes (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
GParamSpec *glade_gtk_attributes_spec (void);
GladeAttribute *glade_gtk_attribute_from_string (PangoAttrType type,
const gchar *strval);
gchar *glade_gtk_string_from_attr (GladeAttribute *gattr);
......
......@@ -193,80 +193,21 @@ glade_column_type_list_get_type (void)
static GType type_id = 0;
if (!type_id)
{
type_id = g_boxed_type_register_static
("GladeColumnTypeList",
(GBoxedCopyFunc) glade_column_list_copy,
(GBoxedFreeFunc) glade_column_list_free);
return type_id;
}
/********************** GladeParamSpecColumnTypes ***********************/
struct _GladeParamSpecColumnTypes
{
GParamSpec parent_instance;
};
static gint
param_values_cmp (GParamSpec *pspec, const GValue *value1, const GValue *value2)
{
GList *l1, *l2;
gint retval;
l1 = g_value_get_boxed (value1);
l2 = g_value_get_boxed (value2);
if (l1 == NULL && l2 == NULL) return 0;