# Plutonium framework API: pu::ui::Layout Class Reference

pu::ui::Layout Class Reference

`#include <ui_Layout.hpp>`

Inheritance diagram for pu::ui::Layout:

## Public Types

using | OnInputCallback = std::function< void(const u64, const u64, const u64, const TouchPoint)>
using | RenderCallback = std::function< void()>

## Public Member Functions

| Layout ()
| ~Layout ()
bool | HasChildren ()
void | SetOnInput (OnInputCallback on_ipt_cb)
OnInputCallback | GetOnInput ()
void | AddRenderCallback (RenderCallback render_cb)
std::vector< RenderCallback > & | GetRenderCallbacks ()
bool | HasBackgroundImage ()
sdl2::Texture | GetBackgroundImageTexture ()
Color | GetBackgroundColor ()
void | SetBackgroundImage (const std::string &path)
void | SetBackgroundColor (const Color clr)
void | SimulateTouchPosition (const TouchPoint sim_touch_pos)
TouchPoint | ConsumeSimulatedTouchPosition ()
Public Member Functions inherited from pu::ui::Container
| Container (const i32 x, const i32 y, const i32 width, const i32 height)
void | Add (elm::Element::Ref elem)
elm::Element::Ref & | At (const i32 idx)
bool | Has (elm::Element::Ref &elem)
void | Clear ()
size_t | GetCount ()
void | SetX (const i32 x)
i32 | GetX ()
void | SetY (const i32 y)
i32 | GetY ()
void | SetWidth (const i32 width)
i32 | GetWidth ()
void | SetHeight (const i32 height)
i32 | GetHeight ()
void | PreRender ()

## Static Public Attributes

static constexpr Color | DefaultBackgroundColor = { 0xE1, 0xE1, 0xE1, 0xFF }

## Additional Inherited Members

Protected Attributes inherited from pu::ui::Container
i32 | x
i32 | y
i32 | w
i32 | h
std::vector< elm::Element::Ref > | elems

## Member Typedef Documentation

## OnInputCallback

using pu::ui::Layout::OnInputCallback = std::function<void(const u64, const u64, const u64, const TouchPoint)>

## RenderCallback

using pu::ui::Layout::RenderCallback = std::function<void()>

## Constructor & Destructor Documentation

## Layout()

pu::ui::Layout::Layout | ( |  | ) |

inline

## ~Layout()

pu::ui::Layout::~Layout | ( |  | ) |

## Member Function Documentation

## AddRenderCallback()

void pu::ui::Layout::AddRenderCallback | ( | RenderCallback | render_cb | ) |

inline

## ConsumeSimulatedTouchPosition()

TouchPoint pu::ui::Layout::ConsumeSimulatedTouchPosition | ( |  | ) |

## GetBackgroundColor()

Color pu::ui::Layout::GetBackgroundColor | ( |  | ) |

inline

## GetBackgroundImageTexture()

sdl2::Texture pu::ui::Layout::GetBackgroundImageTexture | ( |  | ) |

inline

## GetOnInput()

OnInputCallback pu::ui::Layout::GetOnInput | ( |  | ) |

inline

## GetRenderCallbacks()

std::vector< RenderCallback > & pu::ui::Layout::GetRenderCallbacks | ( |  | ) |

inline

## HasBackgroundImage()

bool pu::ui::Layout::HasBackgroundImage | ( |  | ) |

inline

## HasChildren()

bool pu::ui::Layout::HasChildren | ( |  | ) |

inline

## SetBackgroundColor()

void pu::ui::Layout::SetBackgroundColor | ( | const Color | clr | ) |

## SetBackgroundImage()

void pu::ui::Layout::SetBackgroundImage | ( | const std::string & | path | ) |

## SetOnInput()

void pu::ui::Layout::SetOnInput | ( | OnInputCallback | on_ipt_cb | ) |

inline

## SimulateTouchPosition()

void pu::ui::Layout::SimulateTouchPosition | ( | const TouchPoint | sim_touch_pos | ) |

inline

## Member Data Documentation

## DefaultBackgroundColor

constexpr Color pu::ui::Layout::DefaultBackgroundColor = { 0xE1, 0xE1, 0xE1, 0xFF }

staticconstexpr

The documentation for this class was generated from the following file:

- Plutonium/include/pu/ui/ui_Layout.hpp