picofuse-objc

Instance Methods | List of all members
NXGraphicsContext Class Reference

What a display is drawn with, while it's being drawn: a display gives it to its delegate's -display:drawRect:inContext:, and it can't be drawn with after that returns. More...

#import <Graphics/Graphics.h>

Inheritance diagram for NXGraphicsContext:
Inheritance graph
[legend]
Collaboration diagram for NXGraphicsContext:
Collaboration graph
[legend]

Instance Methods

(NXSize) - size
 Returns the size of what's drawn on, which is the display's.
 
(BOOL) - blending
 Returns YES if a color with an opacity under 1 is blended, the default, or NO if it replaces what's there.
 
(void) - setBlending:
 Sets whether a color with an opacity under 1 is blended, or replaces what's there. More...
 
(void) - fillWithColor:
 Fills everything with a color.
 
(void) - fillRect:withColor:
 Fills a rectangle with a color.
 
(void) - drawLineFrom:to:withColor:
 Draws a line one pixel wide, including both ends.
 
(void) - setColor:atPoint:
 Sets a pixel to a color.
 
(NXColor *) - colorAtPoint:
 Returns the color of a pixel, or nil if it's outside, or it isn't drawing.
 
- Instance Methods inherited from NXObject
(void) - dealloc
 Frees the instance. More...
 
(NXZone *) - zone
 Returns the zone in which the instance was allocated. More...
 
(id) - retain
 Increases the retain count of the receiver. More...
 
(void) - release
 Decreases the retain count of the receiver. More...
 
(id) - autorelease
 Releases the receiver later, when the current autorelease pool of the thread is drained. More...
 
(id) - copy
 Returns a copy which can't be changed by anything else, which the caller owns and has to release. More...
 
(uintptr_t) - hash
 Returns a number for the object, which is the same for objects which are equal by isEqual:. More...
 
(NXString *) - description
 Returns a string which describes the instance, for logging. More...
 
- Instance Methods inherited from Object
(id) - init
 Initialize the instance, after allocation. More...
 
(Class) - class
 Returns the class of the instance. More...
 
(Class) - superclass
 Returns the superclass of the instance. More...
 
(BOOL) - isEqual:
 Compares the receiver to another object for equality. More...
 
(BOOL) - isKindOfClass:
 Returns a Boolean value that indicates whether the receiver is an instance of a given class. More...
 
(BOOL) - conformsTo:
 Checks if the receiver's class conforms to a protocol. More...
 
- Instance Methods inherited from <ObjectProtocol>
(BOOL) - respondsToSelector:
 Checks if the receiver responds to a selector. More...
 

Additional Inherited Members

- Class Methods inherited from NXObject
(id) + alloc
 Allocates a new instance in the default zone, or if there isn't one, with sys_calloc(). More...
 
(id) + allocWithZone:
 Allocates a new instance in a specific zone. More...
 
(id) + new
 Allocates and initializes a new instance, as [[cls alloc] init] does. More...
 
(NXString *) + description
 Returns the name of the class.
 
- Class Methods inherited from Object
(void) + initialize
 Performs one-time initialization for the class. More...
 
(Class) + class
 Returns the class object. More...
 
(Class) + superclass
 Returns the superclass of the class. More...
 
(const char *) + name
 Returns the name of the class. More...
 
(BOOL) + conformsTo:
 Checks if the class conforms to a protocol. More...
 
- Protected Attributes inherited from Object
Class isa
 A pointer to the object's class structure. More...
 

Detailed Description

What a display is drawn with, while it's being drawn: a display gives it to its delegate's -display:drawRect:inContext:, and it can't be drawn with after that returns.

Drawing is clipped to the display. A color with an opacity under 1 is blended onto what's there, unless blending is turned off, when it replaces it. A display which has fewer colors, such as an e-ink one, shows the nearest it has.

- (void)display:(NXDisplay *)display drawRect:(NXRect)rect inContext:(NXGraphicsContext *)context {
[context fillRect:NXMakeRect(10, 10, 40, 20) withColor:[NXColor redColor]];
[context drawLineFrom:NXMakePoint(0, 0) to:NXMakePoint(50, 50) withColor:[NXColor blackColor]];
}

Definition at line 28 of file NXGraphicsContext.h.

Method Documentation

◆ setBlending:()

- (void) setBlending: (BOOL)  blending

Sets whether a color with an opacity under 1 is blended, or replaces what's there.

It's YES again each time a display is drawn.


The documentation for this class was generated from the following file: