diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -90,7 +90,7 @@ typedef struct _Ecore_Wl2_Event_Focus_In { - unsigned int window; + Ecore_Wl2_Window *window; unsigned int timestamp; Eo *dev; //The seat device Ecore_Wl2_Display *display; @@ -98,7 +98,7 @@ typedef struct _Ecore_Wl2_Event_Focus_Out { - unsigned int window; + Ecore_Wl2_Window *window; unsigned int timestamp; Eo *dev; //The seat device Ecore_Wl2_Display *display; @@ -106,7 +106,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Enter { - unsigned int win, source; + Ecore_Wl2_Window *win, *source; Ecore_Wl2_Offer *offer; int x, y; unsigned int seat; @@ -115,7 +115,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Leave { - unsigned int win, source; + Ecore_Wl2_Window *win, *source; Ecore_Wl2_Offer *offer; unsigned int seat; Ecore_Wl2_Display *display; @@ -123,7 +123,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Motion { - unsigned int win, source; + Ecore_Wl2_Window *win, *source; Ecore_Wl2_Offer *offer; int x, y; unsigned int seat; @@ -132,7 +132,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Drop { - unsigned int win, source; + Ecore_Wl2_Window *win, *source; int x, y; Ecore_Wl2_Offer *offer; unsigned int seat; @@ -141,14 +141,14 @@ typedef struct _Ecore_Wl2_Event_Dnd_End { - unsigned int win, source; + Ecore_Wl2_Window *win, *source; unsigned int seat; Ecore_Wl2_Display *display; } Ecore_Wl2_Event_Dnd_End; struct _Ecore_Wl2_Event_Data_Source_Event { - unsigned int win, source; + Ecore_Wl2_Window *win, *source; Ecore_Wl2_Drag_Action action; unsigned int seat; uint32_t serial; @@ -157,7 +157,7 @@ typedef struct Ecore_Wl2_Event_Data_Source_End { - unsigned int win, source; + Ecore_Wl2_Window *win, *source; Ecore_Wl2_Drag_Action action; unsigned int seat; uint32_t serial; @@ -216,7 +216,7 @@ typedef struct _Ecore_Wl2_Event_Device { Eo *dev; - int window_id; + Ecore_Wl2_Window *window; unsigned int seat_id; Ecore_Wl2_Device_Type type; } Ecore_Wl2_Event_Device; @@ -236,14 +236,15 @@ typedef struct _Ecore_Wl2_Event_Window_Configure { - unsigned int win, event_win, edges; + Ecore_Wl2_Window *win, *event_win; + unsigned int edges; unsigned int w, h; unsigned int states; } Ecore_Wl2_Event_Window_Configure; typedef struct _Ecore_Wl2_Event_Window_Configure_Complete { - unsigned int win; + Ecore_Wl2_Window *win; } Ecore_Wl2_Event_Window_Configure_Complete; typedef struct _Ecore_Wl2_Event_Input_Keymap_Changed @@ -281,7 +282,7 @@ typedef struct _Ecore_Wl2_Event_Window_Rotation { - unsigned int win; + Ecore_Wl2_Window *win; int rotation, w, h, angle; Eina_Bool resize : 1; } Ecore_Wl2_Event_Window_Rotation; @@ -292,35 +293,35 @@ typedef struct _Ecore_Wl2_Event_Window_Show { - unsigned int win; - unsigned int parent_win; - unsigned int event_win; + Ecore_Wl2_Window *win; + Ecore_Wl2_Window *parent_win; + Ecore_Wl2_Window *event_win; } Ecore_Wl2_Event_Window_Show; typedef struct _Ecore_Wl2_Event_Window_Hide { - unsigned int win; - unsigned int parent_win; - unsigned int event_win; + Ecore_Wl2_Window *win; + Ecore_Wl2_Window *parent_win; + Ecore_Wl2_Window *event_win; } Ecore_Wl2_Event_Window_Hide; typedef struct _Ecore_Wl2_Event_Window_Activate { - unsigned int win; - unsigned int parent_win; - unsigned int event_win; + Ecore_Wl2_Window *win; + Ecore_Wl2_Window *parent_win; + Ecore_Wl2_Window *event_win; } Ecore_Wl2_Event_Window_Activate; typedef struct _Ecore_Wl2_Event_Window_Deactivate { - unsigned int win; - unsigned int parent_win; - unsigned int event_win; + Ecore_Wl2_Window *win; + Ecore_Wl2_Window *parent_win; + Ecore_Wl2_Window *event_win; } Ecore_Wl2_Event_Window_Deactivate; typedef struct _Ecore_Wl2_Event_Window_Iconify_State_Change { - unsigned int win; + Ecore_Wl2_Window *win; unsigned int iconified; unsigned int force; } Ecore_Wl2_Event_Window_Iconify_State_Change; @@ -342,20 +343,20 @@ typedef struct _Ecore_Wl2_Event_Aux_Hint_Allowed { - unsigned int win; + Ecore_Wl2_Window *win; int id; Ecore_Wl2_Display *display; } Ecore_Wl2_Event_Aux_Hint_Allowed; typedef struct _Ecore_Wl2_Event_Aux_Hint_Supported { - unsigned int win; + Ecore_Wl2_Window *win; Ecore_Wl2_Display *display; } Ecore_Wl2_Event_Aux_Hint_Supported; typedef struct Ecore_Wl2_Event_Aux_Message { - unsigned int win; + Ecore_Wl2_Window *win; Eina_Stringshare *key; Eina_Stringshare *val; Eina_List *options; @@ -364,7 +365,7 @@ typedef struct Ecore_Wl2_Event_Window_Offscreen { - unsigned int win; + Ecore_Wl2_Window *win; } Ecore_Wl2_Event_Window_Offscreen; typedef struct _Ecore_Wl2_Buffer Ecore_Wl2_Buffer; @@ -681,7 +682,7 @@ * @ingroup Ecore_Wl2_Display_Group * @since 1.17 */ -EAPI Ecore_Wl2_Window *ecore_wl2_display_window_find(Ecore_Wl2_Display *display, unsigned int id); +EAPI Ecore_Wl2_Window *ecore_wl2_display_window_find(Ecore_Wl2_Display *display, uintptr_t id); /** * Retrieves the Wayland Registry used for the current Wayland display. @@ -744,18 +745,6 @@ EAPI Ecore_Wl2_Window *ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x, int y, int w, int h); /** - * Get the window id associated with an Ecore_Wl2_Window - * - * @param window The Ecore_Wl2_Window of which to retrieve the window id - * - * @return The id associated with this window - * - * @ingroup Ecore_Wl2_Window_Group - * @since 1.17 - */ -EAPI int ecore_wl2_window_id_get(Ecore_Wl2_Window *window); - -/** * Get the wl_surface which belongs to this window * * @param window The Ecore_Wl2_Window to get the surface of diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c --- a/src/lib/ecore_wl2/ecore_wl2_display.c +++ b/src/lib/ecore_wl2/ecore_wl2_display.c @@ -145,7 +145,7 @@ } if (!(ev = calloc(1, sizeof(Ecore_Wl2_Event_Aux_Hint_Supported)))) return; - ev->win = win->id; + ev->win = win; ev->display = ewd; ewd->refs++; ecore_event_add(ECORE_WL2_EVENT_AUX_HINT_SUPPORTED, ev, _display_event_free, ewd); @@ -164,7 +164,7 @@ if (!win) return; if (!(ev = calloc(1, sizeof(Ecore_Wl2_Event_Aux_Hint_Allowed)))) return; - ev->win = win->id; + ev->win = win; ev->id = id; ev->display = ewd; ewd->refs++; @@ -212,7 +212,7 @@ } } - ev->win = win->id; + ev->win = win; ev->key = eina_stringshare_add(key); ev->val = eina_stringshare_add(val); ev->options = opt_list; @@ -1084,16 +1084,9 @@ } EAPI Ecore_Wl2_Window * -ecore_wl2_display_window_find(Ecore_Wl2_Display *display, unsigned int id) +ecore_wl2_display_window_find(Ecore_Wl2_Display *display EINA_UNUSED, uintptr_t id) { - Ecore_Wl2_Window *window; - - EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL); - - EINA_INLIST_FOREACH(display->windows, window) - if (window->id == (int)id) return window; - - return NULL; + return (Ecore_Wl2_Window *)id; } EAPI struct wl_registry * diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c --- a/src/lib/ecore_wl2/ecore_wl2_dnd.c +++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c @@ -53,21 +53,21 @@ uint32_t serial; Eina_List *reads; int ref; - unsigned int window_id; + Ecore_Wl2_Window *window; Eina_Bool proxied : 1; }; -static int +Ecore_Wl2_Window * _win_id_get(Ecore_Wl2_Input *input) { - int win = 0; + Ecore_Wl2_Window *win = NULL; if (input->focus.pointer) - win = input->focus.pointer->id; + win = input->focus.pointer; else if (input->focus.prev_pointer) - win = input->focus.prev_pointer->id; + win = input->focus.prev_pointer; else if (input->focus.keyboard) - win = input->focus.keyboard->id; + win = input->focus.keyboard; return win; } @@ -149,7 +149,7 @@ event_fill(struct _Ecore_Wl2_Event_Data_Source_Event *ev, Ecore_Wl2_Input *input) { if (input->focus.keyboard) - ev->source = input->focus.keyboard->id; + ev->source = input->focus.keyboard; ev->win = _win_id_get(input); ev->action = input->data.drag.action; @@ -256,7 +256,7 @@ if (input->drag.offer) { input->drag.offer->serial = serial; - input->drag.offer->window_id = window->id; + input->drag.offer->window = window; if (input->display->wl.data_device_manager_version >= WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION) @@ -269,14 +269,14 @@ else input->drag.offer = NULL; input->drag.enter_serial = serial; - input->drag.window_id = window->id; + input->drag.window = window; ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Enter)); if (!ev) return; if (input->focus.keyboard) - ev->source = input->focus.keyboard->id; - ev->win = input->drag.window_id; + ev->source = input->focus.keyboard; + ev->win = input->drag.window; ev->x = x; ev->y = y; @@ -311,9 +311,9 @@ if (!ev) return; if (input->focus.keyboard) - ev->source = input->focus.keyboard->id; + ev->source = input->focus.keyboard; - ev->win = input->drag.window_id; + ev->win = input->drag.window; ev->offer = input->drag.offer; if (ev->offer) ev->offer->ref++; @@ -321,7 +321,7 @@ ev->display = input->display; ev->display->refs++; - input->drag.window_id = 0; + input->drag.window = NULL; input->drag.enter_serial = 0; input->drag.offer = NULL; ecore_event_add(ECORE_WL2_EVENT_DND_LEAVE, ev, _delay_offer_destroy, ev->offer); @@ -342,9 +342,9 @@ input->drag.offer->serial = serial; if (input->focus.keyboard) - ev->source = input->focus.keyboard->id; + ev->source = input->focus.keyboard; - ev->win = input->drag.window_id; + ev->win = input->drag.window; ev->x = x; ev->y = y; ev->offer = input->drag.offer; @@ -364,9 +364,9 @@ if (!ev) return; if (input->focus.keyboard) - ev->source = input->focus.keyboard->id; + ev->source = input->focus.keyboard; - ev->win = input->drag.window_id; + ev->win = input->drag.window; ev->x = input->pointer.sx; ev->y = input->pointer.sy; ev->offer = input->drag.offer; @@ -524,7 +524,7 @@ if (!ev) return; if (input->focus.keyboard) - ev->source = input->focus.keyboard->id; + ev->source = input->focus.keyboard; ev->win = _win_id_get(input); diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -47,10 +47,10 @@ { EINA_INLIST; int device, sx, sy; - int last_win; - int last_last_win; - int last_event_win; - int last_last_event_win; + Ecore_Wl2_Window *last_win; + Ecore_Wl2_Window *last_last_win; + Ecore_Wl2_Window *last_event_win; + Ecore_Wl2_Window *last_last_event_win; unsigned int last_time; unsigned int last_last_time; Eina_Bool double_click : 1; @@ -82,14 +82,14 @@ } static Ecore_Wl2_Input_Devices * -_ecore_wl2_devices_get(const Ecore_Wl2_Input *input, int window_id) +_ecore_wl2_devices_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Window *window) { Ecore_Wl2_Input_Devices *devices; Eina_List *l; EINA_LIST_FOREACH(input->devices_list, l, devices) { - if (devices->window_id == window_id) + if (devices->window == window) return devices; } @@ -97,11 +97,11 @@ } static Eo * -_ecore_wl2_mouse_dev_get(Ecore_Wl2_Input *input, int window_id) +_ecore_wl2_mouse_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window) { Ecore_Wl2_Input_Devices *devices; - devices = _ecore_wl2_devices_get(input, window_id); + devices = _ecore_wl2_devices_get(input, window); if (devices && devices->pointer_dev) return efl_ref(devices->pointer_dev); @@ -109,11 +109,11 @@ } static Eo * -_ecore_wl2_touch_dev_get(Ecore_Wl2_Input *input, int window_id) +_ecore_wl2_touch_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window) { Ecore_Wl2_Input_Devices *devices; - devices = _ecore_wl2_devices_get(input, window_id); + devices = _ecore_wl2_devices_get(input, window); if (devices && devices->touch_dev) return efl_ref(devices->touch_dev); @@ -121,11 +121,11 @@ } static Eo * -_ecore_wl2_seat_dev_get(Ecore_Wl2_Input *input, int window_id) +_ecore_wl2_seat_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window) { Ecore_Wl2_Input_Devices *devices; - devices = _ecore_wl2_devices_get(input, window_id); + devices = _ecore_wl2_devices_get(input, window); if (devices) return efl_ref(devices->seat_dev); @@ -150,11 +150,11 @@ ev->x = input->pointer.sx; ev->y = input->pointer.sy; - ev->window = window->id; - ev->event_window = window->id; + ev->window = (Ecore_Window)window; + ev->event_window = (Ecore_Window)window; ev->timestamp = input->timestamp; ev->modifiers = input->keyboard.modifiers; - ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); + ev->dev = _ecore_wl2_mouse_dev_get(input, window); ecore_event_add(ECORE_EVENT_MOUSE_IN, ev, _input_event_cb_free, ev->dev); } @@ -169,11 +169,11 @@ ev->x = input->pointer.sx; ev->y = input->pointer.sy; - ev->window = window->id; - ev->event_window = window->id; + ev->window = (Ecore_Window)window; + ev->event_window = (Ecore_Window)window; ev->timestamp = input->timestamp; ev->modifiers = input->keyboard.modifiers; - ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); + ev->dev = _ecore_wl2_mouse_dev_get(input, window); ecore_event_add(ECORE_EVENT_MOUSE_OUT, ev, _input_event_cb_free, ev->dev); } @@ -187,8 +187,8 @@ ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)); if (!ev) return; - ev->window = window->id; - ev->event_window = window->id; + ev->window = (Ecore_Window)window; + ev->event_window = (Ecore_Window)window; ev->timestamp = input->timestamp; ev->x = input->pointer.sx; ev->y = input->pointer.sy; @@ -207,9 +207,9 @@ ev->multi.root.y = input->pointer.sy; if ((input->focus.touch) && (input->focus.touch == window)) - ev->dev = _ecore_wl2_touch_dev_get(input, window->id); + ev->dev = _ecore_wl2_touch_dev_get(input, window); else if ((input->focus.pointer) && (input->focus.pointer == window)) - ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); + ev->dev = _ecore_wl2_mouse_dev_get(input, window); info = _ecore_wl2_input_mouse_down_info_get(device); if (info) @@ -248,27 +248,27 @@ if (input->grab.window) { - ev->window = input->grab.window->id; - ev->event_window = input->grab.window->id; + ev->window = (Ecore_Window)input->grab.window; + ev->event_window = (Ecore_Window)input->grab.window; } else if (input->focus.pointer) { - ev->window = input->focus.pointer->id; - ev->event_window = input->focus.pointer->id; - ev->dev = _ecore_wl2_mouse_dev_get(input, input->focus.pointer->id); + ev->window = (Ecore_Window)input->focus.pointer; + ev->event_window = (Ecore_Window)input->focus.pointer; + ev->dev = _ecore_wl2_mouse_dev_get(input, input->focus.pointer); } else if (input->focus.touch) { - ev->window = input->focus.touch->id; - ev->event_window = input->focus.touch->id; - ev->dev = _ecore_wl2_touch_dev_get(input, input->focus.touch->id); + ev->window = (Ecore_Window)input->focus.touch; + ev->event_window = (Ecore_Window)input->focus.touch; + ev->dev = _ecore_wl2_touch_dev_get(input, input->focus.touch); } if (!ev->dev) { - ev->dev = _ecore_wl2_mouse_dev_get(input, ev->window); + ev->dev = _ecore_wl2_mouse_dev_get(input, (Ecore_Wl2_Window *)ev->window); if (!ev->dev) - ev->dev = _ecore_wl2_touch_dev_get(input, ev->window); + ev->dev = _ecore_wl2_touch_dev_get(input, (Ecore_Wl2_Window *)ev->window); } ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, _input_event_cb_free, ev->dev); @@ -318,8 +318,8 @@ } if (((int)(timestamp - info->last_time) <= (int)(1000 * 0.25)) && - ((window) && (window->id == info->last_win) && - (window->id == info->last_event_win))) + ((window) && (window == info->last_win) && + (window == info->last_event_win))) { ev->double_click = 1; info->double_click = EINA_TRUE; @@ -332,10 +332,10 @@ if (((int)(timestamp - info->last_last_time) <= (int)(2 * 1000 * 0.25)) && - ((window) && (window->id == info->last_win) && - (window->id == info->last_last_win) && - (window->id == info->last_event_win) && - (window->id == info->last_last_event_win))) + ((window) && (window == info->last_win) && + (window == info->last_last_win) && + (window == info->last_event_win) && + (window == info->last_last_event_win))) { ev->triple_click = 1; info->triple_click = EINA_TRUE; @@ -357,13 +357,13 @@ if (window) { - ev->window = window->id; - ev->event_window = window->id; + ev->window = (Ecore_Window)window; + ev->event_window = (Ecore_Window)window; if ((input->focus.touch) && (input->focus.touch == window)) - ev->dev = _ecore_wl2_touch_dev_get(input, window->id); + ev->dev = _ecore_wl2_touch_dev_get(input, window); else if ((input->focus.pointer) && (input->focus.pointer == window)) - ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); + ev->dev = _ecore_wl2_mouse_dev_get(input, window); } ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, @@ -372,9 +372,9 @@ if ((info) && (!info->triple_click)) { info->last_last_win = info->last_win; - info->last_win = ev->window; + info->last_win = (Ecore_Wl2_Window *)ev->window; info->last_last_event_win = info->last_event_win; - info->last_event_win = ev->window; + info->last_event_win = (Ecore_Wl2_Window *)ev->window; info->last_last_time = info->last_time; info->last_time = timestamp; } @@ -433,13 +433,13 @@ ev->multi.root.x = input->pointer.sx; ev->multi.root.y = input->pointer.sy; - ev->window = window->id; - ev->event_window = window->id; + ev->window = (Ecore_Window)window; + ev->event_window = (Ecore_Window)window; if ((input->focus.touch) && (input->focus.touch == window)) - ev->dev = _ecore_wl2_touch_dev_get(input, window->id); + ev->dev = _ecore_wl2_touch_dev_get(input, window); else if ((input->focus.pointer) && (input->focus.pointer == window)) - ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); + ev->dev = _ecore_wl2_mouse_dev_get(input, window); ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, _input_event_cb_free, ev->dev); @@ -464,8 +464,8 @@ if (!ev) return; ev->timestamp = input->timestamp; - ev->window = window->id; - ev->dev = _ecore_wl2_seat_dev_get(input, window->id); + ev->window = window; + ev->dev = _ecore_wl2_seat_dev_get(input, window); ev->display = input->display; ev->display->refs++; ecore_event_add(ECORE_WL2_EVENT_FOCUS_IN, ev, _input_event_focus_cb_free, @@ -481,8 +481,8 @@ if (!ev) return; ev->timestamp = input->timestamp; - ev->window = window->id; - ev->dev = _ecore_wl2_seat_dev_get(input, window->id); + ev->window = window; + ev->dev = _ecore_wl2_seat_dev_get(input, window); ev->display = input->display; ev->display->refs++; ecore_event_add(ECORE_WL2_EVENT_FOCUS_OUT, ev, _input_event_focus_cb_free, @@ -609,11 +609,11 @@ } static Eo * -_ecore_wl2_keyboard_dev_get(Ecore_Wl2_Input *input, int window_id) +_ecore_wl2_keyboard_dev_get(Ecore_Wl2_Input *input, Ecore_Wl2_Window * window) { Ecore_Wl2_Input_Devices *devices; - devices = _ecore_wl2_devices_get(input, window_id); + devices = _ecore_wl2_devices_get(input, window); if (devices && devices->keyboard_dev) return efl_ref(devices->keyboard_dev); @@ -649,12 +649,12 @@ strcpy((char *)ev->key, key); if (comp_len) strcpy((char *)ev->compose, compose); - ev->window = window->id; - ev->event_window = window->id; + ev->window = (Ecore_Window)window; + ev->event_window = (Ecore_Window)window; ev->timestamp = timestamp; ev->modifiers = input->keyboard.modifiers; ev->keycode = code; - ev->dev = _ecore_wl2_keyboard_dev_get(input, window->id); + ev->dev = _ecore_wl2_keyboard_dev_get(input, window); /* DBG("Emitting Key event (%s,%s,%s,%s)\n", ev->keyname, ev->key, ev->compose, ev->string); */ @@ -1535,7 +1535,7 @@ EINA_LIST_FOREACH(input->devices_list, l, devs) { - if (devs->window_id == ev->window_id) + if (devs->window == ev->window) { devices = devs; break; @@ -1550,7 +1550,7 @@ EINA_SAFETY_ON_NULL_RETURN_VAL(devices, ECORE_CALLBACK_PASS_ON); input->devices_list = eina_list_append(input->devices_list, devices); - devices->window_id = ev->window_id; + devices->window = ev->window; } if (ev->type == ECORE_WL2_DEVICE_TYPE_POINTER) @@ -1747,7 +1747,7 @@ } EINA_LIST_FOREACH_SAFE(input->devices_list, l, l_next, devices) - if (devices->window_id == window->id) + if (devices->window == window) { _ecore_wl2_devices_free(devices); input->devices_list = eina_list_remove_list(input->devices_list, l); @@ -1828,7 +1828,7 @@ EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL); - devices = _ecore_wl2_devices_get(input, window->id); + devices = _ecore_wl2_devices_get(input, window); return devices ? devices->seat_dev : NULL; } diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h --- a/src/lib/ecore_wl2/ecore_wl2_private.h +++ b/src/lib/ecore_wl2/ecore_wl2_private.h @@ -69,7 +69,7 @@ Eo *keyboard_dev; Eo *touch_dev; Eo *seat_dev; - int window_id; + Ecore_Wl2_Window *window; } Ecore_Wl2_Input_Devices; struct _Ecore_Wl2_Display @@ -173,7 +173,7 @@ Ecore_Wl2_Surface *wl2_surface; - int id, rotation, surface_id; + int rotation, surface_id; const char *title; const char *class; const char *role; @@ -509,7 +509,7 @@ { Ecore_Wl2_Offer *offer; uint32_t enter_serial; - Ecore_Window window_id; + Ecore_Wl2_Window *window; } drag, selection; unsigned int seat_version; @@ -523,7 +523,7 @@ typedef struct Ecore_Wl2_Event_Window_WWW { - unsigned int window; + Ecore_Wl2_Window *window; int x_rel; int y_rel; uint32_t timestamp; @@ -531,7 +531,7 @@ typedef struct Ecore_Wl2_Event_Window_WWW_Drag { - unsigned int window; + Ecore_Wl2_Window *window; Eina_Bool dragging; } Ecore_Wl2_Event_Window_WWW_Drag; diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c --- a/src/lib/ecore_wl2/ecore_wl2_surface.c +++ b/src/lib/ecore_wl2/ecore_wl2_surface.c @@ -76,7 +76,7 @@ Ecore_Wl2_Event_Window_Offscreen *ev = event; Ecore_Wl2_Surface *surf = data; - if (surf->wl2_win->id == (int)ev->win) + if (surf->wl2_win == ev->win) ecore_wl2_surface_flush(surf, EINA_FALSE); return ECORE_CALLBACK_RENEW; diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -54,10 +54,10 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Activate)); if (!ev) return; - ev->win = window->id; + ev->win = window; if (window->parent) - ev->parent_win = window->parent->id; - ev->event_win = window->id; + ev->parent_win = window->parent; + ev->event_win = window; ecore_event_add(ECORE_WL2_EVENT_WINDOW_ACTIVATE, ev, NULL, NULL); } @@ -69,10 +69,10 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Deactivate)); if (!ev) return; - ev->win = window->id; + ev->win = window; if (window->parent) - ev->parent_win = window->parent->id; - ev->event_win = window->id; + ev->parent_win = window->parent; + ev->event_win = window; ecore_event_add(ECORE_WL2_EVENT_WINDOW_DEACTIVATE, ev, NULL, NULL); } @@ -84,8 +84,8 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Configure)); if (!ev) return; - ev->win = win->id; - ev->event_win = win->id; + ev->win = win; + ev->event_win = win; if ((win->set_config.geometry.w == win->def_config.geometry.w) && (win->set_config.geometry.h == win->def_config.geometry.h)) @@ -124,7 +124,7 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Configure_Complete)); if (!ev) return; - ev->win = window->id; + ev->win = window; ecore_event_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE_COMPLETE, ev, NULL, NULL); } @@ -139,7 +139,7 @@ ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW_Drag)); EINA_SAFETY_ON_NULL_RETURN(ev); - ev->window = window->id; + ev->window = window; ev->dragging = 0; ecore_event_add(_ecore_wl2_event_window_www_drag, ev, NULL, NULL); @@ -153,7 +153,7 @@ ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW_Drag)); EINA_SAFETY_ON_NULL_RETURN(ev); - ev->window = window->id; + ev->window = window; ev->dragging = 1; ecore_event_add(_ecore_wl2_event_window_www_drag, ev, NULL, NULL); @@ -167,7 +167,7 @@ ev = malloc(sizeof(Ecore_Wl2_Event_Window_WWW)); EINA_SAFETY_ON_NULL_RETURN(ev); - ev->window = window->id; + ev->window = window; ev->x_rel = x_rel; ev->y_rel = y_rel; ev->timestamp = timestamp; @@ -465,7 +465,7 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Offscreen)); if (ev) { - ev->win = win->id; + ev->win = win; ecore_event_add(ECORE_WL2_EVENT_WINDOW_OFFSCREEN, ev, NULL, NULL); } } @@ -514,10 +514,10 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Show)); if (!ev) return; - ev->win = window->id; + ev->win = window; if (window->parent) - ev->parent_win = window->parent->id; - ev->event_win = window->id; + ev->parent_win = window->parent; + ev->event_win = window; ecore_event_add(ECORE_WL2_EVENT_WINDOW_SHOW, ev, NULL, NULL); } @@ -529,10 +529,10 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Hide)); if (!ev) return; - ev->win = window->id; + ev->win = window; if (window->parent) - ev->parent_win = window->parent->id; - ev->event_win = window->id; + ev->parent_win = window->parent; + ev->event_win = window; ecore_event_add(ECORE_WL2_EVENT_WINDOW_HIDE, ev, NULL, NULL); } @@ -540,7 +540,6 @@ ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x, int y, int w, int h) { Ecore_Wl2_Window *win; - static int _win_id = 1; EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL); if (display->pid) CRI("CANNOT CREATE WINDOW WITH SERVER DISPLAY"); @@ -552,7 +551,6 @@ win->display = display; win->parent = parent; - win->id = _win_id++; win->set_config.geometry.x = x; win->set_config.geometry.y = y; @@ -573,13 +571,6 @@ return win; } -EAPI int -ecore_wl2_window_id_get(Ecore_Wl2_Window *window) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(window, -1); - return window->id; -} - EAPI struct wl_surface * ecore_wl2_window_surface_get(Ecore_Wl2_Window *window) { @@ -1257,7 +1248,7 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Prepare)); if (!ev) return; - ev->win = window->id; + ev->win = window; ev->rotation = rot; ev->w = w; ev->h = h; @@ -1276,7 +1267,7 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Prepare_Done)); if (!ev) return; - ev->win = window->id; + ev->win = window; ev->rotation = rot; ev->w = 0; ev->h = 0; @@ -1296,7 +1287,7 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Request)); if (!ev) return; - ev->win = window->id; + ev->win = window; ev->rotation = rot; ev->w = 0; ev->h = 0; @@ -1316,7 +1307,7 @@ ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Done)); if (!ev) return; - ev->win = window->id; + ev->win = window; ev->rotation = rot; ev->w = w; ev->h = h; diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c --- a/src/lib/elementary/efl_selection_manager.c +++ b/src/lib/elementary/efl_selection_manager.c @@ -2960,7 +2960,7 @@ } static Sel_Manager_Dropable * -_wl_dropable_find(Efl_Selection_Manager_Data *pd, unsigned int win) +_wl_dropable_find(Efl_Selection_Manager_Data *pd, Ecore_Wl2_Window *win) { Eina_List *l; Sel_Manager_Dropable *dropable; @@ -2968,7 +2968,7 @@ if (!pd->drop_list) return NULL; - window = ecore_wl2_display_window_find(_elm_wl_display, win); + window = ecore_wl2_display_window_find(_elm_wl_display, (Ecore_Window)win); if (!window) return NULL; EINA_LIST_FOREACH(pd->drop_list, l, dropable) @@ -2979,7 +2979,7 @@ } static Evas * -_wl_evas_get_from_win(Efl_Selection_Manager_Data *pd, unsigned int win) +_wl_evas_get_from_win(Efl_Selection_Manager_Data *pd, Ecore_Wl2_Window *win) { Sel_Manager_Dropable *dropable = _wl_dropable_find(pd, win); return dropable ? evas_object_evas_get(dropable->obj) : NULL; @@ -3368,13 +3368,13 @@ } static void -_wl_dropable_all_clean(Sel_Manager_Seat_Selection *seat_sel, unsigned int win) +_wl_dropable_all_clean(Sel_Manager_Seat_Selection *seat_sel, Ecore_Wl2_Window *win) { Eina_List *l; Sel_Manager_Dropable *dropable; Ecore_Wl2_Window *window; - window = ecore_wl2_display_window_find(_elm_wl_display, win); + window = ecore_wl2_display_window_find(_elm_wl_display, (Ecore_Window)win); if (!window) return; EINA_LIST_FOREACH(seat_sel->pd->drop_list, l, dropable) @@ -3718,7 +3718,7 @@ } } - win = ecore_wl2_display_window_find(pd->wl_display, ev->win); + win = ecore_wl2_display_window_find(pd->wl_display, (Ecore_Window)ev->win); ecore_wl2_dnd_drag_end(_wl_seat_get(win, NULL, seat_sel->seat)); return ECORE_CALLBACK_PASS_ON; } diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -4337,7 +4337,7 @@ { Ecore_Wl2_Event_Window_Configure *ev = event; ELM_WIN_DATA_GET(data, sd); - if (ecore_wl2_window_id_get(sd->wl.win) != (int)ev->win) return ECORE_CALLBACK_RENEW; + if (sd->wl.win != ev->win) return ECORE_CALLBACK_RENEW; if (sd->resizing && (!ev->edges)) sd->resizing = EINA_FALSE; return ECORE_CALLBACK_RENEW; @@ -8413,14 +8413,14 @@ { #if HAVE_ELEMENTARY_WL2 if (sd->wl.win) - return (Ecore_Window)ecore_wl2_window_id_get(sd->wl.win); + return (Ecore_Window)sd->wl.win; if (sd->parent) { Ecore_Wl2_Window *parent; parent = elm_win_wl_window_get(sd->parent); if (parent) - return (Ecore_Window)ecore_wl2_window_id_get(parent); + return (Ecore_Window)parent; } #endif #ifdef HAVE_ELEMENTARY_X diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -115,9 +115,9 @@ LOGFN(__FILE__, __LINE__, __FUNCTION__); ev = event; - ee = ecore_event_window_match(ev->window); + ee = ecore_event_window_match((Ecore_Window)ev->window); if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; - if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; if (_ecore_evas_mouse_in_check(ee, ev->dev)) return ECORE_CALLBACK_PASS_ON; _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_TRUE, EINA_FALSE); @@ -136,9 +136,9 @@ LOGFN(__FILE__, __LINE__, __FUNCTION__); ev = event; - ee = ecore_event_window_match(ev->window); + ee = ecore_event_window_match((Ecore_Window)ev->window); if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; - if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; if (!_ecore_evas_mouse_in_check(ee, ev->dev)) return ECORE_CALLBACK_PASS_ON; ecore_event_evas_seat_modifier_lock_update(ee->evas, @@ -158,9 +158,9 @@ LOGFN(__FILE__, __LINE__, __FUNCTION__); ev = event; - ee = ecore_event_window_match(ev->window); + ee = ecore_event_window_match((Ecore_Window)ev->window); if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; - if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; _ecore_evas_focus_device_set(ee, ev->dev, EINA_TRUE); return ECORE_CALLBACK_PASS_ON; } @@ -174,9 +174,9 @@ LOGFN(__FILE__, __LINE__, __FUNCTION__); ev = event; - ee = ecore_event_window_match(ev->window); + ee = ecore_event_window_match((Ecore_Window)ev->window); if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; - if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; _ecore_evas_focus_device_set(ee, ev->dev, EINA_FALSE); return ECORE_CALLBACK_PASS_ON; } @@ -570,9 +570,9 @@ LOGFN(__FILE__, __LINE__, __FUNCTION__); ev = event; - ee = ecore_event_window_match(ev->win); + ee = ecore_event_window_match((Ecore_Window)ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; - if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; wdata = ee->engine.data; if (!wdata) return ECORE_CALLBACK_PASS_ON; @@ -683,10 +683,10 @@ LOGFN(__FILE__, __LINE__, __FUNCTION__); ev = event; - ee = ecore_event_window_match(ev->win); + ee = ecore_event_window_match((Ecore_Window)ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; - if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas); if (!einfo) return ECORE_CALLBACK_PASS_ON; @@ -709,9 +709,9 @@ Ecore_Wl2_Event_Aux_Message *ev; ev = event; - ee = ecore_event_window_match(ev->win); + ee = ecore_event_window_match((Ecore_Window)ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; - if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; if (eina_streq(ev->key, "stack_del")) { if (ee->func.fn_delete_request) @@ -729,9 +729,9 @@ Ecore_Evas_Engine_Wl_Data *wdata; ev = event; - ee = ecore_event_window_match(ev->win); + ee = ecore_event_window_match((Ecore_Window)ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; - if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; wdata = ee->engine.data; EINA_LIST_FREE(ee->prop.aux_hint.supported_list, hint) eina_stringshare_del(hint); ee->prop.aux_hint.supported_list = ecore_wl2_window_aux_hints_supported_get(wdata->win); @@ -747,9 +747,9 @@ Ecore_Evas_Aux_Hint *aux; ev = event; - ee = ecore_event_window_match(ev->win); + ee = ecore_event_window_match((Ecore_Window)ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; - if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; EINA_LIST_FOREACH(ee->prop.aux_hint.hints, l, aux) { @@ -776,9 +776,9 @@ LOGFN(__FILE__, __LINE__, __FUNCTION__); ev = event; - ee = ecore_event_window_match(ev->win); + ee = ecore_event_window_match((Ecore_Window)ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; - if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; _ecore_evas_wl_common_rotation_set(ee, ev->rotation, ev->resize); return ECORE_CALLBACK_PASS_ON; } @@ -944,9 +944,9 @@ Ecore_Evas_Engine_Wl_Data *wdata; Ecore_Evas *ee; - ee = ecore_event_window_match(ev->window); + ee = ecore_event_window_match((Ecore_Window)ev->window); if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; - if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; wdata = ee->engine.data; wdata->dragging = !!ev->dragging; @@ -962,9 +962,9 @@ Ecore_Evas_Engine_Wl_Data *wdata; Ecore_Evas *ee; - ee = ecore_event_window_match(ev->window); + ee = ecore_event_window_match((Ecore_Window)ev->window); if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; - if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; wdata = ee->engine.data; wdata->x_rel += ev->x_rel; @@ -992,7 +992,7 @@ ev->dev = efl_ref(dev); ev->type = device_type; ev->seat_id = id; - ev->window_id = ee->prop.window; + ev->window = (Ecore_Wl2_Window *)ee->prop.window; ecore_event_add(event_type, ev, _ecore_evas_wl_common_cb_device_event_free, dev); @@ -1265,10 +1265,10 @@ Ecore_Wl2_Event_Window_Iconify_State_Change *ev; ev = event; - ee = ecore_event_window_match(ev->win); + ee = ecore_event_window_match((Ecore_Window)ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; if (!ev->force) return ECORE_CALLBACK_PASS_ON; - if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; + if ((Ecore_Window)ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; if (ee->prop.iconified == ev->iconified) return ECORE_CALLBACK_PASS_ON; @@ -2429,7 +2429,7 @@ }; Ecore_Evas * -_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name) +_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name) { Ecore_Wl2_Display *ewd; Ecore_Wl2_Window *p = NULL; @@ -2519,7 +2519,7 @@ wdata->display = ewd; wdata->win = ecore_wl2_window_new(ewd, p, x, y, w, h); - ee->prop.window = ecore_wl2_window_id_get(wdata->win); + ee->prop.window = (Ecore_Window)wdata->win; ee->prop.aux_hint.supported_list = ecore_wl2_window_aux_hints_supported_get(wdata->win); ecore_evas_aux_hint_add(ee, "wm.policy.win.msg.use", "1"); diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -95,6 +95,6 @@ * @see ecore_evas_wayland_shm_new() * @see ecore_evas_wayland_egl_new() */ -Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name); +Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name); #endif /* _ECORE_EVAS_WAYLAND_PRIVATE_H_ */ diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -634,8 +634,8 @@ strcpy((char *)e->key, key); strcpy((char *)e->string, string); - e->window = ecore_wl2_window_id_get(imcontext->window); - e->event_window = ecore_wl2_window_id_get(imcontext->window); + e->window = (Ecore_Window)imcontext->window; + e->event_window = (Ecore_Window)imcontext->window; e->timestamp = time; e->modifiers = 0;