|##########|
|#MAGIC   #|DBGFFBKD
|#PROJECT #|""
|#PATHS   #|"StdProject"
|#FLAGS   #|xx---x--x----xx--x--------------
|#USERSW  #|--------------------------------
|#USERMASK#|--------------------------------
|#SWITCHES#|x----xxxxx-xx---
|##########|
DEFINITION MODULE GBTextInfo;

IMPORT EGSGadBox AS GB;
IMPORT EGSIntui  AS I;
FROM EGSGfx IMPORT EFontPtr;
FROM Exec   IMPORT LibraryPtr;
FROM System IMPORT Regs;

CONST
  TextInfoType   = CAST(LONGINT,"TINF".data);

TYPE
  CharPtr        = POINTER TO CHAR;
  CardArray      = ARRAY OF CARDINAL;
  TextInfoGadPtr = POINTER TO TextInfoGadget;
  TextInfoGadget = RECORD OF I.MasterGadget;
                     prop     : I.PropGadPtr;         | the propgadget
                     text     : CharPtr;              | first character
                     lineDisp : POINTER TO CardArray; | pointer to displacements
                                                      | to the line starts
                     lines    : INTEGER;              | number of lines in the
                                                      | full text
                     cheight  : INTEGER;              | character height
                     res      : GB.ResBox;            | location and size of the
                                                      | text box
                     x,y,w    : INTEGER;              | real centered text
                                                      | location
                     font     : EFontPtr;             | text font
                     con      : GB.GadContext;        | pointer to the context
                   END;

VAR
  GBTextInfoBase : LibraryPtr;

LIBRARY GBTextInfoBase BY - 30
    PROCEDURE CreateTextInfoGadget(con  IN A0 : GB.GadContext;
                                   minW IN D0,
                                   maxW IN D1,
                                   minH IN D2,
                                   maxH IN D3 : INTEGER;
                                   font IN A1 : EFontPtr;
                                   id   IN D4 : LONGINT):GB.GadBoxPtr;

LIBRARY GBTextInfoBase BY - 36
    PROCEDURE ModifyTextInfoGadget(win  IN A0 : I.WindowPtr;
                                   gad  IN A1 : TextInfoGadPtr;
                                   text IN A2 : CharPtr);

LIBRARY GBTextInfoBase BY - 42
    PROCEDURE SetTextInfoPos(win  IN A0 : I.WindowPtr;
                             gad  IN A1 : TextInfoGadPtr;
                             line IN D0 : INTEGER);

LIBRARY GBTextInfoBase BY - 48
    PROCEDURE GCSetTextInfoData(con  IN A0 : GB.GadContext;
                                id   IN D0 : LONGINT;
                                text IN A1 : CharPtr);

LIBRARY GBTextInfoBase BY - 54
    PROCEDURE GCSetTextInfoPos(con  IN A0 : GB.GadContext;
                               id   IN D0 : LONGINT;
                               line IN D1 : INTEGER);

END GBTextInfo.

