Main Page | Class List | File List | Class Members | File Members

display.h

Go to the documentation of this file.
00001 /* Copyright (c) 1993-2002
00002  *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
00003  *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
00004  * Copyright (c) 1987 Oliver Laumann
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program (see the file COPYING); if not, write to the
00018  * Free Software Foundation, Inc.,
00019  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
00020  *
00021  ****************************************************************
00022  * $Id: display.h,v 1.9 1994/05/31 12:31:54 mlschroe Exp $ FAU
00023  */
00024 
00025 #ifdef MAPKEYS
00026 
00027 #define KMAP_KEYS (T_OCAPS-T_CAPS)
00028 #define KMAP_AKEYS (T_OCAPS-T_CURSOR)
00029 #define KMAP_EXT 50
00030 
00031 #define KMAP_NOTIMEOUT 0x4000
00032 
00033 struct kmap_ext
00034 {
00035   char *str;
00036   int fl;
00037   struct action um;
00038   struct action dm;
00039   struct action mm;
00040 };
00041 
00042 #endif
00043 
00044 struct win;                     /* forward declaration */
00045 
00046 struct canvas
00047 {
00048   struct canvas   *c_next;      /* next canvas on display */
00049   struct display  *c_display;   /* back pointer to display */
00050   struct viewport *c_vplist;
00051   struct layer    *c_layer;     /* layer on this canvas */
00052   struct canvas   *c_lnext;     /* next canvas that displays layer */
00053   struct layer     c_blank;     /* bottom layer, always blank */
00054   int              c_xoff;      /* canvas x offset on display */
00055   int              c_yoff;      /* canvas y offset on display */
00056   int              c_xs;
00057   int              c_xe;
00058   int              c_ys;
00059   int              c_ye;
00060   struct event     c_captev;    /* caption changed event */
00061 };
00062 
00063 struct viewport
00064 {
00065   struct viewport *v_next;      /* next vp on canvas */
00066   struct canvas   *v_canvas;    /* back pointer to canvas */
00067   int              v_xoff;      /* layer x offset on display */
00068   int              v_yoff;      /* layer y offset on display */
00069   int              v_xs;        /* vp upper left */
00070   int              v_xe;        /* vp upper right */
00071   int              v_ys;        /* vp lower left */
00072   int              v_ye;        /* vp lower right */
00073 };
00074 
00075 struct display
00076 {
00077   struct display *d_next;       /* linked list */
00078   struct acluser *d_user;               /* user who owns that display */
00079   struct canvas *d_cvlist;      /* the canvases of this display */
00080   struct canvas *d_forecv;      /* current input focus */
00081   void (*d_processinput) __P((char *, int));
00082   char *d_processinputdata;     /* data for processinput */
00083   int d_vpxmin, d_vpxmax;       /* min/max used position on display */
00084   struct win *d_fore;           /* pointer to fore window */
00085   struct win *d_other;          /* pointer to other window */
00086   int   d_nonblock;             /* -1 don't block if obufmax reached */
00087                                 /* >0: block after nonblock secs */
00088   char  d_termname[20 + 1];     /* $TERM */
00089   char  *d_tentry;              /* buffer for tgetstr */
00090   char  d_tcinited;             /* termcap inited flag */
00091   int   d_width, d_height;      /* width/height of the screen */
00092   int   d_defwidth, d_defheight;        /* default width/height of windows */
00093   int   d_top, d_bot;           /* scrollregion start/end */
00094   int   d_x, d_y;               /* cursor position */
00095   struct mchar d_rend;          /* current rendition */
00096   int   d_col16change;          /* the 16col bits changed in attr */
00097   char  d_atyp;                 /* current attribute types */
00098 #ifdef DW_CHARS
00099   int   d_mbcs;                 /* saved char for multibytes charset */
00100 #endif
00101 #ifdef ENCODINGS
00102   int   d_encoding;             /* what encoding type the display is */
00103   int   d_decodestate;          /* state of our decoder */
00104   int   d_realfont;             /* real font of terminal */
00105 #endif
00106   int   d_insert;               /* insert mode flag */
00107   int   d_keypad;               /* application keypad flag */
00108   int   d_cursorkeys;           /* application cursorkeys flag */
00109   int   d_revvid;               /* reverse video */
00110   int   d_curvis;               /* cursor visibility */
00111   int   d_has_hstatus;          /* display has hardstatus line */
00112   int   d_hstatus;              /* hardstatus used */
00113   int   d_lp_missing;           /* last character on bot line missing */
00114   int   d_mouse;                /* mouse mode */
00115 #ifdef RXVT_OSC
00116   int   d_xtermosc[4];          /* osc used */
00117 #endif
00118   struct mchar d_lpchar;        /* missing char */
00119   struct timeval d_status_time; /* time of status display */
00120   int   d_status;               /* is status displayed? */
00121   char  d_status_bell;          /* is it only a vbell? */
00122   int   d_status_len;           /* length of status line */
00123   char *d_status_lastmsg;       /* last displayed message */
00124   int   d_status_buflen;        /* last message buffer len */
00125   int   d_status_lastx;         /* position of the cursor */
00126   int   d_status_lasty;         /*   before status was displayed */
00127   int   d_status_obuflen;       /* saved obuflen */ 
00128   int   d_status_obuffree;      /* saved obuffree */ 
00129   struct event d_statusev;      /* timeout event */
00130   struct event d_hstatusev;     /* hstatus changed event */
00131   int   d_kaablamm;             /* display kaablamm msg */
00132   struct action *d_ESCseen;     /* Was the last char an ESC (^a) */
00133   int   d_userpid;              /* pid of attacher */
00134   char  d_usertty[MAXPATHLEN];  /* tty we are attached to */
00135   int   d_userfd;               /* fd of the tty */
00136   struct event d_readev;        /* userfd read event */
00137   struct event d_writeev;       /* userfd write event */
00138   struct event d_blockedev;     /* blocked timeout */
00139   struct mode d_OldMode;        /* tty mode when screen was started */
00140   struct mode d_NewMode;        /* New tty mode */
00141   int   d_flow;                 /* tty's flow control on/off flag*/
00142   int   d_intrc;                /* current intr when flow is on */
00143   char *d_obuf;                 /* output buffer */
00144   int   d_obuflen;              /* len of buffer */
00145   int   d_obufmax;              /* len where we are blocking the pty */
00146   int   d_obuflenmax;           /* len - max */
00147   char *d_obufp;                /* pointer in buffer */
00148   int   d_obuffree;             /* free bytes in buffer */
00149 #ifdef AUTO_NUKE
00150   int   d_auto_nuke;            /* autonuke flag */
00151 #endif
00152 #ifdef MAPKEYS
00153   int   d_nseqs;                /* number of valid mappings */
00154   int   d_aseqs;                /* number of allocated mappings */
00155   unsigned char  *d_kmaps;      /* keymaps */
00156   unsigned char *d_seqp;        /* pointer into keymap array */
00157   int   d_seql;                 /* number of parsed chars */
00158   unsigned char *d_seqh;        /* last hit */
00159   struct event d_mapev;         /* timeout event */
00160   int   d_dontmap;              /* do not map next */
00161   int   d_mapdefault;           /* do map next to default */
00162 #endif
00163   union tcu d_tcs[T_N];         /* terminal capabilities */
00164   char *d_attrtab[NATTR];       /* attrib emulation table */
00165   char  d_attrtyp[NATTR];       /* attrib group table */
00166   int   d_hascolor;             /* do we support color */
00167   short d_dospeed;              /* baudrate of tty */
00168 #ifdef FONT
00169   char  d_c0_tab[256];          /* conversion for C0 */
00170   char ***d_xtable;             /* char translation table */
00171 #endif
00172   int   d_UPcost, d_DOcost, d_LEcost, d_NDcost;
00173   int   d_CRcost, d_IMcost, d_EIcost, d_NLcost;
00174   int   d_printfd;              /* fd for vt100 print sequence */
00175 #ifdef UTMPOK
00176   slot_t d_loginslot;           /* offset, where utmp_logintty belongs */
00177   struct utmp d_utmp_logintty;  /* here the original utmp structure is stored */
00178   int   d_loginttymode;
00179 # ifdef _SEQUENT_
00180   char  d_loginhost[100+1];
00181 # endif /* _SEQUENT_ */
00182 #endif
00183   int   d_blocked;
00184   int   d_blocked_fuzz;
00185   struct event d_idleev;        /* screen blanker */
00186 #ifdef BLANKER_PRG
00187   int   d_blankerpid;
00188   struct event d_blankerev;
00189 #endif
00190 };
00191 
00192 #ifdef MULTI
00193 # define DISPLAY(x) display->x
00194 #else
00195 extern struct display TheDisplay;
00196 # define DISPLAY(x) TheDisplay.x
00197 #endif
00198 
00199 #define D_user          DISPLAY(d_user)
00200 #define D_username      (DISPLAY(d_user) ? DISPLAY(d_user)->u_name : 0)
00201 #define D_cvlist        DISPLAY(d_cvlist)
00202 #define D_forecv        DISPLAY(d_forecv)
00203 #define D_processinput  DISPLAY(d_processinput)
00204 #define D_processinputdata      DISPLAY(d_processinputdata)
00205 #define D_vpxmin        DISPLAY(d_vpxmin)
00206 #define D_vpxmax        DISPLAY(d_vpxmax)
00207 #define D_fore          DISPLAY(d_fore)
00208 #define D_other         DISPLAY(d_other)
00209 #define D_nonblock      DISPLAY(d_nonblock)
00210 #define D_termname      DISPLAY(d_termname)
00211 #define D_tentry        DISPLAY(d_tentry)
00212 #define D_tcinited      DISPLAY(d_tcinited)
00213 #define D_width         DISPLAY(d_width)
00214 #define D_height        DISPLAY(d_height)
00215 #define D_defwidth      DISPLAY(d_defwidth)
00216 #define D_defheight     DISPLAY(d_defheight)
00217 #define D_top           DISPLAY(d_top)
00218 #define D_bot           DISPLAY(d_bot)
00219 #define D_x             DISPLAY(d_x)
00220 #define D_y             DISPLAY(d_y)
00221 #define D_rend          DISPLAY(d_rend)
00222 #define D_col16change   DISPLAY(d_col16change)
00223 #define D_atyp          DISPLAY(d_atyp)
00224 #define D_mbcs          DISPLAY(d_mbcs)
00225 #define D_encoding      DISPLAY(d_encoding)
00226 #define D_decodestate   DISPLAY(d_decodestate)
00227 #define D_realfont      DISPLAY(d_realfont)
00228 #define D_insert        DISPLAY(d_insert)
00229 #define D_keypad        DISPLAY(d_keypad)
00230 #define D_cursorkeys    DISPLAY(d_cursorkeys)
00231 #define D_revvid        DISPLAY(d_revvid)
00232 #define D_curvis        DISPLAY(d_curvis)
00233 #define D_has_hstatus   DISPLAY(d_has_hstatus)
00234 #define D_hstatus       DISPLAY(d_hstatus)
00235 #define D_lp_missing    DISPLAY(d_lp_missing)
00236 #define D_mouse         DISPLAY(d_mouse)
00237 #define D_xtermosc      DISPLAY(d_xtermosc)
00238 #define D_lpchar        DISPLAY(d_lpchar)
00239 #define D_status        DISPLAY(d_status)
00240 #define D_status_time   DISPLAY(d_status_time)
00241 #define D_status_bell   DISPLAY(d_status_bell)
00242 #define D_status_len    DISPLAY(d_status_len)
00243 #define D_status_lastmsg        DISPLAY(d_status_lastmsg)
00244 #define D_status_buflen DISPLAY(d_status_buflen)
00245 #define D_status_lastx  DISPLAY(d_status_lastx)
00246 #define D_status_lasty  DISPLAY(d_status_lasty)
00247 #define D_status_obuflen        DISPLAY(d_status_obuflen)
00248 #define D_status_obuffree       DISPLAY(d_status_obuffree)
00249 #define D_statusev      DISPLAY(d_statusev)
00250 #define D_hstatusev     DISPLAY(d_hstatusev)
00251 #define D_kaablamm      DISPLAY(d_kaablamm)
00252 #define D_ESCseen       DISPLAY(d_ESCseen)
00253 #define D_userpid       DISPLAY(d_userpid)
00254 #define D_usertty       DISPLAY(d_usertty)
00255 #define D_userfd        DISPLAY(d_userfd)
00256 #define D_OldMode       DISPLAY(d_OldMode)
00257 #define D_NewMode       DISPLAY(d_NewMode)
00258 #define D_flow          DISPLAY(d_flow)
00259 #define D_intr          DISPLAY(d_intr)
00260 #define D_obuf          DISPLAY(d_obuf)
00261 #define D_obuflen       DISPLAY(d_obuflen)
00262 #define D_obufmax       DISPLAY(d_obufmax)
00263 #define D_obuflenmax    DISPLAY(d_obuflenmax)
00264 #define D_obufp         DISPLAY(d_obufp)
00265 #define D_obuffree      DISPLAY(d_obuffree)
00266 #define D_auto_nuke     DISPLAY(d_auto_nuke)
00267 #define D_nseqs         DISPLAY(d_nseqs)
00268 #define D_aseqs         DISPLAY(d_aseqs)
00269 #define D_seqp          DISPLAY(d_seqp)
00270 #define D_seql          DISPLAY(d_seql)
00271 #define D_seqh          DISPLAY(d_seqh)
00272 #define D_dontmap       DISPLAY(d_dontmap)
00273 #define D_mapdefault    DISPLAY(d_mapdefault)
00274 #define D_kmaps         DISPLAY(d_kmaps)
00275 #define D_tcs           DISPLAY(d_tcs)
00276 #define D_attrtab       DISPLAY(d_attrtab)
00277 #define D_attrtyp       DISPLAY(d_attrtyp)
00278 #define D_hascolor      DISPLAY(d_hascolor)
00279 #define D_dospeed       DISPLAY(d_dospeed)
00280 #define D_c0_tab        DISPLAY(d_c0_tab)
00281 #define D_xtable        DISPLAY(d_xtable)
00282 #define D_UPcost        DISPLAY(d_UPcost)
00283 #define D_DOcost        DISPLAY(d_DOcost)
00284 #define D_LEcost        DISPLAY(d_LEcost)
00285 #define D_NDcost        DISPLAY(d_NDcost)
00286 #define D_CRcost        DISPLAY(d_CRcost)
00287 #define D_IMcost        DISPLAY(d_IMcost)
00288 #define D_EIcost        DISPLAY(d_EIcost)
00289 #define D_NLcost        DISPLAY(d_NLcost)
00290 #define D_printfd       DISPLAY(d_printfd)
00291 #define D_loginslot     DISPLAY(d_loginslot)
00292 #define D_utmp_logintty DISPLAY(d_utmp_logintty)
00293 #define D_loginttymode  DISPLAY(d_loginttymode)
00294 #define D_loginhost     DISPLAY(d_loginhost)
00295 #define D_readev        DISPLAY(d_readev)
00296 #define D_writeev       DISPLAY(d_writeev)
00297 #define D_blockedev     DISPLAY(d_blockedev)
00298 #define D_mapev         DISPLAY(d_mapev)
00299 #define D_blocked       DISPLAY(d_blocked)
00300 #define D_blocked_fuzz  DISPLAY(d_blocked_fuzz)
00301 #define D_idleev        DISPLAY(d_idleev)
00302 #define D_blankerev     DISPLAY(d_blankerev)
00303 #define D_blankerpid    DISPLAY(d_blankerpid)
00304 
00305 
00306 #define GRAIN 4096      /* Allocation grain size for output buffer */
00307 #define OBUF_MAX 256    /* default for obuflimit */
00308 
00309 #define OUTPUT_BLOCK_SIZE 256  /* Block size of output to tty */
00310 
00311 #define AddChar(c)              \
00312 do                              \
00313   {                             \
00314     if (--D_obuffree <= 0)      \
00315       Resize_obuf();            \
00316     *D_obufp++ = (c);           \
00317   }                             \
00318 while (0)
00319 
00320 #define CV_CALL(cv, cmd)                        \
00321 {                                               \
00322   struct display *olddisplay = display;         \
00323   struct layer *oldflayer = flayer;             \
00324   struct layer *l = cv->c_layer;                \
00325   struct canvas *cvlist = l->l_cvlist;          \
00326   struct canvas *cvlnext = cv->c_lnext;         \
00327   flayer = l;                                   \
00328   l->l_cvlist = cv;                             \
00329   cv->c_lnext = 0;                              \
00330   cmd;                                          \
00331   flayer = oldflayer;                           \
00332   l->l_cvlist = cvlist;                         \
00333   cv->c_lnext = cvlnext;                        \
00334   display = olddisplay;                         \
00335 }
00336 
00337 #define STATUS_OFF      0
00338 #define STATUS_ON_WIN   1
00339 #define STATUS_ON_HS    2
00340 
00341 #define HSTATUS_IGNORE          0
00342 #define HSTATUS_LASTLINE        1
00343 #define HSTATUS_MESSAGE         2
00344 #define HSTATUS_HS              3
00345 #define HSTATUS_ALWAYS          (1<<2)

Generated on Sat Jul 2 20:56:16 2005 for GNU Screen by  doxygen 1.4.3