Rev 7742 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7742 | Rev 7743 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | li_tab, |
11 | li_tab, |
12 | button, |
12 | button, |
13 | image, |
13 | image, |
14 | align; |
14 | align; |
15 | }; |
15 | dword |
- | 16 | bg_color; |
|
- | 17 | }; |
|
16 | 18 | ||
Line 17... | Line 19... | ||
17 | struct TWebBrowser { |
19 | struct TWebBrowser { |
18 | llist list; |
20 | llist list; |
19 | _style style; |
21 | _style style; |
Line 45... | Line 47... | ||
45 | dword text_colors[300]; |
47 | dword text_colors[300]; |
46 | dword text_color_index; |
48 | dword text_color_index; |
47 | dword link_color_inactive; |
49 | dword link_color_inactive; |
48 | dword link_color_active; |
50 | dword link_color_active; |
49 | dword bg_color; |
51 | dword page_bg; |
Line 50... | Line 52... | ||
50 | 52 | ||
51 | int draw_y; |
53 | int draw_y; |
52 | int stolbec; |
54 | int stolbec; |
Line 91... | Line 93... | ||
91 | start_x = stolbec * list.font_w + body_magrin + list.x; |
93 | start_x = stolbec * list.font_w + body_magrin + list.x; |
92 | stolbec_len = strlen(#line) * zoom; |
94 | stolbec_len = strlen(#line) * zoom; |
93 | line_length = stolbec_len * list.font_w; |
95 | line_length = stolbec_len * list.font_w; |
94 | 96 | ||
Line -... | Line 97... | ||
- | 97 | if (style.bg_color!=page_bg) { |
|
- | 98 | DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, style.bg_color); |
|
- | 99 | } |
|
- | 100 | ||
95 | if (style.image) { |
101 | if (style.image) { |
96 | DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h, 0xF9DBCB); |
102 | DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, 0xF9DBCB); |
97 | } |
103 | } |
98 | if (style.button) { |
104 | if (style.button) { |
99 | DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h - calc(zoom*2), 0xCCCccc); |
105 | DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h - calc(zoom*2), 0xCCCccc); |
100 | DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2), line_length, zoom, 0x999999); |
106 | DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2), line_length, zoom, 0x999999); |
101 | } |
107 | } |
Line 128... | Line 134... | ||
128 | style.li = link = ignor_text = text_color_index = text_colors[0] = style.li_tab = 0; |
134 | style.li = link = ignor_text = text_color_index = text_colors[0] = style.li_tab = 0; |
129 | style.align = ALIGN_LEFT; |
135 | style.align = ALIGN_LEFT; |
130 | link_color_inactive = 0x0000FF; |
136 | link_color_inactive = 0x0000FF; |
131 | link_color_active = 0xFF0000; |
137 | link_color_active = 0xFF0000; |
132 | bg_color = 0xFFFFFF; |
138 | page_bg = 0xFFFFFF; |
133 | DrawBuf.Fill(0, bg_color); |
139 | style.bg_color = page_bg; |
- | 140 | DrawBuf.Fill(0, page_bg); |
|
134 | PageLinks.Clear(); |
141 | PageLinks.Clear(); |
135 | strcpy(#header, #version); |
142 | strcpy(#header, #version); |
136 | draw_y = body_magrin; |
143 | draw_y = body_magrin; |
137 | stolbec = 0; |
144 | stolbec = 0; |
138 | line = 0; |
145 | line = 0; |
139 | zoom = 1; |
146 | zoom = 1; |
Line 298... | Line 305... | ||
298 | if (isattr("alink=")) link_color_active = GetColor(#val); |
305 | if (isattr("alink=")) link_color_active = GetColor(#val); |
299 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
306 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
300 | if (isattr("bgcolor=")) |
307 | if (isattr("bgcolor=")) |
301 | { |
308 | { |
302 | bg_color = GetColor(#val); |
309 | style.bg_color = page_bg = GetColor(#val); |
303 | DrawBuf.Fill(0, bg_color); |
310 | DrawBuf.Fill(0, page_bg); |
304 | } |
311 | } |
305 | } while(GetNextParam()); |
312 | } while(GetNextParam()); |
306 | if (opened) && (cur_encoding==CH_NULL) { |
313 | if (opened) && (cur_encoding==CH_NULL) { |
307 | cur_encoding = CH_CP866; |
314 | cur_encoding = CH_CP866; |
308 | //BufEncode(CH_UTF8); |
315 | //BufEncode(CH_UTF8); |
309 | debugln("Document has no information about encoding!"); |
316 | debugln("Document has no information about encoding!"); |
Line 338... | Line 345... | ||
338 | } |
345 | } |
339 | return; |
346 | return; |
340 | } |
347 | } |
341 | if (istag("font")) { |
348 | if (istag("font")) { |
342 | if (opened) |
349 | style.bg_color = page_bg; |
- | 350 | if (opened) |
|
343 | { |
351 | { |
344 | text_color_index++; |
352 | text_color_index++; |
345 | text_colors[text_color_index] = text_colors[text_color_index-1]; |
353 | text_colors[text_color_index] = text_colors[text_color_index-1]; |
346 | do{ |
354 | do{ |
347 | if (isattr("color=")) text_colors[text_color_index] = GetColor(#val); |
355 | if (isattr("color=")) text_colors[text_color_index] = GetColor(#val); |
348 | } while(GetNextParam()); |
356 | if (isattr("bg=")) style.bg_color = GetColor(#val); |
- | 357 | } while(GetNextParam()); |
|
349 | } |
358 | } |
350 | else if (text_color_index > 0) text_color_index--; |
359 | else if (text_color_index > 0) text_color_index--; |
351 | return; |
360 | return; |
352 | } |
361 | } |
353 | if (istag("div")) || (istag("header")) || (istag("article")) || (istag("footer")) { |
362 | if (istag("div")) || (istag("header")) || (istag("article")) || (istag("footer")) { |
Line 424... | Line 433... | ||
424 | style.li = opened; |
433 | style.li = opened; |
425 | if (opened) |
434 | if (opened) |
426 | { |
435 | { |
427 | NewLine(); |
436 | NewLine(); |
428 | strcpy(#line, "\31 "); |
437 | stolbec = style.li_tab * 5 - 2; |
- | 438 | strcpy(#line, "\31 "); |
|
429 | stolbec-=2; |
439 | //stolbec-=2; |
430 | } |
440 | } |
431 | return; |
441 | return; |
432 | } |
442 | } |
433 | if (istag("ul")) || (istag("ol")) { |
443 | if (istag("ul")) || (istag("ol")) { |
434 | if (!opened) |
444 | if (!opened) |
435 | { |
445 | { |