Subversion Repositories Kolibri OS

Rev

Rev 7756 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7752 leency 1
#include "..\TWB\colors.h"
2
#include "..\TWB\anchors.h"
3
#include "..\TWB\parce_tag.h"
4
#include "..\TWB\absolute_url.h"
5
#include "..\TWB\unicode_tags.h"
7757 leency 6
#include "..\TWB\img_cache.h"
7
dword page_bg;
8
dword link_color_inactive;
9
dword link_color_active;
10
#include "..\TWB\links.h"
4411 leency 11
 
5746 leency 12
enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT};
4416 leency 13
 
5746 leency 14
struct _style {
7752 leency 15
	bool
6794 leency 16
	b, u, s, h,
5746 leency 17
	pre,
18
	blq,
19
	li,
20
	li_tab,
7742 leency 21
	button,
22
	image,
5746 leency 23
	align;
7752 leency 24
	dword bg_color;
5746 leency 25
};
26
 
4411 leency 27
struct TWebBrowser {
4540 leency 28
	llist list;
5746 leency 29
	_style style;
4475 leency 30
	DrawBufer DrawBuf;
7752 leency 31
	dword draw_y, stolbec;
6803 leency 32
	int zoom;
7752 leency 33
	dword o_bufpointer;
7746 leency 34
	void SetPageDefaults();
7752 leency 35
	void AddCharToTheLine();
36
	void ParseHtml();
5766 leency 37
	void SetStyle();
38
	void DrawStyle();
4411 leency 39
	void DrawPage();
40
	void DrawScroller();
4650 leency 41
	void NewLine();
7750 leency 42
	bool CheckForLineBreak();
5749 leency 43
	void BufEncode();
4686 leency 44
} WB1;
4486 leency 45
 
7757 leency 46
char line[500];
7756 leency 47
 
48
bool link, cur_encoding, t_html, t_body;
5746 leency 49
 
7752 leency 50
 
5781 leency 51
dword bufpointer=0;
52
dword bufsize=0;
4411 leency 53
 
7756 leency 54
char header[150];
55
 
7752 leency 56
int body_magrin=6;
6794 leency 57
int basic_line_h=22;
58
 
7757 leency 59
scroll_bar scroll_wv = { 15,NULL,NULL,NULL,0,2,NULL,0,0,0xeeeeee,0xBBBbbb,0xeeeeee};
4411 leency 60
 
5747 leency 61
//============================================================================================
5766 leency 62
void TWebBrowser::DrawStyle()
4411 leency 63
{
6803 leency 64
	dword start_x, line_length, stolbec_len;
4411 leency 65
 
66
	if (!header)
67
	{
7752 leency 68
		strncpy(#header, #line, sizeof(header)-1);
4411 leency 69
		line = 0;
70
		return;
71
	}
4637 leency 72
	if (t_html) && (!t_body) return;
4411 leency 73
 
6803 leency 74
	if (line)
4411 leency 75
	{
6794 leency 76
		start_x = stolbec * list.font_w + body_magrin + list.x;
6803 leency 77
		stolbec_len = strlen(#line) * zoom;
5768 leency 78
		line_length = stolbec_len * list.font_w;
4411 leency 79
 
7749 leency 80
		if (debug_mode) {
7750 leency 81
			DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h, 0xDDDddd);
7749 leency 82
		}
83
 
7743 leency 84
		if (style.bg_color!=page_bg) {
7750 leency 85
			DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h, style.bg_color);
7743 leency 86
		}
87
 
7742 leency 88
		if (style.image) {
7743 leency 89
			DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, 0xF9DBCB);
7742 leency 90
		}
91
		if (style.button) {
92
			DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h - calc(zoom*2), 0xCCCccc);
93
			DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2), line_length, zoom, 0x999999);
94
		}
95
 
7738 leency 96
		DrawBuf.WriteText(start_x, draw_y, list.font_type, text_colors[text_color_index], #line);
97
		if (style.b) DrawBuf.WriteText(start_x+1, draw_y, list.font_type, text_colors[text_color_index], #line);
6803 leency 98
		if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - zoom + draw_y, line_length, zoom, text_colors[text_color_index]);
99
		if (style.u) DrawBuf.DrawBar(start_x, list.item_h - zoom - zoom + draw_y, line_length, zoom, text_colors[text_color_index]);
5519 leency 100
		if (link) {
7747 leency 101
			if (line[0]==' ') && (line[1]==NULL) {} else {
7750 leency 102
				DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2), line_length, zoom, link_color_inactive);
7746 leency 103
				PageLinks.AddText(start_x, draw_y + list.y, line_length, list.item_h - calc(zoom*2), UNDERLINE, zoom);
104
			}
