Subversion Repositories Kolibri OS

Rev

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

Rev 6783 Rev 6794
Line 28... Line 28...
28
#include "..\lib\patterns\http_downloader.h"
28
#include "..\lib\patterns\http_downloader.h"
Line 29... Line 29...
29
 
29
 
Line 30... Line 30...
30
char homepage[] = FROM "html\\homepage.htm""\0";
30
char homepage[] = FROM "html\\homepage.htm""\0";
31
 
31
 
32
#ifdef LANG_RUS
32
#ifdef LANG_RUS
33
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.56";
33
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.57";
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[] = "‡ £à㧪  áâà ­¨æë...
";
Line 41... Line 41...
41
¥¤ ªâ¨à®¢ âì ¨á室­¨ª
41
¥¤ ªâ¨à®¢ âì ¨á室­¨ª
42
ˆáâ®à¨ï
42
ˆáâ®à¨ï
43
Žç¨áâ¨âì ªíè ª à⨭®ª
43
Žç¨áâ¨âì ªíè ª à⨭®ª
44
Œ¥­¥¤¦¥à § £à㧮ª";
44
Œ¥­¥¤¦¥à § £à㧮ª";
45
#else
45
#else
46
char version[]="Text-based Browser 1.56";
46
char version[]="Text-based Browser 1.57";
47
?define IMAGES_CACHE_CLEARED "Images cache cleared"
47
?define IMAGES_CACHE_CLEARED "Images cache cleared"
48
?define T_LAST_SLIDE "This slide is the last"
48
?define T_LAST_SLIDE "This slide is the last"
49
char loading[] = "Loading...
";
49
char loading[] = "Loading...
";
50
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
50
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
51
char accept_language[]= "Accept-Language: en\n";
51
char accept_language[]= "Accept-Language: en\n";
Line 132... Line 132...
132
				if (!CheckActiveProcess(Form.ID)) break;
132
				if (!CheckActiveProcess(Form.ID)) break;
133
				edit_box_mouse stdcall (#address_box);
133
				edit_box_mouse stdcall (#address_box);
134
				mouse.get();
134
				mouse.get();
135
				if (WB1.list.MouseOver(mouse.x, mouse.y))
135
				if (WB1.list.MouseOver(mouse.x, mouse.y))
136
				{
136
				{
137
					PageLinks.Hover(mouse.x, WB1.list.first*WB1.list.item_h + mouse.y, link_color_inactive, link_color_active, bg_color);
137
					PageLinks.Hover(mouse.x, WB1.list.first + mouse.y, link_color_inactive, link_color_active, bg_color);
138
					if (bufsize) && (mouse.pkm) && (mouse.up) {
138
					if (bufsize) && (mouse.pkm) && (mouse.up) {
139
						EventShowMenu(mouse.x, mouse.y);
139
						EventShowMenu(mouse.x, mouse.y);
140
						break;
140
						break;
141
					}
141
					}
142
					if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
142
					if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
Line 212... Line 212...
212
										$stosb;
212
										$stosb;
213
									} while (AL != 0) && (AL != 13) && (AL != 10);
213
									} while (AL != 0) && (AL != 13) && (AL != 10);
214
									DSBYTE[EDI-1]='\0';
214
									DSBYTE[EDI-1]='\0';
215
									if (!strncmp(#URL,"https://",8))
215
									if (!strncmp(#URL,"https://",8))
216
									{
216
									{
217
										notify("HTTPS protocol is not supported yet");
217
										ShowErrorMessageThatHttpsIsNotSupportedYet();
218
										StopLoading();
218
										StopLoading();
219
										break;	
219
										break;	
220
									}
220
									}
221
								}
221
								}
222
							}
222
							}
Line 260... Line 260...
260
}
260
}
Line 261... Line 261...
261
 
261
 
262
void SetElementSizes()
262
void SetElementSizes()
263
{
263
{
-
 
264
	address_box.top = TOOLBAR_H/2-10;
264
	address_box.top = TOOLBAR_H/2-10;
265
	basic_line_h = calc(WB1.list.font_h * 130) / 100;
265
	address_box.width = Form.cwidth - address_box.left - 50;
266
	address_box.width = Form.cwidth - address_box.left - 50;
266
	WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, 
267
	WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, 
267
		Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom);
268
		Form.cheight - TOOLBAR_H - STATUSBAR_H, basic_line_h);
268
	WB1.list.wheel_size = 7;
