	IFND	DFUNC_I
DFUNC_I SET	1
**
**	$VER: gadgets.i 3.0 (08.03.96)
**	Include Release 38.1
**
**	Descriptions of Digital Surface Gadgets.
**	For use with dfunc.library.
**
**	Copyright © 1994, 1995, 1996 by Digital Surface.
**	All rights reserved.
**
**	The first version of Dfunc.library was named digital.library, but was
**	never intended for release.
**
**	Library is Freeware.
**

	IFND	EXEC_TYPES_I
	INCLUDE	"exec/types.i"
	ENDC

; This is the structure of Digital Surface Gadgets (DG_). Remember that if
; you are specifying another gadgetkind than ButtonKind which is default,
; the appropriate structure has to be used cause the values don't necessary
; fit.

 STRUCTURE ButtonGadgets,0	;size: 42 bytes
 
    WORD dg_Left	; x position of gadget
    WORD dg_Top		; y position of gadget
    WORD dg_Width	; width of gadget
    WORD dg_Height	; height of gadget
    WORD dg_ID		; your personal ID for this gadget
    APTR dg_Title1	; title in unpressed state/cycle text or visable lines
    APTR dg_Title2	; title in pressed state (optional)/ or real length
    APTR dg_Image1	; pointer to an image structure/cycle images or top position
    APTR dg_Image2	; image in pressed state (optional)
    LONG dg_ColorPacket ; color packet describing colors of elements in gad.
    LONG dg_Flags	; flags for gadget (see below)
    APTR dg_Font	; pointer to a TextAttr (optional)
    APTR dg_Link	; pointer to another gadget group
    LABEL dg_SIZEOF

; For scaling gadgets these structures are needed internally for the scale
; function. Do NOT alter these structures:

 STRUCTURE GadScale,0

    LONG sca_Size
    LONG sca_Window
    LONG sca_GadList
    WORD sca_OldX
    WORD sca_OldY
    LABEL sca_SIZEOF

;This body structure is used internally by the DFScaleInit()/DFScaleGads()

;## Private:

 STRUCTURE ScaleBody,0

    WORD sca_Top
    WORD sca_Left
    WORD sca_Width
    WORD sca_Height
    LONG sca_Font
    LABEL scb_SIZEOF

** NOTE: These structures are subject to change in future.

;Here is the structure for using the SliderKind gadget:

** NOTE: Yet not final!! DO NOT USE THIS STRUCTURE!!

;## Private:

 STRUCTURE DSLIDER,0	;size: 40 bytes
 
    WORD dgsl_Left	; x position of gadget
    WORD dgsl_Top	; y position of gadget
    WORD dgsl_Width	; width of gadget
    WORD dgsl_Height	; height of gadget
    WORD dgsl_ArrowW	; width of arrow field
    WORD dgsl_ArrowH	; height of arrow field
    APTR dgsl_List	; pointer to pointertable of text
    LONG dgsl_reserved1
    LONG dgsl_reserved2
    LONG dgsl_ColorPacket ;colors of slider text, borders, back etc.
    LONG dgsl_Flags	; see below for flag definitions
    APTR dgsl_Font	; pointer to a TextAttr (optional)
    LONG dgsl_reserved3
    LABEL dgs_SIZEOF

; Here are the FLAG definitions of the gadgets:

