macOS: Move VLCTimeField out of misc
authorMarvin Scholz <epirat07@gmail.com>
Thu, 1 Jun 2017 09:59:51 +0000 (11:59 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Thu, 1 Jun 2017 10:00:59 +0000 (12:00 +0200)
This moves the VLCTimeField class in their own files, out of misc.

extras/package/macosx/VLC.xcodeproj/project.pbxproj
modules/gui/macosx/Makefile.am
modules/gui/macosx/VLCControlsBarCommon.h
modules/gui/macosx/VLCFSPanelController.h
modules/gui/macosx/VLCTimeField.h [new file with mode: 0644]
modules/gui/macosx/VLCTimeField.m [new file with mode: 0644]
modules/gui/macosx/misc.h
modules/gui/macosx/misc.m

index 3a5021b..8b2e32b 100644 (file)
@@ -80,6 +80,7 @@
                6B81662A1EBFC34300C26F1B /* VLCDefaultValueSliderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B6A499D1DFD9B23009128AC /* VLCDefaultValueSliderCell.m */; };
                6B81662B1EBFC35D00C26F1B /* VLCVoutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = E0C2583F161B593D00185AAD /* VLCVoutWindowController.m */; };
                6B81662C1EBFC38100C26F1B /* VLCUIWidgets.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CCED71514C0D4A90057F8D1 /* VLCUIWidgets.m */; };
+               6BF093F91EE0182B0049D8B0 /* VLCTimeField.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF093F81EE0182B0049D8B0 /* VLCTimeField.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
                6BBBB8B61D114628001BD9BA /* VLCRendererDiscovery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCRendererDiscovery.m; sourceTree = "<group>"; };
                6BCB59091DA247CD009BCA66 /* VLCFSPanelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCFSPanelController.h; sourceTree = "<group>"; };
                6BCB590A1DA247CD009BCA66 /* VLCFSPanelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCFSPanelController.m; sourceTree = "<group>"; };
+               6BF093F71EE0182B0049D8B0 /* VLCTimeField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCTimeField.h; sourceTree = "<group>"; };
+               6BF093F81EE0182B0049D8B0 /* VLCTimeField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCTimeField.m; sourceTree = "<group>"; };
                6BF557CF1E4E0E2500C03C9D /* VLCPauseTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = VLCPauseTemplate.pdf; path = "Button-Icons/VLCPauseTemplate.pdf"; sourceTree = "<group>"; };
                7D5678EB1D5BA1DC002698F3 /* VLCApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCApplication.h; sourceTree = "<group>"; };
                7D5678EC1D5BA1DC002698F3 /* VLCApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCApplication.m; sourceTree = "<group>"; };
                                CC017A0C14A4C8AF00C09A4F /* VLCMainWindowTitleView.m */,
                                8ED6C27F03E2EB1C0059A3A7 /* misc.h */,
                                8ED6C28003E2EB1C0059A3A7 /* misc.m */,
+                               6BF093F71EE0182B0049D8B0 /* VLCTimeField.h */,
+                               6BF093F81EE0182B0049D8B0 /* VLCTimeField.m */,
                                6B4D50A51E7AB52C004479B5 /* NSScreen+VLCAdditions.h */,
                                6B4D50A61E7AB52C004479B5 /* NSScreen+VLCAdditions.m */,
                                6B4D50941E7A7D16004479B5 /* NSSound+VLCAdditions.h */,
                                1CFE8D591EA0D42A00E94451 /* VLCErrorWindowController.m in Sources */,
                                1C3114051E508C8800D4DD76 /* SideBarItem.m in Sources */,
                                6B4D50961E7A7D16004479B5 /* NSSound+VLCAdditions.m in Sources */,
+                               6BF093F91EE0182B0049D8B0 /* VLCTimeField.m in Sources */,
                                1C3114071E508C8800D4DD76 /* PXSourceList.m in Sources */,
                                1C31140B1E508C8800D4DD76 /* SPInvocationGrabbing.m in Sources */,
                                1C31140D1E508C8800D4DD76 /* SPMediaKeyTap.m in Sources */,
index 3085265..3c718af 100644 (file)
@@ -90,7 +90,8 @@ libmacosx_plugin_la_SOURCES = \
        gui/macosx/VLCDefaultValueSlider.h gui/macosx/VLCDefaultValueSlider.m \
        gui/macosx/VLCDefaultValueSliderCell.h gui/macosx/VLCDefaultValueSliderCell.m \
        gui/macosx/VLCHUDImageButton.h gui/macosx/VLCHUDImageButton.m \
-       gui/macosx/VLCHUDToggleButton.h gui/macosx/VLCHUDToggleButton.m
+       gui/macosx/VLCHUDToggleButton.h gui/macosx/VLCHUDToggleButton.m \
+       gui/macosx/VLCTimeField.h gui/macosx/VLCTimeField.m
 
 # User interface compilation
 
index e286012..e2d8639 100644 (file)
@@ -25,6 +25,8 @@
 #import <Cocoa/Cocoa.h>
 #import "misc.h"
 
