Pinboard


Contents


Introduction and Overview

The Pinboard module provides facilities for representing files, applications and directories outside the Filer, by positioning icons either on the icon bar or on the desktop background (the 'pinboard' that gives this module its title).

As well as providing shortcut icons for applications, pinboard also provides the default Iconiser. The Iconiser is used when a window is closed by the user with shift-Select over the close tool, or explicitly clicking the iconise tool.

It also provides a * Command to change the desktop background from the default grey to any sprite of your own choice.

The Pinboard module is not available in RISC OS 2.


Technical Details

Iconiser icons

Iconiser icons, as used by Pinboard, should be of a similar size as the filetype icons. Icons are prefixed by ic_ followed by the application name as given to taskmanager (unless an icon name is supplied by the iconised application.

Iconiser icons should be based on the ic_? sprite.

The iconise protocol

This protocol is not available in RISC OS 2.

Iconise tool of a window clicked

When the iconise tool is clicked, the Wimp broadcasts a Message_Iconise. This facility is only available on WindowManager 4.15 and above.

Shift held down when the close tool of a window is clicked

If Shift is held down when the Close icon of a window is clicked, the Wimp does not close the window, but instead follows the same protocol as the iconise tool.

If no iconiser is loaded nothing happens.

If an iconiser is loaded:

  1. It acknowledges the message (stops the broadcast).
  2. It sends a Message_WindowInfo to the window.

Old application

If the application is an old RISC OS 2 one, it will ignore the above message.

The iconiser gets acknowledgement back and uses the information in the first Message_Iconise to iconise the window.

New application

If the application is a new RISC OS 3 application it should react as follows:

  • If it doesn't want to help it should ignore the message.
  • If it wants to help it should reply with a Message_WindowInfo. The iconiser will then use this information to iconise the window.

    This enables applications such as Edit to give a different icon depending on the file type of the file being edited in the window.

  • If the application wants to iconise its own window it should acknowledge the original Message_WindowInfo message, and do all the work itself.

Closing a window

Whenever a window is closed the Wimp broadcasts the message Message_WindowClosed.

The iconiser then removes the icon.

When a task exits

The iconiser spots the Message_TaskQuit and remove all the icons for that task.

When a new iconiser starts up

It broadcasts a Message_WindowInfo with a window handle of 0.

An iconiser receiving this message should reopen all iconised windows.

All applications should ignore such a message.

Current iconiser (Pinboard) behaviour

If it does not get a reply to the Message_WindowInfo

  1. It gets the task name for the task that owns the window and then tries to find a sprite called ic_<task name> in the wimp sprite area. If it fails it uses a sprite called ic_?.
  2. It uses the title given in the Message_Iconise.

If it gets a Message_WindowInfo

  • It tries to find the sprite ic_<name given in message>. If it fails it uses ic_?.
  • It uses the title given in the Message_WindowInfo.


Wimp Messages


Message_Iconise
(&400CA)

Iconise window request
Message
OffsetContents
R1+20window handle
R1+24task handle for task which owns the window
R1+2820 bytes of title string (last part of first word)
Source
WindowManager
Destination
Iconisers
Use

This message is broadcast by the WindowManager to request that the current Iconiser iconise the window cited. The Iconiser is expected to acknowledge the message and send Message_WindowInfo to the task owning the window.

This message is not available in RISC OS 2.

Related APIs
None

Message_WindowClosed
(&400CB)

Window closed notification
Message
OffsetContents
R1+20window handle
Source
WindowManager
Destination
Iconisers
Use

This message is broadcast by the WindowManager when a window is closed. It is expected that the current Iconiser will remove any iconisations of the window in question.

This message is not available in RISC OS 2.

Related APIs
None

Message_WindowInfo
(&400CC)

Window iconisation information
Message
OffsetContents
R1+20window handle
R1+24reserved, must be 0
R1+28 <string> giving trailing part of sprite name to use, null terminated - sprite name used is ic_<string>
R1+28string giving title to use, null terminated; this should be as short as possible, and may be truncated by the iconiser (eg Pinboard truncates at a space or at the 10th character, whichever is shorter)
Source
Iconisers / Any application
Destination
Any application / Iconisers
Use

This message is send by the Iconiser when a window is to be iconised. Applications will either respond with a modified Message_WindowInfo if they wish to provide specific iconisation information, or acknowledge the message if the wish to handle the iconisation themselves. It is not recommended that applications handle the iconisation themselves.

This message is not available in RISC OS 2.

Related APIs
None

Message_ToggleBackdrop
(&400D1)

Control the backdrop window
Message
OffsetContents
R1+20flags :
Bit(s)Meaning
0-1Type of operation :
TypeMeaning
0Toggle backdrop between front and back
1Move backdrop to the front
2Move backdrop to the back
3Just notify of position
4-31reserved, must be 0
Source
Backdrop provider / Any application
Destination
Any application / Backdrop provider
Use

This message is sent by applications wishing to control the position of the backdrop window. After the operation being performed, the message will be replied to, filling in the new state in the operation field.

This message is not available before RISC OS 4.20.

Related APIs
None

*Commands


*AddTinyDir

Adds a file, application or directory icon to the icon bar
Syntax
*AddTinyDir [<object>]
Parameters
<object>- a valid pathname specifying a file, application or directory
Use

*AddTinyDir adds a file, application or directory to the icon bar. If no pathname is given, it adds a blank directory icon to the icon bar. You can then later install a file, application or directory on the icon bar by dragging it to the blank icon.

Example
*AddTinyDir ADFS::MHardy.$.!System
Related * commands
*RemoveTinyDir, *Pin

*BackDrop

Puts a sprite on the desktop background
Syntax
*BackDrop [-Centre | -Scale | -Tile] [<filename>]
Parameters
-Centre - centre sprite on background
-Tile - tile sprite over background
-Scale - scale sprite to fill background (the default)
<filename>- a valid pathname, specifying a sprite file
Use

*BackDrop puts the first sprite in the given sprite file on the desktop background. The sprite is scaled to fill the background unless you specify otherwise.

If no filename is specified, the current backdrop's placing is altered.

Example
*BackDrop ADFS::Disc4.$.Sprites.desert
Related APIs
None

*Pin

Adds a file, application or directory to the desktop pinboard
Syntax
*Pin <object> <x> <y>
Parameters
<object>- a valid pathname specifying a file, application or directory
<x>- the x-coordinate at which to pin the object's icon, given in OS units
<y>- the y-coordinate at which to pin the object's icon, given in OS units
Use

Pin adds a file, application or directory to the desktop pinboard, positioning its icon at the given coordinates. The coordinates specify the top-left corner of the icon's bounding box (ie the box drawn around the icon when it is selected for a drag), not of the icon itself. To use a negative coordinate you need to specify it as 0-x or 0-y, to avoid the - sign being interpreted as the start of a flag. (You may sometimes see this when Pinboard saves its state to a desktop boot file.)

There is no equivalent command to remove the icon; to do so, you must choose Remove icon from the Pinboard menu.

Example
*Pin ADFS::MHardy.$.!System 200 200
Related * commands
*AddTinyDir, *XPin

*Pinboard

Starts the pinboard
Syntax
*Pinboard [-Grid]
Parameters
-Grid - Turn on grid locking (off by default)
Use

*Pinboard initialises the pinboard, removing any existing pinned icons and backdrop. Grid locking is off by default, but you may turn it on by passing the -Grid option to this command, or by choosing Grid lock from the Pinboard menu.

Example
*Pinboard -Grid
Related APIs
None

*PinboardOptions

Allows you to set the options used by Pinboard
Syntax
*PinboardOptions [-Grid] [-IconiseTo<Location>] [-IconiseStackVertical] [-TidyTo<Location>] [-TidyStackVertical]
Parameters
-Grid - Turn on grid locking (off by default)
-IconiseTo<Location> -

Specifies the location windows are iconised to. This may be one of the following:

  • Iconbar
  • TopLeft
  • TopRight
  • BottomLeft
  • BottomRight

Without the switch, windows are iconised to the pointer.

-IconiseStackVertical - Specifies vertical stacking of iconised window icons. If the switch is not specified, icons are stacked horizontally.
-TidyTo<Location> - Specify the location file icons are tidied to. This may be any of the options listed above for IconiseTo. By default, icons are tidied to the top left.
-TidyStackVertical - Specify vertical stacking of file icons. If the switch is not specified, icons are stacked horizontally.
Use

*PinboardOptions allows you to configure the Pinboard. It is intended for use solely in the !Boot sequence and by !Configure, and should not be used under normal circumstances by the user. This command is present in RISC OS 4 onwards, and switches may vary between versions.

Example
*PinboardOptions -IconiseToTopRight -TidyStackVertical -TidyToTopLeft -TidyStackVertical
Related APIs
None

*RemoveTinyDir

Removes a file, application or directory icon from the icon bar
Syntax
*RemoveTinyDir [<object>]
Parameters
<object>- a valid pathname specifying a file, application or directory
Use

*RemoveTinyDir removes a file, application or directory icon that was previously placed on the icon bar by a *AddTinyDir command. If no pathname is given, all such icons are removed from the icon bar.

Example
*RemoveTinyDir ADFS::MHardy.$.!System
Related * commands
*AddTinyDir, *Pin

*XPin

Adds a file, application or directory to the desktop pinboard, ignoring any errors
Syntax
*XPin <object> <x> <y>
Parameters
<object>- a valid pathname specifying a file, application or directory
<x>- the x-coordinate at which to pin the object's icon, given in OS units
<y>- the y-coordinate at which to pin the object's icon, given in OS units
Use

XPin adds a file, application or directory to the desktop pinboard, positioning its icon at the given coordinates. The coordinates specify the top-left corner of the icon's bounding box (ie the box drawn around the icon when it is selected for a drag), not of the icon itself. To use a negative coordinate you need to specify it as 0-x or 0-y, to avoid the - sign being interpreted as the start of a flag. (You may sometimes see this when Pinboard saves its state to a desktop boot file.) XPin, unlike its sister command *Pin, ignores any errors it encounters.

There is no equivalent command to remove the icon; to do so, you must choose Remove icon from the Pinboard menu.

Example
*XPin ADFS::MHardy.$.!System 200 200
Related * commands
*AddTinyDir, *Pin

Document information

Maintainer(s): RISCOS Ltd <developer@riscos.com>
History:
RevisionDateAuthorChanges
1AHInitial version
  • Converted from original HTML to XML
  • Corrected mistakes and updated with RISC OS 4 specific details
Disclaimer:

Copyright © Pace Micro Technolgy plc, 2002.
Portions copyright © RISCOS Ltd, 2002.
Published by RISCOS Limited.
No part of this publication may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, or stored in any retrieval system of any nature, without the written permission of the copyright holder and the publisher, application for which shall be made to the publisher.