Subversion Repositories Kolibri OS

Rev

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

Rev 7759 Rev 7762
Line 33... Line 33...
33
#include "download_manager.h"
33
#include "download_manager.h"
34
_history history;
34
_history history;
35
#include "history.h"
35
#include "history.h"
36
bool debug_mode = false;
36
bool debug_mode = false;
37
#include "..\TWB\TWB.c" //HTML Parser, a core component
37
#include "..\TWB\TWB.c" //HTML Parser, a core component
-
 
38
#include "texts.h"
Line 38... Line 39...
38
 
39
 
Line 39... Line -...
39
TWebBrowser WB1;
-
 
40
 
-
 
41
char version[]="WebView 2.1";
-
 
42
 
-
 
43
#ifdef LANG_RUS
-
 
44
char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";
-
 
45
char homepage[] = FROM "html\\homepage_ru.htm""\0";
-
 
46
char help[] = FROM "html\\help_ru.htm""\0";
-
 
47
char accept_language[]= "Accept-Language: ru\n";
-
 
48
char rmb_menu[] = 
-
 
49
"®á¬®âà¥âì ¨á室­¨ª
-
 
50
¥¤ ªâ¨à®¢ âì ¨á室­¨ª";
-
 
51
char main_menu[] = 
-
 
52
"Žâªàëâì ä ©«
-
 
53
®¢®¥ ®ª­®
-
 
54
ˆáâ®à¨ï
-
 
55
Œ¥­¥¤¦¥à § £à㧮ª";
-
 
56
char link_menu[] =
-
 
57
"Š®¯¨à®¢ âì áá뫪ã
-
 
58
‘ª ç âì ᮤ¥à¦¨¬®¥ áá뫪¨";
-
 
59
char loading_text[] = "‡ £à㧪 ...";
-
 
60
#else
-
 
61
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
-
 
62
char homepage[] = FROM "html\\homepage_en.htm""\0";
-
 
63
char help[] = FROM "html\\help_en.htm""\0";
-
 
64
char accept_language[]= "Accept-Language: en\n";
-
 
65
char rmb_menu[] =
-
 
66
"View source
-
 
67
Edit source";
-
 
68
char main_menu[] = 
-
 
69
"Open local file
-
 
70
New window
-
 
71
History
-
 
72
Download Manager";
-
 
73
char link_menu[] =
-
 
74
"Copy link
-
 
75
Download link contents";
-
 
76
char loading_text[] = "Loading...";
-
 
77
#endif
40
TWebBrowser WB1;
Line 78... Line -...
78
 
-
 
79
#define URL_SIZE 4000
-
 
80
 
-
 
81
#define URL_SERVICE_HISTORY "WebView:history"
-
 
82
#define URL_SERVICE_HOMEPAGE "WebView:home"
41
 
83
#define URL_SERVICE_HELP "WebView:help"
42
#define URL_SIZE 4000
84
 
43
 
85
#define PADDING 9
44
#define PADDING 9
86
#define SKIN_Y 24
45
#define SKIN_Y 24
Line 155... Line 114...
155
 
114
 
156
void main()
115
void main()
157
{
116
{
158
	int i, btn, redirect_count=0;
117
	int i, btn, redirect_count=0;
159
	LoadLibraries();
118
	LoadLibraries();
-
 
119
	CreateDir("/tmp0/1/Downloads");
160
	CreateDir("/tmp0/1/downloads");
120
	CreateDir("/tmp0/1/WebView_Cache");
161
	Libimg_LoadImage(#skin, "/sys/toolbar.png");
121
	Libimg_LoadImage(#skin, "/sys/toolbar.png");
162
	HandleParam();
122
	HandleParam();
163
	skin.h = 26;
123
	skin.h = 26;
164
	WB1.list.SetFont(8, 14, 10011000b);
124
	WB1.list.SetFont(8, 14, 10011000b);
Line 488... Line 448...
488
	//We will bring it back when we get the buffer
448
	//We will bring it back when we get the buffer
489
	if (strrchr(#new_url, '#')) anchors.take_anchor_from(#new_url);
449
	if (strrchr(#new_url, '#')) anchors.take_anchor_from(#new_url);
Line 490... Line 450...
490
 
450
 
Line -... Line 451...
-
 
451
	history.add(#new_url);
-
 
452
 
-
 
453
	if (pages_cache.have(#new_url)) {
491
	history.add(#new_url);
454
		LoadInternalPage(pages_cache.current_page_buf, pages_cache.pages_cache.current_page_size);
492
 
455
	}
493
	if (!strncmp(#new_url,"WebView:",8)) {
456
	else if (!strncmp(#new_url,"WebView:",8)) {
494
		//INTERNAL PAGE
457
		//INTERNAL PAGE
495
		if (!strcmp(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#homepage, sizeof(homepage));
458
		if (!strcmp(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#homepage, sizeof(homepage));
496
		else if (!strcmp(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#help, sizeof(help));
459
		else if (!strcmp(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#help, sizeof(help));