mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
wlr_input_device: remove anon union field
This union is unnecessary since the recent input device refactor and can now be replaced by wlr_*_from_input_device() functions.
This commit is contained in:
parent
5c4384a133
commit
91943a68a6
31 changed files with 216 additions and 130 deletions
|
|
@ -30,17 +30,6 @@ struct wlr_input_device {
|
|||
unsigned int vendor, product;
|
||||
char *name;
|
||||
|
||||
/* wlr_input_device.type determines which of these is valid */
|
||||
union {
|
||||
void *_device;
|
||||
struct wlr_keyboard *keyboard;
|
||||
struct wlr_pointer *pointer;
|
||||
struct wlr_switch *switch_device;
|
||||
struct wlr_touch *touch;
|
||||
struct wlr_tablet *tablet;
|
||||
struct wlr_tablet_pad *tablet_pad;
|
||||
};
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
|
|
|||
|
|
@ -101,6 +101,14 @@ struct wlr_keyboard_key_event {
|
|||
enum wl_keyboard_key_state state;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a struct wlr_keyboard from a struct wlr_input_device.
|
||||
*
|
||||
* Asserts that the input device is a keyboard.
|
||||
*/
|
||||
struct wlr_keyboard *wlr_keyboard_from_input_device(
|
||||
struct wlr_input_device *input_device);
|
||||
|
||||
bool wlr_keyboard_set_keymap(struct wlr_keyboard *kb,
|
||||
struct xkb_keymap *keymap);
|
||||
|
||||
|
|
|
|||
|
|
@ -145,4 +145,12 @@ struct wlr_pointer_hold_end_event {
|
|||
bool cancelled;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a struct wlr_pointer from a struct wlr_input_device.
|
||||
*
|
||||
* Asserts that the input device is a pointer.
|
||||
*/
|
||||
struct wlr_pointer *wlr_pointer_from_input_device(
|
||||
struct wlr_input_device *input_device);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -43,4 +43,12 @@ struct wlr_switch_toggle_event {
|
|||
enum wlr_switch_state switch_state;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a struct wlr_switch from a struct wlr_input_device.
|
||||
*
|
||||
* Asserts that the input device is a switch.
|
||||
*/
|
||||
struct wlr_switch *wlr_switch_from_input_device(
|
||||
struct wlr_input_device *input_device);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -92,4 +92,12 @@ struct wlr_tablet_pad_strip_event {
|
|||
unsigned int mode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a struct wlr_tablet_pad from a struct wlr_input_device.
|
||||
*
|
||||
* Asserts that the input device is a tablet pad.
|
||||
*/
|
||||
struct wlr_tablet_pad *wlr_tablet_pad_from_input_device(
|
||||
struct wlr_input_device *);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -144,4 +144,12 @@ struct wlr_tablet_tool_button_event {
|
|||
enum wlr_button_state state;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a struct wlr_tablet from a struct wlr_input_device.
|
||||
*
|
||||
* Asserts that the input device is a tablet tool.
|
||||
*/
|
||||
struct wlr_tablet *wlr_tablet_from_input_device(
|
||||
struct wlr_input_device *input_device);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -62,4 +62,12 @@ struct wlr_touch_cancel_event {
|
|||
int32_t touch_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a struct wlr_touch from a struct wlr_input_device.
|
||||
*
|
||||
* Asserts that the input device is a touch device.
|
||||
*/
|
||||
struct wlr_touch *wlr_touch_from_input_device(
|
||||
struct wlr_input_device *input_device);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue