Commit a99dcf71 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* All : added an about VLC panel. It scrolls the names and the work of the

        AUTHORS file.

* AUTHORS: updated my own info
parent dbade9bd
# $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: Gal Hendryckx
......
......@@ -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 \
......
{
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; },
{
......
......@@ -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>
......
......@@ -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;
......
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 \
......
/*****************************************************************************
* 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
/*****************************************************************************
* 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment