NSUInteger count = [[NSScreen screens] count];
for ( NSUInteger i = 0; i < count; i++ ) {
- NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
+ NSScreen *screen = [[NSScreen screens] objectAtIndex:i];
if ([screen displayID] == displayID)
return screen;
}
NSUInteger screenCount = [[NSScreen screens] count];
for (NSUInteger i = 0; i < screenCount; i++) {
- NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
+ NSScreen *screen = [[NSScreen screens] objectAtIndex:i];
VLCWindow *blackoutWindow;
NSRect screen_rect;
NSUInteger blackoutWindowCount = [blackoutWindows count];
for (NSUInteger i = 0; i < blackoutWindowCount; i++) {
- VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i];
+ VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex:i];
[[blackoutWindow screen] setNonFullscreenPresentationOptions];
[blackoutWindow closeAndAnimate: YES];
}
@implementation VLCVolumeSliderCommon : NSSlider
+@synthesize usesBrightArtwork = _usesBrightArtwork;
+
- (void)scrollWheel:(NSEvent *)o_event
{
intf_thread_t * p_intf = VLCIntf;
}
}
+- (void)drawFullVolumeMarker
+{
+ NSRect frame = [self frame];
+
+ NSColor *drawingColor;
+ if (_usesBrightArtwork)
+ drawingColor = [[NSColor whiteColor] colorWithAlphaComponent:.8];
+ else
+ drawingColor = [[NSColor blackColor] colorWithAlphaComponent:.6];
+
+ NSBezierPath* bezierPath = [NSBezierPath bezierPath];
+
+ float fullVolPos = frame.size.width / 2.;
+ [bezierPath moveToPoint:NSMakePoint(fullVolPos, frame.size.height - 3.)];
+ [bezierPath lineToPoint:NSMakePoint(fullVolPos, 3.)];
+ [bezierPath closePath];
+
+ bezierPath.lineWidth = 1.;
+ [drawingColor setStroke];
+ [bezierPath stroke];
+ [drawingColor setFill];
+ [bezierPath fill];
+}
+
@end
/*****************************************************************************
[super drawRect:rect];
[[NSGraphicsContext currentContext] restoreGraphicsState];
+ [self drawFullVolumeMarker];
+
NSRect knobRect = [[self cell] knobRectFlipped:NO];
knobRect.origin.y+=2;
[self drawKnobInRect: knobRect];
[self setNeedsDisplay:YES];
}
+@end
+
+@implementation PositionFormatter
+
+- (id)init
+{
+ self = [super init];
+ NSMutableCharacterSet *nonNumbers = [[[NSCharacterSet decimalDigitCharacterSet] invertedSet] mutableCopy];
+ [nonNumbers removeCharactersInString:@":"];
+ o_forbidden_characters = [nonNumbers copy];
+ [nonNumbers release];
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [o_forbidden_characters release];
+ [super dealloc];
+}
+
+- (NSString*)stringForObjectValue:(id)obj
+{
+ return obj;
+}
+
+- (BOOL)getObjectValue:(id*)obj forString:(NSString*)string errorDescription:(NSString**)error
+{
+ *obj = [[string copy] autorelease];
+ return YES;
+}
+
+- (bool)isPartialStringValid:(NSString*)partialString newEditingString:(NSString**)newString errorDescription:(NSString**)error
+{
+ if ([partialString rangeOfCharacterFromSet:o_forbidden_characters options:NSLiteralSearch].location != NSNotFound) {
+ return NO;
+ } else {
+ return YES;
+ }
+}
+
+
@end