-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmt-screen.h
40 lines (32 loc) · 961 Bytes
/
mt-screen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: LGPL-2.1-or-later
/*
* Copyright (C) 2019-2022 Cyril Hrubis <[email protected]>
*/
#ifndef MT_SCREEN__
#define MT_SCREEN__
#include "mt-common.h"
struct mt_screen {
void (*damage)(void *priv, mt_coord s_col, mt_coord s_row, mt_coord e_col, mt_coord e_row);
void (*scroll)(void *priv, int lines);
void (*cursor)(mt_coord col, mt_coord row, uint8_t set);
void (*erase)(mt_coord o_col, mt_coord o_row, mt_coord n_col, mt_coord n_row);
void *priv;
};
struct mt_damage {
mt_coord s_col, s_row;
mt_coord e_col, e_row;
int scroll;
};
static inline void mt_damage_reset(struct mt_damage *self)
{
self->s_col = -1;
self->e_col = -1;
self->s_row = -1;
self->e_row = -1;
self->scroll = 0;
}
void mt_damage_merge(struct mt_damage *self,
mt_coord s_col, mt_coord s_row,
mt_coord e_col, mt_coord e_row);
void mt_damage_scroll(struct mt_damage *self, int lines);
#endif /* MT_SCREEN__ */