HostPower.h revision f6adf1a86574758258baa232172c965aed0d848d
f650118f144626d9f84baace12426f962f41a252vboxsync * VirtualBox interface to host's power notification service
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync * Copyright (C) 2006-2008 Sun Microsystems, Inc.
f650118f144626d9f84baace12426f962f41a252vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
f650118f144626d9f84baace12426f962f41a252vboxsync * available from http://www.virtualbox.org. This file is free software;
f650118f144626d9f84baace12426f962f41a252vboxsync * you can redistribute it and/or modify it under the terms of the GNU
f650118f144626d9f84baace12426f962f41a252vboxsync * General Public License (GPL) as published by the Free Software
f650118f144626d9f84baace12426f962f41a252vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
f650118f144626d9f84baace12426f962f41a252vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f650118f144626d9f84baace12426f962f41a252vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f650118f144626d9f84baace12426f962f41a252vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
f650118f144626d9f84baace12426f962f41a252vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
f650118f144626d9f84baace12426f962f41a252vboxsync * additional information or have any questions.
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync#endif /* RT_OS_DARWIN */
f650118f144626d9f84baace12426f962f41a252vboxsynctypedef enum
f650118f144626d9f84baace12426f962f41a252vboxsync * The Windows hosted Power Service.
f650118f144626d9f84baace12426f962f41a252vboxsync static DECLCALLBACK(int) NotificationThread (RTTHREAD ThreadSelf, void *pInstance);
f650118f144626d9f84baace12426f962f41a252vboxsync static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync * The Darwin hosted Power Service.
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsyncclass HostPowerServiceDarwin : public HostPowerService
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync static DECLCALLBACK(int) powerChangeNotificationThread (RTTHREAD ThreadSelf, void *pInstance);
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync static void powerChangeNotificationHandler (void *pData, io_service_t service, natural_t messageType, void *pMessageArgument);
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync static OSErr lowPowerEventHandler (const AppleEvent * theAppleEvent, AppleEvent * replyAppleEvent, long refCon);
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync /* Private member vars */
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync io_connect_t mRootPort; /* A reference to the Root Power Domain IOService */
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync IONotificationPortRef mNotifyPort; /* Notification port allocated by IORegisterForSystemPower */
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync io_object_t mNotifierObject; /* Notifier object, used to deregister later */
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync CFRunLoopRef mRunLoop; /* A reference to the local thread run loop */
d7d19e45a09d1de61282ca1a0dca6bac563ed527vboxsync# endif /* RT_OS_DARWIN */
899cf879d9636e1b7fe8bd6b05926c372dc32ed5vboxsync#endif /* !____H_HOSTPOWER */
f6adf1a86574758258baa232172c965aed0d848dvboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */