home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Telnet 2.7b5 / source / Screens / rsdefs.h next >
Encoding:
C/C++ Source or Header  |  1995-03-18  |  3.2 KB  |  92 lines  |  [TEXT/CWIE]

  1. /*------------------------------------------------------------------------------*/
  2. /* RSDEFS.H                                                                        */
  3. /* This is the defines file for rsmac.c.  There are enough defines and structs    */
  4. /* to merit putting them into a separate file, so I have done so    -SMB        */
  5.  
  6.  
  7. /*-------------------------------------------------------------------------*/
  8. /* some defines for easy structure access */
  9. #define FHeight RSlocal[w].fheight
  10. #define    Fascent    RSlocal[w].fascent
  11. #define FWidth RSlocal[w].fwidth
  12. #define    FONT RSlocal[w].fnum
  13. #define FSIZE RSlocal[w].fsiz
  14. #define FRight RSlocal[w].width
  15. #define RMAXWINDOWWIDTH (width)*FWidth+16 - (CHO)
  16. #define RMAXWINDOWHEIGHT (lines)*FHeight+16
  17.  
  18. /* the different cursor types */
  19. #define BLOCKCURSOR                0    /* BYU 2.4.11 */
  20. #define UNDERSCORECURSOR        1    /* BYU 2.4.11 */
  21. #define VERTICALCURSOR            2    /* BYU 2.4.11 */
  22.  
  23. /*  Capable of shifting the text to the right some # of pixels        */
  24. #define CVO 0
  25. #define CHO -3
  26.  
  27. #define INFINITY    20000        // Will screens ever be this large?
  28. #define MAXATTR 8
  29. #define PALSIZE (MAXATTR*2+4*2)    //this is ANSI colors plus our four.
  30.  
  31. /*------------------------------------------------------------------------*/
  32. /* Now we have some externs, packed away neatly from the rest of the code */
  33. extern TelInfoRec *TelInfo;
  34. extern short scrn;                    /* shut up, Tim */
  35. extern char *tempspot;
  36. extern MenuHandle myMenus[];
  37.  
  38.  
  39. /*--------------------------------------------------------------------------*/
  40. /* Time to define the big RS structure.  RSdata holds the font and screen     */
  41. /* specific stuff.  Basically all the ugly stuff you wouldnt otherwise         */
  42. /* care to look at                                                            */
  43.  
  44. struct RSdata {
  45.     OSType        id;            // RSDA
  46.     Rect        textrect;    /* Where the text is in the window */
  47.     Rect        cursor;        /* Cursor rectangle */
  48.     WindowPtr    window;        /* Window pointer */
  49.     PaletteHandle    pal;    /* My Palette */
  50.     char        cursorstate,/* BYU 2.4.11 - 0 is invisible, 1 is visible */
  51.                 selected;    /* BYU 2.4.11 - text is selected */
  52.     Point        last,
  53.                 anchor;
  54.     short        topline,
  55.                 leftmarg;    /* leftmost visible column position */
  56.     short        rheight,    /* Real window dimensions */
  57.                             /* adjusted to not include CHO boundary - TK 12/88 */
  58.                 rwidth;
  59.     short        height,
  60.                 width;        /* Window Dimensions rounded to the nearest character */
  61.     Boolean        flipped;    /* Set when we've reversed normal fg and bg colors */
  62.     ControlHandle
  63.         left,        /* The CH for the left margin */
  64.         scroll;        /* The CH for the scroll bar */
  65.     short
  66.         min,        /* Minimum vertical scrollbar value (number of lines in screen buffer and scrollback) */
  67.         max,        /* Maximum vertical scrollbar value */
  68.         current,    /* current vertical scrollbar value */
  69.         lmin,        /* Minimum horizontal scrollbar value (always 0) */
  70.         lmax,        /* Maximum horizontal scrollbar value (number of columns not visible) */
  71.         lcurrent;    /* current horizontal scrollbar value (leftmost visible column) */
  72.     short
  73.         fascent,    /* Font Ascent */
  74.         fnum,        /* Font ID */
  75.         fsiz,        /* Font Size */
  76.         fheight,    /* Font Height/character */
  77.         fwidth,        /* Font Width /character */
  78.         monospaced;    /* Font is monospaced */
  79.     Boolean
  80.         skip;        /* TRUE if we are skipping the output */
  81.     WCTabHandle
  82.         wctb;        
  83.  
  84.     };
  85.  
  86. typedef struct RSdata RSdata;
  87.  
  88. #define    MYSETRECT(a,b,c,d,e)    a.left = b; \
  89.                                 a.top = c;\
  90.                                 a.right = d;\
  91.                                 a.bottom = e;\
  92.