code clean up. 66/67566/1
authorHermet Park <hermet@hermet.pe.kr>
Wed, 27 Apr 2016 08:32:38 +0000 (17:32 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Wed, 27 Apr 2016 08:32:38 +0000 (17:32 +0900)
Change-Id: Ied732e2ea74342a243875475808b4d6bff2c5b3e

21 files changed:
src/examples/efl/main.cpp
src/examples/efl/page1.h
src/examples/efl/page10.h
src/examples/efl/page11.h
src/examples/efl/page12.h
src/examples/efl/page13.h
src/examples/efl/page14.h
src/examples/efl/page15.h
src/examples/efl/page16.h
src/examples/efl/page2.h
src/examples/efl/page3.h
src/examples/efl/page4.h
src/examples/efl/page5.h
src/examples/efl/page6.h
src/examples/efl/page7.h
src/examples/efl/page8.h
src/examples/efl/page9.h
src/include/efl/mobile/ui_app.h
src/include/efl/mobile/ui_popup.h
src/include/efl/mobile/ui_viewmgr.h
src/lib/efl/mobile/ui_app.cpp

index 2984fd7..b54be0c 100644 (file)
@@ -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);
 }
index 4fb6128..10ca306 100644 (file)
@@ -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());
-}
index 1bb2f83..0885824 100644 (file)
@@ -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());
-}
index 3cb7bb6..015f39e 100644 (file)
@@ -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());
-}
index f81d00e..3ba7791 100644 (file)
@@ -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());
-}
index 8fbb665..19de302 100644 (file)
@@ -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());
-}
index 4aadebb..9b6ecf5 100644 (file)
@@ -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());
-}
index 549275b..5bcdb1a 100644 (file)
@@ -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());
-}
index c02bf39..3df4b84 100644 (file)
@@ -69,9 +69,3 @@ public:
        page16() : ui_view("page16") {}
        ~page16() {}
 };
-
-void create_page16()
-{
-       //Push this view in viewmgr.
-       UI_VIEWMGR->push_view(new page16());
-}
index e04a90a..7d00282 100644 (file)
@@ -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());
-}
index d4a460e..e862e08 100644 (file)
@@ -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());
-}
index d746392..8512768 100644 (file)
@@ -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());
-}
index 43ffd28..ec47288 100644 (file)
@@ -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());
-}
index d37c8c4..7c64ceb 100644 (file)
@@ -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());
-}
index 6bca5c1..8e90332 100644 (file)
@@ -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());
-}
index 4c6712f..f3d99b1 100644 (file)
@@ -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());
-}
index 2a8d63b..95bd01d 100644 (file)
@@ -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());
-}
index c70fc40..880dcd5 100644 (file)
@@ -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();
index 93fee0d..17e0e7c 100644 (file)
@@ -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();
 
index 44d1d49..e85d158 100644 (file)
@@ -35,7 +35,6 @@ protected:
        ui_viewmgr(const char *pkg);
        ui_viewmgr(const ui_viewmgr& viewmgr);
        virtual ~ui_viewmgr();
-
 };
 }
 
index c3a79c7..67a27ac 100644 (file)
@@ -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()