1 |
|
/* |
2 |
|
* clip_amiga.cpp - Clipboard handling, AmigaOS implementation |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2008 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 |
18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
|
*/ |
20 |
|
|
21 |
+ |
#include "sysdeps.h" |
22 |
+ |
|
23 |
|
#include <exec/types.h> |
24 |
|
#include <libraries/iffparse.h> |
25 |
|
#include <devices/clipboard.h> |
26 |
+ |
#define __USE_SYSBASE |
27 |
|
#include <proto/exec.h> |
28 |
|
#include <proto/iffparse.h> |
29 |
+ |
#include <inline/exec.h> |
30 |
+ |
#include <inline/iffparse.h> |
31 |
|
|
27 |
– |
#include "sysdeps.h" |
32 |
|
#include "clip.h" |
33 |
+ |
#include "prefs.h" |
34 |
|
|
35 |
|
#define DEBUG 0 |
36 |
|
#include "debug.h" |
40 |
|
static struct IFFHandle *iffw = NULL; |
41 |
|
static struct ClipboardHandle *ch = NULL; |
42 |
|
static bool clipboard_open = false; |
43 |
+ |
static bool no_clip_conversion; |
44 |
|
|
45 |
|
|
46 |
|
// Conversion tables |
70 |
|
|
71 |
|
void ClipInit(void) |
72 |
|
{ |
73 |
+ |
no_clip_conversion = PrefsFindBool("noclipconversion"); |
74 |
+ |
|
75 |
|
// Create clipboard IFF handle |
76 |
|
iffw = AllocIFF(); |
77 |
|
if (iffw) { |
99 |
|
|
100 |
|
|
101 |
|
/* |
102 |
+ |
* Mac application reads clipboard |
103 |
+ |
*/ |
104 |
+ |
|
105 |
+ |
void GetScrap(void **handle, uint32 type, int32 offset) |
106 |
+ |
{ |
107 |
+ |
D(bug("GetScrap handle %p, type %08x, offset %d\n", handle, type, offset)); |
108 |
+ |
} |
109 |
+ |
|
110 |
+ |
|
111 |
+ |
/* |
112 |
|
* Mac application wrote to clipboard |
113 |
|
*/ |
114 |
|
|
134 |
|
uint8 c = *p++; |
135 |
|
if (c < 0x80) { |
136 |
|
if (c == 13) // CR -> LF |
137 |
< |
c == 10; |
138 |
< |
} else |
137 |
> |
c = 10; |
138 |
> |
} else if (!no_clip_conversion) |
139 |
|
c = mac2iso[c & 0x7f]; |
140 |
|
*q++ = c; |
141 |
|
} |