Skip to content

Commit

Permalink
VLCKit.framework: Update documentation, clean up whitespace, reorgani…
Browse files Browse the repository at this point in the history
…ze code, and remove dead code.
  • Loading branch information
feosuna1 committed Mar 31, 2008
1 parent f87ebe5 commit 6837b43
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions projects/macosx/framework/Sources/VLCVideoView.m
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -67,6 +67,7 @@ - (void)addVoutLayer:(CALayer *)aLayer;
@end

@interface VLCVideoView ()
/* Proeprties */
@property (readwrite) BOOL hasVideo;
@end

Expand All @@ -76,29 +77,32 @@ @interface VLCVideoView ()

@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];
Expand All @@ -112,6 +116,7 @@ - (BOOL)isOpaque
return YES;
}

/* Properties */
@synthesize delegate;
@synthesize backColor;
@synthesize hasVideo;
Expand All @@ -123,7 +128,7 @@ - (BOOL)fillScreen

- (void)setFillScreen:(BOOL)fillScreen
{
[layoutManager setFillScreenEntirely:fillScreen];
[(VLCVideoLayoutManager *)layoutManager setFillScreenEntirely:fillScreen];
[[self layer] setNeedsLayout];
}
@end
Expand All @@ -148,18 +153,13 @@ - (void)addVoutLayer:(CALayer *)aLayer
[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];
Expand Down

0 comments on commit 6837b43

Please sign in to comment.