Subversion Repositories Kolibri OS

Rev

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

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