Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
gva::ScreenGva Class Reference

Class definition of the ScreenGva. More...

#include <screen_gva.h>

Inheritance diagram for gva::ScreenGva:
Inheritance graph
Collaboration diagram for gva::ScreenGva:
Collaboration graph

Public Member Functions

 ScreenGva (Screen *screen, uint32_t width, uint32_t height)
 
ScreenGvaoperator= (const ScreenGva &a)=delete
 Construct a new Screen Gva object.
 
 ScreenGva (const ScreenGva &Other)=default
 Construct a new Screen Gva object.
 
 ~ScreenGva () final
 
GvaStatusTypes Update ()
 
void StartClock (std::shared_ptr< WidgetX > status_bar_widget)
 
void ResetWidgets () const
 
WidgetXGetWidget (widget::WidgetEnum widget)
 
- Public Member Functions inherited from gva::RendererGva
 RendererGva (uint32_t width, uint32_t height)
 Construct a new Renderer Gva object.
 
 ~RendererGva () override=default
 Destroy the Renderer Gva object.
 
void DrawLabels (char *text, uint32_t fontSize, uint32_t x, uint32_t y)
 Draw all the labels on the screen.
 
void DrawFunctionLabels (uint32_t x, const std::array< FunctionKeys::Labels, 6 > &labels)
 Draw all the labels on the screen.
 
void DrawTopLabels (uint32_t y, const std::array< FunctionSelect::Labels, 8 > &labels)
 Draw the labels on the top of the screen.
 
void DrawControlLabels (const uint32_t y, const std::array< CommonTaskKeys::Labels, 8 > &labels)
 Draw the control labels on the bottom of the screen.
 
