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).
50 <!-- ##### MACRO GTK_CLASS_NAME ##### -->
58 <!-- ##### MACRO GTK_CLASS_TYPE ##### -->
66 <!-- ##### MACRO GTK_TYPE_IS_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 highest maximum fundamental enumerated type value.
88 <!-- ##### MACRO GTK_STRUCT_OFFSET ##### -->
90 Use in place of offsetof(), 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 Cast 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 Cast 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 Convert 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 Define a function pointer.
174 <!-- ##### TYPEDEF GtkObjectInitFunc ##### -->
176 Define a function pointer.
180 <!-- ##### USER_FUNCTION GtkSignalFunc ##### -->
182 Define a function pointer.
187 <!-- ##### USER_FUNCTION GtkFunction ##### -->
189 Define a function pointer.
196 <!-- ##### USER_FUNCTION GtkDestroyNotify ##### -->
198 Define a function pointer.
204 <!-- ##### USER_FUNCTION GtkCallbackMarshal ##### -->
206 Define a function pointer.
215 <!-- ##### TYPEDEF GtkSignalMarshaller ##### -->
217 Define a function pointer.
221 <!-- ##### USER_FUNCTION GtkArgGetFunc ##### -->
223 Define a function pointer. Deprecated.
231 <!-- ##### USER_FUNCTION GtkArgSetFunc ##### -->
233 Define a function pointer. Deprecated.
241 <!-- ##### TYPEDEF GtkTypeObject ##### -->
243 A GtkTypeObject defines the minimum structure requirements
244 for type instances. Type instances returned from gtk_type_new ()
245 and initialized through a GtkObjectInitFunc need to directly inherit
246 from this structure or at least copy its fields one by one.
250 <!-- ##### STRUCT GtkArg ##### -->
252 This is a structure that we use to pass in typed values (and names).
258 <!-- ##### MACRO GTK_VALUE_CHAR ##### -->
260 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CHAR
266 <!-- ##### MACRO GTK_VALUE_UCHAR ##### -->
268 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UCHAR
274 <!-- ##### MACRO GTK_VALUE_BOOL ##### -->
276 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOOL
282 <!-- ##### MACRO GTK_VALUE_INT ##### -->
284 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_INT
290 <!-- ##### MACRO GTK_VALUE_UINT ##### -->
292 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UINT
298 <!-- ##### MACRO GTK_VALUE_LONG ##### -->
300 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_LONG
306 <!-- ##### MACRO GTK_VALUE_ULONG ##### -->
308 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ULONG
314 <!-- ##### MACRO GTK_VALUE_FLOAT ##### -->
316 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLOAT
322 <!-- ##### MACRO GTK_VALUE_DOUBLE ##### -->
324 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_DOUBLE
330 <!-- ##### MACRO GTK_VALUE_STRING ##### -->
332 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_STRING
338 <!-- ##### MACRO GTK_VALUE_ENUM ##### -->
340 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ENUM
346 <!-- ##### MACRO GTK_VALUE_FLAGS ##### -->
348 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLAGS
354 <!-- ##### MACRO GTK_VALUE_BOXED ##### -->
356 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOXED
362 <!-- ##### MACRO GTK_VALUE_POINTER ##### -->
364 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_POINTER
370 <!-- ##### MACRO GTK_VALUE_OBJECT ##### -->
372 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_OBJECT
378 <!-- ##### MACRO GTK_VALUE_SIGNAL ##### -->
380 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_SIGNAL
386 <!-- ##### MACRO GTK_RETLOC_CHAR ##### -->
388 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_CHAR
394 <!-- ##### MACRO GTK_RETLOC_UCHAR ##### -->
396 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UCHAR
402 <!-- ##### MACRO GTK_RETLOC_BOOL ##### -->
404 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOOL
410 <!-- ##### MACRO GTK_RETLOC_INT ##### -->
412 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_INT
418 <!-- ##### MACRO GTK_RETLOC_UINT ##### -->
420 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UINT
426 <!-- ##### MACRO GTK_RETLOC_LONG ##### -->
428 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_LONG
434 <!-- ##### MACRO GTK_RETLOC_ULONG ##### -->
436 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ULONG
442 <!-- ##### MACRO GTK_RETLOC_FLOAT ##### -->
444 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLOAT
450 <!-- ##### MACRO GTK_RETLOC_DOUBLE ##### -->
452 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_DOUBLE
458 <!-- ##### MACRO GTK_RETLOC_STRING ##### -->
460 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_STRING
466 <!-- ##### MACRO GTK_RETLOC_ENUM ##### -->
468 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ENUM
474 <!-- ##### MACRO GTK_RETLOC_FLAGS ##### -->
476 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLAGS
482 <!-- ##### MACRO GTK_RETLOC_BOXED ##### -->
484 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOXED
490 <!-- ##### MACRO GTK_RETLOC_POINTER ##### -->
492 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_POINTER
498 <!-- ##### MACRO GTK_RETLOC_OBJECT ##### -->
500 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_OBJECT
506 <!-- ##### STRUCT GtkTypeInfo ##### -->
508 Holds information about the type. @gtk_type_name returns the name.
509 @object_size is somehow set to the number of bytes that an instance of
510 the object will occupy. @class_init_func holds the type's
511 initialization function. @object_init_func holds the initialization
512 function for an instance of the object. @reserved_1 is used for
513 GtkEnumValue to hold the enumerated values.
523 @base_class_init_func:
525 <!-- ##### TYPEDEF GtkTypeClass ##### -->
527 The base structure for a Gtk Type. Every type inherits this as a base structure.
531 <!-- ##### TYPEDEF GtkEnumValue ##### -->
533 A structure which contains a single enum value, and its name, and it's
538 <!-- ##### TYPEDEF GtkFlagValue ##### -->
544 <!-- ##### FUNCTION gtk_type_init ##### -->
546 Initialize the data structures associated with gtk types.
552 <!-- ##### FUNCTION gtk_type_unique ##### -->
554 Create a new, unique type.
557 @parent_type: if zero, a fundamental type is created.
559 @Returns: the new GtkType.
560 <!-- # Unused Parameters # -->
561 @type_info: must not be null, and @type_info->type_name must also not be null.
564 <!-- ##### MACRO gtk_type_name ##### -->
568 @Returns: a pointer to the name of a type, or NULL if it has none.
569 <!-- # Unused Parameters # -->
573 <!-- ##### MACRO gtk_type_from_name ##### -->
575 Get the internal representation of a type given its name.
579 <!-- # Unused Parameters # -->
580 @name: the name of a gtk type
583 <!-- ##### MACRO gtk_type_parent ##### -->
588 @Returns: the GtkType of the parent
589 <!-- # Unused Parameters # -->
593 <!-- ##### FUNCTION gtk_type_class ##### -->
595 Return a gpointer pointing to the class of @type or NULL if there was
596 any trouble identifying @type. Initialize the class if necessary.
600 @Returns: gpointer to the klass.
603 <!-- ##### FUNCTION gtk_type_new ##### -->
605 Create a new object of a given type, and return a gpointer to it.
606 Returns NULL if you give it an invalid type. It allocates the object
607 out of the type's memory chunk if there is a memory chunk. The object
608 has all the proper initializers called.
612 @Returns: gpointer to a GtkTypeObject
615 <!-- ##### MACRO gtk_type_is_a ##### -->
617 Look in the type hierarchy to see if @type has @is_a_type among its
618 ancestors. Do so with a simple lookup, not a loop.
622 <!-- # Unused Parameters # -->
627 <!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
629 If @enum_type has values, then return a pointer to all of them.
633 @Returns: GtkEnumValue*
636 <!-- ##### FUNCTION gtk_type_flags_get_values ##### -->
638 If @flags_type has values, then return a pointer to all of them.
642 @Returns: GtkFlagValue*
645 <!-- ##### FUNCTION gtk_type_enum_find_value ##### -->
647 Return a pointer to one of @enum_type's GtkEnumValues's whose name (or nickname) matches @value_name.
652 @Returns: GtkEnumValue*
655 <!-- ##### FUNCTION gtk_type_flags_find_value ##### -->
657 Return a pointer to one of @flag_type's GtkFlagValue's whose name (or nickname) matches @value_name.
662 @Returns: GtkFlagValue*
663 <!-- # Unused Parameters # -->