Originally posted by absmiths:
<STRONG>So my question is - where did the guy that wrote XRay get the information? Is it a relic from NeXT? Do premium developers get this info and it has to trickle down to us? Was it just hacking?</STRONG>
It's right there in Menus.h.
Great way to search the docs/headers:
Create new carbon project in PB, turn on indexing, and build it.
Then go to "find", search "this project, frameworks only" and search for "contextual". You can also select "Definitions" in the second menu and find only function definitions with your string, and you get a link to the docs right there!
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
<font color = brown>/*————————————————————————————————————————————————— —————————————————————————————————————*/</font>
<font color = brown>/* Contextual Menu Plugin Interface */</font>
<font color = brown>/* */</font>
<font color = brown>/* For Mac OS X, we will support a new type of Contextual Menu Plugin: the CFPlugIn */</font>
<font color = brown>/* based plugin. Each plugin must be in a CFPlugIn in the Contextual Menu Items */</font>
<font color = brown>/* folder in one of these paths: */</font>
<font color = brown>/* /System/Library/Contextual Menu Items/ */</font>
<font color = brown>/* /Library/Contextual Menu Items/ */</font>
<font color = brown>/* ~/Library/Contextual Menu Items/ */</font>
<font color = brown>/* */</font>
<font color = brown>/* It must export the following functions using the following interface or a C++ */</font>
<font color = brown>/* interface inheriting from IUnknown and including similar functions. */</font>
<font color = brown>/*————————————————————————————————————————————————— —————————————————————————————————————*/</font>
<font color = brown>// The Contextual Menu Manager will only load CFPlugIns of type kContextualMenuTypeID</font>
#define kContextualMenuTypeID ( CFUUIDGetConstantUUIDWithBytes( NULL, \
0x2F, 0x65, 0x22, 0xE9, 0x3E, 0x66, 0x11, 0xD5, \
0x80, 0xA7, 0x00, 0x30, 0x65, 0xB3, 0x00, 0xBC ) )
<font color = brown>// 2F6522E9-3E66-11D5-80A7-003065B300BC</font>
<font color = brown>// Contextual Menu Plugins must implement this Contexual Menu Plugin Interface.</font>
#define kContextualMenuInterfaceID ( CFUUIDGetConstantUUIDWithBytes( NULL, \
0x32, 0x99, 0x7B, 0x62, 0x3E, 0x66, 0x11, 0xD5, \
0xBE, 0xAB, 0x00, 0x30, 0x65, 0xB3, 0x00, 0xBC ) )
<font color = brown>// 32997B62-3E66-11D5-BEAB-003065B300BC</font>
#define CM_IUNKNOWN_C_GUTS \
void *_reserved; \
SInt32 (*QueryInterface)(void *thisPointer, CFUUIDBytes iid, void ** ppv); \
UInt32 (*AddRef)(void *thisPointer); \
UInt32 (*Release)(void *thisPointer)
<font color = brown>// The function table for the interface.</font>
struct ContextualMenuInterfaceStruct
{
CM_IUNKNOWN_C_GUTS;
OSStatus ( *ExamineContext )(
void* thisInstance,
const AEDesc* inContext,
AEDescList* outCommandPairs );
OSStatus ( *HandleSelection )(
void* thisInstance,
AEDesc* inContext,
SInt32 inCommandID );
void ( *PostMenuCleanup )(
void* thisInstance );
};
typedef struct ContextualMenuInterfaceStruct ContextualMenuInterfaceStruct;
<font color = brown>/*
* CMPluginExamineContext()
*
* Availability:
* Implemented by client
*/</font>
extern OSStatus
CMPluginExamineContext(
void * thisInstance,
const AEDesc * inContext,
AEDescList * outCommandPairs);
<font color = brown>/*
* CMPluginHandleSelection()
*
* Availability:
* Implemented by client
*/</font>
extern OSStatus
CMPluginHandleSelection(
void * thisInstance,
AEDesc * inContext,
SInt32 inCommandID);
<font color = brown>/*
* CMPluginPostMenuCleanup()
*
* Availability:
* Implemented by client
*/</font>
extern void
CMPluginPostMenuCleanup(void * thisInstance);
</font>[/code]