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 72... | Line 72... | ||
72 | } |
72 | } |
Line 73... | Line 73... | ||
73 | 73 | ||
74 | void TWebBrowser::tag_font() |
74 | void TWebBrowser::tag_font() |
75 | { |
75 | { |
76 | style.font = tag.opened; |
- | |
77 | style.bg_color = page_bg; |
76 | style.font = tag.opened; |
78 | if (tag.opened) |
77 | if (tag.opened) |
79 | { |
78 | { |
- | 79 | if (tag.get_value_of("bg")) { |
|
- | 80 | bg_colors.add(GetColor(tag.value)); |
|
- | 81 | } else { |
|
- | 82 | bg_colors.add(bg_colors.get_last()); |
|
80 | if (tag.get_value_of("bg")) style.bg_color = GetColor(tag.value); |
83 | } |
81 | if (tag.get_value_of("color")) { |
84 | if (tag.get_value_of("color")) { |
82 | text_colors.add(GetColor(tag.value)); |
85 | text_colors.add(GetColor(tag.value)); |
83 | } else { |
86 | } else { |
84 | text_colors.add(text_colors.get_last()); |
87 | text_colors.add(text_colors.get_last()); |
85 | } |
88 | } |
- | 89 | } |
|
86 | } |
90 | else { |
- | 91 | text_colors.pop(); |
|
- | 92 | bg_colors.pop(); |
|
87 | else text_colors.pop(); |
93 | } |
Line 88... | Line 94... | ||
88 | } |
94 | } |
89 | 95 | ||
90 | void TWebBrowser::tag_div() |
96 | void TWebBrowser::tag_div() |
Line 119... | Line 125... | ||
119 | link = true; |
125 | link = true; |
120 | links.add_link(tag.value); |
126 | links.add_link(tag.value); |
121 | } |
127 | } |
122 | } else { |
128 | } else { |
123 | link = false; |
129 | link = false; |
124 | style.bg_color = page_bg; |
- | |
125 | } |
130 | } |
126 | } |
131 | } |
Line 127... | Line 132... | ||
127 | 132 | ||
128 | void TWebBrowser::tag_meta_xml() |
133 | void TWebBrowser::tag_meta_xml() |
Line 145... | Line 150... | ||
145 | } |
150 | } |
Line 146... | Line 151... | ||
146 | 151 | ||
147 | void TWebBrowser::tag_code() |
152 | void TWebBrowser::tag_code() |
148 | { |
153 | { |
149 | if (style.pre = tag.opened) { |
154 | if (style.pre = tag.opened) { |
150 | style.bg_color = 0xe4ffcb; |
155 | bg_colors.add(0xe4ffcb); |
151 | } else { |
156 | } else { |
152 | style.bg_color = page_bg; |
157 | bg_colors.pop(); |
153 | } |
158 | } |
Line 154... | Line 159... | ||
154 | } |
159 | } |
155 | 160 | ||
Line 203... | Line 208... | ||
203 | t_body = tag.opened; |
208 | t_body = tag.opened; |
204 | if (tag.get_value_of("link")) link_color_default = GetColor(tag.value); |
209 | if (tag.get_value_of("link")) link_color_default = GetColor(tag.value); |
205 | if (tag.get_value_of("alink")) link_color_active = GetColor(tag.value); |
210 | if (tag.get_value_of("alink")) link_color_active = GetColor(tag.value); |
206 | if (tag.get_value_of("text")) text_colors.set(0, GetColor(tag.value)); |
211 | if (tag.get_value_of("text")) text_colors.set(0, GetColor(tag.value)); |
207 | if (tag.get_value_of("bgcolor")) { |
212 | if (tag.get_value_of("bgcolor")) { |
208 | style.bg_color = page_bg = GetColor(tag.value); |
213 | bg_colors.set(0, GetColor(tag.value)); |
209 | canvas.Fill(0, page_bg); |
214 | canvas.Fill(0, bg_colors.get(0)); |
210 | } |
215 | } |
211 | // Autodetecting encoding if no encoding was set |
216 | // Autodetecting encoding if no encoding was set |
212 | if (tag.opened) && (custom_encoding==-1) && (cur_encoding == CH_CP866) { |
217 | if (tag.opened) && (custom_encoding==-1) && (cur_encoding == CH_CP866) { |
213 | if (strstr(bufpointer, "\208\190")) ChangeEncoding(CH_UTF8); |
218 | if (strstr(bufpointer, "\208\190")) ChangeEncoding(CH_UTF8); |
214 | else if (chrnum(bufpointer, '\246')>5) ChangeEncoding(CH_CP1251); |
219 | else if (chrnum(bufpointer, '\246')>5) ChangeEncoding(CH_CP1251); |
Line 245... | Line 250... | ||
245 | } else { |
250 | } else { |
246 | if (tag.is("h1")) style.b = false; |
251 | if (tag.is("h1")) style.b = false; |
247 | NewLine(); |
252 | NewLine(); |
248 | zoom=1; |
253 | zoom=1; |
249 | list.font_type = 10011000b; |
254 | list.font_type = 10011000b; |
250 | list.item_h = BASIC_LINE_H; |
255 | style.cur_line_h = list.item_h = BASIC_LINE_H; |
251 | } |
256 | } |
252 | } |
257 | } |
253 | } |
258 | } |
Line 258... | Line 263... | ||
258 | char img_path[4096]=0; |
263 | char img_path[4096]=0; |
259 | dword imgbuf[44]; |
264 | dword imgbuf[44]; |
260 | dword cur_img; |
265 | dword cur_img; |
261 | int img_x, img_y, img_w, img_h; |
266 | int img_x, img_y, img_w, img_h; |
Line 262... | Line 267... | ||
262 | 267 | ||
Line 263... | Line 268... | ||
263 | if (!tag.get_value_of("src")) goto NOIMG; |
268 | if (!tag.get_value_of("src")) return; |
264 | 269 | ||
265 | if (streqrp(tag.value, "data:")) { |
270 | if (streqrp(tag.value, "data:")) { |
266 | if (!strstr(tag.value, "base64,")) goto NOIMG; |
271 | if (!strstr(tag.value, "base64,")) goto NOIMG; |
Line 303... | Line 308... | ||
303 | img_x = stolbec*list.font_w+3; |
308 | img_x = stolbec*list.font_w+3; |
304 | img_y = draw_y; |
309 | img_y = draw_y; |
Line 305... | Line 310... | ||
305 | 310 | ||
Line 306... | Line -... | ||
306 | img_w = math.min(img_w, canvas.bufw - img_x); |
- | |
307 | 311 | img_w = math.min(img_w, canvas.bufw - img_x); |
|
Line 308... | Line 312... | ||
308 | stolbec += img_w / 6; |
312 | |
309 | if (stolbec > list.column_max) NewLine(); |
313 | style.cur_line_h = math.max(list.item_h, img_h); |
310 | 314 | ||
311 | if (img_h > list.item_h + 5) { |
315 | stolbec += img_w / 6; |
Line 312... | Line 316... | ||
312 | draw_y += img_h - list.item_h; |
316 | if (stolbec > list.column_max) { |