Add a drag and drop test client

This commit is contained in:
Kristian Høgsberg 2010-08-18 15:28:04 -04:00
parent eef08fbb1a
commit 9a686243b6
5 changed files with 352 additions and 127 deletions

View file

@ -50,6 +50,15 @@ cairo_surface_t *
display_create_surface(struct display *display,
struct rectangle *rectangle);
struct wl_buffer *
display_get_buffer_for_surface(struct display *display,
cairo_surface_t *surface);
cairo_surface_t *
display_get_pointer_surface(struct display *display, int pointer,
int *width, int *height,
int *hotspot_x, int *hotspot_y);
void
display_run(struct display *d);
@ -61,6 +70,21 @@ enum {
WINDOW_MODIFIER_MOD2 = 0x10,
};
enum pointer_type {
POINTER_BOTTOM_LEFT,
POINTER_BOTTOM_RIGHT,
POINTER_BOTTOM,
POINTER_DRAGGING,
POINTER_LEFT_PTR,
POINTER_LEFT,
POINTER_RIGHT,
POINTER_TOP_LEFT,
POINTER_TOP_RIGHT,
POINTER_TOP,
POINTER_IBEAM,
POINTER_HAND1,
};
typedef void (*window_resize_handler_t)(struct window *window, void *data);
typedef void (*window_redraw_handler_t)(struct window *window, void *data);
typedef void (*window_frame_handler_t)(struct window *window, uint32_t frame, uint32_t timestamp, void *data);
@ -70,6 +94,15 @@ typedef void (*window_key_handler_t)(struct window *window, uint32_t key, uint32
typedef void (*window_keyboard_focus_handler_t)(struct window *window,
struct input *device, void *data);
typedef void (*window_button_handler_t)(struct window *window,
struct input *input, uint32_t time,
int button, int state, void *data);
typedef int (*window_motion_handler_t)(struct window *window,
struct input *input, uint32_t time,
int32_t x, int32_t y,
int32_t sx, int32_t sy, void *data);
struct window *
window_create(struct display *display, const char *title,
int32_t x, int32_t y, int32_t width, int32_t height);
@ -129,6 +162,14 @@ void
window_set_key_handler(struct window *window,
window_key_handler_t handler);
void
window_set_button_handler(struct window *window,
window_button_handler_t handler);
void
window_set_motion_handler(struct window *window,
window_motion_handler_t handler);
void
window_set_keyboard_focus_handler(struct window *window,
window_keyboard_focus_handler_t handler);
@ -141,4 +182,11 @@ void
window_set_frame_handler(struct window *window,
window_frame_handler_t handler);
void
window_start_drag(struct window *window, struct input *input, uint32_t time,
struct wl_buffer *buffer, int32_t x, int32_t y);
void
input_get_position(struct input *input, int32_t *x, int32_t *y);
#endif