Re: how to receive a Cocoa drag in a Carbon app using regular Drag Manager?
Re: how to receive a Cocoa drag in a Carbon app using regular Drag Manager?
- Subject: Re: how to receive a Cocoa drag in a Carbon app using regular Drag Manager?
- From: Greg Titus <email@hidden>
- Date: Wed, 13 Oct 2004 11:06:36 -0700
On Oct 13, 2004, at 10:48 AM, Daniel Morrow wrote:
[...]
But here's my situation - I'm a plugin in InDesign, which, (from what
I can tell) does not use the Pasteboard APIs. The InDesign APIs has
nice wrapper classes which handle drag-n-drop. These routines are
cross-platform (Mac & PC). So, I'm trying to avoid using Mac-specific
code in here, if at all possible. On the Mac, they seem to wrap the
Drag Manager, because their APIs ask for drag-flavors (4-char codes)
to get the dragged data.
I thought this might be possible by adding some kind of data into my
plist which would describe this translation, and then whenever I
dragged my custom data from my app, it would also be dragging along a
drag-flavor of "MySp"
The reason I'm using a custom type in the first place is because my
plugin (in InDesign) doesn't want to intercept all 'TEXT' drops, or
any other standard type. This is a special drop, with my special data,
created by my app.
if this is truly not possible, then I'll move on to using
GetDragPasteboard.
I have another approach you might want to try. Carbon drag-flavors come
across to Cocoa apps in the form of pasteboard types like
"CorePasteboardFlavorType 0x75726C20" (where the number is the hex for
the four-character code 'url '). It is also possible to drag out URLs
from Cocoa to Carbon via using this type, which Carbon will see as the
'url ' flavor.
Since you control the Cocoa app which is putting the data on the
pasteboard in the first place, you should be able to simply put your
data on the Cocoa NSPasteboard with a type of "CorePasteboardFlavorType
0x4d795370" (the hex for 'MySp'), and then use that 4-char code in
InDesign's existing API.
Hope this helps,
- Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden