struct
{
+ unsigned int id;
struct tizen_policy *proto;
Eina_Hash *hash_noti_lv;
Eina_Hash *hash_scr_mode;
} devmgr;
struct
{
+ unsigned int id;
struct tizen_display_policy *proto;
Eina_Hash *hash_brightness;
} display_policy;
EINA_FALSE,
NULL, NULL, NULL,
-1, NULL,
- { NULL, NULL, NULL }, /* tizen_policy protocol */
+ { 0, NULL, NULL, NULL }, /* tizen_policy protocol */
{ NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
{ NULL, -1 }, /* tizen_input_device_manager protocol */
- { NULL, NULL }, /* display_policy protocol */
+ { 0, NULL, NULL }, /* display_policy protocol */
{ NULL, -1, EINA_FALSE } /* tizen_gesture protocol */
},
{
ecore_wl2_init();
- _eflutil.wl.wl2_display = ecore_wl2_connected_display_get(NULL);
+ _eflutil.wl.wl2_display = ecore_wl2_display_connect(NULL);
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.wl2_display, fail);
_eflutil.wl.dpy = ecore_wl2_display_get(_eflutil.wl.wl2_display);
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.dpy, fail);
static void
_cb_wl_reg_global(void *data,
struct wl_registry *reg,
- unsigned int name,
+ unsigned int id,
const char *interface,
unsigned int version)
{
{
struct tizen_policy *proto;
proto = wl_registry_bind(reg,
- name,
+ id,
&tizen_policy_interface,
7);
if (!proto) return;
_eflutil.wl.policy.hash_noti_lv = eina_hash_pointer_new(free);
_eflutil.wl.policy.hash_scr_mode = eina_hash_pointer_new(free);
_eflutil.wl.policy.proto = proto;
+ _eflutil.wl.policy.id = id;
}
else if (strcmp(interface, "wl_output") == 0)
{
_eflutil.wl.shot.output_list = eina_list_append(_eflutil.wl.shot.output_list, output);
- output->output = wl_registry_bind(reg, name, &wl_output_interface, version);
+ output->output = wl_registry_bind(reg, id, &wl_output_interface, version);
wl_output_add_listener(output->output, &output_listener, output);
}
else if (strcmp(interface, "tizen_input_device_manager") == 0)
{
- _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, name, &tizen_input_device_manager_interface, version);
+ _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, id, &tizen_input_device_manager_interface, version);
tizen_input_device_manager_add_listener(_eflutil.wl.devmgr.devicemgr, &_wl_tz_devmgr_listener, NULL);
}
else if (!strcmp(interface, "tizen_display_policy"))
{
- _eflutil.wl.display_policy.proto = wl_registry_bind(reg, name, &tizen_display_policy_interface, version);
+ _eflutil.wl.display_policy.proto = wl_registry_bind(reg, id, &tizen_display_policy_interface, version);
if (!_eflutil.wl.display_policy.proto) return;
tizen_display_policy_add_listener(_eflutil.wl.display_policy.proto,
NULL);
_eflutil.wl.display_policy.hash_brightness = eina_hash_pointer_new(free);
+ _eflutil.wl.display_policy.id = id;
}
else if (strcmp(interface, "tizen_gesture") == 0)
{
- _eflutil.wl.gesture.proto = wl_registry_bind(reg, name, &tizen_gesture_interface, version);
+ _eflutil.wl.gesture.proto = wl_registry_bind(reg, id, &tizen_gesture_interface, version);
tizen_gesture_add_listener(_eflutil.wl.gesture.proto, &_wl_tz_gesture_listener, NULL);
}
}
static void
_cb_wl_reg_global_remove(void *data,
struct wl_registry *reg,
- unsigned int name)
+ unsigned int id)
{
- _eflutil.wl.policy.proto = NULL;
- eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
- eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
-
- _eflutil.wl.display_policy.proto = NULL;
- eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+ /* unset each global id number to 0 since global id is started
+ * from number 1 on server side display structure
+ */
+ if (id == _eflutil.wl.policy.id)
+ {
+ _eflutil.wl.policy.id = 0;
+ _eflutil.wl.policy.proto = NULL;
+ eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
+ eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
+ }
+ else if (id == _eflutil.wl.display_policy.id)
+ {
+ _eflutil.wl.display_policy.id = 0;
+ _eflutil.wl.display_policy.proto = NULL;
+ eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+ }
}
/* LCOV_EXCL_STOP */
l = _cb_info_list_get(idx);
EINA_LIST_FOREACH(l, ll, info)
{
- wlwin2 = elm_win_wl_window_get(info->win);
+ wlwin2 = (Ecore_Wl2_Window *)elm_win_wl_window_get(info->win);
wlsurf2 = ecore_wl2_window_surface_get(wlwin2);
if (wlsurf== wlsurf2) return info;
}
res = _wl_init();
EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
type = elm_win_type_get(window);
res = _wl_init();
EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
type = elm_win_type_get(window);
EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.policy.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
}
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (!wlwin)
return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
res = _wl_init();
EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (wlwin)
{
while (!_eflutil.wl.policy.proto)
res = _wl_init();
EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (wlwin)
{
while (!_eflutil.wl.policy.proto)
res = _wl_init();
EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (wlwin)
{
while (!_eflutil.wl.display_policy.proto)
res = _wl_init();
EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
while (!_eflutil.wl.display_policy.proto)
if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
return EFL_UTIL_ERROR_NOT_SUPPORTED;
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
surface = ecore_wl2_window_surface_get(wlwin);
if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
return EFL_UTIL_ERROR_NOT_SUPPORTED;
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
surface = ecore_wl2_window_surface_get(wlwin);
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_TRUE_RETURN_VAL(type == EFL_UTIL_GESTURE_TYPE_NONE, EFL_UTIL_ERROR_INVALID_PARAMETER);
- wlwin = elm_win_wl_window_get(window);
+ wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
surface = ecore_wl2_window_surface_get(wlwin);