]> git.sesse.net Git - vlc/commitdiff
* All : added an about VLC panel. It scrolls the names and the work of the
authorDerk-Jan Hartman <hartman@videolan.org>
Wed, 9 Apr 2003 20:53:28 +0000 (20:53 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Wed, 9 Apr 2003 20:53:28 +0000 (20:53 +0000)
        AUTHORS file.

* AUTHORS: updated my own info

AUTHORS
Makefile.am
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
extras/MacOSX/Resources/about_bg.png [new file with mode: 0755]
extras/MacOSX/vlc.pbproj/project.pbxproj
modules/gui/macosx/Modules.am
modules/gui/macosx/about.h [new file with mode: 0644]
modules/gui/macosx/about.m [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
index 7465659401fd96296b591da8601ba048b6b2cd0f..976a8fd8d2c47c1ae5719fa28baa97ccb26f3012 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,4 +1,4 @@
-# $Id: AUTHORS,v 1.92 2003/02/27 12:44:01 marcari Exp $
+# $Id: AUTHORS,v 1.93 2003/04/09 20:53:28 hartman Exp $
 # 
 # The format of this file was inspired by the Linux kernel CREDITS file.
 # Authors are listed alphabetically.
@@ -148,9 +148,11 @@ D: Gnome and Gtk+ interface enhancements
 S: United Kingdom
 
 N: Derk-Jan Hartman
-E: pjotr@sidekick.student.utwente.nl
+E: thedj@users.sourceforge.net
 C: hartman
 D: Mac OS X interface
+D: Dutch translation
+D: Directory input
 S: Netherlands
 
 N: GaĆ«l Hendryckx
index 1967fea1c9079d8b76564a4ca8f7e41ab1e70258..61b6def08ce29abc107564d643fd667bda34d9bb 100644 (file)
@@ -263,6 +263,7 @@ EXTRA_DIST += \
        extras/MacOSX/Resources/slow.png \
        extras/MacOSX/Resources/stop.png \
        extras/MacOSX/Resources/vlc_hg.png \
+       extras/MacOSX/Resources/about_bg.png \
        extras/MacOSX/Resources/vlc.scriptSuite \
        extras/MacOSX/Resources/README \
        extras/MacOSX/vlc.pbproj/project.pbxproj \
index 50d02434ee492777b1d499c23caac8fff2796dbc..8e3794c1bb451be506276c0ea582af77e596f770 100644 (file)
@@ -1,6 +1,19 @@
 {
     IBClasses = (
         {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
+        {
+            ACTIONS = {showPanel = id; }; 
+            CLASS = VLAboutBox; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {
+                "o_about_window" = id; 
+                "o_copyright_field" = id; 
+                "o_credits_scrollview" = id; 
+                "o_credits_textview" = id; 
+                "o_name_version_field" = id; 
+            }; 
+            SUPERCLASS = NSObject; 
+        }, 
         {CLASS = VLBrushedMetalImageView; LANGUAGE = ObjC; SUPERCLASS = NSImageView; }, 
         {CLASS = VLCApplication; LANGUAGE = ObjC; SUPERCLASS = NSApplication; }, 
         {
index c1fb1478df7cca4ec3ee72f90b271efc985753aa..af17fe2198afc53534e18e50a8bd4b7ca556432e 100644 (file)
@@ -7,7 +7,7 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
-               <string>14 602 419 44 0 0 1152 746 </string>
+               <string>16 822 419 44 0 0 1280 1002 </string>
                <key>303</key>
                <string>60 509 104 114 0 0 1280 1002 </string>
                <key>909</key>
@@ -23,8 +23,8 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
+               <integer>1345</integer>
                <integer>29</integer>
-               <integer>636</integer>
        </array>
        <key>IBSystem Version</key>
        <string>6I32</string>
index b0767605f482c76b19faa56b7b68bd548f8a95d9..33509d562dff6fa2cab23f03686a9c3e1eada5d2 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
diff --git a/extras/MacOSX/Resources/about_bg.png b/extras/MacOSX/Resources/about_bg.png
new file mode 100755 (executable)
index 0000000..b4177ec
Binary files /dev/null and b/extras/MacOSX/Resources/about_bg.png differ
index 7a4558b0062e98132d38e84215249a0ebe7d8706..b9687c889d6ca951313b1eeab946f712d875f8c7 100644 (file)
                                8EBF3FA803F140A80059A3A7,
                                A0E6B59904407FBD0080DD97,
                                8EDAC3440440F72D0059A3A7,
+                               8EE1AFA40444660F0059A3A7,
                        );
                        isa = PBXResourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                A064F9E803CB9EE000B21232,
                                A064F9E903CB9EE000B21232,
                                8E88833C03DD6E870059A3A7,
+                               8EE1AFA30444660F0059A3A7,
                                F69B0CA602E24F6401A80112,
                                8ED6C29D03E2F32E0059A3A7,
                                8ED6C29E03E2F32E0059A3A7,
                };
                08FB77AFFE84173DC02AAC07 = {
                        children = (
+                               8EE1AF9F044465080059A3A7,
+                               8EE1AFA0044465080059A3A7,
                                8E6BC6F6041643860059A3A7,
                                8E6BC6F7041643860059A3A7,
                                8ED6C27A03E2EB1C0059A3A7,
                        settings = {
                        };
                };
+               8EE1AF9F044465080059A3A7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       name = about.h;
+                       path = ../../modules/gui/macosx/about.h;
+                       refType = 2;
+               };
+               8EE1AFA0044465080059A3A7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       name = about.m;
+                       path = ../../modules/gui/macosx/about.m;
+                       refType = 2;
+               };
+               8EE1AFA30444660F0059A3A7 = {
+                       isa = PBXFileReference;
+                       name = about_bg.png;
+                       path = Resources/about_bg.png;
+                       refType = 2;
+               };
+               8EE1AFA40444660F0059A3A7 = {
+                       fileRef = 8EE1AFA30444660F0059A3A7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
                8EF1600B03FC62560059A3A7 = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
index 951f9d1fa2df5f3017d7bacd207950d3303bab3f..2b6cfaf8bdf21be5197422a09b545c1e3c5006d1 100644 (file)
@@ -1,4 +1,6 @@
 SOURCES_macosx = \
+       modules/gui/macosx/about.h \
+       modules/gui/macosx/about.m \
        modules/gui/macosx/applescript.h \
        modules/gui/macosx/applescript.m \
        modules/gui/macosx/controls.h \
diff --git a/modules/gui/macosx/about.h b/modules/gui/macosx/about.h
new file mode 100644 (file)
index 0000000..7984b02
--- /dev/null
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * about.h: MacOS X About Panel
+ *****************************************************************************
+ * Copyright (C) 2001-2003 VideoLAN
+ * $Id: about.h,v 1.1 2003/04/09 20:53:28 hartman Exp $
+ *
+ * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
+ * 
+ * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * VLAboutBox interface 
+ *****************************************************************************/
+@interface VLAboutBox : NSObject
+{
+    IBOutlet id o_about_window;
+    IBOutlet id o_name_version_field;
+    IBOutlet id o_copyright_field;
+    IBOutlet id o_credits_textview;
+    IBOutlet id o_credits_scrollview;
+    
+    NSTimer *o_scroll_timer;
+    float f_current;
+    NSTimeInterval i_start;
+    BOOL b_restart;
+    
+    NSString *o_credits_path;
+    NSString *o_credits;
+    NSString *o_name_version;
+    NSString *o_copyright;
+    NSDictionary *o_info_dict;
+    CFBundleRef localInfoBundle;
+    NSDictionary *o_local_dict;
+}
+
++ (VLAboutBox *)sharedInstance;
+- (IBAction)showPanel:(id)sender;
+
+@end
diff --git a/modules/gui/macosx/about.m b/modules/gui/macosx/about.m
new file mode 100644 (file)
index 0000000..134f5cb
--- /dev/null
@@ -0,0 +1,176 @@
+/*****************************************************************************
+ * about.m: MacOS X About Panel
+ *****************************************************************************
+ * Copyright (C) 2001-2003 VideoLAN
+ * $Id: about.m,v 1.1 2003/04/09 20:53:28 hartman Exp $
+ *
+ * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "intf.h"
+#include "about.h"
+
+/*****************************************************************************
+ * VLAboutBox implementation 
+ *****************************************************************************/
+@implementation VLAboutBox
+
+static VLAboutBox *_o_sharedInstance = nil;
+
++ (VLAboutBox *)sharedInstance
+{
+    return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
+}
+
+- (id)init 
+{
+    if (_o_sharedInstance) {
+        [self dealloc];
+    } else {
+        _o_sharedInstance = [super init];
+    }
+    
+    return _o_sharedInstance;
+}
+
+- (IBAction)showPanel:(id)sender
+{    
+    if (!o_credits_path)
+    {
+        NSString *o_name;
+        NSString *o_version;
+    
+        // Get the info dictionary (Info.plist)
+        o_info_dict = [[NSBundle mainBundle] infoDictionary];
+        
+        // Get the localized info dictionary (InfoPlist.strings)
+        localInfoBundle = CFBundleGetMainBundle();
+        o_local_dict = (NSDictionary *)
+                        CFBundleGetLocalInfoDictionary( localInfoBundle );
+        
+        // Setup the app name field
+        o_name = [o_local_dict objectForKey:@"CFBundleName"];
+        
+        // Set the about box window title
+        [o_about_window setTitle:_NS("About VLC media player")];
+        
+        // Setup the version field
+        o_version = [o_info_dict objectForKey:@"CFBundleVersion"];
+    
+        // Setup the appnameversion field
+        o_name_version = [NSString stringWithFormat:@"%@ - Version %@", o_name, o_version];
+        [o_name_version_field setStringValue: o_name_version];
+        
+        // Setup our credits
+        o_credits_path = [[NSBundle mainBundle] pathForResource:@"AUTHORS" ofType:nil];
+        o_credits = [NSString stringWithContentsOfFile: o_credits_path ];
+        
+        // Parse the string
+        NSMutableString *o_outString = [NSMutableString string];
+        NSScanner *o_scan_credits = [NSScanner scannerWithString: o_credits];
+        NSCharacterSet *o_stopSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r"];
+        
+        while( ![o_scan_credits isAtEnd] )
+        {
+            NSString *o_person;
+            NSScanner *o_scan_person;
+            
+            [o_scan_credits scanUpToString:@"N:" intoString: nil];
+            [o_scan_credits scanString:@"N:" intoString: nil];
+            [o_scan_credits scanUpToString:@"N:" intoString: &o_person];
+            o_scan_person = [NSScanner scannerWithString: o_person];
+            
+            NSString *o_name;
+            NSString *o_email;
+            NSMutableString *o_jobs = [NSMutableString string];
+            NSString *o_next;
+
+            [o_scan_person scanUpToCharactersFromSet: o_stopSet intoString: &o_name];
+            [o_scan_person scanString:@"E:" intoString: nil];
+            [o_scan_person scanUpToCharactersFromSet: o_stopSet intoString: &o_email];
+            [o_scan_person scanUpToString:@"D:" intoString: &o_next];
+            [o_scan_person scanUpToString:@":" intoString: &o_next];
+            [o_scan_person scanString:@":" intoString: nil];
+    
+            while ( [o_next characterAtIndex:[o_next length] - 1] == 'D' )
+            {
+                NSString *o_job;
+                [o_scan_person scanUpToCharactersFromSet: o_stopSet intoString: &o_job ];
+                [o_jobs appendFormat: @"%@, ", o_job];
+                [o_scan_person scanUpToString:@":" intoString: &o_next];
+                [o_scan_person scanString:@":" intoString: nil];
+            }
+            
+            [o_outString appendFormat: @"%@ <%@>\n%@\n\n", o_name, o_email, o_jobs];
+            [o_credits_textview setString:o_outString];
+        }
+        
+        // Setup the copyright field
+        o_copyright = [o_local_dict objectForKey:@"NSHumanReadableCopyright"];
+        [o_copyright_field setStringValue:o_copyright];
+
+        // Setup the window
+        [o_credits_textview setDrawsBackground: NO];
+        [o_credits_scrollview setDrawsBackground: NO];
+        [o_about_window setExcludedFromWindowsMenu:YES];
+        [o_about_window setMenu:nil];
+        [o_about_window center];
+    }
+    
+    // Show the window
+    b_restart = YES;
+    [o_about_window makeKeyAndOrderFront:nil];
+}
+
+- (void)windowDidBecomeKey:(NSNotification *)notification
+{
+    o_scroll_timer = [NSTimer scheduledTimerWithTimeInterval:1/6
+                           target:self 
+                           selector:@selector(scrollCredits:) 
+                           userInfo:nil 
+                           repeats:YES];
+}
+
+- (void)windowDidResignKey:(NSNotification *)notification
+{
+    [o_scroll_timer invalidate];
+}
+
+- (void)scrollCredits:(NSTimer *)timer
+{
+    if (b_restart)
+    {
+        // Reset the startTime
+        i_start = [NSDate timeIntervalSinceReferenceDate] + 3.0;
+        f_current = 0;
+        b_restart = NO;
+    }
+
+    if ([NSDate timeIntervalSinceReferenceDate] >= i_start)
+    {
+        // Scroll to the position
+        [o_credits_textview scrollPoint:NSMakePoint( 0, f_current )];
+        
+        // Increment the scroll position
+        f_current += 0.005;
+    }
+}
+
+@end