; Assembler header file for Draw
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:44:04 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 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: Draw_Hdr
        GBLS    Draw_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

;Symbols for constants
Draw_OSUnit                     *       256
Draw_Inch                       *       46080
Draw_Point                      *       640
Draw_EndPath                    *       &0
Draw_Continuation               *       &1
Draw_MoveTo                     *       &2
Draw_SpecialMoveTo              *       &3
Draw_CloseGap                   *       &4
Draw_CloseLine                  *       &5
Draw_BezierTo                   *       &6
Draw_GapTo                      *       &7
Draw_LineTo                     *       &8
Draw_FillNonzero                *       &0
Draw_FillNegative               *       &1
Draw_FillEvenOdd                *       &2
Draw_FillPositive               *       &3
Draw_FillWindingRuleShift       *       0
Draw_FillWindingRule            *       &3
Draw_FillFullExterior           *       &4
Draw_FillExteriorBoundary       *       &8
Draw_FillInteriorBoundary       *       &10
Draw_FillFullInterior           *       &20
Draw_FillOutputBBox             *       &2000000
Draw_Fill32BitClean             *       &4000000
Draw_FillCloseOpenSubpaths      *       &8000000
Draw_FillFlatten                *       &10000000
Draw_FillThicken                *       &20000000
Draw_FillReflatten              *       &40000000
Draw_FillFloat                  *       &80000000
Draw_JoinMitred                 *       &0
Draw_JoinRound                  *       &1
Draw_JoinBevelled               *       &2
Draw_CapButt                    *       &0
Draw_CapRound                   *       &1
Draw_CapSquare                  *       &2
Draw_CapTriangular              *       &3
Draw_SpecialInSitu              *       &0
Draw_SpecialFill                *       &1
Draw_SpecialFillBySubpaths      *       &2
Draw_SpecialCount               *       &3
Draw_SpecialBBox                *       &80000000
Error_DrawNoDrawInIRQMode       *       &980
Error_DrawBadDrawReasonCode     *       &981
Error_DrawReservedDrawBits      *       &982
Error_DrawInvalidDrawAddress    *       &983
Error_DrawBadPathElement        *       &984
Error_DrawBadPathSequence       *       &985
Error_DrawMayExpandPath         *       &986
Error_DrawPathFull              *       &987
Error_DrawPathNotFlat           *       &988
Error_DrawBadCapsOrJoins        *       &989
Error_DrawTransformOverflow     *       &98A
Error_DrawDrawNeedsGraphicsMode *       &98B
Error_DrawUnimplementedDraw     *       &9FF
DrawV_ProcessPath               *       &0
DrawV_Fill                      *       &2
DrawV_Stroke                    *       &4
DrawV_StrokePath                *       &6
DrawV_FlattenPath               *       &8
DrawV_TransformPath             *       &A
DrawV_FillClipped               *       &C
DrawV_StrokeClipped             *       &E

;Symbols for structure offsets and sizes
        ^       0
        #       Byte
Draw_Tag                        *       @

        ^       0
        #       Bits
Draw_FillStyle                  *       @

        ^       0
        #       Byte
Draw_JoinStyle                  *       @

        ^       0
        #       Byte
Draw_CapStyle                   *       @

        ^       0
        #       Ptr
Draw_OutputPath                 *       @

        ^       0
Draw_PathElement_tag            #       Draw_Tag
Draw_PathElement_reserved       #       3*Byte
Draw_PathElement_data           *       @
Draw_PathElement_data_end_path  #       Int
        ^       Draw_PathElement_data
Draw_PathElement_data_continuation #       Ptr
        ^       Draw_PathElement_data
Draw_PathElement_data_move_to   #       OS_Coord
        ^       Draw_PathElement_data
Draw_PathElement_data_special_move_to #       OS_Coord
        ^       Draw_PathElement_data
Draw_PathElement_data_bezier_to #       OS_Coord
        ^       Draw_PathElement_data
Draw_PathElement_data_gap_to    #       OS_Coord
        ^       Draw_PathElement_data
Draw_PathElement_data_line_to   #       OS_Coord
        ^       Draw_PathElement_data
Draw_PathElement_data_reserved  #       24*Byte
Draw_PathElement                *       @

        ^       0
