; Assembler header file for TaskManager
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:44:04 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 22 May 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: TaskManager_Hdr
        GBLS    TaskManager_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

;Symbols for constants
TaskManager_NameLimit           *       32
TaskManager_ModuleTask          *       &1
TaskManager_DraggableSlot       *       &2
TaskManager_ShutdownExitOnly    *       &1
TaskManager_ShutdownNoPreQuit   *       &2
TaskManager_ShutdownPortablePowerDown *       &4
TaskManager_ShutdownSendMessage *       &8
TaskManager_ShutdownIgnoreUpCalls *       &10
TaskManager_ShutdownReboot      *       &20
TaskManager_ShutdownPowerOff    *       &40
TaskManager_GroupOverview       *       &0
TaskManager_GroupRequired       *       &1000
TaskManager_GroupSubsidiary     *       &2000
TaskManager_GroupCommercial     *       &3000
TaskManager_GroupFreeware       *       &4000
TaskManager_GroupUser           *       &5000
TaskManager_GroupMask           *       &F000

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

        ^       0
TaskManager_Task_task           #       Wimp_T
TaskManager_Task_name           #       Ptr
TaskManager_Task_slot_size      #       Int
TaskManager_Task_flags          #       TaskManager_Flags
TaskManager_Task                *       @

        ^       0
        #       Bits
TaskManager_ShutdownFlags       *       @

        ^       0
        #       Bits
TaskManager_GroupID             *       @


;Symbols for SWI's and SWI reason codes
XTaskManager_TaskNameFromHandle *       &62680
TaskManager_TaskNameFromHandle  *       &42680
   ;Entry
   ;  R0 = task (Wimp_T)
   ;Exit
   ;  R0 -> name (String)

XTaskManager_EnumerateTasks     *       &62681
TaskManager_EnumerateTasks      *       &42681
   ;Entry
   ;  R0 = context (Int)
   ;  R1 = task (pointer to TaskManager_Task)
   ;  R2 = size (Int)
   ;Exit
   ;  R0 = context_out (Int)
   ;  R1 -> end (Char)
   ;  R2 corrupted

XTaskManager_Shutdown           *       &62682
TaskManager_Shutdown            *       &42682
   ;Entry
   ;  R0 = flags (TaskManager_ShutdownFlags)

XTaskManager_StartTask          *       &62683
TaskManager_StartTask           *       &42683
   ;Entry
   ;  R0 -> path_name (Char)

Service_TaskManagerAcknowledgements *       &42680
   ;Entry
   ;  R1 = &42680
   ;  R2 = add_message (pointer to code)

        ]
        END
