Commit d137f7ac authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Change to method of window highlighting

The change made in Wimp-5_02 to Wimp-5_03 (to permit 'f' prefixed toolsprites) introduced a set of interesting boundary cases not covered by that scheme.
This commit restores the former behaviour, while retaining its simplification of H/V scrollbar plotting (beefed up with a few ASSERTs).
Part of fix for ticket #323.

Tagged as Wimp-5_30-pre4.
parent c641945a
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.1.
;
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
......
......@@ -3,7 +3,7 @@
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
*/
#define Module_MajorVersion_CMHG 5.29
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 21 May 2013
......
......@@ -78,43 +78,15 @@ $lab
MEND
MACRO
$lab AddIcon $index,$name,$pressable,$sprite,$width,$height
LCLS focus
LCLS pushed
LCLS iname
LCLS isprite
[ ($index :AND: 2_01) > 0
pushed SETS "p"
|
pushed SETS ""
]
[ ($index :AND: 2_10) > 0
focus SETS "f"
|
focus SETS ""
]
iname SETS "$pushed" :CC: "$focus" :CC: "$name"
[ "$sprite" = ""
[ "$pressable" = ""
isprite SETS "$sprite"
|
isprite SETS "$focus" :CC: "$name"
]
$lab AddIcon $name,$pressable,$sprite,$width,$height
int_AddIcon $name, $sprite, $width, $height
[ "$pressable"=""
[ "$sprite"=""
int_AddIcon "p$name", $sprite, $width, $height
|
[ "$pressable" = ""
isprite SETS "$pushed" :CC: "$focus" :CC: "$sprite"
|
isprite SETS "$focus" :CC: "$sprite"
]
int_AddIcon "p$name", "p$sprite", $width, $height
]
int_AddIcon "$iname", "$isprite", $width, $height
]
MEND
MACRO
......
......@@ -8206,11 +8206,6 @@ redrawoutlp_done_tracing
BLNE maketoollist ; No then rebuild tool_list
LDRNE R4,tool_list
01
TEQ R4, #0 ; Empty?
TSTNE R3, #ws_hasfocus ; does our window have the input focus?
MOVNE R14, #tool_blank ; if so, get index of last icon
ADDNE R4,R4,R14,LSR #1 ; r4 -> upper table half (=focus icons)
[ TrueIcon3
LDR R14, truetitlecolour
LDR R0, =rgb_lightgrey
......@@ -8524,8 +8519,7 @@ novscroll
BL forcetint_on
]
TEQ R4,#0
LDRNE R14,tool_list
LDRNE R2,[R14,#tool_blank] ; blank splot type tool icon thingi?
LDRNE R2,[R4,#tool_blank] ; blank splot type tool icon thingi?
TEQNE R2,#0
BLNE draw_spriteglyph ; plot the sprite if thats present
LDREQ R1,=sysicon
......
......@@ -415,89 +415,73 @@ ct_grey = sc_verylightgrey, sc_verylightgrey, sc_verylightgrey, sc_veryl
;; Handle replaceable window gadgets, this is simply a set of sprites which
;; can be used to replace all the window bits and bobs within the system.
;;
;; All icons are allowed to give four states;
;; - normal, this is the default state of an icon
;; - pressed normal, used when a mouse button is depressed over the icon
;; - focus, used when window has the input focus
;; - pressed focus, window has focus and mouse button is down over icon
;; Tools are allowed to give two states; normal + pressed, though for some the
;; pressed state is omitted (eg. the scroll bar wells).
;;
;; all gadgets must be defined with the same palette and same mode,
;; mixing is not allowed. Sprites are allowed to have mode suffix
;; to allow different depths to be supported.
;; All gadgets must be defined with the same palette and same mode, mixing is not
;; allowed. Sprites are allowed to have mode suffix to allow different
;; EX EY factors to be supported.
;;-----------------------------------------------------------------------------
;;-----------------------------------------------------------------------------
;; Define the list of sprites and its workspace for the caching block.
;;
;; The table describes the sprite name and which information is important,
;; such as its width + depth.
;; The table describes the sprite name and which information is important, such
;; as its width + depth.
;;
;; The table is built up of four subtables, one for each state of an icon.
;; The LoopCnt variable determines which subtable will be built;
;; 0, 1, 2, 3 for normal, pressed normal, focus, pressed focus.
;;-----------------------------------------------------------------------------
spritetable
^ 0
AddIcon back,,"bicon", back_width, title_height
AddIcon close,,"cicon", close_width, title_height
AddIcon toggle,,"ticon", vscroll_width, title_height
AddIcon toggle1,,"ticon1", vscroll_width, title_height
AddIcon size,,"sicon", vscroll_width, hscroll_height
[ IconiseButton
AddIcon iconise,,"iicon", iconise_width, title_height
]
GBLA LoopCnt
LoopCnt SETA 0
WHILE LoopCnt < 4
AddIcon LoopCnt,back,,"bicon", back_width, title_height
AddIcon LoopCnt,close,,"cicon", close_width, title_height
AddIcon LoopCnt,toggle,,"ticon", vscroll_width, title_height
AddIcon LoopCnt,toggle1,,"ticon1", vscroll_width, title_height
AddIcon LoopCnt,size,,"sicon", vscroll_width, hscroll_height
[ IconiseButton
AddIcon LoopCnt,iconise,,"iicon", iconise_width, title_height
]
AddIcon LoopCnt,up,,"uicon", vscroll_width, up_height
AddIcon LoopCnt,down,,"dicon", vscroll_width, down_height
AddIcon LoopCnt,right,,"ricon", right_width, hscroll_height
AddIcon LoopCnt,left,,"licon", left_width, hscroll_height
AddIcon up,,"uicon", vscroll_width, up_height
AddIcon down,,"dicon", vscroll_width, down_height
AddIcon right,,"ricon", right_width, hscroll_height
AddIcon left,,"licon", left_width, hscroll_height
AddIcon LoopCnt,tbarlcap,,,title_left,title_height
AddIcon LoopCnt,tbarmidt,,,title_sectionwidth,title_topheight
AddIcon LoopCnt,tbarmidb,,,title_sectionwidth,title_bottomheight
AddIcon LoopCnt,tbarrcap,,,title_right,title_height
AddIcon tbarlcap,,,title_left,title_height
AddIcon tbarmidt,,,title_sectionwidth,title_topheight
AddIcon tbarmidb,,,title_sectionwidth,title_bottomheight
AddIcon tbarrcap,,,title_right,title_height
AddIcon LoopCnt,vwelltcap,no,,vscroll_width,vscroll_top
AddIcon LoopCnt,vwellt,no,,vscroll_width,vscroll_topfill
AddIcon vwelltcap,no,,vscroll_width,vscroll_top
AddIcon vwellt,no,,vscroll_width,vscroll_topfill
AddIcon LoopCnt,vbart,,,vscroll_width,vscroll_blobtop
AddIcon LoopCnt,vbarmid,,,vscroll_width,vscroll_blobfill
AddIcon LoopCnt,vbarb,,,vscroll_width,vscroll_blobbottom
AddIcon vbart,,,vscroll_width,vscroll_blobtop
AddIcon vbarmid,,,vscroll_width,vscroll_blobfill
AddIcon vbarb,,,vscroll_width,vscroll_blobbottom
AddIcon LoopCnt,vwellb,no,,vscroll_width,vscroll_bottomfill
AddIcon LoopCnt,vwellbcap,no,,vscroll_width,vscroll_bottom
AddIcon vwellb,no,,vscroll_width,vscroll_bottomfill
AddIcon vwellbcap,no,,vscroll_width,vscroll_bottom
AddIcon LoopCnt,hwelllcap,no,,hscroll_left,hscroll_height
AddIcon LoopCnt,hwelll,no,,hscroll_leftfill,hscroll_height
AddIcon hwelllcap,no,,hscroll_left,hscroll_height
AddIcon hwelll,no,,hscroll_leftfill,hscroll_height
AddIcon LoopCnt,hbarl,,,hscroll_blobleft,hscroll_height
AddIcon LoopCnt,hbarmid,,,hscroll_blob,hscroll_height
AddIcon LoopCnt,hbarr,,,hscroll_blobright,hscroll_height
AddIcon hbarl,,,hscroll_blobleft,hscroll_height
AddIcon hbarmid,,,hscroll_blob,hscroll_height
AddIcon hbarr,,,hscroll_blobright,hscroll_height
AddIcon LoopCnt,hwellr,no,,hscroll_rightfill,hscroll_height
AddIcon LoopCnt,hwellrcap,no,,hscroll_right,hscroll_height
AddIcon hwellr,no,,hscroll_rightfill,hscroll_height
AddIcon hwellrcap,no,,hscroll_right,hscroll_height
[ hvblip
AddIcon LoopCnt,hblip,,,hscroll_blipwidth,hscroll_height
AddIcon LoopCnt,vblip,,,vscroll_width,vscroll_blipheight
AddIcon hblip,,,hscroll_blipwidth,hscroll_height
AddIcon vblip,,,vscroll_width,vscroll_blipheight
]
LoopCnt SETA LoopCnt+1
WEND
; this must always be the *LAST* sprite in the list!
AddIcon 0,blank,no,"blicon",vscroll_width,hscroll_height
AddIcon blank,no,"blicon",vscroll_width,hscroll_height
ALIGN
......@@ -714,7 +698,6 @@ cachetoolspriteaddress ; [spritename], [thisCBptr], [lengthflags] as for cachesp
Pull "PC" ; total failure, exit with
07
ADD SP,SP,#16
ADDVS R8,R8,#4*2
BVS %FT30 ; if not found then skip
......@@ -956,71 +939,9 @@ cachetoolspriteaddress ; [spritename], [thisCBptr], [lengthflags] as for cachesp
MOV R14,#8 ; this one is constant = defines distance of non-changing borders
STRB R14,scroll_sidemargin
;
BL EnsureToolIcons
EXITS
LTORG
;-------------------------------------------------------------------------------
; Ensure that all the various formats of the toolicons have valid sprites.
; We'll assume that the plain toolicon sprites are all present. First we
; check the pressed toolicon sprites. If one or more are missing then we
; replace them by their non-pressed equivalent.
; Next we check all the focus icons, missing icons are replaced with plain
; ones and missing pressed icons are replaced with pressed plain ones.
;-------------------------------------------------------------------------------
EnsureToolIcons
Entry "R0-R9"
MOV R9,#tool_blank ;
; Debug perth,"number of toolicons in total = ",R9
MOV R9,R9,LSR #4 ; number of different tool icons
; Debug perth,"number of toolicons per set = ",R9
MOV R0,R9 ; number of icons to do
LDR R1,tool_list ; -> list of plain toolicons
ADD R2,R1,R9,LSL #2 ; -> list of pushed toolicons
ADD R3,R2,R9,LSL #2 ; -> list of plain focus toolicons
ADD R4,R3,R9,LSL #2 ; -> list of pushed focus toolicons
;------ Move through the list of pushed plain tools and
; replace missing ones with their non-pushed version
01 LDR R6,[R2],#4 ; get pushed toolicon
LDR R5,[R1],#4 ; get plain toolicon
TEQ R6,#0 ; is there a pushed icon?
STREQ R5,[R2,#-4] ; if not, copy in the plain icon
;------ Now do the same for the pushed focus tools
LDR R6,[R4],#4 ; get pushed focus toolicon
LDR R5,[R3],#4 ; get plain focus toolicon
TEQ R6,#0 ; is there a pushed focus icon?
STREQ R5,[R4,#-4] ; if not, copy in the plain focus icon
SUBS R0,R0,#1 ; have we done them all?
BNE %BT01 ; if not, go back for next one
;------ Now check the focus icons, use plain icons for any missing
MOV R0,R9,LSL #1 ; number of icons to do
LDR R1,tool_list ; -> list of plain toolicons
ADD R2,R1,R9,LSL #3 ; -> list of focus toolicons
02 LDR R3,[R2],#4 ; get focus version of toolicon
LDR R4,[R1],#4 ; get plain version of toolicon
TEQ R3,#0 ; is there a focus version?
STREQ R4,[R2,#-4] ; if not, copy in the plain version
SUBS R0,R0,#1 ; have we done them all?
BNE %BT02 ; if not, go back for next one
EXIT
;..............................................................................
; defaultparams - modify the default parameters ready for further calculations
......@@ -1658,15 +1579,8 @@ plot_windowglyph Entry "R0-R9"
ADRNEL R14,glyphs_normal ; -> selection table for the glyph
LDRB R14,[R14,R2] ; = offset into tool list block
LDR R0, [handle, #w_flags] ; get window flags
TST R0, #ws_hasfocus ; does our window have the input focus?
MOVEQ R0, #0
MOVNE R0, #tool_blank
MOVNE R0,R0,LSR #1
LDR R2,tool_list
TEQ R2,#0 ; Tool list present?
ADDNE R2,R2,R0
LDRNE R2,[R2,R14] ; = address of sprite to be plotted
TEQNE R2,#0
[ debugtools
......@@ -1996,14 +1910,13 @@ dofunkytitlebar EntryS "R0-R11"
LDR R2,title_topheight
SUB y1,y1,R2 ; adjust to include the top height
;
MOV R0,#tool_blank ;
LDR R1,tool_list ; -> tool sprite list
;
; is it our window that has input focus?
MOV R3,x0
MOV R4,y0 ; x,y co-ordinates to plot title sprites at
;
LDR R2,[handle, #w_flags] ; get window flags
TST R2,#ws_hasfocus ; does our window have the input focus?
ADDNE R1,R1,R0,LSR #1 ;
ADRL R0,tool_plotparams
LDMIA R0,{R0,R5,R6,R7} ; R0,R5-R7 => sprite op information
LDR R1,tool_list ; -> list of the glyphs
Push "R10,R11" ; preserve these - they are important
;
; is it our window that is highlighted?
;
......@@ -2011,14 +1924,10 @@ dofunkytitlebar EntryS "R0-R11"
CMP R2,handle
LDREQ R2,border_iconselected
CMPEQ R2,#windowicon_title ; if its our window + the title bar then ... oh no!
ADDEQ R1,R1,R0,LSR #2
;
MOV R3,x0
MOV R4,y0 ; x,y co-ordinates to plot title sprites at
;
ADRL R0,tool_plotparams
LDMIA R0,{R0,R5,R6,R7} ; R0,R5-R7 => sprite op information
Push "R10,R11" ; preserve these - they are important
ASSERT (tool_ptbarlcap-tool_tbarlcap) = (tool_ptbarmidb-tool_tbarmidb)
ASSERT (tool_ptbarlcap-tool_tbarlcap) = (tool_ptbarmidt-tool_tbarmidt)
ASSERT (tool_ptbarlcap-tool_tbarlcap) = (tool_ptbarrcap-tool_tbarrcap)
ADDEQ R1,R1,#tool_ptbarlcap-tool_tbarlcap
;
LDR R2, [R1,#tool_tbarlcap]
LDR R14,[R1,#tool_tbarrcap]
......@@ -2158,18 +2067,13 @@ dofunkyvscroll EntryS "R0-R11"
STMIA R14,{x0,y0,x1,y1} ; push clip region for scroll bar
Debug scroll,"tool_scrollclip",x0,y0,x1,y1
;
ADRL R0,tool_plotparams
LDMIA R0,{R0,R5,R6,R7} ; get the plotting parameters
;
LDR R1,dy ; single pixel at screen resolution
LDR R3,[sp,#Proc_RegOffset+sp_x0]
LDR R0,[handle, #w_flags] ; get window flags
TST R0,#ws_hasfocus ; does our window have the input focus?
LDR R10,tool_list ; -> tool sprite list
MOVNE R0,#tool_blank ;
ADDNE R10,R10,R0,LSR #1 ;
;
ADRL R0,tool_plotparams
LDMIA R0,{R0,R5,R6,R7} ; get the plotting parameters
;
; plot the bottom section of the scroll bar
;
......@@ -2239,9 +2143,12 @@ dofunkyvscroll EntryS "R0-R11"
LDREQ R14,border_iconselected
CMPEQ R14,#windowicon_verticalbar
]
MOVEQ R2,#tool_blank ;
ADDEQ R10,R10,R2,LSR #2
ASSERT (tool_pvbarb-tool_vbarb) = (tool_pvbarmid-tool_vbarmid)
ASSERT (tool_pvbarb-tool_vbarb) = (tool_pvbart-tool_vbart)
[ hvblip
ASSERT (tool_pvbarb-tool_vbarb) = (tool_pvblip-tool_vblip)
]
ADDEQ R10,R10,#tool_pvbarb-tool_vbarb
; now plot the scroll sausage bit in the middle
......@@ -2361,17 +2268,11 @@ dofunkyhscroll EntryS "R0-R11"
ADRL R14,tool_scrollclip
STMIA R14,{x0,y0,x1,y1} ; push clip region for scroll bar
;
ADRL R0,tool_plotparams
LDMIA R0,{R0,R5,R6,R7} ; get the plotting parameters
LDR R1,dx ; single pixel at screen resolution
LDR R4,[sp,#Proc_RegOffset+sp_y0]
LDR R0,[handle, #w_flags] ; get window flags
TST R0,#ws_hasfocus ; does our window have the input focus?
LDR R10,tool_list ; -> tool sprite list
MOVNE R0,#tool_blank ;
ADDNE R10,R10,R0,LSR #1 ;
;
ADRL R0,tool_plotparams
LDMIA R0,{R0,R5,R6,R7} ; get the plotting parameters
;
; plot the left hand side of the bar
;
......@@ -2440,13 +2341,16 @@ dofunkyhscroll EntryS "R0-R11"
LDREQ R14,border_iconselected
CMPEQ R14,#windowicon_horizbar
]
MOVEQ R2,#tool_blank ;
ADDEQ R10,R10,R2,LSR #2
ASSERT (tool_phbarl-tool_hbarl) = (tool_phbarmid-tool_hbarmid)
ASSERT (tool_phbarl-tool_hbarl) = (tool_phbarr-tool_hbarr)
[ hvblip
ASSERT (tool_phbarl-tool_hbarl) = (tool_phblip-tool_hblip)
]
ADDEQ R10,R10,#tool_phbarl-tool_hbarl
; handle plotting the horizontal scroll sausage
35 LDR R2,[R10,#tool_hbarl]
LDR R2,[R10,#tool_hbarl]
Debug scroll,"tool_phbarl",R2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment