1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Handle run-time type creation.
7 <!-- ##### SECTION Long_Description ##### -->
9 The GTK+ 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 %G_DISABLE_CAST_CHECKS is
101 defined, just cast it. Otherwise, check to see if we can cast @tobj
105 <!-- # Unused Parameters # -->
107 @cast_type: a GTK+ type.
111 <!-- ##### MACRO GTK_CHECK_CLASS_CAST ##### -->
113 Casts the object in @tobj into @cast. If %G_DISABLE_CAST_CHECKS is
114 defined, just cast it. Otherwise, check to see if we can cast @tobj
118 <!-- # Unused Parameters # -->
119 @tclass: 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 ##### -->
146 Gets the class of @tobj.
149 <!-- # Unused Parameters # -->
153 <!-- ##### MACRO GTK_FUNDAMENTAL_TYPE ##### -->
155 Converts a GTK+ type into a fundamental type.
158 <!-- # Unused Parameters # -->
162 <!-- ##### MACRO GTK_SIGNAL_FUNC ##### -->
164 Just a macroized cast into a #GtkSignalFunc.
170 <!-- ##### TYPEDEF GtkClassInitFunc ##### -->
172 Defines a function pointer.
176 <!-- ##### TYPEDEF GtkObjectInitFunc ##### -->
178 Defines a function pointer.
182 <!-- ##### USER_FUNCTION GtkSignalFunc ##### -->
184 Defines a function pointer.
189 <!-- ##### USER_FUNCTION GtkFunction ##### -->
191 Defines a function pointer.
198 <!-- ##### USER_FUNCTION GtkDestroyNotify ##### -->
200 Defines a function pointer.
206 <!-- ##### USER_FUNCTION GtkCallbackMarshal ##### -->
208 Defines a function pointer.
217 <!-- ##### TYPEDEF GtkSignalMarshaller ##### -->
219 Defines a function pointer.
223 <!-- ##### TYPEDEF GtkTypeObject ##### -->
225 A #GtkTypeObject defines the minimum structure requirements
226 for type instances. Type instances returned from gtk_type_new ()
227 and initialized through a #GtkObjectInitFunc need to directly inherit
228 from this structure or at least copy its fields one by one.
232 <!-- ##### STRUCT GtkArg ##### -->
234 This is a structure that we use to pass in typed values (and names).
240 <!-- ##### MACRO GTK_VALUE_CHAR ##### -->
242 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_CHAR.
248 <!-- ##### MACRO GTK_VALUE_UCHAR ##### -->
250 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_UCHAR.
256 <!-- ##### MACRO GTK_VALUE_BOOL ##### -->
258 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_BOOL.
264 <!-- ##### MACRO GTK_VALUE_INT ##### -->
266 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_INT.
272 <!-- ##### MACRO GTK_VALUE_UINT ##### -->
274 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_UINT.
280 <!-- ##### MACRO GTK_VALUE_LONG ##### -->
282 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_LONG.
288 <!-- ##### MACRO GTK_VALUE_ULONG ##### -->
290 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_ULONG.
296 <!-- ##### MACRO GTK_VALUE_FLOAT ##### -->
298 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_FLOAT.
304 <!-- ##### MACRO GTK_VALUE_DOUBLE ##### -->
306 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_DOUBLE.
312 <!-- ##### MACRO GTK_VALUE_STRING ##### -->
314 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_STRING.
320 <!-- ##### MACRO GTK_VALUE_ENUM ##### -->
322 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_ENUM.
328 <!-- ##### MACRO GTK_VALUE_FLAGS ##### -->
330 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_FLAGS.
336 <!-- ##### MACRO GTK_VALUE_BOXED ##### -->
338 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_BOXED.
344 <!-- ##### MACRO GTK_VALUE_POINTER ##### -->
346 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_POINTER.
352 <!-- ##### MACRO GTK_VALUE_OBJECT ##### -->
354 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_OBJECT.
360 <!-- ##### MACRO GTK_VALUE_SIGNAL ##### -->
362 Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_SIGNAL.
368 <!-- ##### MACRO GTK_RETLOC_CHAR ##### -->
370 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_CHAR.
376 <!-- ##### MACRO GTK_RETLOC_UCHAR ##### -->
378 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_UCHAR.
384 <!-- ##### MACRO GTK_RETLOC_BOOL ##### -->
386 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_BOOL.
392 <!-- ##### MACRO GTK_RETLOC_INT ##### -->
394 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_INT.
400 <!-- ##### MACRO GTK_RETLOC_UINT ##### -->
402 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_UINT.
408 <!-- ##### MACRO GTK_RETLOC_LONG ##### -->
410 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_LONG.
416 <!-- ##### MACRO GTK_RETLOC_ULONG ##### -->
418 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_ULONG.
424 <!-- ##### MACRO GTK_RETLOC_FLOAT ##### -->
426 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_FLOAT.
432 <!-- ##### MACRO GTK_RETLOC_DOUBLE ##### -->
434 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_DOUBLE.
440 <!-- ##### MACRO GTK_RETLOC_STRING ##### -->
442 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_STRING.
448 <!-- ##### MACRO GTK_RETLOC_ENUM ##### -->
450 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_ENUM.
456 <!-- ##### MACRO GTK_RETLOC_FLAGS ##### -->
458 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_FLAGS.
464 <!-- ##### MACRO GTK_RETLOC_BOXED ##### -->
466 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_BOXED.
472 <!-- ##### MACRO GTK_RETLOC_POINTER ##### -->
474 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_POINTER.
480 <!-- ##### MACRO GTK_RETLOC_OBJECT ##### -->
482 If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_OBJECT.
488 <!-- ##### STRUCT GtkTypeInfo ##### -->
490 Holds information about the type. gtk_type_name() returns the name.
491 @object_size is somehow set to the number of bytes that an instance of
492 the object will occupy. @class_init_func holds the type's
493 initialization function. @object_init_func holds the initialization
494 function for an instance of the object. @reserved_1 is used for
495 #GtkEnumValue to hold the enumerated values.
505 @base_class_init_func:
507 <!-- ##### TYPEDEF GtkTypeClass ##### -->
509 The base structure for a GTK+ type. Every type inherits this as a base structure.
513 <!-- ##### TYPEDEF GtkEnumValue ##### -->
515 A structure which contains a single enum value, and its name, and it's
520 <!-- ##### TYPEDEF GtkFlagValue ##### -->
526 <!-- ##### FUNCTION gtk_type_init ##### -->
528 Initializes the data structures associated with GTK+ types.
534 <!-- ##### FUNCTION gtk_type_unique ##### -->
536 Creates a new, unique type.
539 @parent_type: if zero, a fundamental type is created.
541 @Returns: the new #GtkType.
542 <!-- # Unused Parameters # -->
543 @type_info: must not be %NULL, and @type_info->type_name must also not be %NULL.
546 <!-- ##### MACRO gtk_type_name ##### -->
548 Returns a pointer to the name of a type, or %NULL if it has none.
552 @Returns: a pointer to the name of a type, or %NULL if it has none.
555 <!-- ##### MACRO gtk_type_from_name ##### -->
557 Gets the internal representation of a type, given its name.
560 @name: the name of a GTK+ type
561 @Returns: a #GtkType.
564 <!-- ##### MACRO gtk_type_parent ##### -->
566 Returns the parent type of a #GtkType.
570 @Returns: the #GtkType of the parent.
573 <!-- ##### FUNCTION gtk_type_class ##### -->
575 Returns a pointer pointing to the class of @type or %NULL if there was
576 any trouble identifying @type. Initializes the class if necessary.
580 @Returns: pointer to the class.
583 <!-- ##### FUNCTION gtk_type_new ##### -->
585 Creates a new object of a given type, and return a pointer to it.
586 Returns %NULL if you give it an invalid type. It allocates the object
587 out of the type's memory chunk if there is a memory chunk. The object
588 has all the proper initializers called.
592 @Returns: pointer to a #GtkTypeObject.
595 <!-- ##### MACRO gtk_type_is_a ##### -->
597 Looks in the type hierarchy to see if @type has @is_a_type among its
598 ancestors. Do so with a simple lookup, not a loop.
602 @is_a_type: another #GtkType.
603 @Returns: %TRUE if @type is a @is_a_type.
606 <!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
608 If @enum_type has values, then return a pointer to all of them.
611 @enum_type: a #GtkType.
612 @Returns: #GtkEnumValue*
615 <!-- ##### FUNCTION gtk_type_flags_get_values ##### -->
617 If @flags_type has values, then return a pointer to all of them.
620 @flags_type: a #GtkType.
621 @Returns: #GtkFlagValue*
624 <!-- ##### FUNCTION gtk_type_enum_find_value ##### -->
626 Returns a pointer to one of @enum_type's #GtkEnumValues's whose name (or nickname) matches @value_name.
629 @enum_type: a #GtkType.
630 @value_name: the name to look for.
631 @Returns: #GtkEnumValue*
634 <!-- ##### FUNCTION gtk_type_flags_find_value ##### -->
636 Returns a pointer to one of @flag_type's #GtkFlagValue's whose name (or nickname) matches @value_name.
639 @flags_type: a #GtkType.
640 @value_name: the name to look for.
641 @Returns: #GtkFlagValue*
642 <!-- # Unused Parameters # -->