Plutonium framework API  0.1
Simple UI framework for libnx and SDL2
Layout.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file Layout.hpp
7  @brief Contains Layout class, the object used to render specific objects
8  @author XorTroll
9 
10  @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
11 
12 */
13 
14 #pragma once
15 #include <pu/element.hpp>
16 
17 namespace pu
18 {
19  class Layout
20  {
21  public:
22  Layout(bool UseFocus = false);
23  ~Layout();
24  void AddChild(element::Element *Child);
25  void ClearChildren();
26  element::Element *GetChildAt(u32 Index);
27  u32 GetChildCount();
28  bool HasChilds();
29  void SetElementOnFocus(element::Element *OnFocus);
31  void SetOnInput(std::function<void(u64 Down, u64 Up, u64 Held, bool Touch)> Callback);
32  std::function<void(u64 Down, u64 Up, u64 Held, bool Touch)> GetOnInput();
33  void AddThread(std::function<void()> Callback);
34  std::vector<std::function<void()>> GetAllThreads();
35  bool UsesFocus();
36  void SetUseFocus(bool Focus);
37  private:
38  bool ufocus;
39  std::function<void(u64, u64, u64, bool)> onipt;
40  std::vector<std::function<void()>> thds;
41  std::vector<element::Element*> chld;
42  element::Element *efocus;
43  };
44 }
u32 GetChildCount()
void SetUseFocus(bool Focus)
void ClearChildren()
Definition: Layout.hpp:19
Definition: Application.hpp:20
element::Element * GetElementOnFocus()
void AddChild(element::Element *Child)
Definition: Element.hpp:27
std::vector< std::function< void()> > GetAllThreads()
Layout(bool UseFocus=false)
void SetElementOnFocus(element::Element *OnFocus)
std::function< void(u64 Down, u64 Up, u64 Held, bool Touch)> GetOnInput()
void AddThread(std::function< void()> Callback)
element::Element * GetChildAt(u32 Index)
bool UsesFocus()
bool HasChilds()
void SetOnInput(std::function< void(u64 Down, u64 Up, u64 Held, bool Touch)> Callback)