Skip to content

Commit 36d5eb0

Browse files
committed
Add ui module
1 parent fba3ee4 commit 36d5eb0

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
add_subdirectory(app)
22

33
add_subdirectory(global)
4+
add_subdirectory(ui)
45
add_subdirectory(uicomponents)
56
add_subdirectory(keyboard)

src/app/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
22

33
#include "app.h"
4+
#include "ui/uimodule.h"
45
#include "uicomponents/uicomponentsmodule.h"
56
#include "keyboard/keyboardmodule.h"
67

@@ -9,6 +10,7 @@ using namespace scratchcpp;
910
int main(int argc, char *argv[])
1011
{
1112
App app;
13+
app.addModule(new ui::UiModule);
1214
app.addModule(new uicomponents::UiComponentsModule);
1315
app.addModule(new keyboard::KeyboardModule);
1416

src/ui/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set(MODULE ui)
2+
set(MODULE_URI Ui)
3+
set(MODULE_SRC
4+
uimodule.cpp
5+
uimodule.h
6+
)
7+
8+
include(${PROJECT_SOURCE_DIR}/build/module.cmake)

src/ui/uimodule.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
#include "uimodule.h"
4+
5+
using namespace scratchcpp::ui;
6+
7+
UiModule::UiModule()
8+
{
9+
}
10+
11+
std::string UiModule::moduleName() const
12+
{
13+
return "ui";
14+
}

src/ui/uimodule.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
#pragma once
4+
5+
#include "modularity/imodulesetup.h"
6+
7+
namespace scratchcpp::ui
8+
{
9+
10+
class UiModule : public modularity::IModuleSetup
11+
{
12+
public:
13+
UiModule();
14+
15+
std::string moduleName() const override;
16+
};
17+
18+
} // namespace scratchcpp::ui

0 commit comments

Comments
 (0)