Re: [gnome-db] libgda: using g_param_spec_object() instead of g_param_spec_pointer()



On Fri, 2006-12-22 at 15:55 +0100, Vivien Malerba wrote:
> > We'll need to do the same thing for libgnomedb, I think.
> >
> 
> That'd be good! 

You should probably review the attached patch.

It doesn't fix everything. There are 2 TODOs from me in the patch, and
it's worth grepping (or regexxer-ing) for _POINTER yourself.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
? compile
? libgnomedb-3.0.pc
? libgnomedb_signal_param_types.patch
? temp.patch
? data/16x16/Makefile
? data/16x16/Makefile.in
? data/22x22/Makefile
? data/22x22/Makefile.in
? examples/Makefile
? examples/Makefile.in
? examples/SampleApp/Makefile.in
? examples/SampleApp/aclocal.m4
? examples/SampleApp/autom4te.cache
? examples/SampleApp/configure
? examples/SampleApp/mkinstalldirs
? examples/SampleApp/src/Makefile.in
? extra/Makefile
? extra/Makefile.in
? extra/gnome-db-browser
? extra/demos/Makefile
? extra/demos/Makefile.in
? extra/demos/demos.h
? extra/demos/geninclude.pl
? extra/demos/gnome-db-demo
? glade3/Makefile
? glade3/Makefile.in
? gnomedb-sharp/gnomedb-sharp-3.0.pc
? libgnomedb/marshal.c
? libgnomedb/marshal.h
? libgnomedb/data-entries/Makefile
? libgnomedb/data-entries/Makefile.in
? libgnomedb/data-entries/plugins/Makefile
? libgnomedb/data-entries/plugins/Makefile.in
? libgnomedb/data-entries/plugins/gnome-db-entry-filesel-spec.xml
? libgnomedb/data-entries/plugins/gnome-db-entry-pict-spec.xml
? libgnomedb/data-entries/plugins/gnome-db-entry-pict-spec_string.xml
? libgnomedb/graph/Makefile
? libgnomedb/graph/Makefile.in
? po/stamp-it
? testing/test-dyn-widgets
? testing/test-handlers
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgnomedb/ChangeLog,v
retrieving revision 1.465
diff -u -p -r1.465 ChangeLog
--- ChangeLog	22 Dec 2006 16:06:48 -0000	1.465
+++ ChangeLog	27 Dec 2006 16:11:42 -0000
@@ -1,3 +1,28 @@
+2006-12-27  Murray Cumming  <murrayc murrayc com>
+
+	* extra/demos/main.c: (create_tree):
+	* libgnomedb/data-entries/gnome-db-data-cell-renderer-boolean.c:
+	(gnome_db_data_cell_renderer_boolean_class_init):
+	* libgnomedb/data-entries/gnome-db-data-cell-renderer-combo.c:
+	(gnome_db_data_cell_renderer_combo_class_init):
+	* libgnomedb/data-entries/gnome-db-data-cell-renderer-textual.c:
+	(gnome_db_data_cell_renderer_textual_class_init):
+	* libgnomedb/data-entries/gnome-db-entry-wrapper.c:
+	(gnome_db_entry_wrapper_get_handler):
+	* libgnomedb/data-entries/plugins/gnome-db-data-cell-renderer-pict.
+	c: (gnome_db_data_cell_renderer_pict_class_init):
+	* libgnomedb/gnome-db-data-store.c: (data_store_get_column_type),
+	(data_store_get_value):
+	* libgnomedb/gnome-db-data-widget.c:
+	(gnome_db_data_widget_iface_init):
+	* libgnomedb/gnome-db-raw-grid.c: (gnome_db_raw_grid_class_init):
+	* libgnomedb/gnome-db-selector.c: (gnome_db_selector_initialize):
+	* libgnomedb/graph/gnome-db-canvas-item.c:
+	(gnome_db_canvas_item_class_init):
+	* libgnomedb/graph/gnome-db-canvas.c: (gnome_db_canvas_class_init):
+	* libgnomedb/marshal.list: Reduce use of POINTER as a type for 
+	signal parameters, using a specific type instead.
+
 2006-12-22  Vivien Malerba <malerba gnome-db org>
 
 	Released 2.99.2 (AKA 3.0 Beta4).
Index: extra/demos/main.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/extra/demos/main.c,v
retrieving revision 1.3
diff -u -p -r1.3 main.c
--- extra/demos/main.c	26 Oct 2006 13:34:31 -0000	1.3
+++ extra/demos/main.c	27 Dec 2006 16:11:42 -0000
@@ -664,7 +664,7 @@ create_tree (void)
 
 	Demo *d = gnomedb_demos;
 
