This commit is contained in:
Kovid Goyal
2016-11-20 14:11:46 +05:30
parent e3bbb7a3c9
commit 5636971999

View File

@@ -116,14 +116,6 @@ dealloc(Screen* self) {
Py_TYPE(self)->tp_free((PyObject*)self);
} // }}}
void screen_bell(Screen UNUSED *self, uint8_t ch) { // {{{
FILE *f = fopen("/dev/tty", "w");
if (f != NULL) {
fwrite(&ch, 1, 1, f);
fclose(f);
}
} // }}}
// Draw text {{{
void screen_shift_out(Screen *self, uint8_t UNUSED ch) {
@@ -792,6 +784,14 @@ void screen_erase_characters(Screen *self, unsigned int count) {
// Device control {{{
void screen_bell(Screen UNUSED *self, uint8_t ch) {
FILE *f = fopen("/dev/tty", "w");
if (f != NULL) {
fwrite(&ch, 1, 1, f);
fclose(f);
}
}
static inline void callback(const char *name, Screen *self, const char *data, unsigned int sz) {
if (sz) PyObject_CallMethod(self->callbacks, name, "y#", data, sz);
else PyObject_CallMethod(self->callbacks, name, "y", data);