diff --git a/programs/cmm/browser/TWB/TWB.c b/programs/cmm/browser/TWB/TWB.c index 5b347d119b..eac4a06406 100644 --- a/programs/cmm/browser/TWB/TWB.c +++ b/programs/cmm/browser/TWB/TWB.c @@ -115,6 +115,7 @@ void TWebBrowser::SetPageDefaults() cur_encoding = custom_encoding; bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer); } + list.SetFont(8, 14, 10011000b); } //============================================================================================ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ @@ -150,7 +151,7 @@ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ Render(); NewLine(); } else { - AddCharToTheLine(0x0a); + AddCharToTheLine(' '); } break; case 0x09: @@ -159,7 +160,7 @@ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ if (!tab_len) tab_len = 4; else tab_len = 4 - tab_len; for (j=0; j'); + if (openpos) && (openpos < closepos) { + closepos = openpos - 1; + break; + } + */ + if (!openpos = strchr(closepos+1, '<')) break; + if (openpos < strchr(closepos+1, '>')) break; + if (!closepos = EAX) {closepos = bufend;break;} + } strncpy(#name, bufpos, math.min(whitepos - bufpos, sizeof(tag.name))); debug_tag(); bufpos = closepos; diff --git a/programs/cmm/browser/TWB/set_style.h b/programs/cmm/browser/TWB/set_style.h index f99ab3041f..bb867963a9 100644 --- a/programs/cmm/browser/TWB/set_style.h +++ b/programs/cmm/browser/TWB/set_style.h @@ -52,16 +52,9 @@ void TWebBrowser::SetStyle() if (tag.is("html")) { t_html = tag.opened; return; } //TO BE REWORKED - //td_x = td_w = tr_y = highest_td = 0; //if (tag.is("table")) { tag_table(); return; } - //if (tag.is("td")) { tag_td(); return; } //if (tag.is("tr")) { tag_tr(); return; } - - if (tag.is("dd")) { - //NewLine(); - //if (tag.opened) stolbec += 5; //may overflow! - return; - } + //if (tag.is("td")) { tag_td(); return; } } void TWebBrowser::tag_p() @@ -101,6 +94,8 @@ void TWebBrowser::tag_font() void TWebBrowser::tag_div() { if (streq(#tag.prior,"div")) && (tag.opened) return; + if (streq(#tag.prior,"td")) return; + //if (streq(#tag.prior,"div")) return; if (!tag.opened) && (style.font) text_colors.pop(); NewLine(); } @@ -287,6 +282,7 @@ void TWebBrowser::tag_img() if (!strcmp(tag.value + strrchr(tag.value, '.'), "webp")) goto NOIMG; strlcpy(#img_path, tag.value, sizeof(img_path)-1); + replace_char(#img_path, ' ', '\0', sizeof(img_path)); get_absolute_url(#img_path, history.current()); if (check_is_the_adress_local(#img_path)) { diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 56178bc9e3..81156c2742 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -41,10 +41,6 @@ // DATA // // // //===================================================// -char version[]="WebView 3.26"; - -#define DEFAULT_URL URL_SERVICE_HOMEPAGE - bool debug_mode = false; bool show_images = true; @@ -144,11 +140,13 @@ void main() if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage(); - scrollbar_v_mouse (#scroll_wv); - if (scroll_wv.delta2) { - WB1.list.first = scroll_wv.position; - WB1.DrawPage(); - break; + if (WB1.list.count > WB1.list.visible) { + scrollbar_v_mouse (#scroll_wv); + if (scroll_wv.delta2) { + WB1.list.first = scroll_wv.position; + WB1.DrawPage(); + break; + } } if (links.hover(WB1.list.y, WB1.list.first)) @@ -187,8 +185,9 @@ void main() break; case evReDraw: - DefineAndDrawWindow(GetScreenWidth()-800/2-random(80), - GetScreenHeight()-700/2-random(80),800,700,0x73,0,0,0); + DefineAndDrawWindow(GetScreenWidth()-WIN_W/2-random(80),GetScreenHeight()-WIN_H/2-random(80), + //DefineAndDrawWindow(0,0, + WIN_W,WIN_H,0x73,0,0,0); GetProcessInfo(#Form, SelfInfo); ProcessMenuClick(); sc.get(); @@ -410,11 +409,11 @@ void EventToggleDebugMode() void EventAllTabsClick(dword _n) { - if (http.transfer) return; if (mouse.mkm) { + StopLoading(); EventTabClose(_n); } else { - EventTabClick(_n); + if (!http.transfer) EventTabClick(_n); } } diff --git a/programs/cmm/browser/const.h b/programs/cmm/browser/const.h index ea5e33c463..98a7c8597d 100644 --- a/programs/cmm/browser/const.h +++ b/programs/cmm/browser/const.h @@ -1,4 +1,9 @@ #ifdef LANG_RUS +//===================================================// +// // +// CYRILLIC // +// // +//===================================================// char buildin_page_error[] = FROM "res/page_not_found_ru.htm""\0"; char buildin_page_home[] = FROM "res/homepage_ru.htm""\0"; char buildin_page_help[] = FROM "res/help_ru.htm""\0"; @@ -31,6 +36,11 @@ char clear_cache_ok[] = "'WebView\n #define T_RENDERING "Рендеринг страницы..." #define T_DONE_IN_SEC "Готово: %i сек" #else +//===================================================// +// // +// ENGLISH // +// // +//===================================================// char buildin_page_error[] = FROM "res/page_not_found_en.htm""\0"; char buildin_page_home[] = FROM "res/homepage_en.htm""\0"; char buildin_page_help[] = FROM "res/help_en.htm""\0"; @@ -63,12 +73,18 @@ char clear_cache_ok[] = "'WebView\nThe cache has been cleared.' -tI"; #define T_DONE_IN_SEC "Done in %i sec" #endif +//===================================================// +// // +// GLOBAL // +// // +//===================================================// + char buildin_page_test[] = FROM "res/test.htm""\0"; -#define URL_SERVICE_HISTORY "WebView:history" +#define URL_SERVICE_HISTORY "WebView:history" #define URL_SERVICE_HOMEPAGE "WebView:home" -#define URL_SERVICE_HELP "WebView:help" -#define URL_SERVICE_TEST "WebView:test" +#define URL_SERVICE_HELP "WebView:help" +#define URL_SERVICE_TEST "WebView:test" char webview_shared[] = "WEBVIEW"; @@ -84,4 +100,11 @@ enum { TAB_CLOSE_ID = 900 }; -char editbox_icons[] = FROM "res/editbox_icons.raw"; \ No newline at end of file +char editbox_icons[] = FROM "res/editbox_icons.raw"; + +#define WIN_W 850 +#define WIN_H 920 + +#define DEFAULT_URL URL_SERVICE_HOMEPAGE + +char version[]="WebView 3.27"; \ No newline at end of file diff --git a/programs/cmm/browser/tabs.h b/programs/cmm/browser/tabs.h index a6803783dc..2ea3b7c784 100644 --- a/programs/cmm/browser/tabs.h +++ b/programs/cmm/browser/tabs.h @@ -7,7 +7,7 @@ #define TABS_MAX 5 -TWebBrowser data[TABS_MAX+1]=0; +TWebBrowser tabdata[TABS_MAX+1]=0; _history tabstory[TABS_MAX+1]=0; struct TAB @@ -36,7 +36,7 @@ bool TAB::close(int _tab_number) int i; if (count==1) return false; for (i=_tab_number; i0) active--; @@ -48,13 +48,13 @@ bool TAB::close(int _tab_number) void TAB::save_state() { tabstory[active] = history; - data[active] = WB1; + tabdata[active] = WB1; } void TAB::restore(int _id) { tab.active = _id; - WB1 = data[_id]; + WB1 = tabdata[_id]; history = tabstory[_id]; } @@ -90,8 +90,8 @@ void DrawTab(int _id) bgcol=sc.work; border_bottom_color = sc.work_graph; } - if (data[_id].header) { - strncpy(#header_no_version, #data[_id].header, strlen(#data[_id].header)-sizeof(version)-2); + if (tabdata[_id].header) { + strncpy(#header_no_version, #tabdata[_id].header, strlen(#tabdata[_id].header)-sizeof(version)-2); strncpy(#name, #header_no_version, tab_w-CLOSE_S/6-2); } DrawBar(xxx, TOOLBAR_H, 1, TAB_H, sc.work_dark); diff --git a/programs/cmm/lib/dll.h b/programs/cmm/lib/dll.h index a8fbff0f12..dc0ba64bae 100644 --- a/programs/cmm/lib/dll.h +++ b/programs/cmm/lib/dll.h @@ -16,15 +16,6 @@ char a_libdir[43] = "/sys/lib/\0"; -:inline void error_init(dword lirary_path) -{ - char error_text[1024]; - strcpy(#error_text, _TEXT_ERROR_ADD); - strcat(#error_text, lirary_path); - strcat(#error_text, "' -E"); - notify(#error_text); -} - // stdcall with 1 parameter :void dll_Load() { asm { @@ -188,9 +179,8 @@ asm { } } -:int load_dll2(dword dllname, import_table, byte need_init) +:void load_dll(dword dllname, import_table, byte need_init) { - //dword dllentry=0; // load DLL $mov eax, 68 $mov ebx, 19 @@ -237,19 +227,18 @@ asm { #ifndef NO_DLL_INIT IF (need_init) dll_Init (DSDWORD[EDX+4]); #endif - return 0; + return; @exit01: - return -1; + error_init(dllname); } -:byte load_dll(dword dllname, import_table, byte need_init) +:inline void error_init(dword lirary_path) { - if (load_dll2(dllname, import_table, need_init)) - { - error_init(dllname); - return false; - } - return true; + char error_text[1024]; + strcpy(#error_text, _TEXT_ERROR_ADD); + strcat(#error_text, lirary_path); + strcat(#error_text, "' -E"); + notify(#error_text); }