forked from enlightenment/efl
ecore-evas-wayland Fix formatting
NB: No functional changes (yet), just formatting cleanup so this is more readable. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
90ab99cba6
commit
19946e6035
|
@ -274,8 +274,10 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
|
||||||
|
|
||||||
prev_max = ee->prop.maximized;
|
prev_max = ee->prop.maximized;
|
||||||
prev_full = ee->prop.fullscreen;
|
prev_full = ee->prop.fullscreen;
|
||||||
ee->prop.maximized = (ev->states & ECORE_WL2_WINDOW_STATE_MAXIMIZED) == ECORE_WL2_WINDOW_STATE_MAXIMIZED;
|
ee->prop.maximized =
|
||||||
ee->prop.fullscreen = (ev->states & ECORE_WL2_WINDOW_STATE_FULLSCREEN) == ECORE_WL2_WINDOW_STATE_FULLSCREEN;
|
(ev->states & ECORE_WL2_WINDOW_STATE_MAXIMIZED) == ECORE_WL2_WINDOW_STATE_MAXIMIZED;
|
||||||
|
ee->prop.fullscreen =
|
||||||
|
(ev->states & ECORE_WL2_WINDOW_STATE_FULLSCREEN) == ECORE_WL2_WINDOW_STATE_FULLSCREEN;
|
||||||
|
|
||||||
nw = ev->w;
|
nw = ev->w;
|
||||||
nh = ev->h;
|
nh = ev->h;
|
||||||
|
@ -520,8 +522,8 @@ _ecore_evas_wl_common_device_event_add(int event_type, Ecore_Wl2_Device_Type dev
|
||||||
ev->seat_id = id;
|
ev->seat_id = id;
|
||||||
ev->window_id = ee->prop.window;
|
ev->window_id = ee->prop.window;
|
||||||
|
|
||||||
ecore_event_add(event_type, ev, _ecore_evas_wl_common_cb_device_event_free,
|
ecore_event_add(event_type, ev,
|
||||||
dev);
|
_ecore_evas_wl_common_cb_device_event_free, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EE_Wl_Device *
|
static EE_Wl_Device *
|
||||||
|
@ -537,10 +539,9 @@ _ecore_evas_wl_common_seat_add(Ecore_Evas *ee,
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "seat-%u", id);
|
snprintf(buf, sizeof(buf), "seat-%u", id);
|
||||||
dev = evas_device_add_full(ee->evas, buf, "Wayland seat",
|
dev =
|
||||||
NULL, NULL,
|
evas_device_add_full(ee->evas, buf, "Wayland seat", NULL, NULL,
|
||||||
EVAS_DEVICE_CLASS_SEAT,
|
EVAS_DEVICE_CLASS_SEAT, EVAS_DEVICE_SUBCLASS_NONE);
|
||||||
EVAS_DEVICE_SUBCLASS_NONE);
|
|
||||||
EINA_SAFETY_ON_NULL_GOTO(dev, err_dev);
|
EINA_SAFETY_ON_NULL_GOTO(dev, err_dev);
|
||||||
|
|
||||||
device->seat = dev;
|
device->seat = dev;
|
||||||
|
@ -636,11 +637,13 @@ _ecore_evas_wl_common_cb_global_removed(void *d EINA_UNUSED, int t EINA_UNUSED,
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
_ecore_evas_wl_common_device_event_add(
|
_ecore_evas_wl_common_device_event_add
|
||||||
ECORE_WL2_EVENT_DEVICE_REMOVED, ECORE_WL2_DEVICE_TYPE_SEAT,
|
(ECORE_WL2_EVENT_DEVICE_REMOVED, ECORE_WL2_DEVICE_TYPE_SEAT,
|
||||||
ev->id, device->seat, ee);
|
ev->id, device->seat, ee);
|
||||||
wdata->devices_list = eina_list_remove(wdata->devices_list,
|
|
||||||
device);
|
wdata->devices_list =
|
||||||
|
eina_list_remove(wdata->devices_list, device);
|
||||||
|
|
||||||
_ecore_evas_wl_common_device_free(device);
|
_ecore_evas_wl_common_device_free(device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -695,69 +698,73 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI
|
||||||
{
|
{
|
||||||
if (ev->pointer_enabled && !device->pointer)
|
if (ev->pointer_enabled && !device->pointer)
|
||||||
{
|
{
|
||||||
device->pointer = evas_device_add_full(
|
device->pointer =
|
||||||
ee->evas, "Mouse",
|
evas_device_add_full(ee->evas, "Mouse",
|
||||||
"A wayland pointer device",
|
"A wayland pointer device",
|
||||||
device->seat, NULL,
|
device->seat, NULL,
|
||||||
EVAS_DEVICE_CLASS_MOUSE,
|
EVAS_DEVICE_CLASS_MOUSE,
|
||||||
EVAS_DEVICE_SUBCLASS_NONE);
|
EVAS_DEVICE_SUBCLASS_NONE);
|
||||||
_ecore_evas_wl_common_device_event_add(
|
|
||||||
ECORE_WL2_EVENT_DEVICE_ADDED,
|
_ecore_evas_wl_common_device_event_add
|
||||||
ECORE_WL2_DEVICE_TYPE_POINTER,
|
(ECORE_WL2_EVENT_DEVICE_ADDED,
|
||||||
ev->id, device->pointer, ee);
|
ECORE_WL2_DEVICE_TYPE_POINTER,
|
||||||
|
ev->id, device->pointer, ee);
|
||||||
}
|
}
|
||||||
else if (!ev->pointer_enabled && device->pointer)
|
else if (!ev->pointer_enabled && device->pointer)
|
||||||
{
|
{
|
||||||
_ecore_evas_wl_common_device_event_add(
|
_ecore_evas_wl_common_device_event_add
|
||||||
ECORE_WL2_EVENT_DEVICE_REMOVED,
|
(ECORE_WL2_EVENT_DEVICE_REMOVED,
|
||||||
ECORE_WL2_DEVICE_TYPE_POINTER,
|
ECORE_WL2_DEVICE_TYPE_POINTER, ev->id, NULL, ee);
|
||||||
ev->id, NULL, ee);
|
|
||||||
evas_device_del(device->pointer);
|
evas_device_del(device->pointer);
|
||||||
device->pointer = NULL;
|
device->pointer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->keyboard_enabled && !device->keyboard)
|
if (ev->keyboard_enabled && !device->keyboard)
|
||||||
{
|
{
|
||||||
device->keyboard = evas_device_add_full(
|
device->keyboard =
|
||||||
ee->evas, "Keyboard",
|
evas_device_add_full(ee->evas, "Keyboard",
|
||||||
"A wayland keyboard device",
|
"A wayland keyboard device",
|
||||||
device->seat, NULL,
|
device->seat, NULL,
|
||||||
EVAS_DEVICE_CLASS_KEYBOARD,
|
EVAS_DEVICE_CLASS_KEYBOARD,
|
||||||
EVAS_DEVICE_SUBCLASS_NONE);
|
EVAS_DEVICE_SUBCLASS_NONE);
|
||||||
_ecore_evas_wl_common_device_event_add(
|
|
||||||
ECORE_WL2_EVENT_DEVICE_ADDED,
|
_ecore_evas_wl_common_device_event_add
|
||||||
ECORE_WL2_DEVICE_TYPE_KEYBOARD,
|
(ECORE_WL2_EVENT_DEVICE_ADDED,
|
||||||
ev->id, device->keyboard, ee);
|
ECORE_WL2_DEVICE_TYPE_KEYBOARD,
|
||||||
|
ev->id, device->keyboard, ee);
|
||||||
}
|
}
|
||||||
else if (!ev->keyboard_enabled && device->keyboard)
|
else if (!ev->keyboard_enabled && device->keyboard)
|
||||||
{
|
{
|
||||||
_ecore_evas_wl_common_device_event_add(
|
_ecore_evas_wl_common_device_event_add
|
||||||
ECORE_WL2_EVENT_DEVICE_REMOVED,
|
(ECORE_WL2_EVENT_DEVICE_REMOVED,
|
||||||
ECORE_WL2_DEVICE_TYPE_KEYBOARD,
|
ECORE_WL2_DEVICE_TYPE_KEYBOARD, ev->id, NULL, ee);
|
||||||
ev->id, NULL, ee);
|
|
||||||
evas_device_del(device->keyboard);
|
evas_device_del(device->keyboard);
|
||||||
device->keyboard = NULL;
|
device->keyboard = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->touch_enabled && !device->touch)
|
if (ev->touch_enabled && !device->touch)
|
||||||
{
|
{
|
||||||
device->touch = evas_device_add_full(
|
device->touch =
|
||||||
ee->evas, "Touch",
|
evas_device_add_full(ee->evas, "Touch",
|
||||||
"A wayland touch device",
|
"A wayland touch device",
|
||||||
device->seat, NULL,
|
device->seat, NULL,
|
||||||
EVAS_DEVICE_CLASS_TOUCH,
|
EVAS_DEVICE_CLASS_TOUCH,
|
||||||
EVAS_DEVICE_SUBCLASS_NONE);
|
EVAS_DEVICE_SUBCLASS_NONE);
|
||||||
_ecore_evas_wl_common_device_event_add(
|
|
||||||
ECORE_WL2_EVENT_DEVICE_ADDED,
|
_ecore_evas_wl_common_device_event_add
|
||||||
ECORE_WL2_DEVICE_TYPE_TOUCH,
|
(ECORE_WL2_EVENT_DEVICE_ADDED,
|
||||||
ev->id, device->touch, ee);
|
ECORE_WL2_DEVICE_TYPE_TOUCH,
|
||||||
|
ev->id, device->touch, ee);
|
||||||
}
|
}
|
||||||
else if (!ev->touch_enabled && device->touch)
|
else if (!ev->touch_enabled && device->touch)
|
||||||
{
|
{
|
||||||
_ecore_evas_wl_common_device_event_add(
|
_ecore_evas_wl_common_device_event_add
|
||||||
ECORE_WL2_EVENT_DEVICE_REMOVED,
|
(ECORE_WL2_EVENT_DEVICE_REMOVED,
|
||||||
ECORE_WL2_DEVICE_TYPE_TOUCH,
|
ECORE_WL2_DEVICE_TYPE_TOUCH,
|
||||||
ev->id, NULL, ee);
|
ev->id, NULL, ee);
|
||||||
|
|
||||||
evas_device_del(device->touch);
|
evas_device_del(device->touch);
|
||||||
device->touch = NULL;
|
device->touch = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1145,9 +1152,7 @@ _ecore_evas_wl_common_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_C
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_pointer_device_xy_get(const Ecore_Evas *ee,
|
_ecore_evas_wl_common_pointer_device_xy_get(const Ecore_Evas *ee, const Efl_Input_Device *pointer, Evas_Coord *x, Evas_Coord *y)
|
||||||
const Efl_Input_Device *pointer,
|
|
||||||
Evas_Coord *x, Evas_Coord *y)
|
|
||||||
{
|
{
|
||||||
Ecore_Evas_Engine_Wl_Data *wdata;
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
|
@ -1277,10 +1282,7 @@ _ecore_evas_wl_common_aspect_set(Ecore_Evas *ee, double aspect)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
|
_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer EINA_UNUSED, int hot_x EINA_UNUSED, int hot_y EINA_UNUSED)
|
||||||
int layer EINA_UNUSED,
|
|
||||||
int hot_x EINA_UNUSED,
|
|
||||||
int hot_y EINA_UNUSED)
|
|
||||||
{
|
{
|
||||||
Ecore_Evas_Engine_Wl_Data *wdata;
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
|
@ -1936,7 +1938,8 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||||
einfo->info.wl_display = ecore_wl2_display_get(wdata->display);
|
einfo->info.wl_display = ecore_wl2_display_get(wdata->display);
|
||||||
einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(wdata->display);
|
einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(wdata->display);
|
||||||
einfo->info.wl_shm = ecore_wl2_display_shm_get(wdata->display);
|
einfo->info.wl_shm = ecore_wl2_display_shm_get(wdata->display);
|
||||||
einfo->info.compositor_version = ecore_wl2_display_compositor_version_get(wdata->display);
|
einfo->info.compositor_version =
|
||||||
|
ecore_wl2_display_compositor_version_get(wdata->display);
|
||||||
einfo->info.destination_alpha = EINA_TRUE;
|
einfo->info.destination_alpha = EINA_TRUE;
|
||||||
einfo->info.rotation = ee->rotation;
|
einfo->info.rotation = ee->rotation;
|
||||||
einfo->info.wl_surface = ecore_wl2_window_surface_get(wdata->win);
|
einfo->info.wl_surface = ecore_wl2_window_surface_get(wdata->win);
|
||||||
|
@ -1978,7 +1981,8 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||||
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
|
||||||
if (einfo)
|
if (einfo)
|
||||||
{
|
{
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w + fw, ee->h + fh);
|
evas_damage_rectangle_add(ee->evas, 0, 0,
|
||||||
|
ee->w + fw, ee->h + fh);
|
||||||
einfo->www_avail = !!wdata->win->www_surface;
|
einfo->www_avail = !!wdata->win->www_surface;
|
||||||
einfo->just_mapped = EINA_TRUE;
|
einfo->just_mapped = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -2022,38 +2026,45 @@ _ecore_wl2_devices_setup(Ecore_Evas *ee, Ecore_Wl2_Display *display)
|
||||||
r = EINA_FALSE;
|
r = EINA_FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cap & ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD)
|
if (cap & ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD)
|
||||||
{
|
{
|
||||||
device->keyboard = evas_device_add_full(ee->evas, "Keyboard",
|
device->keyboard =
|
||||||
"A wayland keyboard device",
|
evas_device_add_full(ee->evas, "Keyboard",
|
||||||
device->seat, NULL,
|
"A wayland keyboard device",
|
||||||
EVAS_DEVICE_CLASS_KEYBOARD,
|
device->seat, NULL,
|
||||||
EVAS_DEVICE_SUBCLASS_NONE);
|
EVAS_DEVICE_CLASS_KEYBOARD,
|
||||||
_ecore_evas_wl_common_device_event_add(ECORE_WL2_EVENT_DEVICE_ADDED,
|
EVAS_DEVICE_SUBCLASS_NONE);
|
||||||
ECORE_WL2_DEVICE_TYPE_KEYBOARD,
|
|
||||||
id, device->keyboard, ee);
|
_ecore_evas_wl_common_device_event_add
|
||||||
|
(ECORE_WL2_EVENT_DEVICE_ADDED, ECORE_WL2_DEVICE_TYPE_KEYBOARD,
|
||||||
|
id, device->keyboard, ee);
|
||||||
}
|
}
|
||||||
if (cap & ECORE_WL2_SEAT_CAPABILITIES_POINTER)
|
if (cap & ECORE_WL2_SEAT_CAPABILITIES_POINTER)
|
||||||
{
|
{
|
||||||
device->pointer = evas_device_add_full(ee->evas, "Mouse",
|
device->pointer =
|
||||||
"A wayland pointer device",
|
evas_device_add_full(ee->evas, "Mouse",
|
||||||
device->seat, NULL,
|
"A wayland pointer device",
|
||||||
EVAS_DEVICE_CLASS_MOUSE,
|
device->seat, NULL,
|
||||||
EVAS_DEVICE_SUBCLASS_NONE);
|
EVAS_DEVICE_CLASS_MOUSE,
|
||||||
_ecore_evas_wl_common_device_event_add(ECORE_WL2_EVENT_DEVICE_ADDED,
|
EVAS_DEVICE_SUBCLASS_NONE);
|
||||||
ECORE_WL2_DEVICE_TYPE_POINTER,
|
|
||||||
id, device->pointer, ee);
|
_ecore_evas_wl_common_device_event_add
|
||||||
|
(ECORE_WL2_EVENT_DEVICE_ADDED, ECORE_WL2_DEVICE_TYPE_POINTER,
|
||||||
|
id, device->pointer, ee);
|
||||||
}
|
}
|
||||||
if (cap & ECORE_WL2_SEAT_CAPABILITIES_TOUCH)
|
if (cap & ECORE_WL2_SEAT_CAPABILITIES_TOUCH)
|
||||||
{
|
{
|
||||||
device->touch = evas_device_add_full(ee->evas, "Touch",
|
device->touch =
|
||||||
"A wayland touch device",
|
evas_device_add_full(ee->evas, "Touch",
|
||||||
device->seat, NULL,
|
"A wayland touch device",
|
||||||
EVAS_DEVICE_CLASS_TOUCH,
|
device->seat, NULL,
|
||||||
EVAS_DEVICE_SUBCLASS_NONE);
|
EVAS_DEVICE_CLASS_TOUCH,
|
||||||
_ecore_evas_wl_common_device_event_add(ECORE_WL2_EVENT_DEVICE_ADDED,
|
EVAS_DEVICE_SUBCLASS_NONE);
|
||||||
ECORE_WL2_DEVICE_TYPE_TOUCH,
|
|
||||||
id, device->touch, ee);
|
_ecore_evas_wl_common_device_event_add
|
||||||
|
(ECORE_WL2_EVENT_DEVICE_ADDED, ECORE_WL2_DEVICE_TYPE_TOUCH,
|
||||||
|
id, device->touch, ee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eina_iterator_free(itr);
|
eina_iterator_free(itr);
|
||||||
|
@ -2185,7 +2196,8 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, i
|
||||||
einfo->info.wl_surface = ecore_wl2_window_surface_get(wdata->win);
|
einfo->info.wl_surface = ecore_wl2_window_surface_get(wdata->win);
|
||||||
einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(ewd);
|
einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(ewd);
|
||||||
einfo->info.wl_shm = ecore_wl2_display_shm_get(ewd);
|
einfo->info.wl_shm = ecore_wl2_display_shm_get(ewd);
|
||||||
einfo->info.compositor_version = ecore_wl2_display_compositor_version_get(ewd);
|
einfo->info.compositor_version =
|
||||||
|
ecore_wl2_display_compositor_version_get(ewd);
|
||||||
|
|
||||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue