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 designator structures. GType designator is a structure identifying a particular GType; it contains its name and integer value.
GType designators are singleton structures meaning that for every GType, there may be only one GType designator structure for it; this means that two GType designators are equal (with respect to the COMMON-LISP:EQ
function) if and only if their corresponding GTypes are the same.
GType designators remain the same (with respect to the COMMON-LISP:EQ
function) even after dumping and restarting Lisp memory image.
GType designators are obtained with gtype function, and corresponding numeric and string values are accessed via gtype-id and gtype-name functions (you must not access gtype
structure directly). If an attempt is made to obtain an invalid GType, then a warning is signalled but GType designator is still returned (which may become valid at some later time due to e.g. library being initialized).
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.
(gtype "GObject") => #S(GTYPE :NAME "GObject" :%ID 80) (gtype-id (gtype "GObject")) => 80 (gtype-name (gtype "GObject")) => "GObject" (gtype "GtkWidget") => #S(GTYPE :NAME "GtkWidget" :%ID 6963568)