You.i Engine
CYIPlatformViewProxy Class Referenceabstract

Detailed Description

A proxy representation for a platform-native view.

CYIPlatformViewProxy provides a platform agnostic proxy to an instance of a platform-specific view. The class may be used to position, resize, and grab a renderable copy of the platform view. When offered to a CYIPlatformView via CYIPlatformView::SetViewProxy, CYIPlatformViewProxy is used to synchronize the position of the native view with the CYIPlatformView. CYIPlatformView also uses the CYIPlatformViewProxy to grab a renderable representation of the native view for display on screen.

Note
This class is only available on supported mobile touch platforms: Android and iOS. Android TV and Fire TV are not supported.
It is recommended that instances be deleted with YiDeleteLater.
Warning
Android only: Currently hardware accelerated CYIPlatformViews are only supported on Android 6.0 (API 23) and higher. Below this API level the texture rendering in AUTO mode will not work properly or can have visual artifacts for hardware accelerated android views.
See also
CYIPlatformView

#include <platform/YiPlatformViewProxy.h>

Classes

class  Delegate
 CYIPlatformViewProxy delegates handling of texture updates to its Delegate. More...
 

Public Types

enum  PRESENTATION_MODE {
  TEXTURE,
  LIVE
}
 

Public Member Functions

virtual ~CYIPlatformViewProxy ()
 
virtual void OnPresentationModeChanged (PRESENTATION_MODE ePresentationMode)=0
 
virtual void SetViewRectangle (const YI_RECT_REL &viewRectangle)=0
 
virtual void SetVisibility (bool bVisible)=0
 
virtual const std::shared_ptr< CYIMaterial > & GetViewMaterial () const =0
 
virtual void SetPlatformViewHandle (const CYIPlatformViewHandle &handle)=0
 
virtual const CYIPlatformViewHandleGetPlatformViewHandle () const =0
 
virtual void SetBackgroundColor (const CYIColor &color)=0
 
void SetDelegate (Delegate *pDelegate)
 

Static Public Member Functions

static std::unique_ptr< CYIPlatformViewProxyCreateIfSupported ()
 

Public Attributes

CYISignal< const CYIPlatformViewHandle & > PlatformViewHandleSet
 

Protected Member Functions

void TextureUpdated ()
 
 CYIPlatformViewProxy ()
 

Member Enumeration Documentation

Represents how the platform view proxy is being represented.

Enumerator
TEXTURE 

The platform view proxy is being presented as a texture.

See also
GetViewMaterial
LIVE 

The platform view proxy is being represented live. Normally, this view is layered beneath the You.i Engine rendering surface. In this mode, the view is being revealed.

Constructor & Destructor Documentation

virtual CYIPlatformViewProxy::~CYIPlatformViewProxy ( )
virtual
CYIPlatformViewProxy::CYIPlatformViewProxy ( )
protected

Member Function Documentation

static std::unique_ptr<CYIPlatformViewProxy> CYIPlatformViewProxy::CreateIfSupported ( )
static

Returns a new instance of CYIPlatformViewProxy, or nullptr if unsupported on the platform. The caller obtains ownership of the returned instance.

Warning
CYIPlatformViewProxy instances must be created on You.i Engine's UI thread.
virtual const CYIPlatformViewHandle& CYIPlatformViewProxy::GetPlatformViewHandle ( ) const
pure virtual

Returns the platform-specific handle, stored within a CYIPlatformViewHandle, that is associated with this CYIPlatformViewProxy.

Note
The returned CYIPlatformViewHandle may contain a null platform view handle if the CYIPlatformViewHandle has not yet been set on this proxy. The PlatformViewHandleSet signal will be emitted when the handle has been set.
See also
SetPlatformViewHandle
virtual const std::shared_ptr<CYIMaterial>& CYIPlatformViewProxy::GetViewMaterial ( ) const
pure virtual

Returns a CYIMaterial that may be applied to a CYISceneNode, which has a CYIMesh, in order to display the contents of the platform native view. The returned material will be kept updated and may be cached.

virtual void CYIPlatformViewProxy::OnPresentationModeChanged ( PRESENTATION_MODE  ePresentationMode)
pure virtual

Notifies the platform view proxy that its presentation mode has been changed.

See also
CYIPlatformView
virtual void CYIPlatformViewProxy::SetBackgroundColor ( const CYIColor color)
pure virtual

Sets the CYIPlatformViewProxy's background color.

Note
The background color will be only visible when using live rendering and when the platform's view does not fill the entire rectangular bounds of its containing view. The platform view defaults to a transparent color and will start with this color before app initialization.
void CYIPlatformViewProxy::SetDelegate ( Delegate pDelegate)

Sets the CYIPlatformViewProxy's delegate to pDelegate. This delegate will be notified when the platform view proxy's texture data has been updated.

Note
CYIPlatformViewProxy does not take ownership of pDelegate.
virtual void CYIPlatformViewProxy::SetPlatformViewHandle ( const CYIPlatformViewHandle handle)
pure virtual

Associates this CYIPlatformViewProxy with a native platform view, whose platform-specific handle, has been stored in a CYIPlatformViewHandle.

See also
GetPlatformViewHandle
virtual void CYIPlatformViewProxy::SetViewRectangle ( const YI_RECT_REL viewRectangle)
pure virtual

Specifies the screen-space region into which the platform view should be placed. This placement is used to reveal the view when using live rendering, and also for the transmission of user events.

virtual void CYIPlatformViewProxy::SetVisibility ( bool  bVisible)
pure virtual

Specifies visibility which can be applied to the underlying platform view if desired.

void CYIPlatformViewProxy::TextureUpdated ( )
protected

Notifies the associated Delegate that the texture data has been updated. Subclasses must call this function when the texture data is modified.

Member Data Documentation

CYISignal<const CYIPlatformViewHandle &> CYIPlatformViewProxy::PlatformViewHandleSet

Emitted when the platform view handle has been set on the view proxy.


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