* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#include "controls.h"
#include "open.h"
-
/*****************************************************************************
- * VLGetURLScriptCommand implementation
+ * VLGetURLScriptCommand implementation
*****************************************************************************/
@implementation VLGetURLScriptCommand
[o_urlString fileSystemRepresentation],
[[[NSFileManager defaultManager]
displayNameAtPath: o_urlString] UTF8String] );
- playlist_PlaylistAddInput( p_playlist, p_input, PLAYLIST_INSERT,
- PLAYLIST_END );
+ playlist_AddInput( p_playlist, p_input, PLAYLIST_INSERT,
+ PLAYLIST_END, VLC_TRUE, VLC_FALSE );
o_url = [NSURL fileURLWithPath: o_urlString];
/*****************************************************************************
- * VLControlScriptCommand implementation
+ * VLControlScriptCommand implementation
*****************************************************************************/
/*
* This entire control command needs a better design. more object oriented.
{
return nil;
}
-
+
VLCControls * o_controls = (VLCControls *)[[NSApp delegate] getControls];
-
+
if ( o_controls )
{
if ( [o_command isEqualToString:@"play"] )
}
else if ( [o_command isEqualToString:@"fullscreen"] )
{
- NSMenuItem *o_mi = [[NSMenuItem alloc] initWithTitle: _NS("Fullscreen") action: nil keyEquivalent:@""];
- [o_controls windowAction:[o_mi autorelease]];
+ [o_controls toogleFullscreen: self];
return nil;
}
else if ( [o_command isEqualToString:@"mute"] )
}
@end
+
+/*****************************************************************************
+ * Category that adds AppleScript support to NSApplication
+ *****************************************************************************/
+@implementation NSApplication(ScriptSupport)
+
+- (BOOL) scriptFullscreenMode {
+ VLCControls * o_controls = (VLCControls *)[[self delegate] getControls];
+
+ return [o_controls isFullscreen];
+}
+- (void) setScriptFullscreenMode: (BOOL) mode {
+ VLCControls * o_controls = (VLCControls *)[[self delegate] getControls];
+ if (mode == [o_controls isFullscreen]) return;
+ [o_controls toogleFullscreen: self];
+}
+
+@end