[vlc-commits] macosx: Remove VLCHUDButtonCell class
Marvin Scholz
git at videolan.org
Sun Feb 18 17:37:56 CET 2018
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sun Feb 18 17:15:56 2018 +0100| [c6bfc56292dbe4a4bb98052e9006d04ef9398c58] | committer: Marvin Scholz
macosx: Remove VLCHUDButtonCell 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=c6bfc56292dbe4a4bb98052e9006d04ef9398c58
---
.../package/macosx/VLC.xcodeproj/project.pbxproj | 6 -
modules/gui/macosx/Makefile.am | 1 -
modules/gui/macosx/VLCHUDButtonCell.h | 52 ---------
modules/gui/macosx/VLCHUDButtonCell.m | 125 ---------------------
4 files changed, 184 deletions(-)
diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 53c66f3711..2d70e31dd8 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 */; };
- 1C3113F71E508C7600D4DD76 /* VLCHUDButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B846FDD1CF5D88C00112E54 /* VLCHUDButtonCell.m */; };
1C3113F91E508C7600D4DD76 /* VLCHUDCheckboxCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B846FDF1CF5D88C00112E54 /* VLCHUDCheckboxCell.m */; };
1C3113FD1E508C7600D4DD76 /* VLCHUDSliderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B846FE31CF5D88C00112E54 /* VLCHUDSliderCell.m */; };
1C3114031E508C8800D4DD76 /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */; };
@@ -614,8 +613,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>"; };
- 6B846FDC1CF5D88C00112E54 /* VLCHUDButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDButtonCell.h; sourceTree = "<group>"; };
- 6B846FDD1CF5D88C00112E54 /* VLCHUDButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCHUDButtonCell.m; sourceTree = "<group>"; };
6B846FDE1CF5D88C00112E54 /* VLCHUDCheckboxCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDCheckboxCell.h; sourceTree = "<group>"; };
6B846FDF1CF5D88C00112E54 /* VLCHUDCheckboxCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCHUDCheckboxCell.m; sourceTree = "<group>"; };
6B846FE21CF5D88C00112E54 /* VLCHUDSliderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDSliderCell.h; sourceTree = "<group>"; };
@@ -1468,8 +1465,6 @@
6B846FE81CF5D89500112E54 /* HUD UI Classes */ = {
isa = PBXGroup;
children = (
- 6B846FDC1CF5D88C00112E54 /* VLCHUDButtonCell.h */,
- 6B846FDD1CF5D88C00112E54 /* VLCHUDButtonCell.m */,
6B846FDE1CF5D88C00112E54 /* VLCHUDCheckboxCell.h */,
6B846FDF1CF5D88C00112E54 /* VLCHUDCheckboxCell.m */,
6BF5C4FF1EFE03CF008A9C12 /* VLCHUDStepperCell.h */,
@@ -1762,7 +1757,6 @@
1C3113EF1E508C7600D4DD76 /* VLCRendererDiscovery.m in Sources */,
1C3113F11E508C7600D4DD76 /* VLCRendererItem.m in Sources */,
1C3113F31E508C7600D4DD76 /* VLCRendererMenuController.m in Sources */,
- 1C3113F71E508C7600D4DD76 /* VLCHUDButtonCell.m in Sources */,
6B4D50931E7979CB004479B5 /* VLCSimplePrefsWindow.m in Sources */,
1C3113F91E508C7600D4DD76 /* VLCHUDCheckboxCell.m in Sources */,
1C3113FD1E508C7600D4DD76 /* VLCHUDSliderCell.m in Sources */,
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index e945320b3b..8eb82a8ea1 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -75,7 +75,6 @@ libmacosx_plugin_la_SOURCES = \
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/VLCHUDButtonCell.h gui/macosx/VLCHUDButtonCell.m \
gui/macosx/VLCHUDCheckboxCell.h gui/macosx/VLCHUDCheckboxCell.m \
gui/macosx/VLCHUDScroller.h gui/macosx/VLCHUDScroller.m \
gui/macosx/VLCHUDOutlineView.h gui/macosx/VLCHUDOutlineView.m \
diff --git a/modules/gui/macosx/VLCHUDButtonCell.h b/modules/gui/macosx/VLCHUDButtonCell.h
deleted file mode 100644
index 4b3dfaae80..0000000000
--- a/modules/gui/macosx/VLCHUDButtonCell.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// VLCHUDButtonCell.h
-// BGHUDAppKit
-//
-// Created by BinaryGod on 5/25/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 NSButtonCell for HUD Panels.
- *
- * It does NOT support checkboxes or radio buttons,
- * use VLCHUDCheckboxCell and VLCHUDRadiobuttonCell instead.
- */
- at interface VLCHUDButtonCell : NSButtonCell
-
- at property NSGradient *normalGradient;
- at property NSGradient *disabledGradient;
- at property NSGradient *highlightGradient;
- at property NSGradient *pushedGradient;
-
- at property NSColor *enabledTextColor;
- at property NSColor *disabledTextColor;
-
- at end
diff --git a/modules/gui/macosx/VLCHUDButtonCell.m b/modules/gui/macosx/VLCHUDButtonCell.m
deleted file mode 100644
index a61023fd66..0000000000
--- a/modules/gui/macosx/VLCHUDButtonCell.m
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// VLCHUDButtonCell.m
-// BGHUDAppKit
-//
-// Created by BinaryGod on 5/25/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 "VLCHUDButtonCell.h"
-#import "CompatibilityFixes.h"
-
- at implementation VLCHUDButtonCell
-
-
-+ (void)load
-{
- /* On 10.10+ we do not want custom drawing, therefore we swap out the implementation
- * of the selectors below with their original implementations.
- * Just calling super is not enough, as it would still result in different drawing
- * due to lack of vibrancy.
- */
- if (OSX_YOSEMITE_AND_HIGHER) {
- swapoutOverride([VLCHUDButtonCell class], @selector(initWithCoder:));
- swapoutOverride([VLCHUDButtonCell class], @selector(drawBezelWithFrame:inView:));
- swapoutOverride([VLCHUDButtonCell class], @selector(drawTitle:withFrame:inView:));
- }
-}
-
-- (instancetype)initWithCoder:(NSCoder *)coder
-{
- self = [super initWithCoder:coder];
- if (self) {
- _disabledGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.251f green:0.251f blue:0.255f alpha:1.0f]
- endingColor:[NSColor colorWithDeviceRed:0.118f green:0.118f blue:0.118f alpha:1.0f]];
- _normalGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.251f green:0.251f blue:0.255f alpha:0.7f]
- endingColor:[NSColor colorWithDeviceRed:0.118f green:0.118f blue:0.118f alpha:0.7f]];
- _highlightGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.451f green:0.451f blue:0.455f alpha:1.0f]
- endingColor:[NSColor colorWithDeviceRed:0.318f green:0.318f blue:0.318f alpha:1.0f]];
- _pushedGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.451f green:0.451f blue:0.455f alpha:1.0f]
- endingColor:[NSColor colorWithDeviceRed:0.318f green:0.318f blue:0.318f alpha:1.0f]];
- _enabledTextColor = [NSColor whiteColor];
- _disabledTextColor = [NSColor grayColor];
- }
- return self;
-}
-
-- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView
-{
- // Set frame to the correct size
- frame.size.height = self.cellSize.height;
-
- // Inset rect to have enough room for the stroke
- frame = NSInsetRect(frame, 1, 1);
- if (self.bezelStyle == NSRoundRectBezelStyle) {
- [self drawRoundRectButtonBezelInRect:frame];
- } else {
- [super drawBezelWithFrame:frame inView:controlView];
- }
-}
-
-- (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView
-{
- NSMutableAttributedString *coloredTitle = [[NSMutableAttributedString alloc]
- initWithAttributedString:title];
- if (self.isEnabled) {
- [coloredTitle addAttribute:NSForegroundColorAttributeName
- value:_enabledTextColor
- range:NSMakeRange(0, coloredTitle.length)];
- } else {
- [coloredTitle addAttribute:NSForegroundColorAttributeName
- value:_disabledTextColor
- range:NSMakeRange(0, coloredTitle.length)];
- }
-
- return [super drawTitle:coloredTitle withFrame:frame inView:controlView];
-}
-
-- (void)drawRoundRectButtonBezelInRect:(NSRect)rect
-{
- NSBezierPath *path;
- if (self.controlSize == NSMiniControlSize) {
- rect = NSInsetRect(rect, 1.0, 2.0);
- path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:3.0 yRadius:3.0];
- } else {
- path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:8.0 yRadius:8.0];
- }
- if (self.highlighted) {
- [_pushedGradient drawInBezierPath:path angle:90.0f];
- } else if (!self.enabled) {
- [_disabledGradient drawInBezierPath:path angle:90.0f];
- } else {
- [_normalGradient drawInBezierPath:path angle:90.0f];
- }
- [[NSColor colorWithCalibratedWhite:1.0 alpha:1.0] setStroke];
- [path setLineWidth:1.0];
- [path stroke];
-}
-
- at end
More information about the vlc-commits
mailing list