Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
3067 leency 1
 
2
3
 
4
	buf,
5
	filesize,
6
	blink;
7
8
 
9
char search_path[]="http://nigma.ru/index.php?s=";
10
11
 
12
 
13
	int left, top, width, height, line_h;
3464 leency 14
	void Scan(int);
3067 leency 15
	void GetNewUrl();
16
	void OpenPage();
17
	void ReadHtml(byte);
18
	void ShowPage();
19
	void ParseHTML(dword);
20
	void WhatTextStyle(int left1, top1, width1);
21
	void DrawPage();
22
	void DrawScroller();
23
};
3466 leency 24
TWebBrowser WB1;
25
3067 leency 26
 
3128 leency 27
	link, ignor_text, li_tab, cur_encoding, text_align;
4190 leency 28
3067 leency 29
 
4190 leency 30
31
 
3067 leency 32
	text_color_index,
33
	link_color,
34
	bg_color;
35
36
 
37
	stolbec,
38
	tab_len,
3466 leency 39
	anchor_line_num;
40
3067 leency 41
 
42
	tag[100],
43
	tagparam[10000],
44
	parametr[1200],
45
	options[4096],
3466 leency 46
	anchor[256];
47
3067 leency 48
 
49
#include "include\colors.h"
50
#include "include\unicode_tags.h"
51
#include "include\img_cache.h"
3466 leency 52
#include "include\some_code.h"
3067 leency 53
#include "include\parce_tag.h"
54
#include "DrawBuf.h"
4074 leency 55
3067 leency 56
 
3466 leency 57
3067 leency 58
 
3466 leency 59
 
