Changeset 14527 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 24, 2008 4:04:15 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HostImpl.cpp
r14523 r14527 190 190 #if defined (RT_OS_WINDOWS) 191 191 mHostPowerService = new HostPowerServiceWin (mParent); 192 #elif defined (RT_OS_DARWIN) 193 mHostPowerService = new HostPowerServiceDarwin (mParent); 192 194 #else 193 195 mHostPowerService = new HostPowerService (mParent); -
trunk/src/VBox/Main/Makefile.kmk
r14485 r14527 294 294 295 295 VBoxSVC_SOURCES.darwin = \ 296 darwin/iokit.cpp 296 darwin/iokit.cpp \ 297 darwin/HostPowerDarwin.cpp 297 298 298 299 VBoxSVC_SOURCES.win = \ -
trunk/src/VBox/Main/include/HostPower.h
r13713 r14527 5 5 6 6 /* 7 * Copyright (C) 2006-200 7Sun Microsystems, Inc.7 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 28 28 #include <vector> 29 30 #ifdef RT_OS_DARWIN 31 # include <IOKit/pwr_mgt/IOPMLib.h> 32 # include <Carbon/Carbon.h> 33 #endif /* RT_OS_DARWIN */ 29 34 30 35 class VirtualBox; … … 72 77 RTTHREAD mThread; 73 78 }; 74 # endif /* RT_OS_WINDOWS */ 79 # elif defined(RT_OS_DARWIN) /* RT_OS_WINDOWS */ 80 /** 81 * The Darwin hosted Power Service. 82 */ 83 class HostPowerServiceDarwin : public HostPowerService 84 { 85 public: 86 87 HostPowerServiceDarwin (VirtualBox *aVirtualBox); 88 virtual ~HostPowerServiceDarwin(); 89 90 private: 91 92 static DECLCALLBACK(int) powerChangeNotificationThread (RTTHREAD ThreadSelf, void *pInstance); 93 static void powerChangeNotificationHandler (void *pData, io_service_t service, natural_t messageType, void *pMessageArgument); 94 static OSErr lowPowerEventHandler (const AppleEvent * theAppleEvent, AppleEvent * replyAppleEvent, long refCon); 95 96 /* Private member vars */ 97 RTTHREAD mThread; /* Our message thread. */ 98 99 io_connect_t mRootPort; /* A reference to the Root Power Domain IOService */ 100 IONotificationPortRef mNotifyPort; /* Notification port allocated by IORegisterForSystemPower */ 101 io_object_t mNotifierObject; /* Notifier object, used to deregister later */ 102 CFRunLoopRef mRunLoop; /* A reference to the local thread run loop */ 103 }; 104 # endif /* RT_OS_DARWIN */ 75 105 76 106 #endif /* !____H_HOSTPOWER */
Note:
See TracChangeset
for help on using the changeset viewer.