![]() ![]() Main Guide What's new Products Downloads FAQ Mailing List Links |
| ||
WimpWorks Extension ModulesIntroductionWimpWorks Extension Modules (WEMs) are application directories which contain software plugins which can be compiled into a WimpWorks application. These components are written in standard BBC BASIC (and can take advantage of any WimpWorks commands present - even in other WEMs) and add new commands and/or events to WimpWorks applications to take advantage of new ideas, protocols or to simply add a command which is felt is needed. WEMs are installed by copying them into
Format of a WEMA WEM consists of (at least) four files inside an application (a directory beginning with an exclamation mark - '!'). The files are listed below and will then be explained in detail:
!RunThis file is technically optional, however it should be present so that if the WEM is double clicked in a directory display (accidentally or on purpose) the user does not get an error message. It is recommended that the file starts WimpWorks if it can, otherwise simply do nothing:
| !Run file for !Test, a WWv2 WEM !RunImageThis file is the BASIC file which will be linked into the WimpWorks application if the WEM is chosen to be included. This file has a relatively rigidly defined structure which must be adhered to. It also contains the actual code of all the new WimpWorks commands. The file contains, in addition to the code for any new commands, four functions which must be present, all are prefixed with the name of the WEM (see later) and must all return zero (0). In a WEM named
The rest of the file is left to zero or more procedures and/or
functions which define the code for any new WimpWorks commands. Any
WimpWorks command (whether core or provided by another WEM (which must
also be included)) can be called, however they must be called in lowercase
and prefixed with either !SpritesAs with !Run this file is technically optional, however should be defined so that your WEM appears with an attractive icon. DescThis text file instructs WimpWorks how to process the WEM, data is
held within a The various WEM structures which must be implemented are: DEF WEMdetails Name test Description Test WEM Author (c) Jaffa Software 1998 Version 1.00 (21-Feb-1998) Type 2 ENDWEM
DEF WEMevents Mode changed VAL(eva$), VAL(evb$) old_mode%, new_mode% Writable clicked VAL(eva$), VAL(evb$), evc$ window%, icon%, text$ ENDWEM Each new event consists of three lines: the first contains the name of the
event (as it should be included in the "Respond to" menu (events
expecting a value to be returned should have Events which are unattached always return event is an integer representation of the event and is the result
returned from ENCODE when applied to the name of the event. This could be
defined in DEF WEMcommands BEEP PROC <length> Make a beep for <length> seconds, this is a command which is a bit silly. ENDHELP BOOLEAN FN Returns a random boolean value (TRUE or FALSE). ENDHELP ENDWEM Within this block is a list of the commands added, followed by an amount of whitespace and their type: PROC or FN. Following this is the syntax line which is appended to the command in the online help window. The syntax line must be blank if there are no parameters. Finally, there is a block of text defining the online help itself for the
command, this is practically unlimited, but the TRIMmed length of the line
should be <= 45 characters, so that it can fit into the width of the online
help window. After the text is defined, there is an ConclusionThis is a complete specification of WEMs as they are implemented in the current version of WimpWorks, any questions can be directed to the email address at the bottom of the page or the mailing list. © Jaffa Software 1998. |