From: Hermet Park Date: Wed, 27 Apr 2016 08:32:38 +0000 (+0900) Subject: code clean up. X-Git-Tag: submit/tizen/20160617.075742~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F67566%2F1;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git code clean up. Change-Id: Ied732e2ea74342a243875475808b4d6bff2c5b3e --- diff --git a/src/examples/efl/main.cpp b/src/examples/efl/main.cpp index 2984fd7..b54be0c 100644 --- a/src/examples/efl/main.cpp +++ b/src/examples/efl/main.cpp @@ -50,7 +50,8 @@ public: return false; } - create_page1(); + //Push first view in viewmgr. + UI_VIEWMGR->push_view(new page1()); return true; } @@ -59,5 +60,5 @@ public: int main(int argc, char *argv[]) { sample_app app(PACKAGE, LOCALE_DIR); - return app.start(argc, argv); + return app.run(argc, argv); } diff --git a/src/examples/efl/page1.h b/src/examples/efl/page1.h index 4fb6128..10ca306 100644 --- a/src/examples/efl/page1.h +++ b/src/examples/efl/page1.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page2(); + UI_VIEWMGR->push_view(new page2()); }); this->set_content(content, "Page1"); } @@ -44,9 +44,3 @@ public: page1() : ui_view("page1") {} ~page1() {} }; - -void create_page1() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page1()); -} diff --git a/src/examples/efl/page10.h b/src/examples/efl/page10.h index 1bb2f83..0885824 100644 --- a/src/examples/efl/page10.h +++ b/src/examples/efl/page10.h @@ -43,7 +43,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page11(); + UI_VIEWMGR->push_view(new page11()); }); this->set_content(content, "Page 10"); this->set_indicator(UI_VIEW_INDICATOR_DEFAULT); @@ -60,7 +60,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page11(); + UI_VIEWMGR->push_view(new page11()); }); this->set_content(content, "Page 10"); this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL); @@ -70,9 +70,3 @@ public: page10() : ui_view("page10") {} ~page10() {} }; - -void create_page10() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page10()); -} diff --git a/src/examples/efl/page11.h b/src/examples/efl/page11.h index 3cb7bb6..015f39e 100644 --- a/src/examples/efl/page11.h +++ b/src/examples/efl/page11.h @@ -43,7 +43,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page12(); + UI_VIEWMGR->push_view(new page12()); }); this->set_content(content, "Page11"); @@ -71,9 +71,3 @@ public: page11() {} ~page11() {} }; - -void create_page11() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page11()); -} diff --git a/src/examples/efl/page12.h b/src/examples/efl/page12.h index f81d00e..3ba7791 100644 --- a/src/examples/efl/page12.h +++ b/src/examples/efl/page12.h @@ -46,7 +46,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page13(); + UI_VIEWMGR->push_view(new page13()); }); this->set_content(content, "Page12"); @@ -93,9 +93,3 @@ public: popup->activate(); } }; - -void create_page12() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page12()); -} diff --git a/src/examples/efl/page13.h b/src/examples/efl/page13.h index 8fbb665..19de302 100644 --- a/src/examples/efl/page13.h +++ b/src/examples/efl/page13.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page14(); + UI_VIEWMGR->push_view(new page14()); }); this->set_content(content, "Page13"); @@ -48,9 +48,3 @@ public: } ~page13() {} }; - -void create_page13() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page13()); -} diff --git a/src/examples/efl/page14.h b/src/examples/efl/page14.h index 4aadebb..9b6ecf5 100644 --- a/src/examples/efl/page14.h +++ b/src/examples/efl/page14.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page15(); + UI_VIEWMGR->push_view(new page15()); }); this->set_content(content, "Page14"); @@ -48,9 +48,3 @@ public: } ~page14(){} }; - -void create_page14() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page14()); -} diff --git a/src/examples/efl/page15.h b/src/examples/efl/page15.h index 549275b..5bcdb1a 100644 --- a/src/examples/efl/page15.h +++ b/src/examples/efl/page15.h @@ -36,15 +36,9 @@ protected: evas_object_smart_callback_add(right_btn, "clicked", [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page16(); + UI_VIEWMGR->push_view(new page16()); }, this); this->set_title_right_btn(right_btn); } }; - -void create_page15() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page15()); -} diff --git a/src/examples/efl/page16.h b/src/examples/efl/page16.h index c02bf39..3df4b84 100644 --- a/src/examples/efl/page16.h +++ b/src/examples/efl/page16.h @@ -69,9 +69,3 @@ public: page16() : ui_view("page16") {} ~page16() {} }; - -void create_page16() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page16()); -} diff --git a/src/examples/efl/page2.h b/src/examples/efl/page2.h index e04a90a..7d00282 100644 --- a/src/examples/efl/page2.h +++ b/src/examples/efl/page2.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page3(); + UI_VIEWMGR->push_view(new page3()); }); //Title left button @@ -54,9 +54,3 @@ public: page2() : ui_view("page2") {} ~page2() {} }; - -void create_page2() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page2()); -} diff --git a/src/examples/efl/page3.h b/src/examples/efl/page3.h index d4a460e..e862e08 100644 --- a/src/examples/efl/page3.h +++ b/src/examples/efl/page3.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page4(); + UI_VIEWMGR->push_view(new page4()); }); //Arguments: content, title, subtitle, title left button, title right button @@ -46,9 +46,3 @@ public: page3() : ui_view("page3") {} ~page3() {} }; - -void create_page3() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page3()); -} diff --git a/src/examples/efl/page4.h b/src/examples/efl/page4.h index d746392..8512768 100644 --- a/src/examples/efl/page4.h +++ b/src/examples/efl/page4.h @@ -36,7 +36,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page5(); + UI_VIEWMGR->push_view(new page5()); }); //Arguments: content, title @@ -48,9 +48,3 @@ public: page4() : ui_view("page4") {} ~page4() {} }; - -void create_page4() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page4()); -} diff --git a/src/examples/efl/page5.h b/src/examples/efl/page5.h index 43ffd28..ec47288 100644 --- a/src/examples/efl/page5.h +++ b/src/examples/efl/page5.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page6(); + UI_VIEWMGR->push_view(new page6()); }); this->set_content(content); @@ -46,9 +46,3 @@ public: page5() : ui_base_view("page5") {} ~page5() {} }; - -void create_page5() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page5()); -} diff --git a/src/examples/efl/page6.h b/src/examples/efl/page6.h index d37c8c4..7c64ceb 100644 --- a/src/examples/efl/page6.h +++ b/src/examples/efl/page6.h @@ -34,7 +34,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page7(); + UI_VIEWMGR->push_view(new page7()); }); //Arguments: content, title @@ -47,9 +47,3 @@ public: page6() : ui_view("page6") {} ~page6() {} }; - -void create_page6() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page6()); -} diff --git a/src/examples/efl/page7.h b/src/examples/efl/page7.h index 6bca5c1..8e90332 100644 --- a/src/examples/efl/page7.h +++ b/src/examples/efl/page7.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page8(); + UI_VIEWMGR->push_view(new page8()); }); //FIXME: Don't delete view's content when this view poped. @@ -48,9 +48,3 @@ public: page7() : ui_view("page7") {} ~page7() {} }; - -void create_page7() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page7()); -} diff --git a/src/examples/efl/page8.h b/src/examples/efl/page8.h index 4c6712f..f3d99b1 100644 --- a/src/examples/efl/page8.h +++ b/src/examples/efl/page8.h @@ -32,7 +32,7 @@ public: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page9(); + UI_VIEWMGR->push_view(new page9()); }); //Don't delete view's content when this view poped. @@ -41,9 +41,3 @@ public: } ~page8() {} }; - -void create_page8() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page8()); -} diff --git a/src/examples/efl/page9.h b/src/examples/efl/page9.h index 2a8d63b..95bd01d 100644 --- a/src/examples/efl/page9.h +++ b/src/examples/efl/page9.h @@ -46,7 +46,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page10(); + UI_VIEWMGR->push_view(new page10()); }); this->set_content(content, "Page 9"); this->set_indicator(UI_VIEW_INDICATOR_DEFAULT); @@ -65,7 +65,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - create_page10(); + UI_VIEWMGR->push_view(new page10()); }); this->set_content(content, "Page 9"); this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL); @@ -75,9 +75,3 @@ public: page9() : ui_view("page9") {} ~page9() {} }; - -void create_page9() -{ - //Push this view in viewmgr. - UI_VIEWMGR->push_view(new page9()); -} diff --git a/src/include/efl/mobile/ui_app.h b/src/include/efl/mobile/ui_app.h index c70fc40..880dcd5 100644 --- a/src/include/efl/mobile/ui_app.h +++ b/src/include/efl/mobile/ui_app.h @@ -35,7 +35,7 @@ public: ui_app(const char *pkg, const char *locale_dir); virtual ~ui_app(); - virtual int start(int argc, char **argv); + virtual int run(int argc, char **argv); virtual bool on_create(); virtual void on_terminate(); virtual void on_pause(); diff --git a/src/include/efl/mobile/ui_popup.h b/src/include/efl/mobile/ui_popup.h index 93fee0d..17e0e7c 100644 --- a/src/include/efl/mobile/ui_popup.h +++ b/src/include/efl/mobile/ui_popup.h @@ -32,7 +32,7 @@ public: virtual bool activate(); virtual bool deactivate(); - virtual bool set_content(Elm_Popup* ctxpopup); + virtual bool set_content(Elm_Popup* popup); virtual Elm_Popup *unset_content(); virtual bool is_activated(); diff --git a/src/include/efl/mobile/ui_viewmgr.h b/src/include/efl/mobile/ui_viewmgr.h index 44d1d49..e85d158 100644 --- a/src/include/efl/mobile/ui_viewmgr.h +++ b/src/include/efl/mobile/ui_viewmgr.h @@ -35,7 +35,6 @@ protected: ui_viewmgr(const char *pkg); ui_viewmgr(const ui_viewmgr& viewmgr); virtual ~ui_viewmgr(); - }; } diff --git a/src/lib/efl/mobile/ui_app.cpp b/src/lib/efl/mobile/ui_app.cpp index c3a79c7..67a27ac 100644 --- a/src/lib/efl/mobile/ui_app.cpp +++ b/src/lib/efl/mobile/ui_app.cpp @@ -134,6 +134,7 @@ void ui_app::on_pause() void ui_app::on_resume() { + this->viewmgr->activate(); } void ui_app::on_control(app_control_h app_control) @@ -153,7 +154,7 @@ ui_app::ui_app(const char *pkg, const char *locale_dir) locale_dir = eina_stringshare_add(locale_dir); } -int ui_app::start(int argc, char **argv) +int ui_app::run(int argc, char **argv) { ui_app_lifecycle_callback_s event_callback = { 0, }; app_event_handler_h handlers[5] = { NULL, }; @@ -182,8 +183,9 @@ int ui_app::start(int argc, char **argv) ui_app::~ui_app() { - eina_stringshare_del(this->pkg); delete (this->viewmgr); + eina_stringshare_del(this->pkg); + eina_stringshare_del(this->locale_dir); } ui_viewmgr *ui_app::get_viewmgr()