Subversion Repositories Kolibri OS

Rev

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

  1. #include "..\TWB\colors.h"
  2. #include "..\TWB\anchors.h"
  3. #include "..\TWB\parce_tag.h"
  4. #include "..\TWB\special.h"
  5. #include "..\TWB\img_cache.h"
  6. #include "..\TWB\tag_list.h"
  7. dword page_bg;
  8. dword link_color_default;
  9. dword link_color_active;
  10. #include "..\TWB\links.h"
  11.  
  12. #define BODY_MARGIN 6
  13. #define BASIC_LINE_H 18
  14.  
  15. struct _style {
  16.         bool
  17.         b, u, s, h,
  18.         pre,
  19.         blq,
  20.         button,
  21.         image;
  22.         dword bg_color;
  23.         LIST tag_list;
  24.         dword tag_title;
  25. };
  26.  
  27. struct TWebBrowser {
  28.         llist list;
  29.         _style style;
  30.         DrawBufer DrawBuf;
  31.         dword draw_y, stolbec;
  32.         int zoom;
  33.         dword o_bufpointer;
  34.         int cur_encoding, custom_encoding;
  35.         bool link, t_html, t_body;
  36.         dword bufpointer;
  37.         dword bufsize;
  38.  
  39.         void SetPageDefaults();
  40.         void AddCharToTheLine();
  41.         void ParseHtml();
  42.         void SetStyle();
  43.         void DrawStyle();
  44.         void DrawPage();
  45.         void DrawScroller();
  46.         void NewLine();
  47.         bool CheckForLineBreak();
  48.         char line[500];
  49.         char header[150];
  50. };
  51.  
  52. scroll_bar scroll_wv = { 15,NULL,NULL,NULL,0,2,NULL,0,0,0xeeeeee,0xBBBbbb,0xeeeeee};
  53.  
  54. //============================================================================================
  55. void TWebBrowser::DrawStyle()
  56. {
  57.         dword start_x, line_length, stolbec_len;
  58.        
  59.         if (style.tag_title)
  60.         {
  61.                 strncpy(#header, #line, sizeof(TWebBrowser.header)-1);
  62.                 strncat(#header, " - ", sizeof(TWebBrowser.header)-1);
  63.                 strncat(#header, #version, sizeof(TWebBrowser.header)-1);
  64.                 line = 0;
  65.                 return;
  66.         }
  67.         if (t_html) && (!t_body) {
  68.                 line = 0;
  69.                 return;
  70.         }
  71.        
  72.         if (line)
  73.         {
  74.                 start_x = stolbec * list.font_w + BODY_MARGIN + list.x;
  75.                 stolbec_len = strlen(#line) * zoom;
  76.                 line_length = stolbec_len * list.font_w;
  77.  
  78.                 if (debug_mode) {
  79.                         DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h, 0xDDDddd);
  80.                 }
  81.  
  82.                 if (style.bg_color!=page_bg) {
  83.                         DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h, style.bg_color);
  84.                 }
  85.  
  86.                 if (style.image) {
  87.                         DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, 0xF9DBCB);
  88.                 }
  89.                 if (style.button) {
  90.                         DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h - calc(zoom*2), 0xCCCccc);
  91.                         DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2), line_length, zoom, 0x999999);
  92.                 }
  93.  
  94.                 DrawBuf.WriteText(start_x, draw_y, list.font_type, text_colors[text_color_index], #line);
  95.                 if (style.b) DrawBuf.WriteText(start_x+1, draw_y, list.font_type, text_colors[text_color_index], #line);
  96.                 if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - zoom + draw_y, line_length, zoom, text_colors[text_color_index]);
  97.                 if (style.u) DrawBuf.DrawBar(start_x, list.item_h - zoom - zoom + draw_y, line_length, zoom, text_colors[text_color_index]);
  98.                 if (link) {
  99.                         if (line[0]==' ') && (line[1]==NULL) {} else {
  100.                                 DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2)-1, line_length, zoom, link_color_default);
  101.                                 PageLinks.AddText(start_x, draw_y + list.y, line_length, list.item_h - calc(zoom*2)-1, UNDERLINE, zoom);                               
  102.                         }
  103.                 }
  104.                 stolbec += stolbec_len;
  105.                 if (debug_mode) debug(#line);
  106.                 line = NULL;
  107.         }
  108. }
  109. //============================================================================================
  110. void TWebBrowser::SetPageDefaults()
  111. {
  112.         style.b = style.u = style.s = style.h = style.blq = t_html = t_body = style.pre =
  113.         link = text_color_index = text_colors[0] = style.tag_title = false;
  114.         style.tag_list.reset();
  115.         link_color_default = 0x0000FF;
  116.         link_color_active = 0xFF0000;
  117.         page_bg = 0xFFFFFF;
  118.         style.bg_color = page_bg;
  119.         DrawBuf.Fill(0, page_bg);
  120.         PageLinks.Clear();
  121.         anchors.clear();
  122.         header = NULL;
  123.         cur_encoding = CH_CP866;
  124.         draw_y = BODY_MARGIN;
  125.         stolbec = 0;
  126.         line = 0;
  127.         zoom = 1;
  128.         //hold original buffer
  129.         if (o_bufpointer) o_bufpointer=free(o_bufpointer);
  130.         o_bufpointer = malloc(bufsize);
  131.         memmov(o_bufpointer, bufpointer, bufsize);
  132.         if (custom_encoding != -1) {
  133.                 cur_encoding = custom_encoding;
  134.                 bufpointer = ChangeCharset(cur_encoding*10+#charsets, "CP866", bufpointer);
  135.         }
  136. }
  137. //============================================================================================
  138. void TWebBrowser::AddCharToTheLine(unsigned char _char)
  139. {
  140.         dword line_len;
  141.         if (_char<=15) _char=' ';
  142.         line_len = strlen(#line);
  143.         if (!style.pre) && (_char == ' ')
  144.         {
  145.                 if (line[line_len-1]==' ') return; //no double spaces
  146.                 if (!stolbec) && (!line) return; //no paces at the beginning of the line
  147.         }
  148.         if (line_len < sizeof(TWebBrowser.line)) chrcat(#line, _char);
  149.         CheckForLineBreak();
  150. }
  151. //============================================================================================
  152. void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
  153.         word bukva[2];
  154.         char unicode_symbol[10];
  155.         dword unicode_symbol_result;
  156.         dword j;
  157.         bool ignor_param=false;
  158.         int tab_len;
  159.         dword bufpos;
  160.         bufsize = _bufsize;
  161.         bufpointer = malloc(bufsize);
  162.         memmov(bufpointer, _bufpointer, bufsize);
  163.         SetPageDefaults();
  164.         if (strstri(bufpointer, "<body")==-1) {
  165.                 t_body = true;
  166.                 if (strstri(bufpointer, "<html")==-1)  style.pre = true; //show linebreaks for a plaint text
  167.         }
  168.         for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
  169.         {
  170.                 bukva = ESBYTE[bufpos];
  171.                 switch (bukva)
  172.                 {
  173.                 case 0x0a:
  174.                         if (style.pre) {
  175.                                 DrawStyle();
  176.                                 NewLine();
  177.                         } else {
  178.                                 AddCharToTheLine(0x0a);
  179.                         }
  180.                         break;
  181.                 case 0x09:
  182.                         if (style.pre) {
  183.                                 tab_len = strlen(#line) + stolbec % 4;
  184.                                 if (!tab_len) tab_len = 4; else tab_len = 4 - tab_len;
  185.                                 for (j=0; j<tab_len; j++;) chrcat(#line,' ');
  186.                         } else {
  187.                                 AddCharToTheLine(0x09);
  188.                         }
  189.                         break;
  190.                 case '&': //&nbsp; and so on
  191.                         for (j=1, unicode_symbol=0; (ESBYTE[bufpos+j]<>';') && (j<8); j++)
  192.                         {
  193.                                 bukva = ESBYTE[bufpos+j];
  194.                                 chrcat(#unicode_symbol, bukva);
  195.                         }
  196.                         if (GetUnicodeSymbol(#line, #unicode_symbol, sizeof(TWebBrowser.line)-1)) {
  197.                                 bufpos += j;
  198.                                 CheckForLineBreak();
  199.                         } else {
  200.                                 AddCharToTheLine('&');
  201.                         }
  202.                         break;
  203.                 case '<':
  204.                         bufpos++;
  205.                         if (!strncmp(bufpos,"!--",3))
  206.                         {
  207.                                 bufpos+=3;
  208.                                 while (strncmp(bufpos,"-->",3)!=0) && (bufpos < bufpointer + bufsize)
  209.                                 {
  210.                                         bufpos++;
  211.                                 }
  212.                                 bufpos+=2;
  213.                                 break;
  214.                         }
  215.                         tag.reset();
  216.                         if (ESBYTE[bufpos] == '/') {
  217.                                 tag.opened = false;
  218.                                 bufpos++;
  219.                         }
  220.  
  221.                         ignor_param=false;
  222.                         while (ESBYTE[bufpos] !='>') && (bufpos < bufpointer + bufsize) //ïîëó÷àåì òåã è åãî ïàðàìåòðû
  223.                         {
  224.                                 bukva = ESBYTE[bufpos];
  225.                                 if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
  226.                                 if (!ignor_param) && (bukva <>' ')
  227.                                 {
  228.                                         if (strlen(#tag.name)+1<sizeof(tag.name)) chrcat(#tag.name, bukva);
  229.                                 }
  230.                                 else
  231.                                 {
  232.                                         ignor_param = true;
  233.                                         if (strlen(#tag.params)+1<sizeof(tag.params)) strcat(#tag.params, #bukva);
  234.                                         //      chrncat(#tag.params, bukva, sizeof(tag.params)-1);
  235.                                 }
  236.                                 bufpos++;
  237.                         }
  238.                         strlwr(#tag.name);
  239.  
  240.                         // ignore text inside the next tags
  241.                         if (tag.is("script")) || (tag.is("style")) || (tag.is("binary")) || (tag.is("select"))  {
  242.                                 sprintf(#tag.params, "</%s>", #tag.name);
  243.                                 j = strstri(bufpos, #tag.params);
  244.                                 if (j!=-1) bufpos = j-1;
  245.                                 break;
  246.                         }
  247.  
  248.                         if (tag.name[strlen(#tag.name)-1]=='/') tag.name[strlen(#tag.name)-1]=NULL; //for br/ !!!!!!!!
  249.                         if (tag.params) tag.parse_params();
  250.  
  251.                         if (tag.name) {
  252.                                 CheckForLineBreak();
  253.                                 DrawStyle();
  254.                                 if (tag.name) SetStyle();
  255.                         }
  256.                         break;
  257.                 default:
  258.                         AddCharToTheLine(ESBYTE[bufpos]);
  259.                 }
  260.         }
  261.         DrawStyle();
  262.         NewLine();
  263.         list.count = draw_y;
  264.         list.CheckDoesValuesOkey();
  265.         anchors.current = NULL;
  266.         custom_encoding = -1;
  267.         if (!header) {
  268.                 strncpy(#header, #version, sizeof(TWebBrowser.header)-1);
  269.                 DrawTitle(#header);
  270.         }
  271. }
  272. //============================================================================================
  273. bool TWebBrowser::CheckForLineBreak()
  274. {
  275.         int line_break_pos;
  276.         char new_line_text[4096];
  277.         //Do we need a line break?
  278.         if (strlen(#line)*zoom + stolbec < list.column_max) return false;
  279.         //Yes, we do. Lets calculate where...
  280.         line_break_pos = strrchr(#line, ' ');
  281.         //Is a new line fits in the current line?
  282.         if (line_break_pos*zoom + stolbec > list.column_max) {
  283.                 line_break_pos = list.column_max/zoom - stolbec;
  284.                 while(line_break_pos) && (line[line_break_pos]!=' ') line_break_pos--;
  285.         }
  286.         //Maybe a new line is too big for the whole new line? Then we have to split it
  287.         if (!line_break_pos) && (style.tag_list.level*5 + strlen(#line) * zoom >= list.column_max) {
  288.                 line_break_pos = list.column_max/zoom - stolbec;
  289.         }
  290.         strcpy(#new_line_text, #line + line_break_pos);
  291.         line[line_break_pos] = 0x00;           
  292.        
  293.         DrawStyle();
  294.  
  295.         strcpy(#line, #new_line_text);
  296.         NewLine();
  297.         //if (strlen(#line)*zoom + stolbec > list.column_max)CheckForLineBreak();
  298.         return true;
  299. }
  300. //============================================================================================
  301. void TWebBrowser::SetStyle() {
  302.         char img_path[4096]=0;
  303.         int meta_encoding;
  304.  
  305.         dword value;
  306.  
  307.         if (value = tag.get_value_of("name=")) || (value = tag.get_value_of("id=")) {
  308.                 anchors.add(value, draw_y);
  309.                 if (anchors.current) && (streq(value, #anchors.current+1)) {
  310.                         list.first = draw_y;
  311.                         anchors.current = NULL;
  312.                 }
  313.         }
  314.         if (tag.is("html")) {
  315.                 t_html = tag.opened;
  316.                 return;
  317.         }
  318.         if (tag.is("q"))
  319.         {
  320.                 if (tag.opened) {
  321.                         meta_encoding = strlen(#line);
  322.                         if (line[meta_encoding-1] != ' ') chrcat(#line, ' ');
  323.                         chrcat(#line, '\"');
  324.                 }
  325.                 if (!tag.opened) strcat(#line, "\" ");
  326.                 return;
  327.         }
  328.         if (tag.is("title")) {
  329.                 style.tag_title = tag.opened;
  330.                 if (!tag.opened) DrawTitle(#header);
  331.                 return;
  332.         }
  333.         if (tag.is("body")) {
  334.                 t_body = tag.opened;
  335.                 if (value = tag.get_value_of("link="))  link_color_default = GetColor(value);
  336.                 if (value = tag.get_value_of("alink=")) link_color_active = GetColor(value);
  337.                 if (value = tag.get_value_of("text="))  text_colors[0]=GetColor(value);
  338.                 if (value = tag.get_value_of("bgcolor=")) {
  339.                         style.bg_color = page_bg = GetColor(value);
  340.                         DrawBuf.Fill(0, page_bg);
  341.                 }
  342.                 return;
  343.         }
  344.         if (tag.is("a")) {
  345.                 if (tag.opened)
  346.                 {
  347.                         if (link) IF(text_color_index > 0) text_color_index--; //åñëè ïðåäûäóùèé òåã à íå áûë çàêðûò
  348.                         if (value = tag.get_value_of("href=")) && (!strstr(value,"javascript:"))
  349.                         {
  350.                                 text_color_index++;
  351.                                 text_colors[text_color_index] = text_colors[text_color_index-1];
  352.                                 link = 1;
  353.                                 text_colors[text_color_index] = link_color_default;
  354.                                 PageLinks.AddLink(value);
  355.                         }
  356.                 } else {
  357.                         link = 0;
  358.                         IF(text_color_index > 0) text_color_index--;
  359.                 }
  360.                 return;
  361.         }
  362.         if (tag.is("font")) {
  363.                 style.bg_color = page_bg;
  364.                 if (tag.opened)
  365.                 {
  366.                         text_color_index++;
  367.                         text_colors[text_color_index] = text_colors[text_color_index-1];
  368.                         if (value = tag.get_value_of("color=")) text_colors[text_color_index] = GetColor(value);
  369.                         if (value = tag.get_value_of("bg=")) style.bg_color = GetColor(value);
  370.                 }
  371.                 else if (text_color_index > 0) text_color_index--;
  372.                 return;
  373.         }
  374.         if (tag.is("div")) {
  375.                 if (streq(#tag.prior,"div")) && (tag.opened) return;
  376.                 NewLine();
  377.                 return;
  378.         }
  379.         if (tag.is("header")) || (tag.is("article")) || (tag.is("footer")) || (tag.is("figure")) {
  380.                 NewLine();
  381.                 return;
  382.         }
  383.         if (tag.is("p")) {
  384.                 IF (tag.prior[0] == 'h') || (streq(#tag.prior,"td")) || (streq(#tag.prior,"p")) return;
  385.                 NewLine();
  386.                 return;
  387.         }
  388.         if (tag.is("br")) { NewLine(); return; }
  389.         if (tag.is("td")) { if (tag.opened) AddCharToTheLine(' '); return; }
  390.         if (tag.is("tr")) { if (tag.opened) NewLine(); return; }
  391.         if (tag.is("b")) || (tag.is("strong")) || (tag.is("big")) { style.b = tag.opened; return; }
  392.         if (tag.is("button")) { style.button = tag.opened; stolbec++; return; }
  393.         if (tag.is("u")) || (tag.is("ins")) { style.u=tag.opened; return;}
  394.         if (tag.is("s")) || (tag.is("strike")) || (tag.is("del")) { style.s=tag.opened; return; }
  395.         if (tag.is("dd")) { stolbec += 5; return; }
  396.         if (tag.is("blockquote")) { style.blq = tag.opened; return; }
  397.         if (tag.is("pre")) { style.pre = tag.opened; return; }
  398.         if (tag.is("code")) {
  399.                 if (tag.opened) style.bg_color = 0xe4ffcb; else style.bg_color = page_bg;
  400.                 style.pre = tag.opened; return;
  401.         }
  402.         if (tag.is("img")) {
  403.                 if (value = tag.get_value_of("src=")) strlcpy(#img_path, value, sizeof(img_path)-1);
  404.                 if (value = tag.get_value_of("title=")) && (strlen(value)<sizeof(TWebBrowser.line)-3) && (value) sprintf(#line, "[%s]", value);
  405.                 if (value = tag.get_value_of("alt=")) && (strlen(value)<sizeof(TWebBrowser.line)-3) && (value) sprintf(#line, "[%s]", value);
  406.                 if (!img_path) { line=0; return; }
  407.                 style.image = true;
  408.                 text_color_index++;
  409.                 text_colors[text_color_index] = 0x9A6F29;
  410.                 if (!line) {
  411.                         if (!strncmp(#img_path, "data:", 5)) img_path=0;
  412.                         replace_char(#img_path, '?', NULL, strlen(#img_path));
  413.                         sprintf(#line, "[%s]", #img_path+strrchr(#img_path, '/'));
  414.                         line[50]= NULL;
  415.                 }
  416.                 while (CheckForLineBreak()) {};
  417.                 DrawStyle();
  418.                 text_color_index--;
  419.                 style.image = false;
  420.                 //ImgCache.Images( list.x, draw_y, list.w);
  421.                 return;
  422.         }
  423.         if (tag.is("h4")) {
  424.                 NewLine();
  425.                 NewLine();
  426.                 style.h = tag.opened;
  427.                 style.b = tag.opened;
  428.         }
  429.         if (tag.is("h1")) || (tag.is("h2")) || (tag.is("h3")) || (tag.is("caption")) {
  430.                 style.h = tag.opened;
  431.                 if (tag.opened) {
  432.                         if (!style.pre) NewLine();
  433.                         draw_y += 10;
  434.                         zoom=2;
  435.                         list.font_type |= 10011001b;
  436.                         list.item_h = BASIC_LINE_H * 2 - 2;
  437.                         if (tag.is("h1")) style.b = true;
  438.                 } else {
  439.                         if (tag.is("h1")) style.b = false;
  440.                         NewLine();
  441.                         zoom=1;
  442.                         list.font_type = 10011000b;
  443.                         list.item_h = BASIC_LINE_H;
  444.                 }
  445.                 return;
  446.         }
  447.         if (tag.is("dt")) {
  448.                 style.tag_list.upd_level(tag.opened, DT);
  449.                 if (tag.opened) NewLine();
  450.                 return;
  451.         }
  452.         if (tag.is("ul")) {
  453.                 style.tag_list.upd_level(tag.opened, UL);
  454.                 if (!tag.opened) && (!style.pre) NewLine();
  455.                 return;
  456.         }
  457.         if (tag.is("ol")) {
  458.                 style.tag_list.upd_level(tag.opened, OL);      
  459.                 if (!tag.opened) && (!style.pre) NewLine();
  460.                 return;
  461.         }
  462.         if (tag.is("li")) && (tag.opened)
  463.         {
  464.                 if (!style.tag_list.level) style.tag_list.upd_level(1, UL);
  465.                 if (!style.pre) NewLine();
  466.                 if (style.tag_list.get_order_type() == UL) {
  467.                         strcpy(#line, "\31 ");
  468.                         stolbec = style.tag_list.level * 5 - 2;
  469.                 }
  470.                 if (style.tag_list.get_order_type() == OL) {
  471.                         sprintf(#line, "%i. ", style.tag_list.inc_counter());
  472.                         stolbec = style.tag_list.level * 5 - strlen(#line);
  473.                 }
  474.                 return;
  475.         }
  476.         if (tag.is("hr")) {
  477.                 if (value = tag.get_value_of("color=")) EDI = GetColor(value); else EDI = 0x999999;
  478.                 $push edi;
  479.                 NewLine();
  480.                 $pop edi;
  481.                 draw_y += 10;
  482.                 DrawBuf.DrawBar(5, draw_y - 1, list.w-10, 1, EDI);
  483.                 NewLine();
  484.                 draw_y += 10;
  485.                 return;
  486.         }
  487.         if (custom_encoding == -1) && (tag.is("meta")) || (tag.is("?xml")) {
  488.                 meta_encoding = CH_CP866;
  489.                 if (value = tag.get_value_of("charset=")) || (value = tag.get_value_of("content=")) || (value = tag.get_value_of("encoding="))
  490.                 {
  491.                         value += strrchr(value, '='); //search in content=
  492.                         strlwr(value);
  493.                         if      (streq(value,"utf-8"))        || (streq(value,"utf8"))        meta_encoding = CH_UTF8;
  494.                         else if (streq(value,"windows-1251")) || (streq(value,"windows1251")) meta_encoding = CH_CP1251;
  495.                         else if (streq(value,"dos"))          || (streq(value,"cp-866"))      meta_encoding = CH_CP866;
  496.                         else if (streq(value,"iso-8859-5"))   || (streq(value,"iso8859-5"))   meta_encoding = CH_ISO8859_5;
  497.                         else if (streq(value,"koi8-r"))       || (streq(value,"koi8-u"))      meta_encoding = CH_KOI8;
  498.                 }
  499.                 if (meta_encoding != CH_CP866) && (cur_encoding != meta_encoding) {
  500.                         cur_encoding = meta_encoding;
  501.                         bufpointer = ChangeCharset(cur_encoding*10+#charsets, "CP866", bufpointer);
  502.                         if (header) {
  503.                                 ChangeCharset(cur_encoding*10+#charsets, "CP866", #header);
  504.                                 DrawTitle(#header);
  505.                         }
  506.                 }
  507.                 return;
  508.         }
  509. }
  510. //============================================================================================
  511. void TWebBrowser::DrawScroller()
  512. {
  513.         scroll_wv.max_area = list.count;
  514.         scroll_wv.cur_area = list.visible;
  515.         scroll_wv.position = list.first;
  516.         scroll_wv.all_redraw = 0;
  517.         scroll_wv.start_x = list.x + list.w;
  518.         scroll_wv.start_y = list.y;
  519.         scroll_wv.size_y = list.h;
  520.         scrollbar_v_draw(#scroll_wv);
  521. }
  522. //============================================================================================
  523. void TWebBrowser::NewLine()
  524. {
  525.         dword onleft, ontop;
  526.         static int empty_line=0;
  527.  
  528.         if (!stolbec) && (draw_y==BODY_MARGIN) return;
  529.        
  530.         if (style.tag_list.level) && (stolbec == style.tag_list.level * 5) {
  531.                 if (empty_line<1) empty_line++;
  532.                 else return;
  533.         } else if (!stolbec) {
  534.                 if (empty_line<1) empty_line++;
  535.                 else return;
  536.         } else {
  537.                 empty_line=0;
  538.         }
  539.  
  540.         onleft = list.x + BODY_MARGIN;
  541.         ontop = draw_y + list.y;
  542.         if (t_html) && (!t_body) return;
  543.         draw_y += list.item_h;
  544.         if (style.blq) stolbec = 6; else stolbec = 0;
  545.         stolbec += style.tag_list.level * 5;
  546.         if (debug_mode) debugln(NULL);
  547. }
  548. //============================================================================================
  549. void TWebBrowser::DrawPage()
  550. {
  551.         PutPaletteImage(list.first * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0);  
  552.         DrawScroller();
  553. }