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

#ifndef Iconbar_Hdr
#  define Iconbar_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

@Symbols for constants
#  define Class_Iconbar 0x82900
#  define Error_IconbarAllocFailed 0x80ab01
#  define Error_IconbarShortBuffer 0x80ab02
#  define Error_IconbarBadObjectVersion 0x80ab03
#  define Error_IconbarBadFlags 0x80ab04
#  define Error_IconbarNoSuchTask 0x80ab11
#  define Error_IconbarNoSuchMethod 0x80ab12
#  define Error_IconbarNoSuchMiscOpMethod 0x80ab13
#  define Error_IconbarWrongShowType 0x80ab14
#  define Error_IconbarNoText 0x80ab20
#  define Error_IconbarTasksActive 0x80ab21
#  define Iconbar_GenerateSelectAboutToBeShown 0x1
#  define Iconbar_GenerateAdjustAboutToBeShown 0x2
#  define Iconbar_SelectIsMenu 0x4
#  define Iconbar_AdjustIsMenu 0x8
#  define Iconbar_HasText 0x10
#  define Iconbar_GenerateSelectClicked 0x20
#  define Iconbar_GenerateAdjustClicked 0x40
#  define Iconbar_ShowSelectCentered 0x80
#  define Iconbar_ShowAdjustCentered 0x100
#  define Iconbar_ShowSelectAtPointer 0x200
#  define Iconbar_ShowAdjustAtPointer 0x400
#  define Action_IconbarClicked 0x82900
#  define Action_IconbarSelectAboutToBeShown 0x82901
#  define Action_IconbarAdjustAboutToBeShown 0x82902
#  define Iconbar_Select 0x1
#  define Iconbar_Adjust 0x2
#  define Iconbar_ClickedAdjust 0x1
#  define Iconbar_ClickedSelect 0x4

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Bits
Iconbar_Flags                  : 

        .struct 0
Iconbar_Object_flags           : .skip   Iconbar_Flags
Iconbar_Object_position        : .skip   Int
Iconbar_Object_priority        : .skip   Int
Iconbar_Object_sprite_name     : .skip   Toolbox_StringReference
Iconbar_Object_sprite_limit    : .skip   Int
Iconbar_Object_text            : .skip   Toolbox_MsgReference
Iconbar_Object_text_limit      : .skip   Int
Iconbar_Object_menu            : .skip   Toolbox_StringReference
Iconbar_Object_select_action   : .skip   Bits
Iconbar_Object_adjust_action   : .skip   Bits
Iconbar_Object_select_show     : .skip   Toolbox_StringReference
Iconbar_Object_adjust_show     : .skip   Toolbox_StringReference
Iconbar_Object_help_message    : .skip   Toolbox_MsgReference
Iconbar_Object_help_limit      : .skip   Int
Iconbar_Object                 : 

        .struct 0
        Toolbox_ResourceFileObject_MEMBERS Iconbar_ObjectTemplate
Iconbar_ObjectTemplate_objectflags: .skip   Iconbar_Flags
Iconbar_ObjectTemplate_position: .skip   Int
Iconbar_ObjectTemplate_priority: .skip   Int
Iconbar_ObjectTemplate_sprite_name: .skip   Toolbox_StringReference
Iconbar_ObjectTemplate_sprite_limit: .skip   Int
Iconbar_ObjectTemplate_text    : .skip   Toolbox_MsgReference
Iconbar_ObjectTemplate_text_limit: .skip   Int
Iconbar_ObjectTemplate_menu    : .skip   Toolbox_StringReference
Iconbar_ObjectTemplate_select_action: .skip   Bits
Iconbar_ObjectTemplate_adjust_action: .skip   Bits
Iconbar_ObjectTemplate_select_show: .skip   Toolbox_StringReference
Iconbar_ObjectTemplate_adjust_show: .skip   Toolbox_StringReference
Iconbar_ObjectTemplate_help_message: .skip   Toolbox_MsgReference
Iconbar_ObjectTemplate_help_limit: .skip   Int
Iconbar_ObjectTemplate         : 

        .struct 0
        .skip   Toolbox_Full
