From: huiyu.eun Date: Tue, 4 Jul 2017 01:49:23 +0000 (+0900) Subject: [SDL_Tizen] Add SDL Indicator hints X-Git-Tag: accepted/tizen/unified/20170710.154330~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F136965%2F6;p=platform%2Fupstream%2FSDL.git [SDL_Tizen] Add SDL Indicator hints - "opaque" : Opacifies the indicator - "translucent" : Be translucent the indicator - "transparent" : Transparentizes the indicator - "bg_transparent" : Transparentizes the indicator background Can use tizen indicator by SDL_SetHint() api. * SDL_SetHint("SDL_TIZEN_INDICATOR_OPACITY", "bg_transparent"); Change-Id: I8fd7f17a8e9241eb3bd4d4cef925fb3b0ea1eb4d Signed-off-by: huiyu.eun --- diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 3bd5435..a076aa9 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -629,6 +629,17 @@ extern "C" { * "1" - SDL will only do normal key handling for Alt+F4. */ #define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" +/** + * \brief Set Tizen indicator opacity + * + * The variable can be one of + * "#opaque" - Opacifies the indicator + * "#translucent" - Be translucent the indicator + * "#transparent" - Transparentizes the indicator (this is the default) + * "#bg_transparent" - Transparentizes the indicator background + */ +#define SDL_HINT_TIZEN_INDICATOR_OPACITY "SDL_TIZEN_INDICATOR_OPACITY" + /** * \brief An enumeration of hint priorities diff --git a/src/video/tizen/SDL_tizenvideo.h b/src/video/tizen/SDL_tizenvideo.h index b9c37ad..17df465 100755 --- a/src/video/tizen/SDL_tizenvideo.h +++ b/src/video/tizen/SDL_tizenvideo.h @@ -42,8 +42,8 @@ typedef struct { Eina_Hash *windows; Tizen_Prerotation_Data tizen_pre_rotation_data; + int indicator_mode; SDL_bool indicator_on; - } SDL_VideoData; /* Initialization/Query functions */ diff --git a/src/video/tizen/SDL_tizenwindow.c b/src/video/tizen/SDL_tizenwindow.c index d259673..b959168 100755 --- a/src/video/tizen/SDL_tizenwindow.c +++ b/src/video/tizen/SDL_tizenwindow.c @@ -117,7 +117,8 @@ static Eina_Bool _cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, vo 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; } @@ -558,6 +559,25 @@ _tizen_output_transform_register(SDL_WindowData *wind) _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) { @@ -681,6 +701,7 @@ Tizen_CreateWindow(_THIS, SDL_Window *window) } // 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(wind); diff --git a/src/video/tizen/SDL_tizenwindow.h b/src/video/tizen/SDL_tizenwindow.h index 0193e3a..43c2679 100755 --- a/src/video/tizen/SDL_tizenwindow.h +++ b/src/video/tizen/SDL_tizenwindow.h @@ -94,7 +94,8 @@ extern void _tizen_ecore_ipc_client_send(int major, int minor, int ref, int ref_ enum { - OP_RESIZE=1, + OP_INDICATOR_SHOW=1, + OP_INDICATOR_HIDE, OP_RESUME, OP_PAUSE, OP_TERMINATE