A real problem when using a large-screen emulation is that dialog and alert boxes often appear outside the visible portion of the total screen area. Programs such as BigScreen cannot alter this. A solution to this is offered by the possibility of providing information about which portion of the screen is visible at any given time.
The cookie jar can be used for this, which is intended for just such purposes. In our case the cookie is called VSCR, which is short for Virtual Screen. It points to a structure that contains information about the displayed segment of the total screen image. Applications can use this information to centre dialog boxes on the actually visible part of the screen, for instance.
The structure is defined as follows:
typedef struct { int32_t cookie; /* Must be 'VSCR' */ int32_t product; /* Same as XBRA ID of emulator */ int16_t version; /* Version of the VSCR protocol */ int16_t x,y,w,h; /* Visible segment of virtual screen */ } INFOVSCR;
A description of the individual components: cookie must have the value 0x56534352 ('VSCR'). The point of the whole thing is that a large-screen simulator can set the information structure to 'invalid', without having to remove the cookie first. BigScreen, for instance, can be active or inactive depending on the chosen resolution, and when the screen resolution is changed it uses this mechanism to switch the structure on or off as redquired.
A large-screen simulator can enter its own identifier in product. The four bytes should consist of four printable characters (ASCII-code between 32 and 126), just as with an XBRA identifier.
Program | Identifier |
BigScreen | BIGS |
BlowUP030 | BLOW |
LaceScan | LEmu |
NOVA VDI | IMNE |
The component version identifies the version of the VSCR protocol, and is intended to allow at some time in the future to supplement the structure with new fields. Finally, x, y, w and h specify the position, width and height of the visible screen segment.
The protocol is deliberately constructed in such a way that it may be used by other simulators as well, and extended if required.