Commit Graph

12 Commits

Author SHA1 Message Date
George Peter Staplin
adf339d8f9 XQuartz: pbproxy: Fix a bug that occured when a PICT format was available.
We may need another branch to convert a PICT to a PNG or JPEG.  For now
TIFF works well in all of the test image copying apps when converted to
PNG or JPEG with an NSBitmapImageRep class.
2008-09-19 21:28:46 -06:00
George Peter Staplin
7ca1532e8e XQuartz: pbproxy: Make the proxy handle copy request races, and PRIMARY
INCR transfers mixed with a CLIPBOARD change.

Fix a bug with some UTF-8 transfers.  I can only guess that my UTF-8
tests before were inadequate.  I can now copy/paste any characters between
uxterm and Textedit.app.
2008-09-19 14:37:50 -06:00
George Peter Staplin
1b4987e779 XQuartz: pbproxy: Add a missing include of Xutil.h. Another header
seems to have done this before, but correctness matters.
2008-09-19 00:18:44 -06:00
George Peter Staplin
1e9460abdf XQuartz: pbproxy: Add COMPOUND_TEXT handling. Do misc. cleanups with testing
to verify that the behavior didn't change.

main.m: XInternAtom compound_text, and atom_pair.

pbproxy.h: Add compound_text and atom_pair to the struct atom_list.

x-selection.m: Add an #include of Xutil.h.  Refactor the reply struct
initialization to be done in a common place.  Add send_reply: to simplify
the code a bit more.  Add send_compound_text: which handles the
COMPOUND_TEXT type.  Add the beginnings of a send_multiple:.  Change
handle_image:extension: to handle_image:.  The extension: message isn't
needed anymore.
2008-09-19 00:02:48 -06:00
George Peter Staplin
4a8daf8846 XQuartz: pbproxy: pbproxy now responds to selection request events.
We can now copy and paste images to and from X11.  Text copying and
pasting works as well.

The NSPasteboard can contain TIFF or PICT images, and pbproxy will
translate to an image/png or image/jpeg request, and list those in the
TARGETS.

I added a description of the basic design at the top of x-selection.m.

I removed the request_data x_selection class struct.  It's not needed.
2008-09-18 13:10:41 -06:00
George Peter Staplin
12912adaee XQuartz: pbproxy: Use an NSBitmapImageRep to convert an "image/png" selection
to a TIFFRepresentation for use with NSPasteboard.

This has been tested with the Gimp and works with some minor quartz-wm changes.
The Finder clipboard shows the image updates after an Edit -> Copy.
2008-09-17 12:04:20 -06:00
George Peter Staplin
934669f732 XQuartz: pbproxy: The greedy CLIPBOARD handling now works for text.
This change adds some [self own_clipboard] calls in the necessary places to get the proper greedy behavior.

UTF8_STRING and STRING properties seem to work well now with the test cases (PRIMARY, and CLIPBOARD).  I can copy from several different X apps, and have the behavior be correct when pasting.  I also verified that quartz-wm isn't doing the copying, by disabling the quartz-wm paths.
2008-09-16 21:09:22 -06:00
George Peter Staplin
40190675a6 XQuartz: pbproxy: return the TARGETS list as a 32-bit list to fix a bug that was in the original.
Add TRACE() calls where appropriate to try to figure out why we are losing CLIPBOARD at times, after transferring PRIMARY to the NSPasteboard.

Use the new pbproxy_clipboard_to_pasteboard where appropriate.
2008-09-16 15:21:18 -06:00
George Peter Staplin
37361567b6 Rename reclaim_clipboard to claim_clipboard.
Convert the puts usage to use DB().

Add the initial handle_image method.

Check for nil in the NSString instantiation in various places.

Add some commentary to enhance the clarity of why I did some things.
2008-09-15 13:35:46 -06:00
Jeremy Huddleston
21a2d0b8d0 XQuartz: pbproxy: Added global variables to customize how pbproxy behaves 2008-09-15 09:33:55 -07:00
Jeremy Huddleston
5c8b956f8f XQuartz: pbproxy: First round of updates to pbproxy from George. 2008-09-14 09:23:17 -07:00
Jeremy Huddleston
1f842c71c3 XQuartz: Added pasteboard proxy code stripped out of quartz-wm. 2008-09-03 09:16:16 -07:00