From b75bb6ed4d05164528e6ae0df3d019c365a950a5 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 24 May 2020 00:50:02 +0000 Subject: [PATCH] delete Aelia git-svn-id: svn://kolibrios.org@7976 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/aelia/Tupfile.lua | 6 - programs/cmm/aelia/_compile.bat | 5 - programs/cmm/aelia/aelia.c | 560 ------------------ programs/cmm/aelia/atoolbar.png | Bin 2216 -> 0 bytes programs/cmm/aelia/buidin_pages/about.htm | Bin 579 -> 0 bytes programs/cmm/aelia/buidin_pages/home.htm | Bin 406 -> 0 bytes programs/cmm/aelia/buidin_pages/not_found.htm | Bin 534 -> 0 bytes programs/cmm/aelia/canvas.h | 36 -- programs/cmm/aelia/favicon.h | 83 --- programs/cmm/aelia/gui.h | 61 -- programs/cmm/aelia/ini.h | 34 -- programs/cmm/aelia/link.h | 84 --- programs/cmm/aelia/pointer.cur | Bin 3262 -> 0 bytes programs/cmm/aelia/prepare_page.h | 325 ---------- programs/cmm/aelia/special.h | 140 ----- programs/cmm/browser/WebView.c | 24 +- .../{html => buidin_pages}/help_en.htm | 0 .../{html => buidin_pages}/help_ru.htm | 0 .../{html => buidin_pages}/homepage_en.htm | 0 .../{html => buidin_pages}/homepage_ru.htm | 0 .../page_not_found_en.htm | 0 .../page_not_found_ru.htm | 0 programs/cmm/browser/texts.h | 12 +- 23 files changed, 23 insertions(+), 1347 deletions(-) delete mode 100644 programs/cmm/aelia/Tupfile.lua delete mode 100644 programs/cmm/aelia/_compile.bat delete mode 100644 programs/cmm/aelia/aelia.c delete mode 100644 programs/cmm/aelia/atoolbar.png delete mode 100644 programs/cmm/aelia/buidin_pages/about.htm delete mode 100644 programs/cmm/aelia/buidin_pages/home.htm delete mode 100644 programs/cmm/aelia/buidin_pages/not_found.htm delete mode 100644 programs/cmm/aelia/canvas.h delete mode 100644 programs/cmm/aelia/favicon.h delete mode 100644 programs/cmm/aelia/gui.h delete mode 100644 programs/cmm/aelia/ini.h delete mode 100644 programs/cmm/aelia/link.h delete mode 100644 programs/cmm/aelia/pointer.cur delete mode 100644 programs/cmm/aelia/prepare_page.h delete mode 100644 programs/cmm/aelia/special.h rename programs/cmm/browser/{html => buidin_pages}/help_en.htm (100%) rename programs/cmm/browser/{html => buidin_pages}/help_ru.htm (100%) rename programs/cmm/browser/{html => buidin_pages}/homepage_en.htm (100%) rename programs/cmm/browser/{html => buidin_pages}/homepage_ru.htm (100%) rename programs/cmm/browser/{html => buidin_pages}/page_not_found_en.htm (100%) rename programs/cmm/browser/{html => buidin_pages}/page_not_found_ru.htm (100%) diff --git a/programs/cmm/aelia/Tupfile.lua b/programs/cmm/aelia/Tupfile.lua deleted file mode 100644 index cf6727d2f0..0000000000 --- a/programs/cmm/aelia/Tupfile.lua +++ /dev/null @@ -1,6 +0,0 @@ -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("aelia.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "aelia.com") diff --git a/programs/cmm/aelia/_compile.bat b/programs/cmm/aelia/_compile.bat deleted file mode 100644 index d6a397af3b..0000000000 --- a/programs/cmm/aelia/_compile.bat +++ /dev/null @@ -1,5 +0,0 @@ -@C-- "aelia.c" -@del "aelia" -@rename "aelia.com" "aelia" -@del warning.txt -@pause diff --git a/programs/cmm/aelia/aelia.c b/programs/cmm/aelia/aelia.c deleted file mode 100644 index ea8360a3a1..0000000000 --- a/programs/cmm/aelia/aelia.c +++ /dev/null @@ -1,560 +0,0 @@ -#define MEMSIZE 1024*400 - -#include "../lib/gui.h" -#include "../lib/kfont.h" -#include "../lib/io.h" -#include "../lib/cursor.h" -#include "../lib/list_box.h" - -#include "../lib/obj/box_lib.h" -#include "../lib/obj/libini.h" -#include "../lib/obj/iconv.h" -#include "../lib/obj/libimg.h" -#include "../lib/obj/proc_lib.h" -#include "../lib/obj/http.h" - -#include "../lib/patterns/simple_open_dialog.h" -#include "../lib/patterns/history.h" -#include "../lib/patterns/http_downloader.h" -#include "../browser/download_manager.h" - -llist list; - -#include "link.h" -#include "canvas.h" -#include "favicon.h" - -_history history; - -char default_dir[] = "/rd/1"; -od_filter filter2 = { 16, "TXT\0HTM\0HTML\0\0" }; - -char accept_language[]= "Accept-Language: ru\n"; - -#define TOOLBAR_H 36 -#define TOOLBAR_ICON_WIDTH 26 -#define TOOLBAR_ICON_HEIGHT 24 -#define STATUSBAR_H 15 - -#define DEFAULT_EDITOR "/sys/tinypad" -#define DEFAULT_PREVIEW_PATH "/tmp0/1/aelia_preview.txt" - -//ATTENTION: each page must have '\0' character at the end of the file -char buidin_page_home[] = FROM "buidin_pages\\home.htm"; -char buidin_page_about[] = FROM "buidin_pages\\about.htm"; -char buidin_page_not_found[] = FROM "buidin_pages\\not_found.htm"; - -#define UML 4096*2 - -scroll_bar scroll = { 15,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; - -proc_info Form; -char title[4196]; - -enum { - OPEN_FILE, - MAGNIFY_MINUS, - MAGNIFY_PLUS, - CHANGE_ENCODING, - RUN_EDIT, - GO_BACK, - GO_FORWARD, - SANDWICH -}; - -char address[UML]; -edit_box address_box = {250,56,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,UML,#address,NULL,2,19,19}; - -bool debug_mode=false; - -#include "ini.h" -#include "gui.h" -#include "prepare_page.h" -//#include "special.h" - -int menu_id=0; - -#define SANDWICH_MENU "Refresh page\nEdit page\nHistory\nDownloader\nAbout" - -void InitDlls() -{ - load_dll(boxlib, #box_lib_init, 0); - load_dll(libHTTP, #http_lib_init, 1); - load_dll(libio, #libio_init, 1); - load_dll(libimg, #libimg_init, 1); - //load_dll(libini, #lib_init, 1); - load_dll(iconv_lib, #iconv_open, 0); - load_dll(Proc_lib, #OpenDialog_init,0); -} - - -void main() -{ - InitDlls(); - OpenDialog_init stdcall (#o_dialog); - LoadIniSettings(); - kfont.init(DEFAULT_FONT); - Libimg_LoadImage(#skin, abspath("atoolbar.png")); - list.no_selection = true; - SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK); - loop() - { - switch(WaitEvent()) - { - case evMouse: - HandleMouseEvent(); - break; - case evKey: - HandleKeyEvent(); - break; - case evButton: - HandleButtonEvent(); - break; - case evNetwork: - HandleNetworkEvent(); - break; - case evReDraw: - draw_window(); - if (CheckActiveProcess(Form.ID)) EventMenuClick(); - } - } -} - - -void HandleButtonEvent() -{ - byte btn = GetButtonID(); - if (btn==1) { - SaveIniSettings(); - ExitProcess(); - } - switch(btn-10) - { - case GO_BACK: - EventGoBack(); - break; - case GO_FORWARD: - EventGoForward(); - break; - case OPEN_FILE: - EventOpenDialog(); - break; - case MAGNIFY_PLUS: - EventMagnifyPlus(); - break; - case MAGNIFY_MINUS: - EventMagnifyMinus(); - break; - case CHANGE_ENCODING: - EventChangeEncoding(); - break; - case RUN_EDIT: - EventRunEdit(); - break; - case SANDWICH: - EventShowSandwichMenu(); - break; - } -} - - -void HandleKeyEvent() -{ - GetKeys(); - if (key_modifier & KEY_LCTRL) || (key_modifier & KEY_RCTRL) { - switch (key_scancode) - { - case SCAN_CODE_UP: - EventMagnifyPlus(); - return; - case SCAN_CODE_DOWN: - EventMagnifyMinus(); - return; - case SCAN_CODE_KEY_O: - EventOpenDialog(); - return; - case SCAN_CODE_KEY_E: - EventRunEdit(); - return; - case SCAN_CODE_KEY_H: - EventShowHistory(); - return; - case SCAN_CODE_TAB: - EventChangeEncoding(); - return; - } - } - switch (key_scancode) - { - case SCAN_CODE_F1: - EventShowInfo(); - return; - case SCAN_CODE_F12: - EventChangeDebugMode(); - return; - case SCAN_CODE_ENTER: - EventOpenAddress(#address); - return; - case SCAN_CODE_BS: - if (! address_box.flags & ed_focus) { - EventGoBack(); - return; - } - } - if (list.ProcessKey(key_scancode)) && (! address_box.flags & ed_focus) { - DrawPage(); - return; - } - if (key_ascii != ASCII_KEY_ENTER) - && (key_ascii != ASCII_KEY_PGDN) - && (key_ascii != ASCII_KEY_PGUP) { - EAX = key_editbox; - edit_box_key stdcall(#address_box); - } -} - - -void HandleMouseEvent() -{ - edit_box_mouse stdcall (#address_box); - mouse.get(); - list.wheel_size = 7; - - if (link.hover(mouse.x, mouse.y)) { - if (-1 == link.active) { - DrawStatusBar( " " ); //just clean status bar - } - else { - DrawStatusBar( link.get_active_url() ); - } - } - - if (mouse.key&MOUSE_LEFT) && (mouse.up) { - if (-1 != link.active) EventOpenAddress( link.get_active_url() ); - } - - if (list.MouseScroll(mouse.vert)) { - DrawPage(); - return; - } - - scrollbar_v_mouse (#scroll); - if (list.first != scroll.position) { - list.first = scroll.position; - DrawPage(); - } -} - -void HandleNetworkEvent() -{ - char favicon_address[UML]; - - if (downloader.state == STATE_IN_PROGRESS) { - downloader.MonitorProgress(); - - if (downloader.httpd.content_length>0) - DrawProgress(STEP_2_COUNT_PAGE_HEIGHT-STEP_1_DOWNLOAD_PAGE* - downloader.httpd.content_received/downloader.httpd.content_length); - else - DrawProgress(STEP_2_COUNT_PAGE_HEIGHT-STEP_1_DOWNLOAD_PAGE/2); - } - - if (downloader.state == STATE_COMPLETED) - { - if (!strncmp(downloader.url,"http://gate.aspero.pro/",22)) { - strcpy(#address,downloader.url + 29); - } - else { - strcpy(#address,downloader.url); - } - downloader.Stop(); - DrawAddressBox(); - io.buffer_data = downloader.bufpointer; - /* - get_absolute_url(#favicon_address, #address, "/favicon.ico"); - favicon.get(#favicon_address); - */ - PostOpenPageActions(); - } -} - - -/* ----------------------------------------------------- */ - -void EventOpenDialog() -{ - OpenDialog_start stdcall (#o_dialog); - if (o_dialog.status) EventOpenAddress(#openfile_path); -} - -void EventOpenAddress(dword _new_address) -{ -char temp[UML]; -char getUrl[UML]; - if (!ESBYTE[_new_address]) return; - debugln("===================================="); - debug("address: "); - debugln(_new_address); - strlcpy(#address, _new_address, UML); - strlwr(#address); - DrawAddressBox(); - - /* - There could be several possible types of addresses: - - build in page - - local file - - url - So we need to detect what incoming address is - and then halndle it in the propper way. - */ - - io.buffer_data = 0; - favicon.get(NULL); - - // - build in page - if (!strncmp(#address,"aelia:",6)) { - debugln("this is buildin page"); - if (!strcmp(#address,"aelia:home")) io.buffer_data = #buidin_page_home; - if (!strcmp(#address,"aelia:about")) io.buffer_data = #buidin_page_about; - if (!strcmp(#address,"aelia:history")) io.buffer_data = MakePageWithHistory(); - PostOpenPageActions(); - } - // - local file - else if (check_is_the_adress_local(#address)==true) { - debugln("this is local address"); - io.read(#address); - PostOpenPageActions(); - } - // - url - else { - debugln("this is url"); - if (!strncmp(#address,"https://",8)) { - sprintf(#getUrl, "http://gate.aspero.pro/?site=%s", #address); - } - else if (!strncmp(#address,"http://",7)) { - strlcpy(#getUrl, #address, UML); - } - else { - strcpy(#temp, "http://"); - strlcpy(#temp, #address, UML); - strlcpy(#address, #temp, UML); - DrawAddressBox(); - strlcpy(#getUrl, #address, UML); - } - downloader.Start(#getUrl); - } -} - -void PostOpenPageActions() -{ - if (!io.buffer_data) { - debugln("page not found"); - io.buffer_data = #buidin_page_not_found; - } - - history.add(#address); - favicon.draw(address_box.left-18, address_box.top-1); - - /* - Great! So we have the page in our buffer. - We don't know is it a plain text or html. - So we need to parse it and draw. - */ - - list.KeyHome(); - PreparePage(); -} - -void EventMagnifyPlus() -{ - kfont.size.pt++; - if(!kfont.changeSIZE()) - kfont.size.pt--; - else - PreparePage(); -} - -void EventMagnifyMinus() -{ - kfont.size.pt--; - if(!kfont.changeSIZE()) - kfont.size.pt++; - else - PreparePage(); -} - -void EventRunEdit() -{ - if (check_is_the_adress_local(history.current())==true) { - io.run(DEFAULT_EDITOR, history.current()); - } - else { - //io.write(strlen(io.buffer_data), io.buffer_data, DEFAULT_PREVIEW_PATH); // <--- doesn't work, smth odd, need to check - CreateFile(strlen(io.buffer_data), io.buffer_data, DEFAULT_PREVIEW_PATH); - io.run(DEFAULT_EDITOR, DEFAULT_PREVIEW_PATH); - } -} - -void EventChangeEncoding() -{ - menu_id = 10; - open_lmenu(Form.left+Form.cwidth-36,Form.top+TOOLBAR_H+skin_height-6, MENU_ALIGN_TOP_RIGHT, - encoding+1, "UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866"); -} - -void EventShowSandwichMenu() -{ - menu_id = 20; - open_lmenu(Form.left+Form.cwidth+3,Form.top+TOOLBAR_H+skin_height-6, - MENU_ALIGN_TOP_RIGHT, 0, SANDWICH_MENU); -} - -void EventMenuClick() -{ - dword click_id = get_menu_click(); - - if (menu_id == 10) && (click_id) { - encoding = click_id-1; - EventPageRefresh(); - menu_id = 0; - } - if (menu_id == 20) {switch(click_id) { - case 1: EventPageRefresh(); break; - case 2: EventRunEdit(); break; - case 3: EventShowHistory(); break; - case 4: EventShowDownloader(); break; - case 5: EventShowInfo(); break; - } menu_id = 0;} -} - -void EventShowInfo() { - EventOpenAddress("aelia:about"); -} - -void EventShowHistory() -{ - EventOpenAddress("aelia:history"); -} - -void EventGoBack() -{ - if (history.back()) EventOpenAddress(history.current()); -} - -void EventGoForward() -{ - if (history.forward()) EventOpenAddress(history.current()); -} - -void EventPageRefresh() -{ - EventOpenAddress(history.current()); -} - -void EventShowDownloader() -{ - if (!downloader_opened) { - downloader_edit = NULL; - CreateThread(#Downloader,#downloader_stak+4092); - } -} - -void EventChangeDebugMode() -{ - debug_mode ^= 1; - if (debug_mode) notify("'Debug mode ON'-I"); - else notify("'Debug mode OFF'-I"); - return; -} - -/* ------------------------------------------- */ - - -void draw_window() -{ - DefineAndDrawWindow(Form.left,Form.top,Form.width,Form.height,0x73,0,#title,0); - GetProcessInfo(#Form, SelfInfo); - if (Form.status_window>2) return; - - if (Form.width < 200) { MoveSize(OLD,OLD,200,OLD); return; } - if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); return; } - - sc.get(); - - list.SetSizes(0, TOOLBAR_H, Form.cwidth-scroll.size_x-1, - Form.cheight-TOOLBAR_H-STATUSBAR_H, kfont.size.pt+4); - - DrawBar(0, 0, Form.cwidth, TOOLBAR_H - 2, 0xe1e1e1); - DrawBar(0, TOOLBAR_H - 2, Form.cwidth, 1, 0xcecece); - DrawBar(0, TOOLBAR_H - 1, Form.cwidth, 1, 0x7F7F7F); - - DrawToolbarButton(GO_BACK, 8); - DrawToolbarButton(GO_FORWARD, 33); - DrawToolbarButton(OPEN_FILE, 68); - DrawToolbarButton(MAGNIFY_PLUS, Form.cwidth - 125); - DrawToolbarButton(MAGNIFY_MINUS, Form.cwidth - 100); - DrawToolbarButton(CHANGE_ENCODING, Form.cwidth - 64); - DrawToolbarButton(SANDWICH, Form.cwidth - 31); - - DrawAddressBox(); - - if ((Form.cwidth-scroll.size_x-1 == list.w) && - (Form.cheight-TOOLBAR_H == list.h) && - (list.count) - ) - { - DrawPage(); - } - else - { - if (!kfont.raw) { //this code need to be run - if (param) EventOpenAddress(#param); //only once at browser sturtup - else EventOpenAddress("aelia:home"); - } - else PreparePage(); - } - - DrawRectangle(scroll.start_x, scroll.start_y, scroll.size_x, scroll.size_y-1, scroll.bckg_col); - DrawStatusBar(NULL); -} - -void DrawPage() -{ - list.CheckDoesValuesOkey(); - if (list.count) { - kfont.ShowBufferPart(list.x, list.y, list.w, list.h, list.first*list.item_h*list.w); - } - DrawScroller(); -} - -void DrawAddressBox() -{ - address_box.left = 97+19; - address_box.top = 11; - address_box.width = Form.cwidth - address_box.left - 138; - DrawRectangle(address_box.left-4-19, address_box.top-5, address_box.width+6+19, 23, 0x8C8C8C); - DrawWideRectangle(address_box.left-3-19, address_box.top-3, address_box.width+5+19, 21, 4, address_box.color); - address_box.size = address_box.pos = address_box.shift = address_box.shift_old = strlen(#address); - address_box.offset = 0; - edit_box_draw stdcall(#address_box); - favicon.draw(address_box.left-18, address_box.top-1); - DrawBar(address_box.left-2, address_box.top+1, 2, 13, 0xFFFfff); -} - -PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, NULL, 0}; -void DrawStatusBar(dword _status_text) -{ - DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, sc.work); - DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, 0x8C8C8C); - - if (_status_text) { - status_text.start_x = 7; - status_text.start_y = Form.cheight - STATUSBAR_H + 3; - status_text.area_size_x = Form.cwidth - status_text.start_x -3; - status_text.font_color = sc.work_text; - status_text.text_pointer = _status_text; - PathShow_prepare stdcall(#status_text); - PathShow_draw stdcall(#status_text); - } -} - diff --git a/programs/cmm/aelia/atoolbar.png b/programs/cmm/aelia/atoolbar.png deleted file mode 100644 index 5a0df64907d830e571017a960d3f47f422afd8a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2216 zcmV;Z2v_%sP)x99dCa^_xihbr&CY@F+T8igz4y#H|2g-@@9y2ZRqx-wr;i^$ zk~geHix$+XRV(s4apFYPfB^%japT5b0sZ*#gRWn{PJWv=Z?0Ona3THr^~)=uFJHdU zxpU|KFQ7}8F42Pr4^$iW>C=b$_3P&u(9)$#bsL+3xdqa*u3fv*(4j-U4}z^*w@w>W zSXk)%aoMtEZh_XWU8?|{KY!i^*`VJE`uX#x^T*}Om%9a8vu2I+{nxKwwLw>|T+xhm zMux~RWXKRPkSEOsxetOkiHnOPe}8|kfC>r<=+&!N85h%>%M*angZRpaf5E&ylGA|j2%0cy-ZX; z;NPS;dK|UEepE(0u6)rhq#0XRFt=2|Y*THt}+Qm04u1@5J#VFv0ojrTD;x|Lh zfDp84(ve~-Mve~-M)^*|_EnO#-*yN=$ujo28kX{?hx=s=+a$O)F1&`@E zJ&>*Id^dDHa|S(Krv>u3u9Iqc@|v8j>qyINU8f4Nb)999t?O)1?E)P+a)g>RX~NOl zYoK@U-qF#cNBR5p>(}d^?BTwMUw%TsmO&>eWh?di(Y*wQSjv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Tjs>AFsfrJca(>*zx zu%$31E~1&~jGpZ3SuWx=9?+=)4(fKH;0K~l+cE6AO?Vl@d*5L530pMPU-m1>9@{hZ zN!ZZ)O!DOu6_Wf1-GOC diff --git a/programs/cmm/aelia/buidin_pages/home.htm b/programs/cmm/aelia/buidin_pages/home.htm deleted file mode 100644 index 07335d8c691355f129b2f1382b4296ab76cfd2a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmaJ;O-sZu5cMqhABH`Vf9qh@xI-0AZe$PS>6^*A$81pB|Vd#DU z6VD|5yI&YPIc6_BQGl3@y*%A5t&`;&=3zt`;-)NV5UfytwX&+yrmlzLjbp`fShe3) eZPF{TVEZq19ezH&dRpy!#4s&BUmt_!bav#h#ZbHaAY{6pfuU$pbO^_ZBu72h`} zs|7lqy@3|NFyUK5_ZgjYcBQ<_NA+p38)5a*#srLU3t}-KoZVn0t2M|n@vCaXDy(nH zV(^FIf&p9v!SlpH2j>@S5`P*#21{Od)IDYF9Acqkq2?oO4kqA3+OvSGHnULUs()9x*%9XZciIAF1Oc9Gyb@ZqsZWEA}AfO2_1P%qiC#iZ}zpBey*7wiw^bb5m BrP%-g diff --git a/programs/cmm/aelia/canvas.h b/programs/cmm/aelia/canvas.h deleted file mode 100644 index 3e53c0aba5..0000000000 --- a/programs/cmm/aelia/canvas.h +++ /dev/null @@ -1,36 +0,0 @@ - -struct _canvas -{ - dword write_text(); - void draw_hor_line(); -}; - -dword _canvas::write_text(int _x, _y; dword _text_col, _text_off) -{ - char error_message[128]; - dword new_x; - - if (_x > list.w) { - sprintf(#error_message, "ERROR: canvas.x overflow: H %d X %d", kfont.size.height, _x); - debugln(#error_message); - } - if (_y+kfont.size.pt > kfont.size.height) { - sprintf(#error_message, "ERROR: canvas.y overflow: H %d Y %d", kfont.size.height, _y); - debugln(#error_message); - return; - } - new_x = kfont.WriteIntoBuffer(_x, _y, list.w, kfont.size.height, 0xFFFFFF, _text_col, kfont.size.pt, _text_off); - if (_y/list.item_h-list.first==list.visible) DrawPage(); - return new_x; -} - - -void _canvas::draw_hor_line(dword _x, _y, _w, _color) -{ - int i; - for (i = _y*list.w+_x*KFONT_BPP+kfont.raw ; i<_y*list.w+_x+_w*KFONT_BPP+kfont.raw ; i+=KFONT_BPP) - { - ESDWORD[i] = _color; - } -} - diff --git a/programs/cmm/aelia/favicon.h b/programs/cmm/aelia/favicon.h deleted file mode 100644 index 0b236b08ca..0000000000 --- a/programs/cmm/aelia/favicon.h +++ /dev/null @@ -1,83 +0,0 @@ -struct _favicon -{ - DOWNLOADER favget; - void get(); - void draw(); -} favicon; - -void _favicon::get(dword url) -{ - if (url==NULL) || (!favget.Start(url)) { - favget.Stop(); - favget.bufpointer = NULL; - } - else { - while (favget.state!=STATE_COMPLETED) favget.MonitorProgress(); - } -} - -void _favicon::draw(int x,y) -{ - dword favicon_data_decoded; - if (favget.bufpointer) { - img_decode stdcall (favget.bufpointer, favget.httpd.content_length, 0); - if (EAX==0) return; - favicon_data_decoded = EAX; - img_draw stdcall(favicon_data_decoded, x,y, 16, 16, 0, 0); - } - else { - _PutImage(x,y,16,16,#blank_icon); - } -} - - -unsigned char blank_icon[768] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 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xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF -}; \ No newline at end of file diff --git a/programs/cmm/aelia/gui.h b/programs/cmm/aelia/gui.h deleted file mode 100644 index 5355b5af2d..0000000000 --- a/programs/cmm/aelia/gui.h +++ /dev/null @@ -1,61 +0,0 @@ -void DrawToolbarButton(dword image_id, x) -{ - DefineButton(x+1, 7, TOOLBAR_ICON_WIDTH-2, TOOLBAR_ICON_HEIGHT-2, 10+image_id + BT_HIDE, 0); - DrawLibImage(skin.image, x, 6, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT); -} - - -void DrawScroller() -{ - scroll.max_area = list.count; - scroll.cur_area = list.visible; - scroll.position = list.first; - scroll.all_redraw = 0; - scroll.start_x = list.x + list.w; - scroll.start_y = list.y; - scroll.size_y = list.h; - scroll.start_x = list.x + list.w; - scrollbar_v_draw(#scroll); -} - - -dword MakePageWithHistory() -{ - int i; - static dword history_page; - - if (history_page) free(history_page); - history_page = malloc(history.items.data_size+256); - strcat(history_page, "History\n

