add timer for zoom navigation 71/34871/1 accepted/tizen/tv/20150205.022723 submit/tizen_tv/20150204.221842
authorJehun Lim <jehun.lim@samsung.com>
Wed, 4 Feb 2015 02:39:33 +0000 (11:39 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Wed, 4 Feb 2015 02:39:33 +0000 (11:39 +0900)
Change-Id: I841ae3b8e5661792998c5ba9cb94a80ecc50daeb
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
include/common/define.h
include/view/photo-viewer/zoom_view.h
src/view/photo-viewer/zoom_view.cpp

index 989c520..e4a1076 100644 (file)
 
 /* others */
 #define TIMEOUT_TOOLTIP 3.0
+#define TIMEOUT_ZOOMNAVI 0.25
 /* TODO: Need to set timers as per specs */
 #define TIMEOUT_PHOTOVIEWER 3.0
 #define TIMEOUT_PHOTOZOOM 3.0
index 2c4c535..9de65f9 100644 (file)
@@ -31,8 +31,8 @@ private:
        struct SPhotoZoomView *m;
 
 private:
-       static Eina_Bool sm_CbIdler(void *data);
-       Eina_Bool m_OnIdler(void);
+       static Eina_Bool sm_CbTimer(void *data);
+       Eina_Bool m_OnTimer(void);
 
        static void sm_CbContentMoved(void *dt, Evas_Object *obj, void *event_info);
        void m_OnContentMoved(Evas_Object *obj);
@@ -78,4 +78,4 @@ public:
 };
 
 
-#endif /* __ZOOM_VIEW_H__ */
\ No newline at end of file
+#endif /* __ZOOM_VIEW_H__ */
index d913ada..66e3c4f 100644 (file)
@@ -60,7 +60,8 @@ struct SPhotoZoomView {
        int prev_event;
 
        struct zoom_data *data;
-       Ecore_Idler *idler;
+
+       Ecore_Timer *timer;
 
        struct SArrow {
                Evas_Object *eoLeft;
@@ -99,7 +100,7 @@ struct SPhotoZoomView {
        private:
                SPhotoZoomView *m;
 
-       protected:              
+       protected:
                void t_MoveZoomNavi(Evas_Coord_Point coord)
                {
                        int x, y, w, h, w2, h2;
@@ -170,7 +171,8 @@ struct SPhotoZoomView {
                prev_event = 0;;
 
                data = NULL;
-               idler = NULL;
+               timer = NULL;
+
                pHandlerArrow = new CHandlerArrow(this);
                pHandlerZoomNavi = new CHandlerZoomNavi(this);
                pHandlerRect = new CHandlerZoomNavi(this);
@@ -184,21 +186,22 @@ struct SPhotoZoomView {
 };
 
 
-Eina_Bool CPhotoZoomView::sm_CbIdler(void *data)
+Eina_Bool CPhotoZoomView::sm_CbTimer(void *data)
 {
        CPhotoZoomView *root = (CPhotoZoomView*)data;
        Eina_Bool ret = ECORE_CALLBACK_CANCEL;
 
        if (root)
-               ret = root->m_OnIdler();
+               ret = root->m_OnTimer();
 
        return ret;
 }
 
 
-Eina_Bool CPhotoZoomView::m_OnIdler(void)
+Eina_Bool CPhotoZoomView::m_OnTimer(void)
 {
-       m->idler = NULL;
+       ecore_timer_del(m->timer);
+       m->timer = NULL;
 
        elm_photocam_zoom_mode_set(m->eoPhotocam,
                ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
@@ -537,15 +540,14 @@ bool CPhotoZoomView::Create(void *data)
        if (!m_DrawZoomNavi())
                goto error;
 
-       m->idler = ecore_idler_add(sm_CbIdler, this);
-       if (!m->idler)
+       m->timer = ecore_timer_add(TIMEOUT_ZOOMNAVI, sm_CbTimer, this);
+       if (!m->timer)
                goto error;
 
        if (!m->cTimeout.Create(TIMEOUT_PHOTOZOOM, this))
                goto error;
 
        CListenerMgr::Connect(m->eoBase);  //evas_object_event_callback_add(m->eoBase, EVAS_CALLBACK_KEY_DOWN, _base_key_pressed, m);
-       CListenerMgr::Connect(m->eoBase);    //evas_object_event_callback_add(m->eoBase, EVAS_CALLBACK_KEY_UP,   _base_key_released, m);
 
        CBaseView::Create(NULL);
 
@@ -570,7 +572,6 @@ void CPhotoZoomView::Destroy(void)
        if (m->data)
                free(m->data);
 
-       ecore_idler_del(m->idler);
        m->cTimeout.Destroy();
        evas_object_del(m->eoBase);