Skip to content

Improvements to existing NSDataLink code #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Headers/Additions/GNUstepGUI/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

/* Do we have inotify */
#undef HAVE_INOTIFY_H

/* Define for those who don't have rintf and/or rint */
#ifndef HAVE_RINTF
Expand Down
26 changes: 13 additions & 13 deletions Headers/AppKit/NSDataLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,25 @@ APPKIT_EXPORT_CLASS
// Attributes
@private
// link info.
NSDataLinkNumber linkNumber;
NSDataLinkDisposition disposition;
NSDataLinkUpdateMode updateMode;
NSDataLinkNumber _linkNumber;
NSDataLinkDisposition _disposition;
NSDataLinkUpdateMode _updateMode;

// info about the source.
NSDate *lastUpdateTime;
NSString *sourceApplicationName;
NSString *sourceFilename;
NSSelection *sourceSelection;
id sourceManager;
NSDate *_lastUpdateTime;
NSString *_sourceApplicationName;
NSString *_sourceFilename;
NSSelection *_sourceSelection;
id _sourceManager;

// info about the destination
NSString *destinationApplicationName;
NSString *destinationFilename;
NSSelection *destinationSelection;
id destinationManager;
NSString *_destinationApplicationName;
NSString *_destinationFilename;
NSSelection *_destinationSelection;
id _destinationManager;

// types.
NSArray *types;
NSArray *_types;

// other flags
struct __linkFlags {
Expand Down
100 changes: 52 additions & 48 deletions Headers/AppKit/NSDataLinkManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,55 +29,59 @@

#ifndef _GNUstep_H_NSDataLinkManager
#define _GNUstep_H_NSDataLinkManager
#import <AppKit/AppKitDefines.h>

#import <Foundation/NSObject.h>
#import "AppKit/AppKitDefines.h"
#import "AppKit/NSDataLink.h"

@class NSString;
@class NSEnumerator;
@class NSMutableArray;
@class NSDataLink;
@class NSSelection;
@class NSPasteboard;
@class NSString;
@class NSSelection;
@class NSThread;
@class NSWindow;

APPKIT_EXPORT_CLASS
@interface NSDataLinkManager : NSObject <NSCoding>
{
// Attributes
id delegate;
NSString *filename;
NSMutableArray *sourceLinks;
NSMutableArray *destinationLinks;

id _delegate;
NSString *_filename;
NSMutableArray *_sourceLinks;
NSMutableArray *_destinationLinks;
NSDataLinkNumber _nextLinkNumber;
NSThread *_monitorThread;
int _inotifyFD;
NSMutableDictionary *_watchDescriptors;

struct __dlmFlags {
unsigned areLinkOutlinesVisible:1;
unsigned delegateVerifiesLinks:1;
unsigned interactsWithUser:1;
unsigned isEdited:1;
} _flags;

}

//
// Initializing and Freeing a Link Manager
//
- (id)initWithDelegate:(id)anObject;
- (id)initWithDelegate:(id)anObject
fromFile:(NSString *)path;
- (id) initWithDelegate: (id)anObject;
- (id) initWithDelegate: (id)anObject
fromFile: (NSString *)path;

//
// Adding and Removing Links
//
- (BOOL)addLink:(NSDataLink *)link
at:(NSSelection *)selection;
- (BOOL)addLinkAsMarker:(NSDataLink *)link
at:(NSSelection *)selection;
- (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection
fromPasteboard:(NSPasteboard *)pasteboard
at:(NSSelection *)selection;
- (BOOL)addLink: (NSDataLink *)link
at: (NSSelection *)selection;
- (BOOL)addLinkAsMarker: (NSDataLink *)link
at: (NSSelection *)selection;
- (NSDataLink *)addLinkPreviouslyAt: (NSSelection *)oldSelection
fromPasteboard: (NSPasteboard *)pasteboard
at: (NSSelection *)selection;
- (void)breakAllLinks;
- (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard;
- (void)writeLinksToPasteboard: (NSPasteboard *)pasteboard;

//
// Informing the Link Manager of Document Status
Expand All @@ -86,8 +90,8 @@ APPKIT_EXPORT_CLASS
- (void)noteDocumentEdited;
- (void)noteDocumentReverted;
- (void)noteDocumentSaved;
- (void)noteDocumentSavedAs:(NSString *)path;
- (void)noteDocumentSavedTo:(NSString *)path;
- (void)noteDocumentSavedAs: (NSString *)path;
- (void)noteDocumentSavedTo: (NSString *)path;

//
// Getting and Setting Information about the Link Manager
Expand All @@ -97,16 +101,16 @@ APPKIT_EXPORT_CLASS
- (NSString *)filename;
- (BOOL)interactsWithUser;
- (BOOL)isEdited;
- (void)setDelegateVerifiesLinks:(BOOL)flag;
- (void)setInteractsWithUser:(BOOL)flag;
- (void)setDelegateVerifiesLinks: (BOOL)flag;
- (void)setInteractsWithUser: (BOOL)flag;

//
// Getting and Setting Information about the Manager's Links
//
- (BOOL)areLinkOutlinesVisible;
- (NSEnumerator *)destinationLinkEnumerator;
- (NSDataLink *)destinationLinkWithSelection:(NSSelection *)destSel;
- (void)setLinkOutlinesVisible:(BOOL)flag;
- (NSDataLink *)destinationLinkWithSelection: (NSSelection *)destSel;
- (void)setLinkOutlinesVisible: (BOOL)flag;
- (NSEnumerator *)sourceLinkEnumerator;
@end

Expand All @@ -116,29 +120,29 @@ APPKIT_EXPORT_CLASS
//
@interface NSObject (NSDataLinkManagerDelegate)
// data link management methods.
- (void)dataLinkManager:(NSDataLinkManager *)sender
didBreakLink:(NSDataLink *)link;
- (BOOL)dataLinkManager:(NSDataLinkManager *)sender
isUpdateNeededForLink:(NSDataLink *)link;
- (void)dataLinkManager:(NSDataLinkManager *)sender
startTrackingLink:(NSDataLink *)link;
- (void)dataLinkManager:(NSDataLinkManager *)sender
stopTrackingLink:(NSDataLink *)link;
- (void)dataLinkManagerCloseDocument:(NSDataLinkManager *)sender;
- (void)dataLinkManagerDidEditLinks:(NSDataLinkManager *)sender;
- (void)dataLinkManagerRedrawLinkOutlines:(NSDataLinkManager *)sender;
- (BOOL)dataLinkManagerTracksLinksIndividually:(NSDataLinkManager *)sender;
- (void)dataLinkManager: (NSDataLinkManager *)sender
didBreakLink: (NSDataLink *)link;
- (BOOL)dataLinkManager: (NSDataLinkManager *)sender
isUpdateNeededForLink: (NSDataLink *)link;
- (void)dataLinkManager: (NSDataLinkManager *)sender
startTrackingLink: (NSDataLink *)link;
- (void)dataLinkManager: (NSDataLinkManager *)sender
stopTrackingLink: (NSDataLink *)link;
- (void)dataLinkManagerCloseDocument: (NSDataLinkManager *)sender;
- (void)dataLinkManagerDidEditLinks: (NSDataLinkManager *)sender;
- (void)dataLinkManagerRedrawLinkOutlines: (NSDataLinkManager *)sender;
- (BOOL)dataLinkManagerTracksLinksIndividually: (NSDataLinkManager *)sender;

// selection management methods.
- (BOOL)copyToPasteboard:(NSPasteboard *)pasteboard
at:(NSSelection *)selection
cheapCopyAllowed:(BOOL)flag;
- (BOOL)importFile:(NSString *)filename
at:(NSSelection *)selection;
- (BOOL)pasteFromPasteboard:(NSPasteboard *)pasteboard
at:(NSSelection *)selection;
- (BOOL)showSelection:(NSSelection *)selection;
- (NSWindow *)windowForSelection:(NSSelection *)selection;
- (BOOL)copyToPasteboard: (NSPasteboard *)pasteboard
at: (NSSelection *)selection
cheapCopyAllowed: (BOOL)flag;
- (BOOL)importFile: (NSString *)filename
at: (NSSelection *)selection;
- (BOOL)pasteFromPasteboard: (NSPasteboard *)pasteboard
at: (NSSelection *)selection;
- (BOOL)showSelection: (NSSelection *)selection;
- (NSWindow *)windowForSelection: (NSSelection *)selection;
@end


Expand Down
156 changes: 10 additions & 146 deletions Panels/English.lproj/GSDataLinkPanel.gorm/data.classes
Original file line number Diff line number Diff line change
@@ -1,144 +1,8 @@
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
FirstResponder = {
Actions = (
"activateContextHelpMode:",
"alignCenter:",
"alignJustified:",
"alignLeft:",
"alignRight:",
"arrangeInFront:",
"cancel:",
"capitalizeWord:",
"changeColor:",
"changeFont:",
"checkSpelling:",
"close:",
"complete:",
"copy:",
"copyFont:",
"copyRuler:",
"cut:",
"delete:",
"deleteBackward:",
"deleteForward:",
"deleteToBeginningOfLine:",
"deleteToBeginningOfParagraph:",
"deleteToEndOfLine:",
"deleteToEndOfParagraph:",
"deleteToMark:",
"deleteWordBackward:",
"deleteWordForward:",
"deminiaturize:",
"deselectAll:",
"fax:",
"hide:",
"hideOtherApplications:",
"indent:",
"loosenKerning:",
"lowerBaseline:",
"lowercaseWord:",
"makeKeyAndOrderFront:",
"miniaturize:",
"miniaturizeAll:",
"moveBackward:",
"moveBackwardAndModifySelection:",
"moveDown:",
"moveDownAndModifySelection:",
"moveForward:",
"moveForwardAndModifySelection:",
"moveLeft:",
"moveRight:",
"moveToBeginningOfDocument:",
"moveToBeginningOfLine:",
"moveToBeginningOfParagraph:",
"moveToEndOfDocument:",
"moveToEndOfLine:",
"moveToEndOfParagraph:",
"moveUp:",
"moveUpAndModifySelection:",
"moveWordBackward:",
"moveWordBackwardAndModifySelection:",
"moveWordForward:",
"moveWordForwardAndModifySelection:",
"newDocument:",
"ok:",
"openDocument:",
"orderBack:",
"orderFront:",
"orderFrontColorPanel:",
"orderFrontDataLinkPanel:",
"orderFrontFontPanel:",
"orderFrontHelpPanel:",
"orderFrontStandardAboutPanel:",
"orderFrontStandardInfoPanel:",
"orderOut:",
"pageDown:",
"pageUp:",
"paste:",
"pasteAsPlainText:",
"pasteAsRichText:",
"pasteFont:",
"pasteRuler:",
"performClose:",
"performMiniaturize:",
"performZoom:",
"print:",
"raiseBaseline:",
"revertDocumentToSaved:",
"runPageLayout:",
"runToolbarCustomizationPalette:",
"saveAllDocuments:",
"saveDocument:",
"saveDocumentAs:",
"saveDocumentTo:",
"scrollLineDown:",
"scrollLineUp:",
"scrollPageDown:",
"scrollPageUp:",
"scrollViaScroller:",
"selectAll:",
"selectLine:",
"selectNextKeyView:",
"selectParagraph:",
"selectPreviousKeyView:",
"selectText:",
"selectText:",
"selectToMark:",
"selectWord:",
"showContextHelp:",
"showGuessPanel:",
"showHelp:",
"showWindow:",
"stop:",
"subscript:",
"superscript:",
"swapWithMark:",
"takeDoubleValueFrom:",
"takeFloatValueFrom:",
"takeIntValueFrom:",
"takeObjectValueFrom:",
"takeStringValueFrom:",
"terminate:",
"tightenKerning:",
"toggle:",
"toggleContinuousSpellChecking:",
"toggleRuler:",
"toggleToolbarShown:",
"toggleTraditionalCharacterShape:",
"transpose:",
"transposeWords:",
"turnOffKerning:",
"turnOffLigatures:",
"underline:",
"unhide:",
"unhideAllApplications:",
"unscript:",
"uppercaseWord:",
"useAllLigatures:",
"useStandardKerning:",
"useStandardLigatures:",
"yank:",
"zoom:"
"orderFrontFontPanel:"
);
Super = NSObject;
};
Expand All @@ -159,14 +23,14 @@
"pickedBreakAllLinks:"
);
Outlets = (
_updateModeButton,
_breakAllLinksButton,
_breakLinkButton,
_updateDestinationButton,
_openSourceButton,
_lastUpdateField,
_sourceField,
_updateView
"_updateModeButton",
"_breakAllLinksButton",
"_breakLinkButton",
"_updateDestinationButton",
"_openSourceButton",
"_lastUpdateField",
"_sourceField",
"_updateView"
);
Super = NSPanel;
};
Expand Down
Binary file modified Panels/English.lproj/GSDataLinkPanel.gorm/data.info
Binary file not shown.
Binary file modified Panels/English.lproj/GSDataLinkPanel.gorm/objects.gorm
Binary file not shown.
Loading