GTK+ Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# Types

## Name

Types -- Handle run-time type creation.

## Synopsis

    #include <gtk/gtk.h>

    typedef     GtkType;
    enum        GtkFundamentalType;
    #define     GTK_TYPE_NUM_BUILTINS
    #define     GTK_TYPE_FLAT_FIRST
    #define     GTK_TYPE_FLAT_LAST
    #define     GTK_TYPE_STRUCTURED_FIRST
    #define     GTK_TYPE_STRUCTURED_LAST
    #define     GTK_TYPE_FUNDAMENTAL_LAST
    #define     GTK_TYPE_FUNDAMENTAL_MAX
    #define     GTK_STRUCT_OFFSET               (struct, field)
    #define     GTK_CHECK_CAST                  (tobj, cast_type, cast)
    #define     GTK_CHECK_CLASS_CAST            (tclass,cast_type,cast)
    #define     GTK_CHECK_TYPE                  (type_object, otype)
    #define     GTK_CHECK_CLASS_TYPE            (type_class, otype)
    #define     GTK_TYPE_IDENTIFIER
    GtkType     gtk_identifier_get_type         (void);
    #define     GTK_TYPE_MAKE                   (parent_t, seqno)
    #define     GTK_FUNDAMENTAL_TYPE            (type)
    #define     GTK_TYPE_SEQNO                  (type)
    #define     GTK_SIGNAL_FUNC                 (f)
    void        (*GtkClassInitFunc)             (gpointer klass);
    void        (*GtkObjectInitFunc)            (gpointer object,
                                                 gpointer klass);
    void        (*GtkSignalFunc)                ();
    gint        (*GtkFunction)                  (gpointer data);
    void        (*GtkDestroyNotify)             (gpointer data);
    void        (*GtkCallbackMarshal)           (GtkObject *object,
                                                 gpointer data,
                                                 guint n_args,
                                                 GtkArg *args);
    void        (*GtkSignalMarshaller)          (GtkObject *object,
                                                 GtkSignalFunc func,
                                                 gpointer func_data,
                                                 GtkArg *args);
    void        (*GtkArgGetFunc)                (GtkObject *object,
                                                 GtkArg *arg,
                                                 guint arg_id);
    void        (*GtkArgSetFunc)                (GtkObject *object,
                                                 GtkArg *arg,
                                                 guint arg_id);
    struct      GtkTypeObject;
    struct      GtkArg;
    #define     GTK_VALUE_CHAR                  (a)
    #define     GTK_VALUE_UCHAR                 (a)
    #define     GTK_VALUE_BOOL                  (a)
    #define     GTK_VALUE_INT                   (a)
    #define     GTK_VALUE_UINT                  (a)
    #define     GTK_VALUE_LONG                  (a)
    #define     GTK_VALUE_ULONG                 (a)
    #define     GTK_VALUE_FLOAT                 (a)
    #define     GTK_VALUE_DOUBLE                (a)
    #define     GTK_VALUE_STRING                (a)
    #define     GTK_VALUE_ENUM                  (a)
    #define     GTK_VALUE_FLAGS                 (a)
    #define     GTK_VALUE_BOXED                 (a)
    #define     GTK_VALUE_POINTER               (a)
    #define     GTK_VALUE_OBJECT                (a)
    #define     GTK_VALUE_SIGNAL                (a)
    #define     GTK_VALUE_ARGS                  (a)
    #define     GTK_VALUE_CALLBACK              (a)
    #define     GTK_VALUE_C_CALLBACK            (a)
    #define     GTK_VALUE_FOREIGN               (a)
    #define     GTK_RETLOC_CHAR                 (a)
    #define     GTK_RETLOC_UCHAR                (a)
    #define     GTK_RETLOC_BOOL                 (a)
    #define     GTK_RETLOC_INT                  (a)
    #define     GTK_RETLOC_UINT                 (a)
    #define     GTK_RETLOC_LONG                 (a)
    #define     GTK_RETLOC_ULONG                (a)
    #define     GTK_RETLOC_FLOAT                (a)
    #define     GTK_RETLOC_DOUBLE               (a)
    #define     GTK_RETLOC_STRING               (a)
    #define     GTK_RETLOC_ENUM                 (a)
    #define     GTK_RETLOC_FLAGS                (a)
    #define     GTK_RETLOC_BOXED                (a)
    #define     GTK_RETLOC_POINTER              (a)
    #define     GTK_RETLOC_OBJECT               (a)
    struct      GtkTypeInfo;
    struct      GtkTypeQuery;
    struct      GtkTypeClass;
    struct      GtkEnumValue;
    void        gtk_type_init                   (void);
    GtkType     gtk_type_unique                 (GtkType parent_type,
                                                 const GtkTypeInfo *type_info);
    void        gtk_type_set_chunk_alloc        (GtkType type,
                                                 guint n_chunks);
    gchar*      gtk_type_name                   (guint type);
    GtkType     gtk_type_from_name              (const gchar *name);
    GtkType     gtk_type_parent                 (GtkType type);
    gpointer    gtk_type_class                  (GtkType type);
    gpointer    gtk_type_parent_class           (GtkType type);
    GList*      gtk_type_children_types         (GtkType type);
    gpointer    gtk_type_new                    (GtkType type);
    void        gtk_type_free                   (GtkType type,
                                                 gpointer mem);
    void        gtk_type_describe_heritage      (GtkType type);
    void        gtk_type_describe_tree          (GtkType type,
                                                 gboolean show_size);
    gboolean    gtk_type_is_a                   (GtkType type,
                                                 GtkType is_a_type);
    GtkTypeObject* gtk_type_check_object_cast   (GtkTypeObject *type_object,
                                                 GtkType cast_type);
    GtkTypeClass* gtk_type_check_class_cast     (GtkTypeClass *klass,
                                                 GtkType cast_type);
    GtkType     gtk_type_register_enum          (const gchar *type_name,
                                                 GtkEnumValue *values);
    GtkType     gtk_type_register_flags         (const gchar *type_name,
                                                 GtkFlagValue *values);
    GtkEnumValue* gtk_type_enum_get_values      (GtkType enum_type);
    GtkFlagValue* gtk_type_flags_get_values     (GtkType flags_type);
    GtkEnumValue* gtk_type_enum_find_value      (GtkType enum_type,
                                                 const gchar *value_name);
    GtkFlagValue* gtk_type_flags_find_value     (GtkType flag_type,
                                                 const gchar *value_name);
    void        gtk_type_set_varargs_type       (GtkType foreign_type,
                                                 GtkType varargs_type);
    GtkType     gtk_type_get_varargs_type       (GtkType foreign_type);
    GtkTypeQuery* gtk_type_query                (GtkType type);

