Article View: comp.sys.amiga.tech
Article #11915Re: Supporting the clipboard
From: Stuart H. Ferguson
Date: Wed, 22 Mar 1989 10:08
Date: Wed, 22 Mar 1989 10:08
57 lines
3135 bytes
3135 bytes
+-- cks@ziebmef.UUCP (Chris Siebenmann) writes:
| In article <6206@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) writes:
| | [...] but few people support the clipboard device (bad developers, bad! :-)
| | (That's just a joke!)).
| I can't comment on why everyone seems to ignore the clipboard, though
| I have a pretty good idea. I can tell you why ComicSetter doesn't use
| it, and it's very simple.
| There's no IFF routines that will write to the clipboard, and it's
| not at all obvious how to write them.
This is one of the reasons that Leo and I just spent several months
putting together the iffparse.library. Among other things, it lets
you write IFF files to any stream using a simple calling syntax. One
of the streams the library supports internally is the clipboard. So
if you write routines to read and write IFF files with this library
you get clipboard support essentially for free.
| the clipboard.device doesn't appear to support random seeking around
| to write data
The clipboard does seek, it turns out. It's not a general purpose
seek, but it's enough to write IFF files. There's an io_Offset
field in the IOClipReq structure that can be positioned to a
previous point in the clip. A seek by "n" bytes (forwards or
backwards) is just:
clipReq.io_Offset += n;
followed by the read or write you want to do. Fortunately this is
all transparent when using the iffparse library. Yes, this
information is not well documented.
| (when writing to a file, the IFF routines seek back to
| the start of a hunk and write the size once they know it).
The iffparse library can also write to non-seeking stream (such
as pipes) by buffering the data in memory and blasting it out
at the end. The stream just has to be flagged as non-seeking and
this will happen transparently.
| Faced with this problem, we punted and decided that we didn't really
| need to support the clipboard after all (it didn't help that we were
| short for time). It only took me a couple of days to write the
| cut-and-paste code that didn't use the clipboard. Using the clipboard
| would have taken considerably longer, and we were short for time and
| code space.
If this library can generate as much support as we hope (in the
right places) this kind of story may never be heard again. Up
til now it's been heard way too often.
| Chris Siebenmann uunet!{utgpu!moore,attcan!telly}!ziebmef!cks
--
Stuart Ferguson (shf@well.UUCP)
Action by HAVOC
Technical Details
Message-ID:
<11054@well.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!well!shfReferences:
<8903011852.AA16426@jade.berkeley.edu> <6193@columbia.edu> <10901@well.UUCP> <794@zehntel.UUCP> <10923@well.UUCP> <6206@cbmvax.UUCP> <1989Mar19.023257.20564@ziebmef.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!well!shf From: shf@well.UUCP (Stuart H. Ferguson) Newsgroups: comp.sys.amiga.tech Subject: Re: Supporting the clipboard Summary: Clipboard seeks! -- film at eleven. Keywords: Clipboard device, IFF, iffparse library Message-ID: <11054@well.UUCP> Date: 22 Mar 89 10:08:22 GMT References: <8903011852.AA16426@jade.berkeley.edu> <6193@columbia.edu> <10901@well.UUCP> <794@zehntel.UUCP> <10923@well.UUCP> <6206@cbmvax.UUCP> <1989Mar19.023257.20564@ziebmef.uucp> Reply-To: shf@well.UUCP (Stuart H. Ferguson) Organization: The Blue Planet Lines: 57