+#import "VLCTimeField.h"
+
 @class VLCResizeControl;
 
 /*****************************************************************************
index e1f6194..5b86759 100644 (file)
@@ -26,9 +26,9 @@
 
 #import <Cocoa/Cocoa.h>
 
-#import "misc.h"
 #import "Windows.h"
 #import "VLCDefaultValueSlider.h"
+#import "VLCTimeField.h"
 
 @interface VLCFSPanelController : NSWindowController
 
diff --git a/modules/gui/macosx/VLCTimeField.h b/modules/gui/macosx/VLCTimeField.h
new file mode 100644 (file)
index 0000000..c6d81e6
--- /dev/null
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * VLCTimeField.h: NSTextField subclass for playback time fields
+ *****************************************************************************
+ * Copyright (C) 2003-2017 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
+ *          Felix Paul Kühne <fkuehne at videolan dot org>
+ *          Marvin Scholz <epirat07 at gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+/*****************************************************************************
+ * VLCTimeField interface
+ *****************************************************************************
+ * we need the implementation to catch our click-event in the controller window
+ *****************************************************************************/
+
+@interface VLCTimeField : NSTextField
+
+@property (readonly) BOOL timeRemaining;
+
+- (void)setRemainingIdentifier:(NSString *)o_string;
+
+@end
diff --git a/modules/gui/macosx/VLCTimeField.m b/modules/gui/macosx/VLCTimeField.m
new file mode 100644 (file)
index 0000000..91d515a
--- /dev/null
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * VLCTimeField.m: NSTextField subclass for playback time fields
+ *****************************************************************************
+ * Copyright (C) 2003-2017 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
+ *          Felix Paul Kühne <fkuehne at videolan dot org>
+ *          Marvin Scholz <epirat07 at gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import "VLCTimeField.h"
+
+#import "VLCMain.h"
+#import "VLCMainMenu.h"
+
+@interface VLCTimeField ()
+{
+    NSString *o_remaining_identifier;
+    BOOL b_time_remaining;
+}
+@end
+
+@implementation VLCTimeField
++ (void)initialize
+{
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
+                                 @"NO", @"DisplayTimeAsTimeRemaining",
+                                 @"YES", @"DisplayFullscreenTimeAsTimeRemaining",
+                                 nil];
+
+    [defaults registerDefaults:appDefaults];
+}
+
+
+- (void)setRemainingIdentifier:(NSString *)o_string
+{
+    o_remaining_identifier = o_string;
+    b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
+}
+
+- (void)mouseDown: (NSEvent *)ourEvent
+{
+    if ( [ourEvent clickCount] > 1 )
+        [[[VLCMain sharedInstance] mainMenu] goToSpecificTime: nil];
+    else
+    {
+        if (o_remaining_identifier) {
+            b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
+            b_time_remaining = !b_time_remaining;
+            [[NSUserDefaults standardUserDefaults] setObject:(b_time_remaining ? @"YES" : @"NO") forKey:o_remaining_identifier];
+        } else {
+            b_time_remaining = !b_time_remaining;
+        }
+    }
+
+    [[self nextResponder] mouseDown:ourEvent];
+}
+
+- (BOOL)timeRemaining
+{
+    if (o_remaining_identifier)
+        return [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
+    else
+        return b_time_remaining;
+}
+
+@end
index 80b6fcf..5c566eb 100644 (file)
 
 @end
 
-/*****************************************************************************
- * VLCTimeField interface
- *****************************************************************************
- * we need the implementation to catch our click-event in the controller window
- *****************************************************************************/
-
-@interface VLCTimeField : NSTextField
-
-@property (readonly) BOOL timeRemaining;
-
-- (void)setRemainingIdentifier:(NSString *)o_string;
-
-@end
-
 /*****************************************************************************
  * VLCMainWindowSplitView interface
  *****************************************************************************/
index 3b659a9..65dc17e 100644 (file)
@@ -464,66 +464,6 @@ void _drawFrameInRect(NSRect frameRect)
 
 @end
 
-/*****************************************************************************
- * VLCTimeField implementation
- *****************************************************************************
- * we need this to catch our click-event in the controller window
- *****************************************************************************/
-
-@interface VLCTimeField ()
-{
-    NSString *o_remaining_identifier;
-    BOOL b_time_remaining;
-}
-@end
-
-@implementation VLCTimeField
-+ (void)initialize
-{
-    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-    NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
-                                 @"NO", @"DisplayTimeAsTimeRemaining",
-                                 @"YES", @"DisplayFullscreenTimeAsTimeRemaining",
-                                 nil];
-
-    [defaults registerDefaults:appDefaults];
-}
-
-
-- (void)setRemainingIdentifier:(NSString *)o_string
-{
-    o_remaining_identifier = o_string;
-    b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
-}
-
-- (void)mouseDown: (NSEvent *)ourEvent
-{
-    if ( [ourEvent clickCount] > 1 )
-        [[[VLCMain sharedInstance] mainMenu] goToSpecificTime: nil];
-    else
-    {
-        if (o_remaining_identifier) {
-            b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
-            b_time_remaining = !b_time_remaining;
-            [[NSUserDefaults standardUserDefaults] setObject:(b_time_remaining ? @"YES" : @"NO") forKey:o_remaining_identifier];
-        } else {
-            b_time_remaining = !b_time_remaining;
-        }
-    }
-
-    [[self nextResponder] mouseDown:ourEvent];
-}
-
-- (BOOL)timeRemaining
-{
-    if (o_remaining_identifier)
-        return [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
-    else
-        return b_time_remaining;
-}
-
-@end
-
 /*****************************************************************************
  * VLCMainWindowSplitView implementation
  * comment 1 + 2 taken from NSSplitView.h (10.7 SDK)