## Description

Gtk's type system is extensible. Because of that, types have to be managed at runtime.

## Details

### GtkType

    typedef guint GtkType;

`GtkType` is unique integer identifying the type. The guts of the information about the type is held in a private struct named GtkTypeNode.

### enum GtkFundamentalType

    typedef enum
    {
      GTK_TYPE_INVALID,
      GTK_TYPE_NONE,

      /* flat types */
      GTK_TYPE_CHAR,
      GTK_TYPE_UCHAR,
      GTK_TYPE_BOOL,
      GTK_TYPE_INT,
      GTK_TYPE_UINT,
      GTK_TYPE_LONG,
      GTK_TYPE_ULONG,
      GTK_TYPE_FLOAT,
      GTK_TYPE_DOUBLE,
      GTK_TYPE_STRING,
      GTK_TYPE_ENUM,
      GTK_TYPE_FLAGS,
      GTK_TYPE_BOXED,
      GTK_TYPE_POINTER,

      /* structured types */
      GTK_TYPE_SIGNAL,
      GTK_TYPE_ARGS,
      GTK_TYPE_CALLBACK,
      GTK_TYPE_C_CALLBACK,
      GTK_TYPE_FOREIGN,

      /* base type node of the object system */
      GTK_TYPE_OBJECT
    } GtkFundamentalType;

`GtkFundamentalType` is an enumerated type which lists all the possible fundamental types (e.g. char, uchar, int, long, float, etc).

### GTK_TYPE_NUM_BUILTINS

    #define	GTK_TYPE_NUM_BUILTINS	(121)

No idea.

### GTK_TYPE_FLAT_FIRST

    #define	GTK_TYPE_FLAT_FIRST		GTK_TYPE_CHAR

