; Assembler header file for Gadget
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:59 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Sept 1995

; OSLib---efficient, type-safe, transparent, extensible,
; register-safe API coverage of RISC OS
; 
; Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
; 
; Licence:
; 
;    OSLib is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 1, or (at your option)
; any later version - and this with the following clarification and
; special exception:
; 
;    Linking this library statically or dynamically with other modules
; is making a combined work based on this library. Thus, the terms
; and conditions of the GNU General Public License cover the whole
; combination.
; 
;    As a special exception, the copyright holders of this library
; give you permission to link this library with independent modules
; to produce an executable, regardless of the license terms of these
; independent modules, and to copy and distribute the resulting
; executable under terms of your choice, provided that you also meet,
; for each linked independent module, the terms and conditions of the
; license of that module. An independent module is a module which is
; not derived from or based on this library. If you modify this
; library, you may extend this exception to your version of the library,
; but you are not obliged to do so. If you do not wish to do so, delete
; this exception statement from your version.
; 
;    OSLib is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; 
;    You should have received a copy of the GNU General Public License
; along with this programme; if not, write to the Free Software
; Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

        [       :LNOT: :DEF: Gadget_Hdr
        GBLS    Gadget_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_Wimp
        GBLS    Get_Wimp
        ]
        [       :LNOT: :DEF: Wimp_Hdr
Get_Wimp                        SETS    "GET oslib/Wimp.Hdr"
        |
Get_Wimp                        SETS    ""
        ]
        $Get_Wimp

        [       :LNOT: :DEF: Get_Toolbox
        GBLS    Get_Toolbox
        ]
        [       :LNOT: :DEF: Toolbox_Hdr
Get_Toolbox                     SETS    "GET oslib/Toolbox.Hdr"
        |
Get_Toolbox                     SETS    ""
        ]
        $Get_Toolbox

;Symbols for constants
Gadget_Faded                    *       &80000000
Gadget_AtBack                   *       &40000000
Gadget_NoHandler                *       &0
Gadget_DefaultHandler           *       &1
Gadget_PrivateHandler           *       &2
Gadget_FeatureAddShift          *       0
Gadget_FeatureAdd               *       &3
Gadget_FeatureRemoveShift       *       2
Gadget_FeatureRemove            *       &C
Gadget_FeaturePostAddShift      *       4
Gadget_FeaturePostAdd           *       &30
Gadget_FeatureMethodShift       *       6
Gadget_FeatureMethod            *       &C0
Gadget_FeatureClickShift        *       10
Gadget_FeatureClick             *       &C00
Gadget_FeaturePlotShift         *       16
Gadget_FeaturePlot              *       &30000
Gadget_FeatureSetFocusShift     *       18
Gadget_FeatureSetFocus          *       &C0000
Gadget_FeatureMoveShift         *       20
Gadget_FeatureMove              *       &300000
Gadget_FeatureFadeShift         *       22
Gadget_FeatureFade              *       &C00000

;Symbols for structure offsets and sizes
        ^       0
        #       Bits
Gadget_Flags                    *       @

        ^       0
Gadget_Object_flags             #       Gadget_Flags
Gadget_Object_class_no_and_size #       Bits
Gadget_Object_bbox              #       OS_Box
Gadget_Object_cmp               #       Toolbox_C
Gadget_Object_help_message      #       Toolbox_MsgReference
Gadget_Object_help_limit        #       Int
Gadget_Object_gadget            #       Int
Gadget_Object                   *       @
        
        MACRO
$label                          Gadget_Object_MEMBERS
$label._flags                   #       Gadget_Flags
$label._class_no_and_size       #       Bits
$label._bbox                    #       OS_Box
$label._cmp                     #       Toolbox_C
$label._help_message            #       Toolbox_MsgReference
$label._help_limit              #       Int
        MEND
        
        ^       0
Gadget_ObjectBase               Gadget_Object_MEMBERS
Gadget_ObjectBase               *       @

        ^       0
        #       Bits
Gadget_Feature                  *       @

        ^       0
Gadget_Extension_type           #       Int
Gadget_Extension_valid_flags    #       Gadget_Flags
Gadget_Extension_features       #       Gadget_Feature
Gadget_Extension                *       @

        ^       0
Gadget_ExtensionList_gadget     #       Gadget_Extension
Gadget_ExtensionList            *       @


;Symbols for SWI's and SWI reason codes
Gadget_GetFlags                 *       &40
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &40
   ;  R3 = gadget (Toolbox_C)
   ;Exit
   ;  R0 = flags_out (Gadget_Flags)

Gadget_SetFlags                 *       &41
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &41
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = flags_in (Gadget_Flags)

Gadget_SetHelpMessage           *       &42
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &42
   ;  R3 = gadget (Toolbox_C)
   ;  R4 -> help_message (String)

Gadget_GetHelpMessage           *       &43
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &43
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = help_message (pointer to String)
   ;  R5 = size (Int)
   ;Exit
   ;  R5 = used (Int)

Gadget_GetIconList              *       &44
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &44
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = buffer (pointer to Wimp_I)
   ;  R5 = size (Int)
   ;Exit
   ;  R5 = used (Int)

Gadget_SetFocus                 *       &45
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &45
   ;  R3 = gadget (Toolbox_C)

Gadget_GetType                  *       &46
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &46
   ;  R3 = gadget (Toolbox_C)
   ;Exit
   ;  R0 = type (Int)

Gadget_MoveGadget               *       &47
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &47
   ;  R3 = gadget (Toolbox_C)
   ;  R4 -> bbox (OS_Box)

Gadget_GetBBox                  *       &48
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &48
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = bbox (pointer to OS_Box)

        ]
        END
