DrawKit
Vector and illustration framework for Mac OS X
|
A DKDrawing is the model data for the drawing system. More...
Instance Methods | |
(CGImageRef) | - CGImageWithResolution:hasAlpha: |
Creates the initial bitmap image that the various bitmap formats are created from. More... | |
(CGImageRef) | - CGImageWithResolution:hasAlpha:relativeScale: |
(void) | - exitTemporaryTextEditingMode |
(id) | - initWithSize: |
designated initializer More... | |
(void) | - invalidateCursors |
(NSData *) | - JPEGDataWithProperties: |
Returns JPEG data for the drawing. More... | |
(NSData *) | - JPEGDataWithResolution:quality:progressive: |
Returns JPEG data for the drawing or nil if there was a problem. More... | |
(NSArray *) | - layerBitmapsWithDPI: |
Returns an array of bitmaps (NSBitmapImageReps) one per layer. More... | |
(NSData *) | - multipartTIFFDataWithResolution: |
Returns TIFF data. More... | |
(void) | - objectDidNotifyStatusChange: |
(id) | - owner |
Returns the "owner" of this drawing. More... | |
(NSData *) | - PNGDataWithProperties: |
Returns PNG data for the drawing. More... | |
(NSData *) | - PNGDataWithResolution:gamma:interlaced: |
(void) | - scrollToRect: |
(void) | - setOwner: |
Sets the "owner" of this drawing. More... | |
(NSData *) | - thumbnailData |
Returns JPEG data for the drawing at 50% actual size, with 50% quality. More... | |
(NSData *) | - TIFFDataWithProperties: |
Returns TIFF data for the drawing. More... | |
(NSData *) | - TIFFDataWithResolution:compressionType: |
Returns TIFF data for the drawing or nil if there was a problem. More... | |
(NSWindow *) | - windowForSheet |
basic drawing parameters | |
(void) | - setDrawingSize: |
(NSSize) | - drawingSize |
(void) | - setDrawingSizeWithPrintInfo: |
(void) | - setMarginsLeft:top:right:bottom: |
(void) | - setMarginsWithPrintInfo: |
(CGFloat) | - leftMargin |
(CGFloat) | - rightMargin |
(CGFloat) | - topMargin |
(CGFloat) | - bottomMargin |
(NSRect) | - interior |
(NSPoint) | - pinPointToInterior: |
(void) | - setFlipped: |
(BOOL) | - isFlipped |
(void) | - setColourSpace: |
Sets the destination colour space for the whole drawing. More... | |
(NSColorSpace *) | - colourSpace |
Returns the colour space for the whole drawing. More... | |
setting the rulers to the grid | |
(void) | - setDrawingUnits:unitToPointsConversionFactor: |
(NSString *) | - drawingUnits |
(NSString *) | - abbreviatedDrawingUnits |
(CGFloat) | - unitToPointsConversionFactor |
(CGFloat) | - effectiveUnitToPointsConversionFactor |
(void) | - synchronizeRulersWithUnits: |
setting the delegate | |
(void) | - setDelegate: |
(id) | - delegate |
the drawing's view controllers | |
(NSSet *) | - controllers |
(void) | - addController: |
(void) | - removeController: |
(void) | - removeAllControllers |
Removes all controller from the drawing. More... | |
dynamically adjusting the rendering quality: | |
(void) | - setDynamicQualityModulationEnabled: |
Set whether drawing quality modulation is enabled or not. More... | |
(BOOL) | - dynamicQualityModulationEnabled |
(void) | - setLowRenderingQuality: |
(BOOL) | - lowRenderingQuality |
(void) | - checkIfLowQualityRequired |
(void) | - qualityTimerCallback: |
(void) | - setLowQualityTriggerInterval: |
(NSTimeInterval) | - lowQualityTriggerInterval |
setting the undo manager: | |
(void) | - setUndoManager: |
(id) | - undoManager |
Obtains the undo manager that is handling undo for the drawing and hence, this layer. More... | |
drawing meta-data: | |
(void) | - setDrawingInfo: |
(NSMutableDictionary *) | - drawingInfo |
rendering the drawing: | |
(void) | - setPaperColour: |
(NSColor *) | - paperColour |
(void) | - setPaperColourIsPrinted: |
(BOOL) | - paperColourIsPrinted |
active layer | |
(BOOL) | - setActiveLayer: |
(BOOL) | - setActiveLayer:withUndo: |
(DKLayer *) | - activeLayer |
(id) | - activeLayerOfClass: |
high level methods that help support a UI | |
(void) | - addLayer:andActivateIt: |
(void) | - removeLayer:andActivateLayer: |
(DKLayer *) | - firstActivateableLayerOfClass: |
interaction with grid and guides | |
(void) | - setSnapsToGrid: |
(BOOL) | - snapsToGrid |
(void) | - setSnapsToGuides: |
(BOOL) | - snapsToGuides |
(NSPoint) | - snapToGrid:withControlFlag: |
(NSPoint) | - snapToGrid:ignoringUserSetting: |
(NSPoint) | - snapToGuides: |
(NSRect) | - snapRectToGuides:includingCentres: |
(NSSize) | - snapPointsToGuide: |
(NSPoint) | - nudgeOffset |
(DKGridLayer *) | - gridLayer |
(DKGuideLayer *) | - guideLayer |
(CGFloat) | - convertLength: |
(NSPoint) | - convertPoint: |
(NSPoint) | - convertPointFromDrawingToBase: |
(CGFloat) | - convertLengthFromDrawingToBase: |
(NSString *) | - formattedConvertedLength: |
Convert a distance in quartz coordinates to the units established by the drawing grid. More... | |
(NSArray *) | - formattedConvertedPoint: |
Convert a point in quartz coordinates to the units established by the drawing grid. More... | |
export | |
(void) | - finalizePriorToSaving |
(BOOL) | - writeToFile:atomically: |
(NSData *) | - drawingAsXMLDataAtRoot |
(NSData *) | - drawingAsXMLDataForKey: |
(NSData *) | - drawingData |
(NSData *) | |
Returns the content of the layer as a pdf. More... | |
image manager | |
(DKImageDataManager *) | - imageManager |
Returns the image manager. More... | |
Instance Methods inherited from DKLayerGroup | |
(void) | - addLayer: |
(void) | - addLayer:aboveLayerIndex: |
(DKLayer *) | - addNewLayerOfClass: |
(DKLayer *) | - bottomLayer |
(BOOL) | - containsLayer: |
(NSUInteger) | - countOfLayers |
(DKLayer *) | - findLayerForPoint: |
(DKLayer *) | - firstLayerOfClass: |
(DKLayer *) | - firstLayerOfClass:performDeepSearch: |
(NSArray *) | - flattenedLayers |
(NSArray *) | - flattenedLayersIncludingGroups: |
(NSArray *) | - flattenedLayersOfClass: |
(NSArray *) | - flattenedLayersOfClass:includeGroups: |
(BOOL) | - hasHiddenLayers |
Returns YES if the receiver or any of its contained layers is hidden. More... | |
(BOOL) | - hasVisibleLayersOtherThan: |
Returns YES if the receiver or any of its contained layers is visible, ignoring the one passed. More... | |
(void) | - hideAllExcept: |
Makes all layers in the group and in any subgroups hidden except <aLayer>, which is made visible. More... | |
(NSUInteger) | - indexOfHighestOpaqueLayer |
(NSUInteger) | - indexOfLayer: |
(id) | - initWithLayers: |
Initialize a layer group. More... | |
(void) | - insertObject:inLayersAtIndex: |
(NSEnumerator *) | - layerBottomToTopEnumerator |
(NSArray *) | - layers |
(NSArray *) | - layersOfClass: |
(NSArray *) | - layersOfClass:performDeepSearch: |
(NSEnumerator *) | - layerTopToBottomEnumerator |
(DKLayer *) | - layerWithUniqueKey: |
Returns a layer or layer group having the given unique key. More... | |
(NSUInteger) | - level |
Returns the hierarchical level of this group, i.e. More... | |
(void) | - moveDownLayer: |
(void) | - moveLayer:aboveLayer: |
(void) | - moveLayer:belowLayer: |
(void) | - moveLayer:toIndex: |
(void) | - moveLayerToBottom: |
(void) | - moveLayerToTop: |
(void) | - moveUpLayer: |
(DKLayer *) | - objectInLayersAtIndex: |
(void) | - removeAllLayers |
(void) | - removeLayer: |
(void) | - removeObjectFromLayersAtIndex: |
(void) | - setLayers: |
(void) | - showAll |
Makes all layers in the group and in any subgroups visible. More... | |
(DKLayer *) | - topLayer |
(NSString *) | - uniqueLayerNameForName: |
Instance Methods inherited from DKLayer | |
(NSRect) | - activeCursorRect |
Return a rect where the layer's cursor is shown when the mouse is within it. More... | |
(void) | - addMetadata: |
(void) | - addUserInfo: |
(NSSet *) | - allRegisteredStyles |
Return all of registered styles used by the layer. More... | |
(NSSet *) | - allStyles |
Return all of styles used by the layer. More... | |
(CGFloat) | - alpha |
Returns the alpha level for the layer as a whole. More... | |
(void) | - beginDrawing |
Called before the layer starts drawing its content. More... | |
(NSBitmapImageRep *) | - bitmapRepresentationWithDPI: |
Returns the layer's content as a transparent bitmap having the given DPI. More... | |
(BOOL) | - clipsDrawingToInterior |
Whether the drawing will be clipped to the interior or not. More... | |
(NSColor *) | - colourForKey: |
(IBAction) | - copy: |
(NSView *) | - currentView |
Returns the view which is either currently drawing the layer, or the one that mouse events are coming from. More... | |
(NSCursor *) | - cursor |
Returns the cursor to display while the mouse is over this layer while it's active. More... | |
(DKDrawing *) | - drawing |
Returns the drawing that the layer belongs to. More... | |
(void) | - drawingDidChangeMargins: |
(void) | - drawingDidChangeToSize: |
Called when the drawing's size is changed - this gives layers that need to know about this a direct notification. More... | |
(void) | - drawingHasNewUndoManager: |
Called when the drawing's undo manager is changed - this gives objects that cache the UM a chance to update their references. More... | |
(void) | - drawRect:inView: |
Main entry point for drawing the layer and its contents to the drawing's views. More... | |
(void) | - endDrawing |
Called after the layer has finished drawing its content. More... | |
(void) | - flagsChanged: |
Respond to a change in the modifier key state. More... | |
(CGFloat) | - floatValueForKey: |
(BOOL) | - hasMetadataForKey: |
(void) | - hideInfoWindow |
Hides the info window if it's visible. More... | |
(IBAction) | - hideLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(void) | - hideRulerMarkers |
(BOOL) | - hitLayer: |
Detect whether the layer was "hit" by a point. More... | |
(DKDrawableObject *) | - hitTest: |
Detect what object was hit by a point. More... | |
(NSUInteger) | - indexInGroup |
Gets the layer's index within the group that the layer is contained in. More... | |
(NSInteger) | - intValueForKey: |
(BOOL) | - isActive |
Is the layer the active layer? More... | |
(BOOL) | - isChildOfGroup: |
Determine whether a given group is the parent of this layer, or anywhere above it in the hierarchy. More... | |
(BOOL) | - isOpaque |
Is the layer opaque or transparent? More... | |
(DKKnob *) | - knobs |
(BOOL) | - knobsShouldAdjustToViewScale |
(void) | - layerDidBecomeActiveLayer |
The layer was made the active layer by the owning drawing. More... | |
(void) | - layerDidResignActiveLayer |
The layer is no longer the active layer. More... | |
(DKLayerGroup *) | - layerGroup |
Gets the group that the layer is contained in. More... | |
(BOOL) | - layerMayBecomeActive |
Returns whether the layer can become the active layer. More... | |
(BOOL) | - layerMayBeDeleted |
Return whether the layer can be deleted. More... | |
(NSString *) | - layerName |
Returns the layer's name. More... | |
(BOOL) | - locked |
Returns whether the layer is locked or not. More... | |
(BOOL) | - lockedOrHidden |
Returns whether the layer is locked or hidden. More... | |
(IBAction) | - lockLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(IBAction) | - logDescription: |
Debugging method. More... | |
(NSMenu *) | - menuForEvent:inView: |
Allows a contextual menu to be built for the layer or its contents. More... | |
(NSMutableDictionary *) | - metadata |
(NSUInteger) | - metadataChecksum |
(void) | - metadataDidChangeKey: |
(DKMetadataItem *) | - metadataItemForKey: |
(NSArray *) | - metadataKeys |
(id) | - metadataObjectForKey: |
(void) | - metadataWillChangeKey: |
(void) | - mouseDown:inView: |
The mouse went down in this layer. More... | |
(void) | - mouseDragged:inView: |
Subclasses must override to be notified of mouse dragged events. More... | |
(void) | - mouseMoved:inView: |
(void) | - mouseUp:inView: |
Override to respond to the event. More... | |
(BOOL) | - pasteboard:hasAvailableTypeForOperation: |
Tests whether the pasteboard has any of the types the layer is interested in receiving for the given operation. More... | |
(NSArray *) | - pasteboardTypesForOperation: |
Return the pasteboard types this layer is able to receive in a given operation (drop or paste) More... | |
(void) | - removeMetadataForKey: |
(void) | - replaceMatchingStylesFromSet: |
Substitute styles with those in the given set. More... | |
(BOOL) | - rulerMarkerUpdatesEnabled |
(DKLayerMetadataSchema) | - schema |
(NSColor *) | - selectionColour |
Returns the currently preferred selection colour for this layer. More... | |
(void) | - setAlpha: |
Sets the alpha level for the layer. More... | |
(void) | - setClipsDrawingToInterior: |
Sets whether drawing is limited to the interior area or not. More... | |
(void) | - setColour:forKey: |
(void) | - setFloatValue:forKey: |
(void) | - setInfoWindowBackgroundColour: |
Sets the background colour of the small floating info window. More... | |
(void) | - setIntValue:forKey: |
(void) | - setKnobs: |
(void) | - setKnobsShouldAdustToViewScale: |
(void) | - setLayerGroup: |
Sets the group that the layer is contained in - called automatically when the layer is added to a group. More... | |
(void) | - setLayerName: |
Sets the user-readable name of the layer. More... | |
(void) | - setLocked: |
Sets whether the layer is locked or not. More... | |
(void) | - setMetadata: |
(void) | - setMetadataItem:forKey: |
(void) | - setMetadataItemType:forKey: |
(void) | - setMetadataItemValue:forKey: |
(void) | - setMetadataObject:forKey: |
(void) | - setNeedsDisplay: |
Flags the whole layer as needing redrawing. More... | |
(void) | - setNeedsDisplayInRect: |
Flags part of a layer as needing redrawing. More... | |
(void) | - setNeedsDisplayInRects: |
Marks several areas for update at once. More... | |
(void) | - setNeedsDisplayInRects:withExtraPadding: |
Marks several areas for update at once. More... | |
(void) | - setRulerMarkerUpdatesEnabled: |
(void) | - setSelectionColour: |
Sets the colour preference to use for selected objects within this layer. More... | |
(void) | - setShouldDrawToPrinter: |
Set whether this layer should be included in printed output. More... | |
(void) | - setSize:forKey: |
(void) | - setString:forKey: |
(void) | - setupMetadata |
(void) | - setUserInfo: |
(void) | - setUserInfoObject:forKey: |
(void) | - setVisible: |
Sets whether the layer is visible or not. More... | |
(BOOL) | - shouldAutoActivateWithEvent: |
Should the layer automatically activate on a click if the view has this behaviour set? More... | |
(BOOL) | - shouldDrawToPrinter |
Return whether the layer should be part of the printed output or not. More... | |
(void) | - showInfoWindowWithString:atPoint: |
Displays a small floating info window near the point p containg the string. More... | |
(IBAction) | - showLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(NSSize) | - sizeForKey: |
(NSString *) | - stringForKey: |
(BOOL) | - supportsMetadata |
(NSImage *) | - thumbnail |
(NSImage *) | - thumbnailImageWithSize: |
Returns an image of the layer a the given size. More... | |
(IBAction) | - toggleLayerLock: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(IBAction) | - toggleLayerVisible: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(NSString *) | - uniqueKey |
Returns the layer's unique key. More... | |
(IBAction) | - unlockLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(void) | - updateMetadataKeys |
(void) | - updateRulerMarkersForRect: |
(NSMutableDictionary *) | - userInfo |
Return the attached user info. More... | |
(id) | - userInfoObjectForKey: |
Return an item of user info. More... | |
(BOOL) | - visible |
Is the layer visible? More... | |
(void) | - wasAddedToDrawing: |
Notifies the layer that it or a group containing it was added to a drawing. More... | |
(BOOL) | - writePDFDataToPasteboard: |
Writes the content of the layer as a pdf to a nominated pasteboard. More... | |
Instance Methods inherited from NSObject | |
(NSString *) | - address |
(DKStyleRegistry *) | - applicationWillReturnStyleRegistry |
(BOOL) | - canBeUsedWithSelectionTool |
(id) | - categoryManager:shouldReplaceObject:withObject: |
(Class) | - classForCoder |
(NSColor *) | - colorValue |
(NSColor *) | - colourValue |
(id) | - copy |
(void) | - dealloc |
(id) | - deepCopy |
(NSDictionary *) | - dimensionValuesForArrowStroke: |
(CGFloat) | - drawing:convertDistanceToExternalCoordinates: |
(NSPoint) | - drawing:convertLocationToExternalCoordinates: |
(void) | - drawing:didDrawRect:inView: |
(void) | - drawing:willDrawRect:inView: |
(NSString *) | - drawing:willReturnAbbreviationForUnit: |
(NSString *) | - drawing:willReturnFormattedCoordinateForDistance: |
(CGFloat) | - drawingWillReturnUnitToPointsConversonFactor: |
(void) | - finalize |
(NSString *) | - hexString |
(void) | - hotspot:didEndTrackingWithEvent:inView: |
(void) | - hotspot:isTrackingWithEvent:inView: |
(void) | - hotspot:willBeginTrackingWithEvent:inView: |
(NSData *) | - imageData |
(NSImage *) | - imageResourceNamed: |
(id) | - init |
(id) | - initWithExpression: |
(id) | - instantiateObjectWithShortName:parameters: |
(BOOL) | - isLiteralValue |
(void) | - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset: |
(void) | - menuItem:wasAddedForObject:inCategory: |
(BOOL) | - moveObjectTo:position:slope:userInfo: |
(id) | - mutableCopy |
(void) | - oneShotComplete |
(void) | - oneShotHasReached: |
(void) | - oneShotWillBegin |
(void) | - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo: |
(id) | - placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo: |
(id) | - placeObjectAtPoint:onPath:position:slope:userInfo: |
(NSPoint) | - point |
(NSPoint) | - pointForTextLayout |
(DKStyle *) | - registry:shouldReplaceStyle:withStyle: |
(NSBezierPath *) | - renderer:willRenderPath: |
(void) | - routeFinder:progressHasReached: |
(void) | - setValue:forNumericParameter: |
(NSString *) | - stringValue |
(CGFloat) | - taperFactorAtDistance:onPath:ofLength: |
(void) | - toolDidPerformUndoableAction: |
(void) | - toolWillPerformUndoableAction: |
(NSURL *) | - url |
Instance Methods inherited from <NSObject> | |
(NSString *) | - description |
(NSUInteger) | - hash |
(BOOL) | - isEqual: |
Instance Methods inherited from <NSKeyValueBindingCreation> | |
(void) | - bind:toObject:withKeyPath:options: |
(NSArray *) | - exposedBindings |
(NSDictionary *) | - infoForBinding: |
(NSArray *) | - optionDescriptionsForBinding: |
(void) | - unbind: |
(Class) | - valueClassForBinding: |
Instance Methods inherited from <NSCoding> | |
(void) | - encodeWithCoder: |
(id) | - initWithCoder: |
Instance Methods inherited from <DKKnobOwner> | |
(BOOL) | - knobsWantDrawingActiveState |
(CGFloat) | - knobsWantDrawingScale |
Instance Methods inherited from <NSCopying> | |
(id) | - copyWithZone: |
Class Methods | |
(NSString *) | + abbreviationForDrawingUnits: |
Returns the abbreviation for the given drawing units string. More... | |
(id) | + dearchivingHelper |
Return the default derachiving helper for deaerchiving a drawing. More... | |
(NSMutableDictionary *) | + defaultDrawingInfo |
Returns a dictionary containing some standard drawing info attributes. More... | |
(DKDrawing *) | + defaultDrawingWithSize: |
Constructs the default drawing system when the system isn't prebuilt "by hand". More... | |
(DKDrawing *) | + drawingWithContentsOfFile: |
(DKDrawing *) | + drawingWithData: |
Creates a drawing from a lump of data. More... | |
(DKDrawing *) | + drawingWithData:fromFileAtPath: |
(NSString *) | + drawkitReleaseStatus |
Return the current release status of the framework. More... | |
(NSUInteger) | + drawkitVersion |
Return the current version number of the framework. More... | |
(NSString *) | + drawkitVersionString |
Return the current version number and release status as a preformatted string. More... | |
(NSSize) | + isoA0PaperSize: |
(NSSize) | + isoA1PaperSize: |
(NSSize) | + isoA2PaperSize: |
(NSSize) | + isoA3PaperSize: |
(NSSize) | + isoA4PaperSize: |
(NSSize) | + isoA5PaperSize: |
(void) | + loadDefaults |
Loads the static user defaults for all classes in the drawing system. More... | |
(NSUInteger) | + newDrawingNumber |
Returns a new drawing number by incrementing the current default seed value. More... | |
(void) | + saveDefaults |
Saves the static class defaults for ALL classes in the drawing system. More... | |
(void) | + setAbbreviation:forDrawingUnits: |
Sets the abbreviation for the given drawing units string. More... | |
(void) | + setDearchivingHelper: |
Replace the default dearchiving helper for deaerchiving a drawing. More... | |
Class Methods inherited from DKLayerGroup | |
(DKLayerGroup *) | + layerGroupWithLayers: |
Convenience method for building a new layer group from an existing list of layers. More... | |
Class Methods inherited from DKLayer | |
(BOOL) | + metadataChangesAreUndoable |
(NSColor *) | + selectionColourForIndex: |
(NSArray *) | + selectionColours |
Returns the list of colours used for supplying the selection colours. More... | |
(void) | + setMetadataChangesAreUndoable: |
(void) | + setSelectionColours: |
Allows a list of colours to be set for supplying the selection colours. More... | |
Class Methods inherited from NSObject | |
(id) | + alloc |
(Class) | + class |
(void) | + initialize |
(void) | + load |
(id) | + new |
Class Methods inherited from <NSKeyValueBindingCreation> | |
(void) | + exposeBinding: |
Related Functions | |
(Note that these are not member functions.) | |
NSString * | kDKDrawingInfoUserInfoKey |
the key for the drawing info dictionary within the user info More... | |
notifications | |
NSString * | kDKDrawingActiveLayerWillChange |
NSString * | kDKDrawingActiveLayerDidChange |
NSString * | kDKDrawingWillChangeSize |
NSString * | kDKDrawingDidChangeSize |
NSString * | kDKDrawingUnitsWillChange |
NSString * | kDKDrawingUnitsDidChange |
NSString * | kDKDrawingWillChangeMargins |
NSString * | kDKDrawingDidChangeMargins |
NSString * | kDKDrawingWillBeSavedOrExported |
A DKDrawing is the model data for the drawing system.
Usually a document will own one of these. A drawing consists of one or more DKLayers, each of which contains any number of drawable objects, or implements some special feature such as a grid or guides, etc.
A drawing can have multiple views, though typically it will have only one. Each view is managed by a single view controller, either an instance or subclass of DKViewController. Drawing updates refersh all views via their controllers, and input from the views is directed to the current active layer through the controller. The drawing owns the controllers, but the views are owned as normal by their respective superviews. The controller provides only weak references to both drawing and view to prevent potential retain cycles when a view owns a drawing for the automatic backend scenario.
The drawing and the attached views must all have the same bounds size (though the views are free to have any desired frame). Setting the drawing size will adjust the views' bounds automatically.
The active layer will receive mouse events from any of the attached views via its controller. (Because the user can't mouse in more than one view at a time, there is no contention here.) The commands will go to whichever view is the current responder and be passed on appropriately.
Drawings can be saved simply by archiving them, thus all parts of the drawing need to adopt the NSCoding protocol.
- (NSString*) abbreviatedDrawingUnits |
Returns the abbreviation for the given drawing units string.
fullString | the full name of the drawing units |
- (DKLayer*) activeLayer |
- (void) addController: | (DKViewController *) | aController |
- (CGFloat) bottomMargin |
- (CGImageRef) CGImageWithResolution: | (NSInteger) | dpi | |
hasAlpha: | (BOOL) | hasAlpha | |
Creates the initial bitmap image that the various bitmap formats are created from.
Returned ref is autoreleased. The image always has an alpha channel, but the <hasAlpha> flag will paint the background in the paper colour if hasAlpha is NO.
dpi | the resolution of the image in dots per inch. |
hasAlpha | specifies whether the image is painted in the background paper colour or not. |
relScale | scaling factor, 1.0 = actual size, 0.5 = half size, etc. |
Provided by category DKDrawing(Export).
- (CGImageRef) CGImageWithResolution: | (NSInteger) | dpi | |
hasAlpha: | (BOOL) | hasAlpha | |
relativeScale: | (CGFloat) | relScale | |
Provided by category DKDrawing(Export).
- (void) checkIfLowQualityRequired |
- (NSColorSpace*) colourSpace |
Returns the colour space for the whole drawing.
Colours set by styles and so forth are converted to this colourspace when rendering. A value of nil will use whatever is set in the colours used by the styles.
- (NSSet*) controllers |
- (NSPoint) convertPoint: | (NSPoint) | pt |
- (NSPoint) convertPointFromDrawingToBase: | (NSPoint) | pt |
+ (id) dearchivingHelper |
Return the default derachiving helper for deaerchiving a drawing.
This helper is a delegate of the dearchiver during dearchiving and translates older or obsolete classes into modern ones, etc. The default helper deals with older DrawKit classes, but can be replaced to provide the same functionality for application-specific classes.
+ (NSMutableDictionary*) defaultDrawingInfo |
Returns a dictionary containing some standard drawing info attributes.
This is usually called by the drawing object itself when built new. Usually you'll want to replace its contents with your own info. A DKDrawingInfoLayer can interpret some of the standard values and display them in its info box.
+ (DKDrawing*) defaultDrawingWithSize: | (NSSize) | aSize |
Constructs the default drawing system when the system isn't prebuilt "by hand".
As a convenience for users of DrawKit, if you set up a DKDrawingView in IB, and do nothing else, you'll get a fully working, prebuilt drawing system behind that view. This can be very handy for all sorts of uses. However, it is more usual to build the system the other way around - start with a drawing object within a document (say) and attach views to it. This gives you the flexibility to do it either way. For automatic construction, this method is called to supply the drawing.
aSize | - the size of the drawing to create |
- (id) delegate |
- (NSData*) drawingAsXMLDataAtRoot |
- (NSData*) drawingData |
- (NSMutableDictionary*) drawingInfo |
- (NSSize) drawingSize |
- (NSString*) drawingUnits |
Provided by category DKDrawing(Deprecated).
Creates a drawing from a lump of data.
drawingData | data representing an archived drawing |
+ (DKDrawing*) drawingWithData: | (NSData *) | drawingData | |
fromFileAtPath: | (NSString *) | filepath | |
Provided by category DKDrawing(Deprecated).
+ (NSString*) drawkitReleaseStatus |
Return the current release status of the framework.
+ (NSUInteger) drawkitVersion |
Return the current version number of the framework.
+ (NSString*) drawkitVersionString |
Return the current version number and release status as a preformatted string.
This is intended for occasional display, rather than testing for the framework version.
- (BOOL) dynamicQualityModulationEnabled |
- (CGFloat) effectiveUnitToPointsConversionFactor |
- (void) exitTemporaryTextEditingMode |
- (void) finalizePriorToSaving |
Convert a distance in quartz coordinates to the units established by the drawing grid.
This wraps up length conversion and formatting for display into one method, which also calls the delegate if it implements the relevant method.
len | a distance in base points (pixels) |
- (NSArray*) formattedConvertedPoint: | (NSPoint) | pt |
Convert a point in quartz coordinates to the units established by the drawing grid.
This wraps up length conversion and formatting for display into one method, which also calls the delegate if it implements the relevant method. The result is an array with two strings - the first is the x coordinate, the second is the y co-ordinate
pt | a point in base points (pixels) |
- (DKGridLayer*) gridLayer |
- (DKGuideLayer*) guideLayer |
- (DKImageDataManager*) imageManager |
Returns the image manager.
The image manager is an object that is used to improve archiving efficiency of images. Classes that have images, such as DKImageShape, use this to cache image data.
- (id) initWithSize: | (NSSize) | size |
designated initializer
- (NSRect) interior |
- (void) invalidateCursors |
- (BOOL) isFlipped |
+ (NSSize) isoA0PaperSize: | (BOOL) | portrait |
Provided by category DKDrawing(Paper).
+ (NSSize) isoA1PaperSize: | (BOOL) | portrait |
Provided by category DKDrawing(Paper).
+ (NSSize) isoA2PaperSize: | (BOOL) | portrait |
Provided by category DKDrawing(Paper).
+ (NSSize) isoA3PaperSize: | (BOOL) | portrait |
Provided by category DKDrawing(Paper).
+ (NSSize) isoA4PaperSize: | (BOOL) | portrait |
Provided by category DKDrawing(Paper).
+ (NSSize) isoA5PaperSize: | (BOOL) | portrait |
Provided by category DKDrawing(Paper).
- (NSData*) JPEGDataWithProperties: | (NSDictionary *) | props |
Returns JPEG data for the drawing.
props | various parameters and properties |
Provided by category DKDrawing(Export).
- (NSData*) JPEGDataWithResolution: | (NSInteger) | dpi | |
quality: | (CGFloat) | quality | |
progressive: | (BOOL) | progressive | |
Returns JPEG data for the drawing or nil if there was a problem.
This is a convenience wrapper around the dictionary-based methods above
dpi | the resolution in dots per inch |
quality | a value 0..1 that indicates the amount of compression - 0 = max, 1 = none. |
progressive | YES if the data is progressive, NO otherwise |
Provided by category DKDrawing(Export).
- (NSArray*) layerBitmapsWithDPI: | (NSUInteger) | dpi |
Returns an array of bitmaps (NSBitmapImageReps) one per layer.
The lowest index is the bottom layer. Hidden layers and non-printing layers are excluded.
dpi | the desired resolution in dots per inch. |
Provided by category DKDrawing(Export).
- (CGFloat) leftMargin |
+ (void) loadDefaults |
Loads the static user defaults for all classes in the drawing system.
Deprecated - no longer does anything
Provided by category DKDrawing(Deprecated).
- (NSTimeInterval) lowQualityTriggerInterval |
- (BOOL) lowRenderingQuality |
- (NSData*) multipartTIFFDataWithResolution: | (NSUInteger) | dpi |
Returns TIFF data.
Each layer is written as a separate image. This is not the same as a layered TIFF however.
dpi | the desired resolution in dots per inch. |
Provided by category DKDrawing(Export).
+ (NSUInteger) newDrawingNumber |
Returns a new drawing number by incrementing the current default seed value.
- (NSPoint) nudgeOffset |
- (void) objectDidNotifyStatusChange: | (id) | object |
- (id) owner |
Returns the "owner" of this drawing.
The owner is usually either a document, a window controller or a drawing view.
- (NSColor*) paperColour |
- (BOOL) paperColourIsPrinted |
- (NSData*) pdf |
- (NSPoint) pinPointToInterior: | (NSPoint) | p |
- (NSData*) PNGDataWithProperties: | (NSDictionary *) | props |
Returns PNG data for the drawing.
props | various parameters and properties |
Provided by category DKDrawing(Export).
- (NSData*) PNGDataWithResolution: | (NSInteger) | dpi | |
gamma: | (CGFloat) | gamma | |
interlaced: | (BOOL) | interlaced | |
Provided by category DKDrawing(Export).
- (void) qualityTimerCallback: | (NSTimer *) | timer |
- (void) removeAllControllers |
Removes all controller from the drawing.
Typically controllers are removed when necessary - there is little reason to call this yourself
- (void) removeController: | (DKViewController *) | aController |
- (void) removeLayer: | (DKLayer *) | aLayer | |
andActivateLayer: | (DKLayer *) | anotherLayer | |
- (CGFloat) rightMargin |
+ (void) saveDefaults |
Saves the static class defaults for ALL classes in the drawing system.
Deprecated - no longer does anything
Provided by category DKDrawing(Deprecated).
- (void) scrollToRect: | (NSRect) | rect |
Sets the abbreviation for the given drawing units string.
This allows special abbreviations to be set for units if desired. The setting writes to the user defaults so is persistent.
abbrev | the abbreviation for the unit |
fullString | the full name of the drawing units |
- (BOOL) setActiveLayer: | (DKLayer *) | aLayer | |
withUndo: | (BOOL) | undo | |
- (void) setColourSpace: | (NSColorSpace *) | cSpace |
Sets the destination colour space for the whole drawing.
Colours set by styles and so forth are converted to this colourspace when rendering. A value of nil will use whatever is set in the colours used by the styles.
cSpace | the colour space |
+ (void) setDearchivingHelper: | (id) | helper |
Replace the default dearchiving helper for deaerchiving a drawing.
This helper is a delegate of the dearchiver during dearchiving and translates older or obsolete classes into modern ones, etc. The default helper deals with older DrawKit classes, but can be replaced to provide the same functionality for application-specific classes.
helper | a suitable helper object |
- (void) setDelegate: | (id) | aDelegate |
- (void) setDrawingInfo: | (NSMutableDictionary *) | info |
- (void) setDrawingSize: | (NSSize) | aSize |
- (void) setDrawingSizeWithPrintInfo: | (NSPrintInfo *) | printInfo |
- (void) setDrawingUnits: | (NSString *) | units | |
unitToPointsConversionFactor: | (CGFloat) | conversionFactor | |
- (void) setDynamicQualityModulationEnabled: | (BOOL) | qmEnabled |
Set whether drawing quality modulation is enabled or not.
Rasterizers are able to use a low quality drawing mode for rapid updates when DKDrawing detects the need for it. This flag allows that behaviour to be turned on or off.
- (void) setFlipped: | (BOOL) | flipped |
- (void) setLowQualityTriggerInterval: | (NSTimeInterval) | t |
- (void) setLowRenderingQuality: | (BOOL) | quickAndDirty |
- (void) setMarginsWithPrintInfo: | (NSPrintInfo *) | printInfo |
- (void) setOwner: | (id) | owner |
Sets the "owner" of this drawing.
The owner is usually either a document, a window controller or a drawing view. It is not required to be set at all, though some higher-level conveniences may depend on it.
owner | the owner for this object |
- (void) setPaperColour: | (NSColor *) | colour |
- (void) setPaperColourIsPrinted: | (BOOL) | printIt |
- (void) setSnapsToGrid: | (BOOL) | snaps |
- (void) setSnapsToGuides: | (BOOL) | snaps |
- (void) setUndoManager: | (id) | um |
- (NSSize) snapPointsToGuide: | (NSArray *) | points |
- (BOOL) snapsToGrid |
- (BOOL) snapsToGuides |
- (NSPoint) snapToGrid: | (NSPoint) | p | |
ignoringUserSetting: | (BOOL) | ignore | |
- (NSPoint) snapToGrid: | (NSPoint) | p | |
withControlFlag: | (BOOL) | snapControl | |
- (NSPoint) snapToGuides: | (NSPoint) | p |
- (void) synchronizeRulersWithUnits: | (NSString *) | unitString |
- (NSData*) thumbnailData |
Returns JPEG data for the drawing at 50% actual size, with 50% quality.
Useful for e.g. generating QuickLook thumbnails
Provided by category DKDrawing(Export).
- (NSData*) TIFFDataWithProperties: | (NSDictionary *) | props |
Returns TIFF data for the drawing.
props | various parameters and properties |
Provided by category DKDrawing(Export).
Returns TIFF data for the drawing or nil if there was a problem.
This is a convenience wrapper around the dictionary-based methods above
dpi | the resolution in dots per inch |
compType | a valid TIFF compression type (see NSBitMapImageRep.h) |
Provided by category DKDrawing(Export).
- (CGFloat) topMargin |
- (id) undoManager |
Obtains the undo manager that is handling undo for the drawing and hence, this layer.
Implements DKLayer.
- (CGFloat) unitToPointsConversionFactor |
- (NSWindow*) windowForSheet |
Provided by category DKDrawing(UISupport).
|
related |
|
related |
|
related |
|
related |
|
related |
the key for the drawing info dictionary within the user info
|
related |
|
related |
|
related |
|
related |
|
related |