From cb9ead9dcc106f422bd23b65a7f752c148e907ba Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 26 Sep 2016 18:40:09 +0900 Subject: [PATCH] removed capi MACROS, also remove all viewmgr arguments from the capis. * MACROS are not recommended in tizen. * since the viewmgr is singletone instance, user don't need to pass it as the argument. Change-Id: Id1db9def56d43b2e4ead52319d6eacefbf1c8a52 --- src/examples/efl/c/page1.cpp | 4 +- src/examples/efl/c/page10.cpp | 4 +- src/examples/efl/c/page11.cpp | 4 +- src/examples/efl/c/page12.cpp | 4 +- src/examples/efl/c/page13.cpp | 4 +- src/examples/efl/c/page14.cpp | 4 +- src/examples/efl/c/page15.cpp | 2 +- src/examples/efl/c/page16.cpp | 6 +- src/examples/efl/c/page2.cpp | 4 +- src/examples/efl/c/page3.cpp | 4 +- src/examples/efl/c/page4.cpp | 4 +- src/examples/efl/c/page5.cpp | 4 +- src/examples/efl/c/page6.cpp | 4 +- src/examples/efl/c/page7.cpp | 4 +- src/examples/efl/c/page8.cpp | 5 +- src/examples/efl/c/page9.cpp | 4 +- .../efl/mobile/c/ui_mobile_viewmanager.h | 1 - src/include/efl/mobile/c/ui_viewmgr.h | 116 +++++------------- src/lib/efl/mobile/c/ui_viewmgr.cpp | 101 ++++++++------- 19 files changed, 109 insertions(+), 174 deletions(-) diff --git a/src/examples/efl/c/page1.cpp b/src/examples/efl/c/page1.cpp index 2d85436..386ea7b 100644 --- a/src/examples/efl/c/page1.cpp +++ b/src/examples/efl/c/page1.cpp @@ -21,7 +21,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { //FIXME: deactivate??? or ui_app deactivate??? or ui_viewmgr pop??? - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -82,5 +82,5 @@ create_page1() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page10.cpp b/src/examples/efl/c/page10.cpp index e3962ce..a759be3 100644 --- a/src/examples/efl/c/page10.cpp +++ b/src/examples/efl/c/page10.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -105,5 +105,5 @@ create_page10() dlog_print(DLOG_ERROR, LOG_TAG, "ui_view_event_callback_set is failed. err = %d", ret); } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page11.cpp b/src/examples/efl/c/page11.cpp index 54aaea0..1922c79 100644 --- a/src/examples/efl/c/page11.cpp +++ b/src/examples/efl/c/page11.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -134,5 +134,5 @@ create_page11() dlog_print(DLOG_ERROR, LOG_TAG, "ui_view_event_callback_set is failed. err = %d", ret); } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page12.cpp b/src/examples/efl/c/page12.cpp index 48d623b..1af2810 100644 --- a/src/examples/efl/c/page12.cpp +++ b/src/examples/efl/c/page12.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -152,5 +152,5 @@ create_page12() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page13.cpp b/src/examples/efl/c/page13.cpp index 7ca0818..34e110d 100644 --- a/src/examples/efl/c/page13.cpp +++ b/src/examples/efl/c/page13.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -84,5 +84,5 @@ create_page13() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page14.cpp b/src/examples/efl/c/page14.cpp index 748fdc3..8fc88fa 100644 --- a/src/examples/efl/c/page14.cpp +++ b/src/examples/efl/c/page14.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -84,5 +84,5 @@ create_page14() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page15.cpp b/src/examples/efl/c/page15.cpp index 3803d7a..ce88949 100644 --- a/src/examples/efl/c/page15.cpp +++ b/src/examples/efl/c/page15.cpp @@ -80,6 +80,6 @@ create_page15() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page16.cpp b/src/examples/efl/c/page16.cpp index 3ef82c6..718c4c5 100644 --- a/src/examples/efl/c/page16.cpp +++ b/src/examples/efl/c/page16.cpp @@ -20,13 +20,13 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void next_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_DEACTIVATE(); + ui_viewmgr_deactivate(); } static void @@ -109,5 +109,5 @@ create_page16() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page2.cpp b/src/examples/efl/c/page2.cpp index 27bcdc1..44b0684 100644 --- a/src/examples/efl/c/page2.cpp +++ b/src/examples/efl/c/page2.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -95,5 +95,5 @@ create_page2() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page3.cpp b/src/examples/efl/c/page3.cpp index 6df9de7..0e29092 100644 --- a/src/examples/efl/c/page3.cpp +++ b/src/examples/efl/c/page3.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -82,5 +82,5 @@ create_page3() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page4.cpp b/src/examples/efl/c/page4.cpp index 9cd4815..ccdd79c 100644 --- a/src/examples/efl/c/page4.cpp +++ b/src/examples/efl/c/page4.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -82,5 +82,5 @@ create_page4() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page5.cpp b/src/examples/efl/c/page5.cpp index 6842f67..3146e9c 100644 --- a/src/examples/efl/c/page5.cpp +++ b/src/examples/efl/c/page5.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -82,5 +82,5 @@ create_page5() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page6.cpp b/src/examples/efl/c/page6.cpp index 98510af..9556bae 100644 --- a/src/examples/efl/c/page6.cpp +++ b/src/examples/efl/c/page6.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -85,5 +85,5 @@ create_page6() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page7.cpp b/src/examples/efl/c/page7.cpp index aec4525..815ac91 100644 --- a/src/examples/efl/c/page7.cpp +++ b/src/examples/efl/c/page7.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -85,5 +85,5 @@ create_page7() return; } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page8.cpp b/src/examples/efl/c/page8.cpp index b093024..5bbf003 100644 --- a/src/examples/efl/c/page8.cpp +++ b/src/examples/efl/c/page8.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -73,6 +73,5 @@ create_page8() //This is a show case for saving this content for reuse later. ui_view_set_removable_content(view, false); - - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/examples/efl/c/page9.cpp b/src/examples/efl/c/page9.cpp index 51e5738..ce48198 100644 --- a/src/examples/efl/c/page9.cpp +++ b/src/examples/efl/c/page9.cpp @@ -20,7 +20,7 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - UI_VIEWMGR_POP_VIEW(); + ui_viewmgr_pop_view(); } static void @@ -131,5 +131,5 @@ create_page9() dlog_print(DLOG_ERROR, LOG_TAG, "ui_view_event_callback_set is failed. err = %d", ret); } - UI_VIEWMGR_PUSH_VIEW(view); + ui_viewmgr_push_view(view); } diff --git a/src/include/efl/mobile/c/ui_mobile_viewmanager.h b/src/include/efl/mobile/c/ui_mobile_viewmanager.h index f7dd2be..d57cd60 100644 --- a/src/include/efl/mobile/c/ui_mobile_viewmanager.h +++ b/src/include/efl/mobile/c/ui_mobile_viewmanager.h @@ -38,7 +38,6 @@ #include #include -typedef struct ui_viewmgr_s ui_viewmgr; typedef struct ui_view_s ui_view; typedef ui_view ui_standard_view; typedef struct ui_menu_s ui_menu; diff --git a/src/include/efl/mobile/c/ui_viewmgr.h b/src/include/efl/mobile/c/ui_viewmgr.h index f037dbf..4cfa1e9 100644 --- a/src/include/efl/mobile/c/ui_viewmgr.h +++ b/src/include/efl/mobile/c/ui_viewmgr.h @@ -13,15 +13,14 @@ extern "C" { */ /** - * @brief Push a new view into given @a viewmgr. This function is used for when application switches a current view to a new one. + * @brief Push a new view into ui_viewmgr. This function is used for when application switches a current view to a new one. * * @note Normally, the current view will be hidden by a new view. In default, when user calls this API, view will be switched to @a view instantly, * only when ui_viewmgr state is activated. Otherwise, the @a view will be shown later when ui_viewmgr is activated. ui_viewmgr_view_push() is designed * for providing view transition effect. If you want push view instantly without any transition, you could use ui_viewmgr_view_push_insert_before() or * ui_viewmgr_view_push_insert_after(). If you want to pop the current view, the please use ui_viewmgr_view_pop(). * - * @param viewmgr The ui_viewmgr instance. - * @param view An ui_view to insert in the given @a viewmgr view list + * @param view An ui_view to insert in the ui_viewmgr view list * * @return @a view, @c NULL when it fails to push a @a view * @@ -32,13 +31,12 @@ extern "C" { * * @since_tizen 3.0 */ -EAPI ui_view *ui_viewmgr_push_view(ui_viewmgr *viewmgr, ui_view *view); +EAPI ui_view *ui_viewmgr_push_view(ui_view *view); /** - * @brief Insert a view in this given @a viewmgr view list. Specifically, insert a given @a view right before of the given view, @before. + * @brief Insert a view in the ui_viewmgr view list. Specifically, insert a given @a view right before of the given view, @before. * - * @param viewmgr The ui_viewmgr instance. - * @param view An ui_view to insert in the @a viewmgr view list + * @param view An ui_view to insert in the ui_viewmgr view list * @param before An ui_view that will be just inserted after @a view. If you pass @c NULL, @a view will be inserted at the front of the view list * * @return @c true on success or @c false otherwise @@ -47,13 +45,12 @@ EAPI ui_view *ui_viewmgr_push_view(ui_viewmgr *viewmgr, ui_view *view); * * @since_tizen 3.0 */ -EAPI bool ui_viewmgr_push_view_insert_before(ui_viewmgr *viewmgr, ui_view *view, ui_view *before); +EAPI bool ui_viewmgr_push_view_insert_before(ui_view *view, ui_view *before); /** - * @brief Insert a view in this given @a viewmgr view list. Specifically, insert a given @a view right after of the given view, @after. + * @brief Insert a view in the ui_viewmgr view list. Specifically, insert a given @a view right after of the given view, @after. * - * @param viewmgr The ui_viewmgr instance. - * @param view An ui_view to insert in the @a viewmgr view list + * @param view An ui_view to insert in the ui_viewmgr view list * @param after An ui_view that will be just inserted before the @a view. If you pass @c NULL, @a view will be inserted at the end of the view list * * @return @c true on success or @c false otherwise @@ -62,18 +59,16 @@ EAPI bool ui_viewmgr_push_view_insert_before(ui_viewmgr *viewmgr, ui_view *view, * * @since_tizen 3.0 */ -EAPI bool ui_viewmgr_push_view_insert_after(ui_viewmgr *viewmgr, ui_view *view, ui_view *after); +EAPI bool ui_viewmgr_push_view_insert_after(ui_view *view, ui_view *after); /** - * @brief Pop the top(last) view from this given @a viewmgr view list. + * @brief Pop the top(last) view from the ui_viewmgr view list. * This function is used when application switches the current view back to the previous view. - * The top view will be removed from the view stack and then it will be deleted by the given @a viewmgr. + * The top view will be removed from the view stack and then it will be deleted by the given ui_viewmgr. * * @note If the view is just one left, then ui_viewmgr would be deactivated automatically since the ui application might be invalid anymore. Otherwise, * the application will be terminated. It's up to system configuration. * - * @param viewmgr The ui_viewmgr instance. - * * @return @c true on success or @c false otherwise * * @see ui_viewmgr_deactivate() @@ -81,66 +76,57 @@ EAPI bool ui_viewmgr_push_view_insert_after(ui_viewmgr *viewmgr, ui_view *view, * * @since_tizen 3.0 */ -EAPI bool ui_viewmgr_pop_view(ui_viewmgr *viewmgr); +EAPI bool ui_viewmgr_pop_view(void); /** * @brief Activate this view manager. * - * @note viewmgr window and views will be shown once this function is called. Usually this should be called after applications set their all views + * @note ui_viewmgr window and views will be shown once this function is called. Usually this should be called after applications set their all views * on initialization time. * - * @param viewmgr The ui_viewmgr instance. - * * @return @c true on success or @c false otherwise * * @see ui_viewmgr_deactivate() * * @since_tizen 3.0 */ -EAPI bool ui_viewmgr_activate(ui_viewmgr *viewmgr); +EAPI bool ui_viewmgr_activate(void); /** * @brief Deactivate this view manager. * - * @note viewmgr window and views will be hidden once this function is called. this behavior is up ui system, but usually it hides(unmap) + * @note ui_viewmgr window and views will be hidden once this function is called. this behavior is up ui system, but usually it hides(unmap) * current window in order that application go background. * - * @param viewmgr The ui_viewmgr instance. - * * @return @c true success or @c false not * * @see ui_viewmgr_activate() * * @since_tizen 3.0 */ -EAPI bool ui_viewmgr_deactivate(ui_viewmgr *viewmgr); +EAPI bool ui_viewmgr_deactivate(void); /** - * @brief Get a window object of viewmgr. + * @brief Get a window object of ui_viewmgr. * - * @param viewmgr The ui_viewmgr instance. - * - * @return The window object of viewmgr + * @return The window object of ui_viewmgr * * @since_tizen 3.0 */ -EAPI Elm_Win *ui_viewmgr_get_window(ui_viewmgr *viewmgr); +EAPI Elm_Win *ui_viewmgr_get_window(void); /** * @brief Return a last(top) view. * - * @param viewmgr The ui_viewmgr instance. - * - * @return The view which is last view of the given @a viewmgr view list + * @return The view which is last view of the ui_viewmgr view list * * @since_tizen 3.0 */ -EAPI ui_view *ui_viewmgr_get_last_view(ui_viewmgr *viewmgr); +EAPI ui_view *ui_viewmgr_get_last_view(void); /** * @brief Return a view which is matched with the index @a idx. * - * @param viewmgr The ui_viewmgr instance. * @param idx A index of the view which you are looking for. * * @note You could use the index as the page numbers of the views. @@ -154,7 +140,7 @@ EAPI ui_view *ui_viewmgr_get_last_view(ui_viewmgr *viewmgr); * * @since_tizen 3.0 */ -EAPI ui_view *ui_viewmgr_get_view_by_idx(ui_viewmgr *viewmgr, int idx); +EAPI ui_view *ui_viewmgr_get_view_by_idx(int idx); /** * @brief Return a view which is matched with the @a name. @@ -170,26 +156,23 @@ EAPI ui_view *ui_viewmgr_get_view_by_idx(ui_viewmgr *viewmgr, int idx); * * @since_tizen 3.0 */ -EAPI ui_view *ui_viewmgr_get_view_by_name(ui_viewmgr *viewmgr, const char *name); +EAPI ui_view *ui_viewmgr_get_view_by_name(const char *name); /** * @brief Get a base object of a ui_viewmgr. * * @note Normally, a base object can be used for adding additional objects. * - * @param viewmgr The ui_viewmgr instance. - * * @return The base object of ui_viewmgr. * * @since_tizen 3.0 */ -EAPI Eo *ui_viewmgr_get_base(ui_viewmgr *viewmgr); +EAPI Eo *ui_viewmgr_get_base(void); /** * @brief Return a view index(page) number of the given view. * You could use this function to query the given @a view list order. * - * @param viewmgr The ui_viewmgr instance. * @param view An ui_view to query the index * * @return An index of the given @a view on success, otherwise, -1 @@ -198,68 +181,25 @@ EAPI Eo *ui_viewmgr_get_base(ui_viewmgr *viewmgr); * * @since_tizen 3.0 */ -EAPI int ui_viewmgr_get_view_index(ui_viewmgr *viewmgr, const ui_view *view); +EAPI int ui_viewmgr_get_view_index(const ui_view *view); /** - * @brief Return the number of views which this @a given viewmgr has. - * - * @param viewmgr The ui_viewmgr instance. + * @brief Return the number of views which of ui_viewmgr. * * @return the count of views * * @since_tizen 3.0 */ -EAPI int ui_viewmgr_get_view_count(ui_viewmgr *viewmgr); +EAPI int ui_viewmgr_get_view_count(void); /** * @brief Return whether soft back key is required or not. * - * @param viewmgr The ui_viewmgr instance. - * * @return @c true if soft key is required, @c false otherwise * * @since_tizen 3.0 */ -EAPI bool ui_viewmgr_get_soft_key_need(ui_viewmgr *viewmgr); - -/** - * @brief Return the ui_viewmgr instance. - * - * @note ui_viewmgr has a singleton instance. - * - * @return The ui_viewmgr instance. - * - * @since_tizen 3.0 - */ -EAPI ui_viewmgr *ui_viewmgr_get_viewmgr(); - -/** - * @brief A Convenient Macro to activate the ui_viewmgr. - * - * @since_tizen 3.0 - */ -#define UI_VIEWMGR_ACTIVATE() (ui_viewmgr_activate(ui_viewmgr_get_viewmgr())) - -/** - * @brief A Convenient Macro function to deactivate the ui_viewmgr. - * - * @since_tizen 3.0 - */ -#define UI_VIEWMGR_DEACTIVATE() (ui_viewmgr_deactivate(ui_viewmgr_get_viewmgr())) - -/** - * @brief A Convenient Macro function to push a view. - * - * @since_tizen 3.0 - */ -#define UI_VIEWMGR_PUSH_VIEW(X) (ui_viewmgr_push_view(ui_viewmgr_get_viewmgr(), (X))) - -/** - * @brief A Convenient Macro function to pop a view. - * - * @since_tizen 3.0 - */ -#define UI_VIEWMGR_POP_VIEW() (ui_viewmgr_pop_view(ui_viewmgr_get_viewmgr())) +EAPI bool ui_viewmgr_get_soft_key_need(void); #ifdef __cplusplus } diff --git a/src/lib/efl/mobile/c/ui_viewmgr.cpp b/src/lib/efl/mobile/c/ui_viewmgr.cpp index cad5792..a00f6a5 100644 --- a/src/lib/efl/mobile/c/ui_viewmgr.cpp +++ b/src/lib/efl/mobile/c/ui_viewmgr.cpp @@ -1,127 +1,124 @@ #include "../../../../include/efl/mobile/c/_ui_private.h" #include "../../../../include/efl/mobile/c/ui_viewmgr.h" -struct ui_viewmgr_s +EAPI ui_view *ui_viewmgr_push_view(ui_view *view) { - ui_viewmgr *p; -}; - -static bool validate_viewmgr(ui_viewmgr *viewmgr) -{ - if (!viewmgr) - { - LOGE("Invalid ui_viewmgr = nullptr"); - return false; - } - return true; -} - -EAPI ui_view *ui_viewmgr_push_view(ui_viewmgr *viewmgr, ui_view *view) -{ - if (!viewmgr || !view) + if (!view) { - LOGE("Invalid Parameter viewmgr = %p, view = %p", viewmgr, view); + LOGE("Invalid Parameter view = %p", view); return nullptr; } + ui_viewmgr*viewmgr = UI_VIEWMGR; + return dynamic_cast(viewmgr->pushView(view)); } -EAPI bool ui_viewmgr_push_view_insert_before(ui_viewmgr *viewmgr, ui_view *view, ui_view *before) +EAPI bool ui_viewmgr_push_view_insert_before(ui_view *view, ui_view *before) { - if (!viewmgr || !view) + if (!before || !view) { - LOGE("Invalid Parameter viewmgr = %p, view = %p, before = %p", viewmgr, view, before); + LOGE("Invalid Parameter view = %p, before = %p", view, before); return false; } + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->insertViewBefore(view, before); } -EAPI bool ui_viewmgr_push_view_insert_after(ui_viewmgr *viewmgr, ui_view *view, ui_view *after) +EAPI bool ui_viewmgr_push_view_insert_after(ui_view *view, ui_view *after) { - if (!viewmgr || !view) + if (!after || !view) { - LOGE("Invalid Parameter viewmgr = %p, view = %p, after = %p", viewmgr, view, after); + LOGE("Invalid Parameter view = %p, after = %p", view, after); return false; } + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->insertViewAfter(view, after); } -EAPI bool ui_viewmgr_pop_view(ui_viewmgr *viewmgr) +EAPI bool ui_viewmgr_pop_view(void) { - if (!validate_viewmgr(viewmgr)) return false; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->popView(); } -EAPI bool ui_viewmgr_activate(ui_viewmgr *viewmgr) +EAPI bool ui_viewmgr_activate(void) { - if (!validate_viewmgr(viewmgr)) return false; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->activate(); } -EAPI bool ui_viewmgr_deactivate(ui_viewmgr *viewmgr) +EAPI bool ui_viewmgr_deactivate(void) { - if (!validate_viewmgr(viewmgr)) return false; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->deactivate(); } -EAPI Elm_Win *ui_viewmgr_get_window(ui_viewmgr *viewmgr) +EAPI Elm_Win *ui_viewmgr_get_window(void) { - if (!validate_viewmgr(viewmgr)) return nullptr; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->getWindow(); } -EAPI ui_view *ui_viewmgr_get_last_view(ui_viewmgr *viewmgr) +EAPI ui_view *ui_viewmgr_get_last_view(void) { - if (!validate_viewmgr(viewmgr)) return nullptr; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return dynamic_cast(viewmgr->getLastView()); } -EAPI ui_view *ui_viewmgr_get_view_by_idx(ui_viewmgr *viewmgr, int idx) +EAPI ui_view *ui_viewmgr_get_view_by_idx(int idx) { - if (!validate_viewmgr(viewmgr)) return nullptr; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return dynamic_cast(viewmgr->getView(idx)); } -EAPI ui_view *ui_viewmgr_get_view_by_name(ui_viewmgr *viewmgr, const char *name) +EAPI ui_view *ui_viewmgr_get_view_by_name(const char *name) { - if (!validate_viewmgr(viewmgr)) return nullptr; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return dynamic_cast(viewmgr->getView(name)); } -EAPI Evas_Object *ui_viewmgr_get_base(ui_viewmgr *viewmgr) +EAPI Evas_Object *ui_viewmgr_get_base(void) { - if (!validate_viewmgr(viewmgr)) return nullptr; + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->getBase(); } -EAPI int ui_viewmgr_get_view_index(ui_viewmgr *viewmgr, const ui_view *view) +EAPI int ui_viewmgr_get_view_index(const ui_view *view) { - if (!viewmgr || !view) + if (!view) { - LOGE("Invalid Parameter viewmgr = %p, view = %p", viewmgr, view); + LOGE("Invalid Parameter view = %p", view); return -1; } + ui_viewmgr*viewmgr = UI_VIEWMGR; + return viewmgr->getViewIndex(view); } -EAPI int ui_viewmgr_get_view_count(ui_viewmgr *viewmgr) +EAPI int ui_viewmgr_get_view_count(void) { - if (!validate_viewmgr(viewmgr)) return -1; + ui_viewmgr*viewmgr = UI_VIEWMGR; return viewmgr->getViewCount(); } -EAPI bool ui_viewmgr_get_soft_key_need(ui_viewmgr *viewmgr) +EAPI bool ui_viewmgr_get_soft_key_need(void) { - if (!validate_viewmgr(viewmgr)) return false; - return viewmgr->needSoftKey(); -} + ui_viewmgr*viewmgr = UI_VIEWMGR; -EAPI ui_viewmgr *ui_viewmgr_get_viewmgr() -{ - return UI_VIEWMGR; + return viewmgr->needSoftKey(); } -- 2.34.1