Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
rectangle.hpp
Go to the documentation of this file.
1
/*
2
Copyright 2020-2021 natinusala
3
Copyright 2019 p-sam
4
5
Licensed under the Apache License, Version 2.0 (the "License");
6
you may not use this file except in compliance with the License.
7
You may obtain a copy of the License at
8
9
http://www.apache.org/licenses/LICENSE-2.0
10
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
16
*/
17
18
#pragma once
19
20
#include <
aurore/core/frame_context.hpp
>
21
#include <
aurore/core/view.hpp
>
22
23
namespace
aurore
24
{
25
26
// A solid color rectangle
27
class
Rectangle
:
public
View
28
{
29
public
:
30
Rectangle
(NVGcolor color);
31
Rectangle
();
32
~Rectangle
() { }
33
34
void
draw
(NVGcontext* vg,
float
x,
float
y,
float
width,
float
height,
Style
style,
FrameContext
* ctx)
override
;
35
36
void
setColor
(NVGcolor color);
37
NVGcolor
getColor
() {
return
this->color; }
38
39
bool
getStyleProperty
(
const
std::string& name,
StyleValue
* value)
override
;
40
bool
setStyleProperty
(
const
std::string& name,
const
StyleValue
& value)
override
;
41
42
static
View
*
create
();
43
44
private
:
45
NVGcolor color = nvgRGB(0, 0, 255);
46
};
47
48
}
// namespace aurore
aurore::FrameContext
Definition
frame_context.hpp:30
aurore::Rectangle
Definition
rectangle.hpp:28
aurore::Rectangle::setStyleProperty
bool setStyleProperty(const std::string &name, const StyleValue &value) override
aurore::Rectangle::setColor
void setColor(NVGcolor color)
aurore::Rectangle::Rectangle
Rectangle(NVGcolor color)
aurore::Rectangle::~Rectangle
~Rectangle()
Definition
rectangle.hpp:32
aurore::Rectangle::getColor
NVGcolor getColor()
Definition
rectangle.hpp:37
aurore::Rectangle::getStyleProperty
bool getStyleProperty(const std::string &name, StyleValue *value) override
aurore::Rectangle::Rectangle
Rectangle()
aurore::Rectangle::draw
void draw(NVGcontext *vg, float x, float y, float width, float height, Style style, FrameContext *ctx) override
aurore::Rectangle::create
static View * create()
aurore::Style
Simple wrapper around StyleValues for the array operator.
Definition
style.hpp:115
aurore::View
Definition
view.hpp:232
frame_context.hpp
aurore
Definition
actions.hpp:25
aurore::StyleValue
Definition
view_style.hpp:41
view.hpp
aurore
views
rectangle.hpp
Generated by
1.9.8