diff options
author | emersion <contact@emersion.fr> | 2018-04-30 10:55:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 10:55:25 +0100 |
commit | 509d38425c33524c77bfb4aa89676d57c21fcd11 (patch) | |
tree | 7ee2138da910973fa5a7d8722ec400679d5d5bb2 /include | |
parent | a0f490306395ac3705c00ecc85b4a0bba721886e (diff) | |
parent | 178ac8bffee3c76de39e6c0bf37838b58cb7280f (diff) |
Merge pull request #930 from emersion/input-device-output-name
Add wlr_input_device.output_name
Diffstat (limited to 'include')
-rw-r--r-- | include/backend/wayland.h | 22 | ||||
-rw-r--r-- | include/backend/x11.h | 8 | ||||
-rw-r--r-- | include/wlr/backend/wayland.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_input_device.h | 5 |
4 files changed, 20 insertions, 17 deletions
diff --git a/include/backend/wayland.h b/include/backend/wayland.h index d1af954c..38c7ee32 100644 --- a/include/backend/wayland.h +++ b/include/backend/wayland.h @@ -32,10 +32,11 @@ struct wlr_wl_backend { struct wl_shm *shm; struct wl_seat *seat; struct wl_pointer *pointer; + struct wlr_wl_pointer *current_pointer; char *seat_name; }; -struct wlr_wl_backend_output { +struct wlr_wl_output { struct wlr_output wlr_output; struct wlr_wl_backend *backend; @@ -47,7 +48,7 @@ struct wlr_wl_backend_output { struct { struct wl_shm_pool *pool; - void *buffer; // actually a (client-side) struct wl_buffer* + void *buffer; // actually a (client-side) struct wl_buffer * uint32_t buf_size; uint8_t *data; struct wl_surface *surface; @@ -69,17 +70,20 @@ struct wlr_wl_input_device { struct wlr_wl_pointer { struct wlr_pointer wlr_pointer; + + struct wlr_wl_input_device *input_device; + struct wl_pointer *wl_pointer; enum wlr_axis_source axis_source; - struct wlr_wl_backend_output *current_output; - struct wl_listener output_destroy_listener; + struct wlr_wl_output *output; + + struct wl_listener output_destroy; }; void poll_wl_registry(struct wlr_wl_backend *backend); -void update_wl_output_cursor(struct wlr_wl_backend_output *output); -struct wlr_wl_backend_output *get_wl_output_for_surface( - struct wlr_wl_backend *backend, struct wl_surface *surface); -void get_wl_output_layout_box(struct wlr_wl_backend *backend, - struct wlr_box *box); +void update_wl_output_cursor(struct wlr_wl_output *output); +struct wlr_wl_pointer *pointer_get_wl(struct wlr_pointer *wlr_pointer); +void create_wl_pointer(struct wl_pointer *wl_pointer, + struct wlr_wl_output *output); extern const struct wl_seat_listener seat_listener; diff --git a/include/backend/x11.h b/include/backend/x11.h index 1d56fbe8..f5557343 100644 --- a/include/backend/x11.h +++ b/include/backend/x11.h @@ -24,6 +24,9 @@ struct wlr_x11_output { xcb_window_t win; EGLSurface surf; + struct wlr_pointer pointer; + struct wlr_input_device pointer_dev; + struct wl_event_source *frame_timer; int frame_delay; }; @@ -43,9 +46,6 @@ struct wlr_x11_backend { struct wlr_keyboard keyboard; struct wlr_input_device keyboard_dev; - struct wlr_pointer pointer; - struct wlr_input_device pointer_dev; - struct wlr_egl egl; struct wlr_renderer *renderer; struct wl_event_source *event_source; @@ -74,8 +74,6 @@ struct wlr_x11_backend { struct wlr_x11_output *get_x11_output_from_window_id(struct wlr_x11_backend *x11, xcb_window_t window); -void get_x11_output_layout_box(struct wlr_x11_backend *backend, - struct wlr_box *box); extern const struct wlr_keyboard_impl keyboard_impl; extern const struct wlr_pointer_impl pointer_impl; diff --git a/include/wlr/backend/wayland.h b/include/wlr/backend/wayland.h index e28ffff5..31a14c97 100644 --- a/include/wlr/backend/wayland.h +++ b/include/wlr/backend/wayland.h @@ -37,7 +37,7 @@ bool wlr_backend_is_wl(struct wlr_backend *backend); bool wlr_input_device_is_wl(struct wlr_input_device *device); /** - * True if the given output is a wlr_wl_backend_output. + * True if the given output is a wlr_wl_output. */ bool wlr_output_is_wl(struct wlr_output *output); diff --git a/include/wlr/types/wlr_input_device.h b/include/wlr/types/wlr_input_device.h index d65172c1..5cf26b65 100644 --- a/include/wlr/types/wlr_input_device.h +++ b/include/wlr/types/wlr_input_device.h @@ -11,7 +11,7 @@ enum wlr_input_device_type { WLR_INPUT_DEVICE_POINTER, WLR_INPUT_DEVICE_TOUCH, WLR_INPUT_DEVICE_TABLET_TOOL, - WLR_INPUT_DEVICE_TABLET_PAD + WLR_INPUT_DEVICE_TABLET_PAD, }; /* Note: these are circular dependencies */ @@ -27,10 +27,11 @@ struct wlr_input_device { const struct wlr_input_device_impl *impl; enum wlr_input_device_type type; - int vendor, product; + unsigned int vendor, product; char *name; // Or 0 if not applicable to this device double width_mm, height_mm; + char *output_name; /* wlr_input_device.type determines which of these is valid */ union { |