Add binary. 07/88607/2
authorWoochan Lee <wc0917.lee@samsung.com>
Tue, 20 Sep 2016 03:47:27 +0000 (12:47 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 20 Sep 2016 03:50:05 +0000 (20:50 -0700)
Merge branch 'master' of ssh://review.tizen.org:29418/platform/core/uifw/ui-viewmgr

Change-Id: I8f256316b4dd3492a4dc4413e7f725eb01976398

47 files changed:
.cproject [new file with mode: 0644]
binary/ui-viewmgr-0.1.0-1.i586.rpm [new file with mode: 0644]
binary/ui-viewmgr-ui.viewmgr.demo-0.1.0-1.i586.rpm [new file with mode: 0644]
packaging/ui-viewmgr.spec
src/examples/efl/c/main.cpp
src/examples/efl/cpp/contents.cpp
src/examples/efl/cpp/main.cpp
src/examples/efl/cpp/page11.h
src/examples/efl/cpp/page12.h
src/examples/efl/cpp/page16.h
src/include/efl/UiBaseView.h
src/include/efl/UiBaseViewManager.h
src/include/efl/UiBaseViewmgr.h
src/include/efl/mobile/UiApp.h
src/include/efl/mobile/UiMenu.h
src/include/efl/mobile/UiMobileViewManager.h
src/include/efl/mobile/UiPopup.h
src/include/efl/mobile/UiStandardView.h
src/include/efl/mobile/UiView.h
src/include/efl/mobile/c/_ui_private.h
src/include/efl/mobile/c/ui_application.h
src/include/interface/UiIfaceApp.h
src/include/interface/UiIfaceException.h [new file with mode: 0644]
src/include/interface/UiIfaceOverlay.h
src/include/interface/UiIfaceView.h
src/include/interface/UiIfaceViewManager.h
src/include/interface/UiIfaceViewmgr.h
src/lib/CMakeLists.txt
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/efl/mobile/c/ui_application.cpp
src/lib/efl/mobile/c/ui_menu.cpp
src/lib/efl/mobile/c/ui_popup.cpp
src/lib/efl/mobile/c/ui_standard_view.cpp
src/lib/efl/mobile/c/ui_view.cpp
src/lib/efl/mobile/c/ui_viewmgr.cpp
src/lib/interface/UiIfaceApp.cpp
src/lib/interface/UiIfaceException.cpp [new file with mode: 0644]
src/lib/interface/UiIfaceOverlay.cpp
src/lib/interface/UiIfaceView.cpp
src/lib/interface/UiIfaceViewmgr.cpp

diff --git a/.cproject b/.cproject
new file mode 100644 (file)
index 0000000..2e127df
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule moduleId="org.eclipse.cdt.core.settings">
+               <cconfiguration id="0.1314792774">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1314792774" moduleId="org.eclipse.cdt.core.settings" name="Default">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration buildProperties="" description="" id="0.1314792774" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
+                                       <folderInfo id="0.1314792774." name="/" resourcePath="">
+                                               <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.237443428" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
+                                                       <targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.237443428.1069267201" name=""/>
+                                                       <builder id="org.eclipse.cdt.build.core.settings.default.builder.1943157003" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+                                                       <tool id="org.eclipse.cdt.build.core.settings.holder.libs.334507251" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
+                                                       <tool id="org.eclipse.cdt.build.core.settings.holder.318945102" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
+                                                               <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1949172250" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+                                                       </tool>
+                                                       <tool id="org.eclipse.cdt.build.core.settings.holder.1152033755" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
+                                                               <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.529679317" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+                                                       </tool>
+                                                       <tool id="org.eclipse.cdt.build.core.settings.holder.2068815543" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
+                                                               <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1375844046" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+                                                       </tool>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="viewmgr.null.1358010903" name="viewmgr"/>
+       </storageModule>
+       <storageModule moduleId="scannerConfiguration">
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               <scannerConfigBuildInfo instanceId="0.2035251924">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               </scannerConfigBuildInfo>
+               <scannerConfigBuildInfo instanceId="0.1314792774">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               </scannerConfigBuildInfo>
+       </storageModule>
+       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+</cproject>
diff --git a/binary/ui-viewmgr-0.1.0-1.i586.rpm b/binary/ui-viewmgr-0.1.0-1.i586.rpm
new file mode 100644 (file)
index 0000000..ec931da
Binary files /dev/null and b/binary/ui-viewmgr-0.1.0-1.i586.rpm differ
diff --git a/binary/ui-viewmgr-ui.viewmgr.demo-0.1.0-1.i586.rpm b/binary/ui-viewmgr-ui.viewmgr.demo-0.1.0-1.i586.rpm
new file mode 100644 (file)
index 0000000..d1cfddb
Binary files /dev/null and b/binary/ui-viewmgr-ui.viewmgr.demo-0.1.0-1.i586.rpm differ
index fe55230d9f44cba5d68278e44d947e29e188cc57..3ddae0396783f205d22641ed27a12244c6ad0e06 100644 (file)
@@ -15,6 +15,8 @@ BuildRequires:  efl-extension-devel
 BuildRequires:  cmake
 BuildRequires:  edje-bin
 BuildRequires:  gettext-tools
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
 
 %description
 UI VIEW MANAGER library
@@ -55,6 +57,10 @@ rm -rf %{buildroot}
 mkdir -p %{buildroot}/usr/share/license
 cp %{_builddir}/%{buildsubdir}/LICENSE %{buildroot}/usr/share/license/%{name}
 
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
 %files
 %defattr(-,root,root,-)
 %{_libdir}/libui-viewmgr.so.*
index 0de5b656bd2aea392eb66459a3757304da418b94..eec479fa3a1e6dad98156c344f789309cbe55794 100644 (file)
@@ -26,10 +26,10 @@ main(int argc, char *argv[])
        ui_app_lifecycle_callback_s lifecycle_callback = {0, };
 
        //Initialize ui_app. ui_app initializes basic resources including ui_viewmgr internally.
-       if (!(ret = ui_application_init(PACKAGE, LOCALE_DIR)))
+       if (!ui_application_init(PACKAGE, LOCALE_DIR))
        {
-               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_init() is failed. err = %d", ret);
-               return ret;
+               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_init() is failed");
+               return 0;
        }
 
        //Register life cycle callback functions.
@@ -37,17 +37,17 @@ main(int argc, char *argv[])
        lifecycle_callback.app_control = app_control;
 
        //Run ui_app. Now it requests to run an application mainloop.
-       if ((ret = ui_application_run(argc, argv, &lifecycle_callback, NULL)))
+       if (!ui_application_run(argc, argv, &lifecycle_callback, NULL))
        {
-               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_run() is failed. err = %d", ret);
-               return ret;
+               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_run() is failed");
+               return 0;
        }
 
        //Terminate ui_app. Remove all ui_app resources.
-       if (!(ret = ui_application_term()))
+       if (!ui_application_term())
        {
-               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_term() is failed. err = %d", ret);
-               return ret;
+               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_term() is failed");
+               return 0;
        }
 
        return 0;
index 8337ef9757101c7250a1135c782235708e46162b..bc4018f862d6cfa50b601615c3503fd0659ed813 100644 (file)
@@ -30,10 +30,10 @@ createToolbar(Evas_Object *parent, const char *style)
        //       It looks toolbar bug.
        elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
 
-       elm_toolbar_item_append(toolbar, NULL, "Tab1", NULL, NULL);
-       elm_toolbar_item_append(toolbar, NULL, "Tab2", NULL, NULL);
-       elm_toolbar_item_append(toolbar, NULL, "Tab3", NULL, NULL);
-       elm_toolbar_item_append(toolbar, NULL, "Tab4", NULL, NULL);
+       elm_toolbar_item_append(toolbar, nullptr, "Tab1", nullptr, nullptr);
+       elm_toolbar_item_append(toolbar, nullptr, "Tab2", nullptr, nullptr);
+       elm_toolbar_item_append(toolbar, nullptr, "Tab3", nullptr, nullptr);
+       elm_toolbar_item_append(toolbar, nullptr, "Tab4", nullptr, nullptr);
 
        return toolbar;
 }
@@ -47,7 +47,7 @@ createScrollingContent(Evas_Object *parent)
        /* Image */
        image = elm_image_add(parent);
        snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR);
-       elm_image_file_set(image, buf, NULL);
+       elm_image_file_set(image, buf, nullptr);
        elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE);
        evas_object_show(image);
 
@@ -86,7 +86,7 @@ createLandscapeContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _pre
        /* Image */
        image = elm_image_add(grid);
        snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR);
-       elm_image_file_set(image, buf, NULL);
+       elm_image_file_set(image, buf, nullptr);
        evas_object_show(image);
        elm_grid_pack(grid, image, 50, 0, 50, 85);
 
@@ -104,7 +104,7 @@ createLandscapeContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _pre
        evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
        elm_object_text_set(btn, "Prev");
-       evas_object_smart_callback_add(btn, "clicked", _prevBtnClickedCb, NULL);
+       evas_object_smart_callback_add(btn, "clicked", _prevBtnClickedCb, nullptr);
        evas_object_show(btn);
        elm_box_pack_end(box, btn);
 
@@ -113,7 +113,7 @@ createLandscapeContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _pre
        evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
        elm_object_text_set(btn, "Next");
-       evas_object_smart_callback_add(btn, "clicked", _nextBtnClickedCb, NULL);
+       evas_object_smart_callback_add(btn, "clicked", _nextBtnClickedCb, nullptr);
        evas_object_show(btn);
        elm_box_pack_end(box, btn);
 
