Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Want to know about resources of Resource fork




On Jun 29, 2006, at 12:36 PM, Philip Aker wrote:

On 2006-06-29, at 11:06:37, Eric Schlegel wrote:

I don't see what you mean here. Example?

Say I have a text document with some associated particulars like window size, marks, selection, etc. that I'd like to have stored in the file's resource fork. I keep the marks in a CFDictionaryRef. I would concoct an event something like:

err = CreateEvent( kCFAllocatorDefault, kEventClassResource, kEventResourceAdd, GetCurrentEventTime(), attributes, &eref );
err = SetEventParameter( eref, kEventParamDirectObject, typeCFTypeRef, sizeof( dict ), &dict );
err = SetEventParameter( eref, kEventParamResourceID, typeSInt32, sizeof( kMarksResID ), &kMarksResID );
err = SetEventParameter( eref, kEventParamResourceFile, typeFSRef, sizeof( doc_ref ), &doc_ref );
err = SetEventParameter( eref, kEventParamFileFork, typeType, sizeof( res_fork ), &res_fork );
err = SendEventToEventTarget( eref, GetResourceManagerEventTarget () );

// Added resources are automatically committed on close.

Presuming that some data was to be stored in my application's writable resource file, I could omit the FSRef and fork parameters.

Frankly, this is not a sensible use of Carbon events. Events are meant to communicate that something has happened.

Then I'm redefining the meaning of Carbon events and keeping all you Apple engineers gainfully employed for years to come. GetApplicationEventTarget(), GetWindowEventTarget(), and GetControlEventTarget() exist today. I don't see any difference if there was to be a GetResourceManagerEventTarget(), GetFileManagerEventTarget(), or a GetNavManagerEventTarget(). I see usefulness.

In what way have you improved upon the existing APIs?
Just because two APIs use 32-bit IDs doesn't mean they should necessarily share a dispatch mechanism.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden


This email sent to email@hidden
References: 
 >Re: Want to know about resources of Resource fork (From: Mike Kluev <email@hidden>)
 >Re: Want to know about resources of Resource fork (From: Philip Aker <email@hidden>)
 >Re: Want to know about resources of Resource fork (From: Eric Schlegel <email@hidden>)
 >Re: Want to know about resources of Resource fork (From: Philip Aker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.