[vlc-commits] macosx: Remove MPSlider
Marvin Scholz
git at videolan.org
Sun Jul 23 17:32:21 CEST 2017
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sun Jul 23 17:01:52 2017 +0200| [aef2d858bf0fba03ca639bddabfbc544cc92d763] | committer: Marvin Scholz
macosx: Remove MPSlider
Remove unused MPSlider class
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aef2d858bf0fba03ca639bddabfbc544cc92d763
---
modules/gui/macosx/misc.h | 9 -------
modules/gui/macosx/misc.m | 64 -----------------------------------------------
2 files changed, 73 deletions(-)
diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index fb3893b3cf..81bc2e42c4 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -49,15 +49,6 @@
@end
-
-/*****************************************************************************
- * MPSlider
- *****************************************************************************/
-
- at interface MPSlider : NSSlider
-
- at end
-
/*****************************************************************************
* ProgressView
*****************************************************************************/
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 73e20dfc17..b2cde3d88a 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -150,70 +150,6 @@
/*****************************************************************************
- * MPSlider
- *****************************************************************************/
- at implementation MPSlider
-
-void _drawKnobInRect(NSRect knobRect)
-{
- // Center knob in given rect
- knobRect.origin.x += (int)((float)(knobRect.size.width - 7)/2.0);
- knobRect.origin.y += (int)((float)(knobRect.size.height - 7)/2.0);
-
- // Draw diamond
- NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 3, knobRect.origin.y + 6, 1, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 2, knobRect.origin.y + 5, 3, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 1, knobRect.origin.y + 4, 5, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 0, knobRect.origin.y + 3, 7, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 1, knobRect.origin.y + 2, 5, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 2, knobRect.origin.y + 1, 3, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(knobRect.origin.x + 3, knobRect.origin.y + 0, 1, 1), NSCompositeSourceOver);
-}
-
-void _drawFrameInRect(NSRect frameRect)
-{
- // Draw frame
- NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x, frameRect.origin.y + frameRect.size.height-1, frameRect.size.width, 1), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x, frameRect.origin.y, 1, frameRect.size.height), NSCompositeSourceOver);
- NSRectFillUsingOperation(NSMakeRect(frameRect.origin.x+frameRect.size.width-1, frameRect.origin.y, 1, frameRect.size.height), NSCompositeSourceOver);
-}
-
-- (void)drawRect:(NSRect)rect
-{
- // Draw default to make sure the slider behaves correctly
- [[NSGraphicsContext currentContext] saveGraphicsState];
- NSRectClip(NSZeroRect);
- [super drawRect:rect];
- [[NSGraphicsContext currentContext] restoreGraphicsState];
-
- // Full size
- rect = [self bounds];
- int diff = (int)(([[self cell] knobThickness] - 7.0)/2.0) - 1;
- rect.origin.x += diff-1;
- rect.origin.y += diff;
- rect.size.width -= 2*diff-2;
- rect.size.height -= 2*diff;
-
- // Draw dark
- NSRect knobRect = [[self cell] knobRectFlipped:NO];
- [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
- _drawFrameInRect(rect);
- _drawKnobInRect(knobRect);
-
- // Draw shadow
- [[[NSColor blackColor] colorWithAlphaComponent:0.1] set];
- rect.origin.x++;
- rect.origin.y++;
- knobRect.origin.x++;
- knobRect.origin.y++;
- _drawFrameInRect(rect);
- _drawKnobInRect(knobRect);
-}
-
- at end
-
-/*****************************************************************************
* ProgressView
*****************************************************************************/
More information about the vlc-commits
mailing list