Subversion Repositories Kolibri OS

Rev

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

Rev 2799 Rev 2803
Line 7... Line 7...
7
 int i;
7
 int i;
8
 
8
 
Line 9... Line 9...
9
char download_path[]="/rd/1/.download";
9
char download_path[]="/rd/1/.download";
10
char search_path[]="http://nigma.ru/index.php?s=";
10
char search_path[]="http://nigma.ru/index.php?s=";
11
char version[]=" Text-based Browser 0.93b";
11
char version[]=" Text-based Browser 0.93e";
12
 
-
 
13
char tinypad_path[]="/sys/tinypad";
-
 
14
char t_edit_path[]="/sys/develop/t_edit";
-
 
Line 15... Line 12...
15
 
12
 
16
 
13
 
17
struct TWebBrowser {
14
struct TWebBrowser {
Line 52... Line 49...
52
#include "include\unicode_tags.h"
49
#include "include\unicode_tags.h"
53
#include "include\some_code.h"
50
#include "include\some_code.h"
54
 
51
 
Line 55... Line 52...
55
 
52
 
-
 
53
void TWebBrowser::Scan(int id)
56
void TWebBrowser::Scan(int id) {
54
{
57
	if (id > 399)
55
	if (id > 399)
58
	{
56
	{
Line 59... Line 57...
59
		GetURLfromPageLinks(id);
57
		GetURLfromPageLinks(id);
Line 90... Line 88...
90
		OpenPage();
88
		OpenPage();
91
		return;
89
		return;
92
	}
90
	}
Line 93... Line -...
93
	
-
 
94
	//edit1.flags=64;
91
	
95
	IF(count < max_kolvo_strok) SWITCH(id) //åñëè ìàëî ñòðîê èãíîðèðóåì íåêîòîðûå êíîïêè
92
	IF(count < max_kolvo_strok) SWITCH(id) //åñëè ìàëî ñòðîê èãíîðèðóåì íåêîòîðûå êíîïêè
Line 96... Line 93...
96
	{ CASE 183: CASE 184: CASE 180: CASE 181: return; } 
93
	{ CASE 183: CASE 184: CASE 180: CASE 181: return; } 
97
	
94
	
Line 112... Line 109...
112
		case FORWARD:
109
		case FORWARD:
113
			if (!BrowserHistory.GoForward()) return;
110
			if (!BrowserHistory.GoForward()) return;
114
			OpenPage();
111
			OpenPage();
115
			return;
112
			return;
116
		case 054: //F5
113
		case 052:  //Íàæàòà F3
-
 
114
			if (strcmp(get_URL_part(5),"http:")<>0) RunProgram("/rd/1/tinypad", #URL); else RunProgram("/rd/1/tinypad", #download_path);
-
 
115
			return;
-
 
116
		case 053:  //Íàæàòà F4
-
 
117
			if (strcmp(get_URL_part(5),"http:")<>0) RunProgram("/rd/1/develop/t_edit", #URL); else RunProgram("/rd/1/develop/t_edit", #download_path);
-
 
118
			return;
-
 
119
		case 054: //F5
117
			IF(edit1.flags == 66) break;
120
			IF(edit1.flags == 66) break;
118
		case REFRESH:
121
		case REFRESH:
119
			if (GetProcessSlot(downloader_id)<>0)
122
			if (GetProcessSlot(downloader_id)<>0)
120
			{
123
			{
121
				KillProcess(downloader_id);
124
				KillProcess(downloader_id);
122
				Pause(20);
125
				Pause(20);
123
				Draw_Window();
126
				Draw_Window();
124
				return;
127
				return;
125
			}
128
			}
126
			OpenPage(); //îò ñåðäöà îòðûâàþ, çäåñü íóæíî za_kadrom ñòàðîå
129
			anchor_line_num=za_kadrom; //âåñ¸ëûé êîñòûëü :Ð
127
			return;
130
			anchor[0]='|';
-
 
131
			OpenPage();
-
 
132
			return;
128
		case 014: //Ctrl+N íîâîå îêíî
133
		case 014: //Ctrl+N íîâîå îêíî
129
		case 020: //Ctrl+T íîâàÿ âêëàäêà
134
		case 020: //Ctrl+T íîâàÿ âêëàäêà
130
		case NEWTAB:
135
		case NEWTAB:
131
			MoveSize(190,80,OLD,OLD);
136
			MoveSize(190,80,OLD,OLD);
132
			RunProgram(#program_path, #URL);
137
			RunProgram(#program_path, #URL);
133
			return;
138
			return;
134
		case 052:  //Íàæàòà F3
139
			
135
			IF(edit1.flags <> 66) 
-
 
136
			IF (!strcmp(get_URL_part(5),"http:")) RunProgram(#tinypad_path, #download_path); ELSE RunProgram(#tinypad_path, #URL);
-
 
137
			return;
-
 
138
		case 053:  //Íàæàòà F4
-
 
139
			IF(edit1.flags <> 66) 
-
 
140
			IF (!strcmp(get_URL_part(5),"http:")) RunProgram(#t_edit_path, #download_path); ELSE RunProgram(#t_edit_path, #URL);
-
 
141
			return;
-
 
142
			
-
 
Line 143... Line 140...
143
		case HOME:
140
		case HOME:
144
			copystr("http://kolibri-os.narod.ru", #editURL);
141
			copystr("http://kolibri-os.narod.ru", #editURL);
145
		case GOTOURL:
142
		case GOTOURL:
146
		case 0x0D: //enter
143
		case 0x0D: //enter
Line 254... Line 251...
254
		//ýòî ãåíèàëüíî è ýòî ïèçäåö!!!
251
		//ýòî ãåíèàëüíî è ýòî ïèçäåö!!!
255
		Pause(60);
252
		Pause(60);
256
		if (GetProcessSlot(downloader_id)<>0)
253
		if (GetProcessSlot(downloader_id)<>0)
257
		{
254
		{
258
			WriteDebug("Browser Hack v2.0: Killing downloader and trying to run it one more!");
255
			debug("Browser Hack v2.0: Killing downloader and trying to run it one more!");
259
			KillProcess(downloader_id); //óáèâàåì ñòàðûé ïðîöåññ
256
			KillProcess(downloader_id); //óáèâàåì ñòàðûé ïðîöåññ
260
			downloader_id = RunProgram("/sys/network/downloader", #URL);
257
			downloader_id = RunProgram("/sys/network/downloader", #URL);
261
		}
258
		}
262
		//
259
		//
263
		IF (downloader_id<0) RunProgram("@notify", "Error running Downloader. Internet unavilable.");
260
		IF (downloader_id<0) RunProgram("@notify", "Error running Downloader. Internet unavilable.");
264
		Draw_Window();
261
		Draw_Window();
Line 534... Line 531...
534
	//
531
	//
535
	IF(!chTag("q")) copystr("\"", #line + strlen(#line));
532
	IF(!chTag("q")) copystr("\"", #line + strlen(#line));
Line 536... Line 533...
536
	
533
	
537
	//âûâîä íà ýêðàí
534
	//âûâîä íà ýêðàí
538
	if (stroka >= 0) && (stroka - 2 < max_kolvo_strok) && (line) 
535
	if (stroka >= 0) && (stroka - 2 < max_kolvo_strok) && (line) && (!anchor)
539
	{
536
	{
540
		WriteText(stolbec * 6 + left1, top1, 0x80, text_colors[text_color_index], #line, 0); //ìîæåò òóò ðèñîâàòü áåëóþ ñòðîêó?
537
		WriteText(stolbec * 6 + left1, top1, 0x80, text_colors[text_color_index], #line, 0); //ìîæåò òóò ðèñîâàòü áåëóþ ñòðîêó?
541
		IF (b_text)	{ $add ebx, 1<<16   $int 0x40 }
538
		IF (b_text)	{ $add ebx, 1<<16   $int 0x40 }
542
		IF (i_text) Skew(stolbec * 6 + left1, top1, strlen(#line)+1*6, 10); //íàêëîííûé òåêñò
539
		IF (i_text) Skew(stolbec * 6 + left1, top1, strlen(#line)+1*6, 10); //íàêëîííûé òåêñò
Line 801... Line 798...
801
	stroka++;
798
	stroka++;
802
	IF(blq_text == 1) stolbec = 8;
799
	IF(blq_text == 1) stolbec = 8;
803
	ELSE stolbec = 0;
800
	ELSE stolbec = 0;
804
	IF(li_text == 1) stolbec = li_tab * 5;
801
	IF(li_text == 1) stolbec = li_tab * 5;
805
	IF(stroka >= 0) && (stroka - 2 < max_kolvo_strok) DrawBar(left1 - 5, top1 + 10, width1 + 5, 10, bg_color);
802
	IF(stroka >= 0) && (stroka - 2 < max_kolvo_strok)  && (!anchor) DrawBar(left1 - 5, top1 + 10, width1 + 5, 10, bg_color);
806
}
803
}
807
 
804
 
Line 808... Line 805...
808
 
805
 
809
//ñêðîëë
806
//ñêðîëë