elementary/transit - added elm_transit_smooth_set(), elm_transit_smooth_get()
authorChunEon Park <hermet@hermet.pe.kr>
Thu, 28 Feb 2013 08:21:07 +0000 (17:21 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Thu, 28 Feb 2013 08:21:07 +0000 (17:21 +0900)
legacy/elementary/ChangeLog
legacy/elementary/NEWS
legacy/elementary/src/lib/elm_transit.c
legacy/elementary/src/lib/elm_transit.h

index 494c053..29461bd 100644 (file)
         * 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()
index 09e2458..c628090 100644 (file)
@@ -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:
 
index 5af1126..d54284d 100644 (file)
@@ -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;
 }
@@ -580,6 +582,20 @@ elm_transit_objects_get(const Elm_Transit *transit)
 }
 
 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)
 {
    ELM_TRANSIT_CHECK_OR_RETURN(transit);
@@ -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);
      }
index 01ac928..b3c5a6e 100644 (file)
@@ -631,6 +631,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.
  *
  * @note This API is one of the facades. It creates resizing effect context