Subversion Repositories Kolibri OS

Rev

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

Rev 6794 Rev 6795
Line 13... Line 13...
13
#include "..\lib\draw_buf.h"
13
#include "..\lib\draw_buf.h"
14
#include "..\lib\list_box.h"
14
#include "..\lib\list_box.h"
15
#include "..\lib\cursor.h"
15
#include "..\lib\cursor.h"
16
#include "..\lib\collection.h"
16
#include "..\lib\collection.h"
17
#include "..\lib\menu.h"
17
#include "..\lib\menu.h"
-
 
18
#include "..\lib\random.h"
Line 18... Line 19...
18
 
19
 
19
//*.obj libraries
20
//*.obj libraries
20
#include "..\lib\obj\box_lib.h"
21
#include "..\lib\obj\box_lib.h"
21
#include "..\lib\obj\libio_lib.h"
22
#include "..\lib\obj\libio_lib.h"
Line 28... Line 29...
28
#include "..\lib\patterns\http_downloader.h"
29
#include "..\lib\patterns\http_downloader.h"
Line 29... Line 30...
29
 
30
 
Line 30... Line 31...
30
char homepage[] = FROM "html\\homepage.htm""\0";
31
char homepage[] = FROM "html\\homepage.htm""\0";
31
 
32
 
32
#ifdef LANG_RUS
33
#ifdef LANG_RUS
33
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.57";
34
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.58";
34
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
35
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
35
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
36
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
36
char loading[] = "‡ £à㧪  áâà ­¨æë...
";
37
char loading[] = "‡ £à㧪  áâà ­¨æë...
";
Line 41... Line 42...
41
¥¤ ªâ¨à®¢ âì ¨á室­¨ª
42
¥¤ ªâ¨à®¢ âì ¨á室­¨ª
42
ˆáâ®à¨ï
43
ˆáâ®à¨ï
43
Žç¨áâ¨âì ªíè ª à⨭®ª
44
Žç¨áâ¨âì ªíè ª à⨭®ª
44
Œ¥­¥¤¦¥à § £à㧮ª";
45
Œ¥­¥¤¦¥à § £à㧮ª";
45
#else
46
#else
46
char version[]="Text-based Browser 1.57";
47
char version[]="Text-based Browser 1.58";
47
?define IMAGES_CACHE_CLEARED "Images cache cleared"
48
?define IMAGES_CACHE_CLEARED "Images cache cleared"
48
?define T_LAST_SLIDE "This slide is the last"
49
?define T_LAST_SLIDE "This slide is the last"
49
char loading[] = "Loading...
";
50
char loading[] = "Loading...
";
50
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
51
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
51
char accept_language[]= "Accept-Language: en\n";
52
char accept_language[]= "Accept-Language: en\n";
Line 55... Line 56...
55
History
56
History
56
Free image cache
57
Free image cache
57
Download Manager";
58
Download Manager";
58
#endif
59
#endif
Line -... Line 60...
-
 
60
 
-
 
61
char link_menu[] =
-
 
62
"Copy link
-
 
63
Download link";
59
 
64
 
60
#define URL_SERVICE_HISTORY "WebView://history"
65
#define URL_SERVICE_HISTORY "WebView://history"
61
#define URL_SERVICE_HOME "WebView://home"
66
#define URL_SERVICE_HOME "WebView://home"
Line 62... Line 67...
62
#define URL_SERVICE_SOURCE "WebView://source:"
67
#define URL_SERVICE_SOURCE "WebView://source:"
Line 85... Line 90...
85
enum { 
90
enum { 
86
	BACK_BUTTON=1000, 
91
	BACK_BUTTON=1000, 
87
	FORWARD_BUTTON, 
92
	FORWARD_BUTTON, 
88
	REFRESH_BUTTON, 
93
	REFRESH_BUTTON, 
89
	GOTOURL_BUTTON, 
94
	GOTOURL_BUTTON, 
90
	SANDWICH_BUTTON
95
	SANDWICH_BUTTON,
91
};
-
 
92
 
-
 
93
enum {
-
 
94
	VIEW_SOURCE=1100,
96
	VIEW_SOURCE=1100,
95
	EDIT_SOURCE,
97
	EDIT_SOURCE,
96
	VIEW_HISTORY,
98
	VIEW_HISTORY,
97
	FREE_IMG_CACHE,
99
	FREE_IMG_CACHE,
98
	DOWNLOAD_MANAGER
100
	DOWNLOAD_MANAGER,
-
 
101
	COPY_LINK=1200,
-
 
102
	DOWNLOAD_LINK
99
};
103
};
Line 100... Line 104...
100
 
104
 
101
#include "..\TWB\TWB.c"
105
#include "..\TWB\TWB.c"
102
#include "history.h"
106
#include "history.h"
Line 132... Line 136...
132
				if (!CheckActiveProcess(Form.ID)) break;
