Coding Rule: 4. Brace. 22/77522/3 accepted/tizen/common/20160630.152115 accepted/tizen/mobile/20160701.033032 submit/tizen/20160630.072558
authorWoochan Lee <wc0917.lee@samsung.com>
Thu, 30 Jun 2016 06:33:48 +0000 (15:33 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Thu, 30 Jun 2016 06:36:28 +0000 (15:36 +0900)
Change-Id: Ia52f72cf6fd2d9f5144101551b225026f1165401

src/lib/efl/UiBaseKeyListener.cpp
src/lib/efl/UiBaseView.cpp
src/lib/efl/UiBaseViewmgr.cpp
src/lib/efl/mobile/UiKeyListener.cpp
src/lib/efl/mobile/UiMenu.cpp
src/lib/efl/mobile/UiPopup.cpp
src/lib/efl/mobile/UiStandardView.cpp
src/lib/efl/mobile/UiView.cpp
src/lib/interface/UiIfaceApp.cpp
src/lib/interface/UiIfaceView.cpp
src/lib/interface/UiIfaceViewmgr.cpp

index cc7000a..01a9106 100644 (file)
@@ -73,27 +73,25 @@ void UiBaseKeyListenerImpl::eventProc(Evas_Event_Key_Down *ev)
 bool UiBaseKeyListenerImpl::term()
 {
        evas_object_del(this->keyGrabber);
+
        return true;
 }
 
 bool UiBaseKeyListenerImpl::init()
 {
-       if (!this->viewmgr)
-       {
+       if (!this->viewmgr) {
                LOGE("No view manager??");
                return false;
        }
 
        Evas *e = evas_object_evas_get(this->viewmgr->getWindow());
-       if (!e)
-       {
+       if (!e) {
                LOGE("Failed to get Evas from window");
                return false;
        }
 
        Evas_Object *keyGrabRect = evas_object_rectangle_add(e);
-       if (!keyGrabRect)
-       {
+       if (!keyGrabRect) {
                LOGE("Failed to create a key grabber rectangle");
                return false;
        }
@@ -105,15 +103,13 @@ bool UiBaseKeyListenerImpl::init()
                _keyGrabRectKeyUpCb(keyListener, ev);
        }, this);
 
-       if (!evas_object_key_grab(keyGrabRect, KEY_BACK, 0, 0, EINA_FALSE))
-       {
+       if (!evas_object_key_grab(keyGrabRect, KEY_BACK, 0, 0, EINA_FALSE)) {
                LOGE("Failed to grab BACK KEY(%s)\n", KEY_BACK);
                evas_object_del(keyGrabRect);
                return false;
        }
 
-       if (!evas_object_key_grab(keyGrabRect, KEY_BACK2, 0, 0, EINA_FALSE))
-       {
+       if (!evas_object_key_grab(keyGrabRect, KEY_BACK2, 0, 0, EINA_FALSE)) {
                LOGE("Failed to grab BACK KEY(%s)\n", KEY_BACK2);
                evas_object_del(keyGrabRect);
                return false;
index 572d591..daf0666 100644 (file)
@@ -47,47 +47,51 @@ UiBaseView::~UiBaseView()
 bool UiBaseView::setContent(Evas_Object *content)
 {
        Evas_Object *pcontent = this->unsetContent();
-       if (pcontent)
-       {
+
+       if (pcontent) {
                evas_object_del(pcontent);
        }
-       if (content)
-       {
+
+       if (content) {
                evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _contentDelCb, this);
                UiIfaceView::setContent(content);
        }
+
        return true;
 }
 
 Evas_Object *UiBaseView::unsetContent()
 {
        Evas_Object *obj = UiIfaceView::unsetContent();
-       if (obj)
-       {
+
+       if (obj) {
                evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, _contentDelCb);
                evas_object_hide(obj);
        }
+
        return obj;
 }
 
 Evas_Object *UiBaseView::getBase()
 {
        UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
-       if (!viewmgr)
-       {
+
+       if (!viewmgr) {
                return NULL;
        }
+
        return viewmgr->getBase();
 }
 
 Evas_Object *UiBaseView ::getParent()
 {
        UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
-       if (!viewmgr)
-       {
+
+       if (!viewmgr) {
                LOGE("Failed to get a viewmgr");
                return NULL;
        }
+
        return viewmgr->getBase();
 }
 
@@ -98,8 +102,8 @@ void UiBaseView::setIndicator(UiViewIndicator indicator)
        UiIfaceView::setIndicator(indicator);
 
        UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
-       if (!viewmgr)
-       {
+
+       if (!viewmgr) {
                LOGE("Failed to get a viewmgr");
                return;
        }
@@ -126,17 +130,19 @@ void UiBaseView::onLandscape()
 void UiBaseView::setEventBlock(bool block)
 {
        UiIfaceView::setEventBlock(block);
+
        evas_object_freeze_events_set(this->getContent(), block);
 }
 
 int UiBaseView::getDegree()
 {
        UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
-       if (!viewmgr)
-       {
+
+       if (!viewmgr) {
                LOGE("Failed to get a viewmgr");
                return -1;
        }
+
        return elm_win_rotation_get(viewmgr->getWindow());
 }
 
index 0f2a646..6585512 100644 (file)
@@ -63,16 +63,15 @@ public:
        bool insertViewBefore(UiBaseView *view, UiBaseView *before);
        bool insertViewAfter(UiBaseView *view, UiBaseView *after);
 
-       Evas_Object *getBase()
-       {
+       Evas_Object *getBase() {
                return this->_layout;
        }
-       Elm_Win *getWindow()
-       {
+
+       Elm_Win *getWindow() {
                return this->_win;
        }
-       Elm_Conformant *getConformant()
-       {
+
+       Elm_Conformant *getConformant() {
                return this->_conform;
        }
 };
@@ -140,8 +139,7 @@ Elm_Layout *UiBaseViewmgrImpl::_setTransitionLayout(string transitionStyle)
        Elm_Layout *playout = elm_object_part_content_unset(this->_scroller, NULL);
        evas_object_hide(playout);
 
-       if (!effectLayout)
-       {
+       if (!effectLayout) {
                //Create and add effect_layouts in map here.
                //FIXME: If we have to support many effects, this logic should be changed.
                _effectMap.insert(pair<string, Elm_Layout *>("default", this->_layout));
@@ -167,8 +165,7 @@ void UiBaseViewmgrImpl::_activateTopView()
 
        //In case of UiBaseView, it doesn't have any base form. It uses viewmgr base instead.
        Evas_Object *content;
-       if (view->getBase() == this->getBase())
-       {
+       if (view->getBase() == this->getBase()) {
                content = view->getContent();
        } else {
                content = view->getBase();
@@ -189,8 +186,7 @@ bool UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator)
        Elm_Win *window = this->getWindow();
        Elm_Conformant *conform = this->getConformant();
 
-       switch (indicator)
-       {
+       switch (indicator) {
        case UI_VIEW_INDICATOR_DEFAULT:
                elm_win_indicator_opacity_set(window, ELM_WIN_INDICATOR_OPAQUE);
                elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW);
@@ -247,8 +243,7 @@ bool UiBaseViewmgrImpl::_createScroller(Elm_Conformant *conform)
 UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, UiBaseKeyListener *keyListener)
                : _viewmgr(viewmgr), _keyListener(keyListener), _transitionStyle("default")
 {
-       if (!pkg)
-       {
+       if (!pkg) {
                LOGE("Invalid package name");
                return;
        }
@@ -256,16 +251,14 @@ UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, Ui
        //Window
        this->_win = elm_win_util_standard_add(pkg, pkg);
 
-       if (!this->_win)
-       {
+       if (!this->_win) {
                LOGE("Failed to create a window (%s)", pkg);
                return;
        }
 
        //FIXME: Make a method? to set available rotation degree.
        //Set window rotation
-       if (elm_win_wm_rotation_supported_get(this->_win))
-       {
+       if (elm_win_wm_rotation_supported_get(this->_win)) {
                int rots[4] =
                { 0, 90, 180, 270 };
                elm_win_wm_rotation_available_rotations_set(this->_win, (const int *) (&rots), 4);
@@ -294,20 +287,17 @@ UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, Ui
                        this->_viewmgr);
 
        //FIXME: Make conformant configurable?
-       if (!this->_createConformant(this->_win))
-       {
+       if (!this->_createConformant(this->_win)) {
                LOGE("Failed to create a conformant (%s)", pkg);
                return;
        }
 
-       if (!this->_createScroller(this->_conform))
-       {
+       if (!this->_createScroller(this->_conform)) {
                LOGE("Failed to create a scroller (%s)", pkg);
                return;
        }
 
-       if (!this->_createBaseLayout(this->_scroller, "default"))
-       {
+       if (!this->_createBaseLayout(this->_scroller, "default")) {
                LOGE("Failed to create a base layout (%s)", pkg);
                return;
        }
@@ -345,8 +335,7 @@ bool UiBaseViewmgrImpl::activate()
 bool UiBaseViewmgrImpl::deactivate()
 {
        //FIXME: based on the profile, we should app to go behind or terminate.
-       if (true)
-       {
+       if (true) {
                evas_object_lower(this->_win);
        } else {
                delete(this->_viewmgr);
@@ -361,8 +350,7 @@ bool UiBaseViewmgrImpl::popView()
        UiBaseView *view = this->_viewmgr->getLastView();
 
        //In case, if view doesn't have any transition effects.
-       if (!strcmp(view->getTransitionStyle(), "none"))
-       {
+       if (!strcmp(view->getTransitionStyle(), "none")) {
                this->_viewmgr->popViewFinished(pview);
                this->_viewmgr->popViewFinished(view);
                this->_activateTopView();
@@ -479,14 +467,12 @@ bool UiBaseViewmgr::deactivate()
 
 bool UiBaseViewmgr::popView()
 {
-       if (this->getViewCount() == 1)
-       {
+       if (this->getViewCount() == 1) {
                this->deactivate();
                return true;
        }
 
-       if(!UiIfaceViewmgr::popView())
-       {
+       if(!UiIfaceViewmgr::popView()) {
                return false;
        }
 
index 4242709..9a80c69 100644 (file)
@@ -30,6 +30,7 @@ void UiKeyListener::extendEventProc(UiBaseView *view, Evas_Event_Key_Down *ev)
        UiView *v = dynamic_cast<UiView *>(view);
        UiMenu *menu = v->onMenuPre();
        if (!menu) return;
+
        v->onMenu(menu);
        v->onMenuPost();
 }
@@ -48,5 +49,6 @@ bool UiKeyListener::init()
                LOGE("Failed to grab MENU KEY(%s)\n", KEY_MENU2);
                return false;
        }
+
        return true;
 }
index f4da067..dc48da2 100644 (file)
@@ -40,8 +40,7 @@ static bool _updateMenu(UiMenu *menu)
        elm_win_screen_size_get(win, NULL, NULL, &w, &h);
        int rot = elm_win_rotation_get(win);
 
-       switch (rot)
-       {
+       switch (rot) {
        case 0:
        case 180:
                evas_object_move(ctxpopup, (w / 2), h);
@@ -61,6 +60,7 @@ static void _winResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info
 {
        UiMenu *menu = static_cast<UiMenu *>(data);
        if (!menu->isActivated()) return;
+
        _updateMenu(menu);
 }
 
@@ -75,6 +75,7 @@ UiMenu::~UiMenu()
 {
        Elm_Win *win = this->getWindow();
        if (win) evas_object_event_callback_del(win, EVAS_CALLBACK_RESIZE, _winResizeCb);
+
        Elm_Ctxpopup *ctxpopup = this->unsetContent();
        evas_object_del(ctxpopup);
 }
@@ -82,8 +83,7 @@ UiMenu::~UiMenu()
 Elm_Win *UiMenu::getWindow()
 {
        UiViewmgr *viewmgr = UI_VIEWMGR;
-       if (!viewmgr)
-       {
+       if (!viewmgr) {
                LOGE("Viewmgr is null?? menu(%p)", this);
                return NULL;
        }
@@ -110,6 +110,7 @@ bool UiMenu::activate()
 {
        bool ret = _updateMenu(this);
        if (ret) dynamic_cast<UiView *>(this->getView())->onPause();
+
        return ret;
 }
 
@@ -120,8 +121,7 @@ bool UiMenu::setContent(Elm_Ctxpopup *ctxpopup)
 
        if (!ctxpopup) return true;
 
-       if (strcmp(evas_object_type_get(ctxpopup), "elm_ctxpopup"))
-       {
+       if (strcmp(evas_object_type_get(ctxpopup), "elm_ctxpopup")) {
                LOGE("Menu widget is not a ctxpopup!");
                return false;
        }
@@ -140,6 +140,7 @@ bool UiMenu::isActivated()
 {
        Elm_Ctxpopup *ctxpopup = this->getContent();
        if (!ctxpopup) return false;
+
        return evas_object_visible_get(ctxpopup);
 }
 
index e71a2e3..9d9ce46 100644 (file)
@@ -56,19 +56,18 @@ UiPopup::~UiPopup()
 Elm_Win *UiPopup::getWindow()
 {
        UiViewmgr *viewmgr = UI_VIEWMGR;
-       if (!viewmgr)
-       {
+       if (!viewmgr) {
                LOGE("Viewmgr is null?? menu(%p)", this);
                return NULL;
        }
+
        return viewmgr->getWindow();
 }
 
 bool UiPopup::deactivate()
 {
        Elm_Popup *popup = this->getContent();
-       if (!popup)
-       {
+       if (!popup) {
                LOGE("Content is not set! = UiPopup(%p)", this);
                return false;
        }
@@ -93,8 +92,7 @@ bool UiPopup::setContent(Elm_Popup *popup)
 
        if (!popup) return true;
 
-       if (strcmp(evas_object_type_get(popup), "elm_popup"))
-       {
+       if (strcmp(evas_object_type_get(popup), "elm_popup")) {
                LOGE("Menu widget is not a popup!");
                return false;
        }
index f900ad6..a77bfc3 100644 (file)
@@ -56,18 +56,15 @@ public:
        Elm_Toolbar *unsetToolbar();
        Evas_Object *getBase();
 
-       Elm_Button *getTitleLeftBtn()
-       {
+       Elm_Button *getTitleLeftBtn() {
                return this->_titleLeftBtn;
        }
 
-       Elm_Button *getTitleRightBtn()
-       {
+       Elm_Button *getTitleRightBtn() {
                return this->_titleRightBtn;
        }
 
-       Elm_Toolbar *getToolbar()
-       {
+       Elm_Toolbar *getToolbar() {
                return this->_toolbar;
        }
 };
@@ -76,33 +73,36 @@ public:
 
 #define DEFAULT_GROUP "tizen_view/default"
 
-#define LAYOUT_VALIDATE() if (!layout) \
-               { \
-                       LOGE("Layout is invalid! UiStandardView(%p)", this); \
-                       return false; \
-               }
+#define LAYOUT_VALIDATE() if (!layout) { \
+                                       LOGE("Layout is invalid! UiStandardView(%p)", this); \
+                                       return false; \
+                               }
 
 static void _titleLeftBtnDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        UiStandardView *view = static_cast<UiStandardView *>(data);
+
        view->unsetTitleLeftBtn();
 }
 
 static void _titleRightBtnDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        UiStandardView *view = static_cast<UiStandardView *>(data);
+
        view->unsetTitleRightBtn();
 }
 
 static void _toolbarDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        UiStandardView *view = static_cast<UiStandardView *>(data);
+
        view->unsetToolbar();
 }
 
 bool UiStandardViewImpl::_destroyLayout()
 {
        if (!this->_layout) return false;
+
        evas_object_del(this->_layout);
        this->_layout = NULL;
 
@@ -119,28 +119,25 @@ bool UiStandardViewImpl::_createLayout()
        char buf[PATH_MAX];
        snprintf(buf, sizeof(buf), "%s/ui-viewmgr.edj", EDJ_PATH);
 
-       if (!elm_layout_file_set(layout, buf, DEFAULT_GROUP))
-       {
+       if (!elm_layout_file_set(layout, buf, DEFAULT_GROUP))   {
                LOGE("Failed to set file = UiStandardView(%p), path(%s), group(%s)", this, buf, DEFAULT_GROUP);
                evas_object_del(layout);
                return false;
        }
+
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
-       if (this->_view->getContent())
-       {
+       if (this->_view->getContent()) {
                elm_object_part_content_set(layout, "elm.swallow.content", this->_view->getContent());
        }
 
        //Set software back key, if it's needed
        UiViewmgr *viewmgr = UI_VIEWMGR;
-       if (viewmgr && viewmgr->needSoftKey())
-       {
+       if (viewmgr && viewmgr->needSoftKey()) {
                Elm_Button *prevBtn = elm_button_add(layout);
 
-               if (!prevBtn)
-               {
+               if (!prevBtn) {
                        LOGE("Failed to create a button = UiStandardView(%p)", this);
                } else {
                        evas_object_smart_callback_add(prevBtn, "clicked", [](void *data, Evas_Object *obj, void *event_info) -> void
@@ -176,6 +173,7 @@ bool UiStandardViewImpl::setContent(Evas_Object *content, const char *title)
        LAYOUT_VALIDATE();
 
        elm_object_part_content_set(layout, "elm.swallow.content", content);
+
        if (content)
        {
                elm_object_signal_emit(layout, "elm.state,elm.swallow.content,show", "viewmgr");
@@ -194,6 +192,7 @@ bool UiStandardViewImpl::setSubtitle(const char *text)
        LAYOUT_VALIDATE();
 
        elm_object_part_text_set(layout, "elm.text.subtitle", text);
+
        if (text) elm_object_signal_emit(layout, "elm,state,subtitle,show", "viewmgr");
        else elm_object_signal_emit(layout, "elm,state,subtitle,hide", "viewmgr");
 
@@ -250,6 +249,7 @@ bool UiStandardViewImpl::setTitleBadge(const char *text)
        LAYOUT_VALIDATE();
 
        elm_object_part_text_set(layout, "title_badge", text);
+
        if (text) elm_object_signal_emit(layout, "elm,state,title_badge,show", "viewmgr");
        else elm_object_signal_emit(layout, "elm,state,title_badge,hide", "viewmgr");
 
@@ -262,6 +262,7 @@ bool UiStandardViewImpl::setTitle(const char *text)
        LAYOUT_VALIDATE();
 
        elm_object_part_text_set(layout, "elm.text.title", text);
+
        if (text) elm_object_signal_emit(layout, "elm,state,title,show", "viewmgr");
        else elm_object_signal_emit(layout, "elm,state,title,hide", "viewmgr");
 
@@ -283,8 +284,7 @@ bool UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar)
        if (!toolbar) return true;
 
        //FIXME: eeeek. check style?? :(
-       if (!strcmp(elm_object_style_get(toolbar), "navigationbar"))
-       {
+       if (!strcmp(elm_object_style_get(toolbar), "navigationbar")) {
                elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_SCROLL);
                elm_toolbar_align_set(toolbar, 0);
        } else {
@@ -306,11 +306,11 @@ bool UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar)
 void UiStandardViewImpl::unsetContent()
 {
        Elm_Layout *layout = this->getBase();
-       if (!layout)
-       {
+       if (!layout) {
                LOGE("Layout is invalid! UiStandardView(%p)", this);
                return;
        }
+
        elm_object_part_content_unset(layout, "elm.swallow.content");
        elm_object_signal_emit(layout, "elm.state,elm.swallow.content,hide", "viewmgr");
 }
@@ -321,8 +321,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn()
        if (!btn) return NULL;
 
        Elm_Layout *layout = this->getBase();
-       if (!layout)
-       {
+       if (!layout) {
                LOGE("Layout is invalid! UiStandardView(%p)", this);
                return btn;
        }
@@ -342,8 +341,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleRightBtn()
        if (!btn) return NULL;
 
        Elm_Layout *layout = this->getBase();
-       if (!layout)
-       {
+       if (!layout) {
                LOGE("Layout is invalid! UiStandardView(%p)", this);
                return btn;
        }
@@ -363,8 +361,7 @@ Elm_Toolbar *UiStandardViewImpl::unsetToolbar()
        if (!toolbar) return NULL;
 
        Elm_Layout *layout = this->getBase();
-       if (!layout)
-       {
+       if (!layout) {
                LOGE("Layout is invalid! UiStandardView(%p)", this);
                return toolbar;
        }
@@ -380,10 +377,10 @@ Elm_Toolbar *UiStandardViewImpl::unsetToolbar()
 
 Evas_Object *UiStandardViewImpl::getBase()
 {
-       if (!this->_layout)
-       {
+       if (!this->_layout) {
                this->_createLayout();
        }
+
        return this->_layout;
 }
 
@@ -391,14 +388,12 @@ bool UiStandardViewImpl::setTitleVisible(bool visible, bool anim)
 {
        //FIXME: save visible, anim value. they can be used in layout created time.
        Elm_Layout *layout = this->getBase();
-       if (!layout)
-       {
+       if (!layout) {
                LOGE("Layout is invalid! UiStandardView(%p)", this);
                return false;
        }
 
-       if (visible)
-       {
+       if (visible) {
                if (anim) elm_object_signal_emit(layout, "elm,state,title,show,anim", "viewmgr");
                else elm_object_signal_emit(layout, "elm,state,title,show", "viewmgr");
        } else {
@@ -443,6 +438,7 @@ void UiStandardView::onUnload()
 bool UiStandardView::setContent(Evas_Object *content, const char *title)
 {
        UiView::setContent(content);
+
        return this->_impl->setContent(content, title);
 }
 
@@ -489,6 +485,7 @@ bool UiStandardView::setToolbar(Elm_Toolbar *toolbar)
 void UiStandardView::setEventBlock(bool block)
 {
        UiView::setEventBlock(block);
+
        evas_object_freeze_events_set(this->getBase(), block);
 }
 
index d390c49..38813ea 100644 (file)
@@ -73,33 +73,31 @@ void UiViewImpl::_disconnectPopup(UiPopup *popup)
 
 bool UiViewImpl::_deactivatePopup(bool topOne)
 {
-       for (popupRitr it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++)
-       {
+       for (popupRitr it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++) {
                UiPopup *popup = *it;
                if (!popup->isActivated()) continue;
                popup->onBack();
                //deactivate only one top one? or all popups?
                if (topOne) return true;
        }
+
        return false;
 }
 
 bool UiViewImpl::onBack()
 {
        //If any popup is activated, deactivate the popup first.
-       if (this->_deactivatePopup(true))
-       {
+       if (this->_deactivatePopup(true)) {
                return false;
        }
 
-       if (this->_menu)
-       {
-               if (this->_menu->isActivated())
-               {
+       if (this->_menu) {
+               if (this->_menu->isActivated()) {
                        this->_menu->onBack();
                        return false;
                }
        }
+
        return true;
 }
 
@@ -115,14 +113,13 @@ UiViewImpl::~UiViewImpl()
 
 UiMenu *UiViewImpl::onMenuPre()
 {
-       if (!this->_menu)
-       {
+       if (!this->_menu) {
                this->_menu = new UiMenu(this->_view);
        }
 
-       if (this->_menu->isActivated())
-       {
+       if (this->_menu->isActivated()) {
                this->_menu->deactivate();
+
                return NULL;
        }
 
@@ -132,6 +129,7 @@ UiMenu *UiViewImpl::onMenuPre()
 void UiViewImpl::onMenuPost()
 {
        if (!this->_menu) return;
+
        this->_menu->activate();
 }
 
@@ -139,6 +137,7 @@ void UiViewImpl::onRotate(int degree)
 {
        if (!this->_menu) return;
        if (!this->_menu->isActivated()) return;
+
        this->_menu->onRotate(degree);
 }
 
@@ -146,6 +145,7 @@ void UiViewImpl::onPortrait()
 {
        if (!this->_menu) return;
        if (!this->_menu->isActivated()) return;
+
        this->_menu->onPortrait();
 }
 
@@ -153,6 +153,7 @@ void UiViewImpl::onLandscape()
 {
        if (!this->_menu) return;
        if (!this->_menu->isActivated()) return;
+
        this->_menu->onLandscape();
 }
 
@@ -173,12 +174,14 @@ void UiView::_disconnectPopup(UiPopup *popup)
 void UiView::onDeactivate()
 {
        this->_impl->_deactivatePopup(false);
+
        UiBaseView::onDeactivate();
 }
 
 void UiView::onBack()
 {
        if (!this->_impl->onBack()) return;
+
        UiBaseView::onBack();
 }
 
@@ -211,6 +214,7 @@ void UiView::onRotate(int degree)
 {
        //FIXME: see how to handle on_menu()
        UiBaseView::onRotate(degree);
+
        this->_impl->onRotate(degree);
 }
 
@@ -218,6 +222,7 @@ void UiView::onPortrait()
 {
        //FIXME: see how to handle on_menu()
        UiBaseView::onPortrait();
+
        this->_impl->onPortrait();
 }
 
@@ -225,6 +230,7 @@ void UiView::onLandscape()
 {
        //FIXME: see how to handle on_menu()
        UiBaseView::onLandscape();
+
        this->_impl->onLandscape();
 }
 
index f865a4b..642c568 100644 (file)
@@ -149,8 +149,7 @@ int UiIfaceAppImpl::run(int argc, char **argv)
 
        int ret = ui_app_main(argc, argv, &event_callback, this);
 
-       if (ret != APP_ERROR_NONE)
-       {
+       if (ret != APP_ERROR_NONE) {
                LOGE("ui_app_main() is failed. err = %d", ret);
        }
 
@@ -294,8 +293,7 @@ void UiIfaceApp::onTerminate()
 
 UiIfaceApp::UiIfaceApp(const char *pkg, const char *locale_dir, UiIfaceViewmgr *viewmgr)
 {
-       if (_inst)
-       {
+       if (_inst) {
                LOGE("You created UiIfaceApp multiple times!!");
        }
        _inst = this;
index 8fe0b5c..a5fb65f 100644 (file)
@@ -91,8 +91,7 @@ void UiIfaceViewImpl::onLoad()
 void UiIfaceViewImpl::onUnload()
 {
        this->_state = UI_VIEW_STATE_UNLOAD;
-       if (this->getRemovableContent())
-       {
+       if (this->getRemovableContent()) {
                this->setContent(NULL);
                return;
        }
@@ -198,8 +197,7 @@ UiViewIndicator UiIfaceViewImpl::getIndicator()
 void UiIfaceViewImpl::onBack()
 {
        UiIfaceViewmgr *viewmgr = this->_viewmgr;
-       if (!viewmgr)
-       {
+       if (!viewmgr) {
                LOGE("Failed to get a viewmgr, view =%p", this);
                return;
        }
index e501fe9..c500f70 100644 (file)
@@ -84,24 +84,19 @@ bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after)
 {
        VIEW_ITR it;
 
-       if (!view)
-       {
+       if (!view) {
                LOGE("invalid view argument. view(NULL)");
                return false;
        }
 
-       if (!this->connectView(view))
-       {
+       if (!this->connectView(view)) {
                LOGE("connect view failed");
                return false;
        }
 
-       if (this->_viewList.size() > 0)
-       {
-               for (it = this->_viewList.begin(); it != this->_viewList.end(); it++)
-               {
-                       if (after == *it)
-                       {
+       if (this->_viewList.size() > 0) {
+               for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
+                       if (after == *it) {
                                //If the after is a last item of list.
                                //view has to push now.
                                if (it == this->_viewList.end())
@@ -133,16 +128,14 @@ bool UiIfaceViewmgrImpl::connectView(UiIfaceView *view)
        int nameLen = strlen(view->getName());
        const char *name = view->getName();
 
-       for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
-       {
+       for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
                UiIfaceView *view = *it;
                const char *viewName = view->getName();
                if (!viewName) continue;
                int viewNameLen = strlen(viewName);
 
                //Got you!
-               if ((viewNameLen == nameLen) && !strcmp(name, viewName))
-               {
+               if ((viewNameLen == nameLen) && !strcmp(name, viewName)) {
                        LOGE("the same name of UiIfaceView(%p) is already in this UiIfaceViewmgr(%p)", view, this);
                        return false;
                }
@@ -169,8 +162,7 @@ bool UiIfaceViewmgrImpl::pushViewFinished(UiIfaceView *view)
        UiIfaceView *last = this->_viewList.back();
 
        //The previous view has been pushed. This should be unload.
-       if (last != view)
-       {
+       if (last != view) {
                view->onUnload();
                return true;
        }
@@ -187,8 +179,7 @@ bool UiIfaceViewmgrImpl::popViewFinished(UiIfaceView *view)
        UiIfaceView *last = this->_viewList.back();
 
        //This view has been popped. It should be destroyed.
-       if (last == view)
-       {
+       if (last == view) {
                view->onUnload();
                view->onDestroy();
                delete (view);
@@ -212,18 +203,16 @@ UiIfaceViewmgrImpl::~UiIfaceViewmgrImpl()
 {
        //Terminate views
        this->_destroying = EINA_TRUE;
-       for (VIEW_RITR ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++)
-       {
+       for (VIEW_RITR ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++) {
                UiIfaceView *view = *ritr;
                if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
-                       (view->getState() != UI_VIEW_STATE_UNLOAD))
-               {
+                       (view->getState() != UI_VIEW_STATE_UNLOAD)) {
                        view->onDeactivate();
                }
-               if (view->getState() != UI_VIEW_STATE_UNLOAD)
-               {
+               if (view->getState() != UI_VIEW_STATE_UNLOAD) {
                        view->onUnload();
                }
+
                view->onDestroy();
                delete (view);
        }
@@ -236,14 +225,12 @@ UiIfaceViewmgrImpl::~UiIfaceViewmgrImpl()
 
 UiIfaceView *UiIfaceViewmgrImpl::pushView(UiIfaceView *view)
 {
-       if (!view)
-       {
+       if (!view) {
                LOGE("invalid view argument. view(NULL)");
                return NULL;
        }
 
-       if (!this->connectView(view))
-       {
+       if (!this->connectView(view)) {
                LOGE("connect view failed");
                return NULL;
        }
@@ -251,8 +238,7 @@ UiIfaceView *UiIfaceViewmgrImpl::pushView(UiIfaceView *view)
        UiIfaceView *pview;
 
        //Previous view
-       if (this->_viewList.size() > 0)
-       {
+       if (this->_viewList.size() > 0) {
                pview = this->_viewList.back();
                pview->onDeactivate();
                this->setEventBlock(pview, true);
@@ -266,8 +252,7 @@ UiIfaceView *UiIfaceViewmgrImpl::pushView(UiIfaceView *view)
        view->onLoad();
        view->onDeactivate();
 
-       if (this->_viewList.size() != 1)
-       {
+       if (this->_viewList.size() != 1) {
                this->setEventBlock(view, true);
        }
 
@@ -279,21 +264,18 @@ bool UiIfaceViewmgrImpl::popView()
        //last page to be popped.
        UiIfaceView*view = this->_viewList.back();
 
-       if (view->getEventBlock())
-       {
+       if (view->getEventBlock()) {
                return false;
        }
 
        //FIXME: No more view?
-       if (this->getViewCount() == 0)
-       {
+       if (this->getViewCount() == 0) {
                LOGE("No Views. Can't pop anymore!");
                return false;
        }
 
        //This is the last page.
-       if (this->getViewCount() == 1)
-       {
+       if (this->getViewCount() == 1) {
                //destroy viewmgr?
                UiIfaceView*view = this->_viewList.back();
                view->onDeactivate();
@@ -323,24 +305,19 @@ bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before
 {
        VIEW_ITR it;
 
-       if (!view)
-       {
+       if (!view) {
                LOGE("invalid view argument. view(NULL)");
                return false;
        }
 
-       if (!this->connectView(view))
-       {
+       if (!this->connectView(view)) {
                LOGE("connect view failed");
                return false;
        }
 
-       if (this->_viewList.size() > 0)
-       {
-               for (it = this->_viewList.begin(); it != this->_viewList.end(); it++)
-               {
-                       if (before == *it)
-                       {
+       if (this->_viewList.size() > 0) {
+               for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
+                       if (before == *it) {
                                this->_viewList.insert(it, view);
 
                                return true;
@@ -368,11 +345,11 @@ bool UiIfaceViewmgrImpl::removeView(UiIfaceView *view)
 
 UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx)
 {
-       if (idx < 0 || idx >= this->_viewList.size())
-       {
+       if (idx < 0 || idx >= this->_viewList.size()) {
                LOGE("Invalid idx(%d)! =? (idx range: %d ~ %d)", idx, 0, this->_viewList.size() - 1);
                return NULL;
        }
+
        VIEW_ITR it = this->_viewList.begin();
        advance(it, idx);
        return *it;
@@ -382,8 +359,7 @@ int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view)
 {
        int idx = 0;
 
-       for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
-       {
+       for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
                if (view == *it) return idx;
                ++idx;
        }
@@ -421,12 +397,10 @@ bool UiIfaceViewmgrImpl::deactivate()
        UiIfaceView *view = this->getLastView();
 
        if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
-               (view->getState() != UI_VIEW_STATE_UNLOAD))
-       {
+               (view->getState() != UI_VIEW_STATE_UNLOAD)) {
                view->onDeactivate();
        }
-       if (view->getState() != UI_VIEW_STATE_UNLOAD)
-       {
+       if (view->getState() != UI_VIEW_STATE_UNLOAD) {
                view->onUnload();
        }
 
@@ -438,16 +412,14 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name)
        if (!name) return NULL;
        int nameLen = strlen(name);
 
-       for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
-       {
+       for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
                UiIfaceView *view = *it;
                const char *viewName = view->getName();
                if (!viewName) continue;
                int viewNameLen = strlen(viewName);
 
                //Got you!
-               if ((viewNameLen == nameLen) && !strcmp(name, viewName))
-               {
+               if ((viewNameLen == nameLen) && !strcmp(name, viewName)) {
                        return view;
                }
        }