DISTRHO Plugin Framework
Public Member Functions | Protected Member Functions | Friends | List of all members
TopLevelWidget Class Reference

#include <TopLevelWidget.hpp>

Inheritance diagram for TopLevelWidget:
Widget StandaloneWindow ImageBaseAboutWindow< ImageType >

Public Member Functions

 TopLevelWidget (Window &windowToMapTo)
 
 ~TopLevelWidget () override
 
ApplicationgetApp () const noexcept
 
WindowgetWindow () const noexcept
 
void setWidth (uint width)
 
void setHeight (uint height)
 
void setSize (uint width, uint height)
 
void setSize (const Size< uint > &size)
 
void repaint () noexcept override
 
void repaint (const Rectangle< uint > &rect) noexcept
 
const void * getClipboard (size_t &dataSize)
 
bool setClipboard (const char *mimeType, const void *data, size_t dataSize)
 
bool setCursor (MouseCursor cursor)
 
bool addIdleCallback (IdleCallback *callback, uint timerFrequencyInMs=0)
 
bool removeIdleCallback (IdleCallback *callback)
 
double getScaleFactor () const noexcept
 
void setGeometryConstraints (uint minimumWidth, uint minimumHeight, bool keepAspectRatio=false, bool automaticallyScale=false, bool resizeNowIfAutoScaling=true)
 
ApplicationgetParentApp () const noexcept
 
WindowgetParentWindow () const noexcept
 
- Public Member Functions inherited from Widget
virtual ~Widget ()
 
bool isVisible () const noexcept
 
void setVisible (bool visible)
 
void show ()
 
void hide ()
 
uint getWidth () const noexcept
 
uint getHeight () const noexcept
 
const Size< uint > getSize () const noexcept
 
void setWidth (uint width) noexcept
 
void setHeight (uint height) noexcept
 
void setSize (uint width, uint height) noexcept
 
void setSize (const Size< uint > &size) noexcept
 
uint getId () const noexcept
 
const char * getName () const noexcept
 
void setId (uint id) noexcept
 
void setName (const char *name) noexcept
 
ApplicationgetApp () const noexcept
 
WindowgetWindow () const noexcept
 
const GraphicsContextgetGraphicsContext () const noexcept
 
TopLevelWidgetgetTopLevelWidget () const noexcept
 
std::list< SubWidget * > getChildren () const noexcept
 
ApplicationgetParentApp () const noexcept
 
WindowgetParentWindow () const noexcept
 

Protected Member Functions

bool onKeyboard (const KeyboardEvent &) override
 
bool onCharacterInput (const CharacterInputEvent &) override
 
bool onMouse (const MouseEvent &) override
 
bool onMotion (const MotionEvent &) override
 
bool onScroll (const ScrollEvent &) override
 
- Protected Member Functions inherited from Widget
virtual void onDisplay ()=0
 
virtual void onResize (const ResizeEvent &)
 
virtual bool onSpecial (const SpecialEvent &)
 

Friends

class Window
 

Detailed Description

Top-Level Widget class.

This is the only Widget class that is allowed to be used directly on a Window.

This widget takes the full size of the Window it is mapped to. Sub-widgets can be added on top of this top-level widget, by creating them with this class as parent. Doing so allows for custom position and sizes.

This class is used as the type for DPF Plugin UIs. So anything that a plugin UI might need that does not belong in a simple Widget will go here.

Constructor & Destructor Documentation

◆ TopLevelWidget()

TopLevelWidget::TopLevelWidget ( Window windowToMapTo)
explicit

Constructor.

◆ ~TopLevelWidget()

TopLevelWidget::~TopLevelWidget ( )
override

Destructor.

Member Function Documentation

◆ getApp()

Application& TopLevelWidget::getApp ( ) const
noexcept

Get the application associated with this top-level widget's window.

◆ getWindow()

Window& TopLevelWidget::getWindow ( ) const
noexcept

Get the window associated with this top-level widget.

◆ setWidth()

void TopLevelWidget::setWidth ( uint  width)

Set width of this widget's window.

Note
This will not change the widget's size right away, but be pending on the OS resizing the window

◆ setHeight()

void TopLevelWidget::setHeight ( uint  height)

Set height of this widget's window.

Note
This will not change the widget's size right away, but be pending on the OS resizing the window

◆ setSize() [1/2]

void TopLevelWidget::setSize ( uint  width,
uint  height 
)

Set size of this widget's window, using width and height values.

Note
This will not change the widget's size right away, but be pending on the OS resizing the window

◆ setSize() [2/2]

void TopLevelWidget::setSize ( const Size< uint > &  size)

Set size of this widget's window.

Note
This will not change the widget's size right away, but be pending on the OS resizing the window

◆ repaint() [1/2]

void TopLevelWidget::repaint ( )
overridevirtualnoexcept

TODO document this.

Reimplemented from Widget.

◆ repaint() [2/2]

void TopLevelWidget::repaint ( const Rectangle< uint > &  rect)
noexcept

TODO document this.

◆ onKeyboard()

bool TopLevelWidget::onKeyboard ( const KeyboardEvent )
overrideprotectedvirtual

A function called when a key is pressed or released.

Returns
True to stop event propagation, false otherwise.

Reimplemented from Widget.

◆ onCharacterInput()

bool TopLevelWidget::onCharacterInput ( const CharacterInputEvent )
overrideprotectedvirtual

A function called when an UTF-8 character is received.

Returns
True to stop event propagation, false otherwise.

Reimplemented from Widget.

◆ onMouse()

bool TopLevelWidget::onMouse ( const MouseEvent )
overrideprotectedvirtual

A function called when a mouse button is pressed or released.

Returns
True to stop event propagation, false otherwise.

Reimplemented from Widget.

◆ onMotion()

bool TopLevelWidget::onMotion ( const MotionEvent )
overrideprotectedvirtual

A function called when the pointer moves.

Returns
True to stop event propagation, false otherwise.

Reimplemented from Widget.

◆ onScroll()

bool TopLevelWidget::onScroll ( const ScrollEvent )
overrideprotectedvirtual

A function called on scrolling (e.g. mouse wheel or track pad).

Returns
True to stop event propagation, false otherwise.

Reimplemented from Widget.


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