Changeset 30001 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.mm
- Timestamp:
- Jun 2, 2010 3:36:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.mm
r29200 r30001 20 20 21 21 #include "VBoxUtils-darwin.h" 22 #include "VBoxCocoaHelper.h" 23 24 #include <QMenu> 22 25 23 26 #include <iprt/assert.h> … … 29 32 NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView) 30 33 { 31 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];34 CocoaAutoreleasePool pool; 32 35 33 36 NativeWindowRef window = NULL; … … 35 38 window = [aView window]; 36 39 37 [pool release];38 40 return window; 39 41 } … … 41 43 NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow) 42 44 { 43 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];45 CocoaAutoreleasePool pool; 44 46 45 47 NativeViewRef view = NULL; … … 47 49 view = [aWindow contentView]; 48 50 49 [pool release];50 51 return view; 51 52 } … … 53 54 void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled) 54 55 { 55 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];56 CocoaAutoreleasePool pool; 56 57 57 58 [aWindow setShowsToolbarButton:aEnabled]; 58 59 [pool release];60 59 } 61 60 62 61 void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled) 63 62 { 64 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];63 CocoaAutoreleasePool pool; 65 64 66 65 [aWindow setShowsResizeIndicator:aEnabled]; 67 68 [pool release];69 66 } 70 67 71 68 void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow) 72 69 { 73 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];70 CocoaAutoreleasePool pool; 74 71 75 72 /* Remove all title buttons by changing the style mask. This method is … … 95 92 [pButton setEnabled: NO]; 96 93 } 97 98 [pool release];99 94 } 100 95 101 96 void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled) 102 97 { 103 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];98 CocoaAutoreleasePool pool; 104 99 105 100 if (aEnabled) … … 115 110 [aWindow setHasShadow:YES]; 116 111 } 112 } 117 113 118 [pool release]; 114 void darwinSetDockIconMenu(QMenu* pMenu) 115 { 116 CocoaAutoreleasePool pool; 117 118 extern void qt_mac_set_dock_menu(QMenu *); 119 qt_mac_set_dock_menu(pMenu); 119 120 } 120 121 … … 126 127 void darwinSetMouseCoalescingEnabled (bool aEnabled) 127 128 { 128 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];129 CocoaAutoreleasePool pool; 129 130 130 131 [NSEvent setMouseCoalescingEnabled:aEnabled]; 131 132 [pool release];133 132 } 134 133 135 134 void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height) 136 135 { 137 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];136 CocoaAutoreleasePool pool; 138 137 139 138 /* It seems that Qt doesn't return the height of the window with the … … 151 150 152 151 [aWindow setFrame:windowFrame display:YES animate:YES]; 153 154 [pool release];155 152 } 156 153 157 154 void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow) 158 155 { 159 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];156 CocoaAutoreleasePool pool; 160 157 161 158 [aWindow invalidateShadow]; 162 163 [pool release];164 159 } 165 160 166 161 int darwinWindowToolBarHeight (NativeWindowRef aWindow) 167 162 { 168 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];163 CocoaAutoreleasePool pool; 169 164 170 165 NSToolbar *toolbar = [aWindow toolbar]; … … 177 172 toolbarHeight = NSHeight (windowFrame) - NSHeight ([[aWindow contentView] frame]) - theight; 178 173 179 [pool release];180 174 return toolbarHeight; 181 175 } … … 183 177 bool darwinIsWindowMaximized(NativeWindowRef aWindow) 184 178 { 185 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];179 CocoaAutoreleasePool pool; 186 180 187 181 bool fResult = [aWindow isZoomed]; 188 182 189 [pool release];190 183 return fResult; 191 184 } … … 193 186 float darwinSmallFontSize() 194 187 { 195 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];188 CocoaAutoreleasePool pool; 196 189 197 190 float size = [NSFont systemFontSizeForControlSize: NSSmallControlSize]; 198 191 199 [pool release];200 192 return size; 201 193 }
Note:
See TracChangeset
for help on using the changeset viewer.