[SDL_Tizen] Add SDL_Window function
[platform/upstream/SDL.git] / src / video / tizen / SDL_tizenwindow.c
index cf79c38..58c0ce0 100755 (executable)
@@ -251,6 +251,13 @@ Tizen_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
 }
 
 void
+Tizen_SetWindowTitle(_THIS, SDL_Window * window)
+{
+    SDL_WindowData *wind = window->driverdata;
+    ecore_wl_window_title_set(wind->window, window->title);
+}
+
+void
 Tizen_ShowWindow(_THIS, SDL_Window *window)
 {
     SDL_WindowData *wind = window->driverdata;
@@ -263,6 +270,20 @@ Tizen_ShowWindow(_THIS, SDL_Window *window)
 }
 
 void
+Tizen_HideWindow(_THIS, SDL_Window *window)
+{
+    SDL_WindowData *wind = window->driverdata;
+    ecore_wl_window_hide(wind->window);
+}
+
+void
+Tizen_RaiseWindow(_THIS, SDL_Window *window)
+{
+    SDL_WindowData *wind = window->driverdata;
+    ecore_wl_window_raise(wind->window);
+}
+
+void
 Tizen_SetWindowFullscreen(_THIS, SDL_Window *window,
                           SDL_VideoDisplay *_display, SDL_bool fullscreen)
 {
@@ -379,7 +400,8 @@ _tizen_cb_output_transform(void *data, int type EINA_UNUSED, void *event)
     output = ecore_wl_window_output_find(wind->window);
     if (output != ev->output) return ECORE_CALLBACK_PASS_ON;
 
-    _tizen_rotate_update(wind);
+    wind->received_rotation = 1;
+
 
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -392,7 +414,7 @@ _tizen_cb_ignore_output_transform(void *data, int type EINA_UNUSED, void *event
 
     if(!wind) return ECORE_CALLBACK_PASS_ON;
 
-    _tizen_rotate_update(wind);
+    wind->received_rotation = 1;
 
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -506,7 +528,6 @@ _tizen_rotation_do(SDL_WindowData *wind, int rotation)
 
     _tizen_send_rotation_event(window, wind->rotation);
     SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
-    wind->received_rotation = 1;
 
 }
 
@@ -528,10 +549,11 @@ _tizen_rotate_update(SDL_WindowData *wind)
 
     //Set Screen Rotation
     wind->output_rotation = screen_rotation;
-
     if(wind->support_pre_rotation)
         ecore_wl_window_buffer_transform_set(wind->window, wind->output_rotation / 90);
 
+    ecore_wl_window_rotation_set(wind->window, wind->rotation);
+
     int rotation = (wind->output_rotation + wind->rotation) % 360;
     _tizen_rotation_do(wind, rotation);
 }
@@ -843,8 +865,7 @@ _tizen_cb_event_window_rotate(void *data, int type EINA_UNUSED, void *event)
     if (wind->rotation != ev->angle) {
         /* set ecore_wayland window rotation */
         wind->rotation = ev->angle;
-        ecore_wl_window_rotation_set(wind->window, wind->rotation);
-        _tizen_rotate_update(wind);
+        wind->received_rotation = 1;
     }
 
     return ECORE_CALLBACK_PASS_ON;