uliwitness / reclassicfication Goto Github PK
View Code? Open in Web Editor NEWMaybe one day a WINE-style implementation of the classic Mac Toolbox.
Maybe one day a WINE-style implementation of the classic Mac Toolbox.
We can read MacOS resource files just fine, but when writing them out again we still do something wrong.
Currently we load all resources when the file is opened. The real resource manager only loads the resource map and defers loading the data until LoadResource is called. Our FakeLoadResource is a no-op.
Inside Macintosh: More Macintosh Toolbox says:
The RemoveResource procedure doesn’t immediately release the memory occupied
by the resource data; instead, the Resource Manager releases the memory when
your application quits, when you call `UpdateResFile`, or when you call `CloseResFile`
(which in turn calls `UpdateResFile`).
Our current implementation never disposes of the Handle, and requires clients to call DisposeHandle()
themselves.
I think we'd be improving things if FakeRemoveResource()
just called FakeDisposeHandle()
once it has removed the resource. That might make some code crash/corrupt memory that relies on Handles staying around longer, but would at least make all other code work perfectly and without leaking.
Ideally, we would keep around the FakeReferenceListEntry
in a separate list. Then we could release this data from UpdateResFile()
. This entry could also be extended to keep track the resource's offset in the file. That would mean we'd know about unused areas of the resource file and could drop new resources into empty spots in the file, which we'd need for correct WriteResource()
and UpdateResource()
implementations anyway.
Currently, our FakeChangedResource simply sets a dirty flag on the entire file. We should instead set one on the individual resource data or the resource map (if appropriate) and then selectively write out only those.
Our FakeWriteResource function does only sanity checks. We just write out the entire file if anything has changed. FakeWriteResource should selectively write out all modified resource data (and if resource attributes have been modified or a resource has been deleted, should also write out the resource map).
Currently, we load all resources into RAM when a file is opened. The real resource manager loads only the resource map, and keeps track of the offsets of the resource data to load that on an as-needed basis.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.