test x$video_opengl_egl = xyes && \
test x$video_opengles_v2 = xyes; then
if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm; then
- TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm`
- TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm`
+ TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm aul`
+ TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm aul`
video_tizen=yes
fi
fi
test x$video_opengl_egl = xyes && \
test x$video_opengles_v2 = xyes; then
if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm; then
- TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm`
- TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm`
+ TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm aul`
+ TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm aul`
video_tizen=yes
fi
fi
#include <app_internal.h>
#include <app_extension.h>
#include <system_settings.h>
+#include <aul.h>
static int tizen_appcore_initialized = 0;
static appcore_context_h appcore_handle = NULL;
static ui_app_lifecycle_callback_s event_callback = {0,};
static app_event_handler_h handlers[5] = {NULL, };
+int _tizen_terminate_event_filter(void *userdata, SDL_Event * event);
+int _tizen_aul_status_changed_cb(int status, void *data);
+
/* TODO ::
* Impplementation of serveral app core callback function for SDL Application and App Core
* */
{
/*APP_EVENT_LOW_BATTERY*/
SDL_Log("low battery");
+ return;
}
static void
/*APP_EVENT_LOW_MEMORY*/
SDL_Log("low memory");
SDL_SendAppEvent(SDL_APP_LOWMEMORY);
+ return;
+}
+
+int
+_tizen_aul_status_changed_cb(int status, void *data)
+{
+ if (status == STATUS_DYING) {
+ SDL_Log(":: STATUS_DYING");
+ SDL_SendQuit();
+ SDL_SendAppEvent(SDL_APP_TERMINATING);
+
+ SDL_DelEventWatch(_tizen_terminate_event_filter, NULL);
+ }
+
+ return 1;
+}
+
+int
+_tizen_terminate_event_filter(void *userdata, SDL_Event * event)
+{
+ if (!event) {
+ SDL_Log("Event is NULL");
+ return -1;
+ }
+
+ switch(event->type) {
+ case SDL_APP_TERMINATING: {
+ aul_remove_status_local_cb(_tizen_aul_status_changed_cb, NULL);
+ SDL_tizen_app_exit();
+ }
+ break;
+ default:
+ break;
+ }
+
+ return 1;
}
int
SDL_tizen_app_init(int argc, char *argv[])
{
+ int aul_ret = 0;
+
SDL_Log( "SDL Tizen App initialize");
if (tizen_appcore_initialized) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Already initialized!");
}
event_callback.create = _tizen_sdl_create;
- event_callback.terminate = _tizen_sdl_terminate;
+// event_callback.terminate = _tizen_sdl_terminate;
event_callback.pause = _tizen_sdl_pause;
event_callback.resume = _tizen_sdl_resume;
event_callback.app_control = _tizen_sdl_control;
ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, _tizen_app_lang_changed, NULL);
ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, _tizen_app_region_changed, NULL);
+ aul_ret = aul_add_status_local_cb(_tizen_aul_status_changed_cb, NULL);
+ if (aul_ret == AUL_R_ERROR) {
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "AUL status changed callback setting is failed.");
+ return 0;
+ }
+
+ /* add event watch for SDL_APP_TERMINATING */
+ SDL_AddEventWatch(_tizen_terminate_event_filter, NULL);
+
return ui_app_init(argc, argv, &event_callback, NULL, &appcore_handle);
}
void
SDL_tizen_app_exit(void)
{
+ SDL_Log("call ui_app_fini");
ui_app_fini(appcore_handle);
}
#endif