static void st_collections_group_parts_part_description_map_color(void);
static void st_collections_group_parts_part_description_map_zoom_x(void);
static void st_collections_group_parts_part_description_map_zoom_y(void);
+static void st_collections_group_parts_part_description_map_zoom_center(void);
static void st_collections_group_parts_part_description_perspective_zplane(void);
static void st_collections_group_parts_part_description_perspective_focal(void);
static void st_collections_group_parts_part_api(void);
{"collections.group.parts.part.description.map.color", st_collections_group_parts_part_description_map_color},
{"collections.group.parts.part.description.map.zoom.x", st_collections_group_parts_part_description_map_zoom_x},
{"collections.group.parts.part.description.map.zoom.y", st_collections_group_parts_part_description_map_zoom_y},
+ {"collections.group.parts.part.description.map.zoom.center", st_collections_group_parts_part_description_map_zoom_center},
{"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane},
{"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal},
{"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int},
part_lookup_del(pc, &(ed->map.id_persp));
part_lookup_del(pc, &(ed->map.id_light));
part_lookup_del(pc, &(ed->map.rot.id_center));
+ part_lookup_del(pc, &(ed->map.zoom.id_center));
switch (ep->type)
{
ed->map.id_persp = -1;
ed->map.id_light = -1;
ed->map.rot.id_center = -1;
+ ed->map.zoom.id_center = -1;
ed->map.rot.x = FROM_DOUBLE(0.0);
ed->map.rot.y = FROM_DOUBLE(0.0);
ed->map.rot.z = FROM_DOUBLE(0.0);
data_queue_copied_part_lookup(pc, &parent->map.id_persp, &ed->map.id_persp);
data_queue_copied_part_lookup(pc, &parent->map.id_light, &ed->map.id_light);
data_queue_copied_part_lookup(pc, &parent->map.rot.id_center, &ed->map.rot.id_center);
+ data_queue_copied_part_lookup(pc, &parent->map.zoom.id_center, &ed->map.zoom.id_center);
/* make sure all the allocated memory is getting copied, not just
* referenced
}
}
+/** @edcsubsection{collections_group_parts_description_map_zoom,
+ * Group.Parts.Part.Description.Map.Zoom} */
+
+/**
+ @page edcref
+ @block
+ rotation
+ @context
+ map {
+ ..
+ zoom {
+ center: "name";
+ x: 1.0;
+ y: 1.0;
+ }
+ ..
+ }
+ @description
+ Zooms the part, optionally from the center on another part.
+ @endblock
+
+ @property
+ center
+ @parameters
+ [another part's name]
+ @effect
+ This sets the part that is used as the center of zoom when
+ zooming the part with this description. The part's center point
+ is used as the zoom center when applying zoom from the
+ x and y axes. If no center is given, the parts original center
+ itself is used for the zoom center.
+ @endproperty
+*/
+static void
+st_collections_group_parts_part_description_map_zoom_center(void)
+{
+ Edje_Part_Collection *pc;
+
+ check_arg_count(1);
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+
+ {
+ char *name;
+
+ name = parse_str(0);
+ data_queue_part_lookup(pc, name, &(current_desc->map.zoom.id_center));
+ free(name);
+ }
+}
+
/**
@page edcref
@property
edje/table.edc \
edje/text.edc \
edje/textblock-hyphen.edc \
-edje/toggle_using_filter.edc
+edje/toggle_using_filter.edc \
+edje/center_zoom.edc
MULTISENSE_EDCS = edje/multisense.edc
if ENABLE_MULTISENSE
--- /dev/null
+collections {
+group { name: "center_zoom_example";
+ min: 360 360;
+ max: 360 360;
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 255;
+ }
+ }
+ part {
+ name: "center_part";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ min: 25 25;
+ max: 25 25;
+ rel1.to:"bg";
+ rel2 {
+ relative: 1.0 0.5;
+ to: "bg";
+ }
+ }
+ }
+ part {
+ name: "rectangle";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 0 0 255 128;
+ max: 150 150;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ }
+ map {
+ on: 1;
+ zoom {
+ center: "center_part";
+ x: 0.0;
+ y: 0.0;
+ }
+ }
+ }
+ description {
+ state: "zoom" 0.0;
+ inherit: "default" 0.0;
+ map {
+ on: 1;
+ zoom {
+ center: "center_part";
+ x: 1;
+ y: 1;
+ }
+ }
+ }
+ }
+ part {
+ name: "title";
+ type: TEXT;
+ description {
+ state: "default" 0.0;
+ color: 200 200 200 255;
+ align: 0.5 0.0;
+ rel1.to:"bg";
+ rel2 {
+ relative: 1.0 0.0;
+ to: "bg";
+ }
+ text {
+ text: "Center Zoom Example";
+ font: "Sans";
+ size: 16;
+ min: 1 1;
+ }
+ }
+ }
+ part {
+ name: "event";
+ type: RECT;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "move,bottom";
+ signal: "mouse,up,1";
+ source: "event";
+ action: STATE_SET "zoom" 0.0;
+ transition: LINEAR 1.0;
+ target: "rectangle";
+ }
+ }
+ }
+}
+
'textblock-hyphen.edc',
'toggle_using_filter.edc',
'multisense.edc',
+ 'center_zoom.edc',
]
if (get_option('physics'))
static Edje_Part_Description_Common *_edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src, Edje_Part_Description_Common **dst, unsigned char type);
static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep,
- Edje_Part_Description_Common *desc, Edje_Part_Description_Common *chosen_desc,
- Edje_Real_Part *center, Edje_Real_Part *light, Edje_Real_Part *persp,
+ Edje_Part_Description_Common *desc,
+ Edje_Part_Description_Common *chosen_desc,
+ Edje_Real_Part *center,
+ Edje_Real_Part *zoom_center,
+ Edje_Real_Part *light, Edje_Real_Part *persp,
Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y,
Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y,
Edje_Real_Part *clip_to,
_edje_part_recalc_single_map(Edje *ed,
Edje_Real_Part *ep EINA_UNUSED,
Edje_Real_Part *center,
+ Edje_Real_Part *zoom_center,
Edje_Real_Part *light,
Edje_Real_Part *persp,
Edje_Part_Description_Common *desc,
EINA_COW_CALC_MAP_BEGIN(params, params_write)
{
+ //rotation center
if (center)
{
params_write->center.x = ed->x + center->x + (center->w / 2);
params_write->center.y = ed->y + params->final.y + (params->final.h / 2);
}
params_write->center.z = 0;
+ //zoom center
+ if (zoom_center)
+ {
+ params_write->zoom_center.x = ed->x + zoom_center->x + (zoom_center->w / 2);
+ params_write->zoom_center.y = ed->y + zoom_center->y + (zoom_center->h / 2);
+ }
+ else
+ {
+ params_write->zoom_center.x = ed->x + params->final.x + (params->final.w / 2);
+ params_write->zoom_center.y = ed->y + params->final.y + (params->final.h / 2);
+ }
params_write->rotation.x = desc->map.rot.x;
params_write->rotation.y = desc->map.rot.y;
Edje_Part_Description_Common *desc,
Edje_Part_Description_Common *chosen_desc,
Edje_Real_Part *center,
+ Edje_Real_Part *zoom_center,
Edje_Real_Part *light,
Edje_Real_Part *persp,
Edje_Real_Part *rel1_to_x,
EINA_COW_CALC_PHYSICS_END(params, params_write);
}
#endif
- _edje_part_recalc_single_map(ed, ep, center, light, persp, desc, chosen_desc, params);
+ _edje_part_recalc_single_map(ed, ep, center, zoom_center, light, persp, desc, chosen_desc, params);
}
static void
//zoom
evas_map_util_zoom(map,
pf->ext->map->zoom.x, pf->ext->map->zoom.y,
- pf->ext->map->center.x, pf->ext->map->center.y);
+ pf->ext->map->zoom_center.x, pf->ext->map->zoom_center.y);
//rotate
evas_map_util_3d_rotate(map,
int statep2 = -1;
int statecl = -1;
Edje_Real_Part *center[2] = { NULL, NULL };
+ Edje_Real_Part *zoom_center[2] = { NULL, NULL };
Edje_Real_Part *light[2] = { NULL, NULL };
Edje_Real_Part *persp[2] = { NULL, NULL };
Edje_Real_Part *rp1[4] = { NULL, NULL, NULL, NULL };
if (ep->param1.description->map.on)
{
center[0] = _edje_real_part_state_get(ed, ep, flags, ep->param1.description->map.rot.id_center, &statec1);
+ zoom_center[0] = _edje_real_part_state_get(ed, ep, flags, ep->param1.description->map.zoom.id_center, &statec1);
light[0] = _edje_real_part_state_get(ed, ep, flags, ep->param1.description->map.id_light, &statel1);
if (chosen_desc->map.persp_on)
if (ep->param2 && ep->param2->description->map.on)
{
center[1] = _edje_real_part_state_get(ed, ep, flags, ep->param2->description->map.rot.id_center, &statec2);
+ zoom_center[1] = _edje_real_part_state_get(ed, ep, flags, ep->param2->description->map.zoom.id_center, &statec2);
light[1] = _edje_real_part_state_get(ed, ep, flags, ep->param2->description->map.id_light, &statel2);
if (chosen_desc->map.persp_on)
#endif
{
_edje_part_recalc_single(ed, ep, ep->param1.description,
- chosen_desc, center[0], light[0],
+ chosen_desc, center[0], zoom_center[0], light[0],
persp[0], rp1[Rel1X], rp1[Rel1Y],
rp1[Rel2X], rp1[Rel2Y], clip1, confine_to,
threshold, p1, mmw, mmh,
#endif
{
_edje_part_recalc_single(ed, ep, ep->param2->description,
- chosen_desc, center[1], light[1],
+ chosen_desc, center[1], zoom_center[1], light[1],
persp[1], rp2[Rel1X], rp2[Rel1Y],
rp2[Rel2X], rp2[Rel2Y], clip2, confine_to,
threshold, p2, mmw, mmh,
p3_write->center.x = INTP(p1->ext->map->center.x, p2->ext->map->center.x, pos);
p3_write->center.y = INTP(p1->ext->map->center.y, p2->ext->map->center.y, pos);
p3_write->center.z = INTP(p1->ext->map->center.z, p2->ext->map->center.z, pos);
+ p3_write->zoom_center.x = INTP(p1->ext->map->zoom_center.x, p2->ext->map->zoom_center.x, pos);
+ p3_write->zoom_center.y = INTP(p1->ext->map->zoom_center.y, p2->ext->map->zoom_center.y, pos);
p3_write->rotation.x = FFP(p1->ext->map->rotation.x, p2->ext->map->rotation.x, pos);
p3_write->rotation.y = FFP(p1->ext->map->rotation.y, p2->ext->map->rotation.y, pos);
p3_write->rotation.z = FFP(p1->ext->map->rotation.z, p2->ext->map->rotation.z, pos);
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.id_persp", map.id_persp, EET_T_INT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.id_light", map.id_light, EET_T_INT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.id_center", map.rot.id_center, EET_T_INT); \
+ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.zoom.id_center", map.zoom.id_center, EET_T_INT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.x", map.rot.x, EDJE_T_FLOAT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.y", map.rot.y, EDJE_T_FLOAT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.z", map.rot.z, EDJE_T_FLOAT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.id_persp", Dec.map.id_persp, EET_T_INT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.id_light", Dec.map.id_light, EET_T_INT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.id_center", Dec.map.rot.id_center, EET_T_INT); \
+ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.zoom.id_center", Dec.map.zoom.id_center, EET_T_INT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.x", Dec.map.rot.x, EDJE_T_FLOAT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.y", Dec.map.rot.y, EDJE_T_FLOAT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.z", Dec.map.rot.z, EDJE_T_FLOAT); \
Edje_Global *_edje_global_obj = NULL;
static const Edje_Calc_Params_Map default_calc_map = {
- { 0, 0, 0 }, { 0.0, 0.0, 0.0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0.0, 0.0 }, NULL, 0
+ { 0, 0, 0 }, { 0, 0 }, { 0.0, 0.0, 0.0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0.0, 0.0 }, NULL, 0
};
static const Edje_Calc_Params_Physics default_calc_physics = {
} rot;
struct {
FLOAT_T x, y;
+ int id_center;
} zoom;
Edje_Map_Color **colors; /* List of the Edje_Map_Color */
unsigned int colors_count;
int x, y, z;
} center; // 12
struct {
+ int x, y;
+ } zoom_center; // 12
+ struct {
FLOAT_T x, y, z;
} rotation; // 24
struct {