forked from enlightenment/efl
more features... working on fixme list.
SVN revision: 7249
This commit is contained in:
parent
48ccbe5123
commit
a8ed74dc0b
|
@ -29,21 +29,22 @@ collections
|
|||
// OUTLINE_SOFT_SHADOW
|
||||
// effect, NONE;
|
||||
mouse_events, 0;
|
||||
// clip_to "p1";
|
||||
// repeat_events, 0;
|
||||
// clip_to, "p1";
|
||||
// color_class, "default";
|
||||
// text_class, "default";
|
||||
// dragable
|
||||
// {
|
||||
// direction, on/off stepping count
|
||||
// x, 0 1 2;
|
||||
// y, 0 1 2;
|
||||
// confine, "p2";
|
||||
// }
|
||||
description
|
||||
{
|
||||
// state, "name" (float value 0.0 - 1.0)
|
||||
state, "default" 0.0;
|
||||
visible, 1;
|
||||
// dragable
|
||||
// {
|
||||
// direction, on/off stepping count
|
||||
// x, 0 1 2;
|
||||
// y, 0 1 2;
|
||||
// confine, "p2";
|
||||
// }
|
||||
// align, 0.5 0.5;
|
||||
// min, 0 0;
|
||||
// max, 0 0;
|
||||
|
|
|
@ -19,16 +19,17 @@ static void st_collections_group_parts_part_name(void);
|
|||
static void st_collections_group_parts_part_type(void);
|
||||
static void st_collections_group_parts_part_effect(void);
|
||||
static void st_collections_group_parts_part_mouse_events(void);
|
||||
static void st_collections_group_parts_part_repeat_events(void);
|
||||
static void st_collections_group_parts_part_clip_to_id(void);
|
||||
static void st_collections_group_parts_part_color_class(void);
|
||||
static void st_collections_group_parts_part_text_class(void);
|
||||
static void st_collections_group_parts_part_dragable_x(void);
|
||||
static void st_collections_group_parts_part_dragable_y(void);
|
||||
static void st_collections_group_parts_part_dragable_confine(void);
|
||||
|
||||
static void ob_collections_group_parts_part_description(void);
|
||||
static void st_collections_group_parts_part_description_state(void);
|
||||
static void st_collections_group_parts_part_description_visible(void);
|
||||
static void st_collections_group_parts_part_description_dragable_x(void);
|
||||
static void st_collections_group_parts_part_description_dragable_y(void);
|
||||
static void st_collections_group_parts_part_description_dragable_confine(void);
|
||||
static void st_collections_group_parts_part_description_align(void);
|
||||
static void st_collections_group_parts_part_description_min(void);
|
||||
static void st_collections_group_parts_part_description_max(void);
|
||||
|
@ -82,14 +83,15 @@ New_Statement_Handler statement_handlers[] =
|
|||
{"collections.group.parts.part.type", st_collections_group_parts_part_type},
|
||||
{"collections.group.parts.part.effect", st_collections_group_parts_part_effect},
|
||||
{"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
|
||||
{"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
|
||||
{"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
|
||||
{"collections.group.parts.part.color_class", st_collections_group_parts_part_color_class},
|
||||
{"collections.group.parts.part.text_class", st_collections_group_parts_part_text_class},
|
||||
{"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
|
||||
{"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
|
||||
{"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
|
||||
{"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
|
||||
{"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
|
||||
{"collections.group.parts.part.description.dragable.x", st_collections_group_parts_part_description_dragable_x},
|
||||
{"collections.group.parts.part.description.dragable.y", st_collections_group_parts_part_description_dragable_y},
|
||||
{"collections.group.parts.part.description.dragable.confine", st_collections_group_parts_part_description_dragable_confine},
|
||||
{"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
|
||||
{"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min},
|
||||
{"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max},
|
||||
|
@ -143,16 +145,17 @@ New_Object_Handler object_handlers[] =
|
|||
{"collections.group.parts.part.type", NULL},
|
||||
{"collections.group.parts.part.effect", NULL},
|
||||
{"collections.group.parts.part.mouse_events", NULL},
|
||||
{"collections.group.parts.part.repeat_events", NULL},
|
||||
{"collections.group.parts.part.clip_to", NULL},
|
||||
{"collections.group.parts.part.color_class", NULL},
|
||||
{"collections.group.parts.part.text_class", NULL},
|
||||
{"collections.group.parts.part.dragable", NULL},
|
||||
{"collections.group.parts.part.dragable.x", NULL},
|
||||
{"collections.group.parts.part.dragable.y", NULL},
|
||||
{"collections.group.parts.part.dragable.confine", NULL},
|
||||
{"collections.group.parts.part.description", ob_collections_group_parts_part_description},
|
||||
{"collections.group.parts.part.description.state", NULL},
|
||||
{"collections.group.parts.part.description.visible", NULL},
|
||||
{"collections.group.parts.part.description.dragable", NULL},
|
||||
{"collections.group.parts.part.description.dragable.x", NULL},
|
||||
{"collections.group.parts.part.description.dragable.y", NULL},
|
||||
{"collections.group.parts.part.description.dragable.confine", NULL},
|
||||
{"collections.group.parts.part.description.align", NULL},
|
||||
{"collections.group.parts.part.description.min", NULL},
|
||||
{"collections.group.parts.part.description.max", NULL},
|
||||
|
@ -337,7 +340,9 @@ ob_collections_group_parts_part(void)
|
|||
ep->id = evas_list_count(pc->parts) - 1;
|
||||
ep->type = EDJE_PART_TYPE_IMAGE;
|
||||
ep->mouse_events = 1;
|
||||
ep->repeat_events = 0;
|
||||
ep->clip_to_id = -1;
|
||||
ep->dragable.confine_id = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -378,6 +383,17 @@ st_collections_group_parts_part_mouse_events(void)
|
|||
ep->mouse_events = parse_int_range(0, 0, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_repeat_events(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ep->repeat_events = parse_int_range(0, 0, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_clip_to_id(void)
|
||||
{
|
||||
|
@ -417,6 +433,49 @@ st_collections_group_parts_part_text_class(void)
|
|||
ep->text_class = parse_str(0);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_dragable_x(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ep->dragable.x = parse_int_range(0, 0, 1);
|
||||
ep->dragable.step_x = parse_int_range(1, 0, 0x7fffffff);
|
||||
ep->dragable.count_x = parse_int_range(2, 0, 0x7fffffff);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_dragable_y(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ep->dragable.y = parse_int_range(0, 0, 1);
|
||||
ep->dragable.step_y = parse_int_range(1, 0, 0x7fffffff);
|
||||
ep->dragable.count_y = parse_int_range(2, 0, 0x7fffffff);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_dragable_confine(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
{
|
||||
char *name;
|
||||
|
||||
name = parse_str(0);
|
||||
data_queue_part_lookup(pc, name, &(ep->dragable.confine_id));
|
||||
free(name);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ob_collections_group_parts_part_description(void)
|
||||
{
|
||||
|
@ -432,7 +491,6 @@ ob_collections_group_parts_part_description(void)
|
|||
else
|
||||
ep->other_desc = evas_list_append(ep->other_desc, ed);
|
||||
ed->visible = 1;
|
||||
ed->dragable.confine_id = -1;
|
||||
ed->align.x = 0.5;
|
||||
ed->align.y = 0.5;
|
||||
ed->min.w = 0;
|
||||
|
@ -504,58 +562,6 @@ st_collections_group_parts_part_description_visible(void)
|
|||
ed->visible = parse_int_range(0, 0, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_description_dragable_x(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));
|
||||
ed = ep->default_desc;
|
||||
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||
ed->dragable.x = parse_int_range(0, 0, 1);
|
||||
ed->dragable.step_x = parse_int_range(1, 1, 0x7fffffff);
|
||||
ed->dragable.count_x = parse_int_range(2, 1, 0x7fffffff);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_description_dragable_y(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));
|
||||
ed = ep->default_desc;
|
||||
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||
ed->dragable.y = parse_int_range(0, 0, 1);
|
||||
ed->dragable.step_y = parse_int_range(1, 1, 0x7fffffff);
|
||||
ed->dragable.count_y = parse_int_range(2, 1, 0x7fffffff);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_description_dragable_confine(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));
|
||||
ed = ep->default_desc;
|
||||
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||
{
|
||||
char *name;
|
||||
|
||||
name = parse_str(0);
|
||||
data_queue_part_lookup(pc, name, &(ed->dragable.confine_id));
|
||||
free(name);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_description_align(void)
|
||||
{
|
||||
|
|
|
@ -12,8 +12,10 @@ void bg_setup(void);
|
|||
void bg_resize(double w, double h);
|
||||
static void bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info);
|
||||
|
||||
void test_list(char *file);
|
||||
void test_setup(char *file, char *name);
|
||||
void test_reize(double w, double h);
|
||||
|
||||
typedef struct _Demo_Edje Demo_Edje;
|
||||
|
||||
struct _Demo_Edje
|
||||
|
@ -33,10 +35,21 @@ struct _Demo_Edje
|
|||
int vdir;
|
||||
};
|
||||
|
||||
typedef struct _Collection Collection;
|
||||
|
||||
struct _Collection
|
||||
{
|
||||
char *file;
|
||||
char *part;
|
||||
Evas_Object *text;
|
||||
Evas_Object *bg;
|
||||
};
|
||||
|
||||
static Evas_List *edjes = NULL;
|
||||
static Evas_Object *o_bg = NULL;
|
||||
static Evas_Object *o_shadow = NULL;
|
||||
|
||||
static Evas_List *collections = NULL;
|
||||
|
||||
double start_time = 0.0;
|
||||
Ecore_Evas *ecore_evas = NULL;
|
||||
Evas *evas = NULL;
|
||||
|
@ -389,6 +402,47 @@ cb (void *data, Evas_Object *o, const char *sig, const char *src)
|
|||
// printf("CALLBACK for %p %p \"%s\" \"%s\"\n", data, o, sig, src);
|
||||
}
|
||||
|
||||
void
|
||||
test_list(char *file)
|
||||
{
|
||||
Evas_List *entries;
|
||||
|
||||
/* FIXME: still working on this */
|
||||
entries = edje_file_collection_list(file);
|
||||
if (entries)
|
||||
{
|
||||
Evas_List *l;
|
||||
|
||||
for (l = entries; l; l = l->next)
|
||||
{
|
||||
char *name;
|
||||
Collection *co;
|
||||
Evas_Object *o;
|
||||
|
||||
name = l->data;
|
||||
co = calloc(1, sizeof(Collection));
|
||||
collections = evas_list_append(collections, co);
|
||||
co->file = strdup(file);
|
||||
co->part = strdup(name);
|
||||
|
||||
o = evas_object_image_add(evas);
|
||||
evas_object_layer_set(o, 10);
|
||||
evas_object_image_border_set(o, 8, 8, 8, 8);
|
||||
evas_object_image_file_set(o, DAT"data/test/images/list_norm.png", NULL);
|
||||
co->bg = o;
|
||||
|
||||
o = evas_object_text_add(evas);
|
||||
evas_object_layer_set(o, 10);
|
||||
evas_object_color_set(o, 0, 0, 0, 255);
|
||||
evas_object_text_text_set(o, co->part);
|
||||
evas_object_text_font_set(o, "Vera", 6);
|
||||
evas_object_pass_events_set(o, 1);
|
||||
co->text = o;
|
||||
}
|
||||
edje_file_collection_list_free(entries);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
test_setup(char *file, char *name)
|
||||
{
|
||||
|
@ -513,21 +567,34 @@ main(int argc, char **argv)
|
|||
if (argc < 2)
|
||||
{
|
||||
printf("Usage:\n");
|
||||
printf(" %s file_to_show.eet collection_to_show ...\n", argv[0]);
|
||||
printf(" %s file_to_show.eet [collection_to_show] ...\n", argv[0]);
|
||||
printf("\n");
|
||||
printf("Example:\n");
|
||||
printf(" %s data/e_logo.eet\n", argv[0]);
|
||||
printf(" %s data/e_logo.eet test\n", argv[0]);
|
||||
printf(" %s data/e_logo.eet test ~/test.eet my_thing ...\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
for (i = 1; i < (argc - 1); i += 2)
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
char *file;
|
||||
char *coll;
|
||||
int done;
|
||||
|
||||
done = 0;
|
||||
file = argv[i];
|
||||
coll = argv[i + 1];
|
||||
test_setup(file, coll);
|
||||
if (argc > (i + 1))
|
||||
{
|
||||
coll = argv[i + 1];
|
||||
if (strlen(coll) > 0)
|
||||
{
|
||||
test_setup(file, coll);
|
||||
done = 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (!done)
|
||||
test_list(file);
|
||||
}
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
|
|
@ -13,6 +13,9 @@ extern "C" {
|
|||
void edje_freeze (void);
|
||||
void edje_thaw (void);
|
||||
|
||||
Evas_List *edje_file_collection_list (const char *file);
|
||||
void edje_file_collection_list_free (Evas_List *lst);
|
||||
|
||||
void edje_extern_object_min_size_set (Evas_Object *obj, double minw, double minh);
|
||||
void edje_extern_object_max_size_set (Evas_Object *obj, double maxw, double maxh);
|
||||
|
||||
|
|
|
@ -420,26 +420,26 @@ _edje_part_recalc_single(Edje *ed,
|
|||
|
||||
/* complex dragable params */
|
||||
offset = params->x + ep->drag.x - confine_to->x;
|
||||
if (desc->dragable.step_x > 0)
|
||||
if (ep->part->dragable.step_x > 0)
|
||||
{
|
||||
params->x = confine_to->x +
|
||||
((offset / desc->dragable.step_x) * desc->dragable.step_x);
|
||||
((offset / ep->part->dragable.step_x) * ep->part->dragable.step_x);
|
||||
}
|
||||
else if (desc->dragable.count_x > 0)
|
||||
else if (ep->part->dragable.count_x > 0)
|
||||
{
|
||||
step = (confine_to->w - params->w) / desc->dragable.count_x;
|
||||
step = (confine_to->w - params->w) / ep->part->dragable.count_x;
|
||||
params->x = confine_to->x +
|
||||
((offset / step) * step);
|
||||
}
|
||||
offset = params->y + ep->drag.y - confine_to->y;
|
||||
if (desc->dragable.step_y > 0)
|
||||
if (ep->part->dragable.step_y > 0)
|
||||
{
|
||||
params->y = confine_to->y +
|
||||
((offset / desc->dragable.step_y) * desc->dragable.step_y);
|
||||
((offset / ep->part->dragable.step_y) * ep->part->dragable.step_y);
|
||||
}
|
||||
else if (desc->dragable.count_y > 0)
|
||||
else if (ep->part->dragable.count_y > 0)
|
||||
{
|
||||
step = (confine_to->h - params->h) / desc->dragable.count_y;
|
||||
step = (confine_to->h - params->h) / ep->part->dragable.count_y;
|
||||
params->y = confine_to->y +
|
||||
((offset / step) * step);
|
||||
}
|
||||
|
|
|
@ -94,13 +94,6 @@ _edje_edd_setup(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "state.name", state.name, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "state.value", state.value, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "visible", visible, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "dragable.x", dragable.x, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "dragable.step_x", dragable.step_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "dragable.count_x", dragable.count_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "dragable.y", dragable.y, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "dragable.step_y", dragable.step_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "dragable.count_y", dragable.count_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "dragable.counfine_id", dragable.confine_id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "align.x", align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "align.y", align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "min.w", min.w, EET_T_INT);
|
||||
|
@ -171,6 +164,13 @@ _edje_edd_setup(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "text_class", text_class, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_part, Edje_Part, "default_desc", default_desc, _edje_edd_edje_part_description);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part, Edje_Part, "other_desc", other_desc, _edje_edd_edje_part_description);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.x", dragable.x, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.step_x", dragable.step_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.count_x", dragable.count_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.y", dragable.y, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.step_y", dragable.step_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.count_y", dragable.count_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.counfine_id", dragable.confine_id, EET_T_INT);
|
||||
|
||||
_edje_edd_edje_part_collection =
|
||||
NEWD("Edje_Part_Collection",
|
||||
|
|
|
@ -28,7 +28,47 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
if (ed->collection)
|
||||
{
|
||||
Evas_List *l;
|
||||
int errors = 0;
|
||||
|
||||
/* check for invalid loops */
|
||||
for (l = ed->collection->parts; (l && ! errors); l = l->next)
|
||||
{
|
||||
Edje_Part *ep;
|
||||
Evas_List *hist = NULL;
|
||||
|
||||
ep = l->data;
|
||||
hist = evas_list_append(hist, ep);
|
||||
while (ep->dragable.confine_id >= 0)
|
||||
{
|
||||
ep = evas_list_nth(ed->collection->parts,
|
||||
ep->dragable.confine_id);
|
||||
if (evas_list_find(hist, ep))
|
||||
{
|
||||
printf("EDJE FIXME: ERROR! confine_to loops. invalidating loop.\n");
|
||||
ep->dragable.confine_id = -1;
|
||||
break;
|
||||
}
|
||||
hist = evas_list_append(hist, ep);
|
||||
}
|
||||
evas_list_free(hist);
|
||||
hist = NULL;
|
||||
hist = evas_list_append(hist, ep);
|
||||
while (ep->clip_to_id >= 0)
|
||||
{
|
||||
ep = evas_list_nth(ed->collection->parts,
|
||||
ep->clip_to_id);
|
||||
if (evas_list_find(hist, ep))
|
||||
{
|
||||
printf("EDJE FIXME: ERROR! clip_to loops. invalidating loop.\n");
|
||||
ep->clip_to_id = -1;
|
||||
break;
|
||||
}
|
||||
hist = evas_list_append(hist, ep);
|
||||
}
|
||||
evas_list_free(hist);
|
||||
hist = NULL;
|
||||
}
|
||||
/* build real parts */
|
||||
for (l = ed->collection->parts; l; l = l->next)
|
||||
{
|
||||
Edje_Part *ep;
|
||||
|
@ -41,6 +81,10 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
rp->part = ep;
|
||||
ed->parts = evas_list_append(ed->parts, rp);
|
||||
rp->param1.description = ep->default_desc;
|
||||
if (!rp->param1.description)
|
||||
{
|
||||
printf("EDJE FIXME: ERROR! no default part description!\n");
|
||||
}
|
||||
_edje_text_part_on_add(ed, rp);
|
||||
if (ep->type == EDJE_PART_TYPE_RECTANGLE)
|
||||
rp->object = evas_object_rectangle_add(ed->evas);
|
||||
|
@ -50,7 +94,7 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
rp->object = evas_object_text_add(ed->evas);
|
||||
else
|
||||
{
|
||||
printf("FIXME: ERROR! wrong part type!\n");
|
||||
printf("EDJE FIXME: ERROR! wrong part type %i!\n", ep->type);
|
||||
}
|
||||
evas_object_smart_member_add(rp->object, ed->obj);
|
||||
if (ep->mouse_events)
|
||||
|
@ -80,6 +124,8 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
_edje_mouse_wheel_cb,
|
||||
ed);
|
||||
evas_object_data_set(rp->object, "real_part", rp);
|
||||
if (ep->repeat_events)
|
||||
evas_object_repeat_events_set(rp->object, 1);
|
||||
}
|
||||
else
|
||||
evas_object_pass_events_set(rp->object, 1);
|
||||
|
@ -132,6 +178,55 @@ edje_object_file_get(Evas_Object *obj, const char **file, const char **part)
|
|||
if (part) *part = ed->part;
|
||||
}
|
||||
|
||||
Evas_List *
|
||||
edje_file_collection_list(const char *file)
|
||||
{
|
||||
Eet_File *ef = NULL;
|
||||
Evas_List *lst = NULL;
|
||||
Edje_File *ed_file;
|
||||
|
||||
ed_file = evas_hash_find(_edje_file_hash, file);
|
||||
if (!ed_file)
|
||||
{
|
||||
ef = eet_open((char *)file, EET_FILE_MODE_READ);
|
||||
if (!ef) return NULL;
|
||||
ed_file = eet_data_read(ef, _edje_edd_edje_file, "edje_file");
|
||||
if (!ed_file)
|
||||
{
|
||||
eet_close(ef);
|
||||
return NULL;
|
||||
}
|
||||
eet_close(ef);
|
||||
}
|
||||
else
|
||||
ed_file->references++;
|
||||
if (ed_file->collection_dir)
|
||||
{
|
||||
Evas_List *l;
|
||||
|
||||
for (l = ed_file->collection_dir->entries; l; l = l->next)
|
||||
{
|
||||
Edje_Part_Collection_Directory_Entry *ce;
|
||||
|
||||
ce = l->data;
|
||||
lst = evas_list_append(lst, strdup(ce->entry));
|
||||
}
|
||||
}
|
||||
ed_file->references--;
|
||||
if (ed_file->references <= 0) _edje_file_free(ed_file);
|
||||
return lst;
|
||||
}
|
||||
|
||||
void
|
||||
edje_file_collection_list_free(Evas_List *lst)
|
||||
{
|
||||
while (lst)
|
||||
{
|
||||
if (lst->data) free(lst->data);
|
||||
lst = evas_list_remove(lst, lst->data);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_edje_file_add(Edje *ed)
|
||||
{
|
||||
|
@ -161,14 +256,11 @@ _edje_file_add(Edje *ed)
|
|||
ed->file = NULL;
|
||||
goto out;
|
||||
}
|
||||
if (!ed->file->collection_dir)
|
||||
{
|
||||
for (l = ed->file->collection_dir->entries; l; l = l->next)
|
||||
{
|
||||
Edje_Part_Collection_Directory_Entry *ce;
|
||||
|
||||
ce = l->data;
|
||||
printf("Collection: %s\n", ce->entry);
|
||||
}
|
||||
_edje_file_free(ed->file);
|
||||
ed->file = NULL;
|
||||
goto out;
|
||||
}
|
||||
_edje_file_hash = evas_hash_add(_edje_file_hash, ed->path, ed->file);
|
||||
}
|
||||
|
|
|
@ -16,25 +16,20 @@
|
|||
#include <fnmatch.h>
|
||||
|
||||
/* FIXME:
|
||||
*
|
||||
* dont segv if given the wrong collection name
|
||||
*
|
||||
* dragables have to work
|
||||
* dragable need a way of their sizing being set relative to confine
|
||||
* drag start/top signals etc.
|
||||
* drag needs to have signals with relative pos as arg.
|
||||
* drag vals should be 0.0 -> 1.0 if drag is confined. "rest" pos = 0.0.
|
||||
* query dragable for its relative pos value
|
||||
* dragable needs to be able to affext rel/abs values of other parts
|
||||
*
|
||||
* need to be able to list collections in an eet file
|
||||
* more example edje files
|
||||
*
|
||||
* externally sourced images need to be supported in edje_cc and edje
|
||||
*
|
||||
* need to detect rel1_to part loops
|
||||
* need to detect rel2_to part loops
|
||||
* need to detect clip_to part loops
|
||||
* need to detect confine_to part loops
|
||||
* edje test program needs to test all api calls and list edje collections
|
||||
*
|
||||
* ? programs need to be able to cycle part states given a list of states
|
||||
* ? programs need to be able to set/get/add/sub and compare variables
|
||||
* ie:
|
||||
* action, INT "active_state" = INT 1;
|
||||
|
@ -58,18 +53,19 @@
|
|||
* if, MOUSE_X "" > 1;
|
||||
* or, MOUSE_X "this_part" > 50;
|
||||
* or, MOUSE_X_REL "this_part" <= 0.5;
|
||||
* and, STATE "this_part" == "clicked";
|
||||
* and, STATE_VAL "this_part" == 0.0;
|
||||
* ...
|
||||
*
|
||||
* if, INT "active_state" != 0;
|
||||
* and, INT "hidden" < 10;
|
||||
* or, STR "my_string" == "smelly";
|
||||
* ...
|
||||
*
|
||||
* ? programs need to be able to "toggle" part states given a list of states
|
||||
* ? reduce linked list walking and list_nth calls
|
||||
* ? key/value pair config values per colelction and per edje file
|
||||
* ? add containering (hbox, vbox, table, wrapping multi-line hbox & vbox)
|
||||
* ? text entry widget (single line only)
|
||||
* ? add numeric params to conditions for progs (ranges etc.)
|
||||
* ? key/value pair config values per colelction and per edje file
|
||||
* ? reduce linked list walking and list_nth calls
|
||||
*/
|
||||
|
||||
typedef struct _Edje_File Edje_File;
|
||||
|
@ -229,11 +225,24 @@ struct _Edje_Part
|
|||
unsigned char type; /* what type (image, rect, text) */
|
||||
unsigned char effect; /* 0 = plain... */
|
||||
unsigned char mouse_events; /* it will affect/respond to mouse events */
|
||||
unsigned char repeat_events; /* it will repeat events to objects below */
|
||||
int clip_to_id; /* the part id to clip this one to */
|
||||
char *color_class; /* how to modify the color */
|
||||
char *text_class; /* how to apply/modify the font */
|
||||
Edje_Part_Description *default_desc; /* the part descriptor for default */
|
||||
Evas_List *other_desc; /* other possible descriptors */
|
||||
struct {
|
||||
char x; /* can u click & drag this bit in x dir */
|
||||
int step_x; /* drag jumps n pixels (0 = no limit) */
|
||||
int count_x; /* drag area divided by n (0 = no limit) */
|
||||
|
||||
char y; /* can u click & drag this bit in y dir */
|
||||
int step_y; /* drag jumps n pixels (0 = no limit) */
|
||||
int count_y; /* drag area divided by n (0 = no limit) */
|
||||
|
||||
int confine_id; /* dragging within this bit, -1 = no */
|
||||
} dragable;
|
||||
int load_error;
|
||||
};
|
||||
|
||||
struct _Edje_Part_Image_Id
|
||||
|
@ -250,18 +259,6 @@ struct _Edje_Part_Description
|
|||
|
||||
unsigned char visible; /* is it shown */
|
||||
|
||||
struct {
|
||||
char x; /* can u click & draqg this bit & which dir */
|
||||
int step_x; /* drag jumps n pixels (0 = no limit) */
|
||||
int count_x; /* drag area divided by n (0 = no limit) */
|
||||
|
||||
char y; /* can u click & drag this bit & which dir */
|
||||
int step_y; /* drag jumps n pixels (0 = no limit) */
|
||||
int count_y; /* drag area divided by n (0 = no limit) */
|
||||
|
||||
int confine_id; /* dragging within this bit, -1 = no */
|
||||
} dragable;
|
||||
|
||||
struct {
|
||||
double x, y; /* 0 <-> 1.0 alignment within allocated space */
|
||||
} align;
|
||||
|
|
|
@ -78,7 +78,6 @@ _edje_smart_layer_set(Evas_Object * obj, int layer)
|
|||
{
|
||||
Edje *ed;
|
||||
Evas_List *l;
|
||||
char buf[256];
|
||||
|
||||
ed = evas_object_smart_data_get(obj);
|
||||
if (!ed) return;
|
||||
|
@ -105,8 +104,7 @@ _edje_smart_layer_set(Evas_Object * obj, int layer)
|
|||
if (ep->swallowed_object)
|
||||
evas_object_layer_set(ep->swallowed_object, ed->layer);
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "layer,set,%i", layer);
|
||||
_edje_emit(ed, buf, "");
|
||||
_edje_emit(ed, "layer,set", "");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -258,6 +258,8 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
|
|||
if (!obj_swallow) return;
|
||||
rp->swallowed_object = obj_swallow;
|
||||
evas_object_clip_set(rp->swallowed_object, ed->clipper);
|
||||
if (evas_object_layer_get(rp->swallowed_object) != ed->layer)
|
||||
evas_object_layer_set(rp->swallowed_object, ed->layer);
|
||||
evas_object_stack_above(rp->swallowed_object, rp->object);
|
||||
evas_object_event_callback_add(rp->swallowed_object,
|
||||
EVAS_CALLBACK_FREE,
|
||||
|
@ -387,7 +389,7 @@ edje_object_size_min_get(Evas_Object *obj, double *minw, double *minh)
|
|||
Edje *ed;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed)
|
||||
if ((!ed) || (!ed->collection))
|
||||
{
|
||||
if (minw) *minw = 0;
|
||||
if (minh) *minh = 0;
|
||||
|
@ -403,7 +405,7 @@ edje_object_size_max_get(Evas_Object *obj, double *maxw, double *maxh)
|
|||
Edje *ed;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed)
|
||||
if ((!ed) || (!ed->collection))
|
||||
{
|
||||
if (maxw) *maxw = 0;
|
||||
if (maxh) *maxh = 0;
|
||||
|
@ -436,7 +438,7 @@ edje_object_size_min_calc(Evas_Object *obj, double *minw, double *minh)
|
|||
int ok;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed)
|
||||
if ((!ed) || (!ed->collection))
|
||||
{
|
||||
if (minw) *minw = 0;
|
||||
if (minh) *minh = 0;
|
||||
|
|
Loading…
Reference in New Issue