Iconbar_Full                   : 

        .struct 0
        .skip   Toolbox_ActionHeaderBase
Iconbar_ActionClickedBlock     : 

        .struct 0
Iconbar_ActionAboutToBeShown_tag: .skip   Toolbox_PositionTag
Iconbar_ActionAboutToBeShown_position: 
Iconbar_ActionAboutToBeShown_position_top_left: .skip   OS_Coord
        .struct Iconbar_ActionAboutToBeShown_position
Iconbar_ActionAboutToBeShown_position_full: .skip   Iconbar_Full
Iconbar_ActionAboutToBeShown   : 

        .struct 0
Iconbar_ActionSelectAboutToBeShown_o: .skip   Toolbox_O
Iconbar_ActionSelectAboutToBeShown: 

        .struct 0
Iconbar_ActionAdjustAboutToBeShown_o: .skip   Toolbox_O
Iconbar_ActionAdjustAboutToBeShown: 

        .struct 0
        Toolbox_ActionHeader_MEMBERS Iconbar_ActionSelectAboutToBeShownBlock
Iconbar_ActionSelectAboutToBeShownBlock_o: .skip   Toolbox_O
Iconbar_ActionSelectAboutToBeShownBlock: 

        .struct 0
        Toolbox_ActionHeader_MEMBERS Iconbar_ActionAdjustAboutToBeShownBlock
Iconbar_ActionAdjustAboutToBeShownBlock_o: .skip   Toolbox_O
Iconbar_ActionAdjustAboutToBeShownBlock: 

        .struct 0
        .skip   Bits
Iconbar_SetButton              : 


@Symbols for SWI's and SWI reason codes
.set XIconbar_ClassSWI,0xa2900
.set Iconbar_ClassSWI,0x82900

.set XIconbar_PostFilter,0xa2901
.set Iconbar_PostFilter,0x82901

.set XIconbar_PreFilter,0xa2902
.set Iconbar_PreFilter,0x82902

#  define Iconbar_GetIconHandle 0x0
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &0
   @Exit
   @  R0 = i (Wimp_I)

#  define Iconbar_SetMenu 0x1
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &1
   @  R3 = menu (Toolbox_O)

#  define Iconbar_GetMenu 0x2
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &2
   @Exit
   @  R0 = menu (Toolbox_O)

#  define Iconbar_SetAction 0x3
   @Entry
   @  R0 = flags (Iconbar_SetButton)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &3
   @  R3 = select_action (Bits)
   @  R4 = adjust_action (Bits)

#  define Iconbar_GetAction 0x4
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &4
   @Exit
   @  R0 = select_action (Int)
   @  R1 = adjust_action (Int)

#  define Iconbar_SetShow 0x5
   @Entry
   @  R0 = flags (Iconbar_SetButton)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &5
   @  R3 = select (Toolbox_O)
   @  R4 = adjust (Toolbox_O)

#  define Iconbar_GetShow 0x6
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &6
   @Exit
   @  R0 = select (Toolbox_O)
   @  R1 = adjust (Toolbox_O)

#  define Iconbar_SetHelpMessage 0x7
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &7
   @  R3 -> help_message (String)

#  define Iconbar_GetHelpMessage 0x8
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &8
   @  R3 = buffer (pointer to String)
   @  R4 = size (Int)
   @Exit
   @  R4 = used (Int)

#  define Iconbar_SetText 0x9
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &9
   @  R3 -> text (String)

#  define Iconbar_GetText 0xa
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &A
   @  R3 = buffer (pointer to String)
   @  R4 = size (Int)
   @Exit
   @  R4 = used (Int)

#  define Iconbar_SetSprite 0xb
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &B
   @  R3 -> sprite_name (String)

#  define Iconbar_GetSprite 0xc
   @Entry
   @  R0 = flags (Bits)
   @  R1 = iconbar (Toolbox_O)
   @  R2 = &C
   @  R3 = buffer (pointer to String)
   @  R4 = size (Int)
   @Exit
   @  R4 = used (Int)

#endif
