Commit bae04ff4 authored by Ben Avison's avatar Ben Avison
Browse files

Add Message_ToggleBackdrop to allow the backdrop to be moved to front or back.

Detail:
  The Message_ToggleBackdrop has been introduced by ROL in one of their Select
  releases. In order to bring the RISC OS 5 API closer the ROL branch this
  changeset aims to add this message to RO5.

  Applications can broadcast Message_ToggleBackdrop to request that the backdrop
  application moves the backdrop. The message can be used to move the backdrop
  to the front, the back, toggle it or to get notified of the backdrop's
  current position.

  After the backdrop has been moved, this message is sent back to the
  application to notify it of the backdrop's new position.

  Message_ToggleBackdrop &400D1:
     +0  = 24 (Message size)
     +4  = Backdrop controlling application
     +8  = My reference number
     +12 = Your reference number
     +16 = &400D1 (Message_ToggleBackdrop)
     +20 = Flags (if not present, assumed 0)
             b0-1  = type of toggle
                      0 = toggle
                      1 = front
                      2 = back
                      3 = notify of status
             other = reserved
Admin:
  Tested on RO 5.16
Author:
  Fred Graute

Version 0.90. Tagged as 'Pinboard-0_90'
parent 521331ae
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.89"
Module_Version SETA 89
Module_MajorVersion SETS "0.90"
Module_Version SETA 90
Module_MinorVersion SETS ""
Module_Date SETS "14 Nov 2010"
Module_ApplicationDate SETS "14-Nov-10"
Module_Date SETS "14 Apr 2011"
Module_ApplicationDate SETS "14-Apr-11"
Module_ComponentName SETS "Pinboard"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Pinboard"
Module_FullVersion SETS "0.89"
Module_HelpVersion SETS "0.89 (14 Nov 2010)"
Module_FullVersion SETS "0.90"
Module_HelpVersion SETS "0.90 (14 Apr 2011)"
END
/* (0.89)
/* (0.90)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.89
#define Module_MajorVersion_CMHG 0.90
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Nov 2010
#define Module_Date_CMHG 14 Apr 2011
#define Module_MajorVersion "0.89"
#define Module_Version 89
#define Module_MajorVersion "0.90"
#define Module_Version 90
#define Module_MinorVersion ""
#define Module_Date "14 Nov 2010"
#define Module_Date "14 Apr 2011"
#define Module_ApplicationDate "14-Nov-10"
#define Module_ApplicationDate "14-Apr-11"
#define Module_ComponentName "Pinboard"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Pinboard"
#define Module_FullVersion "0.89"
#define Module_HelpVersion "0.89 (14 Nov 2010)"
#define Module_LibraryVersionInfo "0:89"
#define Module_FullVersion "0.90"
#define Module_HelpVersion "0.90 (14 Apr 2011)"
#define Module_LibraryVersionInfo "0:90"
......@@ -93,6 +93,10 @@ message_received
TEQ r0, r14
BEQ HelpRequest
LDR r14, =Message_ToggleBackdrop
TEQ r0, r14
BEQ ToggleBackdrop
TEQ r0,#Message_Quit
Pull "PC",NE
......@@ -1126,4 +1130,61 @@ close_task
B %BT01
ToggleBackdrop ROUT
MOV R0,#User_Message_Acknowledge ; =19
LDR R3,[R1,#ms_myref] ;
LDR R2,[R1,#ms_taskhandle] ;
STR R3,[R1,#ms_yourref] ;
SWI XWimp_SendMessage ; acknowledge message
STR R2,[R1,#ms_taskhandle] ; restore as ack screwed it
LDR R0,[R1,#ms_size] ; get message size
LDR R2,[R1,#ms_data] ; get flags
CMP R0,#&18 ; is msg >= 24 bytes, ie flags present?
MOVLT R2,#0 ; if not, assume 0
ADD R1,R1,#128 ; use upper half of wimp data block
LDR R0,backdrop_handle ; get window handle of backdrop
STR R0,[R1,#u_handle] ; pop window handle in block
SWI XWimp_GetWindowState ; get state of backdrop
LDR R14,[R1,#u_bhandle] ; get handle to open behind
CMP R14,#-1 ; is it -1, ie backdrop at front?
MOVNE R14,#-2 ; if not, pretend it's at back
AND R2,R2,#3 ; isolate bottom two bits of flags
ADD R2,R2,#1 ; convert flags to something that's
AND R2,R2,#3 ; easier to use (0,1,2,3 -> 1,2,3,0)
CMP R2,#1 ;
EOREQ R14,R14,#1 ; toggle -2 <-> -1
RSBHI R14,R2,#1 ; convert %10 to -1, %11 to -2
BLO %FT01 ; just notify, skip code to move backdrop
CMP R14,#-1 ; is backdrop to be moved to front?
LDR R0,[R1,#u_wflags] ; get flags for backdrop window
BICEQ R0,R0,#wf_backwindow ; if to front, clear background stack bit
ORRNE R0,R0,#wf_backwindow ; if to back, set background stack bit
STR R0,[R1,#u_wflags] ; write flags for backdrop window back
STR R14,[R1,#u_bhandle] ; write handle to open behind back
LDR R2,taskidentifier ; magic word "TASK"
MOV R3,#-1 ; -1 =>
MOV R4,#1 ; bit 0 set =>
SWI XWimp_OpenWindow ; open backdrop window in new position
01 SUB R1,R1,#128 ; reset to start of wimp data block
MOV R2,#&18 ; message size
RSB R3,R14,#0 ;
LDR R4,[R1,#ms_myref] ;
STR R2,[R1,#ms_size] ;
STR R3,[R1,#ms_data] ;
STR R4,[R1,#ms_yourref] ;
MOV R0,#User_Message ; =17
LDR R2,[R1,#ms_taskhandle] ;
SWI XWimp_SendMessage ;
Pull "PC"
LNK Help.s
......@@ -82,6 +82,7 @@ MessagesList
DCD Message_WindowInfo
DCD Message_FilerSelection
DCD Message_FontChanged
DCD Message_ToggleBackdrop
DCD 0
; ----------------------------------------------------------------------------------------------------------------------
......
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