@@ -141,7 +141,7 @@ createTitleHandleContent(Evas_Object *parent, Evas_Smart_Cb _prevBtnClickedCb, E
        /* NoContent Layout */
        layout = elm_layout_add(grid);
        elm_layout_theme_set(layout, "layout", "nocontents", "default");
-       elm_object_part_text_set(layout, "elm.text", NULL);
+       elm_object_part_text_set(layout, "elm.text", nullptr);
        evas_object_show(layout);
        elm_grid_pack(grid, layout, 0, 0, 100, 100);
 
@@ -204,7 +204,7 @@ createTitleHandleContent(Evas_Object *parent, Evas_Smart_Cb _prevBtnClickedCb, E
        evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
        elm_object_text_set(btn, "Prev");
-       evas_object_smart_callback_add(btn, "clicked", _prevBtnClickedCb, NULL);
+       evas_object_smart_callback_add(btn, "clicked", _prevBtnClickedCb, nullptr);
        evas_object_show(btn);
        elm_box_pack_end(box, btn);
 
@@ -213,7 +213,7 @@ createTitleHandleContent(Evas_Object *parent, Evas_Smart_Cb _prevBtnClickedCb, E
        evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
        elm_object_text_set(btn, "Next");
-       evas_object_smart_callback_add(btn, "clicked", _nextBtnClickedCb, NULL);
+       evas_object_smart_callback_add(btn, "clicked", _nextBtnClickedCb, nullptr);
        evas_object_show(btn);
        elm_box_pack_end(box, btn);
 
@@ -261,7 +261,7 @@ createContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _prevBtnClick
        evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
        elm_object_text_set(btn, "Prev");
-       evas_object_smart_callback_add(btn, "clicked", _prevBtnClickedCb, NULL);
+       evas_object_smart_callback_add(btn, "clicked", _prevBtnClickedCb, nullptr);
        evas_object_show(btn);
        elm_box_pack_end(box, btn);
 
@@ -270,7 +270,7 @@ createContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _prevBtnClick
        evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
        elm_object_text_set(btn, "Next");
-       evas_object_smart_callback_add(btn, "clicked", _nextBtnClickedCb, NULL);
+       evas_object_smart_callback_add(btn, "clicked", _nextBtnClickedCb, nullptr);
        evas_object_show(btn);
        elm_box_pack_end(box, btn);
 
index 7f01d874ea25b97e93b29959a15b52a5a63082ac..272935fa00dc14c39a40d290dffe26eeea6bfc64 100644 (file)
@@ -60,6 +60,12 @@ protected:
 
 int main(int argc, char *argv[])
 {
-       SampleApp app;
-       return app.run(argc, argv);
+       try {
+               SampleApp app;
+               app.run(argc, argv);
+       } catch (UiException& ex)
+       {
+               dlog_print(DLOG_ERROR, LOG_TAG, ex.getMessage());
+       }
+       return 0;
 }
index 9ec17bfe971b4817af8ac4d299ae7a460f10b351..3660e91641edb252a3b8d043194672ef07f6519b 100644 (file)
@@ -21,7 +21,7 @@
  */
 static void _ctxpopupItemSelectCb(void *data, Evas_Object *obj, void *event_info)
 {
-       Elm_Object_Item *it = static_cast<Elm_Object_Item *>(event_info);
+       auto it = static_cast<Elm_Object_Item *>(event_info);
        LOGE("Item (%s) is selected", elm_object_item_text_get(it));
        elm_ctxpopup_dismiss(obj);
 }
@@ -54,15 +54,15 @@ protected:
                UiStandardView::onMenu(menu);
 
                Elm_Ctxpopup *ctxpopup = elm_ctxpopup_add(menu->getBase());
-               elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Search", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Add contact", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Search", NULL, _ctxpopupItemSelectCb, this);
-               elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Phone calls", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Favorites", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Search", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Dialer", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Add contact", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Phone calls", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Favorites", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Search", nullptr, _ctxpopupItemSelectCb, this);
+               elm_ctxpopup_item_append(ctxpopup, "Dialer", nullptr, _ctxpopupItemSelectCb, this);
 
                menu->setContent(ctxpopup);
        }
index ae57895a1dd342289c5daa34c0abc04bc48104e8..238b74b2e8f4fe2544e57eb2b67c3353288bf740 100644 (file)
@@ -23,7 +23,7 @@
 static void _popupDismissedCb(void *data, Evas_Object *obj, void *event_info)
 {
        evas_object_smart_callback_del(obj, "dismissed", _popupDismissedCb);
-       UiPopup *popup = static_cast<UiPopup *>(data);
+       auto popup = static_cast<UiPopup *>(data);
        delete (popup);
 }
 
@@ -55,7 +55,7 @@ protected:
                evas_object_smart_callback_add(rightBtn, "clicked",
                                [](void *data, Evas_Object *obj, void *event_info) -> void
                                {
-                                       page12 *view = static_cast<page12 *>(data);
+                                       auto view = static_cast<page12 *>(data);
                                        view->createPopup();
                                },
                                this);
@@ -82,13 +82,13 @@ public:
                                {
                                        elm_popup_dismiss(obj);
                                },
-                               NULL);
+                               nullptr);
                evas_object_smart_callback_add(obj, "timeout",
                                [](void *data, Evas_Object *obj, void *event_info) -> void
                                {
                                        elm_popup_dismiss(obj);
                                },
-                               NULL);
+                               nullptr);
 
                popup->setContent(obj);
                popup->activate();
index a89d2cb8c9885363202ccd4b9d325be48287502e..ae105e28b9140c889b3bf375d89b97cf67c149f1 100644 (file)
@@ -40,25 +40,25 @@ protected:
                                //Title Show Button Callback
                                [](void *data, Evas_Object *obj, void *event_info) -> void
                                {
-                                       UiStandardView *view = static_cast<UiStandardView *>(data);
+                                       auto view = static_cast<UiStandardView *>(data);
                                        view->setTitleVisible(true, false);
                                },
                                //Title Hide Button Callback
                                [](void *data, Evas_Object *obj, void *event_info) -> void
                                {
-                                       UiStandardView *view = static_cast<UiStandardView *>(data);
+                                       auto view = static_cast<UiStandardView *>(data);
                                        view->setTitleVisible(false, false);
                                },
                                //Title Show Anim Button Callback
                                [](void *data, Evas_Object *obj, void *event_info) -> void
                                {
-                                       UiStandardView *view = static_cast<UiStandardView *>(data);
+                                       auto view = static_cast<UiStandardView *>(data);
                                        view->setTitleVisible(true, true);
                                },
                                //Title Hide Anim Button Callback
                                [](void *data, Evas_Object *obj, void *event_info) -> void
                                {
-                                       UiStandardView *view = static_cast<UiStandardView *>(data);
+                                       auto view = static_cast<UiStandardView *>(data);
                                        view->setTitleVisible(false, true);
                                }, this);
 
index a0244437438dcb9db2c5d47677a74c14b1f34b58..4ad86b1eb77609ea23bb4df236cbf27b53e5f7be 100644 (file)
@@ -36,7 +36,7 @@ public:
         *
         *  @param name view name.
         */
-       explicit UiBaseView(const char *name = NULL);
+       explicit UiBaseView(const char *name = nullptr);
 
        ///Destructor.
        virtual ~UiBaseView();
@@ -44,16 +44,16 @@ public:
        /**
         *  @brief This is for replacing or setting a content of the view.
         *
-        *  @param content a new content. It allows @c NULL for canceling the previous content.
+        *  @param content a new content. It allows @c nullptr for canceling the previous content.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        virtual bool setContent(Evas_Object *content) override;
 
        /**
         *  @brief This is for unsetting a content of the view.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        virtual Evas_Object *unsetContent() override;
 
index cc28255d2b0da2047d6756cb8417e45df5ebd05b..b3cfc445a18f4151304fa36c2fc6ed0a6a20a608 100644 (file)
@@ -30,4 +30,6 @@
 
 #define UI_BASE_VIEWMGR dynamic_cast<efl_viewmanager::UiBaseViewmgr *>(ui_viewmanager::UiIfaceViewmgr::getInstance())
 
+using UiBaseException = ui_viewmanager::UiIfaceException;
+
 #endif /* UI_BASE_VIEWMANAGER_H */
index ae36b68b94745123146f4e249e53c8315c71d103..b6d31470b20cc511ba7b03fc5d5637cd093e7370 100644 (file)
@@ -72,7 +72,7 @@ public:
         *
         *  @param view A view to insert in the viewmgr view list.
         *
-        *  @return @p view, @c NULL when it fails to push a @p view.
+        *  @return @p view, @c nullptr when it fails to push a @p view.
         *
         *  @see activated()
         *  @see insertViewBefore()
@@ -100,7 +100,7 @@ public:
         *  @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right before of the given view, @before.
         *
         *  @param view A view to insert in the viewmgr view list.
-        *  @param before A view that will be just inserted after @p view. If you pass @c NULL, @p view will be inserted at the front of the view list.
+        *  @param before A view that will be just inserted after @p view. If you pass @c nullptr, @p view will be inserted at the front of the view list.
         *
         *  @return @c true on success or @c false otherwise.
         */
@@ -110,7 +110,7 @@ public:
         *  @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right after of the given view, @after.
         *
         *  @param view A view to insert in the viewmgr view list.
-        *  @param after A view that will be just inserted before the @p view. If you pass @c NULL, @p view will be inserted at the end of the view list.
+        *  @param after A view that will be just inserted before the @p view. If you pass @c nullptr, @p view will be inserted at the end of the view list.
         *
         *  @return @c true on success or @c false otherwise.
         */
@@ -143,7 +143,7 @@ public:
         *  @param idx A index of the view which you are looking for.
         *
         *  @return The view which index is matched with @p idx.
-        *          If there were no views with index @p idx, @c NULL will be returned.
+        *          If there were no views with index @p idx, @c nullptr will be returned.
         *
         *  @note You could use the index as the page numbers of the views.
         *  @warning the index number of views are variable since the view list is variable.
@@ -161,7 +161,7 @@ public:
         *  @param name The name of the view which you are looking for.
         *
         *  @return The view which name is matched with @p name.
-        *          If there were no views name matched, @c NULL will be returned.
+        *          If there were no views name matched, @c nullptr will be returned.
         *
         *  @see UiIfaceView::setName()
         */
