diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-01-09 10:34:35 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-01-09 10:34:35 -0500 |
commit | 87a57bbd7359926baac2c1d8db3315ab43fa2846 (patch) | |
tree | 0a783724d94be31734d912f6e53f2601c6672458 /clients/smoke.c | |
parent | 5f190ef96a742af51c6fb6dfe9ed82cdcb51a355 (diff) | |
download | weston-87a57bbd7359926baac2c1d8db3315ab43fa2846.tar.gz |
window: Create a widget for the window, drop window motion handler
Diffstat (limited to 'clients/smoke.c')
-rw-r--r-- | clients/smoke.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/clients/smoke.c b/clients/smoke.c index 6ceade05..47f9ca5d 100644 --- a/clients/smoke.c +++ b/clients/smoke.c @@ -213,27 +213,25 @@ frame_callback(void *data, struct wl_callback *callback, uint32_t time) } static int -smoke_motion_handler(struct window *window, - struct input *input, uint32_t time, - int32_t x, int32_t y, - int32_t surface_x, int32_t surface_y, void *data) +smoke_motion_handler(struct widget *widget, struct input *input, + uint32_t time, int32_t x, int32_t y, void *data) { struct smoke *smoke = data; int i, i0, i1, j, j0, j1, k, d = 5; - if (surface_x - d < 1) + if (x - d < 1) i0 = 1; else - i0 = surface_x - d; + i0 = x - d; if (i0 + 2 * d > smoke->width - 1) i1 = smoke->width - 1; else i1 = i0 + 2 * d; - if (surface_y - d < 1) + if (y - d < 1) j0 = 1; else - j0 = surface_y - d; + j0 = y - d; if (j0 + 2 * d > smoke->height - 1) j1 = smoke->height - 1; else @@ -291,7 +289,7 @@ int main(int argc, char *argv[]) window_flush(smoke.window); - window_set_motion_handler(smoke.window, + widget_set_motion_handler(window_get_widget(smoke.window), smoke_motion_handler); window_set_user_data(smoke.window, &smoke); |