After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 158818 - glib has no G_TYPE_SHORT
glib has no G_TYPE_SHORT
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: gobject
2.5.x
Other Linux
: Normal enhancement
: ---
Assigned To: Tim Janik
gtkdev
Depends on:
Blocks: 118922
 
 
Reported: 2004-11-20 13:46 UTC by Murray Cumming
Modified: 2011-02-18 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2004-11-20 13:46:08 UTC
It would be nice if gobject had G_TYPE_SHORT and G_TYPE_USHORT as well as the
existing basic types, such as G_TYPE_INT, with appropriate transformation functions.

In gtkmm, developers never need to use these G_TYPE_* identifiers, because gtkmm
uses them internally if the developer uses a native C/C++ short type with a
GValue. So, they don't see what basic types are really supported by default. So
when they use a short for a GtkTreeModelColumn with a GtkCellRendererText, they
get a confusing "unable to set property" warning, because no transformation
exists for our on-the-fly GType.

I think that we could register a new transformation in gtkmm, but it would be
simpler to just add it to C.
Comment 1 Tim Janik 2006-04-18 09:09:03 UTC
the list of types in gtype.h is meant to be resonably short. for most (property) uses, "short" types can be handled as TYPE_INT with param specs ranges like -32768..+32767 or 0..65535. so there's no apparent need to add more fundamentals to libgobject for shorts.
Comment 2 Daniel Espinosa 2006-05-18 21:00:08 UTC
Ok not add fundamentals types, but what about to set/get short values in a GValue, unless you need to derive a GType for shots using the fundamental type G_TYPE_INT, and have any way to convert to a gshort. Please, take in a count, that using generic store like GValue, needs allow the developer to know the current value stored in the GValue and have a transformation function to/from INT or STRING in order to create a generic code to handle values (for example, transform to/from a STRING a list of GValues, to store them in a GtkTreeStore or so).
Comment 3 Murray Cumming 2006-05-18 22:46:18 UTC
Note that Daniel is using GValue in the libgda API for database values, so he really does need to preserve the extra types, without morphing everything into a few basic types.
Comment 4 Matthias Clasen 2006-05-19 15:00:37 UTC
he can easily create his own short type if he needs one...