- Timestamp:
- Feb 2, 2009 5:21:58 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 42355
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r16385 r16469 151 151 VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS 152 152 VirtualBox_DEFS.debug = VBOX_CHECK_STATE # QT_FATAL_ASSERT 153 VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP 153 VirtualBox_DEFS.darwin = VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP 154 VirtualBox_DEFS.darwin.x86= VBOX_GUI_USE_QUARTZ2D 154 155 VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL 155 156 VirtualBox_DEFS.linux = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL -
trunk/src/VBox/Frontends/VirtualBox/include/DarwinKeyboard.h
r8155 r16469 22 22 23 23 24 #ifndef __ DarwinKeyboard_h__25 #define __ DarwinKeyboard_h__24 #ifndef ___DarwinKeyboard_h___ 25 #define ___DarwinKeyboard_h___ 26 26 27 27 #include <iprt/cdefs.h> 28 #include <C arbon/Carbon.h>28 #include <CoreFoundation/CFBase.h> 29 29 30 30 __BEGIN_DECLS -
trunk/src/VBox/Frontends/VirtualBox/include/QIHotKeyEdit.h
r11995 r16469 21 21 */ 22 22 23 #ifndef __ QIHotKeyEdit_h__24 #define __ QIHotKeyEdit_h__23 #ifndef ___QIHotKeyEdit_h___ 24 #define ___QIHotKeyEdit_h___ 25 25 26 26 #include <QLabel> … … 28 28 #include <QMap> 29 29 #endif 30 #if defined (Q_WS_MAC) 31 # include <Carbon/Carbon.h>30 #if defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 31 # include <Carbon/Carbon.h> 32 32 #endif 33 33 … … 82 82 #elif defined (Q_WS_X11) 83 83 bool x11Event (XEvent *event); 84 #elif defined (Q_WS_MAC) 84 #elif defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 85 85 static pascal OSStatus darwinEventHandlerProc (EventHandlerCallRef inHandlerCallRef, 86 86 EventRef inEvent, void *inUserData); … … 106 106 #endif 107 107 108 #if defined (Q_WS_MAC) 108 #if defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 109 109 /** Event handler reference. NULL if the handler isn't installed. */ 110 110 EventHandlerRef mDarwinEventHandlerRef; … … 117 117 }; 118 118 119 #endif // __QIHotKeyEdit_h__119 #endif // !___QIHotKeyEdit_h___ 120 120 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
r15804 r16469 21 21 */ 22 22 23 #ifndef __ VBoxConsoleView_h__24 #define __ VBoxConsoleView_h__23 #ifndef ___VBoxConsoleView_h___ 24 #define ___VBoxConsoleView_h___ 25 25 26 26 #include "COMDefs.h" … … 39 39 40 40 #if defined (Q_WS_MAC) 41 # include <Carbon/Carbon.h> 41 # ifdef QT_MAC_USE_COCOA 42 /** @todo include something chocolatety... */ 43 # else 44 # include <Carbon/Carbon.h> 45 # endif 42 46 #endif 43 47 … … 160 164 bool x11Event (XEvent *event); 161 165 #elif defined(Q_WS_MAC) 166 # ifndef QT_MAC_USE_COCOA 162 167 bool darwinKeyboardEvent (EventRef inEvent); 168 # endif 163 169 void darwinGrabKeyboardEvents (bool fGrab); 164 170 #endif … … 295 301 296 302 #if defined(Q_WS_MAC) 297 # if ndef VBOX_WITH_HACKED_QT303 # if !defined (VBOX_WITH_HACKED_QT) && !defined (QT_MAC_USE_COCOA) 298 304 /** Event handler reference. NULL if the handler isn't installed. */ 299 305 EventHandlerRef mDarwinEventHandlerRef; … … 313 319 static LRESULT CALLBACK lowLevelKeyboardProc (int nCode, 314 320 WPARAM wParam, LPARAM lParam); 315 #elif defined (Q_WS_MAC) 321 #elif defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 316 322 EventHandlerRef mDarwinWindowOverlayHandlerRef; 317 323 # ifndef VBOX_WITH_HACKED_QT … … 334 340 }; 335 341 336 #endif // __VBoxConsoleView_h__337 342 #endif // !___VBoxConsoleView_h___ 343 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r16319 r16469 41 41 #endif 42 42 #ifdef Q_WS_MAC 43 # undef PAGE_SIZE 44 # undef PAGE_SHIFT 45 # include <Carbon/Carbon.h> 43 # ifdef QT_MAC_USE_COCOA 44 /** @todo Carbon -> Cocoa */ 45 # else 46 # undef PAGE_SIZE 47 # undef PAGE_SHIFT 48 # include <Carbon/Carbon.h> 49 # endif 46 50 #endif 47 51 … … 356 360 #ifdef Q_WS_MAC 357 361 QRegion mCurrRegion; 362 # ifndef QT_MAC_USE_COCOA 363 /** @todo Carbon -> Cocoa */ 364 #else 365 # else 358 366 EventHandlerRef mDarwinRegionEventHandlerRef; 367 # endif 359 368 #endif 360 369 … … 386 395 QRect mNormalGeometry; 387 396 Qt::WindowFlags mSavedFlags; 397 # ifdef QT_MAC_USE_COCOA 398 /** @todo Carbon -> Cocoa */ 399 # else 388 400 /* For the fade effect if the the window goes fullscreen */ 389 401 CGDisplayFadeReservationToken mFadeToken; 402 # endif 390 403 #endif 391 404 }; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxDockIconPreview.h
r15804 r16469 21 21 */ 22 22 23 #ifndef __ VBoxDockIconPreview_h__24 #define __ VBoxDockIconPreview_h__23 #ifndef ___VBoxDockIconPreview_h___ 24 #define ___VBoxDockIconPreview_h___ 25 25 26 #include <Carbon/Carbon.h> 26 #include <QObject> /* drag in QT_MAC_USE_COCOA */ 27 28 #ifndef QT_MAC_USE_COCOA 29 /** @todo include chocolatey headers... */ 30 #else 31 # include <Carbon/Carbon.h> 32 #endif 27 33 28 34 class VBoxConsoleWnd; … … 38 44 39 45 void updateDockOverlay(); 46 #ifndef QT_MAC_USE_COCOA 40 47 void updateDockPreview (CGImageRef aVMImage); 48 #endif 41 49 void updateDockPreview (VBoxFrameBuffer *aFrameBuffer); 42 50 43 51 private: 52 #ifdef QT_MAC_USE_COCOA 53 /** @todo Carbon -> Cocoa */ 54 #else 44 55 inline void initPreviewImages(); 45 56 inline void initOverlayData (int aBitmapByteCount); … … 56 67 return aRect; 57 68 } 69 #endif /* !QT_MAC_USE_COCOA */ 58 70 59 71 /* Private member vars */ 60 72 VBoxConsoleWnd *mMainWnd; 73 #ifdef QT_MAC_USE_COCOA 74 /** @todo Carbon -> Cocoa */ 75 #else 61 76 const CGRect mDockIconRect; 62 77 … … 73 88 CGRect mUpdateRect; 74 89 CGRect mMonitorRect; 90 #endif 75 91 }; 76 92 77 #endif /* __VBoxDockIconPreview_h__ */93 #endif /* !___VBoxDockIconPreview_h___ */ 78 94 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r14056 r16469 21 21 */ 22 22 23 #ifndef __ VBoxFrameBuffer_h__24 #define __ VBoxFrameBuffer_h__23 #ifndef ___VBoxFrameBuffer_h___ 24 #define ___VBoxFrameBuffer_h___ 25 25 26 26 #include "COMDefs.h" … … 472 472 }; 473 473 474 #endif 475 476 #endif // !__ VBoxFrameBuffer_h__474 #endif /* Q_WS_MAC && VBOX_GUI_USE_QUARTZ2D */ 475 476 #endif // !___VBoxFrameBuffer_h___ -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxIChatTheaterWrapper.h
r8155 r16469 25 25 #if defined (Q_WS_MAC) && defined (VBOX_WITH_ICHAT_THEATER) 26 26 27 #include <Carbon/Carbon.h> 27 #ifdef QT_MAC_USE_COCOA 28 /** @todo Carbon -> Cocoa */ 29 #else 30 # include <Carbon/Carbon.h> 31 #endif 28 32 29 33 __BEGIN_DECLS 30 34 31 35 void initSharedAVManager(); 36 #ifdef QT_MAC_USE_COCOA 37 /** @todo Carbon -> Cocoa */ 38 #else 32 39 void setImageRef (CGImageRef aImage); 40 #endif 33 41 34 42 __END_DECLS -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxToolBar.h
r11535 r16469 21 21 */ 22 22 23 #ifndef __ VBoxToolBar_h__24 #define __ VBoxToolBar_h__23 #ifndef ___VBoxToolBar_h___ 24 #define ___VBoxToolBar_h___ 25 25 26 26 27 27 #ifdef Q_WS_MAC 28 #include "VBoxUtils.h"28 # include "VBoxUtils.h" 29 29 #endif 30 30 … … 78 78 { 79 79 mMainWindow->setUnifiedTitleAndToolBarOnMac (true); 80 # ifdef QT_MAC_USE_COCOA 81 /** @todo Carbon -> Cocoa */ 82 # else /* !QT_MAC_USE_COCOA */ 80 83 WindowRef window = ::darwinToWindowRef (this); 81 84 EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxToolBar::macEventFilter); … … 88 91 RT_ELEMENTS (eventTypes), eventTypes, 89 92 NULL, NULL); 93 # endif /* !QT_MAC_USE_COCOA */ 90 94 } 91 95 #endif /* Q_WS_MAC */ 92 96 } 93 97 94 #if def Q_WS_MAC98 #if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) 95 99 static pascal OSStatus macEventFilter (EventHandlerCallRef aNextHandler, 96 100 EventRef aEvent, void * /* aUserData */) … … 114 118 return CallNextEventHandler (aNextHandler, aEvent); 115 119 } 116 #endif /* Q_WS_MAC */120 #endif /* Q_WS_MAC && !QT_MAC_USE_COCOA */ 117 121 118 122 void setShowToolBarButton (bool aShow) … … 142 146 }; 143 147 144 #endif // __VBoxToolBar_h__148 #endif // !___VBoxToolBar_h___ 145 149 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils.h
r15804 r16469 21 21 */ 22 22 23 #ifndef __ VBoxUtils_h__24 #define __ VBoxUtils_h__23 #ifndef ___VBoxUtils_h___ 24 #define ___VBoxUtils_h___ 25 25 26 26 /* Qt includes */ … … 126 126 127 127 #ifdef Q_WS_MAC 128 # undef PAGE_SIZE129 # undef PAGE_SHIFT130 # include <Carbon/Carbon.h>131 132 /* Asserts if a != noErr and prints the error code */133 #define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a)))134 135 128 class QImage; 136 129 class QPixmap; … … 138 131 class VBoxFrameBuffer; 139 132 133 # ifdef QT_MAC_USE_COCOA 134 /** @todo Carbon -> Cocoa */ 135 # else /* !QT_MAC_USE_COCOA */ 136 # undef PAGE_SIZE 137 # undef PAGE_SHIFT 138 # include <Carbon/Carbon.h> 139 140 /* Asserts if a != noErr and prints the error code */ 141 # define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a))) 142 140 143 /* Converting stuff */ 141 144 CGImageRef darwinToCGImageRef (const QImage *aImage); … … 197 200 return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); 198 201 } 199 200 QString darwinSystemLanguage(); 201 202 bool darwinIsMenuOpen(); 202 #endif /* !QT_MAC_USE_COCOA */ 203 204 QString darwinSystemLanguage (void); 205 206 bool darwinIsMenuOpen (void); 203 207 204 208 void darwinSetShowToolBarButton (QToolBar *aToolBar, bool aShow); … … 210 214 211 215 /* Icons in the menu of an mac application are unusual. */ 212 void darwinDisableIconsInMenus(); 213 216 void darwinDisableIconsInMenus (void); 217 218 #ifndef QT_MAC_USE_COCOA 219 /** @todo Carbon -> Cocoa */ 220 #else /* !QT_MAC_USE_COCOA */ 214 221 /* Experimental region handler for the seamless mode */ 215 222 OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData); … … 228 235 OSStatus darwinOverlayWindowHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData); 229 236 230 # ifdef DEBUG237 # ifdef DEBUG 231 238 void darwinDebugPrintEvent (const char *aPrefix, EventRef aEvent); 232 # endif 239 # endif 240 # endif /* !QT_MAC_USE_COCOA*/ 233 241 #endif /* Q_WS_MAC */ 234 242 235 #endif // __VBoxUtils_h__236 243 #endif // !___VBoxUtils_h___ 244 -
trunk/src/VBox/Frontends/VirtualBox/src/QIDialog.cpp
r16176 r16469 47 47 setFixedSize (size()); 48 48 #ifdef Q_WS_MAC 49 # ifdef QT_MAC_USE_COCOA 50 /** @todo Carbon -> Cocoa */ 51 # else 49 52 ChangeWindowAttributes (::darwinToWindowRef (this), kWindowNoAttributes, kWindowResizableAttribute); 53 # endif 50 54 #endif /* Q_WS_MAC */ 51 55 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r16176 r16469 106 106 #endif 107 107 108 #if defined (Q_WS_MAC) 108 #if defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 109 109 110 110 # ifndef VBOX_WITH_HACKED_QT … … 184 184 # endif /* VBOX_WITH_HACKED_QT */ 185 185 186 #endif /* Q_WS_MAC */186 #endif /* Q_WS_MAC && !QT_MAC_USE_COCOA */ 187 187 188 188 /** Guest mouse pointer shape change event. */ … … 666 666 #endif 667 667 #if defined(Q_WS_MAC) 668 # if ndef VBOX_WITH_HACKED_QT668 # if !defined (VBOX_WITH_HACKED_QT) && !defined (QT_MAC_USE_COCOA) 669 669 , mDarwinEventHandlerRef (NULL) 670 670 # endif … … 687 687 mDockIconPreview = new VBoxDockIconPreview (mMainWnd, vboxGlobal().vmGuestOSTypeIcon (osTypeId)); 688 688 689 # ifdef QT_MAC_USE_COCOA 690 /** @todo Carbon -> Cocoa */ 691 # else /* !QT_MAC_USE_COCOA */ 689 692 /* Install the event handler which will proceed external window handling */ 690 693 EventHandlerUPP eventHandler = ::NewEventHandlerUPP (::darwinOverlayWindowHandler); … … 701 704 this, &mDarwinWindowOverlayHandlerRef); 702 705 ::DisposeEventHandlerUPP (eventHandler); 703 #endif 706 # endif /* !QT_MAC_USE_COCOA */ 707 #endif /* QT_WS_MAC */ 704 708 705 709 /* No frame around the view */ … … 881 885 mConsole.UnregisterCallback (mCallback); 882 886 883 #if def Q_WS_MAC887 #if defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 884 888 if (mDarwinWindowOverlayHandlerRef) 885 889 { … … 2120 2124 #elif defined (Q_WS_MAC) 2121 2125 2126 # ifndef QT_MAC_USE_COCOA 2122 2127 /** 2123 2128 * Invoked by VBoxConsoleView::darwinEventHandlerProc / VBoxConsoleView::macEventFilter when … … 2211 2216 return ret; 2212 2217 } 2218 # endif /* !QT_MAC_USE_COCOA */ 2213 2219 2214 2220 … … 2223 2229 if (fGrab) 2224 2230 { 2231 # ifdef QT_MAC_USE_COCOA 2232 /** @todo Carbon -> Cocoa */ 2233 # else /* !QT_MAC_USE_COCOA */ 2225 2234 /* Disable mouse event compression to get *really* all mouse events in 2226 2235 the VM. */ … … 2228 2237 ::CGSetLocalEventsSuppressionInterval (0.0); 2229 2238 2230 # ifndef VBOX_WITH_HACKED_QT2239 # ifndef VBOX_WITH_HACKED_QT 2231 2240 2232 2241 EventTypeSpec eventTypes[6]; … … 2253 2262 ::DisposeEventHandlerUPP (eventHandler); 2254 2263 2255 # else /* VBOX_WITH_HACKED_QT */2264 # else /* VBOX_WITH_HACKED_QT */ 2256 2265 ((QIApplication *)qApp)->setEventFilter (VBoxConsoleView::macEventFilter, this); 2257 #endif /* VBOX_WITH_HACKED_QT */ 2266 # endif /* VBOX_WITH_HACKED_QT */ 2267 # endif /* !QT_MAC_USE_COCOA */ 2258 2268 2259 2269 ::DarwinGrabKeyboard (false); … … 2262 2272 { 2263 2273 ::DarwinReleaseKeyboard(); 2264 #ifndef VBOX_WITH_HACKED_QT 2274 # ifdef QT_MAC_USE_COCOA 2275 /** @todo Carbon -> Cocoa */ 2276 # else /* !QT_MAC_USE_COCOA */ 2277 # ifndef VBOX_WITH_HACKED_QT 2265 2278 if (mDarwinEventHandlerRef) 2266 2279 { … … 2268 2281 mDarwinEventHandlerRef = NULL; 2269 2282 } 2270 # else2283 # else 2271 2284 ((QIApplication *)qApp)->setEventFilter (NULL, NULL); 2272 #endif 2273 } 2274 } 2275 2276 #endif // defined (Q_WS_WIN) 2285 # endif 2286 # endif /* !QT_MAC_USE_COCOA*/ 2287 } 2288 } 2289 2290 #endif // defined (Q_WS_MAC) 2277 2291 2278 2292 // … … 2384 2398 } 2385 2399 2386 #elif defined (Q_WS_MAC)2400 #elif defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 2387 2401 2388 2402 /* if (muNumLockAdaptionCnt) ... - NumLock isn't implemented by Mac OS X so ignore it. */ … … 2393 2407 codes[(*count)++] = 0x3a | 0x80; 2394 2408 } 2409 2410 #elif defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 2411 2412 /** @todo Carbon -> Cocoa */ 2395 2413 2396 2414 #else … … 3909 3927 3910 3928 #if defined(Q_WS_MAC) 3929 3911 3930 void VBoxConsoleView::updateDockIcon() 3912 3931 { … … 3915 3934 if (!mPausedShot.isNull()) 3916 3935 { 3936 # ifdef QT_MAC_USE_COCOA 3937 /** @todo Carbon -> Cocoa */ 3938 # else 3917 3939 CGImageRef pauseImg = ::darwinToCGImageRef (&mPausedShot); 3918 3940 /* Use the pause image as background */ 3919 3941 mDockIconPreview->updateDockPreview (pauseImg); 3920 3942 CGImageRelease (pauseImg); 3943 # endif 3921 3944 } 3922 3945 else … … 3955 3978 void VBoxConsoleView::setMouseCoalescingEnabled (bool aOn) 3956 3979 { 3957 3980 #ifdef QT_MAC_USE_COCOA 3981 /** @todo Carbon -> Cocoa */ 3982 #else 3958 3983 if (aOn) 3959 3984 /* Enable mouse event compression if we leave the VM view. This … … 3970 3995 ::SetMouseCoalescingEnabled (false, NULL); 3971 3996 } 3972 } 3973 3974 #endif 3975 3997 #endif 3998 } 3999 4000 #endif /* Q_WS_MAC */ 4001 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r16386 r16469 58 58 59 59 #ifdef Q_WS_MAC 60 #include "VBoxUtils.h" 61 #include "VBoxIChatTheaterWrapper.h" 62 //#include <Carbon/Carbon.h> 63 /* Qt includes */ 64 #include <QPainter> 60 # include "VBoxUtils.h" 61 # include "VBoxIChatTheaterWrapper.h" 62 /* Qt includes */ 63 # include <QPainter> 65 64 #endif 66 65 … … 1161 1160 { 1162 1161 /* Fade back to the normal gamma */ 1162 # ifdef QT_MAC_USE_COCOA 1163 /** @todo Carbon -> Cocoa */ 1164 # else 1163 1165 CGDisplayFade (mFadeToken, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, false); 1164 1166 CGReleaseDisplayFadeReservation (mFadeToken); 1167 # endif 1165 1168 } 1166 1169 console->setMouseCoalescingEnabled (true); … … 1256 1259 { 1257 1260 /* Clear the background */ 1261 # ifdef QT_MAC_USE_COCOA 1262 /** @todo Carbon -> Cocoa */ 1263 # else 1258 1264 HIRect viewRect; 1259 1265 HIViewGetBounds (::darwinToHIViewRef (this), &viewRect); 1260 1266 CGContextClearRect (::darwinToCGContextRef (this), viewRect); 1267 # endif 1261 1268 } 1262 1269 break; … … 2204 2211 { 2205 2212 /* Fade to black */ 2213 # ifdef QT_MAC_USE_COCOA 2214 /** @todo Carbon -> Cocoa */ 2215 # else 2206 2216 CGAcquireDisplayFadeReservation (kCGMaxDisplayReservationInterval, &mFadeToken); 2207 2217 CGDisplayFade (mFadeToken, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, true); 2218 # endif 2208 2219 } 2209 2220 #endif … … 2331 2342 * calls. */ 2332 2343 /* Undo all mac specific installations */ 2344 # ifdef QT_MAC_USE_COCOA 2345 /** @todo Carbon -> Cocoa */ 2346 # else /* !QT_MAC_USE_COCOA */ 2333 2347 OSStatus status; 2334 2348 WindowRef windowRef = ::darwinToWindowRef (this); … … 2342 2356 status = SetWindowAlpha (windowRef, 1.0); 2343 2357 AssertCarbonOSStatus (status); 2358 # endif /* !QT_MAC_USE_COCOA */ 2344 2359 } 2345 2360 #endif … … 2374 2389 * switch and make this stuff useless with the old winId. So please be 2375 2390 * careful on rearrangement of the method calls. */ 2391 # ifdef QT_MAC_USE_COCOA 2392 /** @todo Carbon -> Cocoa */ 2393 # else /* !QT_MAC_USE_COCOA */ 2376 2394 OSStatus status; 2377 2395 HIViewRef viewRef = ::darwinToHIViewRef (console->viewport()); … … 2410 2428 status = ChangeWindowAttributes (windowRef, kWindowNoShadowAttribute, 0); 2411 2429 AssertCarbonOSStatus (status); 2430 # endif /* !QT_MAC_USE_COCOA */ 2412 2431 } 2413 2432 #endif … … 2455 2474 { 2456 2475 #ifdef Q_WS_MAC 2476 # ifdef QT_MAC_USE_COCOA 2477 /** @todo Carbon -> Cocoa */ 2478 # else /* !QT_MAC_USE_COCOA */ 2457 2479 /* setWindowState removes the window group connection somehow. So save it 2458 2480 * temporary. */ … … 2480 2502 /* Reassign the correct window group. */ 2481 2503 SetWindowGroup (::darwinToWindowRef (this), g); 2504 # endif /* !QT_MAC_USE_COCOA */ 2482 2505 #else 2483 2506 NOREF (aOn); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r16374 r16469 62 62 63 63 #if defined (Q_WS_MAC) 64 #include "VBoxUtils.h" 65 #include <Carbon/Carbon.h> // for HIToolbox/InternetConfig 64 # include "VBoxUtils.h" 65 # ifdef QT_MAC_USE_COCOA 66 /** @todo Carbon -> Cocoa */ 67 # else 68 # include <Carbon/Carbon.h> // for HIToolbox/InternetConfig 69 # endif 66 70 #endif 67 71 … … 5161 5165 5162 5166 #elif defined (Q_WS_MAC) 5167 # ifdef QT_MAC_USE_COCOA 5168 /** @todo Carbon -> Cocoa */ 5169 # else /* !QT_MAC_USE_COCOA */ 5163 5170 5164 5171 /* The code below is taken from Psi 0.10 sources … … 5188 5195 return true; 5189 5196 } 5197 # endif /* !QT_MAC_USE_COCOA */ 5190 5198 5191 5199 #else -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMListView.cpp
r14355 r16469 30 30 31 31 #if defined (Q_WS_MAC) 32 # include <Carbon/Carbon.h> 32 # ifdef QT_MAC_USE_COCOA 33 /** @todo Carbon -> Cocoa */ 34 # else 35 # include <Carbon/Carbon.h> 36 # endif 33 37 #endif 34 38 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/DarwinKeyboard.cpp
r8155 r16469 49 49 # include <CoreFoundation/CoreFoundation.h> 50 50 #endif 51 #include <ApplicationServices/ApplicationServices.h> 51 52 #include <Carbon/Carbon.h> 52 53 … … 81 82 /* Found the definition of the fn-key in: 82 83 * http://stuff.mit.edu/afs/sipb/project/darwin/src/modules/IOHIDFamily/IOHIDSystem/IOHIKeyboardMapper.cpp & 83 * http://stuff.mit.edu/afs/sipb/project/darwin/src/modules/AppleADBKeyboard/AppleADBKeyboard.cpp 84 * http://stuff.mit.edu/afs/sipb/project/darwin/src/modules/AppleADBKeyboard/AppleADBKeyboard.cpp 84 85 * Maybe we need this in the future.*/ 85 86 #define QZ_FN 0x3F … … 98 99 #define MY_CHECK_CREFS(cRefs) do { AssertMsg(cRefs < 25, ("%ld\n", cRefs)); NOREF(cRefs); } while (0) 99 100 100 #endif 101 #endif 101 102 102 103 /******************************************************************************* … … 431 432 } 432 433 433 /* 434 * Get the current mode. 434 /* 435 * Get the current mode. 435 436 */ 436 437 CGSGlobalHotKeyOperatingMode enmMode = kCGSGlobalHotKeyInvalid; 437 438 CGSGetGlobalHotKeyOperatingMode(g_CGSConnection, &enmMode); 438 if ( enmMode != kCGSGlobalHotKeyEnable 439 if ( enmMode != kCGSGlobalHotKeyEnable 439 440 && enmMode != kCGSGlobalHotKeyDisable) 440 441 { … … 442 443 if (s_cComplaints++ < 32) 443 444 LogRel(("DarwinDisableGlobalHotKeys: Unexpected enmMode=%d\n", enmMode)); 444 return; 445 } 446 447 /* 448 * Calc the new mode. 445 return; 446 } 447 448 /* 449 * Calc the new mode. 449 450 */ 450 451 if (fDisable) … … 461 462 } 462 463 463 /* 464 * Try set it and check the actual result. 464 /* 465 * Try set it and check the actual result. 465 466 */ 466 467 CGSSetGlobalHotKeyOperatingMode(g_CGSConnection, enmMode); … … 831 832 832 833 833 /** 834 /** 834 835 * Zap the keyboard cache. 835 836 */ -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxDockIconPreview.cpp
r15804 r16469 28 28 29 29 #include <QPixmap> 30 30 #ifndef Q_WS_MAC 31 # error "Q_WS_MAC isn't defined" 32 #endif 33 34 #ifndef QT_MAC_USE_COCOA 31 35 /* Import private function to capture the window content of any given window. */ 32 36 CG_EXTERN_C_BEGIN … … 37 41 CG_EXTERN void CGContextCopyWindowCaptureContentsToRect(CGContextRef c, CGRect dstRect, CGSConnectionID connection, CGSWindowID window, int zero); 38 42 CG_EXTERN_C_END 43 #endif /* !QT_MAC_USE_COCOA */ 39 44 40 45 VBoxDockIconPreview::VBoxDockIconPreview (VBoxConsoleWnd *aMainWnd, const QPixmap& aOverlayImage) 41 46 : mMainWnd (aMainWnd) 47 #ifdef QT_MAC_USE_COCOA 48 #else 42 49 , mDockIconRect (CGRectMake (0, 0, 128, 128)) 43 50 , mDockMonitor (NULL) … … 46 53 , mUpdateRect (CGRectMake (0, 0, 0, 0)) 47 54 , mMonitorRect (CGRectMake (0, 0, 0, 0)) 48 { 55 #endif 56 { 57 #ifdef QT_MAC_USE_COCOA 58 #else /* !QT_MAC_USE_COCOA */ 49 59 mOverlayImage = ::darwinToCGImageRef (&aOverlayImage); 50 60 Assert (mOverlayImage); … … 56 66 mStateRestoring = ::darwinToCGImageRef ("state_restoring_16px.png"); 57 67 Assert (mStateRestoring); 68 #endif /* !QT_MAC_USE_COCOA */ 58 69 } 59 70 60 71 VBoxDockIconPreview::~VBoxDockIconPreview() 61 72 { 73 #ifdef QT_MAC_USE_COCOA 74 #else /* !QT_MAC_USE_COCOA */ 62 75 CGImageRelease (mOverlayImage); 63 76 if (mDockMonitor) … … 72 85 CGImageRelease (mStateSaving); 73 86 CGImageRelease (mStateRestoring); 74 } 87 #endif /* !QT_MAC_USE_COCOA */ 88 } 89 90 #ifndef QT_MAC_USE_COCOA 75 91 76 92 void VBoxDockIconPreview::initPreviewImages() … … 142 158 } 143 159 160 #endif /* !QT_MAC_USE_COCOA */ 161 144 162 void VBoxDockIconPreview::updateDockOverlay() 145 163 { 164 #ifdef QT_MAC_USE_COCOA 165 #else /* !QT_MAC_USE_COCOA */ 166 146 167 /* Remove all previously set tile images */ 147 168 RestoreApplicationDockTileImage(); … … 184 205 CGImageRelease (overlayImage); 185 206 CGColorSpaceRelease (cs); 186 } 187 207 #endif /* !QT_MAC_USE_COCOA */ 208 } 209 210 #ifndef QT_MAC_USE_COCOA 188 211 void VBoxDockIconPreview::updateDockPreview (CGImageRef aVMImage) 189 212 { … … 283 306 CGColorSpaceRelease (cs); 284 307 } 308 #endif /* !QT_MAC_USE_COCOA */ 285 309 286 310 void VBoxDockIconPreview::updateDockPreview (VBoxFrameBuffer *aFrameBuffer) 287 311 { 312 #ifdef QT_MAC_USE_COCOA 313 #else /* !QT_MAC_USE_COCOA */ 288 314 CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); 289 315 Assert (cs); … … 303 329 CGDataProviderRelease (dp); 304 330 CGColorSpaceRelease (cs); 305 } 306 331 #endif /* !QT_MAC_USE_COCOA */ 332 } 333 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
r15804 r16469 28 28 #include <iprt/assert.h> 29 29 #include <iprt/mem.h> 30 31 #include <CoreFoundation/CFBundle.h> 30 32 31 33 /* Qt includes */ … … 42 44 #endif /* QT_VERSION < 0x040400 */ 43 45 46 #ifndef QT_MAC_USE_COCOA 47 44 48 /** 45 49 * Callback for deleting the QImage object when CGImageCreate is done … … 106 110 } 107 111 112 #endif /* !QT_MAC_USE_COCOA */ 113 108 114 void darwinSetShowToolBarButton (QToolBar *aToolBar, bool aShow) 109 115 { … … 111 117 if (parent) 112 118 { 119 #ifdef QT_MAC_USE_COCOA 120 /** @todo Carbon -> Cocoa */ 121 #else 113 122 int err = ChangeWindowAttributes (::darwinToWindowRef (parent), aShow ? kWindowToolbarButtonAttribute:kWindowNoAttributes, 114 123 aShow ? kWindowNoAttributes:kWindowToolbarButtonAttribute); 115 124 AssertCarbonOSStatus (err); 125 #endif 116 126 } 117 127 } … … 119 129 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget) 120 130 { 131 #ifdef QT_MAC_USE_COCOA 132 /** @todo Carbon -> Cocoa */ 133 #else 121 134 HIRect r = ::darwinToHIRect (aTarget); 122 135 TransitionWindowWithOptions (::darwinToWindowRef (aWidget), kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &r, false, NULL); 136 #endif 123 137 } 124 138 … … 142 156 } 143 157 144 QString darwinSystemLanguage ()158 QString darwinSystemLanguage (void) 145 159 { 146 160 /* Get the locales supported by our bundle */ … … 164 178 } 165 179 166 bool darwinIsMenuOpen() 167 { 180 bool darwinIsMenuOpen (void) 181 { 182 #ifdef QT_MAC_USE_COCOA 183 /** @todo Carbon -> Cocoa */ 184 return false; 185 #else 168 186 MenuTrackingData outData; 169 187 return (GetMenuTrackingData (NULL, &outData) != menuNotFoundErr); 170 } 171 172 void darwinDisableIconsInMenus() 188 #endif 189 } 190 191 void darwinDisableIconsInMenus (void) 173 192 { 174 193 /* No icons in the menu of a mac application. */ … … 180 199 #endif /* QT_VERSION >= 0x040400 */ 181 200 } 201 202 #ifndef QT_MAC_USE_COCOA 182 203 183 204 /* Currently not used! */ … … 304 325 } 305 326 327 #endif /* !QT_MAC_USE_COCOA */ 306 328 307 329 308 330 /* Event debugging stuff. Borrowed from Knuts Qt patch. */ 309 #if def DEBUG331 #if defined (DEBUG) && !defined(QT_MAC_USE_COCOA) 310 332 311 333 # define MY_CASE(a) case a: return #a … … 464 486 } 465 487 466 #endif /* DEBUG */488 #endif /* DEBUG && !QT_MAC_USE_COCOA */
Note:
See TracChangeset
for help on using the changeset viewer.