The first "flat" (no struct) enumerated type value.

### GTK_TYPE_FLAT_LAST

    #define	GTK_TYPE_FLAT_LAST		GTK_TYPE_POINTER

The last "flat" (no struct) enumerated type value.

### GTK_TYPE_STRUCTURED_FIRST

    #define	GTK_TYPE_STRUCTURED_FIRST	GTK_TYPE_SIGNAL

The first structured enumerated type value.

### GTK_TYPE_STRUCTURED_LAST

    #define	GTK_TYPE_STRUCTURED_LAST	GTK_TYPE_FOREIGN

The last structured enumerated type value.

### GTK_TYPE_FUNDAMENTAL_LAST

    #define	GTK_TYPE_FUNDAMENTAL_LAST	GTK_TYPE_OBJECT

The highest-numbered structured or flat enumerated type value.

### GTK_TYPE_FUNDAMENTAL_MAX

    #define	GTK_TYPE_FUNDAMENTAL_MAX	(32)

The highest maximum fundamental enumerated type value.

### GTK_STRUCT_OFFSET()

    #define     GTK_STRUCT_OFFSET(struct, field)

Use in place of offsetof(), which is used if it exists.

`struct` : | The type of the structure.
`field` : | The field within the structure.

### GTK_CHECK_CAST()

    #define     GTK_CHECK_CAST(tobj, cast_type, cast)

Cast the object in `tobj` into `cast`. If GTK_NO_CHECK_CASTS is defined, just cast it. Otherwise, check to see if we can cast `tobj` into a `cast`.

`tobj` : | a pointer to a GtkObject.
`cast_type` : | a Gtk type.
`cast` : | a C type

### GTK_CHECK_CLASS_CAST()

    #define     GTK_CHECK_CLASS_CAST(tclass,cast_type,cast)

Cast the object in `tobj` into `cast`. If GTK_NO_CHECK_CASTS is defined, just cast it. Otherwise, check to see if we can cast `tobj` into a `cast`.

`tclass` : | a pointer to a GtkClassInitFunc
`cast_type` : | a Gtk type.
`cast` : | a C type

### GTK_CHECK_TYPE()

    #define     GTK_CHECK_TYPE(type_object, otype)

Determines whether `type_object` is a type of `otype`.

`type_object` : | A GtkTypeObject object.
`otype` : |

### GTK_CHECK_CLASS_TYPE()

    #define     GTK_CHECK_CLASS_TYPE(type_class, otype)

Determines whether `type_class` is a type of `otype`.

`type_class` : | A GtkTypeClass class.
`otype` : |

### GTK_TYPE_IDENTIFIER

    #define		GTK_TYPE_IDENTIFIER		(gtk_identifier_get_type ())

Hide the name of gtk_identifier_get_type

### gtk_identifier_get_type ()

    GtkType     gtk_identifier_get_type         (void);

Get the type of GtkIdentifier.

Returns : | GtkType -- the enumerated type of something.

### GTK_TYPE_MAKE()

    #define GTK_TYPE_MAKE(parent_t, seqno)	(((seqno) << 8) | GTK_FUNDAMENTAL_TYPE (parent_t))

Combine a fundemantal type and a sequence number to create a gtk type.

`parent_t` : |
`seqno` : |

### GTK_FUNDAMENTAL_TYPE()

    #define GTK_FUNDAMENTAL_TYPE(type)	((GtkFundamentalType) ((type) & 0xFF))

Convert a gtk type into a fundamental type

`type` : |

### GTK_TYPE_SEQNO()

    #define GTK_TYPE_SEQNO(type)		((type) > 0xFF ? (type) >> 8 : (type))

Convert a gtk type into its sequence number

`type` : |

### GTK_SIGNAL_FUNC()

    #define GTK_SIGNAL_FUNC(f)  ((GtkSignalFunc) f)

Just a macroized cast into a GtkSignalFunc

`f` : |

### GtkClassInitFunc ()

    void        (*GtkClassInitFunc)             (gpointer klass);

Define a function pointer.

`klass` : | a gpointer

### GtkObjectInitFunc ()

    void        (*GtkObjectInitFunc)            (gpointer object,
                                                 gpointer klass);

