From 0073030aa814be4bb244e2e21c421c5d14df0113 Mon Sep 17 00:00:00 2001 From: EmreTech <50607143+EmreTech@users.noreply.github.com> Date: Fri, 23 Jul 2021 10:41:09 -0700 Subject: [PATCH] Added simple calculator tab view layout --- include/calculatorTab.hpp | 12 ++ include/mainActivity.hpp | 8 ++ resources/.gitignore | 1 + resources/i18n/en-US/text.json | 13 +++ resources/shaders/fill_aa_fsh.dksh | Bin 2304 -> 0 bytes resources/shaders/fill_fsh.dksh | Bin 2304 -> 0 bytes resources/shaders/fill_vsh.dksh | Bin 768 -> 0 bytes resources/xml/activity/main.xml | 16 +++ resources/xml/tabs/calculator.xml | 179 +++++++++++++++++++++++++++++ source/calculatorTab.cpp | 11 ++ source/main.cpp | 18 ++- source/mainActivity.cpp | 1 + 12 files changed, 256 insertions(+), 3 deletions(-) create mode 100644 include/calculatorTab.hpp create mode 100644 include/mainActivity.hpp create mode 100644 resources/.gitignore create mode 100644 resources/i18n/en-US/text.json delete mode 100644 resources/shaders/fill_aa_fsh.dksh delete mode 100644 resources/shaders/fill_fsh.dksh delete mode 100644 resources/shaders/fill_vsh.dksh create mode 100644 resources/xml/activity/main.xml create mode 100644 resources/xml/tabs/calculator.xml create mode 100644 source/calculatorTab.cpp create mode 100644 source/mainActivity.cpp 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 1f615d97d7a5472c6434d795aba2da1cb2aaec7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2304 zcmdT_L1th*@hxE3tK>tgk(8(leJKYyJpv=8=)@eCw5##W|s<+e$Tz{KVt@@D;ExY?!WK8_x`=-oO|c} zYae}Zf$(EIB_es3S9xafI6Tk$wU_VW@y{_ zZ%6Y3E^_}3QTw59os-2D{wp<%%f^)EBm^c?EJ{&jyp>SOA%U{J;7i@jnp!4b}AfM)F2~ zT3S&5O*a_x&L?Cgf9cy?zeLc3)G7TV`o>H3;_R;x?dEmJw7qwr`tD>?F7ow2$5!fy z@;*!5r7`W}y!Cx&l~>>h+jcvRBj~dNegj?+&FH$p_a&a@-?zY1{BSPp9}2#mEap5f zhx`Rsrse$nH|XEYncTOzWm?s^^pAW$LOFWB=t|~@=m$2H`6Kv=Uf^5N1#HlR)F=AT zxhHt#`cRzVkEH+iGpG2%4|xYYg!usM6R!)Of535=y*93Prb|}mlf~bf$Axnn?hknV z`~7s$-;eXa2lu}uJefb!C#LWlRJ~-$j?+=sf!+L#$Jk#v;aTWTXLK;_dvE6NZs(wQ5(kEtH*emX@4fGPf8M$F z{=3f*F2-FZlHc-E?j_t$;QptpxAqk>|DV^^&8_6KFE=+f*OT4u?POzfBe{L^R`Tik zC!OThPO`hc^F=4w*Dg^A2!X}ovg!oTZZvyc+IamrUN5&4s!2HsAH z8d7eVy`yjZ+ml(G)al0sGVG{a={8H=)#W*JRsA&neolSFOARXX_$rrHXh`F$#taZ| zHGg%c&~VSu|3g`LbHPN43g_Zyr1PlkQ1==9f&BsM2i% z6 z)LNSj^3WgK%haRs>XZ0BW4_D-KdV`Ph@(E2Y5bm{J&hal;9T68J&jx1*SNL6or_z$uknZuG#*7K zc|4i-`U{mPI?y-?F6qx?_Ms~&zs6?1jWQdPL%)B_X8!J}@=xFwxbg5U;oU)hJ-hM7 z)J@XbVU581^N;gxIOCh$;VJcN^}HqWn=qzi$LL_QTSO`meaj zoJSv#75uU{yr}&VK?l-ju3y=o`o*Q6BiavrKvTJX`@ZU;te=>MR{Dr?ou}^7oDQKM zEBtk#pUjF5dT!L7LSHrD5A%v>QJ))pU*c*0eT#XDAM(Qc$1>l(k2%NXfM4dyw4CRE z4gGs(a^L2bsikq5pL{>U;jQ&WN3zGF7ueLT$^KM~=mWkL9l+{2gMOsH9{N+g!q@pq zpBD3kodSOi`ycS~BOSbOHouW~0e6_6ojJ(Ia_U~3*HK^i5PY25FrUAvfAOq-`4`kj zKIQ_QJsos5#5wqCHJMnck8?%*BF}n00Y5I~yU26uUzYu#z;}`7nVfH!f04Jqvz{-a zkG!uU&r_Tq=jWH{FU%|TFU{+BF#nv_BG0M6EBsdj-;a3C_)-48MZWBX@R#!z_E_=h ze&xF0Oc%yvddT~Wt<7{1cn*A}&Sd9*fw%D96#A{*^Dg*B`@2s)^@4urVN3(>00KrJW@2Cfu|Z4_FaTl>Fl+b{Ir%vXd1aX?nTZPJ8I=ktnJEgD`K1cE ziP@p*doKg!ekDNzXg#@4B}vQOiU1UAH)wlU|b^4z{IG|z#x+WHTTAQRwniadx1!c zha3uj7-q;r?f>wejo~|g1N)2^cCh)(j1L(f{I&lh&%pAZoxS1z$M^g|cL2d-eunn{ N|M?vrp?Y-a@c=DbQwIP5 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