This can make ABI break...
Change-Id: I1c6cfbf3af9b3d4c34633f2e78eabe563637b643
{
ui_application_event_s events[]= {
{UI_APPLICATION_EVENT_CREATE, app_create},
- {UI_APPLICATION_EVENT_CONTROL, app_control},
- {UI_APPLICATION_EVENT_LAST, NULL}
+ {UI_APPLICATION_EVENT_CONTROL, app_control}
};
int ret;
}
//Run ui_app. Now it requests to run an application mainloop.
- ret = ui_application_run(argc, argv, events, NULL);
+ ret = ui_application_run(argc, argv, events, 2, NULL);
if (ret != TIZEN_ERROR_NONE)
{
dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_run() is failed, ret = %d", ret);
#ifndef _UI_COMMON_VIEW_CAPI_H_
#define _UI_COMMON_VIEW_CAPI_H_
+#include "../../../../include/interface/_UiIfacePrivate.h"
+
namespace efl_viewmanager
{
{
public:
//TODO: Optimize memory? We don't need all slots.
- ui_view_event_cb event_cb[UI_VIEW_EVENT_LAST] = {nullptr, };
- void* event_data[UI_VIEW_EVENT_LAST] = {nullptr, };
+ ui_view_event_cb event_cb[_NUM_OF_UI_VIEW_EVENT_TYPE] = {nullptr, };
+ void* event_data[_NUM_OF_UI_VIEW_EVENT_TYPE] = {nullptr, };
const char *type = nullptr;
UI_APPLICATION_EVENT_TERMINATE_PRE, /**< App terminate pre */
UI_APPLICATION_EVENT_PAUSE_PRE, /**< App pause pre */
UI_APPLICATION_EVENT_RESUME_PRE, /**< App resume pre */
- UI_APPLICATION_EVENT_CONTROL_PRE, /**< App control pre */
-
- UI_APPLICATION_EVENT_LAST
+ UI_APPLICATION_EVENT_CONTROL_PRE /**< App control pre */
} ui_application_event_type_e;
-
/**
* @brief Struct for ui_application event.
* @since_tizen 3.0
* @param[in] argc The argument count
* @param[in] argv The argument vector
* @param[in] events Event callback list
+ * @param[in] count The number of event count
* @param[in] user_data User data for event callbacks
*
* @return @c 0 on success, otherwise a negative error value.
* @see ui_application_init()
* @see ui_application_term()
*/
-EAPI int ui_application_run(int argc, char **argv, ui_application_event_s *events, void *user_data);
+EAPI int ui_application_run(int argc, char **argv, ui_application_event_s *events, int count, void *user_data);
/**
* @brief Deinitializes ui_application.
UI_VIEW_EVENT_PORTRAIT_POST, /**< Portrait post */
UI_VIEW_EVENT_LANDSCAPE_POST, /**< Landscape post */
UI_VIEW_EVENT_BACK_POST, /**< Back post */
- UI_VIEW_EVENT_MENU_POST, /**< Menu post */
-
- UI_VIEW_EVENT_LAST
+ UI_VIEW_EVENT_MENU_POST /**< Menu post */
} ui_view_event_type_e;
/**
UI_VIEW_INDICATOR_OPTIMAL, /**< Transparent indicator */
UI_VIEW_INDICATOR_OVERLAP, /**< Overlap indicator */
UI_VIEW_INDICATOR_HIDE, /**< Indicator hide */
- UI_VIEW_INDICATOR_SHOW, /**< Indicator show */
- UI_VIEW_INDICATOR_LAST
+ UI_VIEW_INDICATOR_SHOW /**< Indicator show */
} ui_view_indicator;
/**
UI_VIEW_STATE_UNLOAD, /**< Unload state */
UI_VIEW_STATE_ACTIVATE, /**< Activate state */
UI_VIEW_STATE_DEACTIVATE, /**< Deactivate state */
- UI_VIEW_STATE_PAUSE, /**< Pause state */
- UI_VIEW_STATE_LAST
+ UI_VIEW_STATE_PAUSE /**< Pause state */
} ui_view_state;
/**
{
UI_VIEW_ORIENTATION_MODE_UNKNOWN = 0, /**< Unknown state (Exceptional case) */
UI_VIEW_ORIENTATION_MODE_PORTRAIT, /**< Portrait state */
- UI_VIEW_ORIENTATION_MODE_LANDSCAPE, /**< Landscape state */
- UI_VIEW_ORIENTATION_MODE_LAST,
+ UI_VIEW_ORIENTATION_MODE_LANDSCAPE /**< Landscape state */
} ui_view_orientation_mode;
#endif /* _UI_IFACE_TYPES_H_ */
--- /dev/null
+#ifndef _UI_IFACE_PRIVATE_H_
+#define _UI_IFACE_PRIVATE_H_
+
+#define _NUM_OF_UI_APPLICATION_EVENT_TYPE 10
+#define _NUM_OF_UI_VIEW_EVENT_TYPE 24
+#define _NUM_OF_UI_VIEW_INDICATOR 6
+#define _NUM_OF_UI_VIEW_STATE 6
+#define _NUM_OF_UI_VIEW_ORIENTATION_MODE 3
+
+#endif /* _UI_IFACE_PRIVATE_H_ */
#include "../../../../include/efl/mobile/c/_ui_private.h"
#include "../../../../include/efl/mobile/c/ui_application.h"
+#include "../../../../include/interface/_UiIfacePrivate.h"
class ui_app_capi : public UiApp
{
public:
- ui_application_event_cb event_cb[UI_APPLICATION_EVENT_LAST] = {nullptr, };
- void *user_data[UI_APPLICATION_EVENT_LAST] = {nullptr, };
+ ui_application_event_cb event_cb[_NUM_OF_UI_APPLICATION_EVENT_TYPE] = {nullptr, };
+ void *user_data[_NUM_OF_UI_APPLICATION_EVENT_TYPE] = {nullptr, };
bool onCreate() override
{
return TIZEN_ERROR_NONE;
}
-EAPI int ui_application_run(int argc, char **argv, ui_application_event_s *events, void *user_data)
+EAPI int ui_application_run(int argc, char **argv, ui_application_event_s *events, int count, void *user_data)
{
ui_app_capi *app = g_app;
if (!app)
return TIZEN_ERROR_NOT_PERMITTED;
}
- int ret = TIZEN_ERROR_NONE;
+ if (count <= 0)
+ {
+ LOGE("Event Count is %d, Application have to implement app event at least 1(app_create).", count);
+ return TIZEN_ERROR_INVALID_PARAMETER;
+ }
- int i = 0;
+ int ret = TIZEN_ERROR_NONE;
- while (true)
+ for (int i = 0; i < count; i++)
{
- if (events[i].event_type == UI_APPLICATION_EVENT_LAST) break;
-
if (events[i].event_type < UI_APPLICATION_EVENT_CREATE)
{
LOGE("events[%d] is invalid(%d)", i, events[i].event_type);
{
app->set_event_cb(events[i].event_type, events[i].event_cb, user_data);
}
-
- ++i;
}
if (ret != TIZEN_ERROR_NONE) return ret;
int ret = validate_view(view);
if (ret != TIZEN_ERROR_NONE) return ret;
- if (event_type < UI_VIEW_EVENT_LOAD || event_type >= UI_VIEW_EVENT_LAST)
+ if (event_type < UI_VIEW_EVENT_LOAD || event_type >= _NUM_OF_UI_VIEW_EVENT_TYPE)
{
LOGE("This view(%p) event_type is invalid(%d)", view, event_type);
return TIZEN_ERROR_INVALID_PARAMETER;
*/
#include "../../include/interface/UiIfaceViewManager.h"
+#include "../../include/interface/_UiIfacePrivate.h"
#include <string>
int UiIfaceViewImpl::setIndicator(UiViewIndicator indicator)
{
- if (indicator <= UI_VIEW_INDICATOR_UNKNOWN || indicator >= UI_VIEW_INDICATOR_LAST)
+ if (indicator <= UI_VIEW_INDICATOR_UNKNOWN || indicator >= _NUM_OF_UI_VIEW_INDICATOR)
return TIZEN_ERROR_INVALID_PARAMETER;
this->_indicator = indicator;