History

\n"); - strcat(history_page, "

Visited pages


\n"); - for (i=0; i"); - strcat(history_page, history.items.get(i)); - strcat(history_page, "
\n"); - } - return history_page; -} - -enum { - STEP_1_DOWNLOAD_PAGE = 0, - STEP_2_COUNT_PAGE_HEIGHT = 35, - STEP_3_DRAW_PAGE_INTO_BUFFER = 60, - STEP_4_SMOOTH_FONT = 88, - STEP_5_STOP = 100, -}; - -void DrawProgress(dword percent) -{ - dword progress_width; - if (percent<100) { - progress_width = address_box.width+5*percent/100; - DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0x72B7EA); - } - else { - progress_width = address_box.width+5; - DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0xFFFfff); - } -} diff --git a/programs/cmm/aelia/ini.h b/programs/cmm/aelia/ini.h deleted file mode 100644 index 58dee3b398..0000000000 --- a/programs/cmm/aelia/ini.h +++ /dev/null @@ -1,34 +0,0 @@ -char ini_path[4096]; -char config_section[] = "Config"; -int encoding; - -void LoadIniSettings() -{ - kfont.size.pt = 14; - encoding = CH_CP866; - Form.left = 150; - Form.top = 50; - Form.width = 640; - Form.height = 560; - /* - strcpy(#ini_path, "/sys/settings/treader.ini"); - ini_get_int stdcall (#ini_path, #config_section, "FontSize", 14); kfont.size.pt = EAX; - ini_get_int stdcall (#ini_path, #config_section, "Encoding", CH_CP866); encoding = EAX; - ini_get_int stdcall (#ini_path, #config_section, "WinX", 150); Form.left = EAX; - ini_get_int stdcall (#ini_path, #config_section, "WinY", 50); Form.top = EAX; - ini_get_int stdcall (#ini_path, #config_section, "WinW", 640); Form.width = EAX; - ini_get_int stdcall (#ini_path, #config_section, "WinH", 560); Form.height = EAX; - */ -} - -void SaveIniSettings() -{ - /* - ini_set_int stdcall (#ini_path, #config_section, "FontSize", kfont.size.pt); - ini_set_int stdcall (#ini_path, #config_section, "Encoding", encoding); - ini_set_int stdcall (#ini_path, #config_section, "WinX", Form.left); - ini_set_int stdcall (#ini_path, #config_section, "WinY", Form.top); - ini_set_int stdcall (#ini_path, #config_section, "WinW", Form.width); - ini_set_int stdcall (#ini_path, #config_section, "WinH", Form.height); - */ -} diff --git a/programs/cmm/aelia/link.h b/programs/cmm/aelia/link.h deleted file mode 100644 index 356c510b1c..0000000000 --- a/programs/cmm/aelia/link.h +++ /dev/null @@ -1,84 +0,0 @@ -dword CursorFile = FROM "pointer.cur"; - -struct _link -{ - CustomCursor CursorPointer; - int count; - int x[4096], y[4096], w[4096], h[4096]; - collection text; - collection url; - void clear(); - void add(); - dword get_active_url(); - void draw_underline(); - int hover(); - int active; -} link; - -void _link::clear() -{ - text.drop(); - url.drop(); - count = 0; -} - -void _link::add(int _xx, _yy, _ww, _hh, dword _textt, _urll ) -{ - if (count==4095) return; - x[count] = _xx; - y[count] = _yy; - w[count] = _ww; - h[count] = _hh; - text.add(_textt); - url.add(_urll); - count++; -} - -dword _link::get_active_url() -{ - return url.get(active); -} - -void _link::draw_underline(dword i, color) -{ - DrawBar(x[i]+list.x, -list.first*list.item_h+y[i]+list.y+h[i]-2, w[i], 1, color); -} - -int _link::hover(dword mouse_x, mouse_y) -{ - int i; - int new_active = -1; - int link_start_y = list.first*list.item_h; - mouse_x -= list.x; - mouse_y -= list.y; - for (i=0; i link_start_y) && (y[i] < link_start_y+list.h) { - // debugln( sprintf(#param, "mx:%i my:%i x[i]:%i y[i]:%i", mx, my, x[i], y[i]) ); - if (mouse_x > x[i]) - && (mouse_x < x[i]+w[i]) - && (mouse_y > y[i]-link_start_y) - && (mouse_y < h[i]-link_start_y+link.y[i]) { - new_active = i; - break; - } - } - } - - if (new_active != active) - { - if (-1 == new_active) { - draw_underline(active, 0x0000FF); - CursorPointer.Restore(); - } - else { - draw_underline(active, 0x0000FF); - draw_underline(new_active, 0xFFFfff); - CursorPointer.Load(#CursorFile); - CursorPointer.Set(); - } - active = new_active; - return true; - } - - return false; -} \ No newline at end of file diff --git a/programs/cmm/aelia/pointer.cur b/programs/cmm/aelia/pointer.cur deleted file mode 100644 index 580bb75fa8942453b6e7b250e6f7351823c47b3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3262 zcmeH`F>ZrE5JiVrmYYcFtdtgw({lkAT!Hi0C1s9bafLKF09QatLyIUVoNE2-kw<6~ z7uhvcSZRh~7v9YL-4%I~L^d0drHCA#MbeDFbqc4)b?3$V0;MNS!*g7=>0h6$E)GNc^&hAuEx(y&F7qO zc-YqXQtuH+ac?PX-fqwzg45Qy)5^IX`&u~nd9g(8z*9!{PTaHJzhHZeJU9C$J_B^J B+LizS diff --git a/programs/cmm/aelia/prepare_page.h b/programs/cmm/aelia/prepare_page.h deleted file mode 100644 index 8180b17025..0000000000 --- a/programs/cmm/aelia/prepare_page.h +++ /dev/null @@ -1,325 +0,0 @@ -/*======================================================== -= = -= STYLE = -= = -========================================================*/ -#define HTML_PADDING_X 8; -#define HTML_PADDING_Y 5; - -struct _style { - bool bold, underlined, italic, strike; - bool h1, h2, h3, h4, h5, h6; - bool a; - bool pre; - bool ignore; - bool body; - dword color; - void clear(); -}; - -void _style::clear() -{ - bold=underlined=italic=strike=0; - h1=h2=h3=h4=h5=h6=0; - a=0; - pre=0; - ignore=0; - color=0; - body=0; -} - -/*======================================================== -= = -= TAG = -= = -========================================================*/ -struct _tag { - dword start; - dword end; - dword name; - - bool opens; - - dword attribute; - dword value; - - void parse(); - int nameis(); -}; - -void _tag::parse() -{ - dword START = start; - - calc(1); //WTF - - if (ESBYTE[START]=='/') { - START++; - opens = false; - } else opens = true; - - name = START; - - while ( (START < end) && (!__isWhite(ESBYTE[START])) ) { - START++; - } - if (START!=end) ESBYTE[START] = '\0'; - START++; - - strlwr(name); - - start = START; -} - -int _tag::nameis(dword _in_tag_name) -{ - if (name) && (streq(_in_tag_name, name)) return true; - return false; -} - -/*======================================================== -= = -= DRAW = -= = -========================================================*/ -struct _draw -{ - dword x; - dword y; - void init(); - void line_break(); -}; - -void _draw::init() -{ - x = HTML_PADDING_X; - y = HTML_PADDING_Y; -} -void _draw::line_break() -{ - y+= list.item_h; - x = HTML_PADDING_X; -} - -/*======================================================== -= = -= BUF = -= = -========================================================*/ -struct _buf -{ - dword pointer; - dword len; - dword start; - dword end; - void init(); -}; - -void _buf::init(dword _buf_pointer, _buf_len) -{ - pointer = _buf_pointer; - len = _buf_len; - start = malloc(len); - end = start + len; - strlcpy(start, pointer, len); -} - -/*======================================================== -= = -= TEXT = -= = -========================================================*/ -struct _text { - int size_pt_change; - dword start; - dword end; - - dword width; -}; - -/*======================================================== -= = -= DOM = -= = -========================================================*/ -struct _dom -{ - _tag tag; - _style style; - _draw draw; - _buf buf; - _text text; - _canvas canvas; - void init(); - void apply_text(); - void set_style(); - void parse(); -}; - -void _dom::init() -{ - style.clear(); - draw.init(); - buf.init(io.buffer_data, strlen(io.buffer_data)); -} - -void _dom::set_style() -{ - if (tag.nameis("body")) style.body = tag.opens; - if (tag.nameis("b")) style.bold = tag.opens; - if (tag.nameis("i")) style.italic = tag.opens; - if (tag.nameis("s")) style.strike = tag.opens; - if (tag.nameis("pre")) style.pre = tag.opens; - if (tag.nameis("style")) style.ignore = tag.opens; - if (tag.nameis("a")) { - style.a = tag.opens; - if (tag.opens) style.color=0x0000FF; else style.color=0; - } - - if (tag.nameis("br")) - || (tag.nameis("p")) - || (tag.nameis("div")) - || (tag.nameis("tr")) { - draw.line_break(); - return; - } - - if (tag.nameis("li")) && (tag.opens) { - draw.line_break(); - return; - } - - if (tag.nameis("td")) && (tag.opens) { - draw.line_break(); - return; - } - - /* - if (tag.nameis("title")) { - strcpy(#title, text.start); - strcat(#title, " - Aelia"); - DrawTitle(#title); - } - - if (tag.nameis("h1")) || (tag.nameis("/h1")) || - (tag.nameis("h2")) || (tag.nameis("/h2")) || - (tag.nameis("h3")) || (tag.nameis("/h3")) { - if (tag.nameis("h1")) { - text.size_pt_change = 8; - } else if (tag.nameis("/h1")) { - text.size_pt_change = -8; - } else if (tag.nameis("h2")) { - text.size_pt_change = 6; - } else if (tag.nameis("/h2")) { - text.size_pt_change = -6; - } else if (tag.nameis("h3")) { - text.size_pt_change = 4; - } else if (tag.nameis("/h3")) { - text.size_pt_change = -4; - } - kfont.size.pt += text.size_pt_change; - get_label_symbols_size(); - if (text.size_pt_change > 0) { - draw.y+= list.item_h;//что если будет очень длинная строка в теге? - } else {//коммент выше и коммент ниже связаны - draw.y+= list.item_h - text.size_pt_change;//не очень понятна логика этого места - text.size_pt_change = 0; - } - draw.x = HTML_PADDING_X; - return; - } - */ -} - -void _dom::apply_text(dword _intext) -{ - int label_w; - int textlen = strlen(_intext); - dword curline = malloc(textlen); - - if (!textlen) || (!style.body) return; - - do { - strlcpy(curline, _intext, textlen); - label_w = kfont.get_label_width(curline); - textlen--; - } while (label_w > list.w - draw.x - 10) && (textlen); - - kfont.bold = style.bold; - - if (kfont.size.height) { - canvas.write_text(draw.x, draw.y, style.color, curline); - if (style.a) { - canvas.draw_hor_line(draw.x, draw.y + list.item_h-2, - kfont.get_label_width(curline), style.color); - link.add(draw.x, draw.y, kfont.get_label_width(curline), - list.item_h, curline, "http://kolibrios.org"); - } - } - draw.x += label_w; - strcpy(curline, _intext + textlen); - - if (textlen) && (textlen < strlen(_intext)-1) { - draw.x = 0; - draw.y += list.item_h; - apply_text(_intext + textlen); - } -} - -void _dom::parse() -{ - dword i; - init(); - - text.start = buf.start; - tag.start = buf.start; - for ( i=buf.start; i') { - tag.end = i-1; - text.start = i+1; - ESBYTE[i] = '\0'; - tag.parse(); - set_style(); - } - } - - free(buf.start); - if (!kfont.size.height) { - list.count = draw.y/list.item_h+3; - if (list.count < list.visible) list.count = list.visible; - kfont.size.height = list.count+5*list.item_h; - kfont.raw_size = 0; - parse(); - } -} - - - -/*======================================================== -= = -= PREPARE = -= = -========================================================*/ -void PreparePage() -{ - _dom dom; - - strcpy(#title, history.current()+strrchr(history.current(),'/')); - ChangeCharset(encoding, "CP866", io.buffer_data); - link.clear(); - - kfont.size.height = 0; - - dom.parse(); - - kfont.ApplySmooth(); - - DrawPage(); -} diff --git a/programs/cmm/aelia/special.h b/programs/cmm/aelia/special.h deleted file mode 100644 index 7416d17c8c..0000000000 --- a/programs/cmm/aelia/special.h +++ /dev/null @@ -1,140 +0,0 @@ -// unicode conversion for special characters -char *unicode_tags[]={ -"nbsp", " ", -"#38", " ", -"#160", " ", - -"ntilde", "n", // spanish n special ñ -"#224", "à", // spanish a with grove accent 'à' -"#241", "n", // spanish symbol - -"copy", "(c)", -"#169", "(c)", - -"trade", "[TM]", - -"reg", "(r)", -"#174", "(r)", - -"bdquo", ",,", - -"amp", "&", -"#38", "&", - -"lt", "<", -"#60", "<", - -"gt", ">", -"#62", ">", - -"minus", "-", -"ndash", "-", -"mdash", "-", //-- -"#8722", "-", -"#8211", "-", -"#151", "-", -"#149", "-", - -"rsquo", "'", -"#39", "'", -"#96", "'", -"#8217", "'", - -"quot", "\"", -"#34", "\"", -"ldquo", "\"", -"rdquo", "\"", -"#8222", "\"", -"#8221", "\"", - -"laquo", "<<", -"#171", "<<", -"raquo", ">>", -"#187", ">>", - -"uarr", "\24", -"darr", "\25", -"rarr", "\26", -"larr", "\27", - -"#1028", "\242", -"#1030", "I", -"#1031", "\244", - -"#8470", "N", -"bull", "-", //âîîáùå çäåñü òî÷êà -"percnt","%", - -0}; - -// function to be called to fix the special symbols -void fixSpecial(dword text) { - byte ch; - int i , j, z; - dword aux; - dword text2 = text; - loop () { - ch = ESBYTE[text]; - if (!ch) return; - if (ch=='&') { - i = 0; - j = 0; - text++; - while ( i < 7) { - ch = ESBYTE[text]; - if (ch == ';') { - z = get_symbol(#str); - if (z == -1) { // not found - ch = ' '; - } - else { // tag found - aux = unicode_tags[z]; - strtrim(aux); - ch = ESBYTE[aux]; - // copy the special symbol found - while (ch) { - ESBYTE[text2] = ch; - aux++; - text2++; - ch = ESBYTE[aux]; - } - ch = ESBYTE[text2]; - } - // clean the old symbol - while (ch != ';') { - ESBYTE[text2] = ' ';// should be (char) 0; - text2++; - ch = ESBYTE[text2]; - } - ESBYTE[text2] = ' '; // should be '' or char 0 - break; - } - str[i] = ch; - if (!ch) return; - text++; - i++; - } - for (i=0; i < 7; i++) str[i] = 0; // clean str - } - text++; - text2++; - } -} - - - -// function to look for the conversion of special characters -// if not found--> return -1 -int get_symbol(char *str2) { - int i,j; - //debugln(#str2); - for (i=0; unicode_tags[i]!=0; i+=2) { - if (strcmp(str2, unicode_tags[i]) == 0) { - return (i+1); - } - } - return -1; -} - - - diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 46fdddcaf9..d7ffc12f26 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -592,16 +592,26 @@ void OpenPage(dword _open_URL) history.add(#new_url); + /* + There could be several possible types of addresses: + - cached page (only http/https) + - internal page + - web page + - local file + So we need to detect what incoming address is + and then halndle it in the propper way. + */ + if (pages_cache.has(#new_url)) { //CACHED PAGE LoadInternalPage(pages_cache.current_page_buf, pages_cache.current_page_size); } else if (!strncmp(#new_url,"WebView:",8)) { //INTERNAL PAGE - if (!strcmp(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#homepage, sizeof(homepage)); - else if (!strcmp(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#help, sizeof(help)); - else if (!strcmp(#new_url, URL_SERVICE_HISTORY)) ShowHistory(); - else LoadInternalPage(#page_not_found, sizeof(page_not_found)); + if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buidin_page_home, sizeof(buidin_page_home)); + else if (streq(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#buidin_page_help, sizeof(buidin_page_help)); + else if (streq(#new_url, URL_SERVICE_HISTORY)) ShowHistory(); + else LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error)); } else if (!strncmp(#new_url,"http:",5)) || (!strncmp(#new_url,"https:",6)) { //WEB PAGE @@ -621,7 +631,7 @@ void OpenPage(dword _open_URL) if (!http.transfer) { StopLoading(); - LoadInternalPage(#page_not_found, sizeof(page_not_found)); + LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error)); } } else { //LOCAL PAGE @@ -633,7 +643,7 @@ void OpenPage(dword _open_URL) strcpy(#new_url, "/tmp0/1/temp/word/document.xml"); } if (!GetLocalFileData(#new_url)) { - LoadInternalPage(#page_not_found, sizeof(page_not_found)); + LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error)); } } } @@ -750,7 +760,7 @@ void EventSubmitOmnibox() void LoadInternalPage(dword _bufdata, _in_bufsize){ if (!_bufdata) || (!_in_bufsize) { - LoadInternalPage(#page_not_found, sizeof(page_not_found)); + LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error)); } else { WB1.list.first = 0; //scroll page to the top DrawOmnibox(); diff --git a/programs/cmm/browser/html/help_en.htm b/programs/cmm/browser/buidin_pages/help_en.htm similarity index 100% rename from programs/cmm/browser/html/help_en.htm rename to programs/cmm/browser/buidin_pages/help_en.htm diff --git a/programs/cmm/browser/html/help_ru.htm b/programs/cmm/browser/buidin_pages/help_ru.htm similarity index 100% rename from programs/cmm/browser/html/help_ru.htm rename to programs/cmm/browser/buidin_pages/help_ru.htm diff --git a/programs/cmm/browser/html/homepage_en.htm b/programs/cmm/browser/buidin_pages/homepage_en.htm similarity index 100% rename from programs/cmm/browser/html/homepage_en.htm rename to programs/cmm/browser/buidin_pages/homepage_en.htm diff --git a/programs/cmm/browser/html/homepage_ru.htm b/programs/cmm/browser/buidin_pages/homepage_ru.htm similarity index 100% rename from programs/cmm/browser/html/homepage_ru.htm rename to programs/cmm/browser/buidin_pages/homepage_ru.htm diff --git a/programs/cmm/browser/html/page_not_found_en.htm b/programs/cmm/browser/buidin_pages/page_not_found_en.htm similarity index 100% rename from programs/cmm/browser/html/page_not_found_en.htm rename to programs/cmm/browser/buidin_pages/page_not_found_en.htm diff --git a/programs/cmm/browser/html/page_not_found_ru.htm b/programs/cmm/browser/buidin_pages/page_not_found_ru.htm similarity index 100% rename from programs/cmm/browser/html/page_not_found_ru.htm rename to programs/cmm/browser/buidin_pages/page_not_found_ru.htm diff --git a/programs/cmm/browser/texts.h b/programs/cmm/browser/texts.h index 0b9d8e8f4c..4b9c60be3e 100644 --- a/programs/cmm/browser/texts.h +++ b/programs/cmm/browser/texts.h @@ -1,9 +1,9 @@ char version[]="WebView 2.61"; #ifdef LANG_RUS -char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0"; -char homepage[] = FROM "html\\homepage_ru.htm""\0"; -char help[] = FROM "html\\help_ru.htm""\0"; +char buidin_page_error[] = FROM "buidin_pages\\page_not_found_ru.htm""\0"; +char buidin_page_home[] = FROM "buidin_pages\\homepage_ru.htm""\0"; +char buidin_page_help[] = FROM "buidin_pages\\help_ru.htm""\0"; char accept_language[]= "Accept-Language: ru\n"; char rmb_menu[] = "ᬮ 室|Ctrl+U @@ -31,9 +31,9 @@ char update_is_current[] = "'WebView\n char update_can_not_copy[] = "'WebView\n ६ Downloads Ramdisk. , 筮 .' -tE"; char clear_cache_ok[] = "'WebView\n 饭.' -tI"; #else -char page_not_found[] = FROM "html\\page_not_found_en.htm""\0"; -char homepage[] = FROM "html\\homepage_en.htm""\0"; -char help[] = FROM "html\\help_en.htm""\0"; +char buidin_page_error[] = FROM "buidin_pages\\page_not_found_en.htm""\0"; +char buidin_page_home[] = FROM "buidin_pages\\homepage_en.htm""\0"; +char buidin_page_help[] = FROM "buidin_pages\\help_en.htm""\0"; char accept_language[]= "Accept-Language: en\n"; char rmb_menu[] = "View source|Ctrl+U