From: Hermet Park Date: Tue, 13 Sep 2016 07:44:03 +0000 (+0900) Subject: c++: code refactoring. X-Git-Tag: submit/tizen/20160928.045111^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F72%2F88072%2F1;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git c++: code refactoring. use auto specifier for simplifying code. Change-Id: I48ca7cfd2a4aa55a9f83be8af46de989f9590370 --- diff --git a/src/examples/efl/cpp/page12.h b/src/examples/efl/cpp/page12.h index 6342ee6..9de4d0f 100644 --- a/src/examples/efl/cpp/page12.h +++ b/src/examples/efl/cpp/page12.h @@ -53,7 +53,7 @@ protected: evas_object_smart_callback_add(rightBtn, "clicked", [](void *data, Evas_Object *obj, void *event_info) -> void { - page12 *view = static_cast(data); + auto view = static_cast(data); view->createPopup(); }, this); diff --git a/src/examples/efl/cpp/page16.h b/src/examples/efl/cpp/page16.h index f4e7a20..0f311a0 100644 --- a/src/examples/efl/cpp/page16.h +++ b/src/examples/efl/cpp/page16.h @@ -40,25 +40,25 @@ protected: //Title Show Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - UiStandardView *view = static_cast(data); + auto view = static_cast(data); view->setTitleVisible(true, false); }, //Title Hide Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - UiStandardView *view = static_cast(data); + auto view = static_cast(data); view->setTitleVisible(false, false); }, //Title Show Anim Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - UiStandardView *view = static_cast(data); + auto view = static_cast(data); view->setTitleVisible(true, true); }, //Title Hide Anim Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - UiStandardView *view = static_cast(data); + auto view = static_cast(data); view->setTitleVisible(false, true); }, this); diff --git a/src/lib/efl/UiBaseKeyListener.cpp b/src/lib/efl/UiBaseKeyListener.cpp index 174ed16..34ea818 100644 --- a/src/lib/efl/UiBaseKeyListener.cpp +++ b/src/lib/efl/UiBaseKeyListener.cpp @@ -101,8 +101,8 @@ bool UiBaseKeyListenerImpl::init() evas_object_event_callback_add(keyGrabRect, EVAS_CALLBACK_KEY_UP, [](void *data, Evas *e, Evas_Object *obj, void *event_info) -> void { - Evas_Event_Key_Down *ev = static_cast(event_info); - UiBaseKeyListenerImpl *keyListener = static_cast(data); + auto ev = static_cast(event_info); + auto keyListener = static_cast(data); _keyGrabRectKeyUpCb(keyListener, ev); }, this); diff --git a/src/lib/efl/mobile/UiKeyListener.cpp b/src/lib/efl/mobile/UiKeyListener.cpp index 3be92d1..7490309 100644 --- a/src/lib/efl/mobile/UiKeyListener.cpp +++ b/src/lib/efl/mobile/UiKeyListener.cpp @@ -30,7 +30,7 @@ UiKeyListener::UiKeyListener(UiViewmgr *viewmgr) void UiKeyListener::extendEventProc(UiBaseView *view, Evas_Event_Key_Down *ev) { if (strcmp(ev->keyname, KEY_MENU) && strcmp(ev->keyname, KEY_MENU2)) return; - UiView *v = dynamic_cast(view); + auto v = dynamic_cast(view); UiMenu *menu = v->onMenuPre(); if (!menu) return; diff --git a/src/lib/efl/mobile/UiMenu.cpp b/src/lib/efl/mobile/UiMenu.cpp index b53f6a0..7adac3d 100644 --- a/src/lib/efl/mobile/UiMenu.cpp +++ b/src/lib/efl/mobile/UiMenu.cpp @@ -26,7 +26,7 @@ static void _ctxpopupDismissedCb(void *data, Evas_Object *obj, void *event_info) static void _ctxpopupDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info) { - UiMenu *menu = static_cast(data); + auto menu = static_cast(data); menu->unsetContent(); } @@ -61,7 +61,7 @@ static bool _updateMenu(UiMenu *menu) static void _winResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info) { - UiMenu *menu = static_cast(data); + auto menu = static_cast(data); if (!menu->isActivated()) return; _updateMenu(menu); diff --git a/src/lib/efl/mobile/UiPopup.cpp b/src/lib/efl/mobile/UiPopup.cpp index c121a4c..8c7a615 100644 --- a/src/lib/efl/mobile/UiPopup.cpp +++ b/src/lib/efl/mobile/UiPopup.cpp @@ -39,7 +39,7 @@ static void _popupDismissedCb(void *data, Evas_Object *obj, void *event_info) static void _popupDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info) { - UiPopup *popup = static_cast(data); + auto popup = static_cast(data); popup->unsetContent(); } diff --git a/src/lib/efl/mobile/c/ui_standard_view.cpp b/src/lib/efl/mobile/c/ui_standard_view.cpp index 1f2386c..589f44a 100644 --- a/src/lib/efl/mobile/c/ui_standard_view.cpp +++ b/src/lib/efl/mobile/c/ui_standard_view.cpp @@ -139,7 +139,7 @@ static ui_standard_view_capi *validate_view(ui_standard_view *view) return nullptr; } - ui_standard_view_capi *capi_view = dynamic_cast(view); + auto capi_view = dynamic_cast(view); if (!capi_view) { LOGE("Invalid ui_standard_view = %p. Probably, you passed ui_view, not ui_standard_view.", view);