From 639a14dc07fefaea6d1a1b07845d712185a8daba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Paul=20K=C3=BChne?= Date: Mon, 27 Nov 2006 21:23:29 +0000 Subject: [PATCH] * more info about the applescript addition: you can also do the following now: , thus you also got write access ;) Sorry, I just forgot to commit these obvious files in [18115]. --- modules/gui/macosx/applescript.h | 10 ++++++++++ modules/gui/macosx/applescript.m | 21 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/gui/macosx/applescript.h b/modules/gui/macosx/applescript.h index 929f8af78b..f0c8e95aab 100644 --- a/modules/gui/macosx/applescript.h +++ b/modules/gui/macosx/applescript.h @@ -31,4 +31,14 @@ * 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 diff --git a/modules/gui/macosx/applescript.m b/modules/gui/macosx/applescript.m index 11b2c505c8..adf31885bc 100644 --- a/modules/gui/macosx/applescript.m +++ b/modules/gui/macosx/applescript.m @@ -122,8 +122,7 @@ } 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"] ) @@ -147,3 +146,21 @@ } @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 -- 2.39.2