5 /* the module api version */
6 #define EVAS_MODULE_API_VERSION 1
10 typedef enum _Evas_Module_Type
12 EVAS_MODULE_TYPE_ENGINE,
13 EVAS_MODULE_TYPE_IMAGE_LOADER,
14 EVAS_MODULE_TYPE_IMAGE_SAVER,
15 EVAS_MODULE_TYPE_OBJECT
19 typedef struct _Evas_Module_Api Evas_Module_Api;
20 typedef struct _Evas_Module Evas_Module;
21 typedef struct _Evas_Module_Path Evas_Module_Path;
22 typedef struct _Evas_Module_Engine Evas_Module_Engine;
24 /* the module api structure, all modules should define this struct */
25 struct _Evas_Module_Api
28 Evas_Module_Type type;
33 /* the module structure */
37 void *handle; /* the dlopen handle */
38 char *path; /* the path where this modules is */
39 char *name; /* the name of the dir where this module is */
42 int (*open)(Evas_Module *);
43 void (*close)(Evas_Module *);
45 void *functions; /* this are the functions exported by the module */
46 void *data; /* some internal data for the module i.e the id for engines */
48 Evas_Module_Type type; /* the type detected by the path */
50 int ref; /* how many refs */
51 int last_used; /* the cycle count when it was last used */
53 unsigned char loaded : 1;
57 /* the internals of the module api use this struct to reference a path with a module type
58 * instead of deduce the type from the path.
60 struct _Evas_Module_Path
62 Evas_Module_Type type;
66 struct _Evas_Module_Engine
71 void evas_module_paths_init (void);
72 void evas_module_init (void);
73 Evas_Module *evas_module_find_type (Evas_Module_Type type, const char *name);
74 int evas_module_load (Evas_Module *em);
75 void evas_module_unload (Evas_Module *em);
76 void evas_module_ref (Evas_Module *em);
77 void evas_module_unref (Evas_Module *em);
78 void evas_module_use (Evas_Module *em);
79 void evas_module_clean (void);
80 void evas_module_shutdown (void);
83 #endif /* _EVAS_MODULE_H */