diff options
Diffstat (limited to 'src/tk/widget.h')
-rw-r--r-- | src/tk/widget.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tk/widget.h b/src/tk/widget.h index a5634a5..e1826d2 100644 --- a/src/tk/widget.h +++ b/src/tk/widget.h @@ -43,6 +43,8 @@ struct mftk_widget { void (*layout)(struct mftk_widget *); void (*index)(struct mftk_widget *, struct mftk_window *); + void (*focus)(struct mftk_widget *); + void (*defocus)(struct mftk_widget *); int (*key_event)(struct mftk_widget *, SDL_Event *); int (*mouse_event)(struct mftk_widget *, SDL_Event *, int, int); @@ -79,6 +81,8 @@ mftk_widget_new(size_t size); return NULL; \ }; \ w->layout = &_mftk_##name##_layout; \ + w->focus = &_mftk_##name##_focus; \ + w->defocus = &_mftk_##name##_defocus; \ w->key_event = &_mftk_##name##_key_event; \ w->mouse_event = &_mftk_##name##_mouse_event; \ w->render = &_mftk_##name##_render; \ @@ -114,6 +118,12 @@ mftk_widget_layout(struct mftk_widget *w); void mftk_widget_index(struct mftk_widget *w, struct mftk_window *win); +void +mftk_widget_focus(struct mftk_widget *w); + +void +mftk_widget_defocus(struct mftk_widget *w); + int mftk_widget_mouse_event(struct mftk_widget *w, SDL_Event *e, int x, int y); |