Changeset aa742bd48e7338574e1beaad5ac63fb078794dc0
- Timestamp:
- 14/09/06 20:47:59
(2 years ago)
- Author:
- Felix Paul Kühne <fkuehne@videolan.org>
- git-committer:
- Felix Paul Kühne <fkuehne@videolan.org> 1158259679 +0000
- git-parent:
[7a57427bbc9487342e333ce2c63f237c55f4d66e]
- git-author:
- Felix Paul Kühne <fkuehne@videolan.org> 1158259679 +0000
- Message:
* fix a nasty handling bug and convert all comments to C-style
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r6f54a53 |
raa742bd |
|
| 27 | 27 | *****************************************************************************/ |
|---|
| 28 | 28 | #import "intf.h" |
|---|
| | 29 | #import "controls.h" |
|---|
| | 30 | #import "vout.h" |
|---|
| 29 | 31 | #import "fspanel.h" |
|---|
| 30 | 32 | |
|---|
| … | … | |
| 35 | 37 | *****************************************************************************/ |
|---|
| 36 | 38 | @implementation VLCFSPanel |
|---|
| 37 | | // We override this initializer so we can set the NSBorderlessWindowMask styleMask, and set a few other important settings |
|---|
| | 39 | /* We override this initializer so we can set the NSBorderlessWindowMask styleMask, and set a few other important settings */ |
|---|
| 38 | 40 | - (id)initWithContentRect:(NSRect)contentRect |
|---|
| 39 | 41 | styleMask:(unsigned int)aStyle |
|---|
| … | … | |
| 45 | 47 | [win setHasShadow: NO]; |
|---|
| 46 | 48 | [win setBackgroundColor:[NSColor clearColor]]; |
|---|
| 47 | | [win setLevel:NSFloatingWindowLevel]; // Let's make it sit on top of everything else |
|---|
| 48 | | [win setAlphaValue:0.2]; // It'll start out mostly transparent |
|---|
| | 49 | /* let the window sit on top of everything else and start out completely transparent */ |
|---|
| | 50 | [win setLevel:NSFloatingWindowLevel]; |
|---|
| | 51 | [win setAlphaValue:0.0]; |
|---|
| 49 | 52 | return win; |
|---|
| 50 | 53 | } |
|---|
| … | … | |
| 61 | 64 | } |
|---|
| 62 | 65 | |
|---|
| 63 | | // Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be |
|---|
| | 66 | /* Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be */ |
|---|
| 64 | 67 | - (BOOL)canBecomeKeyWindow |
|---|
| 65 | 68 | { |
|---|
| … | … | |
| 95 | 98 | } |
|---|
| 96 | 99 | |
|---|
| 97 | | // This routine is called repeatedly when the mouse enters the window from outside it. |
|---|
| | 100 | /* This routine is called repeatedly when the mouse enters the window from outside it. */ |
|---|
| 98 | 101 | - (void)focus:(NSTimer *)timer |
|---|
| 99 | 102 | { |
|---|
| … | … | |
| 112 | 115 | } |
|---|
| 113 | 116 | |
|---|
| 114 | | // This routine is called repeatedly when the mouse exits the window from inside it. |
|---|
| | 117 | /* This routine is called repeatedly when the mouse exits the window from inside it */ |
|---|
| 115 | 118 | - (void)unfocus:(NSTimer *)timer |
|---|
| 116 | 119 | { |
|---|
| … | … | |
| 134 | 137 | } |
|---|
| 135 | 138 | |
|---|
| 136 | | // If the mouse enters a window, go make sure we fade in |
|---|
| | 139 | /* If the mouse enters a window, go make sure we fade in */ |
|---|
| 137 | 140 | - (void)mouseEntered:(NSEvent *)theEvent |
|---|
| 138 | 141 | { |
|---|
| … | … | |
| 140 | 143 | } |
|---|
| 141 | 144 | |
|---|
| 142 | | // If the mouse exits a window, go make sure we fade out |
|---|
| | 145 | /* If the mouse exits a window, go make sure we fade out */ |
|---|
| 143 | 146 | - (void)mouseExited:(NSEvent *)theEvent |
|---|
| 144 | 147 | { |
|---|
| … | … | |
| 152 | 155 | } |
|---|
| 153 | 156 | |
|---|
| | 157 | /* give up our focus, so the vout may show us again without letting the user clicking it */ |
|---|
| | 158 | if( [[[[VLCMain sharedInstance] getControls] getVoutView] isFullscreen] ) |
|---|
| | 159 | [[[[[VLCMain sharedInstance] getControls] getVoutView] window] makeKeyWindow]; |
|---|
| | 160 | |
|---|
| 154 | 161 | [self fadeOut]; |
|---|
| 155 | 162 | } |
|---|
| … | … | |
| 169 | 176 | - (void)fadeOut |
|---|
| 170 | 177 | { |
|---|
| 171 | | if(( [self alphaValue] > 0.0 ) && !NSPointInRect( [NSEvent mouseLocation], [self frame] ) ) |
|---|
| | 178 | if( ( [self alphaValue] > 0.0 ) && !NSPointInRect( [NSEvent mouseLocation], [self frame] ) ) |
|---|
| 172 | 179 | { |
|---|
| 173 | 180 | if (![self fadeTimer]) |
|---|
| … | … | |
| 219 | 226 | } |
|---|
| 220 | 227 | |
|---|
| 221 | | // A getter and setter for our main timer that handles window fading |
|---|
| | 228 | /* A getter and setter for our main timer that handles window fading */ |
|---|
| 222 | 229 | - (NSTimer *)fadeTimer |
|---|
| 223 | 230 | { |
|---|
| … | … | |
| 294 | 301 | addButton( o_next, @"FSGotoEndOff.tif" , @"FSGotoEndOn.tif" , 286, 37, next ); |
|---|
| 295 | 302 | addButton( o_fullscreen, @"FSExitOff.tif", @"FSExitOn.tif", 382, 45, windowAction ); |
|---|
| 296 | | // addButton( o_button, @"FSVolumeThumbOff.tif" , @"FSVolumeThumbOn.tif" , 38, 51, something ); |
|---|
| | 303 | /* |
|---|
| | 304 | addButton( o_button, @"FSVolumeThumbOff.tif" , @"FSVolumeThumbOn.tif" , 38, 51, something ); |
|---|
| | 305 | */ |
|---|
| 297 | 306 | |
|---|
| 298 | 307 | s_rc = [self frame]; |
|---|
| … | … | |
| 441 | 450 | void drawFrameInRect(NSRect frameRect) |
|---|
| 442 | 451 | { |
|---|
| 443 | | // Draw frame |
|---|
| | 452 | /* Draw frame */ |
|---|
| 444 | 453 | NSBundle *bundle = [NSBundle mainBundle]; |
|---|
| 445 | 454 | NSRect frame = frameRect; |
|---|
| … | … | |
| 453 | 462 | - (void)drawRect:(NSRect)rect |
|---|
| 454 | 463 | { |
|---|
| 455 | | // Draw default to make sure the slider behaves correctly |
|---|
| | 464 | /* Draw default to make sure the slider behaves correctly */ |
|---|
| 456 | 465 | [[NSGraphicsContext currentContext] saveGraphicsState]; |
|---|
| 457 | 466 | NSRectClip(NSZeroRect); |
|---|