Subversion Repositories Kolibri OS

Rev

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

Rev 4544 Rev 4718
Line 1... Line 1...
1
struct path_string {
1
struct path_string {
2
char Item[4096];
2
	char Item[sizeof(URL)];
-
 
3
	int was_first;
3
};
4
};
Line 4... Line 5...
4
 
5
 
5
#define MAX_HISTORY_NUM 40
6
#define MAX_HISTORY_NUM 40
Line 6... Line 7...
6
path_string history_list[MAX_HISTORY_NUM];
7
path_string history_list[MAX_HISTORY_NUM];
7
 
8
 
8
struct UrlsHistory {
9
struct UrlsHistory {
9
	int links_count;
10
	int links_count;
10
	int current;
11
	int current;
-
 
12
	dword CurrentUrl();
11
	dword CurrentUrl();
13
	dword GetUrl();
12
	dword GetUrl();
14
	dword GetFirstLine();
13
	void AddUrl();
15
	void AddUrl();
14
	byte GoBack();
16
	byte GoBack();
Line 21... Line 23...
21
 
23
 
22
dword UrlsHistory::GetUrl(int id) {
24
dword UrlsHistory::GetUrl(int id) {
23
	return #history_list[id].Item;
25
	return #history_list[id].Item;
Line -... Line 26...
-
 
26
}
-
 
27
 
-
 
28
dword UrlsHistory::GetFirstLine(int id) {
-
 
29
	return history_list[id].was_first;
24
}
30
}
25
 
31
 
26
void UrlsHistory::AddUrl() {
32
void UrlsHistory::AddUrl() {
Line 27... Line 33...
27
	int i;
33
	int i;
28
	if (links_count>0) && (!strcmp(#URL,#history_list[current].Item)) return;
34
	if (links_count>0) && (!strcmp(#URL,#history_list[current].Item)) return;
29
 
35
 
30
	if (current>=MAX_HISTORY_NUM-1)
36
	if (current>=MAX_HISTORY_NUM-1)
31
	{
37
	{
32
		current/=2;
38
		current/=2;
33
		for (i=0; i
39
		for (i=0; i
34
		{
40
		{
35
			strlcpy(#history_list[i].Item, #history_list[MAX_HISTORY_NUM-i].Item, sizeof(history_list[0].Item));
41
			strlcpy(#history_list[i].Item, #history_list[MAX_HISTORY_NUM-i].Item, sizeof(URL));
-
 
42
		}	
36
		}	
43
	}
37
	}
44
	current++;
38
	current++;
45
	// history_list[i].was_first = WB1.list.first;
Line 39... Line 46...
39
	strlcpy(#history_list[current].Item, #URL, sizeof(history_list[0].Item));
46
	strlcpy(#history_list[current].Item, #URL, sizeof(URL));
40
	links_count=current;
47
	links_count=current;
41
}
48
}
42
 
49
 
-
 
50
 
43
 
51
byte UrlsHistory::GoBack() {
44
byte UrlsHistory::GoBack() {
52
	if (current<=1) return 0;
Line 45... Line 53...
45
	if (current<=1) return 0;
53
	current--;