home *** CD-ROM | disk | FTP | other *** search
- <html>
- <title>Task</title>
- <h1>Task</h1>
-
- <h2>Synposis</h2>
- <p>
- <pre>
- class Task
- {
- public:
- enum <a href="file:task#events">events</a>
- enum <a href="file:task#buttons">buttons</a>
- enum <a href="file:task#messages">Messages</a>
- <a href="file:task#ct1">Task</a> (char *taskname, char *applname, char *spritename,
- char *iconmenu = NULL, int pri = 0, int position = -1,
- int wimp_version = 200, int *message_list = 0) ;
- <a href="file:task#ct2">Task</a> (char *taskname, char *applname,int wimp_version = 310, int *message_list = 0) ;
- <a href="file:task#ct3">Task</a> (char *taskname, char *applname, Icon *iconbar,
- char *iconmenu = NULL, int pri = 0, int position = -1,
- int wimp_version = 200, int *message_list = 0) ;
- virtual <a href="file:task#dt">~Task</a>() ;
- void <a href="file:task#set_mask">set_mask</a>(int m) ;
- void <a href="file:task#run">run</a>() ;
- void <a href="file:task#exit">exit</a>(int status = 0) ;
- void <a href="file:task#spawn">spawn</a>(char *coomand...) ;
- void <a href="file:task#sleep1">sleep</a> (ThreadResource *, int pri = THREAD_BASE_PRIORITY) ;
- void <a href="file:task#sleep2">sleep</a> (int time) ;
- void <a href="file:task#yield">yield</a>() ;
- void <a href="file:task#add_window">add_window</a> (Window *w) ;
- void <a href="file:task#remove_window">remove_window</a> (Window *w) ;
- void <a href="file:task#delete_window">delete_window</a> (Window *w) ;
- void <a href="file:task#delete_deferred">delete_deferred</a> (DeferredDelete *) ;
- Window *<a href="file:task#find_window">find_window</a> (int handle) ;
- void *<a href="file:task#find_template">find_template</a> (char *name) ;
- Menu *<a href="file:task#find_menu">find_menu</a> (char *name) ;
- virtual char *<a href="file:task#get_iconbar_menu">get_iconbar_menu</a> (int icon) ;
- virtual void <a href="file:task#menu">menu</a> (MenuItem items[]) ;
- virtual void <a href="file:task#click">click</a> (int x, int y, int buttons, int icon) ;
- char *<a href="file:task#lookup">lookup</a> (char *token) ;
- void <a href="file:task#send_message">send_message</a> (events event, int action, int &task,
- int &my_ref, int your_ref, int data_length,
- void *data, int icon = 0) ;
- void <a href="file:task#print">print</a> (char *format,...) ;
- virtual void <a href="file:task#pre_menu">pre_menu</a> (Menu *menu) ;
- void <a href="file:task#register_drag">register_drag</a> (Window *dragger, int id) ;
- void <a href="file:task#register_object_drag">register_object_drag</a> (Object *dragger, int id) ;
- void <a href="file:task#add_receiver">add_receiver</a> (Channel *channel, int message) ;
- void <a href="file:task#remove_receiver">remove_receiver</a> (Channel *channel, int message) ;
- receiver *<a href="file:task#find_receiver">find_receiver</a> (int message, int your_ref) ;
- int <a href="file:task#open_font">open_font</a> (char *name, int xisize, int ysize) ;
- void <a href="file:task#close_font">close_font</a> (int handle) ;
- void <a href="file:task#enter_critical">enter_critical </a>() ;
- void <a href="file:task#exit_critical">exit_critical</a>() ;
- void *<a href="file:task#find_sprite">find_sprite</a> (char *name) ;
- virtual void <a href="file:task#poll_word_non_zero">poll_word_non_zero</a> (int *poll_word, int contents) ;
- void <a href="file:task#set_menu">set_menu</a> (Menu *menu, Icon *icon) ;
- void <a href="file:task#set_menu">set_menu</a> (Menu *menu, Object *object) ;
- void <a href="file:task#set_menu">set_menu</a> (Menu *menu, Window *window) ;
- virtual char *<a href="file:task#help">help</a> (int mx, int my, int button, int window, int icon) ;
- void <a href="file:task#show_threads">show_threads</a>() ;
- events <a href="file:task#last_event">last_event</a> ;
- int <a href="file:task#last_event_data">last_event_data</a>[256 / sizeof (int)] ;
- int <a href="file:task#xeigfactor">xeigfactor</a> ;
- int <a href="file:task#yeigfactor">yeigfactor</a> ;
- Icon *<a href="file:task#iconbar_icon">iconbar_icon</a> ;
- DebugWin *<a href="file:task#debug">debug</a> ;
- char *<a href="file:task#program">program</a> ;
- int <a href="file:task#handle">handle</a> ;
- char <a href="file:task#country">country</a>[50] ;
- } ;
- </pre>
-
- <h2>Description</h2>
-
- This class represents a WIMP task. A task is a program which is running
- under the control of the RISC OS WIMP module. The facilities provided
- by this class allow full control over the behaviour of the WIMP task.
- <p>
- Although this is not an abstract class, it is designed to be used as
- a base class for another class which provides some of the application
- specific facilities. If there are no facilities which cannot be provided
- by the default action of the class then the Task class may be used on
- its own.
- <p>
- If a class is derived from this class it can provide all or some of the
- following facilities by supplying an appropriate function which will
- replace the default behaviour of the Task class.
- <p>
- <ul>
- <li>Menu creation
- <p>
- The derived class will be given a chance to provide a menu for an iconbar
- click. The function to provide is 'get_iconbar_menu'.
- <li>Menu modification
- <p>
- The derived class is given the chance to modify any of the entries
- of a menu before it is displayed. The function to provide is 'pre_menu'
- <li>Menu clicks
- <p>
- The derived class is informed of clicks on the iconbar menu by a call
- to the function 'menu'.
- <li>Iconbar clicks
- <p>
- The derived class is informed of clicks on the iconbar icon by a call
- to the function 'click'.
- </ul>
- <p>
- The derived class should also contain the definitions for the windows used
- in the task. The constructor for the derived class should create all the
- windows (but not necessarily open them) and assign these to variables
- within the derived class. The destructor should delete these windows.
- <p>
- If the mouse is clicked over an icon, object or window, then that icon,
- object or window gets priority over the task when dealing with the click.
- This allows a window to set up its own menu and click handlicg code.
-
- <p>
-
- <h2>Example</h2>
-
- This example derives a class called 'Game' from the Task class. It provides
- a default menu for the iconbar, and responds to clicks on that menu. It
- also responds to iconbar icon clicks. The game consists of one main
- window. The iconbar menu contains 2 entries: 'New game' for starting
- a new game, and 'Quit'.
- <p>
- The Window class is described later.
- <pre>
-
- //
- // game example 1
- //
-
-
- #include "Vista:vista.h"
-
- class Game : public Task
- {
- public:
- Game() ; // construct the task
- ~Game() ; // destruct it
- void menu (MenuItem items[]) ; // menu click
- void click (int x, int y, int button, int icon) ;// iconbar click
-
- void start() ; // start a new game
-
- enum MenuEntries // menu entries
- {
- NEWGAME, // New game
- QUIT // Quit
- } ;
-
- private:
- Window *main_window ; // my main window
- } ;
-
-
- Game::Game()
- : Task ("New game", "Game", "!Game", "main_menu")
- {
- main_window = new Window (this, "main") ;
- }
-
- Game::~Game()
- {
- delete main_window ;
- }
-
- void Game::click (int x, int y, int button, int icon)
- {
- if (button & Task::BLEFT)
- main_window->do_open() ;
- }
-
- void Game::menu (MenuItem items[])
- {
- switch (items[0])
- {
- case NEWGAME:
- start() ;
- break ;
- case QUIT:
- exit() ;
- break ;
- }
- }
-
- Game *game ;
-
- main()
- {
- game = new Game() ;
- game->run() ;
- }
-
- </pre>
-
- <h2>Members</h2>
-
- This section describes the main interface functions and data of the Task
- class. There are other members which are used internally and are not
- of interest here.
-
- <p>
- <a name="events"></a>
- <h3>Task::events</h3>
-
- This is an enumeration containing the various event codes returned to the
- task from Wimp_Poll. Each code begins with the letter 'E' and is followed
- by a an abbreviation for the event (eg EPTRLEAVE - pointer leaving event)
-
- <p>
- <a name="buttons"></a>
- <h3>Task::buttons</h3>
-
- This is an enumeration containing constants for the button states returned
- by the OS. Each starts with the letter 'B'. Example: BDRAGLEFT - left drag
- button type)
-
-
- <p>
- <a name="messages"></a>
-
- <h3>Task::Messages</h3>
-
- An enumeration for the various known message codes. The names are as
- defined in the PRMs and most start with the word 'Message_'. Example:
- Message_DataLoadAck.
-
-
- <p>
- <a name="ct1"></a>
-
- <h3>Task::Task (char *taskname,
- char *applname,
- char *spritename,
- char *iconmenu,
- int pri,
- int position,
- int wimp_version,
- int *message_list)</h3>
-
- This constructor makes a task class suitable for running under RISC OS that
- has an icon on the icon bar. The parameters are:
- <p>
- <pre>
-
- taskname: The name which appears on the Task Display window
- applname: The name of the application. This is used to construct
- the application directory variables by appending $Dir (
- and possibly $Path)
- spritename: The name of the sprite in the WIMP sprite pool which will
- be displayed on the icon bar
- iconmenu: The name of a menu which will be used if the user clicks
- 'menu' over the iconbar icon. This is optional and
- if it is omitted then no menu will be supplied by
- default
- pri: The priority for the iconbar icon
- position: Position information for the iconbar icon
- wimp_version: The version of the WIMP under which the task is
- designed to run. This determines the behavious of
- the task with respect to the various WIMP versions. The
- value is as specified in the PRM.
- message_list: This is a pointer to a list of words terminated
- by a word of 0. It is used in versions of the WIMP
- greater than or equal to 310 and contains a list
- of message ids meaningful to the task.
-
- </pre>
-
- By creating a class using this constructor it is prepared to run as a full
- task under RISC OS.
- <pre>
-
- Example:
-
- Task *game = new Task ("Wonderful game", "Game", "game", "game_menu") ;
-
- </pre>
- This is the most common Task constructor of the 3 available. It is used
- when the task is a 'normal' WIMP task with an icon on the icon bar. The
- last 4 parameters are used to control the advanced aspects of
- task and icon creation detailed in the PRMs.
-
-
- <p>
- <a name="ct2"></a>
-
- <h3>Task::Task (char *taskname,
- char *applname,
- int wimp_version,
- int *message_list)</h3>
-
- This constructor makes a task class suitable for running under RISC OS that
- does not have an icon on the icon bar. The parameters are:
- <pre>
-
- taskname: The name which appears on the Task Display window
- applname: The name of the application. This is used to construct
- the application directory variables by appending $Dir (
- and possibly $Path)
- wimp_version: The version of the WIMP under which the task is
- designed to run. This determines the behavious of
- the task with respect to the various WIMP versions. The
- value is as specified in the PRM.
- message_list: This is a pointer to a list of words terminated
- by a word of 0. It is used in versions of the WIMP
- greater than or equal to 310 and contains a list
- of message ids meaningful to the task.
-
- Example:
-
- Task *game = new Task ("Silly clock", "Clock") ;
-
- </pre>
- This constructor creates a task which does not have an icon on the
- icon bar.
- <p>
- <a name="ct3"></a>
-
- <h3>Task::Task (char *taskname,
- char *applname,
- Icon *iconbar,
- char *iconmenu,
- int pri,
- int position,
- int wimp_version,
- int *message_list)</h3>
-
- This constructor makes a task class suitable for running under RISC OS that
- has an icon on the icon bar. The parameters are:
- <pre>
-
- taskname: The name which appears on the Task Display window
- applname: The name of the application. This is used to construct
- the application directory variables by appending $Dir (
- and possibly $Path)
- iconbar: A pointer to an Icon object to use as the icon bar icon.
- iconmenu: The name of a menu which will be used if the user clicks
- 'menu' over the iconbar icon. This is optional and
- if it is omitted then no menu will be supplied by
- default
- pri: The priority for the iconbar icon
- position: Position information for the iconbar icon
- wimp_version: The version of the WIMP under which the task is
- designed to run. This determines the behavious of
- the task with respect to the various WIMP versions. The
- value is as specified in the PRM.
- message_list: This is a pointer to a list of words terminated
- by a word of 0. It is used in versions of the WIMP
- greater than or equal to 310 and contains a list
- of message ids meaningful to the task.
-
-
- </pre>
-
- This constructor is similar to 3.1.4 except that it takes a pointer to
- a preexisting Icon object. This is usefiul if you need to access the
- icon to modify it (like the Alarm application supplied with the computer)
-
- <p>
- <a name="dt"></a>
-
- <h3>Task::~Task()</h3>
-
- This is the class destructor. It is called when the class goes out of
- scope or is deleted. It simply closes all the open windows and fonts.
-
-
- <p>
- <a name="set_mask"></a>
-
- <h3>Task::set_mask (int mask)</h3>
-
- This function sets the polling mask for Wimp_Poll to the value given. The
- polling mask is used to prevent certain events being delivered to the task.
- For full details, see the PRM.
- <p>
- Example:
- <pre>
-
- game->set_mask (1 << ENULL) ; // disable NULL events
-
- </pre>
-
- NB. By default, NULL events are not delivered to the task except
- when there are preempted threads running.
-
- <p>
- <a name="run"></a>
- <h3>Task::run()</h3>
-
- This function sets the task running. It will not return until the task
- has been stopped by a call to the 'stop' function (see below). The task
- runs by entering a loop calling Wimp_Poll and acting on the events passed
- to it.
-
-
- <p>
- <a name="exit"></a>
- <h3>Task::exit (int status = 0)</h3>
-
- This function causes the task to exit immediately with the status given.
- The default value for status is 0. It results in a call to the Shared
- C Library function 'exit'.
-
- <p>
- <a name="spawn"></a>
- <h3>Task::spawn (char *command...</h3>
-
- This function is used to create a new task which runs the command constructed
- from the printf style format string and a list of arguments. This function
- <b>must</b> be used to spawn a new task and not the SWI Wimp_StartTask
- as it is necessary to stop the threads before wht WIMP switches out the
- task.
- <p>
- For example, this command will open a filer window at the coordinates
- (x,y) and showing small icons.
- <pre>
-
- task->spawn ("filer_opendir %s %d %d -si",dirname, x, y) ;
-
- </pre>
-
- <p>
- <a name="sleep1"></a>
- <h3>Task::sleep (ThreadResource *, int pri = THREAD_BASE_PRIORITY)</h3>
-
- This function causes the current thread to sleep until the given
- resource is available. The most common use of this is to sleep
- until another thread has terminated. See the section on Threads
- for more detail on Threads and Resources.
-
- <p>
- <a name="sleep2"></a>
- <h3> Task::sleep (int time)</h3>
-
- This causes the current thread to sleep for a specified number of
- centiseconds. The purpose is to cause a delay in the processing
- of the thread. It could be used to implement a timing loop for,
- say, a clock.
-
- <p>
- <a name="yield"></a>
- <h3> Task::yield()</h3>
-
- This function causes the current thread to give up the processor
- in favour of the next available thread. By judicious use of the
- yield function when there is nothing for a thread to do, the
- performance of the task can be maintained. You should never
- put a thread into a tight loop as this causes a noticible
- degradation in performance of the machine. See the section
- on Threads for more detail.
-
-
- <p>
- <a name="add_window"></a>
- <h3> Task::add_window (Window *w)</h3>
-
- This function adds a window to the list of known windows in the task. When
- a window is known to a task, the task can invoke the appropriate virtual
- functions when certain events task place. All windows must be added to the
- task in order for Vista to operate correctly. This is done automatically
- by the Window constructors.
-
-
-
- <p>
- <a name="remove_window"></a>
- <h3> Task::remove_window (Window *w)</h3>
-
- This function removes a window from a task. It must be called when a
- window is deleted and is done automatically by the Window destructor.
-
- <p>
- <a name="delete_window"></a>
- <h3> Task::delete_window (Window *w)</h3>
-
- One of the inherent problems with object based event processing
- systems is how to delete the windows. Usually, the program
- knows to delete a window from a user action such as a mouse
- click. However, if the window is deleted from here, the
- system will crash beacuse you are actually 'in' the window
- you are deleting. This function is provided to allow the
- deletion of windows from within the window itself. The actual
- deletion does not occur until the thread has finished.
-
-
- <p>
- <a name="delete_deferred"></a>
- <h3> Task::delete_deferred (DeferredDelete *)</h3>
-
- This function is used to signify the deletion of an object
- that cannot be deleted right away. Examples of such objects
- are Windows and Threads which cannot delete themselves. An`
- object registered by use of this function will be deleted when
- the thread which caused the deletion has terminated.
-
- <p>
- <a name="find_window"></a>
- <h3> Task::find_window (int handle)</h3>
-
- This function searches the list of known windows for that whose WIMP handle
- is given. The result is NULL if the window doesn't exist, otherwise
- a pointer to the Window found is returned.
-
-
-
- <p>
- <a name="find_template"></a>
- <h3> Task::find_template (char *name)</h3>
-
- This function is used internally by the task to find the template associated
- with a window upon window creation. It searches the list of known
- templates for the name given.
-
-
-
- <p>
- <a name="find_menu"></a>
- <h3> Task::find_menu(char *name)</h3>
-
- This function is used to find the Menu class associated with a given
- name. If returns NULL if the menu wasn't found, or a pointer to a menu
- otherwise.
-
-
-
- <p>
- <a name="get_iconbar_menu"></a>
- <h3> Task::get_iconbar_menu (int icon)</h3>
-
- This virtual function is called when a task has not been given a default
- iconbar menu (in the Task constructor). The idea is that the user should
- derive a new class from the Task class which will provide this function
- if the iconbar menu is not known at task startup time. It gives the
- flexibility for dynamic iconbar menus.
-
-
-
- <p>
- <a name="menu"></a>
- <h3> Task::menu (MenuItems items[])</h3>
-
- This virtual function must be provided by a derived class and is called
- when the user selects a menu option from the iconbar menu (either default
- or user provided). It is passes an array of MenuItem classes which
- may be used by the function to determine the appropriate action.
-
-
-
- <p>
- <a name="click"></a>
- <h3> Task::click (int x, int y, int buttons, int icon)</h3>
-
- This virtual function must be provided by a derived class and is called
- when the user clicks the mouse buttons (either Select or Adjust) which is
- not over a window in a task. This will happen when the user clicks
- over the iconbar icon. The parameters are those returned to the
- task from the WIMP (see the PRM)
-
-
-
- <p>
- <a name="lookup"></a>
- <h3> Task::lookup (char *token)</h3>
-
- This function is used to provide a translation for a message token. The
- task maintains a set of messages internally (from the Messages file) and
- this function does a lookup on this list. It returns the text associated
- with the token if it exists, otherwise it returns the token it was given.
-
-
-
- <p>
- <a name="send_message"></a>
- <h3>Task::send_message (events event, int action,
- int &task, int &my_ref,
- int your_ref, int data_length,
- void *data, int icon = 0)</h3>
-
- This function is used to send a message to another task. It simply
- calls the WIMP routine Wimp_SendMessage.
-
-
-
- <p>
- <a name="print"></a>
- <h3> Task::print (char *format ...)</h3>
-
- This function takes a printf style format string and creates an error
- window on the screen containing the text (and parameters) created
- from the format string. The function will return when the user
- clicks OK in the error box. It is useful for debugging and presenting
- errors on the screen.
-
-
-
- <p>
- <a name="pre_menu"></a>
- <h3> Task::pre_menu (Menu *menu)</h3>
-
- This virtual function may be provided by a derived class and is called when
- the user clicks menu over the iconbar menu. It gives the derived class
- a chance to change any of the menu entries before the menu appears on
- the screen. It is passed a pointer to the Menu class which will be
- displayed. The derived class can then do anything to that menu (except
- delete it of course), such as printing to an entry or changing the number
- of entries.
-
-
-
- <p>
- <a name="register_drag"></a>
- <h3> Task::register_drag (Window *dragger, int id)</h3>
-
- This function is used to register the fact that a window has caused a
- drag to occur. The task will inform the window when the drag has completed.
- The 'id' parameter passed is passed on to the window when the drag completes
- so that the window can determine the origin of the drag.
-
-
- <p>
- <a name="register_object_drag"></a>
- <h3> Task::register_object_drag (Object *dragger, int id)</h3>
-
- This is similar to the register_drag function ecxept the drag
- events are passed to an Object inside a window instead of a
- window itself.
-
-
- <p>
- <a name="add_receiver"></a>
- <h3> Task::add_receiver (Channel *channel, int message)</h3>
-
- This function is used to inform the task that a particular Channel class
- is interested in the any messages whose id is 'message'. The channel
- will be informed when any such message arrives at the task.
-
-
-
- <p>
- <a name="remove_receiver"></a>
- <h3> Task::remove_receiver (Channel *channel, int message)</h3>
-
- This function is used to remove a Channel's interest in receiving message
- of the given id. It should be called when a Channel is being deleted.
-
-
- <p>
- <a name="open_font"></a>
- <h3> Task::open_font (char *name, int xsize, int ysize)</h3>
-
- This function opens a font (using Font_FindFont) and returns a handle to the
- caller.
-
-
-
- <p>
- <a name="close_font"></a>
- <h3> Task::close_font(int handle)</h3>
-
- This function closes the font whose handle is given as the parameter.
-
-
-
- <p>
- <a name="enter_critical"></a>
- <h3> Task::enter_critical()</h3>
-
- This function must be called when it is important that a thread must not be
- interrupted. It is used in situations like the ubiquitous GetRectangle
- loop to redraw a window where the thread must complete its task before
- being interrupted. By calling this function you are stopping all the
- threads except the calling thread.
-
-
- <p>
- <a name="exit_critical"></a>
- <h3> Task::exit_critical()</h3>
-
- This function is the opposite of enter_critical as it restarts the
- stopped threads.
-
-
- <p>
- <a name="find_sprite"></a>
- <h3> Task::find_sprite(char *name)</h3>
-
- This utility function can be used to find the address of a sprite
- in the WIMP sprite pool. This facility seems to have been omitted from
- the operating system. It returns the address of the sprite found.
-
-
- <p>
- <a name="poll_word_non_zero"></a>
- <h3> Task::poll_word_non_zero(int *poll_word, int contents)</h3>
-
- This is called when the event POLLWORDNONZERO is returned from
- Wimp_Poll. See the PRM for more details.
-
- <p>
- <a name="set_menu"></a>
- <h3> Task::set_menu (Menu *menu, Icon *icon),set_menu (Menu *menu, Object *object),
- set_menu (Menu *menu, Window *window) </h3>
-
- These three functions are used to set up the task so that a menu selection
- is routed to the appropriate icon, object or window. When the user clicks
- 'menu' over an icon, object or window the task is normally set up to deal
- with the menu selection. However, if a menu is created (using display_menu)
- from an event other than a menu click, the task needs to be informed of this
- fact so that it can distribute the selection. So, if you display a menu
- from something other than a menu click (say a select click), then one
- of these functions must be called.
-
- <p>
- <a name="help"></a>
- <h3 Task::help (int mx, int my, int buttons, int window, int icon) </h3>
-
- This function is called when the task is being asked for help. It is called
- when none of the windows are prepared to help or when the mouse is not
- over a window owned by the task (the Iconbar icon say).
- <p>
- The function should return a pointer to the help string to be
- printed by the interactive help application. If no help
- is available, just return NULL. This is a virtual function
- so each derived class may provide its own help by providing
- this function.
- <p>
- The parameters are as passed in the WIMP HelpRequest message. See the
- PRM for details.
-
- <p>
- <a name="show_threads"></a>
- <h3 Task::show_threads() </h3>
-
- This function writes a listing of the current threads into the debug
- window (if a template called 'debug' exists in the templates file).
- The listing shows each of the threads with the following information:
- <p>
- <ul>
- <li>NAME: The name of the thread
- <li>STATE: The current thread state. States are:
- <ol>
- <li>IDLE: The thread is not doing anything
- <li>READY: The thread is ready to run and will be scheduled soon
- <li>RUNNING: The thread is the currently running thread
- <li>SLEEPING: The thread is waiting for a resource to become available
- <li>STOPPED: The thread has been stopped and can be resumed
- <li>DEAD: The thread is dead and cannot be resumed
- </ol>
- <li>PRI: The current priority of the thread. The lower the number, the
- higher the priority
- <li>BPRI: The base priority of the thread
- <li>CPU: The number of centiseconds of (decayed) cputime
- <li>ACCCPU: The accumulated number of centiseconds for the thread (not meaningful for
- the "main" thread)
- </ul>
-
- <p>
- <a name="last_event"></a>
- <h3> Task::last_event</h3>
-
- This variable hold the code of the last event to be passed to the task
-
-
-
- <p>
- <a name="last_event_data"></a>
- <h3> Task::last_event_data</h3>
-
- This variable is a buffer holding the event data for the last event passed
- to the task.
-
-
- <p>
- <a name="xeigfactor"></a>
- <h3> Task::xeigfactor</h3>
-
- This is the number of places an X coordinate must be shifted left in order
- to calculate an OS unit from a pixel unit. See the PRM.
-
-
- <p>
- <a name="yeigfactor"></a>
- <h3> Task::yeigfactor</h3>
-
- This is the Y equivalent of xeigfactor.
-
-
-
- <p>
- <a name="iconbar_icon"></a>
- <h3> Task::iconbar_icon</h3>
-
- This is a pointer to the Icon used to hold the icon on the iconbar.
- It can be used by the program to modify the icon.
-
-
- <p>
- <a name="debug"></a>
- <h3> Task::debug</h3>
-
- This is a pointer to a debug output window. It may be used by a task to
- write debug information to a window using a printf style call. The
- call 'task->debug->print()' may be used to print to the window. It will
- open on the screen if it is not open or has been closed.
-
- Another method of writing to the debug window is by using the 'dprintf'
- function. This takes the same parameters as printf and is at global
- scope so there is no need to know the task before calling it.
-
- The debug facility requires the existence of a window called 'debug'
- within the template file.
-
-
-
- <p>
- <a name="program"></a>
- <h3> Task::program</h3>
-
- This variable is the name of the current program. It is the application
- name passed to the contstructor.
-
-
-
- <p>
- <a name="handle"></a>
- <h3> Task::handle</h3>
-
- This is the WIMP handle given to the task when it initialises. It should
- not be modified.
-
-
-
- <p>
- <a name="country"></a>
- <h3> Task::country</h3>
-
- This is the name of the country in which the resources may be found. It
- is read from the 'Country' file in the 'Resources' directory.
-
-
-