Revert "Evas GL Bug Fix: Fixed int variables that were assumed to be 0 instead"
[framework/uifw/evas.git] / src / lib / cserve2 / evas_cs2.h
1 #ifndef EVAS_CS2_H
2 #define EVAS_CS2_H 1
3
4 #include <Eina.h>
5
6 #ifdef EVAS_CSERVE2
7
8 typedef enum {
9    CSERVE2_OPEN = 1,
10    CSERVE2_OPENED,
11    CSERVE2_SETOPTS,
12    CSERVE2_SETOPTSED,
13    CSERVE2_LOAD,
14    CSERVE2_LOADED,
15    CSERVE2_PRELOAD,
16    CSERVE2_PRELOADED,
17    CSERVE2_UNLOAD,
18    CSERVE2_CLOSE,
19    CSERVE2_FONT_LOAD,
20    CSERVE2_FONT_LOADED,
21    CSERVE2_FONT_UNLOAD,
22    CSERVE2_FONT_GLYPHS_LOAD,
23    CSERVE2_FONT_GLYPHS_LOADED,
24    CSERVE2_FONT_GLYPHS_USED,
25    CSERVE2_ERROR
26 } Message_Type;
27
28 typedef enum {
29    CSERVE2_NONE,
30    CSERVE2_GENERIC,
31    CSERVE2_DOES_NOT_EXIST,
32    CSERVE2_PERMISSION_DENIED,
33    CSERVE2_RESOURCE_ALLOCATION_FAILED,
34    CSERVE2_CORRUPT_FILE,
35    CSERVE2_UNKNOWN_FORMAT,
36    CSERVE2_INVALID_COMMAND,
37    CSERVE2_LOADER_DIED,
38    CSERVE2_LOADER_EXEC_ERR,
39    CSERVE2_INVALID_CACHE, // invalid cserve cache entry
40    CSERVE2_FILE_CHANGED,
41    CSERVE2_REQUEST_CANCEL
42 } Error_Type;
43
44 struct _Msg_Base {
45    int type;
46    unsigned int rid;
47 };
48
49 typedef struct _Msg_Base Msg_Base;
50
51 struct _Msg_Open {
52    Msg_Base base;
53    unsigned int file_id;
54    int path_offset;
55    int key_offset;
56 };
57
58 struct _Msg_Opened {
59    Msg_Base base;
60    struct {
61       int w, h;
62       int frame_count;
63       int loop_count;
64       int loop_hint; /* include Evas.h? Copy the enum around? */
65       Eina_Bool alpha : 1;
66    } image;
67 };
68
69 struct _Msg_Setopts {
70    Msg_Base base;
71    unsigned int file_id;
72    unsigned int image_id;
73    struct {
74       double dpi;
75       int w, h;
76       int scale_down;
77       int rx, ry, rw, rh;
78       Eina_Bool orientation;
79    } opts;
80 };
81
82 struct _Msg_Setoptsed {
83    Msg_Base base;
84 };
85
86 struct _Msg_Load {
87    Msg_Base base;
88    unsigned int image_id;
89 };
90
91 struct _Msg_Loaded {
92    Msg_Base base;
93    struct {
94       int mmap_offset;
95       int use_offset;
96       int mmap_size;
97       int image_size;
98    } shm;
99    Eina_Bool alpha_sparse : 1;
100 };
101
102 struct _Msg_Preload {
103    Msg_Base base;
104    unsigned int image_id;
105 };
106
107 struct _Msg_Preloaded {
108    Msg_Base base;
109 };
110
111 struct _Msg_Unload {
112    Msg_Base base;
113    unsigned int image_id;
114 };
115
116 struct _Msg_Close {
117    Msg_Base base;
118    unsigned int file_id;
119 };
120
121 /**
122  * @struct _Msg_Font_Load
123  *
124  * Message from client to request load or unload of a font.
125  *
126  * The path strings follow the struct inside the message.
127  */
128 struct _Msg_Font_Load {
129    Msg_Base base;
130    unsigned int pathlen; // font id
131    unsigned int rend_flags; // font id
132    unsigned int hint; // font id
133    unsigned int size; // font id
134    unsigned int dpi; // font id
135 };
136
137 /**
138  * @struct _Msg_Font_Loaded
139  *
140  * Message from server to inform that a font was loaded.
141  */
142 struct _Msg_Font_Loaded {
143    Msg_Base base;
144 };
145
146 /**
147  * @struct _Msg_Font_Glyphs_Request
148  *
149  * Message from client to request load of glyphs, of inform usage of them.
150  *
151  * The path strings follow the struct inside the message, as well as
152  * the list of glyphs to be loaded.
153  */
154 struct _Msg_Font_Glyphs_Request {
155    Msg_Base base;
156    unsigned int pathlen; // font id
157    unsigned int rend_flags; // font id
158    unsigned int hint; // font id
159    unsigned int size; // font id
160    unsigned int dpi; // font id
161    unsigned int nglyphs;
162 };
163
164 /**
165  * @struct _Msg_Font_Glyphs_Loaded
166  *
167  * Message from server to inform that some glyphs were loaded.
168  *
169  * This message is quite complex: it contains the font id, representing for
170  * which font these glyphs should be loaded, and the number of caches on which
171  * the loaded glyphs are stored. Each cache is a SHM segment. The information
172  * about each SHM comes serialized just after this struct, and can be read in
173  * order as follows:
174  *
175  * shm name:
176  *  - unsigned int size;
177  *  - char name[];
178  * glyphs:
179  *  - unsigned int nglyphs;
180  *  - struct {
181  *      unsigned int index;
182  *      unsigned int offset;
183  *    } glarray[];
184  */
185 struct _Msg_Font_Glyphs_Loaded {
186    Msg_Base base;
187    unsigned int ncaches;
188 };
189
190 struct _Msg_Error {
191    Msg_Base base;
192    int error;
193 };
194
195 typedef struct _Msg_Open Msg_Open;
196 typedef struct _Msg_Opened Msg_Opened;
197 typedef struct _Msg_Setopts Msg_Setopts;
198 typedef struct _Msg_Setoptsed Msg_Setoptsed;
199 typedef struct _Msg_Load Msg_Load;
200 typedef struct _Msg_Loaded Msg_Loaded;
201 typedef struct _Msg_Preload Msg_Preload;
202 typedef struct _Msg_Preloaded Msg_Preloaded;
203 typedef struct _Msg_Unload Msg_Unload;
204 typedef struct _Msg_Close Msg_Close;
205 typedef struct _Msg_Font_Load Msg_Font_Load;
206 typedef struct _Msg_Font_Loaded Msg_Font_Loaded;
207 typedef struct _Msg_Font_Glyphs_Request Msg_Font_Glyphs_Request;
208 typedef struct _Msg_Font_Glyphs_Loaded Msg_Font_Glyphs_Loaded;
209 typedef struct _Msg_Error Msg_Error;
210
211 #endif
212 #endif