summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-07-29 13:08:36 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:13 +0900
commit47be3a2b819ed6319a65018195b31b622b547aab (patch)
treeda38402d574af89bfe4ce36667598cb8a260d108 /src/lib/evas/cserve2/evas_cs2.h
parentc0bb73c775787ae1221efacc8d5d7a01a28320af (diff)
evas/cserve2: Prepare shared indexes in clients
- Move required struct definitions to common evas_cs2.h - Open/close shm and map arrays to memory Pretty stupid for now as it will close & reopen the shm files even when unchanged. - Check shm size and array header consistency - Implement message send - Send messages from server when calling repack()
Diffstat (limited to 'src/lib/evas/cserve2/evas_cs2.h')
-rw-r--r--src/lib/evas/cserve2/evas_cs2.h68
1 files changed, 67 insertions, 1 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2.h b/src/lib/evas/cserve2/evas_cs2.h
index ad36b4e7fe..d47a02aac9 100644
--- a/src/lib/evas/cserve2/evas_cs2.h
+++ b/src/lib/evas/cserve2/evas_cs2.h
@@ -23,6 +23,7 @@ typedef enum {
23 CSERVE2_FONT_GLYPHS_USED, 23 CSERVE2_FONT_GLYPHS_USED,
24 CSERVE2_STATS, 24 CSERVE2_STATS,
25 CSERVE2_FONT_DEBUG, 25 CSERVE2_FONT_DEBUG,
26 CSERVE2_INDEX_LIST,
26 CSERVE2_ERROR 27 CSERVE2_ERROR
27} Message_Type; 28} Message_Type;
28 29
@@ -224,7 +225,7 @@ struct _Msg_Stats {
224 } images; 225 } images;
225}; 226};
226 227
227/* 228/**
228 * @struct _Msg_Font_Debug 229 * @struct _Msg_Font_Debug
229 * 230 *
230 * Message from server containing all font cache info. 231 * Message from server containing all font cache info.
@@ -262,6 +263,70 @@ struct _Msg_Font_Debug {
262 Msg_Base base; 263 Msg_Base base;
263}; 264};
264 265
266/**
267 * @brief The Msg_Index_List struct
268 *
269 * Message sent from the server, without request from the client,
270 * to inform all clients of the shared index files. Contains the paths
271 * to the latest File, Image and Font index shm.
272 *
273 * The paths contain only the filename used in the call to shm_open.
274 * All strings must be null-terminated.
275 */
276struct _Msg_Index_List {
277 Msg_Base base;
278 char files_index_path[64];
279 char images_index_path[64];
280 char fonts_index_path[64];
281};
282
283typedef struct _Shm_Object Shm_Object;
284typedef struct _File_Data File_Data;
285typedef struct _Image_Data Image_Data;
286typedef struct _Shared_Array_Header Shared_Array_Header;
287typedef int string_t;
288#define SHMOBJECT unsigned int id; unsigned int refcount
289
290struct _Shared_Array_Header
291{
292 int32_t tag;
293 int32_t elemsize;
294 int32_t count;
295 int32_t generation_id;
296 int32_t emptyidx;
297 int32_t sortedidx;
298 int32_t _reserved1;
299 int32_t _reserved2;
300};
301
302struct _Shm_Object
303{
304 SHMOBJECT;
305};
306
307struct _File_Data {
308 SHMOBJECT;
309 string_t path;
310 string_t key;
311 string_t loader_data;
312 int w, h;
313 int frame_count;
314 int loop_count;
315 int loop_hint;
316 Eina_Bool alpha : 1;
317 Eina_Bool invalid : 1;
318};
319
320struct _Image_Data {
321 SHMOBJECT;
322 unsigned int file_id;
323 string_t shm_id;
324 Evas_Image_Load_Opts opts;
325 Eina_Bool alpha_sparse : 1;
326 Eina_Bool unused : 1;
327 Eina_Bool doload : 1;
328};
329
265struct _Msg_Error { 330struct _Msg_Error {
266 Msg_Base base; 331 Msg_Base base;
267 int error; 332 int error;
@@ -282,6 +347,7 @@ typedef struct _Msg_Font_Glyphs_Loaded Msg_Font_Glyphs_Loaded;
282typedef struct _Msg_Stats Msg_Stats; 347typedef struct _Msg_Stats Msg_Stats;
283typedef struct _Msg_Font_Debug Msg_Font_Debug; 348typedef struct _Msg_Font_Debug Msg_Font_Debug;
284typedef struct _Msg_Error Msg_Error; 349typedef struct _Msg_Error Msg_Error;
350typedef struct _Msg_Index_List Msg_Index_List;
285 351
286#endif 352#endif
287#endif 353#endif