From a8ce266293c985fc1f640816add9ec19cae45cbb Mon Sep 17 00:00:00 2001
From: Richard Frith-Macdonald
+ * This method is called by the pasteboard system when it does not have
+ * the data that has been asked for ... the pasteboard owner should
+ * supply the data to the pasteboard by calling -setData:forType: or one
+ * of the related methods.
+ */
- (void) pasteboard: (NSPasteboard*)sender
provideDataForType: (NSString*)type
andVersion: (int)version;
+#endif
+
+/**
+ * This method is called by the pasteboard system when another object
+ * takes ownership of the pasteboard ... it lets the previous owner
+ * know that it is no longer required to supply data.
+ */
- (void) pasteboardChangedOwner: (NSPasteboard*)sender;
+
@end
@interface NSPasteboard (GNUstepExtensions)
+ (NSString*) mimeTypeForPasteboardType: (NSString*)type;
+ (NSString*) pasteboardTypeForMimeType: (NSString*)mimeType;
- (void) setChangeCount: (int)count;
+- (void) setHistory: (unsigned)length;
@end
#ifndef STRICT_OPENSTEP
diff --git a/Source/NSPasteboard.m b/Source/NSPasteboard.m
index 8b8f271d4..ee585714e 100644
--- a/Source/NSPasteboard.m
+++ b/Source/NSPasteboard.m
@@ -369,14 +369,12 @@ static NSString *namePrefix = @"NSTypedFilenamesPboardType:";
* value will do.
*
Each pasteboard has an owner ... an object which declares the
- * types of data it can provide. That object is responsible for producing
- * the data for the pasteboard when it is called for (or it may send all
- * formats of data it supports to the pastebaord system before any other
- * application calls for it).
- * The pasteboard owner needs to implement the
- * -pasteboard:provideDataForType: and -pasteboardChangedOwner: methods,
- * and for extended (GNUstep specific) pastebaord support may implement
- * -pasteboard:provideDataForType:andVersion: too.
+ * types of data it can provide. Unless versions of the pasteboard data
+ * corresponding to all the declared types are written to the pasteboard,
+ * the owner is responsible for producing the data for the pasteboard when
+ * it is called for (lazy provision of data).
+ * The pasteboard owner needs to implement the methods of the
+ * NSPasteboardOwner informal protocl in order to do this.
*
GNUstep adds a mechanism for mapping between OpenStep pasteboard + * types and MIME types. This is useful for interopration with other + * systems, as MIME types have come into common usage (long after the + * OpenStep specification was created). + *
+ *The other extension to the pasteboard system produced by GNUstep + * is the ability to keep a history of recent items placed in a + * pasteboard, and retrieve data from that history rather than just + * the current item. + *
*/ -@implementation NSObject (NSPasteboardOwner) -/** - * This method is called by the pasteboard system when it does not have - * the data that has been asked for ... the pasteboard owner should - * supply the data to the pasteboard by calling -setData:forType: or one - * of the related methods. - */ -- (void) pasteboard: (NSPasteboard*)sender - provideDataForType: (NSString*)type -{ -} - -/** - * Implemented where GNUstep pasteboard extensions are required.Returns a standardised pasteboard type for file contents, * formed from the supplied file extension. *
- *Data written to a pastebaord with a file contents type should + *
Data written to a pasteboard with a file contents type should * be written using the [NSPasteboard-writeFileContents:] or * [NSPasteboard-writeFileWrapper:] method. Similarly, the data should * be read using the [NSPasteboard-readFileContentsType:toFile:] or @@ -1451,7 +1430,7 @@ NSCreateFileContentsPboardType(NSString *fileType) *
Returns a standardised pasteboard type for file names, * formed from the supplied file extension. *
- *Data written to a pastebaord with a file names type should + *
Data written to a pasteboard with a file names type should
* be a single name writen using [NSPasteboard-setString:forType:] or
* an array of strings written using
* [NSPasteboard-setPropertyList:forType:].