From 79fd0192d9f2cd3be3fb190aff3c92628c44363c Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Thu, 28 Feb 2013 17:21:07 +0900 Subject: [PATCH] elementary/transit - added elm_transit_smooth_set(), elm_transit_smooth_get() --- legacy/elementary/ChangeLog | 4 ++++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elm_transit.c | 22 ++++++++++++++++- legacy/elementary/src/lib/elm_transit.h | 32 +++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 494c0531f8..29461bd476 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1071,3 +1071,7 @@ * Add the option about sending signals in content_pos_set. When the scroller is resized, the signals("elm,action,scroll", "elm,edge,top" so on) shouldn't be sent, because it's not a scroll-action. So in this case, the content_pos_set should be called without the signals. + +2013-02-28 ChunEon Park (Hermet) + + * Add elm_transit_smooth_set(), elm_transit_smooth_get() diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 09e245853f..c628090531 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -42,6 +42,7 @@ Additions: * Support widget orientation mode in order to widgets have multiple styles for each window degree. * Add elm_drop_target_add() elm_drop_target_del() and elm_drag_start() * Add the option about sending signals in content_pos_set. + * Add elm_transit_smooth_set(), elm_transit_smooth_get() Improvements: diff --git a/legacy/elementary/src/lib/elm_transit.c b/legacy/elementary/src/lib/elm_transit.c index 5af1126da5..d54284dd98 100644 --- a/legacy/elementary/src/lib/elm_transit.c +++ b/legacy/elementary/src/lib/elm_transit.c @@ -59,6 +59,7 @@ struct _Elm_Transit Eina_Bool deleted : 1; Eina_Bool state_keep : 1; Eina_Bool finished : 1; + Eina_Bool smooth : 1; }; struct _Elm_Transit_Effect_Module @@ -472,6 +473,7 @@ elm_transit_add(void) transit->v1 = 1.0; transit->v2 = 0.0; + transit->smooth = EINA_TRUE; return transit; } @@ -579,6 +581,20 @@ elm_transit_objects_get(const Elm_Transit *transit) return transit->objs; } +EAPI void +elm_transit_smooth_set(Elm_Transit *transit, Eina_Bool smooth) +{ + ELM_TRANSIT_CHECK_OR_RETURN(transit); + transit->smooth = !!smooth; +} + +EAPI Eina_Bool +elm_transit_smooth_get(const Elm_Transit *transit) +{ + ELM_TRANSIT_CHECK_OR_RETURN(transit, EINA_FALSE); + return transit->smooth; +} + EAPI void elm_transit_event_enabled_set(Elm_Transit *transit, Eina_Bool enabled) { @@ -1069,6 +1085,7 @@ _transit_effect_zoom_op(Elm_Transit_Effect *effect, Elm_Transit *transit , doubl _recover_image_uv(obj, map, EINA_FALSE, EINA_FALSE); evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, _TRANSIT_FOCAL); + if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE); evas_object_map_set(obj, map); evas_object_map_enable_set(obj, EINA_TRUE); } @@ -1225,6 +1242,7 @@ _transit_effect_flip_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, _TRANSIT_FOCAL); evas_object_map_enable_set(front, EINA_TRUE); evas_object_map_enable_set(back, EINA_TRUE); + if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE); evas_object_map_set(obj, map); } evas_map_free(map); @@ -1531,6 +1549,7 @@ _transit_effect_resizable_flip_op(Elm_Transit_Effect *effect, Elm_Transit *trans _TRANSIT_FOCAL); evas_object_map_enable_set(resizable_flip_node->front, EINA_TRUE); evas_object_map_enable_set(resizable_flip_node->back, EINA_TRUE); + if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE); evas_object_map_set(obj, map); } evas_map_free(map); @@ -1753,7 +1772,7 @@ _transit_effect_wipe_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double _elm_fx_wipe_show(map, wipe->dir, _x, _y, _w, _h, (float)progress); else _elm_fx_wipe_hide(map, wipe->dir, _x, _y, _w, _h, (float)progress); - + if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE); evas_object_map_enable_set(obj, EINA_TRUE); evas_object_map_set(obj, map); } @@ -2273,6 +2292,7 @@ _transit_effect_rotation_op(Elm_Transit_Effect *effect, Elm_Transit *transit, do half_h = (float)h * 0.5; evas_map_util_rotate(map, degree, x + half_w, y + half_h); + if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE); evas_object_map_enable_set(obj, EINA_TRUE); evas_object_map_set(obj, map); } diff --git a/legacy/elementary/src/lib/elm_transit.h b/legacy/elementary/src/lib/elm_transit.h index 01ac928dbf..b3c5a6e45c 100644 --- a/legacy/elementary/src/lib/elm_transit.h +++ b/legacy/elementary/src/lib/elm_transit.h @@ -630,6 +630,38 @@ EAPI void elm_transit_chain_transit_del(Elm_Transit *transit, */ EAPI Eina_List *elm_transit_chain_transits_get(const Elm_Transit *transit); +/** + * Set the smooth effect for a transit. + * + * @param obj The transit object + * @param enabled enable or disable smooth map rendering + * + * This sets smoothing for transit map rendering. If the object added in a + * transit is a type that has its own smoothing settings, then both the smooth + * settings for this object and the map must be turned off. By default smooth + * maps are enabled. + * + * @see evas_map_smooth_set() + * @since 1.8 + * + * @ingroup Transit + */ +EAPI void elm_transit_smooth_set(Elm_Transit *transit, Eina_Bool smooth); + +/** + * Get the smooth scaling for transit map rendering + * + * This gets smooth scaling for transit map rendering. + * + * @param obj The transit object + * @return @c EINA_TRUE if the smooth is enabled, @c EINA_FALSE otherwise. + * + * @see elm_transit_smooth_set() + * @since 1.8 + * + */ +Eina_Bool elm_transit_smooth_get(const Elm_Transit *transit); + /** * Add the Resizing Effect to Elm_Transit. *