[SDL_TIZEN] code clean up
[platform/upstream/SDL.git] / src / video / tizen / SDL_tizenwindow.c
index d3a049a..64794ad 100755 (executable)
@@ -49,7 +49,7 @@
 _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; \
 }
 
@@ -130,7 +130,6 @@ _tizen_pre_rotation_set(SDL_WindowData *_this)
     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;
@@ -149,7 +148,6 @@ _tizen_pre_rotation_set(SDL_WindowData *_this)
             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);
 }
 
@@ -188,19 +186,15 @@ _tizen_window_orientaiton_hint_callback(void *userdata, const char *name, const
 
             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++;
         }
@@ -209,9 +203,7 @@ _tizen_window_orientaiton_hint_callback(void *userdata, const char *name, const
     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);
             }
         }
@@ -261,7 +253,7 @@ Tizen_CreateWindow(_THIS, SDL_Window *window)
 
     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;
       }
 
@@ -281,7 +273,7 @@ Tizen_CreateWindow(_THIS, SDL_Window *window)
         /* 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;
         }
 
@@ -290,14 +282,7 @@ Tizen_CreateWindow(_THIS, SDL_Window *window)
         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
@@ -309,9 +294,6 @@ Tizen_CreateWindow(_THIS, SDL_Window *window)
     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);
     }
@@ -319,7 +301,6 @@ Tizen_CreateWindow(_THIS, SDL_Window *window)
     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;
            }
       }
@@ -362,7 +343,6 @@ _tizen_setwindowsize(SDL_Window *window)
 void
 Tizen_SetWindowSize(_THIS, SDL_Window *window)
 {
-   SDL_Log("[SDL_Size] Tizen_SetWindowSize");
 //    _tizen_setwindowsize(window);
 //    _tizen_egl_window_resize(window);
 }
@@ -434,8 +414,6 @@ _tizen_cb_event_window_visibility_change(void *data, int type, void *event)
     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;
@@ -527,8 +505,6 @@ _tizen_cb_event_window_rotate(void *data, int type EINA_UNUSED, void *event)
             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
@@ -538,7 +514,6 @@ _tizen_cb_event_window_rotate(void *data, int type EINA_UNUSED, void *event)
                 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