com.tapina.robe.swi
Class Wimp

java.lang.Object
  extended bycom.tapina.robe.runtime.Block
      extended bycom.tapina.robe.runtime.DataBlock
          extended bycom.tapina.robe.module.Module
              extended bycom.tapina.robe.swi.SWIHandler
                  extended bycom.tapina.robe.swi.Wimp

public final class Wimp
extends SWIHandler


Field Summary
 
Fields inherited from class com.tapina.robe.swi.SWIHandler
log, METHOD_PARAMETERS
 
Method Summary
 void closeTemplate()
           
 void CloseTemplate(Environment env)
           
 void CreateIcon(Environment env)
           
 void createIcon(int windowHandle, Icon icon)
           
 void CreateWindow(Environment env)
          This tells the Wimp what the characteristics of a window are.
 Window createWindow(WindowBlock windowBlock)
           
 void DeleteIcon(Environment env)
          This SWI removes the definition of the given icon.
 void deleteIcon(Window window, int iconHandle)
           
static int getBase()
           
 CaretPosition getCaretPosition()
           
 void GetCaretPosition(Environment env)
          Get the current position of the text input caret.
 void GetIconState(Environment env)
          Get the icon definition for an icon.
 Icon getIconState(Window window, int iconHandle)
           
static Wimp getInstance()
           
static java.lang.reflect.Method getMethod(java.lang.Integer offset)
           
 java.lang.String getName()
           
 com.tapina.robe.swi.Wimp.SlotSize getSlotSize(MemoryMap mem)
           
 void GetWindowState(Environment env)
          This call reads a windows visible state.
 Window getWindowState(int windowHandle)
           
 void Initialise(Environment env)
           
 void initialise(int knownWimpVersion, java.lang.String description, int[] acceptableMessages)
           
 void LoadTemplate(Environment env)
          Note that R5 must point to a word aligned 12 byte buffer, which is used as workspace by the call.
 WindowBlock loadTemplate(java.lang.StringBuffer name, int index)
          Load the named template.
 void OpenTemplate(Environment env)
          This call opens the said template file.
 void openTemplate(java.lang.String filename)
           
 java.awt.Color[] readPalette()
           
 void ReadPalette(Environment env)
          This SWI returns the current Wimp palette settings, in the form &B0G0R0LL, where L is the logical colour number used for the Wimp colour 0 to 15 (or %TTGGGGGG in 256 colour modes).
 void ReadSysInfo(Environment env)
           
 void ReportError(Environment env)
          This SWI opens a standard, non-multitasking, errorbox on the screen.
 int reportError(SWIError err, java.lang.String title)
           
 void SetExtent(Environment env)
          Visible workarea must be wholly within new workarea extent.
 void setExtent(Window window, java.awt.Rectangle extent)
           
 void SetIconState(Environment env)
          This SWI sets the icon's flags as follows : new = (old BIC clear_word) EOR EOR_word.
 void setIconState(Icon icon, int eorWord, int clearWord)
           
 int setSlotSize(int newSize, MemoryMap memoryMap)
           
 void SlotSize(Environment env)
           
 void SpriteOp(Environment env)
          This call is mapped to OS_SpriteOp.
 void spriteOp(int operation, java.lang.String spriteName)
           
 java.awt.image.BufferedImage spriteOp40(java.lang.String spriteName)
           
 void WhichIcon(Environment env)
          All icons with (icon flags AND R2) = (R3 AND R2) are added to the list in R1.
 
Methods inherited from class com.tapina.robe.module.Module
getBytes, getHelp, getSize, setSize
 
Methods inherited from class com.tapina.robe.runtime.Block
getAddress, setAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Wimp getInstance()

getBase

public static int getBase()

getName

public java.lang.String getName()
Overrides:
getName in class Module

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Integer offset)
                                          throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

Initialise

public final void Initialise(Environment env)

initialise

public final void initialise(int knownWimpVersion,
                             java.lang.String description,
                             int[] acceptableMessages)
Parameters:
knownWimpVersion -
description -
acceptableMessages - null for no acceptable messages, array containing just 0 for all messages acceptable, otherwise a list

CreateWindow

public final void CreateWindow(Environment env)
This tells the Wimp what the characteristics of a window are. The Wimp takes a copy of this block, so you could throw it away afterwards.

