Browse Source

MacOSX/Framework/VLCVideoView.m: Capitalize the s in FullScreen.

Pierre d'Herbemont 17 years ago
parent
commit
3c9dc9dcc1
2 changed files with 24 additions and 10 deletions
  1. 2 2
      Headers/Public/VLCVideoView.h
  2. 22 8
      Sources/VLCVideoView.m

+ 2 - 2
Headers/Public/VLCVideoView.h

@@ -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;

+ 22 - 8
Sources/VLCVideoView.m

@@ -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];