NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.52">Name Object class -- parent class for all GTS objects.
Synopsis
#include <gts.h>
#define GTS_CLASS_NAME_LENGTH
#define GTS_OBJECT_CLASS (klass)
#define GTS_OBJECT (obj)
#define GTS_IS_OBJECT (obj)
#define GTS_OBJECT_CLASS_CAST (objklass, type, klass)
#define GTS_OBJECT_CAST (obj, type, klass)
#define GTS_OBJECT_FLAGS (obj)
#define GTS_OBJECT_SET_FLAGS (obj,flag)
#define GTS_OBJECT_UNSET_FLAGS (obj,flag)
#define GTS_OBJECT_DESTROYED (obj)
struct GtsObjectClass ;
struct GtsObject ;
struct GtsObjectClassInfo ;
void (*GtsObjectClassInitFunc ) (GtsObjectClass *objclass);
void (*GtsObjectInitFunc ) (GtsObject *obj);
void (*GtsArgSetFunc ) (GtsObject *obj);
void (*GtsArgGetFunc ) (GtsObject *obj);
enum GtsObjectFlags ;
struct GtsColor ;
GtsObjectClass * gts_object_class (void);
gpointer gts_object_class_new (GtsObjectClass *parent_class,
GtsObjectClassInfo *info);
gpointer gts_object_class_check_cast (gpointer klass,
gpointer from);
gpointer gts_object_class_is_from_class (gpointer klass,
gpointer from);
GtsObjectClass * gts_object_class_from_name (gchar *name);
GtsObject * gts_object_new (GtsObjectClass *klass);
void gts_object_init (GtsObject *object,
GtsObjectClass *klass);
GtsObject * gts_object_clone (GtsObject *object);
void gts_object_attributes (GtsObject *object,
GtsObject *from);
gpointer gts_object_check_cast (gpointer object,
gpointer klass);
gpointer gts_object_is_from_class (gpointer object,
gpointer klass);
void gts_object_reset_reserved (GtsObject *object);
void gts_object_destroy (GtsObject *object);
void gts_finalize (void);
Description All GTS objects are derived from this base class. Objects of any class can be constructed using the gts_object_new () function and destroyed using the gts_object_destroy () function. Default virtual methods include read () and write () functions which can be used to read or write associated objects attributes from or to GTS geometrical files.
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 GtsObjectClassThe 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 GtsObjectstruct GtsObject {
GtsObjectClass * klass;
gpointer reserved;
guint32 flags;
};
The base object structure.
struct GtsObjectClassInfostruct 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 GtsObjectFlagstypedef enum
{
GTS_DESTROYED = 1 << 0,
GTS_USER_FLAG = 1 /* user flags start from here */
} GtsObjectFlags;
struct GtsColorstruct 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.