@ GNU AS assembler header file for ColourPicker
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:46:01 2012
@ Jonathan Coxhead, jonathan@doves.demon.co.uk, 29 June 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.

#ifndef ColourPicker_Hdr
#  define ColourPicker_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

#  ifndef Get_Wimp
#    define Get_Wimp
#    include "oslib/Wimp.Hdr"
#  endif

@Symbols for constants
#  define Error_ColourPickerUninit 0x20d00
#  define Error_ColourPickerBadModel 0x20d01
#  define Error_ColourPickerBadHandle 0x20d02
#  define Error_ColourPickerBadFlags 0x20d03
#  define Error_ColourPickerInUse 0x20d04
#  define Error_ColourPickerModelInUse 0x20d05
#  define Error_ColourPickerBadReason 0x20d06
#  define ColourPicker_EntryDialogueStarting 0x0
#  define ColourPicker_EntryDialogueFinishing 0x1
#  define ColourPicker_EntryRedrawArea 0x2
#  define ColourPicker_EntryUpdateArea 0x3
#  define ColourPicker_EntryReadValues 0x4
#  define ColourPicker_EntrySetValues 0x5
#  define ColourPicker_EntryProcessEvent 0x6
#  define ColourPicker_EntrySetColour 0x7
#  define ColourPicker_EntryLimit 0x8
#  define ColourPicker_DialogueOffersTransparent 0x1
#  define ColourPicker_DialogueTransparent 0x2
#  define ColourPicker_DialogueType 0xc
#  define ColourPicker_DialogueTypeShift 0x2
#  define ColourPicker_DialogueTypeNever 0x0
#  define ColourPicker_DialogueTypeClick 0x1
#  define ColourPicker_DialogueTypeClickDrag 0x2
#  define ColourPicker_DialogueIgnoreHelp 0x10
#  define ColourPicker_DialogueIgnoreKeyPressed 0x20
#  define ColourPicker_ModelSizeRGB 0x10
#  define ColourPicker_ModelSizeCMYK 0x14
#  define ColourPicker_ModelSizeHSV 0x10
#  define ColourPicker_ModelRGB 0x0
#  define ColourPicker_ModelCMYK 0x1
#  define ColourPicker_ModelHSV 0x2
#  define Message_ColourPickerColourChoice 0x47700
#  define Message_ColourPickerColourChanged 0x47701
#  define Message_ColourPickerCloseDialogueRequest 0x47702
#  define Message_ColourPickerOpenParentRequest 0x47703
#  define Message_ColourPickerResetColourRequest 0x47704
#  define ColourPicker_ColourTransparent 0x1
#  define ColourPicker_ColourDragging 0x2
#  define ColourPicker_OpenTransient 0x1
#  define ColourPicker_OpenSubMenu 0x2
#  define ColourPicker_OpenToolbox 0x2
#  define ColourPicker_UpdateOffersTransparent 0x1
#  define ColourPicker_UpdateTransparent 0x2
#  define ColourPicker_UpdateType 0x4
#  define ColourPicker_UpdateVisible 0x8
#  define ColourPicker_UpdateScroll 0x10
#  define ColourPicker_UpdateTitle 0x20
#  define ColourPicker_UpdateColour 0x40
#  define ColourPicker_UpdateModel 0x80
#  define ColourPicker_UpdateIgnoreHelp 0x100
#  define ColourPicker_UpdateIgnoreKeyPressed 0x200

@Symbols for structure offsets and sizes
@ abstract type
#  define ColourPicker_D 4

        .struct 0
ColourPicker_Colour_colour     : .skip   OS_Colour
ColourPicker_Colour_size       : .skip   Int
ColourPicker_Colour_info       : .skip   Int
ColourPicker_Colour            : 
        
        .altmacro
        .macro  ColourPicker_Colour_MEMBERS label
\label&_colour                 : .skip   OS_Colour
\label&_size                   : .skip   Int
        .endm
        
        .struct 0
        ColourPicker_Colour_MEMBERS ColourPicker_ColourBase
ColourPicker_ColourBase        : 

        .struct 0
        .skip   Bits
ColourPicker_DialogueFlags     : 

        .struct 0
ColourPicker_Dialogue_flags    : .skip   ColourPicker_DialogueFlags
ColourPicker_Dialogue_title    : .skip   Ptr
ColourPicker_Dialogue_visible  : .skip   OS_Box
ColourPicker_Dialogue_xscroll  : .skip   Int
ColourPicker_Dialogue_yscroll  : .skip   Int
ColourPicker_Dialogue_colour   : .skip   OS_Colour
ColourPicker_Dialogue_size     : .skip   Int
ColourPicker_Dialogue_info     : .skip   Int
ColourPicker_Dialogue          : 
        
        .altmacro
        .macro  ColourPicker_Dialogue_MEMBERS label
\label&_flags                  : .skip   ColourPicker_DialogueFlags
\label&_title                  : .skip   Ptr
\label&_visible                : .skip   OS_Box
\label&_xscroll                : .skip   Int
\label&_yscroll                : .skip   Int
\label&_colour                 : .skip   OS_Colour
\label&_size                   : .skip   Int
        .endm
        
        .struct 0
        ColourPicker_Dialogue_MEMBERS ColourPicker_DialogueBase
