#50206 - Some GObject methods take a gpointer

Hi Tim,

Can you explain why functions like:

gpointer  g_object_ref            (gpointer      object);
void      g_object_unref          (gpointer      object);
GClosure* g_cclosure_new_object   (GCallback     callback_func,
				   gpointer      object);
gpointer  g_value_get_object      (const GValue *value);
guint     g_signal_connect_object (gpointer      instance,
				   const gchar  *detailed_signal,
				   GCallback     c_handler,
				   gpointer      gobject,
				   gboolean      swapped,
				   gboolean      after);

Use gpointer for GObject * arguments or returns? While this saves some
typing, it seems to be against the practice we've always had in GTK+.

Also, the selection of functions where gpointer is used seems a bit
random? What's the principle for deciding where to use a gpointer?


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