From 62fc6cc4a0d5bb68250890073cb3e7ee3c1605cc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Nov 2016 17:35:24 +0530 Subject: [PATCH] Get it compiling again --- kitty/parser.c | 18 ++++++++++++++---- kitty/screen.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/kitty/parser.c b/kitty/parser.c index 71d7126d3..fdd268aed 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -26,6 +26,7 @@ DECLARE_CH_SCREEN_HANDLER(shift_out) DECLARE_CH_SCREEN_HANDLER(shift_in) extern bool screen_draw(Screen *screen, uint8_t *buf, unsigned int buflen); +// Parse text {{{ static inline bool read_text(Screen *screen, uint8_t *buf, unsigned int buflen, unsigned int *pos) { bool ret; @@ -82,30 +83,39 @@ read_text(Screen *screen, uint8_t *buf, unsigned int buflen, unsigned int *pos) DRAW_TEXT; return true; } +// }}} +// Parse ESC {{{ static inline bool -read_esc(Screen *screen, uint8_t *buf, unsigned int buflen, unsigned int *pos) { +read_esc(Screen *screen, uint8_t UNUSED *buf, unsigned int UNUSED buflen, unsigned int UNUSED *pos) { screen->parser_state = NORMAL_STATE; return true; } +// }}} +// Parse CSI {{{ static inline bool -read_csi(Screen *screen, uint8_t *buf, unsigned int buflen, unsigned int *pos) { +read_csi(Screen *screen, uint8_t UNUSED *buf, unsigned int UNUSED buflen, unsigned int UNUSED *pos) { screen->parser_state = NORMAL_STATE; return true; } +// }}} +// Parse OSC {{{ static inline bool -read_osc(Screen *screen, uint8_t *buf, unsigned int buflen, unsigned int *pos) { +read_osc(Screen *screen, uint8_t UNUSED *buf, unsigned int UNUSED buflen, unsigned int UNUSED *pos) { screen->parser_state = NORMAL_STATE; return true; } +// }}} +// Parse DCS {{{ static inline bool -read_dcs(Screen *screen, uint8_t *buf, unsigned int buflen, unsigned int *pos) { +read_dcs(Screen *screen, uint8_t UNUSED *buf, unsigned int UNUSED buflen, unsigned int UNUSED *pos) { screen->parser_state = NORMAL_STATE; return true; } +// }}} PyObject* #ifdef DUMP_COMMANDS diff --git a/kitty/screen.c b/kitty/screen.c index 746a7834a..d35835832 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -44,6 +44,50 @@ dealloc(Screen* self) { Py_TYPE(self)->tp_free((PyObject*)self); } +bool screen_bell(Screen UNUSED *scr, uint8_t ch) { + FILE *f = fopen("/dev/tty", "w"); + if (f != NULL) { + fwrite(&ch, 1, 1, f); + fclose(f); + } + return true; +} + +bool screen_draw(Screen UNUSED *scr, uint8_t UNUSED ch) { + // TODO: Implement this + return true; +} + +bool screen_backspace(Screen UNUSED *scr, uint8_t UNUSED ch) { + // TODO: Implement this + return true; +} + +bool screen_tab(Screen UNUSED *scr, uint8_t UNUSED ch) { + // TODO: Implement this + return true; +} + + +bool screen_linefeed(Screen UNUSED *scr, uint8_t UNUSED ch) { + // TODO: Implement this + return true; +} + +bool screen_carriage_return(Screen UNUSED *scr, uint8_t UNUSED ch) { + // TODO: Implement this + return true; +} + +bool screen_shift_out(Screen UNUSED *scr, uint8_t UNUSED ch) { + // TODO: Implement this + return true; +} + +bool screen_shift_in(Screen UNUSED *scr, uint8_t UNUSED ch) { + // TODO: Implement this + return true; +} // Boilerplate {{{