Loading...
Searching...
No Matches
Overlayabstract

#include <AppCore/Overlay.h>

Overview

Web-content overlay, displays a web-page within a portion of a Window.

Overlays are used to display web-based content in a portion of a window. They automatically forward input events to the underlying View instance and handle rendering.

Creating an Overlay

Call Overlay::Create() to create an overlay in a window.

auto overlay = Overlay::Create(window, 1024, 768, 0, 0);
static RefPtr< Overlay > Create(RefPtr< Window > window, uint32_t width, uint32_t height, int x, int y)
Create a new Overlay.

Loading Content into an Overlay

Each Overlay has a View instance that you can use to load web content into.

overlay->view()->LoadURL("https://google.com");
Inheritance diagram for Overlay:
RefCounted

Static Public Member Functions

static RefPtr< OverlayCreate (RefPtr< Window > window, uint32_t width, uint32_t height, int x, int y)
 Create a new Overlay.
 
static RefPtr< OverlayCreate (RefPtr< Window > window, RefPtr< View > view, int x, int y)
 Create a new Overlay, wrapping an existing View.
 

Public Member Functions

virtual ultralight::RefPtr< ultralight::Viewview ()=0
 Get the underlying View.
 
virtual uint32_t width () const =0
 Get the width (in pixels).
 
virtual uint32_t height () const =0
 Get the height (in pixels).
 
virtual int x () const =0
 Get the x-position (offset from the left of the Window), in pixels.
 
virtual int y () const =0
 Get the y-position (offset from the top of the Window), in pixels.
 
virtual bool is_hidden () const =0
 Whether or not the overlay is hidden (not drawn).
 
virtual void Hide ()=0
 Hide the overlay (will no longer be drawn)
 
virtual void Show ()=0
 Show the overlay.
 
virtual bool has_focus () const =0
 Whether or not this overlay has keyboard focus.
 
virtual void Focus ()=0
 Grant this overlay exclusive keyboard focus.
 
virtual void Unfocus ()=0
 Remove keyboard focus.
 
virtual void MoveTo (int x, int y)=0
 Move the overlay to a new position (in pixels).
 
virtual void Resize (uint32_t width, uint32_t height)=0
 Resize the overlay (and underlying View), dimensions should be specified in pixels.
 
virtual bool NeedsRepaint ()=0
 Whether or not this Overlay needs repaint (either it has moved, resized, or the internal View needs repaint).
 
- Public Member Functions inherited from RefCounted
virtual void AddRef () const =0
 
virtual void Release () const =0
 
virtual int ref_count () const =0
 

Protected Member Functions

virtual ~Overlay ()
 
virtual void Render ()=0
 
virtual void Paint ()=0
 
- Protected Member Functions inherited from RefCounted
virtual ~RefCounted ()
 

Friends

class OverlayManager
 

Constructor & Destructor Documentation

◆ ~Overlay()

virtual ~Overlay ( )
protectedvirtual

Member Function Documentation

◆ Create() [1/2]

static RefPtr< Overlay > Create ( RefPtr< Window > window,
RefPtr< View > view,
int x,
int y )
static

Create a new Overlay, wrapping an existing View.

Parameters
windowThe window to create the Overlay in.
viewThe View to wrap (will use its width and height).
xThe x-position (offset from the left of the Window), in pixels.
yThe y-position (offset from the top of the Window), in pixels.

◆ Create() [2/2]

static RefPtr< Overlay > Create ( RefPtr< Window > window,
uint32_t width,
uint32_t height,
int x,
int y )
static

Create a new Overlay.

Parameters
windowThe window to create the Overlay in.
widthThe width in pixels.
heightThe height in pixels.
xThe x-position (offset from the left of the Window), in pixels.
yThe y-position (offset from the top of the Window), in pixels.

◆ Focus()

virtual void Focus ( )
pure virtual

Grant this overlay exclusive keyboard focus.

◆ has_focus()

virtual bool has_focus ( ) const
pure virtual

Whether or not this overlay has keyboard focus.

◆ height()

virtual uint32_t height ( ) const
pure virtual

Get the height (in pixels).

◆ Hide()

virtual void Hide ( )
pure virtual

Hide the overlay (will no longer be drawn)

◆ is_hidden()

virtual bool is_hidden ( ) const
pure virtual

Whether or not the overlay is hidden (not drawn).

◆ MoveTo()

virtual void MoveTo ( int x,
int y )
pure virtual

Move the overlay to a new position (in pixels).

◆ NeedsRepaint()

virtual bool NeedsRepaint ( )
pure virtual

Whether or not this Overlay needs repaint (either it has moved, resized, or the internal View needs repaint).

◆ Paint()

virtual void Paint ( )
protectedpure virtual

◆ Render()

virtual void Render ( )
protectedpure virtual

◆ Resize()

virtual void Resize ( uint32_t width,
uint32_t height )
pure virtual

Resize the overlay (and underlying View), dimensions should be specified in pixels.

◆ Show()

virtual void Show ( )
pure virtual

Show the overlay.

◆ Unfocus()

virtual void Unfocus ( )
pure virtual

Remove keyboard focus.

◆ view()

virtual ultralight::RefPtr< ultralight::View > view ( )
pure virtual

Get the underlying View.

◆ width()

virtual uint32_t width ( ) const
pure virtual

Get the width (in pixels).

◆ x()

virtual int x ( ) const
pure virtual

Get the x-position (offset from the left of the Window), in pixels.

◆ y()

virtual int y ( ) const
pure virtual

Get the y-position (offset from the top of the Window), in pixels.

Friends And Related Symbol Documentation

◆ OverlayManager

friend class OverlayManager
friend

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