MacOSX/Framework/VLCVideoView.m: Capitalize the s in FullScreen.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 28 Dec 2007 22:20:19 +0000 (22:20 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 28 Dec 2007 22:20:19 +0000 (22:20 +0000)
extras/MacOSX/Framework/Headers/Public/VLCVideoView.h
extras/MacOSX/Framework/Sources/VLCVideoView.m

index 65720d2..3313775 100644 (file)
@@ -41,13 +41,13 @@ extern NSString * VLCVideoViewLeftFullScreen;
     id delegate;
     NSColor * backColor;
     BOOL stretchesVideo;
-    BOOL fullscreen;
+    BOOL fullScreen;
     id layoutManager;
     // TODO: Allow for view to report transparency to do some cool effects
     // with the video?
 }
 
-@property (readonly, assign) BOOL fullscreen;
+@property BOOL fullScreen;
 @property BOOL fillScreen;
 
 - (void)setDelegate:(id)value;
index 317e6c8..cdf495c 100644 (file)
@@ -59,10 +59,6 @@ NSString *VLCVideoViewLeftFullScreen = @"VLCVideoViewLeftFullScreen";
 /******************************************************************************
  * VLCVideoView (Private) 
  */
-@interface VLCVideoView ()
-/* Property */
-@property (readwrite, assign) BOOL fullscreen;
-@end
 
 @interface VLCVideoView (Private)
 /* Method */
@@ -141,7 +137,6 @@ NSString *VLCVideoViewLeftFullScreen = @"VLCVideoViewLeftFullScreen";
  */
 
 @implementation VLCVideoView
-@synthesize fullscreen;
 
 - (BOOL)fillScreen
 {
@@ -153,6 +148,25 @@ NSString *VLCVideoViewLeftFullScreen = @"VLCVideoViewLeftFullScreen";
     [[self layer] setNeedsLayout];
 }
 
+- (BOOL)fullScreen
+{
+    return fullScreen;
+}
+
+- (void)setFullScreen:(BOOL)newFullScreen
+{
+    if( newFullScreen )
+    {
+        fullScreen = YES;
+        [self enterFullscreen];
+    }
+    else
+    {
+        fullScreen = NO;
+        [self leaveFullscreen];
+    }
+}
+
 
 - (id)initWithFrame:(NSRect)rect
 {
@@ -210,7 +224,7 @@ NSString *VLCVideoViewLeftFullScreen = @"VLCVideoViewLeftFullScreen";
                                                  withNotificationName:VLCVideoViewEnteredFullScreen];
     
     [super enterFullScreenMode:[[self window] screen] withOptions:nil];
-    self.fullscreen = YES;
+    if( !self.fullScreen ) self.fullScreen = YES;
 }
 
 /* This is a LibVLC notification that we're about to enter leaving full screen,
@@ -224,7 +238,7 @@ NSString *VLCVideoViewLeftFullScreen = @"VLCVideoViewLeftFullScreen";
     
     // There is nothing else to do, as this object strictly displays the video feed
     [super exitFullScreenModeWithOptions:nil];
-    self.fullscreen = NO;
+    if( self.fullScreen ) self.fullScreen = NO;
 }
 
 - (void)drawRect:(NSRect)aRect
@@ -244,7 +258,7 @@ NSString *VLCVideoViewLeftFullScreen = @"VLCVideoViewLeftFullScreen";
 {
     if([theEvent clickCount] != 2)
         return;
-    if(self.fullscreen)
+    if(self.fullScreen)
         [self leaveFullscreen];
     else
         [self enterFullscreen];