Commit 2c759475 authored by Ben Avison's avatar Ben Avison
Browse files

UTF-8 support from previous version switched in; additional alphabet-...

UTF-8 support from previous version switched in; additional alphabet- conditional support added as follows:

* Correctly converts character index returned from Font_FindCaret into byte
  index into raw string.
* Left-arrow, right-arrow, delete-left and delete-right now act as far as
  the next character boundary, instead of to the next byte.
* Menu item text justification works again (it relies on overwriting spaces
  with hard space characters, which are two-byte characters in UTF-8).
* General key handling code has been rewritten. The Wimp now has three
  internal key input buffers - one each for taking keyboard-generated,
  task-generated, and function-key-generated strings. Each input buffer is
  processed in chunks of one character, rather than one byte; malformed
  UTF-8 characters are rejected, so tasks don't have to worry about them
  (simplifying their character-handling code). There is also a key output
  buffer, to ensure that (UTF-8) sequences of Key_Pressed events are not
  broken up.
* As a result of the above, multiple calls to Wimp_ProcessKey are now
  possible between calls to Wimp_Poll. Previously, this resulted in bytes
  getting jumbled up - making it useless for input of UTF-8 characters.
* Multi-byte characters are inserted into writeable icons in one go, so you
  don't see a brief flicker of the "malformed character" symbol while the
  initial bytes are being inserted.
* Multi-byte characters that don't entirely fit in a writeable icon buffer
  are not inserted at all.
* A new validation string command ("U") can limit the contents of a
  writeable by number of characters, instead of bytes. This will hide the
  character sizes from the user interface.
* Allowable characters (validation string command "A") now works on Unicode
  characters and character ranges.
* Various other minor bugs are fixed (Wimp_ProcessKey 13 can activate a
  writeable menu item, Shift-arrow keys are always consistent in firing off
  Key_Pressed events, etc.)
* Password icons supported: one symbol is displayed for each character
  (instead of for each byte); the display character (validation string
  command "D") can be any UTF-8 character; correctly displays the caret
  after set-caret-by-index calls, even though characters in the processed
  string are different width to those in the raw string, in password icons.

Other changes:
* The border around NC-style error boxes is resized when the error window
  is grown or shrunk.
* Messages, CmdHelp and Template files made consistent across resource
  directories, including support for all Ursula features.
* ShrinkableAreas turned back on in System=RCA builds.
* User interface features of desktop OS builds standardised.

