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

The PWView class provides methods to display the graphics streamed from the service application, and to remote input events (mouse, resize) that occur when the end user interacts with these views. View Controllers in your iOS client requiring this functionality must extend this PWView class.

Constructors

(id) - initWithFramework:
 
(id) - initWithFramework:frame:
 

Public Functions

(void) - attachView
 
(void) - clearView
 
(void) - detachView
 
(CGPoint) - localToNormalized:
 
(CGPoint) - normalizedToLocal:
 
(BOOL viewScalesWithScreen) - PW_DEPRECATED_PROPERTY_USE
 
(void) - queueMouseDown:modifiers:x:y:
 
(void) - queueMouseEnter:y:
 
(void) - queueMouseEvent:
 
(void) - queueMouseEvent:x:y:button:modifiers:
 
(void) - queueMouseLeave:y:
 
(void) - queueMouseMove:modifiers:x:y:
 
(void) - queueMouseUp:modifiers:x:y:
 
(void) - refresh
 
(void) - resize
 
(CGPoint) - sourceToLocal:
 
(void) - updateEncoderConfiguration
 

Properties

PWAcetateToolsetacetateToolset
 
PWLazySimpleValueProfilerclientSizeHeight
 
PWLazySimpleValueProfilerclientSizeWidth
 
CGRect contentFrame
 
id< PWViewDelegatedelegate
 
PWEncoderConfigurationencoderConfiguration
 
NSInteger encodingQuality
 
PWLazySimpleValueProfilerencodingType
 
PWFrequencyProfilerfps
 
IBOutlet PWFrameworkframework
 
NSUInteger imageHeight
 
PWEventPublisher * imageSizeChanged
 
NSUInteger imageWidth
 
BOOL inputTransmissionEnabled
 
PWEventTimerProfilerinteractionTimer
 
BOOL isViewConnected
 
PWEventPublisher * isViewConnectedChanged
 
PWRateProfilermbps
 
PWEventPublisher * mouseEventFiring
 
PWEventPublisher * mouseEventQueued
 
CGFloat pointScale
 
PWLazySimpleValueProfilerserviceSizeHeight
 
PWLazySimpleValueProfilerserviceSizeWidth
 
PWEventPublisher * transformsChanged
 
NSString * viewName
 
PWEventPublisher * viewNameChanged
 
PWEventPublisher * viewUpdated
 
BOOL viewUsesPointScale
 

Methods Descriptions

- (void) attachView

Connects the view to the service application and adds multipart handlers; this is a helper method.

- (void) clearView

Clears the current view, so that it no longer displays any image.

- (void) detachView

Disconnects the view from the service application and removes multipart handlers; this is a helper method.

- (id) initWithFramework: (PWFramework *)  framework

Initializes a new instance of PWView with a framework and a zeroed frame.

- (id) initWithFramework: (PWFramework *)  framework
frame: (CGRect)  frame 

Initializes a new instance of PWView with a framework and a frame.

Parameters
frameworkThe PWFramework to use.
frameThe core graphics frame to use.
- (CGPoint) localToNormalized: (CGPoint)  local

Converts a point from local coordinates to normalized coordinates.

If the normalized coordinate is not between 0 and 1 inclusive, it is off the image.

- (CGPoint) normalizedToLocal: (CGPoint)  normalized

Converts a point from normalized coordinates to local coordinates.

- (BOOL viewScalesWithScreen) PW_DEPRECATED_PROPERTY_USE (5.)  0
(viewUsesPointScale  

A Boolean value that indicates whether the view will observe screen scaling. A value of YES means that the view sizes and interacts in pixels instead of points. This is needed to use the full resolution on retina displays. Changing this property will cause a resize call, resulting in a full image download.

- (void) queueMouseDown: (NSInteger)  button
modifiers: (NSInteger)  modifiers
x: (NSInteger)  x
y: (NSInteger)  y 

Sends a MouseDown command to the service application. Useful to simultate mouse input on a touch device.

Parameters
buttonThe mouse button.
modifiersThe keyboard modifiers (Shift, Control, etc), if any.
xThe x coordinate of the mouse cursor.
yThe y coordinate of the mouse cursor.
- (void) queueMouseEnter: (NSInteger)  x
y: (NSInteger)  y 

Sends a MouseEnter command to the service application. Useful to simultate mouse input on a touch device.

Parameters
xThe x coordinate of the mouse cursor.
yThe y coordinate of the mouse cursor.
- (void) queueMouseEvent: (PWMouseEventArgs *)  eventArgs

Sends a mouse command to the service application. Useful to simultate mouse input on a touch device.

Parameters
eventArgsThe arguments to include with the command, such as the mouse pointer coordinates and the mouse buttons.
- (void) queueMouseEvent: (NSString *)  event
x: (NSInteger)  x
y: (NSInteger)  y
button: (NSInteger)  button
modifiers: (NSInteger)  modifiers 

Sends a mouse command to the service application. Useful to simultate mouse input on a touch device.

Parameters
eventThe type of mouse event to simultate in the command (MouseEventTypeMouseUp, MouseEventTypeMouseDown, etc.)
xThe x coordinate of the mouse cursor.
yThe y coordinate of the mouse cursor.
buttonThe mouse button.
modifiersThe keyboard modifiers (Shift, Control, etc), if any.
- (void) queueMouseLeave: (NSInteger)  x
y: (NSInteger)  y 

Sends a MouseLeave command to the service application. Useful to simultate mouse input on a touch device.

Parameters
xThe x coordinate of the mouse cursor.
yThe y coordinate of the mouse cursor.
- (void) queueMouseMove: (NSInteger)  button
modifiers: (NSInteger)  modifiers
x: (NSInteger)  x
y: (NSInteger)  y 

Sends a MouseMove command to the service application. Useful to simultate mouse input on a touch device.

Parameters
buttonThe mouse button.
modifiersThe keyboard modifiers (Shift, Control, etc), if any.
xThe x coordinate of the mouse cursor.
yThe y coordinate of the mouse cursor.
- (void) queueMouseUp: (NSInteger)  button
modifiers: (NSInteger)  modifiers
x: (NSInteger)  x
y: (NSInteger)  y 

Sends a MouseUp command to the service application. Useful to simultate mouse input on a touch device.

Parameters
buttonThe mouse button.
modifiersThe keyboard modifiers (Shift, Control, etc), if any.
xThe x coordinate of the mouse cursor.
yThe y coordinate of the mouse cursor.
- (void) refresh

Sends to the service application a command to refresh the view.

See also the RefreshView method in the service's ViewManager class.

- (void) resize

Sends to the service application a command to resize the view.

- (CGPoint) sourceToLocal: (CGPoint)  coordinate

Transforms a coordinate from the source application's coordinate space to local view coordinate space.

- (void) updateEncoderConfiguration

Causes the view to update its encoder configuration.

Properties Descriptions

- (PWAcetateToolset*) acetateToolset
readwritenonatomicstrong

The acetate toolset for this view, or null if there is none. For more information on acetate, see PWAcetateToolDelegate.

- (PWLazySimpleValueProfiler*) clientSizeHeight
readnonatomicstrong

A simple value profiler that provides the height of the client-side view.

- (PWLazySimpleValueProfiler*) clientSizeWidth
readnonatomicstrong

A simple value profiler that provides the width of the client-side view.

- (CGRect) contentFrame
readnonatomicassign

Fired when the size of the view has changed.

- (id<PWViewDelegate>) delegate
readwritenonatomicweak

The delegate used to control configuration of this view.

- (PWEncoderConfiguration*) encoderConfiguration
readnonatomicstrong

The encoder configuration that the client uses for this view.

- (NSInteger) encodingQuality
readnonatomicassign

The encoding quality of the content in the last view update.

- (PWLazySimpleValueProfiler*) encodingType
readnonatomicstrong

The mime type of the last encoded frame.

- (PWFrequencyProfiler*) fps
readnonatomicstrong

A profiler that measures the rate at which the view's display is updated.

- (IBOutlet PWFramework*) framework
readwritenonatomicweak

The client application's framework instance.

- (NSUInteger) imageHeight
readnonatomicassign

The height of the last image received from the service application, in pixels.

- (PWEventPublisher*) imageSizeChanged
readwritenonatomicstrong

The event that is dispatched when the view's image size changes.

- (NSUInteger) imageWidth
readnonatomicassign

The width of the last image received from the service application, in pixels.

- (BOOL) inputTransmissionEnabled
readwritenonatomicassign

A Boolean value that indicates whether the view will send interactive mouse and keyboard events to the service application.

- (PWEventTimerProfiler*) interactionTimer
readnonatomicstrong

A profiler that measures the time taken to process all mouse and keyboard events.

- (BOOL) isViewConnected
readnonatomicassign

A Boolean value that indicates whether this view is connected.

- (PWEventPublisher*) isViewConnectedChanged
readwritenonatomicstrong

The event that is dispatched when the view's connection status changes.

- (PWRateProfiler*) mbps
readnonatomicstrong

A profiler that records the total rate of incoming imaging data in Mbps.

- (PWEventPublisher*) mouseEventFiring
readwritenonatomicstrong

The event that is dispatched before a mouse event is sent to the service, to allow individual events to be cancelled.

- (PWEventPublisher*) mouseEventQueued
readwritenonatomicstrong

The event that is dispatched after a mouse input command is created, but before it is transmitted to the service.

- (CGFloat) pointScale
readnonatomicassign

The point scale value used when drawing.

See Also
PWView::viewUsesPointScale.
- (PWLazySimpleValueProfiler*) serviceSizeHeight
readnonatomicstrong

A simple value profiler that provides the height of the service-side view.

- (PWLazySimpleValueProfiler*) serviceSizeWidth
readnonatomicstrong

A simple value profiler that provides the width of the service-side view.

- (PWEventPublisher*) transformsChanged
readwritenonatomicstrong

The event that is dispatched when the source or client geometery has changed.

- (NSString*) viewName
readwritenonatomicstrong

The name of the view. This name was set on the service application when the view was first registered.

- (PWEventPublisher*) viewNameChanged
readwritenonatomicstrong

The event that is dispatched when the view's name is changed.

- (PWEventPublisher*) viewUpdated
readwritenonatomicstrong

The event that is dispatched when a view is updated with a new image.

- (BOOL) viewUsesPointScale
readwritenonatomicassign

A Boolean value that indicates whether this view uses points for scaling. The default value is YES. If you wish to disable support for retina-sized views, then you would set this to NO. There can be a significant performance hit when using retina as image data.

When the value is set to YES, this view and all its subviews and renderers will use point scaling for drawing. In this case, views will be sized at their specified retina size. See pointScale to get access to the current point scale value being used. When the value is set to NO, the view will not use point scaling.

Note
Changing this property will cause a resize call, resulting in a full image download.
See Also
Apple's High Resolution guide specifically relating to handling content scale in custom views and layers, here.
PWView::pointScale