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. <type>char</type>, <type>uchar</type>, <type>int</type>,
30 <type>long</type>, <type>float</type>, etc).
50 <!-- ##### MACRO GTK_CLASS_NAME ##### -->
52 Returns the type name of @class.
55 @class: a #GtkTypeClass.
58 <!-- ##### MACRO GTK_CLASS_TYPE ##### -->
60 Returns the type of @class.
63 @class: a #GtkTypeClass.
66 <!-- ##### MACRO GTK_TYPE_IS_OBJECT ##### -->
68 Returns %TRUE if @type is a %GTK_TYPE_OBJECT.
74 <!-- ##### MACRO GTK_TYPE_FUNDAMENTAL_LAST ##### -->
76 The highest-numbered structured or flat enumerated type value.
81 <!-- ##### MACRO GTK_TYPE_FUNDAMENTAL_MAX ##### -->
83 The maximum fundamental enumerated type value.
88 <!-- ##### MACRO GTK_STRUCT_OFFSET ##### -->
90 Use in place of <function>offsetof()</function>, which is used if it exists.
93 <!-- # Unused Parameters # -->
94 @struct: The type of the structure.
95 @field: The field within the structure.
98 <!-- ##### MACRO GTK_CHECK_CAST ##### -->
100 Casts the object in @tobj into @cast. If GTK_NO_CHECK_CASTS is
101 defined, just cast it. Otherwise, check to see if we can cast @tobj
105 <!-- # Unused Parameters # -->
106 @tobj: a pointer to a GtkObject.
107 @cast_type: a Gtk type.
111 <!-- ##### MACRO GTK_CHECK_CLASS_CAST ##### -->
113 Casts the object in @tobj into @cast. If GTK_NO_CHECK_CASTS is
114 defined, just cast it. Otherwise, check to see if we can cast @tobj
118 <!-- # Unused Parameters # -->
119 @tclass: a pointer to a GtkClassInitFunc
120 @cast_type: a Gtk type.
124 <!-- ##### MACRO GTK_CHECK_TYPE ##### -->
126 Determines whether @type_object is a type of @otype.
129 <!-- # Unused Parameters # -->
130 @type_object: A GtkTypeObject object.
134 <!-- ##### MACRO GTK_CHECK_CLASS_TYPE ##### -->
136 Determines whether @type_class is a type of @otype.
139 <!-- # Unused Parameters # -->
140 @type_class: A GtkTypeClass class.
144 <!-- ##### MACRO GTK_CHECK_GET_CLASS ##### -->
151 <!-- ##### MACRO GTK_FUNDAMENTAL_TYPE ##### -->
153 Converts a Gtk type into a fundamental type.
156 <!-- # Unused Parameters # -->
160 <!-- ##### MACRO GTK_SIGNAL_FUNC ##### -->
162 Just a macroized cast into a #GtkSignalFunc.
168 <!-- ##### TYPEDEF GtkClassInitFunc ##### -->
170 Defines a function pointer.
174 <!-- ##### TYPEDEF GtkObjectInitFunc ##### -->
176 Defines a function pointer.
180 <!-- ##### USER_FUNCTION GtkSignalFunc ##### -->
182 Defines a function pointer.
187 <!-- ##### USER_FUNCTION GtkFunction ##### -->
189 Defines a function pointer.
196 <!-- ##### USER_FUNCTION GtkDestroyNotify ##### -->
198 Defines a function pointer.
204 <!-- ##### USER_FUNCTION GtkCallbackMarshal ##### -->
206 Defines a function pointer.
215 <!-- ##### TYPEDEF GtkSignalMarshaller ##### -->
217 Defines a function pointer.
221 <!-- ##### TYPEDEF GtkTypeObject ##### -->
223 A #GtkTypeObject defines the minimum structure requirements
224 for type instances. Type instances returned from gtk_type_new ()
225 and initialized through a #GtkObjectInitFunc need to directly inherit
226 from this structure or at least copy its fields one by one.
230 <!-- ##### STRUCT GtkArg ##### -->
232 This is a structure that we use to pass in typed values (and names).
238 <!-- ##### MACRO GTK_VALUE_CHAR ##### -->
240 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_CHAR.
246 <!-- ##### MACRO GTK_VALUE_UCHAR ##### -->
248 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_UCHAR.
254 <!-- ##### MACRO GTK_VALUE_BOOL ##### -->
256 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_BOOL.
262 <!-- ##### MACRO GTK_VALUE_INT ##### -->
264 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_INT.
270 <!-- ##### MACRO GTK_VALUE_UINT ##### -->
272 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_UINT.
278 <!-- ##### MACRO GTK_VALUE_LONG ##### -->
280 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_LONG.
286 <!-- ##### MACRO GTK_VALUE_ULONG ##### -->
288 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_ULONG.
294 <!-- ##### MACRO GTK_VALUE_FLOAT ##### -->
296 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_FLOAT.
302 <!-- ##### MACRO GTK_VALUE_DOUBLE ##### -->
304 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_DOUBLE.
310 <!-- ##### MACRO GTK_VALUE_STRING ##### -->
312 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_STRING.
318 <!-- ##### MACRO GTK_VALUE_ENUM ##### -->
320 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_ENUM.
326 <!-- ##### MACRO GTK_VALUE_FLAGS ##### -->
328 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_FLAGS.
334 <!-- ##### MACRO GTK_VALUE_BOXED ##### -->
336 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_BOXED.
342 <!-- ##### MACRO GTK_VALUE_POINTER ##### -->
344 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_POINTER.
350 <!-- ##### MACRO GTK_VALUE_OBJECT ##### -->
352 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_OBJECT.
358 <!-- ##### MACRO GTK_VALUE_SIGNAL ##### -->
360 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_SIGNAL.
366 <!-- ##### MACRO GTK_RETLOC_CHAR ##### -->
368 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_CHAR.
374 <!-- ##### MACRO GTK_RETLOC_UCHAR ##### -->
376 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_UCHAR.
382 <!-- ##### MACRO GTK_RETLOC_BOOL ##### -->
384 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_BOOL.
390 <!-- ##### MACRO GTK_RETLOC_INT ##### -->
392 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_INT.
398 <!-- ##### MACRO GTK_RETLOC_UINT ##### -->
400 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_UINT.
406 <!-- ##### MACRO GTK_RETLOC_LONG ##### -->
408 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_LONG.
414 <!-- ##### MACRO GTK_RETLOC_ULONG ##### -->
416 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_ULONG.
422 <!-- ##### MACRO GTK_RETLOC_FLOAT ##### -->
424 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_FLOAT.
430 <!-- ##### MACRO GTK_RETLOC_DOUBLE ##### -->
432 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_DOUBLE.
438 <!-- ##### MACRO GTK_RETLOC_STRING ##### -->
440 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_STRING.
446 <!-- ##### MACRO GTK_RETLOC_ENUM ##### -->
448 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_ENUM.
454 <!-- ##### MACRO GTK_RETLOC_FLAGS ##### -->
456 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_FLAGS.
462 <!-- ##### MACRO GTK_RETLOC_BOXED ##### -->
464 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_BOXED.
470 <!-- ##### MACRO GTK_RETLOC_POINTER ##### -->
472 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_POINTER.
478 <!-- ##### MACRO GTK_RETLOC_OBJECT ##### -->
480 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_OBJECT.
486 <!-- ##### STRUCT GtkTypeInfo ##### -->
488 Holds information about the type. gtk_type_name() returns the name.
489 @object_size is somehow set to the number of bytes that an instance of
490 the object will occupy. @class_init_func holds the type's
491 initialization function. @object_init_func holds the initialization
492 function for an instance of the object. @reserved_1 is used for
493 #GtkEnumValue to hold the enumerated values.
503 @base_class_init_func:
505 <!-- ##### TYPEDEF GtkTypeClass ##### -->
507 The base structure for a Gtk type. Every type inherits this as a base structure.
511 <!-- ##### TYPEDEF GtkEnumValue ##### -->
513 A structure which contains a single enum value, and its name, and it's
518 <!-- ##### TYPEDEF GtkFlagValue ##### -->
524 <!-- ##### FUNCTION gtk_type_init ##### -->
526 Initializes the data structures associated with Gtk types.
532 <!-- ##### FUNCTION gtk_type_unique ##### -->
534 Creates a new, unique type.
537 @parent_type: if zero, a fundamental type is created.
539 @Returns: the new #GtkType.
540 <!-- # Unused Parameters # -->
541 @type_info: must not be %NULL, and @type_info->type_name must also not be %NULL.
544 <!-- ##### MACRO gtk_type_name ##### -->
546 Returns a pointer to the name of a type, or %NULL if it has none.
550 @Returns: a pointer to the name of a type, or %NULL if it has none.
553 <!-- ##### MACRO gtk_type_from_name ##### -->
555 Gets the internal representation of a type, given its name.
558 @name: the name of a Gtk type
559 @Returns: a #GtkType.
562 <!-- ##### MACRO gtk_type_parent ##### -->
564 Returns the parent type of a #GtkType.
568 @Returns: the #GtkType of the parent.
571 <!-- ##### FUNCTION gtk_type_class ##### -->
573 Returns a pointer pointing to the class of @type or %NULL if there was
574 any trouble identifying @type. Initializes the class if necessary.
578 @Returns: pointer to the class.
581 <!-- ##### FUNCTION gtk_type_new ##### -->
583 Creates a new object of a given type, and return a pointer to it.
584 Returns %NULL if you give it an invalid type. It allocates the object
585 out of the type's memory chunk if there is a memory chunk. The object
586 has all the proper initializers called.
590 @Returns: pointer to a #GtkTypeObject.
593 <!-- ##### MACRO gtk_type_is_a ##### -->
595 Looks in the type hierarchy to see if @type has @is_a_type among its
596 ancestors. Do so with a simple lookup, not a loop.
600 @is_a_type: another #GtkType.
601 @Returns: %TRUE if @type is a @is_a_type.
604 <!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
606 If @enum_type has values, then return a pointer to all of them.
609 @enum_type: a #GtkType.
610 @Returns: #GtkEnumValue*
613 <!-- ##### FUNCTION gtk_type_flags_get_values ##### -->
615 If @flags_type has values, then return a pointer to all of them.
618 @flags_type: a #GtkType.
619 @Returns: #GtkFlagValue*
622 <!-- ##### FUNCTION gtk_type_enum_find_value ##### -->
624 Returns a pointer to one of @enum_type's #GtkEnumValues's whose name (or nickname) matches @value_name.
627 @enum_type: a #GtkType.
628 @value_name: the name to look for.
629 @Returns: #GtkEnumValue*
632 <!-- ##### FUNCTION gtk_type_flags_find_value ##### -->
634 Returns a pointer to one of @flag_type's #GtkFlagValue's whose name (or nickname) matches @value_name.
637 @flags_type: a #GtkType.
638 @value_name: the name to look for.
639 @Returns: #GtkFlagValue*
640 <!-- # Unused Parameters # -->