index 99cfc3e3648577b280310a711db5d9faaeb3d0b9..8791f38bc0b99fd241ca5c3bdc5fa3f2929fe716 100644 (file)
@@ -23,21 +23,21 @@ namespace efl_viewmanager
 class UiViewmgr;
 
 /*
- *  @class UiIfaceApp
+ *  @class UiApp
  *
  *  @ingroup ui_viewmanager
  *
- *  @brief UiIfaceApp is designed for wrapping the application instance. This class hides unnecessary application settings but expose only basic functions
+ *  @brief UiApp is designed for wrapping the application instance. This class hides unnecessary application settings but expose only basic functions
  *         such as initialization and run. Basically, it works on the application life-cycle. It has application life-cycle event interfaces such as create(),
  *         pause(), resume(), terminate(), etc so that users can handle those events for the their application concept. Also, It provides system event
- *         interfaces such as low_baterry(), low_meomory(), lang_changed(), region_changed() and so on. UiIfaceApp create an unique UiViewmgr instance
+ *         interfaces such as low_baterry(), low_meomory(), lang_changed(), region_changed() and so on. UiApp create an unique UiViewmgr instance
  *         internally, and manage its life.
 */
 class UiApp : public ui_viewmanager::UiIfaceApp
 {
 public:
        /**
-        *  @brief This is a constructor for initializing UiPopup.
+        *  @brief This is a constructor for initializing UiApp.
         *
         *  @param pkg The name of package.
         *  @param loale_dir The path of locale directory.
index d49d32f56032b14594a0bcc13d7941f229680b59..a336c987ba2ed1364785804d2846e4c0d4c5523a 100644 (file)
@@ -61,7 +61,7 @@ public:
        /**
         *  @brief This is for replacing or setting a content of the menu.
         *
-        *  @param ctxpopup ctxpopup object. It allows @c NULL for canceling the previous content.
+        *  @param ctxpopup ctxpopup object. It allows @c nullptr for canceling the previous content.
         *
         *  @return @c true if it succeeds, @c false otherwise.
         */
@@ -70,7 +70,7 @@ public:
        /**
         *  @brief This is for unsetting a content of the menu.
         *
-        *  @return A previous content. If it wasn't, return value will be @c NULL.
+        *  @return A previous content. If it wasn't, return value will be @c nullptr.
         */
        virtual Elm_Ctxpopup *unsetContent() override;
 
index a4e895cc97cb61ed34080fbdc1bc7059f80a4c8d..8ffeefe11588f0bc5cdb464c7226f545f44a35d3 100644 (file)
@@ -28,4 +28,7 @@
 
 #define UI_VIEWMGR (efl_viewmanager::UiApp::getInstance()->getViewmgr())
 
+using UiException = ui_viewmanager::UiIfaceException;
+
+
 #endif /* UI_MOBILE_VIEWMANAGER_H */
index 76ea35e52d660507431f49f6f01d0e692a198afe..913038f80085489bc92f1417d01481dccdc3d983 100644 (file)
@@ -73,7 +73,7 @@ public:
        /**
         *  @brief This is for replacing or setting a content of the popup.
         *
-        *  @param popup popup object. It allows @c NULL for canceling the previous content.
+        *  @param popup popup object. It allows @c nullptr for canceling the previous content.
         *
         *  @return @c true if it succeeds, @c false otherwise.
         */
@@ -82,7 +82,7 @@ public:
        /**
         *  @brief This is for unsetting a content of the popup.
         *
-        *  @return A previous content. If it wasn't, return value will be @c NULL.
+        *  @return A previous content. If it wasn't, return value will be @c nullptr.
         */
        virtual Elm_Popup *unsetContent() override;
 
index 673e69cc0275e8fcb1da03b7cb4ccde7bf875c4d..b67db164df8759b32df65a62ded0e2de9c107596 100644 (file)
@@ -41,7 +41,7 @@ public:
         *
         *  @param name view name.
         */
-       explicit UiStandardView(const char *name = NULL);
+       explicit UiStandardView(const char *name = nullptr);
 
        ///Destructor.
        virtual ~UiStandardView();
@@ -49,7 +49,7 @@ public:
        /**
         *  @brief Replace or set a content of the view.
         *
-        *  @param content a new content. It allows @c NULL for canceling the previous content.
+        *  @param content a new content. It allows @c nullptr for canceling the previous content.
         *  @param title  title_label The label in the title area. The name of the title label part is "elm.text.title"
         *
         *  @return @c true if it succeeds, @c false otherwise.
@@ -136,28 +136,28 @@ public:
        /**
         *  @brief Unset a content of the view.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        Evas_Object *unsetContent() override;
 
        /**
         *  @brief Unset a title left button of title area.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        Elm_Button *unsetTitleLeftBtn();
 
        /**
         *  @brief Unset a title right button of title area.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        Elm_Button *unsetTitleRightBtn();
 
        /**
         *  @brief Unset a toolbar.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        Elm_Toolbar *unsetToolbar();
 
index 882e435d3dc849bf03e9b0cfc42385640ecaf05c..75634f0a0d1e5d7c38b201f29c11b28da55b83b1 100644 (file)
@@ -43,7 +43,7 @@ public:
         *
         *  @warning if you don't set a view name, you could not look up the view with its name. @see ui_viewmgr_view_get_by_name()
         */
-       explicit UiView(const char *name = NULL);
+       explicit UiView(const char *name = nullptr);
 
        ///Destructor.
        virtual ~UiView();
@@ -69,7 +69,7 @@ protected:
         *  @note It creates UiMenu instance, if there is no connected UiMenu instance of this view.
         *        It hides menu if there is already menu activated.
         *
-        *  @return The menu instance of this view. NULL If the menu already activated.
+        *  @return The menu instance of this view. nullptr If the menu already activated.
         */
        virtual UiMenu *onMenuPre();
 
index 642fecfb14e18bfe0fb10f4e1e6323c94b2fce9a..520011771b4778c50d03a955023d1beece5524d5 100644 (file)
 using namespace ui_viewmanager;
 using namespace efl_viewmanager;
 
-typedef UiViewmgr ui_viewmgr;
-typedef UiView ui_view;
-typedef UiStandardView ui_standard_view;
-typedef UiMenu ui_menu;
-typedef UiPopup ui_popup;
+using ui_viewmgr = UiViewmgr;
+using ui_view = UiView;
+using ui_standard_view = UiStandardView;
+using ui_menu = UiMenu;
+using ui_popup = UiPopup;
 
 #endif /* _UI_PRIVATE_H_ */
index 6f5073cc3e0a3e7b828b6b88a3d96b3a2a3e254f..a524c10add583cf9e328004c26ed1100c77ee990 100644 (file)
@@ -38,9 +38,9 @@ EAPI bool ui_application_init(const char *pkg, const char *locale_dir);
  *  @param lifecycle_callback The set of callback functions to handle application lifecycle events.
  *  @param user_data The user data to be passed to the gieven @p life_cycle_callback functions.
  *
- *  @return 0 on success, otherwise a negative error value
+ *  @return @c true if it succeeds, @c false otherwise.
  */
-EAPI int ui_application_run(int argc, char **argv, ui_app_lifecycle_callback_s *lifecycle_callback, void *user_data);
+EAPI bool ui_application_run(int argc, char **argv, ui_app_lifecycle_callback_s *lifecycle_callback, void *user_data);
 
 /**
  *  @brief This is ui_application destructor.
index d0e6275983407d90b986cad397b6a8b4ec0aad11..5b13acacd05a65b2cf256f737cf88cfb939a785c 100644 (file)
@@ -69,8 +69,10 @@ public:
         *        create, terminate, pause, resume, app_control, APP_EVENT_LOW_BATTERY, APP_EVENT_LOW_MEMORY
         *        APP_EVENT_DEVICE_ORIENTATION_CHANGED, APP_EVENT_LANGUAGE_CHANGED, APP_EVENT_REGION_FORMAT_CHANGED.
         *        Application can add those events using wrapping functions by viewmgr supported.
+        *
+        *  @return @c true if it succeeds, @c false otherwise.
         */
-       virtual int run(int argc, char **argv);
+       virtual bool run(int argc, char **argv);
 
 protected:
        /**
diff --git a/src/include/interface/UiIfaceException.h b/src/include/interface/UiIfaceException.h
new file mode 100644 (file)
index 0000000..f259906
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *               http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+#ifndef _UI_IFACE_EXCEPTION_H_
+#define _UI_IFACE_EXCEPTION_H_
+
+namespace ui_viewmanager {
+
+class UiIfaceException
+{
+public:
+       UiIfaceException(const char *msg);
+       virtual ~UiIfaceException();
+       const char *getMessage();
+
+private:
+       _UI_DECLARE_PRIVATE_IMPL(UiIfaceException);
+};
+
+}
+
+#endif /* _UI_IFACE_EXCEPTION_H_ */
index a1d717017bcc76e2a5f4b42fd39cc1f0a04a887b..d4e8db93806ef6f8e0a9947d40243b9fa38db9f1 100644 (file)
@@ -41,7 +41,7 @@ public:
         *  @note @p content is a logical object that represents a view in your framework. The actual type of the content could be translated to any certain types.
         *        For instance, the type could be Evas_Object * in EFL and Layer * in Dali.
         *
-        *  @param content a new content. It allows @c NULL for canceling the previous content.
+        *  @param content a new content. It allows @c nullptr for canceling the previous content.
         *
         *  @return @c true if it succeeds, @c false otherwise.
         */
@@ -50,7 +50,7 @@ public:
        /**
         *  @brief This is for unsetting a content of the view.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        virtual T unsetContent();
 
index fd22773ccbae1d17c2351146f3b0571f1d7abb93..daf0829224dc34895c6742da27d9e133d6ec418c 100644 (file)
@@ -47,7 +47,7 @@ public:
         *
         *  @warning if you don't set a view name, you could not look up the view with its name. @see ui_viewmgr_view_get_by_name()
         */
-       explicit UiIfaceView(const char *name = NULL);
+       explicit UiIfaceView(const char *name = nullptr);
 
        ///Destructor.
        virtual ~UiIfaceView();
@@ -56,7 +56,7 @@ public:
         *  @brief Set transition style of a view.
         *
         *  @note @p style is reserved for supporting various kinds of view transition effects.
-        *        The actual behaviors with this transition style is up to your frameworks. Default value of the style is NULL.
+        *        The actual behaviors with this transition style is up to your frameworks. Default value of the style is nullptr.
         *        and "none" represents none transition. If you don't like give any transition effects to this view, you can pass "none" as @p style.
         *
         *  @param style a transition style name.
@@ -64,7 +64,7 @@ public:
         *  @return true if the given @c style is available, otherwise false.
         *
         *  @warning When you override this member function, you should implement the logic to check the given style name is available or not.
-        *           If your framework doesn't support any styles then just allow a @c NULL argument and return true. Otherwise return false.
+        *           If your framework doesn't support any styles then just allow a @c nullptr argument and return true. Otherwise return false.
         */
        bool setTransitionStyle(const char *style);
 
@@ -125,7 +125,7 @@ public:
        /**
         *  @brief Return a content instance of this view.
         *
-        *  @return content of view. If no contents set yet, @c NULL.
+        *  @return content of view. If no contents set yet, @c nullptr.
         */
        T getContent();
 
@@ -135,7 +135,7 @@ public:
         *  @note @p content is a logical object that represents a view in your framework. The actual type of the content could be translated to any certain types.
         *        For instance, the type could be Evas_Object * in EFL and Layer * in Dali.
         *
-        *  @param content a new content. It allows @c NULL for canceling the previous content.
+        *  @param content a new content. It allows @c nullptr for canceling the previous content.
         *
         *  @return @c true if it succeeds, @c false otherwise.
         */
@@ -144,7 +144,7 @@ public:
        /**
         *  @brief Unset the view content.
         *
-        *  @return A previous content. If it wasn't, return @c NULL.
+        *  @return A previous content. If it wasn't, return @c nullptr.
         */
        virtual T unsetContent();
 
index bdff91ce25ef41e0100de8d4b43398c3853c09a6..3a9e3f779508c799b83e9c9a9760ed6f9dcd67b0 100644 (file)
@@ -24,7 +24,7 @@
 
 #if UI_EFL
        #include <Elementary.h>
-       typedef Evas_Object* T;
+       using T = Evas_Object*;
 #elif UI_DALI
 #endif
 
@@ -57,6 +57,7 @@
 #endif
 
 #include "UiIfaceTypes.h"
+#include "UiIfaceException.h"
 #include "UiIfaceRotatable.h"
 #include "UiIfaceOverlay.h"
 #include "UiIfaceView.h"
index 6336bda7a42aaa79d28cd01b50f000790b44a254..7029ad35ae7dd5910d4f30cd8888b0592a196365 100644 (file)
@@ -143,7 +143,7 @@ protected:
         *
         *  @param view A view to insert at the end of viewmgr view list.
         *
-        *  @return @p view, @c NULL when it fails to push a @p view.
+        *  @return @p view, @c nullptr when it fails to push a @p view.
         *
         *  @see activated()
         *  @see insertViewBefore()
@@ -172,7 +172,7 @@ protected:
         *  @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right before of the given view, @before.
         *
         *  @param view A view to insert in the viewmgr view list.
-        *  @param before A view that will be just inserted after @p view. If you pass @c NULL, @p view will be inserted at the front of the view list.
+        *  @param before A view that will be just inserted after @p view. If you pass @c nullptr, @p view will be inserted at the front of the view list.
         *
         *  @return @c true on success or @c false otherwise.
         */
@@ -182,7 +182,7 @@ protected:
         *  @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right after of the given view, @after.
         *
         *  @param view A view to insert in the viewmgr view list.
-        *  @param after A view that will be just inserted before the @p view. If you pass @c NULL, @p view will be inserted at the end of the view list.
+        *  @param after A view that will be just inserted before the @p view. If you pass @c nullptr, @p view will be inserted at the end of the view list.
         *
         *  @return @c true on success or @c false otherwise.
         */
@@ -207,7 +207,7 @@ protected:
         *  @param idx A index of the view which you are looking for.
         *
         *  @return The view which index is matched with @p idx.
-        *          If there were no views with index @p idx, @c NULL will be returned.
+        *          If there were no views with index @p idx, @c nullptr will be returned.
         *
         *  @note You could use the index as the page numbers of the views.
         *  @warning the index number of views are variable since the view list is variable.
@@ -225,7 +225,7 @@ protected:
         *  @param name The name of the view which you are looking for.
         *
         *  @return The view which name is matched with @p name.
-        *          If there were no views name matched, @c NULL will be returned.
+        *          If there were no views name matched, @c nullptr will be returned.
         *
         *  @see UiIfaceView::getName().
         */
index 21d050689aeda364939ace267d062c1364274331..d74f09a3fbe2b09b385b5ac3e0f8fe8011a9fcbb 100644 (file)
@@ -4,6 +4,7 @@ SET(SRCS
      interface/UiIfaceView.cpp
      interface/UiIfaceViewmgr.cpp
      interface/UiIfaceApp.cpp
+     interface/UiIfaceException.cpp
      efl/UiBaseView.cpp
      efl/UiBaseViewmgr.cpp
      efl/UiBaseKeyListener.cpp
@@ -22,6 +23,7 @@ SET(SRCS
      interface/UiIfaceView.cpp
      interface/UiIfaceViewmgr.cpp
      interface/UiIfaceApp.cpp
+     interface/UiIfaceException.cpp
      efl/UiBaseView.cpp
      efl/UiBaseViewmgr.cpp
      efl/UiBaseKeyListener.cpp
index 983211f8ae65840bffa84b73915b3f9ed3aca3ca..34ea818f245d6f9914566ead68d1148209d7e949 100644 (file)
@@ -27,9 +27,9 @@ namespace efl_viewmanager
 class UiBaseKeyListenerImpl
 {
 protected:
-       UiBaseKeyListener *keyListener = NULL;
-       UiBaseViewmgr *viewmgr = NULL;
-       Evas_Object *keyGrabber = NULL;
+       UiBaseKeyListener *keyListener = nullptr;
+       UiBaseViewmgr *viewmgr = nullptr;
+       Evas_Object *keyGrabber = nullptr;
 
 public:
        UiBaseKeyListenerImpl(UiBaseKeyListener *key_listener, UiBaseViewmgr *viewmgr);
@@ -59,11 +59,11 @@ UiBaseKeyListenerImpl::UiBaseKeyListenerImpl(UiBaseKeyListener *keyListener, UiB
 void UiBaseKeyListenerImpl::eventProc(Evas_Event_Key_Down *ev)
 {
        //Only if view manager is activated
-       UiBaseViewmgr *viewmgr = this->keyListener->getViewmgr();
+       auto viewmgr = this->keyListener->getViewmgr();
        if (!viewmgr->isActivated()) return;
 
        //Get Top View
-       UiBaseView *view = viewmgr->getLastView();
+       auto view = viewmgr->getLastView();
        if (!view) return;
 
        this->keyListener->extendEventProc(view, ev);
@@ -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<Evas_Event_Key_Down *>(event_info);
-               UiBaseKeyListenerImpl *keyListener = static_cast<UiBaseKeyListenerImpl *>(data);
+               auto ev = static_cast<Evas_Event_Key_Down *>(event_info);
+               auto keyListener = static_cast<UiBaseKeyListenerImpl *>(data);
                _keyGrabRectKeyUpCb(keyListener, ev);
        }, this);
 
index 20be99afee6bc9239e1b792e49786e4d4b601cb3..0dc38a529101f5eff644401fa199e377990d0a45 100644 (file)
@@ -33,7 +33,7 @@ class UiBaseViewImpl;
 
 static void _contentDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-       UiBaseView *view = static_cast<UiBaseView *>(data);
+       auto view = static_cast<UiBaseView *>(data);
        view->unsetContent();
 }
 
@@ -76,10 +76,10 @@ Evas_Object *UiBaseView::unsetContent()
 
 Evas_Object *UiBaseView::getBase()
 {
-       UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
+       auto viewmgr = UI_BASE_VIEWMGR;
 
        if (!viewmgr) {
-               return NULL;
+               return nullptr;
        }
 
        return viewmgr->getBase();
@@ -87,11 +87,11 @@ Evas_Object *UiBaseView::getBase()
 
 Evas_Object *UiBaseView ::getParent()
 {
-       UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
+       auto viewmgr = UI_BASE_VIEWMGR;
 
        if (!viewmgr) {
                LOGE("Failed to get a viewmgr");
-               return NULL;
+               return nullptr;
        }
 
        return viewmgr->getBase();
@@ -103,7 +103,7 @@ void UiBaseView::setIndicator(UiViewIndicator indicator)
 
        UiIfaceView::setIndicator(indicator);
 
-       UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
+       auto viewmgr = UI_BASE_VIEWMGR;
 
        if (!viewmgr) {
                LOGE("Failed to get a viewmgr");
@@ -123,7 +123,7 @@ bool UiBaseView::setAvailableRotations(const int *rotations, unsigned int count)
                return false;
        }
 
-       UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
+       auto viewmgr = UI_BASE_VIEWMGR;
 
        if (!viewmgr) {
                LOGE("Failed to get a viewmgr");
@@ -157,7 +157,7 @@ void UiBaseView::setEventBlock(bool block)
 
 int UiBaseView::getDegree()
 {
-       UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
+       auto viewmgr = UI_BASE_VIEWMGR;
 
        if (!viewmgr) {
                LOGE("Failed to get a viewmgr");
index d3b1e025a088c2f5bcfb4771719fb2e91d9643b2..d975850cd4b8dfe8a1cf15f3e503425bfee6edfb 100644 (file)
@@ -33,12 +33,12 @@ class UiBaseViewmgrImpl
        friend class UiBaseViewmgr;
 
 private:
-       UiBaseViewmgr *_viewmgr = NULL;
-       Elm_Win *_win = NULL;                                      //This is acting like a base object of viewmgr.
-       Elm_Conformant *_conform = NULL;                           //Conformant for viewmgr.
-       Elm_Scroller *_scroller = NULL;                            //Scroller for viewmgr.
-       Elm_Layout *_layout = NULL;                                //Viewmgr's base layout.
-       UiBaseKeyListener *_keyListener = NULL;                    //HW Key Handler such as "BACK" key...
+       UiBaseViewmgr *_viewmgr = nullptr;
+       Elm_Win *_win = nullptr;                                   //This is acting like a base object of viewmgr.
+       Elm_Conformant *_conform = nullptr;                        //Conformant for viewmgr.
+       Elm_Scroller *_scroller = nullptr;                         //Scroller for viewmgr.
+       Elm_Layout *_layout = nullptr;                             //Viewmgr's base layout.
+       UiBaseKeyListener *_keyListener = nullptr;                 //HW Key Handler such as "BACK" key...
        UiViewIndicator _indicator = UI_VIEW_INDICATOR_DEFAULT;    //Mode of indicator.
        string _transitionStyle = "default";                       //Current transition effect style name
        map<string, Elm_Layout *> _effectMap;                      //Map for effect layouts.
@@ -62,8 +62,6 @@ public:
        bool deactivate();
        UiBaseView *pushView(UiBaseView *view);
        bool popView();
-       bool insertViewBefore(UiBaseView *view, UiBaseView *before);
-       bool insertViewAfter(UiBaseView *view, UiBaseView *after);
 
        Evas_Object *getBase() {
                return this->_layout;
@@ -99,7 +97,7 @@ bool UiBaseViewmgrImpl::_createBaseLayout(Elm_Scroller *scroller, const char *st
        elm_layout_signal_callback_add(layout, "push,finished", "viewmgr",
                        [](void *data, Evas_Object *obj, const char *emission, const char *source) -> void
                        {
-                               UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr *>(data);
+                               auto viewmgr = static_cast<UiBaseViewmgr *>(data);
                                UiBaseView *pview = viewmgr->getView(viewmgr->getViewCount() - 2);
                                UiBaseView *view = viewmgr->getLastView();
                                if (pview) viewmgr->pushViewFinished(pview);
@@ -111,7 +109,7 @@ bool UiBaseViewmgrImpl::_createBaseLayout(Elm_Scroller *scroller, const char *st
        elm_layout_signal_callback_add(layout, "pop,finished", "viewmgr",
                        [](void *data, Evas_Object *obj, const char *emission, const char *source) -> void
                        {
-                               UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr *>(data);
+                               auto viewmgr = static_cast<UiBaseViewmgr *>(data);
                                UiBaseView *pview = viewmgr->getView(viewmgr->getViewCount() - 2);
                                UiBaseView *view = viewmgr->getLastView();
                                if (pview) viewmgr->popViewFinished(pview);
@@ -126,7 +124,7 @@ bool UiBaseViewmgrImpl::_createBaseLayout(Elm_Scroller *scroller, const char *st
 
 Elm_Layout *UiBaseViewmgrImpl::_setTransitionLayout(string transitionStyle)
 {
-       Elm_Layout *effectLayout = NULL;
+       Elm_Layout *effectLayout = nullptr;
        Elm_Layout *pcontent;
 
        pcontent = elm_object_part_content_unset(this->getBase(), "pcontent");
@@ -138,7 +136,7 @@ Elm_Layout *UiBaseViewmgrImpl::_setTransitionLayout(string transitionStyle)
        if (_effectMap.size()) effectLayout = _effectMap.find(transitionStyle)->second;
 
        //Scroller content change to current effect layout and change to hide prev layout.
-       Elm_Layout *playout = elm_object_part_content_unset(this->_scroller, NULL);
+       Elm_Layout *playout = elm_object_part_content_unset(this->_scroller, nullptr);
        evas_object_hide(playout);
 
        if (!effectLayout) {
@@ -163,7 +161,7 @@ void UiBaseViewmgrImpl::_activateTopView()
        Evas_Object *pcontent = elm_object_part_content_unset(this->getBase(), "content");
        if (pcontent) evas_object_hide(pcontent);
 
-       UiBaseView *view = this->_viewmgr->getLastView();
+       auto view = this->_viewmgr->getLastView();
 
        //In case of UiBaseView, it doesn't have any base form. It uses viewmgr base instead.
        Evas_Object *content;
@@ -214,7 +212,7 @@ bool UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator)
 
 void UiBaseViewmgrImpl::_setAvailableRotations(UiBaseView *view)
 {
-       const int *rotations = NULL;
+       const int *rotations = nullptr;
        unsigned int count = 0;
 
        rotations = view->getAvailableRotations(&count);
@@ -264,16 +262,17 @@ UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, Ui
        //Window
        this->_win = elm_win_util_standard_add(pkg, pkg);
 
+       char buf[256];
+
        if (!this->_win) {
-               LOGE("Failed to create a window (%s)", pkg);
-               return;
+               snprintf(buf, sizeof(buf), "Failed to create a window (%s)", pkg);
+               throw UiBaseException(buf);
        }
 
        //FIXME: Make a method? to set available rotation degree.
        //Set window rotation
        if (elm_win_wm_rotation_supported_get(this->_win)) {
-               int rots[4] =
-               { 0, 90, 180, 270 };
+               int rots[4] = { 0, 90, 180, 270 };
                elm_win_wm_rotation_available_rotations_set(this->_win, (const int *) (&rots), 4);
        }
        evas_object_smart_callback_add(this->_win, "wm,rotation,changed",
@@ -281,7 +280,7 @@ UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, Ui
                        {
                                int rot = elm_win_rotation_get(obj);
 
-                               UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr *>(data);
+                               auto viewmgr = static_cast<UiBaseViewmgr *>(data);
                                UiBaseView *view = viewmgr->getLastView();
                                view->onRotate(rot);
 
@@ -294,31 +293,30 @@ UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, Ui
        evas_object_smart_callback_add(this->_win, "delete,request",
                        [](void *data, Evas_Object *obj, void *event_info) -> void
                        {
-                               UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr*>(data);
+                               auto viewmgr = static_cast<UiBaseViewmgr*>(data);
                                delete(viewmgr);
                        },
                        this->_viewmgr);
 
        //FIXME: Make conformant configurable?
        if (!this->_createConformant(this->_win)) {
-               LOGE("Failed to create a conformant (%s)", pkg);
-               return;
+               snprintf(buf, sizeof(buf), "Failed to create a conformant (%s)", pkg);
+               throw UiBaseException(buf);
        }
 
        if (!this->_createScroller(this->_conform)) {
-               LOGE("Failed to create a scroller (%s)", pkg);
-               return;
+               snprintf(buf, sizeof(buf), "Failed to create a scroller (%s)", pkg);
+               throw UiBaseException(buf);
        }
 
        if (!this->_createBaseLayout(this->_scroller, "default")) {
-               LOGE("Failed to create a base layout (%s)", pkg);
-               return;
+               snprintf(buf, sizeof(buf), "Failed to create a base layout (%s)", pkg);
+               throw UiBaseException(buf);
        }
 
        //Set Indicator properties
        elm_win_indicator_mode_set(this->_win, ELM_WIN_INDICATOR_SHOW);
        elm_win_indicator_opacity_set(this->_win, ELM_WIN_INDICATOR_OPAQUE);
-
        elm_win_autodel_set(this->_win, EINA_TRUE);
 }
 
@@ -359,8 +357,8 @@ bool UiBaseViewmgrImpl::deactivate()
 
 bool UiBaseViewmgrImpl::popView()
 {
-       UiBaseView *pview = this->_viewmgr->getView(this->_viewmgr->getViewCount() - 2);
-       UiBaseView *view = this->_viewmgr->getLastView();
+       auto pview = this->_viewmgr->getView(this->_viewmgr->getViewCount() - 2);
+       auto view = this->_viewmgr->getLastView();
 
        //In case, if view doesn't have any transition effects.
        if (!strcmp(view->getTransitionStyle(), "none")) {
index 3be92d148c07a64d438e89f9930a1aa338e07f22..7490309cee8ad7b814621f4fbf7057c20cadadc9 100644 (file)
@@ -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<UiView *>(view);
+       auto v = dynamic_cast<UiView *>(view);
        UiMenu *menu = v->onMenuPre();
        if (!menu) return;
 
index 60f73b1ffba74a148c4c9ff7a4d1a66d2f38190b..7adac3db791eff882f291c480a596d7e4bcb6c28 100644 (file)
@@ -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<UiMenu *>(data);
+       auto menu = static_cast<UiMenu *>(data);
        menu->unsetContent();
 }
 
@@ -40,7 +40,7 @@ static bool _updateMenu(UiMenu *menu)
 
        /* We convince the top widget is a window */
        Evas_Coord w, h;
-       elm_win_screen_size_get(win, NULL, NULL, &w, &h);
+       elm_win_screen_size_get(win, nullptr, nullptr, &w, &h);
        int rot = elm_win_rotation_get(win);
 
        switch (rot) {
@@ -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<UiMenu *>(data);
+       auto menu = static_cast<UiMenu *>(data);
        if (!menu->isActivated()) return;
 
        _updateMenu(menu);
@@ -88,7 +88,7 @@ Elm_Win *UiMenu::getWindow()
        UiViewmgr *viewmgr = UI_VIEWMGR;
        if (!viewmgr) {
                LOGE("Viewmgr is null?? menu(%p)", this);
-               return NULL;
+               return nullptr;
        }
 
        return viewmgr->getWindow();
@@ -131,7 +131,7 @@ bool UiMenu::setContent(Elm_Ctxpopup *ctxpopup)
 
        elm_object_style_set(ctxpopup, "more/default");
        elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
-       evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopupDismissedCb, NULL);
+       evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopupDismissedCb, nullptr);
        evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, _ctxpopupDelCb, this);
 
        UiBaseOverlay::setContent(ctxpopup);
@@ -150,7 +150,7 @@ bool UiMenu::isActivated()
 Elm_Ctxpopup *UiMenu::unsetContent()
 {
        Elm_Ctxpopup *ctxpopup = UiBaseOverlay::unsetContent();
-       if (!ctxpopup) return NULL;
+       if (!ctxpopup) return nullptr;
 
        evas_object_smart_callback_del(ctxpopup, "dismissed", _ctxpopupDismissedCb);
        evas_object_event_callback_del(ctxpopup, EVAS_CALLBACK_DEL, _ctxpopupDelCb);
index b878f0e894cae2665398ffeefe4308de979d9386..8c7a6155240506941f1029ecb7346dee870e4c0d 100644 (file)
@@ -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<UiPopup *>(data);
+       auto popup = static_cast<UiPopup *>(data);
        popup->unsetContent();
 }
 
@@ -61,7 +61,7 @@ Elm_Win *UiPopup::getWindow()
        UiViewmgr *viewmgr = UI_VIEWMGR;
        if (!viewmgr) {
                LOGE("Viewmgr is null?? menu(%p)", this);
-               return NULL;
+               return nullptr;
        }
 
        return viewmgr->getWindow();
@@ -119,7 +119,7 @@ bool UiPopup::isActivated()
 Elm_Popup *UiPopup::unsetContent()
 {
        Elm_Popup *popup = UiBaseOverlay::unsetContent();
-       if (!popup) return NULL;
+       if (!popup) return nullptr;
 
        evas_object_event_callback_del(popup, EVAS_CALLBACK_DEL, _popupDelCb);
        evas_object_smart_callback_del(popup, "dismissed", _popupDismissedCb);
index ca608e6fd0dfaa6defcd14d31c7e50bd26324512..5b7b12af0e32776c4f7a9b07a960db34d2222903 100644 (file)
@@ -31,11 +31,11 @@ class UiStandardViewImpl
        friend class UiStandardView;
 
 private:
-       UiStandardView *_view = NULL;
-       Elm_Layout *_layout = NULL;              //Base layout for view
-       Elm_Toolbar *_toolbar = NULL;            //Toolbar
-       Elm_Button *_titleLeftBtn = NULL;        //Title left button
-       Elm_Button *_titleRightBtn = NULL;       //Title right button
+       UiStandardView *_view = nullptr;
+       Elm_Layout *_layout = nullptr;              //Base layout for view
+       Elm_Toolbar *_toolbar = nullptr;            //Toolbar
+       Elm_Button *_titleLeftBtn = nullptr;        //Title left button
+       Elm_Button *_titleRightBtn = nullptr;       //Title right button
        bool _titleVisible = true;
 
        bool _createLayout();
@@ -84,21 +84,21 @@ public:
 
 static void _titleLeftBtnDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-       UiStandardView *view = static_cast<UiStandardView *>(data);
+       auto 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);
+       auto 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);
+       auto view = static_cast<UiStandardView *>(data);
 
        view->unsetToolbar();
 }
@@ -108,7 +108,7 @@ bool UiStandardViewImpl::_destroyLayout()
        if (!this->_layout) return false;
 
        evas_object_del(this->_layout);
-       this->_layout = NULL;
+       this->_layout = nullptr;
 
        return true;
 }
@@ -137,7 +137,7 @@ bool UiStandardViewImpl::_createLayout()
        }
 
        //Set software back key, if it's needed
-       UiViewmgr *viewmgr = UI_VIEWMGR;
+       auto viewmgr = UI_VIEWMGR;
        if (viewmgr && viewmgr->needSoftKey()) {
                Elm_Button *prevBtn = elm_button_add(layout);
 
@@ -146,7 +146,7 @@ bool UiStandardViewImpl::_createLayout()
                } else {
                        evas_object_smart_callback_add(prevBtn, "clicked", [](void *data, Evas_Object *obj, void *event_info) -> void
                        {
-                               UiViewmgr *viewmgr = static_cast<UiViewmgr *>(data);
+                               auto viewmgr = static_cast<UiViewmgr *>(data);
                                viewmgr->popView();
                        }, viewmgr);
 
@@ -331,7 +331,7 @@ void UiStandardViewImpl::unsetContent()
 Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn()
 {
        Elm_Button *btn = this->_titleLeftBtn;
-       if (!btn) return NULL;
+       if (!btn) return nullptr;
 
        Elm_Layout *layout = this->getBase();
        if (!layout) {
@@ -343,7 +343,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn()
        elm_object_signal_emit(layout, "elm,state,title_left_btn,hide", "viewmgr");
        evas_object_event_callback_del(btn, EVAS_CALLBACK_DEL, _titleLeftBtnDelCb);
        evas_object_hide(btn);
-       this->_titleLeftBtn = NULL;
+       this->_titleLeftBtn = nullptr;
 
        return btn;
 }
@@ -351,7 +351,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn()
 Elm_Button *UiStandardViewImpl::unsetTitleRightBtn()
 {
        Elm_Button *btn = this->_titleRightBtn;
-       if (!btn) return NULL;
+       if (!btn) return nullptr;
 
        Elm_Layout *layout = this->getBase();
        if (!layout) {
@@ -363,7 +363,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleRightBtn()
        elm_object_signal_emit(layout, "elm,state,title_right_btn,hide", "viewmgr");
        evas_object_event_callback_del(btn, EVAS_CALLBACK_DEL, _titleRightBtnDelCb);
        evas_object_hide(btn);
-       this->_titleRightBtn = NULL;
+       this->_titleRightBtn = nullptr;
 
        return btn;
 }
@@ -371,7 +371,7 @@ Elm_Button *UiStandardViewImpl::unsetTitleRightBtn()
 Elm_Toolbar *UiStandardViewImpl::unsetToolbar()
 {
        Elm_Toolbar *toolbar = this->_toolbar;
-       if (!toolbar) return NULL;
+       if (!toolbar) return nullptr;
 
        Elm_Layout *layout = this->getBase();
        if (!layout) {
@@ -383,7 +383,7 @@ Elm_Toolbar *UiStandardViewImpl::unsetToolbar()
        elm_object_signal_emit(layout, "elm,state,toolbar,hide", "viewmgr");
        evas_object_event_callback_del(toolbar, EVAS_CALLBACK_DEL, _toolbarDelCb);
        evas_object_hide(toolbar);
-       this->_toolbar = NULL;
+       this->_toolbar = nullptr;
 
        return toolbar;
 }
@@ -506,7 +506,7 @@ void UiStandardView::setEventBlock(bool block)
 Evas_Object *UiStandardView::unsetContent()
 {
        Evas_Object *pcontent = UiView::unsetContent();
-       if (!pcontent) return NULL;
+       if (!pcontent) return nullptr;
 
        this->_impl->unsetContent();
 
index 317fc429e8d49899a0fbaf007313b774878fd65a..cff32ec4faa3168b0523db8ac7686dffee7e4f57 100644 (file)
@@ -34,8 +34,8 @@ class UiViewImpl
        friend class UiView;
 
 private:
-       UiView *_view = NULL;
-       UiMenu *_menu = NULL;
+       UiView *_view = nullptr;
+       UiMenu *_menu = nullptr;
        list<UiPopup *> _popupList;
 
        void _connectPopup(UiPopup *popup);
@@ -64,8 +64,6 @@ public:
 
 }
 
-typedef list<UiPopup*>::reverse_iterator popupRitr;
-
 void UiViewImpl::_connectPopup(UiPopup *popup)
 {
        this->_popupList.push_back(popup);
@@ -78,8 +76,8 @@ void UiViewImpl::_disconnectPopup(UiPopup *popup)
 
 bool UiViewImpl::_deactivatePopup(bool topOne)
 {
-       for (popupRitr it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++) {
-               UiPopup *popup = *it;
+       for (auto it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++) {
+               auto popup = *it;
                if (!popup->isActivated()) continue;
                popup->onBack();
                //deactivate only one top one? or all popups?
@@ -107,7 +105,7 @@ bool UiViewImpl::onBack()
 }
 
 UiViewImpl::UiViewImpl(UiView *view)
-               : _view(view), _menu(NULL)
+               : _view(view), _menu(nullptr)
 {
 }
 
@@ -125,7 +123,7 @@ UiMenu *UiViewImpl::onMenuPre()
        if (this->_menu->isActivated()) {
                this->_menu->deactivate();
 
-               return NULL;
+               return nullptr;
        }
 
        return this->_menu;
index 3e4ee63d3bea19768eaa583d0d62c9708ec85e82..4c43f2ed985d526660f3e3f70dce7f46a4e05304 100644 (file)
@@ -48,7 +48,7 @@ public:
        }
 
        ui_app_capi(const char *pkg, const char *locale_dir)
-                       : UiApp(pkg, locale_dir), data(NULL)
+                       : UiApp(pkg, locale_dir), data(nullptr)
        {
        }
 
@@ -56,7 +56,7 @@ public:
        {
        }
 
-       int run(int argc, char **argv, ui_app_lifecycle_callback_s *lifecycle_callback, void *user_data)
+       bool run(int argc, char **argv, ui_app_lifecycle_callback_s *lifecycle_callback, void *user_data)
        {
                if (lifecycle_callback)
                {
@@ -69,7 +69,7 @@ public:
        }
 };
 
-static ui_app_capi *g_app = NULL;
+static ui_app_capi *g_app = nullptr;
 
 EAPI bool ui_application_init(const char *pkg, const char *locale_dir)
 {
@@ -88,10 +88,14 @@ EAPI bool ui_application_init(const char *pkg, const char *locale_dir)
        return true;
 }
 
-EAPI int ui_application_run(int argc, char **argv, ui_app_lifecycle_callback_s *lifecycle_callback, void *user_data)
+EAPI bool ui_application_run(int argc, char **argv, ui_app_lifecycle_callback_s *lifecycle_callback, void *user_data)
 {
        ui_app_capi *app = g_app;
-       if (!app) return -1;
+       if (!app)
+       {
+               LOGE("ui_application is not initialized yet.");
+               return false;
+       }
 
        return app->run(argc, argv, lifecycle_callback, user_data);
 }
@@ -100,9 +104,6 @@ EAPI bool ui_application_term(void)
 {
        ui_app_capi *app = g_app;
        if (app) delete (app);
-       else return false;
-
-       g_app = NULL;
-
+       g_app = nullptr;
        return true;
 }
index 37682920d41795ca105a3a6bac21493725a1a1e2..89db1ddc02a810a6782b3d983e111d124fadea7f 100644 (file)
@@ -10,7 +10,7 @@ static bool validate_menu(ui_menu *menu)
 {
        if (!menu)
        {
-               LOGE("Invalid ui_menu = NULL");
+               LOGE("Invalid ui_menu = nullptr");
                return false;
        }
        return true;
@@ -24,13 +24,13 @@ EAPI bool ui_menu_set_content(ui_menu *menu, Elm_Ctxpopup *ctxpopup)
 
 EAPI Elm_Ctxpopup *ui_menu_get_content(ui_menu *menu)
 {
-       if (!validate_menu(menu)) return NULL;
+       if (!validate_menu(menu)) return nullptr;
        return menu->getContent();
 }
 
 EAPI Elm_Ctxpopup *ui_menu_unset_content(ui_menu *menu)
 {
-       if (!validate_menu(menu)) return NULL;
+       if (!validate_menu(menu)) return nullptr;
        return menu->unsetContent();
 }
 
@@ -54,7 +54,7 @@ EAPI bool ui_menu_get_activated(ui_menu *menu)
 
 EAPI Evas_Object *ui_menu_get_base(ui_menu *menu)
 {
-       if (!validate_menu(menu)) return NULL;
+       if (!validate_menu(menu)) return nullptr;
        return menu->getBase();
 }
 
@@ -66,6 +66,6 @@ EAPI int ui_menu_get_degree(ui_menu *menu)
 
 EAPI ui_view *ui_menu_get_view(ui_menu *menu)
 {
-       if (!validate_menu(menu)) return NULL;
+       if (!validate_menu(menu)) return nullptr;
        return dynamic_cast<ui_view *>(menu->getView());
 }
index 3d8cf2c61a272f00665e75711ad3c61d233f2b43..a43ac50126df9736cfb785478dc89fa4b0d00f2b 100644 (file)
@@ -10,7 +10,7 @@ static bool validate_popup(ui_popup *popup)
 {
        if (!popup)
        {
-               LOGE("Invalid ui_popup = NULL");
+               LOGE("Invalid ui_popup = nullptr");
                return false;
        }
        return true;
@@ -35,13 +35,13 @@ EAPI bool ui_popup_set_content(ui_popup *popup, Elm_Popup *content)
 
 EAPI Elm_Popup *ui_popup_get_content(ui_popup *popup)
 {
-       if (!validate_popup(popup)) return NULL;
+       if (!validate_popup(popup)) return nullptr;
        return popup->getContent();
 }
 
 EAPI Elm_Popup *ui_popup_unset_content(ui_popup *popup)
 {
-       if (!validate_popup(popup)) return NULL;
+       if (!validate_popup(popup)) return nullptr;
        return popup->unsetContent();
 }
 
@@ -65,7 +65,7 @@ EAPI bool ui_popup_get_activate(ui_popup *popup)
 
 EAPI Evas_Object *ui_popup_get_base(ui_popup *popup)
 {
-       if (!validate_popup(popup)) return NULL;
+       if (!validate_popup(popup)) return nullptr;
        return popup->getBase();
 }
 
@@ -77,6 +77,6 @@ EAPI int ui_popup_get_degree(ui_popup *popup)
 
 EAPI ui_view *ui_popup_get_view(ui_popup *popup)
 {
-       if (!validate_popup(popup)) return NULL;
+       if (!validate_popup(popup)) return nullptr;
        return dynamic_cast<ui_view *>(popup->getView());
 }
index 53d6ecf45e5e1b176fdd1a5042c65a00975b227e..49b6de1a8fc7e31aae556e3824b924961e953e97 100644 (file)
@@ -135,15 +135,15 @@ static ui_standard_view_capi *validate_view(ui_standard_view *view)
 {
        if (!view)
        {
-               LOGE("Invalid ui_standard_view = NULL");
-               return NULL;
+               LOGE("Invalid ui_standard_view = nullptr");
+               return nullptr;
        }
 
-       ui_standard_view_capi *capi_view = dynamic_cast<ui_standard_view_capi *>(view);
+       auto capi_view = dynamic_cast<ui_standard_view_capi *>(view);
        if (!capi_view)
        {
                LOGE("Invalid ui_standard_view = %p. Probably, you passed ui_view, not ui_standard_view.", view);
-               return NULL;
+               return nullptr;
        }
 
        return capi_view;
@@ -193,14 +193,14 @@ EAPI bool ui_standard_view_set_title_right_btn(ui_standard_view *view, Evas_Obje
 EAPI Elm_Button *ui_standard_view_get_title_right_btn(ui_standard_view *view)
 {
        ui_standard_view_capi *capi_view;
-       if (!(capi_view = validate_view(view))) return NULL;
+       if (!(capi_view = validate_view(view))) return nullptr;
        return capi_view->getTitleRightBtn();
 }
 
 EAPI Elm_Button *ui_standard_view_unset_title_right_btn(ui_standard_view *view)
 {
        ui_standard_view_capi *capi_view;
-       if (!(capi_view = validate_view(view))) return NULL;
+       if (!(capi_view = validate_view(view))) return nullptr;
        return capi_view->unsetTitleRightBtn();
 }
 
@@ -214,14 +214,14 @@ EAPI bool ui_standard_view_set_title_left_btn(ui_standard_view *view, Evas_Objec
 EAPI Elm_Button *ui_standard_view_get_title_left_btn(ui_standard_view *view)
 {
        ui_standard_view_capi *capi_view;
-       if (!(capi_view = validate_view(view))) return NULL;
+       if (!(capi_view = validate_view(view))) return nullptr;
        return capi_view->getTitleLeftBtn();
 }
 
 EAPI Elm_Button *ui_standard_view_unset_title_left_btn(ui_standard_view *view)
 {
        ui_standard_view_capi *capi_view;
-       if (!(capi_view = validate_view(view))) return NULL;
+       if (!(capi_view = validate_view(view))) return nullptr;
        return capi_view->unsetTitleRightBtn();
 }
 
@@ -235,14 +235,14 @@ EAPI bool ui_standard_view_set_toolbar(ui_standard_view *view, Elm_Toolbar *tool
 EAPI Elm_Toolbar *ui_standard_view_get_toolbar(ui_standard_view *view)
 {
        ui_standard_view_capi *capi_view;
-       if (!(capi_view = validate_view(view))) return NULL;
+       if (!(capi_view = validate_view(view))) return nullptr;
        return capi_view->getToolbar();
 }
 
 EAPI Elm_Toolbar *ui_standard_view_unset_toolbar(ui_standard_view *view)
 {
        ui_standard_view_capi *capi_view;
-       if (!(capi_view = validate_view(view))) return NULL;
+       if (!(capi_view = validate_view(view))) return nullptr;
        return capi_view->unsetToolbar();
 }
 
index 9ec890ea745656cb84595bcffcf0593f6fcb5d67..af6cf3c7d6a1f0f7dba7d4634732ed88d881d141 100644 (file)
@@ -134,7 +134,7 @@ static bool validate_view(ui_view *view)
 {
        if (!view)
        {
-               LOGE("Invalid ui_view = NULL");
+               LOGE("Invalid ui_view = nullptr");
                return false;
        }
        return true;
@@ -149,7 +149,7 @@ EAPI bool ui_view_set_lifecycle_callbacks(ui_view *view, ui_view_lifecycle_callb
 {
        if (!validate_view(view)) return false;
 
-       ui_common_view_capi *event_attr = dynamic_cast<ui_common_view_capi *>(view);
+       auto event_attr = dynamic_cast<ui_common_view_capi *>(view);
        if (!event_attr)
        {
                LOGE("This view(%p) doesn't allow lifecycle callback?!");
@@ -169,7 +169,7 @@ EAPI bool ui_view_set_event_callbacks(ui_view *view, ui_view_event_callback_s *e
 {
        if (!validate_view(view)) return false;
 
-       ui_common_view_capi *event_attr = dynamic_cast<ui_common_view_capi *>(view);
+       auto event_attr = dynamic_cast<ui_common_view_capi *>(view);
        if (!event_attr)
        {
                LOGE("This view(%p) doesn't allow event callback?!");
@@ -187,13 +187,13 @@ EAPI bool ui_view_set_event_callbacks(ui_view *view, ui_view_event_callback_s *e
 
 EAPI Evas_Object* ui_view_get_base(ui_view *view)
 {
-       if (!validate_view(view)) return NULL;
+       if (!validate_view(view)) return nullptr;
        return view->getBase();
 }
 
 EAPI Evas_Object *ui_view_unset_content(ui_view *view)
 {
-       if (!validate_view(view)) return NULL;
+       if (!validate_view(view)) return nullptr;
        return view->unsetContent();
 }
 
@@ -253,19 +253,19 @@ EAPI bool ui_view_set_transition_style(ui_view *view, const char *style)
 
 EAPI const char *ui_view_get_transition_style(ui_view *view)
 {
-       if (!validate_view(view)) return NULL;
+       if (!validate_view(view)) return nullptr;
        return view->getTransitionStyle();
 }
 
 EAPI const ui_menu *ui_view_get_menu(ui_view *view)
 {
-       if (!validate_view(view)) return NULL;
+       if (!validate_view(view)) return nullptr;
        return view->getMenu();
 }
 
 EAPI const char *ui_view_get_name(ui_view *view)
 {
-       if (!validate_view(view)) return NULL;
+       if (!validate_view(view)) return nullptr;
        return view->getName();
 }
 
@@ -277,7 +277,7 @@ EAPI ui_view_state ui_view_get_state(ui_view *view)
 
 EAPI Evas_Object *ui_view_get_content(ui_view *view)
 {
-       if (!validate_view(view)) return NULL;
+       if (!validate_view(view)) return nullptr;
        return view->getContent();
 }
 
index 316556ac835668feb53ab6c078dd4606de1baa79..cad57921db8244375e717664b8f7b65857ac8d25 100644 (file)
@@ -10,7 +10,7 @@ static bool validate_viewmgr(ui_viewmgr *viewmgr)
 {
        if (!viewmgr)
        {
-               LOGE("Invalid ui_viewmgr = NULL");
+               LOGE("Invalid ui_viewmgr = nullptr");
                return false;
        }
        return true;
@@ -21,7 +21,7 @@ EAPI ui_view *ui_viewmgr_push_view(ui_viewmgr *viewmgr, ui_view *view)
        if (!viewmgr || !view)
        {
                LOGE("Invalid Parameter viewmgr = %p, view = %p", viewmgr, view);
-               return NULL;
+               return nullptr;
        }
 
        return dynamic_cast<ui_view *>(viewmgr->pushView(view));
@@ -69,31 +69,31 @@ EAPI bool ui_viewmgr_deactivate(ui_viewmgr *viewmgr)
 
 EAPI Elm_Win *ui_viewmgr_get_window(ui_viewmgr *viewmgr)
 {
-       if (!validate_viewmgr(viewmgr)) return NULL;
+       if (!validate_viewmgr(viewmgr)) return nullptr;
        return viewmgr->getWindow();
 }
 
 EAPI ui_view *ui_viewmgr_get_last_view(ui_viewmgr *viewmgr)
 {
-       if (!validate_viewmgr(viewmgr)) return NULL;
+       if (!validate_viewmgr(viewmgr)) return nullptr;
        return dynamic_cast<ui_view *>(viewmgr->getLastView());
 }
 
 EAPI ui_view *ui_viewmgr_get_view_by_idx(ui_viewmgr *viewmgr, int idx)
 {
-       if (!validate_viewmgr(viewmgr)) return NULL;
+       if (!validate_viewmgr(viewmgr)) return nullptr;
        return dynamic_cast<ui_view *>(viewmgr->getView(idx));
 }
 
 EAPI ui_view *ui_viewmgr_get_view_by_name(ui_viewmgr *viewmgr, const char *name)
 {
-       if (!validate_viewmgr(viewmgr)) return NULL;
+       if (!validate_viewmgr(viewmgr)) return nullptr;
        return dynamic_cast<ui_view *>(viewmgr->getView(name));
 }
 
 EAPI Evas_Object *ui_viewmgr_get_base(ui_viewmgr *viewmgr)
 {
-       if (!validate_viewmgr(viewmgr)) return NULL;
+       if (!validate_viewmgr(viewmgr)) return nullptr;
        return viewmgr->getBase();
 }
 
index 5a2b3226b8c3e12c786bae89589153c521284f38..8d1d4fb1b6e9f6a3aac055348d1bad70c7cb4ea5 100644 (file)
@@ -30,15 +30,15 @@ class UiIfaceAppImpl
 public:
        friend class UiIfaceApp;
 
-       UiIfaceApp *app = NULL;
-       UiIfaceViewmgr *viewmgr = NULL;
-       Eina_Stringshare *pkg = NULL;
-       Eina_Stringshare *locale_dir = NULL;
+       UiIfaceApp *app = nullptr;
+       UiIfaceViewmgr *viewmgr = nullptr;
+       Eina_Stringshare *pkg = nullptr;
+       Eina_Stringshare *locale_dir = nullptr;
 
        UiIfaceAppImpl(UiIfaceApp *app, const char *pkg, const char *locale_dir, UiIfaceViewmgr* viewmgr);
        ~UiIfaceAppImpl();
 
-       int run(int argc, char **argv);
+       bool run(int argc, char **argv);
 
        bool init();
        bool onCreate();
@@ -58,61 +58,61 @@ public:
 
 static bool appCreate(void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        return app->onCreate();
 }
 
 static void appTerminate(void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onTerminate();
 }
 
 static void appPause(void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onPause();
 }
 
 static void appResume(void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onResume();
 }
 
 static void appControl(app_control_s *app_control, void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onControl(app_control);
 }
 
 static void uiAppLangChanged(app_event_info_h event_info, void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onLangChanged(event_info);
 }
 
 static void uiAppOrientChanged(app_event_info_h event_info, void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onOrientChanged(event_info);
 }
 
 static void uiAppRegionChanged(app_event_info_h event_info, void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onRegionChanged(event_info);
 }
 
 static void uiAppLowBattery(app_event_info_h event_info, void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onLowBattery(event_info);
 }
 
 static void uiAppLowMemory(app_event_info_h event_info, void *data)
 {
-       UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
+       auto app = static_cast<UiIfaceAppImpl *>(data);
        app->onLowMemory(event_info);
 }
 
@@ -132,10 +132,10 @@ UiIfaceAppImpl::UiIfaceAppImpl(UiIfaceApp *app, const char *pkg, const char *loc
        this->locale_dir = eina_stringshare_add(locale_dir);
 }
 
-int UiIfaceAppImpl::run(int argc, char **argv)
+bool UiIfaceAppImpl::run(int argc, char **argv)
 {
        ui_app_lifecycle_callback_s event_callback = { 0, };
-       app_event_handler_h handlers[5] = { NULL, };
+       app_event_handler_h handlers[5] = { nullptr, };
 
        event_callback.create = appCreate;
        event_callback.terminate = appTerminate;
@@ -153,9 +153,10 @@ int UiIfaceAppImpl::run(int argc, char **argv)
 
        if (ret != APP_ERROR_NONE) {
                LOGE("ui_app_main() is failed. err = %d", ret);
+               return false;
        }
 
-       return ret;
+       return true;
 }
 
 UiIfaceAppImpl::~UiIfaceAppImpl()
@@ -219,18 +220,18 @@ void UiIfaceAppImpl::onTerminate()
 /* External class Implementation                                                               */
 /***********************************************************************************************/
 
-static UiIfaceApp *_inst = NULL;
+static UiIfaceApp *_inst = nullptr;
 
 void UiIfaceApp::onLangChanged(app_event_info_h event_info)
 {
-       char *language = NULL;
+       char *language = nullptr;
        int ret = app_event_get_language(event_info, &language);
        if (ret != APP_ERROR_NONE) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret);
+               LOGE("app_event_get_language() failed. Err = %d", ret);
                return;
        }
 
-       if (language != NULL) {
+       if (language != nullptr) {
                elm_language_set(language);
                UiIfaceView *view = this->_impl->viewmgr->getLastView();
                view->onLanguageChanged(language);
@@ -240,26 +241,26 @@ void UiIfaceApp::onLangChanged(app_event_info_h event_info)
 
 void UiIfaceApp::onLowMemory(app_event_info_h event_info)
 {
-       UiIfaceView *view = this->_impl->viewmgr->getLastView();
+       auto view = this->_impl->viewmgr->getLastView();
        view->onLowMemory();
 }
 
 void UiIfaceApp::onLowBattery(app_event_info_h event_info)
 {
-       UiIfaceView *view = this->_impl->viewmgr->getLastView();
+       auto view = this->_impl->viewmgr->getLastView();
        view->onLowBattery();
 }
 
 void UiIfaceApp::onRegionChanged(app_event_info_h event_info)
 {
-       char *region = NULL;
+       char *region = nullptr;
        int ret = app_event_get_region_format(event_info, &region);
        if (ret != APP_ERROR_NONE) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "model_app_event_get_region_format() failed. Err = %d", ret);
+               LOGE("app_event_get_region_format() failed. Err = %d", ret);
                return;
        }
 
-       UiIfaceView *view = this->_impl->viewmgr->getLastView();
+       auto view = this->_impl->viewmgr->getLastView();
        view->onRegionChanged(region);
 }
 
@@ -295,14 +296,14 @@ void UiIfaceApp::onTerminate()
 UiIfaceApp::UiIfaceApp(const char *pkg, const char *locale_dir, UiIfaceViewmgr *viewmgr)
 {
        if (_inst) {
-               LOGE("You created UiIfaceApp multiple times!!");
+               throw UiIfaceException("Requested to create UiIfaceApp instance multiple times!!");
        }
        _inst = this;
 
        this->_impl = new UiIfaceAppImpl(this, pkg, locale_dir, viewmgr);
 }
 
-int UiIfaceApp::run(int argc, char **argv)
+bool UiIfaceApp::run(int argc, char **argv)
 {
        return this->_impl->run(argc, argv);
 }
@@ -310,7 +311,7 @@ int UiIfaceApp::run(int argc, char **argv)
 UiIfaceApp::~UiIfaceApp()
 {
        delete (this->_impl);
-       _inst = NULL;
+       _inst = nullptr;
 }
 
 UiIfaceViewmgr *UiIfaceApp::getViewmgr()
diff --git a/src/lib/interface/UiIfaceException.cpp b/src/lib/interface/UiIfaceException.cpp
new file mode 100644 (file)
index 0000000..9fc5053
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *               http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+#include <string>
+#include "../../include/interface/UiIfaceViewManager.h"
+
+using namespace ui_viewmanager;
+using namespace std;
+
+/***********************************************************************************************/
+/* Internal class Implementation                                                               */
+/***********************************************************************************************/
+namespace ui_viewmanager
+{
+
+class UiIfaceExceptionImpl
+{
+public:
+       string msg;
+
+       UiIfaceExceptionImpl(const char *msg)
+       {
+               this->msg = string(msg);
+       }
+};
+
+}
+
+/***********************************************************************************************/
+/* External class Implementation                                                               */
+/***********************************************************************************************/
+
+UiIfaceException ::UiIfaceException(const char *msg)
+{
+       LOGE("%s", msg);
+       this->_impl = new UiIfaceExceptionImpl(msg);
+}
+
+UiIfaceException::~UiIfaceException()
+{
+       delete(this->_impl);
+}
+
+const char *UiIfaceException::getMessage()
+{
+       return this->_impl->msg.c_str();
+}
index a1536ae9d4bd51f0282916dd436657dd54af51d6..1c09da18f963a44d040ae9bda498a8abaea643c8 100644 (file)
@@ -30,9 +30,9 @@ class UiIfaceOverlayImpl
        friend class UiIfaceOverlay;
 
 private:
-       UiIfaceOverlay *_overlay = NULL;
-       UiIfaceView *_view = NULL;
-       T _content = NULL;
+       UiIfaceOverlay *_overlay = nullptr;
+       UiIfaceView *_view = nullptr;
+       T _content = nullptr;
 
 public:
        bool setContent(T content);
@@ -64,7 +64,7 @@ bool UiIfaceOverlayImpl::setContent(T content)
 T UiIfaceOverlayImpl::unsetContent()
 {
        T prev = this->_content;
-       this->_content = NULL;
+       this->_content = nullptr;
        return prev;
 }
 
index 0be30e9ce8ced5cb75164a9b931214170d7bc55b..dcbaae7c76ccb44e7cc8242431e6d5c66fcd06a8 100644 (file)
@@ -34,14 +34,14 @@ class UiIfaceViewImpl
        friend class UiIfaceView;
 
 private:
-       UiIfaceView *_view = NULL;
-       T _content = NULL;                                      ///< A content instance for a screen as a view.
+       UiIfaceView *_view = nullptr;
+       T _content = nullptr;                                   ///< A content instance for a screen as a view.
        string _name;                                           ///< View name.
        string _transitionStyle = "default";                    ///< View transition style name.
-       UiIfaceViewmgr *_viewmgr = NULL;                        ///< Viewmgr which this view belongs to.
+       UiIfaceViewmgr *_viewmgr = nullptr;                     ///< Viewmgr which this view belongs to.
        UiViewState _state = UI_VIEW_STATE_UNLOAD;              ///< View state.
        UiViewIndicator _indicator = UI_VIEW_INDICATOR_DEFAULT; ///< View indicator mode.
-       int *_rotations = NULL;                                 ///< The pointer of rotation values.
+       int *_rotations = nullptr;                              ///< The pointer of rotation values.
        unsigned int _rotationCount = 0;                        ///< The number of available rotations.
        bool _eventBlock = false;                               ///< State of event block.
        bool _removableContent = true;                          ///< When this value is true, view removes it's content internally on unload state.
@@ -99,7 +99,7 @@ void UiIfaceViewImpl::onUnload()
 {
        this->_state = UI_VIEW_STATE_UNLOAD;
        if (this->getRemovableContent()) {
-               this->_view->setContent(NULL);
+               this->_view->setContent(nullptr);
                return;
        }
 }
@@ -149,7 +149,7 @@ bool UiIfaceViewImpl::setContent(T content)
 T UiIfaceViewImpl::unsetContent()
 {
        T prev = this->_content;
-       this->_content = NULL;
+       this->_content = nullptr;
        return prev;
 }
 
@@ -180,11 +180,11 @@ bool UiIfaceViewImpl::setAvailableRotations(const int *rotations, unsigned int c
 
        this->_rotations = new int[count];
        if (!this->_rotations) {
-               LOGE("Allocation failed");
+               LOGE("Memory Allocation failed");
                return false;
        }
 
-       for (unsigned int i = 0; i < count; i++) {
+       for (auto i = 0; i < count; i++) {
                this->_rotations[i] = rotations[i];
        }
 
@@ -239,7 +239,7 @@ UiViewIndicator UiIfaceViewImpl::getIndicator()
 
 void UiIfaceViewImpl::onBack()
 {
-       UiIfaceViewmgr *viewmgr = this->_viewmgr;
+       auto viewmgr = this->_viewmgr;
        if (!viewmgr) {
                LOGE("Failed to get a viewmgr, view =%p", this);
                return;
index 167afe2824e15ddcd89826a98b484d63d53204e2..c3a16e5e9eae22e538644ca847114ba19bc8d02e 100644 (file)
@@ -72,21 +72,16 @@ public:
 
 }
 
-UiIfaceViewmgr* UiIfaceViewmgrImpl::_inst = NULL;
+UiIfaceViewmgr* UiIfaceViewmgrImpl::_inst = nullptr;
 //FIXME: Read system profile to decide whether support software key or not.
 bool UiIfaceViewmgrImpl::_softKey = true;
 //FIXME: Read system profile to decide whether support event block or not.
 bool UiIfaceViewmgrImpl::_eventBlock = true;
 
-#define VIEW_ITR list<UiIfaceView *>::iterator
-#define VIEW_RITR list<UiIfaceView *>::reverse_iterator
-
 bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after)
 {
-       VIEW_ITR it;
-
        if (!view) {
-               LOGE("invalid view argument. view(NULL)");
+               LOGE("invalid view argument. view(nullptr)");
                return false;
        }
 
@@ -96,7 +91,7 @@ bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after)
        }
 
        if (this->_viewList.size() > 0) {
-               for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
+               for (auto 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.
@@ -111,7 +106,7 @@ bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after)
        }
 
        //If there is no matching after view with current list.
-       //also in case of after is NULL.
+       //also in case of after is nullptr.
        this->pushView(view);
 
        return true;
@@ -129,7 +124,7 @@ bool UiIfaceViewmgrImpl::connectView(UiIfaceView *view)
        int nameLen = strlen(view->getName());
        const char *name = view->getName();
 
-       for (UiIfaceView *v : this->_viewList) {
+       for (auto v : this->_viewList) {
                const char *viewName = v->getName();
                if (!viewName) continue;
                int viewNameLen = strlen(viewName);
@@ -147,7 +142,7 @@ bool UiIfaceViewmgrImpl::connectView(UiIfaceView *view)
 bool UiIfaceViewmgrImpl::disconnectView(UiIfaceView *view)
 {
        if (!view->_getViewmgr()) return false;
-       view->_setViewmgr(NULL);
+       view->_setViewmgr(nullptr);
        return true;
 }
 
@@ -159,7 +154,7 @@ void UiIfaceViewmgrImpl::setEventBlock(UiIfaceView *view, bool block)
 
 bool UiIfaceViewmgrImpl::pushViewFinished(UiIfaceView *view)
 {
-       UiIfaceView *last = this->_viewList.back();
+       auto last = this->_viewList.back();
 
        //The previous view has been pushed. This should be unload.
        if (last != view) {
@@ -176,7 +171,7 @@ bool UiIfaceViewmgrImpl::pushViewFinished(UiIfaceView *view)
 
 bool UiIfaceViewmgrImpl::popViewFinished(UiIfaceView *view)
 {
-       UiIfaceView *last = this->_viewList.back();
+       auto last = this->_viewList.back();
 
        //This view has been popped. It should be destroyed.
        if (last == view) {
@@ -202,8 +197,8 @@ UiIfaceViewmgrImpl::~UiIfaceViewmgrImpl()
 {
        //Terminate views
        this->_destroying = EINA_TRUE;
-       for (VIEW_RITR ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++) {
-               UiIfaceView *view = *ritr;
+       for (auto ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++) {
+               auto view = *ritr;
                if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
                        (view->getState() != UI_VIEW_STATE_UNLOAD)) {
                        view->onDeactivate();
@@ -219,19 +214,19 @@ UiIfaceViewmgrImpl::~UiIfaceViewmgrImpl()
 
        ui_app_exit();
 
-       UiIfaceViewmgrImpl::_inst = NULL;
+       UiIfaceViewmgrImpl::_inst = nullptr;
 }
 
 UiIfaceView *UiIfaceViewmgrImpl::pushView(UiIfaceView *view)
 {
        if (!view) {
-               LOGE("invalid view argument. view(NULL)");
-               return NULL;
+               LOGE("invalid view argument. view(nullptr)");
+               return nullptr;
        }
 
        if (!this->connectView(view)) {
                LOGE("connect view failed");
-               return NULL;
+               return nullptr;
        }
 
        UiIfaceView *pview;
@@ -261,7 +256,7 @@ UiIfaceView *UiIfaceViewmgrImpl::pushView(UiIfaceView *view)
 bool UiIfaceViewmgrImpl::popView()
 {
        //last page to be popped.
-       UiIfaceView*view = this->_viewList.back();
+       auto view = this->_viewList.back();
 
        if (view->getEventBlock()) {
                return false;
@@ -292,7 +287,7 @@ bool UiIfaceViewmgrImpl::popView()
        //Make this getter method? or define instance?
        //previous page is to be an active page.
        auto nx = prev(this->_viewList.end(), 2);
-       UiIfaceView*pview = *nx;
+       auto pview = *nx;
        pview->onLoad();
        pview->onDeactivate();
        this->setEventBlock(pview, true);
@@ -302,10 +297,8 @@ bool UiIfaceViewmgrImpl::popView()
 
 bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before)
 {
-       VIEW_ITR it;
-
        if (!view) {
-               LOGE("invalid view argument. view(NULL)");
+               LOGE("invalid view argument. view(nullptr)");
                return false;
        }
 
@@ -315,17 +308,16 @@ bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before
        }
 
        if (this->_viewList.size() > 0) {
-               for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
+               for (auto it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
                        if (before == *it) {
                                this->_viewList.insert(it, view);
-
                                return true;
                        }
                }
        }
 
        //If there is no matching before view with current list.
-       //also in case of before is NULL.
+       //also in case of before is nullptr.
        this->pushView(view);
 
        return true;
@@ -346,10 +338,10 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx)
 {
        if (idx < 0 || idx >= this->_viewList.size()) {
                LOGE("Invalid idx(%d)! =? (idx range: %d ~ %d)", idx, 0, this->_viewList.size() - 1);
-               return NULL;
+               return nullptr;
        }
 
-       VIEW_ITR it = this->_viewList.begin();
+       auto it = this->_viewList.begin();
        advance(it, idx);
        return *it;
 }
@@ -358,7 +350,7 @@ int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view)
 {
        int idx = 0;
 
-       for (UiIfaceView *v : this->_viewList) {
+       for (auto v : this->_viewList) {
                if (view == v) return idx;
                ++idx;
        }
@@ -379,7 +371,7 @@ bool UiIfaceViewmgrImpl::activate()
        if (this->getViewCount() == 0) return false;
        this->_activated = true;
 
-       UiIfaceView *view = this->getLastView();
+       auto view = this->getLastView();
 
        view->onLoad();
        view->onDeactivate();
@@ -393,7 +385,7 @@ bool UiIfaceViewmgrImpl::deactivate()
        if (!this->_activated) return false;
        this->_activated = false;
 
-       UiIfaceView *view = this->getLastView();
+       auto view = this->getLastView();
 
        if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
                (view->getState() != UI_VIEW_STATE_UNLOAD)) {
@@ -408,10 +400,10 @@ bool UiIfaceViewmgrImpl::deactivate()
 
 UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name)
 {
-       if (!name) return NULL;
+       if (!name) return nullptr;
        int nameLen = strlen(name);
 
-       for (UiIfaceView *v : this->_viewList) {
+       for (auto v : this->_viewList) {
                const char *viewName = v->getName();
                if (!viewName) continue;
                int viewNameLen = strlen(viewName);
@@ -422,7 +414,7 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name)
                }
        }
 
-       return NULL;
+       return nullptr;
 }
 
 bool UiIfaceViewmgrImpl::isActivated()