mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Added NSDataLinkManager methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21711 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7f1de7d268
commit
d163516298
4 changed files with 39 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-09-10 17:02 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Source/externs.m: Added constants for data link.
|
||||
* Source/NSDataLink.m: Removed NSDataLinkFilenameExtension constant.
|
||||
* Source/NSDataLinkManager.m: Added implementation for
|
||||
addLinkAsMarker:at:, addLinkPreviouslyAt:fromPasteboard:at:.
|
||||
|
||||
2005-09-10 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* configure.ac: Check for libgib if libungif is not found.
|
||||
|
|
|
@ -35,9 +35,6 @@
|
|||
#include "AppKit/NSSavePanel.h"
|
||||
#include "AppKit/NSSelection.h"
|
||||
|
||||
// constants
|
||||
NSString *NSDataLinkFilenameExtension = @"dlink";
|
||||
|
||||
@implementation NSDataLink
|
||||
|
||||
//
|
||||
|
|
|
@ -29,8 +29,10 @@
|
|||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSArchiver.h>
|
||||
#include <AppKit/NSDataLinkManager.h>
|
||||
#include <AppKit/NSDataLink.h>
|
||||
#include <AppKit/NSPasteboard.h>
|
||||
|
||||
@interface NSDataLink (Private)
|
||||
- (void) setLastUpdateTime: (NSDate *)date;
|
||||
|
@ -158,13 +160,26 @@
|
|||
- (BOOL)addLinkAsMarker:(NSDataLink *)link
|
||||
at:(NSSelection *)selection
|
||||
{
|
||||
return NO;
|
||||
// FIXME: Marker?
|
||||
return [self addLink: link at: selection];
|
||||
}
|
||||
|
||||
- (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection
|
||||
fromPasteboard:(NSPasteboard *)pasteboard
|
||||
at:(NSSelection *)selection
|
||||
{
|
||||
NSData *data = [pasteboard dataForType: NSDataLinkPboardType];
|
||||
NSArray *links = [NSUnarchiver unarchiveObjectWithData: data];
|
||||
NSEnumerator *en = [links objectEnumerator];
|
||||
NSDataLink *link = nil;
|
||||
|
||||
while((link = [en nextObject]) != nil)
|
||||
{
|
||||
if([link destinationSelection] == oldSelection)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -197,26 +212,41 @@
|
|||
//
|
||||
- (void)noteDocumentClosed
|
||||
{
|
||||
if([delegate respondsToSelector: @selector(dataLinkManagerCloseDocument:)])
|
||||
{
|
||||
[delegate dataLinkManagerCloseDocument: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)noteDocumentEdited
|
||||
{
|
||||
if([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
||||
{
|
||||
[delegate dataLinkManagerDidEditLinks: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)noteDocumentReverted
|
||||
{
|
||||
if([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
||||
{
|
||||
[delegate dataLinkManagerDidEditLinks: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)noteDocumentSaved
|
||||
{
|
||||
// implemented by subclass
|
||||
}
|
||||
|
||||
- (void)noteDocumentSavedAs:(NSString *)path
|
||||
{
|
||||
// implemented by subclass
|
||||
}
|
||||
|
||||
- (void)noteDocumentSavedTo:(NSString *)path
|
||||
{
|
||||
// implemented by subclass
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -145,7 +145,7 @@ NSString *NSControlTextDidChangeNotification =
|
|||
@"NSControlTextDidChangeNotification";
|
||||
|
||||
// NSDataLink global strings
|
||||
NSString *NSDataLinkFileNameExtension = @"dlf";
|
||||
NSString *NSDataLinkFilenameExtension = @"dlf";
|
||||
|
||||
// NSDrawer notifications
|
||||
NSString *NSDrawerDidCloseNotification =
|
||||
|
|
Loading…
Reference in a new issue