diff --git a/legacy/edje/data/src/e_logo.edc b/legacy/edje/data/src/e_logo.edc index 21cb4706f6..9bf08a127e 100644 --- a/legacy/edje/data/src/e_logo.edc +++ b/legacy/edje/data/src/e_logo.edc @@ -147,6 +147,25 @@ collections { border, 12 12 12 12; } } +/* + part { + name, "clip"; + mouse_events, 0; + type, RECT; + description { + state, "default" 0.0; + rel1 { + relative, 0.5 0.5; + offset, -20 -20; + } + rel2 { + relative, 0.5 0.5; + offset, 19 19; + } + color, 100 200 255 128; + } + } + */ part { name, "logo"; description { @@ -186,6 +205,7 @@ collections { } part { name, "logo_anim"; +// clip_to, "clip"; description { state, "default" 0.0; max, 160 120; diff --git a/legacy/edje/data/src/test.edc b/legacy/edje/data/src/test.edc index 5577e17b67..96c48852b1 100644 --- a/legacy/edje/data/src/test.edc +++ b/legacy/edje/data/src/test.edc @@ -23,7 +23,9 @@ collections // IMAGE, RECTANGLE, TEXT // type, IMAGE; mouse_events, 0; +// clip_to "p1"; // color_class, "default"; +// text_class, "default"; description { // state, "name" (float value 0.0 - 1.0) diff --git a/legacy/edje/src/bin/edje_cc_handlers.c b/legacy/edje/src/bin/edje_cc_handlers.c index 1bd4479598..08adc83d90 100644 --- a/legacy/edje/src/bin/edje_cc_handlers.c +++ b/legacy/edje/src/bin/edje_cc_handlers.c @@ -16,7 +16,9 @@ static void ob_collections_group_parts_part(void); 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_mouse_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 ob_collections_group_parts_part_description(void); static void st_collections_group_parts_part_description_state(void); @@ -73,7 +75,9 @@ New_Statement_Handler statement_handlers[] = {"collections.group.parts.part.name", st_collections_group_parts_part_name}, {"collections.group.parts.part.type", st_collections_group_parts_part_type}, {"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_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.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}, @@ -128,7 +132,9 @@ New_Object_Handler object_handlers[] = {"collections.group.parts.part.name", NULL}, {"collections.group.parts.part.type", NULL}, {"collections.group.parts.part.mouse_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.description", ob_collections_group_parts_part_description}, {"collections.group.parts.part.description.state", NULL}, {"collections.group.parts.part.description.visible", NULL}, @@ -299,6 +305,7 @@ 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->clip_to_id = -1; } static void @@ -339,6 +346,23 @@ st_collections_group_parts_part_mouse_events(void) ep->mouse_events = parse_int_range(0, 0, 1); } +static void +st_collections_group_parts_part_clip_to_id(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->clip_to_id)); + free(name); + } +} + static void st_collections_group_parts_part_color_class(void) { @@ -350,6 +374,17 @@ st_collections_group_parts_part_color_class(void) ep->color_class = parse_str(0); } +static void +st_collections_group_parts_part_text_class(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->text_class = parse_str(0); +} + static void ob_collections_group_parts_part_description(void) { @@ -366,7 +401,6 @@ ob_collections_group_parts_part_description(void) ep->other_desc = evas_list_append(ep->other_desc, ed); ed->visible = 1; ed->dragable.confine_id = -1; - ed->clip_to_id = -1; ed->align.x = 0.5; ed->align.y = 0.5; ed->min.w = 0; diff --git a/legacy/edje/src/lib/edje_data.c b/legacy/edje/src/lib/edje_data.c index da8c9ec34c..b151e7788c 100644 --- a/legacy/edje/src/lib/edje_data.c +++ b/legacy/edje/src/lib/edje_data.c @@ -134,7 +134,6 @@ _edje_edd_setup(void) 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, "clip_to_id", clip_to_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); @@ -204,6 +203,7 @@ _edje_edd_setup(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "id", id, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "type", type, EET_T_CHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "mouse_events", mouse_events, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "clip_to_id", clip_to_id, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "color_class", color_class, EET_T_STRING); 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); diff --git a/legacy/edje/src/lib/edje_load.c b/legacy/edje/src/lib/edje_load.c index 4272bf2328..3138c40bb3 100644 --- a/legacy/edje/src/lib/edje_load.c +++ b/legacy/edje/src/lib/edje_load.c @@ -85,6 +85,12 @@ edje_file_set(Evas_Object *obj, const char *file, const char *part) rp->param1.rel1_to = evas_list_nth(ed->parts, rp->param1.description->rel1.id); if (rp->param1.description->rel2.id >= 0) rp->param1.rel2_to = evas_list_nth(ed->parts, rp->param1.description->rel2.id); + if (rp->part->clip_to_id >= 0) + { + rp->clip_to = evas_list_nth(ed->parts, rp->part->clip_to_id); + if (rp->clip_to) + evas_object_clip_set(rp->object, rp->clip_to->object); + } } ed->dirty = 1; _edje_freeze(ed); diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h index 78152bb4e6..c6527ab6f1 100644 --- a/legacy/edje/src/lib/edje_private.h +++ b/legacy/edje/src/lib/edje_private.h @@ -10,23 +10,39 @@ #include #include -/* FIXME: need "random" signals and events to hook to */ -/* FIXME: clip_to needs to work */ -/* FIXME: free stuff - no more leaks */ -/* FIXME: dragables have to work */ -/* FIXME: drag start/top signals etc. */ -/* FIXME: drag needs to have signals with relative pos */ -/* FIXME: drag vals 0.0 -> 1.0. "rest" pos == 0.0 */ -/* FIXME: text parts need to work */ -/* FIXME: reduce linked list walking and list_nth calls */ -/* FIXME: named parts need to be able to be "replaced" with new evas objects */ -/* FIXME: need to be able to calculate min & max size of a whole edje */ -/* FIXME: add code to list collections in an eet */ -/* FIXME: part replacement with objec t+callbacks */ -/* FIXME: part queries for geometry etc. */ - -/* FIXME: ? somehow handle double click? */ -/* FIXME: ? add numeric params to conditions for progs (ranges etc.) */ +/* FIXME: + * reference count programs since the tmp lists can be screwed if a program is ended by another + * need "random" signals and events for hooking to, and "random" durations + * free stuff - no more leaks + * dragables have to work + * 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 + * text parts need to work + * text and color classes need to work + * reduce linked list walking and list_nth calls + * named parts need to be able to be "replaced" with new evas objects + * real part size and "before min/max limit" sizes need to be stored per part + * need to be able to calculate min & max size of a whole edje + * add code to list collections in an eet file + * externally sourced images need to be supported in edje_cc and edje + * part replacement with object callbacks should be possible + * part queries for geometry etc. + * need to be able to "pause" edjes from API + * need to be able to force anim times to 0.0 from API to turn off animation + * need to detect relative loops + * need to detect clip_to loops + * need to detect anim time 0.0 loops + * need to check frametime 0.0 works + * need to check mouse_events flag works + * edje_cc should be able to force lossy, lossless, min and max quality and compression of encoded images + * edje_cc needs to prune out unused images + * edje_cc might need an option for limiting number of tween images + * audit edje for corrupt/bad input files + * ? somehow handle double click? + * ? add numeric params to conditions for progs (ranges etc.) +*/ /* HOW THIS ALL WORKS: @@ -198,9 +214,10 @@ struct _Edje_Part_Collection struct _Edje_Part { char *name; /* the name if any of the part */ + int id; /* its id number */ unsigned char type; /* what type (image, rect, text) */ unsigned char mouse_events; /* it will affect/respond to mouse events */ - int id; /* its id number */ + 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 */ @@ -233,8 +250,6 @@ struct _Edje_Part_Description int confine_id; /* dragging within this bit, -1 = no */ } dragable; - int clip_to_id; /* the part id to clip this one to */ - struct { double x, y; /* 0 <-> 1.0 alignment within allocated space */ } align; @@ -360,6 +375,8 @@ struct _Edje_Real_Part Edje_Real_Part *rel2_to; Edje_Real_Part *confine_to; } param1, param2; + + Edje_Real_Part *clip_to; Edje_Running_Program *program; };