Subversion Repositories Kolibri OS

Rev

Rev 6931 | Rev 6985 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. //HTML Viewer in C--
  2. //Copyright 2007-2017 by Veliant & Leency
  3. //Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
  4.  
  5. #ifndef AUTOBUILD
  6.         #include "lang.h--"
  7. #endif
  8.  
  9. //libraries
  10. #define MEMSIZE 4096 * 200
  11. #include "..\lib\gui.h"
  12. #include "..\lib\draw_buf.h"
  13. #include "..\lib\list_box.h"
  14. #include "..\lib\cursor.h"
  15. #include "..\lib\collection.h"
  16. #include "..\lib\menu.h"
  17. #include "..\lib\random.h"
  18.  
  19. //*.obj libraries
  20. #include "..\lib\obj\box_lib.h"
  21. #include "..\lib\obj\libio_lib.h"
  22. #include "..\lib\obj\libimg_lib.h"
  23. #include "..\lib\obj\http.h"
  24. #include "..\lib\obj\iconv.h"
  25. //useful patterns
  26. #include "..\lib\patterns\libimg_load_skin.h"
  27. #include "..\lib\patterns\history.h"
  28. #include "..\lib\patterns\http_downloader.h"
  29.  
  30. char homepage[] = FROM "html\\homepage.htm""\0";
  31.  
  32. #ifdef LANG_RUS
  33. char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.61";
  34. ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
  35. ?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
  36. char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
  37. char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";
  38. char accept_language[]= "Accept-Language: ru\n";
  39. char rmb_menu[] =
  40. "®á¬®âà¥âì ¨á室­¨ª
  41. ¥¤ ªâ¨à®¢ âì ¨á室­¨ª
  42. ˆáâ®à¨ï
  43. Žç¨áâ¨âì ªíè ª à⨭®ª
  44. Œ¥­¥¤¦¥à § £à㧮ª";
  45. #else
  46. char version[]="Text-based Browser 1.61";
  47. ?define IMAGES_CACHE_CLEARED "Images cache cleared"
  48. ?define T_LAST_SLIDE "This slide is the last"
  49. char loading[] = "Loading...<br>";
  50. char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
  51. char accept_language[]= "Accept-Language: en\n";
  52. char rmb_menu[] =
  53. "View source
  54. Edit source
  55. History
  56. Free image cache
  57. Download Manager";
  58. #endif
  59.  
  60. char link_menu[] =
  61. "Copy link
  62. Download link";
  63.  
  64. #define URL_SERVICE_HISTORY "WebView://history"
  65. #define URL_SERVICE_HOME "WebView://home"
  66. #define URL_SERVICE_SOURCE "WebView://source:"
  67.  
  68. proc_info Form;
  69.  
  70. //char search_path[]="http://nigma.ru/index.php?s=";
  71. int redirected = 0;
  72.  
  73. char stak[4096];
  74.  
  75. int action_buf;
  76.  
  77. dword http_transfer = 0;
  78. dword http_buffer;
  79.  
  80. dword TOOLBAR_H = 40;
  81. dword STATUSBAR_H = 15;
  82. dword col_bg;
  83. dword panel_color;
  84. dword border_color;
  85.  
  86. progress_bar wv_progress_bar;
  87. bool souce_mode = false;
  88. bool open_in_a_new_window = false;
  89.  
  90. enum {
  91.         BACK_BUTTON=1000,
  92.         FORWARD_BUTTON,
  93.         REFRESH_BUTTON,
  94.         GOTOURL_BUTTON,
  95.         SANDWICH_BUTTON,
  96.         VIEW_SOURCE=1100,
  97.         EDIT_SOURCE,
  98.         VIEW_HISTORY,
  99.         FREE_IMG_CACHE,
  100.         DOWNLOAD_MANAGER,
  101.         COPY_LINK=1200,
  102.         DOWNLOAD_LINK
  103. };
  104.  
  105. #include "..\TWB\TWB.c"
  106. #include "history.h"
  107. #include "show_src.h"
  108. #include "download_manager.h"
  109.  
  110. char editURL[sizeof(URL)];
  111. int     mouse_twb;
  112. edit_box address_box = {250,60,30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,sizeof(URL),#editURL,#mouse_twb,2,19,19};
  113.  
  114.  
  115. void main()
  116. {
  117.         CursorPointer.Load(#CursorFile);
  118.         load_dll(boxlib, #box_lib_init,0);
  119.         load_dll(libio, #libio_init,1);
  120.         load_dll(libimg, #libimg_init,1);
  121.         load_dll(libHTTP, #http_lib_init,1);
  122.         load_dll(iconv_lib, #iconv_open,0);
  123.         Libimg_LoadImage(#skin, abspath("wv_skin.png"));
  124.         SetSkinColors();
  125.         CreateDir("/tmp0/1/downloads");
  126.         if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
  127.         WB1.list.SetFont(8, 14, 10011000b);
  128.         WB1.list.no_selection = true;
  129.         SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK);
  130.         loop() switch(WaitEvent())
  131.         {
  132.                 case evMouse:
  133.                         if (!CheckActiveProcess(Form.ID)) break;
  134.                         edit_box_mouse stdcall (#address_box);
  135.                         mouse.get();
  136.                         if (WB1.list.MouseOver(mouse.x, mouse.y))
  137.                         {
  138.                                 if (PageLinks.HoverAndProceed(mouse.x, WB1.list.first + mouse.y))
  139.                                 && (bufsize) && (mouse.pkm) && (mouse.up) {
  140.                                         EventShowPageMenu(mouse.x, mouse.y);
  141.                                         break;
  142.                                 }
  143.                                 if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
  144.                         }
  145.                         scrollbar_v_mouse (#scroll_wv);
  146.                         if (WB1.list.first != scroll_wv.position)
  147.                         {
  148.                                 WB1.list.first = scroll_wv.position;
  149.                                 WB1.DrawPage();
  150.                                 break;
  151.                         }
  152.                         break;
  153.  
  154.                 case evButton:
  155.                         ProcessEvent(GetButtonID());
  156.                         break;
  157.  
  158.                 case evKey:
  159.                         GetKeys();
  160.                         if (address_box.flags & 0b10)  
  161.                         {
  162.                                 if (key_ascii == ASCII_KEY_ENTER) ProcessEvent(key_scancode); else {
  163.                                         EAX = key_editbox;
  164.                                         edit_box_key stdcall(#address_box);
  165.                                 }
  166.                         }
  167.                         else
  168.                         {
  169.                                 if (WB1.list.ProcessKey(key_scancode)) WB1.DrawPage();
  170.                                 else ProcessEvent(key_scancode);
  171.                         }
  172.                         break;
  173.  
  174.                 case evReDraw:
  175.                         if (menu.list.cur_y) {
  176.                                 ProcessEvent(menu.list.cur_y);
  177.                                 menu.list.cur_y = 0;
  178.                         }
  179.                         DefineAndDrawWindow(GetScreenWidth()-800/2-random(80),GetScreenHeight()-600/2-random(80),800,600,0x73,col_bg,0,0);
  180.                         GetProcessInfo(#Form, SelfInfo);
  181.                         if (Form.status_window>2) { DrawTitle(#header); break; }
  182.                         if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; }
  183.                         if (Form.width<280) { MoveSize(OLD,OLD,280,OLD); break; }
  184.                         Draw_Window();
  185.                         break;
  186.                        
  187.                 case evNetwork:
  188.                         if (http_transfer > 0) {
  189.                                 http_receive stdcall (http_transfer);
  190.                                 $push EAX
  191.                                 ESI = http_transfer;
  192.                                 wv_progress_bar.max = ESI.http_msg.content_length;
  193.                                 if (wv_progress_bar.value != ESI.http_msg.content_received)
  194.                                 {
  195.                                         wv_progress_bar.value = ESI.http_msg.content_received; 
  196.                                         DrawProgress();
  197.                                 }
  198.                                 $pop EAX
  199.                                 if (EAX == 0) {
  200.                                         ESI = http_transfer;
  201.                                         // Handle redirects
  202.                                         if (ESI.http_msg.status >= 300) && (ESI.http_msg.status < 400)
  203.                                         {
  204.                                                 redirected++;
  205.                                                 if (redirected<=5)
  206.                                                 {
  207.                                                         http_find_header_field stdcall (http_transfer, "location\0");
  208.                                                         if (EAX!=0) {
  209.                                                                 ESI = EAX;
  210.                                                                 EDI = #URL;
  211.                                                                 do {
  212.                                                                         $lodsb;
  213.                                                                         $stosb;
  214.                                                                 } while (AL != 0) && (AL != 13) && (AL != 10);
  215.                                                                 DSBYTE[EDI-1]='\0';
  216.                                                                 if (!strncmp(#URL,"https://",8))
  217.                                                                 {
  218.                                                                         ShowErrorMessageThatHttpsIsNotSupportedYet();
  219.                                                                         StopLoading();
  220.                                                                         break; 
  221.                                                                 }
  222.                                                         }
  223.                                                 }
  224.                                                 else
  225.                                                 {
  226.                                                         notify("Too many redirects");
  227.                                                         StopLoading();
  228.                                                         break;
  229.                                                 }
  230.                                         }
  231.                                         else
  232.                                         {
  233.                                                 redirected = 0;
  234.                                         }
  235.                                         // Loading the page is complete, free resources
  236.                                         if (redirected>0)
  237.                                         {
  238.                                                 http_free stdcall (http_transfer);
  239.                                                 http_transfer=0;
  240.                                                 GetAbsoluteURL(#URL);
  241.                                                 history.back();
  242.                                                 strcpy(#editURL, #URL);
  243.                                                 DrawEditBoxWebView();
  244.                                                 OpenPage();
  245.                                         }
  246.                                         else
  247.                                         {
  248.                                                 history.add(#URL);
  249.                                                 ESI = http_transfer;
  250.                                                 bufpointer = ESI.http_msg.content_ptr;
  251.                                                 bufsize = ESI.http_msg.content_received;
  252.                                                 http_free stdcall (http_transfer);
  253.                                                 http_transfer=0;
  254.                                                 SetPageDefaults();
  255.                                                 ShowPage();
  256.                                         }
  257.                                 }
  258.                         }
  259.         }
  260. }
  261.  
  262. void SetElementSizes()
  263. {
  264.         address_box.top = TOOLBAR_H/2-10;
  265.         basic_line_h = calc(WB1.list.font_h * 130) / 100;
  266.         address_box.width = Form.cwidth - address_box.left - 50;
  267.         WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x,
  268.                 Form.cheight - TOOLBAR_H - STATUSBAR_H, basic_line_h);
  269.         WB1.list.wheel_size = 7 * basic_line_h;
  270.         WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
  271.         WB1.list.visible = WB1.list.h;
  272.         if (WB1.list.w!=WB1.DrawBuf.bufw) {
  273.                 WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, 32700);
  274.                 ProcessEvent(REFRESH_BUTTON);
  275.         }
  276. }
  277.  
  278.  
  279.  
  280. void Draw_Window()
  281. {
  282.         DrawBar(0,0, Form.cwidth,TOOLBAR_H-2, panel_color);
  283.         DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xD7D0D3);
  284.         DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color);
  285.         SetElementSizes();
  286.         DrawRectangle(address_box.left-3, address_box.top-3, address_box.width+5, 25,border_color);
  287.         DefineButton(address_box.left-52, address_box.top-2, 24, skin.h-2, BACK_BUTTON+BT_HIDE, 0);
  288.         DefineButton(address_box.left-27, address_box.top-2, 24, skin.h-2, FORWARD_BUTTON+BT_HIDE, 0);
  289.         img_draw stdcall(skin.image, address_box.left-53, address_box.top-3, 51, skin.h, 3, 0);
  290.         DefineButton(address_box.left+address_box.width+1, address_box.top-3, 16, skin.h-1, REFRESH_BUTTON+BT_HIDE+BT_NOFRAME, 0);
  291.         DefineButton(Form.cwidth-27, address_box.top-3, 23, skin.h-1, SANDWICH_BUTTON+BT_HIDE, 0);
  292.         img_draw stdcall(skin.image, Form.cwidth-24, address_box.top-3, 17, skin.h, 87, 0);
  293.         DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, col_bg);
  294.         DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, border_color);
  295.         if (!header) OpenPage(); else { WB1.DrawPage(); DrawEditBoxWebView(); }
  296.         DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
  297.         DrawProgress();
  298. }
  299.  
  300.  
  301. void ProcessEvent(dword id__)
  302. {
  303.         switch (id__)
  304.         {
  305.                 case 1:
  306.                         ExitProcess();
  307.                         return;
  308.                 case SCAN_CODE_BS:
  309.                 case BACK_BUTTON:
  310.                         if (history.back()) {
  311.                                 strcpy(#URL, history.current());
  312.                                 OpenPage();
  313.                         }
  314.                         return;
  315.                 case FORWARD_BUTTON:
  316.                         if (history.forward()) {
  317.                                 strcpy(#URL, history.current());
  318.                                 OpenPage();
  319.                         }
  320.                         return;
  321.                 case GOTOURL_BUTTON:
  322.                 case SCAN_CODE_ENTER:
  323.                         if (!strncmp(#editURL,"http:",5)) || (editURL[0]=='/')
  324.                         || (!strncmp(#editURL,"https:",6)) || (!strncmp(#editURL,"WebView:",8))
  325.                         {
  326.                                 strcpy(#URL, #editURL);
  327.                         }
  328.                         else
  329.                         {
  330.                                 strlcpy(#URL,"http://",7);
  331.                                 strcat(#URL, #editURL);
  332.                         }
  333.                         OpenPage();
  334.                         return;
  335.                 case 063: //F5
  336.                         IF(address_box.flags & 0b10) return;
  337.                 case REFRESH_BUTTON:
  338.                         if (http_transfer > 0)
  339.                         {
  340.                                 StopLoading();
  341.                                 Draw_Window();
  342.                         }
  343.                         else OpenPage();
  344.                         return;
  345.                 case SANDWICH_BUTTON:
  346.                         EventShowPageMenu(Form.cwidth - 215, TOOLBAR_H-6);
  347.                         return;
  348.                 case VIEW_SOURCE:
  349.                         WB1.list.first = 0;
  350.                         ShowSource();
  351.                         WB1.LoadInternalPage(bufpointer, bufsize);
  352.                         break;
  353.                 case EDIT_SOURCE:
  354.                         if (!strncmp(#URL,"http:",5))
  355.                         {
  356.                                 WriteFile(bufsize, bufpointer, "/tmp0/1/WebView_tmp.htm");
  357.                                 if (!EAX) RunProgram("/rd/1/tinypad", "/tmp0/1/WebView_tmp.htm");
  358.                         }
  359.                         else RunProgram("/rd/1/tinypad", #URL);
  360.                         return;
  361.                 case FREE_IMG_CACHE:
  362.                         ImgCache.Free();
  363.                         notify(IMAGES_CACHE_CLEARED);
  364.                         WB1.DrawPage();
  365.                         return;
  366.                 case VIEW_HISTORY:
  367.                         strcpy(#URL, URL_SERVICE_HISTORY);
  368.                         OpenPage();
  369.                         return;
  370.                 case DOWNLOAD_MANAGER:
  371.                         if (!downloader_opened) {
  372.                                 downloader_edit = NULL;
  373.                                 CreateThread(#Downloader,#downloader_stak+4092);
  374.                         }
  375.                         return;
  376.         }
  377. }
  378.  
  379.  
  380. void StopLoading()
  381. {
  382.         if (http_transfer)
  383.         {
  384.                 EAX = http_transfer;
  385.                 EAX = EAX.http_msg.content_ptr;         // get pointer to data
  386.                 $push   EAX                                                     // save it on the stack
  387.                 http_free stdcall (http_transfer);      // abort connection
  388.                 $pop    EAX                                                    
  389.                 free(EAX);                                              // free data
  390.                 http_transfer=0;
  391.                 bufsize = 0;
  392.                 bufpointer = free(bufpointer);
  393.         }
  394.         wv_progress_bar.value = 0;
  395.         DrawEditBoxWebView();
  396. }
  397.  
  398. void SetPageDefaults()
  399. {
  400.         strcpy(#header, #version);
  401.         WB1.list.count = WB1.list.first = 0;
  402.         cur_encoding = CH_NULL;
  403.         if (o_bufpointer) o_bufpointer = free(o_bufpointer);
  404. }
  405.  
  406. void OpenPage()
  407. {
  408.         StopLoading();
  409.         souce_mode = false;
  410.         strcpy(#editURL, #URL);
  411.         history.add(#URL);
  412.         if (!strncmp(#URL,"WebView:",8))
  413.         {
  414.                 SetPageDefaults();
  415.                 if (!strcmp(#URL, URL_SERVICE_HOME)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
  416.                 else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
  417.                 DrawEditBoxWebView();
  418.                 return;
  419.         }
  420.         if (!strncmp(#URL,"http:",5))
  421.         {
  422.                 img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 131, 0);
  423.                 http_get stdcall (#URL, 0, 0, #accept_language);
  424.                 http_transfer = EAX;
  425.                 if (!http_transfer)
  426.                 {
  427.                         StopLoading();
  428.                         bufsize = 0;
  429.                         bufpointer = free(bufpointer);
  430.                         ShowPage();
  431.                         return;
  432.                 }
  433.         }
  434.         else
  435.         {
  436.                 file_size stdcall (#URL);
  437.                 bufsize = EBX;
  438.                 if (bufsize)
  439.                 {
  440.                         free(bufpointer);
  441.                         bufpointer = malloc(bufsize);
  442.                         SetPageDefaults();
  443.                         ReadFile(0, bufsize, bufpointer, #URL);
  444.                 }
  445.                 ShowPage();
  446.         }
  447. }
  448.  
  449. DrawEditBoxWebView()
  450. {
  451.         DrawBar(address_box.left-2, address_box.top-2, address_box.width+3, 2, address_box.color);
  452.         DrawBar(address_box.left-2, address_box.top, 2, 22, address_box.color);
  453.         address_box.size = address_box.pos = address_box.shift = address_box.shift_old = strlen(#editURL);
  454.         address_box.offset = 0;
  455.         edit_box_draw stdcall(#address_box);
  456.         if (http_transfer > 0) EAX = 131; else EAX = 54;
  457.         img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, EAX, 0);
  458. }
  459.  
  460.  
  461. void ShowPage()
  462. {
  463.         DrawEditBoxWebView();
  464.         debugval("bufsize", bufsize);
  465.         if (!bufsize)
  466.         {
  467.                 if (http_transfer) WB1.LoadInternalPage(#loading, sizeof(loading));
  468.                 else WB1.LoadInternalPage(#page_not_found, sizeof(page_not_found));
  469.         }
  470.         else
  471.         {
  472.                 WB1.Prepare();
  473.         }
  474. }
  475.  
  476. byte UrlExtIs(dword ext)
  477. {
  478.         if (!strcmpi(#URL + strlen(#URL) - strlen(ext), ext)) return true;
  479.         return false;
  480. }
  481.  
  482. int SetSkinColors()
  483. {
  484.         dword image_data;
  485.         image_data = DSDWORD[skin.image+24];
  486.         col_bg = DSDWORD[image_data];
  487.         panel_color  = DSDWORD[skin.w*4*4 + image_data];
  488.         border_color = DSDWORD[skin.w*4*7 + image_data];
  489.         wv_progress_bar.progress_color = DSDWORD[skin.w*4*10 + image_data];
  490.         $and col_bg, 0x00ffffff
  491.         $and panel_color, 0x00ffffff
  492.         $and border_color, 0x00ffffff
  493.         $and wv_progress_bar.progress_color, 0x00ffffff
  494. }
  495.  
  496. void DrawProgress()
  497. {
  498.         unsigned long btn;
  499.         if (http_transfer == 0) return;
  500.         if (wv_progress_bar.max) btn = address_box.width*wv_progress_bar.value/wv_progress_bar.max; else btn = 30;
  501.         DrawBar(address_box.left-2, address_box.top+20, btn, 2, wv_progress_bar.progress_color);
  502. }
  503.  
  504.  
  505. char anchor[256];
  506. void ClickLink()
  507. {
  508.         if (http_transfer > 0)
  509.         {
  510.                 StopLoading();
  511.                 history.back();
  512.         }
  513.  
  514.         strcpy(#URL, PageLinks.GetURL(PageLinks.active));      
  515.         //#1
  516.         if (URL[0] == '#')
  517.         {
  518.                 if (URL[1] == NULL) {
  519.                         WB1.list.first = 0;
  520.                         strcpy(#URL, history.current());
  521.                 }
  522.                 else {
  523.                         strlcpy(#anchor, #URL+strrchr(#URL, '#'), sizeof(anchor));
  524.                         strcpy(#URL, history.current());
  525.                 }
  526.                 ShowPage();                    
  527.                 return;
  528.         }
  529.         //liner.ru#1
  530.         if (strrchr(#URL, '#')!=0)
  531.         {
  532.                 strlcpy(#anchor, #URL+strrchr(#URL, '#'), sizeof(anchor));
  533.                 URL[strrchr(#URL, '#')-1] = 0x00;
  534.         }
  535.  
  536.         if (!strncmp(#URL,"mailto:", 7))
  537.         {
  538.                 notify(#URL);
  539.                 strcpy(#editURL, history.current());
  540.                 strcpy(#URL, history.current());
  541.                 return;
  542.         }
  543.  
  544.         if (!strncmp(#URL,"https://",8))
  545.         {
  546.                 ShowErrorMessageThatHttpsIsNotSupportedYet();
  547.         }
  548.        
  549.         GetAbsoluteURL(#URL);
  550.  
  551.         if (strncmp(#URL,"http://",7)!=0)
  552.         {
  553.                 if (UrlExtIs(".htm")!=true) && (UrlExtIs(".html")!=true)
  554.                 {      
  555.                         RunProgram("/sys/@open", #URL);
  556.                         strcpy(#editURL, history.current());
  557.                         strcpy(#URL, history.current());
  558.                         return;
  559.                 }
  560.         }
  561.         else   
  562.         {
  563.                 if (UrlExtIs(".png")==true) || (UrlExtIs(".gif")==true) || (UrlExtIs(".jpg")==true)
  564.                 || (UrlExtIs(".zip")==true) || (UrlExtIs(".kex")==true) || (UrlExtIs(".pdf")==true)
  565.                 || (UrlExtIs(".7z")==true) {
  566.                         strcpy(#downloader_edit, #URL);
  567.                         CreateThread(#Downloader,#downloader_stak+4092);
  568.                         strcpy(#editURL, history.current());
  569.                         strcpy(#URL, history.current());
  570.                         return;
  571.                 }
  572.         }
  573.         if (open_in_a_new_window)
  574.         {
  575.                 RunProgram(#program_path, #URL);
  576.                 strcpy(#editURL, history.current());
  577.                 strcpy(#URL, history.current());
  578.         }
  579.         else
  580.         {
  581.                 OpenPage();
  582.         }
  583.         open_in_a_new_window = false;
  584. }
  585.  
  586. void EventShowPageMenu(dword _left, _top)
  587. {
  588.         menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 220, #rmb_menu, VIEW_SOURCE);
  589. }
  590.  
  591. void EventShowLinkMenu(dword _left, _top)
  592. {
  593.         menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 180, #link_menu, COPY_LINK);
  594. }
  595.  
  596.  
  597. void ShowErrorMessageThatHttpsIsNotSupportedYet()
  598. {
  599.         notify("'HTTPS protocol is not supported yet' -E");
  600. }
  601.  
  602. DrawStatusBar(dword _status_text)
  603. {
  604.         status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10;
  605.         status_text.start_y = Form.cheight - STATUSBAR_H + 3;
  606.         status_text.area_size_x = Form.cwidth - status_text.start_x -3;
  607.         DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
  608.         status_text.text_pointer = _status_text;
  609.         PathShow_prepare stdcall(#status_text);
  610.         PathShow_draw stdcall(#status_text);
  611. }
  612.  
  613. stop: