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
21#include <aurore/core/view.hpp>
22
23namespace aurore
24{
25
26// A solid color rectangle
27class Rectangle : public View
28{
29 public:
30 Rectangle(NVGcolor color);
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
Definition frame_context.hpp:30
Definition rectangle.hpp:28
bool setStyleProperty(const std::string &name, const StyleValue &value) override
void setColor(NVGcolor color)
Rectangle(NVGcolor color)
~Rectangle()
Definition rectangle.hpp:32
NVGcolor getColor()
Definition rectangle.hpp:37
bool getStyleProperty(const std::string &name, StyleValue *value) override
void draw(NVGcontext *vg, float x, float y, float width, float height, Style style, FrameContext *ctx) override
static View * create()
Simple wrapper around StyleValues for the array operator.
Definition style.hpp:115
Definition view.hpp:232
Definition actions.hpp:25
Definition view_style.hpp:41