From c683ddb194707e47e437ed6aa4ec694d3da25d99 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 3 Nov 2013 11:21:09 +0000 Subject: [PATCH] letter icons wrap, key process using building library function git-svn-id: svn://kolibrios.org@4152 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/liza/compile.bat | 4 +-- programs/cmm/liza/img/letter_icons.h | 1 + programs/cmm/liza/img/letter_icons.png | Bin 0 -> 1153 bytes programs/cmm/liza/img/letter_icons.raw | Bin 0 -> 648 bytes programs/cmm/liza/in_out_mail.png | Bin 1163 -> 0 bytes programs/cmm/liza/in_out_mail.raw | 1 - programs/cmm/liza/liza.c | 43 ++++++++++++----------- programs/cmm/liza/mail_box.c | 46 ++++++------------------- 8 files changed, 36 insertions(+), 59 deletions(-) create mode 100644 programs/cmm/liza/img/letter_icons.h create mode 100644 programs/cmm/liza/img/letter_icons.png create mode 100644 programs/cmm/liza/img/letter_icons.raw delete mode 100644 programs/cmm/liza/in_out_mail.png delete mode 100644 programs/cmm/liza/in_out_mail.raw diff --git a/programs/cmm/liza/compile.bat b/programs/cmm/liza/compile.bat index ece1b06217..d728f718d6 100644 --- a/programs/cmm/liza/compile.bat +++ b/programs/cmm/liza/compile.bat @@ -1,5 +1,5 @@ ..\C--\C-- liza.c -@del liza_mail -@rename liza.com liza_mail +@del liza +@rename liza.com liza @del warning.txt @pause \ No newline at end of file diff --git a/programs/cmm/liza/img/letter_icons.h b/programs/cmm/liza/img/letter_icons.h new file mode 100644 index 0000000000..c9f5cc67d2 --- /dev/null +++ b/programs/cmm/liza/img/letter_icons.h @@ -0,0 +1 @@ +dword letter_icons_pal[]= {0x008080C0,0x00ADADAD,0x00ABABAB,0x00A9A9A9,0x00A8A8A8,0x00B2B2B2,0x00F0F0F0,0x00FFFFFF,0x00F1F1F1,0x00B0B0B0,0x00D1D1D1,0x00DEDEDE,0x00FCFCFC,0x00F6F6F6,0x00F4F4F4,0x00F5F5F5,0x00DFDFDF,0x00CECECE,0x00ACACAC,0x00F8F8F8,0x00BEBEBE,0x00D8D8D8,0x00F3F3F3,0x00ECECEC,0x00DCDCDC,0x00BBBBBB,0x00A5A5A5,0x00EEEEEE,0x00B5B5B5,0x00D6D6D6,0x00EDEDED,0x00E6E6E6,0x00DADADA,0x009F9F9F,0x00E3E3E3,0x00AEAEAE,0x00E9E9E9,0x00D7D7D7,0x00E4E4E4,0x00E5E5E5,0x00989898,0x00CFCFCF,0x007C7C7C,0x00787878,0x00E0E0E0,0x00919191,0x00D2D2D2,0x009D9D9D,0x00F2F2F2,0x00999999,0x009B9B9B,0x00A7A7A7,0x00A2A2A2,0x00D4D4D4,0x008B8B8B,0x00CDCDCD,0x00A1A1A1,0x00858585,0x00EBEBEB,0x00E7E7E7,0x009A9A9A,0x00818181,0x00D9D9D9,0x00EAEAEA,0x00828282,0x00606060,0x00848484,0x00838383,0x00179C15,0x00F7F7CD,0x008FF778,0x00E4F7C0,0x00C2F7A6,0x00F3F6C2,0x00EBF7BF,0x00ADF791,0x0095F77E,0x002CF21F,0x0038E82A,0x0026DC17,0x0025CC1D,0x0020E915,0x00179714,0x00169C13,0x0026E21D,0x0029EC1D,0x0015909B,0x00B7F7FA,0x0078F6EC,0x00C3F9FB,0x00A6F6E3,0x0091F6E5,0x007DF7EC,0x001FE9F2,0x0029E2E8,0x0021CFDB,0x001DC2CB,0x0015DEE9,0x0012818B,0x001DD7E2,0x001DE3EC} \ No newline at end of file diff --git a/programs/cmm/liza/img/letter_icons.png b/programs/cmm/liza/img/letter_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..0c7e6479c36c91697162698807f3a36622c4741d GIT binary patch literal 1153 zcmd^-i%(K<6vwZcTQgi*lFK4Aii)wd?1kCVNKLJo8a-D=Wvy~OELW_o6tJb#61Pf0 za=3h6a7J_HBXjhamB=6vBvTVn!HWabd(Eud4{ZGto&C=Dcg}a8o$dF?PfptH?-$|+ zL6Cn!d`v3X7lB+g-v{W+jUqh+`9R5gS+Stya5&l7*}+ePmXt0IE+ww+BvE^Vse`0Y zD{&n{qPxh9QQD$h0kKd_Qhp}(SxJULk{KaeU1934>jpeqLUlKp+qbg~i3iB_$;ykw`2SOC*xAvNEYuT3%jWQBhG~*y zlgs6Gb#?Xi^$LZep`oFrrKPQ{Ehnd4jtPaRr4ltaVlzstatwQ;QmMMSy3}g5Mx)Vc zwK|=yySv+9Fc^)-o}M0)$<*81+t=6E-{1fC$Il_GeF9Ztm}+2Pz-%@T4Gmc=mf_*y zk&zLr)oQcZ#>U1F1hL!g$kc8z<(H?$D)T)@AJXoy|Pl1_CwLb#R4dG|^#^ODPyRNsah;oAJZ@ zNNm#T}(0nV+)*6|$Lfw3xl~0Y*hb+;aqFtsY zzt7lgk9irV zelC#py>${*l4Kv!!X6|R+QYw)3yZo=5Cad~Jrp!gTihzwq8R`8qZ;17;sWxM{kPQbCE-E}uf;Nn2=HuPCo; zL!XKxY~%5}I%Z7T@XQ;ld`3Ufoc8!#@7_?tPH+9~jm`)&uUA%{aetzO*rb>`CY$>Q D4|cY< literal 0 HcmV?d00001 diff --git a/programs/cmm/liza/img/letter_icons.raw b/programs/cmm/liza/img/letter_icons.raw new file mode 100644 index 0000000000000000000000000000000000000000..25cbae6b2825d8f3204a49333af52bf1ab536358 GIT binary patch literal 648 zcmcK1T{{9n7{>9tttf@56w0Z%z^%9d@7VYsJ}=;(2m~jmEYm?2@&n<>Of)uYiOtPN!azL17SyCB`M94Y;y@~$ zRu|O_V;QdKStAAHIOq8#UB1hC&R23kfk#)@ik{N?MsagX@tg%+zVBKnvw}{eP4>|?7&qA8i(~-t!|P3Q3DvYi^$nUP3njJbdlxwga%!7 z+G@4V&M%r|cTroqyt=+2yX*F@e|G;s!(G%SM;Fn5b=i9f;oM7f#P43h^4JxFy~I;j jdVc8$doR(GUfDbFON8IZhD5O={ literal 0 HcmV?d00001 diff --git a/programs/cmm/liza/in_out_mail.png b/programs/cmm/liza/in_out_mail.png deleted file mode 100644 index 875d244cdd6d92a92687c86313502e397162fcc2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1163 zcmeAS@N?(olHy`uVBq!ia0vp^LO`s-!3-of8_&ARz`)E9;1l8sVV{{L4>@=WlC1dQtK1 zP3`wL{ogC5ey?k8ZfDz7YisN1=;-Y1?CR?3>FJp;VZyX&(`L+=F?;sxxpU_( zTC`}%k|j%*E?vHS`O1|mSFKvLdiClxYu2n?yLSEh^&2*9*tBWWmMvShZr!?L$Bvyl zckbDD|1uim_Q z^Y-oA_wV0-`0(NL=g(iheEItI>(8G*|NQy$_wV2T|Np0?qyR&*?9YwWJQ*$`7t4Sg z5ck1qo+VyI^C4WXq9s7V)jUstr1$qLt9fdGB4xQR%5ontFz^5kSk!G$-- zSk?3;v#;-;|F`2TTGOP>?>@DC9(m`pMbBS3o_4{o-fPdzbsyX2teSBt=Zdb>+3pZ|ZzqFRkk5u3L|!PFf`3 z&Z0Q=Zk*fIZ)-{(W-flUUvNR({~vcbSYKqZbhnDXFgcWJH-EoXv`)ia4!@L|iVTrA z#~K}rEsWTt%alvw=dWuPUNX;(;h(*9eVxja^ZhDLyXsWLiY=Yq%Aa)Qvz*^A@Z0^7 zQ(C&3n&fZyV=X?u##=rwR#|%a$k83ubty9**GcbZC{bUL5*g(03`#AYu6{1-oD!M< DYEIAZ diff --git a/programs/cmm/liza/in_out_mail.raw b/programs/cmm/liza/in_out_mail.raw deleted file mode 100644 index 3842474829..0000000000 --- a/programs/cmm/liza/in_out_mail.raw +++ /dev/null @@ -1 +0,0 @@ -ÿÿÿ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ÿÿÿÿÿÿ´´´çççÿÿÿýýýüüüüüüüüüüüüüüüüüüüüüüüüýýýÿÿÿèèè´´´ÿÿÿÿÿÿ´´´ÑÑÑàààùùùõõõôôôôôôôôôôôôôôôôôôõõõùùùáááÏÏÏ´´´ÿÿÿÿÿÿ°°°ïïïÅÅÅÚÚÚðððììììììììììììììììììðððÝÝÝÂÂÂïïï°°°ÿÿÿÿÿÿªªªçççêêê¼¼¼×××ìììææææææææææææìììÚÚÚ¸¸¸êêêçç窪ªÿÿÿÿÿÿ¤¤¤àààâââäääµµµÕÕÕçççààààààæææÙÙÙ²²²äääâââààत¤ÿÿÿÿÿÿÚÚÚÚÚÚÞÞÞÛÛÛŒŒŒÔÔÔããããããØØ؉‰‰ÜÜÜÞÞÞÚÚÚÚÚÚÿÿÿÿÿÿ–––ÔÔÔÖÖÖÑÑѧ§§êêê­­­¥¥¥§§§¬¬¬êêê«««ÓÓÓÕÕÕÔÔÔ–––ÿÿÿÿÿÿÏÏÏÌÌ̤¤¤ìììíííêêêêêêêêêêêêííííííªªªÍÍÍÏÏÏÿÿÿÿÿÿŠŠŠÆÆÆ¢¢¢åååäääßßßßßßßßßßßßßßßßßßãããçç礤¤ÇÇÇŠŠŠÿÿÿÿÿÿƒƒƒ§§§ÝÝÝÖÖÖÔÔÔÒÒÒÓÓÓÓÓÓÓÓÓÓÓÓÒÒÒÒÒÒ×××ÞÞÞ©©©„„„ÿÿÿÿÿÿddd†††ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ†††dddÿÿÿÿÿÿ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ÿÿÿÿÿÿ´´´çççÿÿÿýýýüüüüüüüüüüüüüüüüüüüüüüüüýýýÿÿÿèèè´´´ÿÿÿÿÿÿ´´´ÑÑÑàààùùùœœôôôôôôóóóôôôôôôõõõùùùáááÏÏÏ´´´ÿÿÿÿÿÿ°°°ïïïÅÅÅÚÚÚœÍ÷÷œììììììììììììðððÝÝÝÂÂÂïïï°°°ÿÿÿœœœœœœx÷À÷äœææææææìììÚÚÚ¸¸¸êêêçç窪ªÿÿÿœ¦÷ÂÂöóÂöóÂöó¿÷ë‘÷­~÷•Í÷÷œæææÙÙÙ²²²äääâââààत¤ÿÿÿœò,ò,ò,ò,*è8Ü&Ì%é œØØ؉‰‰ÜÜÜÞÞÞÚÚÚÚÚÚÿÿÿ—œœœœœâ&ì)œ›››¬¬¬êêê«««ÓÓÓÕÕÕÔÔÔ–––ÿÿÿêêê………ÀÀÀ½½½˜˜˜œò,œÙÙÙêêêêêêííííííªªªÍÍÍÏÏÏÿÿÿÿÿÿŠŠŠÆÆÆ¢¢¢åå圜ÏÏÏßßßßßßßßßßßßãããçç礤¤ÇÇÇŠŠŠÿÿÿÿÿÿƒƒƒ§§§ÝÝÝÖÖÖÔÔÔÒÒÒÓÓÓÓÓÓÓÓÓÓÓÓÒÒÒÒÒÒ×××ÞÞÞ©©©„„„ÿÿÿÿÿÿddd†††ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ†††dddÿÿÿÿÿÿ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ÿÿÿÿÿÿ´´´çççÿÿÿýýýüüüüüüüüüüüüüüüüüüüüüüüüýýýÿÿÿèèè´´´ÿÿÿÿÿÿ´´´ÑÑÑàààùùùõõõôôôôôôôôôôôôôôôôôôõõõ››ÏÏÏ´´´ÿÿÿÿÿÿ°°°ïïïÅÅÅÚÚÚðððììììììììììììììììììððð›ú÷·›°°°ÿÿÿÿÿÿªªªçççêêê¼¼¼×××ìììæææ››››››ìöxûùÛêêêÿÿÿ¤¤¤àààâââäääµµµÕÕÕççç›ãö¦ûùÃûùÃûùÃûùÃåö‘ì÷}ú÷·›ÿÿÿÚÚÚÚÚÚÞÞÞÛÛÛŒŒŒÔÔÔ›òéòéòéòéèâ)ÛÏ!ËÂéÞ‹ÿÿÿ–––ÔÔÔÖÖÖÑÑѧ§§êêê­­­‹‹‹‹‹›â×ìã‹êêêÿÿÿÏÏÏÌÌ̤¤¤ìììíííêêêêêêÙÙÙÙÙÙÜÜÜÜÜÜ›òé‹………ÿÿÿÿÿÿŠŠŠÆÆÆ¢¢¢åååäääßßßßßßßßßßßßßßßßßßããã‹‹¹¹¹ŠŠŠÿÿÿÿÿÿƒƒƒ§§§ÝÝÝÖÖÖÔÔÔÒÒÒÓÓÓÓÓÓÓÓÓÓÓÓÒÒÒÒÒÒ×××ÞÞÞ©©©„„„ÿÿÿÿÿÿddd†††ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ†††dddÿÿÿ \ No newline at end of file diff --git a/programs/cmm/liza/liza.c b/programs/cmm/liza/liza.c index 74d3a7051b..3e3046da5f 100644 --- a/programs/cmm/liza/liza.c +++ b/programs/cmm/liza/liza.c @@ -2,24 +2,25 @@ //libraries #define MEMSIZE 0xA0000 -#include "..\lib\kolibri.h" -#include "..\lib\strings.h" -#include "..\lib\mem.h" -#include "..\lib\dll.h" -#include "..\lib\encoding.h" -#include "..\lib\figures.h" -#include "..\lib\file_system.h" -#include "..\lib\list_box.h" -#include "..\lib\socket_new.h" +#include "../lib/kolibri.h" +#include "../lib/strings.h" +#include "../lib/mem.h" +#include "../lib/dll.h" +#include "../lib/encoding.h" +#include "../lib/figures.h" +#include "../lib/file_system.h" +#include "../lib/list_box.h" +#include "../lib/socket_new.h" //*.obj libraries -#include "..\lib\lib.obj\box_lib.h" -#include "..\lib\lib.obj\network.h" -#include "..\lib\lib.obj\libio_lib.h" -#include "..\lib\lib.obj\libimg_lib.h" -#include "..\lib\lib.obj\netcode.h" -#include "..\lib\lib.obj\iconv.h" +#include "../lib/lib.obj/box_lib.h" +#include "../lib/lib.obj/network.h" +#include "../lib/lib.obj/libio_lib.h" +#include "../lib/lib.obj/libimg_lib.h" +#include "../lib/lib.obj/netcode.h" +#include "../lib/lib.obj/iconv.h" //images -byte in_out_mail[18*36] = FROM "in_out_mail.raw"; +byte letter_icons[sizeof(file "img/letter_icons.raw")] = FROM "img/letter_icons.raw"; +#include "img/letter_icons.h" //connection algorithm enum { @@ -45,9 +46,9 @@ enum { #define WIN_H 440 #define WIN_MIN_W 500 #define WIN_MIN_H 380 -#define LOGIN_HEADER "Login - Email client Liza 0.9a" -#define OPTIONS_HEADER "Options - Email client Liza 0.9a" -#define MAILBOX_HEADER "Mail Box - Email client Liza 0.9a" +#define LOGIN_HEADER "Login - Email client Liza 0.9b" +#define OPTIONS_HEADER "Options - Email client Liza 0.9b" +#define MAILBOX_HEADER "Mail Box - Email client Liza 0.9b" #define BUFFERSIZE 512 proc_info Form; system_colors sc; @@ -113,7 +114,9 @@ void OpenMailDat() ReadFile(0, 512, #read_data, "/sys/network/mail.dat"); if (!read_data) { - strcpy(#email_text, "example@mail.com"); + //strcpy(#email_text, "example@mail.com"); + strcpy(#email_text, "eiroglif@yandex.ru"); //temporarily, for testing + strcpy(#pass_text, "rostov"); } else { diff --git a/programs/cmm/liza/mail_box.c b/programs/cmm/liza/mail_box.c index d86c15bea7..9ff15ac76c 100644 --- a/programs/cmm/liza/mail_box.c +++ b/programs/cmm/liza/mail_box.c @@ -163,32 +163,8 @@ void MailBoxLoop() case evKey: key = GetKey(); - if (key == 177){ //down - if (aim) break; - if (mail_list.current >= mail_list.count-1) break; - mail_list.current++ ; - if (mail_list.current >= mail_list.first + mail_list.visible) mail_list.first++ ; - DrawMailList(); - aim = SEND_RETR; - } - if (key == 178){ //up - if (aim) break; - if (mail_list.current<=0) break; - mail_list.current-- ; - if (mail_list.current < mail_list.first) mail_list.first-- ; - DrawMailList(); - aim = SEND_RETR; - } - if (key == 180){ //home - if (aim) break; - mail_list.first = mail_list.current = 0; - DrawMailList(); - aim = SEND_RETR; - } - if (key == 181){ //end - if (aim) break; - mail_list.first = mail_list.count - mail_list.visible; - mail_list.current = mail_list.count - 1; + if (!aim) && (mail_list.ProcessKey(key)) + { DrawMailList(); aim = SEND_RETR; } @@ -285,11 +261,13 @@ void MailBoxLoop() if (!mailbuffer) {debug("alloc error!"); aim=NULL; break;} mailpointer = mailbuffer; aim = GET_ANSWER_RETR; + debugi(letter_size); } if (aim == GET_ANSWER_RETR) { ticks = Receive(socketnum, mailpointer, letter_size + mailbuffer - mailpointer , MSG_DONTWAIT); + debugi(ticks); if (ticks == 0xffffffff) break; //debugi(EAX); @@ -352,27 +330,23 @@ void DrawToolbar() DrawBar(0, mail_list.y-1, mail_list.w,1, 0xf0f0f0); } - void DrawMailList() { int i, on_y, on_x, direction; + dword sel_col; mail_list.visible = mail_list.h / mail_list.line_h; for (i=30; i<150; i++) DeleteButton(i); for (i=0; (i