From: Derk-Jan Hartman Date: Wed, 9 Apr 2003 20:53:28 +0000 (+0000) Subject: * All : added an about VLC panel. It scrolls the names and the work of the X-Git-Tag: 0.6.0~617 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a99dcf71d19a9f4e9ac28992b326bae766484d1c;p=vlc * All : added an about VLC panel. It scrolls the names and the work of the AUTHORS file. * AUTHORS: updated my own info --- diff --git a/AUTHORS b/AUTHORS index 7465659401..976a8fd8d2 100644 --- 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 diff --git a/Makefile.am b/Makefile.am index 1967fea1c9..61b6def08c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index 50d02434ee..8e3794c1bb 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -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; }, { diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index c1fb1478df..af17fe2198 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -7,7 +7,7 @@ IBEditorPositions 29 - 14 602 419 44 0 0 1152 746 + 16 822 419 44 0 0 1280 1002 303 60 509 104 114 0 0 1280 1002 909 @@ -23,8 +23,8 @@ IBOpenObjects + 1345 29 - 636 IBSystem Version 6I32 diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib index b0767605f4..33509d562d 100644 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 index 0000000000..b4177ec29d Binary files /dev/null and b/extras/MacOSX/Resources/about_bg.png differ diff --git a/extras/MacOSX/vlc.pbproj/project.pbxproj b/extras/MacOSX/vlc.pbproj/project.pbxproj index 7a4558b006..b9687c889d 100644 --- a/extras/MacOSX/vlc.pbproj/project.pbxproj +++ b/extras/MacOSX/vlc.pbproj/project.pbxproj @@ -466,6 +466,7 @@ 8EBF3FA803F140A80059A3A7, A0E6B59904407FBD0080DD97, 8EDAC3440440F72D0059A3A7, + 8EE1AFA40444660F0059A3A7, ); isa = PBXResourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -506,6 +507,7 @@ A064F9E803CB9EE000B21232, A064F9E903CB9EE000B21232, 8E88833C03DD6E870059A3A7, + 8EE1AFA30444660F0059A3A7, F69B0CA602E24F6401A80112, 8ED6C29D03E2F32E0059A3A7, 8ED6C29E03E2F32E0059A3A7, @@ -526,6 +528,8 @@ }; 08FB77AFFE84173DC02AAC07 = { children = ( + 8EE1AF9F044465080059A3A7, + 8EE1AFA0044465080059A3A7, 8E6BC6F6041643860059A3A7, 8E6BC6F7041643860059A3A7, 8ED6C27A03E2EB1C0059A3A7, @@ -826,6 +830,32 @@ 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; diff --git a/modules/gui/macosx/Modules.am b/modules/gui/macosx/Modules.am index 951f9d1fa2..2b6cfaf8bd 100644 --- a/modules/gui/macosx/Modules.am +++ b/modules/gui/macosx/Modules.am @@ -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 index 0000000000..7984b02b06 --- /dev/null +++ b/modules/gui/macosx/about.h @@ -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 + * + * 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 index 0000000000..134f5cb3ac --- /dev/null +++ b/modules/gui/macosx/about.m @@ -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 + * + * 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