Subversion Repositories Kolibri OS

Rev

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

Rev 4546 Rev 4550
Line 28... Line 28...
28
//images
28
//images
29
#include "img\toolbar_icons.c"
29
#include "img\toolbar_icons.c"
30
#include "img\URLgoto.txt";
30
#include "img\URLgoto.txt";
Line 31... Line 31...
31
 
31
 
32
#ifdef LANG_RUS
32
#ifdef LANG_RUS
33
	char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.66";
33
	char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.67";
34
	?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
34
	?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
35
	?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
35
	?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
36
	char loading[] = "‡ £à㧪  áâà ­¨æë...";
36
	char loading[] = "‡ £à㧪  áâà ­¨æë...
";
37
	unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm";
37
	unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm";
38
#else
38
#else
39
	char version[]=" Text-based Browser 0.99.66";
39
	char version[]=" Text-based Browser 0.99.67";
40
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
40
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
41
	?define T_LAST_SLIDE "This slide is the last"
41
	?define T_LAST_SLIDE "This slide is the last"
42
	char loading[] = "Loading...";
42
	char loading[] = "Loading...
";
43
	unsigned char page_not_found[] = FROM "html\page_not_found_en.htm";
43
	unsigned char page_not_found[] = FROM "html\page_not_found_en.htm";
Line 44... Line 44...
44
#endif
44
#endif
45
 
45
 
Line 99... Line 99...
99
				if (!CheckActiveProcess(Form.ID)) break;
99
				if (!CheckActiveProcess(Form.ID)) break;
Line 100... Line 100...
100
 
100
 
Line 101... Line 101...
101
				edit_box_mouse stdcall (#address_box);
101
				edit_box_mouse stdcall (#address_box);
102
 
102
 
Line 103... Line 103...
103
				m.get();
103
				m.get();
104
				PageLinks.Hover(m.x, m.y, link_color_inactive, link_color_active, bg_color);
104
				if (m.y>WB1.list.y) PageLinks.Hover(m.x, m.y, link_color_inactive, link_color_active, bg_color);
105
				
105
				
106
				if (m.y>WB1.list.y) && (m.y
106
				if (m.y>WB1.list.y) && (m.y
Line 118... Line 118...
118
					}
118
					}
119
				}
119
				}
Line 120... Line 120...
120
 
120
 
121
				if (m.vert)
121
				if (m.vert)
122
				{
122
				{
123
					if (WB1.list.MouseScroll(m.vert)) WB1.ParseHTML(bufpointer);
123
					if (WB1.list.MouseScroll(m.vert)) WB1.Parse(bufpointer, bufsize);
Line 124... Line 124...
124
				}
124
				}
125
				
125
				
126
				if (!m.lkm) scroll_used=0;
126
				if (!m.lkm) scroll_used=0;
Line 136... Line 136...
136
					half_scroll_size = WB1.list.h - 16 * WB1.list.visible / WB1.list.count - 3 /2;
136
					half_scroll_size = WB1.list.h - 16 * WB1.list.visible / WB1.list.count - 3 /2;
137
					if (half_scroll_size+WB1.list.y>m.y) || (m.y<0) || (m.y>4000) m.y=half_scroll_size+WB1.list.y;
137
					if (half_scroll_size+WB1.list.y>m.y) || (m.y<0) || (m.y>4000) m.y=half_scroll_size+WB1.list.y;
138
					btn=WB1.list.first;
138
					btn=WB1.list.first;
139
					WB1.list.first = m.y -half_scroll_size -WB1.list.y * WB1.list.count / WB1.list.h;
139
					WB1.list.first = m.y -half_scroll_size -WB1.list.y * WB1.list.count / WB1.list.h;
140
					if (WB1.list.visible+WB1.list.first>WB1.list.count) WB1.list.first=WB1.list.count-WB1.list.visible;
140
					if (WB1.list.visible+WB1.list.first>WB1.list.count) WB1.list.first=WB1.list.count-WB1.list.visible;
141
					if (btn<>WB1.list.first) WB1.ParseHTML(bufpointer);
141
					if (btn<>WB1.list.first) WB1.Parse(bufpointer, bufsize);
142
				}
142
				}
Line 143... Line 143...
143
 
143
 
144
				break;
144
				break;
145
			case evButton:
145
			case evButton:
Line 183... Line 183...
183
					bufpointer = ESI.http_msg.content_ptr;
183
					bufpointer = ESI.http_msg.content_ptr;
184
					debug(bufpointer);	
184
					debug(bufpointer);	
185
					//bufsize = ESI.http_msg.content_received;
185
					//bufsize = ESI.http_msg.content_received;
186
					bufsize = strlen(bufpointer)-2;
186
					bufsize = strlen(bufpointer)-2;
187
					debugi(bufsize);
187
					debugi(bufsize);
188
					WB1.ParseHTML(bufpointer);					
188
					WB1.Parse(bufpointer, bufsize);
189
					$pop EAX	
189
					$pop EAX	
190
					if (EAX == 0) {			
190
					if (EAX == 0) {			
191
						http_free stdcall (http_transfer);
191
						http_free stdcall (http_transfer);
192
						http_transfer=0;				
192
						http_transfer=0;				
193
					}
193
					}
Line 257... Line 257...
257
	
257
	
258
	switch (id)
258
	switch (id)
259
	{
259
	{
260
		case 011: //Ctrk+K 
260
		case 011: //Ctrk+K 
261
			WB1.ReadHtml(_KOI);
261
			WB1.ReadHtml(_KOI);
262
			WB1.ParseHTML(bufpointer);
262
			WB1.Parse(bufpointer, bufsize);
Line 263... Line 263...
263
			return;
263
			return;
264
 
264
 
265
		case 021: //Ctrl+U
265
		case 021: //Ctrl+U
266
			WB1.ReadHtml(_UTF);
266
			WB1.ReadHtml(_UTF);
Line 267... Line 267...
267
			WB1.ParseHTML(bufpointer);
267
			WB1.Parse(bufpointer, bufsize);
268
			return;
268
			return;
269
 
269
 
270
		case 004: //Ctrl+D
270
		case 004: //Ctrl+D
Line 271... Line 271...
271
			WB1.ReadHtml(_DOS);
271
			WB1.ReadHtml(_DOS);
272
			WB1.ParseHTML(bufpointer);
272
			WB1.Parse(bufpointer, bufsize);
273
			return;
273
			return;
274
 
274
 
Line 275... Line 275...
275
		case 005: //Win encoding
275
		case 005: //Win encoding
276
			WB1.ReadHtml(_WIN);
276
			WB1.ReadHtml(_WIN);
277
			WB1.ParseHTML(bufpointer);
277
			WB1.Parse(bufpointer, bufsize);
278
			return;
278
			return;
279
 
279
 
Line 280... Line 280...
280
		case 009: //free img cache
280
		case 009: //free img cache
281
			ImgCache.Free();
281
			ImgCache.Free();
282
			notify(IMAGES_CACHE_CLEARED);
282
			notify(IMAGES_CACHE_CLEARED);
Line 299... Line 299...
299
		case 052:  //F3
299
		case 052:  //F3
300
			if (strncmp(#URL,"http:",5)<>0) RunProgram("/rd/1/tinypad", #URL);
300
			if (strncmp(#URL,"http:",5)<>0) RunProgram("/rd/1/tinypad", #URL);
301
			else RunProgram("/rd/1/tinypad", #download_path);
301
			else RunProgram("/rd/1/tinypad", #download_path);
302
			return;
302
			return;
303
		case 054: //F5
303
		case 054: //F5
304
			IF(address_box.flags & 0b10) WB1.ParseHTML(bufpointer);
304
			IF(address_box.flags & 0b10) WB1.Parse(bufpointer, bufsize);
305
			return;
305
			return;
Line 306... Line 306...
306
 
306
 
307
		case REFRESH:
307
		case REFRESH:
308
			if (GetProcessSlot(downloader_id)<>0)
308
			if (GetProcessSlot(downloader_id)<>0)
Line 340... Line 340...
340
		case 183: //PgDown
340
		case 183: //PgDown
341
			if (WB1.list.count < WB1.list.visible) return;
341
			if (WB1.list.count < WB1.list.visible) return;
342
			IF(WB1.list.first == WB1.list.count - WB1.list.visible) return;
342
			IF(WB1.list.first == WB1.list.count - WB1.list.visible) return;
343
			WB1.list.first += WB1.list.visible + 2;
343
			WB1.list.first += WB1.list.visible + 2;
344
			IF(WB1.list.visible + WB1.list.first > WB1.list.count) WB1.list.first = WB1.list.count - WB1.list.visible;
344
			IF(WB1.list.visible + WB1.list.first > WB1.list.count) WB1.list.first = WB1.list.count - WB1.list.visible;
345
			WB1.ParseHTML(bufpointer);
345
			WB1.Parse(bufpointer, bufsize);
346
			return;
346
			return;
Line 347... Line 347...
347
 
347
 
348
		case 184: //PgUp
348
		case 184: //PgUp
349
			if (WB1.list.count < WB1.list.visible) return;
349
			if (WB1.list.count < WB1.list.visible) return;
350
			IF(WB1.list.first == 0) return;
350
			IF(WB1.list.first == 0) return;
351
			WB1.list.first -= WB1.list.visible - 2;
351
			WB1.list.first -= WB1.list.visible - 2;
352
			IF(WB1.list.first < 0) WB1.list.first = 0;
352
			IF(WB1.list.first < 0) WB1.list.first = 0;
353
			WB1.ParseHTML(bufpointer);
353
			WB1.Parse(bufpointer, bufsize);
Line 354... Line 354...
354
			return;
354
			return;
355
 
355
 
356
		case 178:
356
		case 178:
357
		case BTN_UP:
357
		case BTN_UP:
358
			if (WB1.list.first <= 0) return;
358
			if (WB1.list.first <= 0) return;
359
			WB1.list.first--;
359
			WB1.list.first--;
Line 360... Line 360...
360
			WB1.ParseHTML(bufpointer);
360
			WB1.Parse(bufpointer, bufsize);
361
			return;
361
			return;
362
 
362
 
363
		case 177: 
363
		case 177: 
364
		case BTN_DOWN:
364
		case BTN_DOWN:
365
			if (WB1.list.visible + WB1.list.first >= WB1.list.count) return;
365
			if (WB1.list.visible + WB1.list.first >= WB1.list.count) return;
Line 366... Line 366...
366
			WB1.list.first++;
366
			WB1.list.first++;
367
			WB1.ParseHTML(bufpointer);
367
			WB1.Parse(bufpointer, bufsize);
368
			return;
368
			return;
Line 369... Line 369...
369
 
369
 
370
		case 180: //home
370
		case 180: //home
371
			if (WB1.list.KeyHome()) WB1.ParseHTML(bufpointer);
371
			if (WB1.list.KeyHome()) WB1.Parse(bufpointer, bufsize);
372
			return; 
372
			return; 
373
 
373
 
374
		case 181: //end
374
		case 181: //end
Line 466... Line 466...
466
	if (strcmp(#URL, URL_HISTORY)==0) ShowHistory(); else
466
	if (strcmp(#URL, URL_HISTORY)==0) ShowHistory(); else
467
	if (!bufsize)
467
	if (!bufsize)
468
	{
468
	{
469
		PageLinks.Clear();
469
		PageLinks.Clear();
470
		if (GetProcessSlot(downloader_id)<>0) 
470
		if (GetProcessSlot(downloader_id)<>0)
471
		{
-
 
472
			bufsize = sizeof(loading);
471
			WB1.Parse(#loading, sizeof(loading));
473
			WB1.ParseHTML(#loading);
-
 
474
		}
-
 
475
		else
472
		else
476
		{
-
 
477
			bufsize = sizeof(page_not_found);
473
			WB1.Parse(#page_not_found, sizeof(page_not_found));
478
			WB1.ParseHTML(#page_not_found);
-
 
479
		}
-
 
480
		bufsize = 0;
-
 
481
	}
474
	}
482
	else
475
	else
483
		WB1.ParseHTML(bufpointer);
476
		WB1.Parse(bufpointer, bufsize);
Line 484... Line 477...
484
 
477
 
485
	if (!header) strcpy(#header, #version);
478
	if (!header) strcpy(#header, #version);
486
	if (!strcmp(#version, #header)) DrawTitle(#header);
479
	if (!strcmp(#version, #header)) DrawTitle(#header);
Line 491... Line 484...
491
		int i;
484
		int i;
492
		static int history_pointer;
485
		static int history_pointer;
Line 493... Line 486...
493
		
486
		
494
		free(history_pointer);
487
		free(history_pointer);
495
		history_pointer = malloc(64000);
488
		history_pointer = malloc(64000);
496
		strcat(history_pointer, "

History

");
489
		strcat(history_pointer, " History

History

");
497
		strcat(history_pointer, "

Visited pages


");
490
		strcat(history_pointer, "

Visited pages


");
498
		for (i=1; i
491
		for (i=1; i
499
		{
492
		{
500
			strcat(history_pointer, "
Line 507... Line 500...
507
		for (i=1; i
500
		for (i=1; i
508
		{
501
		{
509
			strcat(history_pointer, "
510
			strcat(history_pointer, #pics[i].path);
503
			strcat(history_pointer, #pics[i].path);
511
			strcat(history_pointer, "' />
");
504
			strcat(history_pointer, "' />
");
-
 
505
			strcat(history_pointer, #pics[i].path);
512
		}
506
		}
513
		bufsize = strlen(history_pointer);
-
 
514
		bufpointer = history_pointer;
507
		bufpointer = history_pointer;
515
		WB1.ParseHTML(history_pointer);
508
		WB1.Parse(history_pointer, strlen(history_pointer));
516
}
509
}
Line 517... Line 510...
517
 
510