Rev 4416 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4416 | Rev 4544 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | struct path_string { |
|
- | 2 | char Item[4096]; |
|
- | 3 | }; |
|
- | 4 | ||
- | 5 | #define MAX_HISTORY_NUM 40 |
|
- | 6 | path_string history_list[MAX_HISTORY_NUM]; |
|
- | 7 | ||
1 | struct UrlsHistory { |
8 | struct UrlsHistory { |
- | 9 | int links_count; |
|
- | 10 | int current; |
|
2 | dword CurrentUrl(); |
11 | dword CurrentUrl(); |
- | 12 | dword GetUrl(); |
|
3 | void AddUrl(); |
13 | void AddUrl(); |
4 | byte GoBack(); |
14 | byte GoBack(); |
5 | byte GoForward(); |
15 | byte GoForward(); |
6 | }; |
16 | }; |
Line 7... | Line 17... | ||
7 | 17 | ||
8 | UrlsHistory BrowserHistory; |
- | |
9 | 18 | dword UrlsHistory::CurrentUrl() { |
|
10 | struct path_string { |
- | |
11 | char Item[4096]; |
19 | return #history_list[current].Item; |
12 | }; |
- | |
13 | - | ||
14 | #define MAX_HISTORY_NUM 40 |
- | |
15 | path_string history_list[MAX_HISTORY_NUM]; |
- | |
16 | int history_num; |
- | |
Line 17... | Line 20... | ||
17 | int history_current; |
20 | } |
18 | - | ||
19 | dword UrlsHistory::CurrentUrl() |
21 | |
20 | { |
22 | dword UrlsHistory::GetUrl(int id) { |
Line 21... | Line 23... | ||
21 | return #history_list[history_current].Item; |
23 | return #history_list[id].Item; |
22 | } |
- | |
23 | 24 | } |
|
24 | void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè |
25 | |
Line 25... | Line 26... | ||
25 | { |
26 | void UrlsHistory::AddUrl() { |
26 | int i; |
27 | int i; |
27 | if (history_num>0) && (!strcmp(#URL,#history_list[history_current].Item)) return; |
28 | if (links_count>0) && (!strcmp(#URL,#history_list[current].Item)) return; |
28 | 29 | ||
29 | if (history_current>=MAX_HISTORY_NUM-1) |
30 | if (current>=MAX_HISTORY_NUM-1) |
30 | { |
31 | { |
31 | history_current/=2; |
32 | current/=2; |
32 | for (i=0; i |
33 | for (i=0; i |
33 | { |
34 | { |
34 | strlcpy(#history_list[i].Item, #history_list[MAX_HISTORY_NUM-i].Item, sizeof(history_list[0].Item)); |
35 | strlcpy(#history_list[i].Item, #history_list[MAX_HISTORY_NUM-i].Item, sizeof(history_list[0].Item)); |
35 | } |
36 | } |
36 | } |
37 | } |
Line 37... | Line 38... | ||
37 | history_current++; |
38 | current++; |
38 | strlcpy(#history_list[history_current].Item, #URL, sizeof(history_list[0].Item)); |
- | |
39 | history_num=history_current; |
39 | strlcpy(#history_list[current].Item, #URL, sizeof(history_list[0].Item)); |
40 | } |
- | |
41 | 40 | links_count=current; |
|
42 | 41 | } |
|
43 | byte UrlsHistory::GoBack() |
42 | |
44 | { |
43 | |
Line 45... | Line 44... | ||
45 | if (history_current<=1) return 0; |
44 | byte UrlsHistory::GoBack() { |
46 | - | ||
47 | history_current--; |
45 | if (current<=1) return 0; |
48 | strlcpy(#URL, #history_list[history_current].Item, sizeof(URL)); |
46 | current--; |
49 | return 1; |
47 | strlcpy(#URL, #history_list[current].Item, sizeof(URL)); |
50 | } |
48 | return 1; |
51 | 49 | } |
|
52 | 50 | ||
- | 51 | ||
- | 52 | byte UrlsHistory::GoForward() { |
|
53 | byte UrlsHistory::GoForward() |
53 | if (current==links_count) return 0; |