Eolite 2.16: copying via the clipboard

git-svn-id: svn://kolibrios.org@4427 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2014-01-06 00:36:08 +00:00
parent 52a2c2c8e8
commit 95ffbe2056
2 changed files with 22 additions and 2 deletions

View File

@ -8,6 +8,7 @@
//libraries //libraries
#define MEMSIZE 0xD0000 #define MEMSIZE 0xD0000
#include "..\lib\kolibri.h" #include "..\lib\kolibri.h"
#include "..\lib\clipboard.h"
#include "..\lib\strings.h" #include "..\lib\strings.h"
#include "..\lib\mem.h" #include "..\lib\mem.h"
#include "..\lib\dll.h" #include "..\lib\dll.h"
@ -79,8 +80,8 @@
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
#define TITLE "Eolite File Manager v2.15.3" #define TITLE "Eolite File Manager v2.16"
#define ABOUT_TITLE "Eolite v2.15.3" #define ABOUT_TITLE "Eolite v2.16"
dword col_padding, col_selec, col_lpanel; dword col_padding, col_selec, col_lpanel;
int toolbar_buttons_x[7]={9,46,85,134,167,203}; int toolbar_buttons_x[7]={9,46,85,134,167,203};

View File

@ -3,6 +3,18 @@
byte copy_from[4096], copy_to[4096], cut_active=0; byte copy_from[4096], copy_to[4096], cut_active=0;
enum {NOCUT, CUT, COPY_PASTE_END}; enum {NOCUT, CUT, COPY_PASTE_END};
struct buffer_data
{
dword size;
dword type;
dword encoding;
byte buffer_data[4096];
};
buffer_data buf_data;
Clipboard clipboard;
#define WIN_W 300 #define WIN_W 300
#define WIN_H 50 #define WIN_H 50
@ -10,6 +22,11 @@ enum {NOCUT, CUT, COPY_PASTE_END};
void Copy(dword pcth, char cut) void Copy(dword pcth, char cut)
{ {
strcpy(#copy_from, pcth); strcpy(#copy_from, pcth);
buf_data.size = sizeof(buffer_data);
buf_data.type = 0;
buf_data.encoding = 866;
strcpy(#buf_data.buffer_data, pcth);
clipboard.SetSlotData(sizeof(buffer_data), #buf_data);
cut_active = cut; cut_active = cut;
} }
@ -30,6 +47,8 @@ void Paste()
{ {
char copy_rezult; char copy_rezult;
strcpy(#copy_from, clipboard.GetSlotData(clipboard.GetSlotCount()-1)+12);
if (!copy_from) ExitProcess(); if (!copy_from) ExitProcess();
strcpy(#copy_to, #path); strcpy(#copy_to, #path);
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/')); strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));