Presentation Spaces and Device Contexts

A display window provides a view into a conceptual display surface known as a presentation space. In terms of the above definition of a window, the presentation space is actually the object upon which the window and its window procedure operate. The contents of the presentation space represent application data such as a document or graphical image. The application places text and graphical items such as lines, arcs, and colors, in the presentation space by means of PM API functions (the GPI functions).

The window therefore provides the user with a view of the presentation space, using the screen. This view may show the entire presentation space or only a portion, depending on the size of the window and that of the presentation space. The size of the window is controlled by the user, although it is limited by the physical size and resolution of the screen. The size of the presentation space is controlled by the application and is limited by the amount of available memory which may be used to contain the presentation space.

A presentation space is usually created by a window procedure when a window is created, and is associated with a device context at that time.

A device context relates a presentation space to a physical device such as the screen or a printer, by converting the device-independent information stored in the presentation space to a device-dependent form that can be displayed on a particular device. If the contents of the presentation space must later be drawn on a device other than that for which the presentation space was initially created, the presentation space may simply be re-associated with a different device context. This may, for example, be done when a graphical picture in a window on the screen needs to be printed. The presentation space that was originally associated with a screen device context is re-associated with a printer device context.


[Back: Messages]
[Next: Presentation Manager API Enhancements in OS/2 V2.0]