1 |
|
/* |
2 |
|
* clip_unix.cpp - Clipboard handling, Unix implementation |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2004 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
19 |
|
*/ |
20 |
|
|
21 |
|
#include "sysdeps.h" |
22 |
– |
|
23 |
– |
#include <X11/Xlib.h> |
24 |
– |
|
22 |
|
#include "clip.h" |
23 |
+ |
#include "macos_util.h" |
24 |
+ |
#include "prefs.h" |
25 |
|
|
26 |
|
#define DEBUG 0 |
27 |
|
#include "debug.h" |
28 |
|
|
29 |
|
|
30 |
< |
// From main_unix.cpp |
30 |
> |
// From video_x.cpp |
31 |
> |
#ifndef USE_SDL_VIDEO |
32 |
> |
#include <X11/Xlib.h> |
33 |
|
extern Display *x_display; |
34 |
+ |
#endif |
35 |
|
|
36 |
|
|
37 |
|
// Conversion tables |
54 |
|
0xaf, 0x20, 0xb7, 0xb0, 0xb8, 0x22, 0xb8, 0x20 |
55 |
|
}; |
56 |
|
|
57 |
+ |
// Flag: Don't convert clipboard text |
58 |
+ |
static bool no_clip_conversion; |
59 |
+ |
|
60 |
|
|
61 |
|
/* |
62 |
|
* Initialization |
64 |
|
|
65 |
|
void ClipInit(void) |
66 |
|
{ |
67 |
+ |
no_clip_conversion = PrefsFindBool("noclipconversion"); |
68 |
|
} |
69 |
|
|
70 |
|
|
87 |
|
if (length <= 0) |
88 |
|
return; |
89 |
|
|
90 |
+ |
#ifndef USE_SDL_VIDEO |
91 |
|
switch (type) { |
92 |
< |
case 'TEXT': |
92 |
> |
case FOURCC('T','E','X','T'): |
93 |
|
D(bug(" clipping TEXT\n")); |
94 |
|
|
95 |
|
// Convert text from Mac charset to ISO-Latin1 |
101 |
|
if (c < 0x80) { |
102 |
|
if (c == 13) // CR -> LF |
103 |
|
c = 10; |
104 |
< |
} else |
104 |
> |
} else if (!no_clip_conversion) |
105 |
|
c = mac2iso[c & 0x7f]; |
106 |
|
*q++ = c; |
107 |
|
} |
111 |
|
delete[] buf; |
112 |
|
break; |
113 |
|
} |
114 |
+ |
#endif |
115 |
|
} |