mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-10-07 01:23:26 +00:00
Proper Braces
This commit is contained in:
parent
e93ed1d775
commit
55c7b99e5d
@ -54,7 +54,8 @@
|
||||
}
|
||||
|
||||
- (void) setManagedObjectContext:
|
||||
(NSManagedObjectContext *) managedObjectContext {
|
||||
(NSManagedObjectContext *) managedObjectContext
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -63,7 +64,8 @@
|
||||
modelConfiguration: (NSString *) configuration
|
||||
storeOptions:
|
||||
(NSDictionary *) storeOptions
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
}
|
||||
@ -77,12 +79,12 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) setHasUndoManager: (BOOL) flag {
|
||||
/* Ignored. Always has an undo manager. */
|
||||
- (void) setHasUndoManager: (BOOL) flag
|
||||
{ /* Ignored. Always has an undo manager. */
|
||||
}
|
||||
|
||||
- (void) setUndoManager: (NSUndoManager *) undoManager {
|
||||
/* Ignored. Always uses the undo manager of its persistent context. */
|
||||
- (void) setUndoManager: (NSUndoManager *) undoManager
|
||||
{ /* Ignored. Always uses the undo manager of its persistent context. */
|
||||
}
|
||||
|
||||
- (BOOL) isDocumentEdited {
|
||||
@ -92,14 +94,16 @@
|
||||
|
||||
- (BOOL) readFromURL: (NSURL *) absoluteURL
|
||||
ofType: (NSString *) typeName
|
||||
error: (NSError **) outError {
|
||||
error: (NSError **) outError
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) revertToContentsOfURL: (NSURL *) inAbsoluteURL
|
||||
ofType: (NSString *) inTypeName
|
||||
error: (NSError **) outError {
|
||||
error: (NSError **) outError
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
}
|
||||
@ -108,7 +112,8 @@
|
||||
ofType: (NSString *) typeName
|
||||
forSaveOperation: (NSSaveOperationType) saveOperation
|
||||
originalContentsURL: (NSURL *) absoluteOriginalContentsURL
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
}
|
||||
|
||||
- initWithParent: (_NSManagedProxy *) parent
|
||||
object: (NSManagedObject *) object {
|
||||
- initWithParent: (_NSManagedProxy *) parent object: (NSManagedObject *) object
|
||||
{
|
||||
_object = [object retain];
|
||||
_entity = [parent entity];
|
||||
_entityName = [parent entityName];
|
||||
@ -137,7 +137,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
toObjectsAtIndexes: (NSIndexSet *) indexes
|
||||
forKeyPath: (NSString *) keyPath
|
||||
options: (NSKeyValueObservingOptions) options
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
NSLog(
|
||||
@"Proxy for %@ asked to observe by %@ for keypath %@ options 0x%08x\n",
|
||||
_object, observer, keyPath, options);
|
||||
@ -154,7 +155,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) removeObserver: (NSObject *) observer
|
||||
fromObjectsAtIndexes: (NSIndexSet *) indexes
|
||||
forKeyPath: (NSString *) keyPath {
|
||||
forKeyPath: (NSString *) keyPath
|
||||
{
|
||||
}
|
||||
|
||||
- (void) notifyObserver: (_NSManagedProxy_observerInfo *) observerInfo {
|
||||
|
@ -37,7 +37,8 @@
|
||||
}
|
||||
|
||||
- (BOOL) filenameExtension: (NSString *) extension
|
||||
isValidForType: (NSString *) type {
|
||||
isValidForType: (NSString *) type
|
||||
{
|
||||
// TODO: call UTTypeCreateAllIdentifiersForTag
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
@ -78,14 +79,16 @@
|
||||
- (BOOL) openFile: (NSString *) path
|
||||
fromImage: (NSImage *) image
|
||||
at: (NSPoint) point
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) openFile: (NSString *) path
|
||||
withApplication: (NSString *) application
|
||||
andDeactivate: (BOOL) deactivate {
|
||||
andDeactivate: (BOOL) deactivate
|
||||
{
|
||||
// TODO: call LSOpenFromURLSpec()
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
@ -98,7 +101,8 @@
|
||||
}
|
||||
|
||||
- (BOOL) selectFile: (NSString *) path
|
||||
inFileViewerRootedAtPath: (NSString *) rootedAtPath {
|
||||
inFileViewerRootedAtPath: (NSString *) rootedAtPath
|
||||
{
|
||||
// TODO: call activateFileViewerSelectingURLs
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
@ -111,7 +115,8 @@
|
||||
source: (NSString *) source
|
||||
destination: (NSString *) destination
|
||||
files: (NSArray *) files
|
||||
tag: (NSInteger *) tag {
|
||||
tag: (NSInteger *) tag
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -120,7 +125,8 @@
|
||||
isWritable: (BOOL *) isWritable
|
||||
isUnmountable: (BOOL *) isUnmountable
|
||||
description: (NSString **) description
|
||||
type: (NSString **) type {
|
||||
type: (NSString **) type
|
||||
{
|
||||
if (!path)
|
||||
return NO;
|
||||
|
||||
@ -132,7 +138,8 @@
|
||||
|
||||
- (BOOL) getInfoForFile: (NSString *) path
|
||||
application: (NSString **) application
|
||||
type: (NSString **) type {
|
||||
type: (NSString **) type
|
||||
{
|
||||
// TODO: call LSGetApplicationForURL()
|
||||
NSUnimplementedMethod();
|
||||
return NO;
|
||||
@ -220,7 +227,8 @@
|
||||
|
||||
- (BOOL) launchApplication: (NSString *) application
|
||||
showIcon: (BOOL) showIcon
|
||||
autolaunch: (BOOL) autolaunch {
|
||||
autolaunch: (BOOL) autolaunch
|
||||
{
|
||||
return [self openFile: nil withApplication: application andDeactivate: YES];
|
||||
}
|
||||
|
||||
@ -243,7 +251,8 @@
|
||||
|
||||
- (BOOL) setIcon: (NSImage *) image
|
||||
forFile: (NSString *) fullPath
|
||||
options: (NSWorkspaceIconCreationOptions) options {
|
||||
options: (NSWorkspaceIconCreationOptions) options
|
||||
{
|
||||
// For directories, we would call the NSFileManager to create a file named
|
||||
// "Icon\r" with icon data. For files, we would call
|
||||
// FSCreateResFile/FSOpenResFile, FSSetCatalogInfo and other historical
|
||||
@ -261,8 +270,8 @@
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (NSURL *) URLForApplicationWithBundleIdentifier:
|
||||
(NSString *) bundleIdentifier {
|
||||
- (NSURL *) URLForApplicationWithBundleIdentifier: (NSString *) bundleIdentifier
|
||||
{
|
||||
CFURLRef url;
|
||||
OSStatus status = LSFindApplicationForInfo(
|
||||
kLSUnknownCreator, (CFStringRef) bundleIdentifier, NULL, NULL, &url);
|
||||
|
@ -104,7 +104,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
defaultButton: (NSString *) defaultTitle
|
||||
alternateButton: (NSString *) alternateTitle
|
||||
otherButton: (NSString *) otherTitle
|
||||
informativeTextWithFormat: (NSString *) format, ... {
|
||||
informativeTextWithFormat: (NSString *) format, ...
|
||||
{
|
||||
va_list arguments;
|
||||
NSString *informativeText;
|
||||
|
||||
@ -503,7 +504,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) sheetDidEnd: (NSWindow *) sheet
|
||||
returnCode: (int) returnCode
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
typedef void (*alertDidEnd)(id, SEL, NSAlert *, int, void *);
|
||||
if (_sheetDidEnd) {
|
||||
alertDidEnd endFunction =
|
||||
@ -518,7 +520,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) beginSheetModalForWindow: (NSWindow *) window
|
||||
modalDelegate: delegate
|
||||
didEndSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
[_window setStyleMask: NSDocModalWindowMask];
|
||||
[self layoutIfNeeded];
|
||||
[_window setDefaultButtonCell: [[_buttons objectAtIndex: 0] cell]];
|
||||
|
@ -40,7 +40,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
defaultButton: (NSString *) defaultTitle
|
||||
alternateButton: (NSString *) alternateTitle
|
||||
otherButton: (NSString *) otherTitle
|
||||
sheet: (BOOL) sheet {
|
||||
sheet: (BOOL) sheet
|
||||
{
|
||||
NSImage *image = [NSImage imageNamed: @"NSAlertPanelExclamation"];
|
||||
NSSize imageSize = [image size];
|
||||
NSSize size = {640, 480};
|
||||
|
@ -35,7 +35,8 @@ NSString *NSAnimationRunLoopMode = @"NSAnimationRunLoopMode";
|
||||
@implementation NSAnimation
|
||||
|
||||
- initWithDuration: (NSTimeInterval) duration
|
||||
animationCurve: (NSAnimationCurve) curve {
|
||||
animationCurve: (NSAnimationCurve) curve
|
||||
{
|
||||
_duration = duration;
|
||||
_curve = curve;
|
||||
_frameRate = 10;
|
||||
@ -238,12 +239,14 @@ NSString *NSAnimationRunLoopMode = @"NSAnimationRunLoopMode";
|
||||
}
|
||||
|
||||
- (void) startWhenAnimation: (NSAnimation *) animation
|
||||
reachesProgress: (NSAnimationProgress) progress {
|
||||
reachesProgress: (NSAnimationProgress) progress
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) stopWhenAnimation: (NSAnimation *) animation
|
||||
reachesProgress: (NSAnimationProgress) progress {
|
||||
reachesProgress: (NSAnimationProgress) progress
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
|
@ -105,9 +105,8 @@ NSApplication *NSApp = nil;
|
||||
return NSApp;
|
||||
}
|
||||
|
||||
+ (void) detachDrawingThread: (SEL) selector
|
||||
toTarget: target
|
||||
withObject: object {
|
||||
+ (void) detachDrawingThread: (SEL) selector toTarget: target withObject: object
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -422,7 +421,8 @@ NSApplication *NSApp = nil;
|
||||
|
||||
- (void) addWindowsItem: (NSWindow *) window
|
||||
title: (NSString *) title
|
||||
filename: (BOOL) isFilename {
|
||||
filename: (BOOL) isFilename
|
||||
{
|
||||
NSMenuItem *item;
|
||||
|
||||
if ([[self windowsMenu]
|
||||
@ -445,7 +445,8 @@ NSApplication *NSApp = nil;
|
||||
|
||||
- (void) changeWindowsItem: (NSWindow *) window
|
||||
title: (NSString *) title
|
||||
filename: (BOOL) isFilename {
|
||||
filename: (BOOL) isFilename
|
||||
{
|
||||
|
||||
if ([title length] == 0) {
|
||||
// Windows with no name aren't in the Windows menu
|
||||
@ -725,7 +726,8 @@ NSApplication *NSApp = nil;
|
||||
- (NSEvent *) nextEventMatchingMask: (NSEventMask) mask
|
||||
untilDate: (NSDate *) untilDate
|
||||
inMode: (NSRunLoopMode) mode
|
||||
dequeue: (BOOL) dequeue {
|
||||
dequeue: (BOOL) dequeue
|
||||
{
|
||||
NSEvent *nextEvent = nil;
|
||||
|
||||
do {
|
||||
@ -785,7 +787,8 @@ NSApplication *NSApp = nil;
|
||||
}
|
||||
|
||||
- (void) discardEventsMatchingMask: (NSEventMask) mask
|
||||
beforeEvent: (NSEvent *) event {
|
||||
beforeEvent: (NSEvent *) event
|
||||
{
|
||||
[_display discardEventsMatchingMask: mask beforeEvent: event];
|
||||
}
|
||||
|
||||
@ -1062,7 +1065,8 @@ NSApplication *NSApp = nil;
|
||||
modalForWindow: (NSWindow *) window
|
||||
modalDelegate: (id) modalDelegate
|
||||
didEndSelector: (SEL) didEndSelector
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
NSSheetContext *context =
|
||||
[NSSheetContext sheetContextWithSheet: sheet
|
||||
modalDelegate: modalDelegate
|
||||
@ -1251,7 +1255,8 @@ NSApplication *NSApp = nil;
|
||||
|
||||
- (void) _documentController: (NSDocumentController *) docController
|
||||
didCloseAll: (BOOL) didCloseAll
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
// callback method for terminate:
|
||||
if (didCloseAll) {
|
||||
if ([_delegate
|
||||
@ -1341,12 +1346,14 @@ NSApplication *NSApp = nil;
|
||||
}
|
||||
|
||||
- (void) registerServicesMenuSendTypes: (NSArray *) sendTypes
|
||||
returnTypes: (NSArray *) returnTypes {
|
||||
returnTypes: (NSArray *) returnTypes
|
||||
{
|
||||
// tiredofthesewarnings NSUnsupportedMethod();
|
||||
}
|
||||
|
||||
- validRequestorForSendType: (NSString *) sendType
|
||||
returnType: (NSString *) returnType {
|
||||
returnType: (NSString *) returnType
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
@ -139,7 +139,8 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
#pragma mark Creating an NSAttributedString
|
||||
|
||||
+ (NSAttributedString *) attributedStringWithAttachment:
|
||||
(NSTextAttachment *) attachment {
|
||||
(NSTextAttachment *) attachment
|
||||
{
|
||||
unichar unicode = NSAttachmentCharacter;
|
||||
NSString *string = [NSString stringWithCharacters: &unicode length: 1];
|
||||
NSDictionary *attributes =
|
||||
@ -153,39 +154,44 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
- initWithData: (NSData *) data
|
||||
options: (NSDictionary *) options
|
||||
documentAttributes: (NSDictionary **) attributes
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- initWithDocFormat: (NSData *) werd
|
||||
documentAttributes: (NSDictionary **) attributes {
|
||||
documentAttributes: (NSDictionary **) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- initWithHTML: (NSData *) html
|
||||
baseURL: (NSURL *) url
|
||||
documentAttributes: (NSDictionary **) attributes {
|
||||
documentAttributes: (NSDictionary **) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- initWithHTML: (NSData *) html
|
||||
documentAttributes: (NSDictionary **) attributes {
|
||||
- initWithHTML: (NSData *) html documentAttributes: (NSDictionary **) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- initWithHTML: (NSData *) html
|
||||
options: (NSDictionary *) options
|
||||
documentAttributes: (NSDictionary **) attributes {
|
||||
documentAttributes: (NSDictionary **) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- initWithPath: (NSString *) path
|
||||
documentAttributes: (NSDictionary **) attributes {
|
||||
documentAttributes: (NSDictionary **) attributes
|
||||
{
|
||||
NSAttributedString *string =
|
||||
[NSRichTextReader attributedStringWithContentsOfFile: path];
|
||||
if (string == nil) {
|
||||
@ -205,14 +211,15 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
return [self initWithAttributedString: string];
|
||||
}
|
||||
|
||||
- initWithRTFD: (NSData *) rtfd
|
||||
documentAttributes: (NSDictionary **) attributes {
|
||||
- initWithRTFD: (NSData *) rtfd documentAttributes: (NSDictionary **) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- initWithRTFDFileWrapper: (NSFileWrapper *) wrapper
|
||||
documentAttributes: (NSDictionary **) attributes {
|
||||
documentAttributes: (NSDictionary **) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
@ -225,7 +232,8 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
- initWithURL: (NSURL *) url
|
||||
options: (NSDictionary *) options
|
||||
documentAttributes: (NSDictionary **) attributes
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
@ -294,21 +302,23 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
}
|
||||
|
||||
- (NSUInteger) lineBreakBeforeIndex: (NSUInteger) index
|
||||
withinRange: (NSRange) range {
|
||||
withinRange: (NSRange) range
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSUInteger) lineBreakByHyphenatingBeforeIndex: (NSUInteger) index
|
||||
withinRange: (NSRange) range {
|
||||
withinRange: (NSRange) range
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* as usual, the documentation says one thing and the system behaves
|
||||
* differently, this is the way i think it should work... (dwy 5/11/2003) */
|
||||
- (NSUInteger) nextWordFromIndex: (NSUInteger) location
|
||||
forward: (BOOL) forward {
|
||||
- (NSUInteger) nextWordFromIndex: (NSUInteger) location forward: (BOOL) forward
|
||||
{
|
||||
NSCharacterSet *alpha = [NSCharacterSet alphanumericCharacterSet];
|
||||
NSString *string = [self string];
|
||||
int i = location, length = [self length];
|
||||
@ -385,13 +395,14 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
#pragma mark Calculating Ranges
|
||||
|
||||
- (NSInteger) itemNumberInTextList: (NSTextList *) list
|
||||
atIndex: (NSUInteger) index {
|
||||
atIndex: (NSUInteger) index
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfTextBlock: (NSTextBlock *) block
|
||||
atIndex: (NSUInteger) index {
|
||||
- (NSRange) rangeOfTextBlock: (NSTextBlock *) block atIndex: (NSUInteger) index
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NSMakeRange(0, 0);
|
||||
}
|
||||
@ -401,8 +412,8 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
return NSMakeRange(0, 0);
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfTextTable: (NSTextTable *) table
|
||||
atIndex: (NSUInteger) index {
|
||||
- (NSRange) rangeOfTextTable: (NSTextTable *) table atIndex: (NSUInteger) index
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NSMakeRange(0, 0);
|
||||
}
|
||||
@ -411,37 +422,43 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
#pragma mark Generating Data
|
||||
|
||||
- (NSFileWrapper *) RTFDFileWrapperFromRange: (NSRange) range
|
||||
documentAttributes: (NSDictionary *) attributes {
|
||||
documentAttributes: (NSDictionary *) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSData *) RTFDFromRange: (NSRange) range
|
||||
documentAttributes: (NSDictionary *) attributes {
|
||||
documentAttributes: (NSDictionary *) attributes
|
||||
{
|
||||
return [NSRichTextWriter dataWithAttributedString: self range: range];
|
||||
}
|
||||
|
||||
- (NSData *) RTFFromRange: (NSRange) range
|
||||
documentAttributes: (NSDictionary *) attributes {
|
||||
documentAttributes: (NSDictionary *) attributes
|
||||
{
|
||||
return [NSRichTextWriter dataWithAttributedString: self range: range];
|
||||
}
|
||||
|
||||
- (NSData *) dataFromRange: (NSRange) range
|
||||
documentAttributes: (NSDictionary *) attributes
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSData *) docFormatFromRange: (NSRange) range
|
||||
documentAttributes: (NSDictionary *) attributes {
|
||||
documentAttributes: (NSDictionary *) attributes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSFileWrapper *) fileWrapperFromRange: (NSRange) range
|
||||
documentAttributes: (NSDictionary *) attributes
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
@ -474,7 +491,8 @@ NSUInteger NSUnderlineByWordMask = 0x8000;
|
||||
#pragma mark Getting the Bounding Rectangle of Rendered Strings
|
||||
|
||||
- (NSRect) boundingRectWithSize: (NSSize) size
|
||||
options: (NSStringDrawingOptions) options {
|
||||
options: (NSStringDrawingOptions) options
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
@ -539,7 +557,8 @@ NSColor *NSForegroundColorAttributeInDictionary(NSDictionary *dictionary) {
|
||||
}
|
||||
|
||||
NSParagraphStyle *
|
||||
NSParagraphStyleAttributeInDictionary(NSDictionary *dictionary) {
|
||||
NSParagraphStyleAttributeInDictionary(NSDictionary *dictionary)
|
||||
{
|
||||
NSParagraphStyle *style =
|
||||
[dictionary objectForKey: NSParagraphStyleAttributeName];
|
||||
|
||||
|
@ -33,7 +33,8 @@ static NSLineCapStyle _defaultLineCapStyle = NSButtLineCapStyle;
|
||||
static NSLineJoinStyle _defaultLineJoinStyle = NSMiterLineJoinStyle;
|
||||
|
||||
static BOOL curveIsFlat(CGFloat desiredFlatness, CGPoint start, CGPoint cp1,
|
||||
CGPoint cp2, CGPoint end) {
|
||||
CGPoint cp2, CGPoint end)
|
||||
{
|
||||
// Roughly compute the furthest distance of the curved path from the line
|
||||
// connecting start to end
|
||||
double ux = 3.0 * cp1.x - 2.0 * start.x - end.x;
|
||||
@ -169,7 +170,8 @@ static void CGPathConverter(void *info, const CGPathElement *element) {
|
||||
|
||||
+ (NSBezierPath *) bezierPathWithRoundedRect: (NSRect) rect
|
||||
xRadius: (CGFloat) xRadius
|
||||
yRadius: (CGFloat) yRadius {
|
||||
yRadius: (CGFloat) yRadius
|
||||
{
|
||||
NSBezierPath *result = [[[self alloc] init] autorelease];
|
||||
|
||||
[result appendBezierPathWithRoundedRect: rect
|
||||
@ -327,7 +329,8 @@ static void CGPathConverter(void *info, const CGPathElement *element) {
|
||||
|
||||
- (void) getLineDash: (CGFloat *) dashes
|
||||
count: (int *) count
|
||||
phase: (CGFloat *) phase {
|
||||
phase: (CGFloat *) phase
|
||||
{
|
||||
if (dashes != NULL) {
|
||||
int i;
|
||||
|
||||
@ -376,7 +379,8 @@ static int numberOfPointsForOperator(int op) {
|
||||
}
|
||||
|
||||
- (NSBezierPathElement) elementAtIndex: (int) index
|
||||
associatedPoints: (NSPoint *) associated {
|
||||
associatedPoints: (NSPoint *) associated
|
||||
{
|
||||
int i, pi = 0, pcount;
|
||||
|
||||
if (index >= _numberOfElements)
|
||||
@ -426,7 +430,8 @@ static int numberOfPointsForOperator(int op) {
|
||||
|
||||
- (void) setLineDash: (const CGFloat *) dashes
|
||||
count: (int) count
|
||||
phase: (CGFloat) phase {
|
||||
phase: (CGFloat) phase
|
||||
{
|
||||
if (_dashes != NULL)
|
||||
NSZoneFree(NULL, _dashes);
|
||||
|
||||
@ -492,7 +497,8 @@ static int numberOfPointsForOperator(int op) {
|
||||
toCurveFrom: (CGPoint) fromPoint
|
||||
to: (CGPoint) toPoint
|
||||
tan1: (CGPoint) tan1
|
||||
tan2: (CGPoint) tan2 {
|
||||
tan2: (CGPoint) tan2
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
// No need to test if there no chance of any crossing
|
||||
@ -681,7 +687,8 @@ static inline void expandPointCapacity(NSBezierPath *self, unsigned delta) {
|
||||
|
||||
- (void) curveToPoint: (NSPoint) point
|
||||
controlPoint1: (NSPoint) cp1
|
||||
controlPoint2: (NSPoint) cp2 {
|
||||
controlPoint2: (NSPoint) cp2
|
||||
{
|
||||
expandOperatorCapacity(self, 1);
|
||||
expandPointCapacity(self, 3);
|
||||
_elements[_numberOfElements++] = NSCurveToBezierPathElement;
|
||||
@ -715,7 +722,8 @@ static inline void expandPointCapacity(NSBezierPath *self, unsigned delta) {
|
||||
|
||||
- (void) relativeCurveToPoint: (NSPoint) point
|
||||
controlPoint1: (NSPoint) cp1
|
||||
controlPoint2: (NSPoint) cp2 {
|
||||
controlPoint2: (NSPoint) cp2
|
||||
{
|
||||
CGPoint current = [self currentPoint];
|
||||
|
||||
cp1.x += current.x;
|
||||
@ -728,8 +736,8 @@ static inline void expandPointCapacity(NSBezierPath *self, unsigned delta) {
|
||||
[self curveToPoint: point controlPoint1: cp1 controlPoint2: cp2];
|
||||
}
|
||||
|
||||
- (void) appendBezierPathWithPoints: (NSPoint *) points
|
||||
count: (unsigned) count {
|
||||
- (void) appendBezierPathWithPoints: (NSPoint *) points count: (unsigned) count
|
||||
{
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
@ -838,7 +846,8 @@ static void cgArcFromApply(void *info, const CGPathElement *element) {
|
||||
|
||||
- (void) appendBezierPathWithArcFromPoint: (NSPoint) point
|
||||
toPoint: (NSPoint) toPoint
|
||||
radius: (CGFloat) radius {
|
||||
radius: (CGFloat) radius
|
||||
{
|
||||
if (_numberOfPoints == 0) {
|
||||
NSLog(@"-[%@ %s] no current point", [self class], _cmd);
|
||||
return;
|
||||
@ -856,7 +865,8 @@ static void cgArcFromApply(void *info, const CGPathElement *element) {
|
||||
|
||||
- (void) appendBezierPathWithRoundedRect: (NSRect) rect
|
||||
xRadius: (CGFloat) radius
|
||||
yRadius: (CGFloat) yRadius {
|
||||
yRadius: (CGFloat) yRadius
|
||||
{
|
||||
[self moveToPoint: NSMakePoint(rect.origin.x + radius, NSMaxY(rect))];
|
||||
[self appendBezierPathWithArcWithCenter: NSMakePoint(
|
||||
rect.origin.x +
|
||||
@ -899,7 +909,8 @@ static inline CGFloat degreesToRadians(CGFloat degrees) {
|
||||
- (void) appendBezierPathWithArcWithCenter: (NSPoint) center
|
||||
radius: (CGFloat) radius
|
||||
startAngle: (CGFloat) startAngle
|
||||
endAngle: (CGFloat) endAngle {
|
||||
endAngle: (CGFloat) endAngle
|
||||
{
|
||||
[self appendBezierPathWithArcWithCenter: center
|
||||
radius: radius
|
||||
startAngle: startAngle
|
||||
@ -911,7 +922,8 @@ static inline CGFloat degreesToRadians(CGFloat degrees) {
|
||||
radius: (CGFloat) radius
|
||||
startAngle: (CGFloat) startAngle
|
||||
endAngle: (CGFloat) endAngle
|
||||
clockwise: (BOOL) clockwise {
|
||||
clockwise: (BOOL) clockwise
|
||||
{
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
CGPathAddArc(path, NULL, center.x, center.y, radius,
|
||||
degreesToRadians(startAngle), degreesToRadians(endAngle),
|
||||
@ -956,7 +968,8 @@ static inline CGFloat degreesToRadians(CGFloat degrees) {
|
||||
|
||||
- (void) appendBezierPathWithGlyphs: (NSGlyph *) glyphs
|
||||
count: (unsigned) count
|
||||
inFont: (NSFont *) font {
|
||||
inFont: (NSFont *) font
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < count; ++i) {
|
||||
[self appendBezierPathWithGlyph: glyphs[i] inFont: font];
|
||||
@ -1031,7 +1044,8 @@ static inline CGFloat degreesToRadians(CGFloat degrees) {
|
||||
|
||||
static NSUInteger doFlattenBezierCurve(CGFloat desiredFlatness, CGPoint start,
|
||||
CGPoint cp1, CGPoint cp2, CGPoint end,
|
||||
NSUInteger *index, CGPoint *points) {
|
||||
NSUInteger *index, CGPoint *points)
|
||||
{
|
||||
int count = 0;
|
||||
if (curveIsFlat(desiredFlatness, start, cp1, cp2, end) == NO) {
|
||||
// Subdivide the curve - Hearn & Baker Computer Graphics pp460-461
|
||||
@ -1069,7 +1083,8 @@ static NSUInteger doFlattenBezierCurve(CGFloat desiredFlatness, CGPoint start,
|
||||
// pass nil for points to figure out how large the buffer should be
|
||||
static NSUInteger flattenBezierCurve(CGFloat desiredFlatness, CGPoint start,
|
||||
CGPoint cp1, CGPoint cp2, CGPoint end,
|
||||
CGPoint *points) {
|
||||
CGPoint *points)
|
||||
{
|
||||
NSUInteger index = 0;
|
||||
return doFlattenBezierCurve(desiredFlatness, start, cp1, cp2, end, &index,
|
||||
points);
|
||||
|
@ -52,9 +52,9 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
[NSArray arrayWithObjects:
|
||||
// Try to order them so the most used ones are at the top
|
||||
// of the list
|
||||
@"png", @"tiff", @"tif", @"jpg", @"jpeg", @"icns",
|
||||
@"gif", @"bmp", @"PNG", @"TIFF", @"TIF", @"JPG",
|
||||
@"JPEG", @"ICNS", @"jpe", @"JPE", @"GIF", @"BMP", nil];
|
||||
@"png", @"tiff", @"tif", @"jpg", @"jpeg", @"icns", @"gif",
|
||||
@"bmp", @"PNG", @"TIFF", @"TIF", @"JPG", @"JPEG", @"ICNS",
|
||||
@"jpe", @"JPE", @"GIF", @"BMP", nil];
|
||||
}
|
||||
|
||||
+ (NSArray *) imageRepsWithContentsOfFile: (NSString *) path {
|
||||
@ -70,7 +70,8 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
}
|
||||
|
||||
+ (void) getTIFFCompressionTypes: (const NSTIFFCompression **) types
|
||||
count: (int *) count {
|
||||
count: (int *) count
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -88,7 +89,8 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
+ (NSData *) TIFFRepresentationOfImageRepsInArray: (NSArray *) array
|
||||
usingCompression:
|
||||
(NSTIFFCompression) compression
|
||||
factor: (float) factor {
|
||||
factor: (float) factor
|
||||
{
|
||||
NSMutableData *result = [NSMutableData data];
|
||||
CGImageDestinationRef dest = CGImageDestinationCreateWithData(
|
||||
(CFMutableDataRef) result, (CFStringRef) @"public.tiff", [array count],
|
||||
@ -106,7 +108,8 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
|
||||
+ (NSData *) representationOfImageRepsInArray: (NSArray *) array
|
||||
usingType: (NSBitmapImageFileType) type
|
||||
properties: (NSDictionary *) properties {
|
||||
properties: (NSDictionary *) properties
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
@ -189,7 +192,8 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
colorSpaceName: (NSString *) colorSpaceName
|
||||
bitmapFormat: (NSBitmapFormat) bitmapFormat
|
||||
bytesPerRow: (int) bytesPerRow
|
||||
bitsPerPixel: (int) bitsPerPixel {
|
||||
bitsPerPixel: (int) bitsPerPixel
|
||||
{
|
||||
int i, numberOfPlanes = isPlanar ? samplesPerPixel : 1;
|
||||
|
||||
_size = NSMakeSize(width, height);
|
||||
@ -248,7 +252,8 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
isPlanar: (BOOL) isPlanar
|
||||
colorSpaceName: (NSString *) colorSpaceName
|
||||
bytesPerRow: (int) bytesPerRow
|
||||
bitsPerPixel: (int) bitsPerPixel {
|
||||
bitsPerPixel: (int) bitsPerPixel
|
||||
{
|
||||
return [self initWithBitmapDataPlanes: planes
|
||||
pixelsWide: width
|
||||
pixelsHigh: height
|
||||
@ -613,17 +618,19 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
- (void) colorizeByMappingGray: (CGFloat) gray
|
||||
toColor: (NSColor *) color
|
||||
blackMapping: (NSColor *) blackMapping
|
||||
whiteMapping: (NSColor *) whiteMapping {
|
||||
whiteMapping: (NSColor *) whiteMapping
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) getCompression: (NSTIFFCompression *) compression
|
||||
factor: (float *) factor {
|
||||
factor: (float *) factor
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) setCompression: (NSTIFFCompression) compression
|
||||
factor: (float) factor {
|
||||
- (void) setCompression: (NSTIFFCompression) compression factor: (float) factor
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -633,7 +640,8 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
}
|
||||
|
||||
- (NSData *) representationUsingType: (NSBitmapImageFileType) type
|
||||
properties: (NSDictionary *) properties {
|
||||
properties: (NSDictionary *) properties
|
||||
{
|
||||
CFStringRef uti;
|
||||
|
||||
switch (type) {
|
||||
@ -705,7 +713,8 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame";
|
||||
}
|
||||
|
||||
- (NSData *) TIFFRepresentationUsingCompression: (NSTIFFCompression) compression
|
||||
factor: (float) factor {
|
||||
factor: (float) factor
|
||||
{
|
||||
return [[self class]
|
||||
TIFFRepresentationOfImageRepsInArray: [NSArray arrayWithObject: self]
|
||||
usingCompression: compression
|
||||
|
@ -401,14 +401,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
return [[_customData objectForKey: @"NSBorderWidth2"] doubleValue];
|
||||
}
|
||||
|
||||
- (CGFloat) cornerRadius;
|
||||
{ return [[_customData objectForKey: @"NSCornerRadius2"] doubleValue]; }
|
||||
- (CGFloat) cornerRadius; {
|
||||
return [[_customData objectForKey: @"NSCornerRadius2"] doubleValue];
|
||||
}
|
||||
|
||||
- (NSColor *) borderColor;
|
||||
{ return [_customData objectForKey: @"NSBorderColor2"]; }
|
||||
- (NSColor *) borderColor; {
|
||||
return [_customData objectForKey: @"NSBorderColor2"];
|
||||
}
|
||||
|
||||
- (NSColor *) fillColor;
|
||||
{ return [_customData objectForKey: @"NSFillColor2"]; }
|
||||
- (NSColor *) fillColor; {
|
||||
return [_customData objectForKey: @"NSFillColor2"];
|
||||
}
|
||||
|
||||
- (void) setBorderWidth: (CGFloat) value {
|
||||
[_customData setObject: [NSNumber numberWithDouble: value]
|
||||
|
@ -615,7 +615,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (NSMatrix *) _reloadColumn: (NSInteger) column
|
||||
preserveSelection: (BOOL) preserveSelection {
|
||||
preserveSelection: (BOOL) preserveSelection
|
||||
{
|
||||
NSMatrix *matrix = [self createMatrixInColumn: column];
|
||||
NSInteger selectedRow = [matrix selectedRow],
|
||||
selectedColumn = [matrix selectedColumn];
|
||||
|
@ -1151,7 +1151,8 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) {
|
||||
|
||||
- (void) drawImage: (NSImage *) image
|
||||
withFrame: (NSRect) rect
|
||||
inView: (NSView *) controlView {
|
||||
inView: (NSView *) controlView
|
||||
{
|
||||
BOOL enabled = [self isEnabled] ? YES : ![self imageDimsWhenDisabled];
|
||||
BOOL mixed = ([self state] == NSMixedState) ? YES : NO;
|
||||
|
||||
@ -1172,7 +1173,8 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) {
|
||||
|
||||
- (NSRect) drawTitle: (NSAttributedString *) title
|
||||
withFrame: (NSRect) titleRect
|
||||
inView: (NSView *) controlView {
|
||||
inView: (NSView *) controlView
|
||||
{
|
||||
|
||||
[title _clipAndDrawInRect: titleRect];
|
||||
|
||||
@ -1199,7 +1201,8 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) {
|
||||
|
||||
// This function is duplicated in NSImageCell, consolidate
|
||||
static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize,
|
||||
NSImageScaling scaling) {
|
||||
NSImageScaling scaling)
|
||||
{
|
||||
|
||||
switch (scaling) {
|
||||
case NSImageScaleProportionallyDown: {
|
||||
|
@ -40,7 +40,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (instancetype) initWithSize: (NSSize) size
|
||||
depth: (NSWindowDepth) windowDepth
|
||||
separate: (BOOL) separateWindow
|
||||
alpha: (BOOL) hasAlpha {
|
||||
alpha: (BOOL) hasAlpha
|
||||
{
|
||||
// FIXME: Implement shared caches, but also update NSImage to handle caching
|
||||
// in them.
|
||||
NSWindowStyleMask styleMask = NSBorderlessWindowMask;
|
||||
|
@ -586,8 +586,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
_state = [self nextState];
|
||||
}
|
||||
|
||||
- (BOOL) allowsMixedState;
|
||||
{ return _allowsMixedState; }
|
||||
- (BOOL) allowsMixedState; {
|
||||
return _allowsMixedState;
|
||||
}
|
||||
|
||||
- (void) setAllowsMixedState: (BOOL) allow {
|
||||
_allowsMixedState = allow;
|
||||
@ -725,7 +726,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
// NSNumberFormatter doesn't work that way. - dwy
|
||||
- (void) setFloatingPointFormat: (BOOL) fpp
|
||||
left: (NSUInteger) left
|
||||
right: (NSUInteger) right {
|
||||
right: (NSUInteger) right
|
||||
{
|
||||
NSMutableString *format = [NSMutableString string];
|
||||
|
||||
[self setFormatter: [[[NSNumberFormatter alloc] init] autorelease]];
|
||||
@ -894,7 +896,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) highlight: (BOOL) highlight
|
||||
withFrame: (NSRect) frame
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
if (_isHighlighted != highlight) {
|
||||
_isHighlighted = highlight;
|
||||
}
|
||||
@ -906,20 +909,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (BOOL) continueTracking: (NSPoint) lastPoint
|
||||
at: (NSPoint) currentPoint
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) stopTracking: (NSPoint) lastPoint
|
||||
at: (NSPoint) stopPoint
|
||||
inView: (NSView *) view
|
||||
mouseIsUp: (BOOL) flag {
|
||||
mouseIsUp: (BOOL) flag
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) trackMouse: (NSEvent *) event
|
||||
inRect: (NSRect) frame
|
||||
ofView: (NSView *) view
|
||||
untilMouseUp: (BOOL) untilMouseUp {
|
||||
untilMouseUp: (BOOL) untilMouseUp
|
||||
{
|
||||
NSPoint lastPoint;
|
||||
BOOL result = NO;
|
||||
|
||||
@ -1012,7 +1018,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) _setupFieldEditorWithFrame: (NSRect) frame
|
||||
controlView: (NSView *) view
|
||||
editor: (NSText *) editor
|
||||
delegate: delegate {
|
||||
delegate: delegate
|
||||
{
|
||||
/* There is some funkiness here where the editor is already in the control
|
||||
and it is moving to a different cell or the same cell is being edited
|
||||
after a makeFirstResponder This needs to be straightened out
|
||||
@ -1061,7 +1068,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
inView: (NSView *) view
|
||||
editor: (NSText *) editor
|
||||
delegate: (id) delegate
|
||||
event: (NSEvent *) event {
|
||||
event: (NSEvent *) event
|
||||
{
|
||||
|
||||
if (![self isEditable] && ![self isSelectable])
|
||||
return;
|
||||
@ -1082,7 +1090,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
editor: (NSText *) editor
|
||||
delegate: (id) delegate
|
||||
start: (NSInteger) location
|
||||
length: (NSInteger) length {
|
||||
length: (NSInteger) length
|
||||
{
|
||||
if (![self isEditable] && ![self isSelectable])
|
||||
return;
|
||||
|
||||
@ -1149,6 +1158,7 @@ static NSString *NSStringFromCellType(NSCellType type) {
|
||||
void NSDrawThreePartImage(NSRect frame, NSImage *startCap, NSImage *centerFill,
|
||||
NSImage *endCap, BOOL vertical,
|
||||
NSCompositingOperation operation, CGFloat alpha,
|
||||
BOOL flipped) {
|
||||
BOOL flipped)
|
||||
{
|
||||
NSUnimplementedFunction();
|
||||
}
|
||||
|
@ -66,7 +66,8 @@
|
||||
|
||||
- (void) registerUndoWithTarget: (id) target
|
||||
selector: (SEL) selector
|
||||
object: (id) object {
|
||||
object: (id) object
|
||||
{
|
||||
[super registerUndoWithTarget: target selector: selector object: object];
|
||||
[_nextUndoManager clearRedoStackIfStateIsNormal];
|
||||
}
|
||||
|
@ -551,7 +551,8 @@ static int NSColor_ignoresAlpha = -1;
|
||||
+ (NSColor *) colorWithDeviceRed: (CGFloat) red
|
||||
green: (CGFloat) green
|
||||
blue: (CGFloat) blue
|
||||
alpha: (CGFloat) alpha {
|
||||
alpha: (CGFloat) alpha
|
||||
{
|
||||
return [NSColor_CGColor colorWithRed: red
|
||||
green: green
|
||||
blue: blue
|
||||
@ -562,7 +563,8 @@ static int NSColor_ignoresAlpha = -1;
|
||||
+ (NSColor *) colorWithDeviceHue: (CGFloat) hue
|
||||
saturation: (CGFloat) saturation
|
||||
brightness: (CGFloat) brightness
|
||||
alpha: (CGFloat) alpha {
|
||||
alpha: (CGFloat) alpha
|
||||
{
|
||||
return [NSColor_CGColor colorWithHue: hue
|
||||
saturation: saturation
|
||||
brightness: brightness
|
||||
@ -574,7 +576,8 @@ static int NSColor_ignoresAlpha = -1;
|
||||
magenta: (CGFloat) magenta
|
||||
yellow: (CGFloat) yellow
|
||||
black: (CGFloat) black
|
||||
alpha: (CGFloat) alpha {
|
||||
alpha: (CGFloat) alpha
|
||||
{
|
||||
return [NSColor_CGColor colorWithCyan: cyan
|
||||
magenta: magenta
|
||||
yellow: yellow
|
||||
@ -592,7 +595,8 @@ static int NSColor_ignoresAlpha = -1;
|
||||
+ (NSColor *) colorWithCalibratedRed: (CGFloat) red
|
||||
green: (CGFloat) green
|
||||
blue: (CGFloat) blue
|
||||
alpha: (CGFloat) alpha {
|
||||
alpha: (CGFloat) alpha
|
||||
{
|
||||
return [NSColor_CGColor colorWithRed: red
|
||||
green: green
|
||||
blue: blue
|
||||
@ -603,7 +607,8 @@ static int NSColor_ignoresAlpha = -1;
|
||||
+ (NSColor *) colorWithCalibratedHue: (CGFloat) hue
|
||||
saturation: (CGFloat) saturation
|
||||
brightness: (CGFloat) brightness
|
||||
alpha: (CGFloat) alpha {
|
||||
alpha: (CGFloat) alpha
|
||||
{
|
||||
return [NSColor_CGColor colorWithHue: hue
|
||||
saturation: saturation
|
||||
brightness: brightness
|
||||
@ -612,7 +617,8 @@ static int NSColor_ignoresAlpha = -1;
|
||||
}
|
||||
|
||||
+ (NSColor *) colorWithCatalogName: (NSString *) catalogName
|
||||
colorName: (NSString *) colorName {
|
||||
colorName: (NSString *) colorName
|
||||
{
|
||||
return [NSColor_catalog colorWithCatalogName: catalogName
|
||||
colorName: colorName];
|
||||
}
|
||||
@ -688,14 +694,16 @@ static void releasePatternInfo(void *info) {
|
||||
- (void) getRed: (CGFloat *) red
|
||||
green: (CGFloat *) green
|
||||
blue: (CGFloat *) blue
|
||||
alpha: (CGFloat *) alpha {
|
||||
alpha: (CGFloat *) alpha
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
}
|
||||
|
||||
- (void) getHue: (CGFloat *) hue
|
||||
saturation: (CGFloat *) saturation
|
||||
brightness: (CGFloat *) brightness
|
||||
alpha: (CGFloat *) alpha {
|
||||
alpha: (CGFloat *) alpha
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
}
|
||||
|
||||
@ -703,7 +711,8 @@ static void releasePatternInfo(void *info) {
|
||||
magenta: (CGFloat *) magenta
|
||||
yellow: (CGFloat *) yellow
|
||||
black: (CGFloat *) black
|
||||
alpha: (CGFloat *) alpha {
|
||||
alpha: (CGFloat *) alpha
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
}
|
||||
|
||||
@ -805,7 +814,8 @@ static void releasePatternInfo(void *info) {
|
||||
}
|
||||
|
||||
- (NSColor *) colorUsingColorSpaceName: (NSString *) colorSpace
|
||||
device: (NSDictionary *) device {
|
||||
device: (NSDictionary *) device
|
||||
{
|
||||
if ([[self colorSpaceName] isEqualToString: colorSpace])
|
||||
return self;
|
||||
|
||||
@ -815,7 +825,8 @@ static void releasePatternInfo(void *info) {
|
||||
}
|
||||
|
||||
- (NSColor *) blendedColorWithFraction: (CGFloat) fraction
|
||||
ofColor: (NSColor *) color {
|
||||
ofColor: (NSColor *) color
|
||||
{
|
||||
NSColor *primary =
|
||||
[color colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
|
||||
NSColor *secondary =
|
||||
|
@ -41,14 +41,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
+ (NSColor *) colorWithColorRef: (CGColorRef) colorRef
|
||||
spaceName: (NSString *) spaceName {
|
||||
spaceName: (NSString *) spaceName
|
||||
{
|
||||
return [[[self alloc] initWithColorRef: colorRef
|
||||
spaceName: spaceName] autorelease];
|
||||
}
|
||||
|
||||
+ (NSColor *) colorWithGray: (CGFloat) gray
|
||||
alpha: (CGFloat) alpha
|
||||
spaceName: (NSString *) spaceName {
|
||||
spaceName: (NSString *) spaceName
|
||||
{
|
||||
NSColor *result;
|
||||
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
|
||||
@ -68,7 +70,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
yellow: (CGFloat) yellow
|
||||
black: (CGFloat) black
|
||||
alpha: (CGFloat) alpha
|
||||
spaceName: (NSString *) spaceName {
|
||||
spaceName: (NSString *) spaceName
|
||||
{
|
||||
NSColor *result;
|
||||
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceCMYK();
|
||||
@ -87,7 +90,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
green: (CGFloat) green
|
||||
blue: (CGFloat) blue
|
||||
alpha: (CGFloat) alpha
|
||||
spaceName: (NSString *) spaceName {
|
||||
spaceName: (NSString *) spaceName
|
||||
{
|
||||
NSColor *result;
|
||||
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
@ -106,7 +110,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
saturation: (CGFloat) saturation
|
||||
brightness: (CGFloat) brightness
|
||||
alpha: (CGFloat) alpha
|
||||
spaceName: (NSString *) spaceName {
|
||||
spaceName: (NSString *) spaceName
|
||||
{
|
||||
CGFloat red, green, blue;
|
||||
|
||||
NSColorHSBToRGB(hue, saturation, brightness, &red, &green, &blue);
|
||||
@ -172,7 +177,8 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) {
|
||||
}
|
||||
|
||||
- (NSColor *) colorUsingColorSpaceName: (NSString *) otherSpaceName
|
||||
device: (NSDictionary *) device {
|
||||
device: (NSDictionary *) device
|
||||
{
|
||||
if (otherSpaceName == nil ||
|
||||
[otherSpaceName isEqualToString: _colorSpaceName])
|
||||
return self;
|
||||
@ -341,7 +347,8 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) {
|
||||
- (void) getRed: (CGFloat *) red
|
||||
green: (CGFloat *) green
|
||||
blue: (CGFloat *) blue
|
||||
alpha: (CGFloat *) alpha {
|
||||
alpha: (CGFloat *) alpha
|
||||
{
|
||||
CGColorSpaceRef colorSpace = CGColorGetColorSpace(_colorRef);
|
||||
CGColorSpaceModel model = CGColorSpaceGetModel(colorSpace);
|
||||
const CGFloat *components = CGColorGetComponents(_colorRef);
|
||||
@ -376,7 +383,8 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) {
|
||||
- (void) getHue: (CGFloat *) huep
|
||||
saturation: (CGFloat *) saturationp
|
||||
brightness: (CGFloat *) brightnessp
|
||||
alpha: (CGFloat *) alphap {
|
||||
alpha: (CGFloat *) alphap
|
||||
{
|
||||
CGColorSpaceRef colorSpace = CGColorGetColorSpace(_colorRef);
|
||||
CGColorSpaceModel model = CGColorSpaceGetModel(colorSpace);
|
||||
const CGFloat *components = CGColorGetComponents(_colorRef);
|
||||
@ -402,7 +410,8 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) {
|
||||
magenta: (CGFloat *) magenta
|
||||
yellow: (CGFloat *) yellow
|
||||
black: (CGFloat *) black
|
||||
alpha: (CGFloat *) alpha {
|
||||
alpha: (CGFloat *) alpha
|
||||
{
|
||||
CGColorSpaceRef colorSpace = CGColorGetColorSpace(_colorRef);
|
||||
CGColorSpaceModel model = CGColorSpaceGetModel(colorSpace);
|
||||
const CGFloat *components = CGColorGetComponents(_colorRef);
|
||||
|
@ -32,7 +32,8 @@ NSColor *NSColorGetCatalogColor(NSString *catalogName, NSString *colorName);
|
||||
|
||||
- initWithCatalogName: (NSString *) catalogName
|
||||
colorName: (NSString *) colorName
|
||||
color: (NSColor *) color {
|
||||
color: (NSColor *) color
|
||||
{
|
||||
_catalogName = [catalogName copy];
|
||||
_colorName = [colorName copy];
|
||||
_color = [color copy];
|
||||
@ -69,7 +70,8 @@ NSColor *NSColorGetCatalogColor(NSString *catalogName, NSString *colorName);
|
||||
}
|
||||
|
||||
+ (NSColor *) colorWithCatalogName: (NSString *) catalogName
|
||||
colorName: (NSString *) colorName {
|
||||
colorName: (NSString *) colorName
|
||||
{
|
||||
return [[[self alloc] initWithCatalogName: catalogName
|
||||
colorName: colorName
|
||||
color: nil] autorelease];
|
||||
@ -77,7 +79,8 @@ NSColor *NSColorGetCatalogColor(NSString *catalogName, NSString *colorName);
|
||||
|
||||
+ (NSColor *) colorWithCatalogName: (NSString *) catalogName
|
||||
colorName: (NSString *) colorName
|
||||
color: (NSColor *) color {
|
||||
color: (NSColor *) color
|
||||
{
|
||||
if (NSColorGetCatalogColor(catalogName, colorName) == nil)
|
||||
NSColorSetCatalogColor(catalogName, colorName, color);
|
||||
|
||||
@ -99,7 +102,8 @@ NSColor *NSColorGetCatalogColor(NSString *catalogName, NSString *colorName);
|
||||
}
|
||||
|
||||
- (NSColor *) colorUsingColorSpaceName: (NSString *) colorSpace
|
||||
device: (NSDictionary *) device {
|
||||
device: (NSDictionary *) device
|
||||
{
|
||||
NSColor *result;
|
||||
|
||||
if ([colorSpace isEqualToString: [self colorSpaceName]])
|
||||
|
@ -24,7 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
static inline void NSColorHSBToRGB(CGFloat hue, CGFloat saturation,
|
||||
CGFloat brightness, CGFloat *redp,
|
||||
CGFloat *greenp, CGFloat *bluep) {
|
||||
CGFloat *greenp, CGFloat *bluep)
|
||||
{
|
||||
CGFloat red = brightness, green = brightness, blue = brightness;
|
||||
|
||||
CGFloat H = hue * 360.f; // convert to degrees
|
||||
@ -86,12 +87,13 @@ static inline void NSColorHSBToRGB(CGFloat hue, CGFloat saturation,
|
||||
*bluep = blue + m;
|
||||
|
||||
// NSLog(@"RGB(%f, %f, %f) <- HSB(%f, %f, %f)", *redp, *greenp, *bluep,
|
||||
//hue, saturation, brightness);
|
||||
// hue, saturation, brightness);
|
||||
}
|
||||
|
||||
static inline void NSColorRGBToHSB(CGFloat red, CGFloat green, CGFloat blue,
|
||||
CGFloat *huep, CGFloat *saturationp,
|
||||
CGFloat *brightnessp) {
|
||||
CGFloat *brightnessp)
|
||||
{
|
||||
|
||||
CGFloat M = MAX(red, MAX(green, blue));
|
||||
CGFloat m = MIN(red, MIN(green, blue));
|
||||
@ -130,5 +132,5 @@ static inline void NSColorRGBToHSB(CGFloat red, CGFloat green, CGFloat blue,
|
||||
*brightnessp = V;
|
||||
}
|
||||
// NSLog(@"RGB(%f, %f, %f) -> HSB(%f, %f, %f)", red, green, blue, H/360.f,
|
||||
//S, V);
|
||||
// S, V);
|
||||
}
|
||||
|
@ -322,8 +322,8 @@ static NSMutableDictionary *_namedColorLists = nil;
|
||||
return _keys;
|
||||
}
|
||||
|
||||
- (NSColor *) colorWithKey: (NSString *) soughtKey
|
||||
indexPtr: (unsigned *) index {
|
||||
- (NSColor *) colorWithKey: (NSString *) soughtKey indexPtr: (unsigned *) index
|
||||
{
|
||||
NSEnumerator *keyEnumerator = [_keys objectEnumerator];
|
||||
NSString *thisKey;
|
||||
|
||||
@ -374,7 +374,8 @@ static NSMutableDictionary *_namedColorLists = nil;
|
||||
|
||||
- (void) insertColor: (NSColor *) color
|
||||
key: (NSString *) key
|
||||
atIndex: (unsigned) index {
|
||||
atIndex: (unsigned) index
|
||||
{
|
||||
[_colors insertObject: color atIndex: index];
|
||||
[_keys insertObject: key atIndex: index];
|
||||
|
||||
|
@ -71,7 +71,8 @@ static NSUInteger _pickerMask = 0;
|
||||
|
||||
+ (BOOL) dragColor: (NSColor *) color
|
||||
withEvent: (NSEvent *) event
|
||||
fromView: (NSView *) view {
|
||||
fromView: (NSView *) view
|
||||
{
|
||||
NSPasteboard *pboard = [NSPasteboard pasteboardWithName: NSDragPboard];
|
||||
NSSize size = NSMakeSize(12, 12);
|
||||
NSImage *image = [[[NSImage alloc] initWithSize: size] autorelease];
|
||||
|
@ -26,8 +26,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
@implementation NSColorPicker
|
||||
|
||||
- initWithPickerMask: (NSUInteger) mask
|
||||
colorPanel: (NSColorPanel *) colorPanel {
|
||||
- initWithPickerMask: (NSUInteger) mask colorPanel: (NSColorPanel *) colorPanel
|
||||
{
|
||||
if (![NSBundle loadNibNamed: [[self class] description] owner: self])
|
||||
NSLog(@"Couldn't load %@.nib", [[self class] description]);
|
||||
|
||||
@ -60,8 +60,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
return [NSImage imageNamed: @"NSAlertPanelExclamation"];
|
||||
}
|
||||
|
||||
- (void) insertNewButtonImage: (NSImage *) image
|
||||
in: (NSButtonCell *) buttonCell {
|
||||
- (void) insertNewButtonImage: (NSImage *) image in: (NSButtonCell *) buttonCell
|
||||
{
|
||||
[buttonCell setImage: image];
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
@implementation NSColorPickerColorList
|
||||
|
||||
- initWithPickerMask: (NSUInteger) mask
|
||||
colorPanel: (NSColorPanel *) colorPanel {
|
||||
- initWithPickerMask: (NSUInteger) mask colorPanel: (NSColorPanel *) colorPanel
|
||||
{
|
||||
NSEnumerator *colorListsEnumerator =
|
||||
[[NSColorList availableColorLists] objectEnumerator];
|
||||
NSColorList *colorList;
|
||||
@ -62,7 +62,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (NSInteger) browser: (NSBrowser *) sender
|
||||
numberOfRowsInColumn: (NSInteger) column {
|
||||
numberOfRowsInColumn: (NSInteger) column
|
||||
{
|
||||
return [[_pickedColorList allKeys] count];
|
||||
}
|
||||
|
||||
@ -73,7 +74,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) browser: (NSBrowser *) sender
|
||||
willDisplayCell: (id) cell
|
||||
atRow: (NSInteger) row
|
||||
column: (NSInteger) column {
|
||||
column: (NSInteger) column
|
||||
{
|
||||
[cell setStringValue: [[_pickedColorList allKeys] objectAtIndex: row]];
|
||||
[cell setLeaf: YES];
|
||||
[cell setLoaded: YES];
|
||||
|
@ -23,8 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
@implementation NSColorPickerSliders
|
||||
|
||||
- initWithPickerMask: (NSUInteger) mask
|
||||
colorPanel: (NSColorPanel *) colorPanel {
|
||||
- initWithPickerMask: (NSUInteger) mask colorPanel: (NSColorPanel *) colorPanel
|
||||
{
|
||||
[super initWithPickerMask: mask colorPanel: colorPanel];
|
||||
|
||||
NSSize size = [_grayscaleConstantsMatrix cellSize];
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
@implementation NSColorPickerWheel
|
||||
|
||||
- initWithPickerMask: (NSUInteger) mask
|
||||
colorPanel: (NSColorPanel *) colorPanel {
|
||||
- initWithPickerMask: (NSUInteger) mask colorPanel: (NSColorPanel *) colorPanel
|
||||
{
|
||||
|
||||
if ((self = [super initWithPickerMask: mask colorPanel: colorPanel])) {
|
||||
}
|
||||
@ -42,7 +42,8 @@
|
||||
- (void) colorPickerWheelView: (NSColorPickerWheelView *) view
|
||||
didSelectHue: (CGFloat) hue
|
||||
saturation: (CGFloat) saturation
|
||||
andBrightness: (CGFloat) brightness {
|
||||
andBrightness: (CGFloat) brightness
|
||||
{
|
||||
|
||||
[[self colorPanel]
|
||||
setColor: [NSColor colorWithCalibratedHue: hue / 360.0
|
||||
|
@ -228,7 +228,8 @@ NSString *const NSComboBoxWillPopUpNotification =
|
||||
- (NSArray *) textView: (NSTextView *) textView
|
||||
completions: (NSArray *) words
|
||||
forPartialWordRange: (NSRange) range
|
||||
indexOfSelectedItem: (NSInteger *) index {
|
||||
indexOfSelectedItem: (NSInteger *) index
|
||||
{
|
||||
NSString *string = [[self cell]
|
||||
completedString: [[textView string] substringWithRange: range]];
|
||||
|
||||
|
@ -273,7 +273,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (BOOL) trackMouse: (NSEvent *) event
|
||||
inRect: (NSRect) cellFrame
|
||||
ofView: (NSView *) controlView
|
||||
untilMouseUp: (BOOL) flag {
|
||||
untilMouseUp: (BOOL) flag
|
||||
{
|
||||
NSComboBoxWindow *window;
|
||||
NSPoint origin = [controlView bounds].origin;
|
||||
NSSize size = [self cellSize];
|
||||
|
@ -105,9 +105,7 @@ enum { KEYBOARD_INACTIVE, KEYBOARD_ACTIVE, KEYBOARD_OK, KEYBOARD_CANCEL };
|
||||
if (index == _selectedIndex)
|
||||
attributes = [self selectedItemAttributes];
|
||||
else
|
||||
attributes = [self itemAttributes];
|
||||
|
||||
{
|
||||
attributes = [self itemAttributes]; {
|
||||
NSString *string = [item description];
|
||||
NSSize size = [string sizeWithAttributes: attributes];
|
||||
NSRect itemRect = [self rectForItemAtIndex: index];
|
||||
|
@ -315,7 +315,8 @@ static NSMutableDictionary *cellClassDictionary = nil;
|
||||
|
||||
- (void) setFloatingPointFormat: (BOOL) fpp
|
||||
left: (NSUInteger) left
|
||||
right: (NSUInteger) right {
|
||||
right: (NSUInteger) right
|
||||
{
|
||||
[_cell setFloatingPointFormat: fpp left: left right: right];
|
||||
}
|
||||
|
||||
|
@ -530,7 +530,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (void) insertObjects: (NSArray *) objects
|
||||
atArrangedObjectIndexes: (NSIndexSet *) indices {
|
||||
atArrangedObjectIndexes: (NSIndexSet *) indices
|
||||
{
|
||||
if (_flags.clearsFilterPredicateOnInsertion) {
|
||||
[self setFilterPredicate: nil];
|
||||
}
|
||||
|
@ -244,7 +244,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) observeValueForKeyPath: (NSString *) keyPath
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
// remove cached value for this key path
|
||||
[_cachedValues removeObjectForKey: keyPath];
|
||||
|
||||
@ -260,7 +261,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) addObserver: (NSObject *) observer
|
||||
forKeyPath: (NSString *) keyPath
|
||||
options: (NSKeyValueObservingOptions) options
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
_NSObservationProxy *proxy =
|
||||
[[_NSObservationProxy alloc] initWithKeyPath: keyPath
|
||||
observer: observer
|
||||
@ -276,8 +278,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
[proxy release];
|
||||
}
|
||||
|
||||
- (void) removeObserver: (NSObject *) observer
|
||||
forKeyPath: (NSString *) keyPath {
|
||||
- (void) removeObserver: (NSObject *) observer forKeyPath: (NSString *) keyPath
|
||||
{
|
||||
_NSObservationProxy *proxy =
|
||||
[[_NSObservationProxy alloc] initWithKeyPath: keyPath
|
||||
observer: observer
|
||||
|
@ -150,11 +150,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL) canAdd;
|
||||
{ return [self isEditable]; }
|
||||
- (BOOL) canAdd; {
|
||||
return [self isEditable];
|
||||
}
|
||||
|
||||
- (BOOL) canRemove;
|
||||
{ return [self isEditable] && [[self selectedObjects] count]; }
|
||||
- (BOOL) canRemove; {
|
||||
return [self isEditable] && [[self selectedObjects] count];
|
||||
}
|
||||
|
||||
- (BOOL) isEditable {
|
||||
return _editable;
|
||||
@ -175,7 +177,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) addObserver: (NSObject *) observer
|
||||
forKeyPath: (NSString *) keyPath
|
||||
options: (NSKeyValueObservingOptions) options
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
[_observedKeys addObject: keyPath];
|
||||
[super addObserver: observer
|
||||
forKeyPath: keyPath
|
||||
@ -183,8 +186,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
context: context];
|
||||
}
|
||||
|
||||
- (void) removeObserver: (NSObject *) observer
|
||||
forKeyPath: (NSString *) keyPath {
|
||||
- (void) removeObserver: (NSObject *) observer forKeyPath: (NSString *) keyPath
|
||||
{
|
||||
[_observedKeys removeObject: keyPath];
|
||||
[super removeObserver: observer forKeyPath: keyPath];
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <Foundation/NSKeyValueObserving.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
void NSStringKVCSplitOnDot(NSString *self, NSString **before,
|
||||
NSString **after) {
|
||||
void NSStringKVCSplitOnDot(NSString *self, NSString **before, NSString **after)
|
||||
{
|
||||
NSRange range = [self rangeOfString: @"."];
|
||||
if (range.location != NSNotFound) {
|
||||
*before = [self substringToIndex: range.location];
|
||||
@ -39,7 +39,8 @@ void NSStringKVCSplitOnDot(NSString *self, NSString **before,
|
||||
|
||||
- initWithKeyPath: (NSString *) keyPath
|
||||
observer: (id) observer
|
||||
object: (id) object {
|
||||
object: (id) object
|
||||
{
|
||||
_keyPath = [keyPath retain];
|
||||
_observer = observer;
|
||||
_object = object;
|
||||
@ -84,7 +85,8 @@ void NSStringKVCSplitOnDot(NSString *self, NSString **before,
|
||||
- (void) observeValueForKeyPath: (NSString *) keyPath
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
if (_notifyObject) {
|
||||
[_object observeValueForKeyPath: _keyPath
|
||||
ofObject: _object
|
||||
|
@ -38,7 +38,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- initWithDefaults: (NSUserDefaults *) defaults
|
||||
initialValues: (NSDictionary *) values {
|
||||
initialValues: (NSDictionary *) values
|
||||
{
|
||||
if (defaults == nil)
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
|
@ -42,7 +42,8 @@
|
||||
- (void) addObserver: (id) observer
|
||||
forKeyPath: (NSString *) keyPath
|
||||
options: (NSKeyValueObservingOptions) options
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
// init the proxy
|
||||
_NSObservationProxy *proxy =
|
||||
[[_NSObservationProxy alloc] initWithKeyPath: keyPath
|
||||
|
@ -374,7 +374,8 @@ static NSMutableArray *_cursorStack = nil;
|
||||
- initWithImage: (NSImage *) image
|
||||
foregroundColorHint: (NSColor *) foregroundHint
|
||||
backgroundColorHint: (NSColor *) backgroundHint
|
||||
hotSpot: (NSPoint) hotSpot {
|
||||
hotSpot: (NSPoint) hotSpot
|
||||
{
|
||||
// the hints are unused per doc.s
|
||||
return [self initWithImage: image hotSpot: hotSpot];
|
||||
}
|
||||
|
@ -293,7 +293,8 @@ static void drawRoundedSelection(NSRect rect) {
|
||||
}
|
||||
|
||||
static void getRectsInFrameForAttributesStrings(NSRect *rects, NSRect frame,
|
||||
NSArray *array) {
|
||||
NSArray *array)
|
||||
{
|
||||
NSInteger i, count = [array count];
|
||||
CGFloat maxHeight = 0;
|
||||
|
||||
@ -363,8 +364,8 @@ static void getRectsInFrameForAttributesStrings(NSRect *rects, NSRect frame,
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _multiplyCurrentUnitBy: (NSInteger) multiply
|
||||
add: (NSInteger) addValue {
|
||||
- (void) _multiplyCurrentUnitBy: (NSInteger) multiply add: (NSInteger) addValue
|
||||
{
|
||||
NSArray *array = [self _attributedStrings];
|
||||
NSInteger i, count = [array count];
|
||||
NSDateComponents *components =
|
||||
@ -501,7 +502,8 @@ static void getRectsInFrameForAttributesStrings(NSRect *rects, NSRect frame,
|
||||
|
||||
- (BOOL) continueTracking: (NSPoint) lastPoint
|
||||
at: (NSPoint) currentPoint
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
currentPoint = [view convertPoint: currentPoint fromView: nil];
|
||||
[self selectComponentUnderPoint: currentPoint inView: view];
|
||||
return YES;
|
||||
|
@ -148,7 +148,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (NSEvent *) nextEventMatchingMask: (NSEventMask) mask
|
||||
untilDate: (NSDate *) untilDate
|
||||
inMode: (NSString *) mode
|
||||
dequeue: (BOOL) dequeue {
|
||||
dequeue: (BOOL) dequeue
|
||||
{
|
||||
NSEvent *result = nil;
|
||||
|
||||
if ([_eventQueue count])
|
||||
@ -180,7 +181,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (void) discardEventsMatchingMask: (NSEventMask) mask
|
||||
beforeEvent: (NSEvent *) event {
|
||||
beforeEvent: (NSEvent *) event
|
||||
{
|
||||
NSInteger count = [_eventQueue count];
|
||||
|
||||
while (--count >= 0) {
|
||||
@ -220,7 +222,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (NSEventModifierFlags) modifierForDefault: (NSString *) key
|
||||
standard: (NSEventModifierFlags) standard {
|
||||
standard: (NSEventModifierFlags) standard
|
||||
{
|
||||
NSDictionary *modmap = [[NSUserDefaults standardUserDefaults]
|
||||
dictionaryForKey: @"NSModifierFlagMapping"];
|
||||
NSString *remap = modmap[key];
|
||||
@ -260,7 +263,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (int) runModalPrintPanelWithPrintInfoDictionary:
|
||||
(NSMutableDictionary *) attributes {
|
||||
(NSMutableDictionary *) attributes
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
return 0;
|
||||
}
|
||||
@ -268,7 +272,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (CGContextRef) graphicsPortForPrintOperationWithView: (NSView *) view
|
||||
printInfo:
|
||||
(NSPrintInfo *) printInfo
|
||||
pageRange: (NSRange) pageRange {
|
||||
pageRange: (NSRange) pageRange
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
return nil;
|
||||
}
|
||||
@ -279,7 +284,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (int) savePanel: (NSSavePanel *) savePanel
|
||||
runModalForDirectory: (NSString *) directory
|
||||
file: (NSString *) file {
|
||||
file: (NSString *) file
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
return 0;
|
||||
}
|
||||
@ -287,7 +293,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (int) openPanel: (NSOpenPanel *) openPanel
|
||||
runModalForDirectory: (NSString *) directory
|
||||
file: (NSString *) file
|
||||
types: (NSArray *) types {
|
||||
types: (NSArray *) types
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
return 0;
|
||||
}
|
||||
@ -308,13 +315,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (CGRect) insetRect: (CGRect) frame
|
||||
forNativeWindowBorderWithStyle: (NSUInteger) styleMask {
|
||||
forNativeWindowBorderWithStyle: (NSUInteger) styleMask
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
return frame;
|
||||
}
|
||||
|
||||
- (CGRect) outsetRect: (CGRect) frame
|
||||
forNativeWindowBorderWithStyle: (NSUInteger) styleMask {
|
||||
forNativeWindowBorderWithStyle: (NSUInteger) styleMask
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
return frame;
|
||||
}
|
||||
@ -322,7 +331,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
@end
|
||||
|
||||
void NSColorSetCatalogColor(NSString *catalogName, NSString *colorName,
|
||||
NSColor *color) {
|
||||
NSColor *color)
|
||||
{
|
||||
[[NSDisplay currentDisplay] _addSystemColor: color forName: colorName];
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (instancetype) initWithContentsOfURL: (NSURL *) url
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if ([self _isSelectorOverridden: @selector(initWithContentsOfFile:
|
||||
ofType:)]) {
|
||||
if ([self initWithContentsOfFile: [url path] ofType: type] == nil)
|
||||
@ -147,7 +148,8 @@ static int untitled_document_number = 0;
|
||||
- (instancetype) initForURL: (NSURL *) url
|
||||
withContentsOfURL: (NSURL *) contentsURL
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
[self init];
|
||||
[self setFileURL: url];
|
||||
[self setFileType: type];
|
||||
@ -421,7 +423,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (BOOL) readFromData: (NSData *) data
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if ([self _isSelectorOverridden: @selector(loadDataRepresentation:ofType:)])
|
||||
return [self loadDataRepresentation: data ofType: type];
|
||||
else {
|
||||
@ -433,7 +436,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (BOOL) readFromFileWrapper: (NSFileWrapper *) fileWrapper
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if ([self _isSelectorOverridden: @selector(loadFileWrapperRepresentation:
|
||||
ofType:)])
|
||||
return [self loadFileWrapperRepresentation: fileWrapper ofType: type];
|
||||
@ -445,7 +449,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (BOOL) readFromURL: (NSURL *) url
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if ([url isFileURL]) {
|
||||
if ([self _isSelectorOverridden: @selector(readFromFile:ofType:)]) {
|
||||
return [self readFromFile: [url path] ofType: type];
|
||||
@ -464,7 +469,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (BOOL) revertToContentsOfURL: (NSURL *) url
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if (![self readFromURL: url ofType: type error: error])
|
||||
return NO;
|
||||
|
||||
@ -482,7 +488,8 @@ static int untitled_document_number = 0;
|
||||
}
|
||||
|
||||
- (NSFileWrapper *) fileWrapperOfType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if ([self
|
||||
_isSelectorOverridden: @selector(fileWrapperRepresentationOfType:)])
|
||||
return [self fileWrapperRepresentationOfType: type];
|
||||
@ -499,7 +506,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (BOOL) writeToURL: (NSURL *) url
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if ([self _isSelectorOverridden: @selector(writeToFile:ofType:)]) {
|
||||
return [self writeToFile: [url path] ofType: type];
|
||||
} else {
|
||||
@ -521,7 +529,8 @@ static int untitled_document_number = 0;
|
||||
ofType: (NSString *) type
|
||||
forSaveOperation: (NSSaveOperationType) operation
|
||||
originalContentsURL: (NSURL *) contentsURL
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
BOOL status = NO;
|
||||
if ([self _isSelectorOverridden: @selector
|
||||
(writeToFile:ofType:originalFile:saveOperation:)]) {
|
||||
@ -544,7 +553,8 @@ static int untitled_document_number = 0;
|
||||
- (BOOL) writeSafelyToURL: (NSURL *) url
|
||||
ofType: (NSString *) type
|
||||
forSaveOperation: (NSSaveOperationType) operation
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if (![self writeToURL: url
|
||||
ofType: type
|
||||
forSaveOperation: operation
|
||||
@ -569,7 +579,8 @@ static int untitled_document_number = 0;
|
||||
ofType: (NSString *) type
|
||||
forSaveOperation: (NSSaveOperationType) operation
|
||||
originalContentsURL: (NSURL *) contentsURL
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSMutableDictionary *result = [NSMutableDictionary dictionary];
|
||||
|
||||
return result;
|
||||
@ -581,7 +592,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (void) autosaveDocumentWithDelegate: delegate
|
||||
didAutosaveSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
NSError *error;
|
||||
|
||||
if (![self writeToURL: [self autosavedContentsFileURL]
|
||||
@ -608,7 +620,8 @@ static int untitled_document_number = 0;
|
||||
modalForWindow: (NSWindow *) window
|
||||
delegate: delegate
|
||||
didPresentSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
[[NSDocumentController sharedDocumentController]
|
||||
presentError: [self willPresentError: error]
|
||||
modalForWindow: window
|
||||
@ -657,7 +670,8 @@ static int untitled_document_number = 0;
|
||||
- (void) runModalSavePanelForSaveOperation: (NSSaveOperationType) operation
|
||||
delegate: delegate
|
||||
didSaveSelector: (SEL) selector
|
||||
contextInfo: (void *) context {
|
||||
contextInfo: (void *) context
|
||||
{
|
||||
NSString *path = [_fileURL path];
|
||||
NSString *extension = [path pathExtension];
|
||||
if ([extension length] == 0) {
|
||||
@ -738,7 +752,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (void) saveDocumentWithDelegate: delegate
|
||||
didSaveSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
// First make sure there are no uncommitted changes
|
||||
for (id editor in [[_activeEditors copy] autorelease]) {
|
||||
[editor commitEditing];
|
||||
@ -809,7 +824,8 @@ static int untitled_document_number = 0;
|
||||
- (BOOL) saveToURL: (NSURL *) url
|
||||
ofType: (NSString *) type
|
||||
forSaveOperation: (NSSaveOperationType) operation
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
if (url == nil) {
|
||||
return NO;
|
||||
} else {
|
||||
@ -835,7 +851,8 @@ static int untitled_document_number = 0;
|
||||
forSaveOperation: (NSSaveOperationType) operation
|
||||
delegate: delegate
|
||||
didSaveSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
NSError *error = nil;
|
||||
BOOL success = [self saveToURL: url
|
||||
ofType: type
|
||||
@ -867,7 +884,8 @@ static int untitled_document_number = 0;
|
||||
- (void) runModalPageLayoutWithPrintInfo: (NSPrintInfo *) printInfo
|
||||
delegate: delegate
|
||||
didRunSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
int button = [[NSPageLayout pageLayout] runModalWithPrintInfo: printInfo];
|
||||
if ([delegate respondsToSelector: selector]) {
|
||||
// Tell delegate if the print info was updated.
|
||||
@ -881,12 +899,14 @@ static int untitled_document_number = 0;
|
||||
- (void) runModalPrintOperation: (NSPrintOperation *) printOperation
|
||||
delegate: delegate
|
||||
didRunSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (NSPrintOperation *) printOperationWithSettings: (NSDictionary *) settings
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSLog(@"Implement %s in your subclass %@ of NSDocument to enable printing",
|
||||
sel_getName(_cmd), [self class]);
|
||||
return nil;
|
||||
@ -896,7 +916,8 @@ static int untitled_document_number = 0;
|
||||
showPrintPanel: (BOOL) showPrintPanel
|
||||
delegate: delegate
|
||||
didPrintSelector: (SEL) selector
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
if ([self _isSelectorOverridden: @selector(printShowingPrintPanel:)]) {
|
||||
[self printShowingPrintPanel: showPrintPanel];
|
||||
} else {
|
||||
@ -932,7 +953,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (void) canCloseDocumentWithDelegate: delegate
|
||||
shouldCloseSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
BOOL OKToClose;
|
||||
if ([self isDocumentEdited]) {
|
||||
NSString *fileName = [self fileName];
|
||||
@ -981,7 +1003,8 @@ static int untitled_document_number = 0;
|
||||
- (void) shouldCloseWindowController: (NSWindowController *) controller
|
||||
delegate: delegate
|
||||
shouldCloseSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
if ([controller shouldCloseDocument] || [_windowControllers count] <= 1) {
|
||||
[self canCloseDocumentWithDelegate: delegate
|
||||
shouldCloseSelector: selector
|
||||
@ -1095,8 +1118,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (NSDictionary *) fileAttributesToWriteToFile: (NSString *) path
|
||||
ofType: (NSString *) type
|
||||
saveOperation:
|
||||
(NSSaveOperationType) operation {
|
||||
saveOperation: (NSSaveOperationType) operation
|
||||
{
|
||||
return [NSDictionary dictionary];
|
||||
}
|
||||
|
||||
@ -1105,7 +1128,8 @@ static int untitled_document_number = 0;
|
||||
}
|
||||
|
||||
- (NSString *) fileNameFromRunningSavePanelForSaveOperation:
|
||||
(NSSaveOperationType) operation {
|
||||
(NSSaveOperationType) operation
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
@ -1179,7 +1203,8 @@ static int untitled_document_number = 0;
|
||||
}
|
||||
|
||||
- (BOOL) loadFileWrapperRepresentation: (NSFileWrapper *) fileWrapper
|
||||
ofType: (NSString *) type {
|
||||
ofType: (NSString *) type
|
||||
{
|
||||
|
||||
if ([fileWrapper isRegularFile])
|
||||
return [self loadDataRepresentation: [fileWrapper regularFileContents]
|
||||
@ -1230,7 +1255,8 @@ static int untitled_document_number = 0;
|
||||
}
|
||||
|
||||
- (int) runModalSavePanel: (NSSavePanel *) savePanel
|
||||
withAccessoryView: (NSView *) accessoryView {
|
||||
withAccessoryView: (NSView *) accessoryView
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
@ -1250,7 +1276,8 @@ static int untitled_document_number = 0;
|
||||
saveOperation: (NSSaveOperationType) operation
|
||||
delegate: delegate
|
||||
didSaveSelector: (SEL) selector
|
||||
contextInfo: (void *) context {
|
||||
contextInfo: (void *) context
|
||||
{
|
||||
if (path != nil) {
|
||||
BOOL success = [self writeWithBackupToFile: path
|
||||
ofType: _fileType
|
||||
@ -1296,7 +1323,8 @@ static int untitled_document_number = 0;
|
||||
- (BOOL) writeToFile: (NSString *) path
|
||||
ofType: (NSString *) type
|
||||
originalFile: (NSString *) original
|
||||
saveOperation: (NSSaveOperationType) operation {
|
||||
saveOperation: (NSSaveOperationType) operation
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
@ -1308,7 +1336,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (BOOL) writeWithBackupToFile: (NSString *) path
|
||||
ofType: (NSString *) type
|
||||
saveOperation: (NSSaveOperationType) operation {
|
||||
saveOperation: (NSSaveOperationType) operation
|
||||
{
|
||||
// move original to backup
|
||||
|
||||
if (![self writeToFile: path ofType: type])
|
||||
@ -1402,7 +1431,8 @@ static int untitled_document_number = 0;
|
||||
|
||||
- (void) didEndShouldCloseSheet: (NSWindow *) sheet
|
||||
returnCode: (int) returnCode
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
NSWindow *window = (NSWindow *) contextInfo;
|
||||
|
||||
switch (returnCode) {
|
||||
|
@ -256,7 +256,8 @@ static NSDocumentController *shared = nil;
|
||||
|
||||
- makeDocumentWithContentsOfURL: (NSURL *) url
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
id result;
|
||||
Class class = [self documentClassForType: type];
|
||||
|
||||
@ -269,7 +270,8 @@ static NSDocumentController *shared = nil;
|
||||
- makeDocumentForURL: (NSURL *) url
|
||||
withContentsOfURL: (NSURL *) contentsURL
|
||||
ofType: (NSString *) type
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
id result;
|
||||
Class class = [self documentClassForType: type];
|
||||
|
||||
@ -297,7 +299,8 @@ static NSDocumentController *shared = nil;
|
||||
}
|
||||
|
||||
- (id) makeUntitledDocumentOfType: (NSString *) type
|
||||
error: (NSError **) outError {
|
||||
error: (NSError **) outError
|
||||
{
|
||||
/* Cocoa documentation says:
|
||||
"For backward binary compatibility with Mac OS X v10.3 and earlier,
|
||||
the default implementation of this method instead invokes
|
||||
@ -395,7 +398,8 @@ static NSDocumentController *shared = nil;
|
||||
|
||||
- openDocumentWithContentsOfURL: (NSURL *) url
|
||||
display: (BOOL) display
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
IMP mine = [NSDocumentController instanceMethodForSelector: @selector
|
||||
(openDocumentWithContentsOfFile:display:)];
|
||||
IMP theirs = [self
|
||||
@ -430,14 +434,16 @@ static NSDocumentController *shared = nil;
|
||||
|
||||
- (BOOL) reopenDocumentForURL: (NSURL *) url
|
||||
withContentsOfURL: (NSURL *) contentsUL
|
||||
error: (NSError **) error {
|
||||
error: (NSError **) error
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void) _closeDocumentsStartingWith: (NSDocument *) document
|
||||
shouldClose: (BOOL) shouldClose
|
||||
closeAllContext: (NSDictionary *) context {
|
||||
closeAllContext: (NSDictionary *) context
|
||||
{
|
||||
// This is a recursive callback method. Start it by passing in a document of
|
||||
// nil.
|
||||
void (*delegateMethod)(id, SEL, id, BOOL, void *);
|
||||
@ -471,7 +477,8 @@ static NSDocumentController *shared = nil;
|
||||
|
||||
- (void) closeAllDocumentsWithDelegate: delegate
|
||||
didCloseAllSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
NSDictionary *closeAllContext = [[NSDictionary alloc]
|
||||
initWithObjectsAndKeys: delegate, @"delegate",
|
||||
NSStringFromSelector(selector), @"selector",
|
||||
@ -486,7 +493,8 @@ static NSDocumentController *shared = nil;
|
||||
cancellable: (BOOL) cancellable
|
||||
delegate: delegate
|
||||
didReviewAllSelector: (SEL) selector
|
||||
info: (void *) info {
|
||||
info: (void *) info
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -503,7 +511,8 @@ static NSDocumentController *shared = nil;
|
||||
modalForWindow: (NSWindow *) window
|
||||
delegate: delegate
|
||||
didPresentSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
[NSApp presentError: [self willPresentError: error]
|
||||
modalForWindow: window
|
||||
delegate: delegate
|
||||
@ -512,7 +521,8 @@ static NSDocumentController *shared = nil;
|
||||
}
|
||||
|
||||
- (int) runModalOpenPanel: (NSOpenPanel *) openPanel
|
||||
forTypes: (NSArray *) extensions {
|
||||
forTypes: (NSArray *) extensions
|
||||
{
|
||||
int result = [openPanel runModalForDirectory: [self currentDirectory]
|
||||
file: nil
|
||||
types: extensions];
|
||||
@ -768,7 +778,8 @@ static BOOL actionIsDocumentController(SEL selector) {
|
||||
}
|
||||
|
||||
- (BOOL) reviewUnsavedDocumentsWithAlertTitle: (NSString *) title
|
||||
cancellable: (BOOL) cancellable {
|
||||
cancellable: (BOOL) cancellable
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
@ -47,7 +47,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
event: (NSEvent *) event
|
||||
pasteboard: (NSPasteboard *) pasteboard
|
||||
source: (id) source
|
||||
slideBack: (BOOL) slideBack {
|
||||
slideBack: (BOOL) slideBack
|
||||
{
|
||||
NSInvalidAbstractInvocation();
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,8 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification";
|
||||
leadingOffset: (CGFloat) leadingOffset
|
||||
trailingOffset: (CGFloat) trailingOffset
|
||||
edge: (NSRectEdge) edge
|
||||
state: (NSDrawerState) state {
|
||||
state: (NSDrawerState) state
|
||||
{
|
||||
NSRect parentFrame = [parentWindow frame];
|
||||
NSRect parentContentRect =
|
||||
[parentWindow contentRectForFrameRect: parentFrame];
|
||||
@ -110,7 +111,8 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification";
|
||||
// preferred edge if neither is possible.
|
||||
+ (NSRectEdge) visibleEdgeWithPreferredEdge: (NSRectEdge) preferredEdge
|
||||
parentWindow: (NSWindow *) parentWindow
|
||||
drawerWindow: (NSWindow *) drawerWindow {
|
||||
drawerWindow: (NSWindow *) drawerWindow
|
||||
{
|
||||
NSRect screenRect = [[parentWindow screen] visibleFrame];
|
||||
NSRect parentRect = [parentWindow frame];
|
||||
NSRect drawerRect = [drawerWindow frame];
|
||||
@ -226,7 +228,8 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification";
|
||||
}
|
||||
|
||||
- (id) initWithContentSize: (NSSize) contentSize
|
||||
preferredEdge: (NSRectEdge) edge {
|
||||
preferredEdge: (NSRectEdge) edge
|
||||
{
|
||||
_drawerWindow = [[NSDrawerWindow alloc]
|
||||
initWithContentRect: NSMakeRect(0, 0, contentSize.width,
|
||||
contentSize.height)
|
||||
@ -571,7 +574,8 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification";
|
||||
|
||||
- (NSSize) drawerWindow: (NSDrawerWindow *) window
|
||||
constrainSize: (NSSize) size
|
||||
edge: (NSRectEdge) edge {
|
||||
edge: (NSRectEdge) edge
|
||||
{
|
||||
if (edge == NSMinXEdge || edge == NSMaxXEdge) {
|
||||
if (size.width > _maxContentSize.width && _maxContentSize.width > 0)
|
||||
size.width = _maxContentSize.width;
|
||||
|
@ -42,7 +42,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (void) platformWindowActivated: (CGWindow *) window
|
||||
displayIfNeeded: (BOOL) displayIfNeeded {
|
||||
displayIfNeeded: (BOOL) displayIfNeeded
|
||||
{
|
||||
[_drawer drawerWindowDidActivate: self];
|
||||
|
||||
[super platformWindowActivated: window displayIfNeeded: displayIfNeeded];
|
||||
@ -50,7 +51,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
// constrain resize size.
|
||||
- (NSSize) platformWindow: (CGWindow *) window
|
||||
frameSizeWillChange: (NSSize) size {
|
||||
frameSizeWillChange: (NSSize) size
|
||||
{
|
||||
size = [super platformWindow: window frameSizeWillChange: size];
|
||||
|
||||
return [_drawer drawerWindow: self
|
||||
|
@ -42,7 +42,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (instancetype) initWithType: (NSEventType) type
|
||||
location: (NSPoint) location
|
||||
modifierFlags: (NSEventModifierFlags) modifierFlags
|
||||
window: (NSWindow *) window {
|
||||
window: (NSWindow *) window
|
||||
{
|
||||
_type = type;
|
||||
_timestamp = [NSDate timeIntervalSinceReferenceDate];
|
||||
_locationInWindow = location;
|
||||
@ -57,7 +58,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
window: (NSWindow *) window
|
||||
clickCount: (NSInteger) clickCount
|
||||
deltaX: (CGFloat) deltaX
|
||||
deltaY: (CGFloat) deltaY {
|
||||
deltaY: (CGFloat) deltaY
|
||||
{
|
||||
return [[[NSEvent_mouse alloc] initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
@ -71,7 +73,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
location: (NSPoint) location
|
||||
modifierFlags: (NSEventModifierFlags) modifierFlags
|
||||
window: (NSWindow *) window
|
||||
deltaY: (CGFloat) deltaY {
|
||||
deltaY: (CGFloat) deltaY
|
||||
{
|
||||
return [[[NSEvent_mouse alloc] initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
@ -87,7 +90,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
context: (NSGraphicsContext *) context
|
||||
eventNumber: (NSInteger) eventNumber
|
||||
trackingNumber: (NSInteger) tracking
|
||||
userData: (void *) userData {
|
||||
userData: (void *) userData
|
||||
{
|
||||
return [[[NSEvent_mouse alloc] initWithType: type
|
||||
location: location
|
||||
modifierFlags: flags
|
||||
@ -107,7 +111,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
context: (NSGraphicsContext *) context
|
||||
eventNumber: (NSInteger) eventNumber
|
||||
clickCount: (NSInteger) clickCount
|
||||
pressure: (float) pressure {
|
||||
pressure: (float) pressure
|
||||
{
|
||||
return [[[NSEvent_mouse alloc] initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
@ -126,7 +131,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
characters: (NSString *) characters
|
||||
charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers
|
||||
isARepeat: (BOOL) isARepeat
|
||||
keyCode: (unsigned short) keyCode {
|
||||
keyCode: (unsigned short) keyCode
|
||||
{
|
||||
return [[[NSEvent_keyboard alloc] initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
@ -146,7 +152,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
characters: (NSString *) characters
|
||||
charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers
|
||||
isARepeat: (BOOL) isARepeat
|
||||
keyCode: (unsigned short) keyCode {
|
||||
keyCode: (unsigned short) keyCode
|
||||
{
|
||||
return [[[NSEvent_keyboard alloc]
|
||||
initWithType: type
|
||||
location: location
|
||||
@ -167,7 +174,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
context: (NSGraphicsContext *) context
|
||||
subtype: (short) subtype
|
||||
data1: (NSInteger) data1
|
||||
data2: (NSInteger) data2 {
|
||||
data2: (NSInteger) data2
|
||||
{
|
||||
return [[[NSEvent_other alloc] initWithType: type
|
||||
location: location
|
||||
modifierFlags: flags
|
||||
@ -272,7 +280,8 @@ static NSTimer *_periodicTimer = nil;
|
||||
}
|
||||
|
||||
+ (void) startPeriodicEventsAfterDelay: (NSTimeInterval) delay
|
||||
withPeriod: (NSTimeInterval) period {
|
||||
withPeriod: (NSTimeInterval) period
|
||||
{
|
||||
NSNumber *userInfo = [NSNumber numberWithDouble: period];
|
||||
|
||||
if (_periodicTimer != nil)
|
||||
|
@ -29,7 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
characters: (NSString *) characters
|
||||
charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers
|
||||
isARepeat: (BOOL) isARepeat
|
||||
keyCode: (unsigned short) keyCode {
|
||||
keyCode: (unsigned short) keyCode
|
||||
{
|
||||
[super initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
|
@ -27,7 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
window: (NSWindow *) window
|
||||
clickCount: (NSInteger) clickCount
|
||||
deltaX: (CGFloat) deltaX
|
||||
deltaY: (CGFloat) deltaY {
|
||||
deltaY: (CGFloat) deltaY
|
||||
{
|
||||
[super initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
@ -48,7 +49,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
location: (NSPoint) location
|
||||
modifierFlags: (NSEventModifierFlags) modifierFlags
|
||||
window: (NSWindow *) window
|
||||
deltaY: (CGFloat) deltaY {
|
||||
deltaY: (CGFloat) deltaY
|
||||
{
|
||||
[super initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
@ -67,7 +69,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
context: (NSGraphicsContext *) context
|
||||
eventNumber: (NSInteger) eventNumber
|
||||
trackingNumber: (NSInteger) tracking
|
||||
userData: (void *) userData {
|
||||
userData: (void *) userData
|
||||
{
|
||||
self = [super initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
@ -87,7 +90,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
context: (NSGraphicsContext *) context
|
||||
eventNumber: (NSInteger) eventNumber
|
||||
clickCount: (NSInteger) clickCount
|
||||
pressure: (float) pressure {
|
||||
pressure: (float) pressure
|
||||
{
|
||||
[super initWithType: type
|
||||
location: location
|
||||
modifierFlags: modifierFlags
|
||||
|
@ -28,7 +28,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
context: (NSGraphicsContext *) context
|
||||
subtype: (short) subtype
|
||||
data1: (NSInteger) data1
|
||||
data2: (NSInteger) data2 {
|
||||
data2: (NSInteger) data2
|
||||
{
|
||||
_type = type;
|
||||
_locationInWindow = location;
|
||||
_modifierFlags = modifierFlags;
|
||||
|
@ -130,8 +130,8 @@ static NSLock *_cacheLock = nil;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSUInteger) _cacheIndexOfFontWithName: (NSString *) name
|
||||
size: (CGFloat) size {
|
||||
+ (NSUInteger) _cacheIndexOfFontWithName: (NSString *) name size: (CGFloat) size
|
||||
{
|
||||
NSUInteger i;
|
||||
|
||||
for (i = 0; i < _fontCacheSize; i++) {
|
||||
@ -219,7 +219,8 @@ static NSLock *_cacheLock = nil;
|
||||
|
||||
+ (NSFont *) _uiFontOfType: (CTFontUIFontType) type
|
||||
size: (CGFloat) size
|
||||
fallbackName: (NSString *) fallbackName {
|
||||
fallbackName: (NSString *) fallbackName
|
||||
{
|
||||
NSFont *result = nil;
|
||||
CTFontRef ctFont = CTFontCreateUIFontForLanguage(type, size, nil);
|
||||
if (ctFont) {
|
||||
@ -505,7 +506,8 @@ static NSLock *_cacheLock = nil;
|
||||
}
|
||||
|
||||
+ (NSFont *) fontWithDescriptor: (NSFontDescriptor *) descriptor
|
||||
size: (CGFloat) size {
|
||||
size: (CGFloat) size
|
||||
{
|
||||
|
||||
NSDictionary *attributes = [descriptor fontAttributes];
|
||||
NSString *fontName = [attributes objectForKey: NSFontNameAttribute];
|
||||
@ -552,7 +554,8 @@ static NSLock *_cacheLock = nil;
|
||||
|
||||
+ (NSFont *) fontWithDescriptor: (NSFontDescriptor *) descriptor
|
||||
size: (CGFloat) size
|
||||
textTransform: (NSAffineTransform *) transform {
|
||||
textTransform: (NSAffineTransform *) transform
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
@ -639,7 +642,7 @@ static NSLock *_cacheLock = nil;
|
||||
setObject: [NSNumber numberWithInt: [fm weightOfFont: self]]
|
||||
forKey: NSFontWeightTrait];
|
||||
// [traitsDictionary setObject: [NSNumber numberWithInt: ??] forKey:
|
||||
//NSFontWidthTrait]; // not sure what's put here
|
||||
// NSFontWidthTrait]; // not sure what's put here
|
||||
[traitsDictionary setObject: [NSNumber numberWithDouble: [self italicAngle]]
|
||||
forKey: NSFontSlantTrait];
|
||||
return traitsDictionary;
|
||||
@ -657,9 +660,11 @@ static NSLock *_cacheLock = nil;
|
||||
NSFontFamilyAttribute,
|
||||
[[NSNumber numberWithDouble: [self pointSize]] stringValue],
|
||||
NSFontSizeAttribute,
|
||||
// [self matrix], NSFontMatrixAttribute, // currently
|
||||
//returns nil [self coveredCharacterSet],
|
||||
//NSFontCharacterSetAttribute, // currently returns nil
|
||||
// [self
|
||||
//matrix], NSFontMatrixAttribute,
|
||||
//// currently returns nil
|
||||
// [self coveredCharacterSet], NSFontCharacterSetAttribute, //
|
||||
// currently returns nil
|
||||
[self _fontTraitsAsDictionary], NSFontTraitsAttribute,
|
||||
[typeface traitName], NSFontFaceAttribute,
|
||||
[NSNumber numberWithDouble: [self maximumAdvancement].width],
|
||||
@ -821,7 +826,8 @@ static NSLock *_cacheLock = nil;
|
||||
|
||||
- (NSPoint) positionOfGlyph: (NSGlyph) current
|
||||
precededByGlyph: (NSGlyph) previous
|
||||
isNominal: (BOOL *) isNominalp {
|
||||
isNominal: (BOOL *) isNominalp
|
||||
{
|
||||
return [_ctFont positionOfGlyph: current
|
||||
precededByGlyph: previous
|
||||
isNominal: isNominalp];
|
||||
@ -829,7 +835,8 @@ static NSLock *_cacheLock = nil;
|
||||
|
||||
- (void) getAdvancements: (NSSize *) advancements
|
||||
forGlyphs: (const NSGlyph *) glyphs
|
||||
count: (NSUInteger) count {
|
||||
count: (NSUInteger) count
|
||||
{
|
||||
CGGlyph cgGlyphs[count];
|
||||
NSInteger i;
|
||||
|
||||
@ -841,19 +848,22 @@ static NSLock *_cacheLock = nil;
|
||||
|
||||
- (void) getAdvancements: (NSSize *) advancements
|
||||
forPackedGlyphs: (const void *) packed
|
||||
length: (NSUInteger) length {
|
||||
length: (NSUInteger) length
|
||||
{
|
||||
CTFontGetAdvancesForGlyphs(_ctFont, 0, packed, advancements, length);
|
||||
}
|
||||
|
||||
- (void) getBoundingRects: (NSRect *) rects
|
||||
forGlyphs: (const NSGlyph *) glyphs
|
||||
count: (NSUInteger) count {
|
||||
count: (NSUInteger) count
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (NSUInteger) getGlyphs: (NSGlyph *) glyphs
|
||||
forCharacters: (unichar *) characters
|
||||
length: (NSUInteger) length {
|
||||
length: (NSUInteger) length
|
||||
{
|
||||
CGGlyph cgGlyphs[length];
|
||||
NSInteger i;
|
||||
|
||||
@ -879,7 +889,8 @@ static NSLock *_cacheLock = nil;
|
||||
|
||||
NSInteger NSConvertGlyphsToPackedGlyphs(NSGlyph *glyphs, NSInteger length,
|
||||
NSMultibyteGlyphPacking packing,
|
||||
char *outputX) {
|
||||
char *outputX)
|
||||
{
|
||||
NSInteger i, result = 0;
|
||||
CGGlyph *output = (CGGlyph *) outputX;
|
||||
|
||||
|
@ -76,8 +76,8 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000;
|
||||
autorelease];
|
||||
}
|
||||
|
||||
+ fontDescriptorWithName: (NSString *) name
|
||||
matrix: (NSAffineTransform *) matrix {
|
||||
+ fontDescriptorWithName: (NSString *) name matrix: (NSAffineTransform *) matrix
|
||||
{
|
||||
NSDictionary *attributes = [NSDictionary
|
||||
dictionaryWithObjectsAndKeys: name, NSFontNameAttribute, matrix,
|
||||
NSFontMatrixAttribute, nil];
|
||||
@ -119,7 +119,8 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000;
|
||||
}
|
||||
|
||||
- (NSFontDescriptor *) fontDescriptorByAddingAttributes:
|
||||
(NSDictionary *) attributes {
|
||||
(NSDictionary *) attributes
|
||||
{
|
||||
NSMutableDictionary *copy =
|
||||
[NSMutableDictionary dictionaryWithDictionary: _attributes];
|
||||
|
||||
@ -166,7 +167,8 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000;
|
||||
}
|
||||
|
||||
- (NSFontDescriptor *) fontDescriptorWithSymbolicTraits:
|
||||
(NSFontSymbolicTraits) traits {
|
||||
(NSFontSymbolicTraits) traits
|
||||
{
|
||||
NSMutableDictionary *copy =
|
||||
[NSMutableDictionary dictionaryWithDictionary: _attributes];
|
||||
|
||||
|
@ -89,7 +89,8 @@ static Class _fontPanelFactory;
|
||||
}
|
||||
|
||||
- (void) addFontDescriptors: (NSArray *) descriptors
|
||||
toCollection: (NSString *) name {
|
||||
toCollection: (NSString *) name
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -180,7 +181,8 @@ static Class _fontPanelFactory;
|
||||
}
|
||||
|
||||
- (NSArray *) availableFontNamesMatchingFontDescriptor:
|
||||
(NSFontDescriptor *) descriptor {
|
||||
(NSFontDescriptor *) descriptor
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
@ -199,7 +201,8 @@ static Class _fontPanelFactory;
|
||||
- (NSFont *) fontWithFamily: (NSString *) familyName
|
||||
traits: (NSFontTraitMask) traits
|
||||
weight: (int) weight
|
||||
size: (CGFloat) size {
|
||||
size: (CGFloat) size
|
||||
{
|
||||
// Note : weight is ignored
|
||||
|
||||
NSFontFamily *family = [NSFontFamily fontFamilyWithName: familyName];
|
||||
@ -250,7 +253,8 @@ static Class _fontPanelFactory;
|
||||
}
|
||||
|
||||
- (NSString *) localizedNameForFamily: (NSString *) family
|
||||
face: (NSString *) face {
|
||||
face: (NSString *) face
|
||||
{
|
||||
if (face == nil) {
|
||||
return family;
|
||||
}
|
||||
@ -420,7 +424,8 @@ static Class _fontPanelFactory;
|
||||
}
|
||||
|
||||
- (BOOL) _canConvertFont: (NSFont *) font
|
||||
toHaveTrait: (NSFontTraitMask) addTraits {
|
||||
toHaveTrait: (NSFontTraitMask) addTraits
|
||||
{
|
||||
NSFontFamily *family =
|
||||
[NSFontFamily fontFamilyWithTypefaceName: [font fontName]];
|
||||
NSFontTypeface *typeface = [family typefaceWithName: [font fontName]];
|
||||
@ -447,7 +452,8 @@ static Class _fontPanelFactory;
|
||||
}
|
||||
|
||||
- (NSFont *) convertFont: (NSFont *) font
|
||||
toHaveTrait: (NSFontTraitMask) addTraits {
|
||||
toHaveTrait: (NSFontTraitMask) addTraits
|
||||
{
|
||||
if (font == nil) {
|
||||
return nil;
|
||||
}
|
||||
@ -477,7 +483,8 @@ static Class _fontPanelFactory;
|
||||
}
|
||||
|
||||
- (NSFont *) convertFont: (NSFont *) font
|
||||
toNotHaveTrait: (NSFontTraitMask) trait {
|
||||
toNotHaveTrait: (NSFontTraitMask) trait
|
||||
{
|
||||
if (font == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
@ -24,7 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- initWithSize: (NSSize) size
|
||||
ascender: (CGFloat) ascender
|
||||
descender: (CGFloat) descender {
|
||||
descender: (CGFloat) descender
|
||||
{
|
||||
_size = size;
|
||||
_ascender = ascender;
|
||||
_descender = descender;
|
||||
|
@ -202,9 +202,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) setPanelFont: (NSFont *) font isMultiple: (BOOL) isMultiple {
|
||||
NSFontFamily *family =
|
||||
[NSFontFamily fontFamilyWithTypefaceName: [font fontName]];
|
||||
NSFontTypeface *typeface = [family typefaceWithName: [font fontName]];
|
||||
|
||||
{
|
||||
NSFontTypeface *typeface = [family typefaceWithName: [font fontName]]; {
|
||||
NSArray *families = [self availableFontFamilies];
|
||||
NSString *familyName = [family name];
|
||||
unsigned familyIndex = [families indexOfObject: familyName];
|
||||
|
@ -26,7 +26,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- initWithName: (NSString *) name
|
||||
displayName: (NSString *) displayName
|
||||
traitName: (NSString *) traitName
|
||||
traits: (NSFontTraitMask) traits {
|
||||
traits: (NSFontTraitMask) traits
|
||||
{
|
||||
_name = [name copy];
|
||||
_displayName = [displayName copy];
|
||||
_traitName = [traitName copy];
|
||||
@ -37,7 +38,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- initWithName: (NSString *) name
|
||||
traitName: (NSString *) traitName
|
||||
traits: (NSFontTraitMask) traits {
|
||||
traits: (NSFontTraitMask) traits
|
||||
{
|
||||
return [self initWithName: name
|
||||
displayName: name
|
||||
traitName: traitName
|
||||
|
@ -242,7 +242,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
inView: (NSView *) view
|
||||
editor: (NSText *) editor
|
||||
delegate: (id) delegate
|
||||
event: (NSEvent *) event {
|
||||
event: (NSEvent *) event
|
||||
{
|
||||
|
||||
frame = [self titleRectForBounds: frame];
|
||||
[super editWithFrame: frame
|
||||
@ -257,7 +258,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
editor: (NSText *) editor
|
||||
delegate: (id) delegate
|
||||
start: (NSInteger) location
|
||||
length: (NSInteger) length {
|
||||
length: (NSInteger) length
|
||||
{
|
||||
|
||||
frame = [self titleRectForBounds: frame];
|
||||
[super selectWithFrame: frame
|
||||
|
@ -34,7 +34,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) generateGlyphsForGlyphStorage: (id<NSGlyphStorage>) glyphStorage
|
||||
desiredNumberOfCharacters: (NSUInteger) numberOfCharacters
|
||||
glyphIndex: (NSUInteger *) glyphIndexp
|
||||
characterIndex: (NSUInteger *) characterIndexp {
|
||||
characterIndex: (NSUInteger *) characterIndexp
|
||||
{
|
||||
NSAttributedString *text = [glyphStorage attributedString];
|
||||
NSString *string = [text string];
|
||||
NSUInteger length = [string length];
|
||||
|
@ -24,7 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- initWithCharacterIdentifier: (NSUInteger) identifier
|
||||
collection: (NSCharacterCollection) collection
|
||||
glyphName: (NSString *) glyphName {
|
||||
glyphName: (NSString *) glyphName
|
||||
{
|
||||
_identifier = identifier;
|
||||
_collection = collection;
|
||||
_glyphName = [glyphName copy];
|
||||
@ -39,21 +40,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
+ (NSGlyphInfo *) glyphInfoWithCharacterIdentifier: (NSUInteger) identifier
|
||||
collection:
|
||||
(NSCharacterCollection) collection
|
||||
baseString: (NSString *) baseString {
|
||||
baseString: (NSString *) baseString
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (NSGlyphInfo *) glyphInfoWithGlyph: (NSGlyph) glyph
|
||||
forFont: (NSFont *) font
|
||||
baseString: (NSString *) baseString {
|
||||
baseString: (NSString *) baseString
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (NSGlyphInfo *) glyphInfoWithGlyphName: (NSString *) glyphName
|
||||
forFont: (NSFont *) font
|
||||
baseString: (NSString *) baseString {
|
||||
baseString: (NSString *) baseString
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
@ -80,7 +80,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) {
|
||||
}
|
||||
|
||||
- initWithStartingColor: (NSColor *) startingColor
|
||||
endingColor: (NSColor *) endingColor {
|
||||
endingColor: (NSColor *) endingColor
|
||||
{
|
||||
NSArray *colors =
|
||||
[NSArray arrayWithObjects: startingColor, endingColor, nil];
|
||||
CGFloat locations[2] = {0.0, 1.0};
|
||||
@ -129,7 +130,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) {
|
||||
|
||||
- initWithColors: (NSArray *) colors
|
||||
atLocations: (const CGFloat *) locations
|
||||
colorSpace: (NSColorSpace *) colorSpace {
|
||||
colorSpace: (NSColorSpace *) colorSpace
|
||||
{
|
||||
_colorSpace = [[NSColorSpace deviceRGBColorSpace] retain];
|
||||
_numberOfColors = [colors count];
|
||||
_numberOfComponents = 4;
|
||||
@ -168,7 +170,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) {
|
||||
|
||||
- (void) drawFromPoint: (NSPoint) startingPoint
|
||||
toPoint: (NSPoint) endingPoint
|
||||
options: (NSGradientDrawingOptions) options {
|
||||
options: (NSGradientDrawingOptions) options
|
||||
{
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGFunctionCallbacks callbacks = {0, evaluate, NULL};
|
||||
CGFunctionRef function =
|
||||
@ -187,7 +190,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) {
|
||||
radius: (CGFloat) startRadius
|
||||
toCenter: (NSPoint) endCenter
|
||||
radius: (CGFloat) endRadius
|
||||
options: (NSGradientDrawingOptions) options {
|
||||
options: (NSGradientDrawingOptions) options
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -220,8 +224,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) {
|
||||
|
||||
CGFloat radAngle = angle / 180 * M_PI; // Angle in radians
|
||||
// The trig for this is difficult to describe without an illustration, so
|
||||
// I'm attaching an illustration to Cocotron issue number 438 along with this
|
||||
// patch
|
||||
// I'm attaching an illustration to Cocotron issue number 438 along with
|
||||
// this patch
|
||||
CGFloat distanceToEnd = cos(atan2(tanSize.y, tanSize.x) - radAngle) *
|
||||
sqrt(rect.size.width * rect.size.width +
|
||||
rect.size.height * rect.size.height);
|
||||
@ -253,7 +257,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) {
|
||||
}
|
||||
|
||||
- (void) drawInBezierPath: (NSBezierPath *) path
|
||||
relativeCenterPosition: (NSPoint) center {
|
||||
relativeCenterPosition: (NSPoint) center
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -267,7 +272,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) {
|
||||
|
||||
- (void) getColor: (NSColor **) color
|
||||
location: (CGFloat *) location
|
||||
atIndex: (NSInteger) index {
|
||||
atIndex: (NSInteger) index
|
||||
{
|
||||
if (location)
|
||||
*location = _locations[index];
|
||||
|
||||
|
@ -86,8 +86,8 @@ void NSRectClip(NSRect rect) {
|
||||
CGContextClipToRect(graphicsPort, rect);
|
||||
}
|
||||
|
||||
void NSRectFillListWithColors(const NSRect *rects, NSColor **colors,
|
||||
int count) {
|
||||
void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int count)
|
||||
{
|
||||
CGContextRef context = NSCurrentGraphicsPort();
|
||||
int i;
|
||||
|
||||
@ -105,7 +105,8 @@ void NSRectFillListWithColors(const NSRect *rects, NSColor **colors,
|
||||
}
|
||||
|
||||
void NSRectFillListWithGrays(const NSRect *rects, const CGFloat *grays,
|
||||
int count) {
|
||||
int count)
|
||||
{
|
||||
CGContextRef context = NSCurrentGraphicsPort();
|
||||
int i;
|
||||
|
||||
@ -148,7 +149,8 @@ void NSEraseRect(NSRect rect) {
|
||||
}
|
||||
|
||||
void NSRectFillListUsingOperation(const NSRect *rects, int count,
|
||||
NSCompositingOperation operation) {
|
||||
NSCompositingOperation operation)
|
||||
{
|
||||
CGContextRef context = NSCurrentGraphicsPort();
|
||||
CGContextSaveGState(context);
|
||||
CGContextSetBlendMode(context, blendModeForCompositeOp(operation));
|
||||
@ -165,7 +167,8 @@ void NSFrameRectWithWidth(NSRect rect, CGFloat width) {
|
||||
}
|
||||
|
||||
void NSFrameRectWithWidthUsingOperation(NSRect rect, CGFloat width,
|
||||
NSCompositingOperation operation) {
|
||||
NSCompositingOperation operation)
|
||||
{
|
||||
CGContextRef context = NSCurrentGraphicsPort();
|
||||
CGContextSaveGState(context);
|
||||
CGContextSetBlendMode(context, blendModeForCompositeOp(operation));
|
||||
@ -210,8 +213,7 @@ void NSDottedFrameRect(NSRect rect) {
|
||||
Fortunately this is not used heavily...
|
||||
*/
|
||||
if (rect.size.width <= 0 || rect.size.height <= 0)
|
||||
return;
|
||||
{
|
||||
return; {
|
||||
NSRect rects[(int) rect.size.width + 2 + (int) rect.size.height + 2];
|
||||
int count = 0;
|
||||
int x, y, maxx = NSMaxX(rect), maxy = NSMaxY(rect);
|
||||
@ -238,8 +240,8 @@ void NSDottedFrameRect(NSRect rect) {
|
||||
}
|
||||
|
||||
static NSRect NSDrawColorRects(NSRect boundsRect, NSRect clipRect,
|
||||
const NSRect *sides, NSColor **colors,
|
||||
int count) {
|
||||
const NSRect *sides, NSColor **colors, int count)
|
||||
{
|
||||
CGContextRef graphicsPort = NSCurrentGraphicsPort();
|
||||
|
||||
CGContextSaveGState(graphicsPort);
|
||||
@ -502,7 +504,8 @@ void NSDrawWindowBackground(NSRect rect) {
|
||||
}
|
||||
|
||||
NSRect NSDrawTiledRects(NSRect bounds, NSRect clip, const NSRectEdge *sides,
|
||||
const CGFloat *grays, int count) {
|
||||
const CGFloat *grays, int count)
|
||||
{
|
||||
return bounds;
|
||||
}
|
||||
|
||||
@ -527,7 +530,8 @@ void NSDisableScreenUpdates(void) {
|
||||
|
||||
void NSShowAnimationEffect(NSAnimationEffect effect, NSPoint center,
|
||||
NSSize size, id delegate, SEL didEndSelector,
|
||||
void *context) {
|
||||
void *context)
|
||||
{
|
||||
[NSPoofAnimation poofAtLocation: center
|
||||
size: size
|
||||
animationDelegate: delegate
|
||||
|
@ -110,13 +110,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
+ (NSGraphicsContext *) graphicsContextWithGraphicsPort: (CGContextRef) context
|
||||
flipped: (BOOL) flipped {
|
||||
flipped: (BOOL) flipped
|
||||
{
|
||||
return [[[self alloc] initWithGraphicsPort: context
|
||||
flipped: flipped] autorelease];
|
||||
}
|
||||
|
||||
+ (NSGraphicsContext *) graphicsContextWithBitmapImageRep:
|
||||
(NSBitmapImageRep *) imageRep {
|
||||
(NSBitmapImageRep *) imageRep
|
||||
{
|
||||
return [[[self alloc] initWithBitmapImageRep: imageRep] autorelease];
|
||||
}
|
||||
|
||||
|
@ -326,8 +326,7 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
return [self initWithData: data];
|
||||
}
|
||||
|
||||
- initWithCGImage: (CGImageRef) cgImage size: (NSSize) size;
|
||||
{
|
||||
- initWithCGImage: (CGImageRef) cgImage size: (NSSize) size; {
|
||||
if (self = [self initWithSize: size]) {
|
||||
NSBitmapImageRep *rep =
|
||||
[[[NSBitmapImageRep alloc] initWithCGImage: cgImage] autorelease];
|
||||
@ -582,7 +581,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
|
||||
- (NSImageRep *)
|
||||
_bestUncachedFallbackCachedRepresentationForDevice: (NSDictionary *) device
|
||||
size: (NSSize) size {
|
||||
size: (NSSize) size
|
||||
{
|
||||
int i, count = [_representations count];
|
||||
NSImageRep *best = nil;
|
||||
|
||||
@ -727,7 +727,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
}
|
||||
|
||||
- (NSData *) TIFFRepresentationUsingCompression: (NSTIFFCompression) compression
|
||||
factor: (float) factor {
|
||||
factor: (float) factor
|
||||
{
|
||||
NSMutableArray *bitmaps = [NSMutableArray array];
|
||||
|
||||
for (NSImageRep *check in _representations) {
|
||||
@ -854,8 +855,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
}
|
||||
|
||||
- (BOOL) drawRepresentation: (NSImageRep *) representation
|
||||
inRect: (NSRect) rect {
|
||||
- (BOOL) drawRepresentation: (NSImageRep *) representation inRect: (NSRect) rect
|
||||
{
|
||||
NSColor *bg = [self backgroundColor];
|
||||
|
||||
if (bg != nil) {
|
||||
@ -868,7 +869,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
|
||||
- (void) compositeToPoint: (NSPoint) point
|
||||
fromRect: (NSRect) rect
|
||||
operation: (NSCompositingOperation) operation {
|
||||
operation: (NSCompositingOperation) operation
|
||||
{
|
||||
[self compositeToPoint: point
|
||||
fromRect: rect
|
||||
operation: operation
|
||||
@ -878,7 +880,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
- (void) compositeToPoint: (NSPoint) point
|
||||
fromRect: (NSRect) source
|
||||
operation: (NSCompositingOperation) operation
|
||||
fraction: (CGFloat) fraction {
|
||||
fraction: (CGFloat) fraction
|
||||
{
|
||||
/* Compositing is a blitting operation. We simulate it using the draw
|
||||
operation.
|
||||
|
||||
@ -907,13 +910,15 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
}
|
||||
|
||||
- (void) compositeToPoint: (NSPoint) point
|
||||
operation: (NSCompositingOperation) operation {
|
||||
operation: (NSCompositingOperation) operation
|
||||
{
|
||||
[self compositeToPoint: point operation: operation fraction: 1.0];
|
||||
}
|
||||
|
||||
- (void) compositeToPoint: (NSPoint) point
|
||||
operation: (NSCompositingOperation) operation
|
||||
fraction: (CGFloat) fraction {
|
||||
fraction: (CGFloat) fraction
|
||||
{
|
||||
[self compositeToPoint: point
|
||||
fromRect: NSZeroRect
|
||||
operation: operation
|
||||
@ -926,14 +931,16 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
|
||||
- (void) dissolveToPoint: (NSPoint) point
|
||||
fromRect: (NSRect) rect
|
||||
fraction: (CGFloat) fraction {
|
||||
fraction: (CGFloat) fraction
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) drawAtPoint: (NSPoint) point
|
||||
fromRect: (NSRect) source
|
||||
operation: (NSCompositingOperation) operation
|
||||
fraction: (CGFloat) fraction {
|
||||
fraction: (CGFloat) fraction
|
||||
{
|
||||
NSSize size = [self size];
|
||||
|
||||
[self drawInRect: NSMakeRect(point.x, point.y, size.width, size.height)
|
||||
@ -945,7 +952,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate =
|
||||
- (void) drawInRect: (NSRect) rect
|
||||
fromRect: (NSRect) source
|
||||
operation: (NSCompositingOperation) operation
|
||||
fraction: (CGFloat) fraction {
|
||||
fraction: (CGFloat) fraction
|
||||
{
|
||||
|
||||
// Keep a lid on any intermediate allocations while producing caches
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
@ -89,7 +89,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
// This function is duplicated in NSButtonCell, consolidate
|
||||
static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize,
|
||||
NSImageScaling scaling) {
|
||||
NSImageScaling scaling)
|
||||
{
|
||||
|
||||
switch (scaling) {
|
||||
case NSImageScaleProportionallyDown: {
|
||||
@ -173,8 +174,8 @@ static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize,
|
||||
return frame;
|
||||
}
|
||||
|
||||
- (void) drawInteriorWithFrame: (NSRect) controlFrame
|
||||
inView: (NSView *) control {
|
||||
- (void) drawInteriorWithFrame: (NSRect) controlFrame inView: (NSView *) control
|
||||
{
|
||||
if ([self _imageValue] != nil) {
|
||||
|
||||
CGContextRef ctx = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
|
@ -222,7 +222,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
- (void) drawMenuItemText: (NSString *) string
|
||||
inRect: (NSRect) rect
|
||||
enabled: (BOOL) enabled
|
||||
selected: (BOOL) selected {
|
||||
selected: (BOOL) selected
|
||||
{
|
||||
// Ensure we have enough width - fractional widths give float comparison
|
||||
// trouble
|
||||
rect.size.width = ceilf(rect.size.width);
|
||||
@ -256,7 +257,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
- (void) drawAttributedMenuItemText: (NSAttributedString *) string
|
||||
inRect: (NSRect) rect
|
||||
enabled: (BOOL) enabled
|
||||
selected: (BOOL) selected {
|
||||
selected: (BOOL) selected
|
||||
{
|
||||
// Ensure we have enough width - fractional widths give float comparison
|
||||
// trouble
|
||||
rect.size.width = ceilf(rect.size.width);
|
||||
@ -301,7 +303,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
|
||||
- (void) drawMenuCheckmarkInRect: (NSRect) rect
|
||||
enabled: (BOOL) enabled
|
||||
selected: (BOOL) selected {
|
||||
selected: (BOOL) selected
|
||||
{
|
||||
NSColor *color;
|
||||
NSInterfacePartAttributedString *checkMark;
|
||||
Margins margins = [self menuItemTextMargins];
|
||||
@ -325,7 +328,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
|
||||
- (void) drawMenuBranchArrowInRect: (NSRect) rect
|
||||
enabled: (BOOL) enabled
|
||||
selected: (BOOL) selected {
|
||||
selected: (BOOL) selected
|
||||
{
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
NSColor *color;
|
||||
Margins margins = [self menuItemBranchArrowMargins];
|
||||
@ -368,7 +372,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
|
||||
- (void) drawMenuBarItemBorderInRect: (NSRect) rect
|
||||
hover: (BOOL) hovering
|
||||
selected: (BOOL) selected {
|
||||
selected: (BOOL) selected
|
||||
{
|
||||
if (selected || hovering) {
|
||||
[[NSColor selectedMenuItemColor] setFill];
|
||||
NSRectFill(rect);
|
||||
@ -420,14 +425,16 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
|
||||
- (NSSize) sizeOfButtonImage: (NSImage *) image
|
||||
enabled: (BOOL) enabled
|
||||
mixed: (BOOL) mixed {
|
||||
mixed: (BOOL) mixed
|
||||
{
|
||||
return [image size];
|
||||
}
|
||||
|
||||
- (void) drawButtonImage: (NSImage *) image
|
||||
inRect: (NSRect) rect
|
||||
enabled: (BOOL) enabled
|
||||
mixed: (BOOL) mixed {
|
||||
mixed: (BOOL) mixed
|
||||
{
|
||||
CGFloat fraction = enabled ? 1.0 : 0.5;
|
||||
|
||||
[image drawInRect: rect
|
||||
@ -445,7 +452,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
}
|
||||
|
||||
- (void) drawBrowserHorizontalScrollerWellInRect: (NSRect) rect
|
||||
clipRect: (NSRect) clipRect {
|
||||
clipRect: (NSRect) clipRect
|
||||
{
|
||||
NSDrawGrayBezel(rect, clipRect);
|
||||
}
|
||||
|
||||
@ -456,7 +464,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
- (NSRect) drawColorWellBorderInRect: (NSRect) rect
|
||||
enabled: (BOOL) enabled
|
||||
bordered: (BOOL) bordered
|
||||
active: (BOOL) active {
|
||||
active: (BOOL) active
|
||||
{
|
||||
if (bordered) {
|
||||
if (active)
|
||||
NSInterfaceDrawHighlightedButton(rect, rect);
|
||||
@ -501,7 +510,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
|
||||
- (NSRect) drawProgressIndicatorBackground: (NSRect) rect
|
||||
clipRect: (NSRect) clipRect
|
||||
bezeled: (BOOL) bezeled {
|
||||
bezeled: (BOOL) bezeled
|
||||
{
|
||||
if (bezeled) {
|
||||
NSInterfaceDrawProgressIndicatorBezel(rect, clipRect);
|
||||
return NSInsetRect(rect, 2, 2);
|
||||
@ -524,7 +534,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
- (void) drawProgressIndicatorIndeterminate: (NSRect) rect
|
||||
clipRect: (NSRect) clipRect
|
||||
bezeled: (BOOL) bezeled
|
||||
animation: (double) animation {
|
||||
animation: (double) animation
|
||||
{
|
||||
if (bezeled)
|
||||
rect = [self drawProgressIndicatorBackground: rect
|
||||
clipRect: clipRect
|
||||
@ -558,7 +569,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
- (void) drawProgressIndicatorDeterminate: (NSRect) rect
|
||||
clipRect: (NSRect) clipRect
|
||||
bezeled: (BOOL) bezeled
|
||||
value: (double) value {
|
||||
value: (double) value
|
||||
{
|
||||
if (bezeled)
|
||||
rect = [self drawProgressIndicatorBackground: rect
|
||||
clipRect: clipRect
|
||||
@ -595,7 +607,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
enabled: (BOOL) enabled
|
||||
pressed: (BOOL) pressed
|
||||
vertical: (BOOL) vertical
|
||||
upOrLeft: (BOOL) upOrLeft {
|
||||
upOrLeft: (BOOL) upOrLeft
|
||||
{
|
||||
/*
|
||||
unichar code=vertical?(upOrLeft?0x74:0x75):(upOrLeft?0x33:0x34);
|
||||
Class class;
|
||||
@ -633,13 +646,15 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
|
||||
- (void) drawScrollerKnobInRect: (NSRect) rect
|
||||
vertical: (BOOL) vertical
|
||||
highlight: (BOOL) highlight {
|
||||
highlight: (BOOL) highlight
|
||||
{
|
||||
[self drawPushButtonNormalInRect: rect defaulted: NO];
|
||||
}
|
||||
|
||||
- (void) drawScrollerTrackInRect: (NSRect) rect
|
||||
vertical: (BOOL) vertical
|
||||
upOrLeft: (BOOL) upOrLeft {
|
||||
upOrLeft: (BOOL) upOrLeft
|
||||
{
|
||||
[[NSColor colorWithCalibratedWhite: 0.9 alpha: 1] setFill];
|
||||
NSRectFill(rect);
|
||||
}
|
||||
@ -672,7 +687,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
vertical: (BOOL) vertical
|
||||
highlighted: (BOOL) highlighted
|
||||
hasTickMarks: (BOOL) hasTickMarks
|
||||
tickMarkPosition: (NSTickMarkPosition) tickMarkPosition {
|
||||
tickMarkPosition: (NSTickMarkPosition) tickMarkPosition
|
||||
{
|
||||
NSDrawButton(rect, rect);
|
||||
|
||||
if (highlighted) {
|
||||
@ -683,7 +699,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
|
||||
- (void) drawSliderTrackInRect: (NSRect) rect
|
||||
vertical: (BOOL) vertical
|
||||
hasTickMarks: (BOOL) hasTickMarks {
|
||||
hasTickMarks: (BOOL) hasTickMarks
|
||||
{
|
||||
NSRect groove = rect;
|
||||
|
||||
if (vertical) {
|
||||
@ -710,7 +727,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
clipRect: (NSRect) clipRect
|
||||
enabled: (BOOL) enabled
|
||||
highlighted: (BOOL) highlighted
|
||||
upNotDown: (BOOL) upNotDown {
|
||||
upNotDown: (BOOL) upNotDown
|
||||
{
|
||||
unichar code = upNotDown ? 0x74 : 0x75;
|
||||
NSInterfacePart *arrow;
|
||||
|
||||
@ -738,7 +756,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
@implementation NSGraphicsStyle (NSTableView)
|
||||
|
||||
- (void) drawTableViewHeaderInRect: (NSRect) rect
|
||||
highlighted: (BOOL) highlighted {
|
||||
highlighted: (BOOL) highlighted
|
||||
{
|
||||
NSDrawButton(rect, rect);
|
||||
|
||||
if (highlighted) {
|
||||
@ -780,7 +799,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
- (void) drawComboBoxButtonInRect: (NSRect) rect
|
||||
enabled: (BOOL) enabled
|
||||
bordered: (BOOL) bordered
|
||||
pressed: (BOOL) pressed {
|
||||
pressed: (BOOL) pressed
|
||||
{
|
||||
NSImage *image = [NSImage imageNamed: @"NSComboBoxCellDown"];
|
||||
NSSize imageSize = [image size];
|
||||
NSRect imageRect;
|
||||
@ -808,7 +828,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
- (void) drawTabInRect: (NSRect) rect
|
||||
clipRect: (NSRect) clipRect
|
||||
color: (NSColor *) color
|
||||
selected: (BOOL) selected {
|
||||
selected: (BOOL) selected
|
||||
{
|
||||
NSRect originalRect = rect;
|
||||
NSRect rects[8];
|
||||
NSColor *colors[8];
|
||||
@ -894,7 +915,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
@implementation NSGraphicsStyle (NSTextField)
|
||||
|
||||
- (void) drawTextFieldBorderInRect: (NSRect) rect
|
||||
bezeledNotLine: (BOOL) bezeledNotLine {
|
||||
bezeledNotLine: (BOOL) bezeledNotLine
|
||||
{
|
||||
if (bezeledNotLine)
|
||||
NSDrawWhiteBezel(rect, rect);
|
||||
else {
|
||||
@ -904,7 +926,8 @@ static NSDictionary *sScrollerButtonAttributes = nil;
|
||||
}
|
||||
|
||||
- (void) drawTextViewInsertionPointInRect: (NSRect) rect
|
||||
color: (NSColor *) color {
|
||||
color: (NSColor *) color
|
||||
{
|
||||
[color setFill];
|
||||
NSRectFill(rect);
|
||||
}
|
||||
|
@ -24,7 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
static NSRect NSInterfaceDrawRects(NSRect boundsRect, NSRect clipRect,
|
||||
const NSRect *sides, NSColor **colors,
|
||||
int count) {
|
||||
int count)
|
||||
{
|
||||
CGContextRef graphicsPort = NSCurrentGraphicsPort();
|
||||
|
||||
CGContextSaveGState(graphicsPort);
|
||||
@ -214,8 +215,7 @@ void NSInterfaceDrawOutlineGrid(NSRect rect, CGContextRef context) {
|
||||
if (rect.size.width < 0)
|
||||
return;
|
||||
if (rect.size.height < 0)
|
||||
return;
|
||||
{
|
||||
return; {
|
||||
NSRect rects[(int) rect.size.width + 2 + (int) rect.size.height + 2];
|
||||
int count = 0;
|
||||
int x, y, maxx = NSMaxX(rect), maxy = NSMaxY(rect);
|
||||
|
@ -27,7 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- initWithCharacter: (unichar) character
|
||||
fontName: (NSString *) fontName
|
||||
pointSize: (CGFloat) pointSize
|
||||
color: (NSColor *) color {
|
||||
color: (NSColor *) color
|
||||
{
|
||||
NSString *string = [NSString stringWithCharacters: &character length: 1];
|
||||
NSFont *font = [NSFont fontWithName: fontName size: pointSize];
|
||||
NSDictionary *attributes = [NSDictionary
|
||||
|
@ -28,7 +28,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- initWithCharacter: (unichar) character
|
||||
fontName: (NSString *) fontName
|
||||
pointSize: (CGFloat) pointSize
|
||||
color: (NSColor *) color {
|
||||
color: (NSColor *) color
|
||||
{
|
||||
NSMutableAttributedString *copy;
|
||||
|
||||
[super initWithCharacter: character
|
||||
|
@ -237,7 +237,8 @@ static void *NSBinderChangeContext;
|
||||
- (void) observeValueForKeyPath: (NSString *) kp
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
|
||||
NSBindingDebugLog(
|
||||
kNSBindingDebugLogLevel1,
|
||||
|
@ -165,7 +165,8 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values,
|
||||
- (void) observeValueForKeyPath: (NSString *) kp
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
[self stopObservingChanges];
|
||||
|
||||
if (context == NSCachingBinderChangeContext) {
|
||||
|
@ -67,7 +67,8 @@ static void *NSKVOBinderChangeContext;
|
||||
}
|
||||
|
||||
NSString *NSFormatDisplayPattern(NSString *pattern, id *values,
|
||||
NSUInteger valueCount) {
|
||||
NSUInteger valueCount)
|
||||
{
|
||||
NSInteger i, length = [pattern length];
|
||||
NSUInteger valueIndex = 0;
|
||||
unichar buffer[length];
|
||||
@ -322,7 +323,8 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values,
|
||||
- (void) observeValueForKeyPath: (NSString *) kp
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
NSBindingDebugLog(
|
||||
kNSBindingDebugLogLevel1,
|
||||
@"keyPath: %@\n object: %@\n change: %@\n context: %p", kp,
|
||||
|
@ -75,7 +75,8 @@ static void *NSMultipleValueBinderWholeArrayChangeContext;
|
||||
|
||||
- (void) applyFromObject: (id) object
|
||||
inRow: (NSInteger) row
|
||||
keyPath: (id) keypath {
|
||||
keyPath: (id) keypath
|
||||
{
|
||||
[[_rowValues objectAtIndex: row] setValue: [object valueForKeyPath: keypath]
|
||||
forKeyPath: _valueKeyPath];
|
||||
}
|
||||
@ -189,7 +190,8 @@ static void *NSMultipleValueBinderWholeArrayChangeContext;
|
||||
- (void) observeValueForKeyPath: (NSString *) kp
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
if (context == &NSMultipleValueBinderWholeArrayChangeContext) {
|
||||
[self stopObservingChanges];
|
||||
// NSLog(@"bind event from %@.%@ to %@.%@ alias %@ (%@)", [_destination
|
||||
@ -299,7 +301,8 @@ static void *NSTableViewContentBinderChangeContext;
|
||||
- (void) observeValueForKeyPath: (NSString *) kp
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
[self stopObservingChanges];
|
||||
|
||||
if (context == &NSTableViewContentBinderChangeContext) {
|
||||
|
@ -133,8 +133,9 @@ void NSDetermineBindingDebugLoggingLevel(void) {
|
||||
return [_NSKVOBinder class];
|
||||
}
|
||||
|
||||
- (id) _binderForBinding: (id) binding;
|
||||
{ return [self _binderForBinding: binding create: NO]; }
|
||||
- (id) _binderForBinding: (id) binding; {
|
||||
return [self _binderForBinding: binding create: NO];
|
||||
}
|
||||
|
||||
- (id) _binderForBinding: (id) binding create: (BOOL) create {
|
||||
if (!bindersForObjects)
|
||||
@ -177,7 +178,8 @@ void NSDetermineBindingDebugLoggingLevel(void) {
|
||||
- (void) bind: (id) binding
|
||||
toObject: (id) destination
|
||||
withKeyPath: (NSString *) keyPath
|
||||
options: (NSDictionary *) options {
|
||||
options: (NSDictionary *) options
|
||||
{
|
||||
NSBindingDebugLog(
|
||||
kNSBindingDebugLogLevel1,
|
||||
@"binding: %@\n toObject: %@\n withKeyPath: %@\n options: %@",
|
||||
|
@ -27,7 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
+ (NSKeyboardBinding *) keyBindingWithString: (NSString *) string
|
||||
modifierMask: (int) mask
|
||||
selectorNames: (NSArray *) selNames {
|
||||
selectorNames: (NSArray *) selNames
|
||||
{
|
||||
return [[[self alloc] initWithString: string
|
||||
modifierMask: mask
|
||||
selectorNames: selNames] autorelease];
|
||||
@ -35,7 +36,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (id) initWithString: (NSString *) string
|
||||
modifierMask: (unsigned) mask
|
||||
selectorNames: (NSArray *) selNames {
|
||||
selectorNames: (NSArray *) selNames
|
||||
{
|
||||
[super init];
|
||||
|
||||
_string = [string retain];
|
||||
|
@ -166,7 +166,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (NSKeyboardBinding *) keyBindingWithString: (NSString *) string
|
||||
modifierFlags: (unsigned) flags {
|
||||
modifierFlags: (unsigned) flags
|
||||
{
|
||||
int i, count = [_keyBindings count];
|
||||
|
||||
flags &= ~NSNumericPadKeyMask;
|
||||
|
@ -114,7 +114,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
mode: (NSMatrixMode) mode
|
||||
prototype: (NSCell *) prototype
|
||||
numberOfRows: (NSInteger) rows
|
||||
numberOfColumns: (NSInteger) columns {
|
||||
numberOfColumns: (NSInteger) columns
|
||||
{
|
||||
NSInteger i;
|
||||
|
||||
[self initWithFrame: frame];
|
||||
@ -133,7 +134,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
mode: (NSMatrixMode) mode
|
||||
cellClass: (Class) cls
|
||||
numberOfRows: (NSInteger) rows
|
||||
numberOfColumns: (NSInteger) columns {
|
||||
numberOfColumns: (NSInteger) columns
|
||||
{
|
||||
NSInteger i;
|
||||
|
||||
[self initWithFrame: frame];
|
||||
@ -308,7 +310,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (BOOL) getRow: (NSInteger *) row
|
||||
column: (NSInteger *) column
|
||||
ofCell: (NSCell *) cell {
|
||||
ofCell: (NSCell *) cell
|
||||
{
|
||||
NSInteger index = [_cells indexOfObjectIdenticalTo: cell];
|
||||
|
||||
if (index != NSNotFound) {
|
||||
@ -322,7 +325,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (BOOL) getRow: (NSInteger *) row
|
||||
column: (NSInteger *) column
|
||||
forPoint: (NSPoint) point {
|
||||
forPoint: (NSPoint) point
|
||||
{
|
||||
NSRect cellFrame;
|
||||
|
||||
*row = point.y / (_cellSize.height + _intercellSpacing.height);
|
||||
@ -528,7 +532,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) putCell: (NSCell *) cell
|
||||
atRow: (NSInteger) row
|
||||
column: (NSInteger) column {
|
||||
column: (NSInteger) column
|
||||
{
|
||||
NSUInteger index = row * _numberOfColumns + column;
|
||||
|
||||
[_cells replaceObjectAtIndex: index withObject: cell];
|
||||
@ -716,7 +721,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) setSelectionFrom: (NSInteger) from
|
||||
to: (NSInteger) to
|
||||
anchor: (NSInteger) anchor
|
||||
highlight: (BOOL) highlight {
|
||||
highlight: (BOOL) highlight
|
||||
{
|
||||
if (anchor != -1) { // no anchor, i.e., no selected cell
|
||||
if (anchor < from)
|
||||
from = anchor;
|
||||
@ -786,7 +792,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) setState: (NSInteger) state
|
||||
atRow: (NSInteger) row
|
||||
column: (NSInteger) column {
|
||||
column: (NSInteger) column
|
||||
{
|
||||
NSCell *cell = [self cellAtRow: row column: column];
|
||||
|
||||
if (cell != nil) {
|
||||
@ -799,7 +806,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) highlightCell: (BOOL) highlight
|
||||
atRow: (NSInteger) row
|
||||
column: (NSInteger) column {
|
||||
column: (NSInteger) column
|
||||
{
|
||||
NSCell *cell = [self cellAtRow: row column: column];
|
||||
|
||||
if (cell != nil) {
|
||||
@ -923,7 +931,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) _fieldEditCell: (NSCell *) cell
|
||||
row: (NSInteger) row
|
||||
column: (NSInteger) column {
|
||||
column: (NSInteger) column
|
||||
{
|
||||
[self selectCell: cell];
|
||||
|
||||
NSText *editor = [[self window] fieldEditor: YES forObject: self];
|
||||
@ -952,7 +961,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) _editTextCell: (NSCell *) cell
|
||||
row: (NSInteger) row
|
||||
column: (NSInteger) column
|
||||
event: (NSEvent *) event {
|
||||
event: (NSEvent *) event
|
||||
{
|
||||
NSRect cellFrame = [self cellFrameAtRow: row column: column];
|
||||
|
||||
[self _fieldEditCell: cell row: row column: column];
|
||||
@ -965,7 +975,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (NSCell *) _enabledCellAtPoint: (NSPoint) point
|
||||
row: (NSInteger *) row
|
||||
column: (NSInteger *) column {
|
||||
column: (NSInteger *) column
|
||||
{
|
||||
if ([self getRow: row column: column forPoint: point]) {
|
||||
NSCell *cell = [self cellAtRow: *row column: *column];
|
||||
|
||||
|
@ -109,7 +109,8 @@ static NSMutableArray *_measurementUnits = nil;
|
||||
abbreviation: (NSString *) abbreviation
|
||||
pointsPerUnit: (CGFloat) points
|
||||
stepUpCycle: (NSArray *) upCycle
|
||||
stepDownCycle: (NSArray *) downCycle {
|
||||
stepDownCycle: (NSArray *) downCycle
|
||||
{
|
||||
return [[[self alloc] initWithName: name
|
||||
abbreviation: abbreviation
|
||||
pointsPerUnit: points
|
||||
|
@ -83,7 +83,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (NSRect) titleRectForItem: (NSMenuItem *) item
|
||||
previousBorderRect: (NSRect) previousBorderRect {
|
||||
previousBorderRect: (NSRect) previousBorderRect
|
||||
{
|
||||
NSRect result;
|
||||
NSSize titleSize = [[self graphicsStyle] menuItemTextSize: [item title]];
|
||||
|
||||
@ -295,7 +296,8 @@ static void drawSunkenBorder(NSRect rect) {
|
||||
}
|
||||
|
||||
- (void) positionBranchForSelectedItem: (NSWindow *) branch
|
||||
screen: (NSScreen *) screen {
|
||||
screen: (NSScreen *) screen
|
||||
{
|
||||
NSRect branchFrame = [branch frame];
|
||||
NSRect screenVisible = [screen visibleFrame];
|
||||
NSArray *items = [[self menu] itemArray];
|
||||
|
@ -33,7 +33,8 @@ const NSNotificationName NSMenuDidEndTrackingNotification =
|
||||
|
||||
+ (void) popUpContextMenu: (NSMenu *) menu
|
||||
withEvent: (NSEvent *) event
|
||||
forView: (NSView *) view {
|
||||
forView: (NSView *) view
|
||||
{
|
||||
[menu update];
|
||||
if ([[menu itemArray] count] > 0) {
|
||||
NSPoint point = [event locationInWindow];
|
||||
@ -317,7 +318,8 @@ const NSNotificationName NSMenuDidEndTrackingNotification =
|
||||
|
||||
- (NSMenuItem *) addItemWithTitle: (NSString *) title
|
||||
action: (SEL) action
|
||||
keyEquivalent: (NSString *) keyEquivalent {
|
||||
keyEquivalent: (NSString *) keyEquivalent
|
||||
{
|
||||
NSMenuItem *item =
|
||||
[[[NSMenuItem alloc] initWithTitle: title
|
||||
action: action
|
||||
@ -350,7 +352,8 @@ const NSNotificationName NSMenuDidEndTrackingNotification =
|
||||
- (NSMenuItem *) insertItemWithTitle: (NSString *) title
|
||||
action: (SEL) action
|
||||
keyEquivalent: (NSString *) keyEquivalent
|
||||
atIndex: (NSInteger) index {
|
||||
atIndex: (NSInteger) index
|
||||
{
|
||||
NSMenuItem *item =
|
||||
[[[NSMenuItem alloc] initWithTitle: title
|
||||
action: action
|
||||
|
@ -78,7 +78,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- initWithTitle: (NSString *) title
|
||||
action: (SEL) action
|
||||
keyEquivalent: (NSString *) keyEquivalent {
|
||||
keyEquivalent: (NSString *) keyEquivalent
|
||||
{
|
||||
_title = [title copy];
|
||||
_target = nil;
|
||||
_action = action;
|
||||
|
@ -181,8 +181,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) {
|
||||
|
||||
origin.y += NSHeight(separatorRect);
|
||||
} else {
|
||||
#define CENTER_PART_RECT_VERTICALLY(partSize) \
|
||||
{ \
|
||||
#define CENTER_PART_RECT_VERTICALLY(partSize) { \
|
||||
NSSize __partSize = (partSize); \
|
||||
partRect.origin.y = origin.y + (itemHeight - __partSize.height) / 2; \
|
||||
partRect.size.height = __partSize.height; \
|
||||
@ -318,7 +317,8 @@ static NSRect boundsToTitleAreaRect(NSRect rect) {
|
||||
}
|
||||
|
||||
- (void) positionBranchForSelectedItem: (NSWindow *) branch
|
||||
screen: (NSScreen *) screen {
|
||||
screen: (NSScreen *) screen
|
||||
{
|
||||
NSRect branchFrame = [branch frame];
|
||||
NSRect screenVisible = [screen visibleFrame];
|
||||
NSArray *items = [[self menu] itemArray];
|
||||
|
@ -27,7 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
// Looks for a substitute in the list able to display the given char
|
||||
- (NSFont *) _bestFontForCharacter: (unichar) c
|
||||
userFont: (NSFont *) font
|
||||
usingFontNames: (NSArray *) fontnameList {
|
||||
usingFontNames: (NSArray *) fontnameList
|
||||
{
|
||||
// We are caching the fontName->charset info, to prevent the
|
||||
// creation/conversion of plenty of fonts
|
||||
static NSMutableDictionary *sNameToCharacterSetCache = nil;
|
||||
|
@ -54,7 +54,8 @@ static inline void _clearCurrentContext() {
|
||||
}
|
||||
|
||||
- initWithFormat: (NSOpenGLPixelFormat *) pixelFormat
|
||||
shareContext: (NSOpenGLContext *) shareContext {
|
||||
shareContext: (NSOpenGLContext *) shareContext
|
||||
{
|
||||
CGLError error;
|
||||
|
||||
if (_pixelFormat != nil) {
|
||||
@ -117,12 +118,14 @@ static inline void _clearCurrentContext() {
|
||||
}
|
||||
|
||||
- (void) getValues: (GLint *) vals
|
||||
forParameter: (NSOpenGLContextParameter) parameter {
|
||||
forParameter: (NSOpenGLContextParameter) parameter
|
||||
{
|
||||
CGLGetParameter(_glContext, parameter, vals);
|
||||
}
|
||||
|
||||
- (void) setValues: (const GLint *) vals
|
||||
forParameter: (NSOpenGLContextParameter) parameter {
|
||||
forParameter: (NSOpenGLContextParameter) parameter
|
||||
{
|
||||
CGLSetParameter(_glContext, parameter, vals);
|
||||
}
|
||||
|
||||
@ -213,19 +216,22 @@ static inline void _clearCurrentContext() {
|
||||
- (void) setOffscreen: (void *) bytes
|
||||
width: (long) width
|
||||
height: (long) height
|
||||
rowbytes: (long) rowbytes {
|
||||
rowbytes: (long) rowbytes
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) setPixelBuffer: (NSOpenGLPixelBuffer *) pixelBuffer
|
||||
cubeMapFace: (unsigned long) cubeMapFace
|
||||
mipMapLeve: (long) mipMapLevel
|
||||
currentVirtualScreen: (int) screen {
|
||||
currentVirtualScreen: (int) screen
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) setTextureImageToPixelBuffer: (NSOpenGLPixelBuffer *) pixelBuffer
|
||||
colorBuffer: (unsigned long) source {
|
||||
colorBuffer: (unsigned long) source
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -238,13 +244,15 @@ static inline void _clearCurrentContext() {
|
||||
}
|
||||
|
||||
- (void) copyAttributesFromContext: (NSOpenGLContext *) context
|
||||
withMask: (unsigned long) mask {
|
||||
withMask: (unsigned long) mask
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) createTexture: (unsigned long) identifier
|
||||
fromView: (NSView *) view
|
||||
internalFormat: (unsigned long) internalFormat {
|
||||
internalFormat: (unsigned long) internalFormat
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
@implementation NSOpenGLDrawable
|
||||
|
||||
- initWithPixelFormat: (NSOpenGLPixelFormat *) pixelFormat
|
||||
view: (NSView *) view {
|
||||
- initWithPixelFormat: (NSOpenGLPixelFormat *) pixelFormat view: (NSView *) view
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
textureInternalFormat: (GLenum) textureFormat
|
||||
textureMaxMipMapLevel: (GLint) mipMapLevel
|
||||
pixelsWide: (GLsizei) pixelsWide
|
||||
pixelsHigh: (GLsizei) pixelsHigh {
|
||||
pixelsHigh: (GLsizei) pixelsHigh
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return self;
|
||||
}
|
||||
|
@ -25,7 +25,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
@implementation NSOpenGLPixelFormat
|
||||
|
||||
- (instancetype) initWithAttributes:
|
||||
(const NSOpenGLPixelFormatAttribute *) attributes {
|
||||
(const NSOpenGLPixelFormatAttribute *) attributes
|
||||
{
|
||||
CGLChoosePixelFormat(attributes, (CGLPixelFormatObj *) &_cglPixelFormat,
|
||||
&_numberOfVirtualScreens);
|
||||
return self;
|
||||
@ -80,7 +81,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
- (void) getValues: (long *) values
|
||||
forAttribute: (NSOpenGLPixelFormatAttribute) attribute
|
||||
forVirtualScreen: (int) screen {
|
||||
forVirtualScreen: (int) screen
|
||||
{
|
||||
GLint glValue = 0;
|
||||
|
||||
CGLDescribePixelFormat(_cglPixelFormat, screen, attribute, &glValue);
|
||||
|
@ -33,7 +33,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (id) initWithFrame: (NSRect) frame
|
||||
pixelFormat: (NSOpenGLPixelFormat *) pixelFormat {
|
||||
pixelFormat: (NSOpenGLPixelFormat *) pixelFormat
|
||||
{
|
||||
[super initWithFrame: frame];
|
||||
|
||||
_pixelFormat = [pixelFormat retain];
|
||||
|
@ -85,7 +85,8 @@ static inline BOOL isItemExpanded(NSOutlineView *self, id item) {
|
||||
}
|
||||
|
||||
static inline NSInteger numberOfChildrenOfItemAndReload(NSOutlineView *self,
|
||||
id item, BOOL reload) {
|
||||
id item, BOOL reload)
|
||||
{
|
||||
NSInteger result;
|
||||
|
||||
if (!reload)
|
||||
@ -101,7 +102,8 @@ static inline NSInteger numberOfChildrenOfItemAndReload(NSOutlineView *self,
|
||||
}
|
||||
|
||||
static inline id childOfItemAtIndex(NSOutlineView *self, id item,
|
||||
NSInteger index) {
|
||||
NSInteger index)
|
||||
{
|
||||
#if 1
|
||||
// NSLog(@"%s %d",__FILE__,__LINE__);
|
||||
id result = [self->_dataSource outlineView: self child: index ofItem: item];
|
||||
@ -287,7 +289,8 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item,
|
||||
}
|
||||
|
||||
- (BOOL) _delayResizeButExpandItem: (id) item
|
||||
expandChildren: (BOOL) expandChildren {
|
||||
expandChildren: (BOOL) expandChildren
|
||||
{
|
||||
BOOL noteNumberOfRowsChanged = NO;
|
||||
BOOL expandThisItem = YES;
|
||||
|
||||
@ -551,7 +554,8 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item,
|
||||
static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
NSUInteger *rowCountPtr,
|
||||
NSUInteger recursionLevel,
|
||||
NSHashTable *removeItems) {
|
||||
NSHashTable *removeItems)
|
||||
{
|
||||
NSInteger i,
|
||||
numberOfChildren = numberOfChildrenOfItemAndReload(self, item, YES);
|
||||
|
||||
@ -588,9 +592,7 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
NSHashInsert(removeItems, key);
|
||||
}
|
||||
|
||||
loadItemIntoMapTables(self, nil, &_numberOfCachedRows, 0, removeItems);
|
||||
|
||||
{
|
||||
loadItemIntoMapTables(self, nil, &_numberOfCachedRows, 0, removeItems); {
|
||||
NSHashEnumerator state = NSEnumerateHashTable(removeItems);
|
||||
void *key;
|
||||
|
||||
@ -626,7 +628,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
|
||||
- (NSRect) _adjustedFrameOfCellAtColumn: (NSInteger) column
|
||||
row: (NSInteger) row
|
||||
objectValue: (id) objectValue {
|
||||
objectValue: (id) objectValue
|
||||
{
|
||||
NSRect cellRect = [super frameOfCellAtColumn: column row: row];
|
||||
NSTableColumn *tableColumn = [_tableColumns objectAtIndex: column];
|
||||
|
||||
@ -694,7 +697,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
|
||||
- (void) drawHighlightedSelectionForColumn: (NSInteger) column
|
||||
row: (NSInteger) row
|
||||
inRect: (NSRect) rect {
|
||||
inRect: (NSRect) rect
|
||||
{
|
||||
if ([_tableColumns objectAtIndex: column] == _outlineTableColumn) {
|
||||
NSRect newRect = NSInsetRect(rect, 1, 0);
|
||||
// NSDottedFrameRect is kinda weird
|
||||
@ -710,7 +714,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
|
||||
- (void) _drawGridForItem: (id) item
|
||||
style: (NSGraphicsStyle *) style
|
||||
level: (NSInteger) level {
|
||||
level: (NSInteger) level
|
||||
{
|
||||
NSInteger column = [_tableColumns indexOfObject: _outlineTableColumn];
|
||||
NSInteger row = [self rowForItem: item];
|
||||
NSRect myFrame = [self frameOfCellAtColumn: column row: row];
|
||||
@ -774,8 +779,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
[super drawGridInClipRect: clipRect];
|
||||
}
|
||||
|
||||
- (NSCell *) preparedCellAtColumn: (NSInteger) columnNumber
|
||||
row: (NSInteger) row {
|
||||
- (NSCell *) preparedCellAtColumn: (NSInteger) columnNumber row: (NSInteger) row
|
||||
{
|
||||
NSTableColumn *column = [_tableColumns objectAtIndex: columnNumber];
|
||||
NSCell *result = [super preparedCellAtColumn: columnNumber row: row];
|
||||
|
||||
@ -905,7 +910,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
}
|
||||
|
||||
- (BOOL) delegateShouldEditTableColumn: (NSTableColumn *) tableColumn
|
||||
row: (NSInteger) row {
|
||||
row: (NSInteger) row
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(outlineView:
|
||||
shouldEditTableColumn:item:)])
|
||||
return [_delegate outlineView: self
|
||||
@ -952,7 +958,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
|
||||
- (void) dataSourceSetObjectValue: (id) object
|
||||
forTableColumn: (NSTableColumn *) tableColumn
|
||||
row: (NSInteger) row {
|
||||
row: (NSInteger) row
|
||||
{
|
||||
[_dataSource outlineView: self
|
||||
setObjectValue: object
|
||||
forTableColumn: tableColumn
|
||||
@ -960,7 +967,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
}
|
||||
|
||||
- (id) dataSourceObjectValueForTableColumn: (NSTableColumn *) tableColumn
|
||||
row: (NSInteger) row {
|
||||
row: (NSInteger) row
|
||||
{
|
||||
return [_dataSource outlineView: self
|
||||
objectValueForTableColumn: tableColumn
|
||||
byItem: [self itemAtRow: row]];
|
||||
@ -968,7 +976,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item,
|
||||
|
||||
- (void) _willDisplayCell: (NSCell *) cell
|
||||
forTableColumn: (NSTableColumn *) column
|
||||
row: (NSInteger) row {
|
||||
row: (NSInteger) row
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector
|
||||
(outlineView:willDisplayCell:forTableColumn:item:)])
|
||||
[_delegate outlineView: self
|
||||
|
@ -30,7 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (instancetype) initWithContentRect: (NSRect) contentRect
|
||||
styleMask: (NSWindowStyleMask) styleMask
|
||||
backing: (NSBackingStoreType) backing
|
||||
defer: (BOOL) defer {
|
||||
defer: (BOOL) defer
|
||||
{
|
||||
self = [super initWithContentRect: contentRect
|
||||
styleMask: styleMask
|
||||
backing: backing
|
||||
@ -84,7 +85,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
NSInteger NSRunAlertPanel(NSString *title, NSString *format,
|
||||
NSString *defaultButton, NSString *alternateButton,
|
||||
NSString *otherButton, ...) {
|
||||
NSString *otherButton, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, otherButton);
|
||||
NSString *message =
|
||||
@ -106,7 +108,8 @@ NSInteger NSRunAlertPanel(NSString *title, NSString *format,
|
||||
NSInteger NSRunInformationalAlertPanel(NSString *title, NSString *format,
|
||||
NSString *defaultButton,
|
||||
NSString *alternateButton,
|
||||
NSString *otherButton, ...) {
|
||||
NSString *otherButton, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, otherButton);
|
||||
NSString *message =
|
||||
@ -121,7 +124,8 @@ NSInteger NSRunInformationalAlertPanel(NSString *title, NSString *format,
|
||||
NSInteger NSRunCriticalAlertPanel(NSString *title, NSString *format,
|
||||
NSString *defaultButton,
|
||||
NSString *alternateButton,
|
||||
NSString *otherButton, ...) {
|
||||
NSString *otherButton, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, otherButton);
|
||||
NSString *message =
|
||||
@ -137,7 +141,8 @@ void NSBeginAlertSheet(NSString *title, NSString *defaultButton,
|
||||
NSString *alternateButton, NSString *otherButton,
|
||||
NSWindow *window, id modalDelegate, SEL didEndSelector,
|
||||
SEL didDismissSelector, void *contextInfo,
|
||||
NSString *format, ...) {
|
||||
NSString *format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
NSString *message =
|
||||
@ -162,7 +167,8 @@ void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton,
|
||||
NSString *alternateButton, NSString *otherButton,
|
||||
NSWindow *window, id modalDelegate,
|
||||
SEL didEndSelector, SEL didDismissSelector,
|
||||
void *contextInfo, NSString *format, ...) {
|
||||
void *contextInfo, NSString *format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
NSString *message =
|
||||
@ -180,7 +186,8 @@ void NSBeginInformationalAlertSheet(NSString *title, NSString *defaultButton,
|
||||
NSString *otherButton, NSWindow *window,
|
||||
id modalDelegate, SEL didEndSelector,
|
||||
SEL didDismissSelector, void *contextInfo,
|
||||
NSString *format, ...) {
|
||||
NSString *format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
NSString *message =
|
||||
|
@ -102,8 +102,8 @@ const NSPasteboardReadingOptionKey
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSPasteboardType) availableTypeFromArray:
|
||||
(NSArray<NSPasteboardType> *) types {
|
||||
- (NSPasteboardType) availableTypeFromArray: (NSArray<NSPasteboardType> *) types
|
||||
{
|
||||
NSArray<NSPasteboardType> *available = [self types];
|
||||
for (NSPasteboardType type in types) {
|
||||
if ([available containsObject: type]) {
|
||||
@ -142,13 +142,15 @@ const NSPasteboardReadingOptionKey
|
||||
}
|
||||
|
||||
- (NSInteger) declareTypes: (NSArray<NSPasteboardType> *) types
|
||||
owner: (id<NSPasteboardTypeOwner>) owner {
|
||||
owner: (id<NSPasteboardTypeOwner>) owner
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSInteger) addTypes: (NSArray<NSPasteboardType> *) types
|
||||
owner: (id<NSPasteboardTypeOwner>) owner {
|
||||
owner: (id<NSPasteboardTypeOwner>) owner
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
@ -42,13 +42,15 @@
|
||||
|
||||
- (void) mouseEntered: (NSEvent *) event
|
||||
withFrame: (NSRect) frame
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) mouseExited: (NSEvent *) event
|
||||
withFrame: (NSRect) frame
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
@ -124,7 +126,8 @@
|
||||
|
||||
- (NSRect) rectOfPathComponentCell: (NSPathComponentCell *) cell
|
||||
withFrame: (NSRect) frame
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
NSRect rect = frame;
|
||||
|
||||
for (NSPathComponentCell *check in _pathComponentCells) {
|
||||
@ -153,7 +156,8 @@
|
||||
|
||||
- (NSPathComponentCell *) pathComponentCellAtPoint: (NSPoint) point
|
||||
withFrame: (NSRect) frame
|
||||
inView: (NSView *) view {
|
||||
inView: (NSView *) view
|
||||
{
|
||||
|
||||
for (NSPathComponentCell *cell in _pathComponentCells) {
|
||||
NSRect checkFrame = [self rectOfPathComponentCell: cell
|
||||
@ -170,7 +174,8 @@
|
||||
- (BOOL) trackMouse: (NSEvent *) event
|
||||
inRect: (NSRect) cellFrame
|
||||
ofView: (NSView *) controlView
|
||||
untilMouseUp: (BOOL) untilMouseUp {
|
||||
untilMouseUp: (BOOL) untilMouseUp
|
||||
{
|
||||
|
||||
do {
|
||||
NSPoint point = [controlView convertPoint: [event locationInWindow]
|
||||
|
@ -8,26 +8,22 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSPathStyle) pathStyle;
|
||||
{
|
||||
- (NSPathStyle) pathStyle; {
|
||||
NSPathCell *cell = [self cell];
|
||||
return [cell pathStyle];
|
||||
}
|
||||
|
||||
- (void) setPathStyle: (NSPathStyle) style;
|
||||
{
|
||||
- (void) setPathStyle: (NSPathStyle) style; {
|
||||
NSPathCell *cell = [self cell];
|
||||
[cell setPathStyle: style];
|
||||
}
|
||||
|
||||
- (NSColor *) backgroundColor;
|
||||
{
|
||||
- (NSColor *) backgroundColor; {
|
||||
NSPathCell *cell = [self cell];
|
||||
return [cell backgroundColor];
|
||||
}
|
||||
|
||||
- (void) setBackgroundColor: (NSColor *) color;
|
||||
{
|
||||
- (void) setBackgroundColor: (NSColor *) color; {
|
||||
NSPathCell *cell = [self cell];
|
||||
[cell setBackgroundColor: color];
|
||||
}
|
||||
@ -37,69 +33,62 @@
|
||||
return [cell clickedPathComponentCell];
|
||||
}
|
||||
|
||||
- (NSArray *) pathComponentCells;
|
||||
{
|
||||
- (NSArray *) pathComponentCells; {
|
||||
NSPathCell *cell = [self cell];
|
||||
return [cell pathComponentCells];
|
||||
}
|
||||
|
||||
- (void) setPathComponentCells: (NSArray *) cells;
|
||||
{
|
||||
- (void) setPathComponentCells: (NSArray *) cells; {
|
||||
NSPathCell *cell = [self cell];
|
||||
[cell setPathComponentCells: cells];
|
||||
}
|
||||
|
||||
- (SEL) doubleAction;
|
||||
{
|
||||
- (SEL) doubleAction; {
|
||||
NSPathCell *cell = [self cell];
|
||||
return [cell doubleAction];
|
||||
}
|
||||
|
||||
- (void) setDoubleAction: (SEL) action;
|
||||
{
|
||||
- (void) setDoubleAction: (SEL) action; {
|
||||
NSPathCell *cell = [self cell];
|
||||
[cell setDoubleAction: action];
|
||||
}
|
||||
|
||||
- (NSURL *) URL;
|
||||
{
|
||||
- (NSURL *) URL; {
|
||||
NSPathCell *cell = [self cell];
|
||||
return [cell URL];
|
||||
}
|
||||
- (void) setURL: (NSURL *) url;
|
||||
{
|
||||
- (void) setURL: (NSURL *) url; {
|
||||
NSPathCell *cell = [self cell];
|
||||
[cell setURL: url];
|
||||
}
|
||||
|
||||
- (id<NSPathControlDelegate>) delegate;
|
||||
{
|
||||
- (id<NSPathControlDelegate>) delegate; {
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) setDelegate: (id<NSPathControlDelegate>) delegate;
|
||||
{ NSUnimplementedMethod(); }
|
||||
- (void) setDelegate: (id<NSPathControlDelegate>) delegate; {
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (void) setDraggingSourceOperationMask: (NSDragOperation) mask
|
||||
forLocal: (BOOL) isLocal;
|
||||
{ NSUnimplementedMethod(); }
|
||||
|
||||
- (NSMenu *) menu;
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
- (NSMenu *) menu; {
|
||||
NSPathCell *cell = [self cell];
|
||||
// return [cell menu];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) setMenu: (NSMenu *) menu;
|
||||
{
|
||||
- (void) setMenu: (NSMenu *) menu; {
|
||||
NSPathCell *cell = [self cell];
|
||||
// [cell setMenu: menu];
|
||||
}
|
||||
|
||||
+ (void) initialize;
|
||||
{
|
||||
+ (void) initialize; {
|
||||
if (self == [NSPathControl class]) {
|
||||
[self setCellClass: [NSPathCell class]];
|
||||
}
|
||||
|
@ -97,7 +97,8 @@ static const NSTimeInterval kAnimationDuration = .3;
|
||||
size: (NSSize) size
|
||||
animationDelegate: (id) animationDelegate
|
||||
didEndSelector: (SEL) didEndSelector
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
if (size.width == 0 || size.height == 0) {
|
||||
size.width = size.height = 48;
|
||||
}
|
||||
|
@ -369,7 +369,8 @@ static NSString *const NSPopUpButtonBindingObservationContext =
|
||||
- (void) bind: (NSString *) binding
|
||||
toObject: (id) observable
|
||||
withKeyPath: (NSString *) keyPath
|
||||
options: (NSDictionary *) options {
|
||||
options: (NSDictionary *) options
|
||||
{
|
||||
// No need to observe the same thing many times when we have several
|
||||
// bindings
|
||||
if (!_observerAdded) {
|
||||
@ -393,7 +394,8 @@ static NSString *const NSPopUpButtonBindingObservationContext =
|
||||
- (void) observeValueForKeyPath: (NSString *) keyPath
|
||||
ofObject: (id) object
|
||||
change: (NSDictionary *) change
|
||||
context: (void *) context {
|
||||
context: (void *) context
|
||||
{
|
||||
if (context == NSPopUpButtonBindingObservationContext) {
|
||||
if ([keyPath isEqualToString: @"cell.selectedItem"]) {
|
||||
if ([[change objectForKey: NSKeyValueChangeNotificationIsPriorKey]
|
||||
|
@ -485,7 +485,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (BOOL) trackMouse: (NSEvent *) event
|
||||
inRect: (NSRect) cellFrame
|
||||
ofView: (NSView *) controlView
|
||||
untilMouseUp: (BOOL) flag {
|
||||
untilMouseUp: (BOOL) flag
|
||||
{
|
||||
NSPoint origin = [controlView bounds].origin;
|
||||
|
||||
#if 0
|
||||
|
@ -285,8 +285,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) {
|
||||
|
||||
origin.y += NSHeight(separatorRect);
|
||||
} else {
|
||||
#define CENTER_PART_RECT_VERTICALLY(partSize) \
|
||||
{ \
|
||||
#define CENTER_PART_RECT_VERTICALLY(partSize) { \
|
||||
NSSize __partSize = (partSize); \
|
||||
__partSize.width = ceilf(__partSize.width); \
|
||||
partRect.origin.y = origin.y + (itemHeight - __partSize.height) / 2; \
|
||||
|
@ -46,7 +46,8 @@ static NSPrintOperation *_currentOperation = nil;
|
||||
printInfo: (NSPrintInfo *) printInfo
|
||||
insideRect: (NSRect) rect
|
||||
toData: (NSMutableData *) data
|
||||
type: (int) type {
|
||||
type: (int) type
|
||||
{
|
||||
_view = [view retain];
|
||||
_printInfo = [printInfo copy];
|
||||
if (type == NSPrintOperationPDFInRect ||
|
||||
@ -90,13 +91,15 @@ static NSPrintOperation *_currentOperation = nil;
|
||||
}
|
||||
|
||||
+ (NSPrintOperation *) printOperationWithView: (NSView *) view
|
||||
printInfo: (NSPrintInfo *) printInfo {
|
||||
printInfo: (NSPrintInfo *) printInfo
|
||||
{
|
||||
return [[[self alloc] initWithView: view printInfo: printInfo] autorelease];
|
||||
}
|
||||
|
||||
+ (NSPrintOperation *) PDFOperationWithView: (NSView *) view
|
||||
insideRect: (NSRect) rect
|
||||
toData: (NSMutableData *) data {
|
||||
toData: (NSMutableData *) data
|
||||
{
|
||||
return [self PDFOperationWithView: view
|
||||
insideRect: rect
|
||||
toData: data
|
||||
@ -106,7 +109,8 @@ static NSPrintOperation *_currentOperation = nil;
|
||||
+ (NSPrintOperation *) PDFOperationWithView: (NSView *) view
|
||||
insideRect: (NSRect) rect
|
||||
toData: (NSMutableData *) data
|
||||
printInfo: (NSPrintInfo *) printInfo {
|
||||
printInfo: (NSPrintInfo *) printInfo
|
||||
{
|
||||
return [[[self alloc] initWithView: view
|
||||
printInfo: printInfo
|
||||
insideRect: rect
|
||||
@ -116,7 +120,8 @@ static NSPrintOperation *_currentOperation = nil;
|
||||
|
||||
+ (NSPrintOperation *) EPSOperationWithView: (NSView *) view
|
||||
insideRect: (NSRect) rect
|
||||
toData: (NSMutableData *) data {
|
||||
toData: (NSMutableData *) data
|
||||
{
|
||||
return [self EPSOperationWithView: view
|
||||
insideRect: rect
|
||||
toData: data
|
||||
@ -126,7 +131,8 @@ static NSPrintOperation *_currentOperation = nil;
|
||||
+ (NSPrintOperation *) EPSOperationWithView: (NSView *) view
|
||||
insideRect: (NSRect) rect
|
||||
toData: (NSMutableData *) data
|
||||
printInfo: (NSPrintInfo *) printInfo {
|
||||
printInfo: (NSPrintInfo *) printInfo
|
||||
{
|
||||
return [[[self alloc] initWithView: view
|
||||
printInfo: printInfo
|
||||
insideRect: rect
|
||||
@ -178,7 +184,8 @@ static NSPrintOperation *_currentOperation = nil;
|
||||
|
||||
- (void) _autopaginatePageRange: (NSRange) pageRange
|
||||
actualPageRange: (NSRange *) rangep
|
||||
context: (CGContextRef) context {
|
||||
context: (CGContextRef) context
|
||||
{
|
||||
NSRange result = NSMakeRange(1, 0);
|
||||
NSRect bounds = [_view bounds];
|
||||
NSRect imageableRect = [_printInfo imageablePageBounds];
|
||||
@ -248,7 +255,8 @@ static NSPrintOperation *_currentOperation = nil;
|
||||
}
|
||||
|
||||
- (void) _paginateWithPageRange: (NSRange) pageRange
|
||||
context: (CGContextRef) context {
|
||||
context: (CGContextRef) context
|
||||
{
|
||||
int i;
|
||||
|
||||
NSPrintProgressPanelController *printProgressPanelController = nil;
|
||||
|
@ -67,7 +67,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- validRequestorForSendType: (NSString *) sendType
|
||||
returnType: (NSString *) returnType {
|
||||
returnType: (NSString *) returnType
|
||||
{
|
||||
return [_nextResponder validRequestorForSendType: sendType
|
||||
returnType: returnType];
|
||||
}
|
||||
@ -230,7 +231,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
modalForWindow: (NSWindow *) window
|
||||
delegate: delegate
|
||||
didPresentSelector: (SEL) selector
|
||||
contextInfo: (void *) info {
|
||||
contextInfo: (void *) info
|
||||
{
|
||||
NSUnimplementedMethod();
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (id) initWithRulerView: (NSRulerView *) ruler
|
||||
markerLocation: (CGFloat) location
|
||||
image: (NSImage *) image
|
||||
imageOrigin: (NSPoint) point {
|
||||
imageOrigin: (NSPoint) point
|
||||
{
|
||||
_ruler = ruler;
|
||||
_markerLocation = location;
|
||||
_image = [image retain];
|
||||
|
@ -55,7 +55,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
abbreviation: (NSString *) abbreviation
|
||||
unitToPointsConversionFactor: (CGFloat) conversionFactor
|
||||
stepUpCycle: (NSArray *) stepUpCycle
|
||||
stepDownCycle: (NSArray *) stepDownCycle {
|
||||
stepDownCycle: (NSArray *) stepDownCycle
|
||||
{
|
||||
[NSMeasurementUnit
|
||||
registerUnit: [NSMeasurementUnit
|
||||
measurementUnitWithName: name
|
||||
@ -72,7 +73,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- initWithScrollView: (NSScrollView *) scrollView
|
||||
orientation: (NSRulerOrientation) orientation {
|
||||
orientation: (NSRulerOrientation) orientation
|
||||
{
|
||||
NSRect frame = NSMakeRect(0, 0, 1, 1);
|
||||
if (scrollView) {
|
||||
frame = [scrollView frame];
|
||||
@ -267,8 +269,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
[self invalidateHashMarks];
|
||||
}
|
||||
|
||||
- (BOOL) trackMarker: (NSRulerMarker *) marker
|
||||
withMouseEvent: (NSEvent *) event {
|
||||
- (BOOL) trackMarker: (NSRulerMarker *) marker withMouseEvent: (NSEvent *) event
|
||||
{
|
||||
NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil];
|
||||
|
||||
if (NSMouseInRect(point, [self bounds], [self isFlipped])) {
|
||||
@ -300,7 +302,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
}
|
||||
|
||||
- (void) moveRulerlineFromLocation: (CGFloat) fromLocation
|
||||
toLocation: (CGFloat) toLocation {
|
||||
toLocation: (CGFloat) toLocation
|
||||
{
|
||||
NSNumber *old = [NSNumber numberWithFloat: fromLocation];
|
||||
NSNumber *new = [ NSNumber numberWithFloat : toLocation ];
|
||||
|
||||
|
@ -97,7 +97,8 @@ static NSOpenPanel *_newPanel = nil;
|
||||
|
||||
- (NSInteger) runModalForDirectory: (NSString *) directory
|
||||
file: (NSString *) file
|
||||
types: (NSArray *) types {
|
||||
types: (NSArray *) types
|
||||
{
|
||||
[self _setFilename: file];
|
||||
[self setDirectory: directory];
|
||||
[self setAllowedFileTypes: types];
|
||||
@ -110,7 +111,8 @@ static NSOpenPanel *_newPanel = nil;
|
||||
}
|
||||
|
||||
- (NSInteger) runModalForDirectory: (NSString *) directory
|
||||
file: (NSString *) file {
|
||||
file: (NSString *) file
|
||||
{
|
||||
[self setDirectory: directory];
|
||||
[self _setFilename: file];
|
||||
return [self runModal];
|
||||
@ -171,7 +173,8 @@ static NSOpenPanel *_newPanel = nil;
|
||||
modalForWindow: (NSWindow *) docWindow
|
||||
modalDelegate: (id) modalDelegate
|
||||
didEndSelector: (SEL) didEndSelector
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
id inv = [NSInvocation
|
||||
invocationWithMethodSignature:
|
||||
[self
|
||||
@ -202,7 +205,8 @@ static NSOpenPanel *_newPanel = nil;
|
||||
modalForWindow: (NSWindow *) docWindow
|
||||
modalDelegate: (id) modalDelegate
|
||||
didEndSelector: (SEL) didEndSelector
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
id pool = [NSAutoreleasePool new];
|
||||
int ret = [self runModalForDirectory: path file: name types: fileTypes];
|
||||
|
||||
|
@ -106,7 +106,8 @@ static NSSavePanel *_newPanel = nil;
|
||||
}
|
||||
|
||||
- (NSInteger) runModalForDirectory: (NSString *) directory
|
||||
file: (NSString *) file {
|
||||
file: (NSString *) file
|
||||
{
|
||||
[self _setFilename: file];
|
||||
[self setDirectory: directory];
|
||||
|
||||
@ -167,8 +168,7 @@ static NSSavePanel *_newPanel = nil;
|
||||
return ret;
|
||||
}
|
||||
|
||||
- (void) setMessage: (NSString *) message;
|
||||
{
|
||||
- (void) setMessage: (NSString *) message; {
|
||||
@synchronized(self) {
|
||||
if (_message != message) {
|
||||
[_message release];
|
||||
@ -177,8 +177,7 @@ static NSSavePanel *_newPanel = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *) message;
|
||||
{
|
||||
- (NSString *) message; {
|
||||
id ret = nil;
|
||||
@synchronized(self) {
|
||||
ret = [[_message copy] autorelease];
|
||||
@ -186,8 +185,7 @@ static NSSavePanel *_newPanel = nil;
|
||||
return ret;
|
||||
}
|
||||
|
||||
- (void) setPrompt: (NSString *) prompt;
|
||||
{
|
||||
- (void) setPrompt: (NSString *) prompt; {
|
||||
@synchronized(self) {
|
||||
if (_prompt != prompt) {
|
||||
[_prompt release];
|
||||
@ -196,8 +194,7 @@ static NSSavePanel *_newPanel = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *) prompt;
|
||||
{
|
||||
- (NSString *) prompt; {
|
||||
id ret = nil;
|
||||
@synchronized(self) {
|
||||
ret = [[_prompt copy] autorelease];
|
||||
@ -237,7 +234,8 @@ static NSSavePanel *_newPanel = nil;
|
||||
modalForWindow: (NSWindow *) docWindow
|
||||
modalDelegate: (id) modalDelegate
|
||||
didEndSelector: (SEL) didEndSelector
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
id inv = [NSInvocation
|
||||
invocationWithMethodSignature:
|
||||
[self
|
||||
@ -264,14 +262,16 @@ static NSSavePanel *_newPanel = nil;
|
||||
- (void) _selector_savePanelDidEnd: (NSSavePanel *) sheet
|
||||
returnCode: (int) returnCode
|
||||
contextInfo: (void *) contextInfo;
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
- (void) _background_beginSheetForDirectory: (NSString *) path
|
||||
file: (NSString *) name
|
||||
modalForWindow: (NSWindow *) docWindow
|
||||
modalDelegate: (id) modalDelegate
|
||||
didEndSelector: (SEL) didEndSelector
|
||||
contextInfo: (void *) contextInfo {
|
||||
contextInfo: (void *) contextInfo
|
||||
{
|
||||
id pool = [NSAutoreleasePool new];
|
||||
int ret = [self runModalForDirectory: path file: name];
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user