Define a function pointer.

`object` : | a gpointer
`klass` : | a gpointer

### GtkSignalFunc ()

    void        (*GtkSignalFunc)                ();

Define a function pointer.

### GtkFunction ()

    gint        (*GtkFunction)                  (gpointer data);

Define a function pointer.

`data` : | gpointer
Returns : | gint

### GtkDestroyNotify ()

    void        (*GtkDestroyNotify)             (gpointer data);

Define a function pointer.

`data` : | gpointer

### GtkCallbackMarshal ()

    void        (*GtkCallbackMarshal)           (GtkObject *object,
                                                 gpointer data,
                                                 guint n_args,
                                                 GtkArg *args);

Define a function pointer.

`object` : | GtkObject*
`data` : | gpointer
`n_args` : | guint
`args` : | GtkArg*

### GtkSignalMarshaller ()

    void        (*GtkSignalMarshaller)          (GtkObject *object,
                                                 GtkSignalFunc func,
                                                 gpointer func_data,
                                                 GtkArg *args);

Define a function pointer.

`object` : | GtkObject*
`func` : | GtkSignalFunc
`func_data` : | gpointer
`args` : | GtkArg*

### GtkArgGetFunc ()

    void        (*GtkArgGetFunc)                (GtkObject *object,
                                                 GtkArg *arg,
                                                 guint arg_id);

Define a function pointer. Deprecated.

`object` : |
`arg` : |
`arg_id` : |

### GtkArgSetFunc ()

    void        (*GtkArgSetFunc)                (GtkObject *object,
                                                 GtkArg *arg,
                                                 guint arg_id);

Define a function pointer. Deprecated.

`object` : |
`arg` : |
`arg_id` : |

### struct GtkTypeObject

    struct GtkTypeObject
    {
      /* A pointer to the objects class. This will actually point to
       *  the derived objects class struct (which will be derived from
       *  GtkTypeClass).
       */
      GtkTypeClass	*klass;
    };

A GtkTypeObject defines the minimum structure requirements for type instances. Type instances returned from gtk_type_new() and initialized through a GtkObjectInitFunc need to directly inherit from this structure or at least copy its fields one by one.

### struct GtkArg

    struct GtkArg
    {
      GtkType type;
      gchar *name;

      /* this union only defines the required storage types for
       * the possibile values, thus there is no gint enum_data field,
       * because that would just be a mere alias for gint int_data.
       * use the GTK_VALUE_*() and GTK_RETLOC_*() macros to access
       * the discrete memebers.
       */
      union {
        /* flat values */
        gchar char_data;
        guchar uchar_data;
        gboolean bool_data;
        gint int_data;
        guint uint_data;
        glong long_data;
        gulong ulong_data;
        gfloat float_data;
        gdouble double_data;
        gchar *string_data;
        gpointer pointer_data;
        GtkObject *object_data;

        /* structured values */
        struct {
          GtkSignalFunc f;
          gpointer d;
        } signal_data;
        struct {
          gint n_args;
          GtkArg *args;
        } args_data;
        struct {
          GtkCallbackMarshal marshal;
          gpointer data;
          GtkDestroyNotify notify;
        } callback_data;
        struct {
          GtkFunction func;
          gpointer func_data;
        } c_callback_data;
        struct {
          gpointer data;
          GtkDestroyNotify notify;
        } foreign_data;
      } d;
    };

This is a structure that we use to pass in typed values (and names).

### GTK_VALUE_CHAR()

    #define GTK_VALUE_CHAR(a)	((a).d.char_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CHAR

`a` : |

### GTK_VALUE_UCHAR()

    #define GTK_VALUE_UCHAR(a)	((a).d.uchar_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UCHAR

`a` : |

### GTK_VALUE_BOOL()

    #define GTK_VALUE_BOOL(a)	((a).d.bool_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOOL

`a` : |

### GTK_VALUE_INT()

    #define GTK_VALUE_INT(a)	((a).d.int_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_INT

`a` : |

### GTK_VALUE_UINT()

    #define GTK_VALUE_UINT(a)	((a).d.uint_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_UINT

`a` : |

### GTK_VALUE_LONG()

    #define GTK_VALUE_LONG(a)	((a).d.long_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_LONG

