TermOx
matrix_view.hpp
1 #ifndef TERMOX_WIDGET_WIDGETS_MATRIX_VIEW_HPP
2 #define TERMOX_WIDGET_WIDGETS_MATRIX_VIEW_HPP
3 #include <memory>
4 
5 #include <termox/painter/glyph_matrix.hpp>
6 #include <termox/painter/painter.hpp>
7 #include <termox/widget/widget.hpp>
8 
9 namespace ox {
10 
12 class Matrix_view : public Widget {
13  public:
14  struct Parameters {
15  Glyph_matrix matrix;
16  };
17 
18  public:
19  Glyph_matrix matrix;
20 
21  public:
22  explicit Matrix_view(Glyph_matrix matrix_);
23 
24  explicit Matrix_view(Parameters p);
25 
26  protected:
27  auto paint_event(Painter& p) -> bool override;
28 };
29 
31 [[nodiscard]] auto matrix_view(Glyph_matrix matrix)
32  -> std::unique_ptr<Matrix_view>;
33 
35 [[nodiscard]] auto matrix_view(Matrix_view::Parameters p)
36  -> std::unique_ptr<Matrix_view>;
37 
38 } // namespace ox
39 #endif // TERMOX_WIDGET_WIDGETS_MATRIX_VIEW_HPP
Holds a matrix of Glyphs, provides simple access by indices.
Definition: glyph_matrix.hpp:12
Displays a Glyph_matrix object.
Definition: matrix_view.hpp:12
auto paint_event(Painter &p) -> bool override
Handles Paint_event objects.
Definition: matrix_view.cpp:16
Contains functions to paint Glyphs to a Widget's screen area.
Definition: painter.hpp:21
Definition: widget.hpp:31
Definition: matrix_view.hpp:14