{NULL, NULL}
};
+static void
+_sizing_eval(void *data)
+{
+ Elm_Animation_View_Data *pd = data;
+ if (!pd->file) return;
+
+ double hw,hh;
+ evas_object_size_hint_weight_get(pd->obj, &hw, &hh);
+
+ int sizew, sizeh;
+ eo_do(pd->vg, evas_obj_vg_default_size_get(&sizew, &sizeh));
+
+ int minw = -1;
+ int minh = -1;
+ if (hw == 0) minw = sizew;
+ if (hh == 0) minh = sizeh;
+
+ evas_object_size_hint_min_set(pd->obj, minw, minh);
+}
+
+static void
+_size_hint_event_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
+{
+ _sizing_eval(data);
+}
+
static void
_transit_go_facade(Elm_Animation_View_Data *pd)
{
// Create vg to render vector animation
Eo *vg = evas_object_vg_add(evas_object_evas_get(obj));
elm_widget_resize_object_set(obj, vg, EINA_TRUE);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hint_event_cb, priv);
priv->vg = vg;
priv->speed = 1;
pd->file = eina_stringshare_add(file);
pd->keyframe = 0;
+ _sizing_eval(pd);
+
if (!pd->file)
{
pd->state = ELM_ANIMATION_VIEW_STATE_NOT_READY;
Elm_Animation_View_Data *pd)
{
eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
+
+ _sizing_eval(pd);
+
_auto_play(pd, _visible_check(obj));
+
}
EOLIAN static void
return pd->frame_duration;
}
+EAPI Eina_Size2D
+elm_animation_view_default_size_get(const Elm_Animation_View *obj)
+{
+ Eina_Size2D size = {0, 0};
+
+ ELM_ANIMATION_VIEW_DATA_GET(obj, pd);
+ if (!pd) return size;
+
+ eo_do(pd->vg, evas_obj_vg_default_size_get(&size.w, &size.h));
+
+ return size;
+}
+
EAPI Elm_Animation_View*
elm_animation_view_add(Evas_Object *parent)
{
*/
EAPI Eina_Bool elm_animation_view_is_playing_back(const Elm_Animation_View *obj);
+/**
+ * @brief Get the default view size that specified from vector resource.
+ *
+ * @return default size.
+ *
+ * @since 1.22
+ *
+ * @ingroup Elm_Animation_View
+ */
+
+EAPI Eina_Size2D
+elm_animation_view_default_size_get(const Elm_Animation_View *obj);
+
+
#include "elm_animation_view.eo.legacy.h"