60
{
61
	int start_x, start_y, line_length, magrin_left=5;
62
63
 
64
	{
65
		strcpy(#header, #line);
66
		strcat(#header, " -");
67
		strcat(#header, #version);
68
		line = 0;
69
		return;
70
	}
71
72
 
73
	{
74
		start_x = stolbec * 6 + left + magrin_left;
75
		start_y = stroka * 10 + top + magrin_left;
76
		line_length = strlen(#line) * 6;
77
78
 
4026 leency 79
		IF (b_text)	WriteBufText(start_x+1, 0, 0x88, text_colors[text_color_index], #line, drawbuf);
3466 leency 80
		IF (i_text) DrawBufSkew(start_x, 0, line_length, line_h);
81
		IF (s_text) DrawBufBar(start_x, 4, line_length, 1, text_colors[text_color_index]);
82
		IF (u_text) DrawBufBar(start_x, 8, line_length, 1, text_colors[text_color_index]);
83
		IF (link) {
84
			UnsafeDefineButton(start_x-2, start_y, line_length + 3, 9, blink + BT_HIDE, 0xB5BFC9);
85
			DrawBufBar(start_x, 8, line_length, 1, text_colors[text_color_index]);
86
		}
87
		stolbec += strlen(#line);
88
	}
89
}
90
//=======================================================================
91
92
 
3067 leency 93
{
94
	if (id >= 400)
95
	{
96
		GetURLfromPageLinks(id);
97
98
 
99
		if (URL[0] == '#')
100
		{
101
			strcpy(#anchor, #URL+strrchr(#URL, '#'));
102
103
 
104
105
 
106
			ShowPage();
107
			return;
108
		}
109
		//liner.ru#1
110
		if (strrchr(#URL, '#')<>-1)
111
		{
112
			strcpy(#anchor, #URL+strrchr(#URL, '#'));
113
			URL[strrchr(#URL, '#')-1] = 0x00; //заглушка
114
		}
115
116
 
117
118
 
119
		{
120
			//if (strstr(#URL,"http:"))
121
			RunProgram("/sys/media/kiv", #URL);
122
			strcpy(#editURL, BrowserHistory.CurrentUrl());
123
			strcpy(#URL, BrowserHistory.CurrentUrl());
124
			return;
125
		}
126
		if (!strcmpn(#URL,"mailto:", 7))
127
		{
128
			RunProgram("@notify", #URL);
129
			strcpy(#editURL, BrowserHistory.CurrentUrl());
130
			strcpy(#URL, BrowserHistory.CurrentUrl());
131
			return;
132
		}
133
134
 
135
		return;
136
	}
137
138
 
139
	{ CASE 183: CASE 184: CASE 180: CASE 181: return; }
140
141
 
142
	{
143
		case 011: //Ctrk+K
144
			ReadHtml(_KOI);
145
			break;
146
		case 021: //Ctrl+U
147
			ReadHtml(_UTF);
148
			break;
149
		case 004: //Ctrl+D
150
			ReadHtml(_DOS);
151
			break;
152
		case 002: //free img cache
3468 leency 153
			FreeImgCache();
154
			break;
3067 leency 155
		case BACK:
156
			if (!BrowserHistory.GoBack()) return;
157
			OpenPage();
158
			return;
159
		case FORWARD:
160
			if (!BrowserHistory.GoForward()) return;
161
			OpenPage();
162
			return;
163
		case 052:  //F3
3466 leency 164
			if (strcmp(get_URL_part(5),"http:")<>0) RunProgram("/rd/1/tinypad", #URL); else RunProgram("/rd/1/tinypad", #download_path);
3067 leency 165
			return;
166
		case 054: //F5
167
			IF(address_box.flags & 0b10) break;
3466 leency 168
		case REFRESH:
3067 leency 169
			if (GetProcessSlot(downloader_id)<>0)
170
			{
171
				KillProcess(downloader_id);
172
				pause(20);
3078 leency 173
				Draw_Window();
3067 leency 174
				return;
175
			}
176
			anchor_line_num=lines.first; //весёлый костыль :Р
177
			anchor[0]='|';
178
			OpenPage();
179
			return;
180
		case 014: //Ctrl+N новое окно
181
		case 020: //Ctrl+T новая вкладка
182
		case NEWTAB:
183
			MoveSize(190,80,OLD,OLD);
184
			RunProgram(#program_path, #URL);
185
			return;
186
187
 
188
			strcpy(#editURL, "http://kolibrios.org/en/index.htm");
3987 leency 189
		case GOTOURL:
3067 leency 190
		case 0x0D: //enter
191
			//почему ttp://? Господа, отличный вопрос. Дело в том, что это хак.
3986 leency 192
			//strstr() если не нашло возвращает 0 и в случае успеха возвращает 0. Так что это хак.
193
			if ((strstr(#editURL,"ttp://")==0) && (editURL[0]!='/')) strcpy(#URL,"http://"); else URL[0] = 0;
194
			strcat(#URL, #editURL);
195
			OpenPage();
3067 leency 196
			return;
197
		case SEARCHWEB:
198
			strcpy(#URL, #search_path);
199
			strcat(#URL, #editURL);
200
			OpenPage();
201
			return;
202
203
 
204
			IF(lines.first <= 0) return;
205
			lines.first--;
206
			break;
207
		case ID2: //мотаем вниз
208
			IF(lines.visible + lines.first >= lines.all) return;
209
			lines.first++;
210
			break;
211
		case 183: //PgDown
212
			IF(lines.first == lines.all - lines.visible) return;
213
			lines.first += lines.visible + 2;
214
			IF(lines.visible + lines.first > lines.all) lines.first = lines.all - lines.visible;
215
			break;
216
		case 184: //PgUp
217
			IF(lines.first == 0) return;
218
			lines.first -= lines.visible - 2;
219
			IF(lines.first < 0) lines.first = 0;
220
			break;
221
		case 180: //home
222
			IF(lines.first == 0) return;
223
			lines.first = 0;
224
			break;
225
		case 181: //end
226
			IF (lines.first == lines.all - lines.visible) return;
227
			lines.first = lines.all - lines.visible;
228
			break;
229
		default:
230
			return;
231
	}
232
	ParseHTML(buf);
233
}
234
235
 
236
 
3990 leency 237
//dword TWebBrowser::GetNewUrl(dword CUR_URL, NEW_URL){
3067 leency 238
void TWebBrowser::GetNewUrl(){
239
	int i, len;
240
241
 
242
	{
243
		len=strlen(ABSOLUTE_LINKS[i]);
244
		if (!strcmpn(#URL, ABSOLUTE_LINKS[i], len)) return;
245
	}
246
247
 
248
	strcpy(#editURL, BrowserHistory.CurrentUrl()); //достаём адрес текущей страницы
3987 leency 249
3067 leency 250
 
3987 leency 251
	{
252
		i = strchr(#editURL+8, '/');
253
		editURL[i+7]=0;
254
		strcpy(#URL, #URL+1);
255
	}
256
3067 leency 257
 
258
259
 
260
		{
261
			editURL[strrchr(#editURL, '/')] = 0x00; //обрезаем её урл до последнего /
262
		}
263
264
 
265
		{
266
			strcpy(#URL,#URL+3);
267
			editURL[strrchr(#editURL, '/')-1] = 0x00; //обрезаем её урл до последнего /
268
			goto _CUT_ST_LEVEL_MARK;
269
		}
270
271
 
272
273
 
274
		strcpy(#URL, #editURL);
275
}
276
277
 
278
 
279
 
280
{
281
	if (!strcmp(get_URL_part(5),"http:")))
282
		file_size stdcall (#download_path);
283
	else
284
		file_size stdcall (#URL);
285
286
 
287
	if (!filesize) return;
288
289
 
290
	buf = mem_Alloc(filesize);
291
	if (!strcmp(get_URL_part(5),"http:")))
292
		ReadFile(0, filesize, buf, #download_path);
293
	else
294
		ReadFile(0, filesize, buf, #URL);
295
296
 
297
	if (encoding==_WIN) wintodos(buf);
298
	if (encoding==_UTF) utf8rutodos(buf);
299
	if (encoding==_KOI) koitodos(buf);
300
}
301
302
 
303
 
304
{
305
	if (GetProcessSlot(downloader_id)<>0) PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
306
	KillProcess(downloader_id);
307
	strcpy(#editURL, #URL);
308
	BrowserHistory.AddUrl();
309
	strcpy(#header, #version);
310
	pre_text =0;
311
	if (!strcmp(get_URL_part(5),"http:")))
312
	{
313
		KillProcess(downloader_id); //убиваем старый процесс
314
		DeleteFile(#download_path);
315
		IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]=NULL;
316
		downloader_id = RunProgram("/sys/network/downloader", #URL);
317
		//Browser Hack v2.0
318
		/*
3649 leency 319
		pause(60);
3079 leency 320
		if (GetProcessSlot(downloader_id)<>0)
3067 leency 321
		{
322
			debug("Browser Hack v2.0: Killing downloader and trying to run it one more!");
323
			KillProcess(downloader_id); //убиваем старый процесс
324
			downloader_id = RunProgram("/sys/network/downloader", #URL);
325
		}
326
		*/
3649 leency 327
		IF (downloader_id<0) RunProgram("@notify", "Error running Downloader. Internet unavilable.");
3067 leency 328
		Draw_Window();
329
		return;
330
	}
331
	lines.first = lines.all =0;
332
	ReadHtml(_WIN);
333
	WB1.ShowPage();
334
}
335
336
 
337
 
338
{
339
	address_box.size = address_box.pos = strlen(#editURL);
3466 leency 340
	address_box.offset=0;
341
	edit_box_draw stdcall(#address_box);
342
3128 leency 343
 
3067 leency 344
	{
345
		DrawBar(left, top, width+scroll1.size_x+1, height, 0xFFFFFF); //fill all
3466 leency 346
		if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading...");
3107 leency 347
		else
3067 leency 348
		{
349
			WriteText(left + 10, top + 18, 0x80, 0, "Page not found. May be, URL contains some errors.");
3107 leency 350
			if (!strcmp(get_URL_part(5),"http:"))) WriteText(left + 10, top + 32, 0x80, 0, "Or Internet unavilable for your configuration.");
351
		}
3067 leency 352
		//return;
353
	}
354
	else
355
		ParseHTML(buf);
356
357
 
358
	if (!strcmp(#version, #header)) DrawTitle(#header);
359
}
360
361
 
362
 
363
 
364
	word bukva[2];
365
	int j, perenos_num;
366
	byte ignor_param;
367
	char temp[768];
368
369
 
3468 leency 370
	b_text = i_text = u_text = s_text = blq_text =
3466 leency 371
	li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab = 0; //обнуляем теги
3067 leency 372
	text_align = ALIGN_LEFT;
4190 leency 373
	link_color = 0x0000FF;
3067 leency 374
	bg_color = 0xFFFFFF;
375
	DrawBufFill();
3468 leency 376
	strcpy(#page_links,"|");
3067 leency 377
	strcpy(#header, #version);
378
	stroka = -lines.first;
3468 leency 379
	stolbec = 0;
380
	line = 0;
4026 leency 381
3067 leency 382
 
383
	{
384
		pre_text=0;
385
		if (!strcmp(#URL + strlen(#URL) - 4, ".txt")) pre_text = 1;
386
		if (!strcmp(#URL + strlen(#URL) - 4, ".mht")) ignor_text = 1;
387
	}
388
389
 
390
	{
391
		bukva = ESBYTE[bword];
392
		if (ignor_text) && (bukva<>'<') continue;
393
		switch (bukva)
394
		{
395
		case 0x0a:
396
			if (pre_text)
397
			{
398
				bukva = temp = NULL;
399
				goto NEXT_MARK;
400
			}
401
		case '\9':
402
			if (pre_text) //иначе идём на 0x0d
403
			{
404
				tab_len=strlen(#line)/8;
405
				tab_len=tab_len*8;
406
				tab_len=8+tab_len-strlen(#line);
407
				for (j=0; j
3468 leency 408
				break;
3067 leency 409
			}
3468 leency 410
			goto DEFAULT_MARK;
411
		case '=': //quoted printable
412
			if (strcmp(#URL + strlen(#URL) - 4, ".mht")<>0) goto DEFAULT_MARK;
3067 leency 413
414
 
3468 leency 415
			temp[1] = ESBYTE[bword+2];
416
			temp[2] = '\0';
417
			if (bukva = Hex2Symb(#temp))
418
			{
419
				bword+=2;
420
				goto DEFAULT_MARK;
421
			}
422
			break;
3067 leency 423
424
 
425
			bword++;
426
			tag=0;
427
			for (j=0; (ESBYTE[bword]<>';') && (j<7);   j++, bword++;)
428
			{
429
				bukva = ESBYTE[bword];
430
				chrcat(#tag, bukva);
3468 leency 431
			}
3067 leency 432
			bukva = GetUnicodeSymbol();
433
			if (bukva) goto DEFAULT_MARK;
434
			break;
435
		case '<':
436
			bword++; //промотаем символ <
437
			tag = parametr = tagparam = ignor_param = NULL;
438
			if (ESBYTE[bword] == '!') //фильтрация внутри , дерзко
439
			{
440
				bword++;
441
				if (ESBYTE[bword] == '-')
442
				{
443
				HH_:
444
					do
445
					{
446
						bword++;
447
						if (buf + filesize <= bword) break 2;
448
					}
449
					while (ESBYTE[bword] <>'-');
450
451
 
452
					if (ESBYTE[bword] <>'-') goto HH_;
453
				}
454
			}
455
			while (ESBYTE[bword] !='>') && (bword < buf + filesize) //получаем тег и его параметры
456
			{
457
				bukva = ESBYTE[bword];
458
				if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
459
				if (!ignor_param) && (bukva <>' ')
460
				{
461
					if (strlen(#tag)
462
				}
463
				else
464
				{
465
					ignor_param = true;
466
					if (!ignor_text) && (strlen(#tagparam)+1
467
				}
468
				bword++;
469
			}
470
			strlwr(#tag);
471
			strlwr(#tagparam);
472
473
 
474
			if (tagparam) && (strlen(#tagparam) < 4000) GetNextParam();
475
476
 
3466 leency 477
			{
3067 leency 478
				perenos_num = strrchr(#line, ' ');
479
				if (!perenos_num) && (strlen(#line)>lines.column_max) perenos_num=lines.column_max;
480
				strcpy(#temp, #line + perenos_num); //перенос по словам
481
				line[perenos_num] = 0x00;
482
				if (stroka-1 > lines.visible) && (lines.first <>0) break 1; //уходим...
3466 leency 483
				DrawPage();
3067 leency 484
				strcpy(#line, #temp);
3466 leency 485
				TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //закрашиваем следущую строку
3067 leency 486
			}
487
			DrawPage();
488
			line=NULL;
489
490
 
491
492
 
493
			break;
494
		default:
495
			DEFAULT_MARK:
496
			if (bukva<=15) bukva=' ';
3468 leency 497
			if (!pre_text) && (bukva == ' ')
3067 leency 498
			{
499
				if (line[strlen(#line)-1]==' ') break; //убрать 2 пробела подряд
500
				if (!stolbec) && (!line) break; //строка не может начинаться с пробела
501
			}
502
			if (strlen(#line)
3363 leency 503
3067 leency 504
 
505
			{
506
			NEXT_MARK:
507
				perenos_num = strrchr(#line, ' ');
508
				if (!perenos_num) && (strlen(#line)>lines.column_max) perenos_num=lines.column_max;
509
				strcpy(#temp, #line + perenos_num); //перенос по словам
510
				line[perenos_num] = 0x00;
511
				if (stroka-1 > lines.visible) && (lines.first <>0) break 1; //уходим...
3466 leency 512
				DrawPage();
3067 leency 513
				strcpy(#line, #temp);
3466 leency 514
				TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //закрашиваем следущую строку
3067 leency 515
			}
516
		}
517
	}
518
519
 
520
	TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //закрашиваем следущую строку
3466 leency 521
522
 
3067 leency 523
		DrawBar(left, lines.visible * 10 + top + 25, width, -lines.visible * 10 + height - 25, bg_color);
3466 leency 524
	if (stroka * 10 + 5 <= height)
525
		DrawBar(left, stroka * 10 + top + 5, width, -stroka * 10 + height - 5, bg_color); //закрашиваем всё до конца
526
	if (lines.first == 0) lines.all = stroka;
3067 leency 527
	if (anchor) //если посреди текста появится новый якорь - будет бесконечный цикл
528
	{
529
		anchor=NULL;
530
		lines.first=anchor_line_num;
531
		ParseHTML(buf);
532
	}
533
	DrawScroller();
534
}
535
536
 
3464 leency 537
 
538
 
3067 leency 539
void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
540
	dword hr_color;
541
542
 
543
	if (tag[0] == '/')
544
	{
545
		 rez = 0;
546
		 strcpy(#tag, #tag+1);
547
	}
548
	else rez = 1;
549
550
 
551
	{
552
		IF(!strcmp(#URL + strlen(#URL) - 4, ".mht")) IF (rez==0) ignor_text = 1; ELSE ignor_text = 0;
553
		return;
554
	}
555
556
 
557
558
 
559
	{
560
		if (rez) header=NULL;
561
		else if (!stroka) DrawTitle(#header); //тег закрылся - вывели строку
562
		return;
563
	}
564
565
 
566
567
 
568
 
569
 
4190 leency 570
3067 leency 571
 
572
	{
573
		if (!strcmp(#anchor, #options))	anchor_line_num=lines.first+stroka;
574
	}
575
576
 
577
	{
578
		do{
579
			if (!strcmp(#parametr, "link=")) link_color = GetColor(#options);
580
			if (!strcmp(#parametr, "text=")) text_colors[0]=GetColor(#options);
581
			if (!strcmp(#parametr, "bgcolor="))
3466 leency 582
			{
583
				bg_color=GetColor(#options);
584
				DrawBufFill();
585
			}
586
		} while(GetNextParam());
3067 leency 587
		return;
588
	}
589
590
 
591
	{
592
		if (rez)
593
		{
594
			if (link) IF(text_color_index > 0) text_color_index--; //если предыдущий тег а не был закрыт
595
596
 
597
				if (!strcmp(#parametr, "href="))
598
				{
599
					if (stroka - 1 > lines.visible) || (stroka < -2) return;
600
601
 
602
					text_colors[text_color_index] = text_colors[text_color_index-1];
603
604
 
605
					blink++;
606
					text_colors[text_color_index] = link_color;
607
					strcat(#page_links, #options);
608
					strcat(#page_links, "|");
609
				}
610
				if (anchor) && (!strcmp(#parametr, "name="))
611
				{
612
					if (!strcmp(#anchor, #options))
613
					{
614
						anchor_line_num=lines.first+stroka;
615
					}
616
				}
617
			} while(GetNextParam());
618
		}
619
		else {
620
			link = 0;
621
			IF(text_color_index > 0) text_color_index--;
622
		}
623
		return;
624
	}
625
626
 
627
	{
628
		if (rez)
629
		{
630
			text_color_index++;
631
			text_colors[text_color_index] = text_colors[text_color_index-1];
632
633
 
634
				if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
635
				{
636
					text_colors[text_color_index] = GetColor(#options);
637
				}
638
			} while(GetNextParam());
639
		}
640
		else
641
			if (text_color_index > 0) text_color_index--;
642
		return;
643
	}
644
	if(!chTag("tr")) || (!chTag("br")) {
645
		TextGoDown(left1, top1, width1);
646
		return;
647
	}
648
	if (!chTag("div")) {
649
		IF(oldtag[0] <>'h') TextGoDown(left1, top1, width1);
650
		return;
651
	}
652
	if (!chTag("p")) {
653
		IF(oldtag[0] == 'h') return;
654
		TextGoDown(left1, top1, width1);
655
		IF(rez) TextGoDown(left1, top1 + 10, width1);
656
		return;
657
	}
658
	if (!chTag("center"))
4190 leency 659
	{
660
		if (rez) text_align = ALIGN_CENTER;
661
		if (!rez) text_align = ALIGN_LEFT;
662
		return;
4192 leency 663
	}
4190 leency 664
	if (!chTag("right"))
665
	{
666
		if (rez) text_align = ALIGN_RIGHT;
667
		if (!rez) text_align = ALIGN_LEFT;
668
		return;
4192 leency 669
	}
4190 leency 670
	if (!chTag("h1")) || (!chTag("h2")) || (!chTag("h3")) || (!chTag("h4")) {
3067 leency 671
		TextGoDown(left1, top1, width1);
4192 leency 672
		IF(rez) TextGoDown(left1, top1 + 10, width1);
673
		strcpy(#oldtag, #tag);
674
		if (rez)
4190 leency 675
		{
676
			if (!strcmp(#parametr, "align=")) && (!strcmp(#options,"center")) text_align = ALIGN_CENTER;
677
			if (!strcmp(#parametr, "align=")) && (!strcmp(#options,"right")) text_align = ALIGN_RIGHT;
678
			b_text = 1;
679
		}
680
		if (!rez)
681
		{
682
			text_align = ALIGN_LEFT;
683
			b_text = 0;
684
		}
685
		return;
3067 leency 686
	}
687
	else
688
		oldtag=NULL;
689
690
 
691
		b_text = rez;
692
		return;
693
	}
694
	if(!chTag("i")) || (!chTag("em")) || (!chTag("subtitle")) {
695
		i_text = rez;
696
		return;
697
	}
698
	if (!chTag("dt"))
699
	{
700
		li_text = rez;
701
		IF(rez == 0) return;
702
		TextGoDown(left1, top1, width1);
703
		return;
704
	}
705
	if(!chTag("li")) || (!chTag("dt")) //надо сделать вложенные списки
706
	{
707
		li_text = rez;
708
		if (rez)
3466 leency 709
		{
710
			TextGoDown(left1, top1, width1);
711
			if (stroka > -1) && (stroka - 2 < lines.visible) DrawBufBar(li_tab * 5 * 6 + left1 - 5, line_h/2-3, 2, 2, 0x555555);
712
		}
713
		return;
3067 leency 714
	}
715
	if (!chTag("u")) || (!chTag("ins")) u_text = rez;
716
	if (!chTag("s")) || (!chTag("strike")) || (!chTag("del")) s_text = rez;
717
	if (!chTag("ul")) || (!chTag("ol")) IF(!rez)
718
	{
719
		li_text = rez;
720
		li_tab--;
721
		TextGoDown(left1, top1, width1);
722
	} ELSE li_tab++;
723
	if (!chTag("dd")) stolbec += 5;
724
	if (!chTag("blockquote")) blq_text = rez;
725
	if (!chTag("pre")) pre_text = rez;
726
	if (!chTag("hr"))
727
	{
728
		if (anchor) || (stroka < -1)
3466 leency 729
		{
730
			stroka+=2;
731
			return;
732
		}
733
		if (strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options); else hr_color = 0x999999;
734
		TextGoDown(left1, top1, width1);
3067 leency 735
		DrawBufBar(5, WB1.line_h/2, WB1.width-10, 1, hr_color);
3466 leency 736
		TextGoDown(left1, top1+WB1.line_h, width1);
737
	}
3067 leency 738
	if (!chTag("img"))
739
	{
740
		Images( left1, top1, width1);
741
		return;
742
	}
743
	if (!chTag("meta")) || (!chTag("?xml"))
744
	{
745
		do{
746
			if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding="))
747
			{
748
				strcpy(#options, #options[strrchr(#options, '=')]); //поиск в content=
749
				if (!strcmp(#options,"utf-8"))   || (!strcmp(#options,"utf8"))      ReadHtml(_UTF);
750
				if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u"))   ReadHtml(_KOI);
751
				if (!strcmp(#options, "dos"))    || (!strcmp(#options, "cp-866"))   ReadHtml(_DOS);
752
			}
753
		} while(GetNextParam());
754
		return;
755
	}
756
}
757
758
 
759
 
760
 
761
{
762
	scroll1.max_area = lines.all;
763
	scroll1.cur_area = lines.visible;
764
	scroll1.position = lines.first;
765
766
 
767
	scroll1.start_x = WB1.left + WB1.width;
3466 leency 768
	scroll1.size_y=WB1.height;
3067 leency 769
770
 
771
}
772
>
3466 leency 773