136
				if (!CheckActiveProcess(Form.ID)) break;
133
				edit_box_mouse stdcall (#address_box);
137
				edit_box_mouse stdcall (#address_box);
134
				mouse.get();
138
				mouse.get();
135
				if (WB1.list.MouseOver(mouse.x, mouse.y))
139
				if (WB1.list.MouseOver(mouse.x, mouse.y))
136
				{
140
				{
137
					PageLinks.Hover(mouse.x, WB1.list.first + mouse.y, link_color_inactive, link_color_active, bg_color);
141
					if (PageLinks.HoverAndProceed(mouse.x, WB1.list.first + mouse.y))
138
					if (bufsize) && (mouse.pkm) && (mouse.up) {
142
					&& (bufsize) && (mouse.pkm) && (mouse.up) {
139
						EventShowMenu(mouse.x, mouse.y);
143
						EventShowPageMenu(mouse.x, mouse.y);
140
						break;
144
						break;
141
					}
145
					}
142
					if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
146
					if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
143
				}
147
				}
144
				scrollbar_v_mouse (#scroll_wv);
148
				scrollbar_v_mouse (#scroll_wv);
Line 173... Line 177...
173
			case evReDraw:
177
			case evReDraw:
174
				if (menu.list.cur_y) {
178
				if (menu.list.cur_y) {
175
					ProcessEvent(menu.list.cur_y);
179
					ProcessEvent(menu.list.cur_y);
176
					menu.list.cur_y = 0;
180
					menu.list.cur_y = 0;
177
				}
181
				}
178
				DefineAndDrawWindow(GetScreenWidth()-800/2,GetScreenHeight()-600/2,800,600,0x73,col_bg,0,0);
182
				DefineAndDrawWindow(GetScreenWidth()-800/2-random(80),GetScreenHeight()-600/2-random(80),800,600,0x73,col_bg,0,0);
179
				GetProcessInfo(#Form, SelfInfo);
183
				GetProcessInfo(#Form, SelfInfo);
180
				if (Form.status_window>2) { DrawTitle(#header); break; }
184
				if (Form.status_window>2) { DrawTitle(#header); break; }
181
				if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; }
185
				if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; }
182
				if (Form.width<280) { MoveSize(OLD,OLD,280,OLD); break; }
186
				if (Form.width<280) { MoveSize(OLD,OLD,280,OLD); break; }
183
				Draw_Window();
187
				Draw_Window();
Line 341... Line 345...
341
				Draw_Window();
345
				Draw_Window();
342
			}
346
			}
343
			else OpenPage();
347
			else OpenPage();
344
			return;
348
			return;
345
		case SANDWICH_BUTTON:
349
		case SANDWICH_BUTTON:
346
			EventShowMenu(Form.cwidth - 215, TOOLBAR_H-6);
350
			EventShowPageMenu(Form.cwidth - 215, TOOLBAR_H-6);
347
			return;
351
			return;
348
		case VIEW_SOURCE:
352
		case VIEW_SOURCE:
349
			WB1.list.first = 0;
353
			WB1.list.first = 0;
350
			ShowSource();
354
			ShowSource();
351
			WB1.LoadInternalPage(bufpointer, bufsize);
355
			WB1.LoadInternalPage(bufpointer, bufsize);
Line 572... Line 576...
572
		}
576
		}
573
	}
577
	}
574
	OpenPage();
578
	OpenPage();
575
}
579
}
Line 576... Line 580...
576
 
580
 
577
void EventShowMenu(dword _left, _top)
581
void EventShowPageMenu(dword _left, _top)
578
{
582
{
579
	menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 220, #rmb_menu, VIEW_SOURCE);
583
	menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 220, #rmb_menu, VIEW_SOURCE);
Line -... Line 584...
-
 
584
}
-
 
585
 
-
 
586
void EventShowLinkMenu(dword _left, _top)
-
 
587
{
-
 
588
	menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 180, #link_menu, COPY_LINK);
-
 
589
}
580
}
590
 
581
 
591
 
582
void ShowErrorMessageThatHttpsIsNotSupportedYet()
592
void ShowErrorMessageThatHttpsIsNotSupportedYet()
583
{
593
{
Line -... Line 594...
-
 
594
	notify("'HTTPS protocol is not supported yet' -E");
-
 
595
}
-
 
596
 
-
 
597
DrawStatusBar(dword _status_text)
-
 
598
{
-
 
599
	status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10;
-
 
600
	status_text.start_y = Form.cheight - STATUSBAR_H + 3;
-
 
601
	status_text.area_size_x = Form.cwidth - status_text.start_x -3;
-
 
602
	DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
-
 
603
	status_text.text_pointer = _status_text;
-
 
604
	PathShow_prepare stdcall(#status_text);
584
	notify("'HTTPS protocol is not supported yet' -E");
605
	PathShow_draw stdcall(#status_text);
585
}
606
}