; Assembler header file for Scrollbar
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:59 2012
; Tom Hughes, tom@compton.nu, 14 Mar 1999

; 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: Scrollbar_Hdr
        GBLS    Scrollbar_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_Gadget
        GBLS    Get_Gadget
        ]
        [       :LNOT: :DEF: Gadget_Hdr
Get_Gadget                      SETS    "GET oslib/Gadget.Hdr"
        |
Get_Gadget                      SETS    ""
        ]
        $Get_Gadget

;Symbols for constants
Class_Scrollbar                 *       &401B
Action_ScrollbarPositionChanged *       &140183
Scrollbar_HasVerticalScrollbar  *       &1
Scrollbar_HasHorizontalScrollbar *       &2
Scrollbar_BoundsLower           *       &1
Scrollbar_BoundsUpper           *       &2
Scrollbar_BoundsVisibleLength   *       &4
Scrollbar_IncrementsLine        *       &1
Scrollbar_IncrementsPage        *       &2

;Symbols for structure offsets and sizes
        ^       0
Scrollbar_Gadget_type           #       Int
Scrollbar_Gadget_event          #       Int
Scrollbar_Gadget_lower_bound    #       Int
Scrollbar_Gadget_upper_bound    #       Int
Scrollbar_Gadget_value          #       Int
Scrollbar_Gadget_visible_length #       Int
Scrollbar_Gadget_line_increment #       Int
Scrollbar_Gadget_page_increment #       Int
Scrollbar_Gadget                *       @

        ^       0
Scrollbar_Object                Gadget_Object_MEMBERS
Scrollbar_Object_type           #       Int
Scrollbar_Object_event          #       Int
Scrollbar_Object_lower_bound    #       Int
Scrollbar_Object_upper_bound    #       Int
Scrollbar_Object_value          #       Int
Scrollbar_Object_visible_length #       Int
Scrollbar_Object_line_increment #       Int
Scrollbar_Object_page_increment #       Int
Scrollbar_Object                *       @

        ^       0
Scrollbar_PositionChanged_new_position #       Bits
Scrollbar_PositionChanged_direction #       Int
Scrollbar_PositionChanged       *       @

        ^       0
Scrollbar_ActionPositionChanged_new_position #       Bits
Scrollbar_ActionPositionChanged_direction #       Int
Scrollbar_ActionPositionChanged *       @

        ^       0
Scrollbar_ActionPositionChangedBlock Toolbox_ActionHeader_MEMBERS
Scrollbar_ActionPositionChangedBlock_new_position #       Bits
Scrollbar_ActionPositionChangedBlock_direction #       Int
Scrollbar_ActionPositionChangedBlock *       @

        ^       0
        #       Bits
Scrollbar_State                 *       @

        ^       0
        #       Bits
Scrollbar_BoundsFlags           *       @

        ^       0
        #       Bits
Scrollbar_IncrementsFlags       *       @


;Symbols for SWI's and SWI reason codes
Scrollbar_GetState              *       &401B
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401B
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 = state (Scrollbar_State)

Scrollbar_SetState              *       &401C
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401C
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R4 = state (Scrollbar_State)

Scrollbar_SetBounds             *       &401D
   ;Entry
   ;  R0 = flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401D
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R4 = lower_bound (Int)
   ;  R5 = upper_bound (Int)
   ;  R6 = visible_length (Int)

Scrollbar_SetLowerBound         *       &1
   ;Entry
   ;  R0 = &1 :OR: flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401D
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R4 = lower_bound (Int)

Scrollbar_SetUpperBound         *       &2
   ;Entry
   ;  R0 = &2 :OR: flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401D
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R5 = upper_bound (Int)

Scrollbar_SetVisibleLength      *       &4
   ;Entry
   ;  R0 = &4 :OR: flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401D
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R6 = visible_length (Int)

Scrollbar_GetBounds             *       &401E
   ;Entry
   ;  R0 = flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401E
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 = lower_bound (Int)
   ;  R1 = upper_bound (Int)
   ;  R2 = visible_length (Int)

Scrollbar_GetLowerBound         *       &1
   ;Entry
   ;  R0 = &1 :OR: flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401E
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 = lower_bound (Int)
   ;  R1 corrupted
   ;  R2 corrupted

Scrollbar_GetUpperBound         *       &2
   ;Entry
   ;  R0 = &2 :OR: flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401E
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 corrupted
   ;  R1 = upper_bound (Int)
   ;  R2 corrupted

Scrollbar_GetVisibleLength      *       &4
   ;Entry
   ;  R0 = &4 :OR: flags (Scrollbar_BoundsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401E
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 = visible_length (Int)

Scrollbar_SetValue              *       &401F
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &401F
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R4 = value (Int)

Scrollbar_GetValue              *       &4020
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4020
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 = value (Int)

Scrollbar_SetIncrements         *       &4021
   ;Entry
   ;  R0 = flags (Scrollbar_IncrementsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4021
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R4 = line_increment (Int)
   ;  R5 = page_increment (Int)

Scrollbar_SetLineIncrement      *       &1
   ;Entry
   ;  R0 = &1 :OR: flags (Scrollbar_IncrementsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4021
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R4 = line_increment (Int)

Scrollbar_SetPageIncrement      *       &2
   ;Entry
   ;  R0 = &2 :OR: flags (Scrollbar_IncrementsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4021
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R5 = page_increment (Int)

Scrollbar_GetIncrements         *       &4022
   ;Entry
   ;  R0 = flags (Scrollbar_IncrementsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4022
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 = line_increment (Int)
   ;  R1 = page_increment (Int)

Scrollbar_GetLineIncrement      *       &1
   ;Entry
   ;  R0 = &1 :OR: flags (Scrollbar_IncrementsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4022
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 = line_increment (Int)
   ;  R1 corrupted

Scrollbar_GetPageIncrement      *       &2
   ;Entry
   ;  R0 = &2 :OR: flags (Scrollbar_IncrementsFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4022
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 corrupted
   ;  R1 = page_increment (Int)

Scrollbar_SetEvent              *       &4023
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4023
   ;  R3 = scroll_bar (Toolbox_C)
   ;  R4 = event_code (Bits)

Scrollbar_GetEvent              *       &4024
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4024
   ;  R3 = scroll_bar (Toolbox_C)
   ;Exit
   ;  R0 = event_code (Bits)

        ]
        END
