|
||
The RWindowBase
class is the abstract base class for all windows which may be displayed. These windows further subdivide into two types:
windows that may be drawn (RDrawableWindow
abstract class), and blank windows (RBlankWindow
class).
Displayable windows introduce several new attributes and associated functions:
All windows have a rectangle which defines the area that they are contained in. Most windows will fill all of this area, but you can set rounded corners or even specify any arbitrary region for the windows area
Whether the window is visible or not, controlled by the RWindowBase::SetVisible()
function.
Whether the window backs up the contents of the screen behind it, so that the screen may be redrawn when the window is destroyed or moved: this facility is designed for transient windows such as dialog boxes or menu panes, and such windows are referred to as overlay windows.
Anything to do with pointer event control, see Pointer handling.
The window server maintains the screen display taking into account the region, ordinal position, visibility and shadow requirements of all displayable windows.
The RWindow
class is derived from RDrawableWindow
and implements a window whose invalid areas must be redrawn by the client application. Such windows require very little
RAM. Therefore, they are the most common type of window used by Symbian applications.
A backed up window, provided by the RBackedUpWindow
class, maintains its content on a backup bitmap, so that the window may be redrawn by the window server when it becomes invalid,
without generating a redraw event to the application.
The direct bitmap access functions allow the application to directly access the bitmap used by the window server for backing up the window. By default, areas of a backed-up window that are currently visible on the screen are not backed up. When a region of the window is covered by another window, that region's contents are copied to the bitmap before being covered over on the screen.
An alternative approach to this is provided by the RBackedUpWindow::MaintainBackup()
function. If a window calls MaintainBackup()
, its backup window will thereafter be permanently maintained to contain a copy of the entire window contents at all times.
This ensures a rapid response when a region of the window becomes covered by another window, as the contents of that region
do not need to be copied to the backup bitmap. It is also useful if an application wishes to draw to or read from the backup
bitmap directly, as it ensures that the backup bitmap always contains an up-to-date copy of the window contents.
However, note that calling MaintainBackup()
may produce a reduction in performance, as the window server must subsequently carry out all drawing commands on both the
screen and the bitmap. The more drawing-intensive an application, the more severe this degradation in performance will be.