From 29e0e255d483020197a623967cb93edbe5e35fc7 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 9 Sep 2018 17:02:05 +0000 Subject: [PATCH] Notes 0.7 ALPHA git-svn-id: svn://kolibrios.org@7331 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/fs.h | 19 --- programs/cmm/notes/Tupfile.lua | 6 + programs/cmm/notes/checkbox.png | Bin 0 -> 255 bytes programs/cmm/notes/checkbox.raw | Bin 0 -> 864 bytes programs/cmm/notes/compile.bat | 9 ++ programs/cmm/notes/edge.png | Bin 0 -> 4722 bytes programs/cmm/notes/edge.raw | 1 + programs/cmm/notes/engine.h | 132 ++++++++++++++++++++ programs/cmm/notes/notes | Bin 0 -> 13285 bytes programs/cmm/notes/notes.c | 213 ++++++++++++++++++++++++++++++++ programs/cmm/notes/notes.txt | 6 + 11 files changed, 367 insertions(+), 19 deletions(-) create mode 100644 programs/cmm/notes/Tupfile.lua create mode 100644 programs/cmm/notes/checkbox.png create mode 100644 programs/cmm/notes/checkbox.raw create mode 100644 programs/cmm/notes/compile.bat create mode 100644 programs/cmm/notes/edge.png create mode 100644 programs/cmm/notes/edge.raw create mode 100644 programs/cmm/notes/engine.h create mode 100644 programs/cmm/notes/notes create mode 100644 programs/cmm/notes/notes.c create mode 100644 programs/cmm/notes/notes.txt diff --git a/programs/cmm/lib/fs.h b/programs/cmm/lib/fs.h index 8affbc8025..4535d98316 100644 --- a/programs/cmm/lib/fs.h +++ b/programs/cmm/lib/fs.h @@ -203,25 +203,6 @@ } -:int GetFile(dword buf, filesize, read_path) -{ - int return_val = 0; - BDVK ReadFile_atr; - dword rBuf; - if (! GetFileInfo(read_path, #ReadFile_atr)) - { - rBuf = malloc(ReadFile_atr.sizelo); - if (! ReadFile(0, ReadFile_atr.sizelo, rBuf, read_path)) - { - ESDWORD[buf] = rBuf; - ESDWORD[filesize] = ReadFile_atr.sizelo; - return_val = 1; - } - } - free(rBuf); - return return_val; -} - enum { DIRS_ALL, diff --git a/programs/cmm/notes/Tupfile.lua b/programs/cmm/notes/Tupfile.lua new file mode 100644 index 0000000000..cedf506467 --- /dev/null +++ b/programs/cmm/notes/Tupfile.lua @@ -0,0 +1,6 @@ +if tup.getconfig("NO_CMM") ~= "" then return end +if tup.getconfig("LANG") == "ru" +then C_LANG = "LANG_RUS" +else C_LANG = "LANG_ENG" -- this includes default case without config +end +tup.rule("notes.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "notes.com") diff --git a/programs/cmm/notes/checkbox.png b/programs/cmm/notes/checkbox.png new file mode 100644 index 0000000000000000000000000000000000000000..270fc82d461f240be052e40e0a36a3176b4c676d GIT binary patch literal 255 zcmV?DhPg;@A$$vJe;Q4gkY2 zxWe1EouF-7bY15{w=3=Zfw%4e&@>G~2!61xtNVqZs@HER#^?&0*$Duk?|T<;O=+Iz z*HBcI$8k_Z_^YOAA^?u#NLA$%0AMMl3YSuzVG*f8&bdOLVUjfvkqQA|&bex}0wgIS zOeqlnQ%Ya|`U3Ch*AP^dK~))JbnRi^_j7S(1~c=l1P>LC3FeR+8qNR!002ovPDHLk FV1nFvXI}sS literal 0 HcmV?d00001 diff --git a/programs/cmm/notes/checkbox.raw b/programs/cmm/notes/checkbox.raw new file mode 100644 index 0000000000000000000000000000000000000000..532d5192b4c7cc0810be07886e92ee7ee68cdca2 GIT binary patch literal 864 zcmeIvF$%yS5ClM9X=C97EqufM!!ng%6_PetSXd-M;{&qAAu`^Hnk{9UhAnEX$2h-f zt)1g6eS;Yuc_sTa>;Q6&GdDSB=bTI_<4dtV9)@Qu|X;10Z literal 0 HcmV?d00001 diff --git a/programs/cmm/notes/compile.bat b/programs/cmm/notes/compile.bat new file mode 100644 index 0000000000..64d9a8b235 --- /dev/null +++ b/programs/cmm/notes/compile.bat @@ -0,0 +1,9 @@ +@del lang.h-- +@echo #define LANG_ENG 1 >lang.h-- + +C-- notes.c +@del notes +@rename notes.com notes +@pause +@del lang.h-- +@del warning.txt diff --git a/programs/cmm/notes/edge.png b/programs/cmm/notes/edge.png new file mode 100644 index 0000000000000000000000000000000000000000..3f513b69659ae9f3085d7435644426b1001e5a19 GIT binary patch literal 4722 zcmV-&5{>PNP)EX>4Tx07%E3mUmQC*A|D*y?1({%`gH|hTglt0MdJtUPWP;8DJ;_4l^{dA)*2i zMMRn+NKnLp(NH8-M6nPQRImpm2q-ZaMN}+rM%Ih2ti1Q~^84egZ|$@9x%=$B&srA% zlBX}1mj+7#kjfMAgFKw+5s^`J>;QlP9$S?PR%=$HTzo3l9?ED;xoI3-JvF1F8#m>QQXW*8-Az9>Nv%ZWK* zkqtikEV84R*{M9Xh{ZXlvs2k(?iKO2Od&_ah_8qXGr62B5#JKAMv5?%E8;ie*i;TP z0{|3BY!`4?i6S-;F^L}%f`(o2L0Dz>ZZyndax(`h}FNp#{ zx{a}MR#uh~m%}m=7xWMPPlvyuufAs_KJJh5&|Nw4Oks+EF0LCZEhSCJr)Q)ySsc3I zpNIG#2mW;)20@&74xhslMTCi_jLS<9wVTK03b<)JI+ypKn)naH{-njZ7KzgM5l~}{ zfYfy=Kz{89C<+lE(fh?+|D$id_%I-TdEqLPi*x_)H~nY9rQ#)noA5c#B`Ac>67n+_ z_r%Wu$9dISw03U@r;Pdb`_%=KWKZEBGfDjQHqKX(I48#TT zN1~8;gpaI8ijWGV0cl0Lkv`-mGK$O~Z&4T&1w}_0qHIx~s8AFOwFb2wRf4KU9Y%Ga zdQmq~W2jlwM>H9&h}K8jpuNx$=mc~Yx)5D~ZbG-CFQRXwC(y4k7z_=gjj_UbVj?j~ zn6;P^%sxyT<{V}aGme?VVzKgAeXJeUAIroFu!Yzv>{0Al>=1SW`vynEso>0T?zku% z50{Utz#YMz!42UiaSM1Uye8fT?~iBWbMU43MtnE^I(`DbK#(SA6YK~fge1ZyLM5S< zaFOtU@RCR*su8V;fkZBGBe9ZrjCh$iMtn<>A?cA^NYNxAX$R>L=^W`U=_Q#=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YGG-b6~5k(P=Mnn6nx%Fcc9S9X=}%jJ^ga!C|Lbh};7&d%6uHf*$9ll>ON! z-5~<*@4b)VA-@$7RDSJ?$)WQf!sV~xu}@q@SoPYzFS3X5Ih2zR<(i6xvYBPsodPhQ z&-wD@3nwQhynOlcU=whNcl&ntW3`X*p~m9AxZW4{$3$g6J`Zv9q3=ePWpdxy$2NG3 z@P`QW6tTE30sgM>m{1%NjDKnzs?y)O-+jq_i11Iv|Dgo_ma{!35KqldmFN3H_;+Dg zwy6Xu&vRY84|RCoYVRrd9pb=aTzCwJ{{+*20deyVL^x+cUjP6A07*qoM6N<$g5d~1 Ad;kCd literal 0 HcmV?d00001 diff --git a/programs/cmm/notes/edge.raw b/programs/cmm/notes/edge.raw new file mode 100644 index 0000000000..ad3ce6cbfa --- /dev/null +++ b/programs/cmm/notes/edge.raw @@ -0,0 +1 @@ +ÿÿÿÿÿÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿòòòæææÚÚÚÓÓÓÉÉÉÅÅÅ»»»»»»ÄÄÄàààÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿðððÖÖÖÆÆÆ»»»ÆÆƼ¼¼íííÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúúúñññéééìììõõõÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüüüÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿûûûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿãããÇÇÇÄÄÄàààýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿûûûßßßÅÅÅÁÁÁÑÑÑíííÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿöööýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýíííßßßÖÖÖÓÓÓÝÝÝùùùÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüüüááááááõõõÿÿÿÿÿÿþþþ¼¼¼ÔÔÔÌÌ̾¾¾ÜÜÜúúúÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìììêêêþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýñññÿÿÿÛÛÛ¼¼¼ÛÛÛÿÿÿÿÿÿõõõçççÙÙÙÑÑÑÙÙÙæææòòòýýýíííÜÜÜÓÓÓêêêýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿöööçççØØØÉÉɽ½½ÊÊÊàààùùùÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúúúíííáááÕÕÕÉÉÉ»»»ÆÆÆÏÏÏÚÚÚàààéééìììõõõõõõíííÒÒÒÈÈÈàààíííñññýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøøøÝÝÝÄÄÄÈÈÈÝÝÝëëëõõõöööáááÑÑÑÿÿÿöööÚÚÚÑÑÑÖÖÖßßßäääíííñññüüüÿÿÿÿÿÿÿÿÿäääÉÉÉÙÙÙéééùùùÿÿÿÿÿÿÿÿÿÿÿÿûûûêêêÙÙÙÇÇÇ¿¿¿ÆÆÆÍÍÍËËËÃÃû»»ÉÉÉÓÓÓáááðððöööÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóéééùùùÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿðððáááÒÒÒÄÄľ¾¾½½½ÐÐÐäääõõõÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿùùùÚÚÚ¾¾¾ÁÁÁÝÝÝÿÿÿÿÿÿÞÞÞÂÂÂêêêíííÔÔÔ¼¼¼ãããýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿùùùßßß½½½ÕÕÕëëëðððáááÆÆÆÎÎÎêêêûûûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿéééÍÍͼ¼¼ÝÝÝýýýÿÿÿÿÿÿÿÿÿÿÿÿôôôíííÝÝÝÍÍͼ¼¼ÊÊÊÕÕÕÝÝÝààà×××ÀÀÀ×××ñññÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàà྾¾ÔÔÔÓÓÓÃÃÃÐÐÐìììäääÎÎÎ÷÷÷÷÷÷ñññÖÖÖ¾¾¾ÜÜÜñññÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿéééÍÍÍËËËÌÌ̼¼¼âââýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿòòòñññêêêáááÖÖÖËËËÁÁÁ½½½ÆÆÆØØØÑÑÑðððÃÃÃÍÍ;¾¾ÃÃÃÎÎÎÚÚÚâââÛÛÛÏÏÏÆÆƼ¼¼ÊÊÊÙÙÙàààÌÌ̼¼¼ØØØñññÿÿÿõõõãããÒÒÒÁÁÁÂÂÂÏÏÏÜÜÜéééôôôçççÕÕÕÀÀÀÑÑÑäääñññääääääÚÚÚÖÖÖÏÏÏ¿¿¿ÉÉÉÓÓÓßßßéééõõõöööøøøùùùúúúúúúûûûûûûüüüúúúøøøêêêÕÕÕÊÊÊÆÆƽ½½»»»ÉÉÉËËËÖÖÖÚÚÚäääéééññññññèèèÝÝÝÍÍÍÁÁÁ×××ííí÷÷÷ùùùûûûüüüüüüùùùÎÎÎÍÍÍÂÂÂÚÚÚâââÝÝÝÖÖÖÑÑÑÉÉÉÆÆƾ¾¾»»»»»»»»»ÑÑÑèèèÛÛÛÍÍÍÀÀÀÅÅÅÔÔÔËËËÇÇǾ¾¾ÌÌÌÛÛÛëëëööö÷÷÷÷÷÷÷÷÷öööõõõéééàààÓÓÓÈÈÈ»»»ÏÏÏêêêÜÜÜÀÀÀÅÅÅÍÍÍÀÀÀËËËâââìììàààÔÔÔÈÈÈ»»»ÈÈÈÓÓÓáááíííõõõôôôãããÑÑÑÃÃÃÂÂÂ×××äääÛÛÛÖÖÖÉÉÉÅÅž¾¾ØØØòòòðððÍÍÍÍÍÍÝÝÝÄÄÄðððùùùúúúøøøëëëËË˼¼¼ÁÁÁÉÉÉÌÌÌÖÖÖÖÖÖãããÍÍÍÀÀÀÑÑÑîîîøøøúúúûûûùùù÷÷÷äääÊÊʾ¾¾ÌÌÌÞÞÞöööÿÿÿæææÊÊÊÈÈÈåååõõõðððÑÑѼ¼¼»»»»»»»»»»»»ÄÄÄÉÉÉØØØåååõõõ÷÷÷øøøùùùùùùøøøôôôÝÝÝÆÆÆÀÀÀÖÖÖîîîÿÿÿãããÇÇÇÙÙÙõõõÿÿÿÿÿÿÞÞÞÂÂÂËËËííí÷÷÷øøøöööãããËËË¿¿¿ìììüüüýýýûûûøøøòòò×××ÆÆÆ¿¿¿ÑÑÑåååÜÜÜÃÃÃÆÆÆæææööö÷÷÷ëëëÍÍͼ¼¼»»»¿¿¿ÉÉÉÒÒÒÙÙÙäääíííôôôÿÿÿÿÿÿÿÿÿøøøññññññïïïääääääÛÛÛÖÖÖÖÖÖÑÑÑÉÉÉÉÉÉÇÇÇ»»»»»»»»»ÅÅÅÆÆÆÌÌÌÓÓÓÝÝÝæææïïïõõõõõõÎÎÎöööøøøðððåååñññõõõ÷÷÷øøøùùùùùùøøøöööööö÷÷÷øøøùùù÷÷÷ñññÜÜÜÆÆƽ½½ÃÃÃÒÒÒáááðððöööøøøùùùúúúûûûúúúøøøõõõáááÑÑÑÇÇÇÑÑÑÑÑÑÚÚÚÝÝÝãããïïïööö÷÷÷øøøùùùúúúüüüüüüýýýýýýþþþþþþÿÿÿÿÿÿÿÿÿþþþýýýûûûøøø÷÷÷ööööööõõõéééçççÝÝÝÚÚÚÑÑÑÍÍÍÆÆÆÆÆÆÎÎÎØØØæææöööøøøûûûüüüþþþþþþÿÿÿÿÿÿýýýõõõæææöööøøøùùùùùùøøøøøø÷÷÷ööööööõõõõõõöööøøøùùùùùù÷÷÷öööíííßßßçççëëëööö÷÷÷ùùùûûûüüüüüüýýýýýýüüüüüüûûûùùùøøø÷÷÷öööõõõãããÌÌÌÒÒÒñññööö÷÷÷öööçççÓÓÓËËËÕÕÕßßßêêêõõõ÷÷÷øøøùùùûûûüüüûûûúúúøøøöööïïïÝÝÝÒÒÒÙÙÙÝÝÝèèèíííöööùùùûûûúúúøøøåååØØØòòòûûûþþþþþþýýýúúúøøøöööðððéééæææÝÝÝÝÝÝÒÒÒåååöööøøøûûûýýýþþþþþþþþþüüüúúú÷÷÷öööæææÖÖÖÂÂÂÎÎÎÁÁÁççç÷÷÷úúúûûûûûûøøøöööõõõõõõõõõöööööö÷÷÷ùùùúúúüüüýýýýýýþþþþþþýýýûûûùùù÷÷÷ñññÝÝÝÉÉɾ¾¾ÍÍÍêêêÛÛÛÕÕÕñññ×××ÌÌÌïïïøøøûûûýýýýýýüüüúúú÷÷÷øøøûûûþþþÿÿÿþþþýýýûûûùùù÷÷÷òòòáááÐÐÐÙÙÙîîî÷÷÷úúúüüüüüüúúúøøøöööõõõòòòéééáááÛÛÛÑÑÑÉÉÉÄÄÄ»»»»»»»»»ÁÁÁÆÆÆÆÆÆÈÈÈÑÑÑÑÑÑÙÙÙÝÝÝÝÝÝáááééééééëëëõõõõõõöööööö÷÷÷÷÷÷øøøøøøùùùúúúûûûûûû÷÷÷ûûûýýýûûûúúúúúúûûûüüüüüüþþþþþþýýýüüüüüüýýýýýýýýýýýýûûûùùù÷÷÷ôôôöööøøøúúúûûûüüüýýýþþþþþþÿÿÿþþþýýýüüüúúúøøø÷÷÷øøøøøøùùùùùùúúúûûûüüüýýýýýýþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýýýýüüüüüüûûûûûûúúúùùùùùùøøø÷÷÷÷÷÷÷÷÷øøøùùùúúúüüüýýýþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýûûûüüüýýýþþþþþþýýýýýýýýýüüüüüüüüüüüüüüüýýýþþþþþþýýýüüüûûûúúúúúúûûûüüüýýýþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþýýýýýýüüüûûûúúúøøøùùùûûûüüüýýýüüüúúúøøøøøøøøøùùùûûûüüüüüüýýýþþþþþþÿÿÿÿÿÿþþþýýýüüüûûûùùùøøøùùùùùùúúúûûûüüüýýýþþþþþþýýýúúúúúúüüüþþþÿÿÿÿÿÿÿÿÿþþþýýýüüüûûûûûûúúúùùùùùùùùùúúúüüüýýýþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýüüüúúúøøøöööåååîîîúúúüüüþþþÿÿÿþþþýýýüüüüüüüüüüüüüüüüüüýýýýýýþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþüüüûûûùùù÷÷÷óóóøøøùùùøøøßßßÁÁÁÖÖÖ÷÷÷ûûûýýýþþþÿÿÿÿÿÿÿÿÿþþþýýýýýýþþþÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýüüüûûûúúúøøøùùùûûûýýýþþþÿÿÿÿÿÿþþþýýýüüüüüüûûûúúúúúúùùùøøø÷÷÷ööööööõõõõõõöööööö÷÷÷÷÷÷øøøøøøùùùùùùùùùúúúúúúúúúûûûûûûüüüüüüüüüüüüýýýýýýýýýýýýþþþþþþþþþüüüýýýþþþþþþýýýþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýüüüüüüýýýþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýýýýýýýýýýýýýþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþýýýýýýýýýýýýýýýýýýýýýþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýýýýþþþÿÿÿÿÿÿÿÿÿþþþýýýýýýýýýþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþýýýýýýþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýüüüûûûüüüþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýüüüýýýþþþýýýúúú÷÷÷ùùùüüüþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþýýýþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþýýýýýýüüüüüüüüüüüüüüüüüüüüüýýýýýýýýýýýýþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþ \ No newline at end of file diff --git a/programs/cmm/notes/engine.h b/programs/cmm/notes/engine.h new file mode 100644 index 0000000000..1dd1853a52 --- /dev/null +++ b/programs/cmm/notes/engine.h @@ -0,0 +1,132 @@ +#define LINES_COUNT 13 +#define MAX_LINE_CHARS 256 + +#define CHBOX 12 +#define CHECKBOX_ID 50 +unsigned char checkbox[sizeof(file "checkbox.raw")]= FROM "checkbox.raw"; + +#define COL_BG_ACTIVE 0xFFE56B +#define COL_BG_INACTIVE 0xFFFFFF + +//===================================================// +// // +// LINE // +// // +//===================================================// + +struct NOTE_LINE +{ + bool state; + char data[MAX_LINE_CHARS]; +}; + +//===================================================// +// // +// LIST // +// // +//===================================================// + +struct NOTES { + llist list; + char txt_path[4096]; + char txt_data[MAX_LINE_CHARS*LINES_COUNT]; + + NOTE_LINE lines[LINES_COUNT]; + + char edit_active; + int OpenTxt(); + int SaveTxt(); + void DeleteCurrentNode(); + void DrawList(); + dword DrawLine(int line_n, draw_h); +} notes; + + +int NOTES::OpenTxt(dword file_path) +{ + int i=0, linepos=0; + int item_n=-1; + + strcpy(#txt_path, file_path); + ReadFile(0, 4096, #txt_data, #txt_path); + if (!txt_data) || (strncmp(#txt_data, "notes", 5)!=0) + { + notify("'Notes\nData file does not exists or is not valid' -tE"); + return 0; + } + else + { + i+=5; //skip "notes" indefinier + while (txt_data[i]) + { + if (txt_data[i]=='\n') { + item_n++; + i+=2; + if (txt_data[i]=='-') lines[item_n].state=false; else lines[item_n].state=true; + i+=2; + linepos = 0; + continue; + } + if (linepos1Hh`fjzf$mtCDSq6zqZT&G2V#`a$rK4qGN9dt zCfMfar?i^3$)kWgcRDq2D1ojZUKAwtyD+3$1Cwd*04H_m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programs/cmm/notes/notes.c b/programs/cmm/notes/notes.c new file mode 100644 index 0000000000..bb0d9cd7f8 --- /dev/null +++ b/programs/cmm/notes/notes.c @@ -0,0 +1,213 @@ +// Notes v0.7 ALPHA + +#define MEMSIZE 0xDAE80 +#include "..\lib\kolibri.h" +#include "..\lib\mem.h" +#include "..\lib\strings.h" +#include "..\lib\fs.h" +#include "..\lib\dll.h" + +#include "..\lib\obj\box_lib.h" +#include "..\lib\gui.h" +#include "..\lib\encoding.h" +#include "..\lib\list_box.h" + +//===================================================// +// // +// DATA // +// // +//===================================================// + +#ifndef AUTOBUILD + #include "lang.h--" +#endif + +#define LANG_RUS + +#ifdef LANG_RUS + ?define WINDOW_CAPTION "‡ ¬¥âª¨" + ?define DELETE_TEXT "Udoli"; +#else + ?define WINDOW_CAPTION "Notes and reminders" + ?define DELETE_TEXT "Delete"; +#endif + +#define RED_LINE_X 22 +#define COL_RED_LINE 0xF3C9C9 +unsigned char edge[sizeof(file "edge.raw")]= FROM "edge.raw"; //292x6 +#define EDGE_H 6 +#define TITLE_H 24 +#define HEADER_HEIGHT TITLE_H+EDGE_H + +#define DELETE_BTN 4; + +#include "engine.h" + +dword editbox_text; +proc_info Form; +edit_box edit_box= {0,999,0,COL_BG_ACTIVE,0x94AECE,COL_BG_ACTIVE,0xffffff,0,MAX_LINE_CHARS-1,#editbox_text,#mouse,100000000000010b}; +dword lists[] = { 0xEAEAEA, 0xCDCDCD, 0xF0F0F0, 0xD8D8D8, 0 }; + +//===================================================// +// // +// CODE // +// // +//===================================================// + +struct KDelete { + char width; + char active; + void Draw(); +} DeleteBtn; + +void KDelete::Draw(dword x, y, h) +{ + width = strlen(DELETE_TEXT)+2*6; + x -= width+1; + DefineButton(x, y, width, h-1, DELETE_BTN, 0xFF0000); + WriteText(x+6+1, h/2-4+y, 0x80, 0xFFFfff, DELETE_TEXT); +} + +void main() +{ + int btn; + dword cur_line_offset; + load_dll(boxlib, #box_lib_init,0); + + if (param) notes.OpenTxt(#param); else notes.OpenTxt(abspath("notes.txt")); + notes.list.cur_y = -1; + + SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); + + loop() switch(WaitEvent()) + { + case evMouse: + mouse.get(); + + if (notes.list.MouseOver(mouse.x, mouse.y)) { + notes.list.ProcessMouse(mouse.x, mouse.y); + if (mouse.lkm) EventSelectItem(); + if (mouse.pkm) EventDrawDeleteButton(); + } + + if (mouse.lkm) && (mouse.y=0) edit_box_mouse stdcall (#edit_box); + break; + + case evButton: + btn = GetButtonID(); + if (CLOSE_BTN == btn) EventExitApp(); + if (DELETE_BTN == btn) + { + notes.DeleteCurrentNode(); + notes.DrawList(); + DeleteBtn.active = 0; + break; + } + if (btn>=CHECKBOX_ID) //checkboxes + { + notes.lines[btn-CHECKBOX_ID].state ^= 1; + notes.DrawList(); + break; + } + break; + + case evKey: + GetKeys(); + if (SCAN_CODE_ESC == key_scancode) EventExitApp(); + if (SCAN_CODE_DOWN == key_scancode) { EventActivateLine(notes.list.cur_y+1); break; } + if (SCAN_CODE_UP == key_scancode) { EventActivateLine(notes.list.cur_y-1); break; } + if (notes.list.cur_y>=0) edit_box_key stdcall (#edit_box); + break; + + case evReDraw: + draw_window(); + } +} + + +void DrawCloseButton(dword x,y,w,h) +{ + DrawRectangle(x,y,w,h,0xC96832); + DrawRectangle3D(x+1,y+1,w-2,h-2,0xE6A37F,0xDD8452); + PutPixel(x+w-1, y+1, 0xE08C5E); + DefineButton(x+1,y+1,w-1,h-1,CLOSE_BTN+BT_HIDE,0); + WriteTextB(-6+w/2+x,h/2-4+y,0x80,0xFFFfff,"x"); +} + +void draw_window() +{ + int i; + notes.list.SetSizes(1, HEADER_HEIGHT, 270, RED_LINE_X*LINES_COUNT, RED_LINE_X); + DefineAndDrawWindow(100,100,notes.list.w+1,notes.list.h+HEADER_HEIGHT+4,0x01,0,0,0x01fffFFF); + //DefineDragableWindow(100, 100, notes.list.w+1, notes.list.h+HEADER_HEIGHT+4); + GetProcessInfo(#Form, SelfInfo); + DrawRectangle3D(0,0,Form.width,TITLE_H-1,0xBB6535, 0xCD6F3B); + DrawRectangle3D(1,1,Form.width-2,TITLE_H-3,0xEFBFA4, 0xDD8452); + DrawBar(2,2,Form.width-3,TITLE_H-4,0xE08C5E); + WriteText(9,TITLE_H/2-6,0x90,0xA9613A,WINDOW_CAPTION); + WriteTextB(7,TITLE_H/2-7,0x90,0xFFFfff,WINDOW_CAPTION); + _PutImage(1, TITLE_H, 292,EDGE_H, #edge); + PutPixel(notes.list.x+RED_LINE_X, notes.list.y-1, COL_RED_LINE); + ECX-=1; $int 0x40; + DrawCloseButton(Form.width-23,4,16,16); + DrawRectangle(0,TITLE_H,Form.width,Form.height-HEADER_HEIGHT+EDGE_H,0xBBBBBB); + for (i=0; lists[i]!=0; i++) DrawBar(1,Form.height-i-1, Form.width-1, 1, lists[i]); + edit_box.width = notes.list.w-RED_LINE_X-8; + edit_box.left = notes.list.x+RED_LINE_X+4; + + notes.DrawList(); +} + +void DrawEditBox_Notes() +{ + edit_box.pos = edit_box.offset = edit_box.shift = 0; + edit_box.size = strlen(edit_box.text); + edit_box.top = notes.list.cur_y*notes.list.item_h+4+notes.list.y; + edit_box_draw stdcall(#edit_box); +} + +//===================================================// +// // +// EVENTS // +// // +//===================================================// + +void EventActivateLine(int line_n) +{ + int old; + if (line_n<0) || (line_n>notes.list.count) return; + DeleteBtn.active = 0; + //redraw lines + notes.list.cur_y = line_n; + edit_box.text = notes.DrawLine(notes.list.cur_y, notes.list.item_h); + notes.DrawList(); + DrawEditBox_Notes(); +} + + +void EventExitApp() +{ + notes.SaveTxt(); + ExitProcess(); +} + +void EventDrawDeleteButton() +{ + notes.DrawLine(notes.list.cur_y, notes.list.item_h); + DeleteBtn.Draw(notes.list.x+notes.list.w, notes.list.cur_y*notes.list.item_h+notes.list.y, notes.list.item_h); + edit_box.top=-20; + DeleteBtn.active = 1; +} + +void EventSelectItem() +{ + int id; + id = mouse.y-notes.list.y/notes.list.item_h; + if (DeleteBtn.active) && (mouse.x>notes.list.x+notes.list.w-DeleteBtn.width) return; + if (id!=notes.list.cur_y) && (id