home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / IncPOS.lzx / pGadget / Gadget.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-18  |  9.1 KB  |  243 lines

  1. #ifndef __INC_POS_PGADGET_GADGET_H
  2. #define __INC_POS_PGADGET_GADGET_H
  3. /*******************************************************************
  4.  Includes Release 24
  5.  (C) Copyright 1995-1997 proDAD
  6.      All Rights Reserved
  7.  
  8.  $AUT Holger Burkarth
  9.  $DAT >>Gadget.h<<   04 Mar 1997    15:07:15 - (C) ProDAD
  10. *******************************************************************/
  11. #ifndef __INC_POS_PEXEC_LIST_H
  12. #include <pExec/List.h>
  13. #endif
  14.  
  15.  
  16. /*----------------------------------
  17. -----------------------------------*/
  18. struct pOS_Gadget
  19. {
  20.   struct pOS_Node        gad_Node;
  21.  
  22.   SWORD                  gad_LeftEdge;
  23.   SWORD                  gad_TopEdge;
  24.   SWORD                  gad_Width;
  25.   SWORD                  gad_Height;
  26.  
  27.   ULONG                  gad_Flags;       /* (enum pOS_GadgetFlags) */
  28.   ULONG                  gad_ID;          /* user-definable ID field */
  29.   ULONG                  gad_UserData[2];
  30.  
  31.   struct pOS_IntuiObj   *gad_Render;
  32.   struct pOS_IntuiObj   *gad_Select;
  33.  
  34. /*---------------------------------------------*/
  35.  
  36.   struct pOS_IntuiObj   *gad_Lable;
  37.  
  38.   ULONG                  gad_Activation;  /* (enum pOS_GadgetActivate) */
  39.   ULONG                  gad_Type;        /* (enum pOS_GadgetTypes) */
  40.   APTR                   gad_SpecialInfo;
  41.   struct pOS_Layer      *gad_Layer;
  42.   APTR                   gad_Target;
  43.   const struct pOS_TagItem *gad_Map;
  44.   struct pOS_Gadget     *gad_Parent;
  45.   const CHAR            *gad_HelpID;
  46.  
  47.   struct pOS_Callback   *gad_Callback;
  48.   UBYTE                  gad_ShortKey;
  49.   UBYTE                  gad_BorTop,gad_BorLeft,gad_BorRight,gad_BorBottom;
  50.   UBYTE                  gad_Gwk;        /* Layout-Gewicht */
  51.   UBYTE                  gad_LableLay;    /* (enum pOS_IObjectClassLayout) */
  52.   UBYTE                  gad_RenderLay;   /* (enum pOS_IObjectClassLayout) */
  53.   UBYTE                  gad_MutualExclude;
  54.   UWORD                  gad_BorderType;  /* (enum pOS_GadgetBorderTypes) */
  55.   UWORD                  gad_LableWidth;  /* wird vom Gadget autom. berechnet */
  56.   UWORD                  gad_LableHeight;
  57.   struct pOS_GadgetDrop *gad_Drop;        /* Gadget-Drop-Extend */
  58.   struct pOS_GadgetDrag *gad_Drag;        /* Gadget-Drag-Extend */
  59.  
  60.   UBYTE gad_Reserved[16-4];
  61. };
  62.  
  63.  
  64.  
  65.  
  66. enum pOS_GadgetFlags /* gad_Flags */
  67. {
  68. /*\
  69. *** Ist GFLG_NoSelect==1 gesetzt und GACT_ToggleSelect==0, dann wird beim Anklicken
  70. *** ein optionales IDCMP_GadgetDown gesendet (GACT_Immediate==1). Das Gadget wird
  71. *** aber nicht GFLG_Selected==1 und wird auch nicht neugezeichnet.
  72. \*/
  73.   GFLG_NoSelect=         0x00000004,    /* Gadget wird nie wirklich selektiert */
  74.   GFLG_RelBottom=        0x00000008,    /* vert. pos. is relative to bottom edge */
  75.   GFLG_RelRight=         0x00000010,    /* horiz. pos. is relative to right edge */
  76.   GFLG_RelWidth=         0x00000020,    /* width is relative to req/window    */
  77.   GFLG_RelHeight=        0x00000040,    /* height is relative to req/window   */
  78.  
  79.   GFLG_Selected=         0x00000080,    /* Gadget ist selektiert */
  80.   GFLG_Disabled=         0x00000100,    /* Gadget ist gesperrt */
  81.   GFLG_TabCycle=         0x00000200,
  82.   GFLG_DropSelected=     0x00000400,    /* Ein Drag-Objekt steht zur Zeit im Gadget.
  83.                                         ** Das Flag wird von pIntui gesetzt und ist
  84.                                         ** für Applikationen und Gadgets (const) readonly.
  85.                                         */
  86.  
  87.   GFLG_PrivateDisable=   0x00000800,    /* Beim Sperren vom Gadget (GFLG_Disabled) zeichnet
  88.                                         ** pIntui kein Raster, sondern das Gadget muß
  89.                                         ** ein eigenes Disable verwenden.
  90.                                         ** !! nur für Gadgets modifizierbar !!
  91.                                         */
  92.  
  93.   GFLG_OSLable=          0x00001000,    /* Lable ist außerhalb der Gadget-Box */
  94.   GFLG_Alternate=        0x00002000,    /* Gadget muß erneuert werden  */
  95.   GFLG_FixSize=          0x00004000,    /* das Gadget muß genau mit den GetIBox-Größen bedient werden */
  96.  
  97.   GFLG_UseMthAddRem=     0x00010000,    /* es werden GCLMTH_Add/GCLMTH_Rem gesendet */
  98.   GFLG_UseMthLayout=     0x00020000,    /* GCLMTH_Layout wird gesendet */
  99.   GFLG_IgnoreIE=         0x00040000,    /* Input-Events ignorieren */
  100.   GFLG_HighlightDropBox= 0x00080000,    /* der GadgetBorder wird bei Drop hervorgehoben */
  101.   GFLG_StdCallback=      0x00100000,    /* gad_Callback wird als Standard-Callback berachtet */
  102.   GFLG_StdTargetMap=     0x00200000,    /* gad_Target und gad_Map wird im Standard-Modus bearbeitet */
  103.   GFLG_HighlightFocus=   0x00400000,    /* Gadget-Focus wird grafisch angezeigt */
  104. };
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. enum pOS_GadgetActivate /* gad_Activation */
  114. {
  115.   GACT_RelVerify=       0x0001,
  116.   GACT_Immediate=       0x0002,
  117.   GACT_UpdateGadget=    0x0004, /* UpdateGadget erzeugen */
  118.  
  119.   GACT_RightBorder=     0x0010,
  120.   GACT_LeftBorder=      0x0020,
  121.   GACT_TopBorder=       0x0040,
  122.   GACT_BottomBorder=    0x0080,
  123.  
  124.   GACT_ToggleSelect=    0x0100,  /* */
  125.  
  126.   GACT_StringLeft=      0x0000,  /* */
  127.   GACT_StringCenter=    0x0200,
  128.   GACT_StringRight=     0x0400,
  129.   GACT_LongInt=         0x0800,  /* */
  130.  
  131.   GACT_ActiveGadget=    0x4000,
  132.   GACT_AnimateGadget=   0x8000, /* Gadget wird mit GCLMTHRE_TickFrame versorgt */
  133.  
  134.  
  135.   GACT_AnyBorderFlag =GACT_RightBorder | GACT_LeftBorder |
  136.                       GACT_TopBorder | GACT_BottomBorder,
  137.  
  138.   GACT_StandardDrop=    0x00010000, /* */
  139.   GACT_StandardDrag=    0x00020000, /* */
  140.   GACT_FixFocus=        0x00040000, /* der Eingabefocus kann nicht mit pOS_ActivateGadget() entzogen werden */
  141.   GACT_FetchFocus=      0x00080000, /* nach GadgetUp bleibt der Fokus auf dem Gadget */
  142. };
  143.  
  144.  
  145.  
  146. enum pOS_GadgetTypes /* gad_Type */
  147. {
  148.   GTYP_GadgetType=           0xFC00,  /* all Gadget Global Type flags (padded) */
  149.  
  150.   GTYP_ScrGadget=            0x4000,  /* 1 = ScreenGadget, 0 = WindowGadget */
  151.   GTYP_GZZGadget=            0x2000,  /* 1 = for WFLG_GIMMEZEROZERO borders */
  152.  
  153.   GTYP_SysGadget=            0x8000,
  154.   GTYP_SysTypeMask=          0x00F0,
  155.  
  156.   GTYP_Sizing=               0x0010,  /* Window sizing gadget */
  157.   GTYP_WDragging=            0x0020,  /* Window drag bar */
  158.   GTYP_SDragging=            0x0030,  /* Screen drag bar */
  159.   GTYP_WDepth=               0x0040,  /* Window depth gadget */
  160.   GTYP_SDepth=               0x0050,  /* Screen depth gadget */
  161.   GTYP_WZoom=                0x0060,  /* Window zoom gadget */
  162.   GTYP_Close=                0x0080,  /* Window close gadget */
  163.  
  164.   GTYP_GTypeMask=            0x0007,
  165.  
  166.   GTYP_BoolGadget=           0x0001,
  167.   GTYP_PropGadget=           0x0003,
  168.   GTYP_StrGadget=            0x0004,
  169.   GTYP_CustomGadget=         0x0005,
  170.  
  171.  
  172.  
  173.   GTYP_Reentrant=         0x00010000,   /* Gadget wird ohne pOS_LockIntuiGadget()
  174.                                         ** bedient. Dem Gadget ist es freigestellt
  175.                                         ** pOS_LockIntuiGadget() aufzurufen.
  176.                                         */
  177.  
  178.  
  179.   GTYP_GShortKeyMask=     0x03000000,
  180.   GTYP_KeyNone=           0x00000000,  /* ShortKey => no action */
  181.   GTYP_KeyActivate=       0x01000000,  /* ShortKey => Activate-Gadget */
  182.   GTYP_KeySelect=         0x02000000,  /* ShortKey => Select-Gadget */
  183.   GTYP_KeyActSelect=      0x03000000,  /* ShortKey => Activate+Select-Gadget */
  184.  
  185.   GTYP_KeyRETURN=         0x04000000,  /* is the gadget active, RETURN is the same as click */
  186.  
  187.  
  188.  
  189.   GTYP_DbInWindow=        0x40000000,   /* Internal - Debug */
  190. };
  191.  
  192.  
  193. /** pOS_DrawBorderBox() **/
  194. enum pOS_GadgetBorderTypes /** gad_BorderType **/   /* ICLTAG_GadBorderType */
  195. {
  196.   GADBORTYP_None=0,
  197.   GADBORTYP_BlkBox,             /* Black-Box */
  198.   GADBORTYP_BevelUpBox,         /* 3D/hochgestellt */
  199.   GADBORTYP_BevelDownBox,       /* 3D/tiefgestellt */
  200.   GADBORTYP_RBevelUpBox,        /* 3D/hochgestellt/rund */
  201.   GADBORTYP_RBevelDownBox,      /* 3D/tiefgestellt/rund */
  202.   GADBORTYP_BevelBox,           /* 3D/hoch-/tiefgestellt */
  203.   GADBORTYP_HfBevelUpBox,       /* 3D/hochgestellt (halbhell) */
  204.   GADBORTYP_HfBevelDownBox,     /* 3D/tiefgestellt (halbhell) */
  205.   GADBORTYP_HfRBevelUpBox,      /* 3D/hochgestellt/rund (halbhell) */
  206.   GADBORTYP_HfRBevelDownBox,    /* 3D/tiefgestellt/rund (halbhell) */
  207.   GADBORTYP_XBox,               /* verzahnte Box für Gruppen-Rahmen */
  208.   GADBORTYP_ZBox,               /* Black-White-Black für Boxen mit weißem Inhalt */
  209.   GADBORTYP_Bevel1UpBox,        /* wie GADBORTYP_BevelUpBox, aber mit 1Pixel Luft */
  210.   GADBORTYP_Bevel1DownBox,      /* wie GADBORTYP_BevelDownBox, aber mit 1Pixel Luft */
  211.   GADBORTYP_StrBox,
  212.   GADBORTYP_RBevelBox,          /* 3D/hoch-/tiefgestellt/rund */
  213.  
  214.   GADBORTYP_TypMask = 0x00ff,
  215.  
  216.   GADBORF_BlkOverBorder = 0x0100, /* ... plus Black-Border */
  217.   GADBORF_BgOverBorder  = 0x0200, /* ... plus Background-Border */
  218.  
  219. };
  220.  
  221.  
  222.  
  223.  
  224.  
  225. /** pOS_CalcGadInner(win,gad,rect,flags) **/
  226. enum pOS_CalcGadInnerFlags
  227. {
  228.   CALCGADINF_None       = 0x00, /* nothing ;-) */
  229.   CALCGADINF_CalcGadBox = 0x01, /* call pOS_CalcGadgetBox() */
  230.   CALCGADINF_Relativ    = 0x02, /* 'rect' relativ to Min (Max-=Min; Min=0) */
  231.   CALCGADINF_Border     = 0x04, /* add Border (inner gadget region) */
  232.   CALCGADINF_Lable      = 0x08, /* sub Lable-Size */
  233.   CALCGADINF_Absolut    = 0x10, /* (~CALCGADINF_Relativ) */
  234.   CALCGADINF_NegBorder  = 0x20, /* sub Border (~CALCGADINF_Border) */
  235.   CALCGADINF_NegLable   = 0x40, /* add Lable-Size (~CALCGADINF_Lable) */
  236. };
  237.  
  238.  
  239.  
  240.  
  241.  
  242. #endif
  243.