Draw_LineStyle_join_style       #       Draw_JoinStyle
Draw_LineStyle_end_cap_style    #       Draw_CapStyle
Draw_LineStyle_start_cap_style  #       Draw_CapStyle
Draw_LineStyle_reserved         #       Byte
Draw_LineStyle_mitre_limit      #       Int
Draw_LineStyle_start_cap_width  #       Short
Draw_LineStyle_start_cap_length #       Short
Draw_LineStyle_end_cap_width    #       Short
Draw_LineStyle_end_cap_length   #       Short
Draw_LineStyle                  *       @

        ^       0
Draw_DashPattern_start          #       Int
Draw_DashPattern_element_count  #       Int
Draw_DashPattern_elements       #       Int
Draw_DashPattern                *       @
        
        MACRO
$label                          Draw_DashPattern_MEMBERS
$label._start                   #       Int
$label._element_count           #       Int
        MEND
        
        ^       0
Draw_DashPatternBase            Draw_DashPattern_MEMBERS
Draw_DashPatternBase            *       @

        ^       0
Draw_Path_elements              #       Draw_PathElement
Draw_Path                       *       @

        ^       0
Draw_ClipDescriptor_path        #       Ptr
Draw_ClipDescriptor_fill_style  #       Draw_FillStyle
Draw_ClipDescriptor_trfm        #       OS_Trfm
Draw_ClipDescriptor             *       @

        ^       0
        #       Int
DrawV_Reason                    *       @


;Symbols for SWI's and SWI reason codes
XDraw_ProcessPath               *       &60700
Draw_ProcessPath                *       &40700
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = fill_style (Draw_FillStyle)
   ;  R2 -> trfm (OS_Trfm)
   ;  R3 = flatness (Int)
   ;  R4 = thickness (Int)
   ;  R5 -> line_style (Draw_LineStyle)
   ;  R6 -> dash_pattern (Draw_DashPattern)
   ;  R7 = processed_path (Draw_OutputPath)
   ;Exit
   ;  R0 = end_or_used (pointer to data)

XDraw_Fill                      *       &60702
Draw_Fill                       *       &40702
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = fill_style (Draw_FillStyle)
   ;  R2 -> trfm (OS_Trfm)
   ;  R3 = flatness (Int)

XDraw_Stroke                    *       &60704
Draw_Stroke                     *       &40704
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = fill_style (Draw_FillStyle)
   ;  R2 -> trfm (OS_Trfm)
   ;  R3 = flatness (Int)
   ;  R4 = thickness (Int)
   ;  R5 -> line_style (Draw_LineStyle)
   ;  R6 -> dash_pattern (Draw_DashPattern)

XDraw_StrokePath                *       &60706
Draw_StrokePath                 *       &40706
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = stroked_path (pointer to Draw_Path)
   ;  R2 -> trfm (OS_Trfm)
   ;  R3 = flatness (Int)
   ;  R4 = thickness (Int)
   ;  R5 -> line_style (Draw_LineStyle)
   ;  R6 -> dash_pattern (Draw_DashPattern)
   ;Exit
   ;  R0 = end_or_used (pointer to data)

XDraw_FlattenPath               *       &60708
Draw_FlattenPath                *       &40708
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = flattened_path (pointer to Draw_Path)
   ;  R2 = flatness (Int)
   ;Exit
   ;  R0 = end_or_used (pointer to data)

XDraw_TransformPath             *       &6070A
Draw_TransformPath              *       &4070A
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = transformed_path (pointer to Draw_Path)
   ;  R2 -> trfm (OS_Trfm)
   ;  R3 = &0
   ;Exit
   ;  R0 = end_or_used (pointer to data)

XDraw_FillClipped               *       &6070C
Draw_FillClipped                *       &4070C
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = fill_style (Draw_FillStyle)
   ;  R2 -> trfm (OS_Trfm)
   ;  R3 = flatness (Int)
   ;  R4 -> clip_descriptor (Draw_ClipDescriptor)

XDraw_StrokeClipped             *       &6070E
Draw_StrokeClipped              *       &4070E
   ;Entry
   ;  R0 -> path (Draw_Path)
   ;  R1 = fill_style (Draw_FillStyle)
   ;  R2 -> trfm (OS_Trfm)
   ;  R3 = flatness (Int)
   ;  R4 = thickness (Int)
   ;  R5 -> line_style (Draw_LineStyle)
   ;  R6 -> dash_pattern (Draw_DashPattern)
   ;  R7 -> clip_descriptor (Draw_ClipDescriptor)

DrawV                           *       &20

        ]
        END
