mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-04 21:23:10 +03:00
Python 3-ified _imagingcms.c and display.c, at least when compiling for Py3.3x64 on Win7x64 with MSVC10.
This commit is contained in:
parent
8fc5fbc6c1
commit
f3d601b579
|
@ -483,7 +483,7 @@ cms_get_display_profile_win32(PyObject* self, PyObject* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
return PyString_FromStringAndSize(filename, filename_size-1);
|
return PyUnicode_FromStringAndSize(filename, filename_size-1);
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
|
|
14
display.c
14
display.c
|
@ -346,7 +346,7 @@ PyImaging_GrabScreenWin32(PyObject* self, PyObject* args)
|
||||||
|
|
||||||
/* step 3: extract bits from bitmap */
|
/* step 3: extract bits from bitmap */
|
||||||
|
|
||||||
buffer = PyString_FromStringAndSize(NULL, height * ((width*3 + 3) & -4));
|
buffer = PyBytes_FromStringAndSize(NULL, height * ((width*3 + 3) & -4));
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ PyImaging_GrabScreenWin32(PyObject* self, PyObject* args)
|
||||||
core.bcHeight = height;
|
core.bcHeight = height;
|
||||||
core.bcPlanes = 1;
|
core.bcPlanes = 1;
|
||||||
core.bcBitCount = 24;
|
core.bcBitCount = 24;
|
||||||
if (!GetDIBits(screen_copy, bitmap, 0, height, PyString_AS_STRING(buffer),
|
if (!GetDIBits(screen_copy, bitmap, 0, height, PyBytes_AS_STRING(buffer),
|
||||||
(BITMAPINFO*) &core, DIB_RGB_COLORS))
|
(BITMAPINFO*) &core, DIB_RGB_COLORS))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -386,11 +386,11 @@ static BOOL CALLBACK list_windows_callback(HWND hwnd, LPARAM lParam)
|
||||||
/* get window title */
|
/* get window title */
|
||||||
title_size = GetWindowTextLength(hwnd);
|
title_size = GetWindowTextLength(hwnd);
|
||||||
if (title_size > 0) {
|
if (title_size > 0) {
|
||||||
title = PyString_FromStringAndSize(NULL, title_size);
|
title = PyUnicode_FromStringAndSize(NULL, title_size);
|
||||||
if (title)
|
if (title)
|
||||||
GetWindowText(hwnd, PyString_AS_STRING(title), title_size+1);
|
GetWindowText(hwnd, PyUnicode_AS_UNICODE(title), title_size+1);
|
||||||
} else
|
} else
|
||||||
title = PyString_FromString("");
|
title = PyUnicode_FromString("");
|
||||||
if (!title)
|
if (!title)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ PyImaging_GrabClipboardWin32(PyObject* self, PyObject* args)
|
||||||
size = wcslen(data) * 2;
|
size = wcslen(data) * 2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
result = PyString_FromStringAndSize(data, size);
|
result = PyBytes_FromStringAndSize(data, size);
|
||||||
|
|
||||||
GlobalUnlock(handle);
|
GlobalUnlock(handle);
|
||||||
|
|
||||||
|
@ -853,7 +853,7 @@ PyImaging_DrawWmf(PyObject* self, PyObject* args)
|
||||||
|
|
||||||
GdiFlush();
|
GdiFlush();
|
||||||
|
|
||||||
buffer = PyString_FromStringAndSize(ptr, height * ((width*3 + 3) & -4));
|
buffer = PyBytes_FromStringAndSize(ptr, height * ((width*3 + 3) & -4));
|
||||||
|
|
||||||
error:
|
error:
|
||||||
DeleteEnhMetaFile(meta);
|
DeleteEnhMetaFile(meta);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user