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

layer.h

Go to the documentation of this file.
00001 /* Copyright (c) 1995-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: overlay.h,v 1.3 1994/05/31 12:32:31 mlschroe Exp $ FAU
00023  */
00024 
00025 /*
00026  * This is the overlay structure. It is used to create a seperate
00027  * layer over the current windows.
00028  */
00029 
00030 struct mchar;   /* forward declaration */
00031 
00032 struct LayFuncs
00033 {
00034   void  (*lf_LayProcess) __P((char **, int *));
00035   void  (*lf_LayAbort) __P((void));
00036   void  (*lf_LayRedisplayLine) __P((int, int, int, int));
00037   void  (*lf_LayClearLine) __P((int, int, int, int));
00038   int   (*lf_LayRewrite) __P((int, int, int, struct mchar *, int));
00039   int   (*lf_LayResize) __P((int, int));
00040   void  (*lf_LayRestore) __P((void));
00041 };
00042 
00043 struct layer
00044 {
00045   struct canvas *l_cvlist;      /* list of canvases displaying layer */
00046   int    l_width;
00047   int    l_height;
00048   int    l_x;                   /* cursor position */
00049   int    l_y;
00050   int    l_encoding;
00051   struct LayFuncs *l_layfn;
00052   char  *l_data;
00053 
00054   struct layer *l_next;         /* layer stack, should be in data? */
00055   struct layer *l_bottom;       /* bottom element of layer stack */
00056   int    l_blocking;
00057 };
00058 
00059 #define LayProcess              (*flayer->l_layfn->lf_LayProcess)
00060 #define LayAbort                (*flayer->l_layfn->lf_LayAbort)
00061 #define LayRedisplayLine        (*flayer->l_layfn->lf_LayRedisplayLine)
00062 #define LayClearLine            (*flayer->l_layfn->lf_LayClearLine)
00063 #define LayRewrite              (*flayer->l_layfn->lf_LayRewrite)
00064 #define LayResize               (*flayer->l_layfn->lf_LayResize)
00065 #define LayRestore              (*flayer->l_layfn->lf_LayRestore)
00066 
00067 #define LaySetCursor()  LGotoPos(flayer, flayer->l_x, flayer->l_y)
00068 #define LayCanResize(l) (l->l_layfn->LayResize != DefResize)
00069 
00070 /* XXX: AArgh! think again! */
00071 
00072 #define LAY_CALL_UP(fn) do                              \
00073         {                                               \
00074           struct layer *oldlay = flayer;                \
00075           struct canvas *oldcvlist, *cv;                \
00076           debug("LayCallUp\n");                         \
00077           flayer = flayer->l_next;                      \
00078           oldcvlist = flayer->l_cvlist;                 \
00079           debug1("oldcvlist: %x\n", oldcvlist);         \
00080           flayer->l_cvlist = oldlay->l_cvlist;          \
00081           for (cv = flayer->l_cvlist; cv; cv = cv->c_lnext)     \
00082                 cv->c_layer = flayer;                   \
00083           fn;                                           \
00084           flayer = oldlay;                              \
00085           for (cv = flayer->l_cvlist; cv; cv = cv->c_lnext)     \
00086                 cv->c_layer = flayer;                   \
00087           flayer->l_next->l_cvlist = oldcvlist;         \
00088         } while(0)
00089 
00090 #define LAY_DISPLAYS(l, fn) do                          \
00091         {                                               \
00092           struct display *olddisplay = display;         \
00093           struct canvas *cv;                            \
00094           for (display = displays; display; display = display->d_next) \
00095             {                                           \
00096               for (cv = D_cvlist; cv; cv = cv->c_next)  \
00097                 if (cv->c_layer == l)                   \
00098                   break;                                \
00099               if (cv == 0)                              \
00100                 continue;                               \
00101               fn;                                       \
00102             }                                           \
00103           display = olddisplay;                         \
00104         } while(0)
00105 

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