summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2.h
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
commitc15e9c6575c3b5f39ded167dda5259de3de96151 (patch)
tree5115d7ae3620af24c2bc094cd062575af7adeda9 /src/lib/evas/cserve2/evas_cs2.h
parenta5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff)
merge: and now Evas
I've tested make -j 3 install and it works nicely I've tested expedite with software and opengl xlib, and it works. Not tested other engines, so please report any problems (engines or other) on the ML. TODO: examples and tests, I'll add them later ISSUE: Eina_Unicode size check. It indirectly depends on eina_config.h, which is created at the end of the configure script. So its size is always 0. I don't know how that size is used, so I can't do a lot, for now. SVN revision: 78895
Diffstat (limited to 'src/lib/evas/cserve2/evas_cs2.h')
-rw-r--r--src/lib/evas/cserve2/evas_cs2.h298
1 files changed, 298 insertions, 0 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2.h b/src/lib/evas/cserve2/evas_cs2.h
new file mode 100644
index 0000000000..fc83a9276d
--- /dev/null
+++ b/src/lib/evas/cserve2/evas_cs2.h
@@ -0,0 +1,298 @@
1#ifndef EVAS_CS2_H
2#define EVAS_CS2_H 1
3
4#include <Eina.h>
5
6#ifdef EVAS_CSERVE2
7
8typedef 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_UNLOAD,
17 CSERVE2_CLOSE,
18 CSERVE2_FONT_LOAD,
19 CSERVE2_FONT_LOADED,
20 CSERVE2_FONT_UNLOAD,
21 CSERVE2_FONT_GLYPHS_LOAD,
22 CSERVE2_FONT_GLYPHS_LOADED,
23 CSERVE2_FONT_GLYPHS_USED,
24 CSERVE2_STATS,
25 CSERVE2_FONT_DEBUG,
26 CSERVE2_ERROR
27} Message_Type;
28
29typedef enum {
30 CSERVE2_NONE,
31 CSERVE2_GENERIC,
32 CSERVE2_DOES_NOT_EXIST,
33 CSERVE2_PERMISSION_DENIED,
34 CSERVE2_RESOURCE_ALLOCATION_FAILED,
35 CSERVE2_CORRUPT_FILE,
36 CSERVE2_UNKNOWN_FORMAT,
37 CSERVE2_INVALID_COMMAND,
38 CSERVE2_LOADER_DIED,
39 CSERVE2_LOADER_EXEC_ERR,
40 CSERVE2_INVALID_CACHE, // invalid cserve cache entry
41 CSERVE2_FILE_CHANGED,
42 CSERVE2_REQUEST_CANCEL
43} Error_Type;
44
45struct _Msg_Base {
46 int type;
47 unsigned int rid;
48};
49
50typedef struct _Msg_Base Msg_Base;
51
52struct _Msg_Open {
53 Msg_Base base;
54 unsigned int file_id;
55 int path_offset;
56 int key_offset;
57};
58
59struct _Msg_Opened {
60 Msg_Base base;
61 struct {
62 int w, h;
63 int frame_count;
64 int loop_count;
65 int loop_hint; /* include Evas.h? Copy the enum around? */
66 Eina_Bool alpha : 1;
67 } image;
68};
69
70struct _Msg_Setopts {
71 Msg_Base base;
72 unsigned int file_id;
73 unsigned int image_id;
74 struct {
75 double dpi;
76 int w, h;
77 int scale_down;
78 int rx, ry, rw, rh;
79 Eina_Bool orientation;
80 } opts;
81};
82
83struct _Msg_Setoptsed {
84 Msg_Base base;
85};
86
87struct _Msg_Load {
88 Msg_Base base;
89 unsigned int image_id;
90};
91
92struct _Msg_Loaded {
93 Msg_Base base;
94 struct {
95 int mmap_offset;
96 int use_offset;
97 int mmap_size;
98 int image_size;
99 } shm;
100 Eina_Bool alpha_sparse : 1;
101};
102
103struct _Msg_Preload {
104 Msg_Base base;
105 unsigned int image_id;
106};
107
108struct _Msg_Preloaded {
109 Msg_Base base;
110};
111
112struct _Msg_Unload {
113 Msg_Base base;
114 unsigned int image_id;
115};
116
117struct _Msg_Close {
118 Msg_Base base;
119 unsigned int file_id;
120};
121
122/**
123 * @struct _Msg_Font_Load
124 *
125 * Message from client to request load or unload of a font.
126 *
127 * The path strings follow the struct inside the message.
128 */
129struct _Msg_Font_Load {
130 Msg_Base base;
131 unsigned int sourcelen; // font id
132 unsigned int pathlen; // font id
133 unsigned int rend_flags; // font id
134 unsigned int size; // font id
135 unsigned int dpi; // font id
136};
137
138/**
139 * @struct _Msg_Font_Loaded
140 *
141 * Message from server to inform that a font was loaded.
142 */
143struct _Msg_Font_Loaded {
144 Msg_Base base;
145};
146
147/**
148 * @struct _Msg_Font_Glyphs_Request
149 *
150 * Message from client to request load of glyphs, or inform usage of them.
151 *
152 * The path strings follow the struct inside the message, as well as
153 * the list of glyphs to be loaded.
154 */
155struct _Msg_Font_Glyphs_Request {
156 Msg_Base base;
157 unsigned int sourcelen; // font id
158 unsigned int pathlen; // font id
159 unsigned int rend_flags; // font id
160 unsigned int size; // font id
161 unsigned int dpi; // font id
162 unsigned int hint;
163 unsigned int nglyphs;
164};
165
166/**
167 * @struct _Msg_Font_Glyphs_Loaded
168 *
169 * Message from server to inform that some glyphs were loaded.
170 *
171 * This message is quite complex: it contains the font id, representing for
172 * which font these glyphs should be loaded, and the number of caches on which
173 * the loaded glyphs are stored. Each cache is a SHM segment. The information
174 * about each SHM comes serialized just after this struct, and can be read in
175 * order as follows:
176 *
177 * shm name:
178 * - unsigned int size;
179 * - char name[];
180 * glyphs:
181 * - unsigned int nglyphs;
182 * - struct {
183 * unsigned int index;
184 * unsigned int offset;
185 * unsigned int size;
186 * unsigned int rows;
187 * unsigned int width;
188 * unsigned int pitch;
189 * unsigned int num_grays;
190 * unsigned int pixel_mode;
191 * } glarray[];
192 */
193struct _Msg_Font_Glyphs_Loaded {
194 Msg_Base base;
195 unsigned int ncaches;
196};
197
198struct _Msg_Stats {
199 Msg_Base base;
200 struct {
201 unsigned int requested_size;
202 unsigned int real_size;
203 unsigned int unused_size;
204 unsigned int fonts_loaded; /* number of loaded fonts */
205 unsigned int fonts_unused; /* number of loaded fonts without reference
206 * from any clients */
207 int fonts_load_time; /* total time spent loading fonts */
208 int fonts_used_load_time; /* total time spent loading fonts that are
209 * really used, i.e. fonts that have glyphs
210 * rendered */
211 int fonts_used_saved_time;
212 int glyphs_request_time; /* time spent waiting for glyph requests */
213 int glyphs_load_time; /* total time spent loading glyphs */
214 int glyphs_render_time; /* total time spent rendering glyphs */
215 int glyphs_slave_time; /* total time spent on the slave processing glyph load requests */
216 int glyphs_saved_time; /* total time spent loading glyphs */
217 } fonts;
218 struct {
219 unsigned int files_loaded; /* number of file headers loaded */
220 unsigned int images_loaded; /* number of image data loaded */
221 unsigned int images_unused; /* number of image data loaded and unused */
222
223 unsigned int requested_size; /* memory usage originally requested by
224 * the client */
225 unsigned int files_size; /* memory usage from image headers */
226 unsigned int images_size; /* memory usage from image data */
227 unsigned int unused_size; /* memory usage from image data */
228
229 int files_load_time;
230 int files_saved_time;
231 int images_load_time;
232 int images_saved_time;
233 } images;
234};
235
236/*
237 * @struct _Msg_Font_Debug
238 *
239 * Message from server containing all font cache info.
240 *
241 * Content of the message follows:
242 *
243 * * number of font entries;
244 * * each font entry:
245 * - unsigned int filelen
246 * - const char file
247 * - unsigned int namelen
248 * - const char name
249 * - unsigned int rend_flags;
250 * - unsigned int size;
251 * - unsigned int dpi;
252 * - unsigned int unused;
253 * - ncaches:
254 * - each cache:
255 * * usigned int shmnamelen;
256 * * const char shmname;
257 * * unsigned int size;
258 * * unsigned int usage;
259 * * unsigned int nglyphs;
260 * * each glyph:
261 * - unsigned int index;
262 * - unsigned int offset;
263 * - unsigned int size;
264 * - unsigned int rows;
265 * - unsigned int width;
266 * - unsigned int pitch;
267 * - unsigned int num_grays;
268 * - unsigned int pixel_mode;
269 */
270struct _Msg_Font_Debug {
271 Msg_Base base;
272};
273
274struct _Msg_Error {
275 Msg_Base base;
276 int error;
277};
278
279typedef struct _Msg_Open Msg_Open;
280typedef struct _Msg_Opened Msg_Opened;
281typedef struct _Msg_Setopts Msg_Setopts;
282typedef struct _Msg_Setoptsed Msg_Setoptsed;
283typedef struct _Msg_Load Msg_Load;
284typedef struct _Msg_Loaded Msg_Loaded;
285typedef struct _Msg_Preload Msg_Preload;
286typedef struct _Msg_Preloaded Msg_Preloaded;
287typedef struct _Msg_Unload Msg_Unload;
288typedef struct _Msg_Close Msg_Close;
289typedef struct _Msg_Font_Load Msg_Font_Load;
290typedef struct _Msg_Font_Loaded Msg_Font_Loaded;
291typedef struct _Msg_Font_Glyphs_Request Msg_Font_Glyphs_Request;
292typedef struct _Msg_Font_Glyphs_Loaded Msg_Font_Glyphs_Loaded;
293typedef struct _Msg_Stats Msg_Stats;
294typedef struct _Msg_Font_Debug Msg_Font_Debug;
295typedef struct _Msg_Error Msg_Error;
296
297#endif
298#endif