From bbdfe393e4bf5aee5d00dacb704b0e7510921ecd Mon Sep 17 00:00:00 2001 From: Vitalii Vorobiov Date: Tue, 17 Jan 2017 16:30:45 +0200 Subject: [PATCH] Edje_Edit: add forgotten API for map.zoom.x/y --- src/lib/edje/Edje_Edit.h | 30 ++++++++++++++++++++++++++++++ src/lib/edje/edje_edit.c | 23 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 7997cbf8aa..2b6c1c610c 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -5732,6 +5732,36 @@ EAPI Eina_Bool edje_edit_state_map_perspective_zplane_set(Evas_Object *obj, cons **/ EAPI const char * edje_edit_state_map_rotation_center_get(Evas_Object *obj, const char *part, const char *state, double value); +/** Set map.zoom (x and y) values of given part state. + * + * @param obj Object being edited. + * @param part The name of the part. + * @param state The name of the state (not including the state value). + * @param value The state value. + * @param x value of x + * @param y value of y + * + * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise. + * @since 1.19 + **/ +EAPI Eina_Bool +edje_edit_state_map_zoom_set(Evas_Object *obj, const char *part, const char *state, double value, double x, double y); + +/** Get map.zoom (x and y) values of given part state. + * + * @param obj Object being edited. + * @param part The name of the part. + * @param state The name of the state (not including the state value). + * @param value The state value. + * @param x variable to store value of x + * @param y variable to store value of y + * + * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise. + * @since 1.19 + **/ +EAPI Eina_Bool +edje_edit_state_map_zoom_get(Evas_Object *obj, const char *part, const char *state, double value, double *x, double *y); + /** This sets the part that is used as the center of rotation when rotating the part with this description. If no center is given, the parts original center itself is used for the rotation center. * * @param obj Object being edited. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 38b08e6570..c57355339a 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -7856,6 +7856,29 @@ edje_edit_state_map_rotation_get(Evas_Object *obj, const char *part, const char return EINA_TRUE; } +EAPI Eina_Bool +edje_edit_state_map_zoom_set(Evas_Object *obj, const char *part, const char *state, double value, double x, double y) +{ + GET_PD_OR_RETURN(EINA_FALSE); + + pd->map.zoom.x = FROM_DOUBLE(x); + pd->map.zoom.y = FROM_DOUBLE(y); + + edje_object_calc_force(obj); + return EINA_TRUE; +} + +EAPI Eina_Bool +edje_edit_state_map_zoom_get(Evas_Object *obj, const char *part, const char *state, double value, double *x, double *y) +{ + GET_PD_OR_RETURN(EINA_FALSE); + + if (x) *x = TO_DOUBLE(pd->map.zoom.x); + if (y) *y = TO_DOUBLE(pd->map.zoom.y); + + return EINA_TRUE; +} + EAPI Eina_Bool edje_edit_state_map_perspective_zplane_set(Evas_Object *obj, const char *part, const char *state, double value, int zplane) {