Subversion Repositories Kolibri OS

Rev

Rev 4416 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4416 Rev 4417
Line 1... Line 1...
1
int	downloader_id;
1
int	downloader_id;
Line 2... Line 2...
2
 
2
 
3
dword
-
 
4
	buf,
3
dword buf;
5
	filesize,
4
dword filesize;
Line 6... Line 5...
6
	blink;
5
dword blink;
Line 7... Line 6...
7
 
6
 
8
#define URL param
7
#define URL param
9
 
8
 
Line 10... Line 9...
10
int	mouse_twb;
9
int	mouse_twb;
11
edit_box address_box= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19};
10
edit_box address_box= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19};
12
scroll_bar scroll_wv = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
11
scroll_bar scroll_wv = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
Line 13... Line 12...
13
 
12
 
Line 31... Line 30...
31
	void DrawScroller();
30
	void DrawScroller();
32
};	
31
};	
33
TWebBrowser WB1;
32
TWebBrowser WB1;
34
 
33
 
Line 35... Line 34...
35
byte rez, b_text, i_text, u_text, s_text, pre_text, blq_text, li_text,
34
byte rez, b_text, i_text, u_text, s_text, pre_text, blq_text, li_text, li_tab, 
36
	link, ignor_text, li_tab, cur_encoding, text_align;
35
	link, ignor_text, cur_encoding, text_align;
-
 
36
byte condition_text_active, condition_text_val, condition_href, condition_max;
Line 37... Line 37...
37
 
37
 
Line 38... Line 38...
38
enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT};
38
enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT};
39
 
39
 
40
dword text_colors[300],
40
dword text_colors[300];
41
	text_color_index,
41
dword text_color_index;
42
	link_color,
42
dword link_color;
43
	bg_color;
43
dword bg_color;
44
 
44
 
45
int stroka,
45
int stroka;
46
	stolbec,
46
int stolbec;
47
	tab_len,
47
int tab_len;
48
	anchor_line_num;
48
int anchor_line_num;
49
	
49
	
50
char line[500],
50
char line[500];
51
	tag[100],
51
char tag[100];
52
	tagparam[10000],
52
char tagparam[10000];
53
	parametr[1200],
53
char parametr[1200];
Line 54... Line 54...
54
	options[4096],
54
char options[4096];
55
	anchor[256];
55
char anchor[256];
56
 
56
 
57
#include "..\TWB\history.h"
57
#include "..\TWB\history.h"
Line 200... Line 200...
200
	char temp[768];
200
	char temp[768];
201
	
201
	
Line 202... Line 202...
202
	if (blink<400) blink=400; else for ( ; blink>400; blink--;) DeleteButton(blink);
202
	if (blink<400) blink=400; else for ( ; blink>400; blink--;) DeleteButton(blink);
203
	b_text = i_text = u_text = s_text = blq_text = 
203
	b_text = i_text = u_text = s_text = blq_text = 
204
	li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab = 0; //îáíóëÿåì òåãè
204
	li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab = 
-
 
205
	condition_text_val = condition_text_active = 0; //îáíóëÿåì òåãè
-
 
206
	condition_max = 10;
205
	text_align = ALIGN_LEFT;
207
	text_align = ALIGN_LEFT;
206
	link_color = 0x0000FF;
208
	link_color = 0x0000FF;
207
	bg_color = 0xFFFFFF;
209
	bg_color = 0xFFFFFF;
208
	DrawBufFill();
210
	DrawBufFill();
