MC clipboard support - 2
This commit is contained in:
parent
4e4f8ba5eb
commit
6e729faf8a
@ -12,6 +12,8 @@ ______________________________________________________________________
|
|||||||
Notes for GoldED+ 1.1.5, /snapshot/
|
Notes for GoldED+ 1.1.5, /snapshot/
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
|
- Another try to support MC clipboard.
|
||||||
|
|
||||||
- Once again Numlock was not taken into account for Del in Win9x (not
|
- Once again Numlock was not taken into account for Del in Win9x (not
|
||||||
tested).
|
tested).
|
||||||
|
|
||||||
|
@ -92,7 +92,9 @@ void g_set_osicon(void) {
|
|||||||
|
|
||||||
bool g_is_clip_available(void) {
|
bool g_is_clip_available(void) {
|
||||||
|
|
||||||
return is_dir(CLIPDIR);
|
std::string clipdir = CLIPDIR;
|
||||||
|
strschg_environ(clipdir);
|
||||||
|
return is_dir(clipdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -100,11 +102,13 @@ bool g_is_clip_available(void) {
|
|||||||
|
|
||||||
char* g_get_clip_text(void) {
|
char* g_get_clip_text(void) {
|
||||||
|
|
||||||
size_t size = GetFilesize(CLIPFILE);
|
std::string clipfile = CLIPFILE;
|
||||||
|
strschg_environ(clipfile);
|
||||||
|
size_t size = GetFilesize(clipfile.c_str());
|
||||||
char *text = (char *)throw_malloc(size+1);
|
char *text = (char *)throw_malloc(size+1);
|
||||||
*text = NUL;
|
*text = NUL;
|
||||||
|
|
||||||
FILE *f = fopen(CLIPFILE, "rt");
|
FILE *f = fopen(clipfile.c_str(), "rt");
|
||||||
if(f != NULL) {
|
if(f != NULL) {
|
||||||
fread(text, 1, size, f);
|
fread(text, 1, size, f);
|
||||||
text[size] = NUL;
|
text[size] = NUL;
|
||||||
@ -119,7 +123,9 @@ char* g_get_clip_text(void) {
|
|||||||
|
|
||||||
int g_put_clip_text(const char* buf) {
|
int g_put_clip_text(const char* buf) {
|
||||||
|
|
||||||
FILE *f = fopen(CLIPFILE, "wt");
|
std::string clipfile = CLIPFILE;
|
||||||
|
strschg_environ(clipfile);
|
||||||
|
FILE *f = fopen(clipfile.c_str(), "wt");
|
||||||
if(f != NULL) {
|
if(f != NULL) {
|
||||||
fwrite(buf, 1, strlen(buf), f);
|
fwrite(buf, 1, strlen(buf), f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
Reference in New Issue
Block a user