add postscript pasteboard type

This commit is contained in:
rfm 2024-03-07 09:50:42 +00:00
parent 085082a6cc
commit be85eb8ae6

View file

@ -176,6 +176,11 @@ NSPasteboardTypeFromAtom(Atom type)
return NSPasteboardTypePDF;
}
if (XG_MIME_PS == type)
{
return NSPostScriptPboardType;
}
if (XG_MIME_PNG == type)
{
return NSPasteboardTypePNG;
@ -880,6 +885,10 @@ static int xFixesEventBase;
{
[self requestData: (xType = XG_MIME_PDF)];
}
else if ([type isEqual: NSPostScriptPboardType])
{
[self requestData: (xType = XG_MIME_PS)];
}
else if ([type isEqual: NSHTMLPboardType])
{
[self requestData: (xType = XG_MIME_HTML)];
@ -1374,6 +1383,10 @@ xErrorHandler(Display *d, XErrorEvent *e)
{
[self setData: md];
}
else if (actual_type == XG_MIME_PS)
{
[self setData: md];
}
else if (actual_type == XG_MIME_PNG)
{
[self setData: md];
@ -1457,7 +1470,7 @@ xErrorHandler(Display *d, XErrorEvent *e)
{
unsigned numTypes = 0;
// ATTENTION: Increase this array when adding more types
Atom xTypes[22];
Atom xTypes[23];
/*
* The requestor wants a list of the types we can supply it with.
@ -1514,6 +1527,11 @@ xErrorHandler(Display *d, XErrorEvent *e)
xTypes[numTypes++] = XG_MIME_PDF;
}
if ([types containsObject: NSPostScriptPboardType])
{
xTypes[numTypes++] = XG_MIME_PS;
}
if ([types containsObject: NSPasteboardTypePNG])
{
xTypes[numTypes++] = XG_MIME_PNG;
@ -1612,6 +1630,11 @@ xErrorHandler(Display *d, XErrorEvent *e)
xEvent->target = XG_MIME_PDF;
[self xProvideSelection: xEvent];
}
else if ([types containsObject: NSPostScriptPboardType])
{
xEvent->target = XG_MIME_PS;
[self xProvideSelection: xEvent];
}
else if ([types containsObject: NSPasteboardTypePNG])
{
xEvent->target = XG_MIME_PNG;
@ -1790,6 +1813,14 @@ xErrorHandler(Display *d, XErrorEvent *e)
format = 8;
numItems = [data length];
}
else if ((xEvent->target == XG_MIME_PS)
&& [types containsObject: NSPostScriptPboardType])
{
data = [_pb dataForType: NSPostScriptPboardType];
xType = xEvent->target;
format = 8;
numItems = [data length];
}
else if ((xEvent->target == XG_MIME_PNG)
&& [types containsObject: NSPasteboardTypePNG])
{