From 77bd8d3a76b35fae0163c5d4df8d1f9db2895f8b Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Mon, 16 Nov 2009 18:27:38 -0800 Subject: [PATCH] Add hide: and hideOthers support. Reviewed by me. --- AppKit/CPApplication.j | 10 ++++++++++ AppKit/Platform/CPPlatform.j | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/AppKit/CPApplication.j b/AppKit/CPApplication.j index d955e30ed..64e914b3b 100644 --- a/AppKit/CPApplication.j +++ b/AppKit/CPApplication.j @@ -333,6 +333,11 @@ CPRunContinuesResponse = -1002; [CPPlatform activateIgnoringOtherApps:shouldIgnoreOtherApps]; } +- (void)hideOtherApplications:(id)aSender +{ + [CPPlatform hideOtherApplications:self]; +} + /*! Calls \c -finishLaunching method which results in starting the main event loop. @@ -515,6 +520,11 @@ CPRunContinuesResponse = -1002; return _windows; } +- (void)hide:(id)aSender +{ + [CPPlatform hide:self]; +} + // Accessing the Main Menu /*! Returns the application's main menu diff --git a/AppKit/Platform/CPPlatform.j b/AppKit/Platform/CPPlatform.j index a5eac3712..8635c7aac 100644 --- a/AppKit/Platform/CPPlatform.j +++ b/AppKit/Platform/CPPlatform.j @@ -53,4 +53,20 @@ #endif } ++ (void)hideOtherApplications:(id)aSender +{ +#if PLATFORM(DOM) + if (typeof window["cpHideOtherApplications"] === "function") + window.cpHideOtherApplications(); +#endif +} + ++ (void)hide:(id)aSender +{ +#if PLATFORM(DOM) + if (typeof window["cpHide"] === "function") + window.cpHide(); +#endif +} + @end