Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
4042 leency 1
 
4428 leency 2
byte copy_from[4096];
5514 leency 3
byte cut_active=0;
4428 leency 4
4896 punk_joker 5
 
4042 leency 6
4427 punk_joker 7
 
8
9
 
4896 punk_joker 10
{
4698 punk_joker 11
    dword selected_offset2;
5513 punk_joker 12
    byte copy_t[4096];
13
    dword buff_data;
14
    int ind = 0;
15
16
 
17
	{
18
        buff_data = malloc(selected_count*4096+10);
19
        ESDWORD[buff_data] = selected_count*4096+10;
20
        ESDWORD[buff_data+4] = 3;
21
        ESINT[buff_data+8] = selected_count;
22
        for (i=0; i
5174 punk_joker 23
        {
24
            selected_offset2 = file_mas[i]*304 + buf+32 + 7;
5513 punk_joker 25
            if (ESBYTE[selected_offset2]) {
26
                strcpy(#copy_t, #path);
27
                strcat(#copy_t, file_mas[i]*304+buf+72);
28
                strlcpy(ind*4096+buff_data+10, #copy_t, 4096);;
29
                ind++;
30
            }
31
        }
5174 punk_joker 32
		clipboard.SetSlotData(selected_count*4096+10, buff_data);
5513 punk_joker 33
	}
34
	else
35
	{
36
		buff_data = malloc(4106);
37
        ESDWORD[buff_data] = 4106;
38
        ESDWORD[buff_data+4] = 3;
39
        ESINT[buff_data+8] = 1;
40
        strlcpy(buff_data+10, #file_path, 4096);;
41
		clipboard.SetSlotData(4106, buff_data);
42
	}
43
	cut_active = cut;
4042 leency 44
	free(buff_data);
5209 punk_joker 45
}
4042 leency 46
47
 
48
 
49
{
50
	char copy_rezult;
51
	int j;
5174 punk_joker 52
	int cnt = 0;
5514 leency 53
	dword buf;
4864 punk_joker 54
4042 leency 55
 
4864 punk_joker 56
	if (DSDWORD[buf+4] != 3) return;
5514 leency 57
	cnt = ESINT[buf+8];
5174 punk_joker 58
	for (j = 0; j < cnt; j++) {
5514 leency 59
		strlcpy(#copy_from, j*4096+buf+10, 4096);
5174 punk_joker 60
		if (!copy_from) CopyExit();
4861 leency 61
		strcpy(#copy_to, #path);
4042 leency 62
		strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
63
		if (!strcmp(#copy_from,#copy_to))
4698 punk_joker 64
		{
65
			strcpy(#copy_to, #path);
66
			strcat(#copy_to, "new_");
67
			strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
68
		}
69
		if (strstr(#copy_to, #copy_from))
70
		{
71
			notify("Copy directory into itself is a bad idea...");
72
			CopyExit();
4861 leency 73
		}
4698 punk_joker 74
5514 leency 75
 
76
77
 
4698 punk_joker 78
		{
79
			Write_Error(copy_rezult);
80
		}
81
		else if (cut_active)
4894 punk_joker 82
		{
83
			strcpy(#file_path, #copy_from);
84
			Del_File(true);
85
86
 
87
	}
4042 leency 88
	if (cut_active)
4894 punk_joker 89
	{
4042 leency 90
		cut_active=false;
91
	}
92
	if (info_after_copy) notify(INFO_AFTER_COPY);
5459 punk_joker 93
	CopyExit();
4861 leency 94
}
95
96
 
5514 leency 97
#define WIN_COPY_H 80
98
proc_info Copy_Form;
99
100
 
101
{
4861 leency 102
	  switch(CheckEvent())
5514 leency 103
	  {
104
		 case evButton:
105
			notify(T_CANCEL_PASTE);
106
			CopyExit();
107
			break;
108
109
 
110
			DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_COPY_W,GetSkinHeight()+WIN_COPY_H,0x34,sc.work,T_PASTE_WINDOW_TITLE);
111
			GetProcessInfo(#Copy_Form, SelfInfo);
112
			WriteText(45, 11, 0x80, sc.work_text, T_PASTE_WINDOW_TEXT);
113
			DrawFlatButton(Copy_Form.cwidth - 90, Copy_Form.cheight - 32, 80, 22, 10, sc.work_button, T_PASTE_WINDOW_BUTTON);
114
			DrawBar(8, 10, 32, 32, 0xFFFfff);
115
			break;
116
	  }
117
}
118
119
 
120
	action_buf = COPY_PASTE_END;
4861 leency 121
	ActivateWindow(GetProcessSlot(Form.ID));
4042 leency 122
	ExitProcess();
123
}
5514 leency 124
125
 
126
 
127
	if (Copy_Form.cwidth==0) return;
128
	DisplayCopyfForm();
129
	Put_icon(copying_filename+strrchr(copying_filename,'.'), 16, 19, 0xFFFfff, 0);
130
	DrawBar(45, 29, Copy_Form.cwidth-40, 10, sc.work);
131
	WriteText(45, 29, 0x80, sc.work_text, copying_filename);
132
}
4861 leency 133