Subversion Repositories Kolibri OS

Rev

Rev 2433 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2413 leency 1
struct UrlsHistory {
2605 leency 2
	dword CurrentUrl();
2413 leency 3
	void AddUrl();
4
	void GoBack();
2605 leency 5
	void GoForward();
2413 leency 6
};
7
 
8
UrlsHistory BrowserHistory;
9
 
2605 leency 10
struct path_string {
11
char Item[4096];
12
};
13
 
14
#define MAX_HISTORY_NUM 40
15
path_string history_list[MAX_HISTORY_NUM];
16
int history_num;
17
int history_current;
18
 
19
dword UrlsHistory::CurrentUrl()
2413 leency 20
{
2605 leency 21
	return #history_list[history_current].Item;
2413 leency 22
}
23
 
2605 leency 24
void UrlsHistory::AddUrl() //тут нужен вводимый элемент - для универсальности
2413 leency 25
{
2605 leency 26
	if (history_num>0) && (strcmp(#URL,#history_list[history_current].Item)==0) return;
27
 
28
	if (history_current>=MAX_HISTORY_NUM-1)
29
	{
30
		history_current/=2;
31
		for (i=0; i
32
		{
33
			copystr(#history_list[MAX_HISTORY_NUM-i].Item, #history_list[i].Item);
34
		}
35
	}
36
	history_current++;
37
	copystr(#URL,#history_list[history_current].Item);
38
	history_num=history_current;
2413 leency 39
}
40
 
2605 leency 41
 
42
void UrlsHistory::GoBack()
2413 leency 43
{
2605 leency 44
	if (history_current<=2) return;
45
	history_current--;
46
	copystr(#history_list[history_current].Item,#URL);
2413 leency 47
}
2605 leency 48
 
49
 
50
void UrlsHistory::GoForward()
51
{
52
	if (history_current==history_num) return;
53
	history_current++;
54
	copystr(#history_list[history_current].Item,#URL);
55
}