Plutonium framework API  0.3
Simple UI framework for libnx and SDL2
ui_Layout.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file ui_Layout.hpp
7  @brief Contains pu::Layout class, the object used to render within applications
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/ui/ui_Container.hpp>
16 #include <functional>
17 
18 namespace pu::ui
19 {
20  class Layout : public Container
21  {
22  public:
23  Layout();
25  ~Layout();
26 
27  bool HasChilds();
28  void SetOnInput(std::function<void(u64 Down, u64 Up, u64 Held, Touch Pos)> Callback);
29  std::function<void(u64 Down, u64 Up, u64 Held, Touch Pos)> GetOnInput();
30  void AddThread(std::function<void()> Callback);
31  std::vector<std::function<void()>> GetAllThreads();
32  void SetBackgroundImage(std::string Path);
34  void SimulateTouch(Touch Custom);
37  Color GetBackgroundColor();
38  bool HasBackgroundImage();
39  private:
40  bool hasimage;
41  Color overbgcolor;
42  Touch simtouch;
43  sdl2::Texture overbgtex;
44  std::function<void(u64, u64, u64, Touch)> onipt;
45  std::vector<std::function<void()>> thds;
46  };
47 }
Definition: ui_Types.hpp:24
Definition: ui_Types.hpp:38
void AddThread(std::function< void()> Callback)
void SimulateTouch(Touch Custom)
Color GetBackgroundColor()
sdl2::Texture GetBackgroundImageTexture()
void SetBackgroundColor(Color Color)
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
Touch GetSimulatedTouch()
#define PU_SMART_CTOR(type)
Definition: pu_Macros.hpp:8
Definition: ui_Container.hpp:20
std::vector< std::function< void()> > GetAllThreads()
void SetOnInput(std::function< void(u64 Down, u64 Up, u64 Held, Touch Pos)> Callback)
Definition: ui_Layout.hpp:20
void SetBackgroundImage(std::string Path)
std::function< void(u64 Down, u64 Up, u64 Held, Touch Pos)> GetOnInput()
bool HasBackgroundImage()