Re: g_param_spec_*?



On Sun, 2003-02-02 at 05:56, Ronald Bultje wrote:
> Hey all,
> 
> what's the difference between g_param_spec_boxed(),

A "boxed" type - basically a pointer with copy/free. See 
g_boxed_type_register_static. GdkRectangle, GtkSelectionData
are some of the standard GTK+ boxed types.

>  g_param_spec_param()

A parameter whose value is a paran spec. Probably not what you want.

> and g_param_spec_object()? 

A parameter whose value is a GObject derived type (like a GtkWidget,
a GdkWindow, a PangoLayout, etc.)

> In what cases should I use which of these?
> And what should I use in case of a GList*? 

For GList, you probably want g_param_spec_pointer() - GObject has
no idea of composite type - an array of GtkWidget, a list of
GdkRectangle and that would be need to be there to have a meaningful
GList type.

Remember a GList by itself has no idea what contents of the 
list. It's just a list of generic void *.

> I actually expected a
> g_param_spec_list() or so, since there is a g_param_spec_value_array(),

g_param_spec_value_array() refers to a parameter whose contents 
are a GValueArray - an array of GValue (GValue is a variant type, like a
Python pickle or CORBA::Any.) See the GValueArray API.

> though it's unclear to me whether this applies to a C-array, GArray,
> GPtrArray, GByteArray or to all of them.
> 
> There's lots of API documentation on internet, but no explanation of
> what it actually means. :-(.

Nobody will object if you submit patches :-)

Regards,
                                  Owen





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