[vlc-commits] macosx: Remove now unused ITSlider and VLCVolumeSliderCommon

Marvin Scholz git at videolan.org
Tue Jul 25 02:57:43 CEST 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Jul 25 02:37:02 2017 +0200| [b668735d64e3282eff371e769776e65d445894f1] | committer: Marvin Scholz

macosx: Remove now unused ITSlider and VLCVolumeSliderCommon

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b668735d64e3282eff371e769776e65d445894f1
---

 modules/gui/macosx/misc.h |  25 --------
 modules/gui/macosx/misc.m | 147 ----------------------------------------------
 2 files changed, 172 deletions(-)

diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index 40ab72cf82..d3c68eccb9 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -49,31 +49,6 @@
 
 @end
 
-/*****************************************************************************
- * VLCVolumeSliderCommon
- *****************************************************************************/
-
- at interface VLCVolumeSliderCommon : NSSlider
-
- at property (readwrite, nonatomic) BOOL usesBrightArtwork;
-
-- (void)scrollWheel:(NSEvent *)o_event;
-- (void)drawFullVolumeMarker;
-
-- (CGFloat)fullVolumePos;
-
- at end
-
- at interface VolumeSliderCell : NSSliderCell
- at end
-
-/*****************************************************************************
- * ITSlider
- *****************************************************************************/
-
- at interface ITSlider : VLCVolumeSliderCommon
-
- at end
 
 /*****************************************************************************
  * VLCMainWindowSplitView interface
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index f72d0020a6..7d379a5d5b 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -150,153 +150,6 @@
 
 
 /*****************************************************************************
- * VLCVolumeSliderCommon
- *****************************************************************************/
-
- at implementation VLCVolumeSliderCommon : NSSlider
-
-- (void)scrollWheel:(NSEvent *)o_event
-{
-    BOOL b_up = NO;
-    CGFloat f_deltaY = [o_event deltaY];
-    CGFloat f_deltaX = [o_event deltaX];
-
-    if ([o_event isDirectionInvertedFromDevice])
-        f_deltaX = -f_deltaX; // optimisation, actually double invertion of f_deltaY here
-    else
-        f_deltaY = -f_deltaY;
-
-    // positive for left / down, negative otherwise
-    CGFloat f_delta = f_deltaX + f_deltaY;
-    CGFloat f_abs;
-
-    if (f_delta > 0.0f)
-        f_abs = f_delta;
-    else {
-        b_up = YES;
-        f_abs = -f_delta;
-    }
-
-    for (NSUInteger i = 0; i < (int)(f_abs/4.+1.) && f_abs > 0.05 ; i++) {
-        if (b_up)
-            [[VLCCoreInteraction sharedInstance] volumeUp];
-        else
-            [[VLCCoreInteraction sharedInstance] volumeDown];
-    }
-}
-
-- (void)drawFullVolumeMarker
-{
-    CGFloat maxAudioVol = self.maxValue / AOUT_VOLUME_DEFAULT;
-    if (maxAudioVol < 1.)
-        return;
-
-    NSColor *drawingColor;
-    // for bright artwork, a black color is used and vice versa
-    if (_usesBrightArtwork)
-        drawingColor = [[NSColor blackColor] colorWithAlphaComponent:.4];
-    else
-        drawingColor = [[NSColor whiteColor] colorWithAlphaComponent:.4];
-
-    NSBezierPath* bezierPath = [NSBezierPath bezierPath];
-    [self drawFullVolBezierPath:bezierPath];
-    [bezierPath closePath];
-
-    bezierPath.lineWidth = 1.;
-    [drawingColor setStroke];
-    [bezierPath stroke];
-}
-
-- (CGFloat)fullVolumePos
-{
-    CGFloat maxAudioVol = self.maxValue / AOUT_VOLUME_DEFAULT;
-    CGFloat sliderRange = [self frame].size.width - [self knobThickness];
-    CGFloat sliderOrigin = [self knobThickness] / 2.;
-
-    return 1. / maxAudioVol * sliderRange + sliderOrigin;
-}
-
-- (void)drawFullVolBezierPath:(NSBezierPath*)bezierPath
-{
-    CGFloat fullVolPos = [self fullVolumePos];
-    [bezierPath moveToPoint:NSMakePoint(fullVolPos, [self frame].size.height - 3.)];
-    [bezierPath lineToPoint:NSMakePoint(fullVolPos, 2.)];
-}
-
- at end
-
- at implementation VolumeSliderCell
-
-- (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)controlView
-{
-    VLCVolumeSliderCommon *o_slider = (VLCVolumeSliderCommon *)controlView;
-    CGFloat fullVolumePos = [o_slider fullVolumePos] + 2.;
-
-    CGPoint snapToPoint = currentPoint;
-    if (ABS(fullVolumePos - currentPoint.x) <= 4.)
-        snapToPoint.x = fullVolumePos;
-
-    return [super continueTracking:lastPoint at:snapToPoint inView:controlView];
-}
-
- at end
-
-/*****************************************************************************
- * ITSlider
- *****************************************************************************/
-
- at interface ITSlider()
-{
-    NSImage *img;
-    NSRect image_rect;
-}
- at end
-
- at implementation ITSlider
-
-- (void)awakeFromNib
-{
-    BOOL b_dark = config_GetInt( getIntf(), "macosx-interfacestyle" );
-    if (b_dark)
-        img = imageFromRes(@"volume-slider-knob_dark");
-    else
-        img = imageFromRes(@"volume-slider-knob");
-
-    image_rect.size = [img size];
-    image_rect.origin.x = 0;
-
-    if (b_dark)
-        image_rect.origin.y = -1;
-    else
-        image_rect.origin.y = 0;
-}
-
-- (void)drawKnobInRect:(NSRect)knobRect
-{
-    knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2;
-    knobRect.size.width = image_rect.size.width;
-    knobRect.size.height = image_rect.size.height;
-    [img drawInRect:knobRect fromRect:image_rect operation:NSCompositeSourceOver fraction:1];
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    /* Draw default to make sure the slider behaves correctly */
-    [[NSGraphicsContext currentContext] saveGraphicsState];
-    NSRectClip(NSZeroRect);
-    [super drawRect:rect];
-    [[NSGraphicsContext currentContext] restoreGraphicsState];
-
-    [self drawFullVolumeMarker];
-
-    NSRect knobRect = [[self cell] knobRectFlipped:NO];
-    knobRect.origin.y+=2;
-    [self drawKnobInRect: knobRect];
-}
-
- at end
-
-/*****************************************************************************
  * VLCMainWindowSplitView implementation
  *****************************************************************************/
 @implementation VLCMainWindowSplitView : NSSplitView



More information about the vlc-commits mailing list