Parameters:
env - IN: R1 = Pointer to window block; OUT: R0 = Window handle

createWindow

public final Window createWindow(WindowBlock windowBlock)

CreateIcon

public final void CreateIcon(Environment env)

createIcon

public final void createIcon(int windowHandle,
                             Icon icon)

DeleteIcon

public final void DeleteIcon(Environment env)
This SWI removes the definition of the given icon. If it is the last icon in the windows list, the memory is reallocated, if not it is only marked as deleted. To update screen, you must call Wimp_ForceRedraw .

Parameters:
env - IN: R1 = pointer to +0 Window handle, or -2 for iconbar; +4 Icon handle

deleteIcon

public void deleteIcon(Window window,
                       int iconHandle)

GetWindowState

public void GetWindowState(Environment env)
This call reads a windows visible state. The nested version can be used to read the windows parent. Nested version has R2 = "TASK" (&4B534154) on entry and returns R3 = parent window handle, or -1 if top level, R4 = nesting flags.

Parameters:
env - IN: R1 = pointer to block which contains window handle; OUT: Block in R1 contains :
 +0 Window Handle (or -2 for icon bar)
 +4 Visible area minimum x
 +8 Visible area minimum y
 +12 Visible area maximum x
 +16 Visible area maximum y
 +20 Scroll x offset
 +24 Scroll y offset
 +28 Handle to open window behind
 +32 Window flags

getWindowState

public Window getWindowState(int windowHandle)

SetIconState

public void SetIconState(Environment env)
This SWI sets the icon's flags as follows : new = (old BIC clear_word) EOR EOR_word. This SWI also causes the icon to be redrawn, even if no bits are changed.

Parameters:
env - IN: R1 = pointer to block :
 0 Window handle (-1,-2 for iconbar)
 4 Icon handle
 8 EOR word
 12 Clear word
 

setIconState

public void setIconState(Icon icon,
                         int eorWord,
                         int clearWord)

GetIconState

public void GetIconState(Environment env)
Get the icon definition for an icon. If you want to search for an icon with particular flag settings, use Wimp_WhichIcon.

Parameters:
env - IN: R1 = pointer to block : +0 Window handle, +4 Icon handle OUT: R0 corrupt; on exit the block will also contain +8 32-byte icon block.

getIconState

public Icon getIconState(Window window,
                         int iconHandle)

GetCaretPosition

public final void GetCaretPosition(Environment env)
Get the current position of the text input caret.

Parameters:
env - IN: R1 = pointer to block; OUT: block contains :
 0 window handle (-1 if off)
 4 icon handle, or -1
 8 x offset
 12 y offset
 16 height + flags , or -1
 20 index into string, or -1
 Flags:
 0-15 Height of caret in OS units.
 16-23 Colour (if bit 26 is set)
 24 1 => Use VDU5 type caret.
    0 => Use anti-aliased caret.
 25 1 => Caret is invisible.
 26 1 => Use bits 16-23 for colour.
    0 => Use wimp colour 11.
 27 1 => 16-23 is untranslated col.
    0 => 16-23 is wimp colour.
 

getCaretPosition

public final CaretPosition getCaretPosition()

WhichIcon

public final void WhichIcon(Environment env)
All icons with (icon flags AND R2) = (R3 AND R2) are added to the list in R1. The list is terminated by -1.

Parameters:
env - IN: R0 = Window handle, R1 = Block to contain icon handles, R2 = Bit mask, R3 = Bit settings to match

SetExtent

public void SetExtent(Environment env)
Visible workarea must be wholly within new workarea extent. On RISC OS 2 workarea extent must correspond to a whole number of pixels, or strange effects may occur. Later Wimps round the values.

Parameters:
env - IN: R0 = window handle, R1 = pointer to block
 +0 new workarea min x
 +4 new workarea min y
 +8 new workarea max x
 +12 new workarea max y
 

setExtent

public void setExtent(Window window,
                      java.awt.Rectangle extent)

OpenTemplate

public final void OpenTemplate(Environment env)
This call opens the said template file. Now you can do repeated calls to LoadTemplate(com.tapina.robe.runtime.Environment), and finally CloseTemplate(com.tapina.robe.runtime.Environment). Entry: R1 = pathname of template file to open; Exit: R0 corrupt

