## Input/Output Device Driver Reference

[prev][next][parent][TOC]

### Power Object

As previously mentioned, the OS/2 Power object provides the GUI for power management actions. The complete explanation of the Power object GUI details are documented in the OS/2 V2.1 Update Redbook. In addition, the Power object provides a set of Workplace Shell* methods as an application programming interface (API). The complete explanation of the Power object methods are documented in the Presentation Manager Programming Reference for OS/2.

The Power object is located in the System Setup folder, which is located inside the OS/2 System Folder. The Power object is automatically installed on systems containing the APM BIOS interfaces. In addition, the user can selectively install the Power object (and subsystem) by way of the OS/2 Selective Installation procedures.

A useful tool to customize the Power Object Notebook is the OEM extensions. Some OEM computer vendors add additional power savings capabilities outside the 1.1 specifications and the OS/2 Power object adheres to the 1.1 specification. To provide the OEM extensions, replace the WPPower class and use the wpAddSettingsPages and wpInsertSettingsPage methods with a tab label of "Options".

The ability to perform an immediate conservation of power is controlled by way of selections in the object's pop-up menu. Any Power object extensions can be added in device-specific power state controls by subclassing the pop -up menu and adding or replacing specific menu selections. Furthermore, the conditional cascade menu control (right pointing arrow) should be used to provide the conditional cascade submenu with its additional suboptions. One of the cascaded submenu suboptions should be an "All" option that acts as a replacement for the existing system-wide menu option. A device specific option for the customized device support should also be added to the cascade submenu. The cascaded submenu option that is currently active (defined by check box control) is the option which will be executed when the pop-up menu option is selected.

Pop-up menu options are added by way of the wpModifyPopupMenu method. The OEM extension DLL code maps wpMenuItemSelected notifications for the "All" condition to the original pop-up menu option value. The extension passes the notification on to the OS/2 Power object for normal processing.

The following figure depicts the user's view of the topics previously discussed.

[Artwork not shown]