diff options
author | Cedric Bail <cedric.bail@samsung.com> | 2013-10-01 16:38:01 +0900 |
---|---|---|
committer | Cedric Bail <cedric.bail@samsung.com> | 2013-10-01 16:38:44 +0900 |
commit | 83eaf14f32e3fb804b97906af6e0af70303bf24b (patch) | |
tree | 160a2c7d50249a7a9a7495c2a18cb2410e64c54c /src/lib/evas/file/evas_module.h | |
parent | bb84a01f7ce9d04b8d9ea9e14f8480f44b8449e1 (diff) |
evas: make Evas_Loader.h a real public API.
Diffstat (limited to '')
-rw-r--r-- | src/lib/evas/file/evas_module.h | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/lib/evas/file/evas_module.h b/src/lib/evas/file/evas_module.h index 8699b6bcb6..c3ea5331ff 100644 --- a/src/lib/evas/file/evas_module.h +++ b/src/lib/evas/file/evas_module.h | |||
@@ -1,58 +1,6 @@ | |||
1 | #ifndef _EVAS_MODULE_H | 1 | #ifndef _EVAS_MODULE_H |
2 | #define _EVAS_MODULE_H | 2 | #define _EVAS_MODULE_H |
3 | 3 | ||
4 | |||
5 | /* the module api version */ | ||
6 | #define EVAS_MODULE_API_VERSION 2 | ||
7 | |||
8 | |||
9 | /* the module types */ | ||
10 | typedef enum _Evas_Module_Type | ||
11 | { | ||
12 | EVAS_MODULE_TYPE_ENGINE = 0, | ||
13 | EVAS_MODULE_TYPE_IMAGE_LOADER = 1, | ||
14 | EVAS_MODULE_TYPE_IMAGE_SAVER = 2, | ||
15 | EVAS_MODULE_TYPE_OBJECT = 3 | ||
16 | } Evas_Module_Type; | ||
17 | |||
18 | |||
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; | ||
23 | typedef struct _Evas_Module_Public Evas_Module_Public; | ||
24 | |||
25 | /* the module api structure, all modules should define this struct */ | ||
26 | struct _Evas_Module_Api | ||
27 | { | ||
28 | int version; | ||
29 | const char *name; | ||
30 | const char *author; | ||
31 | |||
32 | struct | ||
33 | { | ||
34 | int (*open)(Evas_Module *); | ||
35 | void (*close)(Evas_Module *); | ||
36 | } func; | ||
37 | }; | ||
38 | |||
39 | /* the module structure */ | ||
40 | struct _Evas_Module | ||
41 | { | ||
42 | const Evas_Module_Api *definition; | ||
43 | |||
44 | void *functions; /* this are the functions exported by the module */ | ||
45 | int id_engine; /* some internal data for the module i.e the id for engines */ | ||
46 | |||
47 | int ref; /* how many refs */ | ||
48 | int last_used; /* the cycle count when it was last used */ | ||
49 | |||
50 | LK(lock); | ||
51 | |||
52 | unsigned char loaded : 1; | ||
53 | }; | ||
54 | |||
55 | |||
56 | /* the internals of the module api use this struct to reference a path with a module type | 4 | /* the internals of the module api use this struct to reference a path with a module type |
57 | * instead of deduce the type from the path. | 5 | * instead of deduce the type from the path. |
58 | * */ | 6 | * */ |
@@ -74,21 +22,5 @@ void evas_module_unref (Evas_Module *em); | |||
74 | void evas_module_use (Evas_Module *em); | 22 | void evas_module_use (Evas_Module *em); |
75 | void evas_module_clean (void); | 23 | void evas_module_clean (void); |
76 | void evas_module_shutdown (void); | 24 | void evas_module_shutdown (void); |
77 | EAPI Eina_Bool evas_module_register (const Evas_Module_Api *module, Evas_Module_Type type); | ||
78 | EAPI Eina_Bool evas_module_unregister (const Evas_Module_Api *module, Evas_Module_Type type); | ||
79 | |||
80 | #define EVAS_MODULE_DEFINE(Type, Tn, Name) \ | ||
81 | Eina_Bool evas_##Tn##_##Name##_init(void) \ | ||
82 | { \ | ||
83 | return evas_module_register(&evas_modapi, Type); \ | ||
84 | } \ | ||
85 | void evas_##Tn##_##Name##_shutdown(void) \ | ||
86 | { \ | ||
87 | evas_module_unregister(&evas_modapi, Type); \ | ||
88 | } | ||
89 | |||
90 | #define EVAS_EINA_MODULE_DEFINE(Tn, Name) \ | ||
91 | EINA_MODULE_INIT(evas_##Tn##_##Name##_init); \ | ||
92 | EINA_MODULE_SHUTDOWN(evas_##Tn##_##Name##_shutdown); | ||
93 | 25 | ||
94 | #endif /* _EVAS_MODULE_H */ | 26 | #endif /* _EVAS_MODULE_H */ |