1. Introduction to the Solaris X Server
2. DPS Features and Enhancements
3. Visuals on the Solaris X Server
6. Transparent Overlay Windows
What are Transparent Overlay Windows?
More on Transparent Overlay Characteristics
Choosing Visuals for Overlay/Underlay Windows
Overview of the Solaris Transparent Overlay Window API
Creating Transparent Overlay Windows
Setting the Paint Type of a Graphics Context
Setting the Background State of a Transparent Overlay Window
Rendering to a Transparent Overlay Window
Querying the Characteristics of a Transparent Overlay Window
Determining Whether a Window is an Overlay Window
Determining the Paint Type of a Graphics Context
Filling an Area Using the Source Area Paint Type
Copying an Area and Its Paint Type
Retrieving Overlay Color Information
Using Existing Xlib Pixel Transfer Routines
Designing an Application for Portability
Selecting a Visual for an Overlay/Underlay Window
A transparent overlay window is a special class of an X InputOutput window into which pixels can be rendered transparently. Handles to transparent overlay windows have the X window type Window. Just like standard X windows, overlay windows are drawables, and an overlay window handle can be passed to any Xlib drawing routine that takes a Drawable.
Transparent overlay windows have extended the set of graphics context attributes to include an attribute for paint type. With the transparent overlay extension, transparent overlay windows can be rendered to with either opaque or transparent paint.
While standard X InputOutput windows and other drawables (such as pixmaps) accept only opaque paint, transparent overlay windows permit pixels to be rendered with transparent paint. Valid pixel values painted opaquely obscure pixels in underlying windows. Such pixels have associated color values that are displayed. Pixels rendered transparently have no intrinsic color; they derive their displayed color from the pixels that lie beneath.
Valid pixel values for pixels painted opaquely are obtained via XAllocColor() or another standard pixel allocation mechanism. Painting opaquely with a non-valid pixel value, for example a value that falls outside the valid colormap entries for a visual, produces undefined results for both transparent overlay windows and standard X InputOutput windows.
Paint type is defined with the data structure XSolarisOvlPaintType. By default, the paint type of a GC is opaque. The XSolarisOvlPaintType data structure is defined as:
typedef enum { XSolarisOvlPaintTransparent, XSolarisOvlPaintOpaque, } XSolarisOvlPaintType;
A transparent overlay window is considered viewable even if all its pixels are fully transparent. For viewable pixels in a transparent overlay window that are fully transparent, the underlying pixels in the underlay will be displayed.
If an overlay window is unmapped or moved, the underlay beneath may receive exposure events. This, for example, is the case on devices that cannot display the overlay window and underlay window in different plane groups.