    IFND INTUITION_GADGETCLASS_I
INTUITION_GADGETCLASS_I SET 1
**
** $Filename: intuition/gadgetclass.i $
** $Release: 2.02 $
** $Revision: 36.2 $
** $Date: 90/11/02 $
**
** Custom and 'boopsi' gadget class interface
**
**  (C) Copyright 1985,1986,1987,1988,1989,1990 Commodore-Amiga, Inc.
**	    All Rights Reserved
**

	IFND EXEC_TYPES_I
	INCLUDE "exec/types.i"
	ENDC

	IFND INTUITION_INTUITION_I
	INCLUDE "intuition/intuition.i"
	ENDC

	IFND UTILITY_TAGITEM_I
	INCLUDE "utility/tagitem.i"
	ENDC


; Gadget Class attributes

GA_Dummy		EQU	(TAG_USER+$30000)
GA_LEFT			EQU	(GA_Dummy+$0001)
GA_RELRIGHT		EQU	(GA_Dummy+$0002)
GA_TOP			EQU	(GA_Dummy+$0003)
GA_RELBOTTOM		EQU	(GA_Dummy+$0004)
GA_WIDTH		EQU	(GA_Dummy+$0005)
GA_RELWIDTH		EQU	(GA_Dummy+$0006)
GA_HEIGHT		EQU	(GA_Dummy+$0007)
GA_RELHEIGHT		EQU	(GA_Dummy+$0008)
GA_TEXT			EQU	(GA_Dummy+$0009)  ; ti_Data is (UBYTE *)
GA_IMAGE		EQU	(GA_Dummy+$000A)
GA_BORDER		EQU	(GA_Dummy+$000B)
GA_SELECTRENDER		EQU	(GA_Dummy+$000C)
GA_HIGHLIGHT		EQU	(GA_Dummy+$000D)
GA_DISABLED		EQU	(GA_Dummy+$000E)
GA_GZZGADGET		EQU	(GA_Dummy+$000F)
GA_ID			EQU	(GA_Dummy+$0010)
GA_USERDATA		EQU	(GA_Dummy+$0011)
GA_SPECIALINFO		EQU	(GA_Dummy+$0012)
GA_SELECTED		EQU	(GA_Dummy+$0013)
GA_ENDGADGET		EQU	(GA_Dummy+$0014)
GA_IMMEDIATE		EQU	(GA_Dummy+$0015)
GA_RELVERIFY		EQU	(GA_Dummy+$0016)
GA_FOLLOWMOUSE		EQU	(GA_Dummy+$0017)
GA_RIGHTBORDER		EQU	(GA_Dummy+$0018)
GA_LEFTBORDER		EQU	(GA_Dummy+$0019)
GA_TOPBORDER		EQU	(GA_Dummy+$001A)
GA_BOTTOMBORDER		EQU	(GA_Dummy+$001B)
GA_TOGGLESELECT		EQU	(GA_Dummy+$001C)

* internal use only, until further notice, please
GA_SYSGADGET		EQU	(GA_Dummy+$001D)
* bool, sets SYSGADGET field in type
GA_SYSGTYPE		EQU	(GA_Dummy+$001E)
* e.g., WUPFRONT, ...

GA_PREVIOUS		EQU	(GA_Dummy+$001F)
* previous gadget (or (struct Gadget **)) in linked list
* NOTE: This attribute CANNOT be used to link new gadgets
* into the gadget list of an open window or requester.
* You must use AddGList().

GA_NEXT			EQU	(GA_Dummy+$0020)
* not implemented

GA_DRAWINFO		EQU	(GA_Dummy+$0021)
* some fancy gadgets need to see a DrawInfo
* when created or for layout

* You should use at most ONE of GA_TEXT, GA_INTUITEXT, and GA_LABELIMAGE
GA_INTUITEXT		EQU	(GA_Dummy+$0022)
* ti_Data is (struct IntuiText	*)

GA_LABELIMAGE		EQU	(GA_Dummy+$0023)
* ti_Data is an image (object), used in place of
* GadgetText


* PROPGCLASS attributes

PGA_Dummy		EQU	(TAG_USER+$31000)
PGA_FREEDOM		EQU	(PGA_Dummy+$0001)
* either or both of FREEVERT and FREEHORIZ
PGA_BORDERLESS		EQU	(PGA_Dummy+$0002)
PGA_HORIZPOT		EQU	(PGA_Dummy+$0003)
PGA_HORIZBODY		EQU	(PGA_Dummy+$0004)
PGA_VERTPOT		EQU	(PGA_Dummy+$0005)
PGA_VERTBODY		EQU	(PGA_Dummy+$0006)
PGA_TOTAL		EQU	(PGA_Dummy+$0007)
PGA_VISIBLE		EQU	(PGA_Dummy+$0008)
PGA_TOP			EQU	(PGA_Dummy+$0009)

* STRGCLASS attributes

STRINGA_Dummy			EQU	(TAG_USER+$32000)
STRINGA_MaxChars	EQU	(STRINGA_Dummy+$0001)
STRINGA_Buffer		EQU	(STRINGA_Dummy+$0002)
STRINGA_UndoBuffer	EQU	(STRINGA_Dummy+$0003)
STRINGA_WorkBuffer	EQU	(STRINGA_Dummy+$0004)
STRINGA_BufferPos	EQU	(STRINGA_Dummy+$0005)
STRINGA_DispPos		EQU	(STRINGA_Dummy+$0006)
STRINGA_AltKeyMap	EQU	(STRINGA_Dummy+$0007)
STRINGA_Font		EQU	(STRINGA_Dummy+$0008)
STRINGA_Pens		EQU	(STRINGA_Dummy+$0009)
STRINGA_ActivePens	EQU	(STRINGA_Dummy+$000A)
STRINGA_EditHook	EQU	(STRINGA_Dummy+$000B)
STRINGA_EditModes	EQU	(STRINGA_Dummy+$000C)

* booleans
STRINGA_ReplaceMode	EQU	(STRINGA_Dummy+$000D)
STRINGA_FixedFieldMode	EQU	(STRINGA_Dummy+$000E)
STRINGA_NoFilterMode	EQU	(STRINGA_Dummy+$000F)

STRINGA_Justification	EQU	(STRINGA_Dummy+$0010)
* STRINGCENTER, STRINGLEFT, STRINGRIGHT
STRINGA_LongVal		EQU	(STRINGA_Dummy+$0011)
STRINGA_TextVal		EQU	(STRINGA_Dummy+$0012)

SG_DEFAULTMAXCHARS	EQU	(128)

* Gadget Layout related attributes

* not used by anything yet
LAYOUTA_Dummy		EQU	(TAG_USER+$38000)
LAYOUTA_LAYOUTOBJ	EQU	(LAYOUTA_Dummy+$0001)
LAYOUTA_SPACING		EQU	(LAYOUTA_Dummy+$0002)
LAYOUTA_ORIENTATION	EQU	(LAYOUTA_Dummy+$0003)

* orientation values
LORIENT_NONE		EQU	0
LORIENT_HORIZ		EQU	1
LORIENT_VERT		EQU	2

; Custom gadget hook command ID's 
; (gadget class method/message ID's)

GM_HITTEST EQU		0	; return GMR_GADGETHIT if you are clicked
				; (whether or not you are disabled)
GM_RENDER EQU		1	; draw yourself, in the appropriate state
GM_GOACTIVE EQU		2	; you are now going to be fed input
GM_HANDLEINPUT EQU	3	; handle that input
GM_GOINACTIVE EQU	4	; whether or not by choice, you are done

; Parameter "Messages" passed to gadget class methods

; All parameter structure begin with a MethodID field
; This definition of an abstract generic "message" is
; equivalent to a better one in intuition/classusr.i, but
; it's left here for historic reasons
 STRUCTURE MsgHeader,0
	ULONG	MethodID
	LABEL	methodid_SIZEOF

; GM_HITTEST
 STRUCTURE	gpHitTest,methodid_SIZEOF
    APTR	gpht_GInfo
    WORD	gpht_MouseX
    WORD	gpht_MouseY

; GM_HITTEST return value
GMR_GADGETHIT	EQU $00000004	; if no hit, return 0

; GM_RENDER
 STRUCTURE	gpRender,methodid_SIZEOF
    APTR	gpr_GInfo	; gadget context
    APTR	gpr_RPort	; all ready for use
    LONG	gpr_Redraw	; might be a "highlight pass"

; values of gpr_Redraw
GREDRAW_UPDATE	EQU 2	; update for change in attributesvalues
GREDRAW_REDRAW	EQU 1	; redraw gadget
GREDRAW_TOGGLE	EQU 0	; toggle highlight, if applicable

; GM_GOACTIVE, GM_HANDLEINPUT
 STRUCTURE	gpInput,methodid_SIZEOF
    APTR	gpi_GInfo;
    APTR	gpi_IEvent;
    APTR	gpi_Termination;
    WORD	gpi_MouseX
    WORD	gpi_MouseY

; GM_GOINACTIVE
 STRUCTURE	gpGoInactive,methodid_SIZEOF
    APTR	gpgi_GInfo;

; GM_HANDLEINPUT and GM_GOACTIVE  return code flags
; return GHR_MEACTIVE (0) alone if you want more input.
; Otherwise, return ONE of GHR_NOREUSE and GHR_REUSE, and optionally
; GHR_VERIFY.

; here are the original constant "equates"
GMR_MEACTIVE	EQU $0000 	; (bugfix: was $0001 during beta)
GMR_NOREUSE	EQU $0002
GMR_REUSE	EQU $0004
GMR_VERIFY	EQU $0008	; you MUST set cgp_Termination

; here are standard bit/flag pairs
GMRB_NOREUSE	EQU 1
GMRB_REUSE	EQU 2
GMRB_VERIFY	EQU 3

GMRF_NOREUSE	EQU $0002
GMRF_REUSE	EQU $0004
GMRF_VERIFY	EQU $0008

	ENDC
