/* Objets qui supportent l'heritage multiple */
#ifndef __OBJECT_H__
#define __OBJECT_H__
#include <general.h>
typedef struct _object object;
typedef struct _obj_ofs obj_ofs;
struct _obj_ofs
{
uint32 obj_type;
pointer ofs;
};
struct _object
{
void (* free)(obj_ofs *this);
};
/* ne pas utiliser directement, utiliser la macro ci dessous */
extern uint32 current_obj_num;
/* renvoi un nouveau numero d'identificateur d'object */
#define object_num_new (++current_obj_num);
/* Renvoi le numero de type qui correspond a un object tout con */
/* chaque autre type d'object (button, window...) doit avoir son */
/* propre numero ainsi que sa propre fonction sur le meme type. */
uint32 object_type(void);
/* initialise un object (utile pour les object qui herite) */
/* qui doivent appeler init avant de faire leur propre */
/* initialisation specifique ou de surcharge. */
void object_init(obj_ofs *this);
/* cree un object */
obj_ofs *object_new(void);
#endif /* __OBJECT_H__ */