add version to smart classes.

SVN revision: 27323
This commit is contained in:
Carsten Haitzler 2006-12-02 03:20:56 +00:00
parent ed0154875b
commit 0a798ec6a8
2 changed files with 6 additions and 0 deletions

View File

@ -95,9 +95,12 @@ struct _Evas_Rectangle /** A rectangle */
int h; /**< height of rectangle */
};
#define EVAS_SMART_CLASS_VERSION 1 /** the version you have to put into the version field in the smart class struct */
struct _Evas_Smart_Class /** a smart object class */
{
const char *name; /** the string name of the class */
int version;
void (*add) (Evas_Object *o);
void (*del) (Evas_Object *o);

View File

@ -90,6 +90,9 @@ evas_smart_class_new(Evas_Smart_Class *sc)
if (!sc) return NULL;
/* api does not match abi! for now refuse as we only have 1 version */
if (sc->version != EVAS_SMART_CLASS_VERSION) return NULL;
s = evas_mem_calloc(sizeof(Evas_Smart));
if (!s) return NULL;