SetCursor Project (For AVS module developers only)

Synopsis

The SetCursor project demonstrates one way of allowing a C or C++ module to change the mouse cursor to, for example, a busy or waiting cursor. This project is only intended to be used by AVS/Express module developers.

Description

The SetCursor project shows one way of changing the mouse cursor from a C or C++ module. This allows a module to do several things including displaying a busy cursor while it is doing its computations. The project includes the C source file cursor.c which is linked into Express through the SetCursorUtilityCode module. This module should not need to be edited and hence is not visible in the Network Editor. The cursor.c file contains a single function, SetApplicationCursor. The full declaration of the function is shown below:

void SetApplicationCursor(int enable)

Whenever this function is called a pre-defined AVS/Express cursor object is found and the attach parameter set. If enable is 1 then the attach parameter is set to true and the working cursor will appear when the mouse is over the application window. Conversely if enable is 0 then the attach parameter is set to false and the normal cursor will appear. The SetCursorExampleMod low-level module and its associated source code show how a call to this function could be made. The main advantage of the approach shown in this project is that the SetApplicationCursor function can be called from anywhere within a module's code and no extra references have to be managed.

The obvious limitation of this approach is that it relies on a pre-defined cursor object existing and the location of that object must be statically compiled into Express. To ensure that this happens correctly in your own projects you will have to alter the CURSOR_OBJ define in the cursor.c file. Currently this points to the Cursor object in the supplied example application. The define will have to be altered to reflect and actual name and user interface structure of your application. Because of this limitation the approach shown in this project will be of most use in a small number of situations. These are where a compiled Express project will be produced and where the user interface modules can be hidden from the user.

Example

An example application SetCursorEg is provided. This demonstrates how the SetCursorExampleMod and Cursor objects should be connected with the rest of the application network. To see how the SetApplicationCursor function should be used the source code to the SetCursorExampleMod should be examined.

Files

iac_proj/setcur/cur_mods.v contains the V definitions of the SetCursorUtilityCode and SetCursorExampleMod modules.

iac_proj/setcur/cur_apps.v contains the V definition of the SetCursorEg example application.

Other Notes

This module is intended for AVS/Express module developers only. The low-level SetCursorMods library containing the modules SetCursorUtilityCode and SetCursorExampleMod does not specify a process. By default the express process will be used. For this project to work correctly both of these modules must be in the same process.

Author

Dr David Knight,
AVS Inc.

Modifications

Ma YingLiang,
Manchester Visualization Centre

Andrew Dodd,
International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
UK
M13 9PL

See Also