Changeset View
Changeset View
Standalone View
Standalone View
sys/teken/teken.c
Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | teken_funcs_copy(const teken_t *t, const teken_rect_t *r, const teken_pos_t *p) | ||||
teken_assert(p->tp_row + (r->tr_end.tp_row - r->tr_begin.tp_row) <= t->t_winsize.tp_row); | teken_assert(p->tp_row + (r->tr_end.tp_row - r->tr_begin.tp_row) <= t->t_winsize.tp_row); | ||||
teken_assert(p->tp_col + (r->tr_end.tp_col - r->tr_begin.tp_col) <= t->t_winsize.tp_col); | teken_assert(p->tp_col + (r->tr_end.tp_col - r->tr_begin.tp_col) <= t->t_winsize.tp_col); | ||||
teken_assert(t->t_funcs->tf_copy != NULL); | teken_assert(t->t_funcs->tf_copy != NULL); | ||||
t->t_funcs->tf_copy(t->t_softc, r, p); | t->t_funcs->tf_copy(t->t_softc, r, p); | ||||
} | } | ||||
static inline void | static inline void | ||||
teken_funcs_video_lock(const teken_t *t) | |||||
{ | |||||
teken_assert(t->t_funcs->tf_video_lock != NULL); | |||||
t->t_funcs->tf_video_lock(t->t_softc); | |||||
} | |||||
static inline void | |||||
teken_funcs_video_unlock(const teken_t *t) | |||||
{ | |||||
teken_assert(t->t_funcs->tf_video_unlock != NULL); | |||||
t->t_funcs->tf_video_unlock(t->t_softc); | |||||
} | |||||
static inline void | |||||
teken_funcs_param(const teken_t *t, int cmd, unsigned int value) | teken_funcs_param(const teken_t *t, int cmd, unsigned int value) | ||||
{ | { | ||||
teken_assert(t->t_funcs->tf_param != NULL); | teken_assert(t->t_funcs->tf_param != NULL); | ||||
t->t_funcs->tf_param(t->t_softc, cmd, value); | t->t_funcs->tf_param(t->t_softc, cmd, value); | ||||
} | } | ||||
static inline void | static inline void | ||||
▲ Show 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | teken_input_byte(teken_t *t, unsigned char c) | ||||
} | } | ||||
} | } | ||||
void | void | ||||
teken_input(teken_t *t, const void *buf, size_t len) | teken_input(teken_t *t, const void *buf, size_t len) | ||||
{ | { | ||||
const char *c = buf; | const char *c = buf; | ||||
teken_funcs_video_lock(t); | |||||
while (len-- > 0) | while (len-- > 0) | ||||
teken_input_byte(t, *c++); | teken_input_byte(t, *c++); | ||||
teken_funcs_video_unlock(t); | |||||
} | } | ||||
const teken_pos_t * | const teken_pos_t * | ||||
teken_get_cursor(const teken_t *t) | teken_get_cursor(const teken_t *t) | ||||
{ | { | ||||
return (&t->t_cursor); | return (&t->t_cursor); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 419 Lines • Show Last 20 Lines |