home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 634.lha / ppdata_v1.0 / src.LZH / src / wintext.h < prev   
Encoding:
C/C++ Source or Header  |  1992-04-11  |  1.5 KB  |  46 lines

  1. #ifndef WINTEXT_H
  2. #define WINTEXT_H
  3. /*
  4. *    wintext.h - version 0.1
  5. *
  6. *    Header for font-independent window-text system, which allows
  7. *    writing of text based on character positions.
  8. *
  9. *    MWS 3/92.
  10. */
  11. #ifndef EXEC_TYPES_H
  12. #include <exec/types.h>
  13. #endif
  14.  
  15. #ifndef MIN
  16. #define MIN(a,b)    ((a) > (b) ? (b) : (a))
  17. #endif
  18.  
  19. typedef struct wintext {
  20.     struct wintext    *next;        /* next WINTEXT */
  21.     char        *text;        /* actual text to be rendered */
  22.     UWORD        lpos, tpos;    /* character coordinates of 1st char in string */
  23.     UWORD        pen, mode;    /* color and drawmode for text */
  24.     UWORD        columns;    /* number of columns to render;
  25.                     /* -1 implies to edge of text window */
  26. } WINTEXT;
  27.  
  28. typedef struct wintextinfo {
  29.     struct Window *window;        /* window this wintextinfo is for */
  30.     struct TextAttr *tattr;        /* screen's default font - we'll use this */
  31.     char    *spaces;        /* string of spaces of size columns */
  32.     UWORD    rows, columns;        /* size of text window */
  33.     UWORD    font_x, font_y;        /* dimensions of default font */
  34.     UWORD    font_baseline;        /* baseline of font */
  35.     BYTE    loffset, toffset,    /* origin (in pixels) for text rendering */
  36.         roffset, boffset;    /* and right and bottom border widths */
  37. } WINTEXTINFO;
  38.  
  39. BOOL InitWinTextInfo(WINTEXTINFO *, struct NewWindow *, UWORD rows, UWORD columns);
  40. void FinishWinText(WINTEXTINFO *);
  41. void WinText(WINTEXTINFO *, char *text, UWORD lpos, UWORD tpos, UWORD pen, UWORD mode);
  42. void RenderWinTexts(WINTEXTINFO *, WINTEXT *);
  43. void RenderWinTextsFmt(WINTEXTINFO *, WINTEXT *, char *, ...);
  44.  
  45. #endif WINTEXT_H
  46.