; Assembler header file for SaveAs
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:59 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 5 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: SaveAs_Hdr
        GBLS    SaveAs_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_Toolbox
        GBLS    Get_Toolbox
        ]
        [       :LNOT: :DEF: Toolbox_Hdr
Get_Toolbox                     SETS    "GET oslib/Toolbox.Hdr"
        |
Get_Toolbox                     SETS    ""
        ]
        $Get_Toolbox

        [       :LNOT: :DEF: Get_Window
        GBLS    Get_Window
        ]
        [       :LNOT: :DEF: Window_Hdr
Get_Window                      SETS    "GET oslib/Window.Hdr"
        |
Get_Window                      SETS    ""
        ]
        $Get_Window

;Symbols for constants
Class_SaveAs                    *       &82BC0
SaveAs_GenerateAboutToBeShown   *       &1
SaveAs_GenerateDialogueCompleted *       &2
SaveAs_NoSelectionButton        *       &4
SaveAs_GivenData                *       &8
SaveAs_ClientSupportsRAMTransfer *       &10
SaveAs_SaveSuccessful           *       &1
SaveAs_SaveSelection            *       &1
SaveAs_SaveSafe                 *       &2
SaveAs_FileIcon                 *       &82BC000
SaveAs_FileName                 *       &82BC001
SaveAs_Cancel                   *       &82BC002
SaveAs_Save                     *       &82BC003
SaveAs_Selection                *       &82BC004
Action_SaveAsAboutToBeShown     *       &82BC0
Action_SaveAsDialogueCompleted  *       &82BC1
Action_SaveAsSaveToFile         *       &82BC2
Action_SaveAsFillBuffer         *       &82BC3
Action_SaveAsSaveCompleted      *       &82BC4
Error_SaveAsTasksActive         *       &80B600
Error_SaveAsAllocFailed         *       &80B601
Error_SaveAsShortBuffer         *       &80B602
Error_SaveAsFileNameTooLong     *       &80B603
Error_SaveAsNoSuchTask          *       &80B611
Error_SaveAsNoSuchMethod        *       &80B612
Error_SaveAsNoSuchMiscOpMethod  *       &80B613
Error_SaveAsNotType1            *       &80B621
Error_SaveAsNotType3            *       &80B623
Error_SaveAsBufferExceeded      *       &80B631
Error_SaveAsDataAddressUnset    *       &80B641
Error_SaveAsNotFullPath         *       &80B642

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

        ^       0
SaveAs_Object_flags             #       SaveAs_Flags
SaveAs_Object_file_name         #       Toolbox_MsgReference
SaveAs_Object_file_type         #       Bits
SaveAs_Object_title             #       Toolbox_MsgReference
SaveAs_Object_title_limit       #       Int
SaveAs_Object_alternative_window_name #       Toolbox_StringReference
SaveAs_Object                   *       @

        ^       0
SaveAs_ObjectTemplate           Toolbox_ResourceFileObject_MEMBERS
SaveAs_ObjectTemplate_objectflags #       SaveAs_Flags
SaveAs_ObjectTemplate_file_name #       Toolbox_MsgReference
SaveAs_ObjectTemplate_file_type #       Bits
SaveAs_ObjectTemplate_title     #       Toolbox_MsgReference
SaveAs_ObjectTemplate_title_limit #       Int
SaveAs_ObjectTemplate_alternative_window_name #       Toolbox_StringReference
SaveAs_ObjectTemplate           *       @

SaveAs_Full                     *       Toolbox_Full

        ^       0
SaveAs_ActionAboutToBeShown_tag #       Toolbox_PositionTag
SaveAs_ActionAboutToBeShown_position *       @
SaveAs_ActionAboutToBeShown_position_top_left #       OS_Coord
        ^       SaveAs_ActionAboutToBeShown_position
SaveAs_ActionAboutToBeShown_position_full #       SaveAs_Full
SaveAs_ActionAboutToBeShown     *       @

        ^       0
