From 6c91093930822c45564a3e5804b6d4ec4a6d14cc Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 22 Oct 2013 21:56:28 +0000 Subject: [PATCH] HTMLv 0.99.09: better menu key process, fix menu stack git-svn-id: svn://kolibrios.org@4074 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/DrawBuf.h | 46 +++++++++++++++++++++++++ programs/cmm/browser/HTMLv.c | 8 ++--- programs/cmm/browser/TWB.h | 46 +------------------------ programs/cmm/browser/include/menu_rmb.h | 14 ++------ 4 files changed, 54 insertions(+), 60 deletions(-) create mode 100644 programs/cmm/browser/DrawBuf.h diff --git a/programs/cmm/browser/DrawBuf.h b/programs/cmm/browser/DrawBuf.h new file mode 100644 index 0000000000..172e4b7495 --- /dev/null +++ b/programs/cmm/browser/DrawBuf.h @@ -0,0 +1,46 @@ +dword drawbuf; +void DrawBufInit() +{ + free(drawbuf); + drawbuf = malloc(WB1.width * WB1.line_h +4 * 4 + 8); //+1 for good luck + ESDWORD[drawbuf] = WB1.width; + ESDWORD[drawbuf+4] = WB1.line_h; +} +void DrawBufFill() +{ + int i; + for (i=0; iy+j*WB1.width+x+h-12*4 ; i-=4) + ESDWORD[drawbuf+i+8] = ESDWORD[-shift[j]+drawbuf+i+8]; + } +} + +void TextGoDown(int left1, top1, width1) +{ + if (!stroka) DrawBar(WB1.left, WB1.top, WB1.width, 5, bg_color); //çàêðàøèâàåì ôîí íàä ïåðâîé ñòðîêîé + stroka++; + if (blq_text) stolbec = 8; else stolbec = 0; + if (li_text) stolbec = li_tab * 5; + if (top1>=WB1.top) && ( top1 < WB1.height+WB1.top-10) && (!anchor) + { + PutPaletteImage(drawbuf+8, WB1.width, WB1.line_h, left1-5, top1, 32,0); + DrawBufFill(); + } +} \ No newline at end of file diff --git a/programs/cmm/browser/HTMLv.c b/programs/cmm/browser/HTMLv.c index 6871b7f8e3..95e8b260c6 100644 --- a/programs/cmm/browser/HTMLv.c +++ b/programs/cmm/browser/HTMLv.c @@ -26,10 +26,10 @@ #endif #ifdef LANG_RUS - char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.08"; + char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.09"; ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­" #else - char version[]=" Text-based Browser 0.99.08"; + char version[]=" Text-based Browser 0.99.09"; ?define IMAGES_CACHE_CLEARED "Images cache cleared" #endif @@ -55,7 +55,7 @@ proc_info Form; #define WIN_H 480 -char stak[512]; +char stak[4096]; mouse m; int action_buf; @@ -115,7 +115,7 @@ void main() { show_menu = 0; SwitchToAnotherThread(); - CreateThread(#menu_rmb,#stak); + CreateThread(#menu_rmb,#stak+4092); break; } } diff --git a/programs/cmm/browser/TWB.h b/programs/cmm/browser/TWB.h index de01f14c5a..24a118026f 100644 --- a/programs/cmm/browser/TWB.h +++ b/programs/cmm/browser/TWB.h @@ -50,54 +50,10 @@ char line[500], #include "include\img_cache.h" #include "include\some_code.h" #include "include\parce_tag.h" +#include "DrawBuf.h" //======================================================================= -dword drawbuf; -void DrawBufInit() -{ - free(drawbuf); - drawbuf = malloc(WB1.width * WB1.line_h +4 * 4 + 8); //+1 for good luck - ESDWORD[drawbuf] = WB1.width; - ESDWORD[drawbuf+4] = WB1.line_h; -} -void DrawBufFill() -{ - int i; - for (i=0; iy+j*WB1.width+x+h-12*4 ; i-=4) - ESDWORD[drawbuf+i+8] = ESDWORD[-shift[j]+drawbuf+i+8]; - } -} - -void TextGoDown(int left1, top1, width1) -{ - if (!stroka) DrawBar(WB1.left, WB1.top, WB1.width, 5, bg_color); //çàêðàøèâàåì ôîí íàä ïåðâîé ñòðîêîé - stroka++; - if (blq_text) stolbec = 8; else stolbec = 0; - if (li_text) stolbec = li_tab * 5; - if (top1>=WB1.top) && ( top1 < WB1.height+WB1.top-10) && (!anchor) - { - PutPaletteImage(drawbuf+8, WB1.width, WB1.line_h, left1-5, top1, 32,0); - DrawBufFill(); - } -} void TWebBrowser::DrawPage() { diff --git a/programs/cmm/browser/include/menu_rmb.h b/programs/cmm/browser/include/menu_rmb.h index 5d5583405a..63659f8668 100644 --- a/programs/cmm/browser/include/menu_rmb.h +++ b/programs/cmm/browser/include/menu_rmb.h @@ -26,7 +26,8 @@ void menu_rmb() menu.w = 165; menu.line_h = 19; - while (ITEMS_LIST[menu.count*2]) menu.count++; + menu.first = 0; + while (ITEMS_LIST[menu.count*2]) {menu.count++; menu.visible++;} SetEventMask(100111b); loop() switch(WaitEvent()) @@ -54,16 +55,7 @@ void menu_rmb() case evKey: key = GetKey(); if (key==27) ExitProcess(); - if (key==178) && (menu.current) - { - menu.current--; - goto _ITEMS_DRAW; - } - if (key==177) && (menu.current+1