Rev 8444 | Rev 8454 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8444 | Rev 8451 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include "TWB\colors.h" |
1 | #include "TWB\colors.h" |
2 | #include "TWB\anchors.h" |
2 | #include "TWB\anchors.h" |
3 | #include "TWB\parse_tag.h" |
3 | #include "TWB\parse_tag.h" |
4 | #include "TWB\special.h" |
4 | #include "TWB\special.h" |
5 | #include "TWB\tag_list.h" |
5 | #include "TWB\tag_list.h" |
6 | dword page_bg; |
6 | #define DEFAULT_BG_COL 0xffEBE8E9; |
7 | dword link_color_default; |
7 | dword link_color_default; |
8 | dword link_color_active; |
8 | dword link_color_active; |
9 | #include "TWB\links.h" |
9 | #include "TWB\links.h" |
Line 10... | Line 10... | ||
10 | 10 | ||
Line 20... | Line 20... | ||
20 | font, |
20 | font, |
21 | pre, |
21 | pre, |
22 | blq, |
22 | blq, |
23 | button, |
23 | button, |
24 | image; |
24 | image; |
25 | dword bg_color; |
- | |
26 | LIST tag_list; |
25 | LIST tag_list; |
27 | dword title; |
26 | dword title; |
- | 27 | dword cur_line_h; |
|
28 | void reset(); |
28 | void reset(); |
29 | }; |
29 | }; |
Line 30... | Line 30... | ||
30 | 30 | ||
31 | void STYLE::reset() |
31 | void STYLE::reset() |
32 | { |
32 | { |
33 | b = u = s = h = blq = pre = title = false; |
33 | b = u = s = h = blq = pre = title = false; |
- | 34 | font = false; |
|
34 | font = false; |
35 | cur_line_h = NULL; |
35 | tag_list.reset(); |
36 | tag_list.reset(); |
Line 36... | Line 37... | ||
36 | } |
37 | } |
37 | 38 | ||
Line 101... | Line 102... | ||
101 | if (line) |
102 | if (line) |
102 | { |
103 | { |
103 | start_x = stolbec * list.font_w + BODY_MARGIN + list.x; |
104 | start_x = stolbec * list.font_w + BODY_MARGIN + list.x; |
104 | stolbec_len = strlen(#line) * zoom; |
105 | stolbec_len = strlen(#line) * zoom; |
105 | line_length = stolbec_len * list.font_w; |
106 | line_length = stolbec_len * list.font_w; |
- | 107 | style.cur_line_h = math.max(style.cur_line_h, list.item_h); |
|
Line 106... | Line 108... | ||
106 | 108 | ||
107 | if (style.bg_color!=page_bg) { |
109 | if (bg_colors.get_last() - bg_colors.get(0)) { |
108 | canvas.DrawBar(start_x, draw_y, line_length, list.item_h, style.bg_color); |
110 | canvas.DrawBar(start_x, draw_y, line_length, list.item_h, bg_colors.get_last()); |
Line 109... | Line 111... | ||
109 | } |
111 | } |
110 | 112 | ||
111 | if (style.image) { |
113 | if (style.image) { |
Line 139... | Line 141... | ||
139 | { |
141 | { |
140 | t_html = t_body = link = false; |
142 | t_html = t_body = link = false; |
141 | style.reset(); |
143 | style.reset(); |
142 | link_color_default = 0x0000FF; |
144 | link_color_default = 0x0000FF; |
143 | link_color_active = 0xFF0000; |
145 | link_color_active = 0xFF0000; |
144 | style.bg_color = page_bg = 0xffEBE8E9; //E0E3E3 EBE8E9 |
- | |
145 | canvas.Fill(0, page_bg); |
146 | //style.cur_line_h = list.item_h; |
146 | links.clear(); |
147 | links.clear(); |
147 | anchors.clear(); |
148 | anchors.clear(); |
148 | img_url.drop(); |
149 | img_url.drop(); |
149 | text_colors.drop(); |
150 | text_colors.drop(); |
150 | text_colors.add(0); |
151 | text_colors.add(0); |
- | 152 | bg_colors.drop(); |
|
- | 153 | bg_colors.add(DEFAULT_BG_COL); |
|
- | 154 | canvas.Fill(0, DEFAULT_BG_COL); |
|
151 | header = NULL; |
155 | header = NULL; |
152 | cur_encoding = CH_CP866; |
156 | cur_encoding = CH_CP866; |
153 | draw_y = BODY_MARGIN; |
157 | draw_y = BODY_MARGIN; |
154 | stolbec = 0; |
158 | stolbec = 0; |
155 | line = 0; |
159 | line = 0; |
Line 324... | Line 328... | ||
324 | } else { |
328 | } else { |
325 | empty_line=0; |
329 | empty_line=0; |
326 | } |
330 | } |
Line 327... | Line 331... | ||
327 | 331 | ||
328 | if (t_html) && (!t_body) return; |
332 | if (t_html) && (!t_body) return; |
- | 333 | draw_y += style.cur_line_h; |
|
329 | draw_y += list.item_h; |
334 | style.cur_line_h = list.item_h; |
330 | if (style.blq) stolbec = 6; else stolbec = 0; |
335 | if (style.blq) stolbec = 6; else stolbec = 0; |
331 | stolbec += style.tag_list.level * 5; |
336 | stolbec += style.tag_list.level * 5; |
332 | } |
337 | } |
333 | //============================================================================================ |
338 | //============================================================================================ |