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