forked from enlightenment/efl
emile: make emile optional
This commit is contained in:
parent
dd7fd87acc
commit
e92f822fc8
10
meson.build
10
meson.build
|
@ -311,8 +311,8 @@ subprojects = [
|
|||
['eolian' ,[] , false, true, true, false, true, false, false, ['eina'], []],
|
||||
['eo' ,[] , false, true, false, true, true, false, true, ['eina'], []],
|
||||
['efl' ,[] , false, true, false, false, true, false, true, ['eo'], []],
|
||||
['emile' ,[] , false, true, false, false, true, true, true, ['eina', 'efl'], ['lz4', 'rg_etc']],
|
||||
['eet' ,[] , false, true, true, false, true, true, true, ['eina', 'emile', 'efl'], []],
|
||||
['emile' ,['emile'] , false, true, false, false, true, true, true, ['eina', 'efl'], ['lz4', 'rg_etc']],
|
||||
['eet' ,[] , false, true, true, false, true, true, true, ['eina', 'efl'], ['rg_etc']],
|
||||
['ecore' ,[] , false, true, false, false, false, false, true, ['eina', 'eo', 'efl'], ['buildsystem']],
|
||||
['eldbus' ,[] , false, true, true, false, true, true, true, ['eina', 'eo', 'efl'], []],
|
||||
['ecore' ,[] , true, false, false, false, true, true, true, ['eina', 'eo', 'efl'], []], #ecores modules depend on eldbus
|
||||
|
@ -355,6 +355,10 @@ subprojects = [
|
|||
['exactness' ,[] , false, false, true, false, false, false, false, ['eina, evas, eet'], []],
|
||||
]
|
||||
|
||||
if not get_option('emile')
|
||||
config_h.set('EMILE_HEADER_ONLY', 1)
|
||||
endif
|
||||
|
||||
# We generate Efl_Config.h and config.h later, they will be available here
|
||||
config_dir += include_directories('.')
|
||||
|
||||
|
@ -365,6 +369,7 @@ subdir(join_paths(local_module, 'eina'))
|
|||
# List of dependency objects that might be disabled due to configurations
|
||||
# If they are enabled, the object gets overwritten by the library file.
|
||||
ecore_audio = declare_dependency()
|
||||
emile = declare_dependency(include_directories : include_directories('src/lib/emile'))
|
||||
|
||||
test_dirs = []
|
||||
example_dirs = []
|
||||
|
@ -374,6 +379,7 @@ efl_one_eo_deps = []
|
|||
efl_one_include_dirs = []
|
||||
efl_one_sub_dirs = []
|
||||
tmp_empty = declare_dependency()
|
||||
lz4 = tmp_empty
|
||||
|
||||
efl_config_h = configuration_data()
|
||||
|
||||
|
|
|
@ -112,6 +112,12 @@ option('efreet',
|
|||
description : 'Enable efreet library',
|
||||
)
|
||||
|
||||
option('emile',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
description : 'Enable Emile'
|
||||
)
|
||||
|
||||
option('crypto',
|
||||
type : 'combo',
|
||||
choices : ['gnutls', 'openssl'],
|
||||
|
|
|
@ -116,7 +116,9 @@ struct _Script_Lua_Writer
|
|||
typedef struct _Script_Write Script_Write;
|
||||
typedef struct _Head_Write Head_Write;
|
||||
typedef struct _Fonts_Write Fonts_Write;
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
typedef struct _Image_Write Image_Write;
|
||||
#endif
|
||||
typedef struct _Sound_Write Sound_Write;
|
||||
typedef struct _Mo_Write Mo_Write;
|
||||
typedef struct _Vibration_Write Vibration_Write;
|
||||
|
@ -148,20 +150,26 @@ struct _Fonts_Write
|
|||
char *errstr;
|
||||
};
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
struct _Image_Write
|
||||
{
|
||||
Eet_File *ef;
|
||||
Edje_Image_Directory_Entry *img;
|
||||
Evas_Object *im;
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
Emile_Image_Property prop;
|
||||
#endif
|
||||
Eina_File *f;
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
Emile_Image *emi;
|
||||
#endif
|
||||
int w, h;
|
||||
int alpha;
|
||||
unsigned int *data;
|
||||
char *path;
|
||||
char *errstr;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct _Sound_Write
|
||||
{
|
||||
|
@ -242,7 +250,9 @@ static int image_num;
|
|||
static Ecore_Evas *buffer_ee;
|
||||
static int cur_image_entry;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void data_write_images(void);
|
||||
#endif
|
||||
|
||||
void
|
||||
error_and_abort(Eet_File *ef EINA_UNUSED, const char *fmt, ...)
|
||||
|
@ -268,7 +278,11 @@ thread_end(Eina_Bool img)
|
|||
if (threads)
|
||||
{
|
||||
if ((pending_image_threads + pending_threads) < (int)max_open_files - 2)
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
data_write_images();
|
||||
#else
|
||||
{}
|
||||
#endif
|
||||
}
|
||||
if (pending_threads + pending_image_threads <= 0) ecore_main_loop_quit();
|
||||
}
|
||||
|
@ -1080,6 +1094,7 @@ show_err:
|
|||
file, file_out, errmsg, hint);
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
data_thread_image(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||
{
|
||||
|
@ -1215,7 +1230,9 @@ data_thread_image(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
data_thread_image_end(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||
{
|
||||
|
@ -1231,7 +1248,9 @@ data_thread_image_end(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
free(iw);
|
||||
thread_end(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
data_image_preload_done(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -1248,7 +1267,9 @@ data_image_preload_done(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *e
|
|||
data_thread_image_end(iw, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
tgv_file_thread(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||
{
|
||||
|
@ -1261,7 +1282,9 @@ tgv_file_thread(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
len = eina_file_size_get(iw->f);
|
||||
eet_write_cipher(iw->ef, buf, iw->data, len, EINA_FALSE /*!no_comp*/, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
tgv_file_thread_end(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||
{
|
||||
|
@ -1273,13 +1296,17 @@ tgv_file_thread_end(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
free(iw->errstr);
|
||||
}
|
||||
free(iw->path);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
emile_image_close(iw->emi);
|
||||
#endif
|
||||
eina_file_map_free(iw->f, iw->data);
|
||||
eina_file_close(iw->f);
|
||||
free(iw);
|
||||
thread_end(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static Eina_Bool
|
||||
tgv_file_check_and_add(Eet_File *ef, Edje_Image_Directory_Entry *img)
|
||||
{
|
||||
|
@ -1368,6 +1395,7 @@ on_error:
|
|||
eina_file_close(f);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
data_write_vectors(Eet_File *ef, int *vector_num)
|
||||
|
@ -1475,6 +1503,7 @@ data_image_sets_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
data_write_images(void)
|
||||
{
|
||||
|
@ -1496,7 +1525,7 @@ data_write_images(void)
|
|||
Eina_List *ll;
|
||||
char *s;
|
||||
int load_err = EVAS_LOAD_ERROR_NONE;
|
||||
Image_Write *iw;
|
||||
Image_Write *iw = NULL;
|
||||
|
||||
img = &edje_file->image_dir->entries[cur_image_entry];
|
||||
if ((img->source_type >= EDJE_IMAGE_SOURCE_TYPE_USER) || !img->entry)
|
||||
|
@ -1508,6 +1537,7 @@ data_write_images(void)
|
|||
ext = strrchr(img->entry, '.');
|
||||
if (ext && !strcasecmp(ext, ".tgv"))
|
||||
{
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (tgv_file_check_and_add(cur_ef, img))
|
||||
{
|
||||
DBG("Directly copying data from TGV file into EDJ");
|
||||
|
@ -1515,13 +1545,17 @@ data_write_images(void)
|
|||
}
|
||||
else
|
||||
ERR("Source '%s' has incompatible ETC format.", img->entry);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
im = evas_object_image_add(evas);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
iw = calloc(1, sizeof(Image_Write));
|
||||
iw->ef = cur_ef;
|
||||
iw->img = img;
|
||||
iw->im = im = evas_object_image_add(evas);
|
||||
iw->im = im;
|
||||
#endif
|
||||
if (threads)
|
||||
evas_object_event_callback_add(im,
|
||||
EVAS_CALLBACK_IMAGE_PRELOADED,
|
||||
|
@ -1589,6 +1623,7 @@ data_write_images(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
data_thread_sounds(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||
|
@ -2883,7 +2918,9 @@ data_write(void)
|
|||
data_thread_authors_end(ef, NULL);
|
||||
}
|
||||
}
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
data_write_images();
|
||||
#endif
|
||||
data_image_sets_init();
|
||||
INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get();
|
||||
pending_threads--;
|
||||
|
|
|
@ -47,16 +47,20 @@ ecore_con_url_init(void)
|
|||
if (++_init_count > 1) return _init_count;
|
||||
if (!ecore_init()) goto ecore_init_failed;
|
||||
if (!ecore_con_init()) goto ecore_con_init_failed;
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_init()) goto emile_init_failed;
|
||||
if (!emile_cipher_init()) goto emile_cipher_init_failed;
|
||||
#endif
|
||||
ECORE_CON_EVENT_URL_DATA = ecore_event_type_new();
|
||||
ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new();
|
||||
ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new();
|
||||
return _init_count;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
emile_cipher_init_failed:
|
||||
emile_shutdown();
|
||||
emile_init_failed:
|
||||
#endif
|
||||
ecore_con_shutdown();
|
||||
ecore_con_init_failed:
|
||||
ecore_shutdown();
|
||||
|
@ -78,7 +82,9 @@ ecore_con_url_shutdown(void)
|
|||
ECORE_CON_EVENT_URL_COMPLETE,
|
||||
ECORE_CON_EVENT_URL_PROGRESS);
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
emile_shutdown(); /* no emile_cipher_shutdown(), handled here */
|
||||
#endif
|
||||
ecore_con_shutdown();
|
||||
ecore_shutdown();
|
||||
return 0;
|
||||
|
|
|
@ -1024,13 +1024,13 @@ static void
|
|||
_efl_net_dialer_websocket_key_add(Efl_Net_Dialer_Websocket_Data *pd)
|
||||
{
|
||||
Eina_Binbuf *binbuf_key;
|
||||
Eina_Strbuf *strbuf_key_base64;
|
||||
Eina_Strbuf *strbuf_key_base64 = NULL;
|
||||
uint8_t key[16];
|
||||
const Eina_Slice guid_slice = EINA_SLICE_STR_LITERAL("258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
|
||||
Eina_Slice ro_slice;
|
||||
Eina_Rw_Slice rw_slice;
|
||||
uint8_t sha1hash[20];
|
||||
Eina_Bool ret;
|
||||
Eina_Bool ret = EINA_FALSE;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < sizeof(key); i++)
|
||||
|
@ -1039,7 +1039,9 @@ _efl_net_dialer_websocket_key_add(Efl_Net_Dialer_Websocket_Data *pd)
|
|||
binbuf_key = eina_binbuf_manage_new(key, sizeof(key), EINA_TRUE);
|
||||
EINA_SAFETY_ON_NULL_RETURN(binbuf_key);
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
strbuf_key_base64 = emile_base64_encode(binbuf_key);
|
||||
#endif
|
||||
eina_binbuf_free(binbuf_key);
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(strbuf_key_base64);
|
||||
|
@ -1055,7 +1057,9 @@ _efl_net_dialer_websocket_key_add(Efl_Net_Dialer_Websocket_Data *pd)
|
|||
binbuf_key = eina_binbuf_manage_new(ro_slice.mem, ro_slice.len, EINA_TRUE);
|
||||
EINA_SAFETY_ON_NULL_GOTO(binbuf_key, free_strbuf);
|
||||
/* 2) sha1(base64(random(16)) + guid) */
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
ret = emile_binbuf_sha1(binbuf_key, sha1hash);
|
||||
#endif
|
||||
eina_binbuf_free(binbuf_key);
|
||||
eina_strbuf_free(strbuf_key_base64);
|
||||
|
||||
|
@ -1065,7 +1069,9 @@ _efl_net_dialer_websocket_key_add(Efl_Net_Dialer_Websocket_Data *pd)
|
|||
binbuf_key = eina_binbuf_manage_new(sha1hash, sizeof(sha1hash), EINA_TRUE);
|
||||
EINA_SAFETY_ON_NULL_RETURN(binbuf_key);
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
strbuf_key_base64 = emile_base64_encode(binbuf_key);
|
||||
#endif
|
||||
eina_binbuf_free(binbuf_key);
|
||||
EINA_SAFETY_ON_NULL_RETURN(strbuf_key_base64);
|
||||
|
||||
|
|
|
@ -273,11 +273,13 @@ _efl_net_ssl_context_efl_object_finalize(Eo *o, Efl_Net_Ssl_Context_Data *pd)
|
|||
o = efl_finalize(efl_super(o, MY_CLASS));
|
||||
if (!o) return NULL;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init())
|
||||
{
|
||||
ERR("could not initialize cipher subsystem.");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pd->is_dialer)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
ector_deps = [eina, emile, eet, eo, efl, draw]
|
||||
ector_deps = [eina, eet, eo, efl, draw]
|
||||
ector_pub_deps = [eina, efl]
|
||||
ector_ext_deps = [triangulator, freetype, draw_without_deps, m]
|
||||
|
||||
ector_deps += emile
|
||||
|
||||
pub_eo_file_target = []
|
||||
ector_opt_lib = [ ]
|
||||
|
||||
|
|
|
@ -88,7 +88,9 @@ eet_identity_open(const char *certificate_file,
|
|||
gnutls_datum_t load_file = { NULL, 0 };
|
||||
char pass[1024];
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return NULL;
|
||||
#endif
|
||||
|
||||
/* Init */
|
||||
if (!(key = malloc(sizeof(Eet_Key))))
|
||||
|
@ -188,7 +190,9 @@ on_error:
|
|||
EVP_PKEY *pkey = NULL;
|
||||
X509 *cert = NULL;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return NULL;
|
||||
#endif
|
||||
|
||||
/* Load the X509 certificate in memory. */
|
||||
{
|
||||
|
@ -243,7 +247,9 @@ on_error:
|
|||
EET_API void
|
||||
eet_identity_close(Eet_Key *key)
|
||||
{
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return ;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SIGNATURE
|
||||
if (!key || (key->references > 0))
|
||||
|
@ -287,7 +293,9 @@ eet_identity_print(Eet_Key *key,
|
|||
if (!key)
|
||||
return;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return ;
|
||||
#endif
|
||||
|
||||
if (key->private_key)
|
||||
{
|
||||
|
@ -360,7 +368,9 @@ on_error:
|
|||
if (!key)
|
||||
return;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return ;
|
||||
#endif
|
||||
|
||||
rsa = EVP_PKEY_get1_RSA(key->private_key);
|
||||
if (rsa)
|
||||
|
@ -485,7 +495,9 @@ eet_identity_sign(FILE *fp,
|
|||
if (!fp || !key || !key->certificate || !key->private_key)
|
||||
return EET_ERROR_BAD_OBJECT;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return EET_ERROR_NOT_IMPLEMENTED;
|
||||
#endif
|
||||
|
||||
/* Get the file size. */
|
||||
fd = fileno(fp);
|
||||
|
@ -665,7 +677,9 @@ eet_identity_check(const void *data_base,
|
|||
if (signature_length < sizeof(int) * 3)
|
||||
return NULL;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return NULL;
|
||||
#endif
|
||||
|
||||
/* Get the header */
|
||||
memcpy(&magic, header, sizeof(int));
|
||||
|
@ -841,7 +855,9 @@ eet_identity_certificate_print(const unsigned char *certificate,
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_cipher_init()) return ;
|
||||
#endif
|
||||
|
||||
# ifdef HAVE_GNUTLS
|
||||
gnutls_datum_t datum;
|
||||
|
@ -905,11 +921,13 @@ eet_cipher(const void *data,
|
|||
void **result,
|
||||
unsigned int *result_length)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
Eina_Binbuf *out = NULL;
|
||||
Eina_Binbuf *in;
|
||||
|
||||
in = eina_binbuf_manage_new(data, size, EINA_TRUE);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
out = emile_binbuf_cipher(EMILE_AES256_CBC, in, key, length);
|
||||
#endif
|
||||
|
||||
if (result_length) *result_length = out ? eina_binbuf_length_get(out) : 0;
|
||||
if (result) *result = out ? eina_binbuf_string_steal(out) : NULL;
|
||||
|
@ -931,7 +949,9 @@ eet_decipher(const void *data,
|
|||
Eina_Binbuf *in;
|
||||
|
||||
in = eina_binbuf_manage_new(data, size, EINA_TRUE);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
out = emile_binbuf_decipher(EMILE_AES256_CBC, in, key, length);
|
||||
#endif
|
||||
|
||||
if (result_length) *result_length = out ? eina_binbuf_length_get(out) : 0;
|
||||
if (result) *result = out ? eina_binbuf_string_steal(out) : NULL;
|
||||
|
|
|
@ -157,12 +157,16 @@ eet_jpeg_membuf_dst(j_compress_ptr cinfo,
|
|||
|
||||
/*---*/
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static int
|
||||
eet_data_image_jpeg_header_decode(const void *data,
|
||||
int size,
|
||||
unsigned int *w,
|
||||
unsigned int *h,
|
||||
const Eet_Colorspace **cspaces);
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static int
|
||||
eet_data_image_jpeg_rgb_decode(const void *data,
|
||||
int size,
|
||||
|
@ -172,6 +176,9 @@ eet_data_image_jpeg_rgb_decode(const void *data,
|
|||
unsigned int w,
|
||||
unsigned int h,
|
||||
Eet_Colorspace cspace);
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static int
|
||||
eet_data_image_jpeg_alpha_decode(const void *data,
|
||||
int size,
|
||||
|
@ -181,6 +188,8 @@ eet_data_image_jpeg_alpha_decode(const void *data,
|
|||
unsigned int w,
|
||||
unsigned int h,
|
||||
Eet_Colorspace cspace);
|
||||
#endif
|
||||
|
||||
static void *
|
||||
eet_data_image_lossless_convert(int *size,
|
||||
const void *data,
|
||||
|
@ -324,6 +333,7 @@ _eet_image_jpeg_emit_message_cb(j_common_ptr cinfo,
|
|||
*/
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static int
|
||||
eet_data_image_jpeg_header_decode(const void *data,
|
||||
int size,
|
||||
|
@ -366,7 +376,9 @@ eet_data_image_jpeg_header_decode(const void *data,
|
|||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static int
|
||||
eet_data_image_jpeg_rgb_decode(const void *data,
|
||||
int size,
|
||||
|
@ -379,7 +391,7 @@ eet_data_image_jpeg_rgb_decode(const void *data,
|
|||
{
|
||||
Emile_Image_Load_Opts opts;
|
||||
Emile_Image_Property prop;
|
||||
Emile_Image *image;
|
||||
Emile_Image *image = NULL;
|
||||
Eina_Binbuf *bin;
|
||||
Emile_Image_Load_Error error;
|
||||
int r = 0;
|
||||
|
@ -421,7 +433,9 @@ eet_data_image_jpeg_rgb_decode(const void *data,
|
|||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static int
|
||||
eet_data_image_jpeg_alpha_decode(const void *data,
|
||||
int size,
|
||||
|
@ -506,6 +520,7 @@ eet_data_image_jpeg_alpha_decode(const void *data,
|
|||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
// FIXME: Importing two functions from evas here: premul & unpremul
|
||||
static void
|
||||
|
@ -551,6 +566,7 @@ _eet_argb_unpremul(unsigned int *data, unsigned int len)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static int
|
||||
eet_data_image_etc2_decode(const void *data,
|
||||
unsigned int length,
|
||||
|
@ -648,6 +664,7 @@ eet_data_image_etc2_decode(const void *data,
|
|||
eina_binbuf_free(bin);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void *
|
||||
eet_data_image_lossless_convert(int *size,
|
||||
|
@ -693,7 +710,7 @@ eet_data_image_lossless_compressed_convert(int *size,
|
|||
|
||||
{
|
||||
Eina_Binbuf *in;
|
||||
Eina_Binbuf *out;
|
||||
Eina_Binbuf *out = NULL;
|
||||
unsigned char *result;
|
||||
int *bigend_data = NULL;
|
||||
int header[8];
|
||||
|
@ -716,7 +733,9 @@ eet_data_image_lossless_compressed_convert(int *size,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
out = emile_compress(in, eet_2_emile_compressor(compression), compression);
|
||||
#endif
|
||||
|
||||
if (!out || (eina_binbuf_length_get(out) > eina_binbuf_length_get(in)))
|
||||
{
|
||||
|
@ -1032,6 +1051,7 @@ eet_data_image_etc1_compressed_convert(int *size,
|
|||
}
|
||||
|
||||
in = eina_binbuf_manage_new(buffer, block_count * etc_block_size, EINA_TRUE);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (compress)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
|
@ -1040,6 +1060,7 @@ eet_data_image_etc1_compressed_convert(int *size,
|
|||
eina_binbuf_free(in);
|
||||
in = out;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (eina_binbuf_length_get(in) > 0)
|
||||
{
|
||||
|
@ -1745,7 +1766,7 @@ eet_data_image_header_advance_decode_cipher(const void *data,
|
|||
unsigned int iw = 0, ih = 0;
|
||||
unsigned const char *dt;
|
||||
int sz1, sz2;
|
||||
int ok;
|
||||
int ok = 0;
|
||||
|
||||
sz1 = header[1];
|
||||
sz2 = header[2];
|
||||
|
@ -1753,7 +1774,9 @@ eet_data_image_header_advance_decode_cipher(const void *data,
|
|||
goto on_error;
|
||||
dt = data;
|
||||
dt += 12;
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
ok = eet_data_image_jpeg_header_decode(dt, sz1, &iw, &ih, cspaces);
|
||||
#endif
|
||||
if (ok)
|
||||
{
|
||||
if (w)
|
||||
|
@ -1817,9 +1840,11 @@ eet_data_image_header_advance_decode_cipher(const void *data,
|
|||
else
|
||||
{
|
||||
unsigned int iw = 0, ih = 0;
|
||||
int ok;
|
||||
int ok = 0;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
ok = eet_data_image_jpeg_header_decode(data, size, &iw, &ih, cspaces);
|
||||
#endif
|
||||
if (ok)
|
||||
{
|
||||
if (w)
|
||||
|
@ -1842,7 +1867,7 @@ eet_data_image_header_advance_decode_cipher(const void *data,
|
|||
|
||||
if (cspaces && *cspaces)
|
||||
{
|
||||
if ((*cspaces)[0] == EMILE_COLORSPACE_GRY8)
|
||||
if ((*cspaces)[0] == EET_COLORSPACE_GRY8)
|
||||
*cspaces = _eet_gry8_alpha_colorspace;
|
||||
}
|
||||
|
||||
|
@ -1978,8 +2003,8 @@ _eet_data_image_decode_inside(const void *data,
|
|||
else
|
||||
{
|
||||
Eina_Binbuf *in;
|
||||
Eina_Binbuf *out;
|
||||
Eina_Bool expanded;
|
||||
Eina_Binbuf *out = NULL;
|
||||
Eina_Bool expanded = EINA_FALSE;
|
||||
|
||||
in = eina_binbuf_manage_new((const unsigned char *) body, size - 8 * sizeof (int), EINA_TRUE);
|
||||
if (!in) return 0;
|
||||
|
@ -1987,7 +2012,9 @@ _eet_data_image_decode_inside(const void *data,
|
|||
if ((src_h == h) && (src_w == w) && (row_stride == src_w * 4))
|
||||
{
|
||||
out = eina_binbuf_manage_new((void*) d, w * h * 4, EINA_TRUE);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
expanded = emile_expand(in, out, eet_2_emile_compressor(comp));
|
||||
#endif
|
||||
eina_binbuf_free(in);
|
||||
eina_binbuf_free(out);
|
||||
if (!expanded) return 0;
|
||||
|
@ -1996,9 +2023,11 @@ _eet_data_image_decode_inside(const void *data,
|
|||
{
|
||||
/* FIXME: This could create a huge alloc. So
|
||||
compressed data and tile could not always work.*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
out = emile_decompress(in,
|
||||
eet_2_emile_compressor(comp),
|
||||
w * h * 4);
|
||||
#endif
|
||||
eina_binbuf_free(in);
|
||||
if (!out) return 0;
|
||||
|
||||
|
@ -2033,6 +2062,7 @@ _eet_data_image_decode_inside(const void *data,
|
|||
dt = data;
|
||||
dt += 12;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (eet_data_image_jpeg_rgb_decode(dt, sz1, src_x, src_y, d, w, h,
|
||||
cspace))
|
||||
{
|
||||
|
@ -2041,19 +2071,29 @@ _eet_data_image_decode_inside(const void *data,
|
|||
d, w, h, cspace))
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
else if (!eet_data_image_jpeg_rgb_decode(data, size, src_x, src_y, d, w,
|
||||
h, cspace))
|
||||
return 0;
|
||||
#else
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
else if ((lossy == EET_IMAGE_ETC1) ||
|
||||
(lossy == EET_IMAGE_ETC2_RGB) ||
|
||||
(lossy == EET_IMAGE_ETC2_RGBA) ||
|
||||
(lossy == EET_IMAGE_ETC1_ALPHA))
|
||||
{
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
return eet_data_image_etc2_decode(data, size, d,
|
||||
src_x, src_y, src_w, src_h,
|
||||
alpha, cspace, lossy);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
abort();
|
||||
|
|
|
@ -565,11 +565,13 @@ eet_init(void)
|
|||
goto shutdown_mempool;
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!emile_init())
|
||||
{
|
||||
EINA_LOG_ERR("Emile: failed to initialize");
|
||||
goto shutdown_emile;
|
||||
}
|
||||
#endif
|
||||
|
||||
eina_log_timing(_eet_log_dom_global,
|
||||
EINA_LOG_STATE_STOP,
|
||||
|
@ -577,8 +579,10 @@ eet_init(void)
|
|||
|
||||
return eet_init_count;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
shutdown_emile:
|
||||
eet_node_shutdown();
|
||||
#endif
|
||||
shutdown_mempool:
|
||||
eet_mempool_shutdown();
|
||||
unregister_log_domain:
|
||||
|
@ -637,7 +641,9 @@ eet_shutdown(void)
|
|||
|
||||
eina_lock_free(&eet_cache_lock);
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
emile_shutdown();
|
||||
#endif
|
||||
|
||||
eina_log_domain_unregister(_eet_log_dom_global);
|
||||
_eet_log_dom_global = -1;
|
||||
|
@ -1944,6 +1950,7 @@ eet_read_cipher(Eet_File *ef,
|
|||
if (!in) goto on_error;
|
||||
|
||||
/* First uncipher data */
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (efn->ciphered && cipher_key)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
|
@ -1956,7 +1963,9 @@ eet_read_cipher(Eet_File *ef,
|
|||
|
||||
in = out;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (efn->compression)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
|
@ -1970,6 +1979,7 @@ eet_read_cipher(Eet_File *ef,
|
|||
|
||||
in = out;
|
||||
}
|
||||
#endif
|
||||
|
||||
UNLOCK_FILE(ef);
|
||||
|
||||
|
@ -2052,6 +2062,7 @@ eet_read_direct(Eet_File *ef,
|
|||
/* handle alias case */
|
||||
if (efn->alias)
|
||||
{
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (efn->compression)
|
||||
{
|
||||
Eina_Binbuf *in;
|
||||
|
@ -2082,6 +2093,7 @@ eet_read_direct(Eet_File *ef,
|
|||
eina_binbuf_free(out);
|
||||
return retptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
data = efn->data ? efn->data : ef->data + efn->offset;
|
||||
if (!data) goto on_error;
|
||||
|
@ -2154,6 +2166,7 @@ eet_alias_get(Eet_File *ef,
|
|||
data = efn->data ? efn->data : ef->data + efn->offset;
|
||||
|
||||
/* handle alias case */
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (efn->compression)
|
||||
{
|
||||
Eina_Binbuf *in;
|
||||
|
@ -2184,6 +2197,7 @@ eet_alias_get(Eet_File *ef,
|
|||
eina_binbuf_free(out);
|
||||
return retptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!data)
|
||||
goto on_error;
|
||||
|
@ -2278,6 +2292,7 @@ eet_alias(Eet_File *ef,
|
|||
if (!in) goto on_error;
|
||||
|
||||
/* if we want to compress */
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (comp)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
|
@ -2290,6 +2305,7 @@ eet_alias(Eet_File *ef,
|
|||
|
||||
in = out;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Does this node already exist? */
|
||||
for (efn = ef->header->directory->nodes[hash]; efn; efn = efn->next)
|
||||
|
@ -2400,6 +2416,7 @@ eet_write_cipher(Eet_File *ef,
|
|||
UNLOCK_FILE(ef);
|
||||
|
||||
in = eina_binbuf_manage_new(data, size, EINA_TRUE);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (comp)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
|
@ -2425,7 +2442,9 @@ eet_write_cipher(Eet_File *ef,
|
|||
comp = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (cipher_key)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
|
@ -2439,6 +2458,7 @@ eet_write_cipher(Eet_File *ef,
|
|||
in = out;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCK_FILE(ef);
|
||||
/* Does this node already exist? */
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
eet_deps = [rg_etc]
|
||||
eet_pub_deps = [eina, emile, efl]
|
||||
eet_ext_deps = [crypto, jpeg, m, rg_etc_simple]
|
||||
eet_pub_deps = [eina, efl]
|
||||
eet_ext_deps = [rg_etc_simple, crypto, jpeg, m]
|
||||
|
||||
eet_pub_deps += [emile]
|
||||
|
||||
eet_header_src = [
|
||||
'Eet.h'
|
||||
|
|
|
@ -30,10 +30,14 @@ efreet_src = files([
|
|||
'efreet_trash.c'
|
||||
])
|
||||
|
||||
efreet_deps = [eet, ecore, ecore_con, ecore_file, eo, efl, eina, emile, ecore_ipc, buildsystem]
|
||||
efreet_deps = [eet, ecore, ecore_con, ecore_file, eo, efl, eina, ecore_ipc, buildsystem]
|
||||
efreet_pub_deps = [eina, eo, efl]
|
||||
efreet_ext_deps = [buildsystem_simple, intl, m]
|
||||
|
||||
if get_option('emile')
|
||||
efreet_deps += emile
|
||||
endif
|
||||
|
||||
package_c_args += ['-DDATA_DIR="'+dir_data+'"']
|
||||
|
||||
efreet_lib = library('efreet',
|
||||
|
|
|
@ -59,7 +59,7 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns
|
|||
{
|
||||
unsigned int list_index = index / EFL_UI_EXACT_MODEL_CONTENT;
|
||||
static Eina_Binbuf *z = NULL;
|
||||
Eina_Binbuf *cbuf;
|
||||
Eina_Binbuf *cbuf = NULL;
|
||||
Eina_Binbuf *tbuf;
|
||||
Eina_List *l = NULL;
|
||||
unsigned int i;
|
||||
|
@ -69,7 +69,9 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns
|
|||
tbuf = eina_binbuf_manage_new((unsigned char *) buffer, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE);
|
||||
if (!tbuf) return compressed;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
cbuf = emile_compress(tbuf, EMILE_LZ4, EMILE_COMPRESSOR_FAST);
|
||||
#endif
|
||||
eina_binbuf_free(tbuf);
|
||||
if (!cbuf) return compressed;
|
||||
|
||||
|
@ -96,7 +98,9 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns
|
|||
return compressed;
|
||||
}
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
z = emile_compress(tbuf, EMILE_LZ4, EMILE_COMPRESSOR_FAST);
|
||||
#endif
|
||||
|
||||
eina_binbuf_free(tbuf);
|
||||
free(zmem);
|
||||
|
@ -139,7 +143,9 @@ _efl_ui_exact_model_buffer_expand(unsigned int list_index, unsigned int *buffer,
|
|||
|
||||
// Found -> expand in buffer
|
||||
tmp = eina_binbuf_manage_new((unsigned char*) buffer, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
emile_expand(eina_list_data_get(l), tmp, EMILE_LZ4);
|
||||
#endif
|
||||
eina_binbuf_free(tmp);
|
||||
|
||||
return buffer;
|
||||
|
|
|
@ -63,7 +63,9 @@ extern "C" {
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifdef EMILE_HEADER_ONLY
|
||||
EMILE_API int emile_init(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Shut down the Emile library
|
||||
|
@ -76,7 +78,9 @@ EMILE_API int emile_init(void);
|
|||
* @return The new init count.
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifdef EMILE_HEADER_ONLY
|
||||
EMILE_API int emile_shutdown(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
*
|
||||
* @since 1.17.0
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Strbuf *emile_base64_encode(const Eina_Binbuf *in);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief base64 url and filename safe encoding function.
|
||||
|
@ -33,7 +35,9 @@ EMILE_API Eina_Strbuf *emile_base64_encode(const Eina_Binbuf *in);
|
|||
*
|
||||
* @since 1.17.0
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Strbuf *emile_base64url_encode(const Eina_Binbuf *in);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief base64 decoding function.
|
||||
|
@ -45,7 +49,9 @@ EMILE_API Eina_Strbuf *emile_base64url_encode(const Eina_Binbuf *in);
|
|||
*
|
||||
* @since 1.17.0
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Binbuf* emile_base64_decode(const Eina_Strbuf *in);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief decoding function for base64 url and filename safe encoding.
|
||||
|
@ -57,7 +63,9 @@ EMILE_API Eina_Binbuf* emile_base64_decode(const Eina_Strbuf *in);
|
|||
*
|
||||
* @since 1.17.0
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Binbuf* emile_base64url_decode(const Eina_Strbuf *in);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -46,14 +46,18 @@ typedef enum _Emile_Cipher_Algorithm
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Bool emile_cipher_init(void);
|
||||
#endif
|
||||
/**
|
||||
* Get the name of the current used backend.
|
||||
*
|
||||
* @return the name of the current cipher backend.
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Emile_Cipher_Backend emile_cipher_module_get(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Cipher a buffer with a defined algorithm and key.
|
||||
|
@ -66,7 +70,9 @@ EMILE_API Emile_Cipher_Backend emile_cipher_module_get(void);
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Binbuf *emile_binbuf_cipher(Emile_Cipher_Algorithm algo, const Eina_Binbuf * in, const char *key, unsigned int length);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Decipher a buffer with a defined algorithm and key.
|
||||
|
@ -83,7 +89,9 @@ EMILE_API Eina_Binbuf *emile_binbuf_cipher(Emile_Cipher_Algorithm algo, const Ei
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Binbuf *emile_binbuf_decipher(Emile_Cipher_Algorithm algo, const Eina_Binbuf * in, const char *key, unsigned int length);
|
||||
#endif
|
||||
|
||||
#ifdef EFL_BETA_API_SUPPORT
|
||||
|
||||
|
@ -102,6 +110,7 @@ typedef enum
|
|||
EMILE_WANT_WRITE = 3
|
||||
} Emile_Want_Type;
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Bool emile_binbuf_hmac_sha1(const char *key, unsigned int key_len, const Eina_Binbuf * data, unsigned char digest[20]);
|
||||
|
||||
EMILE_API Eina_Bool emile_binbuf_sha1(const Eina_Binbuf * data, unsigned char digest[20]);
|
||||
|
@ -125,6 +134,7 @@ EMILE_API void emile_cipher_verify_set(Emile_SSL * emile, Eina_Bool verify);
|
|||
EMILE_API void emile_cipher_verify_basic_set(Emile_SSL * emile, Eina_Bool verify_basic);
|
||||
EMILE_API Eina_Bool emile_cipher_verify_get(const Emile_SSL * emile);
|
||||
EMILE_API Eina_Bool emile_cipher_verify_basic_get(const Emile_SSL * emile);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -51,7 +51,9 @@ typedef enum
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Binbuf *emile_compress(const Eina_Binbuf * in, Emile_Compressor_Type t, Emile_Compressor_Level level);
|
||||
#endif
|
||||
/**
|
||||
* @brief Uncompress a buffer into a newly allocated buffer.
|
||||
*
|
||||
|
@ -67,7 +69,9 @@ EMILE_API Eina_Binbuf *emile_compress(const Eina_Binbuf * in, Emile_Compressor_T
|
|||
* @note That if dest_length doesn't match the expanded data, it will
|
||||
* just fail and return @c NULL.
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Binbuf *emile_decompress(const Eina_Binbuf * in, Emile_Compressor_Type t, unsigned int dest_length);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Uncompress a buffer into an existing buffer.
|
||||
|
@ -83,7 +87,9 @@ EMILE_API Eina_Binbuf *emile_decompress(const Eina_Binbuf * in, Emile_Compressor
|
|||
* expanded data or it will fail. In case of failure, random garbage
|
||||
* could fill the out buffer.
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Bool emile_expand(const Eina_Binbuf * in, Eina_Binbuf * out, Emile_Compressor_Type t);
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -259,7 +259,9 @@ EMILE_API Emile_Image *emile_image_tgv_memory_open(Eina_Binbuf * source, Emile_I
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Emile_Image *emile_image_tgv_file_open(Eina_File * source, Emile_Image_Load_Opts * opts, Emile_Image_Animated * animated, Emile_Image_Load_Error * error);
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
|
@ -273,7 +275,9 @@ EMILE_API Emile_Image *emile_image_tgv_file_open(Eina_File * source, Emile_Image
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Emile_Image *emile_image_jpeg_memory_open(Eina_Binbuf * source, Emile_Image_Load_Opts * opts, Emile_Image_Animated * animated, Emile_Image_Load_Error * error);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Open a JPEG image from file.
|
||||
|
@ -286,7 +290,9 @@ EMILE_API Emile_Image *emile_image_jpeg_memory_open(Eina_Binbuf * source, Emile_
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Emile_Image *emile_image_jpeg_file_open(Eina_File * source, Emile_Image_Load_Opts * opts, Emile_Image_Animated * animated, Emile_Image_Load_Error * error);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Read the header of an image to fill Emile_Image_Property.
|
||||
|
@ -299,7 +305,9 @@ EMILE_API Emile_Image *emile_image_jpeg_file_open(Eina_File * source, Emile_Imag
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Bool emile_image_head(Emile_Image * image, Emile_Image_Property * prop, unsigned int property_size, Emile_Image_Load_Error * error);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Read the pixels from an image file.
|
||||
|
@ -313,7 +321,9 @@ EMILE_API Eina_Bool emile_image_head(Emile_Image * image, Emile_Image_Property *
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API Eina_Bool emile_image_data(Emile_Image * image, Emile_Image_Property * prop, unsigned int property_size, void *pixels, Emile_Image_Load_Error * error);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Register a callback for emile to ask what to do during the processing of an image
|
||||
|
@ -323,7 +333,9 @@ EMILE_API Eina_Bool emile_image_data(Emile_Image * image, Emile_Image_Property *
|
|||
* @param action The action this callback is triggered on.
|
||||
* @since 1.19
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API void emile_image_callback_set(Emile_Image *image, Emile_Action_Cb callback, Emile_Action action, const void *data);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Close an opened image handler.
|
||||
|
@ -332,7 +344,9 @@ EMILE_API void emile_image_callback_set(Emile_Image *image, Emile_Action_Cb call
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API void emile_image_close(Emile_Image * source);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Convert an error code related to an image handler into a meaningful string.
|
||||
|
@ -343,7 +357,9 @@ EMILE_API void emile_image_close(Emile_Image * source);
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
EMILE_API const char *emile_load_error_str(Emile_Image * source, Emile_Image_Load_Error error);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -52,10 +52,12 @@ evas_vg_loaders_file = [
|
|||
evas_vg_savers_file = ['eet', 'svg']
|
||||
|
||||
rel_evas_modules = join_paths('..', '..', '..', 'modules', 'evas', 'engines', 'software_generic')
|
||||
evas_deps = [eo, eet, eina, efl, emile, ector, ecore, draw, buildsystem]
|
||||
evas_deps = [eo, eet, eina, efl, ector, ecore, draw, buildsystem]
|
||||
evas_ext_deps = [vg_common, draw_simple]
|
||||
evas_ext_none_static_deps = [buildsystem_simple, intl, m, valgrind, libunibreak, lua]
|
||||
|
||||
evas_deps += emile
|
||||
|
||||
pub_eo_file_target = []
|
||||
priv_eo_files = []
|
||||
evas_include_directories = []
|
||||
|
@ -208,7 +210,11 @@ if get_option('opengl') != 'none'
|
|||
endif
|
||||
|
||||
evas_link = [ ]
|
||||
evas_pub_deps = [eina, ecore, ector, emile]
|
||||
evas_pub_deps = [eina, ecore, ector]
|
||||
evas_pub_deps += emile
|
||||
|
||||
evas_opt_deps = []
|
||||
evas_opt_deps += emile
|
||||
|
||||
if cpu_sse3 == true or cpu_neon == true and cpu_neon_intrinsics == false
|
||||
evas_opt = static_library('evas_opt',
|
||||
|
@ -218,7 +224,7 @@ if cpu_sse3 == true or cpu_neon == true and cpu_neon_intrinsics == false
|
|||
evas_include_directories +
|
||||
[vg_common_inc_dir],
|
||||
c_args: native_arch_opt_c_args,
|
||||
dependencies: [eina, eo, ector, emile, evas_deps, evas_ext_none_static_deps],
|
||||
dependencies: [eina, eo, ector, evas_deps, evas_ext_none_static_deps, evas_opt_deps],
|
||||
)
|
||||
evas_link += [ evas_opt ]
|
||||
endif
|
||||
|
@ -280,7 +286,7 @@ foreach loader : evas_vg_savers_file
|
|||
file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'vg_savers', loader, 'evas_vg_save_'+loader+'.c')
|
||||
evas_static_list += [declare_dependency(
|
||||
sources: file,
|
||||
dependencies: [eo, ector, emile, freetype, eet],
|
||||
dependencies: [eo, ector, freetype, eet, evas_opt_deps],
|
||||
)]
|
||||
config_h.set('EVAS_STATIC_BUILD_VG_'+loader.to_upper(), '1')
|
||||
endif
|
||||
|
@ -313,7 +319,7 @@ evas = declare_dependency(
|
|||
|
||||
evas_bin = declare_dependency(
|
||||
link_with : [evas_lib],
|
||||
dependencies : [eina, ecore, ector, emile],
|
||||
dependencies : [eina, ecore, ector, evas_opt_deps],
|
||||
include_directories : evas_include_directories
|
||||
)
|
||||
|
||||
|
|
|
@ -1144,7 +1144,7 @@ eng_image_native_set(void *data EINA_UNUSED, void *image, void *native)
|
|||
{
|
||||
Evas_Native_Surface *ns = native;
|
||||
RGBA_Image *im = image;
|
||||
Image_Entry *ie = image, *ie2;
|
||||
Image_Entry *ie = image, *ie2 = NULL;
|
||||
|
||||
if (!im)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ struct _Evas_Loader_Internal
|
|||
Eina_Rectangle region;
|
||||
};
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void *
|
||||
evas_image_load_file_open_jpeg(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
|
||||
Evas_Image_Load_Opts *opts,
|
||||
|
@ -57,8 +58,10 @@ evas_image_load_file_open_jpeg(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
|
|||
|
||||
return loader;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
evas_image_load_file_close_jpeg(void *loader_data)
|
||||
{
|
||||
|
@ -67,7 +70,9 @@ evas_image_load_file_close_jpeg(void *loader_data)
|
|||
emile_image_close(loader->image);
|
||||
free(loader);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static Eina_Bool
|
||||
evas_image_load_file_head_jpeg(void *loader_data,
|
||||
Emile_Image_Property *prop,
|
||||
|
@ -84,7 +89,9 @@ evas_image_load_file_head_jpeg(void *loader_data,
|
|||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static Eina_Bool
|
||||
_evas_image_load_jpeg_cancelled(void *data EINA_UNUSED,
|
||||
Emile_Image *image EINA_UNUSED,
|
||||
|
@ -92,7 +99,9 @@ _evas_image_load_jpeg_cancelled(void *data EINA_UNUSED,
|
|||
{
|
||||
return evas_module_task_cancelled();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
Eina_Bool
|
||||
evas_image_load_file_data_jpeg(void *loader_data,
|
||||
Emile_Image_Property *prop,
|
||||
|
@ -113,7 +122,9 @@ evas_image_load_file_data_jpeg(void *loader_data,
|
|||
*error = image_error;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
Evas_Image_Load_Func evas_image_load_jpeg_func =
|
||||
{
|
||||
EVAS_IMAGE_LOAD_VERSION,
|
||||
|
@ -126,12 +137,15 @@ Evas_Image_Load_Func evas_image_load_jpeg_func =
|
|||
EINA_TRUE,
|
||||
EINA_TRUE
|
||||
};
|
||||
#endif
|
||||
|
||||
static int
|
||||
module_open(Evas_Module *em)
|
||||
{
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!em) return 0;
|
||||
em->functions = (void *)(&evas_image_load_jpeg_func);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ struct _Evas_Loader_Internal
|
|||
Eina_Rectangle region;
|
||||
};
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void *
|
||||
evas_image_load_file_open_tgv(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
|
||||
Evas_Image_Load_Opts *opts,
|
||||
|
@ -57,8 +58,9 @@ evas_image_load_file_open_tgv(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
|
|||
|
||||
return loader;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static void
|
||||
evas_image_load_file_close_tgv(void *loader_data)
|
||||
{
|
||||
|
@ -67,7 +69,9 @@ evas_image_load_file_close_tgv(void *loader_data)
|
|||
emile_image_close(loader->image);
|
||||
free(loader);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
static Eina_Bool
|
||||
evas_image_load_file_head_tgv(void *loader_data,
|
||||
Emile_Image_Property *prop,
|
||||
|
@ -84,7 +88,9 @@ evas_image_load_file_head_tgv(void *loader_data,
|
|||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
Eina_Bool
|
||||
evas_image_load_file_data_tgv(void *loader_data,
|
||||
Emile_Image_Property *prop,
|
||||
|
@ -102,7 +108,9 @@ evas_image_load_file_data_tgv(void *loader_data,
|
|||
*error = image_error;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
Evas_Image_Load_Func evas_image_load_tgv_func =
|
||||
{
|
||||
EVAS_IMAGE_LOAD_VERSION,
|
||||
|
@ -115,12 +123,15 @@ Evas_Image_Load_Func evas_image_load_tgv_func =
|
|||
EINA_TRUE,
|
||||
EINA_FALSE
|
||||
};
|
||||
#endif
|
||||
|
||||
static int
|
||||
module_open(Evas_Module *em)
|
||||
{
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
if (!em) return 0;
|
||||
em->functions = (void *)(&evas_image_load_tgv_func);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,12 @@ draw_src = [
|
|||
'draw_alpha_main.c'
|
||||
]
|
||||
|
||||
draw_opt_lib = [ ]
|
||||
draw_opt_lib = []
|
||||
draw_deps = []
|
||||
draw_without_deps_deps = []
|
||||
|
||||
draw_deps += rg_etc
|
||||
draw_without_deps_deps += rg_etc_simple
|
||||
|
||||
if cpu_sse3 == true
|
||||
draw_opt = static_library('draw_opt',
|
||||
|
@ -23,14 +28,14 @@ endif
|
|||
|
||||
draw = declare_dependency(
|
||||
include_directories: [include_directories('.'), include_directories(join_paths('..', '..', 'lib'))],
|
||||
dependencies: [eina, efl, rg_etc],
|
||||
dependencies: [eina, efl] + draw_deps,
|
||||
sources : draw_src,
|
||||
link_with : draw_opt_lib
|
||||
)
|
||||
|
||||
draw_without_deps = declare_dependency(
|
||||
include_directories: [include_directories('.'), include_directories(join_paths('..', '..', 'lib'))],
|
||||
dependencies: [rg_etc_simple],
|
||||
dependencies: draw_without_deps_deps,
|
||||
sources : draw_src,
|
||||
link_with : draw_opt_lib
|
||||
)
|
||||
|
|
|
@ -36,7 +36,7 @@ static Evas *evas = NULL;
|
|||
Evas *
|
||||
_setup_evas(void)
|
||||
{
|
||||
Evas_Engine_Info *einfo;
|
||||
PEI Evas_Engine_Info *einfo;
|
||||
|
||||
evas = evas_new();
|
||||
|
||||
|
|
|
@ -51,10 +51,12 @@ EFL_START_TEST(eet_test_cipher_decipher_simple)
|
|||
ef = eet_open(file, EET_FILE_MODE_READ);
|
||||
fail_if(!ef);
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
test = eet_read_cipher(ef, "keys/tests", &size, key_bad);
|
||||
|
||||
if (size == (int)strlen(buffer) + 1)
|
||||
fail_if(memcmp(test, buffer, strlen(buffer) + 1) == 0);
|
||||
#endif
|
||||
|
||||
eet_close(ef);
|
||||
|
||||
|
|
|
@ -184,6 +184,7 @@ EFL_START_TEST(eet_test_image_normal)
|
|||
0, 100, 1);
|
||||
fail_if(result == 0);
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
data = eet_data_image_read(ef,
|
||||
EET_TEST_FILE_IMAGE "2",
|
||||
&w,
|
||||
|
@ -215,6 +216,7 @@ EFL_START_TEST(eet_test_image_normal)
|
|||
fail_if(alpha != test_noalpha.alpha);
|
||||
fail_if(compress != 9);
|
||||
fail_if(lossy != 0);
|
||||
#endif
|
||||
|
||||
eet_close(ef);
|
||||
|
||||
|
@ -281,6 +283,7 @@ EFL_START_TEST(eet_test_image_normal)
|
|||
fail_if(data[0] != test_noalpha.color[0]);
|
||||
free(data);
|
||||
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
data = eet_data_image_read(ef,
|
||||
EET_TEST_FILE_IMAGE "1",
|
||||
&w,
|
||||
|
@ -421,6 +424,7 @@ EFL_START_TEST(eet_test_image_normal)
|
|||
fail_if(alpha != test_alpha.alpha);
|
||||
fail_if(lossy != 1);
|
||||
free(data);
|
||||
#endif
|
||||
|
||||
eet_close(ef);
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef EFL_CHECK_H
|
||||
#define EFL_CHECK_H
|
||||
|
||||
#define PEI fprintf(stderr, "== " __FILE__ ":%d %s\n", __LINE__, __func__); fflush(stderr);
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
|
|
@ -767,35 +767,35 @@ EFL_END_TEST
|
|||
|
||||
EFL_START_TEST(evas_object_image_api)
|
||||
{
|
||||
Evas *e = _setup_evas();
|
||||
Evas_Object *o;
|
||||
void *pix;
|
||||
int w, h;
|
||||
PEI Evas *e = _setup_evas();
|
||||
PEI Evas_Object *o;
|
||||
PEI void *pix;
|
||||
PEI int w, h;
|
||||
|
||||
o = evas_object_image_filled_add(e);
|
||||
PEI o = evas_object_image_filled_add(e);
|
||||
/* test file load */
|
||||
evas_object_image_file_set(o, TESTS_IMG_DIR"/Light.jpg", NULL);
|
||||
ck_assert(!!efl_file_get(o));
|
||||
pix = evas_object_image_data_get(o, EINA_FALSE);
|
||||
PEI evas_object_image_file_set(o, TESTS_IMG_DIR"/Light.jpg", NULL);
|
||||
PEI ck_assert(!!efl_file_get(o));
|
||||
PEI pix = evas_object_image_data_get(o, EINA_FALSE);
|
||||
ck_assert(!!pix);
|
||||
evas_object_image_size_get(o, &w, &h);
|
||||
PEI evas_object_image_size_get(o, &w, &h);
|
||||
ck_assert(w && h);
|
||||
/* test file unload */
|
||||
evas_object_image_file_set(o, NULL, NULL);
|
||||
PEI evas_object_image_file_set(o, NULL, NULL);
|
||||
ck_assert(!efl_file_get(o));
|
||||
pix = evas_object_image_data_get(o, EINA_FALSE);
|
||||
ck_assert(!pix);
|
||||
PEI ck_assert(!pix);
|
||||
evas_object_image_size_get(o, &w, &h);
|
||||
ck_assert(!w && !h);
|
||||
/* test file load after unload */
|
||||
evas_object_image_file_set(o, TESTS_IMG_DIR"/Light.jpg", NULL);
|
||||
PEI evas_object_image_file_set(o, TESTS_IMG_DIR"/Light.jpg", NULL);
|
||||
ck_assert(!!efl_file_get(o));
|
||||
pix = evas_object_image_data_get(o, EINA_FALSE);
|
||||
PEI pix = evas_object_image_data_get(o, EINA_FALSE);
|
||||
ck_assert(!!pix);
|
||||
evas_object_image_size_get(o, &w, &h);
|
||||
PEI evas_object_image_size_get(o, &w, &h);
|
||||
ck_assert(w && h);
|
||||
|
||||
evas_free(e);
|
||||
PEI evas_free(e);
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
||||
|
@ -1217,28 +1217,37 @@ EFL_END_TEST
|
|||
|
||||
void evas_test_image_object(TCase *tc)
|
||||
{
|
||||
// FIXME: Fix segfaults for all methods surrounded with EMILE_HEADER_ONLY checks
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
tcase_add_test(tc, evas_object_image_api);
|
||||
#endif
|
||||
tcase_add_test(tc, evas_object_image_defaults);
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
tcase_add_test(tc, evas_object_image_loader);
|
||||
tcase_add_test(tc, evas_object_image_loader_orientation);
|
||||
tcase_add_test(tc, evas_object_image_orient);
|
||||
#endif
|
||||
#if BUILD_LOADER_PNG
|
||||
# if BUILD_LOADER_TGV
|
||||
# if !defined(EMILE_HEADER_ONLY) && BUILD_LOADER_TGV
|
||||
tcase_add_test(tc, evas_object_image_tgv_loader_data);
|
||||
# endif
|
||||
# if BUILD_LOADER_JP2K
|
||||
tcase_add_test(tc, evas_object_image_jp2k_loader_data);
|
||||
# endif
|
||||
#ifdef BUILD_LOADER_JPEG
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
# ifdef BUILD_LOADER_JPEG
|
||||
/* jpeg takes forever from manual value comparisons */
|
||||
tcase_add_loop_test(tc, evas_object_image_all_loader_data, 0, EINA_C_ARRAY_LENGTH(exts) - 2);
|
||||
#else
|
||||
# else
|
||||
tcase_add_loop_test(tc, evas_object_image_all_loader_data, 0, EINA_C_ARRAY_LENGTH(exts));
|
||||
# endif
|
||||
#endif
|
||||
tcase_add_test(tc, evas_object_image_buggy);
|
||||
tcase_add_test(tc, evas_object_image_map_unmap);
|
||||
#endif
|
||||
#ifndef EMILE_HEADER_ONLY
|
||||
tcase_add_test(tc, evas_object_image_partially_load_orientation);
|
||||
#endif
|
||||
tcase_add_test(tc, evas_object_image_cached_data_comparision);
|
||||
tcase_add_test(tc, evas_object_image_9patch);
|
||||
tcase_add_test(tc, evas_object_image_save_from_proxy);
|
||||
|
@ -1249,7 +1258,7 @@ void evas_test_image_object(TCase *tc)
|
|||
void evas_test_image_object2(TCase *tc)
|
||||
{
|
||||
#if BUILD_LOADER_PNG
|
||||
#ifdef BUILD_LOADER_JPEG
|
||||
#if !defined(EMILE_HEADER_ONLY) && defined(BUILD_LOADER_JPEG)
|
||||
/* jpeg takes forever from manual value comparisons */
|
||||
tcase_add_loop_test(tc, evas_object_image_all_loader_data, EINA_C_ARRAY_LENGTH(exts) - 2, EINA_C_ARRAY_LENGTH(exts));
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue