Commit cd19d6a4 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* collection of various fixes and edits

    - removed <10.3 support in the preferences' code
    - added preliminary support for Obj-C 2.0 / Garbage Collection
        - needs to be enabled manually in intf.h for now and is restricted to future Darwin release
    - updated various copyright dates to approbate values
    - configured the source tree in the Xcode project for future Xcode releases
    - finally renamed the Xcode project to the correct bundle extension
parent b181bb11
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
showBookmarks = id; showBookmarks = id;
showExtended = id; showExtended = id;
showMessagesPanel = id; showMessagesPanel = id;
showOrHidePlaylistColumns = id;
showSFilters = id; showSFilters = id;
showWizard = id; showWizard = id;
timesliderUpdate = id; timesliderUpdate = id;
...@@ -324,6 +325,7 @@ ...@@ -324,6 +325,7 @@
"o_mu_ffmpeg_pp" = id; "o_mu_ffmpeg_pp" = id;
"o_mu_file" = id; "o_mu_file" = id;
"o_mu_help" = id; "o_mu_help" = id;
"o_mu_plcolumns" = id;
"o_mu_program" = id; "o_mu_program" = id;
"o_mu_screen" = id; "o_mu_screen" = id;
"o_mu_subtitle" = id; "o_mu_subtitle" = id;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>647 66 478 430 0 0 1440 878 </string> <string>555 99 478 430 0 0 1440 878 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key> <key>1617</key>
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
<array/> <array/>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>2416</integer>
<integer>29</integer>
<integer>2769</integer> <integer>2769</integer>
<integer>29</integer>
<integer>2197</integer>
<integer>2730</integer> <integer>2730</integer>
<integer>2416</integer>
<integer>21</integer> <integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
......
...@@ -1292,9 +1292,12 @@ ...@@ -1292,9 +1292,12 @@
089C1669FE841209C02AAC07 /* Project object */ = { 089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
buildConfigurationList = C2F2A6EA09588F1B00018C74 /* Build configuration list for PBXProject "vlc" */; buildConfigurationList = C2F2A6EA09588F1B00018C74 /* Build configuration list for PBXProject "vlc" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1; hasScannedForEncodings = 1;
mainGroup = 089C166AFE841209C02AAC07 /* vlc */; mainGroup = 089C166AFE841209C02AAC07 /* vlc */;
projectDirPath = ""; projectDirPath = "";
projectRoot = ../..;
shouldCheckCompatibility = 1;
targets = ( targets = (
089C1673FE841209C02AAC07 /* vlc */, 089C1673FE841209C02AAC07 /* vlc */,
); );
......
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
***************************************************************************** *****************************************************************************
* *
* Note that changes made by any members or contributors of the VideoLAN team * Note that changes made by any members or contributors of the VideoLAN team
* (i.e. changes that were checked in into one of VideoLAN's source code * (i.e. changes that were checked in exclusively into one of VideoLAN's source code
* repositories) are licensed under the GNU General Public License version 2, * repositories) are licensed under the GNU General Public License version 2,
* or (at your option) any later version. * or (at your option) any later version.
* Thus, the following statements apply to our changes: * Thus, the following statements apply to our changes:
* *
* Copyright (C) 2006 the VideoLAN team * Copyright (C) 2006-2007 the VideoLAN team
* Authors: Eric Petit <titer@m0k.org> * Authors: Eric Petit <titer@m0k.org>
* Felix Kühne <fkuehne at videolan dot org> * Felix Kühne <fkuehne at videolan dot org>
* *
......
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
***************************************************************************** *****************************************************************************
* *
* Note that changes made by any members or contributors of the VideoLAN team * Note that changes made by any members or contributors of the VideoLAN team
* (i.e. changes that were checked in to one of VideoLAN's source code * (i.e. changes that were exclusively checked in to one of VideoLAN's source code
* repositories) are licensed under the GNU General Public License version 2, * repositories) are licensed under the GNU General Public License version 2,
* or (at your option) any later version. * or (at your option) any later version.
* Thus, the following statements apply to our changes: * Thus, the following statements apply to our changes:
* *
* Copyright (C) 2006 the VideoLAN team * Copyright (C) 2006-2007 the VideoLAN team
* Authors: Eric Petit <titer@m0k.org> * Authors: Eric Petit <titer@m0k.org>
* Felix Kühne <fkuehne at videolan dot org> * Felix Kühne <fkuehne at videolan dot org>
* *
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
#import "AppleRemote.h" #import "AppleRemote.h"
/* this was added by the VideoLAN team to ensure Leopard-compatibility and is VLC-only */
#import "intf.h"
const char* AppleRemoteDeviceName = "AppleIRController"; const char* AppleRemoteDeviceName = "AppleIRController";
const int REMOTE_SWITCH_COOKIE=19; const int REMOTE_SWITCH_COOKIE=19;
const NSTimeInterval DEFAULT_MAXIMUM_CLICK_TIME_DIFFERENCE=0.35; const NSTimeInterval DEFAULT_MAXIMUM_CLICK_TIME_DIFFERENCE=0.35;
...@@ -95,6 +98,15 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4; ...@@ -95,6 +98,15 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
[super dealloc]; [super dealloc];
} }
/* this was added by the VideoLAN team to ensure Leopard-compatibility and is VLC-only */
#if GC_ENABLED
- (void)finalize
{
[self stopListening: self];
[super finalize];
}
#endif
- (int) remoteId { - (int) remoteId {
return remoteId; return remoteId;
} }
......
/***************************************************************************** /*****************************************************************************
* about.m: MacOS X About Panel * about.m: MacOS X About Panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2005 the VideoLAN team * Copyright (C) 2001-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
......
/***************************************************************************** /*****************************************************************************
* bookmarks.m: MacOS X Bookmarks window * bookmarks.m: MacOS X Bookmarks window
***************************************************************************** *****************************************************************************
* Copyright (C) 2005, 2006 the VideoLAN team * Copyright (C) 2005 - 2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Felix Kühne <fkuehne@users.sf.net> * Authors: Felix Kühne <fkuehne@users.sf.net>
...@@ -78,12 +78,20 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -78,12 +78,20 @@ static VLCBookmarks *_o_sharedInstance = nil;
- (void)dealloc - (void)dealloc
{ {
if( p_old_input ) if( p_old_input )
{
vlc_object_release( p_old_input ); vlc_object_release( p_old_input );
}
[super dealloc]; [super dealloc];
} }
#if GC_ENABLED
- (void)finalize
{
/* release old input even if GC is enabled on 10.5 */
if( p_old_input )
vlc_object_release( p_old_input );
[super finalize];
}
#endif
- (void)initStrings - (void)initStrings
{ {
/* localise the items */ /* localise the items */
...@@ -253,9 +261,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -253,9 +261,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
i = [o_tbl_dataTable selectedRow]; i = [o_tbl_dataTable selectedRow];
if( pp_bookmarks[i]->psz_name ) if( pp_bookmarks[i]->psz_name )
{
free( pp_bookmarks[i]->psz_name ); free( pp_bookmarks[i]->psz_name );
}
pp_bookmarks[i]->psz_name = strdup([[o_edit_fld_name stringValue] UTF8String]); pp_bookmarks[i]->psz_name = strdup([[o_edit_fld_name stringValue] UTF8String]);
pp_bookmarks[i]->i_byte_offset = [[o_edit_fld_bytes stringValue] intValue]; pp_bookmarks[i]->i_byte_offset = [[o_edit_fld_bytes stringValue] intValue];
...@@ -354,10 +360,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -354,10 +360,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
(input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT, (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( !p_input ) if( !p_input ) return;
{
return;
}
input_Control( p_input, INPUT_SET_BOOKMARK, [o_tbl_dataTable selectedRow] ); input_Control( p_input, INPUT_SET_BOOKMARK, [o_tbl_dataTable selectedRow] );
...@@ -375,10 +378,9 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -375,10 +378,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
if( !p_input ) return; if( !p_input ) return;
int i_focused = [o_tbl_dataTable selectedRow]; int i_focused = [o_tbl_dataTable selectedRow];
if( i_focused >= 0 ) if( i_focused >= 0 )
{
input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused ); input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused );
}
vlc_object_release( p_input ); vlc_object_release( p_input );
...@@ -407,10 +409,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -407,10 +409,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
seekpoint_t **pp_bookmarks; seekpoint_t **pp_bookmarks;
int i_bookmarks; int i_bookmarks;
if( !p_input ) if( !p_input ) return 0;
{
return 0;
}
else if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, else if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks,
&i_bookmarks ) != VLC_SUCCESS ) &i_bookmarks ) != VLC_SUCCESS )
{ {
...@@ -435,10 +434,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -435,10 +434,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
char *toBeReturned; char *toBeReturned;
int i_toBeReturned = 0; int i_toBeReturned = 0;
if( !p_input ) if( !p_input ) return @"";
{
return @"";
}
else if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, else if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks,
&i_bookmarks ) != VLC_SUCCESS ) &i_bookmarks ) != VLC_SUCCESS )
{ {
...@@ -468,11 +464,10 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -468,11 +464,10 @@ static VLCBookmarks *_o_sharedInstance = nil;
} }
else else
{ {
/* may not happen, but just in case */ /* may not happen, just in case */
vlc_object_release( p_input ); vlc_object_release( p_input );
msg_Err(p_intf, "unknown table column identifier (%s) while " msg_Err(p_intf, "unknown table column identifier (%s) while "
"updating the bookmark table", [[theTableColumn identifier] "updating the bookmark table", [[theTableColumn identifier]
UTF8String] ); UTF8String] );
return @"unknown identifier"; return @"unknown identifier";
} }
......
/***************************************************************************** /*****************************************************************************
* equalizer.h: MacOS X interface module * equalizer.h: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2004 the VideoLAN team * Copyright (C) 2004-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jérôme Decoodt <djc@videolan.org> * Authors: Jérôme Decoodt <djc@videolan.org>
......
/***************************************************************************** /*****************************************************************************
* equalizer.m: MacOS X interface module * equalizer.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2004 the VideoLAN team * Copyright (C) 2004-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jerome Decoodt <djc@videolan.org> * Authors: Jerome Decoodt <djc@videolan.org>
......
/***************************************************************************** /*****************************************************************************
* fspanel.h: MacOS X full screen panel * fspanel.h: MacOS X full screen panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2006 the VideoLAN team * Copyright (C) 2006-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jrme Decoodt <djc at videolan dot org> * Authors: Jrme Decoodt <djc at videolan dot org>
......
/***************************************************************************** /*****************************************************************************
* fspanel.m: MacOS X full screen panel * fspanel.m: MacOS X full screen panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2006 the VideoLAN team * Copyright (C) 2006-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jrme Decoodt <djc at videolan dot org> * Authors: Jrme Decoodt <djc at videolan dot org>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#import "vout.h" #import "vout.h"
#import "fspanel.h" #import "fspanel.h"
#define KEEP_VISIBLE_AFTER_ACTION 4 /* time in half-sec until this panel will hide again after an user's action */ #define KEEP_VISIBLE_AFTER_ACTION 4 /* time in half-sec until this panel will hide again after a user's action */
/***************************************************************************** /*****************************************************************************
* VLCFSPanel * VLCFSPanel
...@@ -92,6 +92,17 @@ ...@@ -92,6 +92,17 @@
return YES; return YES;
} }
#if GC_ENABLED
- (void)finalize
{
/* dealloc isn't called on 10.5 in case that GC is enabled, so we need to provide the functionality here */
[[NSNotificationCenter defaultCenter] removeObserver: self];
[self setFadeTimer:nil];
[super finalize];
}
#endif
-(void)dealloc -(void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self]; [[NSNotificationCenter defaultCenter] removeObserver: self];
......
/***************************************************************************** /*****************************************************************************
* interaction.h: Mac OS X interaction dialogs * interaction.h: Mac OS X interaction dialogs
***************************************************************************** *****************************************************************************
* Copyright (C) 2005-2006 the VideoLAN team * Copyright (C) 2005-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Derk-Jan Hartman <hartman at videolan dot org> * Authors: Derk-Jan Hartman <hartman at videolan dot org>
...@@ -94,6 +94,16 @@ ...@@ -94,6 +94,16 @@
return o_error_panel; return o_error_panel;
} }
#if GC_ENABLED
-(void)finalize
{
/* dealloc doesn't get called on 10.5 if GC is enabled, so we need to provide the basic functionality here */
[[NSNotificationCenter defaultCenter] removeObserver:self];
[o_interaction_list removeAllObjects];
[super finalize];
}
#endif
-(void)dealloc -(void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
......
...@@ -51,6 +51,9 @@ unsigned int CocoaKeyToVLC( unichar i_key ); ...@@ -51,6 +51,9 @@ unsigned int CocoaKeyToVLC( unichar i_key );
@"/System/Library/CoreServices/SystemVersion.plist"] \ @"/System/Library/CoreServices/SystemVersion.plist"] \
objectForKey: @"ProductVersion"] floatValue] objectForKey: @"ProductVersion"] floatValue]
/* switch this to 1, if you want to use Obj-C with GC */
#define GC_ENABLED 0
/***************************************************************************** /*****************************************************************************
* intf_sys_t: description and status of the interface * intf_sys_t: description and status of the interface
*****************************************************************************/ *****************************************************************************/
...@@ -315,6 +318,7 @@ struct intf_sys_t ...@@ -315,6 +318,7 @@ struct intf_sys_t
- (void)manage; - (void)manage;
- (void)manageIntf:(NSTimer *)o_timer; - (void)manageIntf:(NSTimer *)o_timer;
- (void)setupMenus; - (void)setupMenus;
- (void)refreshVoutDeviceMenu:(NSNotification *)o_notification;
- (void)setScrollField:(NSString *)o_string stopAfter:(int )timeout; - (void)setScrollField:(NSString *)o_string stopAfter:(int )timeout;
- (void)resetScrollField; - (void)resetScrollField;
......
/***************************************************************************** /*****************************************************************************
* intf.m: MacOS X interface module * intf.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2006 the VideoLAN team * Copyright (C) 2002-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -483,6 +483,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -483,6 +483,11 @@ static VLCMain *_o_sharedMainInstance = nil;
/* update the playmode stuff */ /* update the playmode stuff */
p_intf->p_sys->b_playmode_update = VLC_TRUE; p_intf->p_sys->b_playmode_update = VLC_TRUE;
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(refreshVoutDeviceMenu:)
name: NSApplicationDidChangeScreenParametersNotification
object: nil];
nib_main_loaded = TRUE; nib_main_loaded = TRUE;
} }
...@@ -1335,6 +1340,32 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1335,6 +1340,32 @@ static VLCMain *_o_sharedMainInstance = nil;
#undef p_input #undef p_input
} }
- (void)refreshVoutDeviceMenu:(NSNotification *)o_notification
{
int x,y = 0;
vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if(! p_vout )
return;
/* clean the menu before adding new entries */
if( [o_mi_screen hasSubmenu] )
{
y = [[o_mi_screen submenu] numberOfItems] - 1;
msg_Dbg( VLCIntf, "%i items in submenu", y );
while( x != y )
{
msg_Dbg( VLCIntf, "removing item %i of %i", x, y );
[[o_mi_screen submenu] removeItemAtIndex: x];
x++;
}
}
[o_controls setupVarMenuItem: o_mi_screen target: (vlc_object_t *)p_vout
var: "video-device" selector: @selector(toggleVar:)];
}
- (void)setScrollField:(NSString *)o_string stopAfter:(int)timeout - (void)setScrollField:(NSString *)o_string stopAfter:(int)timeout
{ {
if( timeout != -1 ) if( timeout != -1 )
...@@ -1572,6 +1603,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1572,6 +1603,11 @@ static VLCMain *_o_sharedMainInstance = nil;
p_intf->b_interaction = VLC_FALSE; p_intf->b_interaction = VLC_FALSE;
var_DelCallback( p_intf, "interaction", InteractCallback, self ); var_DelCallback( p_intf, "interaction", InteractCallback, self );
/* remove global observer watching for vout device changes correctly */
[[NSNotificationCenter defaultCenter] removeObserver: self
name: NSApplicationDidChangeScreenParametersNotification
object: nil];
/* release some other objects here, because it isn't sure whether dealloc /* release some other objects here, because it isn't sure whether dealloc
* will be called later on -- FK (10/6/05) */ * will be called later on -- FK (10/6/05) */
......
/***************************************************************************** /*****************************************************************************
* macosx.m: Mac OS X module for vlc * macosx.m: Mac OS X module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2005 the VideoLAN team * Copyright (C) 2001-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
......
/***************************************************************************** /*****************************************************************************
* misc.m: code not specific to vlc * misc.m: code not specific to vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2003-2005 the VideoLAN team * Copyright (C) 2003-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -67,6 +67,15 @@ ...@@ -67,6 +67,15 @@
[super dealloc]; [super dealloc];
} }
#if GC_ENABLED
- (void)finalize
{
/* dealloc doesn't get called on 10.5 if GC is enabled, so we need to provide the basic functionality here */
[self unregisterDraggedTypes];
[super finalize];
}
#endif
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType, [self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType,
...@@ -145,6 +154,15 @@ ...@@ -145,6 +154,15 @@
[super dealloc]; [super dealloc];
} }
#if GC_ENABLED
- (void)finalize
{
/* dealloc doesn't get called on 10.5 if GC is enabled, so we need to provide the basic functionality here */
[self unregisterDraggedTypes];
[super finalize];
}
#endif
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType, [self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType,
......
/***************************************************************************** /*****************************************************************************
* output.h: MacOS X Output Dialog * output.h: MacOS X Output Dialog
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 the VideoLAN team * Copyright (C) 2002-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
......
/***************************************************************************** /*****************************************************************************
* output.m: MacOS X Output Dialog * output.m: MacOS X Output Dialog
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 the VideoLAN team * Copyright (C) 2002-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
......
/***************************************************************************** /*****************************************************************************
r playlistinfo.m: MacOS X interface module r playlistinfo.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2006 the VideoLAN team * Copyright (C) 2002-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Benjamin Pracht <bigben at videolan dot org> * Authors: Benjamin Pracht <bigben at videolan dot org>
...@@ -111,6 +111,16 @@ ...@@ -111,6 +111,16 @@
[super dealloc]; [super dealloc];
} }
#if GC_ENABLED
- (void)finalize
{
/* since dealloc isn't called with enabled GC on 10.5, we need this to prevent core crashes */
if( [o_statUpdateTimer isValid] )
[o_statUpdateTimer invalidate];
[super finalize];
}
#endif
- (IBAction)togglePlaylistInfoPanel:(id)sender - (IBAction)togglePlaylistInfoPanel:(id)sender
{ {
if( [o_info_window isVisible] ) if( [o_info_window isVisible] )
......
/***************************************************************************** /*****************************************************************************
* prefs_widgets.h: Preferences controls * prefs_widgets.h: Preferences controls
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 the VideoLAN team * Copyright (C) 2002-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Derk-Jan Hartman <hartman at videolan.org> * Authors: Derk-Jan Hartman <hartman at videolan.org>
...@@ -183,21 +183,7 @@ static NSMenu *o_keys_menu = nil; ...@@ -183,21 +183,7 @@ static NSMenu *o_keys_menu = nil;
@end @end
@interface KeyConfigControlBefore103 : VLCConfigControl @interface KeyConfigControl : VLCConfigControl
{
NSButton *o_cmd_checkbox;
NSButton *o_ctrl_checkbox;
NSButton *o_alt_checkbox;
NSButton *o_shift_checkbox;
NSPopUpButton *o_popup;
}
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view;
@end
@interface KeyConfigControlAfter103 : VLCConfigControl
{ {
NSPopUpButton *o_popup; NSPopUpButton *o_popup;
} }
......
/***************************************************************************** /*****************************************************************************
* prefs_widgets.m: Preferences controls * prefs_widgets.m: Preferences controls
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 the VideoLAN team * Copyright (C) 2002-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Derk-Jan Hartman <hartman at videolan.org> * Authors: Derk-Jan Hartman <hartman at videolan.org>
...@@ -51,13 +51,10 @@ ...@@ -51,13 +51,10 @@
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
0]; \ 0]; \
if( MACOS_VERSION >= 10.3 ) \
[o_mi setAlternate: NO]; \ [o_mi setAlternate: NO]; \
[o_mi setTag: \ [o_mi setTag: \
( value )]; \ ( value )]; \
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
if( MACOS_VERSION >= 10.3 ) \
{ \
/* Ctrl */ \ /* Ctrl */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [[NSString stringWithUTF8String: \
...@@ -245,7 +242,6 @@ if( MACOS_VERSION >= 10.3 ) \ ...@@ -245,7 +242,6 @@ if( MACOS_VERSION >= 10.3 ) \
[o_mi setTag: \ [o_mi setTag: \
KEY_MODIFIER_COMMAND | ( value )]; \ KEY_MODIFIER_COMMAND | ( value )]; \
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
} \
} }
#define ADD_LABEL( o_label, superFrame, x_offset, my_y_offset, label ) \ #define ADD_LABEL( o_label, superFrame, x_offset, my_y_offset, label ) \
...@@ -413,6 +409,16 @@ if( MACOS_VERSION >= 10.3 ) \ ...@@ -413,6 +409,16 @@ if( MACOS_VERSION >= 10.3 ) \
[self setFrame:frame]; [self setFrame:frame];
} }
#if GC_ENABLED
- (void)finalize
{
/* since dealloc isn't called on 10.5 if GC is enabled and since GC is
* Obj-C only, we need to do this: */
if( psz_name ) free( psz_name );
[super finalize];
}
#endif
- (void)dealloc - (void)dealloc
{ {
if( o_label ) [o_label release]; if( o_label ) [o_label release];
...@@ -890,18 +896,9 @@ if( MACOS_VERSION >= 10.3 ) \ ...@@ -890,18 +896,9 @@ if( MACOS_VERSION >= 10.3 ) \
} }
break; break;
case CONFIG_ITEM_KEY: case CONFIG_ITEM_KEY:
if( MACOS_VERSION < 10.3 ) p_control = [[KeyConfigControl alloc]
{
p_control = [[KeyConfigControlBefore103 alloc]
initWithItem: _p_item
withView: o_parent_view];
}
else
{
p_control = [[KeyConfigControlAfter103 alloc]
initWithItem: _p_item initWithItem: _p_item
withView: o_parent_view]; withView: o_parent_view];
}
break; break;
case CONFIG_ITEM_MODULE_LIST: case CONFIG_ITEM_MODULE_LIST:
case CONFIG_ITEM_MODULE_LIST_CAT: case CONFIG_ITEM_MODULE_LIST_CAT:
...@@ -1974,155 +1971,7 @@ if( MACOS_VERSION >= 10.3 ) \ ...@@ -1974,155 +1971,7 @@ if( MACOS_VERSION >= 10.3 ) \
@end @end
@implementation KeyConfigControlBefore103 @implementation KeyConfigControl
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
{
NSRect mainFrame = [o_parent_view frame];
NSString *o_labelString, *o_tooltip;
mainFrame.size.height = 37;
mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
mainFrame.origin.x = LEFTMARGIN;
mainFrame.origin.y = 0;
if( [super initWithFrame: mainFrame item: _p_item] != nil )
{
i_view_type = CONFIG_ITEM_KEY_BEFORE_10_3;
/* add the label */
if( p_item->psz_text )
o_labelString = [[VLCMain sharedInstance]
localizedString: (char *)p_item->psz_text];
else
o_labelString = [NSString stringWithString:@""];
ADD_LABEL( o_label, mainFrame, 0, -10, o_labelString )
[o_label setAutoresizingMask:NSViewNotSizable ];
[self addSubview: o_label];
/* add the checkboxes */
o_tooltip = [[VLCMain sharedInstance] wrapString:
[[VLCMain sharedInstance]
localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
ADD_CHECKBOX( o_cmd_checkbox, mainFrame,
[o_label frame].size.width + 2, 0,
[NSString stringWithUTF8String:PLACE_OF_INTEREST_SIGN], o_tooltip,
((((unsigned int)p_item->value.i) & KEY_MODIFIER_COMMAND)?YES:NO),
NSImageLeft )
[o_cmd_checkbox setState: p_item->value.i & KEY_MODIFIER_COMMAND];
ADD_CHECKBOX( o_ctrl_checkbox, mainFrame,
[o_cmd_checkbox frame].size.width +
[o_cmd_checkbox frame].origin.x + 6, 0,
[NSString stringWithUTF8String:UP_ARROWHEAD], o_tooltip,
((((unsigned int)p_item->value.i) & KEY_MODIFIER_CTRL)?YES:NO),
NSImageLeft )
[o_ctrl_checkbox setState: p_item->value.i & KEY_MODIFIER_CTRL];
ADD_CHECKBOX( o_alt_checkbox, mainFrame, [o_label frame].size.width +
2, -2 - [o_cmd_checkbox frame].size.height,
[NSString stringWithUTF8String:OPTION_KEY], o_tooltip,
((((unsigned int)p_item->value.i) & KEY_MODIFIER_ALT)?YES:NO),
NSImageLeft )
[o_alt_checkbox setState: p_item->value.i & KEY_MODIFIER_ALT];
ADD_CHECKBOX( o_shift_checkbox, mainFrame,
[o_cmd_checkbox frame].size.width +
[o_cmd_checkbox frame].origin.x + 6, -2 -
[o_cmd_checkbox frame].size.height,
[NSString stringWithUTF8String:UPWARDS_WHITE_ARROW], o_tooltip,
((((unsigned int)p_item->value.i) & KEY_MODIFIER_SHIFT)?YES:NO),
NSImageLeft )
[o_shift_checkbox setState: p_item->value.i & KEY_MODIFIER_SHIFT];
[self addSubview: o_cmd_checkbox];
[self addSubview: o_ctrl_checkbox];
[self addSubview: o_alt_checkbox];
[self addSubview: o_shift_checkbox];
/* build the popup */
ADD_POPUP( o_popup, mainFrame, [o_shift_checkbox frame].origin.x +
[o_shift_checkbox frame].size.width + 4,
4, 0, o_tooltip )
[o_popup setAutoresizingMask:NSViewWidthSizable ];
if( o_keys_menu == nil )
{
unsigned int i;
o_keys_menu = [[NSMenu alloc] initWithTitle: @"Keys Menu"];
for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++)
if( vlc_keys[i].psz_key_string && *vlc_keys[i].psz_key_string )
POPULATE_A_KEY( o_keys_menu,
[NSString stringWithCString:vlc_keys[i].psz_key_string]
, vlc_keys[i].i_key_code)
}
[o_popup setMenu:[o_keys_menu copyWithZone:nil]];
[o_popup selectItemWithTitle: [[VLCMain sharedInstance]
localizedString:(char *)KeyToString(
(((unsigned int)p_item->value.i) & ~KEY_MODIFIER ))]];
[self addSubview: o_popup];
}
return self;
}
- (void) alignWithXPosition:(int)i_xPos
{
NSRect frame;
NSRect superFrame = [self frame];
frame = [o_label frame];
frame.origin.x = i_xPos - frame.size.width - 3;
[o_label setFrame:frame];
frame = [o_cmd_checkbox frame];
frame.origin.x = i_xPos;
[o_cmd_checkbox setFrame:frame];
frame = [o_ctrl_checkbox frame];
frame.origin.x = [o_cmd_checkbox frame].size.width +
[o_cmd_checkbox frame].origin.x + 4;
[o_ctrl_checkbox setFrame:frame];
frame = [o_alt_checkbox frame];
frame.origin.x = i_xPos;
[o_alt_checkbox setFrame:frame];
frame = [o_shift_checkbox frame];
frame.origin.x = [o_cmd_checkbox frame].size.width +
[o_cmd_checkbox frame].origin.x + 4;
[o_shift_checkbox setFrame:frame];
frame = [o_popup frame];
frame.origin.x = [o_shift_checkbox frame].origin.x +
[o_shift_checkbox frame].size.width + 3;
frame.size.width = superFrame.size.width - frame.origin.x + 2;
[o_popup setFrame:frame];
}
- (void)dealloc
{
[o_cmd_checkbox release];
[o_ctrl_checkbox release];
[o_alt_checkbox release];
[o_shift_checkbox release];
[o_popup release];
[super dealloc];
}
- (int)intValue
{
unsigned int i_new_key = 0;
i_new_key |= ([o_cmd_checkbox state] == NSOnState) ?
KEY_MODIFIER_COMMAND : 0;
i_new_key |= ([o_ctrl_checkbox state] == NSOnState) ?
KEY_MODIFIER_CTRL : 0;
i_new_key |= ([o_alt_checkbox state] == NSOnState) ?
KEY_MODIFIER_ALT : 0;
i_new_key |= ([o_shift_checkbox state] == NSOnState) ?
KEY_MODIFIER_SHIFT : 0;
i_new_key |= StringToKey((char *)[[[o_popup selectedItem] title] cString]);
return i_new_key;
}
@end
@implementation KeyConfigControlAfter103
- (id) initWithItem: (module_config_t *)_p_item - (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view withView: (NSView *)o_parent_view
{ {
...@@ -2298,13 +2147,11 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST ) ...@@ -2298,13 +2147,11 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
o_scrollview = [[[NSScrollView alloc] initWithFrame: s_rc] retain]; o_scrollview = [[[NSScrollView alloc] initWithFrame: s_rc] retain];
[o_scrollview setDrawsBackground: NO]; [o_scrollview setDrawsBackground: NO];
[o_scrollview setBorderType: NSBezelBorder]; [o_scrollview setBorderType: NSBezelBorder];
if( MACOS_VERSION >= 10.3 ) [o_scrollview setAutohidesScrollers:YES];
[o_scrollview setAutohidesScrollers:YES];
NSTableView *o_tableview; NSTableView *o_tableview;
o_tableview = [[NSTableView alloc] initWithFrame : s_rc]; o_tableview = [[NSTableView alloc] initWithFrame : s_rc];
if( MACOS_VERSION >= 10.3 ) [o_tableview setUsesAlternatingRowBackgroundColors:YES];
[o_tableview setUsesAlternatingRowBackgroundColors:YES];
[o_tableview setHeaderView:nil]; [o_tableview setHeaderView:nil];
/* TODO: find a good way to fix the row height and text size*/ /* TODO: find a good way to fix the row height and text size*/
/* FIXME: support for multiple selection... */ /* FIXME: support for multiple selection... */
......
/***************************************************************************** /*****************************************************************************
* vout.m: MacOS X video output module * vout.m: MacOS X video output module
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2006 the VideoLAN team * Copyright (C) 2001-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
......
...@@ -434,6 +434,7 @@ static void Unlock( vout_thread_t * p_vout ) ...@@ -434,6 +434,7 @@ static void Unlock( vout_thread_t * p_vout )
{ {
Lock( p_vout ); Lock( p_vout );
[[self openGLContext] makeCurrentContext]; [[self openGLContext] makeCurrentContext];
/* FIXME: we should use CGLFlushDrawable instead, as glFlush is pretty slow */
glFlush(); glFlush();
[super drawRect:rect]; [super drawRect:rect];
Unlock( p_vout ); Unlock( p_vout );
......
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