Main class to inherit from. Acts ast the root of the widget tree, and provides generic access to the hardware through the painter and presser objects.
More...
#include <controller.hpp>
|
| void | update () override final |
| void | add_held (base_widget *widget) override final |
| void | remove_held (base_widget *widget) override final |
| void | handle_painter (painter &painter) const override final |
| bool | handle_presser (presser &presser) override final |
|
void | on_Shift (auto &p) |
| | Empty funciton acting as a workaround, ensuring it is always defined in the controller.
|
|
| base_controller (std::unique_ptr< base_hardware > &&hardware) |
|
void | on_Delete (button_presser &p) |
| | Handles presses on buttons labeled Delete.
|
|
void | local_repaint (base_widget *widget) |
| | Triggers the painting of the widget pointed to by the parameter.
|
| double | get_horizontal_scale () const noexcept |
| | Retrieves the horizontal scale value.
|
| double | get_vertical_scale () const noexcept |
| | Retrieves the vertical scale value.
|
| bool | handle_Delete () override final |
|
| base_container_widget (base_container_widget *parent) |
| const std::vector< base_widget * > & | get_held () const |
| | Retrieves all held widgets, including duplicates.
|
| std::vector< base_widget * > | get_unique_held () const |
| | Retrieves held widgets, filtering out duplicates.
|
| std::vector< base_widget * > | get_deepest_held () |
| | Retrieves all held items that do not have child held widgets i.e. the deepest held widget in the hierarchy.
|
| void | remove_widget (base_widget *widget) |
| | Removes a child widget.
|
| base_container_widget * | get_parent () const |
| | Retrieves the parent widget.
|
| base_controller * | get_root () const |
| | Retrieves the root widget.
|
|
int | get_x () const |
|
int | get_y () const |
|
void | set_x (int new_x) |
|
void | set_y (int new_y) |
|
int | get_width () const |
|
int | get_height () const |
|
void | set_width (int new_width) |
|
void | set_height (int new_height) |
|
void | set_size (int new_size) |
|
void | set (int new_x, int new_y) |
|
void | set (int new_x, int new_y, int new_width, int new_height) |
|
const point & | get_top_left () const |
|
const point & | get_bottom_right () const |
|
void | set_top_left (point &&new_top_left) |
|
void | set_bottom_right (point &&new_bottom_right) |
|
|
| controller (std::string_view device_name) |
| void | repaint () override final |
| | Calls for this widget to be repainted.
|
| bool | handle_child_Delete () override final |
| | garanties that ctrlr_deleter::recursive_child_Delete returns
|
|
| base_controller (std::unique_ptr< base_hardware > &&hardware) |
| void | increment_horizontal_scale (double scale_inc) |
| | Increments the horizontal scale value.
|
| void | increment_vertical_scale (double scale_inc) |
| | Increments the vertical scale value.
|
| void | set_horizontal_scale (double scale) |
| | Set the horizontal scale value.
|
| void | set_vetical_scale (double scale) |
| | Set the vertical scale value.
|
template<typename T, typename ... Args>
requires std::derived_from<T, base_widget> |
| base_widget * | add_widget (Args &...args) |
| | Create and add a child widget.
|
template<typename T, typename ... Args>
requires std::derived_from<T, base_widget> |
| base_widget * | add_widget (Args &&...args) |
| | Create and add a child widget.
|
template<class Pred>
requires (!std::derived_from<std::remove_pointer_t<Pred> , base_widget>) |
| base_widget * | remove_widget (Pred pred) |
| | Removes a child widget.
|
|
| base_widget (base_container_widget *parent) |
| virtual bool | overlap (rectangle &other) const |
| | Checks whether this rectangle overlaps with another. This funciton is the bassis for handling inputs on the grid. The presser object also inherits from rectangle, and this function is called to check if a press event overlaps with a widget. If so, we can determine that this particular widget is pressed. Custom widgets can override this funciton for a more fine grained handling of presses.
|
template<typename T>
struct bugui::controller< T >
Main class to inherit from. Acts ast the root of the widget tree, and provides generic access to the hardware through the painter and presser objects.
◆ add_held()
template<typename T>
|
|
inlinefinaloverridevirtual |
◆ handle_child_Delete()
template<typename T>
|
|
inlinefinaloverrideprotectedvirtual |
◆ handle_painter()
template<typename T>
|
|
inlinefinaloverridevirtual |
◆ handle_presser()
template<typename T>
|
|
inlinefinaloverridevirtual |
◆ remove_held()
template<typename T>
|
|
inlinefinaloverridevirtual |
◆ repaint()
template<typename T>
|
|
inlinefinaloverrideprotectedvirtual |
◆ update()
template<typename T>
|
|
inlinefinaloverridevirtual |
The documentation for this struct was generated from the following file: