diff --git a/include/Plutonium/docs/d6/d08/ui___overlay_8hpp.html b/include/Plutonium/docs/d6/d08/ui___overlay_8hpp.html new file mode 100644 index 0000000..ad39608 --- /dev/null +++ b/include/Plutonium/docs/d6/d08/ui___overlay_8hpp.html @@ -0,0 +1,118 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/ui_Overlay.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
ui_Overlay.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ui::Overlay
 
+ + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d6/d08/ui___overlay_8hpp_source.html b/include/Plutonium/docs/d6/d08/ui___overlay_8hpp_source.html new file mode 100644 index 0000000..2751328 --- /dev/null +++ b/include/Plutonium/docs/d6/d08/ui___overlay_8hpp_source.html @@ -0,0 +1,171 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/ui_Overlay.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
ui_Overlay.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file ui_Overlay.hpp
+
7 @brief An overlay is some kind of "pop-up", like notification messages or similar items
+
8 @author XorTroll
+
9
+
10 @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
+
11
+
12*/
+
13
+
14#pragma once
+ +
16
+
17namespace pu::ui {
+
18
+
19 class Overlay : public Container {
+
20 public:
+
21 static constexpr i32 DefaultRadius = 25;
+
22 static constexpr i32 MaxFadeAlpha = 200;
+
23 static constexpr i32 FadeAlphaVariation = 25;
+
24
+
25 private:
+
26 i32 fade_a;
+
27 Color bg_clr;
+
28 i32 rad;
+
29 bool is_ending;
+
30 bool round;
+
31
+
32 public:
+
33 Overlay(const i32 x, const i32 y, const i32 width, const i32 height, const Color bg_clr, const bool round = true, const i32 radius = DefaultRadius) : Container(x, y, width, height), fade_a(0), bg_clr(bg_clr), rad(radius), is_ending(false), round(round) {}
+ +
35
+
36 inline void SetRadius(const i32 radius) {
+
37 this->rad = radius;
+
38 }
+
39
+
40 inline i32 GetRadius() {
+
41 return this->rad;
+
42 }
+
43
+
44 virtual void OnPreRender(render::Renderer::Ref &drawer) {}
+
45 virtual void OnPostRender(render::Renderer::Ref &drawer) {}
+
46 bool Render(render::Renderer::Ref &drawer);
+
47
+
48 inline void NotifyEnding(const bool ending) {
+
49 this->is_ending = ending;
+
50 }
+
51 };
+
52
+
53}
+
Definition: ui_Container.hpp:21
+
i32 x
Definition: ui_Container.hpp:23
+
i32 y
Definition: ui_Container.hpp:24
+
Definition: ui_Overlay.hpp:19
+
void NotifyEnding(const bool ending)
Definition: ui_Overlay.hpp:48
+
static constexpr i32 FadeAlphaVariation
Definition: ui_Overlay.hpp:23
+
virtual void OnPostRender(render::Renderer::Ref &drawer)
Definition: ui_Overlay.hpp:45
+
bool Render(render::Renderer::Ref &drawer)
+
static constexpr i32 DefaultRadius
Definition: ui_Overlay.hpp:21
+
static constexpr i32 MaxFadeAlpha
Definition: ui_Overlay.hpp:22
+
virtual void OnPreRender(render::Renderer::Ref &drawer)
Definition: ui_Overlay.hpp:44
+
void SetRadius(const i32 radius)
Definition: ui_Overlay.hpp:36
+
Overlay(const i32 x, const i32 y, const i32 width, const i32 height, const Color bg_clr, const bool round=true, const i32 radius=DefaultRadius)
Definition: ui_Overlay.hpp:33
+
i32 GetRadius()
Definition: ui_Overlay.hpp:40
+
Definition: elm_Button.hpp:18
+
s32 i32
Definition: pu_Include.hpp:28
+
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
+
Definition: ui_Types.hpp:44
+ +
+
+ + + + diff --git a/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.html b/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.html new file mode 100644 index 0000000..e0407fd --- /dev/null +++ b/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.html @@ -0,0 +1,584 @@ + + + + + + + +Plutonium framework API: pu::ui::Layout Class Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::Layout Class Reference
+
+
+ +

#include <ui_Layout.hpp>

+
+Inheritance diagram for pu::ui::Layout:
+
+
+ + +pu::ui::Container + +
+ + + + + + +

+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: +
+
+ + + + diff --git a/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.js b/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.js new file mode 100644 index 0000000..5f7d985 --- /dev/null +++ b/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.js @@ -0,0 +1,20 @@ +var classpu_1_1ui_1_1_layout = +[ + [ "OnInputCallback", "d6/d11/classpu_1_1ui_1_1_layout.html#a7be80c60eb8fd21501a06ac3d18059d6", null ], + [ "RenderCallback", "d6/d11/classpu_1_1ui_1_1_layout.html#a8cb44afa8209bc3f748614c58e1126f2", null ], + [ "Layout", "d6/d11/classpu_1_1ui_1_1_layout.html#ad49ec6b80ed4f53fe77a5d5cc480f460", null ], + [ "~Layout", "d6/d11/classpu_1_1ui_1_1_layout.html#ac93ddffcf6624205a0ba26e9d1ca513e", null ], + [ "AddRenderCallback", "d6/d11/classpu_1_1ui_1_1_layout.html#a0702b749dd67172c62e60256235a89d1", null ], + [ "ConsumeSimulatedTouchPosition", "d6/d11/classpu_1_1ui_1_1_layout.html#a3a3b80c19c80bd51fb6fbf60b744d702", null ], + [ "GetBackgroundColor", "d6/d11/classpu_1_1ui_1_1_layout.html#a8aa3e5d0448ffb6ec3e91f85beaaeec7", null ], + [ "GetBackgroundImageTexture", "d6/d11/classpu_1_1ui_1_1_layout.html#ac981b9782dcac12875b6b8e0cd9dbd47", null ], + [ "GetOnInput", "d6/d11/classpu_1_1ui_1_1_layout.html#ad55ef30fedadeb9d79565057b2968ebc", null ], + [ "GetRenderCallbacks", "d6/d11/classpu_1_1ui_1_1_layout.html#a98ffb6a05d8923b24298dc65fd552187", null ], + [ "HasBackgroundImage", "d6/d11/classpu_1_1ui_1_1_layout.html#a162283529f76efb15db628752da72876", null ], + [ "HasChildren", "d6/d11/classpu_1_1ui_1_1_layout.html#a66240d9592d4264ea6a8472da6794ff5", null ], + [ "SetBackgroundColor", "d6/d11/classpu_1_1ui_1_1_layout.html#a6af2213635577dc827211b558d4d1b9d", null ], + [ "SetBackgroundImage", "d6/d11/classpu_1_1ui_1_1_layout.html#af15d0dd42c8e32c3579cc8a8fd5e30b3", null ], + [ "SetOnInput", "d6/d11/classpu_1_1ui_1_1_layout.html#a218c687961e2245e5de19727b8dc92bd", null ], + [ "SimulateTouchPosition", "d6/d11/classpu_1_1ui_1_1_layout.html#ac49ebb8a928452c19e24fe6199b333de", null ], + [ "DefaultBackgroundColor", "d6/d11/classpu_1_1ui_1_1_layout.html#ac27edb42fdd26503e9a4acf2173554af", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.png b/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.png new file mode 100644 index 0000000..0aab755 Binary files /dev/null and b/include/Plutonium/docs/d6/d11/classpu_1_1ui_1_1_layout.png differ diff --git a/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.html b/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.html new file mode 100644 index 0000000..8cce28b --- /dev/null +++ b/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.html @@ -0,0 +1,679 @@ + + + + + + + +Plutonium framework API: pu::ui::elm::Image Class Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::elm::Image Class Reference
+
+
+ +

#include <elm_Image.hpp>

+
+Inheritance diagram for pu::ui::elm::Image:
+
+
+ + +pu::ui::elm::Element + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Image (const i32 x, const i32 y, const std::string &image_path)
 
 ~Image ()
 
i32 GetX () override
 
void SetX (const i32 x)
 
i32 GetY () override
 
void SetY (const i32 y)
 
i32 GetWidth () override
 
void SetWidth (const i32 width)
 
i32 GetHeight () override
 
void SetHeight (const i32 height)
 
float GetRotationAngle ()
 
void SetRotationAngle (const float angle)
 
std::string GetImagePath ()
 
void SetImage (const std::string &image_path)
 
bool IsImageValid ()
 
void OnRender (render::Renderer::Ref &drawer, const i32 x, const i32 y) override
 
void OnInput (const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override
 
- Public Member Functions inherited from pu::ui::elm::Element
 Element ()
 
virtual ~Element ()
 
virtual i32 GetX ()=0
 
virtual i32 GetY ()=0
 
virtual i32 GetWidth ()=0
 
virtual i32 GetHeight ()=0
 
virtual void OnRender (render::Renderer::Ref &drawer, const i32 x, const i32 y)=0
 
virtual void OnInput (const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos)=0
 
bool IsVisible ()
 
void SetVisible (const bool visible)
 
void SetHorizontalAlign (const HorizontalAlign align)
 
HorizontalAlign GetHorizontalAlign ()
 
void SetVerticalAlign (const VerticalAlign align)
 
VerticalAlign GetVerticalAlign ()
 
void SetParentContainer (Container *parent_container)
 
i32 GetProcessedX ()
 
i32 GetProcessedY ()
 
+ + + + + + + + + + +

+Additional Inherited Members

- Protected Attributes inherited from pu::ui::elm::Element
bool visible
 
HorizontalAlign h_align
 
VerticalAlign v_align
 
Containerparent_container
 
+

Constructor & Destructor Documentation

+ +

◆ Image()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
pu::ui::elm::Image::Image (const i32 x,
const i32 y,
const std::string & image_path 
)
+
+ +
+
+ +

◆ ~Image()

+ +
+
+ + + + + + + +
pu::ui::elm::Image::~Image ()
+
+ +
+
+

Member Function Documentation

+ +

◆ GetHeight()

+ +
+
+ + + + + +
+ + + + + + + +
i32 pu::ui::elm::Image::GetHeight ()
+
+inlineoverridevirtual
+
+ +

Implements pu::ui::elm::Element.

+ +
+
+ +

◆ GetImagePath()

+ +
+
+ + + + + +
+ + + + + + + +
std::string pu::ui::elm::Image::GetImagePath ()
+
+inline
+
+ +
+
+ +

◆ GetRotationAngle()

+ +
+
+ + + + + +
+ + + + + + + +
float pu::ui::elm::Image::GetRotationAngle ()
+
+inline
+
+ +
+
+ +

◆ GetWidth()

+ +
+
+ + + + + +
+ + + + + + + +
i32 pu::ui::elm::Image::GetWidth ()
+
+inlineoverridevirtual
+
+ +

Implements pu::ui::elm::Element.

+ +
+
+ +

◆ GetX()

+ +
+
+ + + + + +
+ + + + + + + +
i32 pu::ui::elm::Image::GetX ()
+
+inlineoverridevirtual
+
+ +

Implements pu::ui::elm::Element.

+ +
+
+ +

◆ GetY()

+ +
+
+ + + + + +
+ + + + + + + +
i32 pu::ui::elm::Image::GetY ()
+
+inlineoverridevirtual
+
+ +

Implements pu::ui::elm::Element.

+ +
+
+ +

◆ IsImageValid()

+ +
+
+ + + + + +
+ + + + + + + +
bool pu::ui::elm::Image::IsImageValid ()
+
+inline
+
+ +
+
+ +

◆ OnInput()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void pu::ui::elm::Image::OnInput (const u64 keys_down,
const u64 keys_up,
const u64 keys_held,
const TouchPoint touch_pos 
)
+
+inlineoverridevirtual
+
+ +

Implements pu::ui::elm::Element.

+ +
+
+ +

◆ OnRender()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void pu::ui::elm::Image::OnRender (render::Renderer::Ref & drawer,
const i32 x,
const i32 y 
)
+
+overridevirtual
+
+ +

Implements pu::ui::elm::Element.

+ +
+
+ +

◆ SetHeight()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Image::SetHeight (const i32 height)
+
+inline
+
+ +
+
+ +

◆ SetImage()

+ +
+
+ + + + + + + + +
void pu::ui::elm::Image::SetImage (const std::string & image_path)
+
+ +
+
+ +

◆ SetRotationAngle()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Image::SetRotationAngle (const float angle)
+
+inline
+
+ +
+
+ +

◆ SetWidth()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Image::SetWidth (const i32 width)
+
+inline
+
+ +
+
+ +

◆ SetX()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Image::SetX (const i32 x)
+
+inline
+
+ +
+
+ +

◆ SetY()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Image::SetY (const i32 y)
+
+inline
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.js b/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.js new file mode 100644 index 0000000..674194e --- /dev/null +++ b/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.js @@ -0,0 +1,20 @@ +var classpu_1_1ui_1_1elm_1_1_image = +[ + [ "Image", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a6c264df4bc977a061969cfefc5b2dbb4", null ], + [ "~Image", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a9164026d1c48f9454fbe8973a8dd817c", null ], + [ "GetHeight", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a2ea94ca2d573b53bdcfb31c25500cacd", null ], + [ "GetImagePath", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a3641f4be8ac1b171bf92aae96a330fa9", null ], + [ "GetRotationAngle", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a5ca46c85eb8696e486e1561f5ed59079", null ], + [ "GetWidth", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a4554beff9df5b3ba8468e93f1d5dd01b", null ], + [ "GetX", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#aa39635538ccdb0012c122ff1734ef9e6", null ], + [ "GetY", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#aed0495d5e0c9e49af8814599fb072ef9", null ], + [ "IsImageValid", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a32e2affbb15090756c757d818f44f56d", null ], + [ "OnInput", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a55f842074d50cb2e66200fca44453971", null ], + [ "OnRender", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a222ed0a039047e7dee7da39e9d061f36", null ], + [ "SetHeight", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a9e2d5fd049f6bf66f0ccd628d66b2c5e", null ], + [ "SetImage", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a5f241c16e5f292cae85df37ed60dce56", null ], + [ "SetRotationAngle", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#ad026e3fa975a96e9efca1dcf3673040b", null ], + [ "SetWidth", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a751c1497a89c7c0c7354756792ee0068", null ], + [ "SetX", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a0bf8429150a1d96f9bb7386c5ccdaf32", null ], + [ "SetY", "d6/d63/classpu_1_1ui_1_1elm_1_1_image.html#a7d7274943b1160be507387fb6a713229", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.png b/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.png new file mode 100644 index 0000000..42ed4a8 Binary files /dev/null and b/include/Plutonium/docs/d6/d63/classpu_1_1ui_1_1elm_1_1_image.png differ diff --git a/include/Plutonium/docs/d6/d74/elm___image_8hpp.html b/include/Plutonium/docs/d6/d74/elm___image_8hpp.html new file mode 100644 index 0000000..c559ec0 --- /dev/null +++ b/include/Plutonium/docs/d6/d74/elm___image_8hpp.html @@ -0,0 +1,120 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_Image.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
elm_Image.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ui::elm::Image
 
+ + + + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
namespace  pu::ui::elm
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d6/d74/elm___image_8hpp_source.html b/include/Plutonium/docs/d6/d74/elm___image_8hpp_source.html new file mode 100644 index 0000000..7cb1412 --- /dev/null +++ b/include/Plutonium/docs/d6/d74/elm___image_8hpp_source.html @@ -0,0 +1,214 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_Image.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
elm_Image.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file Image.hpp
+
7 @brief An Image is an Element showing a picture. (JPEG, PNG, TGA, BMP)
+
8 @author XorTroll
+
9
+
10 @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
+
11
+
12*/
+
13
+
14#pragma once
+ +
16
+
17namespace pu::ui::elm {
+
18
+
19 class Image : public Element {
+
20 private:
+
21 std::string img_path;
+
22 sdl2::Texture img_tex;
+ +
24 i32 x;
+
25 i32 y;
+
26
+
27 public:
+
28 Image(const i32 x, const i32 y, const std::string &image_path);
+ + +
31
+
32 inline i32 GetX() override {
+
33 return this->x;
+
34 }
+
35
+
36 inline void SetX(const i32 x) {
+
37 this->x = x;
+
38 }
+
39
+
40 inline i32 GetY() override {
+
41 return this->y;
+
42 }
+
43
+
44 inline void SetY(const i32 y) {
+
45 this->y = y;
+
46 }
+
47
+
48 inline i32 GetWidth() override {
+
49 return this->rend_opts.width;
+
50 }
+
51
+
52 inline void SetWidth(const i32 width) {
+
53 this->rend_opts.width = width;
+
54 }
+
55
+
56 inline i32 GetHeight() override {
+
57 return this->rend_opts.height;
+
58 }
+
59
+
60 inline void SetHeight(const i32 height) {
+
61 this->rend_opts.height = height;
+
62 }
+
63
+
64 inline float GetRotationAngle() {
+
65 return this->rend_opts.rot_angle;
+
66 }
+
67
+
68 inline void SetRotationAngle(const float angle) {
+
69 this->rend_opts.rot_angle = angle;
+
70 }
+
71
+
72 inline std::string GetImagePath() {
+
73 return this->img_path;
+
74 }
+
75
+
76 void SetImage(const std::string &image_path);
+
77
+
78 inline bool IsImageValid() {
+
79 return this->img_tex != nullptr;
+
80 }
+
81
+
82 void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) override;
+
83 void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override {}
+
84 };
+
85
+
86}
+
Definition: elm_Element.hpp:37
+
Definition: elm_Image.hpp:19
+
void SetX(const i32 x)
Definition: elm_Image.hpp:36
+
void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) override
+
i32 GetHeight() override
Definition: elm_Image.hpp:56
+
bool IsImageValid()
Definition: elm_Image.hpp:78
+
std::string GetImagePath()
Definition: elm_Image.hpp:72
+
i32 GetWidth() override
Definition: elm_Image.hpp:48
+
void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override
Definition: elm_Image.hpp:83
+
float GetRotationAngle()
Definition: elm_Image.hpp:64
+
void SetImage(const std::string &image_path)
+
Image(const i32 x, const i32 y, const std::string &image_path)
+
void SetWidth(const i32 width)
Definition: elm_Image.hpp:52
+
void SetY(const i32 y)
Definition: elm_Image.hpp:44
+ +
void SetHeight(const i32 height)
Definition: elm_Image.hpp:60
+
i32 GetX() override
Definition: elm_Image.hpp:32
+
void SetRotationAngle(const float angle)
Definition: elm_Image.hpp:68
+
i32 GetY() override
Definition: elm_Image.hpp:40
+ +
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
+
Definition: elm_Button.hpp:18
+
s32 i32
Definition: pu_Include.hpp:28
+
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
+
Definition: ui_Types.hpp:62
+
Definition: render_Renderer.hpp:77
+
float rot_angle
Definition: render_Renderer.hpp:81
+
i32 width
Definition: render_Renderer.hpp:79
+
i32 height
Definition: render_Renderer.hpp:80
+
+
+ + + + diff --git a/include/Plutonium/docs/d6/d78/namespacepu_1_1ui_1_1extras.html b/include/Plutonium/docs/d6/d78/namespacepu_1_1ui_1_1extras.html new file mode 100644 index 0000000..3bf4ee9 --- /dev/null +++ b/include/Plutonium/docs/d6/d78/namespacepu_1_1ui_1_1extras.html @@ -0,0 +1,107 @@ + + + + + + + +Plutonium framework API: pu::ui::extras Namespace Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::extras Namespace Reference
+
+
+ + + + +

+Classes

class  Toast
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d6/d78/namespacepu_1_1ui_1_1extras.js b/include/Plutonium/docs/d6/d78/namespacepu_1_1ui_1_1extras.js new file mode 100644 index 0000000..8c8f1e0 --- /dev/null +++ b/include/Plutonium/docs/d6/d78/namespacepu_1_1ui_1_1extras.js @@ -0,0 +1,4 @@ +var namespacepu_1_1ui_1_1extras = +[ + [ "Toast", "dc/d49/classpu_1_1ui_1_1extras_1_1_toast.html", "dc/d49/classpu_1_1ui_1_1extras_1_1_toast" ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.html b/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.html new file mode 100644 index 0000000..31f9941 --- /dev/null +++ b/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.html @@ -0,0 +1,476 @@ + + + + + + + +Plutonium framework API: pu::ui::Overlay Class Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::Overlay Class Reference
+
+
+ +

#include <ui_Overlay.hpp>

+
+Inheritance diagram for pu::ui::Overlay:
+
+
+ + +pu::ui::Container +pu::ui::extras::Toast + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Overlay (const i32 x, const i32 y, const i32 width, const i32 height, const Color bg_clr, const bool round=true, const i32 radius=DefaultRadius)
 
void SetRadius (const i32 radius)
 
i32 GetRadius ()
 
virtual void OnPreRender (render::Renderer::Ref &drawer)
 
virtual void OnPostRender (render::Renderer::Ref &drawer)
 
bool Render (render::Renderer::Ref &drawer)
 
void NotifyEnding (const bool ending)
 
- 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 i32 DefaultRadius = 25
 
static constexpr i32 MaxFadeAlpha = 200
 
static constexpr i32 FadeAlphaVariation = 25
 
+ + + + + + + + + + + + +

+Additional Inherited Members

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

Constructor & Destructor Documentation

+ +

◆ Overlay()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pu::ui::Overlay::Overlay (const i32 x,
const i32 y,
const i32 width,
const i32 height,
const Color bg_clr,
const bool round = true,
const i32 radius = DefaultRadius 
)
+
+inline
+
+ +
+
+

Member Function Documentation

+ +

◆ GetRadius()

+ +
+
+ + + + + +
+ + + + + + + +
i32 pu::ui::Overlay::GetRadius ()
+
+inline
+
+ +
+
+ +

◆ NotifyEnding()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Overlay::NotifyEnding (const bool ending)
+
+inline
+
+ +
+
+ +

◆ OnPostRender()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void pu::ui::Overlay::OnPostRender (render::Renderer::Ref & drawer)
+
+inlinevirtual
+
+ +

Reimplemented in pu::ui::extras::Toast.

+ +
+
+ +

◆ OnPreRender()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void pu::ui::Overlay::OnPreRender (render::Renderer::Ref & drawer)
+
+inlinevirtual
+
+ +

Reimplemented in pu::ui::extras::Toast.

+ +
+
+ +

◆ Render()

+ +
+
+ + + + + + + + +
bool pu::ui::Overlay::Render (render::Renderer::Ref & drawer)
+
+ +
+
+ +

◆ SetRadius()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Overlay::SetRadius (const i32 radius)
+
+inline
+
+ +
+
+

Member Data Documentation

+ +

◆ DefaultRadius

+ +
+
+ + + + + +
+ + + + +
constexpr i32 pu::ui::Overlay::DefaultRadius = 25
+
+staticconstexpr
+
+ +
+
+ +

◆ FadeAlphaVariation

+ +
+
+ + + + + +
+ + + + +
constexpr i32 pu::ui::Overlay::FadeAlphaVariation = 25
+
+staticconstexpr
+
+ +
+
+ +

◆ MaxFadeAlpha

+ +
+
+ + + + + +
+ + + + +
constexpr i32 pu::ui::Overlay::MaxFadeAlpha = 200
+
+staticconstexpr
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.js b/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.js new file mode 100644 index 0000000..c8b8255 --- /dev/null +++ b/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.js @@ -0,0 +1,13 @@ +var classpu_1_1ui_1_1_overlay = +[ + [ "Overlay", "d6/d8f/classpu_1_1ui_1_1_overlay.html#ae269740916cc9360b1969b8cf819524e", null ], + [ "GetRadius", "d6/d8f/classpu_1_1ui_1_1_overlay.html#af1e9643a929bdd34982fbc41472fc8f7", null ], + [ "NotifyEnding", "d6/d8f/classpu_1_1ui_1_1_overlay.html#a099a0e84e2e7173429ab9c93c9962be2", null ], + [ "OnPostRender", "d6/d8f/classpu_1_1ui_1_1_overlay.html#a1c8129b7b18c3394f1ae89a6b18587ac", null ], + [ "OnPreRender", "d6/d8f/classpu_1_1ui_1_1_overlay.html#ab2789bf02ae80a066f83a901af33f540", null ], + [ "Render", "d6/d8f/classpu_1_1ui_1_1_overlay.html#a3a542634d1251b7186b7ef2cd04b1d7d", null ], + [ "SetRadius", "d6/d8f/classpu_1_1ui_1_1_overlay.html#ad034a65041f532860ec06290e23d1fbe", null ], + [ "DefaultRadius", "d6/d8f/classpu_1_1ui_1_1_overlay.html#a556ea751947340b653b9eba75d17df33", null ], + [ "FadeAlphaVariation", "d6/d8f/classpu_1_1ui_1_1_overlay.html#a160e03ad703d8c8627f1f53dbcd455e5", null ], + [ "MaxFadeAlpha", "d6/d8f/classpu_1_1ui_1_1_overlay.html#a8b935b2d5134a9b818a2abc8f8ca166f", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.png b/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.png new file mode 100644 index 0000000..9755360 Binary files /dev/null and b/include/Plutonium/docs/d6/d8f/classpu_1_1ui_1_1_overlay.png differ diff --git a/include/Plutonium/docs/d6/db1/classpu_1_1ui_1_1_dialog-members.html b/include/Plutonium/docs/d6/db1/classpu_1_1ui_1_1_dialog-members.html new file mode 100644 index 0000000..134c780 --- /dev/null +++ b/include/Plutonium/docs/d6/db1/classpu_1_1ui_1_1_dialog-members.html @@ -0,0 +1,138 @@ + + + + + + + +Plutonium framework API: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
pu::ui::Dialog Member List
+
+
+ +

This is the complete list of members for pu::ui::Dialog, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AddOption(const std::string &opt_name)pu::ui::Dialog
ContentExtraWidthpu::ui::Dialogstatic
ContentXpu::ui::Dialogstatic
ContentYpu::ui::Dialogstatic
DefaultContentColorpu::ui::Dialogstatic
DefaultOptionColorpu::ui::Dialogstatic
DefaultTitleColorpu::ui::Dialogstatic
Dialog(const std::string &title, const std::string &content)pu::ui::Dialog
DialogBorderRadiuspu::ui::Dialogstatic
DialogExtraBaseWidthpu::ui::Dialogstatic
FadeAlphaIncrementpu::ui::Dialogstatic
HasCancelOption()pu::ui::Dialoginline
HasIcon()pu::ui::Dialoginline
IconExtraHeightpu::ui::Dialogstatic
IconMarginpu::ui::Dialogstatic
IsOk()pu::ui::Dialoginline
MakeDialogColor(const u8 alpha)pu::ui::Dialoginlinestatic
MakeOverColor(const u8 alpha)pu::ui::Dialoginlinestatic
MaxScreenFadeAlphapu::ui::Dialogstatic
OptionBorderRadiuspu::ui::Dialogstatic
OptionBottomMarginpu::ui::Dialogstatic
OptionHeightpu::ui::Dialogstatic
OptionHorizontalMarginpu::ui::Dialogstatic
OptionsBaseHorizontalMarginpu::ui::Dialogstatic
OverAlphaIncrementpu::ui::Dialogstatic
RemoveCancelOption()pu::ui::Dialoginline
SetCancelOption(const std::string &opt_name)pu::ui::Dialoginline
SetIcon(const std::string &icon_path)pu::ui::Dialog
Show(Application *app_ref)pu::ui::Dialog
SpaceBetweenContentAndOptionspu::ui::Dialogstatic
SpaceBetweenOptionspu::ui::Dialogstatic
TitleExtraWidthpu::ui::Dialogstatic
TitleTopMarginpu::ui::Dialogstatic
TitleXpu::ui::Dialogstatic
TitleYpu::ui::Dialogstatic
UserCancelled()pu::ui::Dialoginline
~Dialog()pu::ui::Dialog
+
+ + + + diff --git a/include/Plutonium/docs/d6/ddb/classpu_1_1ui_1_1_container-members.html b/include/Plutonium/docs/d6/ddb/classpu_1_1ui_1_1_container-members.html new file mode 100644 index 0000000..87b58f8 --- /dev/null +++ b/include/Plutonium/docs/d6/ddb/classpu_1_1ui_1_1_container-members.html @@ -0,0 +1,121 @@ + + + + + + + +Plutonium framework API: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
pu::ui::Container Member List
+
+
+ +

This is the complete list of members for pu::ui::Container, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + +
Add(elm::Element::Ref elem)pu::ui::Containerinline
At(const i32 idx)pu::ui::Containerinline
Clear()pu::ui::Containerinline
Container(const i32 x, const i32 y, const i32 width, const i32 height)pu::ui::Containerinline
elemspu::ui::Containerprotected
GetCount()pu::ui::Containerinline
GetHeight()pu::ui::Containerinline
GetWidth()pu::ui::Containerinline
GetX()pu::ui::Containerinline
GetY()pu::ui::Containerinline
hpu::ui::Containerprotected
Has(elm::Element::Ref &elem)pu::ui::Containerinline
PreRender()pu::ui::Container
SetHeight(const i32 height)pu::ui::Containerinline
SetWidth(const i32 width)pu::ui::Containerinline
SetX(const i32 x)pu::ui::Containerinline
SetY(const i32 y)pu::ui::Containerinline
wpu::ui::Containerprotected
xpu::ui::Containerprotected
ypu::ui::Containerprotected
+
+ + + + diff --git a/include/Plutonium/docs/d6/ddd/ttf___font_8hpp.html b/include/Plutonium/docs/d6/ddd/ttf___font_8hpp.html new file mode 100644 index 0000000..bbf3546 --- /dev/null +++ b/include/Plutonium/docs/d6/ddd/ttf___font_8hpp.html @@ -0,0 +1,120 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ttf/ttf_Font.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
ttf_Font.hpp File Reference
+
+
+
#include <pu/sdl2/sdl2_Types.hpp>
+#include <pu/ui/ui_Types.hpp>
+#include <vector>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ttf::Font
 
+ + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ttf
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d6/ddd/ttf___font_8hpp_source.html b/include/Plutonium/docs/d6/ddd/ttf___font_8hpp_source.html new file mode 100644 index 0000000..26ddc64 --- /dev/null +++ b/include/Plutonium/docs/d6/ddd/ttf___font_8hpp_source.html @@ -0,0 +1,210 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ttf/ttf_Font.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
ttf_Font.hpp
+
+
+Go to the documentation of this file.
1
+
2#pragma once
+ +
4#include <pu/ui/ui_Types.hpp>
+
5#include <vector>
+
6
+
7namespace pu::ttf {
+
8
+
9 class Font {
+
10 private:
+
11 using FontFaceDisposingFunction = void(*)(void*);
+
12
+
13 struct FontFace {
+
14 sdl2::Font font;
+
15 void *ptr;
+
16 size_t ptr_sz;
+
17 FontFaceDisposingFunction dispose_fn;
+
18
+
19 FontFace(void *buf, const size_t buf_size, FontFaceDisposingFunction disp_fn, const u32 font_sz, void *font_class_ptr) : font(nullptr), ptr(buf), ptr_sz(buf_size), dispose_fn(disp_fn) {
+
20 this->font = TTF_OpenFontRW(SDL_RWFromMem(this->ptr, this->ptr_sz), 1, font_sz);
+
21 if(this->font != nullptr) {
+
22 TTF_CppWrap_SetCppPtrRef(this->font, font_class_ptr);
+
23 }
+
24 }
+
25
+
26 FontFace() : font(nullptr), ptr(nullptr), ptr_sz(0), dispose_fn(EmptyFontFaceDisposingFunction) {}
+
27
+
28 inline bool IsSourceValid() {
+
29 // AKA - is the base ptr and size valid?
+
30 return (this->ptr != nullptr) && (this->ptr_sz > 0);
+
31 }
+
32
+
33 void DisposeFont() {
+
34 if(this->font != nullptr) {
+
35 TTF_CloseFont(this->font);
+
36 this->font = nullptr;
+
37 }
+
38 }
+
39
+
40 void Dispose() {
+
41 this->DisposeFont();
+
42 if(this->IsSourceValid()) {
+
43 (this->dispose_fn)(this->ptr);
+
44 this->ptr = nullptr;
+
45 this->ptr_sz = 0;
+
46 }
+
47 }
+
48
+
49 };
+
50
+
51 std::vector<std::pair<i32, std::unique_ptr<FontFace>>> font_faces;
+
52 u32 font_size;
+
53
+
54 inline sdl2::Font TryGetFirstFont() {
+
55 if(!this->font_faces.empty()) {
+
56 return this->font_faces.begin()->second->font;
+
57 }
+
58 return nullptr;
+
59 }
+
60
+
61 public:
+
62 static constexpr i32 InvalidFontFaceIndex = -1;
+
63 static constexpr u32 DefaultFontSize = 25;
+
64
+
65 static void EmptyFontFaceDisposingFunction(void*) {}
+
66
+
67 static inline constexpr bool IsValidFontFaceIndex(const i32 index) {
+
68 return index != InvalidFontFaceIndex;
+
69 }
+
70
+
71 Font(const u32 font_sz) : font_size(font_sz) {}
+ +
73
+
74 i32 LoadFromMemory(void *ptr, const size_t size, FontFaceDisposingFunction disp_fn);
+
75 i32 LoadFromFile(const std::string &path);
+
76 void Unload(const i32 font_idx);
+
77
+
78 inline u32 GetFontSize() {
+
79 return this->font_size;
+
80 }
+
81
+ +
83 std::pair<u32, u32> GetTextDimensions(const std::string &str);
+
84 sdl2::Texture RenderText(const std::string &str, const ui::Color clr);
+
85 };
+
86
+
87}
+
Definition: ttf_Font.hpp:9
+
void Unload(const i32 font_idx)
+
static void EmptyFontFaceDisposingFunction(void *)
Definition: ttf_Font.hpp:65
+ +
i32 LoadFromMemory(void *ptr, const size_t size, FontFaceDisposingFunction disp_fn)
+
sdl2::Texture RenderText(const std::string &str, const ui::Color clr)
+
u32 GetFontSize()
Definition: ttf_Font.hpp:78
+
static constexpr i32 InvalidFontFaceIndex
Definition: ttf_Font.hpp:62
+
sdl2::Font FindValidFontFor(const char ch)
+
static constexpr bool IsValidFontFaceIndex(const i32 index)
Definition: ttf_Font.hpp:67
+
Font(const u32 font_sz)
Definition: ttf_Font.hpp:71
+
static constexpr u32 DefaultFontSize
Definition: ttf_Font.hpp:63
+
i32 LoadFromFile(const std::string &path)
+
std::pair< u32, u32 > GetTextDimensions(const std::string &str)
+
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
+
TTF_Font * Font
Definition: sdl2_Types.hpp:14
+
Definition: ttf_Font.hpp:7
+
s32 i32
Definition: pu_Include.hpp:28
+
DECLSPEC void SDLCALL TTF_CloseFont(TTF_Font *font)
+
DECLSPEC TTF_Font *SDLCALL TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize)
+
void TTF_CppWrap_SetCppPtrRef(TTF_Font *font, void *cpp_ptr_ref)
+ +
Definition: ui_Types.hpp:44
+ +
+
+ + + + diff --git a/include/Plutonium/docs/d6/de9/classpu_1_1ui_1_1_dialog.html b/include/Plutonium/docs/d6/de9/classpu_1_1ui_1_1_dialog.html new file mode 100644 index 0000000..a29c073 --- /dev/null +++ b/include/Plutonium/docs/d6/de9/classpu_1_1ui_1_1_dialog.html @@ -0,0 +1,1026 @@ + + + + + + + +Plutonium framework API: pu::ui::Dialog Class Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::Dialog Class Reference
+
+
+ +

#include <ui_Dialog.hpp>

+ + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Dialog (const std::string &title, const std::string &content)
 
 ~Dialog ()
 
void AddOption (const std::string &opt_name)
 
void SetCancelOption (const std::string &opt_name)
 
void RemoveCancelOption ()
 
bool HasCancelOption ()
 
void SetIcon (const std::string &icon_path)
 
constexpr bool HasIcon ()
 
i32 Show (Application *app_ref)
 
constexpr bool UserCancelled ()
 
bool IsOk ()
 
+ + + + + +

+Static Public Member Functions

static constexpr Color MakeDialogColor (const u8 alpha)
 
static constexpr Color MakeOverColor (const u8 alpha)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Static Public Attributes

static constexpr Color DefaultTitleColor = { 0xA, 0xA, 0xA, 0xFF }
 
static constexpr Color DefaultContentColor = { 0x14, 0x14, 0x14, 0xFF }
 
static constexpr Color DefaultOptionColor = { 0xA, 0xA, 0xA, 0xFF }
 
static constexpr u32 DialogExtraBaseWidth = 250
 
static constexpr u32 DialogBorderRadius = 35
 
static constexpr u32 SpaceBetweenOptions = 20
 
static constexpr u32 TitleExtraWidth = 90
 
static constexpr u32 ContentExtraWidth = 90
 
static constexpr u32 SpaceBetweenContentAndOptions = 140
 
static constexpr u32 TitleTopMargin = 20
 
static constexpr u32 TitleX = 45
 
static constexpr u32 TitleY = 55
 
static constexpr u32 ContentX = 45
 
static constexpr u32 ContentY = 140
 
static constexpr u32 IconExtraHeight = 25
 
static constexpr u32 OptionsBaseHorizontalMargin = 45
 
static constexpr u32 OptionHeight = 60
 
static constexpr u32 OptionHorizontalMargin = 30
 
static constexpr u32 OptionBorderRadius = OptionHeight / 3
 
static constexpr u32 OptionBottomMargin = 25
 
static constexpr u8 MaxScreenFadeAlpha = 125
 
static constexpr u32 IconMargin = 30
 
static constexpr u8 OverAlphaIncrement = 48
 
static constexpr u8 FadeAlphaIncrement = 25
 
+

Constructor & Destructor Documentation

+ +

◆ Dialog()

+ +
+
+ + + + + + + + + + + + + + + + + + +
pu::ui::Dialog::Dialog (const std::string & title,
const std::string & content 
)
+
+ +
+
+ +

◆ ~Dialog()

+ +
+
+ + + + + + + +
pu::ui::Dialog::~Dialog ()
+
+ +
+
+

Member Function Documentation

+ +

◆ AddOption()

+ +
+
+ + + + + + + + +
void pu::ui::Dialog::AddOption (const std::string & opt_name)
+
+ +
+
+ +

◆ HasCancelOption()

+ +
+
+ + + + + +
+ + + + + + + +
bool pu::ui::Dialog::HasCancelOption ()
+
+inline
+
+ +
+
+ +

◆ HasIcon()

+ +
+
+ + + + + +
+ + + + + + + +
constexpr bool pu::ui::Dialog::HasIcon ()
+
+inlineconstexpr
+
+ +
+
+ +

◆ IsOk()

+ +
+
+ + + + + +
+ + + + + + + +
bool pu::ui::Dialog::IsOk ()
+
+inline
+
+ +
+
+ +

◆ MakeDialogColor()

+ +
+
+ + + + + +
+ + + + + + + + +
static constexpr Color pu::ui::Dialog::MakeDialogColor (const u8 alpha)
+
+inlinestaticconstexpr
+
+ +
+
+ +

◆ MakeOverColor()

+ +
+
+ + + + + +
+ + + + + + + + +
static constexpr Color pu::ui::Dialog::MakeOverColor (const u8 alpha)
+
+inlinestaticconstexpr
+
+ +
+
+ +

◆ RemoveCancelOption()

+ +
+
+ + + + + +
+ + + + + + + +
void pu::ui::Dialog::RemoveCancelOption ()
+
+inline
+
+ +
+
+ +

◆ SetCancelOption()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Dialog::SetCancelOption (const std::string & opt_name)
+
+inline
+
+ +
+
+ +

◆ SetIcon()

+ +
+
+ + + + + + + + +
void pu::ui::Dialog::SetIcon (const std::string & icon_path)
+
+ +
+
+ +

◆ Show()

+ +
+
+ + + + + + + + +
i32 pu::ui::Dialog::Show (Applicationapp_ref)
+
+ +
+
+ +

◆ UserCancelled()

+ +
+
+ + + + + +
+ + + + + + + +
constexpr bool pu::ui::Dialog::UserCancelled ()
+
+inlineconstexpr
+
+ +
+
+

Member Data Documentation

+ +

◆ ContentExtraWidth

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::ContentExtraWidth = 90
+
+staticconstexpr
+
+ +
+
+ +

◆ ContentX

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::ContentX = 45
+
+staticconstexpr
+
+ +
+
+ +

◆ ContentY

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::ContentY = 140
+
+staticconstexpr
+
+ +
+
+ +

◆ DefaultContentColor

+ +
+
+ + + + + +
+ + + + +
constexpr Color pu::ui::Dialog::DefaultContentColor = { 0x14, 0x14, 0x14, 0xFF }
+
+staticconstexpr
+
+ +
+
+ +

◆ DefaultOptionColor

+ +
+
+ + + + + +
+ + + + +
constexpr Color pu::ui::Dialog::DefaultOptionColor = { 0xA, 0xA, 0xA, 0xFF }
+
+staticconstexpr
+
+ +
+
+ +

◆ DefaultTitleColor

+ +
+
+ + + + + +
+ + + + +
constexpr Color pu::ui::Dialog::DefaultTitleColor = { 0xA, 0xA, 0xA, 0xFF }
+
+staticconstexpr
+
+ +
+
+ +

◆ DialogBorderRadius

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::DialogBorderRadius = 35
+
+staticconstexpr
+
+ +
+
+ +

◆ DialogExtraBaseWidth

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::DialogExtraBaseWidth = 250
+
+staticconstexpr
+
+ +
+
+ +

◆ FadeAlphaIncrement

+ +
+
+ + + + + +
+ + + + +
constexpr u8 pu::ui::Dialog::FadeAlphaIncrement = 25
+
+staticconstexpr
+
+ +
+
+ +

◆ IconExtraHeight

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::IconExtraHeight = 25
+
+staticconstexpr
+
+ +
+
+ +

◆ IconMargin

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::IconMargin = 30
+
+staticconstexpr
+
+ +
+
+ +

◆ MaxScreenFadeAlpha

+ +
+
+ + + + + +
+ + + + +
constexpr u8 pu::ui::Dialog::MaxScreenFadeAlpha = 125
+
+staticconstexpr
+
+ +
+
+ +

◆ OptionBorderRadius

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::OptionBorderRadius = OptionHeight / 3
+
+staticconstexpr
+
+ +
+
+ +

◆ OptionBottomMargin

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::OptionBottomMargin = 25
+
+staticconstexpr
+
+ +
+
+ +

◆ OptionHeight

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::OptionHeight = 60
+
+staticconstexpr
+
+ +
+
+ +

◆ OptionHorizontalMargin

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::OptionHorizontalMargin = 30
+
+staticconstexpr
+
+ +
+
+ +

◆ OptionsBaseHorizontalMargin

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::OptionsBaseHorizontalMargin = 45
+
+staticconstexpr
+
+ +
+
+ +

◆ OverAlphaIncrement

+ +
+
+ + + + + +
+ + + + +
constexpr u8 pu::ui::Dialog::OverAlphaIncrement = 48
+
+staticconstexpr
+
+ +
+
+ +

◆ SpaceBetweenContentAndOptions

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::SpaceBetweenContentAndOptions = 140
+
+staticconstexpr
+
+ +
+
+ +

◆ SpaceBetweenOptions

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::SpaceBetweenOptions = 20
+
+staticconstexpr
+
+ +
+
+ +

◆ TitleExtraWidth

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::TitleExtraWidth = 90
+
+staticconstexpr
+
+ +
+
+ +

◆ TitleTopMargin

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::TitleTopMargin = 20
+
+staticconstexpr
+
+ +
+
+ +

◆ TitleX

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::TitleX = 45
+
+staticconstexpr
+
+ +
+
+ +

◆ TitleY

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::Dialog::TitleY = 55
+
+staticconstexpr
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/include/Plutonium/docs/d6/de9/classpu_1_1ui_1_1_dialog.js b/include/Plutonium/docs/d6/de9/classpu_1_1ui_1_1_dialog.js new file mode 100644 index 0000000..735efeb --- /dev/null +++ b/include/Plutonium/docs/d6/de9/classpu_1_1ui_1_1_dialog.js @@ -0,0 +1,40 @@ +var classpu_1_1ui_1_1_dialog = +[ + [ "Dialog", "d6/de9/classpu_1_1ui_1_1_dialog.html#afc67f186d26698c0d5c3d15f644cd501", null ], + [ "~Dialog", "d6/de9/classpu_1_1ui_1_1_dialog.html#a4dcf88722bf75361b54cb2cb6c91ba16", null ], + [ "AddOption", "d6/de9/classpu_1_1ui_1_1_dialog.html#aaacd3a9c44331859a4087c48df856c53", null ], + [ "HasCancelOption", "d6/de9/classpu_1_1ui_1_1_dialog.html#a13c6ba3d67a7f552b43557928c2b6ea3", null ], + [ "HasIcon", "d6/de9/classpu_1_1ui_1_1_dialog.html#abfb4fcb0175df1faf4bfaa72ce55dcc9", null ], + [ "IsOk", "d6/de9/classpu_1_1ui_1_1_dialog.html#af2086ba386105a84cfcf65f8f9430562", null ], + [ "MakeDialogColor", "d6/de9/classpu_1_1ui_1_1_dialog.html#ab3b934675298ac45ad58d4180d2bd872", null ], + [ "MakeOverColor", "d6/de9/classpu_1_1ui_1_1_dialog.html#a1d8adfcc184e23b0bba8abf7771e8bf5", null ], + [ "RemoveCancelOption", "d6/de9/classpu_1_1ui_1_1_dialog.html#a9caa4a55531254c6eecff4a04076f7fb", null ], + [ "SetCancelOption", "d6/de9/classpu_1_1ui_1_1_dialog.html#a0d0e6ee0268af2cffe7005097baf74d8", null ], + [ "SetIcon", "d6/de9/classpu_1_1ui_1_1_dialog.html#af4c04bd69f71170ba22853b99a3a5b2b", null ], + [ "Show", "d6/de9/classpu_1_1ui_1_1_dialog.html#a4e042cbd9150cbfc49844a00fba4e13f", null ], + [ "UserCancelled", "d6/de9/classpu_1_1ui_1_1_dialog.html#a0b16de4fe2a9ccbacb001fc72d224ee6", null ], + [ "ContentExtraWidth", "d6/de9/classpu_1_1ui_1_1_dialog.html#aee6d9fd374e84cc9f6884b38cc1da8c8", null ], + [ "ContentX", "d6/de9/classpu_1_1ui_1_1_dialog.html#ae6f99c1963bb6090dd378ea7ac233b11", null ], + [ "ContentY", "d6/de9/classpu_1_1ui_1_1_dialog.html#a0cef5166fe1596798b4f807f3b873d96", null ], + [ "DefaultContentColor", "d6/de9/classpu_1_1ui_1_1_dialog.html#a243819febdc26a20ec183c385f522237", null ], + [ "DefaultOptionColor", "d6/de9/classpu_1_1ui_1_1_dialog.html#aea9d6835c8698f7cf16f33c83ad332e9", null ], + [ "DefaultTitleColor", "d6/de9/classpu_1_1ui_1_1_dialog.html#a04c1f79f4619fd6d62ba050ce1bdd9a3", null ], + [ "DialogBorderRadius", "d6/de9/classpu_1_1ui_1_1_dialog.html#ad36b9adb17f68581dce346eba58e5ade", null ], + [ "DialogExtraBaseWidth", "d6/de9/classpu_1_1ui_1_1_dialog.html#a613a931c7b5f212666dcde18c796165f", null ], + [ "FadeAlphaIncrement", "d6/de9/classpu_1_1ui_1_1_dialog.html#aed735681191da7235a59adfdf9760eaa", null ], + [ "IconExtraHeight", "d6/de9/classpu_1_1ui_1_1_dialog.html#ac435b5801787872f4e83d67725bda9a4", null ], + [ "IconMargin", "d6/de9/classpu_1_1ui_1_1_dialog.html#a1ff0c652a99b0a9cae2efac10d0ccdc0", null ], + [ "MaxScreenFadeAlpha", "d6/de9/classpu_1_1ui_1_1_dialog.html#a04a7b26c55c1e812ee770a61f1ec7c22", null ], + [ "OptionBorderRadius", "d6/de9/classpu_1_1ui_1_1_dialog.html#a21dd7e0bf223f609f9eef520ae9a1b80", null ], + [ "OptionBottomMargin", "d6/de9/classpu_1_1ui_1_1_dialog.html#a78405dac28a8e430838da9732e07038e", null ], + [ "OptionHeight", "d6/de9/classpu_1_1ui_1_1_dialog.html#a7b4c4d9b2c00747e3ac27b4ebcd6566a", null ], + [ "OptionHorizontalMargin", "d6/de9/classpu_1_1ui_1_1_dialog.html#a2000838c869854f29b95f5584ba3d9de", null ], + [ "OptionsBaseHorizontalMargin", "d6/de9/classpu_1_1ui_1_1_dialog.html#a96f60e2130658d5098e77c5a77f373e3", null ], + [ "OverAlphaIncrement", "d6/de9/classpu_1_1ui_1_1_dialog.html#aa4187388a2aea6035ef58d8a1732108b", null ], + [ "SpaceBetweenContentAndOptions", "d6/de9/classpu_1_1ui_1_1_dialog.html#a83362018361b92e5bd8934e62ac08849", null ], + [ "SpaceBetweenOptions", "d6/de9/classpu_1_1ui_1_1_dialog.html#ab31d5ebf1ebd0ceaacbb2591c66a91fd", null ], + [ "TitleExtraWidth", "d6/de9/classpu_1_1ui_1_1_dialog.html#a2b76d58196d39199e2932b8faec0d1c8", null ], + [ "TitleTopMargin", "d6/de9/classpu_1_1ui_1_1_dialog.html#a330c1873068db3c687d30954550b0c72", null ], + [ "TitleX", "d6/de9/classpu_1_1ui_1_1_dialog.html#ac88985313d52c067ba9c0790740e76eb", null ], + [ "TitleY", "d6/de9/classpu_1_1ui_1_1_dialog.html#a9b71e4ba6d98dd724ead594e76876dc9", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d7/d0c/structpu_1_1ui_1_1_color.html b/include/Plutonium/docs/d7/d0c/structpu_1_1ui_1_1_color.html new file mode 100644 index 0000000..c7b59c0 --- /dev/null +++ b/include/Plutonium/docs/d7/d0c/structpu_1_1ui_1_1_color.html @@ -0,0 +1,291 @@ + + + + + + + +Plutonium framework API: pu::ui::Color Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::Color Struct Reference
+
+
+ +

#include <ui_Types.hpp>

+ + + + + + +

+Public Member Functions

constexpr Color ()
 
constexpr Color (const u8 r, const u8 g, const u8 b, const u8 a)
 
+ + + +

+Static Public Member Functions

static Color FromHex (const std::string &str_clr)
 
+ + + + + + + + + +

+Public Attributes

u8 r
 
u8 g
 
u8 b
 
u8 a
 
+

Constructor & Destructor Documentation

+ +

◆ Color() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
constexpr pu::ui::Color::Color ()
+
+inlineconstexpr
+
+ +
+
+ +

◆ Color() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
constexpr pu::ui::Color::Color (const u8 r,
const u8 g,
const u8 b,
const u8 a 
)
+
+inlineconstexpr
+
+ +
+
+

Member Function Documentation

+ +

◆ FromHex()

+ +
+
+ + + + + +
+ + + + + + + + +
static Color pu::ui::Color::FromHex (const std::string & str_clr)
+
+static
+
+ +
+
+

Member Data Documentation

+ +

◆ a

+ +
+
+ + + + +
u8 pu::ui::Color::a
+
+ +
+
+ +

◆ b

+ +
+
+ + + + +
u8 pu::ui::Color::b
+
+ +
+
+ +

◆ g

+ +
+
+ + + + +
u8 pu::ui::Color::g
+
+ +
+
+ +

◆ r

+ +
+
+ + + + +
u8 pu::ui::Color::r
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/include/Plutonium/docs/d7/d0c/structpu_1_1ui_1_1_color.js b/include/Plutonium/docs/d7/d0c/structpu_1_1ui_1_1_color.js new file mode 100644 index 0000000..33fb537 --- /dev/null +++ b/include/Plutonium/docs/d7/d0c/structpu_1_1ui_1_1_color.js @@ -0,0 +1,10 @@ +var structpu_1_1ui_1_1_color = +[ + [ "Color", "d7/d0c/structpu_1_1ui_1_1_color.html#adef2f6a421806d673966db29846da573", null ], + [ "Color", "d7/d0c/structpu_1_1ui_1_1_color.html#ae82d21739871896b29969910b7f48623", null ], + [ "FromHex", "d7/d0c/structpu_1_1ui_1_1_color.html#a36c556d915a95745227672074bd8f95a", null ], + [ "a", "d7/d0c/structpu_1_1ui_1_1_color.html#a5c34ea431e3f4bdeb80c2bf6a2cf0950", null ], + [ "b", "d7/d0c/structpu_1_1ui_1_1_color.html#ae55e2a30e1796df374dd677d31d83342", null ], + [ "g", "d7/d0c/structpu_1_1ui_1_1_color.html#a4674bc7b15dea3d689f6310185347586", null ], + [ "r", "d7/d0c/structpu_1_1ui_1_1_color.html#a85b0f2161d79f9260d7fbbe5db89a07b", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d7/d3f/elm___text_block_8hpp.html b/include/Plutonium/docs/d7/d3f/elm___text_block_8hpp.html new file mode 100644 index 0000000..6bf2da3 --- /dev/null +++ b/include/Plutonium/docs/d7/d3f/elm___text_block_8hpp.html @@ -0,0 +1,120 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_TextBlock.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
elm_TextBlock.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ui::elm::TextBlock
 
+ + + + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
namespace  pu::ui::elm
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d7/d3f/elm___text_block_8hpp_source.html b/include/Plutonium/docs/d7/d3f/elm___text_block_8hpp_source.html new file mode 100644 index 0000000..3afcec6 --- /dev/null +++ b/include/Plutonium/docs/d7/d3f/elm___text_block_8hpp_source.html @@ -0,0 +1,195 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_TextBlock.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
elm_TextBlock.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file TextBlock.hpp
+
7 @brief A TextBlock is a very useful Element which is used to draw text on the screen.
+
8 @author XorTroll
+
9
+
10 @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
+
11
+
12*/
+
13
+
14#pragma once
+ +
16
+
17namespace pu::ui::elm {
+
18
+
19 class TextBlock : public Element {
+
20 public:
+
21 static constexpr Color DefaultColor = { 0, 0, 0, 0xFF };
+
22
+
23 private:
+
24 i32 x;
+
25 i32 y;
+
26 Color clr;
+
27 std::string text;
+
28 sdl2::Texture text_tex;
+
29 std::string fnt_name;
+
30
+
31 public:
+
32 TextBlock(const i32 x, const i32 y, const std::string &text);
+ + +
35
+
36 inline i32 GetX() override {
+
37 return this->x;
+
38 }
+
39
+
40 inline void SetX(const i32 x) {
+
41 this->x = x;
+
42 }
+
43
+
44 inline i32 GetY() override {
+
45 return this->y;
+
46 }
+
47
+
48 inline void SetY(const i32 y) {
+
49 this->y = y;
+
50 }
+
51
+
52 i32 GetWidth() override;
+
53 i32 GetHeight() override;
+
54
+
55 inline std::string GetText() {
+
56 return this->text;
+
57 }
+
58
+
59 void SetText(const std::string &text);
+
60 void SetFont(const std::string &font_name);
+
61
+
62 inline Color GetColor() {
+
63 return this->clr;
+
64 }
+
65
+
66 void SetColor(const Color clr);
+
67 void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) override;
+
68 void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override {}
+
69 };
+
70
+
71}
+
Definition: elm_Element.hpp:37
+
Definition: elm_TextBlock.hpp:19
+
static constexpr Color DefaultColor
Definition: elm_TextBlock.hpp:21
+
void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override
Definition: elm_TextBlock.hpp:68
+
void SetX(const i32 x)
Definition: elm_TextBlock.hpp:40
+
Color GetColor()
Definition: elm_TextBlock.hpp:62
+ +
TextBlock(const i32 x, const i32 y, const std::string &text)
+
void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) override
+
std::string GetText()
Definition: elm_TextBlock.hpp:55
+
i32 GetHeight() override
+
void SetText(const std::string &text)
+
void SetColor(const Color clr)
+
i32 GetY() override
Definition: elm_TextBlock.hpp:44
+
void SetFont(const std::string &font_name)
+
i32 GetWidth() override
+
void SetY(const i32 y)
Definition: elm_TextBlock.hpp:48
+
i32 GetX() override
Definition: elm_TextBlock.hpp:36
+ +
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
+
Definition: elm_Button.hpp:18
+
s32 i32
Definition: pu_Include.hpp:28
+
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
+
Definition: ui_Types.hpp:44
+
Definition: ui_Types.hpp:62
+
+
+ + + + diff --git a/include/Plutonium/docs/d7/d55/structpu_1_1ui_1_1_touch_point.html b/include/Plutonium/docs/d7/d55/structpu_1_1ui_1_1_touch_point.html new file mode 100644 index 0000000..235f268 --- /dev/null +++ b/include/Plutonium/docs/d7/d55/structpu_1_1ui_1_1_touch_point.html @@ -0,0 +1,292 @@ + + + + + + + +Plutonium framework API: pu::ui::TouchPoint Struct Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::TouchPoint Struct Reference
+
+
+ +

#include <ui_Types.hpp>

+ + + + + + + + + + +

+Public Member Functions

constexpr TouchPoint ()
 
constexpr TouchPoint (const u32 x, const u32 y)
 
constexpr bool IsEmpty () const
 
constexpr bool HitsRegion (const i32 region_x, const i32 region_y, const i32 region_w, const i32 region_h) const
 
+ + + + + +

+Public Attributes

i32 x
 
i32 y
 
+

Constructor & Destructor Documentation

+ +

◆ TouchPoint() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
constexpr pu::ui::TouchPoint::TouchPoint ()
+
+inlineconstexpr
+
+ +
+
+ +

◆ TouchPoint() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
constexpr pu::ui::TouchPoint::TouchPoint (const u32 x,
const u32 y 
)
+
+inlineconstexpr
+
+ +
+
+

Member Function Documentation

+ +

◆ HitsRegion()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
constexpr bool pu::ui::TouchPoint::HitsRegion (const i32 region_x,
const i32 region_y,
const i32 region_w,
const i32 region_h 
) const
+
+inlineconstexpr
+
+ +
+
+ +

◆ IsEmpty()

+ +
+
+ + + + + +
+ + + + + + + +
constexpr bool pu::ui::TouchPoint::IsEmpty () const
+
+inlineconstexpr
+
+ +
+
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
i32 pu::ui::TouchPoint::x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
i32 pu::ui::TouchPoint::y
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/include/Plutonium/docs/d7/d55/structpu_1_1ui_1_1_touch_point.js b/include/Plutonium/docs/d7/d55/structpu_1_1ui_1_1_touch_point.js new file mode 100644 index 0000000..3ff045a --- /dev/null +++ b/include/Plutonium/docs/d7/d55/structpu_1_1ui_1_1_touch_point.js @@ -0,0 +1,9 @@ +var structpu_1_1ui_1_1_touch_point = +[ + [ "TouchPoint", "d7/d55/structpu_1_1ui_1_1_touch_point.html#a463faa05a99d011664b24321d91afd94", null ], + [ "TouchPoint", "d7/d55/structpu_1_1ui_1_1_touch_point.html#a3101acfec15553d4e497641acf07f1b2", null ], + [ "HitsRegion", "d7/d55/structpu_1_1ui_1_1_touch_point.html#a7797241cb367e5ffbbd2f5d9e7c59929", null ], + [ "IsEmpty", "d7/d55/structpu_1_1ui_1_1_touch_point.html#ad1919bedf08cd88f0f0b5d085f435910", null ], + [ "x", "d7/d55/structpu_1_1ui_1_1_touch_point.html#a911f7a0d75d0b3e8ea256a0ba5530956", null ], + [ "y", "d7/d55/structpu_1_1ui_1_1_touch_point.html#a1b490a4531448177279248ec32286074", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d8/d8f/namespacepu_1_1audio.html b/include/Plutonium/docs/d8/d8f/namespacepu_1_1audio.html new file mode 100644 index 0000000..6c603a5 --- /dev/null +++ b/include/Plutonium/docs/d8/d8f/namespacepu_1_1audio.html @@ -0,0 +1,483 @@ + + + + + + + +Plutonium framework API: pu::audio Namespace Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::audio Namespace Reference
+
+
+ + + + + + +

+Typedefs

using Music = Mix_Music *
 
using Sfx = Mix_Chunk *
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

Music OpenMusic (const std::string &path)
 
void PlayMusic (Music mus, const int loops)
 
void PlayMusicWithFadeIn (Music mus, const i32 llops, const i32 ms)
 
bool IsPlayingMusic ()
 
void PauseMusic ()
 
void ResumeMusic ()
 
void SetMusicVolume (const i32 vol)
 
i32 GetMusicVolume ()
 
void FadeOutMusic (const i32 ms)
 
void RewindMusic ()
 
void StopMusic ()
 
void SetMusicPosition (const double sec)
 
void DestroyMusic (Music &mus)
 
Sfx LoadSfx (const std::string &path)
 
void PlaySfx (Sfx sfx)
 
void DestroySfx (Sfx &sfx)
 
+

Typedef Documentation

+ +

◆ Music

+ +
+
+ + + + +
using pu::audio::Music = typedef Mix_Music*
+
+ +
+
+ +

◆ Sfx

+ +
+
+ + + + +
using pu::audio::Sfx = typedef Mix_Chunk*
+
+ +
+
+

Function Documentation

+ +

◆ DestroyMusic()

+ +
+
+ + + + + + + + +
void pu::audio::DestroyMusic (Musicmus)
+
+ +
+
+ +

◆ DestroySfx()

+ +
+
+ + + + + + + + +
void pu::audio::DestroySfx (Sfxsfx)
+
+ +
+
+ +

◆ FadeOutMusic()

+ +
+
+ + + + + + + + +
void pu::audio::FadeOutMusic (const i32 ms)
+
+ +
+
+ +

◆ GetMusicVolume()

+ +
+
+ + + + + + + +
i32 pu::audio::GetMusicVolume ()
+
+ +
+
+ +

◆ IsPlayingMusic()

+ +
+
+ + + + + + + +
bool pu::audio::IsPlayingMusic ()
+
+ +
+
+ +

◆ LoadSfx()

+ +
+
+ + + + + + + + +
Sfx pu::audio::LoadSfx (const std::string & path)
+
+ +
+
+ +

◆ OpenMusic()

+ +
+
+ + + + + + + + +
Music pu::audio::OpenMusic (const std::string & path)
+
+ +
+
+ +

◆ PauseMusic()

+ +
+
+ + + + + + + +
void pu::audio::PauseMusic ()
+
+ +
+
+ +

◆ PlayMusic()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void pu::audio::PlayMusic (Music mus,
const int loops 
)
+
+ +
+
+ +

◆ PlayMusicWithFadeIn()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void pu::audio::PlayMusicWithFadeIn (Music mus,
const i32 llops,
const i32 ms 
)
+
+ +
+
+ +

◆ PlaySfx()

+ +
+
+ + + + + + + + +
void pu::audio::PlaySfx (Sfx sfx)
+
+ +
+
+ +

◆ ResumeMusic()

+ +
+
+ + + + + + + +
void pu::audio::ResumeMusic ()
+
+ +
+
+ +

◆ RewindMusic()

+ +
+
+ + + + + + + +
void pu::audio::RewindMusic ()
+
+ +
+
+ +

◆ SetMusicPosition()

+ +
+
+ + + + + + + + +
void pu::audio::SetMusicPosition (const double sec)
+
+ +
+
+ +

◆ SetMusicVolume()

+ +
+
+ + + + + + + + +
void pu::audio::SetMusicVolume (const i32 vol)
+
+ +
+
+ +

◆ StopMusic()

+ +
+
+ + + + + + + +
void pu::audio::StopMusic ()
+
+ +
+
+
+
+ + + + diff --git a/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html b/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html new file mode 100644 index 0000000..baf1d91 --- /dev/null +++ b/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html @@ -0,0 +1,728 @@ + + + + + + + +Plutonium framework API: pu::ui::elm::Element Class Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::elm::Element Class Referenceabstract
+
+
+ +

#include <elm_Element.hpp>

+
+Inheritance diagram for pu::ui::elm::Element:
+
+
+ + +pu::ui::elm::Button +pu::ui::elm::Image +pu::ui::elm::Menu +pu::ui::elm::ProgressBar +pu::ui::elm::Rectangle +pu::ui::elm::TextBlock +pu::ui::elm::Toggle + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Element ()
 
virtual ~Element ()
 
virtual i32 GetX ()=0
 
virtual i32 GetY ()=0
 
virtual i32 GetWidth ()=0
 
virtual i32 GetHeight ()=0
 
virtual void OnRender (render::Renderer::Ref &drawer, const i32 x, const i32 y)=0
 
virtual void OnInput (const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos)=0
 
bool IsVisible ()
 
void SetVisible (const bool visible)
 
void SetHorizontalAlign (const HorizontalAlign align)
 
HorizontalAlign GetHorizontalAlign ()
 
void SetVerticalAlign (const VerticalAlign align)
 
VerticalAlign GetVerticalAlign ()
 
void SetParentContainer (Container *parent_container)
 
i32 GetProcessedX ()
 
i32 GetProcessedY ()
 
+ + + + + + + + + +

+Protected Attributes

bool visible
 
HorizontalAlign h_align
 
VerticalAlign v_align
 
Containerparent_container
 
+

Constructor & Destructor Documentation

+ +

◆ Element()

+ +
+
+ + + + + +
+ + + + + + + +
pu::ui::elm::Element::Element ()
+
+inline
+
+ +
+
+ +

◆ ~Element()

+ +
+
+ + + + + +
+ + + + + + + +
virtual pu::ui::elm::Element::~Element ()
+
+inlinevirtual
+
+ +
+
+

Member Function Documentation

+ +

◆ GetHeight()

+ +
+
+ + + + + +
+ + + + + + + +
virtual i32 pu::ui::elm::Element::GetHeight ()
+
+pure virtual
+
+
+ +

◆ GetHorizontalAlign()

+ +
+
+ + + + + +
+ + + + + + + +
HorizontalAlign pu::ui::elm::Element::GetHorizontalAlign ()
+
+inline
+
+ +
+
+ +

◆ GetProcessedX()

+ +
+
+ + + + + + + +
i32 pu::ui::elm::Element::GetProcessedX ()
+
+ +
+
+ +

◆ GetProcessedY()

+ +
+
+ + + + + + + +
i32 pu::ui::elm::Element::GetProcessedY ()
+
+ +
+
+ +

◆ GetVerticalAlign()

+ +
+
+ + + + + +
+ + + + + + + +
VerticalAlign pu::ui::elm::Element::GetVerticalAlign ()
+
+inline
+
+ +
+
+ +

◆ GetWidth()

+ +
+
+ + + + + +
+ + + + + + + +
virtual i32 pu::ui::elm::Element::GetWidth ()
+
+pure virtual
+
+
+ +

◆ GetX()

+ +
+
+ + + + + +
+ + + + + + + +
virtual i32 pu::ui::elm::Element::GetX ()
+
+pure virtual
+
+
+ +

◆ GetY()

+ +
+
+ + + + + +
+ + + + + + + +
virtual i32 pu::ui::elm::Element::GetY ()
+
+pure virtual
+
+
+ +

◆ IsVisible()

+ +
+
+ + + + + +
+ + + + + + + +
bool pu::ui::elm::Element::IsVisible ()
+
+inline
+
+ +
+
+ +

◆ OnInput()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual void pu::ui::elm::Element::OnInput (const u64 keys_down,
const u64 keys_up,
const u64 keys_held,
const TouchPoint touch_pos 
)
+
+pure virtual
+
+
+ +

◆ OnRender()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual void pu::ui::elm::Element::OnRender (render::Renderer::Ref & drawer,
const i32 x,
const i32 y 
)
+
+pure virtual
+
+
+ +

◆ SetHorizontalAlign()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Element::SetHorizontalAlign (const HorizontalAlign align)
+
+inline
+
+ +
+
+ +

◆ SetParentContainer()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Element::SetParentContainer (Containerparent_container)
+
+inline
+
+ +
+
+ +

◆ SetVerticalAlign()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Element::SetVerticalAlign (const VerticalAlign align)
+
+inline
+
+ +
+
+ +

◆ SetVisible()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::elm::Element::SetVisible (const bool visible)
+
+inline
+
+ +
+
+

Member Data Documentation

+ +

◆ h_align

+ +
+
+ + + + + +
+ + + + +
HorizontalAlign pu::ui::elm::Element::h_align
+
+protected
+
+ +
+
+ +

◆ parent_container

+ +
+
+ + + + + +
+ + + + +
Container* pu::ui::elm::Element::parent_container
+
+protected
+
+ +
+
+ +

◆ v_align

+ +
+
+ + + + + +
+ + + + +
VerticalAlign pu::ui::elm::Element::v_align
+
+protected
+
+ +
+
+ +

◆ visible

+ +
+
+ + + + + +
+ + + + +
bool pu::ui::elm::Element::visible
+
+protected
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.js b/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.js new file mode 100644 index 0000000..61aa634 --- /dev/null +++ b/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.js @@ -0,0 +1,24 @@ +var classpu_1_1ui_1_1elm_1_1_element = +[ + [ "Element", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#ace42a2334b07d91fe497afd19d9d0309", null ], + [ "~Element", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a56d6fc9e9a6924ac904cb380d8c38909", null ], + [ "GetHeight", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#aa17f772252020a43f9170b81ead8f30d", null ], + [ "GetHorizontalAlign", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a5c4ca13c8d3d6ad52f819c2065021044", null ], + [ "GetProcessedX", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a4ffe541c96bd748fa94ae17e61eed5c6", null ], + [ "GetProcessedY", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a1bccdd7cf0e52c2d7db2201a30d2287c", null ], + [ "GetVerticalAlign", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a48cb61fcdbc2cf757e0f5abfc00c0800", null ], + [ "GetWidth", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#acdcf10ee65406a78c001c7d8583bff6c", null ], + [ "GetX", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a7d9f78985cfbecb10f469b30850eb44f", null ], + [ "GetY", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a0544cb8bccb6e86eda4ad27dd4de9924", null ], + [ "IsVisible", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a767a3e3f7456881f039e393018f7a11e", null ], + [ "OnInput", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#aeb6bc0689cdd91019565e8b0ed58b079", null ], + [ "OnRender", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a022d9e188640ec7ce186186a96f4a1a1", null ], + [ "SetHorizontalAlign", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#aaca68308c70cafceb4478a7d4136fb0c", null ], + [ "SetParentContainer", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#ade29148867c9c92641413bd2098cfb4c", null ], + [ "SetVerticalAlign", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a2c8c5cdc38c92dc0d21438a2c0140348", null ], + [ "SetVisible", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a6c5335a9797837d95e9125af890ec2b7", null ], + [ "h_align", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a27117765b66cf5a7bcc6d272fac1bf48", null ], + [ "parent_container", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#a2e6c995d5a409815b11e15f1f895534a", null ], + [ "v_align", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#ac9085dcbc1b4061b22075bc1cd32cedd", null ], + [ "visible", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html#ad46fad870d47414f843f2f35d099f1da", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.png b/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.png new file mode 100644 index 0000000..d44d2d3 Binary files /dev/null and b/include/Plutonium/docs/d9/d0e/classpu_1_1ui_1_1elm_1_1_element.png differ diff --git a/include/Plutonium/docs/d9/d3b/elm___element_8hpp.html b/include/Plutonium/docs/d9/d3b/elm___element_8hpp.html new file mode 100644 index 0000000..74b354a --- /dev/null +++ b/include/Plutonium/docs/d9/d3b/elm___element_8hpp.html @@ -0,0 +1,134 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_Element.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
elm_Element.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ui::elm::Element
 
+ + + + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
namespace  pu::ui::elm
 
+ + + + + +

+Enumerations

enum class  pu::ui::elm::HorizontalAlign { pu::ui::elm::Left +, pu::ui::elm::Center +, pu::ui::elm::Right + }
 
enum class  pu::ui::elm::VerticalAlign { pu::ui::elm::Up +, pu::ui::elm::Center +, pu::ui::elm::Down + }
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d9/d3b/elm___element_8hpp.js b/include/Plutonium/docs/d9/d3b/elm___element_8hpp.js new file mode 100644 index 0000000..82f4f42 --- /dev/null +++ b/include/Plutonium/docs/d9/d3b/elm___element_8hpp.js @@ -0,0 +1,14 @@ +var elm___element_8hpp = +[ + [ "pu::ui::elm::Element", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element.html", "d9/d0e/classpu_1_1ui_1_1elm_1_1_element" ], + [ "HorizontalAlign", "d9/d3b/elm___element_8hpp.html#ac2066021dbc53818c251c446b6d7f864", [ + [ "Left", "d9/d3b/elm___element_8hpp.html#ac2066021dbc53818c251c446b6d7f864a945d5e233cf7d6240f6b783b36a374ff", null ], + [ "Center", "d9/d3b/elm___element_8hpp.html#ac2066021dbc53818c251c446b6d7f864a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Right", "d9/d3b/elm___element_8hpp.html#ac2066021dbc53818c251c446b6d7f864a92b09c7c48c520c3c55e497875da437c", null ] + ] ], + [ "VerticalAlign", "d9/d3b/elm___element_8hpp.html#ac33e06ac84db60b2dd5b56b4a1276e92", [ + [ "Up", "d9/d3b/elm___element_8hpp.html#ac33e06ac84db60b2dd5b56b4a1276e92a258f49887ef8d14ac268c92b02503aaa", null ], + [ "Center", "d9/d3b/elm___element_8hpp.html#ac33e06ac84db60b2dd5b56b4a1276e92a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Down", "d9/d3b/elm___element_8hpp.html#ac33e06ac84db60b2dd5b56b4a1276e92a08a38277b0309070706f6652eeae9a53", null ] + ] ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d9/d3b/elm___element_8hpp_source.html b/include/Plutonium/docs/d9/d3b/elm___element_8hpp_source.html new file mode 100644 index 0000000..c5d4781 --- /dev/null +++ b/include/Plutonium/docs/d9/d3b/elm___element_8hpp_source.html @@ -0,0 +1,222 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_Element.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
elm_Element.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file Element.hpp
+
7 @brief An Element is the base of Plutonium UI's content.
+
8 @author XorTroll
+
9
+
10 @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
+
11
+
12*/
+
13
+
14#pragma once
+ +
16
+
17namespace pu::ui {
+
18
+
19 class Container;
+
20
+
21}
+
22
+
23namespace pu::ui::elm {
+
24
+
25 enum class HorizontalAlign {
+
26 Left,
+
27 Center,
+
28 Right
+
29 };
+
30
+
31 enum class VerticalAlign {
+
32 Up,
+
33 Center,
+
34 Down
+
35 };
+
36
+
37 class Element {
+
38 protected:
+
39 bool visible;
+ + + +
43
+
44 public:
+ + +
47 virtual ~Element() {}
+
48
+
49 virtual i32 GetX() = 0;
+
50 virtual i32 GetY() = 0;
+
51 virtual i32 GetWidth() = 0;
+
52 virtual i32 GetHeight() = 0;
+
53 virtual void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) = 0;
+
54 virtual void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) = 0;
+
55
+
56 inline bool IsVisible() {
+
57 return this->visible;
+
58 }
+
59
+
60 inline void SetVisible(const bool visible) {
+
61 this->visible = visible;
+
62 }
+
63
+
64 inline void SetHorizontalAlign(const HorizontalAlign align) {
+
65 this->h_align = align;
+
66 }
+
67
+ +
69 return this->h_align;
+
70 }
+
71
+
72 inline void SetVerticalAlign(const VerticalAlign align) {
+
73 this->v_align = align;
+
74 }
+
75
+ +
77 return this->v_align;
+
78 }
+
79
+ +
81 this->parent_container = parent_container;
+
82 }
+
83
+ + +
86 };
+
87
+
88}
+
Definition: ui_Container.hpp:21
+
Definition: elm_Element.hpp:37
+
virtual void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y)=0
+
virtual i32 GetY()=0
+ +
HorizontalAlign h_align
Definition: elm_Element.hpp:40
+
void SetVerticalAlign(const VerticalAlign align)
Definition: elm_Element.hpp:72
+
Container * parent_container
Definition: elm_Element.hpp:42
+
VerticalAlign GetVerticalAlign()
Definition: elm_Element.hpp:76
+ +
HorizontalAlign GetHorizontalAlign()
Definition: elm_Element.hpp:68
+
void SetVisible(const bool visible)
Definition: elm_Element.hpp:60
+
bool IsVisible()
Definition: elm_Element.hpp:56
+
virtual i32 GetX()=0
+
virtual i32 GetHeight()=0
+
void SetHorizontalAlign(const HorizontalAlign align)
Definition: elm_Element.hpp:64
+
VerticalAlign v_align
Definition: elm_Element.hpp:41
+
virtual i32 GetWidth()=0
+
Element()
Definition: elm_Element.hpp:45
+
bool visible
Definition: elm_Element.hpp:39
+
void SetParentContainer(Container *parent_container)
Definition: elm_Element.hpp:80
+
virtual void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos)=0
+
Definition: elm_Button.hpp:18
+
HorizontalAlign
Definition: elm_Element.hpp:25
+ + + +
VerticalAlign
Definition: elm_Element.hpp:31
+ + +
Definition: elm_Button.hpp:18
+
s32 i32
Definition: pu_Include.hpp:28
+
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
+ +
Definition: ui_Types.hpp:62
+
+
+ + + + diff --git a/include/Plutonium/docs/d9/d7f/namespacepu_1_1ui.html b/include/Plutonium/docs/d9/d7f/namespacepu_1_1ui.html new file mode 100644 index 0000000..d5517b6 --- /dev/null +++ b/include/Plutonium/docs/d9/d7f/namespacepu_1_1ui.html @@ -0,0 +1,377 @@ + + + + + + + +Plutonium framework API: pu::ui Namespace Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui Namespace Reference
+
+
+ + + + + + + + +

+Namespaces

namespace  elm
 
namespace  extras
 
namespace  render
 
+ + + + + + + + + + + + + + + +

+Classes

class  Application
 
struct  Color
 
class  Container
 
class  Dialog
 
class  Layout
 
class  Overlay
 
struct  TouchPoint
 
+ + + +

+Enumerations

enum class  DefaultFontSize : u32 {
+  Small +, Medium +, MediumLarge +, Large +,
+  Count +
+ }
 
+ + + + + + + + + +

+Functions

std::string MakeDefaultFontName (const u32 font_size)
 
constexpr u32 GetDefaultFontSize (const DefaultFontSize kind)
 
std::string GetDefaultFont (const DefaultFontSize kind)
 
static constexpr bool TouchHitsRegion (const i32 touch_x, const i32 touch_y, const i32 region_x, const i32 region_y, const i32 region_w, const i32 region_h)
 
+ + + + + +

+Variables

static constexpr std::array< u32, static_cast< u32 >(DefaultFontSize::Count)> DefaultFontSizes = { 18, 20, 25, 30 }
 
constexpr u64 TouchPseudoKey = HidNpadButton_29
 
+

Enumeration Type Documentation

+ +

◆ DefaultFontSize

+ +
+
+ + + + + +
+ + + + +
enum class pu::ui::DefaultFontSize : u32
+
+strong
+
+ + + + + + +
Enumerator
Small 
Medium 
MediumLarge 
Large 
Count 
+ +
+
+

Function Documentation

+ +

◆ GetDefaultFont()

+ +
+
+ + + + + +
+ + + + + + + + +
std::string pu::ui::GetDefaultFont (const DefaultFontSize kind)
+
+inline
+
+ +
+
+ +

◆ GetDefaultFontSize()

+ +
+
+ + + + + +
+ + + + + + + + +
constexpr u32 pu::ui::GetDefaultFontSize (const DefaultFontSize kind)
+
+inlineconstexpr
+
+ +
+
+ +

◆ MakeDefaultFontName()

+ +
+
+ + + + + +
+ + + + + + + + +
std::string pu::ui::MakeDefaultFontName (const u32 font_size)
+
+inline
+
+ +
+
+ +

◆ TouchHitsRegion()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static constexpr bool pu::ui::TouchHitsRegion (const i32 touch_x,
const i32 touch_y,
const i32 region_x,
const i32 region_y,
const i32 region_w,
const i32 region_h 
)
+
+inlinestaticconstexpr
+
+ +
+
+

Variable Documentation

+ +

◆ DefaultFontSizes

+ +
+
+ + + + + +
+ + + + +
constexpr std::array<u32, static_cast<u32>(DefaultFontSize::Count)> pu::ui::DefaultFontSizes = { 18, 20, 25, 30 }
+
+inlinestaticconstexpr
+
+ +
+
+ +

◆ TouchPseudoKey

+ +
+
+ + + + + +
+ + + + +
constexpr u64 pu::ui::TouchPseudoKey = HidNpadButton_29
+
+constexpr
+
+ +
+
+
+
+ + + + diff --git a/include/Plutonium/docs/d9/d7f/namespacepu_1_1ui.js b/include/Plutonium/docs/d9/d7f/namespacepu_1_1ui.js new file mode 100644 index 0000000..0d2e382 --- /dev/null +++ b/include/Plutonium/docs/d9/d7f/namespacepu_1_1ui.js @@ -0,0 +1,26 @@ +var namespacepu_1_1ui = +[ + [ "elm", "d2/d5e/namespacepu_1_1ui_1_1elm.html", "d2/d5e/namespacepu_1_1ui_1_1elm" ], + [ "extras", "d6/d78/namespacepu_1_1ui_1_1extras.html", "d6/d78/namespacepu_1_1ui_1_1extras" ], + [ "render", "da/d54/namespacepu_1_1ui_1_1render.html", "da/d54/namespacepu_1_1ui_1_1render" ], + [ "Application", "da/dc0/classpu_1_1ui_1_1_application.html", "da/dc0/classpu_1_1ui_1_1_application" ], + [ "Color", "d7/d0c/structpu_1_1ui_1_1_color.html", "d7/d0c/structpu_1_1ui_1_1_color" ], + [ "Container", "dc/dcd/classpu_1_1ui_1_1_container.html", "dc/dcd/classpu_1_1ui_1_1_container" ], + [ "Dialog", "d6/de9/classpu_1_1ui_1_1_dialog.html", "d6/de9/classpu_1_1ui_1_1_dialog" ], + [ "Layout", "d6/d11/classpu_1_1ui_1_1_layout.html", "d6/d11/classpu_1_1ui_1_1_layout" ], + [ "Overlay", "d6/d8f/classpu_1_1ui_1_1_overlay.html", "d6/d8f/classpu_1_1ui_1_1_overlay" ], + [ "TouchPoint", "d7/d55/structpu_1_1ui_1_1_touch_point.html", "d7/d55/structpu_1_1ui_1_1_touch_point" ], + [ "DefaultFontSize", "d9/d7f/namespacepu_1_1ui.html#ad3aa8662a33d0c410412b1cd1d2984f0", [ + [ "Small", "d9/d7f/namespacepu_1_1ui.html#ad3aa8662a33d0c410412b1cd1d2984f0a2660064e68655415da2628c2ae2f7592", null ], + [ "Medium", "d9/d7f/namespacepu_1_1ui.html#ad3aa8662a33d0c410412b1cd1d2984f0a87f8a6ab85c9ced3702b4ea641ad4bb5", null ], + [ "MediumLarge", "d9/d7f/namespacepu_1_1ui.html#ad3aa8662a33d0c410412b1cd1d2984f0a5c44044dc65cd33c6cbd48595f688ef9", null ], + [ "Large", "d9/d7f/namespacepu_1_1ui.html#ad3aa8662a33d0c410412b1cd1d2984f0a3a69b34ce86dacb205936a8094f6c743", null ], + [ "Count", "d9/d7f/namespacepu_1_1ui.html#ad3aa8662a33d0c410412b1cd1d2984f0ae93f994f01c537c4e2f7d8528c3eb5e9", null ] + ] ], + [ "GetDefaultFont", "d9/d7f/namespacepu_1_1ui.html#a84163ed7a0814736bafbcc6a35cf53bb", null ], + [ "GetDefaultFontSize", "d9/d7f/namespacepu_1_1ui.html#a68b017e053d7b2de2fd2eabaa4395d09", null ], + [ "MakeDefaultFontName", "d9/d7f/namespacepu_1_1ui.html#a2dc46745a47dfcca22fbd18451a7dfd3", null ], + [ "TouchHitsRegion", "d9/d7f/namespacepu_1_1ui.html#a24a793f56cfb1058002a3a5d805d454f", null ], + [ "DefaultFontSizes", "d9/d7f/namespacepu_1_1ui.html#acc118c2b07ab399b3f1d6fd5e39e7f01", null ], + [ "TouchPseudoKey", "d9/d7f/namespacepu_1_1ui.html#a66f25a7f79116138f33ff92bfe628c0a", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/d9/dc7/ui___container_8hpp.html b/include/Plutonium/docs/d9/dc7/ui___container_8hpp.html new file mode 100644 index 0000000..a1e6a2c --- /dev/null +++ b/include/Plutonium/docs/d9/dc7/ui___container_8hpp.html @@ -0,0 +1,120 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/ui_Container.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
ui_Container.hpp File Reference
+
+
+
#include <pu/ui/elm/elm_Element.hpp>
+#include <vector>
+#include <bits/stdc++.h>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ui::Container
 
+ + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d9/dc7/ui___container_8hpp_source.html b/include/Plutonium/docs/d9/dc7/ui___container_8hpp_source.html new file mode 100644 index 0000000..d5e3be1 --- /dev/null +++ b/include/Plutonium/docs/d9/dc7/ui___container_8hpp_source.html @@ -0,0 +1,212 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/ui_Container.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
ui_Container.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file ui_Container.hpp
+
7 @brief A Container is a basic object which contains a bunch of Elements.
+
8 @author XorTroll
+
9
+
10 @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
+
11
+
12*/
+
13
+
14#pragma once
+ +
16#include <vector>
+
17#include <bits/stdc++.h>
+
18
+
19namespace pu::ui {
+
20
+
21 class Container {
+
22 protected:
+ + + + +
27 std::vector<elm::Element::Ref> elems;
+
28
+
29 public:
+
30 Container(const i32 x, const i32 y, const i32 width, const i32 height) : x(x), y(y), w(width), h(height), elems() {}
+ +
32
+
33 inline void Add(elm::Element::Ref elem) {
+
34 this->elems.push_back(elem);
+
35 }
+
36
+
37 inline elm::Element::Ref &At(const i32 idx) {
+
38 return this->elems.at(idx);
+
39 }
+
40
+
41 inline bool Has(elm::Element::Ref &elem) {
+
42 return std::find(this->elems.begin(), this->elems.end(), elem) != this->elems.end();
+
43 }
+
44
+
45 inline void Clear() {
+
46 this->elems.clear();
+
47 }
+
48
+
49 inline size_t GetCount() {
+
50 return this->elems.size();
+
51 }
+
52
+
53 inline void SetX(const i32 x) {
+
54 this->x = x;
+
55 }
+
56
+
57 inline i32 GetX() {
+
58 return this->x;
+
59 }
+
60
+
61 inline void SetY(const i32 y) {
+
62 this->y = y;
+
63 }
+
64
+
65 inline i32 GetY() {
+
66 return this->y;
+
67 }
+
68
+
69 inline void SetWidth(const i32 width) {
+
70 this->w = width;
+
71 }
+
72
+
73 inline i32 GetWidth() {
+
74 return this->w;
+
75 }
+
76
+
77 inline void SetHeight(const i32 height) {
+
78 this->h = height;
+
79 }
+
80
+
81 inline i32 GetHeight() {
+
82 return this->h;
+
83 }
+
84
+
85 void PreRender();
+
86 };
+
87
+
88}
+
Definition: ui_Container.hpp:21
+
i32 x
Definition: ui_Container.hpp:23
+
std::vector< elm::Element::Ref > elems
Definition: ui_Container.hpp:27
+
i32 w
Definition: ui_Container.hpp:25
+
size_t GetCount()
Definition: ui_Container.hpp:49
+
bool Has(elm::Element::Ref &elem)
Definition: ui_Container.hpp:41
+
void Clear()
Definition: ui_Container.hpp:45
+
Container(const i32 x, const i32 y, const i32 width, const i32 height)
Definition: ui_Container.hpp:30
+
i32 y
Definition: ui_Container.hpp:24
+
elm::Element::Ref & At(const i32 idx)
Definition: ui_Container.hpp:37
+
i32 GetX()
Definition: ui_Container.hpp:57
+
void SetY(const i32 y)
Definition: ui_Container.hpp:61
+
void SetHeight(const i32 height)
Definition: ui_Container.hpp:77
+
i32 GetHeight()
Definition: ui_Container.hpp:81
+
i32 h
Definition: ui_Container.hpp:26
+ +
void SetX(const i32 x)
Definition: ui_Container.hpp:53
+
void Add(elm::Element::Ref elem)
Definition: ui_Container.hpp:33
+
void SetWidth(const i32 width)
Definition: ui_Container.hpp:69
+
i32 GetY()
Definition: ui_Container.hpp:65
+
i32 GetWidth()
Definition: ui_Container.hpp:73
+ +
Definition: elm_Button.hpp:18
+
s32 i32
Definition: pu_Include.hpp:28
+
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
+
+
+ + + + diff --git a/include/Plutonium/docs/d9/de9/elm___button_8hpp.html b/include/Plutonium/docs/d9/de9/elm___button_8hpp.html new file mode 100644 index 0000000..eeb42b4 --- /dev/null +++ b/include/Plutonium/docs/d9/de9/elm___button_8hpp.html @@ -0,0 +1,121 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_Button.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
elm_Button.hpp File Reference
+
+
+
#include <functional>
+#include <pu/ui/elm/elm_Element.hpp>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ui::elm::Button
 
+ + + + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
namespace  pu::ui::elm
 
+
+
+ + + + diff --git a/include/Plutonium/docs/d9/de9/elm___button_8hpp_source.html b/include/Plutonium/docs/d9/de9/elm___button_8hpp_source.html new file mode 100644 index 0000000..d1be51e --- /dev/null +++ b/include/Plutonium/docs/d9/de9/elm___button_8hpp_source.html @@ -0,0 +1,266 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/elm/elm_Button.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
elm_Button.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file Button.hpp
+
7 @brief A Button is an Element for option selecting.
+
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 <functional>
+ +
17
+
18namespace pu::ui::elm {
+
19
+
20 class Button : public Element {
+
21 public:
+
22 using OnClickCallback = std::function<void()>;
+
23
+
24 static constexpr u8 DarkerColorFactor = 70;
+
25
+
26 static constexpr u8 HoverAlphaIncrement = 48;
+
27
+
28 private:
+
29 i32 x;
+
30 i32 y;
+
31 i32 w;
+
32 i32 h;
+
33 std::string fnt_name;
+
34 Color bg_clr;
+
35 Color cnt_clr;
+
36 std::string cnt;
+
37 sdl2::Texture cnt_tex;
+
38 OnClickCallback on_click_cb;
+
39 bool hover;
+
40 i32 hover_alpha;
+
41
+
42 inline Color MakeHoverBackgroundColor(const i32 alpha) {
+
43 i32 base_r = this->bg_clr.r - DarkerColorFactor;
+
44 if(base_r < 0) {
+
45 base_r = 0;
+
46 }
+
47 i32 base_g = this->bg_clr.g - DarkerColorFactor;
+
48 if(base_g < 0) {
+
49 base_g = 0;
+
50 }
+
51 i32 base_b = this->bg_clr.b - DarkerColorFactor;
+
52 if(base_b < 0) {
+
53 base_b = 0;
+
54 }
+
55
+
56 auto base_a = this->bg_clr.a;
+
57 if(alpha >= 0) {
+
58 base_a = static_cast<u8>(alpha);
+
59 }
+
60
+
61 return { static_cast<u8>(base_r), static_cast<u8>(base_g), static_cast<u8>(base_b), base_a };
+
62 }
+
63
+
64 public:
+
65 Button(const i32 x, const i32 y, const i32 width, const i32 height, const std::string &content, const Color content_clr, const Color bg_clr);
+ + +
68
+
69 inline i32 GetX() override {
+
70 return this->x;
+
71 }
+
72
+
73 inline void SetX(const i32 x) {
+
74 this->x = x;
+
75 }
+
76
+
77 inline i32 GetY() override {
+
78 return this->y;
+
79 }
+
80
+
81 inline void SetY(const i32 y) {
+
82 this->y = y;
+
83 }
+
84
+
85 inline i32 GetWidth() override {
+
86 return this->w;
+
87 }
+
88
+
89 inline void SetWidth(const i32 width) {
+
90 this->w = width;
+
91 }
+
92
+
93 inline i32 GetHeight() override {
+
94 return this->h;
+
95 }
+
96
+
97 inline void SetHeight(const i32 height) {
+
98 this->h = height;
+
99 }
+
100
+
101 inline std::string GetContent() {
+
102 return this->cnt;
+
103 }
+
104
+
105 void SetContent(const std::string &content);
+
106
+ +
108 return this->cnt_clr;
+
109 }
+
110
+
111 void SetContentColor(const Color content_clr);
+
112
+ +
114 return this->bg_clr;
+
115 }
+
116
+
117 inline void SetBackgroundColor(const Color bg_clr) {
+
118 this->bg_clr = bg_clr;
+
119 }
+
120
+
121 void SetContentFont(const std::string &font_name);
+
122
+
123 inline void SetOnClick(OnClickCallback on_click_cb) {
+
124 this->on_click_cb = on_click_cb;
+
125 }
+
126
+
127 void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) override;
+
128 void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override;
+
129 };
+
130
+
131}
+
Definition: elm_Button.hpp:20
+
void SetOnClick(OnClickCallback on_click_cb)
Definition: elm_Button.hpp:123
+
void SetHeight(const i32 height)
Definition: elm_Button.hpp:97
+
void SetContent(const std::string &content)
+
void SetY(const i32 y)
Definition: elm_Button.hpp:81
+
i32 GetY() override
Definition: elm_Button.hpp:77
+
void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) override
+
std::string GetContent()
Definition: elm_Button.hpp:101
+
Button(const i32 x, const i32 y, const i32 width, const i32 height, const std::string &content, const Color content_clr, const Color bg_clr)
+
void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override
+
void SetX(const i32 x)
Definition: elm_Button.hpp:73
+
Color GetContentColor()
Definition: elm_Button.hpp:107
+
void SetContentColor(const Color content_clr)
+
void SetContentFont(const std::string &font_name)
+
void SetBackgroundColor(const Color bg_clr)
Definition: elm_Button.hpp:117
+
std::function< void()> OnClickCallback
Definition: elm_Button.hpp:22
+
void SetWidth(const i32 width)
Definition: elm_Button.hpp:89
+
i32 GetX() override
Definition: elm_Button.hpp:69
+
i32 GetHeight() override
Definition: elm_Button.hpp:93
+ +
i32 GetWidth() override
Definition: elm_Button.hpp:85
+
Color GetBackgroundColor()
Definition: elm_Button.hpp:113
+
static constexpr u8 HoverAlphaIncrement
Definition: elm_Button.hpp:26
+
static constexpr u8 DarkerColorFactor
Definition: elm_Button.hpp:24
+
Definition: elm_Element.hpp:37
+ +
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
+
Definition: elm_Button.hpp:18
+
s32 i32
Definition: pu_Include.hpp:28
+
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
+
Definition: ui_Types.hpp:44
+
u8 g
Definition: ui_Types.hpp:46
+
u8 a
Definition: ui_Types.hpp:48
+
u8 r
Definition: ui_Types.hpp:45
+
u8 b
Definition: ui_Types.hpp:47
+
Definition: ui_Types.hpp:62
+
+
+ + + + diff --git a/include/Plutonium/docs/da/d54/namespacepu_1_1ui_1_1render.html b/include/Plutonium/docs/da/d54/namespacepu_1_1ui_1_1render.html new file mode 100644 index 0000000..649e6f9 --- /dev/null +++ b/include/Plutonium/docs/da/d54/namespacepu_1_1ui_1_1render.html @@ -0,0 +1,735 @@ + + + + + + + +Plutonium framework API: pu::ui::render Namespace Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::render Namespace Reference
+
+
+ + + + + + + + +

+Classes

class  Renderer
 
struct  RendererInitOptions
 
struct  TextureRenderOptions
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

sdl2::Renderer GetMainRenderer ()
 
sdl2::Window GetMainWindow ()
 
sdl2::Surface GetMainSurface ()
 
std::pair< u32, u32 > GetDimensions ()
 
bool AddSharedFont (const std::string &font_name, const u32 font_size, const PlSharedFontType type)
 
bool AddAllSharedFonts (const std::string &font_name, const u32 font_size)
 
bool AddFontFile (const std::string &font_name, const u32 font_size, const std::string &path)
 
void AddDefaultFontFromShared (const u32 font_size)
 
void AddDefaultFontFromFile (const u32 font_size, const std::string &path)
 
sdl2::Texture RenderText (const std::string &font_name, const std::string &text, const Color clr)
 
i32 GetTextWidth (const std::string &font_name, const std::string &text)
 
i32 GetTextHeight (const std::string &font_name, const std::string &text)
 
sdl2::Texture ConvertToTexture (sdl2::Surface surface)
 
sdl2::Texture LoadImage (const std::string &path)
 
i32 GetTextureWidth (sdl2::Texture texture)
 
i32 GetTextureHeight (sdl2::Texture texture)
 
void SetAlphaValue (sdl2::Texture texture, const u8 alpha)
 
void DeleteTexture (sdl2::Texture &texture)
 
+ + + + + + + + + + + + + +

+Variables

constexpr u32 ScreenWidth = 1280
 
constexpr u32 ScreenHeight = 720
 
constexpr u32 MixerAllFlags = MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG
 
constexpr u32 IMGAllFlags = IMG_INIT_PNG | IMG_INIT_JPG | IMG_INIT_TIF | IMG_INIT_WEBP
 
constexpr u32 RendererSoftwareFlags = SDL_RENDERER_SOFTWARE
 
constexpr u32 RendererHardwareFlags = SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED
 
+

Function Documentation

+ +

◆ AddAllSharedFonts()

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool pu::ui::render::AddAllSharedFonts (const std::string & font_name,
const u32 font_size 
)
+
+ +
+
+ +

◆ AddDefaultFontFromFile()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void pu::ui::render::AddDefaultFontFromFile (const u32 font_size,
const std::string & path 
)
+
+inline
+
+ +
+
+ +

◆ AddDefaultFontFromShared()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::render::AddDefaultFontFromShared (const u32 font_size)
+
+inline
+
+ +
+
+ +

◆ AddFontFile()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool pu::ui::render::AddFontFile (const std::string & font_name,
const u32 font_size,
const std::string & path 
)
+
+ +
+
+ +

◆ AddSharedFont()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool pu::ui::render::AddSharedFont (const std::string & font_name,
const u32 font_size,
const PlSharedFontType type 
)
+
+ +
+
+ +

◆ ConvertToTexture()

+ +
+
+ + + + + + + + +
sdl2::Texture pu::ui::render::ConvertToTexture (sdl2::Surface surface)
+
+ +
+
+ +

◆ DeleteTexture()

+ +
+
+ + + + + + + + +
void pu::ui::render::DeleteTexture (sdl2::Texturetexture)
+
+ +
+
+ +

◆ GetDimensions()

+ +
+
+ + + + + + + +
std::pair< u32, u32 > pu::ui::render::GetDimensions ()
+
+ +
+
+ +

◆ GetMainRenderer()

+ +
+
+ + + + + + + +
sdl2::Renderer pu::ui::render::GetMainRenderer ()
+
+ +
+
+ +

◆ GetMainSurface()

+ +
+
+ + + + + + + +
sdl2::Surface pu::ui::render::GetMainSurface ()
+
+ +
+
+ +

◆ GetMainWindow()

+ +
+
+ + + + + + + +
sdl2::Window pu::ui::render::GetMainWindow ()
+
+ +
+
+ +

◆ GetTextHeight()

+ +
+
+ + + + + + + + + + + + + + + + + + +
i32 pu::ui::render::GetTextHeight (const std::string & font_name,
const std::string & text 
)
+
+ +
+
+ +

◆ GetTextureHeight()

+ +
+
+ + + + + + + + +
i32 pu::ui::render::GetTextureHeight (sdl2::Texture texture)
+
+ +
+
+ +

◆ GetTextureWidth()

+ +
+
+ + + + + + + + +
i32 pu::ui::render::GetTextureWidth (sdl2::Texture texture)
+
+ +
+
+ +

◆ GetTextWidth()

+ +
+
+ + + + + + + + + + + + + + + + + + +
i32 pu::ui::render::GetTextWidth (const std::string & font_name,
const std::string & text 
)
+
+ +
+
+ +

◆ LoadImage()

+ +
+
+ + + + + + + + +
sdl2::Texture pu::ui::render::LoadImage (const std::string & path)
+
+ +
+
+ +

◆ RenderText()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
sdl2::Texture pu::ui::render::RenderText (const std::string & font_name,
const std::string & text,
const Color clr 
)
+
+ +
+
+ +

◆ SetAlphaValue()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void pu::ui::render::SetAlphaValue (sdl2::Texture texture,
const u8 alpha 
)
+
+ +
+
+

Variable Documentation

+ +

◆ IMGAllFlags

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::render::IMGAllFlags = IMG_INIT_PNG | IMG_INIT_JPG | IMG_INIT_TIF | IMG_INIT_WEBP
+
+constexpr
+
+ +
+
+ +

◆ MixerAllFlags

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::render::MixerAllFlags = MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG
+
+constexpr
+
+ +
+
+ +

◆ RendererHardwareFlags

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::render::RendererHardwareFlags = SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED
+
+constexpr
+
+ +
+
+ +

◆ RendererSoftwareFlags

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::render::RendererSoftwareFlags = SDL_RENDERER_SOFTWARE
+
+constexpr
+
+ +
+
+ +

◆ ScreenHeight

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::render::ScreenHeight = 720
+
+constexpr
+
+ +
+
+ +

◆ ScreenWidth

+ +
+
+ + + + + +
+ + + + +
constexpr u32 pu::ui::render::ScreenWidth = 1280
+
+constexpr
+
+ +
+
+
+
+ + + + diff --git a/include/Plutonium/docs/da/d54/namespacepu_1_1ui_1_1render.js b/include/Plutonium/docs/da/d54/namespacepu_1_1ui_1_1render.js new file mode 100644 index 0000000..7dabdea --- /dev/null +++ b/include/Plutonium/docs/da/d54/namespacepu_1_1ui_1_1render.js @@ -0,0 +1,30 @@ +var namespacepu_1_1ui_1_1render = +[ + [ "Renderer", "d0/d27/classpu_1_1ui_1_1render_1_1_renderer.html", "d0/d27/classpu_1_1ui_1_1render_1_1_renderer" ], + [ "RendererInitOptions", "df/d6f/structpu_1_1ui_1_1render_1_1_renderer_init_options.html", "df/d6f/structpu_1_1ui_1_1render_1_1_renderer_init_options" ], + [ "TextureRenderOptions", "dc/d32/structpu_1_1ui_1_1render_1_1_texture_render_options.html", "dc/d32/structpu_1_1ui_1_1render_1_1_texture_render_options" ], + [ "AddAllSharedFonts", "da/d54/namespacepu_1_1ui_1_1render.html#ab5ebf894ae9239221d39569e379fe188", null ], + [ "AddDefaultFontFromFile", "da/d54/namespacepu_1_1ui_1_1render.html#a879d9bdd49dd85e24c56a7eab7e56f78", null ], + [ "AddDefaultFontFromShared", "da/d54/namespacepu_1_1ui_1_1render.html#ad22e51883cfc01c65c9c2cb2bd6bd871", null ], + [ "AddFontFile", "da/d54/namespacepu_1_1ui_1_1render.html#a7028fbbfd0b390992a62b0dd64c7e86e", null ], + [ "AddSharedFont", "da/d54/namespacepu_1_1ui_1_1render.html#a9fc279a6b6f318722a1330cfde9ed612", null ], + [ "ConvertToTexture", "da/d54/namespacepu_1_1ui_1_1render.html#ae4fc689be6e2b1052e0a3197fe5cd1a6", null ], + [ "DeleteTexture", "da/d54/namespacepu_1_1ui_1_1render.html#a687992204d83230da27780900cc882a1", null ], + [ "GetDimensions", "da/d54/namespacepu_1_1ui_1_1render.html#abd48c078f9a0d5a57bf93d413a8ed2e6", null ], + [ "GetMainRenderer", "da/d54/namespacepu_1_1ui_1_1render.html#ac3ef345ab94510dd75774086f3737224", null ], + [ "GetMainSurface", "da/d54/namespacepu_1_1ui_1_1render.html#a7d87075716f44ab90d397ade7da4cb70", null ], + [ "GetMainWindow", "da/d54/namespacepu_1_1ui_1_1render.html#a49da42826685906d7bf6662b9be169e1", null ], + [ "GetTextHeight", "da/d54/namespacepu_1_1ui_1_1render.html#ace12eee5e824e7246730c4141cc73210", null ], + [ "GetTextureHeight", "da/d54/namespacepu_1_1ui_1_1render.html#a5ddabd3bd6cfe05172eef8c0dee9234c", null ], + [ "GetTextureWidth", "da/d54/namespacepu_1_1ui_1_1render.html#a8187f56badf43ccf9eed52915345fa01", null ], + [ "GetTextWidth", "da/d54/namespacepu_1_1ui_1_1render.html#abb9cc63606c0f861f03830cf1bb3cf88", null ], + [ "LoadImage", "da/d54/namespacepu_1_1ui_1_1render.html#ac6a58de115048eb3260a085d5fcfc3f0", null ], + [ "RenderText", "da/d54/namespacepu_1_1ui_1_1render.html#a5d9f841115348f57afed74d536a6b291", null ], + [ "SetAlphaValue", "da/d54/namespacepu_1_1ui_1_1render.html#ab22ff2d91f71f95a4e889cc942d69b43", null ], + [ "IMGAllFlags", "da/d54/namespacepu_1_1ui_1_1render.html#aca8de816c249f71ecec38137222352f2", null ], + [ "MixerAllFlags", "da/d54/namespacepu_1_1ui_1_1render.html#a0955ba96cbd635c6bc387fcb51088555", null ], + [ "RendererHardwareFlags", "da/d54/namespacepu_1_1ui_1_1render.html#ae9f1375477d6776bad834896952ecaf2", null ], + [ "RendererSoftwareFlags", "da/d54/namespacepu_1_1ui_1_1render.html#aaedd6a7faa3d79a5e6cf58120fe8626b", null ], + [ "ScreenHeight", "da/d54/namespacepu_1_1ui_1_1render.html#af387b6301a55da00e921539845d9f357", null ], + [ "ScreenWidth", "da/d54/namespacepu_1_1ui_1_1render.html#ae5920eeeae0aa4c3eac8073c2471ebb6", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/da/dc0/classpu_1_1ui_1_1_application.html b/include/Plutonium/docs/da/dc0/classpu_1_1ui_1_1_application.html new file mode 100644 index 0000000..042a38a --- /dev/null +++ b/include/Plutonium/docs/da/dc0/classpu_1_1ui_1_1_application.html @@ -0,0 +1,1273 @@ + + + + + + + +Plutonium framework API: pu::ui::Application Class Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu::ui::Application Class Referenceabstract
+
+
+ +

#include <ui_Application.hpp>

+ + + + + + + + +

+Public Types

using OnInputCallback = std::function< void(const u64, const u64, const u64, const TouchPoint)>
 
using RenderCallback = std::function< void()>
 
using RenderOverFunction = std::function< bool(render::Renderer::Ref &)>
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Application (render::Renderer::Ref renderer)
 
void LoadLayout (Layout::Ref lyt)
 
template<typename L >
std::shared_ptr< L > GetLayout ()
 
void Prepare ()
 
virtual void OnLoad ()=0
 
void AddRenderCallback (RenderCallback render_cb)
 
void SetOnInput (OnInputCallback on_ipt_cb)
 
i32 ShowDialog (Dialog::Ref &dialog)
 
i32 CreateShowDialog (const std::string &title, const std::string &content, const std::vector< std::string > &opts, const bool use_last_opt_as_cancel, const std::string &icon_path="")
 
void StartOverlay (Overlay::Ref ovl)
 
void StartOverlayWithTimeout (Overlay::Ref ovl, const u64 ms)
 
void EndOverlay ()
 
void Show ()
 
void ShowWithFadeIn ()
 
bool IsShown ()
 
bool CanBeShown ()
 
bool CallForRender ()
 
bool CallForRenderWithRenderOver (RenderOverFunction render_over_fn)
 
void FadeIn ()
 
void FadeOut ()
 
bool IsFadedIn ()
 
void SetFadeAlphaIncrement (const u8 fade_alpha_increment)
 
void OnRender ()
 
void Close ()
 
void CloseWithFadeOut ()
 
u64 GetButtonsDown ()
 
u64 GetButtonsUp ()
 
u64 GetButtonsHeld ()
 
HidTouchScreenState GetTouchState ()
 
+ + + +

+Static Public Attributes

static constexpr u8 DefaultFadeAlphaIncrement = 35
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Protected Attributes

bool loaded
 
bool in_render_over
 
RenderOverFunction render_over_fn
 
bool is_shown
 
u8 fade_alpha_increment
 
i32 fade_alpha
 
Layout::Ref lyt
 
Overlay::Ref ovl
 
u64 ovl_timeout_ms
 
std::chrono::steady_clock::time_point ovl_start_time
 
std::vector< RenderCallbackrender_cbs
 
OnInputCallback on_ipt_cb
 
render::Renderer::Ref renderer
 
PadState input_pad
 
+

Member Typedef Documentation

+ +

◆ OnInputCallback

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

◆ RenderCallback

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

◆ RenderOverFunction

+ +
+
+ + + + +
using pu::ui::Application::RenderOverFunction = std::function<bool(render::Renderer::Ref&)>
+
+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Application()

+ +
+
+ + + + + + + + +
pu::ui::Application::Application (render::Renderer::Ref renderer)
+
+ +
+
+

Member Function Documentation

+ +

◆ AddRenderCallback()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Application::AddRenderCallback (RenderCallback render_cb)
+
+inline
+
+ +
+
+ +

◆ CallForRender()

+ +
+
+ + + + + + + +
bool pu::ui::Application::CallForRender ()
+
+ +
+
+ +

◆ CallForRenderWithRenderOver()

+ +
+
+ + + + + + + + +
bool pu::ui::Application::CallForRenderWithRenderOver (RenderOverFunction render_over_fn)
+
+ +
+
+ +

◆ CanBeShown()

+ +
+
+ + + + + +
+ + + + + + + +
bool pu::ui::Application::CanBeShown ()
+
+inline
+
+ +
+
+ +

◆ Close()

+ +
+
+ + + + + + + +
void pu::ui::Application::Close ()
+
+ +
+
+ +

◆ CloseWithFadeOut()

+ +
+
+ + + + + +
+ + + + + + + +
void pu::ui::Application::CloseWithFadeOut ()
+
+inline
+
+ +
+
+ +

◆ CreateShowDialog()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
i32 pu::ui::Application::CreateShowDialog (const std::string & title,
const std::string & content,
const std::vector< std::string > & opts,
const bool use_last_opt_as_cancel,
const std::string & icon_path = "" 
)
+
+ +
+
+ +

◆ EndOverlay()

+ +
+
+ + + + + + + +
void pu::ui::Application::EndOverlay ()
+
+ +
+
+ +

◆ FadeIn()

+ +
+
+ + + + + + + +
void pu::ui::Application::FadeIn ()
+
+ +
+
+ +

◆ FadeOut()

+ +
+
+ + + + + + + +
void pu::ui::Application::FadeOut ()
+
+ +
+
+ +

◆ GetButtonsDown()

+ +
+
+ + + + + +
+ + + + + + + +
u64 pu::ui::Application::GetButtonsDown ()
+
+inline
+
+ +
+
+ +

◆ GetButtonsHeld()

+ +
+
+ + + + + +
+ + + + + + + +
u64 pu::ui::Application::GetButtonsHeld ()
+
+inline
+
+ +
+
+ +

◆ GetButtonsUp()

+ +
+
+ + + + + +
+ + + + + + + +
u64 pu::ui::Application::GetButtonsUp ()
+
+inline
+
+ +
+
+ +

◆ GetLayout()

+ +
+
+
+template<typename L >
+ + + + + +
+ + + + + + + +
std::shared_ptr< L > pu::ui::Application::GetLayout ()
+
+inline
+
+ +
+
+ +

◆ GetTouchState()

+ +
+
+ + + + + +
+ + + + + + + +
HidTouchScreenState pu::ui::Application::GetTouchState ()
+
+inline
+
+ +
+
+ +

◆ IsFadedIn()

+ +
+
+ + + + + +
+ + + + + + + +
bool pu::ui::Application::IsFadedIn ()
+
+inline
+
+ +
+
+ +

◆ IsShown()

+ +
+
+ + + + + +
+ + + + + + + +
bool pu::ui::Application::IsShown ()
+
+inline
+
+ +
+
+ +

◆ LoadLayout()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Application::LoadLayout (Layout::Ref lyt)
+
+inline
+
+ +
+
+ +

◆ OnLoad()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void pu::ui::Application::OnLoad ()
+
+pure virtual
+
+ +
+
+ +

◆ OnRender()

+ +
+
+ + + + + + + +
void pu::ui::Application::OnRender ()
+
+ +
+
+ +

◆ Prepare()

+ +
+
+ + + + + + + +
void pu::ui::Application::Prepare ()
+
+ +
+
+ +

◆ SetFadeAlphaIncrement()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Application::SetFadeAlphaIncrement (const u8 fade_alpha_increment)
+
+inline
+
+ +
+
+ +

◆ SetOnInput()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Application::SetOnInput (OnInputCallback on_ipt_cb)
+
+inline
+
+ +
+
+ +

◆ Show()

+ +
+
+ + + + + + + +
void pu::ui::Application::Show ()
+
+ +
+
+ +

◆ ShowDialog()

+ +
+
+ + + + + +
+ + + + + + + + +
i32 pu::ui::Application::ShowDialog (Dialog::Ref & dialog)
+
+inline
+
+ +
+
+ +

◆ ShowWithFadeIn()

+ +
+
+ + + + + +
+ + + + + + + +
void pu::ui::Application::ShowWithFadeIn ()
+
+inline
+
+ +
+
+ +

◆ StartOverlay()

+ +
+
+ + + + + +
+ + + + + + + + +
void pu::ui::Application::StartOverlay (Overlay::Ref ovl)
+
+inline
+
+ +
+
+ +

◆ StartOverlayWithTimeout()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void pu::ui::Application::StartOverlayWithTimeout (Overlay::Ref ovl,
const u64 ms 
)
+
+ +
+
+

Member Data Documentation

+ +

◆ DefaultFadeAlphaIncrement

+ +
+
+ + + + + +
+ + + + +
constexpr u8 pu::ui::Application::DefaultFadeAlphaIncrement = 35
+
+staticconstexpr
+
+ +
+
+ +

◆ fade_alpha

+ +
+
+ + + + + +
+ + + + +
i32 pu::ui::Application::fade_alpha
+
+protected
+
+ +
+
+ +

◆ fade_alpha_increment

+ +
+
+ + + + + +
+ + + + +
u8 pu::ui::Application::fade_alpha_increment
+
+protected
+
+ +
+
+ +

◆ in_render_over

+ +
+
+ + + + + +
+ + + + +
bool pu::ui::Application::in_render_over
+
+protected
+
+ +
+
+ +

◆ input_pad

+ +
+
+ + + + + +
+ + + + +
PadState pu::ui::Application::input_pad
+
+protected
+
+ +
+
+ +

◆ is_shown

+ +
+
+ + + + + +
+ + + + +
bool pu::ui::Application::is_shown
+
+protected
+
+ +
+
+ +

◆ loaded

+ +
+
+ + + + + +
+ + + + +
bool pu::ui::Application::loaded
+
+protected
+
+ +
+
+ +

◆ lyt

+ +
+
+ + + + + +
+ + + + +
Layout::Ref pu::ui::Application::lyt
+
+protected
+
+ +
+
+ +

◆ on_ipt_cb

+ +
+
+ + + + + +
+ + + + +
OnInputCallback pu::ui::Application::on_ipt_cb
+
+protected
+
+ +
+
+ +

◆ ovl

+ +
+
+ + + + + +
+ + + + +
Overlay::Ref pu::ui::Application::ovl
+
+protected
+
+ +
+
+ +

◆ ovl_start_time

+ +
+
+ + + + + +
+ + + + +
std::chrono::steady_clock::time_point pu::ui::Application::ovl_start_time
+
+protected
+
+ +
+
+ +

◆ ovl_timeout_ms

+ +
+
+ + + + + +
+ + + + +
u64 pu::ui::Application::ovl_timeout_ms
+
+protected
+
+ +
+
+ +

◆ render_cbs

+ +
+
+ + + + + +
+ + + + +
std::vector<RenderCallback> pu::ui::Application::render_cbs
+
+protected
+
+ +
+
+ +

◆ render_over_fn

+ +
+
+ + + + + +
+ + + + +
RenderOverFunction pu::ui::Application::render_over_fn
+
+protected
+
+ +
+
+ +

◆ renderer

+ +
+
+ + + + + +
+ + + + +
render::Renderer::Ref pu::ui::Application::renderer
+
+protected
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/include/Plutonium/docs/da/dc0/classpu_1_1ui_1_1_application.js b/include/Plutonium/docs/da/dc0/classpu_1_1ui_1_1_application.js new file mode 100644 index 0000000..60f7f1e --- /dev/null +++ b/include/Plutonium/docs/da/dc0/classpu_1_1ui_1_1_application.js @@ -0,0 +1,50 @@ +var classpu_1_1ui_1_1_application = +[ + [ "OnInputCallback", "da/dc0/classpu_1_1ui_1_1_application.html#afa87e0a47c4ad3505f9bacf00e61dbb0", null ], + [ "RenderCallback", "da/dc0/classpu_1_1ui_1_1_application.html#a875fd12dc58069ead6176a47c553ce05", null ], + [ "RenderOverFunction", "da/dc0/classpu_1_1ui_1_1_application.html#a374a778ba740283e918269bda6cf33ee", null ], + [ "Application", "da/dc0/classpu_1_1ui_1_1_application.html#a3833437526232f5a507a45ab538c4fb9", null ], + [ "AddRenderCallback", "da/dc0/classpu_1_1ui_1_1_application.html#a66423e53db87dbdd007a3bad01bc2469", null ], + [ "CallForRender", "da/dc0/classpu_1_1ui_1_1_application.html#a2d0a2aff83ad9142c7d0869a32b10fd7", null ], + [ "CallForRenderWithRenderOver", "da/dc0/classpu_1_1ui_1_1_application.html#acf4c82b3926475fdda7fcde4eb6e434a", null ], + [ "CanBeShown", "da/dc0/classpu_1_1ui_1_1_application.html#a5b80802e3217a2eaef820c95bc3a9a6e", null ], + [ "Close", "da/dc0/classpu_1_1ui_1_1_application.html#a9a4772b2d9c594eb0fffb264c21c8720", null ], + [ "CloseWithFadeOut", "da/dc0/classpu_1_1ui_1_1_application.html#a4d70ac6b82dbe63b108b708a5ce64dab", null ], + [ "CreateShowDialog", "da/dc0/classpu_1_1ui_1_1_application.html#a85d3df4a6757a55e83ef93dae98542f0", null ], + [ "EndOverlay", "da/dc0/classpu_1_1ui_1_1_application.html#a88a356add56c9d77f2b257ffb1b04c74", null ], + [ "FadeIn", "da/dc0/classpu_1_1ui_1_1_application.html#a5e4ce9356c5a450b89dfe13ef222c7e1", null ], + [ "FadeOut", "da/dc0/classpu_1_1ui_1_1_application.html#a5c81b0f1930c4f66288c4c1587e48ef9", null ], + [ "GetButtonsDown", "da/dc0/classpu_1_1ui_1_1_application.html#a4d4edf80918036ae380ef967f0a4090a", null ], + [ "GetButtonsHeld", "da/dc0/classpu_1_1ui_1_1_application.html#a5b73c965d8feba01be3c39f217318953", null ], + [ "GetButtonsUp", "da/dc0/classpu_1_1ui_1_1_application.html#a5a6d5b7eb26c33af458ca8b8b09677eb", null ], + [ "GetLayout", "da/dc0/classpu_1_1ui_1_1_application.html#aaf460c32bd5e2c4d211465f4a1195fd5", null ], + [ "GetTouchState", "da/dc0/classpu_1_1ui_1_1_application.html#a225ff9d81b7b01cda0686ff3fa5d05e1", null ], + [ "IsFadedIn", "da/dc0/classpu_1_1ui_1_1_application.html#abc4dca38f274ea1ed87702c40e875fd3", null ], + [ "IsShown", "da/dc0/classpu_1_1ui_1_1_application.html#a04f910e1f6ac91784093220b38433a06", null ], + [ "LoadLayout", "da/dc0/classpu_1_1ui_1_1_application.html#adfde79d1bcbd14fba0a33239855ca320", null ], + [ "OnLoad", "da/dc0/classpu_1_1ui_1_1_application.html#a293c44edb540457ba28f96be672fecb2", null ], + [ "OnRender", "da/dc0/classpu_1_1ui_1_1_application.html#a036ff0bfa3f7232d9f8864891e56fbd6", null ], + [ "Prepare", "da/dc0/classpu_1_1ui_1_1_application.html#ab46adc854979e5692c5b91344f1c40c5", null ], + [ "SetFadeAlphaIncrement", "da/dc0/classpu_1_1ui_1_1_application.html#a5d3d9f02541a082f3688bd54b55ea423", null ], + [ "SetOnInput", "da/dc0/classpu_1_1ui_1_1_application.html#a99fd3ace7acea927129742b3a64262f6", null ], + [ "Show", "da/dc0/classpu_1_1ui_1_1_application.html#aea869e54e6672af5507df7d7559b2885", null ], + [ "ShowDialog", "da/dc0/classpu_1_1ui_1_1_application.html#ae008f0373d4e2876bed6ed14d8821df3", null ], + [ "ShowWithFadeIn", "da/dc0/classpu_1_1ui_1_1_application.html#a7290833d778556c8303bcca9e06fa707", null ], + [ "StartOverlay", "da/dc0/classpu_1_1ui_1_1_application.html#a4715cea76a14b3dc462bd40ce218a904", null ], + [ "StartOverlayWithTimeout", "da/dc0/classpu_1_1ui_1_1_application.html#a4cbe59f3a504c19bdbf91c1482362f86", null ], + [ "DefaultFadeAlphaIncrement", "da/dc0/classpu_1_1ui_1_1_application.html#a7767b393f2f1b7c3041e6ae40ce1897e", null ], + [ "fade_alpha", "da/dc0/classpu_1_1ui_1_1_application.html#a8d109c462aa687642e446ec811a18d9c", null ], + [ "fade_alpha_increment", "da/dc0/classpu_1_1ui_1_1_application.html#a6325312b78283594f76f2c3e67d4dbbd", null ], + [ "in_render_over", "da/dc0/classpu_1_1ui_1_1_application.html#a8a1650a14277160860e10b1df2a2e7b4", null ], + [ "input_pad", "da/dc0/classpu_1_1ui_1_1_application.html#a7e6fadf805816037a2694f2cdee75734", null ], + [ "is_shown", "da/dc0/classpu_1_1ui_1_1_application.html#a089a01967c0885355a0f671219351696", null ], + [ "loaded", "da/dc0/classpu_1_1ui_1_1_application.html#aab06d178dbe6d404fe274b18824cfc3c", null ], + [ "lyt", "da/dc0/classpu_1_1ui_1_1_application.html#a43fefd09f752dc74936c2c079c45a533", null ], + [ "on_ipt_cb", "da/dc0/classpu_1_1ui_1_1_application.html#a2df6f0e62e24af013b1e64b7de63a3cb", null ], + [ "ovl", "da/dc0/classpu_1_1ui_1_1_application.html#abc8b77634ba4b551e42d69e66f6bacf4", null ], + [ "ovl_start_time", "da/dc0/classpu_1_1ui_1_1_application.html#afe27eca2727bc7808b5832a879a915bd", null ], + [ "ovl_timeout_ms", "da/dc0/classpu_1_1ui_1_1_application.html#acc362b64289bf6cdfa81c81df610f315", null ], + [ "render_cbs", "da/dc0/classpu_1_1ui_1_1_application.html#a1e64ead3b8e6935e866c32f015d5e287", null ], + [ "render_over_fn", "da/dc0/classpu_1_1ui_1_1_application.html#abd0bc4d0efa786751527f59c23961dfe", null ], + [ "renderer", "da/dc0/classpu_1_1ui_1_1_application.html#ad21fef299cbbc0a83cc79b4282210514", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/da/df2/namespacepu.html b/include/Plutonium/docs/da/df2/namespacepu.html new file mode 100644 index 0000000..0367c96 --- /dev/null +++ b/include/Plutonium/docs/da/df2/namespacepu.html @@ -0,0 +1,134 @@ + + + + + + + +Plutonium framework API: pu Namespace Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
pu Namespace Reference
+
+
+ + + + + + + + + + +

+Namespaces

namespace  audio
 
namespace  sdl2
 
namespace  ttf
 
namespace  ui
 
+ + + +

+Typedefs

using i32 = s32
 
+

Typedef Documentation

+ +

◆ i32

+ +
+
+ + + + +
using pu::i32 = typedef s32
+
+ +
+
+
+
+ + + + diff --git a/include/Plutonium/docs/da/df2/namespacepu.js b/include/Plutonium/docs/da/df2/namespacepu.js new file mode 100644 index 0000000..5157c32 --- /dev/null +++ b/include/Plutonium/docs/da/df2/namespacepu.js @@ -0,0 +1,33 @@ +var namespacepu = +[ + [ "audio", "d8/d8f/namespacepu_1_1audio.html", [ + [ "Music", "d8/d8f/namespacepu_1_1audio.html#adc990fea10ff67b623e34b67ffa29413", null ], + [ "Sfx", "d8/d8f/namespacepu_1_1audio.html#a21bc80b31e5b3e065615f5f24880e747", null ], + [ "DestroyMusic", "d8/d8f/namespacepu_1_1audio.html#a1f7671249f422dca75905b3becfe0a24", null ], + [ "DestroySfx", "d8/d8f/namespacepu_1_1audio.html#ac3d79067485a253473beeae7691fea65", null ], + [ "FadeOutMusic", "d8/d8f/namespacepu_1_1audio.html#a0514eeae754124a9bdec08e79823f08a", null ], + [ "GetMusicVolume", "d8/d8f/namespacepu_1_1audio.html#a00fd980306751af01d7946a7d6da2044", null ], + [ "IsPlayingMusic", "d8/d8f/namespacepu_1_1audio.html#a07bae3d9442a509f1729c72ba4b4c92c", null ], + [ "LoadSfx", "d8/d8f/namespacepu_1_1audio.html#a9d37a88a7efef6bac8947b853965234b", null ], + [ "OpenMusic", "d8/d8f/namespacepu_1_1audio.html#a66c81b8c5c29b92ac8a0786bc803ca23", null ], + [ "PauseMusic", "d8/d8f/namespacepu_1_1audio.html#a1a16cf110068c643338a686d06fc0311", null ], + [ "PlayMusic", "d8/d8f/namespacepu_1_1audio.html#ae6860df6873c68be641096106f2f10e1", null ], + [ "PlayMusicWithFadeIn", "d8/d8f/namespacepu_1_1audio.html#a6732fa4e7407c46285dda78126c4ae55", null ], + [ "PlaySfx", "d8/d8f/namespacepu_1_1audio.html#a38344de3e19215b9d8125e6971c7f6cd", null ], + [ "ResumeMusic", "d8/d8f/namespacepu_1_1audio.html#a293674d2948d7a79e2cde7796c661848", null ], + [ "RewindMusic", "d8/d8f/namespacepu_1_1audio.html#a2f34c8478347186d0209fef078d41582", null ], + [ "SetMusicPosition", "d8/d8f/namespacepu_1_1audio.html#a101f963439aaf0a9a5229de9a9545ab1", null ], + [ "SetMusicVolume", "d8/d8f/namespacepu_1_1audio.html#ad8c9e4959cf7ad40f9493659130f2878", null ], + [ "StopMusic", "d8/d8f/namespacepu_1_1audio.html#adefbe54b078d8a9f1db1d50e9dfcaa7c", null ] + ] ], + [ "sdl2", "d1/d78/namespacepu_1_1sdl2.html", [ + [ "Font", "d1/d78/namespacepu_1_1sdl2.html#a6cc3040689b5eaa481307108ed33d996", null ], + [ "Renderer", "d1/d78/namespacepu_1_1sdl2.html#a4872247f27ba13a3f3db43c110da39c0", null ], + [ "Surface", "d1/d78/namespacepu_1_1sdl2.html#a00c40ae94ad2fc0b78571071c62faa19", null ], + [ "Texture", "d1/d78/namespacepu_1_1sdl2.html#a65fedc3a65aa972d8e05f05545a65fc3", null ], + [ "Window", "d1/d78/namespacepu_1_1sdl2.html#a4dc2c75c183ac8dd775de27b4e26b932", null ] + ] ], + [ "ttf", "d5/d72/namespacepu_1_1ttf.html", "d5/d72/namespacepu_1_1ttf" ], + [ "ui", "d9/d7f/namespacepu_1_1ui.html", "d9/d7f/namespacepu_1_1ui" ], + [ "i32", "da/df2/namespacepu.html#ad6f40fe34a42045f7df3275f60b00e99", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/db/d2d/structpu_1_1ui_1_1render_1_1_renderer_init_options-members.html b/include/Plutonium/docs/db/d2d/structpu_1_1ui_1_1render_1_1_renderer_init_options-members.html new file mode 100644 index 0000000..f43b1ac --- /dev/null +++ b/include/Plutonium/docs/db/d2d/structpu_1_1ui_1_1render_1_1_renderer_init_options-members.html @@ -0,0 +1,120 @@ + + + + + + + +Plutonium framework API: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
pu::ui::render::RendererInitOptions Member List
+
+
+ +

This is the complete list of members for pu::ui::render::RendererInitOptions, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + +
audio_mixer_flagspu::ui::render::RendererInitOptions
default_font_pathpu::ui::render::RendererInitOptions
extra_default_font_sizespu::ui::render::RendererInitOptions
heightpu::ui::render::RendererInitOptions
init_imgpu::ui::render::RendererInitOptions
init_mixerpu::ui::render::RendererInitOptions
init_plpu::ui::render::RendererInitOptions
init_romfspu::ui::render::RendererInitOptions
init_ttfpu::ui::render::RendererInitOptions
RendererInitOptions(const u32 sdl_flags, const u32 sdl_render_flags, const u32 w=ScreenWidth, const u32 h=ScreenHeight)pu::ui::render::RendererInitOptionsinline
sdl_flagspu::ui::render::RendererInitOptions
sdl_img_flagspu::ui::render::RendererInitOptions
sdl_render_flagspu::ui::render::RendererInitOptions
SetExtraDefaultFontSize(const u32 font_size)pu::ui::render::RendererInitOptionsinline
UseAudio(const u32 audio_mixer_flags)pu::ui::render::RendererInitOptionsinline
UseImage(const u32 sdl_img_flags)pu::ui::render::RendererInitOptionsinline
UseRomfs()pu::ui::render::RendererInitOptionsinline
UseTTF(const std::string &default_font_path="")pu::ui::render::RendererInitOptionsinline
widthpu::ui::render::RendererInitOptions
+
+ + + + diff --git a/include/Plutonium/docs/db/d52/ui___application_8hpp.html b/include/Plutonium/docs/db/d52/ui___application_8hpp.html new file mode 100644 index 0000000..fc519aa --- /dev/null +++ b/include/Plutonium/docs/db/d52/ui___application_8hpp.html @@ -0,0 +1,121 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/ui_Application.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
ui_Application.hpp File Reference
+
+
+
#include <pu/ui/ui_Dialog.hpp>
+#include <pu/ui/ui_Layout.hpp>
+#include <pu/ui/ui_Overlay.hpp>
+#include <chrono>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  pu::ui::Application
 
+ + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
+
+
+ + + + diff --git a/include/Plutonium/docs/db/d52/ui___application_8hpp_source.html b/include/Plutonium/docs/db/d52/ui___application_8hpp_source.html new file mode 100644 index 0000000..f146dff --- /dev/null +++ b/include/Plutonium/docs/db/d52/ui___application_8hpp_source.html @@ -0,0 +1,297 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/ui_Application.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
ui_Application.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file ui_Application.hpp
+
7 @brief An Application is the base to use the UI system of this library.
+
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_Dialog.hpp>
+
16#include <pu/ui/ui_Layout.hpp>
+
17#include <pu/ui/ui_Overlay.hpp>
+
18#include <chrono>
+
19
+
20namespace pu::ui {
+
21
+ +
23 public:
+
24 using OnInputCallback = std::function<void(const u64, const u64, const u64, const TouchPoint)>;
+
25 using RenderCallback = std::function<void()>;
+
26 using RenderOverFunction = std::function<bool(render::Renderer::Ref&)>;
+
27
+
28 static constexpr u8 DefaultFadeAlphaIncrement = 35;
+
29
+
30 protected:
+
31 bool loaded;
+ + + + + +
37 Layout::Ref lyt;
+
38 Overlay::Ref ovl;
+ +
40 std::chrono::steady_clock::time_point ovl_start_time;
+
41 std::vector<RenderCallback> render_cbs;
+ +
43 render::Renderer::Ref renderer;
+
44 PadState input_pad;
+
45
+
46 public:
+
47 Application(render::Renderer::Ref renderer);
+ +
49
+
50 inline void LoadLayout(Layout::Ref lyt) {
+
51 this->lyt = lyt;
+
52 }
+
53
+
54 template<typename L>
+
55 inline std::shared_ptr<L> GetLayout() {
+
56 static_assert(std::is_base_of_v<ui::Layout, L>);
+
57 return std::static_pointer_cast<L>(this->lyt);
+
58 }
+
59
+
60 void Prepare();
+
61
+
62 // Force create a derived Application class which initializes everything here
+
63 virtual void OnLoad() = 0;
+
64
+
65 inline void AddRenderCallback(RenderCallback render_cb) {
+
66 this->render_cbs.push_back(render_cb);
+
67 }
+
68
+ +
70 this->on_ipt_cb = on_ipt_cb;
+
71 }
+
72
+
73 inline i32 ShowDialog(Dialog::Ref &dialog) {
+
74 return dialog->Show(this);
+
75 }
+
76
+
77 i32 CreateShowDialog(const std::string &title, const std::string &content, const std::vector<std::string> &opts, const bool use_last_opt_as_cancel, const std::string &icon_path = "");
+
78
+
79 inline void StartOverlay(Overlay::Ref ovl) {
+
80 if(this->ovl == nullptr) {
+
81 this->ovl = ovl;
+
82 }
+
83 }
+
84
+
85 void StartOverlayWithTimeout(Overlay::Ref ovl, const u64 ms);
+
86 void EndOverlay();
+
87 void Show();
+
88
+
89 inline void ShowWithFadeIn() {
+
90 this->FadeIn();
+
91 this->Show();
+
92 }
+
93
+
94 inline bool IsShown() {
+
95 return this->is_shown;
+
96 }
+
97
+
98 inline bool CanBeShown() {
+
99 return this->loaded && (this->lyt != nullptr);
+
100 }
+
101
+ + +
104 void FadeIn();
+
105 void FadeOut();
+
106
+
107 inline bool IsFadedIn() {
+
108 return this->fade_alpha > 0;
+
109 }
+
110
+ +
112 this->fade_alpha_increment = fade_alpha_increment;
+
113 }
+
114
+
115 void OnRender();
+
116 void Close();
+
117
+
118 inline void CloseWithFadeOut() {
+
119 this->FadeOut();
+
120 this->Close();
+
121 }
+
122
+
123 inline u64 GetButtonsDown() {
+
124 return padGetButtonsDown(&this->input_pad);
+
125 }
+
126
+
127 inline u64 GetButtonsUp() {
+
128 return padGetButtonsUp(&this->input_pad);
+
129 }
+
130
+
131 inline u64 GetButtonsHeld() {
+
132 return padGetButtons(&this->input_pad);
+
133 }
+
134
+
135 inline HidTouchScreenState GetTouchState() {
+
136 HidTouchScreenState state = {};
+
137 hidGetTouchScreenStates(&state, 1);
+
138 return state;
+
139 }
+
140 };
+
141
+
142}
+
Definition: ui_Application.hpp:22
+ +
bool IsShown()
Definition: ui_Application.hpp:94
+
bool is_shown
Definition: ui_Application.hpp:34
+
std::vector< RenderCallback > render_cbs
Definition: ui_Application.hpp:41
+
HidTouchScreenState GetTouchState()
Definition: ui_Application.hpp:135
+
virtual void OnLoad()=0
+ +
OnInputCallback on_ipt_cb
Definition: ui_Application.hpp:42
+
std::function< bool(render::Renderer::Ref &)> RenderOverFunction
Definition: ui_Application.hpp:26
+
Application(render::Renderer::Ref renderer)
+
Layout::Ref lyt
Definition: ui_Application.hpp:37
+
void StartOverlay(Overlay::Ref ovl)
Definition: ui_Application.hpp:79
+
void StartOverlayWithTimeout(Overlay::Ref ovl, const u64 ms)
+
u64 GetButtonsDown()
Definition: ui_Application.hpp:123
+
void CloseWithFadeOut()
Definition: ui_Application.hpp:118
+
u64 GetButtonsUp()
Definition: ui_Application.hpp:127
+
u64 GetButtonsHeld()
Definition: ui_Application.hpp:131
+
bool CanBeShown()
Definition: ui_Application.hpp:98
+ +
void SetFadeAlphaIncrement(const u8 fade_alpha_increment)
Definition: ui_Application.hpp:111
+ +
u8 fade_alpha_increment
Definition: ui_Application.hpp:35
+
void AddRenderCallback(RenderCallback render_cb)
Definition: ui_Application.hpp:65
+
void ShowWithFadeIn()
Definition: ui_Application.hpp:89
+
static constexpr u8 DefaultFadeAlphaIncrement
Definition: ui_Application.hpp:28
+
PadState input_pad
Definition: ui_Application.hpp:44
+
i32 CreateShowDialog(const std::string &title, const std::string &content, const std::vector< std::string > &opts, const bool use_last_opt_as_cancel, const std::string &icon_path="")
+
std::function< void()> RenderCallback
Definition: ui_Application.hpp:25
+ +
bool in_render_over
Definition: ui_Application.hpp:32
+
i32 fade_alpha
Definition: ui_Application.hpp:36
+
void SetOnInput(OnInputCallback on_ipt_cb)
Definition: ui_Application.hpp:69
+ +
bool loaded
Definition: ui_Application.hpp:31
+
std::shared_ptr< L > GetLayout()
Definition: ui_Application.hpp:55
+ +
bool IsFadedIn()
Definition: ui_Application.hpp:107
+
Overlay::Ref ovl
Definition: ui_Application.hpp:38
+
RenderOverFunction render_over_fn
Definition: ui_Application.hpp:33
+
u64 ovl_timeout_ms
Definition: ui_Application.hpp:39
+
bool CallForRenderWithRenderOver(RenderOverFunction render_over_fn)
+
render::Renderer::Ref renderer
Definition: ui_Application.hpp:43
+
void LoadLayout(Layout::Ref lyt)
Definition: ui_Application.hpp:50
+
i32 ShowDialog(Dialog::Ref &dialog)
Definition: ui_Application.hpp:73
+ +
std::function< void(const u64, const u64, const u64, const TouchPoint)> OnInputCallback
Definition: ui_Application.hpp:24
+
std::chrono::steady_clock::time_point ovl_start_time
Definition: ui_Application.hpp:40
+
Definition: ui_Layout.hpp:20
+
Definition: elm_Button.hpp:18
+
s32 i32
Definition: pu_Include.hpp:28
+
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
+
Definition: ui_Types.hpp:62
+ + + +
+
+ + + + diff --git a/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp.html b/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp.html new file mode 100644 index 0000000..96dd638 --- /dev/null +++ b/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp.html @@ -0,0 +1,131 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/render/render_SDL2.hpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
render_SDL2.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Namespaces

namespace  pu
 
namespace  pu::ui
 
namespace  pu::ui::render
 
+ + + + + + + + + + + + + +

+Functions

sdl2::Texture pu::ui::render::ConvertToTexture (sdl2::Surface surface)
 
sdl2::Texture pu::ui::render::LoadImage (const std::string &path)
 
i32 pu::ui::render::GetTextureWidth (sdl2::Texture texture)
 
i32 pu::ui::render::GetTextureHeight (sdl2::Texture texture)
 
void pu::ui::render::SetAlphaValue (sdl2::Texture texture, const u8 alpha)
 
void pu::ui::render::DeleteTexture (sdl2::Texture &texture)
 
+
+
+ + + + diff --git a/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp.js b/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp.js new file mode 100644 index 0000000..739f0c2 --- /dev/null +++ b/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp.js @@ -0,0 +1,9 @@ +var render___s_d_l2_8hpp = +[ + [ "ConvertToTexture", "db/db1/render___s_d_l2_8hpp.html#ae4fc689be6e2b1052e0a3197fe5cd1a6", null ], + [ "DeleteTexture", "db/db1/render___s_d_l2_8hpp.html#a687992204d83230da27780900cc882a1", null ], + [ "GetTextureHeight", "db/db1/render___s_d_l2_8hpp.html#a5ddabd3bd6cfe05172eef8c0dee9234c", null ], + [ "GetTextureWidth", "db/db1/render___s_d_l2_8hpp.html#a8187f56badf43ccf9eed52915345fa01", null ], + [ "LoadImage", "db/db1/render___s_d_l2_8hpp.html#ac6a58de115048eb3260a085d5fcfc3f0", null ], + [ "SetAlphaValue", "db/db1/render___s_d_l2_8hpp.html#ab22ff2d91f71f95a4e889cc942d69b43", null ] +]; \ No newline at end of file diff --git a/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp_source.html b/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp_source.html new file mode 100644 index 0000000..311eb22 --- /dev/null +++ b/include/Plutonium/docs/db/db1/render___s_d_l2_8hpp_source.html @@ -0,0 +1,138 @@ + + + + + + + +Plutonium framework API: Plutonium/include/pu/ui/render/render_SDL2.hpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
render_SDL2.hpp
+
+
+Go to the documentation of this file.
1
+
2/*
+
3
+
4 Plutonium library
+
5
+
6 @file render_SDL2.hpp
+
7 @brief Wrapper code to simplify SDL2 usage
+
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_Types.hpp>
+ +
17
+
18namespace pu::ui::render {
+
19
+ +
21 sdl2::Texture LoadImage(const std::string &path);
+ + +
24 void SetAlphaValue(sdl2::Texture texture, const u8 alpha);
+ +
26
+
27}
+
SDL_Surface * Surface
Definition: sdl2_Types.hpp:15
+
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
+
Definition: render_Renderer.hpp:19
+
i32 GetTextureHeight(sdl2::Texture texture)
+
void DeleteTexture(sdl2::Texture &texture)
+
i32 GetTextureWidth(sdl2::Texture texture)
+
void SetAlphaValue(sdl2::Texture texture, const u8 alpha)
+
sdl2::Texture LoadImage(const std::string &path)
+
sdl2::Texture ConvertToTexture(sdl2::Surface surface)
+
s32 i32
Definition: pu_Include.hpp:28
+ + +
+
+ + + + diff --git a/include/Plutonium/docs/db/ded/classpu_1_1ui_1_1elm_1_1_element-members.html b/include/Plutonium/docs/db/ded/classpu_1_1ui_1_1elm_1_1_element-members.html new file mode 100644 index 0000000..700e9eb --- /dev/null +++ b/include/Plutonium/docs/db/ded/classpu_1_1ui_1_1elm_1_1_element-members.html @@ -0,0 +1,122 @@ + + + + + + + +Plutonium framework API: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
pu::ui::elm::Element Member List
+
+
+ +

This is the complete list of members for pu::ui::elm::Element, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + +
Element()pu::ui::elm::Elementinline
GetHeight()=0pu::ui::elm::Elementpure virtual
GetHorizontalAlign()pu::ui::elm::Elementinline
GetProcessedX()pu::ui::elm::Element
GetProcessedY()pu::ui::elm::Element
GetVerticalAlign()pu::ui::elm::Elementinline
GetWidth()=0pu::ui::elm::Elementpure virtual
GetX()=0pu::ui::elm::Elementpure virtual
GetY()=0pu::ui::elm::Elementpure virtual
h_alignpu::ui::elm::Elementprotected
IsVisible()pu::ui::elm::Elementinline
OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos)=0pu::ui::elm::Elementpure virtual
OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y)=0pu::ui::elm::Elementpure virtual
parent_containerpu::ui::elm::Elementprotected
SetHorizontalAlign(const HorizontalAlign align)pu::ui::elm::Elementinline
SetParentContainer(Container *parent_container)pu::ui::elm::Elementinline
SetVerticalAlign(const VerticalAlign align)pu::ui::elm::Elementinline
SetVisible(const bool visible)pu::ui::elm::Elementinline
v_alignpu::ui::elm::Elementprotected
visiblepu::ui::elm::Elementprotected
~Element()pu::ui::elm::Elementinlinevirtual
+
+ + + + diff --git a/include/Plutonium/docs/db/df4/classpu_1_1ui_1_1extras_1_1_toast-members.html b/include/Plutonium/docs/db/df4/classpu_1_1ui_1_1extras_1_1_toast-members.html new file mode 100644 index 0000000..19dc099 --- /dev/null +++ b/include/Plutonium/docs/db/df4/classpu_1_1ui_1_1extras_1_1_toast-members.html @@ -0,0 +1,137 @@ + + + + + + + +Plutonium framework API: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
Plutonium framework API 0.3.0 +
+
UI framework libraries for libnx
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
pu::ui::extras::Toast Member List
+
+
+ +

This is the complete list of members for pu::ui::extras::Toast, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Add(elm::Element::Ref elem)pu::ui::Containerinline
At(const i32 idx)pu::ui::Containerinline
BaseAlphapu::ui::extras::Toaststatic
Clear()pu::ui::Containerinline
Container(const i32 x, const i32 y, const i32 width, const i32 height)pu::ui::Containerinline
DefaultRadiuspu::ui::Overlaystatic
DefaultYpu::ui::extras::Toaststatic
elemspu::ui::Containerprotected
FadeAlphaVariationpu::ui::Overlaystatic
GetCount()pu::ui::Containerinline
GetHeight()pu::ui::Containerinline
GetRadius()pu::ui::Overlayinline
GetWidth()pu::ui::Containerinline
GetX()pu::ui::Containerinline
GetY()pu::ui::Containerinline
hpu::ui::Containerprotected
Has(elm::Element::Ref &elem)pu::ui::Containerinline
HeightAndTextHeightFactorpu::ui::extras::Toaststatic
HorizontalMarginpu::ui::extras::Toaststatic
MaxFadeAlphapu::ui::Overlaystatic
NotifyEnding(const bool ending)pu::ui::Overlayinline
OnPostRender(render::Renderer::Ref &drawer) overridepu::ui::extras::Toastvirtual
OnPreRender(render::Renderer::Ref &drawer) overridepu::ui::extras::Toastvirtual
Overlay(const i32 x, const i32 y, const i32 width, const i32 height, const Color bg_clr, const bool round=true, const i32 radius=DefaultRadius)pu::ui::Overlayinline
PreRender()pu::ui::Container
Render(render::Renderer::Ref &drawer)pu::ui::Overlay
SetHeight(const i32 height)pu::ui::Containerinline
SetRadius(const i32 radius)pu::ui::Overlayinline
SetText(const std::string &text)pu::ui::extras::Toast
SetWidth(const i32 width)pu::ui::Containerinline
SetX(const i32 x)pu::ui::Containerinline
SetY(const i32 y)pu::ui::Containerinline
Toast(const std::string &text, const std::string &font_name, const Color text_clr, const Color bg_clr)pu::ui::extras::Toast
wpu::ui::Containerprotected
xpu::ui::Containerprotected
ypu::ui::Containerprotected
+
+ + + +