int aul_ret = 0;
SDL_Log( "SDL Tizen App initialize");
+
if (tizen_appcore_initialized) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Already initialized!");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT,"Already initialized!");
return 0;
}
tizen_appcore_initialized = 1;
if (argc < 1 || argv == NULL) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"APP_ERROR_INVALID_PARAMETER");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT,"APP_ERROR_INVALID_PARAMETER");
return 0;
}
lockFile->fileDescriptor = open(LockFileName, O_RDWR);
if(lockFile->fileDescriptor == -1)
{
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"[SDL]Fail to open lock file!");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT,"[SDL]Fail to open lock file!");
return NULL;
}
if(lockFile->fileDescriptor>=0) {
if(lockf(lockFile->fileDescriptor, F_ULOCK, 0) <0 )
{
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"[SDL] Lock release fail");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT,"[SDL] Lock release fail");
return;
}
}
{
char sharedFilename[256];
int n = epcEvent->response;
- SDL_Log("[SDL] LoadSharedImage print n: %d\n",n);
if(n < SHARED_FILE_NUMBER)
{
snprintf(sharedFilename, 256, "/%s-%d.%d", shared_info->fileInfo[n].SharedFileName, shared_info->fileInfo[n].SharedFileID, shared_info->fileInfo[n].SharedFileNumber);
- SDL_Log("[SDL]The shared file name is %s", sharedFilename);
Tizen_Indicator_SharedFile_Free(shared_info, n);
}
else
{
- SDL_Log("[SDL]fileInfo->sharedFile == NULL");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "[SDL]fileInfo->sharedFile == NULL");
}
}
}
{
case OP_SHM_REF0:
{
- SDL_Log("[SDL]Indicator client received: OP_SHM_REF0\n");
SetSharedImageInfo(epcEvent, shared_info);
break;
}
case OP_SHM_REF1:
{
- SDL_Log("[SDL]Indicator client received: OP_SHM_REF1\n");
SetLockFileInfo(epcEvent, shared_info);
break;
}
case OP_SHM_REF2:
{
- SDL_Log("[SDL]Indicator client received: OP_SHM_REF2\n");
LoadSharedImage(epcEvent, shared_info);
break;
}
case OP_UPDATE:
{
- int n = epcEvent->response;
- SDL_Log("[SDL]Indicator client received: OP_UPDATE : %d\n", n);
+ //int n = epcEvent->response;
break;
}
case OP_UPDATE_DONE:
{
int n = epcEvent->response;
- SDL_Log("[SDL] OP_UPDATE_DONE n: %d\n", n);
if( n < SHARED_FILE_NUMBER)
{
shared_info->cur_idx = n;
}
case OP_GL_REF:
{
- SDL_Log("[SDL] receive socket to client (resource_id:%u)", epcEvent->ref);
if (Tizen_remote_surface_init())
{
Tizen_remote_indicator(epcEvent->ref);
}
case OP_RESIZE:
{
- SDL_Log("[SDL]Indicator client received: OP_RESIZE\n");
break;
}
}
Eina_Bool handler_server_add(void *data, int ev_type EINA_UNUSED, void *ev)
{
- Ecore_Ipc_Event_Server_Add *e = (Ecore_Ipc_Event_Server_Add *)ev;
- SDL_Log("Got a server add %p", e->server);
+ //Ecore_Ipc_Event_Server_Add *e = (Ecore_Ipc_Event_Server_Add *)ev;
return 1;
}
Eina_Bool handler_server_del(void *data, int ev_type EINA_UNUSED, void *ev)
{
- Ecore_Ipc_Event_Server_Del *e = (Ecore_Ipc_Event_Server_Del *)ev;
- SDL_Log("Got a server del %p", e->server);
+ //Ecore_Ipc_Event_Server_Del *e = (Ecore_Ipc_Event_Server_Del *)ev;
return 1;
}
if(!ecore_ipc_init())
{
- SDL_Log("cannot init ecore_con!");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "cannot init ecore_con!");
ecore_shutdown();
return NULL;
}
_ecore_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
{
char *commit_str = (char *)event_info;
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "commit string : %s\n", commit_str);
SDL_SendKeyboardText(commit_str);
return;
}
// get preedit string and attributes
ecore_imf_context_preedit_string_with_attributes_get(imf_context, &preedit_string, NULL, &cursor_pos);
- SDL_Log("preedit string : %s, %d", preedit_string, cursor_pos);
SDL_SendEditingText(preedit_string, 0, cursor_pos);
free(preedit_string);
{
//ECORE_IMF_INPUT_PANEL_STATE_SHOW : 0
//ECORE_IMF_INPUT_PANEL_STATE_HIDE : 1
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Keyboard State : %d\n", value);
return;
}
const char *default_id = ecore_imf_context_default_id_get();
if (!default_id)
{
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't create ecore_imf_context\n");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Can't create ecore_imf_context\n");
return;
}
SDL_Window *window;
if (!_this) {
- SDL_SetError("Video subsystem must be initialized");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Video subsystem must be initialized");
return;
}
window = SDL_GetKeyboardFocus();
if(!window){
- SDL_SetError("Keyboard focused window is NULL");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Keyboard focused window is NULL");
return;
}
Tizen_ShowScreenKeyboard(_this, window);
shm_fd = wayland_create_tmp_file(size);
if (shm_fd < 0)
{
- fprintf(stderr, "creating mouse cursor buffer failed!\n");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "creating mouse cursor buffer failed!\n");
return -1;
}
d->shm_data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, 0);
if (d->shm_data == MAP_FAILED) {
d->shm_data = NULL;
- fprintf (stderr, "mmap () failed\n");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "mmap () failed\n");
close (shm_fd);
return -1;
}
int x, y;
_tizen_get_mouseXY(window, (int)e->x, (int)e->y, &x, &y);
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "mouse down (%d x %d)", x, y);
if(Tizen_isTouchIndicator(window, wind->rotation, x, y))
{
ModelMatrixTranslateInit(window, wind->rotation);
int x, y;
_tizen_get_mouseXY(window, (int)e->x, (int)e->y, &x, &y);
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "mouse up (%d x %d)", x, y);
SDL_SendMouseMotion(window, 0, 0, x, y);
SDL_SendMouseButton(window, 0, SDL_RELEASED, SDL_BUTTON_LEFT);
int x, y;
_tizen_get_mouseXY(window, (int)e->x, (int)e->y, &x, &y);
- //SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "mouse move (%d x %d)",e->x,e->y);
SDL_SendMouseMotion(window, 0, 0, x, y);
Tizen_OnTouch(_this,1,e->multi.device,ACTION_POINTER_MOVE, x, y, 1.0f);
return context;
if(!Tizen_Indicator_GLES_Init(window))
{
- SDL_Log("Indicator GLES init error!");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Indicator GLES init error!");
}
}
SeparateEventsHintWatcher, NULL);
if(SDL_AddTouch(deviceId, "Tizen_Touch")<0)
{
- SDL_Log("error: can't add tizen touch %s, %d", __FILE__, __LINE__);
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "error: can't add tizen touch %s, %d", __FILE__, __LINE__);
}
}
touchDeviceId = (SDL_TouchID)touch_device_id_in;
if (SDL_AddTouch(touchDeviceId, "Tizen_Touch") < 0) {
- SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "error: can't add touch %s, %d", __FILE__, __LINE__);
}
fingerId = (SDL_FingerID)pointer_finger_id_in;
#include "SDL_tizenwindow.h"
#include "SDL_tizenvideo.h"
#include "SDL_tizenvulkan.h"
+#include "SDL_log.h"
#define DEFAULT_VULKAN "libvulkan.so"
_this->vk_data->NAME = SDL_LoadFunction(_this->vk_data->vk_dll_handle, #NAME); \
if (!_this->vk_data->NAME) \
{ \
- return SDL_SetError("Could not retrieve Vulkan function " #NAME); \
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Could not retrieve Vulkan function " #NAME); \
+ return -1; \
}
SDL_bool
VkResult err;
if (strcmp(driver, "tizen")) {
- SDL_SetError("Unsupported video driver '%s'", driver);
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Unsupported video driver '%s'", driver);
return SDL_FALSE;
}
err = _this->vk_data->vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL);
if (err < 0) {
- SDL_SetError("Fail to get Instance extension");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Fail to get Instance extension");
return SDL_FALSE;
}
ret = _this->vk_data->vkCreateWaylandSurfaceKHR((VkInstance)instance, &createInfo, NULL, (VkSurfaceKHR*)surface);
if (ret != VK_SUCCESS) {
- SDL_SetError("fail to vkCreateWaylandSurfaceKHR : %i", (int)ret);
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "fail to vkCreateWaylandSurfaceKHR : %i", (int)ret);
return SDL_FALSE;
}
return SDL_TRUE;
}
default:
(void)surface;
- SDL_SetError("Unsupported subsystem %i", (int)wminfo.subsystem);
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Unsupported subsystem %i", (int)wminfo.subsystem);
return SDL_FALSE;
}
}
_this->vk_data->vk_dll_handle = vk_dll_handle;
if (vk_dll_handle == NULL) {
- return SDL_SetError("Could not initialize Vulkan library");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Could not initialize Vulkan library");
+ return -1;
}
LOAD_FUNC(vkEnumerateInstanceExtensionProperties);
_this->tizen_pre_rotation_data->NAME = SDL_LoadFunction(_this->tizen_pre_rotation_data->prerotation_dll_handle, #NAME); \
if (!_this->tizen_pre_rotation_data->NAME) \
{ \
- SDL_SetError("Could not retrieve pre-rotation function " #NAME); \
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Could not retrieve pre-rotation function " #NAME); \
return SDL_FALSE; \
}
tizen_wl_egl_window_rotation rot;
if (!_this->egl_window) return;
- SDL_Log("%s with angle %d",__FUNCTION__, _this->rotation);
switch (_this->rotation) {
case 90:
rot = TIZEN_ROTATION_270;
break;
}
- SDL_SetError("call wl_egl_win_set_rotation with rot %d",rot);
_this->tizen_pre_rotation_data->wl_egl_window_set_rotation(_this->egl_window, rot);
}
if (i == 0) {
checked[j] = 0;
- SDL_Log("SDL %s: avaiable rotation: 0", __FUNCTION__);
}
else if (i == 1) {
checked[j] = 90;
- SDL_Log("SDL %s: avaiable rotation: 90", __FUNCTION__);
}
else if (i == 2) {
checked[j] = 180;
- SDL_Log("SDL %s: avaiable rotation: 180", __FUNCTION__);
}
else if (i == 3) {
checked[j] = 270;
- SDL_Log("SDL %s: avaiable rotation: 270", __FUNCTION__);
}
j++;
}
if (j > 0) {
if (j == 1) {
ecore_wl_window_rotation_preferred_rotation_set(window,wind->rotation);
- SDL_Log("SDL %s: support pre_rotation %d", __FUNCTION__,wind->support_pre_rotation);
if (wind->support_pre_rotation) {
- SDL_Log("SDL %s: set pre rotation %d", __FUNCTION__,wind->rotation);
_tizen_pre_rotation_set(wind);
}
}
if (!(globals = ecore_wl_globals_get()))
{
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get wayland globals");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Failed to get wayland globals");
return -1;
}
/* Create the GLES window surface */
wind->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) wind->egl_window);
if (wind->egl_surface == EGL_NO_SURFACE) {
- SDL_SetError("failed to create a window surface");
+ SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "failed to create a window surface");
return -1;
}
if (_tizen_PreRotatotion_LoadLibrary(wind, "libwayland-egl.so")) {
if (wind->tizen_pre_rotation_data->wl_egl_window_get_capabilities(wind->egl_window) == TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) {
wind->support_pre_rotation = 1;
- SDL_Log("Can support PreRotation");
}
- else {
- SDL_Log("can not support PreRotation !!");
- }
- }
- else {
- SDL_Log("can not support PreRotation !!");
}
}
#endif
SDL_SetMouseFocus(window);
if (window->flags & 0x00008000) {
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "---------------------------------------");
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[SDL] touch bypass setting is done!\n");
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "---------------------------------------");
ecore_wl_window_input_region_set(wind->window, -1, -1, 1, 1);
ecore_wl_window_focus_skip_set(wind->window, EINA_TRUE);
}
EINA_INLIST_FOREACH(globals, global) {
if (!strcmp(global->interface, "tizen_policy_ext")) {
wind->rotation_supported = 1;
- SDL_Log("SDL can support rotation in this device!!!!!!!!!!!");
break;
}
}
void
Tizen_SetWindowSize(_THIS, SDL_Window *window)
{
- SDL_Log("[SDL_Size] Tizen_SetWindowSize");
// _tizen_setwindowsize(window);
// _tizen_egl_window_resize(window);
}
ew = ecore_wl_window_find(ev->win);
window = Tizen_FindWindow(_this, ew);
- SDL_Log( "visibility window: %p, ecore_wl_window: %p\n", window, ew);
-
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SHOWN, 0, 0);
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
return ECORE_CALLBACK_PASS_ON;
wl_egl_window_get_attached_size(wind->egl_window, &aw, &ah);
wl_egl_window_resize(wind->egl_window, aw, ah, 0, 0);
- SDL_Log("[SDL_Size] * _tizen_cb_event_window_rotate aw ah : %d, %d", aw, ah);
-
if(wind->rotation == 90 || wind->rotation == 270) {
SDL_SetWindowSize(window, ah, aw);
window->w = ah;//for Fullscreen
window->w = aw;//for Fullscreen
window->h = ah;
}
- SDL_Log("[SDL_Size] * _tizen_cb_event_window_rotate aw ah : %d, %d", window->w, window->h);
}
// Send Rotation Event