209
	strcpy(#page_links,"|");
211
	strcpy(#page_links,"|");
Line 221... Line 223...
221
	
223
	
Line 222... Line 224...
222
	for ( ; buf+filesize > bword; bword++;)
224
	for ( ; buf+filesize > bword; bword++;)
223
	{
225
	{
224
		bukva = ESBYTE[bword];
226
		bukva = ESBYTE[bword];
225
		if (ignor_text) && (bukva<>'<') continue;
227
		if (ignor_text) && (bukva!='<') continue;
-
 
228
		if (condition_text_active) && (condition_text_val != condition_href) && (bukva!='<') continue;
226
		switch (bukva)
229
		switch (bukva)
227
		{
230
		{
228
		case 0x0a:
231
		case 0x0a:
229
			if (pre_text)
232
			if (pre_text)
230
			{
233
			{
Line 261... Line 264...
261
			{
264
			{
262
				bukva = ESBYTE[bword];
265
				bukva = ESBYTE[bword];
263
				chrcat(#tag, bukva);
266
				chrcat(#tag, bukva);
264
			}
267
			}
265
			bukva = GetUnicodeSymbol();
268
			if (bukva = GetUnicodeSymbol()) goto DEFAULT_MARK;
266
			if (bukva) goto DEFAULT_MARK;
-
 
267
			break;
269
			break;
268
		case '<':
270
		case '<':
269
			bword++; //ïðîìîòàåì ñèìâîë <
271
			bword++; //ïðîìîòàåì ñèìâîë <
270
			tag = parametr = tagparam = ignor_param = NULL;
272
			tag = parametr = tagparam = ignor_param = NULL;
271
			if (ESBYTE[bword] == '!') //ôèëüòðàöèÿ âíóòðè , äåðçêî
273
			if (ESBYTE[bword] == '!') //ôèëüòðàöèÿ âíóòðè , äåðçêî
272
			{
274
			{
Line 302... Line 304...
302
			}
304
			}
303
			strlwr(#tag);
305
			strlwr(#tag);
304
			strlwr(#tagparam);
306
			strlwr(#tagparam);
305
 
307
 
Line -... Line 308...
-
 
308
			if (condition_text_active) && (condition_text_val != condition_href) 
-
 
309
			{
-
 
310
				if (strcmp(#tag, "/condition")!=0) break;
-
 
311
			}
306
			if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/
312
			if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/
307
			if (tagparam) && (strlen(#tagparam) < 4000) GetNextParam();
313
			if (tagparam) && (strlen(#tagparam) < 4000) GetNextParam();
Line 308... Line 314...
308
 
314
 
309
			if (stolbec + strlen(#line) > list.column_max) //============the same as NEXT_MARK
315
			if (stolbec + strlen(#line) > list.column_max) //============the same as NEXT_MARK
Line 408... Line 414...
408
	
414
	
Line 409... Line 415...
409
	if (!chTag("body"))
415
	if (!chTag("body"))
410
	{
416
	{
411
		do{
417
		do{
-
 
418
			if (!strcmp(#parametr, "condition_max=")) { condition_max = options[0]-'0'; debugi(condition_max); }
412
			if (!strcmp(#parametr, "link=")) link_color = GetColor(#options);
419
			if (!strcmp(#parametr, "link=")) link_color = GetColor(#options);
413
			if (!strcmp(#parametr, "text=")) text_colors[0]=GetColor(#options);
420
			if (!strcmp(#parametr, "text=")) text_colors[0]=GetColor(#options);
414
			if (!strcmp(#parametr, "bgcolor="))
421
			if (!strcmp(#parametr, "bgcolor="))
415
			{
422
			{
416
				bg_color=GetColor(#options);
423
				bg_color=GetColor(#options);
Line 542... Line 549...
542
		IF(rez == 0) return;
549
		IF(rez == 0) return;
543
		TextGoDown(left1, top1, width1);
550
		TextGoDown(left1, top1, width1);
544
		return;
551
		return;
545
	}
552
	}
546
	if(!chTag("li")) || (!chTag("dt")) //íàäî ñäåëàòü âëîæåííûå ñïèñêè
553
	if (!chTag("condition"))
-
 
554
	{
-
 
555
		condition_text_active = rez;
-
 
556
		if (rez) && (!strcmp(#parametr, "show_if=")) condition_text_val = atoi(#options);
-
 
557
		return;
-
 
558
	}
-
 
559
	if(!chTag("li")) || (!chTag("dt")) //íàäî ñäåëàòü âëîæåííûå ñïèñêè
547
	{
560
	{
548
		li_text = rez;
561
		li_text = rez;
549
		if (rez)
562
		if (rez)
550
		{
563
		{
551
			TextGoDown(left1, top1, width1);
564
			TextGoDown(left1, top1, width1);