4411 leency 105
		}
4718 leency 106
		stolbec += stolbec_len;
7750 leency 107
		if (debug_mode) debug(#line);
108
		line = NULL;
4411 leency 109
	}
110
}
5747 leency 111
//============================================================================================
7746 leency 112
void TWebBrowser::SetPageDefaults()
113
{
114
	style.b = style.u = style.s = style.h = style.blq = t_html = t_body = style.pre =
115
	style.li = link = text_color_index = text_colors[0] = style.li_tab = false;
5746 leency 116
	style.align = ALIGN_LEFT;
4491 leency 117
	link_color_inactive = 0x0000FF;
118
	link_color_active = 0xFF0000;
7743 leency 119
	page_bg = 0xFFFFFF;
120
	style.bg_color = page_bg;
121
	DrawBuf.Fill(0, page_bg);
4504 leency 122
	PageLinks.Clear();
7752 leency 123
	anchors.clear();
124
	strncpy(#header, #version, sizeof(header)-1);
7746 leency 125
	cur_encoding = CH_NULL;
6794 leency 126
	draw_y = body_magrin;
4411 leency 127
	stolbec = 0;
128
	line = 0;
7752 leency 129
	zoom = 1;
7757 leency 130
	//hold original buffer
131
	if (o_bufpointer) o_bufpointer=free(o_bufpointer);
132
	o_bufpointer = malloc(bufsize);
133
	memmov(o_bufpointer, bufpointer, bufsize);
7746 leency 134
}
135
//============================================================================================
7752 leency 136
void TWebBrowser::AddCharToTheLine(unsigned char _char)
137
{
138
	dword line_len;
139
	if (_char<=15) _char=' ';
140
	line_len = strlen(#line);
141
	if (!style.pre) && (_char == ' ')
142
	{
143
		if (line[line_len-1]==' ') return; //no double spaces
144
		if (!stolbec) && (!line) return; //no paces at the beginning of the line
145
	}
146
	if (line_len < sizeof(line)) chrcat(#line, _char);
147
	CheckForLineBreak();
148
}
149
//============================================================================================
150
void TWebBrowser::ParseHtml(){
7746 leency 151
	word bukva[2];
7752 leency 152
	char unicode_symbol[10];
153
	dword unicode_symbol_result;
7746 leency 154
	dword j;
7752 leency 155
	bool ignor_param=false;
156
	int tab_len;
7746 leency 157
	dword bufpos;
158
	SetPageDefaults();
7749 leency 159
	if (strstri(bufpointer, "
160
		t_body = true;
161
		if (strstri(bufpointer, "
162
	}
5773 leency 163
	for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
4411 leency 164
	{
4508 leency 165
		bukva = ESBYTE[bufpos];
4411 leency 166
		switch (bukva)
167
		{
168
		case 0x0a:
7752 leency 169
			if (style.pre) {
5781 leency 170
				DrawStyle();
171
				NewLine();
7752 leency 172
			} else {
173
				AddCharToTheLine(0x0a);
4411 leency 174
			}
7752 leency 175
			break;
176
		case 0x09:
177
			if (style.pre) {
178
				tab_len = strlen(#line) + stolbec % 4;
179
				if (!tab_len) tab_len = 4; else tab_len = 4 - tab_len;
4411 leency 180
				for (j=0; j
7752 leency 181
			} else {
182
				AddCharToTheLine(0x09);
4411 leency 183
			}
7752 leency 184
			break;
4411 leency 185
		case '&': //  and so on
7752 leency 186
			for (j=1, unicode_symbol=0; (ESBYTE[bufpos+j]<>';') && (j<8); j++)
4411 leency 187
			{
7749 leency 188
				bukva = ESBYTE[bufpos+j];
7752 leency 189
				chrcat(#unicode_symbol, bukva);
4411 leency 190
			}
7757 leency 191
			if (GetUnicodeSymbol(#line, #unicode_symbol, sizeof(line)-1)) {
7749 leency 192
				bufpos += j;
7750 leency 193
				CheckForLineBreak();
7749 leency 194
			} else {
7752 leency 195
				AddCharToTheLine('&');
7749 leency 196
			}
4411 leency 197
			break;
198
		case '<':
5749 leency 199
			bufpos++;
5768 leency 200
			if (!strncmp(bufpos,"!--",3))
4411 leency 201
			{
6986 leency 202
				bufpos+=3;
203
				while (strncmp(bufpos,"-->",3)!=0) && (bufpos < bufpointer + bufsize)
204
				{
205
					bufpos++;
206
				}
7746 leency 207
				bufpos+=2;
6986 leency 208
				break;
4411 leency 209
			}
7752 leency 210
			tag.reset();
211
			if (ESBYTE[bufpos] == '/') {
212
				tag.opened = false;
213
				bufpos++;
214
			}
215
 
216
			ignor_param=false;
6735 leency 217
			while (ESBYTE[bufpos] !='>') && (bufpos < bufpointer + bufsize) //ïîëó÷àåì òåã è åãî ïàðàìåòðû
4411 leency 218
			{
4508 leency 219
				bukva = ESBYTE[bufpos];
4411 leency 220
				if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
221
				if (!ignor_param) && (bukva <>' ')
222
				{
7752 leency 223
					if (strlen(#tag.name)+1
4411 leency 224
				}
225
				else
226
				{
227
					ignor_param = true;
7752 leency 228
					if (strlen(#tag.params)+1
229
					//	chrncat(#tag.params, bukva, sizeof(tag.params)-1);
4411 leency 230
				}
4508 leency 231
				bufpos++;
4411 leency 232
			}
7752 leency 233
			strlwr(#tag.name);
4411 leency 234
 
7746 leency 235
			// ignore text inside the next tags
7752 leency 236
			if (tag.is("script")) || (tag.is("style")) || (tag.is("binary")) || (tag.is("select"))  {
237
				sprintf(#tag.params, "", #tag.name);
238
				j = strstri(bufpos, #tag.params);
239
				if (j!=-1) bufpos = j-1;
7746 leency 240
				break;
241
			}
242
 
7752 leency 243
			if (tag.name[strlen(#tag.name)-1]=='/') tag.name[strlen(#tag.name)-1]=NULL; //for br/ !!!!!!!!
244
			if (tag.params) tag.parse_params();
7746 leency 245
 
7757 leency 246
			if (tag.name) {
7750 leency 247
				CheckForLineBreak();
7746 leency 248
				DrawStyle();
7752 leency 249
				if (tag.name) SetStyle();
7746 leency 250
			}
4411 leency 251
			break;
252
		default:
7752 leency 253
			AddCharToTheLine(ESBYTE[bufpos]);
4411 leency 254
		}
255
	}
5766 leency 256
	DrawStyle();
257
	NewLine();
7752 leency 258
	list.count = draw_y;
7755 leency 259
	list.CheckDoesValuesOkey();
260
	anchors.current = NULL;
4411 leency 261
}
5747 leency 262
//============================================================================================
7750 leency 263
bool TWebBrowser::CheckForLineBreak()
4718 leency 264
{
7750 leency 265
	int line_break_pos;
4718 leency 266
	char new_line_text[4096];
7750 leency 267
	if (strlen(#line)*zoom + stolbec < list.column_max) return false;
268
	line_break_pos = strrchr(#line, ' ');
269
	if (line_break_pos*zoom + stolbec > list.column_max) {
270
		line_break_pos = list.column_max/zoom - stolbec;
271
		while(line_break_pos) && (line[line_break_pos]!=' ') line_break_pos--;
272
	}
273
	if (!line_break_pos) && (strlen(#line)*zoom>list.column_max) {
274
		line_break_pos=list.column_max/zoom;
7742 leency 275
		if (!stolbec)&&(style.pre) draw_y-=list.item_h; //hack to fix https://prnt.sc/rk3kyt
276
	}
7750 leency 277
	strcpy(#new_line_text, #line + line_break_pos);
278
	line[line_break_pos] = 0x00;
5766 leency 279
	DrawStyle();
4718 leency 280
	strcpy(#line, #new_line_text);
281
	NewLine();
7750 leency 282
	//if (strlen(#line)*zoom + stolbec > list.column_max)CheckForLineBreak();
283
	return true;
4718 leency 284
}
5747 leency 285
//============================================================================================
5773 leency 286
void TWebBrowser::SetStyle() {
7749 leency 287
	char img_path[4096]=0;
7742 leency 288
	int meta_encoding;
7752 leency 289
 
290
	dword value;
291
 
7755 leency 292
	if (value = tag.get_value_of("name=")) || (value = tag.get_value_of("id=")) {
293
		anchors.add(value, draw_y);
294
		if (anchors.current) && (streq(value, #anchors.current+1)) {
295
			list.first = draw_y;
296
			anchors.current = NULL;
297
		}
298
	}
299
 
7752 leency 300
	if (tag.is("html")) {
301
		t_html = tag.opened;
4411 leency 302
		return;
303
	}
7757 leency 304
	if (tag.is("title")) {
7752 leency 305
		if (tag.opened) header=NULL;
4411 leency 306
		return;
307
	}
308
 
7757 leency 309
	if (tag.is("q"))
4491 leency 310
	{
7752 leency 311
		if (tag.opened)	{
7750 leency 312
			meta_encoding = strlen(#line);
313
			if (line[meta_encoding-1] != ' ') chrcat(#line, ' ');
314
			chrcat(#line, '\"');
315
		}
7752 leency 316
		if (!tag.opened) strcat(#line, "\" ");
5749 leency 317
		return;
4491 leency 318
	}
7752 leency 319
	if (tag.is("body")) {
320
		t_body = tag.opened;
321
		if (value = tag.get_value_of("link="))  link_color_inactive = GetColor(value);
322
		if (value = tag.get_value_of("alink=")) link_color_active = GetColor(value);
323
		if (value = tag.get_value_of("text="))  text_colors[0]=GetColor(value);
324
		if (value = tag.get_value_of("bgcolor=")) {
325
			style.bg_color = page_bg = GetColor(value);
326
			DrawBuf.Fill(0, page_bg);
327
		}
328
		if (tag.opened) {
329
			if (cur_encoding==CH_NULL) {
330
				cur_encoding = CH_CP866;
331
				//BufEncode(CH_UTF8);
332
				debugln("Document has no information about encoding!");
4411 leency 333
			}
7752 leency 334
			if (!streq(#header, #version)) {
7056 leency 335
				ChangeCharset(charsets[cur_encoding], "CP866", #header);
7752 leency 336
				strncat(#header, " - ", sizeof(header)-1);
337
				strncat(#header, #version, sizeof(header)-1);
7056 leency 338
			}
7032 leency 339
			DrawTitle(#header);
340
		}
4411 leency 341
		return;
342
	}
7752 leency 343
	if (tag.is("a")) {
344
		if (tag.opened)
4411 leency 345
		{
6735 leency 346
			if (link) IF(text_color_index > 0) text_color_index--; //åñëè ïðåäûäóùèé òåã à íå áûë çàêðûò
7752 leency 347
			if (value = tag.get_value_of("href=")) && (!strstr(value,"javascript:"))
348
			{
349
				text_color_index++;
350
				text_colors[text_color_index] = text_colors[text_color_index-1];
351
				link = 1;
352
				text_colors[text_color_index] = link_color_inactive;
353
				PageLinks.AddLink(value);
354
			}
355
		} else {
4411 leency 356
			link = 0;
357
			IF(text_color_index > 0) text_color_index--;
358
		}
359
		return;
360
	}
7752 leency 361
	if (tag.is("font")) {
7743 leency 362
		style.bg_color = page_bg;
7752 leency 363
		if (tag.opened)
4411 leency 364
		{
365
			text_color_index++;
366
			text_colors[text_color_index] = text_colors[text_color_index-1];
7752 leency 367
			if (value = tag.get_value_of("color=")) text_colors[text_color_index] = GetColor(value);
368
			if (value = tag.get_value_of("bg=")) style.bg_color = GetColor(value);
4411 leency 369
		}
5749 leency 370
		else if (text_color_index > 0) text_color_index--;
4411 leency 371
		return;
372
	}
7752 leency 373
	if (tag.is("div")) {
7756 leency 374
		if (streq(#tag.prior,"div")) && (tag.opened) return;
7746 leency 375
		NewLine();
4411 leency 376
		return;
377
	}
7752 leency 378
	if (tag.is("header")) || (tag.is("article")) || (tag.is("footer")) || (tag.is("figure")) {
7746 leency 379
		NewLine();
380
		return;
381
	}
7752 leency 382
	if (tag.is("p")) {
7756 leency 383
		IF (tag.prior[0] == 'h') || (streq(#tag.prior,"td")) || (streq(#tag.prior,"p")) return;
4692 leency 384
		NewLine();
4411 leency 385
		return;
386
	}
7752 leency 387
	if (tag.is("br")) { NewLine(); return; }
7757 leency 388
	if (tag.is("td")) { if (tag.opened) AddCharToTheLine(' '); return; }
7752 leency 389
	if (tag.is("tr")) { if (tag.opened) NewLine(); return; }
390
	if (tag.is("b")) || (tag.is("strong")) || (tag.is("big")) { style.b = tag.opened; return; }
391
	if (tag.is("button")) { style.button = tag.opened; stolbec++; return; }
392
	if (tag.is("u")) || (tag.is("ins")) { style.u=tag.opened; return;}
393
	if (tag.is("s")) || (tag.is("strike")) || (tag.is("del")) { style.s=tag.opened; return; }
394
	if (tag.is("dd")) { stolbec += 5; return; }
395
	if (tag.is("blockquote")) { style.blq = tag.opened; return; }
396
	if (tag.is("pre")) || (tag.is("code")) { style.pre = tag.opened; return; }
397
	if (tag.is("img")) {
398
		if (value = tag.get_value_of("src=")) strlcpy(#img_path, value, sizeof(img_path)-1);
399
		if (value = tag.get_value_of("title=")) && (strlen(value)
400
		if (value = tag.get_value_of("alt=")) && (strlen(value)
7750 leency 401
		if (!img_path) { line=0; return; }
7742 leency 402
		style.image = true;
403
		text_color_index++;
404
		text_colors[text_color_index] = 0x9A6F29;
405
		if (!line) {
406
			if (!strncmp(#img_path, "data:", 5)) img_path=0;
7749 leency 407
			replace_char(#img_path, '?', NULL, strlen(#img_path));
7742 leency 408
			sprintf(#line, "[%s]", #img_path+strrchr(#img_path, '/'));
409
			line[50]= NULL;
410
		}
7750 leency 411
		while (CheckForLineBreak()) {};
7742 leency 412
		DrawStyle();
413
		text_color_index--;
414
		style.image = false;
7752 leency 415
		//ImgCache.Images( list.x, draw_y, WB1.list.w);
7742 leency 416
		return;
417
	}
7752 leency 418
	if (tag.is("h1")) || (tag.is("h2")) || (tag.is("h3")) || (tag.is("caption")) {
419
		style.h = tag.opened;
420
		if (tag.opened)
4411 leency 421
		{
6794 leency 422
			NewLine();
423
			draw_y += 10;
6803 leency 424
			WB1.zoom=2;
6045 leency 425
			WB1.list.font_type |= 10011001b;
7752 leency 426
			if (value = tag.get_value_of("align=")) {
427
				if (streq(value, "center")) style.align = ALIGN_CENTER;
428
				if (streq(value, "right")) style.align = ALIGN_RIGHT;
429
			}
6794 leency 430
			list.item_h = basic_line_h * 2;
7752 leency 431
			if (tag.is("h1")) style.b = true;
4411 leency 432
		}
5768 leency 433
		else
4411 leency 434
		{
7752 leency 435
			if (tag.is("h1")) style.b = false;
6794 leency 436
			NewLine();
6803 leency 437
			WB1.zoom=1;
6045 leency 438
			WB1.list.font_type = 10011000b;
5746 leency 439
			style.align = ALIGN_LEFT;
6794 leency 440
			list.item_h = basic_line_h;
4411 leency 441
		}
442
		return;
443
	}
7752 leency 444
	if (tag.is("dt")) {
445
		style.li = tag.opened;
446
		if (tag.opened) NewLine();
4411 leency 447
		return;
448
	}
7752 leency 449
	if (tag.is("li")) || (tag.is("dt"))
4411 leency 450
	{
7752 leency 451
		style.li = tag.opened;
452
		if (tag.opened)
4411 leency 453
		{
4692 leency 454
			NewLine();
7743 leency 455
			stolbec = style.li_tab * 5 - 2;
7742 leency 456
			strcpy(#line, "\31 ");
7743 leency 457
			//stolbec-=2;
4411 leency 458
		}
459
		return;
460
	}
7752 leency 461
	if (tag.is("ul")) || (tag.is("ol")) {
462
		if (!tag.opened)
5749 leency 463
		{
7757 leency 464
			style.li = false;
5749 leency 465
			style.li_tab--;
466
			NewLine();
467
		}
468
		else style.li_tab++;
469
	}
7752 leency 470
	if (tag.is("hr")) {
471
		if (value = tag.get_value_of("color=")) EDI = GetColor(value); else EDI = 0x999999;
5773 leency 472
		$push edi;
4692 leency 473
		NewLine();
5773 leency 474
		$pop edi;
7746 leency 475
		draw_y += 10;
6794 leency 476
		DrawBuf.DrawBar(5, draw_y - 1, list.w-10, 1, EDI);
4692 leency 477
		NewLine();
7746 leency 478
		draw_y += 10;
5773 leency 479
		return;
4411 leency 480
	}
7752 leency 481
	if (tag.is("meta")) || (tag.is("?xml")) {
6045 leency 482
		meta_encoding = CH_NULL;
7752 leency 483
		if (value = tag.get_value_of("charset=")) || (value = tag.get_value_of("content=")) || (value = tag.get_value_of("encoding="))
484
		{
485
			value += strrchr(value, '='); //search in content=
486
			strlwr(value);
487
			if      (streq(value,"utf-8"))        || (streq(value,"utf8"))        meta_encoding = CH_UTF8;
488
			else if (streq(value,"windows-1251")) || (streq(value,"windows1251")) meta_encoding = CH_CP1251;
489
			else if (streq(value,"dos"))          || (streq(value,"cp-866"))      meta_encoding = CH_CP866;
490
			else if (streq(value,"iso-8859-5"))   || (streq(value,"iso8859-5"))   meta_encoding = CH_ISO8859_5;
491
			else if (streq(value,"koi8-r"))       || (streq(value,"koi8-u"))      meta_encoding = CH_KOI8;
492
		}
6045 leency 493
		if (meta_encoding!=CH_NULL) BufEncode(meta_encoding);
4411 leency 494
		return;
495
	}
496
}
7746 leency 497
//============================================================================================
6803 leency 498
void TWebBrowser::BufEncode(dword set_new_encoding)
5704 leency 499
{
7757 leency 500
	if (cur_encoding != set_new_encoding) {
501
		cur_encoding = set_new_encoding;
502
		bufpointer = ChangeCharset(charsets[cur_encoding], "CP866", bufpointer);
5704 leency 503
	}
504
}
5747 leency 505
//============================================================================================
4674 leency 506
void TWebBrowser::DrawScroller()
4411 leency 507
{
4416 leency 508
	scroll_wv.max_area = list.count;
509
	scroll_wv.cur_area = list.visible;
510
	scroll_wv.position = list.first;
5519 leency 511
	scroll_wv.all_redraw = 0;
4486 leency 512
	scroll_wv.start_x = list.x + list.w;
4508 leency 513
	scroll_wv.start_y = list.y;
5678 leency 514
	scroll_wv.size_y = list.h;
4416 leency 515
	scrollbar_v_draw(#scroll_wv);
4411 leency 516
}
5747 leency 517
//============================================================================================
4692 leency 518
void TWebBrowser::NewLine()
4475 leency 519
{
6803 leency 520
	dword onleft, ontop;
7742 leency 521
	static int empty_line=0;
4692 leency 522
 
6794 leency 523
	if (!stolbec) && (draw_y==body_magrin) return;
7742 leency 524
 
7749 leency 525
	if (style.li) && (stolbec == style.li_tab * 5) {
7742 leency 526
		if (empty_line<1) empty_line++;
527
		else return;
7749 leency 528
	} else if (!stolbec) {
529
		if (empty_line<1) empty_line++;
530
		else return;
7742 leency 531
	} else {
532
		empty_line=0;
533
	}
6794 leency 534
 
535
	onleft = list.x + body_magrin;
536
	ontop = draw_y + list.y;
4637 leency 537
	if (t_html) && (!t_body) return;
6794 leency 538
	draw_y += list.item_h;
5746 leency 539
	if (style.blq) stolbec = 6; else stolbec = 0;
540
	if (style.li) stolbec = style.li_tab * 5;
7750 leency 541
	if (debug_mode) debugln(NULL);
4488 leency 542
}
5747 leency 543
//============================================================================================
5766 leency 544
void TWebBrowser::DrawPage()
545
{
6794 leency 546
	PutPaletteImage(list.first * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0);
5766 leency 547
	DrawScroller();
548
}