Ecore_Wl2_Display *wl2_display;
struct wl_display *dpy;
struct wl_event_queue *queue;
- int dpy_fd;
- Ecore_Fd_Handler *fd_hdl;
struct
{
struct tizen_display_policy *proto;
Eina_Hash *hash_brightness;
} display_policy;
+ } wl;
+} Efl_Util_Data;
+
+typedef struct _Efl_Util_Data_Default_Queue
+{
+ /* wayland related stuffs */
+ struct
+ {
+ Eina_Bool init;
+ Ecore_Wl2_Display *wl2_display;
+ struct wl_display *dpy;
+
struct
{
+ unsigned int id;
struct tizen_gesture *proto;
int request_notified;
int event_init;
} gesture;
} wl;
-} Efl_Util_Data;
+} Efl_Util_Data_Default_Queue;
+
static Efl_Util_Data _eflutil =
{
{
EINA_FALSE,
NULL, NULL, NULL,
- -1, NULL,
{ 0, NULL, NULL, NULL }, /* tizen_policy protocol */
{ NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
{ NULL, -1 }, /* tizen_input_device_manager protocol */
- { 0, NULL, NULL }, /* display_policy protocol */
- { NULL, -1, EINA_FALSE } /* tizen_gesture protocol */
+ { 0, NULL, NULL } /* display_policy protocol */
},
};
+static Efl_Util_Data_Default_Queue _eflutil_defaultqueue =
+{
+ {
+ EINA_FALSE,
+ NULL, NULL,
+ { 0, NULL, -1, 0 } /* gesture protocol */
+ },
+};
+
+
static Eina_Bool _wl_init(void);
+static Eina_Bool _wl_init_default_queue(void);
static void _cb_wl_reg_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version);
static void _cb_wl_reg_global_remove(void *data, struct wl_registry *reg, unsigned int name);
+static void _cb_wl_default_queue_reg_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version);
+static void _cb_wl_default_queue_reg_global_remove(void *data, struct wl_registry *reg, unsigned int name);
static void _cb_wl_reg_screenshooter_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version);
static void _cb_wl_reg_screenshooter_global_remove(void *data, struct wl_registry *reg, unsigned int name);
static void _cb_wl_tz_policy_conformant(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t is_conformant);
_cb_wl_tz_display_policy_brightness_done,
};
+static const struct wl_registry_listener _wl_default_queue_reg_listener =
+{
+ _cb_wl_default_queue_reg_global,
+ _cb_wl_default_queue_reg_global_remove
+};
+
struct tizen_gesture_listener _wl_tz_gesture_listener =
{
_cb_gesture_edge_swipe_notify,
return EINA_FALSE;
}
+static Eina_Bool
+_wl_init_default_queue(void)
+{
+ struct wl_display *display_wrapper = NULL;
+ struct wl_registry *reg = NULL;
+
+ if (_eflutil_defaultqueue.wl.init) return EINA_TRUE;
+
+ if (ecore_wl2_init() <= 0) return EINA_FALSE;
+
+ _eflutil_defaultqueue.wl.wl2_display = ecore_wl2_connected_display_get(NULL);
+ EINA_SAFETY_ON_NULL_GOTO(_eflutil_defaultqueue.wl.wl2_display, fail);
+ _eflutil_defaultqueue.wl.dpy = ecore_wl2_display_get(_eflutil_defaultqueue.wl.wl2_display);
+ EINA_SAFETY_ON_NULL_GOTO(_eflutil_defaultqueue.wl.dpy, fail);
+
+ display_wrapper = wl_proxy_create_wrapper(_eflutil_defaultqueue.wl.dpy);
+ EINA_SAFETY_ON_NULL_GOTO(display_wrapper, fail);
+
+ reg = wl_display_get_registry(display_wrapper);
+ wl_proxy_wrapper_destroy(display_wrapper);
+ display_wrapper = NULL;
+ EINA_SAFETY_ON_NULL_GOTO(reg, fail);
+
+ wl_registry_add_listener(reg, &_wl_default_queue_reg_listener, NULL);
+
+ _eflutil_defaultqueue.wl.init = EINA_TRUE;
+
+ return EINA_TRUE;
+fail:
+ if (display_wrapper)
+ wl_proxy_wrapper_destroy(display_wrapper);
+
+ ecore_wl2_shutdown();
+ return EINA_FALSE;
+}
+
static void
_cb_wl_output_geometry(void *data, struct wl_output *wl_output, int x, int y,
int physical_width, int physical_height, int subpixel,
_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, id, &tizen_gesture_interface, version);
- tizen_gesture_add_listener(_eflutil.wl.gesture.proto, &_wl_tz_gesture_listener, NULL);
- }
}
/* LCOV_EXCL_START */
static void
/* LCOV_EXCL_STOP */
static void
+_cb_wl_default_queue_reg_global(void *data,
+ struct wl_registry *reg,
+ unsigned int id,
+ const char *interface,
+ unsigned int version)
+{
+ if (strcmp(interface, "tizen_gesture") == 0)
+ {
+ _eflutil_defaultqueue.wl.gesture.id = id;
+ _eflutil_defaultqueue.wl.gesture.proto = wl_registry_bind(reg, id, &tizen_gesture_interface, version);
+ tizen_gesture_add_listener(_eflutil_defaultqueue.wl.gesture.proto, &_wl_tz_gesture_listener, NULL);
+ }
+}
+/* LCOV_EXCL_START */
+static void
+_cb_wl_default_queue_reg_global_remove(void *data,
+ struct wl_registry *reg,
+ unsigned int id)
+{
+ if (id == _eflutil_defaultqueue.wl.gesture.id)
+ {
+ _eflutil_defaultqueue.wl.gesture.id = 0;
+ _eflutil_defaultqueue.wl.gesture.proto = NULL;
+ }
+}
+/* LCOV_EXCL_STOP */
+
+
+static void
_cb_wl_reg_screenshooter_global(void *data,
struct wl_registry *reg,
unsigned int name,
static void
_cb_gesture_edge_swipe_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t edge EINA_UNUSED, uint32_t edge_size EINA_UNUSED, uint32_t start_point EINA_UNUSED, uint32_t end_point EINA_UNUSED, uint32_t error)
{
- _eflutil.wl.gesture.request_notified = error;
+ _eflutil_defaultqueue.wl.gesture.request_notified = error;
}
static void
static void
_cb_gesture_edge_drag_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t edge EINA_UNUSED, uint32_t edge_size EINA_UNUSED, uint32_t start_point EINA_UNUSED, uint32_t end_point EINA_UNUSED, uint32_t error)
{
- _eflutil.wl.gesture.request_notified = error;
+ _eflutil_defaultqueue.wl.gesture.request_notified = error;
}
static void
static void
_cb_gesture_tap_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t repeat EINA_UNUSED, uint32_t error)
{
- _eflutil.wl.gesture.request_notified = error;
+ _eflutil_defaultqueue.wl.gesture.request_notified = error;
}
static void
static void
_cb_gesture_palm_cover_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t error)
{
- _eflutil.wl.gesture.request_notified = error;
+ _eflutil_defaultqueue.wl.gesture.request_notified = error;
}
/* LCOV_EXCL_START */
static void
_cb_gesture_activate_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t type EINA_UNUSED, uint32_t active EINA_UNUSED, uint32_t error)
{
- _eflutil.wl.gesture.request_notified = error;
+ _eflutil_defaultqueue.wl.gesture.request_notified = error;
}
static efl_util_error_e
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_SWIPE,
EFL_UTIL_ERROR_INVALID_PARAMETER);
start_point = edge_swipe_data->start_point;
end_point = edge_swipe_data->end_point;
- tizen_gesture_grab_edge_swipe(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+ tizen_gesture_grab_edge_swipe(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_SWIPE,
EFL_UTIL_ERROR_INVALID_PARAMETER);
start_point = edge_swipe_data->start_point;
end_point = edge_swipe_data->end_point;
- tizen_gesture_ungrab_edge_swipe(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+ tizen_gesture_ungrab_edge_swipe(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_DRAG,
EFL_UTIL_ERROR_INVALID_PARAMETER);
start_point = edge_drag_data->start_point;
end_point = edge_drag_data->end_point;
- tizen_gesture_grab_edge_drag(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+ tizen_gesture_grab_edge_drag(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_DRAG,
EFL_UTIL_ERROR_INVALID_PARAMETER);
start_point = edge_drag_data->start_point;
end_point = edge_drag_data->end_point;
- tizen_gesture_ungrab_edge_drag(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+ tizen_gesture_ungrab_edge_drag(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_TAP,
EFL_UTIL_ERROR_INVALID_PARAMETER);
fingers = tap_data->fingers;
repeats = tap_data->repeats;
- tizen_gesture_grab_tap(_eflutil.wl.gesture.proto, fingers, repeats);
+ tizen_gesture_grab_tap(_eflutil_defaultqueue.wl.gesture.proto, fingers, repeats);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_TAP,
EFL_UTIL_ERROR_INVALID_PARAMETER);
fingers = tap_data->fingers;
repeats = tap_data->repeats;
- tizen_gesture_ungrab_tap(_eflutil.wl.gesture.proto, fingers, repeats);
+ tizen_gesture_ungrab_tap(_eflutil_defaultqueue.wl.gesture.proto, fingers, repeats);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_PALM_COVER,
EFL_UTIL_ERROR_INVALID_PARAMETER);
- tizen_gesture_grab_palm_cover(_eflutil.wl.gesture.proto);
+ tizen_gesture_grab_palm_cover(_eflutil_defaultqueue.wl.gesture.proto);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_PALM_COVER,
EFL_UTIL_ERROR_INVALID_PARAMETER);
- tizen_gesture_ungrab_palm_cover(_eflutil.wl.gesture.proto);
+ tizen_gesture_ungrab_palm_cover(_eflutil_defaultqueue.wl.gesture.proto);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
-
-static Eina_Bool
-_efl_util_fd_cb(void *data, Ecore_Fd_Handler *hdl)
-{
- if (_eflutil.wl.dpy && _eflutil.wl.queue)
- {
- wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
- return ECORE_CALLBACK_RENEW;
- }
- else
- {
- return ECORE_CALLBACK_CANCEL;
- }
-}
/* LCOV_EXCL_STOP */
API efl_util_gesture_h
efl_util_gesture_initialize(void)
{
efl_util_gesture_h gesture_h = NULL;
- int dpy_fd = -1;
gesture_h = (efl_util_gesture_h)calloc(1, sizeof(struct _efl_util_gesture_h));
if (!gesture_h)
goto out; /* LCOV_EXCL_LINE */
}
- if (_wl_init() == (int)EINA_FALSE)
+ if (_wl_init_default_queue() == (int)EINA_FALSE)
{
set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */
goto out; /* LCOV_EXCL_LINE */
}
- while (!_eflutil.wl.gesture.proto)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue); /* LCOV_EXCL_LINE */
+ while (!_eflutil_defaultqueue.wl.gesture.proto)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy); /* LCOV_EXCL_LINE */
- if (_eflutil.wl.gesture.event_init <= 0)
+ if (_eflutil_defaultqueue.wl.gesture.event_init <= 0)
{
if (ecore_event_init() <= 0)
{
EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = ecore_event_type_new();
EFL_UTIL_EVENT_GESTURE_TAP = ecore_event_type_new();
EFL_UTIL_EVENT_GESTURE_PALM_COVER = ecore_event_type_new();
-
- dpy_fd = wl_display_get_fd(_eflutil.wl.dpy);
- _eflutil.wl.dpy_fd = fcntl(dpy_fd, F_DUPFD_CLOEXEC, 0);
- if (_eflutil.wl.dpy_fd >= 0)
- _eflutil.wl.fd_hdl = ecore_main_fd_handler_add(_eflutil.wl.dpy_fd,
- ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
- _efl_util_fd_cb, NULL,
- NULL, NULL);
}
- _eflutil.wl.gesture.event_init++;
+ _eflutil_defaultqueue.wl.gesture.event_init++;
gesture_h->init = EINA_TRUE;
set_last_result(EFL_UTIL_ERROR_NONE);
free(gesture_h);
gesture_h = NULL;
- _eflutil.wl.gesture.event_init--;
+ _eflutil_defaultqueue.wl.gesture.event_init--;
- if (_eflutil.wl.gesture.event_init <= 0)
+ if (_eflutil_defaultqueue.wl.gesture.event_init <= 0)
{
- _eflutil.wl.gesture.event_init = 0;
+ _eflutil_defaultqueue.wl.gesture.event_init = 0;
ecore_event_shutdown();
EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE = 0;
EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = 0;
EFL_UTIL_EVENT_GESTURE_TAP = 0;
EFL_UTIL_EVENT_GESTURE_PALM_COVER = 0;
- if (_eflutil.wl.dpy_fd >= 0)
- {
- ecore_main_fd_handler_del(_eflutil.wl.fd_hdl);
- _eflutil.wl.fd_hdl = NULL;
- close(_eflutil.wl.dpy_fd);
- _eflutil.wl.dpy_fd = -1;
- }
}
return EFL_UTIL_ERROR_NONE;
EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
EFL_UTIL_ERROR_INVALID_PARAMETER);
- tizen_gesture_select_palm_cover(_eflutil.wl.gesture.proto, surface);
+ tizen_gesture_select_palm_cover(_eflutil_defaultqueue.wl.gesture.proto, surface);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
EFL_UTIL_ERROR_INVALID_PARAMETER);
- tizen_gesture_deselect_palm_cover(_eflutil.wl.gesture.proto, surface);
+ tizen_gesture_deselect_palm_cover(_eflutil_defaultqueue.wl.gesture.proto, surface);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_TRUE_RETURN_VAL(type == EFL_UTIL_GESTURE_TYPE_NONE, EFL_UTIL_ERROR_INVALID_PARAMETER);
- tizen_gesture_activate_set(_eflutil.wl.gesture.proto, NULL, type, active);
+ tizen_gesture_activate_set(_eflutil_defaultqueue.wl.gesture.proto, NULL, type, active);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
EFL_UTIL_ERROR_INVALID_PARAMETER);
- tizen_gesture_activate_set(_eflutil.wl.gesture.proto, surface, type, active);
+ tizen_gesture_activate_set(_eflutil_defaultqueue.wl.gesture.proto, surface, type, active);
- while (_eflutil.wl.gesture.request_notified == -1)
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
+ wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
- ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
- _eflutil.wl.gesture.request_notified = -1;
+ ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
+ _eflutil_defaultqueue.wl.gesture.request_notified = -1;
return ret;
}