Fill in a few blanks

This commit is contained in:
Kovid Goyal 2016-11-13 22:33:58 +05:30
parent a734fb79e6
commit 3e3f140452
2 changed files with 16 additions and 4 deletions

View File

@ -296,6 +296,7 @@ void linebuf_set_attribute(LineBuf *, unsigned int , unsigned int );
void screen_restore_cursor(Screen *);
void screen_save_cursor(Screen *);
void screen_cursor_position(Screen*, unsigned int, unsigned int);
void screen_cursor_back(Screen *self, unsigned int count/*=1*/, int move_direction/*=-1*/);
void screen_erase_in_display(Screen *, unsigned int, bool);
void screen_draw(Screen *screen, uint8_t *buf, unsigned int buflen);
void screen_ensure_bounds(Screen *self, bool use_margins);

View File

@ -170,19 +170,30 @@ void screen_draw(Screen *self, uint8_t *buf, unsigned int buflen) {
// }}}
void screen_backspace(Screen UNUSED *self, uint8_t UNUSED ch) {
// TODO: Implement this
screen_cursor_back(self, 1, -1);
}
void screen_tab(Screen UNUSED *self, uint8_t UNUSED ch) {
// TODO: Implement this
// Move to the next tab space, or the end of the screen if there aren't anymore left.
unsigned int found = 0;
for (unsigned int i = self->cursor->x + 1; i < self->columns; i++) {
if (self->tabstops[i]) { found = i; break; }
}
if (!found) found = self->columns - 1;
if (found != (unsigned int)self->cursor->x) {
self->cursor->x = found;
tracker_cursor_changed(self->change_tracker);
}
}
void screen_shift_out(Screen UNUSED *self, uint8_t UNUSED ch) {
// TODO: Implement this
self->current_charset = 1;
self->utf8_state = 0;
}
void screen_shift_in(Screen UNUSED *self, uint8_t UNUSED ch) {
// TODO: Implement this
self->current_charset = 0;
self->utf8_state = 0;
}
// Graphics {{{