* 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
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
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
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);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
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);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
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
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
return;
}
- UI_VIEWMGR_PUSH_VIEW(view);
+ ui_viewmgr_push_view(view);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
//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);
}
static void
prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
{
- UI_VIEWMGR_POP_VIEW();
+ ui_viewmgr_pop_view();
}
static void
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);
}
#include <app.h>
#include <dlog.h>
-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;
*/
/**
- * @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
*
*
* @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
*
* @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
*
* @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()
*
* @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.
*
* @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.
*
* @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
*
* @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
}
#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<ui_view *>(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<ui_view *>(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<ui_view *>(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<ui_view *>(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();
}