2 Simple DirectMedia Layer
3 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
4 Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
6 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages
8 arising from the use of this software.
10 Permission is granted to anyone to use this software for any purpose,
11 including commercial applications, and to alter it and redistribute it
12 freely, subject to the following restrictions:
14 1. The origin of this software must not be misrepresented; you must not
15 claim that you wrote the original software. If you use this software
16 in a product, an acknowledgment in the product documentation would be
17 appreciated but is not required.
18 2. Altered source versions must be plainly marked as such, and must not be
19 misrepresented as being the original software.
20 3. This notice may not be removed or altered from any source distribution.
23 #include "../../SDL_internal.h"
25 #if SDL_VIDEO_DRIVER_TIZEN
28 #include "SDL_hints.h"
29 #include "SDL_loadso.h"
31 #include "SDL_tizenvideo.h"
32 #include "SDL_tizentouch.h"
33 #include "SDL_tizenkeyboard.h"
34 #include "SDL_tizenmouse.h"
35 #include "SDL_tizenevents_c.h"
37 #include "SDL_tizenwindow.h"
38 #include "SDL_tizenopengles.h"
40 #include "../../events/SDL_mouse_c.h"
41 #include "../../joystick/tizen/SDL_sysjoystick_c.h"
43 #include "../SDL_egl_c.h"
44 #include "../SDL_vulkan_c.h"
45 #include "../SDL_sysvideo.h"
46 #include "../../events/SDL_windowevents_c.h"
48 #include <Ecore_Ipc.h>
53 ROTATION_TYPE_NORMAL_ROTATION = 0,
54 ROTATION_TYPE_PRE_ROTATION, /* use pre-rotation */
57 #define LOAD_FUNC(NAME) \
58 _this->tizen_pre_rotation_data->NAME = SDL_LoadFunction(_this->tizen_pre_rotation_data->prerotation_dll_handle, #NAME); \
59 if (!_this->tizen_pre_rotation_data->NAME) \
61 SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Could not retrieve pre-rotation function " #NAME); \
69 Ecore_Ipc_Server *ipc = NULL;
71 #define IPC_HEAD(_type) \
72 Ecore_Ipc_Event_Client_##_type *e = event; \
73 if (ecore_ipc_client_server_get(e->client) != ipc) \
74 return ECORE_CALLBACK_PASS_ON
76 void SDL_ExecuteIndicatorProcess()
78 _tizen_init_ecore_ipc();
79 unsigned int childPID = fork();
82 SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "[SDL] child process : %d", getpid());
83 int ret = execl("/usr/apps/org.tizen.sdl_indicator/bin/sdl_indicator", "/usr/apps/org.tizen.sdl_indicator/bin/sdl_indicator", NULL);
86 SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "[SDL] Failed indicator process error:%s", strerror(errno));
87 kill(getpid(), SIGKILL);
92 SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "[SDL] Failed fork");
96 SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "[SDL] parent process : %d", getpid());
100 void _tizen_ecore_ipc_client_send(int major, int minor, int ref, int ref_to)
102 Eina_List *ipc_clients = ecore_ipc_server_clients_get(ipc);
104 Ecore_Ipc_Client *cl;
105 EINA_LIST_FOREACH(ipc_clients, l, cl)
106 ecore_ipc_client_send(cl, major, minor, ref, ref_to, 0, NULL, 0);
109 static Eina_Bool _cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
113 SDL_Log("[SDL]_cb_client_add");
114 SDL_Window * window = SDL_GetVideoDevice()->windows;
115 SDL_WindowData *wind = window->driverdata;
116 wind->indicator = SDL_TRUE;
118 int window_w, window_h;
119 ecore_wl_screen_size_get(&window_w, &window_h);
120 _tizen_ecore_ipc_client_send(OP_RESIZE, wind->rotation, window_w, window_h);
122 return ECORE_CALLBACK_DONE;
125 static Eina_Bool _cb_client_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
128 SDL_Log("[SDL]_cb_client_del");
129 Eina_List *ipc_clients = ecore_ipc_server_clients_get(ipc);
131 Ecore_Ipc_Client *cl;
132 EINA_LIST_FOREACH(ipc_clients, l, cl)
134 ecore_ipc_client_del(cl);
137 SDL_Window * window = SDL_GetVideoDevice()->windows;
138 SDL_WindowData *wind = window->driverdata;
139 wind->indicator = SDL_FALSE;
140 return ECORE_CALLBACK_DONE;
143 static Eina_Bool _cb_client_data(void *data, int type EINA_UNUSED, void *event)
147 Ecore_Ipc_Event_Server_Data* epcEvent = (Ecore_Ipc_Event_Server_Data*)event;
148 SDL_Log("[SDL]_cb_client_data: %d -> %d", epcEvent->major, epcEvent->minor);
149 return ECORE_CALLBACK_DONE;
152 int _tizen_init_ecore_ipc()
157 if(!ecore_ipc_init())
158 SDL_Log("[SDL]Fail ecore_ipc");
160 ipc = ecore_ipc_server_add(ECORE_IPC_LOCAL_USER, "sdl_indicator", 0, NULL);
163 ecore_ipc_shutdown();
165 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD, _cb_client_add, NULL);
166 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL, _cb_client_del, NULL);
167 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, _cb_client_data, NULL);
173 _tizen_rotation_type_get()
175 static int type = ROTATION_TYPE_PRE_ROTATION;
176 static int checked = 0;
179 if (checked) return type;
181 engine = getenv("SDL_ROTATION");
185 if ((!strcasecmp(engine, "normal")))
186 type = ROTATION_TYPE_NORMAL_ROTATION;
187 else if ((!strcasecmp(engine, "pre_rotation")))
188 type = ROTATION_TYPE_PRE_ROTATION;
190 type = ROTATION_TYPE_PRE_ROTATION;
197 _tizen_PreRotatotion_LoadLibrary(SDL_WindowData *_this, const char *lib_path)
199 void *lib_dll_handle = NULL;
202 if (_this->isLoaded_pre_rotation)
205 _this->tizen_pre_rotation_data = (Tizen_Prerotation_Data *) SDL_calloc(1, sizeof(Tizen_Prerotation_Data));
206 if (!_this->tizen_pre_rotation_data) {
207 return SDL_OutOfMemory();
211 lib_dll_handle = SDL_LoadObject(lib_path);
213 if (!lib_dll_handle) {
214 path = "libwayland-egl.so";
215 lib_dll_handle = SDL_LoadObject(path);
218 _this->tizen_pre_rotation_data->prerotation_dll_handle = lib_dll_handle;
220 if (lib_dll_handle == NULL)
223 LOAD_FUNC(wl_egl_window_set_rotation);
224 LOAD_FUNC(wl_egl_window_get_capabilities);
225 _this->isLoaded_pre_rotation = 1;
231 Tizen_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info)
233 SDL_WindowData *wmdata = (SDL_WindowData *)window->driverdata;
234 info->info.tizen.egl_display = NULL;
235 info->info.tizen.egl_surface = NULL;
236 #if SDL_VIDEO_OPENGL_EGL
239 info->info.tizen.egl_display = (void*)_this->egl_data->egl_display;
241 info->info.tizen.egl_surface = (void*)wmdata->egl_surface;
243 info->subsystem = SDL_SYSWM_TIZEN;
248 Tizen_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
250 return 0; /* just succeed, the real work is done elsewhere. */
254 Tizen_SetWindowTitle(_THIS, SDL_Window * window)
256 SDL_WindowData *wind = window->driverdata;
257 ecore_wl_window_title_set(wind->window, window->title);
261 Tizen_ShowWindow(_THIS, SDL_Window *window)
263 SDL_WindowData *wind = window->driverdata;
265 if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS) && !wind->indicator)
267 SDL_ExecuteIndicatorProcess();
269 ecore_wl_window_show(wind->window);
273 Tizen_HideWindow(_THIS, SDL_Window *window)
275 SDL_WindowData *wind = window->driverdata;
276 ecore_wl_window_hide(wind->window);
280 Tizen_RaiseWindow(_THIS, SDL_Window *window)
282 SDL_WindowData *wind = window->driverdata;
283 ecore_wl_window_raise(wind->window);
287 Tizen_SetWindowFullscreen(_THIS, SDL_Window *window,
288 SDL_VideoDisplay *_display, SDL_bool fullscreen)
294 Tizen_pre_rotation_set(SDL_WindowData *_this, int rotation)
296 tizen_wl_egl_window_rotation rot;
297 if (!_this->egl_window) return;
301 rot = TIZEN_ROTATION_270;
304 rot = TIZEN_ROTATION_180;
307 rot = TIZEN_ROTATION_90;
310 rot = TIZEN_ROTATION_0;
313 rot = TIZEN_ROTATION_0;
317 _this->tizen_pre_rotation_data->wl_egl_window_set_rotation(_this->egl_window, rot);
321 _tizen_window_orientaiton_hint_callback(void *userdata, const char *name, const char *oldValue, const char *newValue)
324 char orientation_type[4][20] = {"Portrait","LandscapeLeft","PortraitUpsideDown","LandscapeRight"};
325 int checked[4] = {0,};
328 SDL_WindowData *wind = (SDL_WindowData*)userdata;
329 Ecore_Wl_Window *window = wind->window;
331 if (wind->rotation_supported == 0) {
335 SDL_assert(SDL_strncmp(name, SDL_HINT_ORIENTATIONS, SDL_strlen(SDL_HINT_ORIENTATIONS)) == 0);
337 if ((oldValue == NULL) && (newValue == NULL)) {
342 p_str = SDL_strstr(newValue, orientation_type[i]);
344 if (p_str == newValue) {
347 else if (i == 1) rot = 90;
348 else if (i == 2) rot = 180;
349 else if (i == 3) rot = 270;
350 wind->rotation = rot;
371 ecore_wl_window_rotation_preferred_rotation_set(window, wind->rotation);
373 ecore_wl_window_rotation_available_rotations_set(window, (const int*)checked, j);
376 _tizen_rotate_update(wind);
380 _tizen_window_orientation_add_hint(void *data)
382 SDL_WindowData *wind = (SDL_WindowData*)data;
383 if (wind->rotation_supported == 0) {
387 SDL_AddHintCallback(SDL_HINT_ORIENTATIONS, _tizen_window_orientaiton_hint_callback, data);
391 _tizen_cb_output_transform(void *data, int type EINA_UNUSED, void *event)
393 SDL_Window * window = SDL_GetVideoDevice()->windows;
394 SDL_WindowData *wind = window->driverdata;
396 if(!wind) return ECORE_CALLBACK_PASS_ON;
398 Ecore_Wl_Event_Output_Transform *ev = event;
399 Ecore_Wl_Output *output;
401 output = ecore_wl_window_output_find(wind->window);
402 if (output != ev->output) return ECORE_CALLBACK_PASS_ON;
404 wind->received_rotation = 1;
407 return ECORE_CALLBACK_PASS_ON;
411 _tizen_cb_ignore_output_transform(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
413 SDL_Window * window = SDL_GetVideoDevice()->windows;
414 SDL_WindowData *wind = window->driverdata;
416 if(!wind) return ECORE_CALLBACK_PASS_ON;
418 wind->received_rotation = 1;
420 return ECORE_CALLBACK_PASS_ON;
424 _tizen_output_transform_register(SDL_WindowData *wind)
428 Ecore_Wl_Output *output = ecore_wl_window_output_find(wind->window);
429 wind->output_rotation = ecore_wl_output_transform_get(output) * 90;
431 ecore_event_handler_add(ECORE_WL_EVENT_OUTPUT_TRANSFORM,
432 _tizen_cb_output_transform, NULL);
433 ecore_event_handler_add(ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM,
434 _tizen_cb_ignore_output_transform, NULL);
439 _tizen_send_rotation_event(SDL_Window *window, unsigned int angle)
442 SDL_WindowData *wind;
443 wind = window->driverdata;
445 SDL_memset(&event, 0, sizeof(event));
446 event.type = SDL_ROTATEEVENT;
448 if (wind->support_pre_rotation)
449 event.user.data1 = (void*)0;
451 event.user.data1 = (void*)angle;
452 event.user.data2 = (void*)-1;
454 SDL_PushEvent(&event);
459 _tizen_set_window_size(SDL_Window * window, int w, int h)
463 SDL_SetError("Invalid window");
467 SDL_VideoDevice *_this = SDL_GetVideoDevice();
469 SDL_SetError("Video subsystem has not been initialized");
473 if (window->magic != &_this->window_magic) {
478 SDL_InvalidParamError("w");
482 SDL_InvalidParamError("h");
486 /* Make sure we don't exceed any window size limits */
487 if (window->min_w && w < window->min_w)
491 if (window->max_w && w > window->max_w)
495 if (window->min_h && h < window->min_h)
499 if (window->max_h && h > window->max_h)
504 window->windowed.w = w;
505 window->windowed.h = h;
512 _tizen_rotation_do(SDL_WindowData *wind, int rotation)
516 SDL_Window *window = SDL_GetVideoDevice()->windows;
519 int window_w, window_h;
520 if(wind->rotation == 0 || wind->rotation == 180)
521 ecore_wl_window_geometry_get(wind->window, 0, 0, &window_w, &window_h);
523 ecore_wl_window_geometry_get(wind->window, 0, 0, &window_h, &window_w);
525 _tizen_set_window_size(window, window_w, window_h);
527 if(wind->support_pre_rotation)
528 Tizen_pre_rotation_set(wind, rotation);
530 _tizen_send_rotation_event(window, wind->rotation);
531 SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
536 _tizen_rotate_update(SDL_WindowData *wind)
541 if (ecore_wl_window_ignore_output_transform_get(wind->window))
547 Ecore_Wl_Output *output = ecore_wl_window_output_find(wind->window);
548 screen_rotation = ecore_wl_output_transform_get(output) * 90;
551 //Set Screen Rotation
552 wind->output_rotation = screen_rotation;
553 if(wind->support_pre_rotation)
554 ecore_wl_window_buffer_transform_set(wind->window, wind->output_rotation / 90);
556 ecore_wl_window_rotation_set(wind->window, wind->rotation);
558 int rotation = (wind->output_rotation + wind->rotation) % 360;
559 _tizen_rotation_do(wind, rotation);
563 Tizen_CreateWindow(_THIS, SDL_Window *window)
565 SDL_VideoData *data = _this->driverdata;
566 SDL_WindowData *wind;
567 Ecore_Wl_Global *global;
568 Eina_Inlist *globals;
570 wind = calloc(1, sizeof * wind);
572 return SDL_OutOfMemory();
575 window->driverdata = wind;
576 window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */
578 #if SDL_VIDEO_OPENGL_EGL
579 if (window->flags & SDL_WINDOW_OPENGL) {
580 SDL_GL_LoadLibrary(NULL);
585 if (window->flags & SDL_WINDOW_VULKAN) {
586 if (!_this->vulkan_GetInstanceExtensions) {
587 SDL_SetError("No Vulkan support in video driver");
590 if (_this->vulkan_LoadLibrary(_this, NULL) < 0) {
591 SDL_SetError("Fail to load Vulkan Library");
596 if (window->x == SDL_WINDOWPOS_UNDEFINED) {
599 if (window->y == SDL_WINDOWPOS_UNDEFINED) {
603 if (!(globals = ecore_wl_globals_get()))
605 SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Failed to get wayland globals");
609 wind->window = ecore_wl_window_new(NULL,
610 window->x, window->y, window->w, window->h,
611 ECORE_WL_WINDOW_BUFFER_TYPE_SHM);
613 SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Failed to create wayland window");
616 _tizen_output_transform_register(wind);
618 wind->surface = ecore_wl_window_surface_create(wind->window);
619 if (!wind->surface) {
620 SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Failed to create wayland window surface");
623 ecore_wl_window_type_set(wind->window, ECORE_WL_WINDOW_TYPE_UTILITY);
626 wind->rotation_supported = 0;
627 wind->received_rotation = 0;
629 #if SDL_VIDEO_OPENGL_EGL
630 if (window->flags & SDL_WINDOW_OPENGL) {
632 if(wind->output_rotation == 90 || wind->output_rotation == 270)
633 wind->egl_window = wl_egl_window_create(wind->surface, window->h, window->w);
635 wind->egl_window = wl_egl_window_create(wind->surface, window->w, window->h);
637 /* Create the GLES window surface */
638 wind->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) wind->egl_window);
639 if (wind->egl_surface == EGL_NO_SURFACE) {
640 SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "failed to create a window surface");
644 if (!_this->gl_config.alpha_size) {
645 ecore_wl_window_opaque_region_set(wind->window, window->x, window->y, window->w, window->h);
648 wl_surface_set_opaque_region(wind->surface, NULL);
651 //Support PreRotation
652 wind->support_pre_rotation = 0;
653 if (_tizen_rotation_type_get() && _tizen_PreRotatotion_LoadLibrary(wind, "libwayland-egl.so")) {
654 if (wind->tizen_pre_rotation_data->wl_egl_window_get_capabilities(wind->egl_window) == TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) {
655 wind->support_pre_rotation = 1;
660 wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
666 wind->id = ecore_wl_window_id_get(wind->window);
667 eina_hash_add(data->windows, &wind->id, window);
669 Tizen_InitKeyboard(_this);
670 SDL_SetMouseFocus(window);
672 if (window->flags & 0x00008000) {
673 ecore_wl_window_input_region_set(wind->window, -1, -1, 1, 1);
674 ecore_wl_window_focus_skip_set(wind->window, EINA_TRUE);
677 EINA_INLIST_FOREACH(globals, global) {
678 if (!strcmp(global->interface, "tizen_policy_ext")) {
679 wind->rotation_supported = 1;
683 // Add orientaiton hint cb
684 _tizen_window_orientation_add_hint((void*)wind);
686 _tizen_rotate_update(wind);
692 Tizen_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
694 SDL_WindowData *wind = window->driverdata;
697 SDL_ExecuteIndicatorProcess();
702 _tizen_window_resize(SDL_Window *window)
704 SDL_WindowData *wind = window->driverdata;
705 if (!wind->egl_window) {
709 if(wind->support_pre_rotation && (wind->rotation==90 || wind->rotation==270))
710 ecore_wl_window_update_size(wind->window, window->h, window->w);
712 ecore_wl_window_update_size(wind->window, window->w, window->h);
714 // TODO : consider to rotation status.
715 #if SDL_VIDEO_OPENGL_EGL
716 if (window->flags & SDL_WINDOW_OPENGL) {
717 if(wind->output_rotation==90 || wind->output_rotation==270)
718 wl_egl_window_resize(wind->egl_window, window->h, window->w, 0, 0);
720 wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
726 _tizen_setwindowsize(SDL_Window *window)
728 SDL_WindowData *wind = window->driverdata;
735 Tizen_SetWindowSize(_THIS, SDL_Window *window)
737 _tizen_window_resize(window);
741 Tizen_GetWindowSize(_THIS, SDL_Window *window, int *w, int *h)
743 SDL_WindowData *wind = window->driverdata;
748 if (w) *w = window->w;
749 if (h) *h = window->h;
753 Tizen_SetWindowPosition(_THIS, SDL_Window * window)
755 SDL_WindowData *wind = window->driverdata;
760 // TODO : consider to rotation status.
761 ecore_wl_window_position_set(wind->window, window->x, window->y);
765 Tizen_DestroyWindow(_THIS, SDL_Window *window)
767 SDL_VideoData *data = _this->driverdata;
768 SDL_WindowData *wind = window->driverdata;
771 eina_hash_del(data->windows, &wind->id, window);
772 #if SDL_VIDEO_OPENGL_EGL
773 if (window->flags & SDL_WINDOW_OPENGL) {
774 SDL_EGL_DestroySurface(_this, wind->egl_surface);
775 wl_egl_window_destroy(wind->egl_window);
778 ecore_wl_window_free(wind->window);
782 window->driverdata = NULL;
786 Tizen_FindWindow(_THIS, Ecore_Wl_Window *ewin)
788 SDL_VideoData *data = _this->driverdata;
791 id = ecore_wl_window_id_get(ewin);
792 return (SDL_Window*)eina_hash_find(data->windows, &id);
796 _tizen_cb_event_window_visibility_change(void *data, int type, void *event)
799 Ecore_Wl_Event_Window_Visibility_Change *ev;
804 ew = ecore_wl_window_find(ev->win);
805 window = Tizen_FindWindow(_this, ew);
807 SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SHOWN, 0, 0);
808 SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
809 return ECORE_CALLBACK_PASS_ON;
813 _tizen_cb_window_configure(void *data, int type EINA_UNUSED, void *event)
818 SDL_WindowData *wind;
819 Ecore_Wl_Event_Window_Configure *ev;
821 ew = ecore_wl_window_find(ev->win);
822 window = Tizen_FindWindow(_this, ew);
823 wind = window->driverdata;
825 if (wind->rotation_supported == 0){
826 return ECORE_CALLBACK_PASS_ON;
829 int nx = 0, ny = 0, nw = 0, nh = 0;
830 SDL_Log( "configure notify window: %p, ecore_wl_window: %p\n", window, ew);
832 ecore_wl_window_geometry_get(ew, &nx, &ny, &nw, &nh);
836 SDL_Log("[SDL_Size] * _tizen_cb_window_configure :: w->w:%d, w->h:%d, nw:%d, nh:%d", window->w, window->h, nw, nh);
837 if ((window->x != nx) || (window->y != ny))
838 ecore_wl_window_position_set(ew, nx, ny);
840 if ((window->w != nw) || (window->h != nh)) {
841 _tizen_setwindowsize(window);
844 return ECORE_CALLBACK_PASS_ON;
849 _tizen_cb_event_window_rotate(void *data, int type EINA_UNUSED, void *event)
852 Ecore_Wl_Event_Window_Rotate *ev;
855 SDL_WindowData *wind;
859 return ECORE_CALLBACK_PASS_ON;
862 ew = ecore_wl_window_find(ev->win);
863 window = Tizen_FindWindow(_this, ew);
864 wind = window->driverdata;
866 if (wind->rotation != ev->angle) {
867 /* set ecore_wayland window rotation */
868 wind->rotation = ev->angle;
869 wind->received_rotation = 1;
872 return ECORE_CALLBACK_PASS_ON;
876 Tizen_InitWindow(_THIS)
878 SDL_VideoData *data = _this->driverdata;
880 data->windows = eina_hash_int32_new(NULL);
882 ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE,
883 _tizen_cb_event_window_visibility_change,_this);
884 ecore_event_handler_add(ECORE_EVENT_KEY_UP,
885 _tizen_cb_event_keyup_change,_this);
886 ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
887 _tizen_cb_event_keydown_change,_this);
888 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
889 _tizen_cb_event_mousedown_change,_this);
890 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
891 _tizen_cb_event_mouseup_change,_this);
892 ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
893 _tizen_cb_event_mousemove_change,_this);
894 ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_ROTATE,
895 _tizen_cb_event_window_rotate,_this);
896 ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
897 _tizen_cb_window_configure,_this);
898 ecore_event_handler_add(ECORE_EVENT_JOYSTICK,
899 _tizen_cb_event_joystick_change,_this);
900 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
901 _tizen_cb_event_focus_in,_this);
902 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
903 _tizen_cb_event_focus_out,_this);
904 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
905 _tizen_cb_event_mouse_in,_this);
906 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
907 _tizen_cb_event_mouse_out,_this);
913 Tizen_DeinitWindow(_THIS)
915 SDL_VideoData *data = _this->driverdata;
917 eina_hash_free(data->windows);
919 #endif /* SDL_VIDEO_DRIVER_TIZEN */
921 /* vi: set ts=4 sw=4 expandtab: */