diff --git a/include/calculatorTab.hpp b/include/calculatorTab.hpp new file mode 100644 index 0000000..4d5459d --- /dev/null +++ b/include/calculatorTab.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include + +struct CalculatorTab : public brls::Box +{ + CalculatorTab(); + + static brls::View* create(); + + private: +}; \ No newline at end of file diff --git a/include/mainActivity.hpp b/include/mainActivity.hpp new file mode 100644 index 0000000..6807c2b --- /dev/null +++ b/include/mainActivity.hpp @@ -0,0 +1,8 @@ +#pragma once + +#include + +struct MainActivity : public brls::Activity +{ + CONTENT_FROM_XML_RES("activity/main.xml") +}; \ No newline at end of file diff --git a/resources/.gitignore b/resources/.gitignore new file mode 100644 index 0000000..4180d7a --- /dev/null +++ b/resources/.gitignore @@ -0,0 +1 @@ +shaders/** \ No newline at end of file diff --git a/resources/i18n/en-US/text.json b/resources/i18n/en-US/text.json new file mode 100644 index 0000000..604d8f5 --- /dev/null +++ b/resources/i18n/en-US/text.json @@ -0,0 +1,13 @@ +{ + "title": "Calculator_NX Rewrite", + + "tabs": { + "calculator": "Calculator", + "settings": "Settings", + "about": "About Calculator_NX" + }, + + "calculator": { + "expression_enter": "Enter an expression" + } +} \ No newline at end of file diff --git a/resources/shaders/fill_aa_fsh.dksh b/resources/shaders/fill_aa_fsh.dksh deleted file mode 100644 index 1f615d9..0000000 Binary files a/resources/shaders/fill_aa_fsh.dksh and /dev/null differ diff --git a/resources/shaders/fill_fsh.dksh b/resources/shaders/fill_fsh.dksh deleted file mode 100644 index 14cf502..0000000 Binary files a/resources/shaders/fill_fsh.dksh and /dev/null differ diff --git a/resources/shaders/fill_vsh.dksh b/resources/shaders/fill_vsh.dksh deleted file mode 100644 index 6285e2d..0000000 Binary files a/resources/shaders/fill_vsh.dksh and /dev/null differ diff --git a/resources/xml/activity/main.xml b/resources/xml/activity/main.xml new file mode 100644 index 0000000..436c419 --- /dev/null +++ b/resources/xml/activity/main.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/xml/tabs/calculator.xml b/resources/xml/tabs/calculator.xml new file mode 100644 index 0000000..3d26faa --- /dev/null +++ b/resources/xml/tabs/calculator.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/calculatorTab.cpp b/source/calculatorTab.cpp new file mode 100644 index 0000000..1e79d71 --- /dev/null +++ b/source/calculatorTab.cpp @@ -0,0 +1,11 @@ +#include + +CalculatorTab::CalculatorTab() +{ + this->inflateFromXMLRes("xml/tabs/calculator.xml"); +} + +brls::View* CalculatorTab::create() +{ + return new CalculatorTab(); +} \ No newline at end of file diff --git a/source/main.cpp b/source/main.cpp index 3ba586d..ad64012 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,12 +1,24 @@ #include -#include -#include +#include +#include -#include +using namespace brls::literals; int main(int argc, char *argv[]) { + if (!brls::Application::init()) + { + brls::Logger::error("Unable to init Borealis application"); + return EXIT_FAILURE; + } + brls::Application::createWindow("Calculator_NX rewrite"); + brls::Application::setGlobalQuit(true); + brls::Application::registerXMLView("CalculatorTab", CalculatorTab::create); + brls::Application::pushActivity(new MainActivity()); + + while (brls::Application::mainLoop()); + return EXIT_SUCCESS; } \ No newline at end of file diff --git a/source/mainActivity.cpp b/source/mainActivity.cpp new file mode 100644 index 0000000..68c0ff2 --- /dev/null +++ b/source/mainActivity.cpp @@ -0,0 +1 @@ +#include \ No newline at end of file