Ginga  0.13.6.2086-83aa
The iTV middleware.
GingaCefHandler Class Reference

A render handler class of CEF for Ginga. More...

#include <PlayerHTML.h>

Inheritance diagram for GingaCefHandler:
Collaboration diagram for GingaCefHandler:

Public Member Functions

 GingaCefHandler (int width, int height, SDL_Renderer *renderer)
 Default constructor for GingaCefHandler. More...
 
virtual ~GingaCefHandler ()
 Default destructor for GingaCefHandler. More...
 
int getWidth ()
 Return the current window width. More...
 
void setWidth (int width)
 Set the current window width. More...
 
int getHeight ()
 Return the current window height. More...
 
void setHeight (int height)
 Set the current window height. More...
 
SDL_Renderer * getRenderer ()
 Return the current renderer. More...
 
void setRenderer (SDL_Renderer *renderer)
 Set the current renderer. More...
 
SDL_Texture * getTexture ()
 Return the local texture. More...
 
bool GetViewRect (CefRefPtr< CefBrowser > browser, CefRect &rect) override
 Set the view rectangle. More...
 
void OnPaint (CefRefPtr< CefBrowser > browser, PaintElementType type, const RectList &dirtyRects, const void *buffer, int width, int height) override
 Paint an element. More...
 

Private Attributes

int _width
 Keep the current window width.
 
int _height
 Keep the current window height.
 
SDL_Texture * _texture
 Keep the local texture.
 
SDL_Renderer * _renderer
 Keep the current renderer.
 

Detailed Description

A render handler class of CEF for Ginga.

This class is responsible for copying the page load result to a local SDL texture.

Constructor & Destructor Documentation

◆ GingaCefHandler()

GingaCefHandler::GingaCefHandler ( int  width,
int  height,
SDL_Renderer *  renderer 
)

Default constructor for GingaCefHandler.

Parameters
widthThe window width.
heightThe window height.
rendererThe renderer.
Returns
Nothing.

◆ ~GingaCefHandler()

GingaCefHandler::~GingaCefHandler ( )
virtual

Default destructor for GingaCefHandler.

Returns
Nothing.

Member Function Documentation

◆ getHeight()

int GingaCefHandler::getHeight ( )

Return the current window height.

Returns
The current window height.

◆ getRenderer()

SDL_Renderer * GingaCefHandler::getRenderer ( )

Return the current renderer.

Returns
The current renderer.

◆ getTexture()

SDL_Texture * GingaCefHandler::getTexture ( )

Return the local texture.

Returns
The texture.

◆ GetViewRect()

bool GingaCefHandler::GetViewRect ( CefRefPtr< CefBrowser >  browser,
CefRect &  rect 
)
override

Set the view rectangle.

Parameters
browserA browser instance.
rectThe view rectangle to be set.
Returns
The rectangle status.

"Called to retrieve the view rectangle which is relative to screen c\oordinates. Return **true** if the rectangle was provided." (copying from CEF documentation).

◆ getWidth()

int GingaCefHandler::getWidth ( )

Return the current window width.

Returns
The current window width.

◆ OnPaint()

void GingaCefHandler::OnPaint ( CefRefPtr< CefBrowser >  browser,
PaintElementType  type,
const RectList &  dirtyRects,
const void *  buffer,
int  width,
int  height 
)
override

Paint an element.

Parameters
browserA browser instance.
typeThe element type (view or widget).
dirtyRectsSet of rectangle that need to be repainted.
bufferThe pixel data of whole image.
widthThe image width.
heightThe image height.
Returns
Nothing.

"Called when an element should be painted." (copying from CEF documentation).

◆ setHeight()

void GingaCefHandler::setHeight ( int  height)

Set the current window height.

Returns
Nothing.
See also
setWidth(), setRenderer() and getTexture().

The window height is used to create the local texture.

◆ setRenderer()

void GingaCefHandler::setRenderer ( SDL_Renderer *  renderer)

Set the current renderer.

Returns
Nothing.
See also
setWidth(), setHeight() and getTexture().

This method also create a new instance of the local texture based on the width and height values and the renderer itself.

◆ setWidth()

void GingaCefHandler::setWidth ( int  width)

Set the current window width.

Returns
Nothing.
See also
setHeight(), setRenderer() and getTexture().

The window width is used to create the local texture.


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