Version 4.06. Tagged as 'Wimp-4_06'
parent e6cf688e
......@@ -69,7 +69,7 @@
Option TrueIcon1, true ; true colour support, phase 1
Option SwitchingToSprite, true ; update vdu variables when switching to sprite
Option StartTaskPostFilter, true ; always call the post filter on exit from Wimp_StartTask
Option UTF8, false ; support for UTF-8 alphabet (Unicode)
Option UTF8, true ; support for UTF-8 alphabet (Unicode)
END
......@@ -88,7 +88,7 @@
OptionD exit, false ; ExitWimp
OptionD L40, false ; Fancy font in L40-type icons
OptionD menuw, false ; Automatic calculation of menu width
OptionD temp, false
OptionD upcall, false ; Upcalls
OptionD mjs, false ; Mike's debugs
OptionD mjs2, false ; Mike's debugs 2
OptionD mjs3, false ; Mike's debugs 3
......
......@@ -33,7 +33,7 @@
; (this means funny paletted sprites plot
; better in 16bpp+ modes)
Option STB, false ; Running on an STB/NC-like device
Option BuildForNC, false
Option NCErrorBox, false
Option NoCommandPrompt, false ; Don't show "Press SPACE..." when closing command
; window
Option DontCheckModeOnInit, false ; Don't validate the configured Wimp mode in module
......@@ -63,7 +63,7 @@
Option ChocolateScreen, false ; Clean cached screen after redraw loops
Option KernelLocksFreePool, false ; use OS_Memory 10 to lock Free Pool for Wimp_ClaimFreeMemory
Option StretchErrorButtons, true ; Stretch buttons in error box to fit text
Option StretchErrorText, false ; Stretch error box to contain long error messages neatly
Option StretchErrorText, true ; Stretch error box to contain long error messages neatly
Option AutoHourglass, false ; Hourglass automatically on between Wimp_Polls
Option UrsulaHighlighting, false ; Uses icon highlighting algorithm to suit Ursula new-look
Option ForegroundWindows, false ; Layering of windows within each stack
......
......@@ -25,12 +25,21 @@ module_postfix SETS " RISC OS 3.1"
Option PlotSpritesFromPalette, false ; Use palette entries, not translation table
; (this means funny paletted sprites plot
; better in 16bpp+ modes)
Option ShrinkableAreas, false:LAND:Medusa ; Support shrinkable dynamic areas
; (remove multiple memory change messages)
Option UseAMBControl, false ; delegate task memory management to OS_AMBControl
Option StrongARM, false
Option FPE4, false ; assume FPE 4.00 or later present
Option TrueIcon2, true :LAND: TrueIcon1 ; true colour support, phase 2
Option TrueIcon3, true :LAND: TrueIcon2 ; true colour support, phase 3 (windows)
Option IconiseButton, true ; Windows given iconise button
Option BounceClose, true ; Furniture buttons are release-type
Option ForegroundWindows, true ; Layering of windows within each stack
Option SpritePriority, true ; Allow configurable sprite pool priority
Option Autoscr, true ; Add Wimp_AutoScroll and dragbox-within-window facilities
Option StickyEdges, false ; unimplemented ; Allow windows to "stick" when dragged over edge of screen
Option MultiClose, true ; Allow Ctrl-Alt clicks on close/iconise buttons
Option PushBothBars, true ; Push in both scrollbars on adjust-drags
ASSERT International_Help = 0
END
......@@ -26,6 +26,17 @@ module_postfix SETS " RISC OS 3.5"
Option UseAMBControl, false ; delegate task memory management to OS_AMBControl
Option StrongARM, false
Option TrueIcon2, true :LAND: TrueIcon1 ; true colour support, phase 2
Option TrueIcon3, true :LAND: TrueIcon2 ; true colour support, phase 3 (windows)
Option IconiseButton, true ; Windows given iconise button
Option BounceClose, true ; Furniture buttons are release-type
Option ForegroundWindows, true ; Layering of windows within each stack
Option SpritePriority, true ; Allow configurable sprite pool priority
Option Autoscr, true ; Add Wimp_AutoScroll and dragbox-within-window facilities
Option StickyEdges, false ; unimplemented ; Allow windows to "stick" when dragged over edge of screen
Option MultiClose, true ; Allow Ctrl-Alt clicks on close/iconise buttons
Option PushBothBars, true ; Push in both scrollbars on adjust-drags
ASSERT International_Help = 0
END
......@@ -21,6 +21,17 @@ module_postfix SETS " RISC OS 3.6"
Option UseAMBControl, false ; delegate task memory management to OS_AMBControl
Option StrongARM, false
Option TrueIcon2, true :LAND: TrueIcon1 ; true colour support, phase 2
Option TrueIcon3, true :LAND: TrueIcon2 ; true colour support, phase 3 (windows)
Option IconiseButton, true ; Windows given iconise button
Option BounceClose, true ; Furniture buttons are release-type
Option ForegroundWindows, true ; Layering of windows within each stack
Option SpritePriority, true ; Allow configurable sprite pool priority
Option Autoscr, true ; Add Wimp_AutoScroll and dragbox-within-window facilities
Option StickyEdges, false ; unimplemented ; Allow windows to "stick" when dragged over edge of screen
Option MultiClose, true ; Allow Ctrl-Alt clicks on close/iconise buttons
Option PushBothBars, true ; Push in both scrollbars on adjust-drags
ASSERT International_Help <> 0
END
......@@ -16,6 +16,19 @@
; Wimp options for a RISC OS 3.7x build of the Window Manager
;
module_postfix SETS " RISC OS 3.7"
Option TrueIcon2, true :LAND: TrueIcon1 ; true colour support, phase 2
Option TrueIcon3, true :LAND: TrueIcon2 ; true colour support, phase 3 (windows)
Option IconiseButton, true ; Windows given iconise button
Option BounceClose, true ; Furniture buttons are release-type
Option ForegroundWindows, true ; Layering of windows within each stack
Option SpritePriority, true ; Allow configurable sprite pool priority
Option Autoscr, true ; Add Wimp_AutoScroll and dragbox-within-window facilities
Option StickyEdges, false ; unimplemented ; Allow windows to "stick" when dragged over edge of screen
Option MultiClose, true ; Allow Ctrl-Alt clicks on close/iconise buttons
Option PushBothBars, true ; Push in both scrollbars on adjust-drags
ASSERT International_Help <> 0
END
......@@ -16,22 +16,25 @@
; Wimp options for an Ursula build of the Window Manager
;
module_postfix SETS " Ursula"
Option ServiceCallTable, true ; Add Ursula kernel Service Call table
Option TrueIcon2, true :LAND: TrueIcon1 ; true colour support, phase 2
Option TrueIcon3, true :LAND: TrueIcon2 ; true colour support, phase 3 (windows)
Option IconiseButton, true ; Windows given iconise button
Option BounceClose, true ; Furniture buttons are release-type
Option ChocolateScreen, true ; Clean cached screen after redraw loops
Option ShrinkableAreas, true ; Support Shrinkable Dynamic Areas
Option KernelLocksFreePool, true ; use OS_Memory 10 to lock Free Pool for Wimp_ClaimFreeMemory
Option StretchErrorText, true ; Stretch error box to contain long error messages neatly
Option UrsulaHighlighting, true ; Uses icon highlighting algorithm to suit Ursula new-look
Option Euro, true ; Don't map fancy fonts' char 128 to tick - used for Euro
Option TrueIcon2, true :LAND: TrueIcon1 ; true colour support, phase 2
Option TrueIcon3, true :LAND: TrueIcon2 ; true colour support, phase 3 (windows)
Option IconiseButton, true ; Windows given iconise button
Option BounceClose, true ; Furniture buttons are release-type
Option ForegroundWindows, true ; Layering of windows within each stack
Option SpritePriority, true ; Allow configurable sprite pool priority
Option Autoscr, true ; Add Wimp_AutoScroll and dragbox-within-window facilities
Option StickyEdges, false ; unimplemented ; Allow windows to "stick" when dragged over edge of screen
Option MultiClose, true ; Allow Ctrl-Alt clicks on close/iconise buttons
Option Euro, true ; Don't map fancy fonts' char 128 to tick - used for Euro
Option PushBothBars, true ; Push in both scrollbars on adjust-drags
ASSERT International_Help <> 0
......
......@@ -2,7 +2,7 @@ Error:Error
NoError:%0
Watchdog:Stop,Cancel,Next Task
Modifiers:^ ^ ^
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Select SELECT Menu MENU Adjust ADJUST
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Acorn ACORN Select SELECT Menu MENU Adjust ADJUST
OK:Fortst
Continue:Fortst
Quit:Quit
......@@ -49,6 +49,7 @@ BadPtrInR1:Bad pointer passed to Wimp in R1
BadEscapeState:Wimp_Poll called with escape enabled!
BadIconHandle:Illegal icon handle
BadR3:Illegal Wimp_Poll pointer in R3
BadParent:Bad parent window
NoSprites:There is not enough memory to load all of the available sprites. This may affect the appearance of files and applications.
TemplateEOF:End of file while reading template file.
CantKill:Window manager is currently active
......@@ -57,7 +58,8 @@ ID:Please insert %0 '%1'
Space:Press SPACE or click mouse to continue
ErrorF:Message from %0
ErrorP:%0 may have gone wrong. Click Continue to try to resume or Quit to stop %0.
ErrMem:There is not enough free memory to start this application.
ErrMemS:There is not enough free memory to start this application.
ErrMem:%0K free memory is needed before the application will start.
ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or
......@@ -2,7 +2,7 @@ Error:Error
NoError:%0
Watchdog:Stop,Cancel,Next Task
Modifiers:^ ^ ^
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Select SELECT Menu MENU Adjust ADJUST
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Acorn ACORN Select SELECT Menu MENU Adjust ADJUST
OK:Jatka
Continue:Jatka
Quit:Quit
......@@ -49,6 +49,7 @@ BadPtrInR1:Bad pointer passed to Wimp in R1
BadEscapeState:Wimp_Poll called with escape enabled!
BadIconHandle:Illegal icon handle
BadR3:Illegal Wimp_Poll pointer in R3
BadParent:Bad parent window
NoSprites:There is not enough memory to load all of the available sprites. This may affect the appearance of files and applications.
TemplateEOF:End of file while reading template file.
CantKill:Window manager is currently active
......@@ -57,7 +58,8 @@ ID:Please insert %0 '%1'
Space:Press SPACE or click mouse to continue
ErrorF:Message from %0
ErrorP:%0 may have gone wrong. Click Continue to try to resume or Quit to stop %0.
ErrMem:There is not enough free memory to start this application.
ErrMemS:There is not enough free memory to start this application.
ErrMem:%0K free memory is needed before the application will start.
ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or
......@@ -2,7 +2,7 @@ Error:エラー
NoError:%0
Watchdog:終了,キャンセル,次のタスク
Modifiers:^ ^ ^
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Select SELECT Menu MENU Adjust ADJUST
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Acorn ACORN Select SELECT Menu MENU Adjust ADJUST
OK:続行
Continue:続行
Quit:終了
......@@ -49,6 +49,7 @@ BadPtrInR1:Bad pointer passed to Wimp in R1
BadEscapeState:Wimp_Poll called with escape enabled!
BadIconHandle:Illegal icon handle
BadR3:Illegal Wimp_Poll pointer in R3
BadParent:Bad parent window
NoSprites:There is not enough memory to load all of the available sprites. This may affect the appearance of files and applications.
TemplateEOF:End of file while reading template file.
CantKill:Window manager is currently active
......@@ -57,7 +58,8 @@ ID:Please insert %0 '%1'
Space:スペースキーを押すかマウスをクリックすると続行します。
ErrorF:%0 からのメッセージ
ErrorP:%0 は不安定になった可能性があります。再開するには[続行]をクリックしてください。%0 を終了させるには[終了]をクリックしてください。
ErrMem:メモリ不足のため、このアプリケーションを起動できません。
ErrMemS:メモリ不足のため、このアプリケーションを起動できません。
ErrMem:%0K free memory is needed before the application will start.
ErrNoMv:Unable to move memory
KillApp:%0 を終了するには[終了]を押してください。
KillProg:プログラムを終了するには Enter キーを押します。
......@@ -2,7 +2,7 @@ Error:Error
NoError:%0
Watchdog:Stop,Cancel,Next Task
Modifiers:^ ^ ^
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Select SELECT Menu MENU Adjust ADJUST
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Acorn ACORN Select SELECT Menu MENU Adjust ADJUST
OK:Fortsett
Continue:Fortsett
Quit:Quit
......@@ -49,6 +49,7 @@ BadPtrInR1:Bad pointer passed to Wimp in R1
BadEscapeState:Wimp_Poll called with escape enabled!
BadIconHandle:Illegal icon handle
BadR3:Illegal Wimp_Poll pointer in R3
BadParent:Bad parent window
NoSprites:There is not enough memory to load all of the available sprites. This may affect the appearance of files and applications.
TemplateEOF:End of file while reading template file.
CantKill:Window manager is currently active
......@@ -57,7 +58,8 @@ ID:Please insert %0 '%1'
Space:Press SPACE or click mouse to continue
ErrorF:Message from %0
ErrorP:%0 may have gone wrong. Click Continue to try to resume or Quit to stop %0.
ErrMem:There is not enough free memory to start this application.
ErrMemS:There is not enough free memory to start this application.
ErrMem:%0K free memory is needed before the application will start.
ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or
......@@ -2,7 +2,7 @@ Error:Error
NoError:%0
Watchdog:Stop,Cancel,Next Task
Modifiers:^ ^ ^
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Select SELECT Menu MENU Adjust ADJUST
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Acorn ACORN Select SELECT Menu MENU Adjust ADJUST
OK:Fortstt
Continue:Fortstt
Quit:Quit
......@@ -49,6 +49,7 @@ BadPtrInR1:Bad pointer passed to Wimp in R1
BadEscapeState:Wimp_Poll called with escape enabled!
BadIconHandle:Illegal icon handle
BadR3:Illegal Wimp_Poll pointer in R3
BadParent:Bad parent window
NoSprites:There is not enough memory to load all of the available sprites. This may affect the appearance of files and applications.
TemplateEOF:End of file while reading template file.
CantKill:Window manager is currently active
......@@ -57,7 +58,8 @@ ID:Please insert %0 '%1'
Space:Press SPACE or click mouse to continue
ErrorF:Message from %0
ErrorP:%0 may have gone wrong. Click Continue to try to resume or Quit to stop %0.
ErrMem:There is not enough free memory to start this application.
ErrMemS:There is not enough free memory to start this application.
ErrMem:%0K free memory is needed before the application will start.
ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or
......@@ -2,7 +2,7 @@ Error:Error
NoError:%0
Watchdog:Stop,Cancel,Next Task
Modifiers:^ ^ ^
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Select SELECT Menu MENU Adjust ADJUST
KeyNames:Esc ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Print PRINT Break BREAK Pause PAUSE Tab TAB Return RETURN Insert INSERT Home HOME PageUp PAGEUP Delete DELETE Copy COPY End END PageDown PAGEDOWN Enter ENTER Up UP Down DOWN Left LEFT Right RIGHT Acorn ACORN Select SELECT Menu MENU Adjust ADJUST
OK:Continue
Continue:Continue
Quit:Quit
......@@ -49,6 +49,7 @@ BadPtrInR1:Bad pointer passed to Wimp in R1
BadEscapeState:Wimp_Poll called with escape enabled!
BadIconHandle:Illegal icon handle
BadR3:Illegal Wimp_Poll pointer in R3
BadParent:Bad parent window
NoSprites:There is not enough memory to load all of the available sprites. This may affect the appearance of files and applications.
TemplateEOF:End of file while reading template file.
CantKill:Window manager is currently active
......@@ -57,7 +58,8 @@ ID:Please insert %0 '%1'
Space:Press SPACE or click mouse to continue
ErrorF:Message from %0
ErrorP:%0 may have gone wrong. Click Continue to try to resume or Quit to stop %0.
ErrMem:There is not enough free memory to start this application.
ErrMemS:There is not enough free memory to start this application.
ErrMem:%0K free memory is needed before the application will start.
ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or
......@@ -5,8 +5,8 @@
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
Module_MajorVersion SETS "4.05"
Module_Version SETA 405
Module_MajorVersion SETS "4.06"
Module_Version SETA 406
Module_MinorVersion SETS ""
Module_Date SETS "12 Oct 1998"
Module_Date SETS "20 Oct 1998"
END
/* (4.05)
/* (4.06)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 4.05
#define Module_MajorVersion_CMHG 4.06
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Oct 1998
#define Module_Date_CMHG 20 Oct 1998
#define Module_MajorVersion "4.05"
#define Module_Version 405
#define Module_MajorVersion "4.06"
#define Module_Version 406
#define Module_MinorVersion ""
#define Module_Date "12 Oct 1998"
#define Module_Date "20 Oct 1998"
......@@ -2544,9 +2544,9 @@ UpCallCode ROUT
MOV R1,#erf_okbox:OR:erf_cancelbox:OR:erf_omiterror:OR:erf_poll
CMP R5,#bignum
BICCS R1,R1,#erf_poll ; don't poll if timeout too long
Debug temp, "+Wimp_ReportError: flags", R1
Debug upcall, "+Wimp_ReportError: flags", R1
SWI XWimp_ReportError
Debug temp, "-Wimp_ReportError: button", R1
Debug upcall, "-Wimp_ReportError: button", R1
TEQ R1,#0 ; if no decision made, loop & timeout
BNE %FT02
......@@ -2593,7 +2593,7 @@ finishupcall_withmessage
ADRL R0, errorbuffer
SUB R0, r2, r0
Debug temp,"string size",R0
Debug upcall,"string size",R0
ADRL R0, errorbuffer
MOV R1,#erf_okbox:OR:erf_poll ; Draw the Box
SWI XWimp_ReportError
......@@ -2838,7 +2838,9 @@ User_Message_Recorded * 18
User_Message_Acknowledge * 19
max_reason * 20
[ :LNOT: UTF8 ; we've done away with this kludge!
Key_PressedOldData * &FF ; This is never seen outside the wimp.
]
border_normal * 0
......@@ -3461,6 +3463,18 @@ menuhandles # 4*maxmenus ; handle of relevant window
menudata # 4*maxmenus ; ptrs to menu definitions (-1 if dial)
menuselections # 4*maxmenus ; selection index in each menu
[ UTF8
keystring_buflen # 1 ; number of bytes in keystring_buffer (see below)
keyprocess_buflen # 1 ; number of bytes in keyprocess_buffer (see below)
keyin_buffer # 6 ; filled from kernel buffer, for the sake of identifying incoming UTF-8 sequences
keyin_buflen # 1 ; number of bytes in keyin_buffer
keyout_buffer # 5 ; for outputting multi-byte UTF-8 characters as hotkey sequences
keyout_buflen # 1 ; number of bytes in keyout_buffer
alphabet # 1 ; for storing the current alphabet
ALIGNHASH 4
]
[ Autoscr
; main autoscrolling variables
autoscr_state # 4 ; flags word
......@@ -3723,7 +3737,7 @@ menudragdelay # 4
automenu_timeouttime # 4
automenu_inactivetimeout # 4
savedcaretdata # 24
savedcaretdata # 24 ; holds caretdata from start of key handling process
savedvalidation # 4
savedcharcode # 4
......@@ -3746,6 +3760,14 @@ hourglass_status # 4 ; autohourglass status (0 => no hourglas
ALIGNHASH 64
[ UTF8
keystring_buffer # 256 ; for queuing Key$n bytes
keyprocess_buffer # 256 ; for queuing multiple key-originating Wimp_ProcessKey calls
; byte format is the same as bytes read from kernel keyboard buffer
]
ALIGNHASH 64
[ NewErrorSystem
errortitle # 256 ; for building up 'Error from ...'
errortitend # 0
......
......@@ -2206,10 +2206,7 @@ skip_backdrop
SWI XOS_WriteN
;
[ UTF8
MOV R0, #71
MOV R1, #127 ; read alphabet
SWI XOS_Byte
TEQ R1, #ISOAlphabet_UTF8
BL read_current_alphabet
BEQ %FT88
ADR R0, initvdustring1a
MOV R1, #endvdustring1a-initvdustring1a
......@@ -2832,6 +2829,12 @@ inittasks
]
[ MultiClose
STR R0, nextwindowtoiconise
]
[ UTF8
STRB R0, keystring_buflen ; all the key buffers are initially empty
STRB R0, keyprocess_buflen
STRB R0, keyin_buflen
STRB R0, keyout_buflen
]
STRB R0,dragflag
STRB R0,dotdash ; impossible dot-dash pattern
......
......@@ -2178,6 +2178,297 @@ returnclick
trykeys
Debug poll2, "Processing keys"
[ UTF8
; First, check if caret task is queueing keypresses for later handling
LDR handle, caretdata + 0
CMP handle, #0
BLE %FT11 ; still read character (may be hot!)
BL checkhandle ; check it hasn't been deleted!
MOVVS handle, #nullptr
STRVS handle, caretdata + 0 ; if deleted, turn it off
BVS %FT11
LDR R14, [handle, #w_taskhandle]
CMP R14, #0
LDRLT R14, menutaskhandle
LDR R14, [wsptr, R14]
LDR R14, [R14, #task_flagword]
TST R14, #keypress_bit
BNE nothing ; queue for later handling
11
; See if we're in the middle of a multi-byte external key event
LDRB R14, keyout_buflen
TEQ R14, #0
BEQ trykeys_getinternalkeycode
ADRL R1, keyout_buffer
LDRB R6, [R1] ; next byte to process
ADD R2, R1, R14
01 LDRB R0, [R1, #1] ; copy the other bytes down
STRB R0, [R1], #1
CMP R1, R2
BLT %BT01
SUB R14, R14, #1 ; decrement byte count
STRB R14, keyout_buflen
LDR R14, singletaskhandle
CMP R14, #0
BLLE topmost_window
STRLE R0, hotkeyptr ; initialise hotkey system, unless we're single-tasking
ADRL R14, savedcaretdata ; get caret data
LDMIA R14, {R0-R5}
CMP R0, #0 ; is there a caret?
BGT %FT02
BL int_processkey ; if not, send hotkey
B repollwimp ; (no need to check if single-tasking, as we won't get here otherwise)
02 MOV handle, R0
BL checkhandle ; check savedcaret window hasn't been deleted
MOVVS R0, #0
STRVSB R0, keyout_buflen ; if it has (!) then delete continuation byte queue
BVS trykeys ; and restart key processing
LDR R14, [handle, #w_taskhandle]
CMP R14, #0
LDRLT R14, menutaskhandle
Task R14,, "KeyPressed continuation"
STMIA userblk, {R0-R6}
MOV R0, #Key_Pressed
B ExitPoll ; return Key_Pressed event
trykeys_getinternalkeycode
; Get the next "key" from the expanded function key (if applicable)
ADR R5, keystring_buffer
ADRL R7, keystring_buflen
BL get_internal_keycode_from_buffer
CMP R6, #-1 ; was there one?
BNE trykeys_gotinternalkeycode
; Get the next task-generated key
ADR R5, keyprocess_buffer
ADRL R7, keyprocess_buflen
BL get_internal_keycode_from_buffer
CMP R6, #-1 ; was there one?
BNE trykeys_gotinternalkeycode
; Fill our keyboard input buffer from kernel keyboard buffer (needed so we can look ahead)
LDRB R3, keyin_buflen
ADRL R5, keyin_buffer
01 CMP R3, #6
BGE %FT02 ; break from loop if full
MOV R0, #&81 ; OS_Byte 129 (INKEY)
MOV R1, #0
MOV R2, #0 ; time limit 0
SWI XOS_Byte
TEQ R2, #&FF
BEQ %FT02 ; break if no byte available
STRB R1, [R5, R3] ; stick byte in my buffer
ADD R3, R3, #1
B %BT01
02 STRB R3, keyin_buflen
; Get a key from our input buffer
ADR R7, keyin_buflen ; R5 already set up
BL get_internal_keycode_from_buffer
CMP R6, #-1 ; was there one?
BEQ nothing ; no keys to handle
trykeys_gotinternalkeycode
; *All* Key_Pressed events now return caretdata as it is at this time
; - ie. before the writable icon handling messes around with it.
; This saves on the horrible kludge of storing the Key_PressedOldData
; event number in order to specify where to get the caret data from.
Push "R0-R5"
ADR R14, caretdata
LDMIA R14, {R0-R5}
ADRL R14, savedcaretdata
STMIA R14, {R0-R5}
Pull "R0-R5"
; Page in correct task
CMP handle, #0
BLE %FT01
LDR R14, [handle, #w_taskhandle]
CMP R14, #0
LDRLT R14, menutaskhandle
Task R14,, "KeyPressed"
01
; KeyboardMenus gets a look in first
[ KeyboardMenus
LDR R4, menuSP
CMP R4, #0
BLT %FT00 ; no menu open so don't grab special keys
ADR R5, menudata ; if it's a dbox then don't grab keys
LDR R5, [R5, R4]
TST R5, #3
BNE %FT00
ADR R14, menuhandles ; if menu has caret then don't grab keys
LDR R14, [R14, R4]
LDR R0, menucaretwindow
TEQ R0, R14
BEQ %FT00
TEQ R6, #13 ; check for return and cursor keys
BEQ handlemenukey
TST R6, #1:SHL:31
BEQ %FT00
BIC R14, R6, #1:SHL:31
TEQ R14, #&8C
TEQNE R14, #&8D
TEQNE R14, #&8E
TEQNE R14, #&8F
SUBEQ R6, R14, #(&8C-136) ; map onto range 136-139
BEQ handlemenukey
00
]
; Handle escape keypresses
TEQ R6,#&1B ; escape?
BNE %FT02
[ KeyboardMenus
CMP r4, #0 ; if no menu open then skip
BLT %FT02
TST r5, #3 ; check for dialogue
SUBNE r0, r4, #4 ; if dialogue open then just remove it
MOVEQ r0, #-4 ; otherwise remove whole menu tree
CMP r0, #0
BLLT menusdeleted ; send Message_MenusDeleted if whole menu going (preserves r0)
BL closemenus
|
LDR R0,menuSP
CMP R0,#0
BLT %FT02
BL menusdeleted ; send Message_MenusDeleted
MOVVC R0,#-4
BLVC closemenus
]
BVC nothing ; absorb escape if used to close menus
B ExitPoll ; report error if any
02 ; Examine caret state to determine what to do with keypress