| Flutter Impeller |

widgets.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_
6 #define FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_
7
8 #include <optional>
9 #include <tuple>
10
11 #include "impeller/base/strings.h"
12 #include "impeller/geometry/color.h"
13 #include "impeller/geometry/point.h"
14 #include "third_party/imgui/imgui.h"
15
16 namespace impeller {
17 struct PlaygroundPoint {
18 PlaygroundPoint(Point default_position, Scalar p_radius, Color p_color)
19 : position(default_position),
20 reset_position(default_position),
21 radius(p_radius),
22 color(p_color) {}
23 Point position;
24 Point reset_position;
25 bool dragging = false;
26 std::optional<Point> prev_mouse_pos;
27 Scalar radius;
28 Color color;
29 PlaygroundPoint(const PlaygroundPoint&) = delete;
30 PlaygroundPoint(PlaygroundPoint&&) = delete;
31 PlaygroundPoint& operator=(const PlaygroundPoint&) = delete;
32 };
33
34 Point DrawPlaygroundPoint(PlaygroundPoint& point);
35
36 std::tuple<Point, Point> DrawPlaygroundLine(PlaygroundPoint& point_a,
37 PlaygroundPoint& point_b);
38 } // namespace impeller
39 #endif // FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_
point.h
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::PlaygroundPoint::reset_position
Point reset_position
Definition: widgets.h:24
impeller::Color
Definition: color.h:123
impeller::PlaygroundPoint::position
Point position
Definition: widgets.h:23
impeller::PlaygroundPoint::color
Color color
Definition: widgets.h:28
strings.h
impeller::PlaygroundPoint::operator=
PlaygroundPoint & operator=(const PlaygroundPoint &)=delete
impeller::PlaygroundPoint::prev_mouse_pos
std::optional< Point > prev_mouse_pos
Definition: widgets.h:26
impeller::DrawPlaygroundPoint
Point DrawPlaygroundPoint(PlaygroundPoint &point)
Definition: widgets.cc:9
impeller::PlaygroundPoint
Definition: widgets.h:17
impeller::PlaygroundPoint::PlaygroundPoint
PlaygroundPoint(Point default_position, Scalar p_radius, Color p_color)
Definition: widgets.h:18
impeller::TPoint
Definition: point.h:27
impeller::PlaygroundPoint::radius
Scalar radius
Definition: widgets.h:27
color.h
impeller
Definition: allocation.cc:12
impeller::DrawPlaygroundLine
std::tuple< Point, Point > DrawPlaygroundLine(PlaygroundPoint &point_a, PlaygroundPoint &point_b)
Definition: widgets.cc:50
impeller::PlaygroundPoint::dragging
bool dragging
Definition: widgets.h:25