home *** CD-ROM | disk | FTP | other *** search
-
- 3:ô ><BasicV$Lib>.Wimp : REM Library routines. v0.07
- 3ô MACHINE: Archimedes
- 3#ô LANGUAGE: BBC BASIC V, v1.04
- 3"ô AUTHOR: Cy Booker,
- 3,Gô 86 Church View, Main Road, Crockenhill, Swanley, Kent.
- 36ô BR8 8JW
- 3@ô FUNCTIONS:
- 3Jô Claim_Stack( size% )
- 3T%ô Custom_Error( flags%, text$ )
- 3^Aô Date Version
- 3hô FileSize( n% )
- 3rô FixedFileSize( n% )
- 3|ô getname( ptr% )
- 3ŷHô PSR_V_set( flags% ) After SYS call
- 3‘ô PSR_V_Set( flags% )
- 3Œ,ô Open_Window_Horz_Centered( window% )
- 3¤'ô Open_Window_Centered( window% )
- 3®7ô Query_Icon_BackCol_And_Delete( window%, icon% )
- 3¸+ô Query_Icon_Shaded( window%, icon% )
- 3Â-ô Query_Icon_Selected( window%, icon% )
- 3Ìô leaf( f$ )
- 3Ö4ô Load_Template( id$, rove%, sprite_pointer% )
- 3à)ô Read_String_Val( window%, icon% )
- 3ê%ô Read_String( window%, icon% )
- 3ô"ô XSizeof_File( file_name$ )
- 3þKô XSet_Colour( RETURN routine, RETURN colour ) ARM code producer
- 4ô :
- 4ô PROCEDURES:
- 4Cô Activate_Wimp() Main loop
- 4&1ô alter_bit( RETURN word%, bit%, boolean% )
- 40ô Cancel_Stop()
- 4:6ô Check_Icon_In_Range( w%, icon%, mini%, maxi% )
- 4D$ô Claim_Null_Reason( reason$ )
- 4Nô Close_Window( window% )
- 4X8ô dim_array( RETURN start%, length%, RETURN end% )
- 4bDô Generic_Init_Wimp( name$, v%, s_v% ) Initialise
- 4l1ô Initiate_Drag( window%, icon%, routine$ )
- 4vDô Open_Pane_Underneath( window%, xmin%, ymin%, xmax%, stack% )
- 4€&ô Open_Window( window%, stack% )
- 4⇩*ô Query_Wimp_Global_Error( prefix$ )
- 4“Hô Rename_Icon( window%, icon%, sprite$ ) Non-indirected
- 4fi&ô Release_Null_Reason( reason$ )
- 4¨&ô Release_Stack( start%, size% )
- 4²3ô Send_Save( filetype%, file_name$, length% )
- 4¼*ô SetCaretPosition( window%, icon% )
- 4Æ$ô Set_Title( window%, title$ )
- 4Ð>ô Set_Window_Extent( window%, width%, height%, resize% )
- 4Ú6ô Set_Icon_Foreground( window%, icon%, colour% )
- 4ä2ô Set_Shade_Icon( window%, icon%, boolean% )
- 4î3ô Set_Select_Icon( window%, icon%, boolean% )
- 4ø'ô unselect_icon( window%, icon% )
- 5%ô select_icon( window%, icon% )
- 5(ô Stop_Action( string$, routine$ )
- 5<ô Update_Icon( window%, icon%, number%, eor%, clear% )
- 5 +ô Update_String( window%, icon%, s$ )
- 5*(ô Wimp_Error_Block( error_block% )
- 54!ô Wimp_Error( num%, text$ )
- 5>ô :
- 5Hô VARIABLES:
- 5R ô Application$ "Edit"
- 5\.ô Version$ "0.12 (17-Apr-1969)"
- 5f@ô Wimp_Active% Boolean, used in case of library error
- 5pô Task_Handle%
- 5z5ô W% Wimp poll block (512 bytes)
- 5☓ô :
- 5‰
- ô NB:
- 5—Gô This is not amenable to compiling, because use procedures names
- 5¢Jô as string literals in the program to cope with drags/null reasons.
- 5¬;ô But can compact to reduce variable names (I think).
- 5¶ô :
- 5Àô UPDATES:
- 5ÊFô 17.03.1991 CJB Added FN_Read_String_Val, FN_Query_Icon_Shaded,
- 5ÔIô PROC_Set_Select_Icon, PROC_Set_Shade_Icon, altered
- 5ÞBô FN_Query_Icon_Selected, so now should work!
- 5èGô Added XSet_Colour, Query_Icon_BackCol_And_Delete
- 5ò3ô Added PROC_Set_Window_Extent
- 5üLô 30.03.1991 CJB Removed all references to old prog. PROC_Stop_Action,
- 6?ô renamed, and now takes string parameter.
- 6Gô 05.04.1991 CJB Added PROC_Set_Icon_Foreground, Library version.
- 6Bô 06.04.1991 CJB Actually used 'em - so now slightly stable.
- 6$@ô So ProgInfo window can have sprites file.
- 6.Fô 07.04.1991 CJB If an error occured between Wimp_Initialise and
- 68Cô Init_Menus, would get stuck in loop. Cured.
- 69Bô 08.04.1991 CJB Added FN_[Fixed]FileSize, PROC_Rename_Icon.
- 6B:
- 6LÝ ¤_Wimp_version : = 007
- 6V:
- 6`Ý ¤_hard_initialise_Wimp
- 6jê Ŷ
- 6t7î Ŷ ê ÷ Ŷ : ò_e( "%.Wimp: hard_initialise_Wimp" )
- 6~" ç ¤_LibHandler_version<012 …
- 6⇦; Ŷ 1, "Needs more recent version of the LibHandler."
- 6‹ Í
- 6†0 ò_load_library( "<BasicV$Lib>.Heap", 007 )
- 6¦ Wimp_Active% = £
- 6° Wimp_Stack_End% = 4 * 1024
- 6º8 ò_Claim_Heap_Block( Wimp_Stack%, Wimp_Stack_End% )
- 6Ä$ Wimp_Stack_End% += Wimp_Stack%
- 6Î# Wimp_Stack_Top% = Wimp_Stack%
- 6Ø# ò_Claim_Heap_Block( W%, 512 )
- 6â query_routine$ = ""
- 6ì dragged$ = ""
- 6ö dragged_button% = 0
- 7 " Application$ = "Application"
- 7
- ) Version$ = "0.00 (01-Jan-1900)"
- 7 Task_Handle% = -1
- 7 :
- 7( Wimp_Error_Fatal% = &960
- 72 Wimp_Error% = &961
- 7<= 0
- 7F:
- 7PKô *********************************************************************
- 7ZKô *** Handy library routines ***
- 7dKô *********************************************************************
- 7n:
- 7xÝ ¤_Date
- 7ŵê t$
- 7… t$ = Á’$, 5, 11)
- 7„ Át$, 3, 1) = "-"
- 7 Át$, 7, 1) = "-"
- 7ª= t$
- 7´:
- 7¾*Ý ¤_XSet_Colour( ø routine, ø colour )
- 7È[OPT pass%
- 7ÒALIGN:.colour EQUD 0
- 7Ü.routine
- 7æ STMFD (sp)!, {R0}
- 7ð LDR R0, colour
- 7ú% SWI "XWimp_SetColour"
- 8, BLVS Write_Global_Error_Block
- 8 LDMFD (sp)!, {R0}
- 8 MOV pc, link
- 8"]
- 8,= 0
- 86:
- 8@E: ô Explicitly sets / reset bit in a word, dependent on boolean.
- 8J,Ý ò_alter_bit( ø word%, bit%, boolean% )
- 8T ç boolean% …
- 8^% word% = word% ☓ (1 << bit%)
- 8h Ì
- 8r& word% = word% € ¬(1 << bit%)
- 8| Í
- 8ŷá
- 8‘:
- 8ŒK: ô If SYS ... TO ... ; C%, Then this function will test for overflow.
- 8¤Ý ¤_PSR_V_set( flags% )
- 8®= (flags% € 1)<>0
- 8¸:
- 8ÂÝ ¤_PSR_V_Set( flags% )
- 8Ì= (flags% € 1)<>0
- 8Ö:
- 8àD: ô Reserve space for an array of length length%, but setting a
- 8ê>: ô variable to the end so can easily check for overflow.
- 8ô,Ý ò_dim_array(ø start%, length%, ø end%)
- 8þ Þ start% length%
- 9 end% = start% + length%
- 9á
- 9:
- 9&Kô *********************************************************************
- 90Kô *** Caret ***
- 9:Kô *********************************************************************
- 9D:
- 9N*Ý ò_SetCaretPosition( window%, icon% )
- 9X^ È− "Wimp_SetCaretPosition", window%, icon%, -1, -1, -1, ©(¤_Read_String(window%, icon%))
- 9bá
- 9l:
- 9vKô *********************************************************************
- 9€Kô *** Windows ***
- 9⇩Kô *********************************************************************
- 9“:
- 9fi&Ý ò_Open_Window( window%, stack% )
- 9¨
- ê ptr%
- 9²! ptr% = ¤_Claim_Stack( 128 )
- 9¼ !ptr% = window%
- 9Æ% È− "Wimp_GetWindowState",, ptr%
- 9Ð ptr%!28 = stack%
- 9Ú! È− "Wimp_OpenWindow",, ptr%
- 9ä" ò_Release_Stack( ptr%, 128 )
- 9îá
- 9ø:
- :Ý ò_Close_Window( window% )
- :
- ê ptr%
- :! ptr% = ¤_Claim_Stack( 128 )
- : !ptr% = window%
- :*" È− "Wimp_CloseWindow",, ptr%
- :4" ò_Release_Stack( ptr%, 128 )
- :>á
- :H:
- :R(Ý ò_Bring_Window_To_Front( window% )
- :\
- ê ptr%
- :f ptr% = ¤_Claim_Stack( 64 )
- :p !ptr% = window%
- :z% È− "Wimp_GetWindowState",, ptr%
- :☓ ptr%!28 = -1
- :‰! È− "Wimp_OpenWindow",, ptr%
- :—! ò_Release_Stack( ptr%, 64 )
- :¢á
- :¬:
- :¶ Ý ò_ReOpen_Window( window% )
- :À
- ê ptr%
- :Ê ptr% = ¤_Claim_Stack( 64 )
- :Ô !ptr% = window%
- :Þ% È− "Wimp_GetWindowState",, ptr%
- :è! È− "Wimp_OpenWindow",, ptr%
- :ò! ò_Release_Stack( ptr%, 64 )
- :üá
- ;:
- ;,Ý ¤_Open_Window_Horz_Centered( window% )
- ;ê ptr%, w%
- ;$# ptr% = ¤_Claim_Stack( 256 )
- ;. ptr%!0 = window%
- ;8K È− "Wimp_GetWindowInfo",, ptr% : ô Get Template defininition.
- ;B w% = ptr%!12 - ptr%!4
- ;L ptr%!0 = window%
- ;V# ptr%!4 = (logmaxx% - w%) Ŵ 2
- ;` ptr%!12 = ptr%!4 + w%
- ;j ptr%!20 = 0
- ;t ptr%!24 = 0
- ;~K ptr%!28 = -1 : ô Open to front of display.
- ;⇦! È− "Wimp_OpenWindow",, ptr%
- ;‹" ò_Release_Stack( ptr%, 256 )
- ;†= ¹
- ;¦:
- ;°'Ý ¤_Open_Window_Centered( window% )
- ;ºê ptr%, w%, h%
- ;Ä# ptr% = ¤_Claim_Stack( 256 )
- ;Î ptr%!0 = window%
- ;ØK È− "Wimp_GetWindowInfo",, ptr% : ô Get Template defininition.
- ;â w% = ptr%!12 - ptr%!4
- ;ì h% = ptr%!16 - ptr%!8
- ;ö ptr%!0 = window%
- <