[Xquartz-dev] 1.4.2-apple20 - copy-paste

George Peter Staplin georgeps at xmission.com
Sun Oct 26 11:16:36 PDT 2008


Quoted Jeremy Huddleston <jeremyhu at apple.com>:
> On Oct 26, 2008, at 07:53, George Peter Staplin wrote:
>
> ...
>
>> Well, that's interesting that it's still not working between    
>> Photoshop and Gimp.  I don't have Photoshop available to test with.
>>
>> I suspect that Photoshop is using a Pict format with NSPasteboard,   
>>  but I have no way of knowing for sure, unless I can add some    
>> introspection for the available types.  I will look into this    
>> further, and perhaps write a test application for you that would    
>> print out the available NSPasteboard types.  I want it to work    
>> flawlessly between all apps, as much as possible.
>>
>> Right now we support TIFF, JPEG, PNG, UTF-8, CompoundText, and    
>> STRING/Latin-1.
>
> Yeah, this is a good start (and much better than what we had  before ;>) ...

Agreed :-)

>> The Pict support was more difficult I think, because I'm not sure    
>> how to translate between the Pict and the various formats.  We need  
>>   to convert Pict to TIFF, and Pict to PNG for the best results.
>
> Yeah, currently we just drop it if it's Pict...
>
> It could also be something else that we don't handle... is there
> documentation somewhere about what valid types can be returned by
> [NSPasteboard types]?

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPasteboard_Class/Reference/Reference.html#//apple_ref/doc/uid/20000328-SW13

It should be possible to build an app that uses the NSPasteboard using  
something like this:

NSArray *array = [pb types];
NSUInteger i;
for(i = 0; i < [array count]; ++i) {
   NSString *typestr = [array objectAtIndex: i];

   if([typestr isEqualToString: NSPICTPboardType]) {
     puts("PICT");
   }
   ...
}

Depending on how the NSString is defined in NSPasteboard.h for  
NSPICTPboardtype, we might be able to just print the typestr itself,  
and have it make sense.

>> I have this on the TODO list on my desk.  I'm sorry that it's   
>> taking  a while to get to.  I will try to take a look at the Eterm   
>> sources,  as I suspect they are doing something unexpected.
>
> Same goes for nedit (and I suspect other apps that use the Motif
> clipboard functionality)...

Thanks for reminding me.  I'll increase the priority of this.

George
-- 
http://www.xmission.com/~georgeps/  http://whim.linuxsys.net
http://code.google.com/p/megapkg/   http://people.freedesktop.org/~gstaplin/


More information about the Xquartz-dev mailing list