ColourPicker_DialogueBase      : 

        .struct 0
        .skip   Bits
ColourPicker_ModelFlags        : 

        .struct 0
ColourPicker_Model_flags       : .skip   ColourPicker_ModelFlags
ColourPicker_Model_name        : .skip   Ptr
ColourPicker_Model_description : .skip   Ptr
ColourPicker_Model_info_size   : .skip   Int
ColourPicker_Model_pane_size   : .skip   OS_Coord
ColourPicker_Model_entries     : .skip   8*Ptr
ColourPicker_Model             : 

        .struct 0
        .skip   Bits
ColourPicker_ColourFlags       : 

        .struct 0
ColourPicker_MessageColourChoice_d: .skip   ColourPicker_D
ColourPicker_MessageColourChoice_flags: .skip   ColourPicker_ColourFlags
ColourPicker_MessageColourChoice_colour: .skip   OS_Colour
ColourPicker_MessageColourChoice_size: .skip   Int
ColourPicker_MessageColourChoice_info: .skip   Int
ColourPicker_MessageColourChoice: 
        
        .altmacro
        .macro  ColourPicker_MessageColourChoice_MEMBERS label
\label&_d                      : .skip   ColourPicker_D
\label&_flags                  : .skip   ColourPicker_ColourFlags
\label&_colour                 : .skip   OS_Colour
\label&_size                   : .skip   Int
        .endm
        
        .struct 0
        ColourPicker_MessageColourChoice_MEMBERS ColourPicker_MessageColourChoiceBase
ColourPicker_MessageColourChoiceBase: 

        .struct 0
ColourPicker_MessageColourChanged_d: .skip   ColourPicker_D
ColourPicker_MessageColourChanged_flags: .skip   ColourPicker_ColourFlags
ColourPicker_MessageColourChanged_colour: .skip   OS_Colour
ColourPicker_MessageColourChanged_size: .skip   Int
ColourPicker_MessageColourChanged_info: .skip   Int
ColourPicker_MessageColourChanged: 
        
        .altmacro
        .macro  ColourPicker_MessageColourChanged_MEMBERS label
\label&_d                      : .skip   ColourPicker_D
\label&_flags                  : .skip   ColourPicker_ColourFlags
\label&_colour                 : .skip   OS_Colour
\label&_size                   : .skip   Int
        .endm
        
        .struct 0
        ColourPicker_MessageColourChanged_MEMBERS ColourPicker_MessageColourChangedBase
ColourPicker_MessageColourChangedBase: 

        .struct 0
ColourPicker_MessageOpenParentRequest_d: .skip   ColourPicker_D
ColourPicker_MessageOpenParentRequest: 

        .struct 0
ColourPicker_MessageCloseDialogueRequest_d: .skip   ColourPicker_D
ColourPicker_MessageCloseDialogueRequest: 

        .struct 0
ColourPicker_MessageResetColourRequest_d: .skip   ColourPicker_D
ColourPicker_MessageResetColourRequest: 

        .struct 0
        Wimp_MessageHeader_MEMBERS ColourPicker_FullMessageColourChoice
ColourPicker_FullMessageColourChoice_d: .skip   ColourPicker_D
ColourPicker_FullMessageColourChoice_flags: .skip   ColourPicker_ColourFlags
ColourPicker_FullMessageColourChoice_colour: .skip   OS_Colour
ColourPicker_FullMessageColourChoice_array_size: .skip   Int
ColourPicker_FullMessageColourChoice_info: .skip   Int
ColourPicker_FullMessageColourChoice: 
        
        .altmacro
        .macro  ColourPicker_FullMessageColourChoice_MEMBERS label
        Wimp_MessageHeader_MEMBERS \label
\label&_d                      : .skip   ColourPicker_D
\label&_flags                  : .skip   ColourPicker_ColourFlags
\label&_colour                 : .skip   OS_Colour
\label&_array_size             : .skip   Int
        .endm
        
        .struct 0
        ColourPicker_FullMessageColourChoice_MEMBERS ColourPicker_FullMessageColourChoiceBase
ColourPicker_FullMessageColourChoiceBase: 

        .struct 0
        Wimp_MessageHeader_MEMBERS ColourPicker_FullMessageColourChanged
ColourPicker_FullMessageColourChanged_d: .skip   ColourPicker_D
ColourPicker_FullMessageColourChanged_flags: .skip   ColourPicker_ColourFlags
ColourPicker_FullMessageColourChanged_colour: .skip   OS_Colour
ColourPicker_FullMessageColourChanged_array_size: .skip   Int
ColourPicker_FullMessageColourChanged_info: .skip   Int
ColourPicker_FullMessageColourChanged: 
        
        .altmacro
        .macro  ColourPicker_FullMessageColourChanged_MEMBERS label
        Wimp_MessageHeader_MEMBERS \label
