35#define AS_MAX_SCREEN_COUNT 256
37#define GET_SCR_IDX(name) (general_hash(name) % AS_MAX_SCREEN_COUNT)
40#define LOCAL_ARROW_YMOVE 0
42#define LOCAL_ARROW_XMOVE 1
46#define LOCAL_LINE_INSERT 3
48#define LOCAL_LINE_DELETION 4
50#define LOCAL_BUFFER_MOVE 5
52#define LOCAL_BUFFER_CHAR 6
54#define LOCAL_WINDOW_MOVE 7
56#define LOCAL_WINDOW_SELECTION 8
58#define LOCAL_BUFFER_MOVE_LINE 9
60#define LOCAL_FILE_LOAD 10
62#define LOCAL_FILE_SAVE 11
64#define LOCAL_COLDESC_SWITCH 12
67#define IN_BOUND(x, y, bound) \
68 (x >= bound.x && x <= bound.x + bound.w) && \
69 (y >= bound.y && y <= bound.y + bound.h)
76#define SCR_OPT_ON_UPDATE (1 << 0)
82#define SCR_OPT_ALWAYS (1 << 1)
int register_screen(char *name, void(*render)(struct AS_RenderCtx *), void(*update)(struct AS_RenderCtx *), void(*local)(int, int))
Definition interface.c:63
void draw_border(struct AS_Bound bound)
Definition interface.c:78
int switch_to_last_screen()
Definition interface.c:50
int switch_to_screen(char *name)
Definition interface.c:38
bool update
Definition main.c:53
Definition interface.h:89
int x
Starting X.
Definition interface.h:91
int h
Height.
Definition interface.h:97
int y
Starting Y.
Definition interface.h:93
int w
Width.
Definition interface.h:95
Definition interface.h:105
int max_x
Maximum X-position.
Definition interface.h:107
int max_y
Maximum Y-position.
Definition interface.h:109
Definition interface.h:117
void(* update)(struct AS_RenderCtx *)
Function to call to update the screen.
Definition interface.h:121
char * name
ASCII name of the screen.
Definition interface.h:126
void(* render)(struct AS_RenderCtx *)
Function to call to render the screen.
Definition interface.h:119
void(* local)(int, int)
Function to call to interrupt the screen with input.
Definition interface.h:123