* Move X related window items into their own substruct of
_Elm_Win_Smart_Data to allow grouping based on engine.
+2012-05-29 Rob Bradford
+ * Move X related cursor items into their own substruct of Elm_Cursor
+ to make supporting cursors on other platforms cleaner.
+
+2012-05-30 Rob Bradford
+ * Add support for setting the cursor under Wayland:
+ * Introduce a configure option and #define to as per other engines
+ * Add always-built API function to allow identification of running
+ under Wayland (like for X11)
+ * Call into Ecore to set the cursor when the mouse enters the desired
+ widget.
+
2012-05-30 Mike Blumenkrantz
* Fix even/odd signals for genlist items
AC_MSG_ERROR([ecore-wince support requested, but not found by pkg-config.])
fi
+have_elementary_wayland="no"
+want_elementary_wayland="auto"
+AC_ARG_ENABLE([ecore-x],
+ [AC_HELP_STRING([--disable-ecore-wayland], [disable ecore-wayland support. @<:@default=detect@:>@])],
+ [want_elementary_wayland=$enableval], [])
+
+if test "x$want_elementary_wayland" != "xno"; then
+ PKG_CHECK_MODULES([ELEMENTARY_WAYLAND],
+ [ecore-wayland],
+ [
+ AC_DEFINE(HAVE_ELEMENTARY_WAYLAND, 1, [Wayland support for Elementary])
+ have_elementary_wayland="yes"
+ requirement_elm="ecore-wayland ${requirement_elm}"
+ ],
+ [have_elementary_wayland="no"]
+ )
+else
+ have_elementary_wayland="no"
+fi
+if test "x$want_elementary_wayland" = "xyes" -a "x$have_elementary_wayland" = "xno"; then
+ AC_MSG_ERROR([ecore-x support requested, but not found by pkg-config.])
+fi
+
ELM_EDBUS_DEF="#undef"
have_elementary_edbus="no"
want_elementary_edbus="auto"
echo " Cocoa..................: ${have_elementary_cocoa}"
echo " Windows XP.............: ${have_elementary_win32}"
echo " Windows CE.............: ${have_elementary_wince}"
+echo " Wayland...............:. ${have_elementary_wayland}"
echo
echo " Features:"
echo " Ecore_IMF..............: ${have_ecore_imf}"
#ifdef HAVE_ELEMENTARY_WINCE
#include <Ecore_WinCE.h>
#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+#include <Ecore_Wayland.h>
+#endif
#include "elm_widget.h"
Ecore_Event_Handler *client_message_handler;
} x;
#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ struct
+ {
+ Ecore_Wl_Window *win;
+ } wl;
+#endif
+
Ecore_Job *deferred_resize_job;
Ecore_Job *deferred_child_eval_job;
_elm_win_xwindow_get(sd);
#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ sd->wl.win = ecore_evas_wayland_window_get(sd->ee);
+#endif
+
if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
ecore_evas_avoid_damage_set(sd->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
// bg pixmap done by x - has other issues like can be redrawn by x before it
#endif
return 0;
}
+
+EAPI Ecore_Wl_Window *
+elm_win_wl_window_get(const Evas_Object *obj)
+{
+ if (!obj) return NULL;
+
+ if (!evas_object_smart_type_check_ptr(obj, WIN_SMART_NAME))
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ return ecore_evas_wayland_window_get(ee);
+ }
+
+ ELM_WIN_CHECK(obj) NULL;
+ ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+#if HAVE_ELEMENTARY_WAYLAND
+ if (sd->wl.win) return sd->wl.win;
+ if (sd->parent) return elm_win_wl_window_get(sd->parent);
+#endif
+ return NULL;
+}
+
*/
EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj);
+/* Wayland specific call - returns NULL on non-Wayland engines */
+/**
+ * Get the Ecore_Wl_Window of and Evas_Object
+ *
+ * @param obj the object
+ *
+ * @return The Ecore_Wl_Window of @p obj
+ *
+ * @ingroup Win
+ */
+EAPI Ecore_Wl_Window *elm_win_wl_window_get(const Evas_Object *obj);
+
/**
* @}
*/
Ecore_Evas *ee;
Evas *evas;
#ifdef HAVE_ELEMENTARY_X
- Ecore_X_Cursor cursor;
- Ecore_X_Window win;
+ struct {
+ Ecore_X_Cursor cursor;
+ Ecore_X_Window win;
+ } x;
#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ struct {
+ Ecore_Wl_Window *win;
+ } wl;
+#endif
+
Eina_Bool visible:1;
Eina_Bool use_engine:1;
Eina_Bool engine_only:1;
else
{
#ifdef HAVE_ELEMENTARY_X
- if (cur->win)
- ecore_x_window_cursor_set(cur->win, cur->cursor);
+ if (cur->x.win)
+ ecore_x_window_cursor_set(cur->x.win, cur->x.cursor);
+#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ if (cur->wl.win)
+ ecore_wl_window_cursor_from_name_set(cur->wl.win, cur->cursor_name);
#endif
}
evas_event_thaw(cur->evas);
else
{
#ifdef HAVE_ELEMENTARY_X
- if (cur->win)
- ecore_x_window_cursor_set(cur->win, ECORE_X_CURSOR_X);
+ if (cur->x.win)
+ ecore_x_window_cursor_set(cur->x.win, ECORE_X_CURSOR_X);
+#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ if (cur->wl.win)
+ ecore_wl_window_cursor_default_restore(cur->wl.win);
#endif
}
evas_event_thaw(cur->evas);
if (cur->use_engine)
{
#ifdef HAVE_ELEMENTARY_X
- struct _Cursor_Id *cur_id;
+ cur->x.win = elm_win_xwindow_get(cur->eventarea);
+ if (cur->x.win)
+ {
+ struct _Cursor_Id *cur_id;
- cur_id = bsearch(&(cur->cursor_name), _cursors, _cursors_count,
- sizeof(struct _Cursor_Id), _elm_cursor_strcmp);
+ cur_id = bsearch(&(cur->cursor_name), _cursors, _cursors_count,
+ sizeof(struct _Cursor_Id), _elm_cursor_strcmp);
- cur->win = elm_win_xwindow_get(cur->eventarea);
- if (cur->win)
- {
if (!cur_id)
{
INF("X cursor couldn't be found: %s. Using default.",
cur->cursor_name);
- cur->cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_X);
+ cur->x.cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_X);
}
else
- cur->cursor = ecore_x_cursor_shape_get(cur_id->id);
+ cur->x.cursor = ecore_x_cursor_shape_get(cur_id->id);
}
#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ cur->wl.win = elm_win_wl_window_get(cur->eventarea);
+#endif
}
}
ecore_evas_object_cursor_set(cur->ee, NULL, ELM_OBJECT_LAYER_CURSOR,
cur->hot_x, cur->hot_y);
#ifdef HAVE_ELEMENTARY_X
- else if (cur->win)
- ecore_x_window_cursor_set(cur->win, ECORE_X_CURSOR_X);
+ else if (cur->x.win)
+ ecore_x_window_cursor_set(cur->x.win, ECORE_X_CURSOR_X);
#endif
}