Subversion Repositories Kolibri OS

Rev

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

Rev 4644 Rev 4645
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.7";
33
	char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.71";
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
	char accept_language[]= "Accept-Language: ru\n\0";
38
	char accept_language[]= "Accept-Language: ru\n\0";
39
#else
39
#else
40
	char version[]=" Text-based Browser 0.99.7";
40
	char version[]=" Text-based Browser 0.99.71";
41
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
41
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
42
	?define T_LAST_SLIDE "This slide is the last"
42
	?define T_LAST_SLIDE "This slide is the last"
43
	char loading[] = "Loading...
";
43
	char loading[] = "Loading...
";
44
	unsigned char page_not_found[] = FROM "html\page_not_found_en.htm";
44
	unsigned char page_not_found[] = FROM "html\page_not_found_en.htm";
Line 205... Line 205...
205
							BrowserHistory.current--;
205
							BrowserHistory.current--;
206
							OpenPage();
206
							OpenPage();
207
						}
207
						}
208
						else
208
						else
209
						{
209
						{
210
							if (o_bufpointer) o_bufpointer = free(o_bufpointer);
-
 
211
							ESI = http_transfer;
210
							ESI = http_transfer;
212
							bufpointer = ESI.http_msg.content_ptr;
211
							bufpointer = ESI.http_msg.content_ptr;
213
							bufsize = ESI.http_msg.content_received;
212
							bufsize = ESI.http_msg.content_received;
214
							http_free stdcall (http_transfer);
213
							http_free stdcall (http_transfer);
215
							http_transfer=0;
214
							http_transfer=0;
-
 
215
							SetPageDefaults();
216
							Draw_Window();		// stop button => refresh button
216
							Draw_Window();		// stop button => refresh button
217
						}
217
						}
218
					}
218
					}
219
				}
219
				}
220
		}
220
		}
Line 467... Line 467...
467
		http_free stdcall (http_transfer);	// abort connection
467
		http_free stdcall (http_transfer);	// abort connection
468
		$pop	EAX							
468
		$pop	EAX							
469
		mem_Free(EAX);						// free data
469
		mem_Free(EAX);						// free data
470
		http_transfer=0;
470
		http_transfer=0;
471
		bufsize = 0;
471
		bufsize = 0;
-
 
472
		PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
-
 
473
	}
472
	}
474
}
-
 
475
 
-
 
476
void SetPageDefaults()
-
 
477
{
-
 
478
	strcpy(#header, #version);
-
 
479
	pre_text = 0;
-
 
480
	WB1.list.count = WB1.list.first = 0;
-
 
481
	stroka = 0;
-
 
482
	cur_encoding = _DEFAULT;
-
 
483
	if (o_bufpointer) o_bufpointer = free(o_bufpointer);
473
	anchor_line_num=WB1.list.first;
484
	anchor_line_num=WB1.list.first;
474
	anchor[0]='|';
485
	anchor[0]='|';
475
}
486
}
Line 476... Line 487...
476
 
487
 
477
void OpenPage()
488
void OpenPage()
478
{
-
 
479
	if (http_transfer<>0) PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
489
{
480
	StopLoading();
490
	StopLoading();
481
	strcpy(#editURL, #URL);
491
	strcpy(#editURL, #URL);
482
	BrowserHistory.AddUrl();
-
 
483
	strcpy(#header, #version);
-
 
484
	pre_text =0;
-
 
485
	WB1.list.ClearList();
492
	BrowserHistory.AddUrl();
486
	if (strncmp(#URL,"http:",5)==0)
493
	if (strncmp(#URL,"http:",5)==0)
-
 
494
	{
487
	{
495
		_PutImage(88,10, 24,24, #stop_btn);
488
		http_get stdcall (#URL, #accept_language);
496
		http_get stdcall (#URL, #accept_language);
489
		http_transfer = EAX;
-
 
490
		cur_encoding = _DEFAULT;
497
		http_transfer = EAX;
491
		IF (http_transfer < 0) notify("Error from HTTP lib");
-
 
492
		Draw_Window();
-
 
493
		return;
498
		IF (http_transfer < 0) notify("Error from HTTP lib");
494
	}
499
	}
495
	else
500
	else
496
	{
501
	{
497
		file_size stdcall (#URL);
502
		file_size stdcall (#URL);
498
		bufsize = EBX;
503
		bufsize = EBX;
499
		if (!bufsize) return;
504
		if (!bufsize) return;
500
		mem_Free(bufpointer);
-
 
501
		cur_encoding = _DEFAULT;
-
 
502
		if (o_bufpointer) o_bufpointer = free(o_bufpointer);
505
		mem_Free(bufpointer);
-
 
506
		bufpointer = mem_Alloc(bufsize);
503
		bufpointer = mem_Alloc(bufsize);
507
		SetPageDefaults();
504
		ReadFile(0, bufsize, bufpointer, #URL);	
-
 
505
	}
508
		ReadFile(0, bufsize, bufpointer, #URL);	
506
	ShowPage();
509
		ShowPage();
-
 
510
	}
Line 507... Line 511...
507
}
511
}
508
 
512
 
509
void ShowPage()
513
void ShowPage()
510
{
514
{