-	model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_INT);
+	model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER /* func */, PANGO_TYPE_STYLE);
 	tree_view = gtk_tree_view_new ();
 	gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
Index: libgnomedb/gnome-db-data-store.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-data-store.c,v
retrieving revision 1.6
diff -u -p -r1.6 gnome-db-data-store.c
--- libgnomedb/gnome-db-data-store.c	14 Jul 2006 13:46:17 -0000	1.6
+++ libgnomedb/gnome-db-data-store.c	27 Dec 2006 16:11:42 -0000
@@ -586,7 +586,7 @@ data_store_get_column_type (GtkTreeModel
 			retval = G_TYPE_INT;
 			break;
 		case DATA_STORE_COL_MODEL_POINTER:
-			retval = G_TYPE_POINTER;
+			retval = GDA_TYPE_DATA_MODEL;
 			break;
 		case DATA_STORE_COL_MODIFIED:
 		case DATA_STORE_COL_TO_DELETE:
@@ -600,7 +600,7 @@ data_store_get_column_type (GtkTreeModel
 		prox_nb_cols = gda_data_proxy_get_proxied_model_n_cols (store->priv->proxy);
 		if ((index < prox_nb_cols) ||
 		    ((index >= 2 * prox_nb_cols) && (index < 3 * prox_nb_cols)))
-			retval = G_TYPE_POINTER;
+			retval = GDA_TYPE_DATA_MODEL;
 		else
 			if (index < 2 * prox_nb_cols)
 				retval = G_TYPE_UINT;
@@ -715,7 +715,7 @@ data_store_get_value (GtkTreeModel *tree
 		
 		rettype = data_store_get_column_type (tree_model, column);
 		
-		if (rettype == G_TYPE_POINTER)
+		if (rettype == GDA_TYPE_DATA_MODEL)
 			g_value_set_pointer (value, (gpointer) tmp);
 		else {
 			if (tmp)
Index: libgnomedb/gnome-db-data-widget.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-data-widget.c,v
retrieving revision 1.10
diff -u -p -r1.10 gnome-db-data-widget.c
--- libgnomedb/gnome-db-data-widget.c	22 Dec 2006 14:41:53 -0000	1.10
+++ libgnomedb/gnome-db-data-widget.c	27 Dec 2006 16:11:42 -0000
@@ -71,8 +71,8 @@ gnome_db_data_widget_iface_init (gpointe
                                       G_SIGNAL_RUN_FIRST,
                                       G_STRUCT_OFFSET (GnomeDbDataWidgetIface, proxy_changed),
                                       NULL, NULL,
-                                      g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE,
-                                      1, G_TYPE_POINTER);
+                                      g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE,
+                                      1, GDA_TYPE_DATA_PROXY);
 
 		initialized = TRUE;
 	}
Index: libgnomedb/gnome-db-raw-grid.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-raw-grid.c,v
retrieving revision 1.23
diff -u -p -r1.23 gnome-db-raw-grid.c
--- libgnomedb/gnome-db-raw-grid.c	22 Dec 2006 14:41:53 -0000	1.23
+++ libgnomedb/gnome-db-raw-grid.c	27 Dec 2006 16:11:43 -0000
@@ -234,8 +234,8 @@ gnome_db_raw_grid_class_init (GnomeDbRaw
                               G_SIGNAL_RUN_FIRST,
                               G_STRUCT_OFFSET (GnomeDbRawGridClass, populate_popup),
                               NULL, NULL,
-                              marshal_VOID__POINTER, G_TYPE_NONE,
-                              1, G_TYPE_POINTER);
+                              marshal_VOID__OBJECT, G_TYPE_NONE,
+                              1, GTK_TYPE_MENU);
 
 	object_class->dispose = gnome_db_raw_grid_dispose;
 
Index: libgnomedb/gnome-db-selector.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-selector.c,v
retrieving revision 1.11
diff -u -p -r1.11 gnome-db-selector.c
--- libgnomedb/gnome-db-selector.c	9 Dec 2006 14:53:47 -0000	1.11
+++ libgnomedb/gnome-db-selector.c	27 Dec 2006 16:11:43 -0000
@@ -353,6 +353,7 @@ gnome_db_selector_initialize (GnomeDbSel
 		}
 		
 		/* model creation */
+                /* TODO: What exactly is this selection "Object" actually? murrayc */
 		model = GTK_TREE_MODEL (gtk_tree_store_new (NUM_COLUMNS, 
 							    G_TYPE_STRING,    /* NAME_COLUMN */
 							    G_TYPE_STRING,    /* OWNER_COLUMN */
@@ -368,7 +369,7 @@ gnome_db_selector_initialize (GnomeDbSel
 							    G_TYPE_POINTER,   /* OBJ_COLUMN */
 							    GDK_TYPE_PIXBUF,  /* PIXBUF_COLUMN */
 							    G_TYPE_INT,       /* CONTENTS_COLUMN */
-							    G_TYPE_POINTER,   /* SUB_MODULE_COLUMN */
+							    G_TYPE_POINTER,   /* SUB_MODULE_COLUMN */ /* TODO: What is this? Is it at least a G_TYPE_OBJECT? murrayc */
 							    G_TYPE_BOOLEAN,   /* ERROR_COLUMN */
 							    G_TYPE_STRING));  /* BG_COLOR_COLUMN */
 		mgsel->priv->model = model;
Index: libgnomedb/marshal.list
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/marshal.list,v
retrieving revision 1.4
diff -u -p -r1.4 marshal.list
--- libgnomedb/marshal.list	19 Nov 2006 21:44:30 -0000	1.4
+++ libgnomedb/marshal.list	27 Dec 2006 16:11:43 -0000
@@ -24,16 +24,14 @@
 
 VOID:VOID
 VOID:VOID,VOID
-VOID:POINTER
-VOID:POINTER,POINTER
-VOID:POINTER,UINT,UINT
+VOID:OBJECT,OBJECT
 VOID:BOOLEAN
 VOID:ULONG
 VOID:OBJECT
 VOID:OBJECT,BOOL
 VOID:INT
 VOID:STRING,STRING
-VOID:STRING,POINTER
+VOID:STRING,BOXED
 VOID:STRING,POINTER,POINTER
 VOID:STRING,UINT
 VOID:STRING
Index: libgnomedb/data-entries/gnome-db-data-cell-renderer-boolean.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/data-entries/gnome-db-data-cell-renderer-boolean.c,v
retrieving revision 1.4
diff -u -p -r1.4 gnome-db-data-cell-renderer-boolean.c
--- libgnomedb/data-entries/gnome-db-data-cell-renderer-boolean.c	3 Sep 2006 14:08:20 -0000	1.4
+++ libgnomedb/data-entries/gnome-db-data-cell-renderer-boolean.c	27 Dec 2006 16:11:43 -0000
@@ -170,10 +170,10 @@ gnome_db_data_cell_renderer_boolean_clas
 			      G_SIGNAL_RUN_LAST,
 			      G_STRUCT_OFFSET (GnomeDbDataCellRendererBooleanClass, changed),
 			      NULL, NULL,
-			      marshal_VOID__STRING_POINTER,
+			      marshal_VOID__STRING_BOXED,
 			      G_TYPE_NONE, 2,
 			      G_TYPE_STRING,
-			      G_TYPE_POINTER);
+			      G_TYPE_VALUE);
 }
 
 static void
