summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorSubodh Kumar <s7158.kumar@samsung.com>2019-07-12 11:58:35 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-07-12 12:04:06 -0400
commit2854702f8ec4c7899473f737c31420de429e9359 (patch)
treedf1f3516e842152abdf49c5848baa14e7bbed281 /src/bin/edje
parenta9504b9e75c4c9d9b1c76b4a06134f7a66faf88d (diff)
edje: Add support for map zoom to use other part center.
Summary: Current: In edc, zoom is supposed to happen from object center, there is no way to change the center of the zoom. Changes: Adding support to change the center of zooming just like map rotation by using other part's center. @feature Reviewers: cedric, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9115
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc_handlers.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 3d3b23b8c6..147db84280 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -497,6 +497,7 @@ static void st_collections_group_parts_part_description_map_perspective_on
497static void st_collections_group_parts_part_description_map_color(void); 497static void st_collections_group_parts_part_description_map_color(void);
498static void st_collections_group_parts_part_description_map_zoom_x(void); 498static void st_collections_group_parts_part_description_map_zoom_x(void);
499static void st_collections_group_parts_part_description_map_zoom_y(void); 499static void st_collections_group_parts_part_description_map_zoom_y(void);
500static void st_collections_group_parts_part_description_map_zoom_center(void);
500static void st_collections_group_parts_part_description_perspective_zplane(void); 501static void st_collections_group_parts_part_description_perspective_zplane(void);
501static void st_collections_group_parts_part_description_perspective_focal(void); 502static void st_collections_group_parts_part_description_perspective_focal(void);
502static void st_collections_group_parts_part_api(void); 503static void st_collections_group_parts_part_api(void);
@@ -1029,6 +1030,7 @@ New_Statement_Handler statement_handlers[] =
1029 {"collections.group.parts.part.description.map.color", st_collections_group_parts_part_description_map_color}, 1030 {"collections.group.parts.part.description.map.color", st_collections_group_parts_part_description_map_color},
1030 {"collections.group.parts.part.description.map.zoom.x", st_collections_group_parts_part_description_map_zoom_x}, 1031 {"collections.group.parts.part.description.map.zoom.x", st_collections_group_parts_part_description_map_zoom_x},
1031 {"collections.group.parts.part.description.map.zoom.y", st_collections_group_parts_part_description_map_zoom_y}, 1032 {"collections.group.parts.part.description.map.zoom.y", st_collections_group_parts_part_description_map_zoom_y},
1033 {"collections.group.parts.part.description.map.zoom.center", st_collections_group_parts_part_description_map_zoom_center},
1032 {"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane}, 1034 {"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane},
1033 {"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal}, 1035 {"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal},
1034 {"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int}, 1036 {"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int},
@@ -6447,6 +6449,7 @@ _part_desc_free(Edje_Part_Collection *pc,
6447 part_lookup_del(pc, &(ed->map.id_persp)); 6449 part_lookup_del(pc, &(ed->map.id_persp));
6448 part_lookup_del(pc, &(ed->map.id_light)); 6450 part_lookup_del(pc, &(ed->map.id_light));
6449 part_lookup_del(pc, &(ed->map.rot.id_center)); 6451 part_lookup_del(pc, &(ed->map.rot.id_center));
6452 part_lookup_del(pc, &(ed->map.zoom.id_center));
6450 6453
6451 switch (ep->type) 6454 switch (ep->type)
6452 { 6455 {
@@ -8600,6 +8603,7 @@ ob_collections_group_parts_part_description(void)
8600 ed->map.id_persp = -1; 8603 ed->map.id_persp = -1;
8601 ed->map.id_light = -1; 8604 ed->map.id_light = -1;
8602 ed->map.rot.id_center = -1; 8605 ed->map.rot.id_center = -1;
8606 ed->map.zoom.id_center = -1;
8603 ed->map.rot.x = FROM_DOUBLE(0.0); 8607 ed->map.rot.x = FROM_DOUBLE(0.0);
8604 ed->map.rot.y = FROM_DOUBLE(0.0); 8608 ed->map.rot.y = FROM_DOUBLE(0.0);
8605 ed->map.rot.z = FROM_DOUBLE(0.0); 8609 ed->map.rot.z = FROM_DOUBLE(0.0);
@@ -8759,6 +8763,7 @@ st_collections_group_parts_part_description_inherit(void)
8759 data_queue_copied_part_lookup(pc, &parent->map.id_persp, &ed->map.id_persp); 8763 data_queue_copied_part_lookup(pc, &parent->map.id_persp, &ed->map.id_persp);
8760 data_queue_copied_part_lookup(pc, &parent->map.id_light, &ed->map.id_light); 8764 data_queue_copied_part_lookup(pc, &parent->map.id_light, &ed->map.id_light);
8761 data_queue_copied_part_lookup(pc, &parent->map.rot.id_center, &ed->map.rot.id_center); 8765 data_queue_copied_part_lookup(pc, &parent->map.rot.id_center, &ed->map.rot.id_center);
8766 data_queue_copied_part_lookup(pc, &parent->map.zoom.id_center, &ed->map.zoom.id_center);
8762 8767
8763 /* make sure all the allocated memory is getting copied, not just 8768 /* make sure all the allocated memory is getting copied, not just
8764 * referenced 8769 * referenced
@@ -14294,6 +14299,57 @@ st_collections_group_parts_part_description_map_light(void)
14294 } 14299 }
14295} 14300}
14296 14301
14302/** @edcsubsection{collections_group_parts_description_map_zoom,
14303 * Group.Parts.Part.Description.Map.Zoom} */
14304
14305/**
14306 @page edcref
14307 @block
14308 rotation
14309 @context
14310 map {
14311 ..
14312 zoom {
14313 center: "name";
14314 x: 1.0;
14315 y: 1.0;
14316 }
14317 ..
14318 }
14319 @description
14320 Zooms the part, optionally from the center on another part.
14321 @endblock
14322
14323 @property
14324 center
14325 @parameters
14326 [another part's name]
14327 @effect
14328 This sets the part that is used as the center of zoom when
14329 zooming the part with this description. The part's center point
14330 is used as the zoom center when applying zoom from the
14331 x and y axes. If no center is given, the parts original center
14332 itself is used for the zoom center.
14333 @endproperty
14334*/
14335static void
14336st_collections_group_parts_part_description_map_zoom_center(void)
14337{
14338 Edje_Part_Collection *pc;
14339
14340 check_arg_count(1);
14341
14342 pc = eina_list_data_get(eina_list_last(edje_collections));
14343
14344 {
14345 char *name;
14346
14347 name = parse_str(0);
14348 data_queue_part_lookup(pc, name, &(current_desc->map.zoom.id_center));
14349 free(name);
14350 }
14351}
14352
14297/** 14353/**
14298 @page edcref 14354 @page edcref
14299 @property 14355 @property