diff --git a/Platformio/OmoteUI/core/screen/ScreenBase.cpp b/Platformio/OmoteUI/core/screen/ScreenBase.cpp index e69de29..820cada 100644 --- a/Platformio/OmoteUI/core/screen/ScreenBase.cpp +++ b/Platformio/OmoteUI/core/screen/ScreenBase.cpp @@ -0,0 +1,11 @@ +#include "ScreenBase.hpp" + +using namespace UI::Screen; + +Base::Base(){ + +} + +void Base::AddWidget(Widget::Base::Ptr aWidget){ + mWidgets.push_back(std::move(aWidget)); +} diff --git a/Platformio/OmoteUI/core/screen/ScreenBase.hpp b/Platformio/OmoteUI/core/screen/ScreenBase.hpp index 1f869cd..fc8a6d9 100644 --- a/Platformio/OmoteUI/core/screen/ScreenBase.hpp +++ b/Platformio/OmoteUI/core/screen/ScreenBase.hpp @@ -1,11 +1,19 @@ #include "lvgl.h" +#include "WidgetBase.hpp" + +#include namespace UI::Screen{ class Base { public: + typedef std::unique_ptr Ptr; + Base(); + void AddWidget(Widget::Base::Ptr aWidget); + private: + std::vector mWidgets; lv_obj_t *mScreen = lv_obj_create(NULL); }; diff --git a/Platformio/OmoteUI/core/widget/WidgetBase.cpp b/Platformio/OmoteUI/core/widget/WidgetBase.cpp index e69de29..c56d254 100644 --- a/Platformio/OmoteUI/core/widget/WidgetBase.cpp +++ b/Platformio/OmoteUI/core/widget/WidgetBase.cpp @@ -0,0 +1,12 @@ +#include "WidgetBase.hpp" + +namespace UI::Widget{ + +Base::Base(lv_obj_t* aLvglSelf): + mLvglSelf(aLvglSelf) +{ + mLvglSelf->user_data = this; +} + + +} \ No newline at end of file diff --git a/Platformio/OmoteUI/core/widget/WidgetBase.hpp b/Platformio/OmoteUI/core/widget/WidgetBase.hpp index 5fcafcf..4254e30 100644 --- a/Platformio/OmoteUI/core/widget/WidgetBase.hpp +++ b/Platformio/OmoteUI/core/widget/WidgetBase.hpp @@ -1,13 +1,13 @@ #include "lvgl.h" + +#include namespace UI::Widget{ class Base{ public: - Base(lv_obj_t* aLvglSelf): - mLvglSelf(aLvglSelf) - { - mLvglSelf.user_data = this; - } + typedef std::unique_ptr Ptr; + + Base(lv_obj_t* aLvglSelf); private: lv_obj_t* mLvglSelf;