void DrawIcon (widget::IconType icon, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 Draw an icon.
 
void DrawButton (const std::string &keytext, uint32_t fontSize, uint32_t x, uint32_t y, uint32_t size)
 Draw keyboard buttons.
 
void DrawButton (const std::string &key_text, uint32_t font_size, uint32_t x, uint32_t y, uint32_t height, uint32_t width, widget::CellAlignType align)
 Draw keyboard buttons.
 
TouchGvaGetTouch ()
 Get the Touch object.
 
- Public Member Functions inherited from gva::RendererCairo
 RendererCairo (uint32_t width, uint32_t height)
 Construct a new Renderer Cairo object.
 
 ~RendererCairo () override
 Destroy the Renderer Cairo object.
 
HandleTypeInit (uint32_t width, uint32_t height, bool fullscreen=false)
 Initalise the renderer with display parameters.
 
void SetPixel (uint32_t x, uint32_t y) override
 
void SetColour (uint8_t red, uint8_t green, uint8_t blue) override
 Set the Colour object.
 
void SetColour (uint32_t rgb)
 Set the Colour object.
 
void SetColourForeground (ColourType colour)
 Set the Colour Foreground object.
 
void SetColourForeground (uint8_t red, uint8_t green, uint8_t blue) override
 Set the Colour Foreground object.
 
void SetColourForeground (uint32_t rgb)
 Set the Colour Foreground object.
 
void SetColourBackground (ColourType colour)
 Set the Colour Background attribute.
 
void SetColourBackground (uint8_t red, uint8_t green, uint8_t blue) override
 Set the Colour Background object.
 
void SetColourBackground (uint32_t rgb)
 Set the Colour Background object.
 
void SetLineType (uint32_t type)
 Set the Line Type object.
 
void SetLineThickness (uint32_t thickness, LineType fill)
 Set the Line Thickness object.
 
void SetLineThickness (uint32_t thickness, LineType fill, LineCapEnd end)
 Set the Line Thickness object.
 
uint32_t MovePen (int32_t x, int32_t y)
 
uint32_t DrawPen (uint32_t x, uint32_t y, bool close)
 
uint32_t DrawPen (uint32_t x, uint32_t y)
 
uint32_t MovePenRaw (int32_t x, int32_t y)
 
uint32_t DrawPenRaw (int32_t x, int32_t y)
 
void DrawArcRaw (uint32_t x, uint32_t y, uint32_t radius, uint32_t angle1, uint32_t angle2)
 
uint32_t DrawLine (uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2) override
 
void Save ()
 Save the current state of the renderer.
 
void Restore ()
 Restore the last saved state of the renderer.
 
void Scale (double x, double y)
 Scale the renderer.
 
void Translate (uint32_t x, uint32_t y)
 Translate the renderer.
 
void Rotate (double radians)
 Rotate the renderer.
 
uint32_t ClosePath (bool fill)
 Close drawing path.
 
void DrawCircle (uint32_t x, uint32_t y, uint32_t radius, bool fill) override
 Draw a circle.
 
void DrawRectangle (uint32_t x, uint32_t y, uint32_t width, uint32_t height, bool fill) override
 Draw a rectangle.
 
void DrawRoundedRectangle (uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t corner, bool fill)
 Draw a rounded rectangle.
 
void DrawTriangle (uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t x3, uint32_t y3, bool fill)
 Draw a triangle.
 
uint32_t DrawColor (ColourType colour)
 Set the Colour object to draw with.
 
uint32_t DrawColor (uint8_t r, uint8_t g, uint8_t b) override
 Set the Colour object to draw with.
 
uint32_t CurveTo (uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t x3, uint32_t y3)
 Adds a cubic Bézier spline to the path from the current point to position (x3 , y3 ) in user-space coordinates, using (x1 , y1 ) and (x2 , y2 ) as the control points. After this call the current point will be (x3 , y3 ).
 
uint32_t DrawColor (uint32_t rgb)
 Set the draw colour.
 
void SetTextFont (uint32_t slope, widget::WeightType weight, std::string_view font_name, double size)
 Set the Text Font object.
 
void Push ()
 Push the current state of the renderer.
 
void Pop ()
 Pop the last saved state of the renderer.
 
uint32_t GetTextWidth (std::string_view str, uint32_t fontSize) const
 Get the Text Width object.
 
uint32_t GetTextHeight (std::string_view str, uint32_t fontSize) const
 Get the Text Height object.
 
void DrawString (uint32_t x, uint32_t y, std::string_view text)
 Draw some text on the screen.
 
void DrawLabel (uint32_t x, uint32_t y, std::string_view text)
 Draw an on screen label.
 
void DrawTextCentre (uint32_t x, std::string_view text, uint32_t size)
 Draw some text on the screen and centre it.
 
uint32_t TextureRGB (uint32_t x, uint32_t y, unsigned char *buffer, std::string_view file) override
 Set a texture (file) to use as a bitmap.
 
uint32_t TextureRGB (uint32_t x, uint32_t y, unsigned char *buffer)
 Set a texture (file) to use as a bitmap.
 
uint32_t TextureRGB (uint32_t x, uint32_t y, cairo_surface_t *surface)
 Set a texture (cairo surface) to use as a bitmap.
 
void Draw ()
 Redraw the screen.
 
void Reset ()
 Redraw the screen.
 
void SetHeight (uint32_t height) const
 Set the Height object.
 
void SetWidth (uint32_t width) const
 Set the Width object.
 
uint32_t GetHeight () const
 Get the Height object.
 
uint32_t GetWidth () const
 Get the Width object.
 
void SetSurface (cairo_surface_t *surface)
 Set the Surface attribute, used by application.
 
void DrawSurface (cairo_t *cr)
 Draw the new cairo surface to the screen.
 
void Configure (uint32_t height, uint32_t width)
 Configure the surface to use new dimensions.
 
- Public Member Functions inherited from gva::Renderer
 Renderer (uint32_t width, uint32_t height)
 Construct a new Renderer object.
 
virtual ~Renderer ()=default
 Destroy the Renderer object.
 
uint32_t UnpackRed (uint32_t rgb) const
 Unpack a red value.
 
uint32_t UnpackGreen (uint32_t rgb) const
 Unpack a green value.
 
uint32_t UnpackBlue (uint32_t rgb) const
 Unpack a blue value.
 
RgbUnpackedType UnpackRgb (uint64_t rgb) const
 Unpack red, green and blue values.
 

Static Public Member Functions

static void ClockUpdateThread (ClockArgs *arg)
 
- Static Public Member Functions inherited from gva::RendererCairo
static void DestroySurface ()
 Destroy the current cairo surface, usually called during shutdown.
 
- Static Public Member Functions inherited from gva::Renderer
static uint32_t GetWidth ()
 Get the Width attribute.
 
static uint32_t GetHeight ()
 Get the Height attribute.
 
static void SetWidth (uint32_t width)
 Set the Width attribute.
 
static void SetHeight (uint32_t height)
 Set the Height attribute.
 
static uint32_t PackRgb (ColourType colour)
 Pack the colour to RGB.
 
static uint32_t PackRgb (uint8_t r, uint8_t g, uint8_t b)
 Pack three red, green, blue values.
 

Static Public Attributes

static ClockArgs args_ = {}
 The arguments for the clock thread.
 
- Static Public Attributes inherited from gva::RendererCairo
static HandleType render_
 Class definition of the HandleType.
 

Additional Inherited Members

- Static Protected Attributes inherited from gva::Renderer
static uint32_t height_ = kMinimumHeight
 The height of the renderer.
 
static uint32_t width_ = kMinimumWidth
 The width of the renderer.
 

Detailed Description

Class definition of the ScreenGva.

Constructor & Destructor Documentation

◆ ScreenGva() [1/2]

gva::ScreenGva::ScreenGva ( Screen screen,
uint32_t  width,
uint32_t  height 
)

Construct a new Screen Gva object

Parameters
screen
width
height

◆ ScreenGva() [2/2]

gva::ScreenGva::ScreenGva ( const ScreenGva Other)
default

Construct a new Screen Gva object.

Parameters
OtherThe object to copy

◆ ~ScreenGva()

gva::ScreenGva::~ScreenGva ( )
final

Destroy the Screen Gva object

Member Function Documentation

◆ ClockUpdateThread()

void gva::ScreenGva::ClockUpdateThread ( ClockArgs arg)
static

The thread that reads and updates the clock and status bar info

Parameters
argstatus bar arguments
Returns
void*

◆ GetWidget()

WidgetX * gva::ScreenGva::GetWidget ( widget::WidgetEnum  widget)

Get the Widget object

Parameters
widget
Returns
WidgetX*

◆ operator=()

ScreenGva & gva::ScreenGva::operator= ( const ScreenGva a)
delete

Construct a new Screen Gva object.

Parameters
aThe argument to copy
Returns
ScreenGva&

◆ ResetWidgets()

void gva::ScreenGva::ResetWidgets ( ) const

Reset the all the widgets to not be visible

Returns
WidgetX*

Iterate over all widgets and draw the visible ones

◆ StartClock()

void gva::ScreenGva::StartClock ( std::shared_ptr< WidgetX status_bar_widget)

Start the clock thread running to update the clock (pthread started)

Parameters
status_bar_widgetthe widget to update

◆ Update()

GvaStatusTypes gva::ScreenGva::Update ( )

Redraw the screen

Returns
GvaStatusTypes Status

Iterate over all widgets and draw the visible ones


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