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_FLAGS()
#define GTS_OBJECT_FLAGS(obj) (GTS_OBJECT (obj)->flags) |
GTS_OBJECT_SET_FLAGS()
#define GTS_OBJECT_SET_FLAGS(obj,flag) G_STMT_START{ (GTS_OBJECT_FLAGS (obj) |= (flag)); }G_STMT_END |
GTS_OBJECT_UNSET_FLAGS()
#define GTS_OBJECT_UNSET_FLAGS(obj,flag) G_STMT_START{ (GTS_OBJECT_FLAGS (obj) &= ~(flag)); }G_STMT_END |
GTS_OBJECT_DESTROYED()
#define GTS_OBJECT_DESTROYED(obj) ((GTS_OBJECT_FLAGS (obj) & GTS_DESTROYED) != 0) |
struct GtsObjectClass
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;
guint32 flags;
}; |
The base object structure.
struct GtsObjectClassInfo
struct GtsObjectClassInfo; |
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.
enum GtsObjectFlags
typedef enum
{
GTS_DESTROYED = 1 << 0,
GTS_USER_FLAG = 1 /* user flags start from here */
} GtsObjectFlags; |
struct GtsColor
struct GtsColor {
gfloat r, g, b;
}; |
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_class_from_name ()
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_attributes ()
Calls the attributes() method of object using from as source.
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.
gts_finalize ()
void gts_finalize (void); |
Free all the memory allocated by the object system of GTS. No other
GTS function can be called after this function has been called.