`a` : |

### GTK_VALUE_ULONG()

    #define GTK_VALUE_ULONG(a)	((a).d.ulong_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ULONG

`a` : |

### GTK_VALUE_FLOAT()

    #define GTK_VALUE_FLOAT(a)	((a).d.float_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLOAT

`a` : |

### GTK_VALUE_DOUBLE()

    #define GTK_VALUE_DOUBLE(a)	((a).d.double_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_DOUBLE

`a` : |

### GTK_VALUE_STRING()

    #define GTK_VALUE_STRING(a)	((a).d.string_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_STRING

`a` : |

### GTK_VALUE_ENUM()

    #define GTK_VALUE_ENUM(a)	((a).d.int_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ENUM

`a` : |

### GTK_VALUE_FLAGS()

    #define GTK_VALUE_FLAGS(a)	((a).d.uint_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_FLAGS

`a` : |

### GTK_VALUE_BOXED()

    #define GTK_VALUE_BOXED(a)	((a).d.pointer_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_BOXED

`a` : |

### GTK_VALUE_POINTER()

    #define GTK_VALUE_POINTER(a)	((a).d.pointer_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_POINTER

`a` : |

### GTK_VALUE_OBJECT()

    #define GTK_VALUE_OBJECT(a)	((a).d.object_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_OBJECT

`a` : |

### GTK_VALUE_SIGNAL()

    #define GTK_VALUE_SIGNAL(a)	((a).d.signal_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_SIGNAL

`a` : |

### GTK_VALUE_ARGS()

    #define GTK_VALUE_ARGS(a)	((a).d.args_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ARGS

`a` : |

### GTK_VALUE_CALLBACK()

    #define GTK_VALUE_CALLBACK(a)	((a).d.callback_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CALLBACK

`a` : |

### GTK_VALUE_C_CALLBACK()

    #define GTK_VALUE_C_CALLBACK(a) ((a).d.c_callback_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_CALLBACK

`a` : |

### GTK_VALUE_FOREIGN()

    #define GTK_VALUE_FOREIGN(a)	((a).d.foreign_data)

Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_FOREIGN

`a` : |

### GTK_RETLOC_CHAR()

    #define GTK_RETLOC_CHAR(a)	((gchar*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_CHAR

`a` : |

### GTK_RETLOC_UCHAR()

    #define GTK_RETLOC_UCHAR(a)	((guchar*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UCHAR

`a` : |

### GTK_RETLOC_BOOL()

    #define GTK_RETLOC_BOOL(a)	((gboolean*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOOL

`a` : |

### GTK_RETLOC_INT()

    #define GTK_RETLOC_INT(a)	((gint*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_INT

`a` : |

### GTK_RETLOC_UINT()

    #define GTK_RETLOC_UINT(a)	((guint*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_UINT

`a` : |

### GTK_RETLOC_LONG()

    #define GTK_RETLOC_LONG(a)	((glong*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_LONG

`a` : |

### GTK_RETLOC_ULONG()

    #define GTK_RETLOC_ULONG(a)	((gulong*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ULONG

`a` : |

### GTK_RETLOC_FLOAT()

    #define GTK_RETLOC_FLOAT(a)	((gfloat*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLOAT

`a` : |

### GTK_RETLOC_DOUBLE()

    #define GTK_RETLOC_DOUBLE(a)	((gdouble*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_DOUBLE

`a` : |

### GTK_RETLOC_STRING()

    #define GTK_RETLOC_STRING(a)	((gchar**)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_STRING

`a` : |

### GTK_RETLOC_ENUM()

    #define GTK_RETLOC_ENUM(a)	((gint*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_ENUM

`a` : |

### GTK_RETLOC_FLAGS()

    #define GTK_RETLOC_FLAGS(a)	((guint*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_FLAGS

`a` : |

### GTK_RETLOC_BOXED()

    #define GTK_RETLOC_BOXED(a)	((gpointer*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_BOXED

`a` : |

### GTK_RETLOC_POINTER()

    #define GTK_RETLOC_POINTER(a)	((gpointer*)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_POINTER

`a` : |

### GTK_RETLOC_OBJECT()

    #define GTK_RETLOC_OBJECT(a)	((GtkObject**)	(a).d.pointer_data)

