Subversion Repositories Kolibri OS

Rev

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

Rev 4413 Rev 4414
Line 9... Line 9...
9
	blink;
9
	blink;
Line 10... Line 10...
10
 
10
 
11
char download_path[]="/rd/1/.download";
11
char download_path[]="/rd/1/.download";
Line -... Line 12...
-
 
12
char search_path[]="http://nigma.ru/index.php?s=";
-
 
13
 
-
 
14
struct lines{
Line 12... Line 15...
12
char search_path[]="http://nigma.ru/index.php?s=";
15
	int visible, all, first, column_max;
13
 
-
 
14
 
16
};
15
struct TWebBrowser {
17
 
16
	int left, top, width, height, line_h;
18
struct TWebBrowser {
17
	llist list;
19
	llist list;
18
	void GetNewUrl();
20
	void GetNewUrl();
Line 71... Line 73...
71
		return;
73
		return;
72
	}
74
	}
Line 73... Line 75...
73
	
75
	
74
	if (stroka >= 0) && (stroka - 2 < lines.visible) && (line) && (!anchor)
76
	if (stroka >= 0) && (stroka - 2 < lines.visible) && (line) && (!anchor)
75
	{
77
	{
76
		start_x = stolbec * 6 + left + magrin_left;
78
		start_x = stolbec * 6 + list.x + magrin_left;
77
		start_y = stroka * 10 + top + magrin_left;
79
		start_y = stroka * 10 + list.y + magrin_left;
Line 78... Line 80...
78
		line_length = strlen(#line) * 6;
80
		line_length = strlen(#line) * 6;
79
 
81
 
80
		WriteBufText(start_x, 0, 0x88, text_colors[text_color_index], #line, drawbuf);
82
		WriteBufText(start_x, 0, 0x88, text_colors[text_color_index], #line, drawbuf);
81
		IF (b_text)	WriteBufText(start_x+1, 0, 0x88, text_colors[text_color_index], #line, drawbuf);
83
		IF (b_text)	WriteBufText(start_x+1, 0, 0x88, text_colors[text_color_index], #line, drawbuf);
82
		IF (i_text) DrawBufSkew(start_x, 0, line_length, line_h);
84
		IF (i_text) DrawBufSkew(start_x, 0, line_length, list.line_h);
83
		IF (s_text) DrawBufBar(start_x, 4, line_length, 1, text_colors[text_color_index]);
85
		IF (s_text) DrawBufBar(start_x, 4, line_length, 1, text_colors[text_color_index]);
84
		IF (u_text) DrawBufBar(start_x, 8, line_length, 1, text_colors[text_color_index]);
86
		IF (u_text) DrawBufBar(start_x, 8, line_length, 1, text_colors[text_color_index]);
85
		IF (link) {
87
		IF (link) {
Line 200... Line 202...
200
	address_box.offset=0;
202
	address_box.offset=0;
201
	edit_box_draw stdcall(#address_box);
203
	edit_box_draw stdcall(#address_box);
Line 202... Line 204...
202
 
204
 
203
	if (!filesize)
205
	if (!filesize)
204
	{
206
	{
205
		DrawBar(left, top, width+scroll1.size_x+1, height, 0xFFFFFF); //fill all
207
		DrawBar(list.x, list.y, list.w+scroll1.size_x+1, list.h, 0xFFFFFF); //fill all
206
		if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading...");
208
		if (GetProcessSlot(downloader_id)<>0) WriteText(list.x + 10, list.y + 18, 0x80, 0, "Loading...");
207
		else
209
		else
208
		{
210
		{
209
			WriteText(left + 10, top + 18, 0x80, 0, "Page not found. May be, URL contains some errors.");
211
			WriteText(list.x + 10, list.y + 18, 0x80, 0, "Page not found. May be, URL contains some errors.");
210
			if (!strcmp(get_URL_part(5),"http:"))) WriteText(left + 10, top + 32, 0x80, 0, "Or Internet unavilable for your configuration.");
212
			if (!strcmp(get_URL_part(5),"http:"))) WriteText(list.x + 10, list.y + 32, 0x80, 0, "Or Internet unavilable for your configuration.");
211
		}
213
		}
212
		//return;
214
		//return;
213
	}
215
	}
214
	else
216
	else
Line 340... Line 342...
340
				strcpy(#temp, #line + perenos_num); //ïåðåíîñ ïî ñëîâàì
342
				strcpy(#temp, #line + perenos_num); //ïåðåíîñ ïî ñëîâàì
341
				line[perenos_num] = 0x00;
343
				line[perenos_num] = 0x00;
342
				if (stroka-1 > lines.visible) && (lines.first <>0) break 1; //óõîäèì...
344
				if (stroka-1 > lines.visible) && (lines.first <>0) break 1; //óõîäèì...
343
				DrawPage();
345
				DrawPage();
344
				strcpy(#line, #temp);				
346
				strcpy(#line, #temp);				
345
				TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
347
				TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
346
			}
348
			}
347
			DrawPage();
349
			DrawPage();
348
			line=NULL;
350
			line=NULL;
Line 349... Line 351...
349
 
351
 
Line 350... Line 352...
350
			if (tag) WhatTextStyle(left + 5, stroka * 10 + top + 5, width - 20); //îáðàáîòêà òåãîâ
352
			if (tag) WhatTextStyle(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //îáðàáîòêà òåãîâ
351
 
353
 
352
			tag = parametr = tagparam = ignor_param = NULL;
354
			tag = parametr = tagparam = ignor_param = NULL;
353
			break;
355
			break;
Line 369... Line 371...
369
				strcpy(#temp, #line + perenos_num); //ïåðåíîñ ïî ñëîâàì
371
				strcpy(#temp, #line + perenos_num); //ïåðåíîñ ïî ñëîâàì
370
				line[perenos_num] = 0x00;
372
				line[perenos_num] = 0x00;
371
				if (stroka-1 > lines.visible) && (lines.first <>0) break 1; //óõîäèì...
373
				if (stroka-1 > lines.visible) && (lines.first <>0) break 1; //óõîäèì...
372
				DrawPage();
374
				DrawPage();
373
				strcpy(#line, #temp);			
375
				strcpy(#line, #temp);			
374
				TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
376
				TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
375
			}
377
			}
376
		}
378
		}
377
	}
379
	}
Line 378... Line 380...
378
 
380
 
379
	DrawPage(); //ðèñóåò ïîñëåäíþþ ñòðîêó, ïîòîì ýòî íàäî óáðàòü, îïòèìèçèðîâàâ êîä
381
	DrawPage(); //ðèñóåò ïîñëåäíþþ ñòðîêó, ïîòîì ýòî íàäî óáðàòü, îïòèìèçèðîâàâ êîä
Line 380... Line 382...
380
	TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
382
	TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
381
 
383
 
382
	if (lines.visible * 10 + 25 <= height)
384
	if (lines.visible * 10 + 25 <= list.h)
383
		DrawBar(left, lines.visible * 10 + top + 25, width, -lines.visible * 10 + height - 25, bg_color);
385
		DrawBar(list.x, lines.visible * 10 + list.y + 25, list.w, -lines.visible * 10 + list.h - 25, bg_color);
384
	if (stroka * 10 + 5 <= height)
386
	if (stroka * 10 + 5 <= list.h)
385
		DrawBar(left, stroka * 10 + top + 5, width, -stroka * 10 + height - 5, bg_color); //çàêðàøèâàåì âñ¸ äî êîíöà
387
		DrawBar(list.x, stroka * 10 + list.y + 5, list.w, -stroka * 10 + list.h - 5, bg_color); //çàêðàøèâàåì âñ¸ äî êîíöà
386
	if (lines.first == 0) lines.all = stroka;
388
	if (lines.first == 0) lines.all = stroka;
387
	if (anchor) //åñëè ïîñðåäè òåêñòà ïîÿâèòñÿ íîâûé ÿêîðü - áóäåò áåñêîíå÷íûé öèêë
389
	if (anchor) //åñëè ïîñðåäè òåêñòà ïîÿâèòñÿ íîâûé ÿêîðü - áóäåò áåñêîíå÷íûé öèêë
388
	{
390
	{
Line 574... Line 576...
574
	{
576
	{
575
		li_text = rez;
577
		li_text = rez;
576
		if (rez)
578
		if (rez)
577
		{
579
		{
578
			TextGoDown(left1, top1, width1);
580
			TextGoDown(left1, top1, width1);
579
			if (stroka > -1) && (stroka - 2 < lines.visible) DrawBufBar(li_tab * 5 * 6 + left1 - 5, line_h/2-3, 2, 2, 0x555555);
581
			if (stroka > -1) && (stroka - 2 < lines.visible) DrawBufBar(li_tab * 5 * 6 + left1 - 5, list.line_h/2-3, 2, 2, 0x555555);
580
		}
582
		}
581
		return;
583
		return;
582
	}
584
	}
583
	if (!chTag("u")) || (!chTag("ins")) u_text = rez;
585
	if (!chTag("u")) || (!chTag("ins")) u_text = rez;
584
	if (!chTag("s")) || (!chTag("strike")) || (!chTag("del")) s_text = rez;
586
	if (!chTag("s")) || (!chTag("strike")) || (!chTag("del")) s_text = rez;
Line 598... Line 600...
598
			stroka+=2;
600
			stroka+=2;
599
			return;
601
			return;
600
		}
602
		}
601
		if (strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options); else hr_color = 0x999999;
603
		if (strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options); else hr_color = 0x999999;
602
		TextGoDown(left1, top1, width1);
604
		TextGoDown(left1, top1, width1);
603
		DrawBufBar(5, WB1.line_h/2, WB1.width-10, 1, hr_color);
605
		DrawBufBar(5, WB1.list.line_h/2, WB1.list.w-10, 1, hr_color);
604
		TextGoDown(left1, top1+WB1.line_h, width1);
606
		TextGoDown(left1, top1+WB1.list.line_h, width1);
605
	}
607
	}
606
	if (!chTag("img"))
608
	if (!chTag("img"))
607
	{
609
	{
608
		Images( left1, top1, width1);
610
		Images( left1, top1, width1);
609
		return;
611
		return;
Line 630... Line 632...
630
	scroll1.max_area = lines.all;
632
	scroll1.max_area = lines.all;
631
	scroll1.cur_area = lines.visible;
633
	scroll1.cur_area = lines.visible;
632
	scroll1.position = lines.first;
634
	scroll1.position = lines.first;
Line 633... Line 635...
633
 
635
 
634
	scroll1.all_redraw=1;
636
	scroll1.all_redraw=1;
635
	scroll1.start_x = WB1.left + WB1.width;
637
	scroll1.start_x = WB1.list.x + WB1.list.w;
Line 636... Line 638...
636
	scroll1.size_y=WB1.height;
638
	scroll1.size_y=WB1.list.h;
637
 
639