Commit ef084e87 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

removed signals. Moved to inherit from GObject instead of GtkObject.

Wed Feb 21 15:41:34 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreestore.c: removed signals.  Moved to inherit from
	GObject instead of GtkObject.

	* gtk/gtkliststore.c: ditto.

	* gtk/gtktreemodelsort.c: ditto.

	* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
	GtkTreeModelIface, instead of in each model.
parent 0ebf7690
Wed Feb 21 15:41:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c: removed signals. Moved to inherit from
GObject instead of GtkObject.
* gtk/gtkliststore.c: ditto.
* gtk/gtktreemodelsort.c: ditto.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
GtkTreeModelIface, instead of in each model.
2001-02-21 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_child_anchor):
......
Wed Feb 21 15:41:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c: removed signals. Moved to inherit from
GObject instead of GtkObject.
* gtk/gtkliststore.c: ditto.
* gtk/gtktreemodelsort.c: ditto.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
GtkTreeModelIface, instead of in each model.
2001-02-21 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_child_anchor):
......
Wed Feb 21 15:41:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c: removed signals. Moved to inherit from
GObject instead of GtkObject.
* gtk/gtkliststore.c: ditto.
* gtk/gtktreemodelsort.c: ditto.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
GtkTreeModelIface, instead of in each model.
2001-02-21 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_child_anchor):
......
Wed Feb 21 15:41:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c: removed signals. Moved to inherit from
GObject instead of GtkObject.
* gtk/gtkliststore.c: ditto.
* gtk/gtktreemodelsort.c: ditto.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
GtkTreeModelIface, instead of in each model.
2001-02-21 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_child_anchor):
......
Wed Feb 21 15:41:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c: removed signals. Moved to inherit from
GObject instead of GtkObject.
* gtk/gtkliststore.c: ditto.
* gtk/gtktreemodelsort.c: ditto.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
GtkTreeModelIface, instead of in each model.
2001-02-21 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_child_anchor):
......
Wed Feb 21 15:41:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c: removed signals. Moved to inherit from
GObject instead of GtkObject.
* gtk/gtkliststore.c: ditto.
* gtk/gtktreemodelsort.c: ditto.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
GtkTreeModelIface, instead of in each model.
2001-02-21 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_child_anchor):
......
Wed Feb 21 15:41:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c: removed signals. Moved to inherit from
GObject instead of GtkObject.
* gtk/gtkliststore.c: ditto.
* gtk/gtktreemodelsort.c: ditto.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): moved signals to
GtkTreeModelIface, instead of in each model.
2001-02-21 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_child_anchor):
......
......@@ -27,16 +27,6 @@
#define G_SLIST(x) ((GSList *) x)
enum {
CHANGED,
INSERTED,
CHILD_TOGGLED,
DELETED,
LAST_SIGNAL
};
static guint list_store_signals[LAST_SIGNAL] = { 0 };
static void gtk_list_store_init (GtkListStore *list_store);
static void gtk_list_store_class_init (GtkListStoreClass *class);
static void gtk_list_store_tree_model_init (GtkTreeModelIface *iface);
......@@ -98,7 +88,7 @@ validate_list_store (GtkListStore *list_store)
GtkType
gtk_list_store_get_type (void)
{
static GtkType list_store_type = 0;
static GType list_store_type = 0;
if (!list_store_type)
{
......@@ -136,7 +126,7 @@ gtk_list_store_get_type (void)
NULL
};
list_store_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkListStore", &list_store_info, 0);
list_store_type = g_type_register_static (G_TYPE_OBJECT, "GtkListStore", &list_store_info, 0);
g_type_add_interface_static (list_store_type,
GTK_TYPE_TREE_MODEL,
&tree_model_info);
......@@ -154,45 +144,9 @@ gtk_list_store_get_type (void)
static void
gtk_list_store_class_init (GtkListStoreClass *class)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
list_store_signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkListStoreClass, changed),
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
list_store_signals[INSERTED] =
gtk_signal_new ("inserted",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkListStoreClass, inserted),
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
list_store_signals[CHILD_TOGGLED] =
gtk_signal_new ("child_toggled",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkListStoreClass, child_toggled),
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
list_store_signals[DELETED] =
gtk_signal_new ("deleted",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkListStoreClass, deleted),
gtk_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
GTK_TYPE_TREE_PATH);
GObjectClass *object_class;
object_class = (GObjectClass*) class;
}
static void
......@@ -250,7 +204,7 @@ gtk_list_store_init (GtkListStore *list_store)
GtkListStore *
gtk_list_store_new (void)
{
return GTK_LIST_STORE (gtk_type_new (gtk_list_store_get_type ()));
return GTK_LIST_STORE (g_object_new (gtk_list_store_get_type (), NULL));
}
/**
......@@ -583,9 +537,9 @@ gtk_list_store_set_cell (GtkListStore *list_store,
if (column == 0)
{
_gtk_tree_data_list_value_to_node (list, value);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
"changed",
NULL, iter);
g_signal_emit_by_name (G_OBJECT (list_store),
"changed",
NULL, iter);
return;
}
......@@ -613,7 +567,7 @@ gtk_list_store_set_cell (GtkListStore *list_store,
column --;
}
_gtk_tree_data_list_value_to_node (list, value);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
g_signal_emit_by_name (G_OBJECT (list_store),
"changed",
NULL, iter);
}
......@@ -790,7 +744,7 @@ gtk_list_store_remove (GtkListStore *list_store,
validate_list_store (list_store);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
g_signal_emit_by_name (G_OBJECT (list_store),
"deleted",
path);
gtk_tree_path_free (path);
......@@ -865,7 +819,7 @@ gtk_list_store_insert (GtkListStore *list_store,
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, position);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
g_signal_emit_by_name (G_OBJECT (list_store),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -946,7 +900,7 @@ gtk_list_store_insert_before (GtkListStore *list_store,
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, i);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
g_signal_emit_by_name (G_OBJECT (list_store),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -1000,7 +954,7 @@ gtk_list_store_insert_after (GtkListStore *list_store,
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, i);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
g_signal_emit_by_name (G_OBJECT (list_store),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -1041,7 +995,7 @@ gtk_list_store_prepend (GtkListStore *list_store,
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, 0);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
g_signal_emit_by_name (G_OBJECT (list_store),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -1084,7 +1038,7 @@ gtk_list_store_append (GtkListStore *list_store,
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, i);
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
g_signal_emit_by_name (G_OBJECT (list_store),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -1230,7 +1184,7 @@ gtk_list_store_drag_data_received (GtkTreeDragDest *drag_dest,
G_SLIST (dest_iter.user_data)->data = copy_head;
gtk_signal_emit_by_name (GTK_OBJECT (tree_model),
g_signal_emit_by_name (G_OBJECT (tree_model),
"changed",
NULL, &dest_iter);
}
......
......@@ -37,7 +37,7 @@ typedef struct _GtkListStoreClass GtkListStoreClass;
struct _GtkListStore
{
GtkObject parent;
GObject parent;
/*< private >*/
gint stamp;
......@@ -50,7 +50,7 @@ struct _GtkListStore
struct _GtkListStoreClass
{
GtkObjectClass parent_class;
GObjectClass parent_class;
/* signals */
/* Will be moved into the GtkTreeModelIface eventually */
......
......@@ -66,22 +66,21 @@ static void
gtk_tree_model_base_init (gpointer g_class)
{
static gboolean initted = FALSE;
#if 0
if (! initted)
{
g_signal_newc ("changed",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeModelIface, changed),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
g_signal_newc ("inserted",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeModelIface, inserted),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
......@@ -90,7 +89,7 @@ gtk_tree_model_base_init (gpointer g_class)
GTK_TYPE_TREE_ITER);
g_signal_newc ("child_toggled",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeModelIface, child_toggled),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
......@@ -99,16 +98,14 @@ gtk_tree_model_base_init (gpointer g_class)
GTK_TYPE_TREE_ITER);
g_signal_newc ("deleted",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeModelIface, deleted),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
gtk_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
GTK_TYPE_TREE_PATH);
initted = TRUE;
}
#endif
}
/**
......
......@@ -28,14 +28,6 @@
#include "gtksignal.h"
#include <string.h>
enum {
CHANGED,
INSERTED,
CHILD_TOGGLED,
DELETED,
LAST_SIGNAL
};
typedef struct _SortElt SortElt;
struct _SortElt
{
......@@ -54,8 +46,6 @@ struct _SortData
GValueCompareFunc func;
};
static guint tree_model_sort_signals[LAST_SIGNAL] = { 0 };
#define get_array(e,t) ((GArray *)((e)->parent?(e)->parent->children:GTK_TREE_MODEL_SORT(t)->root))
......@@ -134,10 +124,10 @@ static gint g_value_int_compare_func (const GValue *a,
GtkType
GType
gtk_tree_model_sort_get_type (void)
{
static GtkType tree_model_sort_type = 0;
static GType tree_model_sort_type = 0;
if (!tree_model_sort_type)
{
......@@ -161,7 +151,7 @@ gtk_tree_model_sort_get_type (void)
NULL
};
tree_model_sort_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkTreeModelSort", &tree_model_sort_info, 0);
tree_model_sort_type = g_type_register_static (G_TYPE_OBJECT, "GtkTreeModelSort", &tree_model_sort_info, 0);
g_type_add_interface_static (tree_model_sort_type,
GTK_TYPE_TREE_MODEL,
&tree_model_info);
......@@ -178,42 +168,6 @@ gtk_tree_model_sort_class_init (GtkTreeModelSortClass *tree_model_sort_class)
object_class = (GObjectClass *) tree_model_sort_class;
object_class->finalize = gtk_tree_model_sort_finalize;
tree_model_sort_signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeModelSortClass, changed),
gtk_marshal_VOID__POINTER_POINTER,
GTK_TYPE_NONE, 2,
GTK_TYPE_POINTER,
GTK_TYPE_POINTER);
tree_model_sort_signals[INSERTED] =
gtk_signal_new ("inserted",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeModelSortClass, inserted),
gtk_marshal_VOID__POINTER_POINTER,
GTK_TYPE_NONE, 2,
GTK_TYPE_POINTER,
GTK_TYPE_POINTER);
tree_model_sort_signals[CHILD_TOGGLED] =
gtk_signal_new ("child_toggled",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeModelSortClass, child_toggled),
gtk_marshal_VOID__POINTER_POINTER,
GTK_TYPE_NONE, 2,
GTK_TYPE_POINTER,
GTK_TYPE_POINTER);
tree_model_sort_signals[DELETED] =
gtk_signal_new ("deleted",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeModelSortClass, deleted),
gtk_marshal_VOID__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
}
static void
......@@ -243,7 +197,7 @@ gtk_tree_model_sort_init (GtkTreeModelSort *tree_model_sort)
GtkTreeModel *
gtk_tree_model_sort_new (void)
{
return GTK_TREE_MODEL (gtk_type_new (gtk_tree_model_sort_get_type ()));
return GTK_TREE_MODEL (g_object_new (gtk_tree_model_sort_get_type (), NULL));
}
GtkTreeModel *
......@@ -281,18 +235,14 @@ gtk_tree_model_sort_set_model (GtkTreeModelSort *tree_model_sort,
if (tree_model_sort->child_model)
{
gtk_signal_disconnect_by_func (GTK_OBJECT (tree_model_sort->child_model),
gtk_tree_model_sort_changed,
tree_model_sort);
gtk_signal_disconnect_by_func (GTK_OBJECT (tree_model_sort->child_model),
gtk_tree_model_sort_inserted,
tree_model_sort);
gtk_signal_disconnect_by_func (GTK_OBJECT (tree_model_sort->child_model),
gtk_tree_model_sort_child_toggled,
tree_model_sort);
gtk_signal_disconnect_by_func (GTK_OBJECT (tree_model_sort->child_model),
gtk_tree_model_sort_deleted,
tree_model_sort);
g_signal_handler_disconnect (G_OBJECT (tree_model_sort->child_model),
tree_model_sort->changed_id);
g_signal_handler_disconnect (G_OBJECT (tree_model_sort->child_model),
tree_model_sort->inserted_id);
g_signal_handler_disconnect (G_OBJECT (tree_model_sort->child_model),
tree_model_sort->child_toggled_id);
g_signal_handler_disconnect (G_OBJECT (tree_model_sort->child_model),
tree_model_sort->deleted_id);
g_object_unref (G_OBJECT (tree_model_sort->child_model));
}
......@@ -301,19 +251,23 @@ gtk_tree_model_sort_set_model (GtkTreeModelSort *tree_model_sort,
if (child_model)
{
gtk_signal_connect (GTK_OBJECT (child_model),
tree_model_sort->changed_id =
g_signal_connect (child_model,
"changed",
gtk_tree_model_sort_changed,
tree_model_sort);
gtk_signal_connect (GTK_OBJECT (child_model),
tree_model_sort->inserted_id =
g_signal_connect (child_model,
"inserted",
gtk_tree_model_sort_inserted,
tree_model_sort);
gtk_signal_connect (GTK_OBJECT (child_model),
tree_model_sort->child_toggled_id =
g_signal_connect (child_model,
"child_toggled",
gtk_tree_model_sort_child_toggled,
tree_model_sort);
gtk_signal_connect (GTK_OBJECT (child_model),
tree_model_sort->deleted_id =
g_signal_connect (child_model,
"deleted",
gtk_tree_model_sort_deleted,
tree_model_sort);
......@@ -420,7 +374,7 @@ gtk_tree_model_sort_changed (GtkTreeModel *s_model,
(GtkTreeIter *) elt,
TRUE);
gtk_signal_emit_by_name (GTK_OBJECT (data), "changed", path, &iter);
g_signal_emit_by_name (G_OBJECT (data), "changed", path, &iter);
gtk_tree_path_free (path);
if (free_s_path)
......@@ -533,7 +487,7 @@ gtk_tree_model_sort_inserted (GtkTreeModel *s_model,
return;
gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
gtk_signal_emit_by_name (GTK_OBJECT (data), "inserted", path, &iter);
g_signal_emit_by_name (G_OBJECT (data), "inserted", path, &iter);
gtk_tree_path_free (path);
}
......@@ -566,7 +520,7 @@ gtk_tree_model_sort_child_toggled (GtkTreeModel *s_model,
if (path == NULL)
return;
gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
gtk_signal_emit_by_name (GTK_OBJECT (data),
g_signal_emit_by_name (G_OBJECT (data),
"child_toggled",
path, &iter);
gtk_tree_path_free (path);
......@@ -625,7 +579,7 @@ gtk_tree_model_sort_deleted (GtkTreeModel *s_model,
}
tree_model_sort->stamp++;
gtk_signal_emit_by_name (GTK_OBJECT (data), "deleted", path);
g_signal_emit_by_name (G_OBJECT (data), "deleted", path);
gtk_tree_path_free (path);
}
......
......@@ -40,7 +40,7 @@ typedef gint (* GValueCompareFunc) (const GValue *a,
struct _GtkTreeModelSort
{
GtkObject parent;
GObject parent;
/* < private > */
gpointer root;
......@@ -49,11 +49,16 @@ struct _GtkTreeModelSort
GtkTreeModel *child_model;
gint sort_col;
GValueCompareFunc func;
guint changed_id;
guint inserted_id;
guint child_toggled_id;
guint deleted_id;
};
struct _GtkTreeModelSortClass
{
GtkObjectClass parent_class;
GObjectClass parent_class;
/* signals */
/* Will be moved into the GtkTreeModelIface eventually */
......
......@@ -27,17 +27,6 @@
#define G_NODE(node) ((GNode *)node)
enum {
CHANGED,
INSERTED,
CHILD_TOGGLED,
DELETED,
LAST_SIGNAL
};
static guint tree_store_signals[LAST_SIGNAL] = { 0 };
static void gtk_tree_store_init (GtkTreeStore *tree_store);
static void gtk_tree_store_class_init (GtkTreeStoreClass *tree_store_class);
static void gtk_tree_store_tree_model_init (GtkTreeModelIface *iface);
......@@ -100,7 +89,7 @@ validate_tree (GtkTreeStore *tree_store)
GtkType
gtk_tree_store_get_type (void)
{
static GtkType tree_store_type = 0;
static GType tree_store_type = 0;
if (!tree_store_type)
{
......@@ -138,7 +127,7 @@ gtk_tree_store_get_type (void)
NULL
};
tree_store_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkTreeStore", &tree_store_info, 0);
tree_store_type = g_type_register_static (G_TYPE_OBJECT, "GtkTreeStore", &tree_store_info, 0);
g_type_add_interface_static (tree_store_type,
GTK_TYPE_TREE_MODEL,
......@@ -160,45 +149,10 @@ gtk_tree_store_get_type (void)
static void
gtk_tree_store_class_init (GtkTreeStoreClass *tree_store_class)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass *) tree_store_class;
tree_store_signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeStoreClass, changed),
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
tree_store_signals[INSERTED] =
gtk_signal_new ("inserted",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeStoreClass, inserted),
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
tree_store_signals[CHILD_TOGGLED] =
gtk_signal_new ("child_toggled",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeStoreClass, child_toggled),
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
tree_store_signals[DELETED] =
gtk_signal_new ("deleted",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeStoreClass, deleted),
gtk_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
GTK_TYPE_TREE_PATH);
GObjectClass *object_class;
object_class = (GObjectClass *) tree_store_class;
}
static void
......@@ -241,7 +195,7 @@ gtk_tree_store_init (GtkTreeStore *tree_store)
GtkTreeStore *
gtk_tree_store_new (void)
{
return GTK_TREE_STORE (gtk_type_new (gtk_tree_store_get_type ()));
return GTK_TREE_STORE (g_object_new (gtk_tree_store_get_type (), NULL));
}
GtkTreeStore *
......@@ -591,9 +545,9 @@ gtk_tree_store_set_cell (GtkTreeStore *tree_store,
if (column == 0)
{
_gtk_tree_data_list_value_to_node (list, value);
gtk_signal_emit_by_name (GTK_OBJECT (tree_store),
"changed",
NULL, iter);
g_signal_emit_by_name (G_OBJECT (tree_store),
"changed",
NULL, iter);
return;
}
......@@ -621,7 +575,7 @@ gtk_tree_store_set_cell (GtkTreeStore *tree_store,
column --;
}
_gtk_tree_data_list_value_to_node (list, value);
gtk_signal_emit_by_name (GTK_OBJECT (tree_store),
g_signal_emit_by_name (G_OBJECT (tree_store),
"changed",
NULL, iter);
}
......@@ -732,14 +686,14 @@ gtk_tree_store_remove (GtkTreeStore *model,
g_node_destroy (G_NODE (iter->user_data));
model->stamp++;
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"deleted",
path);
if (parent != G_NODE (model->root) && parent->children == NULL)
{
gtk_tree_path_up (path);
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"child_toggled",
path,
parent);
......@@ -769,7 +723,7 @@ gtk_tree_store_insert (GtkTreeStore *model,
g_node_insert (parent_node, position, G_NODE (iter->user_data));
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), iter);
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -814,7 +768,7 @@ gtk_tree_store_insert_before (GtkTreeStore *model,
iter->user_data = new_node;
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), iter);
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -860,7 +814,7 @@ gtk_tree_store_insert_after (GtkTreeStore *model,
iter->user_data = new_node;
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), iter);
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"inserted",
path, iter);
gtk_tree_path_free (path);
......@@ -896,7 +850,7 @@ gtk_tree_store_prepend (GtkTreeStore *model,
if (parent_node != model->root)
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), parent);
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"child_toggled",
path,
parent);
......@@ -906,7 +860,7 @@ gtk_tree_store_prepend (GtkTreeStore *model,
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), iter);
}
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"inserted",
path,
iter);
......@@ -948,7 +902,7 @@ gtk_tree_store_append (GtkTreeStore *model,
if (parent_node != model->root)
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), parent);
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),
"child_toggled",
path,
parent);
......@@ -959,7 +913,7 @@ gtk_tree_store_append (GtkTreeStore *model,
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), iter);
}
gtk_signal_emit_by_name (GTK_OBJECT (model),
g_signal_emit_by_name (G_OBJECT (model),