From: Josh J. <jj...@gm...> - 2012-06-19 06:25:50
|
On Jun 18, 2012, at 8:30 PM, Alexei Svitkine wrote: > On Mon, Jun 18, 2012 at 9:06 PM, Josh Juran <jj...@gm...> wrote: > >> On Jun 18, 2012, at 3:51 PM, Alexei Svitkine wrote: >> >>> Assuming there's no good open source library to handle arbitrary >>> PICT data, >>> the solution here would be to add some functionality to TESyncScrap >>> or a >>> similar extension that would intercept clipboard data on the guest >>> OS side >>> and when it's a PICT, rasterize it into PICT bitmap-only data, >>> putting that >>> back on the guest clipboard. >> >> This would be a separate extension which patches PutScrap(). >> >>> Then, when SheepShaver gets that data, the PICTs will be guaranteed >>> to only >>> have bitmap data, which could be handled by paintlib (or possibly >>> even some >>> simpler code we can just write for SheepShaver) which would then be >>> easily >>> convertible to the host OS clipboard format. >> >> I don't think replacing the PICT data is a good idea, since the pre- >> rasterized picture would no longer be available to other Mac >> applications. But adding it as, say, 'Pict' or 'Bits' should work. > > I think that would be useful. If you store them in a separate data > type, > then it doesn't have to be a PICT at all - maybe something even > simpler so > we could process it from the SheepShaver side without needing any > library. Something like struct header { uint16_t height; uint16_t width; uint16_t rowBytes; uint16_t format; }; followed by raw pixel data? > By the way, maybe the sources for these extensions should live in the > SheepShaver repository? What do you think? I think that depends on who's going to build them.[1] Currently, they require Metrowerks CodeWarrior to build, since the C++ usage is beyond what MPW compilers can handle.[2] If you don't want to rely on Metrowerks C++, I can rewrite in straight C for use with MPW's SC compiler, but MPW is no longer offered for download from Apple, so it's no more easily legally acquired than CodeWarrior is. If you want something from which you can produce a binary using only free software, I can provide machine code in hex, annotated with the corresponding assembler instructions or even C code. Converting that to a binary is quite simple, at least provided you can get it into a resource (which is easy in MacRelix: `cat code.68k > TESyncScrap/r/ 0000.INIT`). A third alternative is get GCC to build Mac code resources. There's been at least two ports of GCC to MPW, so we might be able to reuse that effort. An additional point to consider is that the system extensions I've written share a common library that non-trivially uses templates. Other developers might find a single source file of non-general code easier to maintain. Let me know what you think. Josh [1] Actually, I don't think they should live in SheepShaver's repo in any case, since TESyncScrap at least is useful with any emulator (or none at all), and rather they might get repos of their own, which cebix is free to clone -- but this point is orthogonal to the more important issue of building from source. [2] And that's not saying much. |