[vlc-commits] macosx: Remove VLCHUDCheckboxCell class
Marvin Scholz
git at videolan.org
Sun Feb 18 17:38:04 CET 2018
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sun Feb 18 17:32:59 2018 +0100| [408dd4fcd23b10ea7e66af56d73b91c9765c1923] | committer: Marvin Scholz
macosx: Remove VLCHUDCheckboxCell class
This was used on macOS versions lower than 10.10 to draw custom
HUD-style controls and is not necessary anymore.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=408dd4fcd23b10ea7e66af56d73b91c9765c1923
---
.../package/macosx/VLC.xcodeproj/project.pbxproj | 6 -
modules/gui/macosx/Makefile.am | 1 -
modules/gui/macosx/VLCHUDSliderCell.h | 54 ----
modules/gui/macosx/VLCHUDSliderCell.m | 342 ---------------------
4 files changed, 403 deletions(-)
diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index ed1a8a06e6..e2e9fbdb1c 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -61,7 +61,6 @@
1C3113EF1E508C7600D4DD76 /* VLCRendererDiscovery.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBBB8B61D114628001BD9BA /* VLCRendererDiscovery.m */; };
1C3113F11E508C7600D4DD76 /* VLCRendererItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBBB8B11D10A994001BD9BA /* VLCRendererItem.m */; };
1C3113F31E508C7600D4DD76 /* VLCRendererMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBBB8A81D108A17001BD9BA /* VLCRendererMenuController.m */; };
- 1C3113FD1E508C7600D4DD76 /* VLCHUDSliderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B846FE31CF5D88C00112E54 /* VLCHUDSliderCell.m */; };
1C3114031E508C8800D4DD76 /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */; };
1C3114051E508C8800D4DD76 /* SideBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = CCCDDEF013E870BB00A35661 /* SideBarItem.m */; };
1C3114071E508C8800D4DD76 /* PXSourceList.m in Sources */ = {isa = PBXBuildFile; fileRef = CC0CD0E013DE0EAE00B0D90D /* PXSourceList.m */; };
@@ -611,8 +610,6 @@
6B8229FF1E4D2DD100833BE1 /* vlc.scriptSuite */ = {isa = PBXFileReference; lastKnownFileType = text.plist.scriptSuite; path = vlc.scriptSuite; sourceTree = "<group>"; };
6B822A001E4D2DD100833BE1 /* vlc.scriptTerminology */ = {isa = PBXFileReference; lastKnownFileType = text.plist.scriptTerminology; path = vlc.scriptTerminology; sourceTree = "<group>"; };
6B822A031E4D2DEB00833BE1 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
- 6B846FE21CF5D88C00112E54 /* VLCHUDSliderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDSliderCell.h; sourceTree = "<group>"; };
- 6B846FE31CF5D88C00112E54 /* VLCHUDSliderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCHUDSliderCell.m; sourceTree = "<group>"; };
6B9FD0371EEB5D8A0085151F /* VLCHUDScroller.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCHUDScroller.h; sourceTree = "<group>"; };
6B9FD0381EEB5D8A0085151F /* VLCHUDScroller.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCHUDScroller.m; sourceTree = "<group>"; };
6BA1A0632038D93D005EA18A /* ci_filters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ci_filters.m; path = ../../../modules/video_filter/ci_filters.m; sourceTree = "<group>"; };
@@ -1459,8 +1456,6 @@
6B846FE81CF5D89500112E54 /* HUD UI Classes */ = {
isa = PBXGroup;
children = (
- 6B846FE21CF5D88C00112E54 /* VLCHUDSliderCell.h */,
- 6B846FE31CF5D88C00112E54 /* VLCHUDSliderCell.m */,
6B9FD0371EEB5D8A0085151F /* VLCHUDScroller.h */,
6B9FD0381EEB5D8A0085151F /* VLCHUDScroller.m */,
6BF5C5021EFE66EF008A9C12 /* VLCHUDTableView.h */,
@@ -1748,7 +1743,6 @@
1C3113F11E508C7600D4DD76 /* VLCRendererItem.m in Sources */,
1C3113F31E508C7600D4DD76 /* VLCRendererMenuController.m in Sources */,
6B4D50931E7979CB004479B5 /* VLCSimplePrefsWindow.m in Sources */,
- 1C3113FD1E508C7600D4DD76 /* VLCHUDSliderCell.m in Sources */,
1C31138E1E508C6900D4DD76 /* VLCAboutWindowController.m in Sources */,
1C3113901E508C6900D4DD76 /* VLCHelpWindowController.m in Sources */,
1C3113921E508C6900D4DD76 /* VLCAddonListItem.m in Sources */,
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index 400c6ee4d1..058089d6fd 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -74,7 +74,6 @@ libmacosx_plugin_la_SOURCES = \
gui/macosx/VLCCoreDialogProvider.h gui/macosx/VLCCoreDialogProvider.m \
gui/macosx/VLCLogMessage.h gui/macosx/VLCLogMessage.m \
gui/macosx/VLCLogWindowController.h gui/macosx/VLCLogWindowController.m \
- gui/macosx/VLCHUDSliderCell.h gui/macosx/VLCHUDSliderCell.m \
gui/macosx/VLCHUDScroller.h gui/macosx/VLCHUDScroller.m \
gui/macosx/VLCHUDOutlineView.h gui/macosx/VLCHUDOutlineView.m \
gui/macosx/VLCHUDTableView.h gui/macosx/VLCHUDTableView.m \
diff --git a/modules/gui/macosx/VLCHUDSliderCell.h b/modules/gui/macosx/VLCHUDSliderCell.h
deleted file mode 100644
index 5b2e3295b0..0000000000
--- a/modules/gui/macosx/VLCHUDSliderCell.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// VLCHUDSliderCell.h
-// BGHUDAppKit
-//
-// Created by BinaryGod on 5/30/08.
-//
-// Copyright (c) 2008, Tim Davis (BinaryMethod.com, binary.god at gmail.com)
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation and/or
-// other materials provided with the distribution.
-//
-// Neither the name of the BinaryMethod.com nor the names of its contributors
-// may be used to endorse or promote products derived from this software without
-// specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-#import <Cocoa/Cocoa.h>
-
-
-/* Custom subclass that provides a dark NSSliderCell for HUD Panels.
- *
- * It does NOT support circular sliders, only horizontal and vertical
- * sliders with and without tickmarks are supported!
- * The size used should be "Mini" or "Small".
- */
- at interface VLCHUDSliderCell : NSSliderCell
-
- at property NSColor *sliderColor;
- at property NSColor *disabledSliderColor;
- at property NSColor *strokeColor;
- at property NSColor *disabledStrokeColor;
-
- at property NSGradient *knobGradient;
- at property NSGradient *disableKnobGradient;
-
- at end
diff --git a/modules/gui/macosx/VLCHUDSliderCell.m b/modules/gui/macosx/VLCHUDSliderCell.m
deleted file mode 100644
index f6e7e558da..0000000000
--- a/modules/gui/macosx/VLCHUDSliderCell.m
+++ /dev/null
@@ -1,342 +0,0 @@
-//
-// VLCHUDSliderCell.m
-// BGHUDAppKit
-//
-// Created by BinaryGod on 5/30/08.
-//
-// Copyright (c) 2008, Tim Davis (BinaryMethod.com, binary.god at gmail.com)
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation and/or
-// other materials provided with the distribution.
-//
-// Neither the name of the BinaryMethod.com nor the names of its contributors
-// may be used to endorse or promote products derived from this software without
-// specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-#import "VLCHUDSliderCell.h"
-#import "CompatibilityFixes.h"
-
- at implementation VLCHUDSliderCell
-
-- (instancetype)initWithCoder:(NSCoder *)coder
-{
- self = [super initWithCoder:coder];
- if (self) {
- // Custom colors for the slider
- _sliderColor = [NSColor colorWithCalibratedRed:0.318 green:0.318 blue:0.318 alpha:0.6];
- _disabledSliderColor = [NSColor colorWithCalibratedRed:0.318 green:0.318 blue:0.318 alpha:0.2];
- _strokeColor = [NSColor colorWithCalibratedRed:0.749 green:0.761 blue:0.788 alpha:1.0];
- _disabledStrokeColor = [NSColor colorWithCalibratedRed:0.749 green:0.761 blue:0.788 alpha:0.2];
-
- // Custom knob gradients
- _knobGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.251 green:0.251 blue:0.255 alpha:1.0]
- endingColor:[NSColor colorWithDeviceRed:0.118 green:0.118 blue:0.118 alpha:1.0]];
- _disableKnobGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.251 green:0.251 blue:0.255 alpha:1.0]
- endingColor:[NSColor colorWithDeviceRed:0.118 green:0.118 blue:0.118 alpha:1.0]];
- }
- return self;
-}
-
-NSAffineTransform* RotationTransform(const CGFloat angle, const NSPoint point)
-{
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy:point.x yBy:point.y];
- [transform rotateByRadians:angle];
- [transform translateXBy:-(point.x) yBy:-(point.y)];
- return transform;
-}
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-- (void)drawKnob:(NSRect)smallRect
-{
- if (OSX_YOSEMITE_AND_HIGHER) {
- return [super drawKnob:smallRect];
- }
- NSBezierPath *path = [NSBezierPath bezierPath];
- // Inset rect to have enough room for the stroke
- smallRect = NSInsetRect(smallRect, 1.0, 1.0);
-
- // Get min/max/mid coords for shape calculations
- CGFloat minX = NSMinX(smallRect);
- CGFloat minY = NSMinY(smallRect);
- CGFloat maxX = NSMaxX(smallRect);
- CGFloat maxY = NSMaxY(smallRect);
- CGFloat midX = NSMidX(smallRect);
- CGFloat midY = NSMidY(smallRect);
-
- // Draw the knobs shape
- if (self.numberOfTickMarks > 0) {
- // We have tickmarks, draw an arrow-like shape
- if (self.isVertical) {
- // For some reason the rect is not alligned correctly at
- // tickmarks and clipped, so this ugly thing is necessary:
- maxY = maxY - 2;
- midY = midY - 1;
-
- // Right pointing arrow
- [path moveToPoint:NSMakePoint(minX + 3, minY)];
- [path lineToPoint:NSMakePoint(midX + 2, minY)];
- [path lineToPoint:NSMakePoint(maxX, midY)];
- [path lineToPoint:NSMakePoint(midX + 2, maxY)];
- [path lineToPoint:NSMakePoint(minX + 3, maxY)];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(minX, maxY)
- toPoint:NSMakePoint(minX, maxY - 3)
- radius:2.5f];
- [path lineToPoint:NSMakePoint(minX, maxY - 3)];
- [path lineToPoint:NSMakePoint(minX, minY + 3)];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(minX, minY)
- toPoint:NSMakePoint(minX + 3, minY)
- radius:2.5f];
- [path closePath];
- } else {
- // Down pointing arrow
- [path moveToPoint:NSMakePoint(minX + 3, minY)];
- [path lineToPoint:NSMakePoint(maxX - 3, minY)];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(maxX, minY)
- toPoint:NSMakePoint(maxX, minY + 3)
- radius:2.5f];
- [path lineToPoint:NSMakePoint(maxX, minY + 3)];
- [path lineToPoint:NSMakePoint(maxX, midY + 2)];
- [path lineToPoint:NSMakePoint(midX, maxY)];
- [path lineToPoint:NSMakePoint(minX, midY + 2)];
- [path lineToPoint:NSMakePoint(minX, minY + 3)];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(minX, minY)
- toPoint:NSMakePoint(minX + 3, minY)
- radius:2.5f];
- [path closePath];
- }
-
- // Rotate our knob if needed to the correct position
- if (self.tickMarkPosition == NSTickMarkAbove) {
- NSAffineTransform *transform = nil;
- transform = RotationTransform(M_PI, NSMakePoint(midX, midY));
- [path transformUsingAffineTransform:transform];
- }
- } else {
- // We have no tickmarks, draw a round knob
- [path appendBezierPathWithOvalInRect:NSInsetRect(smallRect, 0.5, 0.5)];
- }
-
- // Draw the knobs background
- if (self.isEnabled && self.isHighlighted) {
- [_knobGradient drawInBezierPath:path angle:270.0f];
- } else if (self.isEnabled) {
- [_knobGradient drawInBezierPath:path angle:90.0f];
- } else {
- [_disableKnobGradient drawInBezierPath:path angle:90.0f];
- }
-
- // Draw white stroke around the knob
- if (self.isEnabled) {
- [_strokeColor setStroke];
- } else {
- [_disabledStrokeColor setStroke];
- }
-
- [path setLineWidth:1.0];
- [path stroke];
-}
-
-- (void)drawBarInside:(NSRect)fullRect flipped:(BOOL)flipped
-{
- if (OSX_YOSEMITE_AND_HIGHER) {
- return [super drawBarInside:fullRect flipped:flipped];
- }
- if (self.isVertical) {
- return [self drawVerticalBarInFrame:fullRect];
- } else {
- return [self drawHorizontalBarInFrame:fullRect];
- }
-}
-#pragma clang diagnostic pop
-
-- (void)drawVerticalBarInFrame:(NSRect)frame
-{
- // Adjust frame based on ControlSize
- switch ([self controlSize]) {
-
- case NSRegularControlSize:
-
- if ([self numberOfTickMarks] != 0) {
- if ([self tickMarkPosition] == NSTickMarkRight) {
- frame.origin.x += 4;
- } else {
- frame.origin.x += frame.size.width - 9;
- }
- } else {
- frame.origin.x = frame.origin.x + (((frame.origin.x + frame.size.width) /2) - 2.5f);
- }
- frame.origin.x += 0.5f;
- frame.origin.y += 2.5f;
- frame.size.height -= 6;
- frame.size.width = 5;
- break;
-
- case NSSmallControlSize:
-
- if ([self numberOfTickMarks] != 0) {
- if ([self tickMarkPosition] == NSTickMarkRight) {
- frame.origin.x += 3;
- } else {
- frame.origin.x += frame.size.width - 8;
- }
- } else {
- frame.origin.x = frame.origin.x + (((frame.origin.x + frame.size.width) /2) - 2.5f);
- }
- frame.origin.y += 0.5f;
- frame.size.height -= 1;
- frame.origin.x += 0.5f;
- frame.size.width = 5;
- break;
-
- case NSMiniControlSize:
-
- if ([self numberOfTickMarks] != 0) {
- if ([self tickMarkPosition] == NSTickMarkRight) {
- frame.origin.x += 2.5f;
- } else {
- frame.origin.x += frame.size.width - 6.5f;
- }
- } else {
- frame.origin.x = frame.origin.x + (((frame.origin.x + frame.size.width) /2) - 2);
- }
- frame.origin.x += 1;
- frame.origin.y += 0.5f;
- frame.size.height -= 1;
- frame.size.width = 3;
- break;
- }
-
- // Draw Bar
- NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect: frame xRadius: 2 yRadius: 2];
-
- if ([self isEnabled]) {
- [_sliderColor set];
- [path fill];
-
- [_strokeColor set];
- [path stroke];
- } else {
- [_disabledSliderColor set];
- [path fill];
-
- [_disabledStrokeColor set];
- [path stroke];
- }
-}
-
-- (void)drawHorizontalBarInFrame:(NSRect)frame
-{
- // Adjust frame based on ControlSize
- switch ([self controlSize]) {
-
- case NSRegularControlSize:
-
- if ([self numberOfTickMarks] != 0) {
- if ([self tickMarkPosition] == NSTickMarkBelow) {
- frame.origin.y += 4;
- } else {
- frame.origin.y += frame.size.height - 10;
- }
- } else {
- frame.origin.y = frame.origin.y + (((frame.origin.y + frame.size.height) /2) - 2.5f);
- }
- frame.origin.x += 2.5f;
- frame.origin.y += 0.5f;
- frame.size.width -= 5;
- frame.size.height = 5;
- break;
-
- case NSSmallControlSize:
-
- if ([self numberOfTickMarks] != 0) {
- if ([self tickMarkPosition] == NSTickMarkBelow) {
- frame.origin.y += 2;
- } else {
- frame.origin.y += frame.size.height - 8;
- }
- } else {
- frame.origin.y = frame.origin.y + (((frame.origin.y + frame.size.height) /2) - 2.5f);
- }
- frame.origin.x += 0.5f;
- frame.origin.y += 0.5f;
- frame.size.width -= 1;
- frame.size.height = 5;
- break;
-
- case NSMiniControlSize:
-
- if ([self numberOfTickMarks] != 0) {
- if ([self tickMarkPosition] == NSTickMarkBelow) {
- frame.origin.y += 2;
- } else {
- frame.origin.y += frame.size.height - 6;
- }
- } else {
- frame.origin.y = frame.origin.y + (((frame.origin.y + frame.size.height) /2) - 2);
- }
- frame.origin.x += 0.5f;
- frame.origin.y += 0.5f;
- frame.size.width -= 1;
- frame.size.height = 3;
- break;
- }
-
- // Draw Bar
- NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:frame xRadius:2 yRadius:2];
-
- if ([self isEnabled]) {
- [_sliderColor set];
- [path fill];
-
- [_strokeColor set];
- [path stroke];
- } else {
- [_disabledSliderColor set];
- [path fill];
-
- [_disabledStrokeColor set];
- [path stroke];
- }
-}
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-- (void)drawTickMarks
-{
- if (OSX_YOSEMITE_AND_HIGHER) {
- return [super drawTickMarks];
- }
- for (int i = 0; i < self.numberOfTickMarks; i++) {
- NSRect tickMarkRect = [self rectOfTickMarkAtIndex:i];
- if (self.isEnabled) {
- [_strokeColor setFill];
- } else {
- [_disabledStrokeColor setFill];
- }
- NSRectFill(tickMarkRect);
- }
-}
-#pragma clang diagnostic pop
-
- at end
More information about the vlc-commits
mailing list