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 <!-- ##### USER_FUNCTION GtkSignalMarshaller ##### -->
217 Define a function pointer.
226 <!-- ##### USER_FUNCTION GtkArgGetFunc ##### -->
228 Define a function pointer. Deprecated.
236 <!-- ##### USER_FUNCTION GtkArgSetFunc ##### -->
238 Define a function pointer. Deprecated.
246 <!-- ##### TYPEDEF GtkTypeObject ##### -->
248 A GtkTypeObject defines the minimum structure requirements
249 for type instances. Type instances returned from gtk_type_new ()
250 and initialized through a GtkObjectInitFunc need to directly inherit
251 from this structure or at least copy its fields one by one.
255 <!-- ##### STRUCT GtkArg ##### -->
257 This is a structure that we use to pass in typed values (and names).
263 <!-- ##### MACRO GTK_VALUE_CHAR ##### -->
265 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CHAR
271 <!-- ##### MACRO GTK_VALUE_UCHAR ##### -->
273 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UCHAR
279 <!-- ##### MACRO GTK_VALUE_BOOL ##### -->
281 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOOL
287 <!-- ##### MACRO GTK_VALUE_INT ##### -->
289 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_INT
295 <!-- ##### MACRO GTK_VALUE_UINT ##### -->
297 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UINT
303 <!-- ##### MACRO GTK_VALUE_LONG ##### -->
305 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_LONG
311 <!-- ##### MACRO GTK_VALUE_ULONG ##### -->
313 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ULONG
319 <!-- ##### MACRO GTK_VALUE_FLOAT ##### -->
321 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLOAT
327 <!-- ##### MACRO GTK_VALUE_DOUBLE ##### -->
329 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_DOUBLE
335 <!-- ##### MACRO GTK_VALUE_STRING ##### -->
337 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_STRING
343 <!-- ##### MACRO GTK_VALUE_ENUM ##### -->
345 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ENUM
351 <!-- ##### MACRO GTK_VALUE_FLAGS ##### -->
353 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLAGS
359 <!-- ##### MACRO GTK_VALUE_BOXED ##### -->
361 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOXED
367 <!-- ##### MACRO GTK_VALUE_POINTER ##### -->
369 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_POINTER
375 <!-- ##### MACRO GTK_VALUE_OBJECT ##### -->
377 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_OBJECT
383 <!-- ##### MACRO GTK_VALUE_SIGNAL ##### -->
385 Use to get the value of a GtkArg whose GtkType is GTK_TYPE_SIGNAL
391 <!-- ##### MACRO GTK_RETLOC_CHAR ##### -->
393 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_CHAR
399 <!-- ##### MACRO GTK_RETLOC_UCHAR ##### -->
401 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UCHAR
407 <!-- ##### MACRO GTK_RETLOC_BOOL ##### -->
409 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOOL
415 <!-- ##### MACRO GTK_RETLOC_INT ##### -->
417 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_INT
423 <!-- ##### MACRO GTK_RETLOC_UINT ##### -->
425 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UINT
431 <!-- ##### MACRO GTK_RETLOC_LONG ##### -->
433 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_LONG
439 <!-- ##### MACRO GTK_RETLOC_ULONG ##### -->
441 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ULONG
447 <!-- ##### MACRO GTK_RETLOC_FLOAT ##### -->
449 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLOAT
455 <!-- ##### MACRO GTK_RETLOC_DOUBLE ##### -->
457 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_DOUBLE
463 <!-- ##### MACRO GTK_RETLOC_STRING ##### -->
465 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_STRING
471 <!-- ##### MACRO GTK_RETLOC_ENUM ##### -->
473 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ENUM
479 <!-- ##### MACRO GTK_RETLOC_FLAGS ##### -->
481 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLAGS
487 <!-- ##### MACRO GTK_RETLOC_BOXED ##### -->
489 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOXED
495 <!-- ##### MACRO GTK_RETLOC_POINTER ##### -->
497 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_POINTER
503 <!-- ##### MACRO GTK_RETLOC_OBJECT ##### -->
505 If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_OBJECT
511 <!-- ##### STRUCT GtkTypeInfo ##### -->
513 Holds information about the type. @gtk_type_name returns the name.
514 @object_size is somehow set to the number of bytes that an instance of
515 the object will occupy. @class_init_func holds the type's
516 initialization function. @object_init_func holds the initialization
517 function for an instance of the object. @reserved_1 is used for
518 GtkEnumValue to hold the enumerated values.
528 @base_class_init_func:
530 <!-- ##### TYPEDEF GtkTypeClass ##### -->
532 The base structure for a Gtk Type. Every type inherits this as a base structure.
536 <!-- ##### TYPEDEF GtkEnumValue ##### -->
538 A structure which contains a single enum value, and its name, and it's
543 <!-- ##### TYPEDEF GtkFlagValue ##### -->
549 <!-- ##### FUNCTION gtk_type_init ##### -->
551 Initialize the data structures associated with gtk types.
556 <!-- ##### FUNCTION gtk_type_unique ##### -->
558 Create a new, unique type.
561 @parent_type: if zero, a fundamental type is created.
563 @Returns: the new GtkType.
564 <!-- # Unused Parameters # -->
565 @type_info: must not be null, and @type_info->type_name must also not be null.
568 <!-- ##### MACRO gtk_type_name ##### -->
572 @Returns: a pointer to the name of a type, or NULL if it has none.
573 <!-- # Unused Parameters # -->
577 <!-- ##### MACRO gtk_type_from_name ##### -->
579 Get the internal representation of a type given its name.
583 <!-- # Unused Parameters # -->
584 @name: the name of a gtk type
587 <!-- ##### MACRO gtk_type_parent ##### -->
592 @Returns: the GtkType of the parent
593 <!-- # Unused Parameters # -->
597 <!-- ##### FUNCTION gtk_type_class ##### -->
599 Return a gpointer pointing to the class of @type or NULL if there was
600 any trouble identifying @type. Initialize the class if necessary.
604 @Returns: gpointer to the klass.
607 <!-- ##### FUNCTION gtk_type_new ##### -->
609 Create a new object of a given type, and return a gpointer to it.
610 Returns NULL if you give it an invalid type. It allocates the object
611 out of the type's memory chunk if there is a memory chunk. The object
612 has all the proper initializers called.
616 @Returns: gpointer to a GtkTypeObject
619 <!-- ##### MACRO gtk_type_is_a ##### -->
621 Look in the type hierarchy to see if @type has @is_a_type among its
622 ancestors. Do so with a simple lookup, not a loop.
626 <!-- # Unused Parameters # -->
631 <!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
633 If @enum_type has values, then return a pointer to all of them.
637 @Returns: GtkEnumValue*
640 <!-- ##### FUNCTION gtk_type_flags_get_values ##### -->
642 If @flags_type has values, then return a pointer to all of them.
646 @Returns: GtkFlagValue*
649 <!-- ##### FUNCTION gtk_type_enum_find_value ##### -->
651 Return a pointer to one of @enum_type's GtkEnumValues's whose name (or nickname) matches @value_name.
656 @Returns: GtkEnumValue*
659 <!-- ##### FUNCTION gtk_type_flags_find_value ##### -->
661 Return a pointer to one of @flag_type's GtkFlagValue's whose name (or nickname) matches @value_name.
666 @Returns: GtkFlagValue*
667 <!-- # Unused Parameters # -->