Details
GTS_CLASS_NAME_LENGTH
#define GTS_CLASS_NAME_LENGTH 40 |
Maximum class name length for GtsObjectClass.
GTS_OBJECT_CLASS()
#define GTS_OBJECT_CLASS(klass) |
Casts klass to GtsObjectClass.
GTS_IS_OBJECT()
#define GTS_IS_OBJECT(obj) |
Evaluates to TRUE if obj is a GtsObject, FALSE otherwise.
GTS_OBJECT_CLASS_CAST()
#define GTS_OBJECT_CLASS_CAST(objklass, type, klass) |
This macro is used to define casting macros for object classes. You should need it only when writing new object class functions.
GTS_OBJECT_CAST()
#define GTS_OBJECT_CAST(obj, type, klass) |
This macro is used to define casting macros for object. You should need it only when writing new object functions.
GTS_OBJECT_DESTROYABLE()
#define GTS_OBJECT_DESTROYABLE(object) |
Evaluates to TRUE if object is destroyable, FALSE otherwise. You should not need to use this macro.
GTS_OBJECT_NOT_DESTROYABLE()
#define GTS_OBJECT_NOT_DESTROYABLE(object) |
Sets object as not destroyable. You should not need to use this macro.
struct GtsObjectClass
struct GtsObjectClass {
GtsObjectClassInfo info;
GtsObjectClass * parent_class;
void (* clone) (GtsObject *, GtsObject *);
void (* destroy) (GtsObject *);
gint (* read) (GtsObject *, FILE *);
void (* write) (GtsObject *, FILE *);
}; |
The base object class structure. All the virtual functions clone, destroy, read and write can be overloaded. The default read and write methods are undefined. The default clone method just copies the object structure. The default destroy method frees the memory allocated for a given object structure.
struct GtsObject
struct GtsObject {
GtsObjectClass * klass;
gpointer reserved;
}; |
The base object structure. The reserved pointer is used internally.
struct GtsObjectClassInfo
struct GtsObjectClassInfo {
gchar name[GTS_CLASS_NAME_LENGTH];
guint object_size;
guint class_size;
GtsObjectClassInitFunc class_init_func;
GtsObjectInitFunc object_init_func;
GtsArgSetFunc arg_set_func;
GtsArgGetFunc arg_get_func;
}; |
Informations about a GtsObjectClass, including name, size of the object structure to be allocated when constructing the object, size of the object class structure to be allocated when instanciating the object class, class initialization function, object initialization function.
GtsObjectClassInitFunc ()
A function to call to initialize an object class.
GtsObjectInitFunc ()
A function to call to initialize an object.
GtsArgSetFunc ()
Defined for future use.
GtsArgGetFunc ()
Defined for future use.
gts_object_class_check_cast ()
gpointer gts_object_class_check_cast (gpointer klass,
gpointer from); |
gts_object_class_is_from_class ()
gpointer gts_object_class_is_from_class (gpointer klass,
gpointer from); |
gts_object_init ()
Calls the init method of klass with object as argument. This is done
recursively in the correct order (from the base class to the top). You
should rarely need this function as it is called automatically by the
constructor for each class.
gts_object_clone ()
Calls the clone method of object. The call to this function will fail
if no clone method exists for the given object.
gts_object_check_cast ()
gpointer gts_object_check_cast (gpointer object,
gpointer klass); |
gts_object_is_from_class ()
gpointer gts_object_is_from_class (gpointer object,
gpointer klass); |
gts_object_reset_reserved ()
void gts_object_reset_reserved (GtsObject *object); |
Reset the reserved field of object.
gts_object_destroy ()
Calls the destroy method of object, freeing all memory allocated for it.