Parameters:
env -

openTemplate

public final void openTemplate(java.lang.String filename)

CloseTemplate

public final void CloseTemplate(Environment env)

closeTemplate

public final void closeTemplate()

LoadTemplate

public final void LoadTemplate(Environment env)
Note that R5 must point to a word aligned 12 byte buffer, which is used as workspace by the call. Errors will not be returned if the template is not found. Instead R6 is set to 0. Entry: R1 = pointer to userbuffer for template, or 0 to find required buffersize R2 = pointer to workspace for indirected data. R3 = pointer to end of workspace (+1?) R4 = pointer to 256-byte array for font ref, or -1 for no fonts R5 = pointer to (wildcarded) name to match (3 aligned words) R6 = position to search from, or 0 for the first call Exit: R0 corrupt R2 = pointer to remaining workspace R5 is overwritten with actual name R6 = pos of next entry, or 0 if template not found if R1 was 0, then : R1 = required size for window and icons R2 = required size for indirected data

Parameters:
env -

loadTemplate

public final WindowBlock loadTemplate(java.lang.StringBuffer name,
                                      int index)
Load the named template. The name may be wildcarded in which case 'index' will determine which template is loaded - to start off with index should be 0 then incremented each time until the method returns null.

Parameters:
name - StringBuffer containing (possibly wildcarded) name - will be overwritten with actual name
index - index of template to load
Returns:
template matching name, at specified index, or null if not found/no more

ReportError

public final void ReportError(Environment env)
This SWI opens a standard, non-multitasking, errorbox on the screen. Avoid, if possible. It is boring and, as stated above, non-multitasking. However, the RO3.5 extensions make the use of error boxes much more appealing to the programmer. Entry: R0 = pointer to standard SWI errorblock R1 = flags (1 = OK, 2 cancel, 4 = default cancel, 8 = no prompt, 16 = no "Error from App:", 32 = return immediately, 64 = pretend click, 128 = silent, 256 = use categories bits 9-11 = category, bits 24-27 = Continue value, bits 28-31 = Quit value) Categories are: 1=info, 2=warning, 3=program msg, 4=question, 5=user1, 6=user2, 7=reserved R2 = pointer to application name (or title if bit 4 set), or 0 for simply 'Error' R3 = sprite name (if bit 8 set) R4 = sprite area (if bit 8 set) R5 = pointer to extra buttons string (if bit 8 set) Exit: R1 = 0 if nothing selected, 1 if OK selected and 2 if Cancel, 3-5 if extra buttons Return gives default, Escape the alternate R0 corrupt

Parameters:
env -

reportError

public final int reportError(SWIError err,
                             java.lang.String title)

ReadPalette

public final void ReadPalette(Environment env)
This SWI returns the current Wimp palette settings, in the form &B0G0R0LL, where L is the logical colour number used for the Wimp colour 0 to 15 (or %TTGGGGGG in 256 colour modes). Note that when even when the values are masked to give &B0R0G000 this is not correct for passing to ColourTrans. If 'TRUE' is used, then the true colour values are returned.

Parameters:
env - IN: R1 = pointer to 20-word palette block, R2 = "TRUE" (&45555254) to return true colour; OUT: R0 corrupt, block contains palette definitions

readPalette

public java.awt.Color[] readPalette()

SpriteOp

public final void SpriteOp(Environment env)
This call is mapped to OS_SpriteOp. &100 is added to reason code in R0, and R1 is set to the Wimp sprite-area pointer.

Parameters:
env - IN: R0 = reason code (0..&FF), R1 unused, R2 = pointer to sprite name, R3.. as for OS_SpriteOp; OUT: as for OS_SpriteOp

spriteOp

public final void spriteOp(int operation,
                           java.lang.String spriteName)

spriteOp40

public final java.awt.image.BufferedImage spriteOp40(java.lang.String spriteName)

SlotSize

public final void SlotSize(Environment env)

setSlotSize

public int setSlotSize(int newSize,
                       MemoryMap memoryMap)

getSlotSize

public final com.tapina.robe.swi.Wimp.SlotSize getSlotSize(MemoryMap mem)

ReadSysInfo

public final void ReadSysInfo(Environment env)


Copyright © 2003-2005 . All Rights Reserved.