*/
EAPI int ecore_evas_aux_hint_id_get(const Ecore_Evas *ee, const char *hint);
/**
+ * @brief Set an input rect of surface.
+ *
+ * @param ee The Ecore_Evas
+ * @param input_rect The rect of input to be set
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * @since 1.16
+ */
+EAPI void ecore_evas_input_rect_set(Ecore_Evas *ee, Eina_Rectangle *input_rect);
+/**
+ * @brief Set an input rect of surface.
+ *
+ * @param ee The Ecore_Evas
+ * @param input_rect The rect of input to be added
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * @since 1.16
+ */
+EAPI void ecore_evas_input_rect_add(Ecore_Evas *ee, Eina_Rectangle *input_rect);
+/**
+ * @brief Set an input rect of surface.
+ *
+ * @param ee The Ecore_Evas
+ * @param input_rect The rect of input to be subtracted
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * @since 1.16
+ */
+EAPI void ecore_evas_input_rect_subtract(Ecore_Evas *ee, Eina_Rectangle *input_rect);
+/**
* @brief Query if the ecore evas is obscured or unobscured.
*
* @param ee The Ecore_Evas
return -1;
}
+EAPI void
+ecore_evas_input_rect_set(Ecore_Evas *ee, Eina_Rectangle *input_rect)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_input_rect_set");
+ return EINA_FALSE;
+ }
+
+ if (!strncmp(ee->driver, "wayland", 7))
+ {
+ Ecore_Evas_Interface_Wayland *iface;
+ iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
+ EINA_SAFETY_ON_NULL_RETURN(iface);
+
+ if (iface->input_rect_set)
+ iface->input_rect_set(ee, input_rect);
+
+ return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
+}
+
+EAPI void
+ecore_evas_input_rect_add(Ecore_Evas *ee, Eina_Rectangle *input_rect)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_input_rect_add");
+ return EINA_FALSE;
+ }
+
+ if (!strncmp(ee->driver, "wayland", 7))
+ {
+ Ecore_Evas_Interface_Wayland *iface;
+ iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
+ EINA_SAFETY_ON_NULL_RETURN(iface);
+
+ if (iface->input_rect_add)
+ iface->input_rect_add(ee, input_rect);
+
+ return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
+}
+
+EAPI void
+ecore_evas_input_rect_subtract(Ecore_Evas *ee, Eina_Rectangle *input_rect)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_input_rect_subtract");
+ return EINA_FALSE;
+ }
+
+ if (!strncmp(ee->driver, "wayland", 7))
+ {
+ Ecore_Evas_Interface_Wayland *iface;
+ iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
+ EINA_SAFETY_ON_NULL_RETURN(iface);
+
+ if (iface->input_rect_subtract)
+ iface->input_rect_subtract(ee, input_rect);
+
+ return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
+}
+
EAPI Eina_Bool
ecore_evas_obscured_get(const Ecore_Evas *ee)
{
void (*aux_hint_change)(Ecore_Evas *ee, int id, const char *val);
void (*aux_hint_del)(Ecore_Evas *ee, int id);
void (*supported_aux_hints_get)(Ecore_Evas *ee);
+ void (*input_rect_set)(Ecore_Evas *ee, Eina_Rectangle *input_rect);
+ void (*input_rect_add)(Ecore_Evas *ee, Eina_Rectangle *input_rect);
+ void (*input_rect_subtract)(Ecore_Evas *ee, Eina_Rectangle *input_rect);
};
#endif
EAPI Ecore_Wl_Window *ecore_wl_window_surface_find(struct wl_surface *surface);
/**
+ * Set the input rect of the Ecore_Wl_Window.
+ *
+ * To set an empty rect, pass x and y and width and height as -1, -1, 1, 1.
+ *
+ * @param win The window
+ * @param input_rect The rectangle to be set as input
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.8
+ */
+EAPI void ecore_wl_window_input_rect_set(Ecore_Wl_Window *win, Eina_Rectangle *input_rect);
+
+/**
+ * Add the input rect of the Ecore_Wl_Window.
+ *
+ * @param win The window
+ * @param input_rect The rectangle to be added as input
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.8
+ */
+EAPI void ecore_wl_window_input_rect_add(Ecore_Wl_Window *win, Eina_Rectangle *input_rect);
+
+/**
+ * Subtract the input rect of the Ecore_Wl_Window.
+ *
+ * @param win The window
+ * @param input_rect The rectangle to be subtracted as input
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.8
+ */
+EAPI void ecore_wl_window_input_rect_subtract(Ecore_Wl_Window *win, Eina_Rectangle *input_rect);
+
+/**
* Set the input region of the Ecore_Wl_Window.
*
* To set an empty region, pass width and height as 0.
} rotation_geometry_hints[4];
Eina_List *supported_aux_hints;
+ struct wl_region *input_region;
/* Eina_Bool redraw_scheduled : 1; */
/* Eina_Bool resize_scheduled : 1; */
if (win->role) eina_stringshare_del(win->role);
_ecore_wl_window_aux_hint_free(win);
-
+ if (win->input_region) wl_region_destroy(win->input_region);
+ win->input_region = NULL;
/* HMMM, why was this disabled ? */
free(win);
}
return win;
}
+EAPI void
+ecore_wl_window_input_rect_set(Ecore_Wl_Window *win, Eina_Rectangle *input_rect)
+{
+ Eina_Bool unset = EINA_FALSE;
+ if (!win) return;
+ if (!input_rect) return;
+ if (win->input_region)
+ wl_region_destroy(win->input_region);
+
+ win->input.x = input_rect->x;
+ win->input.y = input_rect->y;
+ win->input.w = input_rect->w;
+ win->input.h = input_rect->h;
+
+ if (win->type != ECORE_WL_WINDOW_TYPE_DND)
+ {
+ struct wl_region *region;
+ region = wl_compositor_create_region(_ecore_wl_compositor_get());
+ if (!region) return;
+
+ wl_region_add(region, input_rect->x, input_rect->y, input_rect->w, input_rect->h);
+ wl_surface_set_input_region(win->surface, region);
+ wl_region_destroy(region);
+ }
+}
+
+EAPI void
+ecore_wl_window_input_rect_add(Ecore_Wl_Window *win, Eina_Rectangle *input_rect)
+{
+ if (!win) return;
+ if (!input_rect) return;
+ if (input_rect->x < 0 || input_rect->y < 0) return;
+
+ if (win->type != ECORE_WL_WINDOW_TYPE_DND)
+ {
+ if (!win->input_region)
+ {
+ struct wl_region *region;
+ region = wl_compositor_create_region(_ecore_wl_compositor_get());
+ if (!region) return;
+
+ win->input_region = region;
+ }
+
+ wl_region_add(win->input_region, input_rect->x, input_rect->y, input_rect->w, input_rect->h);
+ wl_surface_set_input_region(win->surface, win->input_region);
+ }
+}
+
+EAPI void
+ecore_wl_window_input_rect_subtract(Ecore_Wl_Window *win, Eina_Rectangle *input_rect)
+{
+ if (!win) return;
+ if (!input_rect) return;
+ if (input_rect->x < 0 || input_rect->y < 0) return;
+ if (!win->input_region) return;
+
+ if (win->type != ECORE_WL_WINDOW_TYPE_DND)
+ {
+ wl_region_subtract(win->input_region, input_rect->x, input_rect->y, input_rect->w, input_rect->h);
+ wl_surface_set_input_region(win->surface, win->input_region);
+ }
+}
+
/* @since 1.8 */
EAPI void
ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
}
static void
+_ecore_evas_wayland_input_rect_set(Ecore_Evas *ee, Eina_Rectangle *input_rect)
+{
+ Ecore_Evas_Engine_Wl_Data *wdata;
+
+ if (!ee) return;
+ wdata = ee->engine.data;
+ ecore_wl_window_input_rect_set(wdata->win, input_rect);
+}
+
+static void
+_ecore_evas_wayland_input_rect_add(Ecore_Evas *ee, Eina_Rectangle *input_rect)
+{
+ Ecore_Evas_Engine_Wl_Data *wdata;
+
+ if (!ee) return;
+ wdata = ee->engine.data;
+ ecore_wl_window_input_rect_add(wdata->win, input_rect);
+}
+
+static void
+_ecore_evas_wayland_input_rect_subtract(Ecore_Evas *ee, Eina_Rectangle *input_rect)
+{
+ Ecore_Evas_Engine_Wl_Data *wdata;
+
+ if (!ee) return;
+ wdata = ee->engine.data;
+ ecore_wl_window_input_rect_subtract(wdata->win, input_rect);
+}
+
+static void
_ecore_evas_wayland_supported_aux_hints_get(Ecore_Evas *ee)
{
Ecore_Evas_Engine_Wl_Data *wdata;
iface->aux_hint_change = _ecore_evas_wayland_aux_hint_change;
iface->aux_hint_del = _ecore_evas_wayland_aux_hint_del;
iface->supported_aux_hints_get = _ecore_evas_wayland_supported_aux_hints_get;
+ iface->input_rect_set = _ecore_evas_wayland_input_rect_set;
+ iface->input_rect_add = _ecore_evas_wayland_input_rect_add;
+ iface->input_rect_subtract = _ecore_evas_wayland_input_rect_subtract;
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
iface->pre_post_swap_callback_set =