Rev 6686 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6686 | Rev 6730 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | dword link_color_inactive; |
44 | dword link_color_inactive; |
45 | dword link_color_active; |
45 | dword link_color_active; |
46 | dword bg_color; |
46 | dword bg_color; |
47 | 47 | dword block_bg_color; |
|
48 | int stroka; |
48 | |
- | 49 | int stroka; |
|
Line 49... | Line 50... | ||
49 | int stolbec; |
50 | int stolbec; |
50 | int tab_len; |
51 | int tab_len; |
51 | int anchor_line_num; |
52 | int anchor_line_num; |
52 | 53 | ||
Line 122... | Line 123... | ||
122 | style.align = ALIGN_LEFT; |
123 | style.align = ALIGN_LEFT; |
123 | link_color_inactive = 0x0000FF; |
124 | link_color_inactive = 0x0000FF; |
124 | link_color_active = 0xFF0000; |
125 | link_color_active = 0xFF0000; |
125 | bg_color = 0xFFFFFF; |
126 | bg_color = block_bg_color = 0xFFFFFF; |
126 | DrawBuf.Fill(bg_color); |
127 | DrawBuf.Fill(bg_color); |
127 | PageLinks.Clear(); |
128 | PageLinks.Clear(); |
128 | strcpy(#header, #version); |
129 | strcpy(#header, #version); |
129 | stroka = -list.first; |
130 | stroka = -list.first; |
130 | stolbec = 0; |
131 | stolbec = 0; |
131 | line = 0; |
132 | line = 0; |
132 | //for plaint text use CP866 for other UTF |
133 | //for plaint text use CP866 for other UTF |
Line 287... | Line 288... | ||
287 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
288 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
288 | if (isattr("bgcolor=")) |
289 | if (isattr("bgcolor=")) |
289 | { |
290 | { |
290 | bg_color=GetColor(#val); |
291 | bg_color = block_bg_color = GetColor(#val); |
291 | DrawBuf.Fill(bg_color); |
292 | DrawBuf.Fill(bg_color); |
292 | } |
293 | } |
293 | } while(GetNextParam()); |
294 | } while(GetNextParam()); |
294 | if (opened) && (cur_encoding==CH_NULL) debugln("Document has no information about encoding, UTF will be used"); |
295 | if (opened) && (cur_encoding==CH_NULL) debugln("Document has no information about encoding, UTF will be used"); |
295 | return; |
296 | return; |
296 | } |
297 | } |
297 | if (istag("a")) { |
298 | if (istag("a")) { |
Line 334... | Line 335... | ||
334 | else if (text_color_index > 0) text_color_index--; |
335 | else if (text_color_index > 0) text_color_index--; |
335 | return; |
336 | return; |
336 | } |
337 | } |
337 | if (istag("div")) || (istag("header")) || (istag("article")) || (istag("footer")) { |
338 | if (istag("bg")) { |
338 | IF(oldtag[0] != 'h') NewLine(); |
339 | if (opened) {block_bg_color=GetColor(#val); NewLine();} |
- | 340 | if (!opened) block_bg_color=bg_color; |
|
- | 341 | } |
|
- | 342 | if (istag("div")) || (istag("header")) || (istag("article")) || (istag("footer")) { |
|
- | 343 | IF(oldtag[0] != 'h') NewLine(); |
|
339 | if (isattr("bgcolor=")) |
344 | return; |
340 | { |
345 | } |
341 | bg_color=GetColor(#val); |
- | |
342 | DrawBuf.Fill(bg_color); |
- | |
343 | } |
- | |
344 | return; |
- | |
345 | } |
- | |
346 | if (istag("p")) { |
346 | if (istag("p")) { |
347 | IF(oldtag[0] == 'h') return; |
347 | IF(oldtag[0] == 'h') return; |
348 | NewLine(); |
348 | NewLine(); |
349 | IF(opened) NewLine(); |
349 | IF(opened) NewLine(); |
350 | return; |
350 | return; |
Line 473... | Line 473... | ||
473 | onleft = list.x + 5; |
473 | onleft = list.x + 5; |
Line 474... | Line 474... | ||
474 | ontop = stroka * list.item_h + list.y + 5; |
474 | ontop = stroka * list.item_h + list.y + 5; |
475 | if (t_html) && (!t_body) return; |
475 | if (t_html) && (!t_body) return; |
476 | if (stroka * list.item_h + 5 >= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor) |
476 | if (block_bg_color!=bg_color) DrawBuf.DrawBar(0, stroka+1*list.item_h+5, DrawBuf.bufw, list.item_h, block_bg_color); |
- | 477 | if (stroka * list.item_h + 5 >= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor) |
|
477 | { |
478 | { |
478 | if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
479 | if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
479 | if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
480 | if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
480 | } |
481 | } |
481 | stroka++; |
482 | stroka++; |
482 | if (style.blq) stolbec = 6; else stolbec = 0; |
483 | if (style.blq) stolbec = 6; else stolbec = 0; |
483 | if (style.li) stolbec = style.li_tab * 5; |
484 | if (style.li) stolbec = style.li_tab * 5; |
484 | } |
485 | } |
485 | //============================================================================================ |
486 | //============================================================================================ |
486 | int istag(dword text) { if (!strcmp(#tag,text)) return 1; else return 0; } |
487 | int istag(dword text) { if (!strcmp(#tag,text)) return true; else return false; } |
487 | int isattr(dword text) { if (!strcmp(#attr,text)) return 1; else return 0; } |
488 | int isattr(dword text) { if (!strcmp(#attr,text)) return true; else return false; } |
488 | int isval(dword text) { if (!strcmp(#val,text)) return 1; else return 0; } |
489 | int isval(dword text) { if (!strcmp(#val,text)) return true; else return false; } |
489 | //============================================================================================ |
490 | //============================================================================================ |
490 | void TWebBrowser::DrawPage() |
491 | void TWebBrowser::DrawPage() |
491 | { |
492 | { |
492 | PutPaletteImage(list.first * list.item_h * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0); |
493 | PutPaletteImage(list.first * list.item_h * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0); |
493 | DrawScroller(); |
494 | DrawScroller(); |
494 | }>>>=15)>>>=>': |
495 | }>>>=15)>>>=>': |