GObject is an object system based on GType type system. Types in it are identified by an integer value of type GType
. In cl-gtk2-gobject
, types are identified by GType designators. GType designator is an integer (equal to corresponding GType identifier) or a string (equal to the name of corresponding type). The important difference between GType and GType designator is that GType values may change between program runs (all GTypes except fundamental GTypes will change values), but string GType designators do not change (because names of types do not change). As such, if ever GType must be saved in a code, string GType designator should be preferred.
An example of GType designator is a string "GObject"
and the numeric value 80 that corresponds to it.
Some of the types are fundamental and have constant integer values. They are identified by constants (strings in parentheses are corresponding type names):
+g-type-invalid+
. An invalid GType used as error return value in some functions which return a GType.
+g-type-void+
("void"). A fundamental type which is used as a replacement for the C void
return type.
+g-type-interface+
("GInterface"). The fundamental type from which all interfaces are derived.
+g-type-char+
("gchar"). The fundamental type corresponding to gchar. The type designated by +g-type-char+
is unconditionally an 8-bit signed integer. This may or may not be the same type a the C type gchar
.
+g-type-uchar+
("guchar"). The fundamental type corresponding to guchar
.
+g-type-boolean+
("gboolean"). The fundamental type corresponding to gboolean
.
+g-type-int+
("gint"). The fundamental type corresponding to gint
.
+g-type-uint+
("guint"). The fundamental type corresponding to guint
.
+g-type-long+
("glong"). The fundamental type corresponding to glong
.
+g-type-ulong+
("gulong"). The fundamental type corresponding to gulong
.
+g-type-int64+
("gint64"). The fundamental type corresponding to gint64
.
+g-type-uint64+
("guint64"). The fundamental type corresponding to guint64
.
+g-type-enum+
("GEnum"). The fundamental type from which all enumeration types are derived.
+g-type-flags+
("GFlags"). The fundamental type from which all flags types are derived.
+g-type-float+
("gfloat"). The fundamental type corresponding to gfloat
.
+g-type-double+
("gdouble"). The fundamental type corresponding to gdouble
.
+g-type-string+
("gchararray"). The fundamental type corresponding to null-terminated C strings.
+g-type-pointer+
("gpointer"). The fundamental type corresponding to gpointer
.
+g-type-boxed+
("GBoxed"). The fundamental type from which all boxed types are derived. Values of this type correspond to by-value structures.
+g-type-param+
("GParam"). The fundamental type from which all GParamSpec types are derived. Values of this type correspond to instances of structure g-class-property-definition
.
+g-type-object+
("GObject"). The fundamental type for GObject.
Functions g-type-string and g-type-numeric return the numeric and string representations of GType designators (given any of them). Functions g-type= and g-type/= check types for equality.
Invalid type (the GType that does not exist) is identified as a 0 or NIL
.
(g-type-numeric "GObject") => 80 (g-type-numeric 80) => 80 (g-type-string "GObject") => "GObject" (g-type-string 80) => "GObject" (g-type-numeric "GtkWidget") => 6905648 ;;Will be different on each run