|
176 | 176 | return NSPasteboardTypePDF; |
177 | 177 | } |
178 | 178 |
|
| 179 | + if (XG_MIME_PS == type) |
| 180 | + { |
| 181 | + return NSPostScriptPboardType; |
| 182 | + } |
| 183 | + |
179 | 184 | if (XG_MIME_PNG == type) |
180 | 185 | { |
181 | 186 | return NSPasteboardTypePNG; |
@@ -880,6 +885,10 @@ - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type |
880 | 885 | { |
881 | 886 | [self requestData: (xType = XG_MIME_PDF)]; |
882 | 887 | } |
| 888 | + else if ([type isEqual: NSPostScriptPboardType]) |
| 889 | + { |
| 890 | + [self requestData: (xType = XG_MIME_PS)]; |
| 891 | + } |
883 | 892 | else if ([type isEqual: NSHTMLPboardType]) |
884 | 893 | { |
885 | 894 | [self requestData: (xType = XG_MIME_HTML)]; |
@@ -1374,6 +1383,10 @@ - (void) xSelectionNotify: (XSelectionEvent*)xEvent |
1374 | 1383 | { |
1375 | 1384 | [self setData: md]; |
1376 | 1385 | } |
| 1386 | + else if (actual_type == XG_MIME_PS) |
| 1387 | + { |
| 1388 | + [self setData: md]; |
| 1389 | + } |
1377 | 1390 | else if (actual_type == XG_MIME_PNG) |
1378 | 1391 | { |
1379 | 1392 | [self setData: md]; |
@@ -1457,7 +1470,7 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent |
1457 | 1470 | { |
1458 | 1471 | unsigned numTypes = 0; |
1459 | 1472 | // ATTENTION: Increase this array when adding more types |
1460 | | - Atom xTypes[22]; |
| 1473 | + Atom xTypes[23]; |
1461 | 1474 |
|
1462 | 1475 | /* |
1463 | 1476 | * The requestor wants a list of the types we can supply it with. |
@@ -1514,6 +1527,11 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent |
1514 | 1527 | xTypes[numTypes++] = XG_MIME_PDF; |
1515 | 1528 | } |
1516 | 1529 |
|
| 1530 | + if ([types containsObject: NSPostScriptPboardType]) |
| 1531 | + { |
| 1532 | + xTypes[numTypes++] = XG_MIME_PS; |
| 1533 | + } |
| 1534 | + |
1517 | 1535 | if ([types containsObject: NSPasteboardTypePNG]) |
1518 | 1536 | { |
1519 | 1537 | xTypes[numTypes++] = XG_MIME_PNG; |
@@ -1612,6 +1630,11 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent |
1612 | 1630 | xEvent->target = XG_MIME_PDF; |
1613 | 1631 | [self xProvideSelection: xEvent]; |
1614 | 1632 | } |
| 1633 | + else if ([types containsObject: NSPostScriptPboardType]) |
| 1634 | + { |
| 1635 | + xEvent->target = XG_MIME_PS; |
| 1636 | + [self xProvideSelection: xEvent]; |
| 1637 | + } |
1615 | 1638 | else if ([types containsObject: NSPasteboardTypePNG]) |
1616 | 1639 | { |
1617 | 1640 | xEvent->target = XG_MIME_PNG; |
@@ -1790,6 +1813,14 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent |
1790 | 1813 | format = 8; |
1791 | 1814 | numItems = [data length]; |
1792 | 1815 | } |
| 1816 | + else if ((xEvent->target == XG_MIME_PS) |
| 1817 | + && [types containsObject: NSPostScriptPboardType]) |
| 1818 | + { |
| 1819 | + data = [_pb dataForType: NSPostScriptPboardType]; |
| 1820 | + xType = xEvent->target; |
| 1821 | + format = 8; |
| 1822 | + numItems = [data length]; |
| 1823 | + } |
1793 | 1824 | else if ((xEvent->target == XG_MIME_PNG) |
1794 | 1825 | && [types containsObject: NSPasteboardTypePNG]) |
1795 | 1826 | { |
|
0 commit comments