Files
macSVG-mirror/macSVG/TextDocument Classes/TextDocument.m
Evelyn Fecher-Ward f56efa5311 Updated macSVG to modern Objective-C syntax with Xcode tools. Most third-party source code was left unmodified.
A few bugs were fixed for getBbox and updating selection rects and handles during animation.
2016-10-05 02:16:09 -05:00

77 lines
2.5 KiB
Objective-C

//
// TextDocument.m
// macSVG
//
// Created by Douglas Ward on 1/18/12.
// Copyright © 2016 ArkPhone LLC. All rights reserved.
//
#import "TextDocument.h"
#import "TextDocumentWindowController.h"
@implementation TextDocument
- (instancetype)init
{
self = [super init];
if (self) {
// Add your subclass-specific initialization here.
// If an error occurs here, send a [self release] message and return nil.
}
return self;
}
/*
- (NSString *)windowNibName
{
// Override returning the nib file name of the document
// If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
return @"TextDocument";
}
*/
//==================================================================================
// makeWindowControllers:
//==================================================================================
- (void)makeWindowControllers
{
// create character set document window
self.textDocumentWindowController = [[TextDocumentWindowController alloc]
initWithWindowNibName:@"TextDocument" owner:self];
[self addWindowController:self.textDocumentWindowController];
}
- (void)windowControllerDidLoadNib:(NSWindowController *)aController
{
[super windowControllerDidLoadNib:aController];
// Add any code here that needs to be executed once the windowController has loaded the document's window.
}
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
{
/*
Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil.
You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
*/
if (outError) {
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL];
}
return nil;
}
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
{
/*
Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning NO.
You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
*/
if (outError) {
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL];
}
return YES;
}
@end