summaryrefslogtreecommitdiff
path: root/src/lib/efl_wl
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-12 12:15:50 -0400
committerMike Blumenkrantz <zmike@samsung.com>2020-03-12 12:17:07 -0400
commit12854eac34d8d1decc3c61867d242887a288ac6e (patch)
tree07580bc61f1d9c61bdca22bfadc55e9868da5061 /src/lib/efl_wl
parentb51d45835c534970361845e4f666d405d5b66d6a (diff)
efl-wl: move keymap functions to eo
Summary: more 1:1 changes Depends on D11467 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11468
Diffstat (limited to 'src/lib/efl_wl')
-rw-r--r--src/lib/efl_wl/Efl_Wl.h6
-rw-r--r--src/lib/efl_wl/efl_wl.c20
-rw-r--r--src/lib/efl_wl/efl_wl.eo17
3 files changed, 28 insertions, 15 deletions
diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h
index 5676d892ae..71b3c2c190 100644
--- a/src/lib/efl_wl/Efl_Wl.h
+++ b/src/lib/efl_wl/Efl_Wl.h
@@ -26,8 +26,10 @@
26typedef struct Efl_Wl_Wl_Surface Efl_Wl_Wl_Surface; 26typedef struct Efl_Wl_Wl_Surface Efl_Wl_Wl_Surface;
27typedef struct Efl_Wl_Wl_Global Efl_Wl_Wl_Global; 27typedef struct Efl_Wl_Wl_Global Efl_Wl_Wl_Global;
28typedef struct Efl_Wl_Wl_Interface Efl_Wl_Wl_Interface; 28typedef struct Efl_Wl_Wl_Interface Efl_Wl_Wl_Interface;
29typedef struct Efl_Wl_Wl_Array Efl_Wl_Wl_Array;
29typedef void * Efl_Wl_Wl_Interface_Data; 30typedef void * Efl_Wl_Wl_Interface_Data;
30typedef void * Efl_Wl_Wl_Interface_Bind_Cb; 31typedef void * Efl_Wl_Wl_Interface_Bind_Cb;
32typedef struct Efl_Wl_Xkb_State Efl_Wl_Xkb_State;
31 33
32#include <efl_wl.eo.h> 34#include <efl_wl.eo.h>
33#include <efl_wl_surface.eo.h> 35#include <efl_wl_surface.eo.h>
@@ -210,7 +212,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource);
210 * @since 1.21 212 * @since 1.21
211 */ 213 */
212EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); 214EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface);
213#endif 215
214/** 216/**
215 * Set external xkbcommon resources to be used read-only by the compositor object 217 * Set external xkbcommon resources to be used read-only by the compositor object
216 * 218 *
@@ -236,7 +238,7 @@ EAPI void efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char *
236 * @since 1.21 238 * @since 1.21
237 */ 239 */
238EAPI void efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay); 240EAPI void efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay);
239 241#endif
240#undef EAPI 242#undef EAPI
241#define EAPI 243#define EAPI
242#undef EAPI_WEAK 244#undef EAPI_WEAK
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index c56ec323f7..0aa1d23096 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -210,7 +210,7 @@ typedef struct Comp_Seat
210 struct xkb_context *context; 210 struct xkb_context *context;
211 struct xkb_keymap *keymap; 211 struct xkb_keymap *keymap;
212 struct xkb_state *state; 212 struct xkb_state *state;
213 char *keymap_str; 213 const char *keymap_str;
214 int keymap_str_size; 214 int keymap_str_size;
215 int repeat_rate; 215 int repeat_rate;
216 int repeat_delay; 216 int repeat_delay;
@@ -5782,14 +5782,11 @@ _efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs)
5782 return NULL; 5782 return NULL;
5783} 5783}
5784 5784
5785void 5785static EOLIAN void
5786efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_array) 5786_efl_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Wl_Xkb_State *state, const char *str, Efl_Wl_Wl_Array *key_array)
5787{ 5787{
5788 Comp *c;
5789 Comp_Seat *s; 5788 Comp_Seat *s;
5790 5789
5791 if (!eina_streq(evas_object_type_get(obj), "comp")) abort();
5792 c = efl_data_scope_get(obj, MY_CLASS);
5793 EINA_INLIST_FOREACH(c->seats, s) 5790 EINA_INLIST_FOREACH(c->seats, s)
5794 { 5791 {
5795 if (!seat) efl_wl_seat_keymap_set(obj, s->dev, state, str, key_array); 5792 if (!seat) efl_wl_seat_keymap_set(obj, s->dev, state, str, key_array);
@@ -5799,8 +5796,8 @@ efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_arra
5799 EINA_SAFETY_ON_NULL_RETURN(s); 5796 EINA_SAFETY_ON_NULL_RETURN(s);
5800 seat_kbd_destroy(s); 5797 seat_kbd_destroy(s);
5801 s->kbd.external = 1; 5798 s->kbd.external = 1;
5802 s->kbd.keys_external = key_array; 5799 s->kbd.keys_external = (void*)key_array;
5803 s->kbd.state = state; 5800 s->kbd.state = (void*)state;
5804 s->kbd.keymap_str = str; 5801 s->kbd.keymap_str = str;
5805 if (str) 5802 if (str)
5806 s->kbd.keymap_str_size = strlen(str) + 1; 5803 s->kbd.keymap_str_size = strlen(str) + 1;
@@ -5812,14 +5809,11 @@ efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_arra
5812 seat_kbd_external_init(s); 5809 seat_kbd_external_init(s);
5813} 5810}
5814 5811
5815void 5812static EOLIAN void
5816efl_wl_seat_key_repeat_set(Eo *obj, Eo *seat, int repeat_rate, int repeat_delay) 5813_efl_wl_seat_key_repeat_set(Eo *obj, Comp *c, Eo *seat, int repeat_rate, int repeat_delay)
5817{ 5814{
5818 Comp *c;
5819 Comp_Seat *s; 5815 Comp_Seat *s;
5820 5816
5821 if (!eina_streq(evas_object_type_get(obj), "comp")) abort();
5822 c = efl_data_scope_get(obj, MY_CLASS);
5823 EINA_INLIST_FOREACH(c->seats, s) 5817 EINA_INLIST_FOREACH(c->seats, s)
5824 { 5818 {
5825 if (!seat) efl_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay); 5819 if (!seat) efl_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay);
diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo
index ffd2e9d5c7..20663624cb 100644
--- a/src/lib/efl_wl/efl_wl.eo
+++ b/src/lib/efl_wl/efl_wl.eo
@@ -7,6 +7,8 @@ struct @beta @extern Efl.Wl_Wl_Global; [[ struct wl_global. @since 1.24 ]]
7struct @beta @extern Efl.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]] 7struct @beta @extern Efl.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]]
8struct @beta @extern Efl.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]] 8struct @beta @extern Efl.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]]
9struct @beta @extern Efl.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]] 9struct @beta @extern Efl.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]]
10struct @beta @extern Efl.Wl_Xkb_State; [[ struct xkb_state. @since 1.24 ]]
11struct @beta @extern Efl.Wl_Wl_Array; [[ struct wl_array. @since 1.24 ]]
10 12
11 13
12enum @beta Efl.Wl.Rotation 14enum @beta Efl.Wl.Rotation
@@ -82,6 +84,21 @@ class @beta Efl.Wl extends Efl.Canvas.Group
82 } 84 }
83 return: Efl.Wl_Wl_Global @by_ref; 85 return: Efl.Wl_Wl_Global @by_ref;
84 } 86 }
87 seat_keymap_set {
88 params {
89 seat: Efl.Input.Device;
90 state: Efl.Wl_Xkb_State @by_ref;
91 keymap_str: string;
92 key_array: Efl.Wl_Wl_Array @by_ref;
93 }
94 }
95 seat_key_repeat_set {
96 params {
97 seat: Efl.Input.Device;
98 repeat_rate: int;
99 repeat_delay: int;
100 }
101 }
85 } 102 }
86 implements { 103 implements {
87 Efl.Object.constructor; 104 Efl.Object.constructor;