home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d828 / disktest.lha / DiskTest / Source / ts.h < prev   
Text File  |  2001-02-25  |  2KB  |  73 lines

  1. /*------------------------------------*
  2.  | File: TS.h - Include file for TS.c |
  3.  *------------------------------------*/
  4.  
  5. /**
  6.  | #define's:
  7.  | - parameters of the Bevel Box;
  8.  | - offset, inside the Bevel Box, of the text scrolling region.
  9. **/
  10.  
  11. #define BEVEL_LEFT        4
  12. #define BEVEL_TOP         3
  13. #define BEVEL_WIDTH     589
  14. #define BEVEL_HEIGHT    149
  15.  
  16. #define TEXT_XOFFSET      8
  17. #define TEXT_YOFFSET      4
  18.  
  19. /**
  20.  | Local structures:
  21.  | - a double-linked list structure, to hold the text lines to be
  22.  |   presented in the scroller (it is simple to implement, and
  23.  |   to do it myself is funnier that to use OS List structures :-).
  24. **/
  25.  
  26. typedef struct sLine {
  27.   struct sLine  *sl_Back;
  28.   struct sLine  *sl_Forw;
  29.   size_t         sl_Length;
  30.   char           sl_Text[1];
  31. } Line;
  32.  
  33. /**
  34.  | Local global variables:
  35.  | - pointers to the first and last line of text;
  36.  | - a pointer to the window raster port;
  37.  | - scroller variables;
  38.  | - variables for Bevel Box and text drawing.
  39.  |
  40. **/
  41.  
  42. static Line  *firstLine        = NULL;
  43. static Line  *lastLine         = NULL;
  44.  
  45. static struct RastPort *pRP;
  46.  
  47. static USHORT numLines       = 0;   /* Number of actual text lines     */
  48. static USHORT topLine        = 0;   /* Actual top line (first is zero) */
  49. static USHORT oldNumLines    = 0;   /* Nr. lines and top line the last */
  50. static USHORT oldTopLine     = 0;   /*   time the scroller was updated */
  51. static USHORT linesVisible;         /* Number of lines and columns in  */
  52. static USHORT columnsVisible;       /*   the scrolling region          */
  53. static USHORT fontHeight;           /* Height and width of the window  */
  54. static USHORT fontWidth;            /*   text font (pixels)            */
  55. static USHORT viewHeight;           /* Height and width of the text    */
  56. static USHORT viewWidth;            /*   scrolling region (pixels)     */
  57. static USHORT usefulHeight;         /* Height and width of the zone to */
  58. static USHORT usefulWidth;          /*   be refreshed                  */
  59.  
  60. static USHORT bevelLeft, bevelTop, bevelWidth, bevelHeight;
  61. static USHORT textLeft, textTop;
  62.  
  63. /**
  64.  | Local procedure prototypes
  65. **/
  66.  
  67. static void RenderLine
  68.   (USHORT x, USHORT y, USHORT w, char *text, size_t len);
  69. static Line *ScanList(register Line *pL, register int n);
  70. static void SetScroller
  71.   (struct Window *pW, struct Gadget *pG, USHORT lV, USHORT nL, USHORT tL);
  72. static void UpdateScroller(void);
  73.