ecore_wayland: Added cursor_theme_name in Ecore_Wl_input.

Summary:
1. Added cursor_theme_name to Ecore_Wl_Input struct.
2. Made it configurable through environment variable ECORE_WL_INPUT_CURSOR_THEME_NAME.
3. Added a API ecore_wl_cursor_theme_name_set for user to set manually.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1458
This commit is contained in:
Srivardhan Hebbar 2014-09-18 10:52:29 -04:00 committed by Chris Michael
parent 2690080c2d
commit 50a0195f7e
4 changed files with 22 additions and 3 deletions

View File

@ -408,6 +408,7 @@ EAPI Eina_Inlist *ecore_wl_outputs_get(void);
* @since 1.12
*/
EAPI void ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size);
EAPI void ecore_wl_input_cursor_theme_name_set(Ecore_Wl_Input *input, const char *cursor_theme_name);
/**
* Retrieves the Wayland Globals Interface list used for the current Wayland connection.

View File

@ -635,11 +635,11 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
{
ewd->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
/* FIXME: we should import the theme name from a config or env variable */
if (ewd->input)
{
ewd->cursor_theme =
wl_cursor_theme_load(NULL, ewd->input->cursor_size, ewd->wl.shm);
ewd->cursor_theme =
wl_cursor_theme_load(ewd->input->cursor_theme_name,
ewd->input->cursor_size, ewd->wl.shm);
}
else
{

View File

@ -221,6 +221,19 @@ ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size)
wl_cursor_theme_load(NULL, input->cursor_size, input->display->wl.shm);
}
EAPI void
ecore_wl_input_cursor_theme_name_set(Ecore_Wl_Input *input, const char *cursor_theme_name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!input) return;
input->cursor_theme_name = cursor_theme_name;
input->display->cursor_theme =
wl_cursor_theme_load(input->cursor_theme_name, input->cursor_size,
input->display->wl.shm);
}
static Eina_Bool
_ecore_wl_input_cursor_update(void *data)
{
@ -341,6 +354,7 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
Ecore_Wl_Input *input;
char *temp;
unsigned int cursor_size;
char *cursor_theme_name;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -360,6 +374,9 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
cursor_size = ECORE_WL_DEFAULT_CURSOR_SIZE;
ecore_wl_input_cursor_size_set(input, cursor_size);
cursor_theme_name = getenv("ECORE_WL_CURSOR_THEME_NAME");
ecore_wl_input_cursor_theme_name_set(input, cursor_theme_name);
input->seat =
wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1);
ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input));

View File

@ -181,6 +181,7 @@ struct _Ecore_Wl_Input
Ecore_Timer *cursor_timer;
unsigned int cursor_current_index;
unsigned int cursor_size;
const char *cursor_theme_name;
struct wl_data_device *data_device;
struct wl_data_source *data_source;