If the GtkArg contains a pointer to the value, this macro will be a pointer to a GTK_TYPE_OBJECT

`a` : |

### struct GtkTypeInfo

    struct GtkTypeInfo
    {
      gchar			*type_name;
      guint			 object_size;
      guint			 class_size;
      GtkClassInitFunc	 class_init_func;
      GtkObjectInitFunc	 object_init_func;
      gpointer		 reserved_1;
      gpointer		 reserved_2;
      GtkClassInitFunc	 base_class_init_func;
    };

Holds information about the type. `gtk_type_name` returns the name. `object_size` is somehow set to the number of bytes that an instance of the object will occupy. `class_init_func` holds the type's initialization function. `object_init_func` holds the initialization function for an instance of the object. `reserved_1` is used for GtkEnumValue to hold the enumerated values.

### struct GtkTypeQuery

    struct GtkTypeQuery
    {
      GtkType		 type;
      const gchar		*type_name;
      guint			 object_size;
      guint			 class_size;
    };

A structure used to return values from `gtk_type_query`.

### struct GtkTypeClass

    struct GtkTypeClass;

The base structure for a Gtk Type. Every type inherits this as a base structure.

### struct GtkEnumValue

    struct GtkEnumValue
    {
      guint	 value;
      gchar	*value_name;
      gchar *value_nick;
    };

A structure which contains a single enum value, and its name, and it's nickname.

### gtk_type_init ()

    void        gtk_type_init                   (void);

Initialize the data structures associated with gtk types.

### gtk_type_unique ()

    GtkType     gtk_type_unique                 (GtkType parent_type,
                                                 const GtkTypeInfo *type_info);

Create a new, unique type.

`parent_type` : | if zero, a fundamental type is created.
`type_info` : | must not be null, and `type_info`->type_name must also not be null.
Returns : | the new GtkType.

### gtk_type_set_chunk_alloc ()

    void        gtk_type_set_chunk_alloc        (GtkType type,
                                                 guint n_chunks);

Set the mem_chunk size so it will hold `n_chunks` of the objects of that `type`.

`type` : | There must be an unlocked TypeNode associated with this type otherwise nothing happens.
`n_chunks` : |

### gtk_type_name ()

    gchar*      gtk_type_name                   (guint type);

`type` : | a GtkType
Returns : | a pointer to the name of a type, or NULL if it has none.

### gtk_type_from_name ()

    GtkType     gtk_type_from_name              (const gchar *name);

Get the internal representation of a type given its name.

`name` : | the name of a gtk type
Returns : | a GtkType

### gtk_type_parent ()

    GtkType     gtk_type_parent                 (GtkType type);

`type` : | a GtkType
Returns : | the GtkType of the parent

### gtk_type_class ()

    gpointer    gtk_type_class                  (GtkType type);

Return a gpointer pointing to the class of `type` or NULL if there was any trouble identifying `type`. Initialize the class if necessary.

`type` : | a GtkType
Returns : | gpointer to the klass.

### gtk_type_parent_class ()

    gpointer    gtk_type_parent_class           (GtkType type);

Return the class of the parent. Initialize the class if necessary. Return NULL if anything goes wrong.

`type` : | GtkType
Returns : | gpointer to the klass.

### gtk_type_children_types ()

    GList*      gtk_type_children_types         (GtkType type);

Return the pointer to the type's children's types.

`type` : | GtkType
Returns : | pointer to a GList

### gtk_type_new ()

    gpointer    gtk_type_new                    (GtkType type);

Create a new object of a given type, and return a gpointer to it. Returns NULL if you give it an invalid type. It allocates the object out of the type's memory chunk if there is a memory chunk. The object has all the proper initializers called.

`type` : | GtkType
Returns : | gpointer to a GtkTypeObject

### gtk_type_free ()

    void        gtk_type_free                   (GtkType type,
                                                 gpointer mem);

Given the type of an object and a pointer to it, the object is freed.

`type` : | GtkType
`mem` : | gpointer to the object

### gtk_type_describe_heritage ()

    void        gtk_type_describe_heritage      (GtkType type);

Print the types `type` inherits from.

`type` : | GtkType

