2023-08-28 18:52:28 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023 : Ognjen 'xolatile' Milan Robovic
|
|
|
|
*
|
|
|
|
* Xurses is free software! You will redistribute it or modify it under the terms of the GNU General Public License by Free Software Foundation.
|
|
|
|
* And when you do redistribute it or modify it, it will use either version 3 of the License, or (at yours truly opinion) any later version.
|
|
|
|
* It is distributed in the hope that it will be useful or harmful, it really depends... But no warranty what so ever, seriously. See GNU/GPLv3.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef XURSES_HEADER
|
|
|
|
#define XURSES_HEADER
|
|
|
|
|
|
|
|
#include <xolatile/xtandard.h>
|
|
|
|
|
|
|
|
#include <termios.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2023-09-20 06:00:37 -04:00
|
|
|
#define CURSES_LENGTH ((int) sizeof ("\033[-;3-m-\033[0m") - 1)
|
|
|
|
#define CURSES_OFFSET ((int) sizeof ("\033[H") - 1)
|
2023-09-20 07:46:24 -04:00
|
|
|
#define CURSES_RETURN ((int) sizeof ("\r\n") - 1)
|
2023-09-20 06:00:37 -04:00
|
|
|
|
2023-08-28 18:52:28 -04:00
|
|
|
extern int curses_active;
|
|
|
|
extern int curses_cursor;
|
|
|
|
extern char curses_signal;
|
|
|
|
extern int curses_screen_width;
|
|
|
|
extern int curses_screen_height;
|
|
|
|
extern int curses_screen_size;
|
|
|
|
extern char * curses_screen;
|
|
|
|
|
2023-09-20 06:00:37 -04:00
|
|
|
extern char curses_format [CURSES_LENGTH + 1];
|
|
|
|
|
2023-10-04 17:49:10 -04:00
|
|
|
extern void (* curses_action [SIGNAL_COUNT]) (void);
|
2023-08-28 18:52:28 -04:00
|
|
|
|
|
|
|
extern struct termios curses_old_terminal;
|
|
|
|
extern struct termios curses_new_terminal;
|
|
|
|
|
2023-10-04 17:49:10 -04:00
|
|
|
extern void curses_initialize (void);
|
|
|
|
extern void curses_deinitialize (void);
|
|
|
|
extern void curses_synchronize (void);
|
|
|
|
extern void curses_configure (void);
|
|
|
|
|
2023-09-20 06:00:37 -04:00
|
|
|
extern void curses_screen_offset (void);
|
|
|
|
|
|
|
|
extern char * curses_screen_position (int, int);
|
|
|
|
extern char * curses_format_character (char, int, int);
|
2023-08-28 18:52:28 -04:00
|
|
|
|
2023-09-20 06:00:37 -04:00
|
|
|
extern void curses_output_character (char, int, int);
|
|
|
|
extern void curses_render_character (char, int, int, int, int);
|
|
|
|
/*extern void curses_append_string (char *, int, int, int);
|
|
|
|
extern void curses_append_cursor (int, int);*/
|
2023-09-18 16:17:08 -04:00
|
|
|
extern void curses_blank (void);
|
2023-08-28 18:52:28 -04:00
|
|
|
|
2023-10-04 17:49:10 -04:00
|
|
|
extern void curses_bind (int, void (*) (void));
|
|
|
|
extern void curses_unbind (int);
|
2023-08-28 18:52:28 -04:00
|
|
|
|
|
|
|
extern void curses_idle (void);
|
|
|
|
extern void curses_exit (void);
|
|
|
|
|
|
|
|
#endif
|