Replaced all direct curses calls with screen_xx() wrappers. This should

enable us to optionally use termcap directly.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1535 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-06-01 21:49:07 +00:00 committed by cras
commit 05777636a7
13 changed files with 238 additions and 132 deletions

View file

@ -1,16 +1,7 @@
#ifndef __SCREEN_H
#define __SCREEN_H
#if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
# include <ncurses.h>
#else
# include <curses.h>
#endif
/* Some curseses include term.h, which #defines some things breaking irssi */
#undef lines
#undef key_backspace
#undef tab
typedef struct _SCREEN_WINDOW SCREEN_WINDOW;
#define ATTR_UNDERLINE 0x100
#define ATTR_COLOR8 0x200
@ -25,22 +16,43 @@
*/
#ifdef WANT_BIG5
/* XXX I didn't check the encoding range of big5+. This is standard big5. */
#define is_big5_los(lo) (((char)0x40<=lo)&&(lo<=(char)0x7E)) /* standard */
#define is_big5_lox(lo) (((char)0x80<=lo)&&(lo<=(char)0xFE)) /* extended */
#define is_big5_hi(hi) (((char)0x81<=hi)&&(hi<=(char)0xFE))
#define is_big5(hi,lo) is_big5_hi(hi) && (is_big5_los(lo) || is_big5_lox(lo))
# define is_big5_los(lo) (((char)0x40<=lo)&&(lo<=(char)0x7E)) /* standard */
# define is_big5_lox(lo) (((char)0x80<=lo)&&(lo<=(char)0xFE)) /* extended */
# define is_big5_hi(hi) (((char)0x81<=hi)&&(hi<=(char)0xFE))
# define is_big5(hi,lo) is_big5_hi(hi) && (is_big5_los(lo) || is_big5_lox(lo))
#endif
extern SCREEN_WINDOW *screen_root;
extern int screen_width, screen_height;
int init_screen(void); /* Initialize screen, detect screen length */
void deinit_screen(void); /* Deinitialize screen */
void set_color(WINDOW *window, int col);
void set_bg(WINDOW *window, int col);
int screen_has_colors(void);
void screen_clear(void);
void move_cursor(int y, int x);
SCREEN_WINDOW *screen_window_create(int x, int y, int width, int height);
void screen_window_destroy(SCREEN_WINDOW *window);
void screen_window_clear(SCREEN_WINDOW *window);
void screen_window_move(SCREEN_WINDOW *window, int x, int y,
int width, int height);
void screen_window_scroll(SCREEN_WINDOW *window, int count);
void screen_set_color(SCREEN_WINDOW *window, int col);
void screen_set_bg(SCREEN_WINDOW *window, int col);
void screen_move(SCREEN_WINDOW *window, int x, int y);
void screen_addch(SCREEN_WINDOW *window, int chr);
void screen_addstr(SCREEN_WINDOW *window, char *str);
void screen_clrtoeol(SCREEN_WINDOW *window);
void screen_move_cursor(int x, int y);
void screen_refresh_freeze(void);
void screen_refresh_thaw(void);
void screen_refresh(WINDOW *window);
void screen_refresh(SCREEN_WINDOW *window);
int screen_getch(void);
#endif