resolve missing return statement
[framework/uifw/elementary.git] / src / lib / elm_map.c
index 7134003..6b14a2d 100644 (file)
@@ -295,6 +295,8 @@ static const char SIG_NAME_LOADED[] = "name,loaded";
 static const char SIG_NAME_LOADED_FAIL[] = "name,loaded,fail";
 static const char SIG_OVERLAY_CLICKED[] = "overlay,clicked";
 static const char SIG_OVERLAY_DEL[] = "overlay,del";
+static const char SIG_LANG_CHANGED[] = "language,changed";
+
 static const Evas_Smart_Cb_Description _smart_callbacks[] = {
    {SIG_CLICKED, ""},
    {SIG_CLICKED_DOUBLE, ""},
@@ -320,6 +322,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
    {SIG_NAME_LOADED_FAIL, ""},
    {SIG_OVERLAY_CLICKED, ""},
    {SIG_OVERLAY_DEL, ""},
+   {SIG_LANG_CHANGED, ""},
    {NULL, NULL}
 };
 
@@ -337,6 +340,13 @@ ELM_INTERNAL_SMART_SUBCLASS_NEW
   (ELM_MAP_PAN_SMART_NAME, _elm_map_pan, Elm_Map_Pan_Smart_Class,
   Elm_Pan_Smart_Class, elm_pan_smart_class_get, NULL);
 
+static Eina_Bool
+_elm_map_smart_translate(Evas_Object *obj)
+{
+   evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
+   return EINA_TRUE;
+}
+
 static void
 _edj_overlay_size_get(Elm_Map_Smart_Data *sd,
                       Evas_Coord *w,
@@ -511,10 +521,18 @@ _coord_to_canvas_no_rotation(Elm_Map_Smart_Data *sd,
 {
    Evas_Coord vx, vy, sx, sy;
 
-   _viewport_coord_get(sd, &vx, &vy, NULL, NULL);
-   evas_object_geometry_get(sd->pan_obj, &sx, &sy, NULL, NULL);
-   if (xx) *xx = x - vx + sx;
-   if (yy) *yy = y - vy + sy;
+   if (!strcmp(sd->engine->name, INTERNAL_ENGINE_NAME))
+     {
+        _viewport_coord_get(sd, &vx, &vy, NULL, NULL);
+        evas_object_geometry_get(sd->pan_obj, &sx, &sy, NULL, NULL);
+        if (xx) *xx = x - vx + sx;
+        if (yy) *yy = y - vy + sy;
+   }
+   else
+     {
+        if (xx) *xx = x;
+        if (yy) *yy = y;
+     }
 }
 
 // Map coordinates to canvas geometry
@@ -526,7 +544,10 @@ _coord_to_canvas(Elm_Map_Smart_Data *sd,
                  Evas_Coord *yy)
 {
    _coord_to_canvas_no_rotation(sd, x, y, &x, &y);
-   _rotate_do(x, y, sd->pan_rotate.cx, sd->pan_rotate.cy, sd->pan_rotate.d, &x, &y);
+   if (!strcmp(sd->engine->name, INTERNAL_ENGINE_NAME))
+     {
+        _rotate_do(x, y, sd->pan_rotate.cx, sd->pan_rotate.cy, sd->pan_rotate.d, &x, &y);
+     }
    if (xx) *xx = x;
    if (yy) *yy = y;
 }
@@ -1361,14 +1382,7 @@ _overlay_default_show(Overlay_Default *ovl)
         h = ovl->h;
      }
    _coord_to_canvas(ovl->wsd, ovl->x, ovl->y, &x, &y);
-
-   if (!strcmp(ovl->wsd->engine->name, INTERNAL_ENGINE_NAME))
-     _obj_place(disp, x - (w / 2), y - (h / 2), w, h);
-   else
-     {
-        evas_object_geometry_get(ovl->wsd->layout, &x, &y, NULL, NULL);
-        _obj_place(disp, (x + ovl->x) - (w / 2), (y + ovl->y) - (h / 2), w, h);
-     }
+   _obj_place(disp, x - (w / 2), y - (h / 2), w, h);
 }
 
 static void
@@ -3196,6 +3210,7 @@ _pinch_rotate_cb(void *data,
         x = x + ((double)w * 0.5);
         y = y + ((double)h * 0.5);
         sd->engine->rotate(ELM_WIDGET_DATA(sd)->obj, angle, x, y, 0);
+        _overlay_place(sd);
      }
 
    return EVAS_EVENT_FLAG_NONE;
@@ -4488,6 +4503,15 @@ _elm_map_smart_del(Evas_Object *obj)
 }
 
 static void
+_elm_map_smart_calculate(Evas_Object *obj)
+{
+   ELM_MAP_DATA_GET(obj, sd);
+
+   if (strcmp(sd->engine->name, INTERNAL_ENGINE_NAME))
+     _overlay_place(sd);
+}
+
+static void
 _elm_map_smart_move(Evas_Object *obj,
                     Evas_Coord x,
                     Evas_Coord y)
@@ -4498,7 +4522,11 @@ _elm_map_smart_move(Evas_Object *obj,
 
    if (!strcmp(sd->engine->name, INTERNAL_ENGINE_NAME))
       evas_object_move(sd->hit_rect, x, y);
-   else sd->engine->move(obj, x, y);
+   else
+     {
+        sd->engine->move(obj, x, y);
+        _overlay_place(sd);
+     }
 }
 
 static void
@@ -4512,7 +4540,11 @@ _elm_map_smart_resize(Evas_Object *obj,
 
    if (!strcmp(sd->engine->name, INTERNAL_ENGINE_NAME))
       evas_object_resize(sd->hit_rect, w, h);
-   else sd->engine->resize(obj, w, h);
+   else
+     {
+        sd->engine->resize(obj, w, h);
+        _overlay_place(sd);
+     }
 }
 
 static void
@@ -4532,6 +4564,8 @@ _elm_map_smart_set_user(Elm_Map_Smart_Class *sc)
 {
    ELM_WIDGET_CLASS(sc)->base.add = _elm_map_smart_add;
    ELM_WIDGET_CLASS(sc)->base.del = _elm_map_smart_del;
+   ELM_WIDGET_CLASS(sc)->base.calculate = _elm_map_smart_calculate;
+
    ELM_WIDGET_CLASS(sc)->base.move = _elm_map_smart_move;
    ELM_WIDGET_CLASS(sc)->base.resize = _elm_map_smart_resize;
    ELM_WIDGET_CLASS(sc)->base.member_add = _elm_map_smart_member_add;
@@ -4539,6 +4573,7 @@ _elm_map_smart_set_user(Elm_Map_Smart_Class *sc)
    ELM_WIDGET_CLASS(sc)->on_focus = _elm_map_smart_on_focus;
    ELM_WIDGET_CLASS(sc)->theme = _elm_map_smart_theme;
    ELM_WIDGET_CLASS(sc)->event = _elm_map_smart_event;
+   ELM_WIDGET_CLASS(sc)->translate = _elm_map_smart_translate;
 }
 #endif
 
@@ -5834,7 +5869,9 @@ elm_map_overlay_region_set(Elm_Map_Overlay *overlay,
      }
    else ERR("Not supported overlay type: %d", overlay->type);
 
-   evas_object_smart_changed(overlay->wsd->pan_obj);
+   if (!strcmp(overlay->wsd->engine->name, INTERNAL_ENGINE_NAME))
+     evas_object_smart_changed(overlay->wsd->pan_obj);
+   else _overlay_place(overlay->wsd);
 #else
    (void)overlay;
    (void)lon;