/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#import <Cocoa/Cocoa.h>
#import "QueuingApplicationDelegate.h"
@interface NSBundle (EAWTOverrides)
@end
return [[[[self objectForInfoDictionaryKey:@"Java"] objectForKey:@"EAWTOverride"] objectForKey:key] boolValue];
}
@end
{
if (!qad) {
qad = [QueuingApplicationDelegate new];
}
return qad;
}
{
if (!self) {
return self;
}
// If the java application has a bundle with an Info.plist file with
// a CFBundleDocumentTypes entry, then it is set up to handle Open Doc
// and Print Doc commands for these files. Therefore java AWT will
// cache Open Doc and Print Doc events that are sent prior to a
// listener being installed by the client java application.
fHandlesDocumentTypes = [bundle objectForInfoDictionaryKey:@"CFBundleDocumentTypes"] != nil || [bundle _hasEAWTOverride:@"DocumentHandler"];
fHandlesURLTypes = [bundle objectForInfoDictionaryKey:@"CFBundleURLTypes"] != nil || [bundle _hasEAWTOverride:@"URLHandler"];
if (fHandlesURLTypes) {
}
[ctr addObserver:self selector:@selector(_willFinishLaunching) name:NSApplicationWillFinishLaunchingNotification object:nil];
[ctr addObserver:self selector:@selector(_systemWillPowerOff) name:NSWorkspaceWillPowerOffNotification object:nil];
[ctr addObserver:self selector:@selector(_appDidActivate) name:NSApplicationDidBecomeActiveNotification object:nil];
[ctr addObserver:self selector:@selector(_appDidDeactivate) name:NSApplicationDidResignActiveNotification object:nil];
[ctr addObserver:self selector:@selector(_appDidHide) name:NSApplicationDidHideNotification object:nil];
[ctr addObserver:self selector:@selector(_appDidUnhide) name:NSApplicationDidUnhideNotification object:nil];
return self;
}
- (void)dealloc
{
if (fHandlesURLTypes) {
[[NSAppleEventManager sharedAppleEventManager] removeEventHandlerForEventClass: kInternetEventClass andEventID:kAEGetURL];
}
[super dealloc];
}
- (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
// Make an explicit copy of the passed events as they may be invalidated by the time they're processed
} copy]];
}
{
} copy]];
}
- (NSApplicationPrintReply)application:(NSApplication *)application printFiles:(NSArray *)fileNames withSettings:(NSDictionary *)printSettings showPrintPanels:(BOOL)showPrintPanels
{
if (!fHandlesDocumentTypes) {
return NSPrintingCancelled;
}
[self.realDelegate application:application printFiles:fileNames withSettings:printSettings showPrintPanels:showPrintPanels];
} copy]];
// well, a bit premature, but what else can we do?..
return NSPrintingSuccess;
}
- (void)_willFinishLaunching
{
} copy]];
}
{
} copy]];
return YES;
}
{
} copy]];
return NSTerminateLater;
}
- (void)_systemWillPowerOff
{
} copy]];
}
- (void)_appDidActivate
{
} copy]];
}
- (void)_appDidDeactivate
{
} copy]];
}
- (void)_appDidHide
{
} copy]];
}
- (void)_appDidUnhide
{
} copy]];
}
{
NSUInteger i;
for (i = 0; i < count; i++) {
event();
}
}
@end