From c8a64305fd746ab1b33367d3ffcc9fa054221717 Mon Sep 17 00:00:00 2001 From: David Eklov Date: Tue, 5 Jul 2016 01:21:56 -0500 Subject: Enable windows to register to get notified of pointer button events --- include/client/window.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/client/window.h b/include/client/window.h index e48ec4f3..b5cc1880 100644 --- a/include/client/window.h +++ b/include/client/window.h @@ -9,6 +9,8 @@ #include "list.h" #include "client/registry.h" +struct window; + struct buffer { struct wl_buffer *buffer; cairo_surface_t *surface; @@ -25,6 +27,13 @@ struct cursor { struct wl_poitner *pointer; }; +struct pointer_input { + wl_fixed_t last_x; + wl_fixed_t last_y; + + void (*notify)(struct window *window, wl_fixed_t x, wl_fixed_t y, uint32_t button); +}; + struct window { struct registry *registry; struct buffer buffers[2]; @@ -36,6 +45,7 @@ struct window { uint32_t width, height; char *font; cairo_t *cairo; + struct pointer_input pointer_input; }; struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface); -- cgit v1.2.3-54-g00ecf From b9d8cbabdd42b8b65852fac5d8d8b01bbdabb280 Mon Sep 17 00:00:00 2001 From: David Eklov Date: Wed, 6 Jul 2016 01:08:54 -0500 Subject: Fix formatting guide violations (spaces instead of tabs) --- include/client/window.h | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/client/window.h b/include/client/window.h index b5cc1880..7be4fff3 100644 --- a/include/client/window.h +++ b/include/client/window.h @@ -12,19 +12,19 @@ struct window; struct buffer { - struct wl_buffer *buffer; - cairo_surface_t *surface; - cairo_t *cairo; - PangoContext *pango; - uint32_t width, height; - bool busy; + struct wl_buffer *buffer; + cairo_surface_t *surface; + cairo_t *cairo; + PangoContext *pango; + uint32_t width, height; + bool busy; }; struct cursor { - struct wl_surface *surface; - struct wl_cursor_theme *cursor_theme; - struct wl_cursor *cursor; - struct wl_poitner *pointer; + struct wl_surface *surface; + struct wl_cursor_theme *cursor_theme; + struct wl_cursor *cursor; + struct wl_poitner *pointer; }; struct pointer_input { @@ -35,16 +35,16 @@ struct pointer_input { }; struct window { - struct registry *registry; - struct buffer buffers[2]; - struct buffer *buffer; - struct wl_surface *surface; - struct wl_shell_surface *shell_surface; - struct wl_callback *frame_cb; - struct cursor cursor; - uint32_t width, height; - char *font; - cairo_t *cairo; + struct registry *registry; + struct buffer buffers[2]; + struct buffer *buffer; + struct wl_surface *surface; + struct wl_shell_surface *shell_surface; + struct wl_callback *frame_cb; + struct cursor cursor; + uint32_t width, height; + char *font; + cairo_t *cairo; struct pointer_input pointer_input; }; -- cgit v1.2.3-54-g00ecf