]> git.sesse.net Git - vlc/commitdiff
macosx: updated used Cocoa methods to the current definitions and fixed a few logic...
authorFelix Paul Kühne <fkuehne@videolan.org>
Fri, 6 Feb 2009 22:59:21 +0000 (23:59 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Fri, 6 Feb 2009 22:59:21 +0000 (23:59 +0100)
12 files changed:
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/bookmarks.m
modules/gui/macosx/extended.m
modules/gui/macosx/fspanel.m
modules/gui/macosx/interaction.m
modules/gui/macosx/intf.m
modules/gui/macosx/misc.m
modules/gui/macosx/playlist.m
modules/gui/macosx/playlistinfo.m
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/simple_prefs.m

index f60942084ea753fa343873a9e5ad9eac4dcc3c58..e1b036c53ce872c38202fab6b23b9200b8cb6bdf 100644 (file)
@@ -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 {
index 754899b4486059f2773ba3b080511b9d651f1a72..19a9c0f2ee7da6bf2be4236228858fc0f0291806 100644 (file)
@@ -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 );
index d4f3587fd5b5e8b1d221288d69735e55ecf8b3d2..3119bd2c37010138bba37293ce0f9f8c7315df5f 100644 (file)
@@ -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 );
     }
index 825ab56aafe09fbb73943a086bddef822e259dd7..f59d5795fe7f5f72e39867da38133c4b9be40235 100644 (file)
@@ -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
 {
index 0f3238f42cc486173e6eb06f8d56c2eeb4a21835..32c9bd9c063d57049bc80579c59715502f7d70c9 100644 (file)
 /*----------------------------------------------------------------------------
  * 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];
index 0c1f1905ed488d82f0982bdf03fc43805a6e8f7f..1372baba6ee9ba27c47ca37b1f43995fe26b4e67 100644 (file)
@@ -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];
index 3a033f820aed22e43137cceaba0b5a8dbccd8d9e..25520094a53901dd5f6665448182f6ec4a01e2dc 100644 (file)
@@ -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
index 0378b60ac64d221844891007fa4e962fa52ee6b5..de5fff9e766fd20dc10274766abd6f69e9527bf5 100644 (file)
 @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;
 }
 
 /* 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;
 
 @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 );
     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];
     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];
index a32e6dafb9698bacc8aa4a1e3af0f0cf4f170e2a..d924cfc37dfd0119a0e128d0669c4123abfdba6e 100644 (file)
@@ -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];
 }
index 09e31e1436ef3e670bd7497688272dd073c8d3a6..0a29493f85fbd4bec80cff2f476f047fb3104f56 100644 (file)
@@ -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];
 }
index 90c187f6f88c6260610dadb424ff6824b95a1e9b..3cb152b19dd2896bdbeba6d96bce8313a42d2f86 100644 (file)
@@ -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];
index 4d2778849fa6d778ec732a8acea72e0bb2fc488d..81dc19231dfb77fd1727096f089038f2975488b8 100644 (file)
@@ -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 )
     {