mirror of https://code.videolan.org/videolan/vlc
macosx: updated used Cocoa methods to the current definitions and fixed a few logic errors, which only occur in 64 bit mode
This commit is contained in:
parent
571e981e37
commit
2fb774083c
|
@ -61,6 +61,10 @@ const int REMOTE_SWITCH_COOKIE=19;
|
|||
const NSTimeInterval DEFAULT_MAXIMUM_CLICK_TIME_DIFFERENCE=0.35;
|
||||
const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
|
||||
|
||||
#ifndef NSUInteger
|
||||
#define NSUInteger unsigned
|
||||
#endif
|
||||
|
||||
@implementation AppleRemote
|
||||
|
||||
#pragma public interface
|
||||
|
@ -305,7 +309,7 @@ static AppleRemote* sharedInstance=nil;
|
|||
- (id)retain {
|
||||
return self;
|
||||
}
|
||||
- (unsigned)retainCount {
|
||||
- (NSUInteger)retainCount {
|
||||
return UINT_MAX; //denotes an object that cannot be released
|
||||
}
|
||||
- (void)release {
|
||||
|
|
|
@ -365,7 +365,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
|
|||
* data source methods
|
||||
*****************************************************************************/
|
||||
|
||||
- (int)numberOfRowsInTableView:(NSTableView *)theDataTable
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)theDataTable
|
||||
{
|
||||
/* return the number of bookmarks */
|
||||
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
|
||||
|
@ -386,7 +386,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
|
|||
}
|
||||
|
||||
- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn:
|
||||
(NSTableColumn *)theTableColumn row: (int)row
|
||||
(NSTableColumn *)theTableColumn row: (NSInteger)row
|
||||
{
|
||||
/* return the corresponding data as NSString */
|
||||
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
|
||||
|
|
|
@ -113,11 +113,11 @@ static VLCExtended *_o_sharedInstance = nil;
|
|||
/* set the video-filter-checkboxes to the correct values */
|
||||
if( psz_vfilters )
|
||||
{
|
||||
[o_ckb_blur setState: (int)strstr( psz_vfilters, "motionblur")];
|
||||
[o_ckb_imgClone setState: (int)strstr( psz_vfilters, "clone")];
|
||||
[o_ckb_imgCrop setState: (int)strstr( psz_vfilters, "crop")];
|
||||
[o_ckb_trnsform setState: (int)strstr( psz_vfilters, "transform")];
|
||||
[o_ckb_intZoom setState: (int)strstr( psz_vfilters, "magnify")];
|
||||
[o_ckb_blur setState: (NSInteger)strstr( psz_vfilters, "motionblur")];
|
||||
[o_ckb_imgClone setState: (NSInteger)strstr( psz_vfilters, "clone")];
|
||||
[o_ckb_imgCrop setState: (NSInteger)strstr( psz_vfilters, "crop")];
|
||||
[o_ckb_trnsform setState: (NSInteger)strstr( psz_vfilters, "transform")];
|
||||
[o_ckb_intZoom setState: (NSInteger)strstr( psz_vfilters, "magnify")];
|
||||
|
||||
free( psz_vfilters );
|
||||
}
|
||||
|
@ -147,11 +147,11 @@ static VLCExtended *_o_sharedInstance = nil;
|
|||
}
|
||||
if( psz_vifilters )
|
||||
{
|
||||
[o_ckb_wave setState: (int)strstr( psz_vifilters, "wave")];
|
||||
[o_ckb_psycho setState: (int)strstr( psz_vifilters, "psychedelic")];
|
||||
[o_ckb_ripple setState: (int)strstr( psz_vifilters, "ripple")];
|
||||
[o_ckb_gradient setState: (int)strstr( psz_vifilters, "gradient")];
|
||||
[o_ckb_imgInvers setState: (int)strstr( psz_vifilters, "invert")];
|
||||
[o_ckb_wave setState: (NSInteger)strstr( psz_vifilters, "wave")];
|
||||
[o_ckb_psycho setState: (NSInteger)strstr( psz_vifilters, "psychedelic")];
|
||||
[o_ckb_ripple setState: (NSInteger)strstr( psz_vifilters, "ripple")];
|
||||
[o_ckb_gradient setState: (NSInteger)strstr( psz_vifilters, "gradient")];
|
||||
[o_ckb_imgInvers setState: (NSInteger)strstr( psz_vifilters, "invert")];
|
||||
|
||||
free( psz_vifilters );
|
||||
}
|
||||
|
@ -161,8 +161,8 @@ static VLCExtended *_o_sharedInstance = nil;
|
|||
psz_afilters = config_GetPsz( p_intf, "audio-filter" );
|
||||
if( psz_afilters )
|
||||
{
|
||||
[o_ckb_hdphnVirt setState: (int)strstr( psz_afilters, "headphone" ) ];
|
||||
[o_ckb_vlme_norm setState: (int)strstr( psz_afilters, "normvol" ) ];
|
||||
[o_ckb_hdphnVirt setState: (NSInteger)strstr( psz_afilters, "headphone" ) ];
|
||||
[o_ckb_vlme_norm setState: (NSInteger)strstr( psz_afilters, "normvol" ) ];
|
||||
|
||||
free( psz_afilters );
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
@implementation VLCFSPanel
|
||||
/* We override this initializer so we can set the NSBorderlessWindowMask styleMask, and set a few other important settings */
|
||||
- (id)initWithContentRect:(NSRect)contentRect
|
||||
styleMask:(unsigned int)aStyle
|
||||
styleMask:(NSInteger)aStyle
|
||||
backing:(NSBackingStoreType)bufferingType
|
||||
defer:(BOOL)flag
|
||||
{
|
||||
|
|
|
@ -474,13 +474,13 @@
|
|||
/*----------------------------------------------------------------------------
|
||||
* data source methods
|
||||
*---------------------------------------------------------------------------*/
|
||||
- (int)numberOfRowsInTableView:(NSTableView *)theDataTable
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)theDataTable
|
||||
{
|
||||
return [o_errors count];
|
||||
}
|
||||
|
||||
- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn:
|
||||
(NSTableColumn *)theTableColumn row: (int)row
|
||||
(NSTableColumn *)theTableColumn row: (NSInteger)row
|
||||
{
|
||||
if( [[theTableColumn identifier] isEqualToString: @"error_msg"] )
|
||||
return [o_errors objectAtIndex: row];
|
||||
|
|
|
@ -2249,7 +2249,7 @@ end:
|
|||
- (IBAction)crashReporterAction:(id)sender
|
||||
{
|
||||
if( sender == o_crashrep_send_btn )
|
||||
[self sendCrashLog:[NSString stringWithContentsOfFile: [self latestCrashLogPath]] withUserComment: [o_crashrep_fld string]];
|
||||
[self sendCrashLog:[NSString stringWithContentsOfFile: [self latestCrashLogPath] encoding: NSUTF8StringEncoding error: NULL] withUserComment: [o_crashrep_fld string]];
|
||||
|
||||
[NSApp stopModal];
|
||||
[o_crashrep_win orderOut: sender];
|
||||
|
|
|
@ -222,7 +222,7 @@ static NSMutableArray *blackoutWindows = NULL;
|
|||
*****************************************************************************/
|
||||
|
||||
@implementation VLCWindow
|
||||
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask
|
||||
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask
|
||||
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
|
||||
{
|
||||
self = [super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag];
|
||||
|
@ -403,7 +403,7 @@ static NSMutableArray *blackoutWindows = NULL;
|
|||
|
||||
@implementation VLCControllerWindow
|
||||
|
||||
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask
|
||||
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask
|
||||
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
|
||||
{
|
||||
self = [super initWithContentRect:contentRect styleMask:styleMask //& ~NSTitledWindowMask
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
@implementation VLCPlaylistCommon (NSOutlineViewDataSource)
|
||||
|
||||
/* return the number of children for Obj-C pointer item */ /* DONE */
|
||||
- (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
|
||||
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
|
||||
{
|
||||
int i_return = 0;
|
||||
playlist_item_t *p_item = NULL;
|
||||
|
@ -167,7 +167,7 @@
|
|||
}
|
||||
|
||||
/* return the child at index for the Obj-C pointer item */ /* DONE */
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item
|
||||
{
|
||||
playlist_item_t *p_return = NULL, *p_item = NULL;
|
||||
NSValue *o_value;
|
||||
|
@ -1478,7 +1478,7 @@
|
|||
|
||||
@implementation VLCPlaylist (NSOutlineViewDataSource)
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item
|
||||
{
|
||||
id o_value = [super outlineView: outlineView child: index ofItem: item];
|
||||
playlist_t *p_playlist = pl_Hold( VLCIntf );
|
||||
|
@ -1562,7 +1562,7 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(int)index
|
||||
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
|
||||
{
|
||||
playlist_t *p_playlist = pl_Hold( VLCIntf );
|
||||
NSPasteboard *o_pasteboard = [info draggingPasteboard];
|
||||
|
@ -1626,7 +1626,7 @@
|
|||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(int)index
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index
|
||||
{
|
||||
playlist_t * p_playlist = pl_Hold( VLCIntf );
|
||||
NSPasteboard *o_pasteboard = [info draggingPasteboard];
|
||||
|
|
|
@ -458,7 +458,7 @@ error:
|
|||
|
||||
@implementation VLCInfo (NSTableDataSource)
|
||||
|
||||
- (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
|
||||
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
|
||||
{
|
||||
return (item == nil) ? [rootItem numberOfChildren] : [item numberOfChildren];
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ error:
|
|||
return ([item numberOfChildren] > 0);
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item
|
||||
{
|
||||
return (item == nil) ? [rootItem childAtIndex:index] : (id)[item childAtIndex:index];
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
|
|||
|
||||
@implementation VLCPrefs (NSTableDataSource)
|
||||
|
||||
- (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
|
||||
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
|
||||
{
|
||||
return (item == nil) ? [_rootTreeItem numberOfChildren] : [item numberOfChildren];
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
|
|||
return ![item isKindOfClass:[VLCTreeSubCategoryItem class]];
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item
|
||||
{
|
||||
return (item == nil) ? (id)[_rootTreeItem childAtIndex:index]: (id)[item childAtIndex:index];
|
||||
}
|
||||
|
|
|
@ -1096,12 +1096,12 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
|
|||
@end
|
||||
|
||||
@implementation StringListConfigControl (NSComboBoxDataSource)
|
||||
- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox
|
||||
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox
|
||||
{
|
||||
return p_item->i_list;
|
||||
}
|
||||
|
||||
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)i_index
|
||||
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)i_index
|
||||
{
|
||||
if( p_item->ppsz_list_text && p_item->ppsz_list_text[i_index] )
|
||||
{
|
||||
|
@ -1550,12 +1550,12 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
|
|||
@end
|
||||
|
||||
@implementation IntegerListConfigControl (NSComboBoxDataSource)
|
||||
- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox
|
||||
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox
|
||||
{
|
||||
return p_item->i_list;
|
||||
}
|
||||
|
||||
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)i_index
|
||||
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)i_index
|
||||
{
|
||||
if( p_item->ppsz_list_text && p_item->ppsz_list_text[i_index] )
|
||||
return [[VLCMain sharedInstance]
|
||||
|
@ -2215,7 +2215,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
|
|||
}
|
||||
|
||||
- (NSDragOperation)tableView:(NSTableView*)table
|
||||
validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row
|
||||
validateDrop:(id <NSDraggingInfo>)info proposedRow:(NSInteger)row
|
||||
proposedDropOperation:(NSTableViewDropOperation)op
|
||||
{
|
||||
// Make drops at the end of the table go to the end.
|
||||
|
@ -2233,7 +2233,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
|
|||
}
|
||||
|
||||
- (BOOL)tableView:(NSTableView*)table acceptDrop:(id <NSDraggingInfo>)info
|
||||
row:(int)dropRow dropOperation:(NSTableViewDropOperation)op;
|
||||
row:(NSInteger)dropRow dropOperation:(NSTableViewDropOperation)op;
|
||||
{
|
||||
NSPasteboard *pb = [info draggingPasteboard];
|
||||
NSDragOperation srcMask = [info draggingSourceOperationMask];
|
||||
|
@ -2287,13 +2287,13 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
|
|||
return accepted;
|
||||
}
|
||||
|
||||
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
|
||||
{
|
||||
return [o_modulearray count];
|
||||
}
|
||||
|
||||
- (id)tableView:(NSTableView *)aTableView
|
||||
objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
|
||||
objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
|
||||
{
|
||||
if( [[aTableColumn identifier] isEqualToString: @"Enabled"] )
|
||||
return [[o_modulearray objectAtIndex:rowIndex] objectAtIndex:2];
|
||||
|
@ -2304,7 +2304,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
|
|||
}
|
||||
|
||||
- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject
|
||||
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
|
||||
forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
|
||||
{
|
||||
[[o_modulearray objectAtIndex:rowIndex] replaceObjectAtIndex:2
|
||||
withObject: anObject];
|
||||
|
|
|
@ -423,7 +423,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
|
|||
psz_tmp = config_GetPsz( p_intf, "audio-filter" );
|
||||
if( psz_tmp )
|
||||
{
|
||||
[o_audio_norm_ckb setState: (int)strstr( psz_tmp, "volnorm" )];
|
||||
[o_audio_norm_ckb setState: (NSInteger)strstr( psz_tmp, "volnorm" )];
|
||||
[o_audio_norm_fld setEnabled: [o_audio_norm_ckb state]];
|
||||
[o_audio_norm_stepper setEnabled: [o_audio_norm_ckb state]];
|
||||
}
|
||||
|
@ -744,7 +744,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
|
|||
psz_tmp = config_GetPsz( p_intf, "audio-filter" );
|
||||
if(! psz_tmp)
|
||||
config_PutPsz( p_intf, "audio-filter", "volnorm" );
|
||||
else if( (int)strstr( psz_tmp, "normvol" ) == NO )
|
||||
else if( (NSInteger)strstr( psz_tmp, "normvol" ) == NO )
|
||||
{
|
||||
/* work-around a GCC 4.0.1 bug */
|
||||
psz_tmp = (char *)[[NSString stringWithFormat: @"%s:volnorm", psz_tmp] UTF8String];
|
||||
|
@ -845,7 +845,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
|
|||
|
||||
#define CaCi( name, int ) config_PutInt( p_intf, name, int * [[o_input_cachelevel_pop selectedItem] tag] )
|
||||
#define CaC( name ) CaCi( name, 1 )
|
||||
msg_Dbg( p_intf, "Adjusting all cache values to: %i", [[o_input_cachelevel_pop selectedItem] tag] );
|
||||
msg_Dbg( p_intf, "Adjusting all cache values to: %i", (int)[[o_input_cachelevel_pop selectedItem] tag] );
|
||||
CaC( "udp-caching" );
|
||||
if( module_exists ( "dvdread" ) )
|
||||
{
|
||||
|
@ -1144,7 +1144,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
|
|||
}
|
||||
else if( sender == o_hotkeys_change_ok_btn )
|
||||
{
|
||||
int i_returnValue;
|
||||
NSInteger i_returnValue;
|
||||
if(! o_keyInTransition )
|
||||
{
|
||||
[NSApp stopModal];
|
||||
|
@ -1199,7 +1199,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
|
|||
|
||||
- (BOOL)changeHotkeyTo: (int)i_theNewKey
|
||||
{
|
||||
int i_returnValue;
|
||||
NSInteger i_returnValue;
|
||||
i_returnValue = [o_hotkeysNonUseableKeys indexOfObject: [NSNumber numberWithInt: i_theNewKey]];
|
||||
if( i_returnValue != NSNotFound || i_theNewKey == 0 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue