Subversion Repositories Kolibri OS

Rev

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

Rev 7910 Rev 7914
Line 28... Line 28...
28
//useful patterns
28
//useful patterns
29
#include "..\lib\patterns\history.h"
29
#include "..\lib\patterns\history.h"
30
#include "..\lib\patterns\http_downloader.h"
30
#include "..\lib\patterns\http_downloader.h"
31
#include "..\lib\patterns\simple_open_dialog.h"
31
#include "..\lib\patterns\simple_open_dialog.h"
32
#include "..\lib\patterns\toolbar_button.h"
32
#include "..\lib\patterns\toolbar_button.h"
-
 
33
#include "..\lib\patterns\restart_process.h"
Line 33... Line 34...
33
 
34
 
34
#include "texts.h"
35
#include "texts.h"
35
#include "cache.h"
36
#include "cache.h"
36
#include "show_src.h"
37
#include "show_src.h"
Line 99... Line 100...
99
edit_box address_box = {, PADDING+TSZE*2+PADDING+6, PADDING+3, 0xffffff,
100
edit_box address_box = {, PADDING+TSZE*2+PADDING+6, PADDING+3, 0xffffff,
100
	0x94AECE, 0xffffff, 0xffffff,0x10000000,URL_SIZE-2,#editURL,0,,19,19};
101
	0x94AECE, 0xffffff, 0xffffff,0x10000000,URL_SIZE-2,#editURL,0,,19,19};
Line 101... Line 102...
101
 
102
 
Line -... Line 103...
-
 
103
char editbox_icons[] = FROM "editbox_icons.raw";
Line 102... Line 104...
102
char editbox_icons[] = FROM "editbox_icons.raw";
104
 
103
 
105
dword shared_url;
104
 
106
 
105
void LoadLibraries()
107
void LoadLibraries()
Line 128... Line 130...
128
			ExitProcess();
130
			ExitProcess();
129
		} else if (!strncmp(#param, "-source ", 8)) {
131
		} else if (!strncmp(#param, "-source ", 8)) {
130
			source_mode = true;
132
			source_mode = true;
131
			history.add(#param + 8);
133
			history.add(#param + 8);
132
		} else {
134
		} else {
-
 
135
			if (GetProcessesCount("WEBVIEW") == 1) {
133
			history.add(#param);
136
				history.add(#param);
-
 
137
			} else {
-
 
138
				shared_url = memopen(#webview_shared, URL_SIZE+1, SHM_OPEN + SHM_WRITE);
-
 
139
				strncpy(shared_url, #param, URL_SIZE);
-
 
140
				ExitProcess();
-
 
141
			}
134
		}
142
		}
135
	} else {
143
	} else {
136
		history.add(URL_SERVICE_HOMEPAGE);
144
		history.add(URL_SERVICE_HOMEPAGE);
137
	}
145
	}
-
 
146
	shared_url = memopen(#webview_shared, URL_SIZE+1, SHM_CREATE + SHM_WRITE);
138
}
147
}
Line 139... Line 148...
139
 
148
 
140
void main()
149
void main()
141
{
150
{
Line 146... Line 155...
146
	HandleParam();
155
	HandleParam();
147
	WB1.list.SetFont(8, 14, 10011000b);
156
	WB1.list.SetFont(8, 14, 10011000b);
148
	WB1.list.no_selection = true;
157
	WB1.list.no_selection = true;
149
	WB1.custom_encoding = -1;
158
	WB1.custom_encoding = -1;
150
	SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK);
159
	SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK);
151
	loop() switch(WaitEvent())
160
	loop() switch(@WaitEventTimeout(30))
152
	{
161
	{
153
		case evMouse:
162
		case evMouse:
154
			edit_box_mouse stdcall (#address_box);
163
			edit_box_mouse stdcall (#address_box);
155
			mouse.get();
164
			mouse.get();
156
			if (PageLinks.HoverAndProceed(mouse.x, WB1.list.first + mouse.y, WB1.list.y, WB1.list.first))
165
			if (PageLinks.HoverAndProceed(mouse.x, WB1.list.first + mouse.y, WB1.list.y, WB1.list.first))
Line 244... Line 253...
244
				redirect_count = 0;
253
				redirect_count = 0;
245
				http.free();
254
				http.free();
246
				pages_cache.add(history.current(), http.content_pointer, http.content_received);
255
				pages_cache.add(history.current(), http.content_pointer, http.content_received);
247
				LoadInternalPage(http.content_pointer, http.content_received);
256
				LoadInternalPage(http.content_pointer, http.content_received);
248
			}
257
			}
-
 
258
			break;
-
 
259
		default:
-
 
260
			if (ESDWORD[shared_url] != '\0') {
-
 
261
				EventOpenNewTab(shared_url);
-
 
262
				ESDWORD[shared_url] = '\0';
-
 
263
				ActivateWindow(GetProcessSlot(Form.ID));
-
 
264
			}
249
	}
265
	}
250
}
266
}
Line 251... Line 267...
251
 
267
 
252
bool ProcessCtrlKeyEvent()
268
bool ProcessCtrlKeyEvent()