]> git.sesse.net Git - vlc/commitdiff
VLCKit.framework: Update documentation, clean up whitespace, reorganize code, and...
authorFaustino Osuna <enrique.osuna@gmail.com>
Mon, 31 Mar 2008 22:58:30 +0000 (23:58 +0100)
committerFaustino Osuna <enrique.osuna@gmail.com>
Mon, 31 Mar 2008 22:58:30 +0000 (23:58 +0100)
projects/macosx/framework/Sources/VLCVideoView.m

index 87f3c4f3486e9f75dfffb055c999aed3ee5ed347..da94d99fafec7876aa3e7707924ab4b941f9aa59 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * VLCVideoView.h: VLC.framework VLCVideoView implementation
+ * VLCVideoView.m: VLCKit.framework VLCVideoView implementation
  *****************************************************************************
  * Copyright (C) 2007 Pierre d'Herbemont
  * Copyright (C) 2007 the VideoLAN team
@@ -67,6 +67,7 @@
 @end
 
 @interface VLCVideoView ()
+/* Proeprties */
 @property (readwrite) BOOL hasVideo;
 @end
 
 
 @implementation VLCVideoView
 
+/* Initializers */
 - (id)initWithFrame:(NSRect)rect
 {
     if (self = [super initWithFrame:rect]) 
     {
-        delegate = nil;
-        [self setBackColor:[NSColor blackColor]];
+        self.delegate = nil;
+        self.backColor = [NSColor blackColor];
+        self.fillScreen = NO;
+        self.hasVideo = NO;
+        
         [self setStretchesVideo:NO];
         [self setAutoresizesSubviews:YES];
-        [self setFillScreen: NO];
-        self.hasVideo = NO;
         layoutManager = [[VLCVideoLayoutManager layoutManager] retain];
     }
     return self;
 
 - (void)dealloc
 {
+    self.delegate = nil;
+    self.backColor = nil;
     [layoutManager release];
-    delegate = nil;
-    [backColor release];
     [super dealloc];
 }
 
+/* NSView Overrides */
 - (void)drawRect:(NSRect)aRect
 {
     [self lockFocus];
     return YES;
 }
 
+/* Properties */
 @synthesize delegate;
 @synthesize backColor;
 @synthesize hasVideo;
 
 - (void)setFillScreen:(BOOL)fillScreen
 {
-    [layoutManager setFillScreenEntirely:fillScreen];
+    [(VLCVideoLayoutManager *)layoutManager setFillScreenEntirely:fillScreen];
     [[self layer] setNeedsLayout];
 }
 @end
     [layoutManager setOriginalVideoSize:aLayer.bounds.size];
     [rootLayer setLayoutManager:layoutManager];
     [rootLayer insertSublayer:aLayer atIndex:0];
+    [self setNeedsDisplayOnBoundsChange:YES];
 
-    [aLayer setNeedsLayout];
-    [aLayer setNeedsDisplay];
-
-    [rootLayer setNeedsDisplayOnBoundsChange:YES];
-    [rootLayer setNeedsDisplay];
-    [rootLayer layoutIfNeeded];
     [CATransaction commit];
     self.hasVideo = YES;
 }
 
-- (void)removeVoutLayer:(CALayer*)voutLayer
+- (void)removeVoutLayer:(CALayer *)voutLayer
 {
     [CATransaction begin];
     [voutLayer removeFromSuperlayer];