[glade/tintou/klass-removal: 2/2] Rename *Klass to *Class as there are no name collision anymore
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/tintou/klass-removal: 2/2] Rename *Klass to *Class as there are no name collision anymore
- Date: Tue, 18 Jun 2019 11:14:30 +0000 (UTC)
commit 5b859654f0ce261fd7316583bf00de6292b489f8
Author: Corentin Noël <corentin noel collabora com>
Date: Tue Jun 18 11:26:36 2019 +0200
Rename *Klass to *Class as there are no name collision anymore
doc/gladeui-docs.xml | 2 +-
doc/gladeui-sections.txt | 19 ++++++++------
gladeui/glade-property.c | 67 +++++++++++++-----------------------------------
gladeui/glade-property.h | 10 ++++----
gladeui/glade-signal.c | 16 ++----------
gladeui/glade-signal.h | 10 ++++----
6 files changed, 42 insertions(+), 82 deletions(-)
---
diff --git a/doc/gladeui-docs.xml b/doc/gladeui-docs.xml
index 85e28bcb..676899b4 100644
--- a/doc/gladeui-docs.xml
+++ b/doc/gladeui-docs.xml
@@ -38,7 +38,7 @@
<xi:include href="xml/glade-widget.xml"/>
<xi:include href="xml/glade-widget-adaptor.xml"/>
<xi:include href="xml/glade-widget-action.xml"/>
- <xi:include href="xml/gw-action-class.xml"/>
+ <xi:include href="xml/glade-widget-action-def.xml"/>
<xi:include href="xml/glade-fixed.xml"/>
<xi:include href="xml/glade-property.xml"/>
<xi:include href="xml/glade-property-def.xml"/>
diff --git a/doc/gladeui-sections.txt b/doc/gladeui-sections.txt
index aee3444a..0f09775a 100644
--- a/doc/gladeui-sections.txt
+++ b/doc/gladeui-sections.txt
@@ -510,12 +510,12 @@ glade_signal_set_userdata
<SUBSECTION Standard>
GLADE_SIGNAL
GLADE_IS_SIGNAL
-GLADE_IS_SIGNAL_KLASS
+GLADE_IS_SIGNAL_CLASS
GLADE_TYPE_SIGNAL
-GladeSignalKlass
+GladeSignalClass
GladeSignalPrivate
-GLADE_SIGNAL_GET_KLASS
-GLADE_SIGNAL_KLASS
+GLADE_SIGNAL_GET_CLASS
+GLADE_SIGNAL_CLASS
glade_signal_get_type
</SECTION>
@@ -524,11 +524,13 @@ glade_signal_get_type
<TITLE>GladeSignalDef</TITLE>
GladeSignalDef
glade_signal_def_new
+glade_signal_def_clone
glade_signal_def_free
glade_signal_def_update_from_node
glade_signal_def_get_adaptor
glade_signal_def_get_flags
glade_signal_def_get_name
+glade_signal_def_get_object_type_name
glade_signal_def_set_deprecated
glade_signal_def_deprecated
glade_signal_def_set_since
@@ -1036,10 +1038,10 @@ GLADE_PROPERTY
GLADE_IS_PROPERTY
GLADE_TYPE_PROPERTY
glade_property_get_type
-GLADE_PROPERTY_KLASS
-GLADE_IS_PROPERTY_KLASS
-GLADE_PROPERTY_GET_KLASS
-GladePropertyKlass
+GLADE_PROPERTY_CLASS
+GLADE_IS_PROPERTY_CLASS
+GLADE_PROPERTY_GET_CLASS
+GladePropertyClass
GladePropertyPrivate
glade_property_state_get_type
GLADE_TYPE_PROPERTY_STATE
@@ -1512,6 +1514,7 @@ glade_widget_action_def_set_important
glade_widget_action_def_set_label
glade_widget_action_def_set_stock
<SUBSECTION Standard>
+GLADE_TYPE_WIDGET_ACTION_DEF
GLADE_WIDGET_ACTION_DEF
glade_widget_action_def_get_type
</SECTION>
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index 7c5f324c..ee021652 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -127,6 +127,8 @@ struct _GladePropertyPrivate {
*/
};
+G_DEFINE_TYPE_WITH_PRIVATE (GladeProperty, glade_property, G_TYPE_OBJECT)
+
enum
{
VALUE_CHANGED,
@@ -151,8 +153,6 @@ enum
static GParamSpec *properties[N_PROPERTIES];
static guint glade_property_signals[LAST_SIGNAL] = { 0 };
-static GObjectClass *glade_property_parent_class = NULL;
-
/*******************************************************************************
GladeProperty class methods
*******************************************************************************/
@@ -388,7 +388,7 @@ glade_property_set_value_impl (GladeProperty *property, const GValue *value)
g_value_reset (property->priv->value);
g_value_copy (value, property->priv->value);
- GLADE_PROPERTY_GET_KLASS (property)->sync (property);
+ GLADE_PROPERTY_GET_CLASS (property)->sync (property);
glade_property_fix_state (property);
@@ -647,13 +647,9 @@ glade_property_init (GladeProperty *property)
}
static void
-glade_property_klass_init (GladePropertyKlass * prop_class)
+glade_property_class_init (GladePropertyClass * prop_class)
{
- GObjectClass *object_class;
- g_return_if_fail (prop_class != NULL);
-
- glade_property_parent_class = g_type_class_peek_parent (prop_class);
- object_class = G_OBJECT_CLASS (prop_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (prop_class);
/* GObjectClass */
object_class->set_property = glade_property_set_real_property;
@@ -736,7 +732,7 @@ glade_property_klass_init (GladePropertyKlass * prop_class)
g_signal_new ("value-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GladePropertyKlass,
+ G_STRUCT_OFFSET (GladePropertyClass,
value_changed),
NULL, NULL,
_glade_marshal_VOID__POINTER_POINTER,
@@ -746,39 +742,12 @@ glade_property_klass_init (GladePropertyKlass * prop_class)
g_signal_new ("tooltip-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GladePropertyKlass,
+ G_STRUCT_OFFSET (GladePropertyClass,
tooltip_changed),
NULL, NULL,
_glade_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING);
-
- g_type_class_add_private (prop_class, sizeof (GladePropertyPrivate));
-}
-
-GType
-glade_property_get_type (void)
-{
- static GType property_type = 0;
-
- if (!property_type)
- {
- static const GTypeInfo property_info = {
- sizeof (GladePropertyKlass), /* Klass is our class */
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) glade_property_klass_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GladeProperty),
- 0, /* n_preallocs */
- (GInstanceInitFunc) glade_property_init,
- };
- property_type =
- g_type_register_static (G_TYPE_OBJECT,
- "GladeProperty", &property_info, 0);
- }
- return property_type;
}
/*******************************************************************************
@@ -838,7 +807,7 @@ GladeProperty *
glade_property_dup (GladeProperty *template_prop, GladeWidget *widget)
{
g_return_val_if_fail (GLADE_IS_PROPERTY (template_prop), NULL);
- return GLADE_PROPERTY_GET_KLASS (template_prop)->dup (template_prop, widget);
+ return GLADE_PROPERTY_GET_CLASS (template_prop)->dup (template_prop, widget);
}
static void
@@ -853,7 +822,7 @@ glade_property_reset_common (GladeProperty *property, gboolean original)
else
value = glade_property_def_get_default (property->priv->def);
- GLADE_PROPERTY_GET_KLASS (property)->set_value (property, value);
+ GLADE_PROPERTY_GET_CLASS (property)->set_value (property, value);
}
/**
@@ -892,7 +861,7 @@ glade_property_default_common (GladeProperty *property, gboolean orig)
else
value = glade_property_def_get_default (property->priv->def);
- return GLADE_PROPERTY_GET_KLASS (property)->equals_value (property, value);
+ return GLADE_PROPERTY_GET_CLASS (property)->equals_value (property, value);
}
/**
@@ -930,7 +899,7 @@ gboolean
glade_property_equals_value (GladeProperty *property, const GValue *value)
{
g_return_val_if_fail (GLADE_IS_PROPERTY (property), FALSE);
- return GLADE_PROPERTY_GET_KLASS (property)->equals_value (property, value);
+ return GLADE_PROPERTY_GET_CLASS (property)->equals_value (property, value);
}
/**
@@ -950,7 +919,7 @@ glade_property_equals_va_list (GladeProperty *property, va_list vl)
value = glade_property_def_make_gvalue_from_vl (property->priv->def, vl);
- ret = GLADE_PROPERTY_GET_KLASS (property)->equals_value (property, value);
+ ret = GLADE_PROPERTY_GET_CLASS (property)->equals_value (property, value);
g_value_unset (value);
g_free (value);
@@ -993,7 +962,7 @@ glade_property_set_value (GladeProperty *property, const GValue *value)
{
g_return_val_if_fail (GLADE_IS_PROPERTY (property), FALSE);
g_return_val_if_fail (value != NULL, FALSE);
- return GLADE_PROPERTY_GET_KLASS (property)->set_value (property, value);
+ return GLADE_PROPERTY_GET_CLASS (property)->set_value (property, value);
}
/**
@@ -1013,7 +982,7 @@ glade_property_set_va_list (GladeProperty *property, va_list vl)
value = glade_property_def_make_gvalue_from_vl (property->priv->def, vl);
- success = GLADE_PROPERTY_GET_KLASS (property)->set_value (property, value);
+ success = GLADE_PROPERTY_GET_CLASS (property)->set_value (property, value);
g_value_unset (value);
g_free (value);
@@ -1055,7 +1024,7 @@ glade_property_get_value (GladeProperty *property, GValue *value)
{
g_return_if_fail (GLADE_IS_PROPERTY (property));
g_return_if_fail (value != NULL);
- GLADE_PROPERTY_GET_KLASS (property)->get_value (property, value);
+ GLADE_PROPERTY_GET_CLASS (property)->get_value (property, value);
}
/**
@@ -1122,7 +1091,7 @@ void
glade_property_sync (GladeProperty *property)
{
g_return_if_fail (GLADE_IS_PROPERTY (property));
- GLADE_PROPERTY_GET_KLASS (property)->sync (property);
+ GLADE_PROPERTY_GET_CLASS (property)->sync (property);
}
/**
@@ -1135,7 +1104,7 @@ void
glade_property_load (GladeProperty *property)
{
g_return_if_fail (GLADE_IS_PROPERTY (property));
- GLADE_PROPERTY_GET_KLASS (property)->load (property);
+ GLADE_PROPERTY_GET_CLASS (property)->load (property);
}
/**
@@ -1191,7 +1160,7 @@ glade_property_read (GladeProperty *property,
gvalue =
glade_property_def_make_gvalue_from_string (property->priv->def, value, project);
- GLADE_PROPERTY_GET_KLASS (property)->set_value (property, gvalue);
+ GLADE_PROPERTY_GET_CLASS (property)->set_value (property, gvalue);
g_value_unset (gvalue);
g_free (gvalue);
diff --git a/gladeui/glade-property.h b/gladeui/glade-property.h
index 127f7c18..14dafff1 100644
--- a/gladeui/glade-property.h
+++ b/gladeui/glade-property.h
@@ -7,12 +7,12 @@ G_BEGIN_DECLS
#define GLADE_TYPE_PROPERTY (glade_property_get_type())
#define GLADE_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_PROPERTY,
GladeProperty))
-#define GLADE_PROPERTY_KLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_PROPERTY,
GladePropertyKlass))
+#define GLADE_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_PROPERTY,
GladePropertyClass))
#define GLADE_IS_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_PROPERTY))
-#define GLADE_IS_PROPERTY_KLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_PROPERTY))
-#define GLADE_PROPERTY_GET_KLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_PROPERTY, GladePropertyKlass))
+#define GLADE_IS_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_PROPERTY))
+#define GLADE_PROPERTY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_PROPERTY, GladePropertyClass))
-typedef struct _GladePropertyKlass GladePropertyKlass;
+typedef struct _GladePropertyClass GladePropertyClass;
typedef struct _GladePropertyPrivate GladePropertyPrivate;
typedef enum {
@@ -34,7 +34,7 @@ struct _GladeProperty
};
-struct _GladePropertyKlass
+struct _GladePropertyClass
{
GObjectClass parent_class;
diff --git a/gladeui/glade-signal.c b/gladeui/glade-signal.c
index fee32bca..0b0d1e54 100644
--- a/gladeui/glade-signal.c
+++ b/gladeui/glade-signal.c
@@ -55,17 +55,8 @@ enum {
N_PROPERTIES
};
-/* We need these defines because GladeSignalClass is another object type!
- * So we use GladeSignalKlass as the class name for GladeSignal
- */
-#define GladeSignalClass GladeSignalKlass
-#define glade_signal_class_init glade_signal_klass_init
-
G_DEFINE_TYPE_WITH_PRIVATE (GladeSignal, glade_signal, G_TYPE_OBJECT)
-#undef GladeSignalClass
-#undef glade_signal_class_init
-
static GParamSpec *properties[N_PROPERTIES];
static void
@@ -162,12 +153,9 @@ glade_signal_init (GladeSignal *signal)
}
static void
-glade_signal_klass_init (GladeSignalKlass *klass)
+glade_signal_class_init (GladeSignalClass *klass)
{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
- glade_signal_parent_class = g_type_class_peek_parent (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = glade_signal_set_property;
object_class->get_property = glade_signal_get_property;
diff --git a/gladeui/glade-signal.h b/gladeui/glade-signal.h
index 9e0ef955..fccaf568 100644
--- a/gladeui/glade-signal.h
+++ b/gladeui/glade-signal.h
@@ -9,13 +9,13 @@ G_BEGIN_DECLS
#define GLADE_TYPE_SIGNAL (glade_signal_get_type())
#define GLADE_SIGNAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_SIGNAL, GladeSignal))
-#define GLADE_SIGNAL_KLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_SIGNAL, GladeSignalKlass))
+#define GLADE_SIGNAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_SIGNAL, GladeSignalClass))
#define GLADE_IS_SIGNAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_SIGNAL))
-#define GLADE_IS_SIGNAL_KLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_SIGNAL))
-#define GLADE_SIGNAL_GET_KLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_SIGNAL, GladeSignalKlass))
+#define GLADE_IS_SIGNAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_SIGNAL))
+#define GLADE_SIGNAL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_SIGNAL, GladeSignalClass))
typedef struct _GladeSignal GladeSignal;
-typedef struct _GladeSignalKlass GladeSignalKlass;
+typedef struct _GladeSignalClass GladeSignalClass;
typedef struct _GladeSignalPrivate GladeSignalPrivate;
struct _GladeSignal {
@@ -24,7 +24,7 @@ struct _GladeSignal {
GladeSignalPrivate *priv;
};
-struct _GladeSignalKlass {
+struct _GladeSignalClass {
GObjectClass object_class;
void (* glade_reserved1) (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]