Subversion Repositories Kolibri OS

Rev

Rev 4725 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. dword bufpointer;
  2. dword o_bufpointer;
  3. dword bufsize;
  4.  
  5. #define URL param
  6.  
  7. scroll_bar scroll_wv = { 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};
  8.  
  9. char header[2048];
  10.  
  11. struct TWebBrowser {
  12.         llist list;
  13.         DrawBufer DrawBuf;
  14.         void Prepare();
  15.         void Parse();
  16.         void SetTextStyle();
  17.         void DrawPage();
  18.         void DrawScroller();
  19.         void NewLine();
  20.         void Perenos();
  21.         byte end_parsing;
  22. } WB1;
  23.  
  24. byte b_text, i_text, u_text, s_text, pre_text, blq_text, li_text, li_tab,
  25.         link, ignor_text, cur_encoding, text_align, t_html, t_body;
  26. byte condition_text_active, condition_text_val, condition_href, condition_max;
  27.  
  28. enum { _WIN, _DOS, _KOI, _UTF, _DEFAULT };
  29.  
  30. enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT};
  31.  
  32. dword text_colors[300];
  33. dword text_color_index;
  34. dword link_color_inactive;
  35. dword link_color_active;
  36. dword bg_color;
  37.  
  38. int stroka;
  39. int stolbec;
  40. int tab_len;
  41. int anchor_line_num;
  42.  
  43. char line[500];
  44. char tag[100];
  45. char tagparam[10000];
  46. char parametr[1200];
  47. char options[4096];
  48. char anchor[256];
  49.  
  50. #include "..\TWB\history.h"
  51. #include "..\TWB\links.h"
  52. #include "..\TWB\colors.h"
  53. #include "..\TWB\unicode_tags.h"
  54. #include "..\TWB\img_cache.h"
  55. #include "..\TWB\parce_tag.h"
  56. #include "..\TWB\table.h"
  57.  
  58.  
  59. //=======================================================================
  60.  
  61.  
  62. void TWebBrowser::DrawPage()
  63. {
  64.         int start_x, start_y, line_length, stolbec_len, magrin_left=5;
  65.        
  66.         if (!header)
  67.         {
  68.                 strcpy(#header, #line);
  69.                 strcat(#header, " -");
  70.                 strcat(#header, #version);
  71.                 line = 0;
  72.                 return;
  73.         }
  74.         if (t_html) && (!t_body) return;
  75.        
  76.         if (stroka >= 0) && (stroka - 2 < list.visible) && (line) && (!anchor)
  77.         {
  78.                 start_x = stolbec * 6 + list.x + magrin_left;
  79.                 start_y = stroka * list.line_h + list.y + magrin_left;
  80.                 stolbec_len = strlen(#line);
  81.                 line_length = stolbec_len * 6;
  82.  
  83.                 WriteBufText(start_x, 0, 0x88, text_colors[text_color_index], #line, buf_data);
  84.                 IF (b_text)     WriteBufText(start_x+1, 0, 0x88, text_colors[text_color_index], #line, buf_data);
  85.                 IF (i_text) { stolbec++; DrawBuf.Skew(start_x, 0, line_length, list.line_h); }
  86.                 IF (s_text) DrawBuf.DrawBar(start_x, 4, line_length, 1, text_colors[text_color_index]);
  87.                 IF (u_text) DrawBuf.DrawBar(start_x, 8, line_length, 1, text_colors[text_color_index]);
  88.                 IF (link) {
  89.                         UnsafeDefineButton(start_x-2, start_y-1, line_length + 3, 10, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
  90.                         DrawBuf.DrawBar(start_x, 8, line_length, 1, text_colors[text_color_index]);
  91.                         PageLinks.AddText(#line, line_length, list.line_h, UNDERLINE);
  92.                 }
  93.                 stolbec += stolbec_len;
  94.         }
  95. }
  96. //=======================================================================
  97.  
  98.  
  99. void BufEncode(int set_new_encoding)
  100. {
  101.         int bufpointer_realsize;
  102.         cur_encoding = set_new_encoding;
  103.         if (o_bufpointer==0)
  104.         {
  105.                 o_bufpointer = malloc(bufsize);
  106.                 strcpy(o_bufpointer, bufpointer);
  107.         }
  108.         else
  109.         {
  110.                 strcpy(bufpointer, o_bufpointer);
  111.         }
  112.         if (set_new_encoding==_WIN) wintodos(bufpointer);
  113.         if (set_new_encoding==_UTF) utf8rutodos(bufpointer);
  114.         if (set_new_encoding==_KOI) koitodos(bufpointer);
  115. }
  116.  
  117. void TWebBrowser::Prepare(dword bufpos, in_filesize){
  118.         bufsize = in_filesize;
  119.         bufpointer = bufpos;
  120.         Parse();
  121. }
  122.  
  123.  
  124. void TWebBrowser::Parse(){
  125.         word bukva[2];
  126.         int j;
  127.         byte ignor_param;
  128.         char temp[768];
  129.         dword bufpos = bufpointer;
  130.         int line_len;
  131.        
  132.         b_text = i_text = u_text = s_text = blq_text = t_html = t_body =
  133.         li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab =
  134.         condition_text_val = condition_text_active = 0; //îáíóëÿåì òåãè
  135.         end_parsing = false;
  136.         condition_max = 255;
  137.         text_align = ALIGN_LEFT;
  138.         link_color_inactive = 0x0000FF;
  139.         link_color_active = 0xFF0000;
  140.         bg_color = 0xFFFFFF;
  141.         DrawBuf.Fill(bg_color);
  142.         PageLinks.Clear();
  143.         strcpy(#header, #version);
  144.         stroka = -list.first;
  145.         stolbec = 0;
  146.         line = 0;
  147.  
  148.         if (pre_text<>2)
  149.         {
  150.                 pre_text=0;
  151.                 if (!strcmp(#URL + strlen(#URL) - 4, ".txt")) pre_text = 1;
  152.                 if (!strcmp(#URL + strlen(#URL) - 4, ".mht")) ignor_text = 1;
  153.         }
  154.        
  155.         for ( ; (bufpointer+bufsize > bufpos) && (ESBYTE[bufpos]!=0); bufpos++;)
  156.         {
  157.                 if (end_parsing) break;
  158.                 bukva = ESBYTE[bufpos];
  159.                 if (ignor_text) && (bukva!='<') continue;
  160.                 if (condition_text_active) && (condition_text_val != condition_href) && (bukva!='<') continue;
  161.                 switch (bukva)
  162.                 {
  163.                 case 0x0a:
  164.                         if (pre_text)
  165.                         {
  166.                                 chrcat(#line, ' ');
  167.                                 bukva = temp = NULL;
  168.                                 Perenos();
  169.                                 break;
  170.                         }
  171.                 case '\9':
  172.                         if (pre_text) //èíà÷å èä¸ì íà 0x0d     
  173.                         {
  174.                                 tab_len = strlen(#line) % 4;
  175.                                 if (!tab_len) tab_len = 4;
  176.                                 for (j=0; j<tab_len; j++;) chrcat(#line,' ');
  177.                                 break;
  178.                         }
  179.                         goto DEFAULT_MARK;             
  180.                 case '=': //quoted printable
  181.                         if (strcmp(#URL + strlen(#URL) - 4, ".mht")<>0) goto DEFAULT_MARK;
  182.  
  183.                         temp[0] = ESBYTE[bufpos+1];
  184.                         temp[1] = ESBYTE[bufpos+2];
  185.                         temp[2] = '\0';
  186.                         if (bukva = Hex2Symb(#temp))
  187.                         {
  188.                                 bufpos+=2;
  189.                                 goto DEFAULT_MARK;
  190.                         }
  191.                         break;
  192.                        
  193.                 case '&': //&nbsp; and so on
  194.                         bufpos++;
  195.                         tag=0;
  196.                         for (j=0; (ESBYTE[bufpos]<>';') && (j<7);   j++, bufpos++;)
  197.                         {
  198.                                 bukva = ESBYTE[bufpos];
  199.                                 chrcat(#tag, bukva);
  200.                         }
  201.                         if (bukva = GetUnicodeSymbol()) goto DEFAULT_MARK;
  202.                         break;
  203.                 case '<':
  204.                         bufpos++; //ïðîìîòàåì ñèìâîë <
  205.                         tag = parametr = tagparam = ignor_param = NULL;
  206.                         if (ESBYTE[bufpos] == '!') //ôèëüòðàöèÿ âíóòðè <!-- -->, äåðçêî
  207.                         {
  208.                                 bufpos++;
  209.                                 if (ESBYTE[bufpos] == '-')
  210.                                 {
  211.                                 HH_:
  212.                                         do
  213.                                         {
  214.                                                 bufpos++;
  215.                                                 if (bufpointer + bufsize <= bufpos) break 2;
  216.                                         }
  217.                                         while (ESBYTE[bufpos] <>'-');
  218.                                        
  219.                                         bufpos++;
  220.                                         if (ESBYTE[bufpos] <>'-') goto HH_;
  221.                                 }
  222.                         }
  223.                         while (ESBYTE[bufpos] !='>') && (bufpos < bufpointer + bufsize) //ïîëó÷àåì òåã è åãî ïàðàìåòðû
  224.                         {
  225.                                 bukva = ESBYTE[bufpos];
  226.                                 if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
  227.                                 if (!ignor_param) && (bukva <>' ')
  228.                                 {
  229.                                         if (strlen(#tag)<sizeof(tag)) chrcat(#tag, bukva);
  230.                                 }
  231.                                 else
  232.                                 {
  233.                                         ignor_param = true;
  234.                                         if (!ignor_text) && (strlen(#tagparam)+1<sizeof(tagparam)) strcat(#tagparam, #bukva);
  235.                                 }
  236.                                 bufpos++;
  237.                         }
  238.                         strlwr(#tag);
  239.  
  240.                         if (condition_text_active) && (condition_text_val != condition_href)
  241.                         {
  242.                                 if (strcmp(#tag, "/condition")!=0) break;
  243.                         }
  244.                         if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/
  245.                         if (tagparam) GetNextParam();
  246.  
  247.                         if (stolbec + strlen(#line) > list.column_max) Perenos();
  248.                         DrawPage();
  249.                         line = NULL;
  250.                         if (tag) SetTextStyle(list.x + 5, stroka * list.line_h + list.y + 5); //îáðàáîòêà òåãîâ
  251.                         tag = parametr = tagparam = ignor_param = NULL;
  252.                         break;
  253.                 default:
  254.                         DEFAULT_MARK:
  255.                         if (bukva<=15) bukva=' ';
  256.                         line_len = strlen(#line);
  257.                         if (!pre_text) && (bukva == ' ')
  258.                         {
  259.                                 if (line[line_len-1]==' ') break; //no double spaces
  260.                                 if (!stolbec) && (!line) break; //no paces at the beginning of the line
  261.                         }
  262.                         if (line_len < sizeof(line)) chrcat(#line, bukva);
  263.                         if (stolbec + line_len > list.column_max) Perenos();
  264.                 }
  265.         }
  266.         DrawPage();
  267.         NewLine();
  268.         DrawBar(list.x, stroka * list.line_h + list.y + 5, list.w, -stroka * list.line_h + list.h - 5, bg_color);
  269.         DrawBar(list.x, list.visible * list.line_h + list.y + 4, list.w, -list.visible * list.line_h + list.h - 4, bg_color);
  270.         if (list.first == 0) list.count = stroka;
  271.         if (anchor) //åñëè ïîñðåäè òåêñòà ïîÿâèòñÿ íîâûé ÿêîðü - áóäåò áåñêîíå÷íûé öèêë
  272.         {
  273.                 anchor=NULL;
  274.                 list.first=anchor_line_num;
  275.                 Parse();
  276.         }
  277.         DrawScroller();
  278. }
  279.  
  280. void TWebBrowser::Perenos()
  281. {
  282.         int perenos_num;
  283.         char new_line_text[4096];
  284.         perenos_num = strrchr(#line, ' ');
  285.         if (!perenos_num) && (strlen(#line)>list.column_max) perenos_num=list.column_max;
  286.         strcpy(#new_line_text, #line + perenos_num);
  287.         line[perenos_num] = 0x00;
  288.         if (stroka-1 > list.visible) && (list.first <>0) end_parsing=true;
  289.         DrawPage();
  290.         strcpy(#line, #new_line_text);
  291.         NewLine();
  292. }
  293.  
  294.  
  295. char oldtag[100];
  296. void TWebBrowser::SetTextStyle(int left1, top1) {
  297.         dword hr_color;
  298.         byte opened;
  299.         byte meta_encoding;
  300.         //ïðîâåðÿåì òåã îòêðûâàåòñÿ èëè çàêðûâàåòñÿ
  301.         if (tag[0] == '/')
  302.         {
  303.                  opened = 0;
  304.                  strcpy(#tag, #tag+1);
  305.         }
  306.         else opened = 1;
  307.                
  308.         if (isTag("html"))
  309.         {
  310.                 IF(!strcmp(#URL + strlen(#URL) - 4, ".mht")) IF (opened==0) ignor_text = 1; ELSE ignor_text = 0;
  311.                 t_html = opened;
  312.                 return;
  313.         }
  314.  
  315.         if (isTag("script")) || (isTag("style")) || (isTag("binary")) || (isTag("select")) ignor_text = opened;
  316.  
  317.         if(isTag("title"))
  318.         {
  319.                 if (opened) header=NULL;
  320.                 else if (!stroka) DrawTitle(#header); //òåã çàêðûëñÿ - âûâåëè ñòðîêó
  321.                 return;
  322.         }
  323.  
  324.         if (ignor_text) return;
  325.        
  326.         IF(isTag("q"))
  327.         {
  328.                 if (opened)
  329.                 {
  330.                         NewLine();
  331.                         strcat(#line, ' \"');
  332.                 }
  333.                 if (!opened)
  334.                 {
  335.                         chrcat(#line, '\"');
  336.                         NewLine();
  337.                 }
  338.         }
  339.  
  340.         if (anchor) && (!strcmp(#parametr, "id=")) //î÷åíü ïëîõî!!! ïîòîìó ÷òî åñëè íå ïîñëåäíèé òåã, ðàáîòàòü íå áóäåò
  341.         {
  342.                 if (!strcmp(#anchor, #options)) anchor_line_num=list.first+stroka;
  343.         }
  344.        
  345.         if (isTag("body"))
  346.         {
  347.                 t_body = opened;
  348.                 do{
  349.                         if (!strcmp(#parametr, "condition_max=")) condition_max = atoi(#options);
  350.                         if (!strcmp(#parametr, "link=")) link_color_inactive = GetColor(#options);
  351.                         if (!strcmp(#parametr, "alink=")) link_color_active = GetColor(#options);
  352.                         if (!strcmp(#parametr, "text=")) text_colors[0]=GetColor(#options);
  353.                         if (!strcmp(#parametr, "bgcolor="))
  354.                         {
  355.                                 bg_color=GetColor(#options);
  356.                                 DrawBuf.Fill(bg_color);
  357.                         }
  358.                 } while(GetNextParam());
  359.                 if (opened) && (cur_encoding==_DEFAULT)
  360.                 {
  361.                         debugln("Document has no information about encoding, UTF will be used");
  362.                         BufEncode(_UTF);
  363.                 }
  364.                 return;
  365.         }
  366.  
  367.         if (isTag("a"))
  368.         {
  369.                 if (opened)
  370.                 {
  371.                         if (link) IF(text_color_index > 0) text_color_index--; //åñëè ïðåäûäóùèé òåã à íå áûë çàêðûò
  372.  
  373.                         do{
  374.                                 if (!strcmp(#parametr, "href="))
  375.                                 {
  376.                                         if (stroka - 1 > list.visible) || (stroka < -2) return;
  377.                                        
  378.                                         text_color_index++;
  379.                                         text_colors[text_color_index] = text_colors[text_color_index-1];
  380.                                        
  381.                                         link = 1;
  382.                                         text_colors[text_color_index] = link_color_inactive;
  383.                                         PageLinks.AddLink(#options, stolbec*6+left1, top1-2);
  384.                                 }
  385.                                 if (anchor) && (!strcmp(#parametr, "name="))
  386.                                 {
  387.                                         if (!strcmp(#anchor, #options))
  388.                                         {
  389.                                                 anchor_line_num=list.first+stroka;
  390.                                         }
  391.                                 }
  392.                         } while(GetNextParam());
  393.                 }
  394.                 else {
  395.                         link = 0;
  396.                         IF(text_color_index > 0) text_color_index--;
  397.                 }
  398.                 return;
  399.         }
  400.  
  401.         if (isTag("font"))
  402.         {
  403.                 if (opened)
  404.                 {
  405.                         text_color_index++;
  406.                         text_colors[text_color_index] = text_colors[text_color_index-1];
  407.                
  408.                         do{
  409.                                 if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
  410.                                 {
  411.                                         text_colors[text_color_index] = GetColor(#options);
  412.                                 }
  413.                         } while(GetNextParam());
  414.                 }
  415.                 else
  416.                         if (text_color_index > 0) text_color_index--;
  417.                 return;
  418.         }
  419.         if (isTag("br")) {
  420.                 NewLine();
  421.                 return;
  422.         }
  423.         if (isTag("div")) || (isTag("header")) || (isTag("article")) || (isTag("footer")) {
  424.                 IF(oldtag[0] <>'h') NewLine();
  425.                 return;
  426.         }
  427.         if (isTag("p")) {
  428.                 IF(oldtag[0] == 'h') return;
  429.                 NewLine();
  430.                 IF(opened) NewLine();
  431.                 return;
  432.         }
  433.  
  434.         if(isTag("table")) {
  435.                 table.active = opened;
  436.                 NewLine();
  437.                 if (opened)     table.NewTable();
  438.         }
  439.  
  440.         if(isTag("td")) {
  441.                 if (opened)
  442.                 {
  443.                         table.cur_col++;
  444.                         table.row_h = 0;
  445.                         do {
  446.                                 if (!strcmp(#parametr, "width="))
  447.                                 {
  448.                                         table.col_w[table.cur_col] = atoi(#options);
  449.                                         // NewLine();
  450.                                         // strcpy(#line, #options);
  451.                                         // NewLine();
  452.                                 }
  453.                         } while(GetNextParam());
  454.                 }
  455.                 else
  456.                 {
  457.                         if (table.row_h > table.row_max_h) table.row_max_h = table.row_h;
  458.                 }
  459.         }
  460.  
  461.         if(isTag("tr")) {
  462.                 if (opened)
  463.                 {
  464.                         table.cur_col = 0;
  465.                         table.row_max_h = 0;
  466.                         table.row_start = stroka;
  467.                 }
  468.                 else
  469.                 {
  470.                         NewLine();
  471.                         if (table.cur_row == 0) table.max_cols = table.cur_col;
  472.                         table.cur_row++;
  473.                         table.max_cols = table.cur_col;
  474.                 }
  475.         }
  476.  
  477.         /*
  478.         if (isTag("center"))
  479.         {
  480.                 if (opened) text_align = ALIGN_CENTER;
  481.                 if (!opened)
  482.                 {
  483.                         NewLine();
  484.                         text_align = ALIGN_LEFT;
  485.                 }
  486.                 return;
  487.         }
  488.         if (isTag("right"))
  489.         {
  490.                 if (opened) text_align = ALIGN_RIGHT;
  491.                 if (!opened)
  492.                 {
  493.                         NewLine();
  494.                         text_align = ALIGN_LEFT;
  495.                 }
  496.                 return;
  497.         }
  498.         */
  499.         if (isTag("h1")) || (isTag("h2")) || (isTag("h3")) || (isTag("h4")) {
  500.                 NewLine();
  501.                 if (opened) && (stroka>1) NewLine();
  502.                 strcpy(#oldtag, #tag);
  503.                 if (opened)
  504.                 {
  505.                         if (!strcmp(#parametr, "align=")) && (!strcmp(#options,"center")) text_align = ALIGN_CENTER;
  506.                         if (!strcmp(#parametr, "align=")) && (!strcmp(#options,"right")) text_align = ALIGN_RIGHT;
  507.                         b_text = 1;
  508.                 }
  509.                 if (!opened)
  510.                 {
  511.                         text_align = ALIGN_LEFT;
  512.                         b_text = 0;
  513.                 }
  514.                 return;
  515.         }
  516.         else
  517.                 oldtag=NULL;
  518.                
  519.         if (isTag("b")) || (isTag("strong")) || (isTag("big")) {
  520.                 b_text = opened;
  521.                 return;
  522.         }
  523.         if(isTag("i")) || (isTag("em")) || (isTag("subtitle")) {
  524.                 i_text = opened;
  525.                 return;
  526.         }      
  527.         if (isTag("dt"))
  528.         {
  529.                 li_text = opened;
  530.                 IF(opened == 0) return;
  531.                 NewLine();
  532.                 return;
  533.         }
  534.         if (isTag("condition"))
  535.         {
  536.                 condition_text_active = opened;
  537.                 if (opened) && (!strcmp(#parametr, "show_if=")) condition_text_val = atoi(#options);
  538.                 return;
  539.         }
  540.         if (isTag("li")) || (isTag("dt")) //íàäî ñäåëàòü âëîæåííûå ñïèñêè
  541.         {
  542.                 li_text = opened;
  543.                 if (opened)
  544.                 {
  545.                         NewLine();
  546.                         if (stroka > -1) && (stroka - 2 < list.visible) DrawBuf.DrawBar(li_tab * 5 * 6 + left1 - 5, list.line_h/2-2, 2, 2, 0x555555);
  547.                 }
  548.                 return;
  549.         }
  550.         if (isTag("u")) || (isTag("ins")) u_text = opened;
  551.         if (isTag("s")) || (isTag("strike")) || (isTag("del")) s_text = opened;
  552.         if (isTag("ul")) || (isTag("ol")) IF(!opened)
  553.         {
  554.                 li_text = opened;
  555.                 li_tab--;
  556.                 NewLine();
  557.         } ELSE li_tab++;
  558.         if (isTag("dd")) stolbec += 5;
  559.         if (isTag("blockquote")) blq_text = opened;
  560.         if (isTag("pre")) || (isTag("code")) pre_text = opened;
  561.         if (isTag("hr"))
  562.         {
  563.                 if (anchor) || (stroka < -1)
  564.                 {
  565.                         stroka+=2;
  566.                         return;
  567.                 }
  568.                 if (strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options); else hr_color = 0x999999;
  569.                 NewLine();
  570.                 DrawBuf.DrawBar(5, list.line_h/2, list.w-10, 1, hr_color);
  571.                 NewLine();
  572.         }
  573.         if (isTag("img"))
  574.         {
  575.                 ImgCache.Images( left1, top1, WB1.list.w);
  576.                 return;
  577.         }
  578.         if (isTag("meta")) || (isTag("?xml"))
  579.         {
  580.                 do{
  581.                         if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding="))
  582.                         {
  583.                                 strcpy(#options, #options[strrchr(#options, '=')]); //ïîèñê â content=
  584.                                 strlwr(#options);
  585.                                 meta_encoding = _DEFAULT;
  586.                                 if (!strcmp(#options, "utf-8"))  || (!strcmp(#options,"utf8")) meta_encoding = _UTF;
  587.                                 if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) meta_encoding = _KOI;
  588.                                 if (!strcmp(#options, "windows-1251")) || (!strcmp(#options, "windows1251")) meta_encoding = _WIN;
  589.                                 if (!strcmp(#options, "dos"))    || (!strcmp(#options, "cp-866"))   meta_encoding = _DOS;
  590.                                 if (cur_encoding==_DEFAULT) BufEncode(meta_encoding);
  591.                                 return;
  592.                         }
  593.                 } while(GetNextParam());
  594.                 return;
  595.         }
  596. }
  597.  
  598. void TWebBrowser::DrawScroller()
  599. {
  600.         scroll_wv.max_area = list.count;
  601.         scroll_wv.cur_area = list.visible;
  602.         scroll_wv.position = list.first;
  603.  
  604.         scroll_wv.all_redraw=0;
  605.         scroll_wv.start_x = list.x + list.w;
  606.         scroll_wv.start_y = list.y;
  607.         scroll_wv.size_y=list.h;
  608.  
  609.         scrollbar_v_draw(#scroll_wv);
  610. }
  611.  
  612.  
  613. void TWebBrowser::NewLine()
  614. {
  615.         int onleft;
  616.         int ontop;
  617.  
  618.         onleft = list.x + 5;
  619.         ontop = stroka * list.line_h + list.y + 5;
  620.         if (!stroka) DrawBar(list.x, list.y, list.w, 5, bg_color);
  621.         if (t_html) && (!t_body) return;
  622.         if (ontop>=list.y) && ( ontop < list.h+list.y-10)  && (!anchor)
  623.         {
  624.                 if (text_align == ALIGN_CENTER) DrawBuf.AlignCenter(onleft,ontop,list.w,list.line_h,stolbec * 6);
  625.                 if (text_align == ALIGN_RIGHT) DrawBuf.AlignRight(onleft,ontop,list.w,list.line_h,stolbec * 6);
  626.                 DrawBuf.bufy = ontop;
  627.                 DrawBuf.Show();
  628.                 DrawBuf.Fill(bg_color);
  629.         }
  630.         stroka++;
  631.         if (blq_text) stolbec = 6; else stolbec = 0;
  632.         if (li_text) stolbec = li_tab * 5;
  633. }
  634.  
  635.  
  636.  
  637. int isTag(dword text)
  638. {
  639.         if (!strcmp(#tag,text)) return 1; else return 0;
  640. }
  641.  
  642.  
  643.