mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Removed debugging interface for Image.core.grabclipboard
This commit is contained in:
parent
a7cf91499a
commit
dcddc71dea
|
@ -72,8 +72,7 @@ def grabclipboard():
|
|||
os.unlink(filepath)
|
||||
return im
|
||||
else:
|
||||
debug = 0 # temporary interface
|
||||
data = Image.core.grabclipboard(debug)
|
||||
data = Image.core.grabclipboard()
|
||||
if isinstance(data, bytes):
|
||||
from . import BmpImagePlugin
|
||||
import io
|
||||
|
|
75
display.c
75
display.c
|
@ -452,84 +452,9 @@ PyImaging_GrabClipboardWin32(PyObject* self, PyObject* args)
|
|||
void* data;
|
||||
PyObject* result;
|
||||
|
||||
int verbose = 0; /* debugging; will be removed in future versions */
|
||||
if (!PyArg_ParseTuple(args, "|i", &verbose))
|
||||
return NULL;
|
||||
|
||||
|
||||
clip = OpenClipboard(NULL);
|
||||
/* FIXME: check error status */
|
||||
|
||||
if (verbose) {
|
||||
UINT format = EnumClipboardFormats(0);
|
||||
char buffer[200];
|
||||
char* result;
|
||||
while (format != 0) {
|
||||
if (GetClipboardFormatName(format, buffer, sizeof buffer) > 0)
|
||||
result = buffer;
|
||||
else
|
||||
switch (format) {
|
||||
case CF_BITMAP:
|
||||
result = "CF_BITMAP";
|
||||
break;
|
||||
case CF_DIB:
|
||||
result = "CF_DIB";
|
||||
break;
|
||||
case CF_DIF:
|
||||
result = "CF_DIF";
|
||||
break;
|
||||
case CF_ENHMETAFILE:
|
||||
result = "CF_ENHMETAFILE";
|
||||
break;
|
||||
case CF_HDROP:
|
||||
result = "CF_HDROP";
|
||||
break;
|
||||
case CF_LOCALE:
|
||||
result = "CF_LOCALE";
|
||||
break;
|
||||
case CF_METAFILEPICT:
|
||||
result = "CF_METAFILEPICT";
|
||||
break;
|
||||
case CF_OEMTEXT:
|
||||
result = "CF_OEMTEXT";
|
||||
break;
|
||||
case CF_OWNERDISPLAY:
|
||||
result = "CF_OWNERDISPLAY";
|
||||
break;
|
||||
case CF_PALETTE:
|
||||
result = "CF_PALETTE";
|
||||
break;
|
||||
case CF_PENDATA:
|
||||
result = "CF_PENDATA";
|
||||
break;
|
||||
case CF_RIFF:
|
||||
result = "CF_RIFF";
|
||||
break;
|
||||
case CF_SYLK:
|
||||
result = "CF_SYLK";
|
||||
break;
|
||||
case CF_TEXT:
|
||||
result = "CF_TEXT";
|
||||
break;
|
||||
case CF_WAVE:
|
||||
result = "CF_WAVE";
|
||||
break;
|
||||
case CF_TIFF:
|
||||
result = "CF_TIFF";
|
||||
break;
|
||||
case CF_UNICODETEXT:
|
||||
result = "CF_UNICODETEXT";
|
||||
break;
|
||||
default:
|
||||
sprintf(buffer, "[%d]", format);
|
||||
result = buffer;
|
||||
break;
|
||||
}
|
||||
printf("%s (%d)\n", result, format);
|
||||
format = EnumClipboardFormats(format);
|
||||
}
|
||||
}
|
||||
|
||||
handle = GetClipboardData(CF_DIB);
|
||||
if (!handle) {
|
||||
/* FIXME: add CF_HDROP support to allow cut-and-paste from
|
||||
|
|
Loading…
Reference in New Issue
Block a user