2012-05-03 14:01:31 -07:00
|
|
|
#ifndef EVAS_CS2_PRIVATE_H
|
|
|
|
#define EVAS_CS2_PRIVATE_H 1
|
|
|
|
|
2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2013-07-28 21:08:36 -07:00
|
|
|
#include "evas_cs2.h"
|
2012-05-03 14:01:31 -07:00
|
|
|
|
2013-07-28 23:41:23 -07:00
|
|
|
typedef struct _Data_Entry Data_Entry;
|
|
|
|
typedef struct _Font_Entry Font_Entry;
|
|
|
|
typedef struct _Index_Table Index_Table;
|
|
|
|
typedef struct _Shared_Index Shared_Index;
|
|
|
|
|
2012-05-03 14:01:31 -07:00
|
|
|
struct _Data_Entry {
|
|
|
|
unsigned int image_id;
|
|
|
|
void (*preloaded_cb)(void *, Eina_Bool);
|
|
|
|
struct {
|
|
|
|
const char *path;
|
|
|
|
int mmap_offset;
|
|
|
|
int use_offset;
|
|
|
|
int mmap_size;
|
|
|
|
int image_size;
|
2012-05-11 13:12:56 -07:00
|
|
|
Eina_File *f;
|
2012-05-03 14:01:31 -07:00
|
|
|
void *data;
|
|
|
|
} shm;
|
|
|
|
};
|
|
|
|
|
2013-07-28 23:41:23 -07:00
|
|
|
struct _Shared_Index {
|
|
|
|
char path[64];
|
2013-07-31 03:31:50 -07:00
|
|
|
int generation_id;
|
2013-07-28 23:41:23 -07:00
|
|
|
Eina_File *f;
|
|
|
|
union
|
|
|
|
{
|
2013-07-31 03:31:50 -07:00
|
|
|
const Shared_Array_Header *header;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
union
|
|
|
|
{
|
|
|
|
const char *p; // Random access
|
2013-07-28 23:41:23 -07:00
|
|
|
const Index_Entry *index; // TODO for strings
|
|
|
|
const Image_Data *idata;
|
|
|
|
const File_Data *fdata;
|
|
|
|
// TODO Fonts
|
|
|
|
} entries;
|
|
|
|
int count;
|
|
|
|
Eina_Hash *entries_by_hkey;
|
|
|
|
int last_entry_in_hash;
|
|
|
|
};
|
|
|
|
|
2013-07-28 21:08:36 -07:00
|
|
|
struct _Index_Table {
|
2013-07-31 03:31:50 -07:00
|
|
|
int generation_id;
|
2013-07-28 23:41:23 -07:00
|
|
|
// TODO: use Shared_Index
|
2013-07-28 21:08:36 -07:00
|
|
|
struct {
|
2013-07-28 23:41:23 -07:00
|
|
|
char index_path[64];
|
|
|
|
char entries_path[64];
|
|
|
|
Eina_File *index_file;
|
|
|
|
Eina_File *entries_file;
|
|
|
|
const Shared_Array_Header *index_header;
|
|
|
|
const Index_Entry *indexes;
|
|
|
|
const char *data;
|
|
|
|
size_t entries_size;
|
|
|
|
} strings;
|
|
|
|
Shared_Index files;
|
|
|
|
Shared_Index images;
|
|
|
|
Shared_Index fonts; // TODO
|
2013-07-28 21:08:36 -07:00
|
|
|
};
|
|
|
|
|
2012-05-03 14:01:31 -07:00
|
|
|
int evas_cserve2_init(void);
|
|
|
|
int evas_cserve2_shutdown(void);
|
|
|
|
EAPI int evas_cserve2_use_get(void);
|
2013-07-02 23:49:59 -07:00
|
|
|
Eina_Bool evas_cserve2_image_load(Image_Entry *ie);
|
2012-05-03 14:01:31 -07:00
|
|
|
int evas_cserve2_image_load_wait(Image_Entry *ie);
|
|
|
|
Eina_Bool evas_cserve2_image_data_load(Image_Entry *ie);
|
2013-06-04 03:40:36 -07:00
|
|
|
int evas_cserve2_image_load_data_wait(Image_Entry *ie);
|
2012-05-03 14:01:31 -07:00
|
|
|
void evas_cserve2_image_free(Image_Entry *ie);
|
|
|
|
void evas_cserve2_image_unload(Image_Entry *ie);
|
|
|
|
Eina_Bool evas_cserve2_image_preload(Image_Entry *ie, void (*preloaded_cb)(void *im, Eina_Bool success));
|
|
|
|
void evas_cserve2_dispatch(void);
|
|
|
|
|
|
|
|
void *evas_cserve2_image_data_get(Image_Entry *ie);
|
2012-06-22 13:31:31 -07:00
|
|
|
|
|
|
|
Font_Entry *evas_cserve2_font_load(const char *source, const char *name, int size, int dpi, Font_Rend_Flags wanted_rend);
|
2013-01-09 13:37:34 -08:00
|
|
|
EAPI int evas_cserve2_font_load_wait(Font_Entry *fe);
|
2012-06-22 13:31:31 -07:00
|
|
|
void evas_cserve2_font_free(Font_Entry *fe);
|
|
|
|
Eina_Bool evas_cserve2_font_glyph_request(Font_Entry *fe, unsigned int idx, Font_Hint_Flags hints);
|
2013-06-04 03:40:36 -07:00
|
|
|
Eina_Bool evas_cserve2_font_glyph_used(Font_Entry *fe, unsigned int idx, Font_Hint_Flags hints) EINA_WARN_UNUSED_RESULT;
|
2012-06-22 13:31:31 -07:00
|
|
|
RGBA_Font_Glyph_Out *evas_cserve2_font_glyph_bitmap_get(Font_Entry *fe, unsigned int idx, Font_Hint_Flags hints);
|
2012-05-03 14:01:31 -07:00
|
|
|
#endif
|