xurses/xurses.h
2023-10-02 16:26:22 -04:00

59 lines
1.9 KiB
C

/*
* 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>
#define CURSES_LENGTH ((int) sizeof ("\033[-;3-m-\033[0m") - 1)
#define CURSES_OFFSET ((int) sizeof ("\033[H") - 1)
#define CURSES_RETURN ((int) sizeof ("\r\n") - 1)
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;
extern char curses_format [CURSES_LENGTH + 1];
extern void (* curses_action ['~' - ' ' + 1]) (void);
extern struct termios curses_old_terminal;
extern struct termios curses_new_terminal;
extern void curses_initialize (void);
extern void curses_deinitialize (void);
extern void curses_synchronize (void);
extern void curses_screen_offset (void);
extern char * curses_screen_position (int, int);
extern char * curses_format_character (char, int, int);
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);*/
extern void curses_blank (void);
extern void curses_bind (char, void (*) (void));
extern void curses_unbind (char);
extern void curses_idle (void);
extern void curses_exit (void);
#endif