### gtk_type_describe_tree ()

    void        gtk_type_describe_tree          (GtkType type,
                                                 gboolean show_size);

Given a `type`, describe all of its children, and their children. Only show the size if `show_size` is true.

`type` : | GtkType
`show_size` : | gboolean

### gtk_type_is_a ()

    gboolean    gtk_type_is_a                   (GtkType type,
                                                 GtkType is_a_type);

Look in the type hierarchy to see if `type` has `is_a_type` among its ancestors. Do so with a simple lookup, not a loop.

`type` : | GtkType
`is_a_type` : | GtkType
Returns : |

### gtk_type_check_object_cast ()

    GtkTypeObject* gtk_type_check_object_cast   (GtkTypeObject *type_object,
                                                 GtkType cast_type);

Given a pointer to a GtkTypeObject `type_object`, and a GtkType `cast_type`, make sure that it's okay to cast `type_object` into a `cast_type`.

`type_object` : | GtkTypeObject*
`cast_type` : | GtkType
Returns : | the same GtkTypeObject* as `type_object`

### gtk_type_check_class_cast ()

    GtkTypeClass* gtk_type_check_class_cast     (GtkTypeClass *klass,
                                                 GtkType cast_type);

Given a GtkTypeClass pointer `klass`, and a GtkType `cast_type`, make sure that it's okay to cast something of that `klass` into a `cast_type`.

`klass` : | GtkTypeClass*
`cast_type` : | GtkType
Returns : | Always return `klass`.

### gtk_type_register_enum ()

    GtkType     gtk_type_register_enum          (const gchar *type_name,
                                                 GtkEnumValue *values);

Register a new set of enum `values` and give them the name in `type_name`.

`type_name` : | must not be null.
`values` : | GtkEnumValue*
Returns : |

### gtk_type_register_flags ()

    GtkType     gtk_type_register_flags         (const gchar *type_name,
                                                 GtkFlagValue *values);

Register a new set of flags `values` and give them the name in `type_name`.

`type_name` : | must not be null.
`values` : | GtkFlagValue*
Returns : |

### gtk_type_enum_get_values ()

    GtkEnumValue* gtk_type_enum_get_values      (GtkType enum_type);

If `enum_type` has values, then return a pointer to all of them.

`enum_type` : | GtkType
Returns : | GtkEnumValue*

### gtk_type_flags_get_values ()

    GtkFlagValue* gtk_type_flags_get_values     (GtkType flags_type);

If `flags_type` has values, then return a pointer to all of them.

`flags_type` : |
Returns : | GtkFlagValue*

### gtk_type_enum_find_value ()

    GtkEnumValue* gtk_type_enum_find_value      (GtkType enum_type,
                                                 const gchar *value_name);

Return a pointer to one of `enum_type`'s GtkEnumValues's whose name (or nickname) matches `value_name`.

`enum_type` : | GtkType
`value_name` : |
Returns : | GtkEnumValue*

### gtk_type_flags_find_value ()

    GtkFlagValue* gtk_type_flags_find_value     (GtkType flag_type,
                                                 const gchar *value_name);

Return a pointer to one of `flag_type`'s GtkFlagValue's whose name (or nickname) matches `value_name`.

`flag_type` : | GtkType
`value_name` : |
Returns : | GtkFlagValue*

### gtk_type_set_varargs_type ()

    void        gtk_type_set_varargs_type       (GtkType foreign_type,
                                                 GtkType varargs_type);

Set the varargs type for a fundamental type `foreign_type`.

`foreign_type` : | Must be a GtkType with a sequence number of zero. Must not be a fundamental type.
`varargs_type` : | Must be a GtkType which is either structured or flag, or NONE.

### gtk_type_get_varargs_type ()

    GtkType     gtk_type_get_varargs_type       (GtkType foreign_type);

Get the varargs type associated with `foreign_type`

`foreign_type` : | GtkType
Returns : | GtkType

### gtk_type_query ()

    GtkTypeQuery* gtk_type_query                (GtkType type);

Given a type, return various interesting parameters of the type.

`type` : | GtkType
Returns : | GtkTypeQuery*

<<< Previous Page | Home | Up | Next Page >>>
Implementation of Object Properties | Bindings