
    IFND INTUITION_SGHOOKS_I
INTUITION_SGHOOKS_I SET 1

*** sghooks.i ****************************************************************
*
*  sghooks.i	string gadget extensions and hooks
*
*  $Header: /home/amiga/V36/src/kickstart/intuition/RCS/sghooks.i,v 1.2 89/11/24 00:16:09 jimm Exp $
*
*  Confidential Information: Commodore-Amiga Computer, Inc.
*  Copyright (c) Commodore-Amiga Computer, Inc.
*
****************************************************************************
* CONFIDENTIAL and PROPRIETARY
* Copyright (C) 1985, COMMODORE-AMIGA, INC.
* All Rights Reserved
***************************************************************************

 STRUCTURE StringExtend,0
    ; display specifications
    APTR	sex_Font	; must be an open Font (not TextAttr)
    STRUCT	sex_Pens,2	; color of text/background
    STRUCT	sex_ActivePens,2 ; colors when gadget is active	

    ; edit specifications
    ULONG	sex_InitialModes ; inital mode flags, below
    APTR 	sex_EditHook	; if non-NULL, must supply WorkBuffer
    APTR	sex_WorkBuffer	; must be as large as StringInfo.Buffer

    STRUCT	sex_Reserved,4	; set to 0
 LABEL	sex_SIZEOF


 STRUCTURE SGWork,0
    ; set up when gadget is first activated
    APTR		sgw_Gadget	; the contestant itself
    APTR		sgw_StringInfo	; easy access to sinfo
    APTR		sgw_WorkBuffer	; intuition's planned result
    APTR		sgw_PrevBuffer	; what was there before
    ULONG		sgw_Modes	; current mode

    ; modified for each input event
    APTR		sgw_IEvent	; actual event: do not change
    UWORD		sgw_Code	; character code, if one byte
    SHORT		sgw_BufferPos	; cursor position
    SHORT		sgw_NumChars
    ULONG		sgw_Actions	; what Intuition will do
    LONG		sgw_LongInt	; temp storage for longint
 LABEL	sgw_SIZEOF

; Mode Flags definitions (ONLY first group allowed as InitialModes)
SGM_REPLACE	EQU	1
; please initiate StringInfo with in-range value of BufferPos 
; if you are using SGM_REPLACE mode.

SGM_FIXEDFIELD	EQU $00000002	; fixed length buffer (not implemented yet)
SGM_NOFILTER	EQU $00000004	; don't filter control chars

; These Mode Flags are for internal use only
SGM_NOCHANGE	EQU $00000008	; no edit changes yet
SGM_NOWORKB	EQU $00000010	; Buffer == PrevBuffer
SGM_CONTROL	EQU $00000020	; control char escape mode
SGM_LONGINT	EQU $00000040	; an intuition longint gadget

; String Gadget Action Flags (put in SGWork.Actions by EditHook)
SGA_USE		EQU $1		; use contents of SGWork
SGA_END		EQU $2		; terminate gadget, code in Code field
SGA_BEEP 	EQU $4		; flash the screen for the user
SGA_REUSE 	EQU $8		; reuse input event
SGA_REDISPLAY 	EQU $10		; gadget visuals changed

; function id for only existing custom string gadget edit hook
SGH_KEY		EQU	1 	; process editing keystroke

    ENDC
