Subversion Repositories Kolibri OS

Rev

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

Rev 4894 Rev 4896
Line 1... Line 1...
1
//Leency 2008-2014
1
//Leency 2008-2014
Line 2... Line 2...
2
 
2
 
3
byte copy_to[4096];
3
byte copy_to[4096];
4
byte cut_active=0;
-
 
5
byte id_add_to_copy=0;
-
 
6
byte add_to_copy_active=0;
-
 
7
enum {NOCUT, CUT, COPY_PASTE_END};
-
 
8
 
-
 
9
struct path_str {
-
 
10
	char Item[4096];
-
 
Line 11... Line 4...
11
};
4
byte cut_active=0;
Line 12... Line 5...
12
 
5
 
Line 13... Line -...
13
#define MAX_HISTORY_NUM 10
-
 
14
 
-
 
15
Clipboard clipboard;
-
 
16
 
-
 
17
struct Copy_Path {
-
 
18
	dword	size;
-
 
19
	dword	type;
-
 
20
	int     count;
-
 
21
	path_str copy_list[MAX_HISTORY_NUM];
-
 
22
};	
-
 
23
 
-
 
24
Copy_Path copy_path;
-
 
25
 
-
 
26
void add_to_copy(dword pcth)
-
 
27
{
-
 
28
	strlcpy(#copy_path.copy_list[id_add_to_copy].Item, pcth);
-
 
29
	if (add_to_copy_active == 1)
-
 
30
	{
-
 
31
		id_add_to_copy++;
-
 
32
		copy_path.count = id_add_to_copy;
-
 
33
	}
-
 
34
	else copy_path.count = 1;
6
enum {NOCUT, CUT, COPY_PASTE_END};
35
}
7
 
36
 
8
Clipboard clipboard;
-
 
9
 
37
 
10
void Copy(dword pcth, char cut)
-
 
11
{
38
void Copy(dword pcth, char cut)
12
	if (mark_active == 0) {
39
{
13
		strlcpy(#elements_path.element_list[elements_path.count].Item, pcth);
40
	if (add_to_copy_active == 0) add_to_copy(pcth);
14
		elements_path.count++;
41
	copy_path.type = 3;
15
	}
Line 42... Line 16...
42
	copy_path.size = sizeof(copy_path);
16
	elements_path.size = sizeof(elements_path);
43
	clipboard.SetSlotData(sizeof(copy_path), #copy_path);
17
	clipboard.SetSlotData(sizeof(elements_path), #elements_path);
Line 56... Line 30...
56
		notify(T_CANCEL_PASTE);
30
		notify(T_CANCEL_PASTE);
57
		CopyExit();
31
		CopyExit();
58
	} 
32
	} 
59
}
33
}
Line 60... Line -...
60
 
-
 
61
 
34
 
62
void Paste()
35
void Paste()
63
{
36
{
64
	char copy_rezult;
37
	char copy_rezult;
65
	byte copy_from[4096];
38
	byte copy_from[4096];
Line 69... Line 42...
69
	buf = clipboard.GetSlotData(clipboard.GetSlotCount()-1);
42
	buf = clipboard.GetSlotData(clipboard.GetSlotCount()-1);
70
	count = DSINT[buf+8];
43
	count = DSINT[buf+8];
71
	if (DSDWORD[buf+4] != 3) return;
44
	if (DSDWORD[buf+4] != 3) return;
72
	debugi(count);
45
	debugi(count);
Line 73... Line -...
73
	
-
 
74
	add_to_copy_active=0;
-
 
75
	id_add_to_copy=0;
-
 
76
	
46
	
77
	for (j = 0; j < count; j++) {
47
	for (j = 0; j < count; j++) {
78
		tst = j*4096;
48
		tst = j*4096;
79
		strlcpy(#copy_from, buf+12+tst, 4096);
49
		strlcpy(#copy_from, buf+12+tst, 4096);
80
		if (!copy_from) CopyExit();
50
		if (!copy_from) CopyExit();
Line 105... Line 75...
105
	}
75
	}
106
	if (cut_active)
76
	if (cut_active)
107
	{
77
	{
108
		cut_active=false;
78
		cut_active=false;
109
	}
79
	}
110
	for (j = 0; j < count; j++) strcpy(#copy_path.copy_list[j].Item[0], 0);
80
	mark_default();
111
	CopyExit();
81
	CopyExit();
112
}
82
}
Line 113... Line 83...
113
 
83
 
114
void CopyExit()
84
void CopyExit()