Subversion Repositories Kolibri OS

Rev

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

Rev 4415 Rev 4416
Line 4... Line 4...
4
	buf,
4
	buf,
5
	filesize,
5
	filesize,
6
	blink;
6
	blink;
7
 
7
 
Line -... Line 8...
-
 
8
#define URL param
-
 
9
 
-
 
10
int	mouse_twb;
-
 
11
edit_box address_box= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19};
-
 
12
scroll_bar scroll_wv = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
-
 
13
 
-
 
14
char editURL[sizeof(URL)],
-
 
15
	page_links[12000],
-
 
16
	header[2048];
-
 
17
 
-
 
18
 
-
 
19
 
8
char download_path[]="/rd/1/.download";
20
char download_path[]="/rd/1/.download";
9
char search_path[]="http://nigma.ru/index.php?s=";
-
 
Line 10... Line 21...
10
 
21
 
11
 
22
 
12
struct TWebBrowser {
23
struct TWebBrowser {
13
	llist list; //need #include "..\lib\list_box.h"
-
 
14
	void GetNewUrl();
24
	llist list; //need #include "..\lib\list_box.h"
15
	void OpenPage();
25
	void GetNewUrl();
16
	void ReadHtml(byte);
26
	void ReadHtml(byte);
17
	void ShowPage();
27
	void ShowPage();
18
	void ParseHTML(dword);
28
	void ParseHTML(dword);
Line 43... Line 53...
43
	parametr[1200],
53
	parametr[1200],
44
	options[4096],
54
	options[4096],
45
	anchor[256];
55
	anchor[256];
46
 
56
 
Line -... Line 57...
-
 
57
#include "..\TWB\history.h"
47
#include "..\TWB\colors.h"
58
#include "..\TWB\colors.h"
48
#include "..\TWB\unicode_tags.h"
59
#include "..\TWB\unicode_tags.h"
49
#include "..\TWB\img_cache.h"
60
#include "..\TWB\img_cache.h"
50
#include "..\TWB\some_code.h"
61
#include "..\TWB\some_code.h"
51
#include "..\TWB\parce_tag.h"
62
#include "..\TWB\parce_tag.h"
Line 155... Line 166...
155
	if (encoding==_KOI) koitodos(buf);
166
	if (encoding==_KOI) koitodos(buf);
156
}
167
}
157
 
168
 
Line 158... Line -...
158
 
-
 
159
void TWebBrowser::OpenPage()
-
 
160
{
-
 
161
	if (GetProcessSlot(downloader_id)<>0) PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
-
 
162
	KillProcess(downloader_id);
-
 
163
	strcpy(#editURL, #URL);
-
 
164
	BrowserHistory.AddUrl();
-
 
165
	strcpy(#header, #version);
-
 
166
	pre_text =0;
-
 
167
	if (!strcmp(get_URL_part(5),"http:")))
-
 
168
	{
-
 
169
		KillProcess(downloader_id);
-
 
170
		DeleteFile(#download_path);
-
 
171
		IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]=NULL;
-
 
172
		downloader_id = RunProgram("/sys/network/downloader", #URL);
-
 
173
		IF (downloader_id<0) notify("Error running Downloader. Internet unavilable.");
-
 
174
		Draw_Window();
-
 
175
		return;
-
 
176
	}
-
 
177
	list.first = list.count =0;
-
 
178
	ReadHtml(_WIN);
-
 
179
	WB1.ShowPage();
-
 
180
}
-
 
181
 
-
 
182
 
169
 
183
void TWebBrowser::ShowPage()
170
void TWebBrowser::ShowPage()
184
{
171
{
185
	address_box.size = address_box.pos = strlen(#editURL);
172
	address_box.size = address_box.pos = strlen(#editURL);
186
	address_box.offset=0;
173
	address_box.offset=0;
Line 187... Line 174...
187
	edit_box_draw stdcall(#address_box);
174
	edit_box_draw stdcall(#address_box);
188
 
175
 
189
	if (!filesize)
176
	if (!filesize)
190
	{
177
	{
191
		DrawBar(list.x, list.y, list.w+scroll1.size_x+1, list.h, 0xFFFFFF); //fill all
178
		DrawBar(list.x, list.y, list.w+scroll_wv.size_x+1, list.h, 0xFFFFFF); //fill all
192
		if (GetProcessSlot(downloader_id)<>0) WriteText(list.x + 10, list.y + 18, 0x80, 0, "Loading...");
179
		if (GetProcessSlot(downloader_id)<>0) WriteText(list.x + 10, list.y + 18, 0x80, 0, "Loading...");
193
		else
180
		else
194
		{
181
		{
Line 612... Line 599...
612
 
599
 
613
 
600
 
614
void TWebBrowser::DrawScroller() //íå îïòèìàëüíàÿ îòðèñîâêà, íî çàòî â îäíîì ìåñòå
601
void TWebBrowser::DrawScroller() //íå îïòèìàëüíàÿ îòðèñîâêà, íî çàòî â îäíîì ìåñòå
615
{
602
{
616
	scroll1.max_area = list.count;
603
	scroll_wv.max_area = list.count;
617
	scroll1.cur_area = list.visible;
604
	scroll_wv.cur_area = list.visible;
618
	scroll1.position = list.first;
605
	scroll_wv.position = list.first;
619
 
606
 
620
	scroll1.all_redraw=1;
607
	scroll_wv.all_redraw=1;
Line 621... Line 608...
621
	scroll1.start_x = WB1.list.x + WB1.list.w;
608
	scroll_wv.start_x = WB1.list.x + WB1.list.w;
622
	scroll1.size_y=WB1.list.h;
609
	scroll_wv.size_y=WB1.list.h;