From 56afccc622e122e6071feedcb3a39cd71f4664a6 Mon Sep 17 00:00:00 2001 From: Robert Sprowson <rsprowson@gitlab.riscosopen.org> Date: Sat, 5 Sep 2020 16:24:21 +0100 Subject: [PATCH] Add minimalist Wimp_ReadSysInfo 21 implementation Since our text selection model follows the Style Guide and there's no means to configure it to the contrary, this subreason can just return fixed values to allow applications to query the state compared with running on a non-Cut-n-Paste Wimp. --- hdr/Wimp | 15 ++++++++++++++- s/Wimp01 | 12 +++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/hdr/Wimp b/hdr/Wimp index 200c298..d5b880a 100644 --- a/hdr/Wimp +++ b/hdr/Wimp @@ -177,7 +177,7 @@ WimpSysInfo_ScrollPause # 1 ; Wimp 3.99 onwards WimpSysInfo_Reserved_ROL18 # 1 ; RISC OS Select WimpSysInfo_Reserved_ROL19 # 1 ; RISC OS Select WimpSysInfo_Reserved_ROL20 # 1 ; RISC OS Select -WimpSysInfo_Reserved_ROL21 # 1 ; RISC OS Select +WimpSysInfo_TextSelection # 1 ; Wimp 5.79 and RISC OS Select onwards WimpSysInfo_Reserved_ROL22 # 1 ; RISC OS Select WimpSysInfo_DragPause # 1 ; Wimp 5.14 onwards WimpSysInfo_DoubleClickPause # 1 ; Wimp 5.14 onwards @@ -221,6 +221,19 @@ WimpTextOp_RightJustify * 1 :SHL: 31 WimpTextOp_VerticalJustify * 1 :SHL: 30 WimpTextOp_Style * 1 :SHL: 29 +; Flags for Wimp_ReadSysInfo text selection + +WimpTextSelection_Enabled * 1:SHL:0 ; Wimp CnP in writeables +WimpTextSelection_EffectNOP * 0 +WimpTextSelection_EffectDelete * 1 +WimpTextSelection_EffectClear * 2 +WimpTextSelection_EffectCut * 3 +WimpTextSelection_EffectMask * 2_11 ; 2 bits to describe the effect +WimpTextSelection_InsertEffectShift * 1 ; Insert key and synonyms +WimpTextSelection_DeleteEffectShift * 3 ; Delete key and synonyms +WimpTextSelection_MoveEffectShift * 5 ; Caret moved with cursors +WimpTextSelection_AutoSelectEnabled * 1:SHL:7 ; Text is auto-selected when caret enters + ; Priority for Wimp_CreateIcon (iconbar) WimpPriority_Maximum * &78000000 ; used for handle = -3 or -4 diff --git a/s/Wimp01 b/s/Wimp01 index 83a7d03..7d82473 100644 --- a/s/Wimp01 +++ b/s/Wimp01 @@ -5523,7 +5523,7 @@ SWIWimp_ReadSysInfo B err_badR0 ; 18= ? (ROL) B err_badR0 ; 19= priority sprite area (ROL) B err_badR0 ; 20= special highlight colour (ROL) - B err_badR0 ; 21= text selection behaviour (ROL) + B sysinfo_textselection ; 21= text selection behaviour B err_badR0 ; 22= caret colour (ROL) B sysinfo_dragging ; 23= mouse drag delay B sysinfo_doubleclicks ; 24= double click delay @@ -5612,6 +5612,16 @@ sysinfo_IconBarInt STMIA sp,{R1-R4} B ExitWimp +sysinfo_textselection + MOV R0,#-1 ; fg always from icon's own colours + MOV R1,#-1 ; bg always from icon's own colours + MOV R2,#WimpTextSelection_Enabled :OR: \ + (WimpTextSelection_EffectDelete:SHL:WimpTextSelection_InsertEffectShift) :OR: \ + (WimpTextSelection_EffectCut:SHL:WimpTextSelection_DeleteEffectShift) :OR: \ + (WimpTextSelection_EffectClear:SHL:WimpTextSelection_MoveEffectShift) + STMIA sp,{R1-R2} + B ExitWimp + sysinfo_dragging LDRB R0,drag_movelimit LDR R1,drag_timelimit -- GitLab