Could you add the posibility to derive from a fundamental GType



Could you  add a function to derive a GType from all fundamental
types; like you do in GBoxed Type.

This is becouse in my work in the Gda/Gnome-Db project I worked in
made GdaValue as a GValue (typedef GValue GdaValue) and for some types
like: a shortint (one byte long) I use G_TYPE_CHAR, becouse don't
exist a G_TYPE_SHORT or similar to disting beatween a gchar and a
gshort.

In the code most of the GdaType had a GType contrapart, but in some
cases, like above, it does'n exist and the I'll need to use a custom
type G_VALUE_TYPE_* to know if I'm working in a simple char or a short
int.

May is not necesary to have a G_TYPE_SHORT, becouse it is simply a
G_TYPE_CHAR as a size, but the type of information stored is diferent,
then exist, in my opinion, two ways:

- Create a G_TYPE_SHORT, and the corresponding g_value_set/get functions.

or 

- Create a function to derive from a G_TYPE_CHAR, and use the g_value_set_char.

Of course, this is'n the unique type needed, the if you consider this
could be in the future version of GLib, please contact me.
-- 
Trabajar, la mejor arma para tu superación
_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers



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