diff --git a/Platformio/OmoteUI/core/ScreenManager.cpp b/Platformio/OmoteUI/core/ScreenManager.cpp new file mode 100644 index 0000000..9b16fbb --- /dev/null +++ b/Platformio/OmoteUI/core/ScreenManager.cpp @@ -0,0 +1,16 @@ +#include "ScreenManager.hpp" + + +using namespace UI::Screen; + +Manager Manager::mManager = Manager(); + +Manager& Manager::getInstance(){ + return mManager; +} + +Manager::Manager(){} + +void Manager::pushScreen(std::unique_ptr aPage){ + pages.push(std::move(aPage)); +} diff --git a/Platformio/OmoteUI/core/ScreenManager.hpp b/Platformio/OmoteUI/core/ScreenManager.hpp new file mode 100644 index 0000000..fce6fb9 --- /dev/null +++ b/Platformio/OmoteUI/core/ScreenManager.hpp @@ -0,0 +1,20 @@ +#include "ScreenBase.hpp" +#include +#include + +namespace UI::Screen{ + +class Manager{ +public: + static Manager& getInstance(); + + void pushScreen(std::unique_ptr aPage); + +private: + Manager(); + static Manager mManager; + + std::stack> pages; +}; + +} \ No newline at end of file diff --git a/Platformio/OmoteUI/core/interfaces/IHandleButtons.hpp b/Platformio/OmoteUI/core/interfaces/IHandleButtons.hpp new file mode 100644 index 0000000..d5e1408 --- /dev/null +++ b/Platformio/OmoteUI/core/interfaces/IHandleButtons.hpp @@ -0,0 +1,3 @@ +class IHandleButtons{ + virtual void OnKeyTap() = 0; +}; \ No newline at end of file diff --git a/Platformio/OmoteUI/core/screen/ScreenBase.cpp b/Platformio/OmoteUI/core/screen/ScreenBase.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Platformio/OmoteUI/core/screen/ScreenBase.hpp b/Platformio/OmoteUI/core/screen/ScreenBase.hpp new file mode 100644 index 0000000..1f869cd --- /dev/null +++ b/Platformio/OmoteUI/core/screen/ScreenBase.hpp @@ -0,0 +1,12 @@ +#include "lvgl.h" +namespace UI::Screen{ + +class Base { +public: + Base(); + +private: + lv_obj_t *mScreen = lv_obj_create(NULL); +}; + +} \ No newline at end of file diff --git a/Platformio/OmoteUI/core/widget/WidgetBase.cpp b/Platformio/OmoteUI/core/widget/WidgetBase.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Platformio/OmoteUI/core/widget/WidgetBase.hpp b/Platformio/OmoteUI/core/widget/WidgetBase.hpp new file mode 100644 index 0000000..5fcafcf --- /dev/null +++ b/Platformio/OmoteUI/core/widget/WidgetBase.hpp @@ -0,0 +1,18 @@ +#include "lvgl.h" +namespace UI::Widget{ + +class Base{ +public: + Base(lv_obj_t* aLvglSelf): + mLvglSelf(aLvglSelf) + { + mLvglSelf.user_data = this; + } + +private: + lv_obj_t* mLvglSelf; + + uint16_t mId; +}; + +} diff --git a/Platformio/platformio.ini b/Platformio/platformio.ini index 45bd512..ba9d32d 100644 --- a/Platformio/platformio.ini +++ b/Platformio/platformio.ini @@ -40,6 +40,9 @@ build_flags = ; ------------- Includes ------------------------------------ -I OmoteUI -I OmoteUI/core + -I OmoteUI/core/interfaces + -I OmoteUI/core/screen + -I OmoteUI/core/widget -I OmoteUI/UIs -I OmoteUI/UIs/Basic -I HAL