mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
commit
73707eb5f7
|
@ -37,7 +37,8 @@ python3 -m pip install -U pytest-timeout
|
||||||
python3 -m pip install pyroma
|
python3 -m pip install pyroma
|
||||||
|
|
||||||
if [[ $(uname) != CYGWIN* ]]; then
|
if [[ $(uname) != CYGWIN* ]]; then
|
||||||
python3 -m pip install numpy
|
# TODO Remove condition when NumPy supports 3.12
|
||||||
|
if ! [ "$GHA_PYTHON_VERSION" == "3.12-dev" ]; then python3 -m pip install numpy ; fi
|
||||||
|
|
||||||
# PyQt6 doesn't support PyPy3
|
# PyQt6 doesn't support PyPy3
|
||||||
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
|
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
|
||||||
|
|
3
.github/workflows/macos-install.sh
vendored
3
.github/workflows/macos-install.sh
vendored
|
@ -13,7 +13,8 @@ python3 -m pip install -U pytest-cov
|
||||||
python3 -m pip install -U pytest-timeout
|
python3 -m pip install -U pytest-timeout
|
||||||
python3 -m pip install pyroma
|
python3 -m pip install pyroma
|
||||||
|
|
||||||
python3 -m pip install numpy
|
# TODO Remove condition when NumPy supports 3.12
|
||||||
|
if ! [ "$GHA_PYTHON_VERSION" == "3.12-dev" ]; then python3 -m pip install numpy ; fi
|
||||||
|
|
||||||
# extra test images
|
# extra test images
|
||||||
pushd depends && ./install_extra_test_images.sh && popd
|
pushd depends && ./install_extra_test_images.sh && popd
|
||||||
|
|
2
.github/workflows/test-windows.yml
vendored
2
.github/workflows/test-windows.yml
vendored
|
@ -15,7 +15,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
|
||||||
architecture: ["x86", "x64"]
|
architecture: ["x86", "x64"]
|
||||||
include:
|
include:
|
||||||
# PyPy 7.3.4+ only ships 64-bit binaries for Windows
|
# PyPy 7.3.4+ only ships 64-bit binaries for Windows
|
||||||
|
|
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
|
@ -22,6 +22,7 @@ jobs:
|
||||||
python-version: [
|
python-version: [
|
||||||
"pypy3.9",
|
"pypy3.9",
|
||||||
"pypy3.8",
|
"pypy3.8",
|
||||||
|
"3.12-dev",
|
||||||
"3.11",
|
"3.11",
|
||||||
"3.10",
|
"3.10",
|
||||||
"3.9",
|
"3.9",
|
||||||
|
|
|
@ -442,21 +442,23 @@ These platforms are built and tested for every change.
|
||||||
+----------------------------------+----------------------------+---------------------+
|
+----------------------------------+----------------------------+---------------------+
|
||||||
| Gentoo | 3.9 | x86-64 |
|
| Gentoo | 3.9 | x86-64 |
|
||||||
+----------------------------------+----------------------------+---------------------+
|
+----------------------------------+----------------------------+---------------------+
|
||||||
| macOS 11 Big Sur | 3.7, 3.8, 3.9, 3.10, 3.11, | x86-64 |
|
| macOS 12 Monterey | 3.7, 3.8, 3.9, 3.10, 3.11, | x86-64 |
|
||||||
| | PyPy3 | |
|
| | 3.12, PyPy3 | |
|
||||||
+----------------------------------+----------------------------+---------------------+
|
+----------------------------------+----------------------------+---------------------+
|
||||||
| Ubuntu Linux 18.04 LTS (Bionic) | 3.9 | x86-64 |
|
| Ubuntu Linux 18.04 LTS (Bionic) | 3.9 | x86-64 |
|
||||||
+----------------------------------+----------------------------+---------------------+
|
+----------------------------------+----------------------------+---------------------+
|
||||||
| Ubuntu Linux 20.04 LTS (Focal) | 3.7, 3.8, 3.9, 3.10, 3.11, | x86-64 |
|
| Ubuntu Linux 20.04 LTS (Focal) | 3.8 | x86-64 |
|
||||||
| | PyPy3 | |
|
|
||||||
+----------------------------------+----------------------------+---------------------+
|
+----------------------------------+----------------------------+---------------------+
|
||||||
| Ubuntu Linux 22.04 LTS (Jammy) | 3.10 | arm64v8, ppc64le, |
|
| Ubuntu Linux 22.04 LTS (Jammy) | 3.7, 3.8, 3.9, 3.10, 3.11, | x86-64 |
|
||||||
| | | s390x, x86-64 |
|
| | 3.12, PyPy3 | |
|
||||||
|
| +----------------------------+---------------------+
|
||||||
|
| | 3.10 | arm64v8, ppc64le, |
|
||||||
|
| | | s390x |
|
||||||
+----------------------------------+----------------------------+---------------------+
|
+----------------------------------+----------------------------+---------------------+
|
||||||
| Windows Server 2016 | 3.7 | x86-64 |
|
| Windows Server 2016 | 3.7 | x86-64 |
|
||||||
+----------------------------------+----------------------------+---------------------+
|
+----------------------------------+----------------------------+---------------------+
|
||||||
| Windows Server 2022 | 3.7, 3.8, 3.9, 3.10, 3.11, | x86, x86-64 |
|
| Windows Server 2022 | 3.7, 3.8, 3.9, 3.10, 3.11, | x86, x86-64 |
|
||||||
| | PyPy3 | |
|
| | 3.12, PyPy3 | |
|
||||||
| +----------------------------+---------------------+
|
| +----------------------------+---------------------+
|
||||||
| | 3.9 (MinGW) | x86, x86-64 |
|
| | 3.9 (MinGW) | x86, x86-64 |
|
||||||
| +----------------------------+---------------------+
|
| +----------------------------+---------------------+
|
||||||
|
|
|
@ -3984,8 +3984,6 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args);
|
||||||
extern PyObject *
|
extern PyObject *
|
||||||
PyImaging_GrabClipboardWin32(PyObject *self, PyObject *args);
|
PyImaging_GrabClipboardWin32(PyObject *self, PyObject *args);
|
||||||
extern PyObject *
|
extern PyObject *
|
||||||
PyImaging_ListWindowsWin32(PyObject *self, PyObject *args);
|
|
||||||
extern PyObject *
|
|
||||||
PyImaging_EventLoopWin32(PyObject *self, PyObject *args);
|
PyImaging_EventLoopWin32(PyObject *self, PyObject *args);
|
||||||
extern PyObject *
|
extern PyObject *
|
||||||
PyImaging_DrawWmf(PyObject *self, PyObject *args);
|
PyImaging_DrawWmf(PyObject *self, PyObject *args);
|
||||||
|
@ -4069,7 +4067,6 @@ static PyMethodDef functions[] = {
|
||||||
{"grabclipboard_win32", (PyCFunction)PyImaging_GrabClipboardWin32, METH_VARARGS},
|
{"grabclipboard_win32", (PyCFunction)PyImaging_GrabClipboardWin32, METH_VARARGS},
|
||||||
{"createwindow", (PyCFunction)PyImaging_CreateWindowWin32, METH_VARARGS},
|
{"createwindow", (PyCFunction)PyImaging_CreateWindowWin32, METH_VARARGS},
|
||||||
{"eventloop", (PyCFunction)PyImaging_EventLoopWin32, METH_VARARGS},
|
{"eventloop", (PyCFunction)PyImaging_EventLoopWin32, METH_VARARGS},
|
||||||
{"listwindows", (PyCFunction)PyImaging_ListWindowsWin32, METH_VARARGS},
|
|
||||||
{"drawwmf", (PyCFunction)PyImaging_DrawWmf, METH_VARARGS},
|
{"drawwmf", (PyCFunction)PyImaging_DrawWmf, METH_VARARGS},
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_XCB
|
#ifdef HAVE_XCB
|
||||||
|
|
|
@ -421,79 +421,6 @@ error:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL CALLBACK
|
|
||||||
list_windows_callback(HWND hwnd, LPARAM lParam) {
|
|
||||||
PyObject *window_list = (PyObject *)lParam;
|
|
||||||
PyObject *item;
|
|
||||||
PyObject *title;
|
|
||||||
RECT inner, outer;
|
|
||||||
int title_size;
|
|
||||||
int status;
|
|
||||||
|
|
||||||
/* get window title */
|
|
||||||
title_size = GetWindowTextLength(hwnd);
|
|
||||||
if (title_size > 0) {
|
|
||||||
title = PyUnicode_FromStringAndSize(NULL, title_size);
|
|
||||||
if (title) {
|
|
||||||
GetWindowTextW(hwnd, PyUnicode_AS_UNICODE(title), title_size + 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
title = PyUnicode_FromString("");
|
|
||||||
}
|
|
||||||
if (!title) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get bounding boxes */
|
|
||||||
GetClientRect(hwnd, &inner);
|
|
||||||
GetWindowRect(hwnd, &outer);
|
|
||||||
|
|
||||||
item = Py_BuildValue(
|
|
||||||
F_HANDLE "N(iiii)(iiii)",
|
|
||||||
hwnd,
|
|
||||||
title,
|
|
||||||
inner.left,
|
|
||||||
inner.top,
|
|
||||||
inner.right,
|
|
||||||
inner.bottom,
|
|
||||||
outer.left,
|
|
||||||
outer.top,
|
|
||||||
outer.right,
|
|
||||||
outer.bottom);
|
|
||||||
if (!item) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = PyList_Append(window_list, item);
|
|
||||||
|
|
||||||
Py_DECREF(item);
|
|
||||||
|
|
||||||
if (status < 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
PyObject *
|
|
||||||
PyImaging_ListWindowsWin32(PyObject *self, PyObject *args) {
|
|
||||||
PyObject *window_list;
|
|
||||||
|
|
||||||
window_list = PyList_New(0);
|
|
||||||
if (!window_list) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumWindows(list_windows_callback, (LPARAM)window_list);
|
|
||||||
|
|
||||||
if (PyErr_Occurred()) {
|
|
||||||
Py_DECREF(window_list);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return window_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/* Windows clipboard grabber */
|
/* Windows clipboard grabber */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user