parent
00d83df7eb
commit
1bb9260fea
|
@ -17,6 +17,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
#include <locale.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/* types */
|
||||
typedef struct _New_Object_Handler New_Object_Handler;
|
||||
|
|
|
@ -1093,7 +1093,6 @@ st_collections_group_parts_part_effect(void)
|
|||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
|
|
|
@ -71,6 +71,7 @@ data_write(void)
|
|||
int image_num;
|
||||
int collection_num;
|
||||
|
||||
bytes = 0;
|
||||
input_bytes = 0;
|
||||
total_bytes = 0;
|
||||
input_raw_bytes = 0;
|
||||
|
@ -83,96 +84,112 @@ data_write(void)
|
|||
progname, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
bytes = eet_data_write(ef, edd_edje_file, "edje_file", edje_file, 1);
|
||||
if (bytes <= 0)
|
||||
if (edje_file)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write \"edje_file\" entry to \"%s\" \n",
|
||||
progname, file_out);
|
||||
exit(-1);
|
||||
bytes = eet_data_write(ef, edd_edje_file, "edje_file", edje_file, 1);
|
||||
if (bytes <= 0)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write \"edje_file\" entry to \"%s\" \n",
|
||||
progname, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
total_bytes += bytes;
|
||||
}
|
||||
else
|
||||
total_bytes += bytes;
|
||||
if (verbose)
|
||||
{
|
||||
printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n",
|
||||
progname, bytes, (bytes + 512) / 1024);
|
||||
}
|
||||
for (l = edje_file->image_dir->entries; l; l = l->next)
|
||||
if ((edje_file) && (edje_file->image_dir))
|
||||
{
|
||||
Edje_Image_Directory_Entry *img;
|
||||
|
||||
img = l->data;
|
||||
if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
|
||||
for (l = edje_file->image_dir->entries; l; l = l->next)
|
||||
{
|
||||
Imlib_Image im;
|
||||
Evas_List *l;
|
||||
|
||||
im = NULL;
|
||||
imlib_set_cache_size(0);
|
||||
for (l = img_dirs; l; l = l->next)
|
||||
Edje_Image_Directory_Entry *img;
|
||||
|
||||
img = l->data;
|
||||
if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
|
||||
{
|
||||
char buf[4096];
|
||||
Imlib_Image im;
|
||||
Evas_List *l;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s", l->data, img->entry);
|
||||
im = imlib_load_image(buf);
|
||||
if (im) break;
|
||||
}
|
||||
if (!im) im = imlib_load_image(img->entry);
|
||||
if (im)
|
||||
{
|
||||
DATA32 *im_data;
|
||||
int im_w, im_h;
|
||||
int im_alpha;
|
||||
char buf[256];
|
||||
|
||||
imlib_context_set_image(im);
|
||||
im_w = imlib_image_get_width();
|
||||
im_h = imlib_image_get_height();
|
||||
im_alpha = imlib_image_has_alpha();
|
||||
im_data = imlib_image_get_data_for_reading_only();
|
||||
snprintf(buf, sizeof(buf), "images/%i", img->id);
|
||||
if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT)
|
||||
bytes = eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h,
|
||||
im_alpha,
|
||||
img->source_param, 0, 0);
|
||||
else
|
||||
bytes = eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h,
|
||||
im_alpha,
|
||||
0, img->source_param, 1);
|
||||
if (bytes <= 0)
|
||||
im = NULL;
|
||||
imlib_set_cache_size(0);
|
||||
for (l = img_dirs; l; l = l->next)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write image part \"%s\" as \"%s\" part entry to %s \n",
|
||||
progname, img->entry, buf, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
image_num++;
|
||||
total_bytes += bytes;
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
struct stat st;
|
||||
char buf[4096];
|
||||
|
||||
if (stat(imlib_image_get_filename(), &st) != 0)
|
||||
st.st_size = 0;
|
||||
input_bytes += st.st_size;
|
||||
input_raw_bytes += im_w * im_h * 4;
|
||||
printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]\n",
|
||||
progname, bytes, (bytes + 512) / 1024, buf, img->entry,
|
||||
100 - (100 * (double)bytes) / ((double)(im_w * im_h * 4)),
|
||||
100 - (100 * (double)bytes) / ((double)(st.st_size))
|
||||
);
|
||||
snprintf(buf, sizeof(buf), "%s/%s",
|
||||
(char *)(l->data), img->entry);
|
||||
im = imlib_load_image(buf);
|
||||
if (im) break;
|
||||
}
|
||||
if (!im) im = imlib_load_image(img->entry);
|
||||
if (im)
|
||||
{
|
||||
DATA32 *im_data;
|
||||
int im_w, im_h;
|
||||
int im_alpha;
|
||||
char buf[256];
|
||||
|
||||
imlib_context_set_image(im);
|
||||
im_w = imlib_image_get_width();
|
||||
im_h = imlib_image_get_height();
|
||||
im_alpha = imlib_image_has_alpha();
|
||||
im_data = imlib_image_get_data_for_reading_only();
|
||||
if ((im_data) && (im_w > 0) && (im_h > 0))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "images/%i", img->id);
|
||||
if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT)
|
||||
bytes = eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h,
|
||||
im_alpha,
|
||||
img->source_param, 0, 0);
|
||||
else
|
||||
bytes = eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h,
|
||||
im_alpha,
|
||||
0, img->source_param, 1);
|
||||
if (bytes <= 0)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write image part \"%s\" as \"%s\" part entry to %s \n",
|
||||
progname, img->entry, buf, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
image_num++;
|
||||
total_bytes += bytes;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write image part \"%s\" as \"%s\" part entry to %s \n",
|
||||
progname, img->entry, buf, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (stat(imlib_image_get_filename(), &st) != 0)
|
||||
st.st_size = 0;
|
||||
input_bytes += st.st_size;
|
||||
input_raw_bytes += im_w * im_h * 4;
|
||||
printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]\n",
|
||||
progname, bytes, (bytes + 512) / 1024, buf, img->entry,
|
||||
100 - (100 * (double)bytes) / ((double)(im_w * im_h * 4)),
|
||||
100 - (100 * (double)bytes) / ((double)(st.st_size))
|
||||
);
|
||||
}
|
||||
if (im_data) imlib_image_put_back_data(im_data);
|
||||
imlib_free_image();
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Warning. unable to open image \"%s\" for inclusion in output\n",
|
||||
progname, img->entry);
|
||||
}
|
||||
imlib_image_put_back_data(im_data);
|
||||
imlib_free_image();
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Warning. unable to open image \"%s\" for inclusion in output\n",
|
||||
progname, img->entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@ new_object(void)
|
|||
if (!handled)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
|
||||
progname, file_in, line, evas_list_data(evas_list_last(stack)));
|
||||
progname, file_in, line,
|
||||
(char *)evas_list_data(evas_list_last(stack)));
|
||||
exit(-1);
|
||||
}
|
||||
free(id);
|
||||
|
@ -66,7 +67,8 @@ new_statement(void)
|
|||
if (!handled)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
|
||||
progname, file_in, line, evas_list_data(evas_list_last(stack)));
|
||||
progname, file_in, line,
|
||||
(char *)evas_list_data(evas_list_last(stack)));
|
||||
exit(-1);
|
||||
}
|
||||
free(id);
|
||||
|
|
|
@ -29,7 +29,6 @@ test_list(char *file)
|
|||
for (l = entries; l; l = l->next)
|
||||
{
|
||||
char *name;
|
||||
Evas_Object *o;
|
||||
char buf[1024];
|
||||
|
||||
name = l->data;
|
||||
|
@ -43,7 +42,6 @@ test_list(char *file)
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
Evas_List *l;
|
||||
FILE *output;
|
||||
|
||||
progname = argv[0];
|
||||
|
|
|
@ -107,7 +107,6 @@ main_start(int argc, char **argv)
|
|||
#else
|
||||
ecore_evas = ecore_evas_fb_new(NULL, 270, startw, starth);
|
||||
#endif
|
||||
canvas_up:
|
||||
if (!ecore_evas) return -1;
|
||||
ecore_evas_callback_delete_request_set(ecore_evas, main_delete_request);
|
||||
ecore_evas_callback_resize_set(ecore_evas, main_resize);
|
||||
|
@ -784,7 +783,6 @@ main(int argc, char **argv)
|
|||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
char *file;
|
||||
char *coll;
|
||||
int done;
|
||||
|
||||
done = 0;
|
||||
|
@ -794,18 +792,6 @@ main(int argc, char **argv)
|
|||
(!strcmp(file, "--geometry"))) && (i < (argc - 1)))
|
||||
i++;
|
||||
if (file[0] == '-') continue;
|
||||
/*
|
||||
if (argc > (i + 1))
|
||||
{
|
||||
coll = argv[i + 1];
|
||||
if (strlen(coll) > 0)
|
||||
{
|
||||
test_setup(file, coll);
|
||||
done = 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
*/
|
||||
if (!done) test_list(file);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,9 +40,6 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, double pos)
|
|||
void
|
||||
_edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, char *d1, double v1, char *d2, double v2)
|
||||
{
|
||||
char *cd1 = "default", *cd2 = "default";
|
||||
double cv1 = 0.0, cv2 = 0.0;
|
||||
|
||||
if (!d1) d1 = "default";
|
||||
if (!d2) d2 = "default";
|
||||
|
||||
|
@ -250,6 +247,7 @@ _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
|
|||
if (x) *x = 0.0;
|
||||
if (y) *y = 0.0;
|
||||
return 0;
|
||||
ed = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -13,6 +13,8 @@ _edje_mouse_in_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
rp = evas_object_data_get(obj, "real_part");
|
||||
if (!rp) return;
|
||||
_edje_emit(ed, "mouse,in", rp->part->name);
|
||||
return;
|
||||
e = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -27,6 +29,8 @@ _edje_mouse_out_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
rp = evas_object_data_get(obj, "real_part");
|
||||
if (!rp) return;
|
||||
_edje_emit(ed, "mouse,out", rp->part->name);
|
||||
return;
|
||||
e = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -85,6 +89,8 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
_edje_recalc(ed);
|
||||
_edje_thaw(ed);
|
||||
_edje_unref(ed);
|
||||
return;
|
||||
e = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -126,6 +132,8 @@ _edje_mouse_up_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
_edje_recalc(ed);
|
||||
_edje_thaw(ed);
|
||||
_edje_unref(ed);
|
||||
return;
|
||||
e = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -178,7 +186,6 @@ _edje_mouse_move_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
{
|
||||
if (rp->drag.down.count > 0)
|
||||
{
|
||||
char buf[256];
|
||||
double dx, dy;
|
||||
int dir;
|
||||
|
||||
|
@ -195,6 +202,8 @@ _edje_mouse_move_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
}
|
||||
_edje_unref(ed);
|
||||
_edje_thaw(ed);
|
||||
return;
|
||||
e = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -211,6 +220,8 @@ _edje_mouse_wheel_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
if (!rp) return;
|
||||
snprintf(buf, sizeof(buf), "mouse,wheel,%i,%i", ev->direction, (ev->z < 0) ? (-1) : (1));
|
||||
_edje_emit(ed, buf, rp->part->name);
|
||||
return;
|
||||
e = NULL;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -285,6 +296,7 @@ _edje_timer_cb(void *data)
|
|||
if (_edje_anim_count > 0) return 1;
|
||||
_edje_timer = NULL;
|
||||
return 0;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -77,7 +77,6 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
{
|
||||
Edje_Part *ep;
|
||||
Edje_Real_Part *rp;
|
||||
char buf[256];
|
||||
|
||||
ep = l->data;
|
||||
rp = calloc(1, sizeof(Edje_Real_Part));
|
||||
|
@ -312,7 +311,6 @@ void
|
|||
_edje_file_add(Edje *ed)
|
||||
{
|
||||
Eet_File *ef = NULL;
|
||||
Edje_Part_Collection *pc = NULL;
|
||||
Evas_List *l;
|
||||
int id = -1;
|
||||
|
||||
|
@ -589,4 +587,6 @@ _edje_collection_free_prog_cache_matches_free_cb(Evas_Hash *hash, const char *ke
|
|||
{
|
||||
evas_list_free((Evas_List *)data);
|
||||
return 1;
|
||||
hash = NULL;
|
||||
fdata = NULL;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ edje_object_signal_callback_del(Evas_Object *obj, const char *emission, const ch
|
|||
|
||||
if ((!emission) || (!source) || (!func)) return NULL;
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
if (!ed) return NULL;
|
||||
if (ed->delete_me) return NULL;
|
||||
for (l = ed->callbacks; l; l = l->next)
|
||||
{
|
||||
|
|
|
@ -241,7 +241,6 @@ _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
|||
{
|
||||
Edje *ed;
|
||||
Evas_List *l;
|
||||
Evas_Coord xx, yy;
|
||||
|
||||
ed = evas_object_smart_data_get(obj);
|
||||
if (!ed) return;
|
||||
|
|
|
@ -6,8 +6,8 @@ Ejde_Text_Style _edje_text_styles[EDJE_TEXT_EFFECT_LAST];
|
|||
void
|
||||
_edje_text_init(void)
|
||||
{
|
||||
int i, j, n;
|
||||
const vals[5][5] =
|
||||
int i, j, n = 0;
|
||||
const char vals[5][5] =
|
||||
{
|
||||
{0, 1, 2, 1, 0},
|
||||
{1, 3, 4, 3, 1},
|
||||
|
@ -225,6 +225,8 @@ _edje_text_part_on_del(Edje *ed, Edje_Real_Part *ep)
|
|||
ep->extra_objects = evas_list_remove(ep->extra_objects, o);
|
||||
evas_object_del(o);
|
||||
}
|
||||
return;
|
||||
ed = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -191,7 +191,6 @@ edje_object_part_exists(Evas_Object *obj, const char *part)
|
|||
void
|
||||
edje_object_part_geometry_get(Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h )
|
||||
{
|
||||
Evas_List *l;
|
||||
Edje *ed;
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
|
@ -570,7 +569,6 @@ edje_object_part_drag_dir_get(Evas_Object *obj, const char *part)
|
|||
{
|
||||
Edje *ed;
|
||||
Edje_Real_Part *rp;
|
||||
int v;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part))
|
||||
|
@ -981,4 +979,7 @@ _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *e
|
|||
|
||||
edje_obj = data;
|
||||
edje_object_part_unswallow(edje_obj, obj);
|
||||
return;
|
||||
e = NULL;
|
||||
event_info = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue