[SDL_Tizen] Fix drawing issue
[platform/upstream/SDL.git] / src / video / tizen / SDL_tizenwindow.h
1 /*
2   Simple DirectMedia Layer
3   Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
4   Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
5
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.
9
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:
13
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.
21 */
22 #include "../../SDL_internal.h"
23
24 #ifndef _SDL_tizenwindow_h
25 #define _SDL_tizenwindow_h
26
27 #include "../SDL_sysvideo.h"
28
29 #include "SDL_syswm.h"
30
31 #include "SDL_tizenvideo.h"
32 #include <Ecore_Input.h>
33 #include <wayland-egl.h>
34
35 typedef struct {
36     uint32_t g_res_id;         /* Wayland window resource id */
37     uint32_t id;               /* Ecore wayland window id */
38
39     Ecore_Wl_Window *window;
40     struct wl_surface *surface;
41     struct wl_egl_window *egl_window;
42     EGLSurface egl_surface;
43
44     int rotation;
45     int output_rotation;
46     int rotation_supported;
47     int received_rotation;
48
49     SDL_bool support_pre_rotation;
50     SDL_bool support_indicator;
51
52 } SDL_WindowData;
53
54 enum tizen_wl_egl_window_capability {
55     TIZEN_WL_EGL_WINDOW_CAPABILITY_NONE = 0,
56     TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED = (1 << 0),
57     TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_UNSUPPORTED = (1 << 1),
58     TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_UNKNOWN = (1 << 2),
59 };
60
61 typedef enum {
62     TIZEN_ROTATION_0 = 0,
63     TIZEN_ROTATION_90 = 90,
64     TIZEN_ROTATION_180 = 180,
65     TIZEN_ROTATION_270 = 270
66 } tizen_wl_egl_window_rotation;
67
68 typedef enum {
69     TIZEN_ROTATION_RECEIVED_NONE = 0,
70     TIZEN_ROTATION_RECEIVED_SCREEN_ROTATION = 1,
71     TIZEN_ROTATION_RECEIVED_WINDOW_ROATION = 2
72 };
73
74 extern SDL_Window* Tizen_FindWindow(_THIS, Ecore_Wl_Window *ewin);
75 extern void Tizen_SetWindowTitle(_THIS, SDL_Window * window);
76 extern void Tizen_ShowWindow(_THIS, SDL_Window *window);
77 extern void Tizen_HideWindow(_THIS, SDL_Window *window);
78 extern void Tizen_RaiseWindow(_THIS, SDL_Window *window);
79
80 extern void Tizen_SetWindowFullscreen(_THIS, SDL_Window *window,
81                                       SDL_VideoDisplay *_display,
82                                       SDL_bool fullscreen);
83 extern int Tizen_CreateWindow(_THIS, SDL_Window *window);
84 extern void Tizen_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
85
86 extern void Tizen_SetWindowSize(_THIS, SDL_Window *window);
87 extern void Tizen_GetWindowSize(_THIS, SDL_Window *window, int *w, int *h);
88 extern void Tizen_DestroyWindow(_THIS, SDL_Window *window);
89
90 extern SDL_bool Tizen_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info);
91 extern int Tizen_SetWindowHitTest(SDL_Window *window, SDL_bool enabled);
92 extern void Tizen_SetWindowPosition(_THIS, SDL_Window * window);
93
94 extern int Tizen_InitWindow(_THIS);
95 extern void Tizen_DeinitWindow(_THIS);
96
97 extern void Tizen_pre_rotation_set(SDL_WindowData *_this, int rotation);
98 extern void Tizen_rotate_update(SDL_Window *window);
99
100 extern int _tizen_init_ecore_ipc();
101 extern void _tizen_ecore_ipc_client_send(int major, int minor, int ref, int ref_to);
102 extern void _tizen_set_window_size(SDL_Window * window, int w, int h);
103 enum
104 {
105     OP_INDICATOR_INIT = 1,
106     OP_INDICATOR_SHOW,
107     OP_INDICATOR_HIDE,
108     OP_RESUME,
109     OP_PAUSE,
110     OP_TERMINATE
111 };
112
113 extern void Tizen_ExecuteIndicatorProcess(SDL_WindowData *wind);
114 extern void _tizen_ecore_ipc_client_send(int major, int minor, int ref, int ref_to);
115
116 extern void _tizen_quickpanel_on(SDL_WindowData *wind);
117 extern void _tizen_quickpanel_off(SDL_WindowData *wind);
118
119 #endif /* _SDL_tizenwindow_h */
120
121 /* vi: set ts=4 sw=4 expandtab: */