2008-01-29 Brandon Sneed <nivenh@sourceware.org>

* include/winnt.h (SYSTEM_POWER_CONDITION): typedef.
	* include/winuser.h (PBT_POWERSETTINGCHANGE, DEVICE_NOTIFY_WINDOW_HANDLE,
	DEVICE_NOTIFY_SERVICE_HANDLE): define.
	* include/winuser.h (LPCGUID, HPOWERNOTIFY, POWERBROADCAST_SETTING): typedefs.
	* include/winuser.h (GUID_POWERSCHEME_PERSONALITY, GUID_MIN_POWER_SAVINGS,
	GUID_MAX_POWER_SAVINGS, GUID_TYPICAL_POWER_SAVINGS, GUID_ACDC_POWER_SOURCE,
	GUID_BATTERY_PERCENTAGE_REMAINING, GUID_IDLE_BACKGROUND_TASK,
	GUID_SYSTEM_AWAYMODE, GUID_MONITOR_POWER_ON): added externs for GUIDs.
	* include/winuser.h (RegisterPowerSettingNotification,
	UnregisterPowerSettingNotification): Add prototypes.
	* lib/user32.def: Added imports for the above prototypes.
	* lib/Makefile.in: Added build support for power-uuid.c.
	* lib/power-uuid.c: New file containing power GUID definitions.
This commit is contained in:
Brandon Sneed
2008-01-29 21:18:49 +00:00
parent 458430dc16
commit e917b0bc44
6 changed files with 85 additions and 3 deletions

View File

@ -1100,9 +1100,11 @@ extern "C" {
#define PBT_APMPOWERSTATUSCHANGE 10
#define PBT_APMOEMEVENT 11
#define PBT_APMRESUMEAUTOMATIC 18
#define PBTF_APMRESUMEFROMFAILURE 1
#endif
#if (_WIN32_WINNT >= 0x0600)
#define PBT_POWERSETTINGCHANGE 32787
#endif
/* end pbt.h */
#define PM_NOREMOVE 0
@ -3367,7 +3369,35 @@ typedef struct {
(p).y=HIWORD(*(DWORD *)&ps); \
}
#define POINTTOPOINTS(p) ((POINTS)MAKELONG((p).x,(p).y))
#ifndef _LPCGUID_DEFINED
#define _LPCGUID_DEFINED
typedef const GUID *LPCGUID;
#endif
#if (_WIN32_WINNT >= 0x0600)
#define DEVICE_NOTIFY_WINDOW_HANDLE 0
#define DEVICE_NOTIFY_SERVICE_HANDLE 1
typedef HANDLE HPOWERNOTIFY;
typedef struct {
GUID PowerSetting;
DWORD DataLength;
UCHAR Data[1];
} POWERBROADCAST_SETTING, *PPOWERBROADCAST_SETTING;
extern const GUID GUID_POWERSCHEME_PERSONALITY;
extern const GUID GUID_MIN_POWER_SAVINGS;
extern const GUID GUID_MAX_POWER_SAVINGS;
extern const GUID GUID_TYPICAL_POWER_SAVINGS;
extern const GUID GUID_ACDC_POWER_SOURCE;
extern const GUID GUID_BATTERY_PERCENTAGE_REMAINING;
extern const GUID GUID_IDLE_BACKGROUND_TASK;
extern const GUID GUID_SYSTEM_AWAYMODE;
extern const GUID GUID_MONITOR_POWER_ON;
#endif
WINUSERAPI HKL WINAPI ActivateKeyboardLayout(HKL,UINT);
WINUSERAPI BOOL WINAPI AdjustWindowRect(LPRECT,DWORD,BOOL);
WINUSERAPI BOOL WINAPI AdjustWindowRectEx(LPRECT,DWORD,BOOL,DWORD);
@ -3890,6 +3920,9 @@ WINUSERAPI UINT WINAPI RegisterClipboardFormatW(LPCWSTR);
WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE,LPVOID,DWORD);
WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE,LPVOID,DWORD);
#endif
#if (_WIN32_WINNT >= 0x0600)
WINUSERAPI HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE,LPCGUID,DWORD);
#endif
WINUSERAPI BOOL WINAPI RegisterHotKey(HWND,int,UINT,UINT);
#if (_WIN32_WINNT >= 0x0501)
WINUSERAPI BOOL WINAPI RegisterRawInputDevices(PCRAWINPUTDEVICE,UINT,UINT);
@ -4037,6 +4070,9 @@ WINUSERAPI BOOL WINAPI UnregisterClassW(LPCWSTR,HINSTANCE);
#if (_WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0500)
WINUSERAPI BOOL WINAPI UnregisterDeviceNotification(HANDLE);
#endif
#if (_WIN32_WINNT >= 0x0600)
WINUSERAPI BOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY);
#endif
WINUSERAPI BOOL WINAPI UnregisterHotKey(HWND,int);
WINUSERAPI BOOL WINAPI UpdateWindow(HWND);
#if (_WIN32_WINNT >= 0x0500)