; ; WimpExt.s ; ; WimpExtension I interface ; ; © 1993-1998 Straylight ; ;----- Licensing note ------------------------------------------------------- ; ; This file is part of Straylight's Steel library. ; ; Steel 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 2, or (at your option) ; any later version. ; ; Steel 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 Steel. If not, write to the Free Software Foundation, ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ;----- Notes ---------------------------------------------------------------- ; ; Not all of the calls are done yet (understatement of the year!). I won't ; bother with all of them until WimpExtension II is done. It just isn't ; worth the bother, because most of the others are doable using standard ; RISC_OSlib or Steel features anyway. ; ; Straylight ; ;----- SWI names and numbers ------------------------------------------------ XWimpExt_Initialise EQU &65780 XWimpExt_CloseDown EQU &65781 XWimpExt_SlabIcon EQU &65782 XWimpExt_Redraw EQU &65783 XWimpExt_Action EQU &65784 XWimpExt_IconBarSprite EQU &65785 XWimpExt_IconBarText EQU &65786 XWimpExt_LinkWindows EQU &65787 XWimpExt_OpenLinked EQU &65788 XWimpExt_CloseLinked EQU &65789 XWimpExt_UnLinkWindows EQU &6578A XWimpExt_CurrentTask EQU &6578B XWimpExt_LoadTemplates EQU &6578C XWimpExt_SetIconString EQU &6578D XWimpExt_OpenWindowTop EQU &6578E XWimpExt_SetIcon EQU &6578F XWimpExt_GetIcon EQU &65790 XWimpExt_GetNumberIcon EQU &65791 XWimpExt_SetNumberIcon EQU &65792 XWimpExt_IncNumberIcon EQU &65793 XWimpExt_DecNumberIcon EQU &65794 XWimpExt_SetPointer EQU &65795 XWimpExt_Divide EQU &65796 XWimpExt_ColoursMenu EQU &65797 XWimpExt_AutoRedraw EQU &65798 XWimpExt_CentreWindow EQU &65799 XWimpExt_DragIcon EQU &6579A XWimpExt_PutCaretIcon EQU &6579B XWimpExt_OpenDialogue EQU &6579C XWimpExt_CheckWindowOpen EQU &6579D XWimpExt_CopyString EQU &6579E XWimpExt_SetWindowTitle EQU &6579F XWimpExt_SetIconStringN EQU &657A0 XWimpExt_FindLeaf EQU &657A1 XWimpExt_LimitPointer EQU &657A2 XWimpExt_ReleasePointer EQU &657A3 XWimpExt_OpenFullSize EQU &657A4 XWimpExt_LoadRAMTemplate EQU &657A5 XWimpExt_OpenRequester EQU &657A6 XWimpExt_CloseRequester EQU &657A7 XWimpExt_HideLink EQU &657A8 XWimpExt_UnHideLink EQU &657A9 XWimpExt_SendHelp EQU &657AA XWimpExt_SendWimpHelp EQU &657AB XWimpExt_CreateMenu EQU &657AC XWimpExt_ReCreateMenu EQU &657AD XWimpExt_ShadeEntry EQU &657AE XWimpExt_TickEntry EQU &657AF XWimpExt_SetIconColour EQU &657B0 XWimpExt_ShadeIcon EQU &657B1 XWimpExt_PlotSprite EQU &657B2 XWimpExt_RedrawDraw EQU &657B3 XWimpExt_PrePoll EQU &657B4 XWimpExt_SetExtent EQU &657B5 XWimpExt_MoveCaret EQU &657B6 XWimpExt_GetFontMenu EQU &657B7 XWimpExt_DecodeFontMenu EQU &657B8 XWimpExt_ControlImmediate EQU &657B9 XWimpExt_Heap EQU &657BA XWimpExt_MemCopy EQU &657BB XWimpExt_DataSave EQU &657BC XWimpExt_PlotBorder EQU &657BD XWimpExt_CentreWindowV EQU &657BE XWimpExt_Sort EQU &66380 XWimpExt_MemMove EQU &66381 XWimpExt_MenuWidth EQU &66382 XWimpExt_DataLoad EQU &66383 XWimpExt_MoveCaretIcon EQU &66384 XWimpExt_DrawOp EQU &66385 XWimpExt_SpriteOp EQU &66386 XWimpExt_Intersect EQU &66387 XWimpExt_BorderOp EQU &66388 XWimpExt_ManualLink EQU &66389 XWimpExt_MiscOp EQU &6638A XWimpExt_ViewIcon EQU &6638B XWimpExt_SubstituteArgs EQU &6638C XWimpExt_CreateDraw EQU &6638D XWimpExt_RedirectSprites EQU &6638E ;----- External dependencies ------------------------------------------------ IMPORT |x$stack_overflow| IMPORT wimpt_task IMPORT atexit ;----- Constants and macros ------------------------------------------------- wimpExt__ver EQU 16 ;WimpExt version for Steel ;----- Main code ------------------------------------------------------------ AREA |C$$Code|,CODE,READONLY EXPORT wimpExt_initialise wimpExt_initialise MOV ip,sp STMFD sp!,{v1,fp,ip,lr,pc} SUB fp,ip,#4 CMP sp,sl BLLT |x$stack_overflow| MOV v1,a1 ;Keep hold of flags word BL wimpt_task ;Get the task handle MOV R2,v1 ;Get features word back MOV R1,a1 ;Get task handle again MOV R0,#wimpExt__ver ;Latest version I know of SWI XWimpExt_Initialise ;Initialise the module LDMVSDB fp,{v1,fp,sp,pc}^ ;If there's an error, leave ADR a1,wimpExt_quit ;Point to closedown routine BL atexit ;Shut down the module nicely MOV a1,#0 ;The SWI worked -- no error LDMDB fp,{v1,fp,sp,pc}^ ;Return to sender... wimpExt_quit MOV ip,sp STMFD sp!,{fp,ip,lr,pc} SUB fp,ip,#4 CMP sp,sl BLLT |x$stack_overflow| BL wimpt_task ;Get the task handle SWI XWimpExt_CloseDown ;Inform WimpExt we're dead MOVVC R0,#0 ;If no error, return NULL LDMDB fp,{v1,fp,sp,pc}^ ;Return to sender... EXPORT wimpExt_slabIcon wimpExt_slabIcon STMFD sp!,{v1} ;We're going to corrupt this MOV R4,a3 ;To slab or not to slab... MOV R3,a2 ;Icon to slab or unslab MOV R2,a1 ;Window handle of icon SWI XWimpExt_SlabIcon ;Do the job MOVVC a1,#0 ;If no error, return NULL LDMFD sp!,{v1} MOVS pc,lr EXPORT wimpExt_redraw wimpExt_redraw MOV R1,a1 ;Point to redraw block SWI XWimpExt_Redraw ;Redraw the icons MOVVC a1,#0 ;If no error, return NULL MOVS pc,lr EXPORT wimpExt_action wimpExt_action MOV ip,sp STMFD sp!,{v1,fp,ip,lr,pc} SUB fp,ip,#4 CMP sp,sl BLLT |x$stack_overflow| MOV v1,a1 ;Remember wimp_eventstr ptr BL wimpt_task ;Get my task handle LDR R2,[v1] ;Get the reason code out ADD R1,v1,#4 ;Point to main block SWI XWimpExt_Action ;Do the job LDMVSDB fp,{v1,fp,sp,pc}^ ;Quit now if it failed STR R0,[v1] ;Store (altered) reason code MOV a1,#0 ;SWI was successful LDMDB fp,{v1,fp,sp,pc}^ ;Return to caller EXPORT wimpExt_iconBarSprite wimpExt_iconBarSprite