Commits (30)
Specification
=============
The specification covering the use of cut-and-paste and drag-and-drop in The specification covering the use of cut-and-paste and drag-and-drop in
writable icons is stored in RiscOS/Sources/Desktop/Clipboard. writable icons is stored
https://www.riscosopen.org/wiki/documentation/show/Drag-And-Drop%20Functional%20Specification
WindowManager changes - Clipboard
=================================
In order to provide clipboard functionality, the Wimp has had some extra internal functionality added. Most of the extra calls will be of no major use to other tasks but documentation is supplied here for completeness. Key press handling changes may be relevant, however.
Key press handling
Certain extra key codes are intercepted and handled by the Wimp if the caret is in a writeable icon.
^C Copy selection to clipboard
^K Delete selection
^V Paste selection from clipboard
^X Cut selection to clipboard
Shift ^ left cursor Extend / shrink selection to the left*
Shift ^ right cursor Extend / shrink selection to the right*
* actual end of the selection that is adjusted depends on which part was last adjusted by the user.
If ^C is used in a password icon, no copy is made. Similarly, if ^X is used, no data is copied to the clipboard.
Should a task wish to receive these key codes for its own uses, then the above can be blocked by using the validation string KC. No clipboard selection actions will then take place.
SWIs
====
Wimp_Autoscroll (&400FD)
If bit 3 of the flags in R0 is set, then:
R0 flags
bit 0: 1=>enable horizontal scrolling; 0=>cancel scrolling
bit 3: set
All other bits ignored and should be considered reserved and set to 0.
R1 Pointer to data block
+0 Window handle
+4 Icon handle
On exit, registers preserved. On error, V set and R0 points to standard error block.
This call triggers autoscrolling of a writeable icon. It is used by the Wimp when a drag operation is in progress to scroll the icon when a ghost caret is being positioned.
Wimp_DragBox (&400D0)
Parameters unchanged.
Drag Box block in R1:
+0 Window handle
+4 13
+8-52 unused
Drag box type 13 has been added. Issuing this call will start a selection drag within an icon. The drag is performed on the icon which currently holds the caret. The exact type of selection drag depends on the last click event on the icon.
Wimp_Extend (&400FB)
There is an extra reason code added. It is primarily intended for internal use.
R0 14
R1 Window handle
R2 Icon handle
R3 Pointer to buffer for data if R4<>0
R4 Buffer size or 0 to get required size
On exit, if there is an error then R0 points to a standard error block and V is set.
R4 Space remaining in buffer. Will be negative if R4=0 on entry.
Unlike an indirection string there is no direct way of obtaining the length of an icon validation string from another task. This call allows a copy of the validation string to be obtained safely.
The buffer pointed to in R3 must not be in application space as it is very likely to be paged out. If there is not going to be enough space in the allocated buffer then nothing will be copied and the potential overflow count is returned.
This call should be used twice. On the first call, R4 should be set to 0. On exit, R4 will contain 0 if there is no validation string or a negative number of characters to indicate the buffer size required. R3 is ignored in this case.
On the second call, R3 should point to the newly allocated buffer of correct size and R4 gives the positive buffer size. The validation string is now copied.
Wimp_StartTask (&400DE)
There is a minor change to functionality.
If R0 on entry points to the module title string and the WindowManager task is not running, then the WindowManager task is started.
If any other task is started and the WindowManager task is not running, then the WindowManager task will also be started.
Wimp_SetCaretPosition (&400D2)
Implementation is the same as the Drag and Drop specification but with the addition of one extra variation.
Normally, an icon caret may be set to a particular coordinate by using:
R0 window handle
R1 icon handle
R2 X offset relative to work area origin
R3 Y offset relative to work area origin
R4 undefined
R5 -1
However, R4 is undefined and could be anything.
The additional functionality allows a ghost caret to be set to an icon by using a coordinate rather than a string index:
R0 window handle
R1 icon handle
R2 X offset relative to work area origin
R3 Y offset relative to work area origin
R4 Caret flags
bits 0-15 caret height in OS units
24 use a Wimp-drawn caret rather than the Font Manager caret
30 1 (for ghost caret)
All other bits should be 0
R5 -2
Message passing
===============
In order to enable clipboard and drag and drop functionality, the Wimp will intercept and redirect certain messages. These messages will not be received by their intended destination task but will be handled by the WindowManager task instead.
Message_DataLoad
Message_DataSave
If the destination icon is writeable and the filetype at +40 is TextFile (&FFF) then the message is redirected.
Message_Dragging
If the message is part of a new conversation (ie your_ref=0) and the destination icon is writeable and there is an option of a TextFile (&FFF) in the filetype list at +56 then the message is redirected.
Note that it is the reponsibility of each task to bounce Message_Dragging if they currently have a claim and the pointer moves over one of their writeable icons. A new conversation will then result and the Wimp will perform the interception. Once the pointer leaves the writeable icon, Message_Dragging will again be bounced and the original task can continue again.
Clipboard Manager task
======================
The Wimp will start up a task called Clipboard Manager if it is not running and another task is started (see Wimp_StartTask above).
The Clipboard Manager task handles clipboard operations and clipboard ownership functionality for the Wimp. It also handles drag and drop messaging. It operates as per the drag and drop fucntional specification.
Display buffering
=================
In order to reduce flicker, especially when dragging a selection within an icon, writeable icons are now buffered. On redraw, the output is written first to a memory buffer and then the resulting buffer is written out to the screen.
The memory buffer is pre-allocated on mode change to cover an icon of 256x26 pixels in size. Should a larger icon be plotted, then the buffer size will be increased.
Note that there will still be a flicker if there are other icons beneath the writeable icon, as these will be redrawn and then the writeable icon in the usual way.
Memory usage
============
The clipboard Wimp requires extra memory to hold the display buffer and any clipboard or drag and drop data.
If dynamic areas are supported, then this memory is held in a dynamic area which is limited to 8MB in size. Memory is only claimed for the clipboard or drag and drop if a store is required; the area size will be reduced as far as possible as soon as this usage is over.
If dynamic areas are not supported, then the memory is claimed from the RMA.
...@@ -80,5 +80,7 @@ ...@@ -80,5 +80,7 @@
Option SpacesInFilenames, true ; when hard space is allowed but space is not, convert Option SpacesInFilenames, true ; when hard space is allowed but space is not, convert
Option ExtendReadSlotSize, UseAMBControl :LAND: ShrinkableAreas ; Replacement for Wimp_SlotSize read ops, for machines with >=2GB RAM. Current implementation only caters to AMB+shrinkable Wimp/kernel configs.
END END
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS-Einheiten / Sekunde ...@@ -12,6 +12,8 @@ OSUperSec: OS-Einheiten / Sekunde
OSUperSec2: OS-Einheiten / Sekunde² OSUperSec2: OS-Einheiten / Sekunde²
WSP:Sprite-Bereich WSP:Sprite-Bereich
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Das WIMP konnte sich keinen Arbeitsbereich reservieren. NoClaim:Das WIMP konnte sich keinen Arbeitsbereich reservieren.
...@@ -64,3 +66,4 @@ ErrMem:Die Anwendung ben ...@@ -64,3 +66,4 @@ ErrMem:Die Anwendung ben
ErrNoMv:Speicherverschiebung unmöglich ErrNoMv:Speicherverschiebung unmöglich
KillApp:Drücken Sie Stopp, um –%0” zu beenden. KillApp:Drücken Sie Stopp, um –%0” zu beenden.
KillProg:Drücken Sie die Eingabetaste, um das Programm zu beenden. KillProg:Drücken Sie die Eingabetaste, um das Programm zu beenden.
FileSe:Auswahl
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -11,6 +11,8 @@ OSUperSec: OS Units / second ...@@ -11,6 +11,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second² OSUperSec2: OS Units / second²
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -63,3 +65,4 @@ ErrMem:アプリケーションを実行するために、%0K のメモリーが ...@@ -63,3 +65,4 @@ ErrMem:アプリケーションを実行するために、%0K のメモリーが
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:%0 を終了するには[終了]を押してください。 KillApp:%0 を終了するには[終了]を押してください。
KillProg:プログラムを終了するには決定キーを押します。 KillProg:プログラムを終了するには決定キーを押します。
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -65,3 +67,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -65,3 +67,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -65,3 +67,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -65,3 +67,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -64,3 +66,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection
...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second ...@@ -12,6 +12,8 @@ OSUperSec: OS Units / second
OSUperSec2: OS Units / second OSUperSec2: OS Units / second
WSP:Wimp sprite pool WSP:Wimp sprite pool
WCF:Wimp_ClaimFreeMemory workspace WCF:Wimp_ClaimFreeMemory workspace
WCS:Clipboard workspace
ClipMgr:Clipboard Manager
#{DictTokens} #{DictTokens}
NoClaim:Wimp unable to claim work area NoClaim:Wimp unable to claim work area
...@@ -65,3 +67,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw ...@@ -65,3 +67,4 @@ ErrMem:%0K free memory is needed before the application will start. Quit any unw
ErrNoMv:Unable to move memory ErrNoMv:Unable to move memory
KillApp:Press Stop to terminate %0. KillApp:Press Stop to terminate %0.
KillProg:Press the return key to stop the program or KillProg:Press the return key to stop the program or
FileSe:Selection