diff options
author | Daniel Stone <daniel@fooishbar.org> | 2012-05-08 17:17:54 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-08 14:40:57 -0400 |
commit | b230a7ee58ebe12f07b6ace4fcbb7a410038e35c (patch) | |
tree | 9cb90c941e8efafc5a4b70a2cacba02c1791e759 /clients | |
parent | bd3489b6e1657a036327c079abbd7da1c50799dc (diff) |
Convert internal input co-ordinates to GLfloat
Change all client motion handlers to take GLfloat for co-ordinates,
rather than int32_t.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'clients')
-rw-r--r-- | clients/desktop-shell.c | 4 | ||||
-rw-r--r-- | clients/dnd.c | 6 | ||||
-rw-r--r-- | clients/eventdemo.c | 4 | ||||
-rw-r--r-- | clients/flower.c | 2 | ||||
-rw-r--r-- | clients/gears.c | 2 | ||||
-rw-r--r-- | clients/smoke.c | 2 | ||||
-rw-r--r-- | clients/terminal.c | 2 | ||||
-rw-r--r-- | clients/window.c | 12 | ||||
-rw-r--r-- | clients/window.h | 7 |
9 files changed, 21 insertions, 20 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index 3617cf9..77e6a18 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -233,7 +233,7 @@ panel_redraw_handler(struct widget *widget, void *data) static int panel_launcher_enter_handler(struct widget *widget, struct input *input, - int32_t x, int32_t y, void *data) + GLfloat x, GLfloat y, void *data) { struct panel_launcher *launcher = data; @@ -504,7 +504,7 @@ unlock_dialog_keyboard_focus_handler(struct window *window, static int unlock_dialog_widget_enter_handler(struct widget *widget, struct input *input, - int32_t x, int32_t y, void *data) + GLfloat x, GLfloat y, void *data) { struct unlock_dialog *dialog = data; diff --git a/clients/dnd.c b/clients/dnd.c index 54fc1f2..c2975d5 100644 --- a/clients/dnd.c +++ b/clients/dnd.c @@ -450,7 +450,7 @@ lookup_cursor(struct dnd *dnd, int x, int y) static int dnd_enter_handler(struct widget *widget, - struct input *input, int32_t x, int32_t y, void *data) + struct input *input, GLfloat x, GLfloat y, void *data) { return lookup_cursor(data, x, y); } @@ -458,7 +458,7 @@ dnd_enter_handler(struct widget *widget, static int dnd_motion_handler(struct widget *widget, struct input *input, uint32_t time, - int32_t x, int32_t y, void *data) + GLfloat x, GLfloat y, void *data) { return lookup_cursor(data, x, y); } @@ -466,7 +466,7 @@ dnd_motion_handler(struct widget *widget, static void dnd_data_handler(struct window *window, struct input *input, - int32_t x, int32_t y, const char **types, void *data) + GLfloat x, GLfloat y, const char **types, void *data) { struct dnd *dnd = data; diff --git a/clients/eventdemo.c b/clients/eventdemo.c index 6ecb7d7..3189497 100644 --- a/clients/eventdemo.c +++ b/clients/eventdemo.c @@ -238,12 +238,12 @@ button_handler(struct widget *widget, struct input *input, uint32_t time, */ static int motion_handler(struct widget *widget, struct input *input, uint32_t time, - int32_t x, int32_t y, void *data) + GLfloat x, GLfloat y, void *data) { struct eventdemo *e = data; if (log_motion) { - printf("motion time: %d, x: %d, y: %d\n", time, x, y); + printf("motion time: %d, x: %f, y: %f\n", time, x, y); } if (x > e->x && x < e->x + e->w) diff --git a/clients/flower.c b/clients/flower.c index 0827c14..5fc14b5 100644 --- a/clients/flower.c +++ b/clients/flower.c @@ -134,7 +134,7 @@ redraw_handler(struct widget *widget, void *data) static int motion_handler(struct widget *widget, struct input *input, - uint32_t time, int32_t x, int32_t y, void *data) + uint32_t time, GLfloat x, GLfloat y, void *data) { return POINTER_HAND1; } diff --git a/clients/gears.c b/clients/gears.c index 9d0fba1..3a57fa6 100644 --- a/clients/gears.c +++ b/clients/gears.c @@ -223,7 +223,7 @@ static const struct wl_callback_listener listener = { static int motion_handler(struct widget *widget, struct input *input, - uint32_t time, int32_t x, int32_t y, void *data) + uint32_t time, GLfloat x, GLfloat y, void *data) { struct gears *gears = data; int offset_x, offset_y; diff --git a/clients/smoke.c b/clients/smoke.c index 2ab171f..1cf8162 100644 --- a/clients/smoke.c +++ b/clients/smoke.c @@ -230,7 +230,7 @@ redraw_handler(struct widget *widget, void *data) static int smoke_motion_handler(struct widget *widget, struct input *input, - uint32_t time, int32_t x, int32_t y, void *data) + uint32_t time, GLfloat x, GLfloat y, void *data) { struct smoke *smoke = data; int i, i0, i1, j, j0, j1, k, d = 5; diff --git a/clients/terminal.c b/clients/terminal.c index fd6fb5e..4fbc1ff 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -2237,7 +2237,7 @@ button_handler(struct widget *widget, static int motion_handler(struct widget *widget, struct input *input, uint32_t time, - int32_t x, int32_t y, void *data) + GLfloat x, GLfloat y, void *data) { struct terminal *terminal = data; diff --git a/clients/window.c b/clients/window.c index c7da54a..f5114bd 100644 --- a/clients/window.c +++ b/clients/window.c @@ -178,7 +178,7 @@ struct input { int current_cursor; uint32_t modifiers; uint32_t pointer_enter_serial; - int32_t sx, sy; + GLfloat sx, sy; struct wl_list link; struct widget *focus_widget; @@ -1336,7 +1336,7 @@ window_show_frame_menu(struct window *window, static int frame_enter_handler(struct widget *widget, - struct input *input, int32_t x, int32_t y, void *data) + struct input *input, GLfloat x, GLfloat y, void *data) { return frame_get_pointer_image_for_location(data, input); } @@ -1344,7 +1344,7 @@ frame_enter_handler(struct widget *widget, static int frame_motion_handler(struct widget *widget, struct input *input, uint32_t time, - int32_t x, int32_t y, void *data) + GLfloat x, GLfloat y, void *data) { return frame_get_pointer_image_for_location(data, input); } @@ -1439,7 +1439,7 @@ frame_destroy(struct frame *frame) static void input_set_focus_widget(struct input *input, struct widget *focus, - int32_t x, int32_t y) + GLfloat x, GLfloat y) { struct widget *old, *widget; int pointer = POINTER_LEFT_PTR; @@ -2458,7 +2458,7 @@ menu_set_item(struct menu *menu, int sy) static int menu_motion_handler(struct widget *widget, struct input *input, uint32_t time, - int32_t x, int32_t y, void *data) + GLfloat x, GLfloat y, void *data) { struct menu *menu = data; @@ -2470,7 +2470,7 @@ menu_motion_handler(struct widget *widget, static int menu_enter_handler(struct widget *widget, - struct input *input, int32_t x, int32_t y, void *data) + struct input *input, GLfloat x, GLfloat y, void *data) { struct menu *menu = data; diff --git a/clients/window.h b/clients/window.h index 1dd5f0c..ac52935 100644 --- a/clients/window.h +++ b/clients/window.h @@ -23,6 +23,7 @@ #ifndef _WINDOW_H_ #define _WINDOW_H_ +#include <GLES2/gl2.h> #include <xkbcommon/xkbcommon.h> #include <wayland-client.h> #include <cairo.h> @@ -165,7 +166,7 @@ typedef void (*window_keyboard_focus_handler_t)(struct window *window, typedef void (*window_data_handler_t)(struct window *window, struct input *input, - int32_t x, int32_t y, + GLfloat x, GLfloat y, const char **types, void *data); @@ -182,12 +183,12 @@ typedef void (*widget_redraw_handler_t)(struct widget *widget, void *data); typedef int (*widget_enter_handler_t)(struct widget *widget, struct input *input, - int32_t x, int32_t y, void *data); + GLfloat x, GLfloat y, void *data); typedef void (*widget_leave_handler_t)(struct widget *widget, struct input *input, void *data); typedef int (*widget_motion_handler_t)(struct widget *widget, struct input *input, uint32_t time, - int32_t x, int32_t y, void *data); + GLfloat x, GLfloat y, void *data); typedef void (*widget_button_handler_t)(struct widget *widget, struct input *input, uint32_t time, uint32_t button, uint32_t state, |