269
	WB1.list.wheel_size = 7 * basic_line_h;
269
	WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
270
	WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
270
	WB1.list.visible = WB1.list.h - 5 / WB1.list.item_h;
271
	WB1.list.visible = WB1.list.h;
271
	if (WB1.list.w!=WB1.DrawBuf.bufw) {
272
	if (WB1.list.w!=WB1.DrawBuf.bufw) {
272
		WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, 2048 * WB1.list.item_h);
273
		WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, 2048 * WB1.list.item_h);
273
		ProcessEvent(REFRESH_BUTTON);
274
		ProcessEvent(REFRESH_BUTTON);
274
	}
275
	}
Line 396... Line 397...
396
 
397
 
397
void SetPageDefaults()
398
void SetPageDefaults()
398
{
399
{
399
	strcpy(#header, #version);
400
	strcpy(#header, #version);
400
	WB1.list.count = WB1.list.first = 0;
-
 
401
	stroka = 0;
401
	WB1.list.count = WB1.list.first = 0;
402
	cur_encoding = CH_NULL;
402
	cur_encoding = CH_NULL;
403
	if (o_bufpointer) o_bufpointer = free(o_bufpointer);
403
	if (o_bufpointer) o_bufpointer = free(o_bufpointer);
404
	anchor_line_num=WB1.list.first;
404
	anchor_y = WB1.list.first;
405
	//anchor[0]='|';
405
	//anchor[0]='|';
406
	anchor=NULL;
406
	anchor=NULL;
Line 407... Line 407...
407
}
407
}
Line 472... Line 472...
472
	}
472
	}
473
	else
473
	else
474
	{
474
	{
475
		WB1.Prepare();
475
		WB1.Prepare();
476
	}
476
	}
477
	if (!strcmp(#version, #header)) DrawTitle(#header);
-
 
478
}
477
}
Line 479... Line 478...
479
 
478
 
480
byte UrlExtIs(dword ext)
479
byte UrlExtIs(dword ext)
481
{
480
{
Line 543... Line 542...
543
		return;
542
		return;
544
	}
543
	}
Line 545... Line 544...
545
 
544
 
546
	if (!strncmp(#URL,"https://",8))
545
	if (!strncmp(#URL,"https://",8))
547
	{
546
	{
548
		notify("'HTTPS protocol is not supported yet' -E");	
547
		ShowErrorMessageThatHttpsIsNotSupportedYet();
Line 549... Line 548...
549
	}
548
	}
Line 550... Line 549...
550
	
549
	
Line 561... Line 560...
561
		}
560
		}
562
	}
561
	}
563
	else	
562
	else	
564
	{
563
	{
565
		if (UrlExtIs(".png")==true) || (UrlExtIs(".gif")==true) || (UrlExtIs(".jpg")==true) 
564
		if (UrlExtIs(".png")==true) || (UrlExtIs(".gif")==true) || (UrlExtIs(".jpg")==true) 
566
		|| (UrlExtIs(".zip")==true) || (UrlExtIs(".kex")==true)
565
		|| (UrlExtIs(".zip")==true) || (UrlExtIs(".kex")==true) || (UrlExtIs(".pdf")==true)
567
		|| (UrlExtIs(".7z")==true) || (UrlExtIs("netcfg")==true) {		
566
		|| (UrlExtIs(".7z")==true) {
568
			strcpy(#downloader_edit, #URL);
567
			strcpy(#downloader_edit, #URL);
569
			CreateThread(#Downloader,#downloader_stak+4092);
568
			CreateThread(#Downloader,#downloader_stak+4092);
570
			strcpy(#editURL, history.current());
569
			strcpy(#editURL, history.current());
571
			strcpy(#URL, history.current());
570
			strcpy(#URL, history.current());
572
			return;
571
			return;
Line 578... Line 577...
578
void EventShowMenu(dword _left, _top)
577
void EventShowMenu(dword _left, _top)
579
{
578
{
580
	menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 220, #rmb_menu, VIEW_SOURCE);
579
	menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 220, #rmb_menu, VIEW_SOURCE);
581
}
580
}
Line -... Line 581...
-
 
581
 
-
 
582
void ShowErrorMessageThatHttpsIsNotSupportedYet()
-
 
583
{
-
 
584
	notify("'HTTPS protocol is not supported yet' -E");
-
 
585
}
582
 
586
 
583
stop:
587
stop: