mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:40:47 +00:00
Some more (empty) Cocoa methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18751 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bbb2d2da0c
commit
17e9214321
6 changed files with 337 additions and 92 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2004-02-29 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Header/AppKit/NSTableView.h:
|
||||||
|
* Header/AppKit/NSSavePanel.h:
|
||||||
|
* Source/NSTableView.m:
|
||||||
|
* Source/NSSavePanel.m:
|
||||||
|
Declared some more MacOSX 10.3 methods and added place holders for
|
||||||
|
them.
|
||||||
|
* Source/NSTextView.m:
|
||||||
|
Implemented keyed unarchiving.
|
||||||
|
|
||||||
2004-02-29 Adam Fedor <fedor@gnu.org>
|
2004-02-29 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Headers/AppKit/NSPageLayout.h: Update tags.
|
* Headers/AppKit/NSPageLayout.h: Update tags.
|
||||||
|
|
|
@ -98,10 +98,16 @@ enum {
|
||||||
- (NSString *) prompt;
|
- (NSString *) prompt;
|
||||||
|
|
||||||
#ifndef STRICT_OPENSTEP
|
#ifndef STRICT_OPENSTEP
|
||||||
|
- (void) setNameFieldLabel: (NSString *)label;
|
||||||
|
- (NSString *) nameFieldLabel;
|
||||||
|
- (void) setMessage: (NSString *)message;
|
||||||
|
- (NSString *) message;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hidding extensions
|
* Hidding extensions
|
||||||
*/
|
*/
|
||||||
- (void) setCanSelectHiddenExtension: (BOOL) flag;
|
- (void) setCanSelectHiddenExtension: (BOOL) flag;
|
||||||
|
- (BOOL) canSelectHiddenExtension;
|
||||||
- (BOOL) isExtensionHidden;
|
- (BOOL) isExtensionHidden;
|
||||||
- (void) setExtensionHidden: (BOOL) flag;
|
- (void) setExtensionHidden: (BOOL) flag;
|
||||||
#endif
|
#endif
|
||||||
|
@ -113,11 +119,23 @@ enum {
|
||||||
- (void) setDirectory: (NSString *)path;
|
- (void) setDirectory: (NSString *)path;
|
||||||
- (void) setRequiredFileType: (NSString *)fileType;
|
- (void) setRequiredFileType: (NSString *)fileType;
|
||||||
|
|
||||||
|
#ifndef STRICT_OPENSTEP
|
||||||
|
- (void) setAllowedFileTypes: (NSArray *)types;
|
||||||
|
- (void) setAllowsOtherFileTypes: (BOOL)flag;
|
||||||
|
- (NSArray *) allowedFileTypes;
|
||||||
|
- (BOOL) allowsOtherFileTypes;
|
||||||
|
#endif
|
||||||
|
|
||||||
- (void) setTreatsFilePackagesAsDirectories: (BOOL)flag;
|
- (void) setTreatsFilePackagesAsDirectories: (BOOL)flag;
|
||||||
- (BOOL) treatsFilePackagesAsDirectories;
|
- (BOOL) treatsFilePackagesAsDirectories;
|
||||||
|
|
||||||
- (void) validateVisibleColumns;
|
- (void) validateVisibleColumns;
|
||||||
|
|
||||||
|
#ifndef STRICT_OPENSTEP
|
||||||
|
- (void) setCanCreateDirectories: (BOOL)flag;
|
||||||
|
- (BOOL) canCreateDirectories;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Running the NSSavePanel
|
* Running the NSSavePanel
|
||||||
*/
|
*/
|
||||||
|
@ -182,6 +200,12 @@ enum {
|
||||||
- (NSString *)panel: (id)sender
|
- (NSString *)panel: (id)sender
|
||||||
userEnteredFilename: (NSString *)fileName
|
userEnteredFilename: (NSString *)fileName
|
||||||
confirmed: (BOOL)okFlag;
|
confirmed: (BOOL)okFlag;
|
||||||
|
|
||||||
|
#ifndef STRICT_OPENSTEP
|
||||||
|
- (void) panel: (id)sender willExpand: (BOOL)expanding;
|
||||||
|
- (void) panelSelectionDidChange: (id)sender;
|
||||||
|
- (void) panel: (id)sender directoryDidChange: (NSString *)path;
|
||||||
|
#endif
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif /* _GNUstep_H_NSSavePanel */
|
#endif /* _GNUstep_H_NSSavePanel */
|
||||||
|
|
|
@ -31,8 +31,10 @@
|
||||||
|
|
||||||
#include <AppKit/NSControl.h>
|
#include <AppKit/NSControl.h>
|
||||||
#include <AppKit/NSDragging.h>
|
#include <AppKit/NSDragging.h>
|
||||||
|
#include <AppKit/NSUserInterfaceValidation.h>
|
||||||
|
|
||||||
@class NSArray;
|
@class NSArray;
|
||||||
|
@class NSIndexSet;
|
||||||
@class NSTableColumn;
|
@class NSTableColumn;
|
||||||
@class NSTableHeaderView;
|
@class NSTableHeaderView;
|
||||||
@class NSText;
|
@class NSText;
|
||||||
|
@ -43,7 +45,13 @@ typedef enum _NSTableViewDropOperation {
|
||||||
NSTableViewDropAbove
|
NSTableViewDropAbove
|
||||||
} NSTableViewDropOperation;
|
} NSTableViewDropOperation;
|
||||||
|
|
||||||
@interface NSTableView : NSControl
|
enum {
|
||||||
|
NSTableViewGridNone = 0,
|
||||||
|
NSTableViewSolidVerticalGridLineMask = 1,
|
||||||
|
NSTableViewSolidHorizontalGridLineMask = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
@interface NSTableView : NSControl <NSUserInterfaceValidations>
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Real Ivars
|
* Real Ivars
|
||||||
|
@ -114,18 +122,6 @@ typedef enum _NSTableViewDropOperation {
|
||||||
BOOL _tilingDisabled;
|
BOOL _tilingDisabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Table Dimensions */
|
|
||||||
- (int) numberOfColumns;
|
|
||||||
- (int) numberOfRows;
|
|
||||||
|
|
||||||
/* Columns */
|
|
||||||
- (void) addTableColumn: (NSTableColumn *)aColumn;
|
|
||||||
- (void) removeTableColumn: (NSTableColumn *)aColumn;
|
|
||||||
- (void) moveColumn: (int)columnIndex toColumn: (int)newIndex;
|
|
||||||
- (NSArray *) tableColumns;
|
|
||||||
- (int) columnWithIdentifier: (id)identifier;
|
|
||||||
- (NSTableColumn *) tableColumnWithIdentifier: (id)anObject;
|
|
||||||
|
|
||||||
/* Data Source */
|
/* Data Source */
|
||||||
- (void) setDataSource: (id)anObject;
|
- (void) setDataSource: (id)anObject;
|
||||||
- (id) dataSource;
|
- (id) dataSource;
|
||||||
|
@ -158,10 +154,24 @@ typedef enum _NSTableViewDropOperation {
|
||||||
- (float) rowHeight;
|
- (float) rowHeight;
|
||||||
- (void) setBackgroundColor: (NSColor *)aColor;
|
- (void) setBackgroundColor: (NSColor *)aColor;
|
||||||
- (NSColor *) backgroundColor;
|
- (NSColor *) backgroundColor;
|
||||||
|
- (void) setUsesAlternatingRowBackgroundColors: (BOOL)useAlternatingRowColors;
|
||||||
|
- (BOOL) usesAlternatingRowBackgroundColors;
|
||||||
|
|
||||||
|
/* Columns */
|
||||||
|
- (void) addTableColumn: (NSTableColumn *)aColumn;
|
||||||
|
- (void) removeTableColumn: (NSTableColumn *)aColumn;
|
||||||
|
- (void) moveColumn: (int)columnIndex toColumn: (int)newIndex;
|
||||||
|
- (NSArray *) tableColumns;
|
||||||
|
- (int) columnWithIdentifier: (id)identifier;
|
||||||
|
- (NSTableColumn *) tableColumnWithIdentifier: (id)anObject;
|
||||||
|
|
||||||
/* Selecting Columns and Rows */
|
/* Selecting Columns and Rows */
|
||||||
- (void) selectColumn: (int) columnIndex byExtendingSelection: (BOOL)flag;
|
- (void) selectColumn: (int) columnIndex byExtendingSelection: (BOOL)flag;
|
||||||
- (void) selectRow: (int) rowIndex byExtendingSelection: (BOOL)flag;
|
- (void) selectRow: (int) rowIndex byExtendingSelection: (BOOL)flag;
|
||||||
|
- (void) selectColumnIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend;
|
||||||
|
- (void) selectRowIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend;
|
||||||
|
- (NSIndexSet *) selectedColumnIndexes;
|
||||||
|
- (NSIndexSet *) selectedRowIndexes;
|
||||||
- (void) deselectColumn: (int)columnIndex;
|
- (void) deselectColumn: (int)columnIndex;
|
||||||
- (void) deselectRow: (int)rowIndex;
|
- (void) deselectRow: (int)rowIndex;
|
||||||
- (int) numberOfSelectedColumns;
|
- (int) numberOfSelectedColumns;
|
||||||
|
@ -175,11 +185,17 @@ typedef enum _NSTableViewDropOperation {
|
||||||
- (void) selectAll: (id)sender;
|
- (void) selectAll: (id)sender;
|
||||||
- (void) deselectAll: (id)sender;
|
- (void) deselectAll: (id)sender;
|
||||||
|
|
||||||
|
/* Table Dimensions */
|
||||||
|
- (int) numberOfColumns;
|
||||||
|
- (int) numberOfRows;
|
||||||
|
|
||||||
/* Grid Drawing attributes */
|
/* Grid Drawing attributes */
|
||||||
- (void) setDrawsGrid: (BOOL)flag;
|
- (void) setDrawsGrid: (BOOL)flag;
|
||||||
- (BOOL) drawsGrid;
|
- (BOOL) drawsGrid;
|
||||||
- (void) setGridColor: (NSColor *)aColor;
|
- (void) setGridColor: (NSColor *)aColor;
|
||||||
- (NSColor *) gridColor;
|
- (NSColor *) gridColor;
|
||||||
|
- (void) setGridStyleMask: (unsigned int)gridType;
|
||||||
|
- (unsigned int) gridStyleMask;
|
||||||
|
|
||||||
/* Editing Cells */
|
/* Editing Cells */
|
||||||
/* ALL TODOS */
|
/* ALL TODOS */
|
||||||
|
@ -208,8 +224,6 @@ typedef enum _NSTableViewDropOperation {
|
||||||
- (void) setAutoresizesAllColumnsToFit: (BOOL)flag;
|
- (void) setAutoresizesAllColumnsToFit: (BOOL)flag;
|
||||||
- (BOOL) autoresizesAllColumnsToFit;
|
- (BOOL) autoresizesAllColumnsToFit;
|
||||||
- (void) sizeLastColumnToFit;
|
- (void) sizeLastColumnToFit;
|
||||||
// - (void) sizeToFit; inherited from NSControl
|
|
||||||
- (void) setFrame: (NSRect) frameRect;
|
|
||||||
- (void) noteNumberOfRowsChanged;
|
- (void) noteNumberOfRowsChanged;
|
||||||
- (void) tile;
|
- (void) tile;
|
||||||
|
|
||||||
|
|
|
@ -796,6 +796,29 @@ selectCellWithString: (NSString*)title
|
||||||
return _accessoryView;
|
return _accessoryView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setNameFieldLabel: (NSString *)label
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) nameFieldLabel
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return @"Save As";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setMessage: (NSString *)message
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) message
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current path name in the Save panel's browser.
|
* Sets the current path name in the Save panel's browser.
|
||||||
* The path argument must be an absolute path name.
|
* The path argument must be an absolute path name.
|
||||||
|
@ -833,6 +856,28 @@ selectCellWithString: (NSString*)title
|
||||||
return _requiredFileType;
|
return _requiredFileType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setAllowedFileTypes: (NSArray *)types
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setAllowsOtherFileTypes: (BOOL)flag
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *) allowedFileTypes;
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) allowsOtherFileTypes;
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns YES if file packages are shown as directories. The default
|
/** Returns YES if file packages are shown as directories. The default
|
||||||
is NO. */
|
is NO. */
|
||||||
- (BOOL) treatsFilePackagesAsDirectories
|
- (BOOL) treatsFilePackagesAsDirectories
|
||||||
|
@ -867,6 +912,17 @@ selectCellWithString: (NSString*)title
|
||||||
[_browser validateVisibleColumns];
|
[_browser validateVisibleColumns];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setCanCreateDirectories: (BOOL)flag
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) canCreateDirectories
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the save panel for the user. This method invokes
|
* Shows the save panel for the user. This method invokes
|
||||||
* -runModalForDirectory:file: with empty strings for the filename.
|
* -runModalForDirectory:file: with empty strings for the filename.
|
||||||
|
@ -1131,6 +1187,11 @@ selectCellWithString: (NSString*)title
|
||||||
{
|
{
|
||||||
// FIXME
|
// FIXME
|
||||||
}
|
}
|
||||||
|
- (BOOL) canSelectHiddenExtension
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) isExtensionHidden
|
- (BOOL) isExtensionHidden
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <Foundation/NSAutoreleasePool.h>
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
#include <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
#include <Foundation/NSFormatter.h>
|
#include <Foundation/NSFormatter.h>
|
||||||
|
#include <Foundation/NSIndexSet.h>
|
||||||
#include <Foundation/NSNotification.h>
|
#include <Foundation/NSNotification.h>
|
||||||
#include <Foundation/NSSet.h>
|
#include <Foundation/NSSet.h>
|
||||||
#include <Foundation/NSUserDefaults.h>
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
@ -3387,6 +3388,16 @@ _isCellEditable (id delegate, NSArray *tableColumns,
|
||||||
{
|
{
|
||||||
return _backgroundColor;
|
return _backgroundColor;
|
||||||
}
|
}
|
||||||
|
- (void) setUsesAlternatingRowBackgroundColors: (BOOL)useAlternatingRowColors
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) usesAlternatingRowBackgroundColors
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Selecting Columns and Rows
|
* Selecting Columns and Rows
|
||||||
|
@ -3618,6 +3629,28 @@ byExtendingSelection: (BOOL)flag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) selectColumnIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) selectRowIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSIndexSet *) selectedColumnIndexes;
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSIndexSet *) selectedRowIndexes;
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) deselectColumn: (int)columnIndex
|
- (void) deselectColumn: (int)columnIndex
|
||||||
{
|
{
|
||||||
NSNumber *num = [NSNumber numberWithInt: columnIndex];
|
NSNumber *num = [NSNumber numberWithInt: columnIndex];
|
||||||
|
@ -3900,6 +3933,17 @@ byExtendingSelection: (BOOL)flag
|
||||||
return _gridColor;
|
return _gridColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setGridStyleMask: (unsigned int)gridType
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (unsigned int) gridStyleMask;
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Editing Cells
|
* Editing Cells
|
||||||
*/
|
*/
|
||||||
|
@ -5440,6 +5484,15 @@ byExtendingSelection: (BOOL)flag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) drawBackgroundInClipRect: (NSRect)clipRect
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
/*
|
||||||
|
[_backgroundColor set];
|
||||||
|
NSRectFill (clipRect);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
- (void) drawRect: (NSRect)aRect
|
- (void) drawRect: (NSRect)aRect
|
||||||
{
|
{
|
||||||
int startingRow;
|
int startingRow;
|
||||||
|
@ -5447,11 +5500,8 @@ byExtendingSelection: (BOOL)flag
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Draw background */
|
/* Draw background */
|
||||||
|
[self drawBackgroundInClipRect: aRect];
|
||||||
|
|
||||||
/*
|
|
||||||
[_backgroundColor set];
|
|
||||||
NSRectFill (aRect);
|
|
||||||
*/
|
|
||||||
if ((_numberOfRows == 0) || (_numberOfColumns == 0))
|
if ((_numberOfRows == 0) || (_numberOfColumns == 0))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -6568,6 +6618,28 @@ byExtendingSelection: (BOOL)flag
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* sorting
|
||||||
|
*/
|
||||||
|
- (void) setSortDescriptors: (NSArray *)array
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)sortDescriptors
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* User interface validation
|
||||||
|
*/
|
||||||
|
- (BOOL) validateUserInterfaceItem: (id <NSValidatedUserInterfaceItem>)anItem
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (NotificationRequestMethods)
|
* (NotificationRequestMethods)
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include <Foundation/NSCoder.h>
|
#include <Foundation/NSCoder.h>
|
||||||
#include <Foundation/NSDebug.h>
|
#include <Foundation/NSDebug.h>
|
||||||
#include <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
|
#include <Foundation/NSKeyedArchiver.h>
|
||||||
#include <Foundation/NSNotification.h>
|
#include <Foundation/NSNotification.h>
|
||||||
#include <Foundation/NSRunLoop.h>
|
#include <Foundation/NSRunLoop.h>
|
||||||
#include <Foundation/NSString.h>
|
#include <Foundation/NSString.h>
|
||||||
|
@ -121,6 +122,51 @@ Interface for a bunch of internal methods that need to be cleaned up.
|
||||||
-(void) pasteSelection;
|
-(void) pasteSelection;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
// This class is a helper for keyed unarchiving only
|
||||||
|
@interface NSTextViewSharedData : NSObject
|
||||||
|
{
|
||||||
|
@public
|
||||||
|
NSColor *backgroundColor;
|
||||||
|
NSParagraphStyle *paragraphStyle;
|
||||||
|
int flags;
|
||||||
|
NSColor *insertionColor;
|
||||||
|
NSArray *linkAttr;
|
||||||
|
NSArray *markAttr;
|
||||||
|
NSArray *selectedAttr;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation NSTextViewSharedData
|
||||||
|
|
||||||
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
|
{
|
||||||
|
if ([aDecoder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
ASSIGN(backgroundColor, [aDecoder decodeObjectForKey: @"NSBackgroundColor"]);
|
||||||
|
ASSIGN(paragraphStyle, [aDecoder decodeObjectForKey: @"NSDefaultParagraphStyle"]);
|
||||||
|
flags = [aDecoder decodeIntForKey: @"NSFlags"];
|
||||||
|
ASSIGN(insertionColor, [aDecoder decodeObjectForKey: @"NSInsertionColor"]);
|
||||||
|
ASSIGN(linkAttr, [aDecoder decodeObjectForKey: @"NSLinkAttributes"]);
|
||||||
|
ASSIGN(markAttr, [aDecoder decodeObjectForKey: @"NSMarkedAttributes"]);
|
||||||
|
ASSIGN(selectedAttr, [aDecoder decodeObjectForKey: @"NSSelectedAttributes"]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) dealloc
|
||||||
|
{
|
||||||
|
RELEASE(backgroundColor);
|
||||||
|
RELEASE(paragraphStyle);
|
||||||
|
RELEASE(insertionColor);
|
||||||
|
RELEASE(linkAttr);
|
||||||
|
RELEASE(markAttr);
|
||||||
|
RELEASE(selectedAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
/**** Misc. helpers and stuff ****/
|
/**** Misc. helpers and stuff ****/
|
||||||
|
@ -598,77 +644,80 @@ that makes decoding and encoding compatible with the old code.
|
||||||
|
|
||||||
-(id) initWithCoder: (NSCoder *)aDecoder
|
-(id) initWithCoder: (NSCoder *)aDecoder
|
||||||
{
|
{
|
||||||
int version = [aDecoder versionForClassName:
|
self = [super initWithCoder: aDecoder];
|
||||||
@"NSTextView"];
|
|
||||||
|
|
||||||
/* Common stuff for version 1 and 2. */
|
if ([aDecoder allowsKeyedCoding])
|
||||||
{
|
|
||||||
BOOL flag;
|
|
||||||
|
|
||||||
self = [super initWithCoder: aDecoder];
|
|
||||||
|
|
||||||
_delegate = [aDecoder decodeObject];
|
|
||||||
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.is_field_editor = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.is_editable = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.is_selectable = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.is_rich_text = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.imports_graphics = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.draws_background = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.is_horizontally_resizable = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.is_vertically_resizable = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.uses_font_panel = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.uses_ruler = flag;
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
_tf.is_ruler_visible = flag;
|
|
||||||
|
|
||||||
_backgroundColor = RETAIN([aDecoder decodeObject]);
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_minSize];
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_maxSize];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (version == currentVersion)
|
|
||||||
{
|
{
|
||||||
NSTextContainer *aTextContainer;
|
if ([aDecoder containsValueForKey: @"NSDelegate"])
|
||||||
BOOL flag;
|
{
|
||||||
NSSize containerSize;
|
[self setDelegate: [aDecoder decodeObjectForKey: @"NSDelegate"]];
|
||||||
|
}
|
||||||
|
if ([aDecoder containsValueForKey: @"NSMaxSize"])
|
||||||
|
{
|
||||||
|
[self setMaxSize: [aDecoder decodeSizeForKey: @"NSMaxSize"]];
|
||||||
|
}
|
||||||
|
// Is this a mistype from Apple?
|
||||||
|
if ([aDecoder containsValueForKey: @"NSMinize"])
|
||||||
|
{
|
||||||
|
[self setMinSize: [aDecoder decodeSizeForKey: @"NSMinize"]];
|
||||||
|
}
|
||||||
|
if ([aDecoder containsValueForKey: @"NSTextContainer"])
|
||||||
|
{
|
||||||
|
[self setTextContainer: [aDecoder decodeObjectForKey: @"NSTextContainer"]];
|
||||||
|
}
|
||||||
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
// FIXME set the flags, shared data, storage
|
||||||
_tf.smart_insert_delete = flag;
|
if ([aDecoder containsValueForKey: @"NSTVFlags"])
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
{
|
||||||
_tf.allows_undo = flag;
|
//int vFlags = [aDecoder decodeIntForKey: @"NSTVFlags"];
|
||||||
|
// FIXME set the flags
|
||||||
_insertionPointColor = RETAIN([aDecoder decodeObject]);
|
}
|
||||||
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &containerSize];
|
if ([aDecoder containsValueForKey: @"NSSharedData"])
|
||||||
/* build up the rest of the text system, which doesn't get stored
|
{
|
||||||
<doesn't even implement the Coding protocol>. */
|
//NSTextViewSharedData *shared = [aDecoder decodeObjectForKey: @"NSSharedData"];
|
||||||
aTextContainer = [self buildUpTextNetwork: _frame.size];
|
}
|
||||||
[aTextContainer setTextView: (NSTextView *)self];
|
if ([aDecoder containsValueForKey: @"NSTextStorage"])
|
||||||
[aTextContainer setContainerSize: containerSize];
|
{
|
||||||
|
//NSTextStorage *storage = [aDecoder decodeObjectForKey: @"NSTextStorage"];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
}
|
||||||
[aTextContainer setWidthTracksTextView: flag];
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
||||||
[aTextContainer setHeightTracksTextView: flag];
|
|
||||||
|
|
||||||
/* See initWithFrame: for comments on this RELEASE */
|
|
||||||
RELEASE(self);
|
|
||||||
}
|
}
|
||||||
else if (version == 1)
|
else
|
||||||
{
|
{
|
||||||
NSTextContainer *aTextContainer;
|
|
||||||
BOOL flag;
|
BOOL flag;
|
||||||
|
NSTextContainer *aTextContainer;
|
||||||
|
int version = [aDecoder versionForClassName:
|
||||||
|
@"NSTextView"];
|
||||||
|
|
||||||
|
/* Common stuff for version 1 and 2. */
|
||||||
|
_delegate = [aDecoder decodeObject];
|
||||||
|
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.is_field_editor = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.is_editable = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.is_selectable = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.is_rich_text = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.imports_graphics = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.draws_background = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.is_horizontally_resizable = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.is_vertically_resizable = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.uses_font_panel = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.uses_ruler = flag;
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
_tf.is_ruler_visible = flag;
|
||||||
|
|
||||||
|
_backgroundColor = RETAIN([aDecoder decodeObject]);
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_minSize];
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_maxSize];
|
||||||
|
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
_tf.smart_insert_delete = flag;
|
_tf.smart_insert_delete = flag;
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
@ -680,17 +729,31 @@ that makes decoding and encoding compatible with the old code.
|
||||||
[aTextContainer setTextView: (NSTextView *)self];
|
[aTextContainer setTextView: (NSTextView *)self];
|
||||||
/* See initWithFrame: for comments on this RELEASE */
|
/* See initWithFrame: for comments on this RELEASE */
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
|
|
||||||
|
if (version == currentVersion)
|
||||||
|
{
|
||||||
|
NSSize containerSize;
|
||||||
|
|
||||||
|
_insertionPointColor = RETAIN([aDecoder decodeObject]);
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &containerSize];
|
||||||
|
[aTextContainer setContainerSize: containerSize];
|
||||||
|
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
[aTextContainer setWidthTracksTextView: flag];
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
||||||
|
[aTextContainer setHeightTracksTextView: flag];
|
||||||
|
}
|
||||||
|
|
||||||
|
[self _recacheDelegateResponses];
|
||||||
|
[self invalidateTextContainerOrigin];
|
||||||
|
|
||||||
|
[self setPostsFrameChangedNotifications: YES];
|
||||||
|
[notificationCenter addObserver: self
|
||||||
|
selector: @selector(_updateState:)
|
||||||
|
name: NSViewFrameDidChangeNotification
|
||||||
|
object: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self _recacheDelegateResponses];
|
|
||||||
[self invalidateTextContainerOrigin];
|
|
||||||
|
|
||||||
[self setPostsFrameChangedNotifications: YES];
|
|
||||||
[notificationCenter addObserver: self
|
|
||||||
selector: @selector(_updateState:)
|
|
||||||
name: NSViewFrameDidChangeNotification
|
|
||||||
object: self];
|
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue