Add a few MacOSX methods with dummy implementations.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33281 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-06-11 15:48:08 +00:00
parent c744492fee
commit 191d9619d6
4 changed files with 106 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2011-06-11 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSWorkspace.h,
* Source/NSWorkspace.m: Add a few MacOSX methods with dummy implementations.
* Source/externs.m: Add new notification strings for NSWorkspace.
2011-06-11 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSKeyValueBinding.h

View file

@ -63,6 +63,14 @@ enum {
typedef NSUInteger NSWorkspaceLaunchOptions;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
enum {
NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
NSExclude10_4ElementsIconCreationOption = 1 << 2
};
typedef NSUInteger NSWorkspaceIconCreationOptions;
#endif
@interface NSWorkspace : NSObject
{
@ -126,6 +134,11 @@ typedef NSUInteger NSWorkspaceLaunchOptions;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (BOOL) isFilePackageAtPath: (NSString*)fullPath;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (BOOL) setIcon: (NSImage *)image
forFile: (NSString *)fullPath
options: (NSWorkspaceIconCreationOptions)options;
#endif
//
// Tracking Changes to the File System
@ -151,6 +164,7 @@ typedef NSUInteger NSWorkspaceLaunchOptions;
autolaunch: (BOOL)autolaunch;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (NSString *) absolutePathForAppBundleWithIdentifier: (NSString *)bundleIdentifier;
// TODO: implement NSAppleEventDescriptor in gnustep-base
typedef void NSAppleEventDescriptor;
@ -158,9 +172,25 @@ typedef void NSAppleEventDescriptor;
options: (NSWorkspaceLaunchOptions)options
additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor
launchIdentifier: (NSNumber **)identifier;
- (BOOL) openURLs: (NSArray *)urls
withAppBundleIdentifier: (NSString *)bundleIdentifier
options: (NSWorkspaceLaunchOptions)options
additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor
launchIdentifiers: (NSArray **)identifiers;
#endif
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (BOOL) filenameExtension: (NSString *)filenameExtension
isValidForType: (NSString*)typeName;
- (NSString *) localizedDescriptionForType: (NSString *)typeName;
- (NSString *) preferredFilenameExtensionForType: (NSString *)typeName;
- (BOOL) type: (NSString *)firstTypeName
conformsToType: (NSString *)secondTypeName;
- (NSString *) typeOfFile: (NSString *)absoluteFilePath
error: (NSError **)outError;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
- (NSDictionary*) activeApplication;
- (NSArray*) launchedApplications;
#endif
@ -264,6 +294,12 @@ APPKIT_EXPORT NSString *NSWorkspaceDidUnmountNotification;
APPKIT_EXPORT NSString *NSWorkspaceWillLaunchApplicationNotification;
APPKIT_EXPORT NSString *NSWorkspaceWillPowerOffNotification;
APPKIT_EXPORT NSString *NSWorkspaceWillUnmountNotification;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
APPKIT_EXPORT NSString *NSWorkspaceDidWakeNotification;
APPKIT_EXPORT NSString *NSWorkspaceSessionDidBecomeActiveNotification;
APPKIT_EXPORT NSString *NSWorkspaceSessionDidResignActiveNotification;
APPKIT_EXPORT NSString *NSWorkspaceWillSleepNotification;
#endif
//
// Workspace File Type Globals

View file

@ -1423,6 +1423,14 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
return NO;
}
- (BOOL) setIcon: (NSImage *)image
forFile: (NSString *)fullPath
options: (NSWorkspaceIconCreationOptions)options
{
// FIXME
return NO;
}
/**
* Tracking Changes to the File System
*/
@ -1563,6 +1571,12 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
return YES;
}
- (NSString *) absolutePathForAppBundleWithIdentifier: (NSString *)bundleIdentifier
{
// TODO: full implementation
return [self fullPathForApplication: bundleIdentifier];
}
- (BOOL) launchAppWithBundleIdentifier: (NSString *)bundleIdentifier
options: (NSWorkspaceLaunchOptions)options
additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor
@ -1574,6 +1588,16 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
autolaunch: NO];
}
- (BOOL) openURLs: (NSArray *)urls
withAppBundleIdentifier: (NSString *)bundleIdentifier
options: (NSWorkspaceLaunchOptions)options
additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor
launchIdentifiers: (NSArray **)identifiers
{
// FIXME
return NO;
}
/**
* Returns a description of the currently active application, containing
* the name (NSApplicationName), path (NSApplicationPath) and process
@ -1954,6 +1978,37 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
return 0;
}
- (BOOL) filenameExtension: (NSString *)filenameExtension
isValidForType: (NSString*)typeName
{
// FIXME
return [filenameExtension isEqualToString: typeName];
}
- (NSString *) localizedDescriptionForType: (NSString *)typeName
{
// FIXME
return typeName;
}
- (NSString *) preferredFilenameExtensionForType: (NSString *)typeName
{
// FIXME
return typeName;
}
- (BOOL) type: (NSString *)firstTypeName conformsToType: (NSString *)secondTypeName
{
// FIXME
return [firstTypeName isEqualToString: secondTypeName];
}
- (NSString *) typeOfFile: (NSString *)absoluteFilePath error: (NSError **)outError
{
// FIXME
return [absoluteFilePath pathExtension];
}
@end
@implementation NSWorkspace (GNUstep)

View file

@ -493,6 +493,14 @@ NSString *NSWorkspaceWillPowerOffNotification =
@"NSWorkspaceWillPowerOffNotification";
NSString *NSWorkspaceWillUnmountNotification =
@"NSWorkspaceWillUnmountNotification";
NSString *NSWorkspaceDidWakeNotification =
@"NSWorkspaceDidWakeNotification";
NSString *NSWorkspaceSessionDidBecomeActiveNotification =
@"NSWorkspaceSessionDidBecomeActiveNotification";
NSString *NSWorkspaceSessionDidResignActiveNotification =
@"NSWorkspaceSessionDidResignActiveNotification";
NSString *NSWorkspaceWillSleepNotification =
@"NSWorkspaceWillSleepNotification";
/*
* NSStringDrawing NSAttributedString additions