1.10
svgdeserial.h
1/*
2 * Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef EGT_SVGDESERIAL_H
7#define EGT_SVGDESERIAL_H
8
9
10#include "app.h"
11#include "window.h"
12#include "gauge.h"
13#include "animation.h"
14#include "text.h"
15#include "shapes.h"
16
17namespace egt
18{
19inline namespace v1
20{
21
22namespace experimental
23{
24
25class EGT_API SVGDeserial : public Gauge
26{
27public:
28
32 SVGDeserial(TopWindow& parent) noexcept;
33
39 shared_cairo_surface_t DeSerialize(const unsigned char* buf, size_t len, std::shared_ptr<egt::Rect>& rect);
40
46 std::shared_ptr<GaugeLayer> AddWidgetByBuf(const unsigned char* buf, size_t len, bool show);
47
58 std::shared_ptr<NeedleLayer> AddRotateWidgetByBuf(const unsigned char* buf, size_t len, int min, int max,
59 int min_angle, int max_angle, bool clockwise, Point center);
60
67 std::shared_ptr<AnimationSequence> RotateAnimation(std::shared_ptr<NeedleLayer> widget,
68 std::chrono::milliseconds duration, const EasingFunc& easein, const EasingFunc& easeout);
69
70 std::shared_ptr<egt::TextBox> find_text(const std::string& name) { return find_child<egt::TextBox>(name); }
71
72 std::shared_ptr<egt::RectangleWidget> find_rec(const std::string& name) { return find_child<egt::RectangleWidget>(name); }
73
74 std::shared_ptr<egt::experimental::GaugeLayer> find_layer(const std::string& name) { return find_child<egt::experimental::GaugeLayer>(name); }
75
76 void add_text_widget(const std::string& id, const std::string& txt, const egt::Rect& rect, egt::Font::Size size);
77 void add_text_widget(const std::string& id, const std::string& txt, const egt::Rect& rect, egt::Font::Size size, egt::Color color);
78
81 ~SVGDeserial() noexcept {}
82
83private:
84
85};
86
87}
88}
89}
90
91#endif
32 bit RGBA color.
Definition color.h:41
Top level Window.
Definition window.h:335
A Gauge Widget that is composed of GaugeLayer layers.
Definition gauge.h:383
Definition svgdeserial.h:26
std::shared_ptr< egt::TextBox > find_text(const std::string &name)
Definition svgdeserial.h:70
SVGDeserial(TopWindow &parent) noexcept
std::shared_ptr< AnimationSequence > RotateAnimation(std::shared_ptr< NeedleLayer > widget, std::chrono::milliseconds duration, const EasingFunc &easein, const EasingFunc &easeout)
~SVGDeserial() noexcept
Definition svgdeserial.h:81
shared_cairo_surface_t DeSerialize(const unsigned char *buf, size_t len, std::shared_ptr< egt::Rect > &rect)
std::shared_ptr< egt::experimental::GaugeLayer > find_layer(const std::string &name)
Definition svgdeserial.h:74
bool is_point_in_rect(egt::DisplayPoint &point, egt::Rect rect)
void add_text_widget(const std::string &id, const std::string &txt, const egt::Rect &rect, egt::Font::Size size)
std::shared_ptr< GaugeLayer > AddWidgetByBuf(const unsigned char *buf, size_t len, bool show)
void add_text_widget(const std::string &id, const std::string &txt, const egt::Rect &rect, egt::Font::Size size, egt::Color color)
bool is_point_in_line(egt::DefaultDim point, egt::DefaultDim start, egt::DefaultDim end)
std::shared_ptr< NeedleLayer > AddRotateWidgetByBuf(const unsigned char *buf, size_t len, int min, int max, int min_angle, int max_angle, bool clockwise, Point center)
std::shared_ptr< egt::RectangleWidget > find_rec(const std::string &name)
Definition svgdeserial.h:72
std::shared_ptr< cairo_surface_t > shared_cairo_surface_t
Shared pointer for a cairo surface.
Definition types.h:29
std::function< EasingScalar(EasingScalar percent)> EasingFunc
Easing function type.
Definition animation.h:41
int DefaultDim
Define the default dimension type used for geometry.
Definition geometry.h:34
EGT framework namespace.
Definition animation.h:24