~ubuntu-branches/ubuntu/vivid/basilisk2/vivid

« back to all changes in this revision

Viewing changes to src/MacOSX/clip_macosx.cpp

  • Committer: Package Import Robot
  • Author(s): Jonas Smedegaard, Jonas Smedegaard, Jérémy Lal, Giulio Paci
  • Date: 2012-05-19 02:08:30 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120519020830-o59ui1wsfftg55m6
Tags: 0.9.20120331-1
* Upstream update

[ Jonas Smedegaard ]
* Drop local CDBS snippets: All included in main cdbs now.
* Use source format 3.0 (quilt), and stop including patchsys-quilt.mk.
  Stop build-depending on quilt, patchutils.
* Add full licensing header to debian/rules, and update copyright
  years.
* Add README.source (and drop outdated README.cdbs-tweaks).
* Refresh patches with shortening quilt options --no-index
  --no-timestamps -pab, and fix their path prefix.
* Rewrite copyright file using draft DEP-5 format.
* Update control file Vcs-* fields: Packaging moved to Git.
* Ease building with git-buildpackage:
  + Add gbp.conf, enabling pristine-tar and tag signing.
  + Git-ignore quilt .pc dir.
* Bump debhelper compat level to 7.
* Update Vcs-Browser field to use anonscm.debian.org.
* Add Giulio Paci and Jérémy Lal as uploaders, and permit Debian
  Maintainers to upload.

[ Jérémy Lal ]
* Drop patch 1002 to fix capitalized flag: corrected upstream.

[ Giulio Paci ]
* Restart package development.
  Closes: #662175.
* Add patches to fix compilation and documentation.
* Provide JIT flavor on supported architectures (i386 and amd64).
* Bump standards-version to 3.9.3.
* Update copyright file:
  + Adjust licenses now clarified/improved upstream.
* Update ChangeLog.cvs.
* Enable CDBS autogeneration of autotools files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  clip_macosx.cpp - Clipboard handling, MacOS X (Carbon) implementation
3
3
 *
4
 
 *  Basilisk II (C) 1997-2005 Christian Bauer
 
4
 *  Basilisk II (C) 1997-2008 Christian Bauer
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
19
19
 */
20
20
 
21
21
#include "sysdeps.h"
 
22
#define _UINT64
22
23
#include <Carbon/Carbon.h>
23
24
 
24
25
#include "clip.h"
97
98
 
98
99
void GetScrap(void **handle, uint32 type, int32 offset)
99
100
{
 
101
#if defined(__LP64__)
 
102
        D(bug("GetScrap handle %p, type %08x, offset %d\n", handle, type, offset));
 
103
        #warning Carbon scrapbook function are not implemented in 64-bit mode
 
104
#else
100
105
        D(bug("GetScrap handle %p, type %08x, offset %d\n", handle, type, offset));
101
106
        ScrapRef theScrap;
102
107
 
128
133
                                        0x2f, 0x3c, 0, 0, 0, 0,         // move.l       #outbuf,-(sp)
129
134
                                        0xa9, 0xfe,                                     // PutScrap()
130
135
                                        0x58, 0x8f,                                     // addq.l       #4,sp
131
 
                                        M68K_RTS >> 8, M68K_RTS
 
136
                                        M68K_RTS >> 8, M68K_RTS & 0xff
132
137
                                };
133
138
                                r.d[0] = sizeof(proc);
134
139
                                Execute68kTrap(0xa71e, &r);             // NewPtrSysClear()
151
156
                        Execute68kTrap(0xa01f, &r);                     // DisposePtr
152
157
                }
153
158
        }
 
159
#endif
154
160
}
155
161
 
156
162
 
160
166
 
161
167
void PutScrap(uint32 type, void *scrap, int32 length)
162
168
{
163
 
        D(bug("PutScrap type %08lx, data %08lx, length %ld\n", type, scrap, length));
 
169
#if defined(__LP64__)
 
170
        #warning Carbon scrapbook function are not implemented in 64-bit mode
 
171
        D(bug("PutScrap type %4.4s, data %08lx, length %ld\n", &type, scrap, length));
 
172
#else
 
173
        static bool clear = true;
 
174
        D(bug("PutScrap type %4.4s, data %08lx, length %ld\n", &type, scrap, length));
164
175
        ScrapRef theScrap;
165
176
 
166
177
        if (we_put_this_data) {
167
178
                we_put_this_data = false;
 
179
                clear = true;
168
180
                return;
169
181
        }
170
182
        if (length <= 0)
171
183
                return;
172
184
 
173
 
        ClearCurrentScrap();
 
185
        if (clear) {
 
186
                D(bug(" calling ClearCurrentScrap\n"));
 
187
                ClearCurrentScrap();
 
188
        }
174
189
        if (GetCurrentScrap(&theScrap) != noErr) {
175
190
                D(bug(" could not open scrap\n"));
176
191
                return;
179
194
        SwapScrapData(type, scrap, length, TRUE);
180
195
        if (PutScrapFlavor(theScrap, type, kScrapFlavorMaskNone, length, scrap) != noErr) {
181
196
                D(bug(" could not put to scrap\n"));
182
 
                return;
 
197
                //return;
183
198
        }
 
199
        SwapScrapData(type, scrap, length, FALSE); // swap it back
 
200
#endif
184
201
}