GNU Info

Info Node: (gtk.info)Standard Macros

(gtk.info)Standard Macros


Prev: Resource Files Up: Miscellaneous
Enter node , (file) or (file)node

Macros defined by all objects
=============================

   There are three macros that are defined by all object types. The
first two are used for performing casts and the last is for querying
whether an object is of a particular type. These macros are both
conveniences and debugging tools. If the GTK library was compiled with
`NDEBUG' defined as a preprocessor symbol (via the -DNDEBUG to cc),
then the macros check the object type and emit a warning if the cast is
invalid. Doing such checking is fairly expensive since the cast macros
are used everywhere in GTK and would normally be turned off in a public
release of a product. Note: The functions below are indeed macros, but
they may be considered functions for most purposes.

 - Function: Gtk<ObjectType>* GTK_<OBJECT_TYPE> (gpointer OBJ)
     Cast a generic pointer to `Gtk<ObjectType>*'. This function is
     provided in order to be able to provide checking during development
     stages of code development since it is possible to examine the
     actual type of object (using `gtk_type_is_a') before performing
     the cast.

 - Function: Gtk<ObjectType>Class* GTK_<OBJECT_TYPE>_CLASS (gpointer
          CLASS)
     Cast a generic pointer to `Gtk<ObjectType>Class*'. Like
     `GTK_<ObjectType>', this function is, in reality, a macro.

 - Function: gint GTK_IS_<ObjectType> (gpointer OBJ)
     Determine if a generic pointer refers to a `Gtk<ObjectType>'
     object. This function is, in reality, a macro wrapper around the
     `gtk_type_is_a' function (Note: Types).


automatically generated by info2www version 1.2.2.9