|
160 | 160 | return NSRTFPboardType;
|
161 | 161 | }
|
162 | 162 |
|
| 163 | + if (XG_MIME_HTML == type |
| 164 | + || XG_MIME_XHTML == type) |
| 165 | + { |
| 166 | + return NSHTMLPboardType; |
| 167 | + } |
| 168 | + |
163 | 169 | if (XG_MIME_PDF == type)
|
164 | 170 | {
|
165 | 171 | return NSPasteboardTypePDF;
|
@@ -869,6 +875,10 @@ - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type
|
869 | 875 | {
|
870 | 876 | [self requestData: (xType = XG_MIME_PDF)];
|
871 | 877 | }
|
| 878 | + else if ([type isEqual: NSHTMLPboardType]) |
| 879 | + { |
| 880 | + [self requestData: (xType = XG_MIME_HTML)]; |
| 881 | + } |
872 | 882 | // FIXME: Support more types
|
873 | 883 | else
|
874 | 884 | {
|
@@ -1338,6 +1348,11 @@ - (void) xSelectionNotify: (XSelectionEvent*)xEvent
|
1338 | 1348 | {
|
1339 | 1349 | [self setData: md];
|
1340 | 1350 | }
|
| 1351 | + else if ((actual_type == XG_MIME_HTML) |
| 1352 | + || (actual_type == XG_MIME_XHTML)) |
| 1353 | + { |
| 1354 | + [self setData: md]; |
| 1355 | + } |
1341 | 1356 | else if (actual_type == XG_MIME_TIFF)
|
1342 | 1357 | {
|
1343 | 1358 | [self setData: md];
|
@@ -1429,7 +1444,7 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent
|
1429 | 1444 | {
|
1430 | 1445 | unsigned numTypes = 0;
|
1431 | 1446 | // ATTENTION: Increase this array when adding more types
|
1432 |
| - Atom xTypes[19]; |
| 1447 | + Atom xTypes[21]; |
1433 | 1448 |
|
1434 | 1449 | /*
|
1435 | 1450 | * The requestor wants a list of the types we can supply it with.
|
@@ -1465,6 +1480,12 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent
|
1465 | 1480 | xTypes[numTypes++] = XG_MIME_TEXT_RICHTEXT;
|
1466 | 1481 | }
|
1467 | 1482 |
|
| 1483 | + if ([types containsObject: NSHTMLPboardType]) |
| 1484 | + { |
| 1485 | + xTypes[numTypes++] = XG_MIME_HTML; |
| 1486 | + xTypes[numTypes++] = XG_MIME_XHTML; |
| 1487 | + } |
| 1488 | + |
1468 | 1489 | if ([types containsObject: NSTIFFPboardType])
|
1469 | 1490 | {
|
1470 | 1491 | xTypes[numTypes++] = XG_MIME_TIFF;
|
@@ -1578,6 +1599,11 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent
|
1578 | 1599 | xEvent->target = XG_MIME_PNG;
|
1579 | 1600 | [self xProvideSelection: xEvent];
|
1580 | 1601 | }
|
| 1602 | + else if ([types containsObject: NSHTMLPboardType]) |
| 1603 | + { |
| 1604 | + xEvent->target = XG_MIME_HTML; |
| 1605 | + [self xProvideSelection: xEvent]; |
| 1606 | + } |
1581 | 1607 | }
|
1582 | 1608 | else if (xEvent->target == XG_MULTIPLE)
|
1583 | 1609 | {
|
@@ -1708,6 +1734,15 @@ - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent
|
1708 | 1734 | format = 8;
|
1709 | 1735 | numItems = [data length];
|
1710 | 1736 | }
|
| 1737 | + else if (((xEvent->target == XG_MIME_HTML) |
| 1738 | + || (xEvent->target == XG_MIME_XHTML)) |
| 1739 | + && [types containsObject: NSHTMLPboardType]) |
| 1740 | + { |
| 1741 | + data = [_pb dataForType: NSHTMLPboardType]; |
| 1742 | + xType = xEvent->target; |
| 1743 | + format = 8; |
| 1744 | + numItems = [data length]; |
| 1745 | + } |
1711 | 1746 | else if ((xEvent->target == XG_MIME_TIFF)
|
1712 | 1747 | && [types containsObject: NSTIFFPboardType])
|
1713 | 1748 | {
|
|
0 commit comments