+_tizen_set_window_size(SDL_Window * window, int w, int h)
+{
+ if(!window)
+ {
+ SDL_SetError("Invalid window");
+ return;
+ }
+
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+ if (!_this) {
+ SDL_SetError("Video subsystem has not been initialized");
+ return;
+ }
+
+ if (window->magic != &_this->window_magic) {
+ return;
+ }
+
+ if (w <= 0) {
+ SDL_InvalidParamError("w");
+ return;
+ }
+ if (h <= 0) {
+ SDL_InvalidParamError("h");
+ return;
+ }
+
+ /* Make sure we don't exceed any window size limits */
+ if (window->min_w && w < window->min_w)
+ {
+ w = window->min_w;
+ }
+ if (window->max_w && w > window->max_w)
+ {
+ w = window->max_w;
+ }
+ if (window->min_h && h < window->min_h)
+ {
+ h = window->min_h;
+ }
+ if (window->max_h && h > window->max_h)
+ {
+ h = window->max_h;
+ }
+
+ window->windowed.w = w;
+ window->windowed.h = h;
+
+ window->w = w;
+ window->h = h;
+}
+
+void
+_tizen_send_rotation_event(SDL_Window *window, unsigned int angle)
+{
+ SDL_Event event;
+ SDL_WindowData *wind;
+ wind = window->driverdata;
+
+ SDL_memset(&event, 0, sizeof(event));
+ event.type = SDL_ROTATEEVENT;
+ event.user.code = 0;
+ if (wind->support_pre_rotation)
+ event.user.data1 = (void*)0;
+ else
+ event.user.data1 = (void*)angle;
+ event.user.data2 = (void*)-1;
+
+ SDL_PushEvent(&event);
+ return;
+}
+
+void
+_tizen_rotation_do(SDL_Window *window, SDL_WindowData* wind, int rotation)
+{
+ int window_w, window_h;
+ if(wind->rotation == 0 || wind->rotation == 180)
+ ecore_wl_window_geometry_get(wind->window, 0, 0, &window_w, &window_h);
+ else
+ ecore_wl_window_geometry_get(wind->window, 0, 0, &window_h, &window_w);
+
+ _tizen_set_window_size(window, window_w, window_h);
+
+ if(wind->support_pre_rotation)
+ Tizen_pre_rotation_set(wind, rotation);
+
+ _tizen_send_rotation_event(window, wind->rotation);
+ SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
+
+}
+
+void
+Tizen_rotate_update(SDL_Window *window)
+{
+ SDL_WindowData *wind = window->driverdata;
+ if(!wind) return;
+
+ int screen_rotation;
+ if (ecore_wl_window_ignore_output_transform_get(wind->window))
+ {
+ screen_rotation = 0;
+ }
+ else
+ {
+ Ecore_Wl_Output *output = ecore_wl_window_output_find(wind->window);
+ screen_rotation = ecore_wl_output_transform_get(output) * 90;
+ }
+
+ //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(window, wind, rotation);
+}
+
+void