Rev 5825 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4411 | leency | 1 | |
5749 | leency | 2 | |
4677 | leency | 3 | enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT}; |
4416 | leency | 4 | |
5746 | leency | 5 | struct _style { |
4416 | leency | 6 | |
5746 | leency | 7 | b, i, u, s, h, |
8 | pre, |
||
5768 | leency | 9 | blq, |
5746 | leency | 10 | li, |
11 | li_tab, |
||
12 | align; |
||
13 | }; |
||
14 | |||
15 | struct TWebBrowser { |
||
16 | |||
4411 | leency | 17 | _style style; |
4540 | leency | 18 | DrawBufer DrawBuf; |
5746 | leency | 19 | void Prepare(); |
4475 | leency | 20 | void SetStyle(); |
5766 | leency | 21 | void DrawStyle(); |
22 | void DrawPage(); |
||
23 | void DrawScroller(); |
||
4411 | leency | 24 | void LoadInternalPage(); |
25 | void NewLine(); |
||
5747 | leency | 26 | void Perenos(); |
4650 | leency | 27 | void BufEncode(); |
4718 | leency | 28 | } WB1; |
5749 | leency | 29 | |
4686 | leency | 30 | |
4486 | leency | 31 | |
5746 | leency | 32 | |
33 | ignor_text, |
||
34 | cur_encoding, |
||
35 | t_html, |
||
36 | t_body; |
||
37 | |||
38 | dword bufpointer=0; |
||
39 | |||
5781 | leency | 40 | dword bufsize=0; |
41 | |||
42 | dword text_colors[300]; |
||
4411 | leency | 43 | |
4417 | leency | 44 | dword link_color_inactive; |
45 | dword link_color_active; |
||
4491 | leency | 46 | dword bg_color; |
47 | |||
4417 | leency | 48 | int stroka; |
4411 | leency | 49 | |
4417 | leency | 50 | int tab_len; |
51 | int anchor_line_num; |
||
52 | |||
53 | char URL[10000]; |
||
4636 | leency | 54 | |
5746 | leency | 55 | char line[500]; |
56 | char tagparam[10000]; |
||
4417 | leency | 57 | char tag[100]; |
5746 | leency | 58 | char oldtag[100]; |
4417 | leency | 59 | char attr[1200]; |
5768 | leency | 60 | char val[4096]; |
5746 | leency | 61 | char anchor[256]=0; |
62 | |||
5768 | leency | 63 | #include "..\TWB\links.h" |
4411 | leency | 64 | |
4686 | leency | 65 | #include "..\TWB\unicode_tags.h" |
4411 | leency | 66 | #include "..\TWB\img_cache.h" |
67 | #include "..\TWB\parce_tag.h" |
||
68 | |||
69 | |||
70 | |||
4475 | leency | 71 | |
5747 | leency | 72 | { |
5766 | leency | 73 | int start_x, start_y, line_length, stolbec_len, body_magrin=5; |
4411 | leency | 74 | |
5766 | leency | 75 | if (!header) |
4411 | leency | 76 | |
77 | ChangeCharset("UTF-8", "CP866", #line); |
||
78 | strcpy(#header, #line); |
||
5718 | leency | 79 | strcat(#header, " -"); |
4411 | leency | 80 | strcat(#header, #version); |
81 | line = 0; |
||
82 | return; |
||
83 | } |
||
84 | if (t_html) && (!t_body) return; |
||
85 | |||
4637 | leency | 86 | if (line) && (!anchor) |
4411 | leency | 87 | |
5766 | leency | 88 | start_x = stolbec * list.font_w + body_magrin * DrawBuf.zoom + list.x; |
4411 | leency | 89 | start_y = stroka * list.item_h + body_magrin; |
5766 | leency | 90 | stolbec_len = utf8_strlen(#line) * DrawBuf.zoom; |
5825 | leency | 91 | line_length = stolbec_len * list.font_w; |
5768 | leency | 92 | |
93 | if (style.h) stroka++; |
||
4411 | leency | 94 | |
5768 | leency | 95 | if (style.b) WriteBufText(start_x+1, start_y, list.font_type, text_colors[text_color_index], #line, buf_data); |
5766 | leency | 96 | if (style.i) { stolbec++; DrawBuf.Skew(start_x, start_y, line_length, list.item_h); } // bug with zoom>1 |
97 | if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]); |
||
5825 | leency | 98 | if (style.u) DrawBuf.DrawBar(start_x, list.item_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]); |
99 | if (link) { |
||
100 | DrawBuf.DrawBar(start_x, list.item_h*style.h + list.item_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]); |
||
5519 | leency | 101 | PageLinks.AddText(#line, line_length, list.item_h*style.h + list.item_h, UNDERLINE); |
5825 | leency | 102 | } |
103 | stolbec += stolbec_len; |
||
4411 | leency | 104 | } |
4718 | leency | 105 | } |
4411 | leency | 106 | //============================================================================================ |
107 | void TWebBrowser::LoadInternalPage(dword bufpos, in_filesize){ |
||
5747 | leency | 108 | bufsize = in_filesize; |
109 | bufpointer = bufpos; |
||
110 | Prepare(); |
||
111 | } |
||
5766 | leency | 112 | //============================================================================================ |
5747 | leency | 113 | void TWebBrowser::Prepare(){ |
114 | word bukva[2]; |
||
5766 | leency | 115 | int j; |
4411 | leency | 116 | byte ignor_param; |
4718 | leency | 117 | dword bufpos; |
4411 | leency | 118 | int line_len; |
5773 | leency | 119 | style.b = style.i = style.u = style.s = style.h = style.blq = t_html = t_body = |
120 | style.li = link = ignor_text = text_color_index = text_colors[0] = style.li_tab = 0; |
||
5768 | leency | 121 | style.align = ALIGN_LEFT; |
5749 | leency | 122 | link_color_inactive = 0x0000FF; |
5746 | leency | 123 | link_color_active = 0xFF0000; |
4491 | leency | 124 | bg_color = 0xFFFFFF; |
125 | DrawBuf.Fill(bg_color); |
||
4411 | leency | 126 | PageLinks.Clear(); |
4475 | leency | 127 | strcpy(#header, #version); |
4504 | leency | 128 | stroka = -list.first; |
4411 | leency | 129 | stolbec = 0; |
4415 | leency | 130 | line = 0; |
4411 | leency | 131 | //for plaint text use CP866 for other UTF |
132 | if (strstri(bufpointer, "html")) |
||
5749 | leency | 133 | { |
134 | style.pre = 0; |
||
135 | cur_encoding = CH_UTF8; |
||
136 | } |
||
5773 | leency | 137 | else |
5749 | leency | 138 | { |
139 | style.pre = 1; |
||
140 | cur_encoding = CH_CP866; |
||
141 | } |
||
5773 | leency | 142 | for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;) |
5749 | leency | 143 | { |
5773 | leency | 144 | if (ignor_text) && (ESBYTE[bufpos]!='<') continue; |
4411 | leency | 145 | bukva = ESBYTE[bufpos]; |
5773 | leency | 146 | switch (bukva) |
4508 | leency | 147 | { |
4411 | leency | 148 | case 0x0a: |
149 | if (style.pre) |
||
150 | { |
||
5746 | leency | 151 | DrawStyle(); |
4411 | leency | 152 | NewLine(); |
5781 | leency | 153 | break; |
154 | } |
||
4726 | leency | 155 | case '\9': |
4411 | leency | 156 | if (style.pre) //иначе идём на 0x0d |
157 | { |
||
5746 | leency | 158 | tab_len = strlen(#line) % 4; |
4411 | leency | 159 | if (!tab_len) tab_len = 4; |
4725 | leency | 160 | for (j=0; j |
161 | break; |
||
4411 | leency | 162 | } |
163 | goto DEFAULT_MARK; |
||
164 | case '&': // and so on |
||
165 | bufpos++; |
||
166 | tag=0; |
||
4508 | leency | 167 | for (j=0; (ESBYTE[bufpos]<>';') && (j<7); j++, bufpos++;) |
4411 | leency | 168 | { |
4508 | leency | 169 | bukva = ESBYTE[bufpos]; |
4411 | leency | 170 | chrcat(#tag, bukva); |
4508 | leency | 171 | } |
4411 | leency | 172 | if (bukva = GetUnicodeSymbol()) goto DEFAULT_MARK; |
173 | break; |
||
4417 | leency | 174 | case '<': |
4411 | leency | 175 | bufpos++; |
176 | if (!strncmp(bufpos,"!--",3)) |
||
5749 | leency | 177 | { |
5768 | leency | 178 | if (!strncmp(bufpos,"-->",3)) || (bufpointer + bufsize <= bufpos) break; |
4411 | leency | 179 | bufpos++; |
5768 | leency | 180 | } |
4508 | leency | 181 | tag = attr = tagparam = ignor_param = NULL; |
4411 | leency | 182 | while (ESBYTE[bufpos] !='>') && (bufpos < bufpointer + bufsize) //получаем тег и его параметры |
5768 | leency | 183 | { |
4550 | leency | 184 | bukva = ESBYTE[bufpos]; |
4411 | leency | 185 | if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' '; |
4508 | leency | 186 | if (!ignor_param) && (bukva <>' ') |
4411 | leency | 187 | { |
188 | if (strlen(#tag) |
||
189 | } |
||
4726 | leency | 190 | else |
4411 | leency | 191 | { |
192 | ignor_param = true; |
||
193 | if (!ignor_text) && (strlen(#tagparam)+1 |
||
194 | } |
||
195 | bufpos++; |
||
196 | } |
||
4508 | leency | 197 | strlwr(#tag); |
4411 | leency | 198 | |
199 | if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/ |
||
200 | |||
201 | |||
4726 | leency | 202 | Perenos(); |
4411 | leency | 203 | |
5768 | leency | 204 | line = NULL; |
5766 | leency | 205 | if (tag) SetStyle(); //обработка тегов |
4677 | leency | 206 | strcpy(#oldtag, #tag); |
5773 | leency | 207 | tag = attr = tagparam = ignor_param = NULL; |
5768 | leency | 208 | break; |
5746 | leency | 209 | default: |
4411 | leency | 210 | DEFAULT_MARK: |
211 | if (bukva<=15) bukva=' '; |
||
212 | line_len = utf8_strlen(#line); |
||
213 | if (!style.pre) && (bukva == ' ') |
||
5712 | leency | 214 | { |
5746 | leency | 215 | if (line[line_len-1]==' ') break; //no double spaces |
4411 | leency | 216 | if (!stolbec) && (!line) break; //no paces at the beginning of the line |
4726 | leency | 217 | } |
218 | if (line_len < sizeof(line)) chrcat(#line, bukva); |
||
4411 | leency | 219 | Perenos(); |
4726 | leency | 220 | } |
5768 | leency | 221 | } |
4411 | leency | 222 | DrawStyle(); |
223 | NewLine(); |
||
5766 | leency | 224 | DrawPage(); |
225 | if (list.first == 0) list.count = stroka; |
||
4692 | leency | 226 | if (anchor) //если посреди текста появится новый якорь - будет бесконечный цикл |
4415 | leency | 227 | { |
4411 | leency | 228 | anchor=NULL; |
229 | list.first=anchor_line_num; |
||
230 | Prepare(); |
||
4415 | leency | 231 | } |
5766 | leency | 232 | } |
4411 | leency | 233 | //============================================================================================ |
234 | void TWebBrowser::Perenos() |
||
5747 | leency | 235 | { |
4718 | leency | 236 | int perenos_num; |
237 | char new_line_text[4096]; |
||
238 | if (utf8_strlen(#line)*DrawBuf.zoom + stolbec < list.column_max) return; |
||
239 | perenos_num = strrchr(#line, ' '); |
||
5773 | leency | 240 | if (!perenos_num) && (utf8_strlen(#line)*DrawBuf.zoom>list.column_max) perenos_num=list.column_max/DrawBuf.zoom; |
4718 | leency | 241 | strcpy(#new_line_text, #line + perenos_num); |
5773 | leency | 242 | line[perenos_num] = 0x00; |
4718 | leency | 243 | DrawStyle(); |
244 | strcpy(#line, #new_line_text); |
||
5766 | leency | 245 | NewLine(); |
4718 | leency | 246 | } |
247 | //============================================================================================ |
||
248 | void TWebBrowser::SetStyle() { |
||
5747 | leency | 249 | int left1 = 5 + list.x; |
5773 | leency | 250 | int top1 = stroka * list.item_h + list.y + 5; |
251 | byte opened; |
||
5825 | leency | 252 | byte meta_encoding; |
4491 | leency | 253 | //проверяем тег открывается или закрывается |
4636 | leency | 254 | if (tag[0] == '/') |
4411 | leency | 255 | { |
256 | opened = 0; |
||
257 | strcpy(#tag, #tag+1); |
||
4491 | leency | 258 | } |
4411 | leency | 259 | else opened = 1; |
260 | if (istag("html")) { |
||
4491 | leency | 261 | t_html = opened; |
5749 | leency | 262 | return; |
4637 | leency | 263 | } |
4411 | leency | 264 | if (istag("script")) || (istag("style")) || (istag("binary")) || (istag("select")) { ignor_text = opened; return; } |
265 | if (istag("form")) if (!opened) ignor_text = false; |
||
5749 | leency | 266 | if(istag("title")) { |
5746 | leency | 267 | if (opened) header=NULL; |
5749 | leency | 268 | else if (!stroka) DrawTitle(#header); //тег закрылся - вывели строку |
4491 | leency | 269 | return; |
4411 | leency | 270 | } |
271 | if (ignor_text) return; |
||
272 | |||
273 | IF(istag("q")) |
||
274 | |||
5746 | leency | 275 | if (opened) strcat(#line, " \""); |
4491 | leency | 276 | if (!opened) strcat(#line, "\" "); |
5746 | leency | 277 | return; |
278 | } |
||
5749 | leency | 279 | if (anchor) && (isattr("id=")) { //очень плохо!!! потому что если не последний тег, работать не будет |
4491 | leency | 280 | if (!strcmp(#anchor, #val)) anchor_line_num=list.first+stroka; |
5749 | leency | 281 | } |
5746 | leency | 282 | if (istag("body")) { |
5749 | leency | 283 | t_body = opened; |
284 | do{ |
||
4637 | leency | 285 | if (isattr("link=")) link_color_inactive = GetColor(#val); |
4411 | leency | 286 | if (isattr("alink=")) link_color_active = GetColor(#val); |
5746 | leency | 287 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
288 | if (isattr("bgcolor=")) |
||
289 | { |
||
290 | bg_color=GetColor(#val); |
||
4411 | leency | 291 | DrawBuf.Fill(bg_color); |
5746 | leency | 292 | } |
4475 | leency | 293 | } while(GetNextParam()); |
4411 | leency | 294 | if (opened) && (cur_encoding==CH_NULL) debugln("Document has no information about encoding, UTF will be used"); |
295 | return; |
||
5749 | leency | 296 | } |
4411 | leency | 297 | if (istag("a")) { |
298 | if (opened) |
||
5749 | leency | 299 | { |
4491 | leency | 300 | if (link) IF(text_color_index > 0) text_color_index--; //если предыдущий тег а не был закрыт |
4411 | leency | 301 | do{ |
302 | if (isattr("href=")) |
||
303 | { |
||
5746 | leency | 304 | text_color_index++; |
4411 | leency | 305 | text_colors[text_color_index] = text_colors[text_color_index-1]; |
306 | link = 1; |
||
307 | text_colors[text_color_index] = link_color_inactive; |
||
308 | PageLinks.AddLink(#val, DrawBuf.zoom * stolbec * list.font_w + left1, top1-DrawBuf.zoom); |
||
4491 | leency | 309 | } |
5746 | leency | 310 | if (anchor) && (isattr("name=")) |
4411 | leency | 311 | { |
5746 | leency | 312 | if (!strcmp(#anchor, #val)) |
4411 | leency | 313 | { |
5746 | leency | 314 | anchor_line_num=list.first+stroka; |
4411 | leency | 315 | } |
4415 | leency | 316 | } |
4411 | leency | 317 | } while(GetNextParam()); |
318 | } |
||
319 | else { |
||
320 | link = 0; |
||
321 | IF(text_color_index > 0) text_color_index--; |
||
322 | } |
||
323 | return; |
||
324 | } |
||
325 | if (istag("font")) { |
||
326 | if (opened) |
||
5749 | leency | 327 | { |
4491 | leency | 328 | text_color_index++; |
4411 | leency | 329 | text_colors[text_color_index] = text_colors[text_color_index-1]; |
330 | do{ |
||
331 | if (isattr("color=")) text_colors[text_color_index] = GetColor(#val); |
||
332 | } while(GetNextParam()); |
||
5749 | leency | 333 | } |
4411 | leency | 334 | else if (text_color_index > 0) text_color_index--; |
335 | return; |
||
5749 | leency | 336 | } |
4411 | leency | 337 | if (istag("div")) || (istag("header")) || (istag("article")) || (istag("footer")) { |
338 | IF(oldtag[0] != 'h') NewLine(); |
||
5746 | leency | 339 | if (isattr("bgcolor=")) |
5749 | leency | 340 | { |
5746 | leency | 341 | bg_color=GetColor(#val); |
5493 | leency | 342 | DrawBuf.Fill(bg_color); |
5746 | leency | 343 | } |
5493 | leency | 344 | return; |
345 | } |
||
4411 | leency | 346 | if (istag("p")) { |
347 | IF(oldtag[0] == 'h') return; |
||
5746 | leency | 348 | NewLine(); |
4411 | leency | 349 | IF(opened) NewLine(); |
4692 | leency | 350 | return; |
351 | } |
||
4411 | leency | 352 | if (istag("br")) { NewLine(); return; } |
353 | if (istag("tr")) { if (opened) { NewLine(); strcat(#line, "| "); } return; } |
||
5749 | leency | 354 | if (istag("td")) || (istag("th")) { if (!opened) strcat(#line, " | "); return; } |
355 | if (istag("b")) || (istag("strong")) || (istag("big")) { style.b = opened; return; } |
||
356 | if (istag("i")) || (istag("em")) || (istag("subtitle")) { style.i=opened; return; } |
||
357 | if (istag("u")) || (istag("ins")) { style.u=opened; return;} |
||
358 | if (istag("s")) || (istag("strike")) || (istag("del")) { style.s=opened; return; } |
||
359 | if (istag("dd")) { stolbec += 5; return; } |
||
360 | if (istag("blockquote")) { style.blq = opened; return; } |
||
361 | if (istag("pre")) || (istag("code")) { style.pre = opened; return; } |
||
362 | if (istag("img")) { ImgCache.Images( left1, top1, WB1.list.w); return; } |
||
363 | if (istag("h1")) || (istag("h2")) || (istag("h3")) || (istag("h4")) || (istag("caption")) { |
||
364 | style.h = opened; |
||
365 | NewLine(); |
||
5768 | leency | 366 | if (opened) |
4692 | leency | 367 | { |
4491 | leency | 368 | WB1.DrawBuf.zoom=2; |
4411 | leency | 369 | WB1.list.font_type |= 10111001b; |
5768 | leency | 370 | if (isattr("align=")) && (isval("center")) style.align = ALIGN_CENTER; |
5781 | leency | 371 | if (isattr("align=")) && (isval("right")) style.align = ALIGN_RIGHT; |
5746 | leency | 372 | if (stroka>1) NewLine(); |
373 | } |
||
5768 | leency | 374 | else |
4411 | leency | 375 | { |
5768 | leency | 376 | WB1.DrawBuf.zoom=1; |
4411 | leency | 377 | WB1.list.font_type = 10111000b; |
5768 | leency | 378 | style.align = ALIGN_LEFT; |
5781 | leency | 379 | } |
5746 | leency | 380 | return; |
4411 | leency | 381 | } |
382 | if (istag("dt")) { |
||
383 | style.li = opened; |
||
5749 | leency | 384 | if (opened) NewLine(); |
5746 | leency | 385 | return; |
5749 | leency | 386 | } |
4411 | leency | 387 | if (istag("li")) || (istag("dt")) |
388 | { |
||
5773 | leency | 389 | style.li = opened; |
4411 | leency | 390 | if (opened) |
5746 | leency | 391 | { |
4491 | leency | 392 | NewLine(); |
4411 | leency | 393 | DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, stroka +1 * list.item_h - 3 |
4692 | leency | 394 | - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x454545); |
5825 | leency | 395 | } |
5773 | leency | 396 | return; |
4411 | leency | 397 | } |
398 | if (istag("ul")) || (istag("ol")) { |
||
399 | if (!opened) |
||
5749 | leency | 400 | { |
401 | style.li = opened; |
||
402 | style.li_tab--; |
||
403 | NewLine(); |
||
404 | } |
||
405 | else style.li_tab++; |
||
406 | } |
||
407 | if (istag("hr")) { |
||
408 | if (isattr("color=")) EDI = GetColor(#val); else EDI = 0x999999; |
||
409 | $push edi; |
||
5773 | leency | 410 | NewLine(); |
411 | $pop edi; |
||
4692 | leency | 412 | DrawBuf.DrawBar(5, list.item_h*stroka+4, list.w-10, 1, EDI); |
5773 | leency | 413 | NewLine(); |
5825 | leency | 414 | return; |
4692 | leency | 415 | } |
5773 | leency | 416 | if (istag("meta")) || (istag("?xml")) { |
4411 | leency | 417 | do{ |
5749 | leency | 418 | if (isattr("charset=")) || (isattr("content=")) || (isattr("encoding=")) |
4411 | leency | 419 | { |
5746 | leency | 420 | strcpy(#val, #val[strrchr(#val, '=')]); //поиск в content= |
4411 | leency | 421 | strlwr(#val); |
5746 | leency | 422 | if (isval("utf-8")) || (isval("utf8")) meta_encoding = CH_UTF8; |
423 | else if (isval("koi8-r")) || (isval("koi8-u")) meta_encoding = CH_KOI8; |
||
5749 | leency | 424 | else if (isval("windows-1251")) || (isval("windows1251")) meta_encoding = CH_CP1251; |
5746 | leency | 425 | else if (isval("iso-8859-5")) || (isval("iso8859-5")) meta_encoding = CH_ISO8859_5; |
426 | else if (isval("dos")) || (isval("cp-866")) meta_encoding = CH_CP866; |
||
427 | if (cur_encoding!=meta_encoding) BufEncode(meta_encoding); |
||
428 | return; |
||
5749 | leency | 429 | } |
4636 | leency | 430 | } while(GetNextParam()); |
4411 | leency | 431 | return; |
432 | } |
||
433 | } |
||
434 | |||
435 | void TWebBrowser::BufEncode(int set_new_encoding) |
||
436 | |||
5749 | leency | 437 | int bufpointer_realsize; |
5704 | leency | 438 | cur_encoding = set_new_encoding; |
439 | if (o_bufpointer==0) |
||
440 | { |
||
441 | o_bufpointer = malloc(bufsize); |
||
442 | strcpy(o_bufpointer, bufpointer); |
||
443 | } |
||
444 | else |
||
445 | { |
||
446 | strcpy(bufpointer, o_bufpointer); |
||
447 | } |
||
448 | } |
||
449 | //============================================================================================ |
||
450 | void TWebBrowser::DrawScroller() |
||
5747 | leency | 451 | { |
4674 | leency | 452 | scroll_wv.max_area = list.count; |
4411 | leency | 453 | scroll_wv.cur_area = list.visible; |
4416 | leency | 454 | scroll_wv.position = list.first; |
455 | |||
456 | scroll_wv.all_redraw = 0; |
||
4411 | leency | 457 | |
5519 | leency | 458 | scroll_wv.start_y = list.y; |
4486 | leency | 459 | |
4508 | leency | 460 | scroll_wv.size_y = list.h; |
4411 | leency | 461 | |
5678 | leency | 462 | |
463 | scrollbar_v_draw(#scroll_wv); |
||
5519 | leency | 464 | |
4416 | leency | 465 | //============================================================================================ |
4411 | leency | 466 | void TWebBrowser::NewLine() |
5747 | leency | 467 | { |
4692 | leency | 468 | int onleft, ontop; |
4475 | leency | 469 | |
5678 | leency | 470 | onleft = list.x + 5; |
4692 | leency | 471 | |
472 | if (t_html) && (!t_body) return; |
||
5825 | leency | 473 | if (stroka * list.item_h + 5 >= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor) |
4637 | leency | 474 | { |
5825 | leency | 475 | if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
4475 | leency | 476 | if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
5825 | leency | 477 | } |
478 | stroka++; |
||
4475 | leency | 479 | if (style.blq) stolbec = 6; else stolbec = 0; |
480 | if (style.li) stolbec = style.li_tab * 5; |
||
5746 | leency | 481 | } |
482 | //============================================================================================ |
||
4488 | leency | 483 | int istag(dword text) { if (!strcmp(#tag,text)) return 1; else return 0; } |
5747 | leency | 484 | int isattr(dword text) { if (!strcmp(#attr,text)) return 1; else return 0; } |
5746 | leency | 485 | int isval(dword text) { if (!strcmp(#val,text)) return 1; else return 0; } |
486 | //============================================================================================ |
||
487 | void TWebBrowser::DrawPage() |
||
5766 | leency | 488 | { |
489 | PutPaletteImage(list.first * list.item_h * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0); |
||
490 | DrawScroller(); |
||
5825 | leency | 491 | }>>>=15)>>>=>': |
5766 | leency | 492 | >7);>>')>> |
493 |