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

* extras/MacOSX/vlc.pbproj/project.pbxproj:

  - Add the THANKS file to the Mac OS X application
* modules/gui/macosx/about.?:
  - Use c-style comments instead of //
  - Open the AUTHORS file with the correct Encoding
  - Display the THANKS file as well
  - Rotate the scrolling when at the end
* modules/gui/macosx/intf.m:
  - put Cocoa into multithreaded mode as soon as possible. Not really
    causing any problems now, but is cleaner.
* modules/gui/macosx/prefs.m:
  - Select the current setting when we create a combobox.
parent b4080ac4
...@@ -467,6 +467,7 @@ ...@@ -467,6 +467,7 @@
A0E6B59904407FBD0080DD97, A0E6B59904407FBD0080DD97,
8EDAC3440440F72D0059A3A7, 8EDAC3440440F72D0059A3A7,
8EE1AFA40444660F0059A3A7, 8EE1AFA40444660F0059A3A7,
8E9CC7B2046EFD700059A3A7,
); );
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -510,6 +511,7 @@ ...@@ -510,6 +511,7 @@
8EE1AFA30444660F0059A3A7, 8EE1AFA30444660F0059A3A7,
F69B0CA602E24F6401A80112, F69B0CA602E24F6401A80112,
8ED6C29D03E2F32E0059A3A7, 8ED6C29D03E2F32E0059A3A7,
8E9CC7B1046EFD700059A3A7,
8ED6C29E03E2F32E0059A3A7, 8ED6C29E03E2F32E0059A3A7,
A0E6B59804407FBD0080DD97, A0E6B59804407FBD0080DD97,
8EBF3FA303F13FFB0059A3A7, 8EBF3FA303F13FFB0059A3A7,
...@@ -671,6 +673,19 @@ ...@@ -671,6 +673,19 @@
settings = { settings = {
}; };
}; };
8E9CC7B1046EFD700059A3A7 = {
fileEncoding = 12;
isa = PBXFileReference;
name = THANKS;
path = ../../THANKS;
refType = 2;
};
8E9CC7B2046EFD700059A3A7 = {
fileRef = 8E9CC7B1046EFD700059A3A7;
isa = PBXBuildFile;
settings = {
};
};
8EBF3FA303F13FFB0059A3A7 = { 8EBF3FA303F13FFB0059A3A7 = {
isa = PBXFileReference; isa = PBXFileReference;
name = vlc.scriptSuite; name = vlc.scriptSuite;
...@@ -809,14 +824,14 @@ ...@@ -809,14 +824,14 @@
refType = 2; refType = 2;
}; };
8ED6C29D03E2F32E0059A3A7 = { 8ED6C29D03E2F32E0059A3A7 = {
fileEncoding = 30; fileEncoding = 12;
isa = PBXFileReference; isa = PBXFileReference;
name = AUTHORS; name = AUTHORS;
path = ../../AUTHORS; path = ../../AUTHORS;
refType = 2; refType = 2;
}; };
8ED6C29E03E2F32E0059A3A7 = { 8ED6C29E03E2F32E0059A3A7 = {
fileEncoding = 30; fileEncoding = 12;
isa = PBXFileReference; isa = PBXFileReference;
name = COPYING; name = COPYING;
path = ../../COPYING; path = ../../COPYING;
...@@ -1017,7 +1032,7 @@ ...@@ -1017,7 +1032,7 @@
}; };
}; };
A0E6B59804407FBD0080DD97 = { A0E6B59804407FBD0080DD97 = {
fileEncoding = 5; fileEncoding = 12;
isa = PBXFileReference; isa = PBXFileReference;
name = README; name = README;
path = Resources/README; path = Resources/README;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* about.h: MacOS X About Panel * about.h: MacOS X About Panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: about.h,v 1.1 2003/04/09 20:53:28 hartman Exp $ * $Id: about.h,v 1.2 2003/05/11 23:17:30 hartman Exp $
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* *
...@@ -34,11 +34,13 @@ ...@@ -34,11 +34,13 @@
NSTimer *o_scroll_timer; NSTimer *o_scroll_timer;
float f_current; float f_current;
float f_end;
NSTimeInterval i_start; NSTimeInterval i_start;
BOOL b_restart; BOOL b_restart;
NSString *o_credits_path; NSString *o_credits_path;
NSString *o_credits; NSString *o_credits;
NSString *o_thanks;
NSString *o_name_version; NSString *o_name_version;
NSString *o_copyright; NSString *o_copyright;
NSDictionary *o_info_dict; NSDictionary *o_info_dict;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* about.m: MacOS X About Panel * about.m: MacOS X About Panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: about.m,v 1.1 2003/04/09 20:53:28 hartman Exp $ * $Id: about.m,v 1.2 2003/05/11 23:17:30 hartman Exp $
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* *
...@@ -56,33 +56,34 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -56,33 +56,34 @@ static VLAboutBox *_o_sharedInstance = nil;
{ {
NSString *o_name; NSString *o_name;
NSString *o_version; NSString *o_version;
NSString *o_thanks_path;
// Get the info dictionary (Info.plist) /* Get the info dictionary (Info.plist) */
o_info_dict = [[NSBundle mainBundle] infoDictionary]; o_info_dict = [[NSBundle mainBundle] infoDictionary];
// Get the localized info dictionary (InfoPlist.strings) /* Get the localized info dictionary (InfoPlist.strings) */
localInfoBundle = CFBundleGetMainBundle(); localInfoBundle = CFBundleGetMainBundle();
o_local_dict = (NSDictionary *) o_local_dict = (NSDictionary *)
CFBundleGetLocalInfoDictionary( localInfoBundle ); CFBundleGetLocalInfoDictionary( localInfoBundle );
// Setup the app name field /* Setup the name field */
o_name = [o_local_dict objectForKey:@"CFBundleName"]; o_name = [o_local_dict objectForKey:@"CFBundleName"];
// Set the about box window title /* Set the about box title */
[o_about_window setTitle:_NS("About VLC media player")]; [o_about_window setTitle:_NS("About VLC media player")];
// Setup the version field /* Setup the version field */
o_version = [o_info_dict objectForKey:@"CFBundleVersion"]; o_version = [o_info_dict objectForKey:@"CFBundleVersion"];
// Setup the appnameversion field /* Setup the nameversion field */
o_name_version = [NSString stringWithFormat:@"%@ - Version %@", o_name, o_version]; o_name_version = [NSString stringWithFormat:@"%@ - Version %@", o_name, o_version];
[o_name_version_field setStringValue: o_name_version]; [o_name_version_field setStringValue: o_name_version];
// Setup our credits /* Setup our credits */
o_credits_path = [[NSBundle mainBundle] pathForResource:@"AUTHORS" ofType:nil]; o_credits_path = [[NSBundle mainBundle] pathForResource:@"AUTHORS" ofType:nil];
o_credits = [NSString stringWithContentsOfFile: o_credits_path ]; o_credits = [[NSString alloc] initWithData: [NSData dataWithContentsOfFile: o_credits_path ] encoding:NSWindowsCP1252StringEncoding];
// Parse the string /* Parse the authors string */
NSMutableString *o_outString = [NSMutableString string]; NSMutableString *o_outString = [NSMutableString string];
NSScanner *o_scan_credits = [NSScanner scannerWithString: o_credits]; NSScanner *o_scan_credits = [NSScanner scannerWithString: o_credits];
NSCharacterSet *o_stopSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r"]; NSCharacterSet *o_stopSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r"];
...@@ -119,14 +120,33 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -119,14 +120,33 @@ static VLAboutBox *_o_sharedInstance = nil;
} }
[o_outString appendFormat: @"%@ <%@>\n%@\n\n", o_name, o_email, o_jobs]; [o_outString appendFormat: @"%@ <%@>\n%@\n\n", o_name, o_email, o_jobs];
[o_credits_textview setString:o_outString];
} }
// Setup the copyright field /* Parse the thanks string */
o_thanks_path = [[NSBundle mainBundle] pathForResource:@"THANKS" ofType:nil];
o_thanks = [[NSString alloc] initWithData: [NSData dataWithContentsOfFile:
o_thanks_path ] encoding:NSWindowsCP1252StringEncoding];
NSScanner *o_scan_thanks = [NSScanner scannerWithString: o_thanks];
[o_scan_thanks scanUpToCharactersFromSet: o_stopSet intoString: nil];
while( ![o_scan_thanks isAtEnd] )
{
NSString *o_person;
NSString *o_job;
[o_scan_thanks scanUpToString:@" - " intoString: &o_person];
[o_scan_thanks scanString:@" - " intoString: nil];
[o_scan_thanks scanUpToCharactersFromSet: o_stopSet intoString: &o_job];
[o_outString appendFormat: @"%@\n%@\n\n", o_person, o_job];
}
[o_credits_textview setString:o_outString];
/* Setup the copyright field */
o_copyright = [o_local_dict objectForKey:@"NSHumanReadableCopyright"]; o_copyright = [o_local_dict objectForKey:@"NSHumanReadableCopyright"];
[o_copyright_field setStringValue:o_copyright]; [o_copyright_field setStringValue:o_copyright];
// Setup the window /* Setup the window */
[o_credits_textview setDrawsBackground: NO]; [o_credits_textview setDrawsBackground: NO];
[o_credits_scrollview setDrawsBackground: NO]; [o_credits_scrollview setDrawsBackground: NO];
[o_about_window setExcludedFromWindowsMenu:YES]; [o_about_window setExcludedFromWindowsMenu:YES];
...@@ -134,7 +154,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -134,7 +154,7 @@ static VLAboutBox *_o_sharedInstance = nil;
[o_about_window center]; [o_about_window center];
} }
// Show the window /* Show the window */
b_restart = YES; b_restart = YES;
[o_about_window makeKeyAndOrderFront:nil]; [o_about_window makeKeyAndOrderFront:nil];
} }
...@@ -157,19 +177,26 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -157,19 +177,26 @@ static VLAboutBox *_o_sharedInstance = nil;
{ {
if (b_restart) if (b_restart)
{ {
// Reset the startTime /* Reset the starttime */
i_start = [NSDate timeIntervalSinceReferenceDate] + 3.0; i_start = [NSDate timeIntervalSinceReferenceDate] + 3.0;
f_current = 0; f_current = 0;
f_end = [o_credits_textview bounds].size.height - [o_credits_scrollview bounds].size.height;
b_restart = NO; b_restart = NO;
} }
if ([NSDate timeIntervalSinceReferenceDate] >= i_start) if ([NSDate timeIntervalSinceReferenceDate] >= i_start)
{ {
// Scroll to the position /* Scroll to the position */
[o_credits_textview scrollPoint:NSMakePoint( 0, f_current )]; [o_credits_textview scrollPoint:NSMakePoint( 0, f_current )];
// Increment the scroll position /* Increment the scroll position */
f_current += 0.005; f_current += 0.005;
/* If at end, restart at the top */
if ( f_current >= f_end )
{
b_restart = YES;
}
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin * intf.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.80 2003/05/11 19:09:51 hartman Exp $ * $Id: intf.m,v 1.81 2003/05/11 23:17:30 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -55,14 +55,19 @@ int E_(OpenIntf) ( vlc_object_t *p_this ) ...@@ -55,14 +55,19 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
} }
memset( p_intf->p_sys, 0, sizeof( *p_intf->p_sys ) ); memset( p_intf->p_sys, 0, sizeof( *p_intf->p_sys ) );
p_intf->p_sys->o_pool = [[NSAutoreleasePool alloc] init]; p_intf->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
/* Put Cocoa into multithread mode as soon as possible.
* http://developer.apple.com/techpubs/macosx/Cocoa/
* TasksAndConcepts/ProgrammingTopics/Multithreading/index.html
* This thread does absolutely nothing at all. */
[NSThread detachNewThreadSelector:@selector(self) toTarget:[NSString string] withObject:nil];
p_intf->p_sys->o_sendport = [[NSPort port] retain]; p_intf->p_sys->o_sendport = [[NSPort port] retain];
p_intf->p_sys->p_sub = msg_Subscribe( p_intf ); p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
p_intf->pf_run = Run; p_intf->pf_run = Run;
[[VLCApplication sharedApplication] autorelease]; [[VLCApplication sharedApplication] autorelease];
[NSApp initIntlSupport]; [NSApp initIntlSupport];
[NSApp setIntf: p_intf]; [NSApp setIntf: p_intf];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* prefs.m: MacOS X plugin for vlc * prefs.m: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.m,v 1.20 2003/05/09 01:19:43 hartman Exp $ * $Id: prefs.m,v 1.21 2003/05/11 23:17:30 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -475,6 +475,15 @@ ...@@ -475,6 +475,15 @@
free( psz_duptip ); free( psz_duptip );
} }
[o_view addSubview: [o_combo_box autorelease]]; [o_view addSubview: [o_combo_box autorelease]];
for( i=0; p_item->ppsz_list[i]; i++ )
{
[o_combo_box addItemWithObjectValue:
[NSString stringWithCString: p_item->ppsz_list[i]]];
}
[o_combo_box setStringValue: [NSString stringWithCString:
p_item->psz_value ? p_item->psz_value : ""]];
[[NSNotificationCenter defaultCenter] addObserver: self [[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(configChanged:) selector: @selector(configChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
...@@ -484,12 +493,6 @@ ...@@ -484,12 +493,6 @@
name: NSComboBoxSelectionDidChangeNotification name: NSComboBoxSelectionDidChangeNotification
object: o_combo_box]; object: o_combo_box];
for( i=0; p_item->ppsz_list[i]; i++ )
{
[o_combo_box addItemWithObjectValue:
[NSString stringWithCString: p_item->ppsz_list[i]]];
}
CONTROL_LABEL( p_item->psz_text ); CONTROL_LABEL( p_item->psz_text );
s_rc.origin.y += s_rc.size.height; s_rc.origin.y += s_rc.size.height;
......
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