Rev 8499 | Rev 8572 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8499 | Rev 8500 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | void RenderLine(); |
54 | void RenderLine(); |
55 | bool RenderImage(); |
55 | bool RenderImage(); |
Line 56... | Line 56... | ||
56 | 56 | ||
57 | void SetPageDefaults(); |
57 | void SetPageDefaults(); |
- | 58 | void ParseHtml(); |
|
58 | void ParseHtml(); |
59 | void Reparse(); |
59 | void NewLine(); |
60 | void NewLine(); |
60 | void ChangeEncoding(); |
61 | void ChangeEncoding(); |
61 | void AddCharToTheLine(); |
62 | void AddCharToTheLine(); |
Line 108... | Line 109... | ||
108 | redirect = '\0'; |
109 | redirect = '\0'; |
109 | list.SetFont(8, 14, 10011000b); |
110 | list.SetFont(8, 14, 10011000b); |
110 | tag_table_reset(); |
111 | tag_table_reset(); |
111 | } |
112 | } |
112 | //============================================================================================ |
113 | //============================================================================================ |
- | 114 | void TWebBrowser::Reparse() |
|
- | 115 | { |
|
- | 116 | ParseHtml(bufpointer, bufsize); |
|
- | 117 | } |
|
- | 118 | //============================================================================================ |
|
113 | void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ |
119 | void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ |
114 | int tab_len; |
120 | int tab_len; |
115 | dword bufpos; |
121 | dword bufpos; |
116 | bufsize = _bufsize; |
122 | bufsize = _bufsize; |
Line 221... | Line 227... | ||
221 | } else { |
227 | } else { |
222 | RenderTextbuf(); |
228 | RenderTextbuf(); |
223 | } |
229 | } |
224 | } |
230 | } |
225 | //============================================================================================ |
231 | //============================================================================================ |
226 | void TWebBrowser::NewLine() |
- | |
227 | { |
- | |
228 | static bool empty_line = true; |
- | |
229 | - | ||
230 | if (draw_x==left_gap) && (draw_y==BODY_MARGIN) return; |
- | |
231 | if (t_html) && (!t_body) return; |
- | |
232 | - | ||
233 | if (draw_x == style.tag_list.level * 5 * list.font_w + left_gap) { |
- | |
234 | if (!empty_line) empty_line=true; else return; |
- | |
235 | } else { |
- | |
236 | empty_line = false; |
- | |
237 | } |
- | |
238 | - | ||
239 | draw_y += style.cur_line_h; |
- | |
240 | style.cur_line_h = list.item_h; |
- | |
241 | if (style.blq) draw_x = 6 * list.font_w; else draw_x = 0; |
- | |
242 | draw_x += style.tag_list.level * 5 * list.font_w + left_gap; |
- | |
243 | } |
- | |
244 | //============================================================================================ |
- | |
245 | void TWebBrowser::ChangeEncoding(int _new_encoding) |
232 | void TWebBrowser::ChangeEncoding(int _new_encoding) |
246 | { |
233 | { |
247 | if (cur_encoding == _new_encoding) return; |
234 | if (cur_encoding == _new_encoding) return; |
248 | cur_encoding = _new_encoding; |
235 | cur_encoding = _new_encoding; |
249 | bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer); |
236 | bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer); |
Line 256... | Line 243... | ||
256 | scroll_bar scroll_wv = { 15,NULL,NULL,NULL, |
243 | scroll_bar scroll_wv = { 15,NULL,NULL,NULL, |
257 | 0,2,NULL,0,0,0xeeeeee,0xBBBbbb,0xeeeeee}; |
244 | 0,2,NULL,0,0,0xeeeeee,0xBBBbbb,0xeeeeee}; |
Line 258... | Line 245... | ||
258 | 245 | ||
259 | void TWebBrowser::DrawPage() |
246 | void TWebBrowser::DrawPage() |
260 | { |
247 | { |
261 | if (list.w!=canvas.bufw) { |
- | |
262 | ParseHtml(bufpointer, bufsize); |
- | |
263 | } |
248 | if (list.w!=canvas.bufw) Reparse(); |
Line 264... | Line 249... | ||
264 | canvas.Show(list.first, list.h); |
249 | canvas.Show(list.first, list.h); |
265 | 250 | ||
266 | scroll_wv.max_area = list.count; |
251 | scroll_wv.max_area = list.count; |