GlyphsToolDraw Protocol Reference
Conforms to | GlyphsToolAuxiliaryDrawing |
Declared in | GlyphsToolDrawProtocol.h |
Tasks
interfaceVersion
required methodtitle
required method– modifierChanged:
required method– willSelectTempTool:
required method– drawLayer:atPoint:asActive:attributes:
required method– drawBackgroundForLayer:
– drawBackgroundForLayer:atPoint:asActive:
– drawForegroundForLayer:
– willActivate
– willDeactivate
– drawPreview:
– inspectorViewControllers
Instance Methods
drawBackgroundForLayer:
Draws the background for the Layer.
- (void)drawBackgroundForLayer:(GSLayer
*)layer
Parameters
- layer
-
The actual GSPlainGlyph instance.
Discussion
This should be only additional items, as the actual glyph is drawn somewhere else. The drawing happend in font units scale (the view does the transformation). If you need to draw something in a definit size (text) you have to counter scale it.
See Also
drawBackgroundForLayer:atPoint:asActive:
Draws the background for the Layer.
- (void)drawBackgroundForLayer:(GSLayer *)layer
atPoint:(NSPoint)layerOrigin
asActive:(BOOL)active
Parameters
- layer
-
the layer
- layerOrigin
-
The current position in the edit view
- active
-
if the layer is currentyl active
drawForegroundForLayer:
Draws the foreground for the Layer.
- (void)drawForegroundForLayer:(GSLayer
*)layer
Parameters
- layer
-
The Layer.
Discussion
This should be only additional items, as the actual glyph is drawn somewhere else. The drawing happend in font units scale (the view does the transformation). If you need to draw something in a definit size (text) you have to counter scale it.
See Also
drawLayer:atPoint:asActive:attributes:
Draws the foreground for the Layer.
- (void)drawLayer:(GSLayer *)layer
atPoint:(NSPoint)layerOrigin
asActive:(BOOL)active attributes:(NSDictionary
*)attributes
Parameters
- layer
-
the layer
- layerOrigin
-
The current position in the edit view
- active
-
if the layer is currentyl active
- attributes
-
Some attributes
drawPreview:
Draw something is the preview
- (void)drawPreview:(NSView *)previewView
Parameters
- previewView
-
The PreviewView to draw in
Discussion
If you implement this method, the default preview drawing will be deactivated
inspectorViewControllers
Return a list of NSViewControllers to place in the inspector box.
- (NSArray *)inspectorViewControllers
modifierChanged:
Informs the receiver that the user has released the left mouse button.
- (void)modifierChanged:(NSEvent *)theEvent
Parameters
- theEvent
-
The event resulting from the user action.
willActivate
Is called when the tool becomes active
- (void)willActivate
Discussion
This might mean that the tool is clicked or the document window becomes active