Rev 7945 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7945 | Rev 7970 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | dword draw_y, stolbec; |
33 | dword draw_y, stolbec; |
34 | int zoom; |
34 | int zoom; |
35 | dword o_bufpointer; |
35 | dword o_bufpointer; |
36 | int cur_encoding, custom_encoding; |
36 | int cur_encoding, custom_encoding; |
37 | bool link, t_html, t_body; |
37 | bool link, t_html, t_body; |
38 | dword link_bg; |
- | |
39 | dword bufpointer; |
38 | dword bufpointer; |
40 | dword bufsize; |
39 | dword bufsize; |
41 | dword is_html; |
40 | dword is_html; |
Line 42... | Line 41... | ||
42 | 41 | ||
Line 104... | Line 103... | ||
104 | if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - zoom + draw_y, line_length, zoom, text_color__); |
103 | if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - zoom + draw_y, line_length, zoom, text_color__); |
105 | if (style.u) DrawBuf.DrawBar(start_x, list.item_h - zoom - zoom + draw_y, line_length, zoom, text_color__); |
104 | if (style.u) DrawBuf.DrawBar(start_x, list.item_h - zoom - zoom + draw_y, line_length, zoom, text_color__); |
106 | if (link) { |
105 | if (link) { |
107 | if (line[0]==' ') && (line[1]==NULL) {} else { |
106 | if (line[0]==' ') && (line[1]==NULL) {} else { |
108 | DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2)-1, line_length, zoom, link_color_default); |
107 | DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2)-1, line_length, zoom, link_color_default); |
109 | PageLinks.AddText(start_x, draw_y + list.y, line_length, list.item_h - calc(zoom*2)-1, UNDERLINE, zoom); |
108 | links.add_text(start_x, draw_y + list.y, line_length, list.item_h - calc(zoom*2)-1, zoom); |
110 | } |
109 | } |
111 | } |
110 | } |
112 | stolbec += stolbec_len; |
111 | stolbec += stolbec_len; |
113 | if (debug_mode) debug(#line); |
112 | if (debug_mode) debug(#line); |
114 | line = NULL; |
113 | line = NULL; |
Line 121... | Line 120... | ||
121 | link = text_color_index = text_colors[0] = style.tag_title = false; |
120 | link = text_color_index = text_colors[0] = style.tag_title = false; |
122 | style.tag_list.reset(); |
121 | style.tag_list.reset(); |
123 | link_color_default = 0x0000FF; |
122 | link_color_default = 0x0000FF; |
124 | link_color_active = 0xFF0000; |
123 | link_color_active = 0xFF0000; |
125 | page_bg = 0xFFFFFF; |
124 | page_bg = 0xFFFFFF; |
126 | link_bg = 0xFFFFFF; |
- | |
127 | style.bg_color = page_bg; |
125 | style.bg_color = page_bg; |
128 | DrawBuf.Fill(0, page_bg); |
126 | DrawBuf.Fill(0, page_bg); |
129 | PageLinks.Clear(); |
127 | links.clear(); |
130 | anchors.clear(); |
128 | anchors.clear(); |
131 | header = NULL; |
129 | header = NULL; |
132 | cur_encoding = CH_CP866; |
130 | cur_encoding = CH_CP866; |
133 | draw_y = BODY_MARGIN; |
131 | draw_y = BODY_MARGIN; |
134 | stolbec = 0; |
132 | stolbec = 0; |
Line 339... | Line 337... | ||
339 | } |
337 | } |
340 | if (tag.is("body")) { |
338 | if (tag.is("body")) { |
341 | t_body = tag.opened; |
339 | t_body = tag.opened; |
342 | if (value = tag.get_value_of("link=")) link_color_default = GetColor(value); |
340 | if (value = tag.get_value_of("link=")) link_color_default = GetColor(value); |
343 | if (value = tag.get_value_of("alink=")) link_color_active = GetColor(value); |
341 | if (value = tag.get_value_of("alink=")) link_color_active = GetColor(value); |
344 | if (value = tag.get_value_of("bglink=")) link_bg=GetColor(value); |
- | |
345 | if (value = tag.get_value_of("text=")) text_colors[0]=GetColor(value); |
342 | if (value = tag.get_value_of("text=")) text_colors[0]=GetColor(value); |
346 | if (value = tag.get_value_of("bgcolor=")) { |
343 | if (value = tag.get_value_of("bgcolor=")) { |
347 | style.bg_color = page_bg = link_bg = GetColor(value); |
344 | style.bg_color = page_bg = GetColor(value); |
348 | DrawBuf.Fill(0, page_bg); |
345 | DrawBuf.Fill(0, page_bg); |
349 | } |
346 | } |
350 | // Autodetecting encoding if no encoding was set |
347 | // Autodetecting encoding if no encoding was set |
351 | if (tag.opened) && (custom_encoding==-1) && (cur_encoding == CH_CP866) { |
348 | if (tag.opened) && (custom_encoding==-1) && (cur_encoding == CH_CP866) { |
352 | if (strstr(bufpointer, "\208\190")) ChangeEncoding(CH_UTF8); |
349 | if (strstr(bufpointer, "\208\190")) ChangeEncoding(CH_UTF8); |
Line 364... | Line 361... | ||
364 | if (tag.opened) |
361 | if (tag.opened) |
365 | { |
362 | { |
366 | if (value = tag.get_value_of("href=")) && (!strstr(value,"javascript:")) |
363 | if (value = tag.get_value_of("href=")) && (!strstr(value,"javascript:")) |
367 | { |
364 | { |
368 | link = true; |
365 | link = true; |
369 | PageLinks.AddLink(value); |
366 | links.add_link(value); |
370 | style.bg_color = link_bg; |
- | |
371 | } |
367 | } |
372 | } else { |
368 | } else { |
373 | link = false; |
369 | link = false; |
374 | style.bg_color = page_bg; |
370 | style.bg_color = page_bg; |
375 | } |
371 | } |
Line 378... | Line 374... | ||
378 | if (tag.is("iframe")) && (value = tag.get_value_of("src=")) { |
374 | if (tag.is("iframe")) && (value = tag.get_value_of("src=")) { |
379 | NewLine(); |
375 | NewLine(); |
380 | strcpy(#line, "IFRAME: "); |
376 | strcpy(#line, "IFRAME: "); |
381 | Paint(); |
377 | Paint(); |
382 | link=true; |
378 | link=true; |
383 | PageLinks.AddLink(value); |
379 | links.add_link(value); |
384 | strncpy(#line, value, sizeof(line)-1); |
380 | strncpy(#line, value, sizeof(line)-1); |
385 | while (CheckForLineBreak()) {}; |
381 | while (CheckForLineBreak()) {}; |
386 | Paint(); |
382 | Paint(); |
387 | link=false; |
383 | link=false; |
388 | NewLine(); |
384 | NewLine(); |