\label&_d                      : .skip   ColourPicker_D
\label&_flags                  : .skip   ColourPicker_ColourFlags
\label&_colour                 : .skip   OS_Colour
\label&_array_size             : .skip   Int
        .endm
        
        .struct 0
        ColourPicker_FullMessageColourChanged_MEMBERS ColourPicker_FullMessageColourChangedBase
ColourPicker_FullMessageColourChangedBase: 

        .struct 0
        Wimp_MessageHeader_MEMBERS ColourPicker_FullMessageOpenParentRequest
ColourPicker_FullMessageOpenParentRequest_d: .skip   ColourPicker_D
ColourPicker_FullMessageOpenParentRequest: 

        .struct 0
        Wimp_MessageHeader_MEMBERS ColourPicker_FullMessageCloseDialogueRequest
ColourPicker_FullMessageCloseDialogueRequest_d: .skip   ColourPicker_D
ColourPicker_FullMessageCloseDialogueRequest: 

        .struct 0
        Wimp_MessageHeader_MEMBERS ColourPicker_FullMessageResetColourRequest
ColourPicker_FullMessageResetColourRequest_d: .skip   ColourPicker_D
ColourPicker_FullMessageResetColourRequest: 

        .struct 0
        .skip   Bits
ColourPicker_OpenFlags         : 

        .struct 0
        .skip   Bits
ColourPicker_CloseFlags        : 

        .struct 0
        .skip   Bits
ColourPicker_UpdateFlags       : 

        .struct 0
        .skip   Bits
ColourPicker_ReadFlags         : 

        .struct 0
        .skip   Bits
ColourPicker_SetFlags          : 

        .struct 0
        .skip   Bits
ColourPicker_HelpFlags         : 


@Symbols for SWI's and SWI reason codes
.set XColourPicker_RegisterModel,0x67700
.set ColourPicker_RegisterModel,0x47700
   @Entry
   @  R0 = model_no (Int)
   @  R1 -> model (ColourPicker_Model)
   @  R2 = workspace (pointer to Void)

.set XColourPicker_DeregisterModel,0x67701
.set ColourPicker_DeregisterModel,0x47701
   @Entry
   @  R0 = model_no (Int)

.set XColourPicker_OpenDialogue,0x67702
.set ColourPicker_OpenDialogue,0x47702
   @Entry
   @  R0 = flags (ColourPicker_OpenFlags)
   @  R1 -> dialogue (ColourPicker_Dialogue)
   @Exit
   @  R0 = d (ColourPicker_D)
   @  R1 = w (Wimp_W)

.set XColourPicker_CloseDialogue,0x67703
.set ColourPicker_CloseDialogue,0x47703
   @Entry
   @  R0 = flags (ColourPicker_CloseFlags)
   @  R1 = d (ColourPicker_D)

.set XColourPicker_UpdateDialogue,0x67704
.set ColourPicker_UpdateDialogue,0x47704
   @Entry
   @  R0 = flags (ColourPicker_UpdateFlags)
   @  R1 = d (ColourPicker_D)
   @  R2 -> dialogue (ColourPicker_Dialogue)

.set XColourPicker_ReadDialogue,0x67705
.set ColourPicker_ReadDialogue,0x47705
   @Entry
   @  R0 = flags (ColourPicker_ReadFlags)
   @  R1 = d (ColourPicker_D)
   @  R2 = dialogue (pointer to ColourPicker_Dialogue)
   @Exit
   @  R1 = w (Wimp_W)
   @  R2 = size (Int)

.set XColourPicker_SetColour,0x67706
.set ColourPicker_SetColour,0x47706
   @Entry
   @  R0 = flags (ColourPicker_SetFlags)
   @  R1 -> colour (ColourPicker_Colour)

.set XColourPicker_HelpReply,0x67707
.set ColourPicker_HelpReply,0x47707
   @Entry
   @  R0 = flags (ColourPicker_HelpFlags)
   @  R1 -> help_request (Wimp_Message)

.set XColourPicker_ModelSWI,0x67708
.set ColourPicker_ModelSWI,0x47708

#  define ColourPickerModelSWI_ColourChanged 0x0
   @Entry
   @  R0 = &0
   @  R1 -> colour (ColourPicker_Colour)

#  define ColourPickerModelSWI_ColourChangedByDragging 0x1
   @Entry
   @  R0 = &1
   @  R1 -> colour (ColourPicker_Colour)

#  define ColourPickerModelSWI_ClaimEvent 0x2
   @Entry
   @  R0 = &2
   @  R1 = event (Int)
   @  R2 -> colour (ColourPicker_Colour)

#  define ColourPickerModelSWI_ReleaseEvent 0x3
   @Entry
   @  R0 = &3
   @  R1 = event (Int)
   @  R2 -> colour (ColourPicker_Colour)

#  define ColourPickerModelSWI_ProcessKey 0x4
   @Entry
   @  R0 = &4
   @  R1 = c (Int)
   @  R2 -> colour (ColourPicker_Colour)

#  define Service_ColourPickerLoaded 0x93
   @Entry
   @  R1 = &93
   @  R2 = loaded_service (pointer to code)
   @  R3 = workspace (pointer to Void)

#endif