Index: libgnomedb/data-entries/gnome-db-data-cell-renderer-combo.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/data-entries/gnome-db-data-cell-renderer-combo.c,v
retrieving revision 1.3
diff -u -p -r1.3 gnome-db-data-cell-renderer-combo.c
--- libgnomedb/data-entries/gnome-db-data-cell-renderer-combo.c	8 May 2006 12:39:08 -0000	1.3
+++ libgnomedb/data-entries/gnome-db-data-cell-renderer-combo.c	27 Dec 2006 16:11:43 -0000
@@ -187,7 +187,7 @@ gnome_db_data_cell_renderer_combo_class_
 			      G_TYPE_NONE, 3,
 			      G_TYPE_STRING,
 			      G_TYPE_POINTER,
-			      G_TYPE_POINTER);
+			      G_TYPE_POINTER); /* TODO: Use a more specific type? */
 
 }
 
Index: libgnomedb/data-entries/gnome-db-data-cell-renderer-textual.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/data-entries/gnome-db-data-cell-renderer-textual.c,v
retrieving revision 1.8
diff -u -p -r1.8 gnome-db-data-cell-renderer-textual.c
--- libgnomedb/data-entries/gnome-db-data-cell-renderer-textual.c	22 Dec 2006 14:41:53 -0000	1.8
+++ libgnomedb/data-entries/gnome-db-data-cell-renderer-textual.c	27 Dec 2006 16:11:44 -0000
@@ -185,10 +185,10 @@ gnome_db_data_cell_renderer_textual_clas
 			      G_SIGNAL_RUN_LAST,
 			      G_STRUCT_OFFSET (GnomeDbDataCellRendererTextualClass, changed),
 			      NULL, NULL,
