Commit c3a1a712 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

macosx: get rid of the infamous 'get' prefixes everywhere and finally respect...

macosx: get rid of the infamous 'get' prefixes everywhere and finally respect Cocoa's naming scheme here
parent ef93d6eb
......@@ -96,7 +96,7 @@
return nil;
}
VLCControls * o_controls = (VLCControls *)[[NSApp delegate] getControls];
VLCControls * o_controls = (VLCControls *)[[NSApp delegate] controls];
if ( o_controls )
{
......@@ -145,12 +145,12 @@
@implementation NSApplication(ScriptSupport)
- (BOOL) scriptFullscreenMode {
VLCControls * o_controls = (VLCControls *)[[self delegate] getControls];
VLCControls * o_controls = (VLCControls *)[[self delegate] controls];
return [o_controls isFullscreen];
}
- (void) setScriptFullscreenMode: (BOOL) mode {
VLCControls * o_controls = (VLCControls *)[[self delegate] getControls];
VLCControls * o_controls = (VLCControls *)[[self delegate] controls];
if (mode == [o_controls isFullscreen]) return;
[o_controls toogleFullscreen: self];
}
......
......@@ -64,5 +64,5 @@
- (void)initStrings;
- (void)showBookmarks;
- (id)getDataTable;
- (id)dataTable;
@end
......@@ -318,7 +318,7 @@ clear:
msg_Dbg( VLCIntf, "calling wizard");
char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
[[[VLCMain sharedInstance] getWizard] initWithExtractValuesFrom:
[[[VLCMain sharedInstance] wizard] initWithExtractValuesFrom:
[[NSNumber numberWithInt:
(pp_bookmarks[i_first]->i_time_offset/1000000)] stringValue]
to: [[NSNumber numberWithInt:
......@@ -366,7 +366,7 @@ clear:
* callback stuff
*****************************************************************************/
-(id)getDataTable
-(id)dataTable
{
return o_tbl_dataTable;
}
......
......@@ -110,7 +110,7 @@
- (IBAction)goToSpecificTime:(id)sender;
- (id)getFSPanel;
- (id)fspanel;
@end
......
......@@ -162,14 +162,14 @@
{
id window;
id voutView = nil;
id embeddedViewList = [[VLCMain sharedInstance] getEmbeddedList];
id embeddedViewList = [[VLCMain sharedInstance] embeddedList];
NSEnumerator *enumerator = [[NSApp orderedWindows] objectEnumerator];
while( !voutView && ( window = [enumerator nextObject] ) )
{
/* We have an embedded vout */
if( [embeddedViewList windowContainsEmbedded: window] )
{
voutView = [embeddedViewList getViewForWindow: window];
voutView = [embeddedViewList viewForWindow: window];
}
/* We have a detached vout */
else if( [[window className] isEqualToString: @"VLCVoutWindow"] )
......@@ -485,7 +485,7 @@
[o_vout_view toggleFloatOnTop];
else if( [o_title isEqualToString: _NS("Fit to Screen") ] )
{
id o_window = [o_vout_view getWindow];
id o_window = [o_vout_view voutWindow];
if( ![o_window isZoomed] )
[o_window performZoom:self];
}
......@@ -960,7 +960,7 @@
}
}
- (id)getFSPanel
- (id)fspanel
{
if( o_fs_panel )
return o_fs_panel;
......@@ -1074,7 +1074,7 @@
while( (o_window = [o_enumerator nextObject]))
{
if( [[o_window className] isEqualToString: @"VLCVoutWindow"] ||
[[[VLCMain sharedInstance] getEmbeddedList]
[[[VLCMain sharedInstance] embeddedList]
windowContainsEmbedded: o_window])
{
bEnabled = TRUE;
......@@ -1179,7 +1179,7 @@
- (void)mouseDown: (NSEvent *)ourEvent
{
if( [ourEvent clickCount] > 1 )
[[[VLCMain sharedInstance] getControls] goToSpecificTime: nil];
[[[VLCMain sharedInstance] controls] goToSpecificTime: nil];
else
[[VLCMain sharedInstance] timeFieldWasClicked: self];
}
......
......@@ -87,6 +87,6 @@
-(void)showProgressDialog: (NSValue *)o_value;
-(IBAction)progDialogAction:(id)sender;
-(id)getErrorPanel;
-(id)errorPanel;
@end
\ No newline at end of file
......@@ -237,13 +237,13 @@ void updateProgressPanel (void *priv, const char *text, float value)
NSString *o_txt;
if( text != NULL )
o_txt = [NSString stringWithUTF8String: text];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCCoreDialogProgressBarUpdateNotification" object:[[VLCMain sharedInstance] getCoreDialogProvider] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_txt, @"Text", [NSNumber numberWithInt: ((int)(value * 1000.))], @"IntValue", nil]];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCCoreDialogProgressBarUpdateNotification" object:[[VLCMain sharedInstance] coreDialogProvider] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_txt, @"Text", [NSNumber numberWithInt: ((int)(value * 1000.))], @"IntValue", nil]];
}
void destroyProgressPanel (void *priv)
{
NSLog( @"we should destroy" );
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCCoreDialogProgressBarDestroyNotification" object:[[VLCMain sharedInstance] getCoreDialogProvider] userInfo: nil];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCCoreDialogProgressBarDestroyNotification" object:[[VLCMain sharedInstance] coreDialogProvider] userInfo: nil];
}
bool checkProgressPanel (void *priv)
......@@ -258,7 +258,7 @@ bool checkProgressPanel (void *priv)
b_progress_cancelled = YES;
}
-(id)getErrorPanel
-(id)errorPanel
{
return o_error_panel;
}
......
......@@ -379,18 +379,18 @@
- (void)hasBecomeFullscreen
{
[o_fullscreen_window makeFirstResponder: [[[VLCMain sharedInstance] getControls] voutView]];
[o_fullscreen_window makeFirstResponder: [[[VLCMain sharedInstance] controls] voutView]];
[o_fullscreen_window makeKeyWindow];
[o_fullscreen_window setAcceptsMouseMovedEvents: TRUE];
/* tell the fspanel to move itself to front next time it's triggered */
[[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
[[[[VLCMain sharedInstance] controls] fspanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
if([self isVisible])
[super orderOut: self];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
[[[[VLCMain sharedInstance] controls] fspanel] setActive: nil];
b_fullscreen = YES;
[self unlockFullscreenAnimation];
......@@ -430,7 +430,7 @@
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
/* Will release the lock */
......@@ -448,7 +448,7 @@
[self setAlphaValue: 0.0];
[self orderFront: self];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
if (o_fullscreen_anim1)
......
......@@ -56,7 +56,7 @@
- (void)awakeFromNib;
- (void)setValue: (float)value forSlider: (int)index;
- (id)getSliderByIndex: (int)index;
- (id)sliderByIndex: (int)index;
- (void)setBandSlidersValues: (float *)values;
- (void)initBandSliders;
......
......@@ -457,7 +457,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
}
- (id)getSliderByIndex:(int)index
- (id)sliderByIndex:(int)index
{
switch(index)
{
......@@ -495,7 +495,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
- (void)setValue:(float)value forSlider:(int)index
{
id slider = [self getSliderByIndex:index];
id slider = [self sliderByIndex:index];
if (slider != nil)
{
......
......@@ -95,7 +95,7 @@
- (IBAction)moreInfoVideoFilters:(id)sender;
+ (VLCExtended *)sharedInstance;
- (BOOL)getConfigChanged;
- (BOOL)configChanged;
- (void)showPanel;
- (void)initStrings;
......
......@@ -180,7 +180,7 @@ static VLCExtended *_o_sharedInstance = nil;
[self initStrings];
}
- (BOOL)getConfigChanged
- (BOOL)configChanged
{
return o_config_changed;
}
......@@ -416,13 +416,13 @@ static VLCExtended *_o_sharedInstance = nil;
if( p_vout != NULL )
{
p_real_vout = [VLCVoutView getRealVout: p_vout];
p_real_vout = [VLCVoutView realVout: p_vout];
var_Set( p_real_vout, "macosx-opaqueness", val );
while ((o_window = [o_enumerator nextObject]))
{
if( [[o_window className] isEqualToString: @"VLCVoutWindow"] ||
[[[VLCMain sharedInstance] getEmbeddedList]
[[[VLCMain sharedInstance] embeddedList]
windowContainsEmbedded: o_window])
{
[o_window setAlphaValue: val.f_float];
......
......@@ -178,9 +178,9 @@
- (void)setActive:(id)noData
{
if( [[[VLCMain sharedInstance] getControls] voutView] != nil )
if( [[[VLCMain sharedInstance] controls] voutView] != nil )
{
if( [[[[VLCMain sharedInstance] getControls] voutView] isFullscreen] )
if( [[[[VLCMain sharedInstance] controls] voutView] isFullscreen] )
{
b_nonActive = NO;
[self fadeIn];
......@@ -247,8 +247,8 @@
- (void)mouseExited:(NSEvent *)theEvent
{
/* give up our focus, so the vout may show us again without letting the user clicking it */
if( [[[[VLCMain sharedInstance] getControls] voutView] isFullscreen] )
[[[[[VLCMain sharedInstance] getControls] voutView] window] makeKeyWindow];
if( [[[[VLCMain sharedInstance] controls] voutView] isFullscreen] )
[[[[[VLCMain sharedInstance] controls] voutView] window] makeKeyWindow];
}
- (void)hideMouse
......@@ -524,32 +524,32 @@
- (IBAction)play:(id)sender
{
[[[VLCMain sharedInstance] getControls] play: sender];
[[[VLCMain sharedInstance] controls] play: sender];
}
- (IBAction)forward:(id)sender
{
[[[VLCMain sharedInstance] getControls] forward: sender];
[[[VLCMain sharedInstance] controls] forward: sender];
}
- (IBAction)backward:(id)sender
{
[[[VLCMain sharedInstance] getControls] backward: sender];
[[[VLCMain sharedInstance] controls] backward: sender];
}
- (IBAction)prev:(id)sender
{
[[[VLCMain sharedInstance] getControls] prev: sender];
[[[VLCMain sharedInstance] controls] prev: sender];
}
- (IBAction)next:(id)sender
{
[[[VLCMain sharedInstance] getControls] next: sender];
[[[VLCMain sharedInstance] controls] next: sender];
}
- (IBAction)windowAction:(id)sender
{
[[[VLCMain sharedInstance] getControls] windowAction: sender];
[[[VLCMain sharedInstance] controls] windowAction: sender];
}
- (IBAction)fsTimeSliderUpdate:(id)sender
......@@ -559,7 +559,7 @@
- (IBAction)fsVolumeSliderUpdate:(id)sender
{
[[[VLCMain sharedInstance] getControls] volumeSliderUpdated: sender];
[[[VLCMain sharedInstance] controls] volumeSliderUpdated: sender];
}
#define addImage(image, _x, _y, mode, _width) \
......
......@@ -42,7 +42,7 @@
*****************************************************************************/
unsigned int CocoaKeyToVLC( unichar i_key );
#define VLCIntf [[VLCMain sharedInstance] getIntf]
#define VLCIntf [[VLCMain sharedInstance] intf]
#define _NS(s) [[VLCMain sharedInstance] localizedString: _(s)]
/* Get an alternate version of the string.
......@@ -341,25 +341,25 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
+ (VLCMain *)sharedInstance;
- (intf_thread_t *)getIntf;
- (intf_thread_t *)intf;
- (void)setIntf:(intf_thread_t *)p_mainintf;
- (void)controlTintChanged;
- (id)getControls;
- (id)getSimplePreferences;
- (id)getPreferences;
- (id)getPlaylist;
- (id)controls;
- (id)simplePreferences;
- (id)preferences;
- (id)playlist;
- (BOOL)isPlaylistCollapsed;
- (id)getInfo;
- (id)getWizard;
- (id)getBookmarks;
- (id)getEmbeddedList;
- (id)getCoreDialogProvider;
- (id)getMainIntfPgbar;
- (id)getControllerWindow;
- (id)getVoutMenu;
- (id)getEyeTVController;
- (id)info;
- (id)wizard;
- (id)bookmarks;
- (id)embeddedList;
- (id)coreDialogProvider;
- (id)mainIntfPgbar;
- (id)controllerWindow;
- (id)voutMenu;
- (id)eyeTVController;
- (void)applicationWillTerminate:(NSNotification *)notification;
- (NSString *)localizedString:(const char *)psz;
- (char *)delocalizeString:(NSString *)psz;
......
......@@ -234,7 +234,7 @@ static int DialogCallback( vlc_object_t *p_this, const char *type, vlc_value_t p
const dialog_fatal_t *p_dialog = (const dialog_fatal_t *)value.p_address;
NSValue *o_value = [NSValue valueWithPointer:p_dialog];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCNewCoreDialogEventNotification" object:[interface getCoreDialogProvider] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_value, @"VLCDialogPointer", [NSString stringWithUTF8String: type], @"VLCDialogType", nil]];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCNewCoreDialogEventNotification" object:[interface coreDialogProvider] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_value, @"VLCDialogPointer", [NSString stringWithUTF8String: type], @"VLCDialogType", nil]];
[o_pool release];
return VLC_SUCCESS;
......@@ -314,7 +314,7 @@ static VLCMain *_o_sharedMainInstance = nil;
p_intf = p_mainintf;
}
- (intf_thread_t *)getIntf {
- (intf_thread_t *)intf {
return p_intf;
}
......@@ -745,7 +745,7 @@ static VLCMain *_o_sharedMainInstance = nil;
config_PutInt( p_intf->p_libvlc, "volume", i_lastShownVolume );
/* save the prefs if they were changed in the extended panel */
if(o_extended && [o_extended getConfigChanged])
if(o_extended && [o_extended configChanged])
{
[o_extended savePrefs];
}
......@@ -1315,9 +1315,8 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
#pragma mark -
#pragma mark Other objects getters
// FIXME: this is ugly and does not respect cocoa naming scheme
- (id)getControls
- (id)controls
{
if( o_controls )
return o_controls;
......@@ -1325,7 +1324,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getSimplePreferences
- (id)simplePreferences
{
if( !o_sprefs )
return nil;
......@@ -1336,7 +1335,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return o_sprefs;
}
- (id)getPreferences
- (id)preferences
{
if( !o_prefs )
return nil;
......@@ -1347,7 +1346,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return o_prefs;
}
- (id)getPlaylist
- (id)playlist
{
if( o_playlist )
return o_playlist;
......@@ -1360,7 +1359,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return ![o_btn_playlist state];
}
- (id)getInfo
- (id)info
{
if( o_info )
return o_info;
......@@ -1368,7 +1367,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getWizard
- (id)wizard
{
if( o_wizard )
return o_wizard;
......@@ -1376,12 +1375,12 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getVLM
- (id)vlm
{
return o_vlm;
}
- (id)getBookmarks
- (id)bookmarks
{
if( o_bookmarks )
return o_bookmarks;
......@@ -1389,7 +1388,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getEmbeddedList
- (id)embeddedList
{
if( o_embedded_list )
return o_embedded_list;
......@@ -1397,7 +1396,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getCoreDialogProvider
- (id)coreDialogProvider
{
if( o_coredialogs )
return o_coredialogs;
......@@ -1405,7 +1404,7 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getMainIntfPgbar
- (id)mainIntfPgbar
{
if( o_main_pgbar )
return o_main_pgbar;
......@@ -1413,19 +1412,19 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getControllerWindow
- (id)controllerWindow
{
if( o_window )
return o_window;
return nil;
}
- (id)getVoutMenu
- (id)voutMenu
{
return o_vout_menu;
}
- (id)getEyeTVController
- (id)eyeTVController
{
if( o_eyetv )
return o_eyetv;
......@@ -1596,7 +1595,7 @@ static void manage_cleanup( void * args )
if( [self isPlaylistCollapsed] == YES )
{
PL_LOCK;
[[self getInfo] updatePanelWithItem: playlist_CurrentPlayingItem( p_playlist )->p_input];
[[self info] updatePanelWithItem: playlist_CurrentPlayingItem( p_playlist )->p_input];
PL_UNLOCK;
}
......@@ -1633,8 +1632,8 @@ static void manage_cleanup( void * args )
[o_timeslider setFloatValue: 0.0];
[o_timeslider setEnabled: b_seekable];
[o_timefield setStringValue: @"00:00"];
[[[self getControls] getFSPanel] setStreamPos: 0 andTime: @"00:00"];
[[[self getControls] getFSPanel] setSeekable: b_seekable];
[[[self controls] fspanel] setStreamPos: 0 andTime: @"00:00"];
[[[self controls] fspanel] setSeekable: b_seekable];
[o_embedded_window setSeekable: b_seekable];
......@@ -1662,7 +1661,7 @@ static void manage_cleanup( void * args )
if( p_intf->p_sys->b_intf_show )
{
if( [[o_controls voutView] isFullscreen] && config_GetInt( VLCIntf, "macosx-fspanel" ) )
[[o_controls getFSPanel] fadeIn];
[[o_controls fspanel] fadeIn];
else
[o_window makeKeyAndOrderFront: self];
......@@ -1688,7 +1687,7 @@ static void manage_cleanup( void * args )
free(name);
[self setScrollField: aString stopAfter:-1];
[[[self getControls] getFSPanel] setStreamTitle: aString];
[[[self controls] fspanel] setStreamTitle: aString];
[[o_controls voutView] updateTitle];
......@@ -1720,7 +1719,7 @@ static void manage_cleanup( void * args )
o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
[o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
[[[self controls] fspanel] setStreamPos: f_updated andTime: o_time];
[o_embedded_window setTime: o_time position: f_updated];
}
......@@ -1756,7 +1755,7 @@ static void manage_cleanup( void * args )
i_volume_step = config_GetInt( p_intf->p_libvlc, "volume-step" );
[o_volumeslider setFloatValue: (float)i_lastShownVolume / i_volume_step];
[o_volumeslider setEnabled: TRUE];
[[[self getControls] getFSPanel] setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
[[[self controls] fspanel] setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
p_intf->p_sys->b_mute = ( i_lastShownVolume == 0 );
p_intf->p_sys->b_volume_update = FALSE;
}
......@@ -1912,7 +1911,7 @@ end:
o_temp = [NSString stringWithUTF8String:p_item->p_input->psz_name];
PL_UNLOCK;
[self setScrollField: o_temp stopAfter:-1];
[[[self getControls] getFSPanel] setStreamTitle: o_temp];
[[[self controls] fspanel] setStreamTitle: o_temp];
vlc_object_release( p_input );
pl_Release( p_intf );
return;
......@@ -1925,7 +1924,7 @@ end:
{
if( i_status == PLAYING_S )
{
[[[self getControls] getFSPanel] setPause];
[[[self controls] fspanel] setPause];
[o_btn_play setImage: o_img_pause];
[o_btn_play setAlternateImage: o_img_pause_pressed];
[o_btn_play setToolTip: _NS("Pause")];
......@@ -1935,7 +1934,7 @@ end:
}
else
{
[[[self getControls] getFSPanel] setPlay];
[[[self controls] fspanel] setPlay];
[o_btn_play setImage: o_img_play];
[o_btn_play setAlternateImage: o_img_play_pressed];
[o_btn_play setToolTip: _NS("Play")];
......@@ -2005,7 +2004,7 @@ end:
o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
[o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
[[[self controls] fspanel] setStreamPos: f_updated andTime: o_time];
[o_embedded_window setTime: o_time position: f_updated];
vlc_object_release( p_input );