|
|
@ -114,6 +114,16 @@ redraw_handler(struct window *window, void *data) |
|
|
|
view_draw(view); |
|
|
|
view_draw(view); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
|
|
resize_handler(struct window *window, |
|
|
|
|
|
|
|
int32_t width, int32_t height, void *data) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
struct view *view = data; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window_set_child_size(view->window, width, height); |
|
|
|
|
|
|
|
window_schedule_redraw(window); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
|
view_page_up(struct view *view) |
|
|
|
view_page_up(struct view *view) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -233,6 +243,7 @@ view_create(struct display *display, uint32_t key, const char *filename) |
|
|
|
|
|
|
|
|
|
|
|
window_set_user_data(view->window, view); |
|
|
|
window_set_user_data(view->window, view); |
|
|
|
window_set_redraw_handler(view->window, redraw_handler); |
|
|
|
window_set_redraw_handler(view->window, redraw_handler); |
|
|
|
|
|
|
|
window_set_resize_handler(view->window, resize_handler); |
|
|
|
window_set_key_handler(view->window, key_handler); |
|
|
|
window_set_key_handler(view->window, key_handler); |
|
|
|
window_set_keyboard_focus_handler(view->window, |
|
|
|
window_set_keyboard_focus_handler(view->window, |
|
|
|
keyboard_focus_handler); |
|
|
|
keyboard_focus_handler); |
|
|
|