-			      marshal_VOID__STRING_POINTER,
+			      marshal_VOID__STRING_BOXED,
 			      G_TYPE_NONE, 2,
 			      G_TYPE_STRING,
-			      G_TYPE_POINTER);
+			      G_TYPE_VALUE);
 
 }
 
Index: libgnomedb/data-entries/gnome-db-entry-wrapper.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/data-entries/gnome-db-entry-wrapper.c,v
retrieving revision 1.9
diff -u -p -r1.9 gnome-db-entry-wrapper.c
--- libgnomedb/data-entries/gnome-db-entry-wrapper.c	22 Dec 2006 14:41:53 -0000	1.9
+++ libgnomedb/data-entries/gnome-db-entry-wrapper.c	27 Dec 2006 16:11:44 -0000
@@ -817,9 +817,9 @@ gnome_db_entry_wrapper_get_handler (Gnom
 	g_return_val_if_fail (GNOME_DB_IS_ENTRY_WRAPPER (iface), NULL);
 	g_return_val_if_fail (GNOME_DB_ENTRY_WRAPPER (iface)->priv, NULL);
 
-	g_value_init (&val, G_TYPE_POINTER);
+	g_value_init (&val, GDA_TYPE_DATA_HANDLER);
 	g_object_get_property (G_OBJECT (iface), "handler", &val);
-	dh = g_value_get_pointer (&val);
+	dh = g_value_get_object (&val);
 	g_value_unset (&val);
 
 	return dh;
Index: libgnomedb/data-entries/plugins/gnome-db-data-cell-renderer-pict.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/data-entries/plugins/gnome-db-data-cell-renderer-pict.c,v
retrieving revision 1.2
diff -u -p -r1.2 gnome-db-data-cell-renderer-pict.c
--- libgnomedb/data-entries/plugins/gnome-db-data-cell-renderer-pict.c	20 Dec 2006 20:37:10 -0000	1.2
+++ libgnomedb/data-entries/plugins/gnome-db-data-cell-renderer-pict.c	27 Dec 2006 16:11:44 -0000
@@ -207,10 +207,10 @@ gnome_db_data_cell_renderer_pict_class_i
 						     G_SIGNAL_RUN_LAST,
 						     G_STRUCT_OFFSET (GnomeDbDataCellRendererPictClass, changed),
 						     NULL, NULL,
-						     marshal_VOID__STRING_POINTER,
+						     marshal_VOID__STRING_BOXED,
 						     G_TYPE_NONE, 2,
 						     G_TYPE_STRING,
-						     G_TYPE_POINTER);
+						     G_TYPE_VALUE);
 }
 
 static void
Index: libgnomedb/graph/gnome-db-canvas-item.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/graph/gnome-db-canvas-item.c,v
retrieving revision 1.6
diff -u -p -r1.6 gnome-db-canvas-item.c
--- libgnomedb/graph/gnome-db-canvas-item.c	19 Nov 2006 21:44:31 -0000	1.6
+++ libgnomedb/graph/gnome-db-canvas-item.c	27 Dec 2006 16:11:44 -0000
@@ -136,8 +136,8 @@ gnome_db_canvas_item_class_init (GnomeDb
 			      G_SIGNAL_RUN_FIRST,
 			      G_STRUCT_OFFSET (GnomeDbCanvasItemClass, drag_action),
 			      NULL, NULL,
-			      marshal_VOID__POINTER_POINTER,
-			      G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
+			      marshal_VOID__OBJECT_OBJECT,
+			      G_TYPE_NONE, 2, GNOME_DB_TYPE_CANVAS_ITEM, GNOME_DB_TYPE_CANVAS_ITEM);
 
 	class->moved = NULL;
 	class->moving = NULL;
Index: libgnomedb/graph/gnome-db-canvas.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/graph/gnome-db-canvas.c,v
retrieving revision 1.5
diff -u -p -r1.5 gnome-db-canvas.c
--- libgnomedb/graph/gnome-db-canvas.c	19 Nov 2006 21:44:32 -0000	1.5
+++ libgnomedb/graph/gnome-db-canvas.c	27 Dec 2006 16:11:44 -0000
@@ -105,8 +105,8 @@ gnome_db_canvas_class_init (GnomeDbCanva
 			      G_SIGNAL_RUN_FIRST,
 			      G_STRUCT_OFFSET (GnomeDbCanvasClass, drag_action),
 			      NULL, NULL,
-			      marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
-			      G_TYPE_POINTER, G_TYPE_POINTER);
+			      marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2,
+			      GNOME_DB_TYPE_CANVAS_ITEM, GNOME_DB_TYPE_CANVAS_ITEM);
 
 	class->drag_action = NULL;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]