Commit 7f4d5a0c authored by Paolo Borelli's avatar Paolo Borelli

gtk_object -> g_object cleanup.

parent 0d6ba805
2003-06-15 Paolo Borelli <pborelli@katamail.com>
* src/glade-property.[ch]: gtk_object -> g_object cleanup.
2003-06-14 Paolo Borelli <pborelli@katamail.com>
* src/glade-gtk.c: first step at making the gtknotebook
......
......@@ -32,9 +32,8 @@
#include "glade-widget-class.h"
#include "glade-debug.h"
static void glade_property_class_init (GladePropertyObjectClass * klass);
static void glade_property_object_class_init (GladePropertyObjectClass *class);
static void glade_property_init (GladeProperty *property);
static void glade_property_destroy (GtkObject *object);
enum
{
......@@ -45,55 +44,51 @@ enum
static guint glade_property_signals[LAST_SIGNAL] = {0};
static GtkObjectClass *parent_class = NULL;
guint
GType
glade_property_get_type (void)
{
static guint type = 0;
if (!type)
{
GtkTypeInfo info =
{
"GladeProperty",
sizeof (GladeProperty),
static GType type = 0;
if (!type) {
static const GTypeInfo info = {
sizeof (GladePropertyObjectClass),
(GtkClassInitFunc) glade_property_class_init,
(GtkObjectInitFunc) glade_property_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) glade_property_object_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (GladeProperty),
0,
(GInstanceInitFunc) glade_property_init
};
type = gtk_type_unique (gtk_object_get_type (),
&info);
type = g_type_register_static (G_TYPE_OBJECT, "GladeProperty", &info, 0);
}
return type;
}
static void
glade_property_class_init (GladePropertyObjectClass * klass)
glade_property_object_class_init (GladePropertyObjectClass *class)
{
GtkObjectClass *object_class;
GObjectClass *object_class;
object_class = (GtkObjectClass *) klass;
object_class = G_OBJECT_CLASS (class);
parent_class = gtk_type_class (gtk_object_get_type ());
parent_class = g_type_class_peek_parent (class);
glade_property_signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GladePropertyObjectClass, changed),
gtk_marshal_VOID__VOID,
GTK_TYPE_NONE, 0);
klass->changed = NULL;
object_class->destroy = glade_property_destroy;
g_signal_new ("changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GladePropertyObjectClass, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
class->changed = NULL;
}
static void
glade_property_init (GladeProperty *property)
{
......@@ -104,25 +99,16 @@ glade_property_init (GladeProperty *property)
property->child = NULL;
}
static void
glade_property_destroy (GtkObject *object)
{
GladeProperty *property;
property = GLADE_PROPERTY (object);
}
static GladeProperty *
glade_property_new (void)
{
GladeProperty *property;
property = GLADE_PROPERTY (gtk_type_new (glade_property_get_type ()));
property = g_object_new (GLADE_TYPE_PROPERTY, NULL);
return property;
}
/* We are recursing so add the prototype. Don't you love C ? */
static GList * glade_property_list_new_from_list (GList *list, GladeWidget *widget);
......@@ -198,7 +184,6 @@ glade_property_list_new_from_list (GList *list, GladeWidget *widget)
return new_list;
}
GList *
glade_property_list_new_from_widget_class (GladeWidgetClass *class,
GladeWidget *widget)
......@@ -210,7 +195,6 @@ glade_property_list_new_from_widget_class (GladeWidgetClass *class,
return glade_property_list_new_from_list (list, widget);
}
GladeProperty *
glade_property_get_from_id (GList *settings_list, const gchar *id)
{
......@@ -704,3 +688,4 @@ glade_property_get_from_widget (GladeProperty *property)
}
}
}
......@@ -4,9 +4,11 @@
G_BEGIN_DECLS
#define GLADE_PROPERTY(obj) GTK_CHECK_CAST (obj, glade_property_get_type (), GladeProperty)
#define GLADE_PROPERTY_OBJECT_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, glade_property_get_type (), GladePropertyObjectClass)
#define GLADE_IS_PROPERTY(obj) GTK_CHECK_TYPE (obj, glade_property_get_type ())
#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_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_PROPERTY, GladePropertyObjectClass))
#define GLADE_IS_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_PROPERTY))
typedef struct _GladePropertyObjectClass GladePropertyObjectClass;
......@@ -14,8 +16,8 @@ typedef struct _GladePropertyObjectClass GladePropertyObjectClass;
* There will be one GladePropertyClass for "GtkLabel->label" but one
* GladeProperty for each GtkLabel in the GladeProject.
*/
struct _GladeProperty {
struct _GladeProperty
{
GObject object;
GladePropertyClass *class; /* A pointer to the GladeProperty that this
......@@ -56,21 +58,24 @@ struct _GladePropertyObjectClass
void (*changed) (GladeProperty *property, const gchar *value);
};
struct _GladePropertyQuery {
struct _GladePropertyQuery
{
gchar *window_title;
gchar *question;
};
struct _GladePropertyQueryResult {
struct _GladePropertyQueryResult
{
GHashTable *hash;
};
guint glade_property_get_type (void);
GType glade_property_get_type (void);
GList * glade_property_list_new_from_widget_class (GladeWidgetClass *class,
GladeWidget *widget);
GladeProperty * glade_property_new_from_class (GladePropertyClass *class, GladeWidget *widget);
GList *glade_property_list_new_from_widget_class (GladeWidgetClass *class,
GladeWidget *widget);
GladeProperty *glade_property_new_from_class (GladePropertyClass *class,
GladeWidget *widget);
void glade_property_free (GladeProperty *property);
void glade_property_set (GladeProperty *property, const GValue *value);
......@@ -90,16 +95,15 @@ gboolean glade_property_get_boolean (GladeProperty *property);
gunichar glade_property_get_unichar (GladeProperty *property);
GladeChoice * glade_property_get_enum (GladeProperty *property);
void glade_property_get_from_widget (GladeProperty *property);
/* Get a GladeProperty */
GladeProperty * glade_property_get_from_id (GList *settings_list,
const gchar *id);
GladeProperty *glade_property_get_from_id (GList *settings_list,
const gchar *id);
/* Property Queries */
GladePropertyQueryResult * glade_property_query_result_new (void);
void glade_property_query_result_destroy (GladePropertyQueryResult *result);
GladePropertyQueryResult *glade_property_query_result_new (void);
void glade_property_query_result_destroy (GladePropertyQueryResult *result);
void glade_property_query_result_get_int (GladePropertyQueryResult *result,
const gchar *name,
......@@ -109,7 +113,7 @@ void glade_property_query_result_set_int (GladePropertyQueryResult *result,
gint value);
/* XML i/o */
GladeXmlNode * glade_property_write (GladeXmlContext *context, GladeProperty *property);
GladeXmlNode *glade_property_write (GladeXmlContext *context, GladeProperty *property);
G_END_DECLS
......
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