@ GNU AS assembler header file for TextArea
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:45:47 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.

#ifndef TextArea_Hdr
#  define TextArea_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

#  ifndef Get_Toolbox
#    define Get_Toolbox
#    include "oslib/Toolbox.Hdr"
#  endif

#  ifndef Get_Gadget
#    define Get_Gadget
#    include "oslib/Gadget.Hdr"
#  endif

@Symbols for constants
#  define Class_TextArea 0x4018
#  define TextArea_StateHasVerticalScrollbar 0x1
#  define TextArea_StateHasHorizontalScrollbar 0x2
#  define TextArea_StateWordwrappingEnabled 0x4
#  define TextArea_AllowSelection 0x8
#  define TextArea_AllowSave 0x10
#  define TextArea_AllowLoad 0x20
#  define TextArea_Clipboard 0x40
#  define TextArea_AutoScroll 0x80
#  define TextArea_GetSelectionReturnText 0x1
#  define TextArea_SetColourDesktop 0x1

@Symbols for structure offsets and sizes
        .struct 0
TextArea_Gadget_type           : .skip   Int
TextArea_Gadget_event          : .skip   Int
TextArea_Gadget_text           : .skip   Toolbox_MsgReference
TextArea_Gadget_foreground     : .skip   OS_Colour
TextArea_Gadget_background     : .skip   OS_Colour
TextArea_Gadget                : 

        .struct 0
        Gadget_Object_MEMBERS TextArea_Object
TextArea_Object_type           : .skip   Int
TextArea_Object_event          : .skip   Int
TextArea_Object_text           : .skip   Toolbox_MsgReference
TextArea_Object_foreground     : .skip   OS_Colour
TextArea_Object_background     : .skip   OS_Colour
TextArea_Object                : 

        .struct 0
        .skip   Bits
TextArea_State                 : 

        .struct 0
        .skip   Bits
TextArea_GetSelectionFlags     : 

        .struct 0
        .skip   Bits
TextArea_SetColourFlags        : 

        .struct 0
TextArea_Colour_real           : .skip   OS_Colour
        .struct 0
TextArea_Colour_desktop        : .skip   Wimp_Colour
TextArea_Colour                : 


@Symbols for SWI's and SWI reason codes
#  define TextArea_GetState 0x4018
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4018
   @  R3 = text_area (Toolbox_C)
   @Exit
   @  R0 = state (TextArea_State)

#  define TextArea_SetState 0x4019
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4019
   @  R3 = text_area (Toolbox_C)
   @  R4 = state (TextArea_State)

#  define TextArea_SetText 0x401a
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401A
   @  R3 = text_area (Toolbox_C)
   @  R4 -> text (String)

#  define TextArea_GetTextSize 0x401b
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401B
   @  R3 = text_area (Toolbox_C)
   @  R4 = &0
   @Exit
   @  R5 = buffer_size (Int)

#  define TextArea_GetText 0x401b
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401B
   @  R3 = text_area (Toolbox_C)
   @  R4 = buffer (pointer to String)
   @  R5 = buffer_size (Int)
   @Exit
   @  R5 = length (Int)

#  define TextArea_InsertText 0x401c
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401C
   @  R3 = text_area (Toolbox_C)
   @  R4 = insert_at (Int)
   @  R5 -> text (String)

#  define TextArea_ReplaceText 0x401d
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401D
   @  R3 = text_area (Toolbox_C)
   @  R4 = start (Int)
   @  R5 = end (Int)
   @  R6 -> text (String)

#  define TextArea_GetSelection 0x401e
   @Entry
   @  R0 = flags (TextArea_GetSelectionFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401E
   @  R3 = text_area (Toolbox_C)
   @Exit
   @  R4 = start (Int)
   @  R5 = end (Int)

#  define TextArea_GetSelectionTextSize 0x401e
   @Entry
   @  R0 = &1 :OR: flags (TextArea_GetSelectionFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401E
   @  R3 = text_area (Toolbox_C)
   @  R4 = &0
   @Exit
   @  R5 = buffer_size (Int)

#  define TextArea_GetSelectionText 0x401e
   @Entry
   @  R0 = &1 :OR: flags (TextArea_GetSelectionFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401E
   @  R3 = text_area (Toolbox_C)
   @  R4 = buffer (pointer to String)
   @  R5 = buffer_size (Int)
   @Exit
   @  R5 = length (Int)

#  define TextArea_SetSelection 0x401f
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401F
   @  R3 = text_area (Toolbox_C)
   @  R4 = start (Int)
   @  R5 = end (Int)

#  define TextArea_SetFont 0x4020
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4020
   @  R3 = text_area (Toolbox_C)
   @  R4 -> font_name (String)
   @  R5 = width (Int)
   @  R6 = height (Int)

#  define TextArea_SetColour 0x4021
   @Entry
   @  R0 = flags (TextArea_SetColourFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &4021
   @  R3 = text_area (Toolbox_C)
   @  R4 = foreground (TextArea_Colour)
   @  R5 = background (TextArea_Colour)

#  define TextArea_GetColour 0x4022
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4022
   @  R3 = text_area (Toolbox_C)
   @Exit
   @  R0 = foreground (OS_Colour)
   @  R1 = background (OS_Colour)

#  define TextArea_SetTextBorder 0x4023
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4023
   @  R3 = text_area (Toolbox_C)
   @  R4 = border_size (Int)

#endif
