1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Handle run-time type creation.
7 <!-- ##### SECTION Long_Description ##### -->
9 Gtk's type system is extensible. Because of that, types have to be
13 <!-- ##### SECTION See_Also ##### -->
18 <!-- ##### TYPEDEF GtkType ##### -->
20 @GtkType is unique integer identifying the type. The guts of the
21 information about the type is held in a private struct named
26 <!-- ##### ENUM GtkFundamentalType ##### -->
28 @GtkFundamentalType is an enumerated type which lists all the possible
29 fundamental types (e.g. char, uchar, int, long, float, etc).
49 <!-- ##### MACRO GTK_CLASS_NAME ##### -->
57 <!-- ##### MACRO GTK_CLASS_TYPE ##### -->
65 <!-- ##### MACRO GTK_TYPE_IS_OBJECT ##### -->
73 <!-- ##### MACRO GTK_TYPE_FUNDAMENTAL_LAST ##### -->
75 The highest-numbered structured or flat enumerated type value.
80 <!-- ##### MACRO GTK_TYPE_FUNDAMENTAL_MAX ##### -->
82 The highest maximum fundamental enumerated type value.
87 <!-- ##### MACRO GTK_STRUCT_OFFSET ##### -->
89 Use in place of offsetof(), which is used if it exists.
92 <!-- # Unused Parameters # -->
93 @struct: The type of the structure.
94 @field: The field within the structure.
97 <!-- ##### MACRO GTK_CHECK_CAST ##### -->
99 Cast the object in @tobj into @cast. If GTK_NO_CHECK_CASTS is
100 defined, just cast it. Otherwise, check to see if we can cast @tobj
104 <!-- # Unused Parameters # -->
105 @tobj: a pointer to a GtkObject.
106 @cast_type: a Gtk type.
110 <!-- ##### MACRO GTK_CHECK_CLASS_CAST ##### -->
112 Cast the object in @tobj into @cast. If GTK_NO_CHECK_CASTS is
113 defined, just cast it. Otherwise, check to see if we can cast @tobj
117 <!-- # Unused Parameters # -->
118 @tclass: a pointer to a GtkClassInitFunc
119 @cast_type: a Gtk type.
123 <!-- ##### MACRO GTK_CHECK_TYPE ##### -->
125 Determines whether @type_object is a type of @otype.
128 <!-- # Unused Parameters # -->
129 @type_object: A GtkTypeObject object.
133 <!-- ##### MACRO GTK_CHECK_CLASS_TYPE ##### -->
135 Determines whether @type_class is a type of @otype.
138 <!-- # Unused Parameters # -->
139 @type_class: A GtkTypeClass class.
143 <!-- ##### MACRO GTK_CHECK_GET_CLASS ##### -->
150 <!-- ##### MACRO GTK_FUNDAMENTAL_TYPE ##### -->
152 Convert a gtk type into a fundamental type
155 <!-- # Unused Parameters # -->
159 <!-- ##### MACRO GTK_SIGNAL_FUNC ##### -->
161 Just a macroized cast into a GtkSignalFunc
167 <!-- ##### TYPEDEF GtkClassInitFunc ##### -->
169 Define a function pointer.
173 <!-- ##### TYPEDEF GtkObjectInitFunc ##### -->
175 Define a function pointer.
179 <!-- ##### USER_FUNCTION GtkSignalFunc ##### -->
181 Define a function pointer.
186 <!-- ##### USER_FUNCTION GtkFunction ##### -->
188 Define a function pointer.
195 <!-- ##### USER_FUNCTION GtkDestroyNotify ##### -->
197 Define a function pointer.
203 <!-- ##### USER_FUNCTION GtkCallbackMarshal ##### -->
205 Define a function pointer.
214 <!-- ##### TYPEDEF GtkSignalMarshaller ##### -->
216 Define a function pointer.
220 <!-- ##### USER_FUNCTION GtkArgGetFunc ##### -->
222 Define a function pointer. Deprecated.
230 <!-- ##### USER_FUNCTION GtkArgSetFunc ##### -->
232 Define a function pointer. Deprecated.
240 <!-- ##### TYPEDEF GtkTypeObject ##### -->
242 A GtkTypeObject defines the minimum structure requirements
243 for type instances. Type instances returned from gtk_type_new ()
244 and initialized through a GtkObjectInitFunc need to directly inherit
245 from this structure or at least copy its fields one by one.
249 <!-- ##### STRUCT GtkArg ##### -->
251 This is a structure that we use to pass in typed values (and names).
257 <!-- ##### MACRO GTK_VALUE_CHAR ##### -->
259 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CHAR
265 <!-- ##### MACRO GTK_VALUE_UCHAR ##### -->
267 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UCHAR
273 <!-- ##### MACRO GTK_VALUE_BOOL ##### -->
275 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOOL
281 <!-- ##### MACRO GTK_VALUE_INT ##### -->
283 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_INT
289 <!-- ##### MACRO GTK_VALUE_UINT ##### -->
291 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UINT
297 <!-- ##### MACRO GTK_VALUE_LONG ##### -->
299 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_LONG
305 <!-- ##### MACRO GTK_VALUE_ULONG ##### -->
307 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ULONG
313 <!-- ##### MACRO GTK_VALUE_FLOAT ##### -->
315 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLOAT
321 <!-- ##### MACRO GTK_VALUE_DOUBLE ##### -->
323 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_DOUBLE
329 <!-- ##### MACRO GTK_VALUE_STRING ##### -->
331 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_STRING
337 <!-- ##### MACRO GTK_VALUE_ENUM ##### -->
339 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ENUM
345 <!-- ##### MACRO GTK_VALUE_FLAGS ##### -->
347 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLAGS
353 <!-- ##### MACRO GTK_VALUE_BOXED ##### -->
355 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOXED
361 <!-- ##### MACRO GTK_VALUE_POINTER ##### -->
363 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_POINTER
369 <!-- ##### MACRO GTK_VALUE_OBJECT ##### -->
371 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_OBJECT
377 <!-- ##### MACRO GTK_VALUE_SIGNAL ##### -->
379 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_SIGNAL
385 <!-- ##### MACRO GTK_RETLOC_CHAR ##### -->
387 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_CHAR
393 <!-- ##### MACRO GTK_RETLOC_UCHAR ##### -->
395 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UCHAR
401 <!-- ##### MACRO GTK_RETLOC_BOOL ##### -->
403 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOOL
409 <!-- ##### MACRO GTK_RETLOC_INT ##### -->
411 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_INT
417 <!-- ##### MACRO GTK_RETLOC_UINT ##### -->
419 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UINT
425 <!-- ##### MACRO GTK_RETLOC_LONG ##### -->
427 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_LONG
433 <!-- ##### MACRO GTK_RETLOC_ULONG ##### -->
435 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ULONG
441 <!-- ##### MACRO GTK_RETLOC_FLOAT ##### -->
443 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLOAT
449 <!-- ##### MACRO GTK_RETLOC_DOUBLE ##### -->
451 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_DOUBLE
457 <!-- ##### MACRO GTK_RETLOC_STRING ##### -->
459 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_STRING
465 <!-- ##### MACRO GTK_RETLOC_ENUM ##### -->
467 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ENUM
473 <!-- ##### MACRO GTK_RETLOC_FLAGS ##### -->
475 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLAGS
481 <!-- ##### MACRO GTK_RETLOC_BOXED ##### -->
483 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOXED
489 <!-- ##### MACRO GTK_RETLOC_POINTER ##### -->
491 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_POINTER
497 <!-- ##### MACRO GTK_RETLOC_OBJECT ##### -->
499 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_OBJECT
505 <!-- ##### STRUCT GtkTypeInfo ##### -->
507 Holds information about the type. @gtk_type_name returns the name.
508 @object_size is somehow set to the number of bytes that an instance of
509 the object will occupy. @class_init_func holds the type's
510 initialization function. @object_init_func holds the initialization
511 function for an instance of the object. @reserved_1 is used for
512 GtkEnumValue to hold the enumerated values.
522 @base_class_init_func:
524 <!-- ##### TYPEDEF GtkTypeClass ##### -->
526 The base structure for a Gtk Type. Every type inherits this as a base structure.
530 <!-- ##### TYPEDEF GtkEnumValue ##### -->
532 A structure which contains a single enum value, and its name, and it's
537 <!-- ##### TYPEDEF GtkFlagValue ##### -->
543 <!-- ##### FUNCTION gtk_type_init ##### -->
545 Initialize the data structures associated with gtk types.
551 <!-- ##### FUNCTION gtk_type_unique ##### -->
553 Create a new, unique type.
556 @parent_type: if zero, a fundamental type is created.
558 @Returns: the new GtkType.
559 <!-- # Unused Parameters # -->
560 @type_info: must not be null, and @type_info->type_name must also not be null.
563 <!-- ##### MACRO gtk_type_name ##### -->
567 @Returns: a pointer to the name of a type, or NULL if it has none.
568 <!-- # Unused Parameters # -->
572 <!-- ##### MACRO gtk_type_from_name ##### -->
574 Get the internal representation of a type given its name.
578 <!-- # Unused Parameters # -->
579 @name: the name of a gtk type
582 <!-- ##### MACRO gtk_type_parent ##### -->
587 @Returns: the GtkType of the parent
588 <!-- # Unused Parameters # -->
592 <!-- ##### FUNCTION gtk_type_class ##### -->
594 Return a gpointer pointing to the class of @type or NULL if there was
595 any trouble identifying @type. Initialize the class if necessary.
599 @Returns: gpointer to the klass.
602 <!-- ##### FUNCTION gtk_type_new ##### -->
604 Create a new object of a given type, and return a gpointer to it.
605 Returns NULL if you give it an invalid type. It allocates the object
606 out of the type's memory chunk if there is a memory chunk. The object
607 has all the proper initializers called.
611 @Returns: gpointer to a GtkTypeObject
614 <!-- ##### MACRO gtk_type_is_a ##### -->
616 Look in the type hierarchy to see if @type has @is_a_type among its
617 ancestors. Do so with a simple lookup, not a loop.
621 <!-- # Unused Parameters # -->
626 <!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
628 If @enum_type has values, then return a pointer to all of them.
632 @Returns: GtkEnumValue*
635 <!-- ##### FUNCTION gtk_type_flags_get_values ##### -->
637 If @flags_type has values, then return a pointer to all of them.
641 @Returns: GtkFlagValue*
644 <!-- ##### FUNCTION gtk_type_enum_find_value ##### -->
646 Return a pointer to one of @enum_type's GtkEnumValues's whose name (or nickname) matches @value_name.
651 @Returns: GtkEnumValue*
654 <!-- ##### FUNCTION gtk_type_flags_find_value ##### -->
656 Return a pointer to one of @flag_type's GtkFlagValue's whose name (or nickname) matches @value_name.
661 @Returns: GtkFlagValue*
662 <!-- # Unused Parameters # -->