DEFINITION MODULE GadToolsD; (*$ Implementation:=FALSE *)
(* 29-May-1993/bp *)

FROM SYSTEM IMPORT ADDRESS,BITSET,WORD,LONGSET,CAST;

FROM ExecD IMPORT Node;

FROM GraphicsD IMPORT RastPortPtr,Rectangle,TextAttrPtr;

FROM IntuitionD IMPORT DrawInfoPtr,IDCMPFlags,IDCMPFlagSet,
                       Menu,MenuItem,MenuItemFlagSet;

FROM UtilityD IMPORT TagItemPtr,tagUser;

IMPORT IntuitionD;

CONST
  gadtoolsName="gadtools.library";

TYPE
 StrPtr=ADDRESS;

CONST
 genericKind=0;
 buttonKind=1;
 checkboxKind=2;
 integerKind=3;
 listviewKind=4;
 mxKind=5;
 numberKind=6;
 cycleKind=7;
 paletteKind=8;
 scrollerKind=9;
 sliderKind=11;
 stringKind=12;
 textKind=13;

 numKinds=14;


 arrowIDCMP=IDCMPFlagSet{gadgetUp,gadgetDown,intuiTicks,mouseButtons};

 buttonIDCMP=IDCMPFlagSet{gadgetUp};
 checkboxIDCMP=IDCMPFlagSet{gadgetUp};
 integerIDCMP=IDCMPFlagSet{gadgetUp};
 listviewIDCMP=IDCMPFlagSet{gadgetUp,gadgetDown,mouseMove}+arrowIDCMP;

 mxIDCMP=IDCMPFlagSet{gadgetDown};
 numberIDCMP=IDCMPFlagSet{};
 cycleIDCMP=IDCMPFlagSet{gadgetUp};
 paletteIDCMP=IDCMPFlagSet{gadgetUp};

 scrollerIDCMP=IDCMPFlagSet{gadgetUp,gadgetDown,mouseMove};
 sliderIDCMP=IDCMPFlagSet{gadgetUp,gadgetDown,mouseMove};
 stringIDCMP=IDCMPFlagSet{gadgetUp};

 textIDCMP=IDCMPFlagSet{};

 interWidth=8;
 interHeight=4;

TYPE
 NewGadgetFlags=(
  placetextLeft,placetextRight,placetextAbove,placetextBelow,
  placetextIn,ngHighlabel,ng6,ng7,
  ng8,ng9,ng10,ng11,
  ng12,ng13,ng14,ng15,
  ng16,ng17,ng18,ng19,
  ng20,ng21,ng22,ng23,
  ng24,ng25,ng26,ng27,
  ng28,ng29,ng30,ng31
 );
 NewGadgetFlagSet=SET OF NewGadgetFlags;

 NewGadget=RECORD
  leftEdge:INTEGER;
  topEdge:INTEGER;
  width:INTEGER;
  height:INTEGER;
  gadgetText:ADDRESS;
  textAttr:TextAttrPtr;
  gadgetID:CARDINAL;
  flags:NewGadgetFlagSet;
  visualInfo:ADDRESS;
  userData:ADDRESS;
 END;
 NewGadgetPtr=POINTER TO NewGadget;

CONST
 nmTitle=1;
 nmItem=2;
 nmSub=3;
 nmEnd=0;
 (*39*)nmIgnore=64;

TYPE
 NewMenu=RECORD
  type:SHORTCARD;
  label:StrPtr;
  commKey:StrPtr;
  CASE :SHORTCARD OF
  |nmTitle: menuFlags:BITSET;
  |nmItem,nmSub: itemFlags:MenuItemFlagSet;
  END;
  mutualExclude:LONGSET;
  userData:ADDRESS;
 END;
 NewMenuPtr=POINTER TO NewMenu;

 (* GadTools erzeugt in Wahrheit Ext..-Strukturen mit
    userData am Ende.
  *)
 ExtMenu=RECORD
   m:Menu;
   userData:ADDRESS;
 END;
 ExtMenuPtr=POINTER TO ExtMenu;
 ExtMenuItem=RECORD
   m:MenuItem;
   userData:ADDRESS;
 END;
 ExtMenuItemPtr=POINTER TO ExtMenuItem;
 
CONST
 menuImage=128;
 imItem=nmItem+menuImage;
 imSub=nmSub+menuImage;

 nmBarlabel=CAST(StrPtr,LONGINT(-1));

 menuDisabled=IntuitionD.menuEnabled;
 itemDisabled=IntuitionD.itemEnabled;
 (*39*)commandString=IntuitionD.commSeq;

TYPE
 GtTags=(gtTagBase:=tagUser + 080000H,
  gtviNewWindow,
  gtviNWTags,
  gtPrivate0,
  gtcbChecked,
  gtlvTop,
  gtlvLabels,
  gtlvReadOnly,
  gtlvScrollWidth,
  gtmxLabels,
  gtmxActive,
  gttxText,
  gttxCopyText,
  gtnmNumber,
  gtcyLabels,
  gtcyActive,
  gtpaDepth,
  gtpaColor,
  gtpaColorOffset,
  gtpaIndicatorWidth,
  gtpaIndicatorHeight,
  gtscTop,
  gtscTotal,
  gtscVisible,
  gtscOverlap,
  gt25,gt26,gt27,gt28,gt29,gt30,gt31,gt32,gt33,gt34,gt35,gt36,gt37,
  gtslMin,
  gtslMax,
  gtslLevel,
  gtslMaxLevelLen,
  gtslLevelFormat,
  gtslLevelPlace,
  gtslDispFunc,
  gtstString,
  gtstMaxChars,
  gtinNumber,
  gtinMaxChars,
  gtmnTextAttr,
  gtmnFrontPen,
  gtbbRecessed,
  gtVisualInfo,
  gtlvShowSelected,
  gtlvSelected,
  (*37*)gtstEditHook,
  gtReserved1,
  gttxBorder,
  gtnmBorder,
  gtscArrows,
  gtmnMenu,
  gtmxSpacing,
  (*37*)gtmnFullMenu,
  (*37*)gtmnSecondaryError,
  (*37*)gtUnderscore,
  (*39*)gtmnCheckmark,
  (*39*)gtmnAmigaKey,
  (*39*)gtmnNewLookMenus,
  (*39*)gtcbScaled,
  (*39*)gtmxScaled,
  (*39*)gtpaNumColors,
  (*39*)gtmxTitlePlace,
  (*39*)gttxFrontPen,
  (*39*)gttxBackPen,
  (*39*)gttxJustification,
  (*39*)gtnmFormat,
  (*39*)gtnmMaxNumberLen,
  (*39*)gtbbFrameType,
  (*39*)gtlvMakeVisible,
  (*39*)gtlvItemHeight,
  (*39*)gtslMaxPixelLen,
  (*39*)gtslJustification,
  (*39*)gtpaColorTable,
  (*39*)gtlvCallBack,
  (*39*)gtlvMaxPen,
  (*39*)gttxClipped (* user+85 *)
 );
CONST
  (*39*)gtnmFrontPen=gttxFrontPen;
  (*39*)gtnmBackPen=gttxBackPen;
  (*39*)gtnmJustification=gttxJustification;
  (*39*)gtnmClipped=gttxClipped;

  (* gttxJustification & gtnmJustification: *)
  (*39*)gtjLeft=0;
  (*39*)gtjRight=1;
  (*39*)gtjCenter=2;

  (* gtbbFrameType: *)
  (*39*)bbftButton=1;
  (*39*)bbftRidge=2;
  (*39*)bbftIconDropBox=3;

  (* gtlvCallBack: *)
  (*39*)lvDraw=0202H;
  
  (*39*)lvcbOk=0;
  (*39*)lvcbUnknown=1;

  (*39*)lvrNormal=0;
  (*39*)lvrSelected=1;
  (*39*)lvrNormalDisabled=2;
  (*39*)lvrSelectedDisabled=8;
TYPE
  (*39*)LVDrawMsg=RECORD
          methodID:LONGCARD;
          rastPort:RastPortPtr;
          drawInfo:DrawInfoPtr;
          bounds:Rectangle;
          state:LONGCARD;
        END;
        LVDrawMsgPtr=POINTER TO LVDrawMsg;

CONST
 (*37*)gtmenuTrimmed=1;
 (*37*)gtmenuInvalid=2;
 (*37*)gtmenuNomem=3;

 (* MX gadget default dimensions: *)
 (*39*)mxWidth=17;
 (*39*)mxHeight=9;

 (* Checkbox default dimensions: *)
 (*39*)checkboxWidth=26;
 (*39*)checkboxHeight=11;

END GadToolsD.noimp
