evas vg: add 2 more legacy apis. 80/189580/1
authorHermet Park <hermetpark@gmail.com>
Wed, 19 Sep 2018 02:10:30 +0000 (11:10 +0900)
committerHermet Park <hermetpark@gmail.com>
Wed, 19 Sep 2018 02:14:46 +0000 (11:14 +0900)
evas_object_vg_animated_frame_count_get()
evas_object_vg_animated_frame_set()

@feature

Change-Id: I3081551f6da06cdaaecf20471296f58d5412781c

src/lib/evas/Evas_Legacy.h
src/lib/evas/canvas/efl_canvas_vg.c

index 2eebfb8..8a64694 100755 (executable)
@@ -3638,6 +3638,26 @@ EAPI Evas_Object *evas_object_rectangle_add(Evas *e) EINA_WARN_UNUSED_RESULT EIN
  */
 EAPI Evas_Object *evas_object_vg_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
 
+/**
+ * Get the total number of frames of the vector, if animated.
+ *
+ * @return 0, if not animated.
+ *
+ * @since 1.22
+ */
+EAPI int evas_object_vg_animated_frame_count_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
+/**
+ * Set the frame to current frame of an animated vector.
+ *
+ * @param[in] frame_index The index of current frame.
+ *
+ * @return Returns @c EINA_TRUE, if the frame index is valid.
+ *
+ * @since 1.22
+ */
+EAPI Eina_Bool evas_object_vg_animated_frame_set(Evas_Object *obj, int frame_index) EINA_ARG_NONNULL(1, 2);
+
 #include "canvas/efl_canvas_vg_node.eo.legacy.h"
 #include "canvas/efl_canvas_vg.eo.legacy.h"
 #include "canvas/efl_canvas_vg_container.eo.legacy.h"
index e2bf066..bbc15f2 100644 (file)
@@ -120,16 +120,6 @@ _evas_vg_resize(void *data, const Efl_Event *ev)
    _update_vgtree_viewport(ev->object, pd);
 }
 
-/* the actual api call to add a vector graphic object */
-EAPI Evas_Object *
-evas_object_vg_add(Evas *e)
-{
-   e = evas_find(e);
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
-   // TODO: Ask backend to return the main Ector_Surface
-   return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
-}
-
 EOLIAN static Efl_VG *
 _efl_canvas_vg_root_node_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd)
 {
@@ -980,5 +970,26 @@ _efl_canvas_vg_efl_gfx_image_animation_controller_animated_frame_get(const Eo *e
 {
    return pd->frame_index;
 }
+/* the actual api call to add a vector graphic object */
+EAPI Evas_Object *
+evas_object_vg_add(Evas *e)
+{
+   e = evas_find(e);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
+   // TODO: Ask backend to return the main Ector_Surface
+   return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
+}
+
+EAPI int
+evas_object_vg_animated_frame_count_get(const Evas_Object *obj)
+{
+   return efl_gfx_image_animated_frame_count_get(obj);
+}
+
+EAPI Eina_Bool
+evas_object_vg_animated_frame_set(Evas_Object *obj, int frame_index)
+{
+   return efl_gfx_image_animated_frame_set(obj, frame_index);
+}
 
 #include "efl_canvas_vg.eo.c"