SaveAs_ActionSaveToFile_file_name #       212*Char
SaveAs_ActionSaveToFile         *       @

        ^       0
SaveAs_ActionFillBuffer_size    #       Int
SaveAs_ActionFillBuffer_buffer  #       Ptr
SaveAs_ActionFillBuffer_size_saved #       Int
SaveAs_ActionFillBuffer         *       @

        ^       0
SaveAs_ActionSaveCompleted_ref  #       Bits
SaveAs_ActionSaveCompleted_file_name #       208*Char
SaveAs_ActionSaveCompleted      *       @

        ^       0
SaveAs_ActionAboutToBeShownBlock Toolbox_ActionHeader_MEMBERS
SaveAs_ActionAboutToBeShownBlock_tag #       Toolbox_PositionTag
SaveAs_ActionAboutToBeShownBlock_position *       @
SaveAs_ActionAboutToBeShownBlock_position_top_left #       OS_Coord
        ^       SaveAs_ActionAboutToBeShownBlock_position
SaveAs_ActionAboutToBeShownBlock_position_full #       SaveAs_Full
SaveAs_ActionAboutToBeShownBlock *       @

SaveAs_ActionDialogueCompletedBlock *       Toolbox_ActionHeaderBase

        ^       0
SaveAs_ActionSaveToFileBlock    Toolbox_ActionHeader_MEMBERS
SaveAs_ActionSaveToFileBlock_file_name #       212*Char
SaveAs_ActionSaveToFileBlock    *       @

        ^       0
SaveAs_ActionFillBufferBlock    Toolbox_ActionHeader_MEMBERS
SaveAs_ActionFillBufferBlock_buffer_size #       Int
SaveAs_ActionFillBufferBlock_buffer #       Ptr
SaveAs_ActionFillBufferBlock_size_saved #       Int
SaveAs_ActionFillBufferBlock    *       @

        ^       0
SaveAs_ActionSaveCompletedBlock Toolbox_ActionHeader_MEMBERS
SaveAs_ActionSaveCompletedBlock_ref #       Bits
SaveAs_ActionSaveCompletedBlock_file_name #       208*Char
SaveAs_ActionSaveCompletedBlock *       @


;Symbols for SWI's and SWI reason codes
XSaveAs_ClassSWI                *       &A2BC0
SaveAs_ClassSWI                 *       &82BC0

XSaveAs_PostFilter              *       &A2BC1
SaveAs_PostFilter               *       &82BC1

XSaveAs_PreFilter               *       &A2BC2
SaveAs_PreFilter                *       &82BC2

SaveAs_GetWindowID              *       &0
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &0
   ;Exit
   ;  R0 = window (Toolbox_O)

SaveAs_SetTitle                 *       &1
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &1
   ;  R3 -> title (String)

SaveAs_GetTitle                 *       &2
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &2
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R4 = used (Int)

SaveAs_SetFileName              *       &3
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &3
   ;  R3 -> file_name (String)

SaveAs_GetFileName              *       &4
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &4
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R4 = used (Int)

SaveAs_SetFileType              *       &5
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &5
   ;  R3 = file_type (Bits)

SaveAs_GetFileType              *       &6
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &6
   ;Exit
   ;  R0 = file_type (Bits)

SaveAs_SetFileSize              *       &7
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &7
   ;  R3 = file_size (Int)

SaveAs_GetFileSize              *       &8
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &8
   ;Exit
   ;  R0 = file_size (Int)

SaveAs_SelectionAvailable       *       &9
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &9
   ;  R3 = selection_available (Bool)

SaveAs_SetDataAddress           *       &A
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &A
   ;  R3 = data (pointer to data)
   ;  R4 = size (Int)
   ;  R5 = selection (pointer to data)
   ;  R6 = selection_size (Int)

SaveAs_BufferFilled             *       &B
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &B
   ;  R3 = buffer (pointer to data)
   ;  R4 = size (Int)

SaveAs_FileSaveCompleted        *       &C
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &C
   ;  R3 -> file_name (String)

        ]
        END
