};
#define LOAD_FUNC(NAME) \
-_this->tizen_pre_rotation_data->NAME = SDL_LoadFunction(_this->tizen_pre_rotation_data->prerotation_dll_handle, #NAME); \
-if (!_this->tizen_pre_rotation_data->NAME) \
+_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_LogError(SDL_LOG_CATEGORY_ASSERT, "Could not retrieve pre-rotation function " #NAME); \
return SDL_FALSE; \
if (ecore_ipc_client_server_get(e->client) != ipc) \
return ECORE_CALLBACK_PASS_ON
-void SDL_ExecuteIndicatorProcess()
+void Tizen_ExecuteIndicatorProcess()
{
_tizen_init_ecore_ipc();
unsigned int childPID = fork();
{
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "[SDL] child process : %d", getpid());
int ret = execl("/usr/apps/org.tizen.sdl_indicator/bin/sdl_indicator", "/usr/apps/org.tizen.sdl_indicator/bin/sdl_indicator", NULL);
- if(ret==-1)
+ if(ret == -1)
{
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "[SDL] Failed indicator process error:%s", strerror(errno));
kill(getpid(), SIGKILL);
}
}
- else if(childPID==-1)
+ else if(childPID == -1)
{
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "[SDL] Failed fork");
}
IPC_HEAD(Add);
SDL_Log("[SDL]_cb_client_add");
+
+ SDL_VideoData* videoData = SDL_GetVideoDevice()->driverdata;
+ videoData->indicator_on = SDL_TRUE;
+
SDL_Window * window = SDL_GetVideoDevice()->windows;
SDL_WindowData *wind = window->driverdata;
- wind->indicator = SDL_TRUE;
int window_w, window_h;
ecore_wl_screen_size_get(&window_w, &window_h);
- _tizen_ecore_ipc_client_send(OP_RESIZE, wind->rotation, window_w, window_h);
+
+ _tizen_ecore_ipc_client_send(OP_INDICATOR_SHOW, wind->rotation, 0, videoData->indicator_mode);
return ECORE_CALLBACK_DONE;
}
ecore_ipc_client_del(cl);
}
- SDL_Window * window = SDL_GetVideoDevice()->windows;
- SDL_WindowData *wind = window->driverdata;
- wind->indicator = SDL_FALSE;
+ SDL_VideoData* videoData = SDL_GetVideoDevice()->driverdata;
+ videoData->indicator_on = SDL_FALSE;
+
return ECORE_CALLBACK_DONE;
}
}
int
-_tizen_PreRotatotion_LoadLibrary(SDL_WindowData *_this, const char *lib_path)
+_tizen_PreRotatotion_LoadLibrary(SDL_VideoData *_this, const char *lib_path)
{
void *lib_dll_handle = NULL;
char *path = NULL;
- if (_this->isLoaded_pre_rotation)
+ if (_this->tizen_pre_rotation_data.prerotation_dll_handle
+ && _this->tizen_pre_rotation_data.wl_egl_window_set_rotation
+ && _this->tizen_pre_rotation_data.wl_egl_window_get_capabilities)
return SDL_TRUE;
- _this->tizen_pre_rotation_data = (Tizen_Prerotation_Data *) SDL_calloc(1, sizeof(Tizen_Prerotation_Data));
- if (!_this->tizen_pre_rotation_data) {
- return SDL_OutOfMemory();
- }
+ _this->tizen_pre_rotation_data.prerotation_dll_handle = NULL;
+ _this->tizen_pre_rotation_data.wl_egl_window_set_rotation = NULL;
+ _this->tizen_pre_rotation_data.wl_egl_window_get_capabilities = NULL;
if (!lib_path)
lib_dll_handle = SDL_LoadObject(lib_path);
lib_dll_handle = SDL_LoadObject(path);
}
- _this->tizen_pre_rotation_data->prerotation_dll_handle = lib_dll_handle;
+ _this->tizen_pre_rotation_data.prerotation_dll_handle = lib_dll_handle;
if (lib_dll_handle == NULL)
return SDL_FALSE;
LOAD_FUNC(wl_egl_window_set_rotation);
LOAD_FUNC(wl_egl_window_get_capabilities);
- _this->isLoaded_pre_rotation = 1;
return SDL_TRUE;
}
void
Tizen_ShowWindow(_THIS, SDL_Window *window)
{
- SDL_WindowData *wind = window->driverdata;
+ SDL_VideoData* videoData = SDL_GetVideoDevice()->driverdata;
- if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS) && !wind->indicator)
+ if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS) && !videoData->indicator_on)
{
- SDL_ExecuteIndicatorProcess();
+ Tizen_ExecuteIndicatorProcess();
}
+
+ SDL_WindowData *wind = window->driverdata;
ecore_wl_window_show(wind->window);
}
}
void
-Tizen_pre_rotation_set(SDL_WindowData *_this, int rotation)
+Tizen_pre_rotation_set(SDL_WindowData *wind, int rotation)
{
tizen_wl_egl_window_rotation rot;
- if (!_this->egl_window) return;
+ if (!wind->egl_window) return;
switch (rotation) {
case 90:
break;
}
- _this->tizen_pre_rotation_data->wl_egl_window_set_rotation(_this->egl_window, rot);
+ SDL_VideoData* _this = SDL_GetVideoDevice()->driverdata;
+ _this->tizen_pre_rotation_data.wl_egl_window_set_rotation(wind->egl_window, rot);
}
void
_tizen_cb_ignore_output_transform, NULL);
}
+void
+_tizen_indicator_opacity_hint_callback(void *userdata, const char *name, const char *oldValue, const char *newValue)
+{
+ SDL_VideoData *data = (SDL_VideoData *)userdata;
+
+ if ((oldValue == NULL) && (newValue == NULL))
+ return;
+
+ SDL_assert(SDL_strncmp(name, SDL_HINT_TIZEN_INDICATOR_OPACITY, SDL_strlen(SDL_HINT_TIZEN_INDICATOR_OPACITY)) == 0);
+ char indicator_type[4][20] = {"opaque","translucent","transparent","bg_transparent"};
+ for (int i=0;i<4;i++) {
+ if(SDL_strncmp(newValue, indicator_type[i], SDL_strlen(indicator_type[i])) == 0)
+ {
+ data->indicator_mode = i+1;
+ break;
+ }
+ }
+}
+
int
Tizen_CreateWindow(_THIS, SDL_Window *window)
{
//Support PreRotation
wind->support_pre_rotation = 0;
- if (_tizen_rotation_type_get() && _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 ) {
+ if (_tizen_rotation_type_get() && _tizen_PreRotatotion_LoadLibrary(data, "libwayland-egl.so")) {
+ if (data->tizen_pre_rotation_data.wl_egl_window_get_capabilities(wind->egl_window) == TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) {
wind->support_pre_rotation = 1;
}
}
}
// Add orientaiton hint cb
_tizen_window_orientation_add_hint((void*)wind);
+ SDL_AddHintCallback(SDL_HINT_TIZEN_INDICATOR_OPACITY, _tizen_indicator_opacity_hint_callback, data);
Tizen_rotate_update(window);
void
Tizen_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
{
- SDL_WindowData *wind = window->driverdata;
- if(!wind->indicator)
- SDL_ExecuteIndicatorProcess();
+ SDL_VideoData* videoData = SDL_GetVideoDevice()->driverdata;
+ if(!videoData->indicator_on)
+ Tizen_ExecuteIndicatorProcess();
}
void