mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:50:48 +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
27e8abeb3d
commit
f2186c6cee
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>
|
2005-09-10 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* configure.ac: Check for libgib if libungif is not found.
|
* configure.ac: Check for libgib if libungif is not found.
|
||||||
|
|
|
@ -35,9 +35,6 @@
|
||||||
#include "AppKit/NSSavePanel.h"
|
#include "AppKit/NSSavePanel.h"
|
||||||
#include "AppKit/NSSelection.h"
|
#include "AppKit/NSSelection.h"
|
||||||
|
|
||||||
// constants
|
|
||||||
NSString *NSDataLinkFilenameExtension = @"dlink";
|
|
||||||
|
|
||||||
@implementation NSDataLink
|
@implementation NSDataLink
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,8 +29,10 @@
|
||||||
#include <Foundation/NSDictionary.h>
|
#include <Foundation/NSDictionary.h>
|
||||||
#include <Foundation/NSEnumerator.h>
|
#include <Foundation/NSEnumerator.h>
|
||||||
#include <Foundation/NSArray.h>
|
#include <Foundation/NSArray.h>
|
||||||
|
#include <Foundation/NSArchiver.h>
|
||||||
#include <AppKit/NSDataLinkManager.h>
|
#include <AppKit/NSDataLinkManager.h>
|
||||||
#include <AppKit/NSDataLink.h>
|
#include <AppKit/NSDataLink.h>
|
||||||
|
#include <AppKit/NSPasteboard.h>
|
||||||
|
|
||||||
@interface NSDataLink (Private)
|
@interface NSDataLink (Private)
|
||||||
- (void) setLastUpdateTime: (NSDate *)date;
|
- (void) setLastUpdateTime: (NSDate *)date;
|
||||||
|
@ -158,13 +160,26 @@
|
||||||
- (BOOL)addLinkAsMarker:(NSDataLink *)link
|
- (BOOL)addLinkAsMarker:(NSDataLink *)link
|
||||||
at:(NSSelection *)selection
|
at:(NSSelection *)selection
|
||||||
{
|
{
|
||||||
return NO;
|
// FIXME: Marker?
|
||||||
|
return [self addLink: link at: selection];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection
|
- (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection
|
||||||
fromPasteboard:(NSPasteboard *)pasteboard
|
fromPasteboard:(NSPasteboard *)pasteboard
|
||||||
at:(NSSelection *)selection
|
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;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,26 +212,41 @@
|
||||||
//
|
//
|
||||||
- (void)noteDocumentClosed
|
- (void)noteDocumentClosed
|
||||||
{
|
{
|
||||||
|
if([delegate respondsToSelector: @selector(dataLinkManagerCloseDocument:)])
|
||||||
|
{
|
||||||
|
[delegate dataLinkManagerCloseDocument: self];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)noteDocumentEdited
|
- (void)noteDocumentEdited
|
||||||
{
|
{
|
||||||
|
if([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
||||||
|
{
|
||||||
|
[delegate dataLinkManagerDidEditLinks: self];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)noteDocumentReverted
|
- (void)noteDocumentReverted
|
||||||
{
|
{
|
||||||
|
if([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
||||||
|
{
|
||||||
|
[delegate dataLinkManagerDidEditLinks: self];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)noteDocumentSaved
|
- (void)noteDocumentSaved
|
||||||
{
|
{
|
||||||
|
// implemented by subclass
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)noteDocumentSavedAs:(NSString *)path
|
- (void)noteDocumentSavedAs:(NSString *)path
|
||||||
{
|
{
|
||||||
|
// implemented by subclass
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)noteDocumentSavedTo:(NSString *)path
|
- (void)noteDocumentSavedTo:(NSString *)path
|
||||||
{
|
{
|
||||||
|
// implemented by subclass
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -145,7 +145,7 @@ NSString *NSControlTextDidChangeNotification =
|
||||||
@"NSControlTextDidChangeNotification";
|
@"NSControlTextDidChangeNotification";
|
||||||
|
|
||||||
// NSDataLink global strings
|
// NSDataLink global strings
|
||||||
NSString *NSDataLinkFileNameExtension = @"dlf";
|
NSString *NSDataLinkFilenameExtension = @"dlf";
|
||||||
|
|
||||||
// NSDrawer notifications
|
// NSDrawer notifications
|
||||||
NSString *NSDrawerDidCloseNotification =
|
NSString *NSDrawerDidCloseNotification =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue