Objective-C API Library Reference  4.3.0-42-g45f162a
 All Classes Functions Typedefs Properties Pages
Public Functions | Properties | List of all members
PWViewRenderer Class Reference

The base class for custom ViewRenderer implementations. By itself, this class will render nothing. A view renderer takes binary input data representing the content of the view and renders it to the view. The default view renderer is PWImageRenderer. You can also create your own renderer using this class; this would be useful for instance to add support codecs not currently supported by PureWeb, or to replace existing render paths with custom alternatives.

Constructors

(id) - initWithView:
 

Public Functions

(void) - activate
 
(void) - clear
 
(void) - deactivate
 
(CGPoint) - localToNormalized:
 
(CGPoint) - localToSource:
 
(CGPoint) - normalizedToLocal:
 
(PWXmlElement *) - profilerInfo
 
(void) - renderBytes:bytes:encodingParameters:
 
(CGPoint) - sourceToLocal:
 

Properties

PWEventPublisher * activated
 
PWEventPublisher * deactivated
 
PWMatrix * localToNormalizedTransform
 
PWMatrix * localToSourceTransform
 
PWMatrix * normalizedToLocalTransform
 
PWRectangle * sourceSize
 
PWEventPublisher * sourceSizeChanged
 
PWMatrix * sourceToLocalTransform
 
CALayer * target
 
PWEventPublisher * transformsChanged
 
PWRectangle * viewSize
 
PWEventPublisher * viewSizeChanged
 
PWEventPublisher * viewUpdated
 

Methods Descriptions

- (void) activate

Called when a ViewRenderer is being used by a view. The intention is that ViewRenderer implementation will add subComponents to its target for display when activated. It is best to use the ViewRendererEvent.ACTIVATED event in ViewRenderer implementations rather than overriding this method. If you override this method, you MUST call the base method first.

- (void) clear

Clears the view image data. It is HIGHLY recommended that your implementation override this method in order to properly clear the display.

- (void) deactivate

Called when a ViewRenderer will stop being used by the view. The intention is that ViewRenderer implementation will remove subComponents from the target. It is best to use the ViewRendererEvent.DEACTIVATED event in ViewRenderer implementations rather than overring this method. If you override this method, you MUST call the base method last.

- (id) initWithView: (CALayer *)  target

Creates a new ViewRenderer and attaches it to the specified target view.

- (CGPoint) localToNormalized: (CGPoint)  local

Converts a point from local coordinates to normalized coordinates.

- (CGPoint) localToSource: (CGPoint)  local

Converts a point from local coordinates to coordinates of the back buffer image (source coordinates).

- (CGPoint) normalizedToLocal: (CGPoint)  normalized

Converts a point from normalized coordinates to local coordinates.

- (PWXmlElement *) profilerInfo

This profiler information will be attached to the view profiler information when the view is attached.

Reimplemented from <PWProfilerDelegate>.

- (void) renderBytes: (NSString *)  mimeType
bytes: (NSData *)  bytes
encodingParameters: (NSDictionary *)  encodingParameters 

Called when bytes are received and should be renderered. It is HIGHLY recommended to override this method in your implementation to render display data.

Parameters
mimeTypeThe mime type defined when this ViewRenderer was registered.
bytesThe data to be renderered.
encodingParametersA dictionary of parameters set by the service for this encoded data.
- (CGPoint) sourceToLocal: (CGPoint)  source

Converts a point from image (source) coordinates to local coordinates.

Properties Descriptions

- (PWEventPublisher*) activated
readwritenonatomicstrong

The event that will get dispatched when this renderer is added to a view.

- (PWEventPublisher*) deactivated
readwritenonatomicstrong

The event that will get dispatched when this renderer is removed from a view.

- (PWMatrix*) localToNormalizedTransform
readnonatomicstrong

The matrix used for localToNormalized transforms. (Useful for render operations.)

- (PWMatrix*) localToSourceTransform
readnonatomicstrong

The matrix used for localToSource transforms. (Useful for render operations.)

- (PWMatrix*) normalizedToLocalTransform
readnonatomicstrong

The matrix used for normalizedToLocal transforms. (Useful for render operations.)

- (PWRectangle*) sourceSize
readwritenonatomicstrong

The size of the corresponding view on the service. This is related to the ClientSize property on the service view.

- (PWEventPublisher*) sourceSizeChanged
readwritenonatomicstrong

The event that will get dispatched when imageSize is set.

- (PWMatrix*) sourceToLocalTransform
readnonatomicstrong

The matrix used for sourceToLocal transforms. (Useful for render operations.)

- (CALayer*) target
readnonatomicstrong

The PWView that is the target of the rendering.

- (PWEventPublisher*) transformsChanged
readwritenonatomicstrong

The event that will get dispatched when viewToSource or viewToNormalized transforms change.

- (PWRectangle*) viewSize
readnonatomicstrong

The size of the target area for this view. Your implementation should render to this size.

- (PWEventPublisher*) viewSizeChanged
readwritenonatomicstrong

The event that will get dispatched when the target view of this renderer resizes.

- (PWEventPublisher*) viewUpdated
readwritenonatomicstrong

The event that will get dispatched when the view display is updated to inform the view.