diff options
| author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2018-05-16 09:01:02 +0000 |
|---|---|---|
| committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2018-05-16 09:01:02 +0000 |
| commit | 547e74a8be76e2d9fcaa1c4c9b31225044f70963 (patch) | |
| tree | 889e1c01e5b6d41052a7652c0c5ee93179236ac7 /sys/teken | |
| parent | c9c4d38aa84d87a4d24a7857e98bfa7b6dff1f68 (diff) | |
Notes
Diffstat (limited to 'sys/teken')
| -rw-r--r-- | sys/teken/teken.c | 18 | ||||
| -rw-r--r-- | sys/teken/teken.h | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sys/teken/teken.c b/sys/teken/teken.c index 28fdb7a791bb..a356aa192ecf 100644 --- a/sys/teken/teken.c +++ b/sys/teken/teken.c @@ -133,6 +133,22 @@ teken_funcs_copy(const teken_t *t, const teken_rect_t *r, const teken_pos_t *p) } static inline void +teken_funcs_pre_input(const teken_t *t) +{ + + teken_assert(t->t_funcs->tf_pre_input != NULL); + t->t_funcs->tf_pre_input(t->t_softc); +} + +static inline void +teken_funcs_post_input(const teken_t *t) +{ + + teken_assert(t->t_funcs->tf_post_input != NULL); + t->t_funcs->tf_post_input(t->t_softc); +} + +static inline void teken_funcs_param(const teken_t *t, int cmd, unsigned int value) { @@ -292,8 +308,10 @@ teken_input(teken_t *t, const void *buf, size_t len) { const char *c = buf; + teken_funcs_pre_input(t); while (len-- > 0) teken_input_byte(t, *c++); + teken_funcs_post_input(t); } const teken_pos_t * diff --git a/sys/teken/teken.h b/sys/teken/teken.h index 570812505a4a..0186fedb20d5 100644 --- a/sys/teken/teken.h +++ b/sys/teken/teken.h @@ -93,6 +93,8 @@ typedef void tf_putchar_t(void *, const teken_pos_t *, teken_char_t, typedef void tf_fill_t(void *, const teken_rect_t *, teken_char_t, const teken_attr_t *); typedef void tf_copy_t(void *, const teken_rect_t *, const teken_pos_t *); +typedef void tf_pre_input_t(void *); +typedef void tf_post_input_t(void *); typedef void tf_param_t(void *, int, unsigned int); #define TP_SHOWCURSOR 0 #define TP_KEYPADAPP 1 @@ -114,6 +116,8 @@ typedef struct { tf_putchar_t *tf_putchar; tf_fill_t *tf_fill; tf_copy_t *tf_copy; + tf_pre_input_t *tf_pre_input; + tf_post_input_t *tf_post_input; tf_param_t *tf_param; tf_respond_t *tf_respond; } teken_funcs_t; |
