]> git.sesse.net Git - vlc/commitdiff
* more info about the applescript addition:
authorFelix Paul Kühne <fkuehne@videolan.org>
Mon, 27 Nov 2006 21:23:29 +0000 (21:23 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Mon, 27 Nov 2006 21:23:29 +0000 (21:23 +0000)
you can also do the following now:

<tell app "VLC" to set fullscreen mode to true>, thus you also got write access ;)

Sorry, I just forgot to commit these obvious files in [18115].

modules/gui/macosx/applescript.h
modules/gui/macosx/applescript.m

index 929f8af78bbf1015531e65d2bbc333ee3e9391fa..f0c8e95aab988c1d33d70990834d8115ea967d78 100644 (file)
  * VLControlScriptCommand interface 
  *****************************************************************************/
 @interface VLControlScriptCommand : NSScriptCommand
+@end
+
+/*****************************************************************************
+* Category that adds AppleScript support to NSApplication
+*****************************************************************************/
+@interface NSApplication(ScriptSupport)
+
+- (BOOL) scriptFullscreenMode;
+- (void) setScriptFullscreenMode: (BOOL) mode;
+
 @end
\ No newline at end of file
index 11b2c505c8dd5eb53c36d3c793716f2d06b44852..adf31885bcdb8692dc0a9d00f09ba80b946773b9 100644 (file)
         }
         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
\ No newline at end of file