summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2020-01-22 07:37:23 -0500
committerChristopher Michael <cp.michael@samsung.com>2020-01-22 07:38:45 -0500
commit46cfcf71903aea7422897eb66a2a5fa0c70f5bfa (patch)
treeb737ab1c719c45ddab4649ee022aed1b0387fae6
parentf1740535648a4d1c8d372376a727d23e61c68c5d (diff)
ecore_wl2: Add ecore_wl2_input_default_input_get() API.
Summary: Gets default input which created by display. Reviewers: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11132
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h25
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c14
2 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index eed6660c7e..294af10b5a 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -1486,6 +1486,31 @@ EAPI Eina_Bool ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int
1486EAPI void ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y); 1486EAPI void ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y);
1487 1487
1488/** 1488/**
1489 * Set a specific cursor on a given seat
1490 *
1491 * @brief This function will try to find a matching cursor inside the existing
1492 * cursor theme and set the pointer for the specified seat to be
1493 * the specified cursor
1494 *
1495 * @param input The seat to set the cursor on
1496 * @param cursor The name of the cursor to try and set
1497 *
1498 * @ingroup Ecore_Wl2_Input_Group
1499 * @since 1.20
1500 */
1501EAPI void ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const char *cursor);
1502
1503/**
1504 * Gets default input of a given display
1505 *
1506 * @param display The display
1507 *
1508 * @ingroup Ecore_Wl2_Input_Group
1509 * @since 1.24
1510 */
1511EAPI Ecore_Wl2_Input *ecore_wl2_input_default_input_get(const Ecore_Wl2_Display *ewd);
1512
1513/**
1489 * @defgroup Ecore_Wl2_Output_Group Wayland Library Output Functions 1514 * @defgroup Ecore_Wl2_Output_Group Wayland Library Output Functions
1490 * @ingroup Ecore_Wl2_Group 1515 * @ingroup Ecore_Wl2_Group
1491 * 1516 *
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 92cc9a52bd..75a7366f82 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1871,3 +1871,17 @@ ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int *x, int *y)
1871 if (y) *y = input->pointer.sy; 1871 if (y) *y = input->pointer.sy;
1872 return EINA_TRUE; 1872 return EINA_TRUE;
1873} 1873}
1874
1875EAPI Ecore_Wl2_Input *
1876ecore_wl2_input_default_input_get(const Ecore_Wl2_Display *ewd)
1877{
1878 Ecore_Wl2_Input *input;
1879
1880 EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
1881 EINA_SAFETY_ON_NULL_RETURN_VAL(ewd->inputs, NULL);
1882
1883 input = ecore_wl2_display_input_find_by_name(ewd, "seat0");
1884 if (!input) input = ecore_wl2_display_input_find_by_name(ewd, "default");
1885
1886 return input;
1887}