DG_PRESSED	EQU	$1	;if you want the gadget to be selected
DG_INPRESSABLE	EQU	$2	;can't press this gadget down
DG_INVISABLE	EQU	$4	;you can't see this one, but it works
DG_INSCALABLE	EQU	$8	;keep same size if a window resize
DG_NOBORDER	EQU	$10	;no border around the gadget
DG_NOBACK	EQU	$20	;make back transperant (overlay on pics etc.)
DG_TEXTLEFT	EQU	$40	;draw text in gadget from left
DG_TEXTRIGHT	EQU	$80	;draw text from right
DG_TEXTSHADOW	EQU	$100	;make shadow on text
DG_HOTKEY	EQU	$200	;respond to hotkeys (see below)
DG_INSENSITIVE	EQU	$400	;don't care about char. case if a hotkey
DG_SHADOWRIGHT	EQU	$800	;shadow on the right side of gadget
DG_SHADOWBOTTOM	EQU	$1000	;shadow below gadget
DG_SHADOWCORNER	EQU	$2000	;shadow right/below of gadget (if matrix')
DG_IMAGECENTER	EQU	$4000	;put image in center of gadget
DG_IMAGERIGHT	EQU	$8000	;draw image from right
DG_GHOSTED	EQU	$10000	;ghosted look and inpressable

DG_CYCLEKIND	EQU	$20000	;make us a cycle gadget
DG_SLIDERKIND	EQU	$40000	;a listview kind of style gadget
DG_PROCESSKIND	EQU	$80000	;start a task or jump to a code when pressed
DG_TEXTKIND	EQU	$100000	;text input
DG_NUMERICKIND	EQU	$200000	;numeric input

DG_MASK		EQU	$400000	;Mask map
DG_PROCTASK	EQU	$800000 ;CreateProc -- SUB call (Code--RTS) is default

DG_DBLBORDERV	EQU	$1000000 ;for different resolutions you can select
DG_DBLBORDERH	EQU	$2000000 ;which border shall be double. This is
				 ;necessary cause we don't use DisplayInfo.
DG_RESERVED2	EQU	$4000000

DG_MOVABLE	EQU	$8000000
DG_PICTURE	EQU	$10000000
DG_TEXTEMBOSS	EQU	$20000000 ;make emboss effect on text. Only useful
				  ;with bigger fonts.
DG_RESERVED3	EQU	$40000000

DG_EXTENDED	EQU	$80000000 ;enable use of dg_Link field for more flags.
				  ;Unfunctional, DO NOT use this flag yet!

;Flag macros:

DG_DBLBORDERS	EQU	DG_DBLBORDERH!DG_DBLBORDERV
DG_SHADOW	EQU	DG_SHADOWRIGHT!DG_SHADOWBOTTOM
DG_HOTKEYS	EQU	DG_HOTKEY!DG_INSENSITIVE

* Flags of the future:
*
* DG_PATTERN	- Set image in patters in the gadget box (dots, squares etc.)

;* Slider kind: DO NOT use this structure!

DG_SLIDERLEFT	EQU	$40	;slider on left side of screen
DG_SLIDERBOTTOM	EQU	$1000	;slider in bottom of screen
DG_SLIDERTOP	EQU	$800	;slider on top of screen
DG_OUTPUTBOX	EQU	$20
DG_KEYS		EQU	$200	;if you want to use the arrow-keys

;you can also use the DG_HOTKEY flag

** BIT definition of FLAGS of DigitalGadgets:

DGB_PRESSED		EQU	0
DGB_INPRESSABLE		EQU	1
DGB_INVISABLE		EQU	2
DGB_INSCALABLE		EQU	3
DGB_NOBORDER		EQU	4
DGB_NOBACK		EQU	5
DGB_TEXTLEFT		EQU	6
DGB_TEXTRIGHT		EQU	7
DGB_TEXTSHADOW		EQU	8
DGB_HOTKEY		EQU	9
DGB_INSENSITIVE		EQU	10
DGB_SHADOWRIGHT		EQU	11
DGB_SHADOWBOTTOM	EQU	12
DGB_SHADOWCORNER	EQU	13
DGB_IMAGECENTER		EQU	14
DGB_IMAGERIGHT		EQU	15
DGB_GHOSTED		EQU	16
DGB_CYCLEKIND		EQU	17
DGB_SLIDERKIND		EQU	18
DGB_PROCESSKIND		EQU	19
DGB_TEXTKIND		EQU	20
DGB_NUMERICKIND		EQU	21
DGB_MASK		EQU	22
DGB_PROCTASK		EQU	23
DGB_DBLBORDERV		EQU	24
DGB_DBLBORDERH		EQU	25

DGB_RESERVED2		EQU	26	;res2

DGB_MOVABLE		EQU	27
DGB_PICTURE		EQU	28
DGB_TEXTEMBOSS		EQU	29

DGB_RESERVED3		EQU	30	;res3

DGB_EXTENDED		EQU	31	;set flag and use link field for more
					;flags (32 bits wide).

;Flag bit macros:

DGB_DBLBORDERS		EQU	DGB_DBLBORDERH!DGB_DBLBORDERV
DGB_SHADOW		EQU	DGB_SHADOWRIGHT!DGB_SHADOWBOTTOM
DGB_HOTKEYS		EQU	DGB_HOTKEY!DGB_INSENSITIVE

;DO NOT USE THESE FLAGS:

;## Private:

DGB_SLIDERLEFT		EQU	4
DGB_SLIDERRIGHT		EQU	5
DGB_SLIDERTOP		EQU	10
DGB_SLIDERBOTTOM	EQU	11
DGB_KEYS		EQU	16

;DFNewPrintText() Flags

DGPT_CENTER		EQU	$1
DGPT_SHADOW		EQU	$2
DGPT_RIGHT		EQU	$4

DGPTB_CENTER		EQU	0
DGPTB_SHADOW		EQU	1
DGPTB_RIGHT		EQU	2

;DFSetFont() Flags

DGF_CHECK		EQU	$0
DGF_FORCE		EQU	$1

DGFB_CHECK		EQU	0
DGFB_FORCE		EQU	1

;DFClrWindow() Flags

CLR_NORMAL		EQU	$0
CLR_GHOSTED		EQU	$1

CLRB_NORMAL		EQU	0
CLRB_GHOSTED		EQU	1

; This structure is used when you are gonna dump windows to printer:
; NOTE: Only used internally, which makes it... private!

  STRUCTURE PrintRastport,0

	struct	pra_IO,100
	long	pra_port1
	long	pra_port2
	long	pra_sig
	long	pra_scr
	long	pra_task
	word	pra_x
	word	pra_y
	word	pra_w
	word	pra_h
	word	pra_scrw
	word	pra_scrh
	long	pra_rast
	long	pra_view
	word	pra_vmode
	long	pra_cmap
	word	pra_xasc
	word	pra_yasc
	word	pra_scrx
	word	pra_scry
	label	pra_SizeOf

 STRUCTURE PrintWindow,0

    WORD prt_Top		;x start position of print
    WORD prt_Left		;y start position
    WORD prt_Width		;width of window to be printed
    WORD prt_Height		;height of window to be printed
    WORD prt_AspectX		;horizontal aspect of print
    WORD prt_AspectY		;vertical aspect of print
    LABEL prt_SIZEOF

* Command numbers for DFPrinterCommand(). Do NOT use undocumented commands!

prcm_init		=	1
prcm_linefeed		=	2
prcm_return		=	3
prcm_reverself		=	4
prcm_normal		=	5
prcm_italics		=	6
prcm_italicsoff		=	7
prcm_underline		=	8
prcm_underlineoff	=	9
prcm_bold		=	10
prcm_boldoff		=	11
prcm_pitch		=	14
prcm_elite		=	15
prcm_eliteoff		=	16
prcm_condensed		=	17
prcm_condensedoff	=	18
prcm_enlarged		=	19
prcm_enlargedoff	=	20
prcm_shadow		=	21
prcm_shadowoff		=	22
prcm_double		=	23
prcm_doubleoff		=	24
prcm_nlq		=	25
prcm_nlqoff		=	26
prcm_superscript	=	27
prcm_superscriptoff	=	28
prcm_subscript		=	29
prcm_subscriptoff	=	30
prcm_normalize		=	31
prcm_partialup		=	32
prcm_partialdown	=	33
prcm_us			=	34
prcm_french		=	35
prcm_german		=	36
prcm_uk			=	37
prcm_danish		=	38
prcm_swedish		=	39
prcm_italian		=	40
prcm_spanish		=	41
prcm_japanene		=	42
prcm_norwegian		=	43
prcm_danish2		=	44
prcm_prop		=	45
prcm_propoff		=	46
prcm_propclr		=	47
prcm_8			=	55
prcm_6			=	56

; This structure is used to define the height, width and zoom position
; of a sample:

 STRUCTURE DrawSample,0

    APTR samp_Sample		;pointer to sample buffer (public,chip)
    WORD samp_Left		;x position of drawing area
    WORD samp_Top		;y position of drawing area
    WORD samp_Width		;width of drawing area
    WORD samp_Height		;heigth of drawing area
    WORD samp_ZoomPos		;start show sample from this position
    WORD samp_ZoomSize		;used as length of visable sample
    LABEL samp_SIZEOF


;DFAllocList() allows you to allocate a memory pool by a list.

 STRUCTURE DF_PoolList,0

    LONG dmeml_Size
    LONG dmeml_Attr
    LABEL dmeml_SIZEOF

DF_IDCMP	=	$8!$10!$200000 ;MouseMove!MouseButtons!VanillaKey

*
*--- From V38 --------------------------------------------------------------
*

DF_IDCMPRAW	=	DF_IDCMP!$400  ;DF_IDCMP!RawKey

;Structure for DFSuggestWindow()

  STRUCTURE SW_Table,0

    LONG sw_width
    LONG sw_height
    LONG sw_barheight
    LABEL sw_SizeOf

; Flags for DFSuggestWindow()

SW_NoTitlebar	=	$1
SW_NoBorders	=	$2
SW_NoDelta	=	$4

BSW_NoTitlebar	=	0
BSW_NoBorders	=	1
BSW_NoDelta	=	2


; Progress bar structure for DFProgressBar().
; Flags defaults is zero which is a horizontal bar.

  STRUCTURE progressbar,0

	APTR	prg_rastport	;important to remember
	LONG	prg_total
	LONG	prg_current
	WORD	prg_x1
	WORD	prg_y1
	WORD	prg_x2
	WORD	prg_y2
	LONG	prg_flags
	BYTE	prg_hicolor
	BYTE	prg_locolor
	BYTE	prg_fillcolor
	BYTE	prg_clearcolor
	LABEL	prg_SizeOF


; prg_flags:

prgf_vertical	=	$0001		;not yet supported

; prg_flags bit values:

prgfb_vertical	=	0

	ENDC	; DFUNC_I
