/* $MirOS: contrib/code/jupp/scrn.h,v 1.4 2012/12/30 17:10:58 tg Exp $ */ /* * Device independant tty interface for JOE * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_SCRN_H #define _JOE_SCRN_H 1 #include "config.h" #include "types.h" #include "tty.h" /* ttputc() */ extern int skiptop; /* SCRN *nopen(void); * * Open the screen (sets TTY mode so that screen may be used immediatly after * the 'nopen'). */ SCRN *nopen PARAMS((CAP *cap)); /* void nresize(SCRN *t,int w,int h); * * Change size of screen. For example, call this when you find out that * the Xterm changed size. */ void nresize PARAMS((SCRN *t, int w, int h)); /* void nredraw(SCRN *t); * * Invalidate all state variables for the terminal. This way, everything gets * redrawn. */ void nredraw PARAMS((SCRN *t)); void npartial PARAMS((SCRN *t)); void nescape PARAMS((SCRN *t)); void nreturn PARAMS((SCRN *t)); /* void nclose(SCRN *t); * * Close the screen and restore TTY to initial state. * * if 'flg' is set, tclose doesn't mess with the signals. */ void nclose PARAMS((SCRN *t)); /* int cpos(SCRN *t,int x,int y); * * Set cursor position */ int cpos PARAMS((register SCRN *t, register int x, register int y)); /* int attr(SCRN *t,int a); * * Set attributes */ int set_attr PARAMS((SCRN *t, int c)); /* Encode character as utf8 */ void utf8_putc PARAMS((int c)); /* void outatr(SCRN *t,int *scrn,int *attr,int x,int y,int c,int a); * * Output a character at the given screen cooridinate. The cursor position * after this function is executed is indeterminate. */ /* Character attribute bits */ #ifdef __MSDOS__ #define INVERSE 1 #define UNDERLINE 2 #define BOLD 4 #define BLINK 8 #define DIM 16 extern unsigned atab[]; #define outatr(t,scrn,attr,x,y,c,a) do { \ (t); \ (x); \ (y); \ *(scrn) = ((unsigned)(c) | atab[a]); \ } while(0) #else #define INVERSE 256 #define UNDERLINE 512 #define BOLD 1024 #define BLINK 2048 #define DIM 4096 #define AT_MASK (INVERSE+UNDERLINE+BOLD+BLINK+DIM) #define BG_SHIFT 13 #define BG_VALUE (7<