A presentation space is a data structure maintained by the operating system in which information relevant to the graphic output is stored. The information is related to both the subsequent drawings (such as colors or line styles) and the presentation space resources (such as color tables or fonts).
The first task in a graphics application is to define a presentation space, because so many of the GPI functions must operate within them. A presentation space is required for each output device currently in use by your application, including each separate window on the display screen. In almost all cases, the presentation space is set up to be device-independent, because the requirements of each possible output device are so different.
Note: In some cases, it is possible to disassociate a presentation space from one device and associate it with another, thereby allowing the presentation space to be shared.
To facilitate the device independence of the PM programming interface, all device-specific information is held in a device context. A device context is a data structure that identifies a particular instance of an output device and contains all the device-specific information, such as the logical name of the device and the presentation driver name. Each separate instance of an output device that you intend to use must be described in a device context. For example, if a single application uses more than one window, each of those windows must have its own window device context.
The applicable device context, then, must be associated with the presentation space in order to send graphics data to that output device.
This chapter describes presentation spaces and device contexts. The following topics are related to the information in this chapter: