The more panel should be changed when the theme is changed.
[framework/uifw/elementary.git] / src / lib / elm_photocam.c
index 4f8a65e..021ddcf 100644 (file)
@@ -98,6 +98,7 @@ struct _Widget_Data
    Eina_Bool on_hold : 1;
    Eina_Bool paused : 1;
    Eina_Bool do_region : 1;
+   Eina_Bool do_gesture : 1;
    Eina_Bool zoom_gest : 1;
 };
 
@@ -1017,27 +1018,27 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
    elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h);
 
    if ((!strcmp(ev->keyname, "Left")) ||
-       (!strcmp(ev->keyname, "KP_Left")))
+       ((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
      {
         x -= step_x;
      }
    else if ((!strcmp(ev->keyname, "Right")) ||
-            (!strcmp(ev->keyname, "KP_Right")))
+            ((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
      {
         x += step_x;
      }
    else if ((!strcmp(ev->keyname, "Up"))  ||
-            (!strcmp(ev->keyname, "KP_Up")))
+            ((!strcmp(ev->keyname, "KP_Up")) && (!ev->string)))
      {
         y -= step_y;
      }
    else if ((!strcmp(ev->keyname, "Down")) ||
-            (!strcmp(ev->keyname, "KP_Down")))
+            ((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
      {
         y += step_y;
      }
    else if ((!strcmp(ev->keyname, "Prior")) ||
-            (!strcmp(ev->keyname, "KP_Prior")))
+            ((!strcmp(ev->keyname, "KP_Prior")) && (!ev->string)))
      {
         if (page_y < 0)
           y -= -(page_y * v_h) / 100;
@@ -1045,7 +1046,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
           y -= page_y;
      }
    else if ((!strcmp(ev->keyname, "Next")) ||
-            (!strcmp(ev->keyname, "KP_Next")))
+            ((!strcmp(ev->keyname, "KP_Next")) && (!ev->string)))
      {
         if (page_y < 0)
           y += -(page_y * v_h) / 100;
@@ -1739,12 +1740,6 @@ elm_photocam_image_size_get(const Evas_Object *obj, int *w, int *h)
    if (h) *h = wd->size.imh;
 }
 
-EINA_DEPRECATED EAPI void
-elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
-{
-   return elm_photocam_image_region_get(obj, x, y, w, h);
-}
-
 EAPI void
 elm_photocam_image_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
 {
@@ -1925,12 +1920,12 @@ elm_photocam_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *
 }
 
 EAPI void
-elm_photocam_gesture_set(Evas_Object *obj, Eina_Bool gesture)
+elm_photocam_gesture_enabled_set(Evas_Object *obj, Eina_Bool gesture)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   if ((wd->gest && !!gesture) || (!wd->gest && !gesture)) return;
+   if (wd->do_gesture == !!gesture) return;
 
    if (wd->gest)
      {
@@ -1941,6 +1936,7 @@ elm_photocam_gesture_set(Evas_Object *obj, Eina_Bool gesture)
    if (gesture)
      {
         wd->gest = elm_gesture_layer_add(wd->obj);
+        if (!wd->gest) return;
         elm_gesture_layer_attach(wd->gest, wd->obj);
         elm_gesture_layer_cb_set(wd->gest, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_START,
                                  _gzoom_start, wd);
@@ -1951,16 +1947,16 @@ elm_photocam_gesture_set(Evas_Object *obj, Eina_Bool gesture)
         elm_gesture_layer_cb_set(wd->gest, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_ABORT,
                                  _gzoom_end, wd);
      }
+
+   wd->do_gesture = !!gesture;
 }
 
 EAPI Eina_Bool
-elm_photocam_gesture_get(const Evas_Object *obj)
+elm_photocam_gesture_enabled_get(const Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return EINA_FALSE;
 
-   if (wd->gest)
-     return EINA_TRUE;
-   return EINA_FALSE;
+   return wd->do_gesture;
 }