Subversion Repositories Kolibri OS

Rev

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

Rev 7738 Rev 7739
Line 1... Line 1...
1
//HTML Viewer in C--
1
//HTML Viewer in C--
2
//Copyright 2007-2019 by Veliant & Leency
2
//Copyright 2007-2020 by Veliant & Leency
3
//Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
3
//Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
Line 4... Line 4...
4
 
4
 
5
#ifndef AUTOBUILD
5
#ifndef AUTOBUILD
6
	#include "lang.h--"
6
	#include "lang.h--"
Line 29... Line 29...
29
_http http = {0, 0, 0, 0, 0, 0, 0};
29
_http http = {0, 0, 0, 0, 0, 0, 0};
Line 30... Line 30...
30
 
30
 
Line 31... Line 31...
31
char homepage[] = FROM "html\\homepage.htm""\0";
31
char homepage[] = FROM "html\\homepage.htm""\0";
32
 
32
 
33
#ifdef LANG_RUS
33
#ifdef LANG_RUS
34
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.82";
34
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.83";
35
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
35
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
36
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
36
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
37
char loading[] = "‡ £à㧪  áâà ­¨æë...
";
37
char loading[] = "‡ £à㧪  áâà ­¨æë...
";
Line 44... Line 44...
44
Œ¥­¥¤¦¥à § £à㧮ª";
44
Œ¥­¥¤¦¥à § £à㧮ª";
45
char link_menu[] =
45
char link_menu[] =
46
"Š®¯¨à®¢ âì áá뫪ã
46
"Š®¯¨à®¢ âì áá뫪ã
47
‘ª ç âì ᮤ¥à¦¨¬®¥ áá뫪¨";
47
‘ª ç âì ᮤ¥à¦¨¬®¥ áá뫪¨";
48
#else
48
#else
49
char version[]="Text-based Browser 1.82";
49
char version[]="Text-based Browser 1.83";
50
?define IMAGES_CACHE_CLEARED "Images cache cleared"
50
?define IMAGES_CACHE_CLEARED "Images cache cleared"
51
?define T_LAST_SLIDE "This slide is the last"
51
?define T_LAST_SLIDE "This slide is the last"
52
char loading[] = "Loading...
";
52
char loading[] = "Loading...
";
53
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
53
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
54
char accept_language[]= "Accept-Language: en\n";
54
char accept_language[]= "Accept-Language: en\n";
Line 424... Line 424...
424
	if (!strncmp(#URL,"WebView:",8))
424
	if (!strncmp(#URL,"WebView:",8))
425
	{
425
	{
426
		SetPageDefaults();
426
		SetPageDefaults();
427
		if (!strcmp(#URL, URL_SERVICE_HOME)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
427
		if (!strcmp(#URL, URL_SERVICE_HOME)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
428
		else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
428
		else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
-
 
429
		else {bufsize=0; ShowPage();} //page not found
429
		DrawEditBoxWebView();
430
		DrawEditBoxWebView();
430
		return;
431
		return;
431
	}
432
	}
432
	if (!strncmp(#URL,"http:",5)) || (!strncmp(#URL,"https://",8)) 
433
	if (!strncmp(#URL,"http:",5)) || (!strncmp(#URL,"https://",8)) 
433
	{
434
	{
Line 452... Line 453...
452
		}
453
		}
453
	}
454
	}
454
	else
455
	else
455
	{
456
	{
456
		file_size stdcall (#URL);
457
		file_size stdcall (#URL);
457
		bufsize = EBX;
-
 
458
		if (bufsize)
458
		if (EBX)
459
		{
459
		{
-
 
460
			bufsize = EBX;
460
			free(bufpointer);
461
			free(bufpointer);
461
			bufpointer = malloc(bufsize);
462
			bufpointer = malloc(bufsize);
462
			SetPageDefaults();
463
			SetPageDefaults();
463
			ReadFile(0, bufsize, bufpointer, #URL);
464
			ReadFile(0, bufsize, bufpointer, #URL);
464
		}
465
		}
Line 507... Line 508...
507
	if (wv_progress_bar.max) persent = wv_progress_bar.value*100/wv_progress_bar.max; else persent = 10;
508
	if (wv_progress_bar.max) persent = wv_progress_bar.value*100/wv_progress_bar.max; else persent = 10;
508
	DrawBar(address_box.left-2, address_box.top+20, persent*address_box.width/100, 2, wv_progress_bar.progress_color);
509
	DrawBar(address_box.left-2, address_box.top+20, persent*address_box.width/100, 2, wv_progress_bar.progress_color);
509
}
510
}
Line 510... Line -...
510
 
-
 
511
 
511
 
-
 
512
 
-
 
513
void ClickLink()
512
char anchor[256];
514
char anchor[256];
513
void ClickLink()
515
int anchor_pos;
514
{
516
{
515
	if (http.transfer > 0) 
517
	if (http.transfer > 0) 
516
	{
518
	{
Line 535... Line 537...
535
		DrawEditBoxWebView();
537
		DrawEditBoxWebView();
536
		WB1.DrawPage();
538
		WB1.DrawPage();
537
		return;
539
		return;
538
	}
540
	}
539
	//liner.ru#1
541
	//liner.ru#1
540
	if (strrchr(#URL, '#')!=0)
542
	else if (strrchr(#URL, '#')!=0)
541
	{
543
	{
-
 
544
		anchor_pos = strrchr(#URL, '#')-1;
542
		strlcpy(#anchor, #URL+strrchr(#URL, '#'), sizeof(anchor));
545
		strlcpy(#anchor, #URL+anchor_pos, sizeof(anchor));
543
		URL[strrchr(#URL, '#')-1] = 0x00;
546
		URL[anchor_pos] = 0x00;
-
 
547
		OpenPage();
-
 
548
		strcat(#editURL, #anchor);
-
 
549
		DrawEditBoxWebView();
-
 
550
		if (anchors.get_anchor_pos(#anchor+1)!=-1) WB1.list.first = anchors.get_anchor_pos(#anchor+1);
-
 
551
		WB1.DrawPage();
-
 
552
		return;
544
	}
553
	}
Line 545... Line 554...
545
 
554
 
546
	if (!strncmp(#URL,"mailto:", 7))
555
	if (!strncmp(#URL,"mailto:", 7))
547
	{
556
	{