Rev 8490 | Rev 8492 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8490 | Rev 8491 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | if (tag.is("caption")) { tag_h1234_caption(); return; } |
49 | if (tag.is("caption")) { tag_h1234_caption(); return; } |
50 | if (tag.is("title")) { tag_title(); return; } |
50 | if (tag.is("title")) { tag_title(); return; } |
51 | if (tag.is("body")) { tag_body(); return; } |
51 | if (tag.is("body")) { tag_body(); return; } |
52 | if (tag.is("html")) { t_html = tag.opened; return; } |
52 | if (tag.is("html")) { t_html = tag.opened; return; } |
Line 53... | Line -... | ||
53 | - | ||
54 | //TO BE REWORKED |
53 | |
- | 54 | if (tag.is("table")) { tag_table(); return; } |
|
55 | //if (tag.is("table")) { tag_table(); return; } |
55 | if (tag.is("tr")) { if (tag.opened) NewLine(); return; } //temp |
56 | //if (tag.is("tr")) { tag_tr(); return; } |
56 | //if (tag.is("tr")) { tag_tr(); return; } |
57 | //if (tag.is("td")) { tag_td(); return; } |
57 | //if (tag.is("td")) { tag_td(); return; } |
Line 58... | Line 58... | ||
58 | } |
58 | } |
Line 103... | Line 103... | ||
103 | void TWebBrowser::tag_iframe() |
103 | void TWebBrowser::tag_iframe() |
104 | { |
104 | { |
105 | if (tag.get_value_of("src")) { |
105 | if (tag.get_value_of("src")) { |
106 | NewLine(); |
106 | NewLine(); |
107 | strcpy(#line, "IFRAME: "); |
107 | strcpy(#line, "IFRAME: "); |
108 | Render(); |
108 | RenderTextbuf(); |
109 | link=true; |
109 | link=true; |
110 | links.add_link(tag.value); |
110 | links.add_link(tag.value); |
111 | strncpy(#line, tag.value, sizeof(line)-1); |
111 | strncpy(#line, tag.value, sizeof(TWebBrowser.line)-1); |
112 | while (CheckForLineBreak()) {}; |
- | |
113 | Render(); |
112 | RenderTextbuf(); |
114 | link=false; |
113 | link=false; |
115 | NewLine(); |
114 | NewLine(); |
116 | } |
115 | } |
117 | } |
116 | } |
Line 189... | Line 188... | ||
189 | } |
188 | } |
190 | } |
189 | } |
Line 191... | Line 190... | ||
191 | 190 | ||
192 | void TWebBrowser::tag_hr() |
191 | void TWebBrowser::tag_hr() |
193 | { |
192 | { |
194 | EAX = 0x999999; |
193 | dword hrcol = 0x777777; |
195 | if (tag.get_value_of("color")) GetColor(tag.value); |
194 | if (tag.get_value_of("color")) hrcol = GetColor(tag.value); |
- | 195 | if (draw_x != left_gap) NewLine(); |
|
196 | $push eax; |
196 | canvas.DrawBar(5, style.cur_line_h / 2 + draw_y - 1, draw_w-10, 1, hrcol); |
197 | NewLine(); |
- | |
198 | $pop edi; |
- | |
199 | draw_y += 10; |
- | |
200 | canvas.DrawBar(5, draw_y - 1, list.w-10, 1, EDI); |
- | |
201 | NewLine(); |
- | |
202 | draw_y += 10; |
197 | NewLine(); |
203 | return; |
198 | return; |
Line 204... | Line 199... | ||
204 | } |
199 | } |
205 | 200 | ||
Line 220... | Line 215... | ||
220 | } |
215 | } |
221 | } |
216 | } |
Line 222... | Line 217... | ||
222 | 217 | ||
223 | void TWebBrowser::tag_q() |
218 | void TWebBrowser::tag_q() |
224 | { |
- | |
225 | if (tag.opened) { |
- | |
226 | AddCharToTheLine(' '); |
- | |
227 | AddCharToTheLine('\"'); |
- | |
228 | } else { |
219 | { |
229 | AddCharToTheLine('\"'); |
- | |
230 | AddCharToTheLine(' '); |
- | |
231 | } |
220 | chrncat(#line, '\"', sizeof(TWebBrowser.line)); |
Line 232... | Line 221... | ||
232 | } |
221 | } |
233 | 222 | ||
234 | void TWebBrowser::tag_h1234_caption() |
223 | void TWebBrowser::tag_h1234_caption() |
Line 301... | Line 290... | ||
301 | IMGOK: |
290 | IMGOK: |
302 | if (RenderImage(EAX)) return; |
291 | if (RenderImage(EAX)) return; |
Line 303... | Line 292... | ||
303 | 292 | ||
304 | NOIMG: |
293 | NOIMG: |
305 | if (tag.get_value_of("title")) || (tag.get_value_of("alt")) { |
294 | if (tag.get_value_of("title")) || (tag.get_value_of("alt")) { |
306 | strncpy(#img_path, tag.value, sizeof(line)-3); |
295 | strncpy(#img_path, tag.value, sizeof(TWebBrowser.line)-3); |
307 | sprintf(#line, "[%s]", #img_path); |
296 | sprintf(#line, "[%s]", #img_path); |
308 | } else { |
297 | } else { |
309 | if (streqrp(#img_path, "data:")) img_path=0; |
298 | if (streqrp(#img_path, "data:")) img_path=0; |
310 | replace_char(#img_path, '?', NULL, strlen(#img_path)); |
299 | replace_char(#img_path, '?', NULL, strlen(#img_path)); |
311 | img_path[sizeof(line)-3] = '\0'; //prevent overflow in sprintf |
300 | img_path[sizeof(TWebBrowser.line)-3] = '\0'; //prevent overflow in sprintf |
312 | sprintf(#line, "[%s]", #img_path+strrchr(#img_path, '/')); |
301 | sprintf(#line, "[%s]", #img_path+strrchr(#img_path, '/')); |
313 | line[50]= NULL; |
302 | line[50]= NULL; |
314 | } |
- | |
315 | while (CheckForLineBreak()) {}; |
303 | } |
316 | text_colors.add(0x9A6F29); |
304 | text_colors.add(0x9A6F29); |
317 | style.image = true; |
305 | style.image = true; |
318 | Render(); |
306 | RenderTextbuf(); |
319 | style.image = false; |
307 | style.image = false; |
320 | text_colors.pop(); |
308 | text_colors.pop(); |
Line 328... | Line 316... | ||
328 | int table_c=0; |
316 | int table_c=0; |
Line 329... | Line 317... | ||
329 | 317 | ||
330 | void TWebBrowser::tag_table() |
318 | void TWebBrowser::tag_table() |
331 | { |
319 | { |
- | 320 | if (tag.opened) table_c++; else table_c--; |
|
332 | if (tag.opened) table_c++; else table_c--; |
321 | if (!tag.opened) NewLine(); |
Line 333... | Line 322... | ||
333 | } |
322 | } |
334 | 323 | ||
335 | void TWebBrowser::tag_tr() |
324 | void TWebBrowser::tag_tr() |