From: Hermet Park Date: Tue, 13 Sep 2016 07:34:04 +0000 (+0900) Subject: c++: code refactoring. X-Git-Tag: submit/tizen/20160928.045111^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f1c63df9a7bcf110ae010d405bffbbb941d9486;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git c++: code refactoring. replace NULL to nullptr. nullptr is more explict than NULL. Its behavior is more clear and correct for the polymorphism environment. Change-Id: I9aa99ca1a6ccf7c7d5c4d3db14d8ced6502a2fd5 --- diff --git a/src/examples/efl/c/main.cpp b/src/examples/efl/c/main.cpp index fe37edd..eec479f 100644 --- a/src/examples/efl/c/main.cpp +++ b/src/examples/efl/c/main.cpp @@ -29,7 +29,7 @@ main(int argc, char *argv[]) if (!ui_application_init(PACKAGE, LOCALE_DIR)) { dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_init() is failed"); - return 1; + return 0; } //Register life cycle callback functions. @@ -40,14 +40,14 @@ main(int argc, char *argv[]) if (!ui_application_run(argc, argv, &lifecycle_callback, NULL)) { dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_run() is failed"); - return 1; + return 0; } //Terminate ui_app. Remove all ui_app resources. if (!ui_application_term()) { dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_term() is failed"); - return 1; + return 0; } return 0; diff --git a/src/examples/efl/cpp/contents.cpp b/src/examples/efl/cpp/contents.cpp index 8337ef9..bc4018f 100644 --- a/src/examples/efl/cpp/contents.cpp +++ b/src/examples/efl/cpp/contents.cpp @@ -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); diff --git a/src/examples/efl/cpp/page11.h b/src/examples/efl/cpp/page11.h index 487c782..8227c3b 100644 --- a/src/examples/efl/cpp/page11.h +++ b/src/examples/efl/cpp/page11.h @@ -56,15 +56,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); } diff --git a/src/examples/efl/cpp/page12.h b/src/examples/efl/cpp/page12.h index 3aad58e..6342ee6 100644 --- a/src/examples/efl/cpp/page12.h +++ b/src/examples/efl/cpp/page12.h @@ -83,13 +83,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(); diff --git a/src/include/efl/UiBaseView.h b/src/include/efl/UiBaseView.h index a024443..4ad86b1 100644 --- a/src/include/efl/UiBaseView.h +++ b/src/include/efl/UiBaseView.h @@ -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; diff --git a/src/include/efl/UiBaseViewmgr.h b/src/include/efl/UiBaseViewmgr.h index ae36b68..b6d3147 100644 --- a/src/include/efl/UiBaseViewmgr.h +++ b/src/include/efl/UiBaseViewmgr.h @@ -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() */ diff --git a/src/include/efl/mobile/UiMenu.h b/src/include/efl/mobile/UiMenu.h index d49d32f..a336c98 100644 --- a/src/include/efl/mobile/UiMenu.h +++ b/src/include/efl/mobile/UiMenu.h @@ -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; diff --git a/src/include/efl/mobile/UiPopup.h b/src/include/efl/mobile/UiPopup.h index 76ea35e..913038f 100644 --- a/src/include/efl/mobile/UiPopup.h +++ b/src/include/efl/mobile/UiPopup.h @@ -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; diff --git a/src/include/efl/mobile/UiStandardView.h b/src/include/efl/mobile/UiStandardView.h index 98b2d8b..2b793f3 100644 --- a/src/include/efl/mobile/UiStandardView.h +++ b/src/include/efl/mobile/UiStandardView.h @@ -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. @@ -123,28 +123,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(); diff --git a/src/include/efl/mobile/UiView.h b/src/include/efl/mobile/UiView.h index 882e435..75634f0 100644 --- a/src/include/efl/mobile/UiView.h +++ b/src/include/efl/mobile/UiView.h @@ -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(); diff --git a/src/include/interface/UiIfaceOverlay.h b/src/include/interface/UiIfaceOverlay.h index a1d7170..d4e8db9 100644 --- a/src/include/interface/UiIfaceOverlay.h +++ b/src/include/interface/UiIfaceOverlay.h @@ -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(); diff --git a/src/include/interface/UiIfaceView.h b/src/include/interface/UiIfaceView.h index fd22773..daf0829 100644 --- a/src/include/interface/UiIfaceView.h +++ b/src/include/interface/UiIfaceView.h @@ -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(); diff --git a/src/include/interface/UiIfaceViewmgr.h b/src/include/interface/UiIfaceViewmgr.h index 6336bda..7029ad3 100644 --- a/src/include/interface/UiIfaceViewmgr.h +++ b/src/include/interface/UiIfaceViewmgr.h @@ -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(). */ diff --git a/src/lib/efl/UiBaseKeyListener.cpp b/src/lib/efl/UiBaseKeyListener.cpp index 3b1a499..174ed16 100644 --- a/src/lib/efl/UiBaseKeyListener.cpp +++ b/src/lib/efl/UiBaseKeyListener.cpp @@ -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); diff --git a/src/lib/efl/UiBaseView.cpp b/src/lib/efl/UiBaseView.cpp index 998a00e..0dc38a5 100644 --- a/src/lib/efl/UiBaseView.cpp +++ b/src/lib/efl/UiBaseView.cpp @@ -79,7 +79,7 @@ Evas_Object *UiBaseView::getBase() auto viewmgr = UI_BASE_VIEWMGR; if (!viewmgr) { - return NULL; + return nullptr; } return viewmgr->getBase(); @@ -91,7 +91,7 @@ Evas_Object *UiBaseView ::getParent() if (!viewmgr) { LOGE("Failed to get a viewmgr"); - return NULL; + return nullptr; } return viewmgr->getBase(); diff --git a/src/lib/efl/UiBaseViewmgr.cpp b/src/lib/efl/UiBaseViewmgr.cpp index 0d86e2e..d975850 100644 --- a/src/lib/efl/UiBaseViewmgr.cpp +++ b/src/lib/efl/UiBaseViewmgr.cpp @@ -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 _effectMap; //Map for effect layouts. @@ -124,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"); @@ -136,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) { @@ -212,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); diff --git a/src/lib/efl/mobile/UiMenu.cpp b/src/lib/efl/mobile/UiMenu.cpp index 60f73b1..b53f6a0 100644 --- a/src/lib/efl/mobile/UiMenu.cpp +++ b/src/lib/efl/mobile/UiMenu.cpp @@ -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) { @@ -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); diff --git a/src/lib/efl/mobile/UiPopup.cpp b/src/lib/efl/mobile/UiPopup.cpp index b878f0e..c121a4c 100644 --- a/src/lib/efl/mobile/UiPopup.cpp +++ b/src/lib/efl/mobile/UiPopup.cpp @@ -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); diff --git a/src/lib/efl/mobile/UiStandardView.cpp b/src/lib/efl/mobile/UiStandardView.cpp index 751e9cb..a413765 100644 --- a/src/lib/efl/mobile/UiStandardView.cpp +++ b/src/lib/efl/mobile/UiStandardView.cpp @@ -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(); @@ -107,7 +107,7 @@ bool UiStandardViewImpl::_destroyLayout() if (!this->_layout) return false; evas_object_del(this->_layout); - this->_layout = NULL; + this->_layout = nullptr; return true; } @@ -328,7 +328,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) { @@ -340,7 +340,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; } @@ -348,7 +348,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) { @@ -360,7 +360,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; } @@ -368,7 +368,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) { @@ -380,7 +380,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; } @@ -493,7 +493,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(); diff --git a/src/lib/efl/mobile/UiView.cpp b/src/lib/efl/mobile/UiView.cpp index 4c7d17f..cff32ec 100644 --- a/src/lib/efl/mobile/UiView.cpp +++ b/src/lib/efl/mobile/UiView.cpp @@ -34,8 +34,8 @@ class UiViewImpl friend class UiView; private: - UiView *_view = NULL; - UiMenu *_menu = NULL; + UiView *_view = nullptr; + UiMenu *_menu = nullptr; list _popupList; void _connectPopup(UiPopup *popup); @@ -105,7 +105,7 @@ bool UiViewImpl::onBack() } UiViewImpl::UiViewImpl(UiView *view) - : _view(view), _menu(NULL) + : _view(view), _menu(nullptr) { } @@ -123,7 +123,7 @@ UiMenu *UiViewImpl::onMenuPre() if (this->_menu->isActivated()) { this->_menu->deactivate(); - return NULL; + return nullptr; } return this->_menu; diff --git a/src/lib/efl/mobile/c/ui_application.cpp b/src/lib/efl/mobile/c/ui_application.cpp index 8a59512..4c43f2e 100644 --- a/src/lib/efl/mobile/c/ui_application.cpp +++ b/src/lib/efl/mobile/c/ui_application.cpp @@ -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) { } @@ -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) { @@ -104,6 +104,6 @@ EAPI bool ui_application_term(void) { ui_app_capi *app = g_app; if (app) delete (app); - g_app = NULL; + g_app = nullptr; return true; } diff --git a/src/lib/efl/mobile/c/ui_menu.cpp b/src/lib/efl/mobile/c/ui_menu.cpp index 3768292..89db1dd 100644 --- a/src/lib/efl/mobile/c/ui_menu.cpp +++ b/src/lib/efl/mobile/c/ui_menu.cpp @@ -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(menu->getView()); } diff --git a/src/lib/efl/mobile/c/ui_popup.cpp b/src/lib/efl/mobile/c/ui_popup.cpp index 3d8cf2c..a43ac50 100644 --- a/src/lib/efl/mobile/c/ui_popup.cpp +++ b/src/lib/efl/mobile/c/ui_popup.cpp @@ -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(popup->getView()); } diff --git a/src/lib/efl/mobile/c/ui_standard_view.cpp b/src/lib/efl/mobile/c/ui_standard_view.cpp index aa6881d..1f2386c 100644 --- a/src/lib/efl/mobile/c/ui_standard_view.cpp +++ b/src/lib/efl/mobile/c/ui_standard_view.cpp @@ -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(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; @@ -185,14 +185,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(); } @@ -206,14 +206,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(); } @@ -227,14 +227,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(); } diff --git a/src/lib/efl/mobile/c/ui_view.cpp b/src/lib/efl/mobile/c/ui_view.cpp index ee994c4..af6cf3c 100644 --- a/src/lib/efl/mobile/c/ui_view.cpp +++ b/src/lib/efl/mobile/c/ui_view.cpp @@ -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; @@ -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(); } diff --git a/src/lib/efl/mobile/c/ui_viewmgr.cpp b/src/lib/efl/mobile/c/ui_viewmgr.cpp index 316556a..cad5792 100644 --- a/src/lib/efl/mobile/c/ui_viewmgr.cpp +++ b/src/lib/efl/mobile/c/ui_viewmgr.cpp @@ -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(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(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(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(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(); } diff --git a/src/lib/interface/UiIfaceApp.cpp b/src/lib/interface/UiIfaceApp.cpp index 5d257c5..8d1d4fb 100644 --- a/src/lib/interface/UiIfaceApp.cpp +++ b/src/lib/interface/UiIfaceApp.cpp @@ -30,10 +30,10 @@ 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(); @@ -135,7 +135,7 @@ UiIfaceAppImpl::UiIfaceAppImpl(UiIfaceApp *app, const char *pkg, const char *loc 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; @@ -220,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) { 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); @@ -253,7 +253,7 @@ void UiIfaceApp::onLowBattery(app_event_info_h event_info) void UiIfaceApp::onRegionChanged(app_event_info_h event_info) { - char *region = NULL; + char *region = nullptr; int ret = app_event_get_region_format(event_info, ®ion); if (ret != APP_ERROR_NONE) { LOGE("app_event_get_region_format() failed. Err = %d", ret); @@ -311,7 +311,7 @@ bool UiIfaceApp::run(int argc, char **argv) UiIfaceApp::~UiIfaceApp() { delete (this->_impl); - _inst = NULL; + _inst = nullptr; } UiIfaceViewmgr *UiIfaceApp::getViewmgr() diff --git a/src/lib/interface/UiIfaceOverlay.cpp b/src/lib/interface/UiIfaceOverlay.cpp index a1536ae..1c09da1 100644 --- a/src/lib/interface/UiIfaceOverlay.cpp +++ b/src/lib/interface/UiIfaceOverlay.cpp @@ -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; } diff --git a/src/lib/interface/UiIfaceView.cpp b/src/lib/interface/UiIfaceView.cpp index 8a433e2..dcbaae7 100644 --- a/src/lib/interface/UiIfaceView.cpp +++ b/src/lib/interface/UiIfaceView.cpp @@ -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; } diff --git a/src/lib/interface/UiIfaceViewmgr.cpp b/src/lib/interface/UiIfaceViewmgr.cpp index ea4a715..c3a16e5 100644 --- a/src/lib/interface/UiIfaceViewmgr.cpp +++ b/src/lib/interface/UiIfaceViewmgr.cpp @@ -72,7 +72,7 @@ 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. @@ -81,7 +81,7 @@ bool UiIfaceViewmgrImpl::_eventBlock = true; bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after) { if (!view) { - LOGE("invalid view argument. view(NULL)"); + LOGE("invalid view argument. view(nullptr)"); return false; } @@ -106,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; @@ -142,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; } @@ -214,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; @@ -298,7 +298,7 @@ bool UiIfaceViewmgrImpl::popView() bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before) { if (!view) { - LOGE("invalid view argument. view(NULL)"); + LOGE("invalid view argument. view(nullptr)"); return false; } @@ -317,7 +317,7 @@ bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before } //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; @@ -338,7 +338,7 @@ 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; } auto it = this->_viewList.begin(); @@ -400,7 +400,7 @@ bool UiIfaceViewmgrImpl::deactivate() UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name) { - if (!name) return NULL; + if (!name) return nullptr; int nameLen = strlen(name); for (auto v : this->_viewList) { @@ -414,7 +414,7 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name) } } - return NULL; + return nullptr; } bool UiIfaceViewmgrImpl::isActivated()