From 73e822e99011aa30163c3e5c2ffe83a5f8cb8cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20=C5=9Amigiel?= Date: Fri, 1 Apr 2022 18:59:57 +0200 Subject: [PATCH 1/4] =?UTF-8?q?Usu=C5=84=20'venv/Include/site/python3.9/py?= =?UTF-8?q?game/=5Fcamera.h'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- venv/Include/site/python3.9/pygame/_camera.h | 26 -------------------- 1 file changed, 26 deletions(-) delete mode 100644 venv/Include/site/python3.9/pygame/_camera.h diff --git a/venv/Include/site/python3.9/pygame/_camera.h b/venv/Include/site/python3.9/pygame/_camera.h deleted file mode 100644 index 075ef6f..0000000 --- a/venv/Include/site/python3.9/pygame/_camera.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - pygame - Python Game Library - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -#ifndef _CAMERA_H -#define _CAMERA_H - -#include "_pygame.h" -#include "camera.h" - -#endif From 22c521a2dc4e93ce960893c1d9e0fbdec5c9041f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20=C5=9Amigiel?= Date: Fri, 1 Apr 2022 19:00:06 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Usu=C5=84=20'venv/Include/site/python3.9/py?= =?UTF-8?q?game/=5Fpygame.h'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- venv/Include/site/python3.9/pygame/_pygame.h | 326 ------------------- 1 file changed, 326 deletions(-) delete mode 100644 venv/Include/site/python3.9/pygame/_pygame.h diff --git a/venv/Include/site/python3.9/pygame/_pygame.h b/venv/Include/site/python3.9/pygame/_pygame.h deleted file mode 100644 index 23da37f..0000000 --- a/venv/Include/site/python3.9/pygame/_pygame.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - pygame - Python Game Library - Copyright (C) 2000-2001 Pete Shinners - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Pete Shinners - pete@shinners.org -*/ - -/* This will use PYGAMEAPI_EXTERN_SLOTS instead - * of PYGAMEAPI_DEFINE_SLOTS for base modules. - */ -#ifndef _PYGAME_INTERNAL_H -#define _PYGAME_INTERNAL_H - -#include "pgplatform.h" -/* - If PY_SSIZE_T_CLEAN is defined before including Python.h, length is a - Py_ssize_t rather than an int for all # variants of formats (s#, y#, etc.) -*/ -#define PY_SSIZE_T_CLEAN -#include - -/* Ensure PyPy-specific code is not in use when running on GraalPython (PR - * #2580) */ -#if defined(GRAALVM_PYTHON) && defined(PYPY_VERSION) -#undef PYPY_VERSION -#endif - -#include - -/* SDL 1.2 constants removed from SDL 2 */ -typedef enum { - SDL_HWSURFACE = 0, - SDL_RESIZABLE = SDL_WINDOW_RESIZABLE, - SDL_ASYNCBLIT = 0, - SDL_OPENGL = SDL_WINDOW_OPENGL, - SDL_OPENGLBLIT = 0, - SDL_ANYFORMAT = 0, - SDL_HWPALETTE = 0, - SDL_DOUBLEBUF = 0, - SDL_FULLSCREEN = SDL_WINDOW_FULLSCREEN, - SDL_HWACCEL = 0, - SDL_SRCCOLORKEY = 0, - SDL_RLEACCELOK = 0, - SDL_SRCALPHA = 0, - SDL_NOFRAME = SDL_WINDOW_BORDERLESS, - SDL_GL_SWAP_CONTROL = 0, - TIMER_RESOLUTION = 0 -} PygameVideoFlags; - -/* the wheel button constants were removed from SDL 2 */ -typedef enum { - PGM_BUTTON_LEFT = SDL_BUTTON_LEFT, - PGM_BUTTON_RIGHT = SDL_BUTTON_RIGHT, - PGM_BUTTON_MIDDLE = SDL_BUTTON_MIDDLE, - PGM_BUTTON_WHEELUP = 4, - PGM_BUTTON_WHEELDOWN = 5, - PGM_BUTTON_X1 = SDL_BUTTON_X1 + 2, - PGM_BUTTON_X2 = SDL_BUTTON_X2 + 2, - PGM_BUTTON_KEEP = 0x80 -} PygameMouseFlags; - -typedef enum { - /* Any SDL_* events here are for backward compatibility. */ - SDL_NOEVENT = 0, - - SDL_ACTIVEEVENT = SDL_USEREVENT, - SDL_VIDEORESIZE, - SDL_VIDEOEXPOSE, - - PGE_MIDIIN, - PGE_MIDIOUT, - PGE_KEYREPEAT, /* Special internal pygame event, for managing key-presses - */ - - /* DO NOT CHANGE THE ORDER OF EVENTS HERE */ - PGE_WINDOWSHOWN, - PGE_WINDOWHIDDEN, - PGE_WINDOWEXPOSED, - PGE_WINDOWMOVED, - PGE_WINDOWRESIZED, - PGE_WINDOWSIZECHANGED, - PGE_WINDOWMINIMIZED, - PGE_WINDOWMAXIMIZED, - PGE_WINDOWRESTORED, - PGE_WINDOWENTER, - PGE_WINDOWLEAVE, - PGE_WINDOWFOCUSGAINED, - PGE_WINDOWFOCUSLOST, - PGE_WINDOWCLOSE, - PGE_WINDOWTAKEFOCUS, - PGE_WINDOWHITTEST, - - /* Here we define PGPOST_* events, events that act as a one-to-one - * proxy for SDL events (and some extra events too!), the proxy is used - * internally when pygame users use event.post() - * - * At a first glance, these may look redundant, but they are really - * important, especially with event blocking. If proxy events are - * not there, blocked events dont make it to our event filter, and - * that can break a lot of stuff. - * - * IMPORTANT NOTE: Do not post events directly with these proxy types, - * use the appropriate functions from event.c, that handle these proxy - * events for you. - * Proxy events are for internal use only */ - PGPOST_EVENTBEGIN, /* mark start of proxy-events */ - PGPOST_ACTIVEEVENT = PGPOST_EVENTBEGIN, - PGPOST_AUDIODEVICEADDED, - PGPOST_AUDIODEVICEREMOVED, - PGPOST_CONTROLLERAXISMOTION, - PGPOST_CONTROLLERBUTTONDOWN, - PGPOST_CONTROLLERBUTTONUP, - PGPOST_CONTROLLERDEVICEADDED, - PGPOST_CONTROLLERDEVICEREMOVED, - PGPOST_CONTROLLERDEVICEREMAPPED, - PGPOST_CONTROLLERTOUCHPADDOWN, - PGPOST_CONTROLLERTOUCHPADMOTION, - PGPOST_CONTROLLERTOUCHPADUP, - PGPOST_DOLLARGESTURE, - PGPOST_DOLLARRECORD, - PGPOST_DROPFILE, - PGPOST_DROPTEXT, - PGPOST_DROPBEGIN, - PGPOST_DROPCOMPLETE, - PGPOST_FINGERMOTION, - PGPOST_FINGERDOWN, - PGPOST_FINGERUP, - PGPOST_KEYDOWN, - PGPOST_KEYUP, - PGPOST_JOYAXISMOTION, - PGPOST_JOYBALLMOTION, - PGPOST_JOYHATMOTION, - PGPOST_JOYBUTTONDOWN, - PGPOST_JOYBUTTONUP, - PGPOST_JOYDEVICEADDED, - PGPOST_JOYDEVICEREMOVED, - PGPOST_MIDIIN, - PGPOST_MIDIOUT, - PGPOST_MOUSEMOTION, - PGPOST_MOUSEBUTTONDOWN, - PGPOST_MOUSEBUTTONUP, - PGPOST_MOUSEWHEEL, - PGPOST_MULTIGESTURE, - PGPOST_NOEVENT, - PGPOST_QUIT, - PGPOST_SYSWMEVENT, - PGPOST_TEXTEDITING, - PGPOST_TEXTINPUT, - PGPOST_VIDEORESIZE, - PGPOST_VIDEOEXPOSE, - PGPOST_WINDOWSHOWN, - PGPOST_WINDOWHIDDEN, - PGPOST_WINDOWEXPOSED, - PGPOST_WINDOWMOVED, - PGPOST_WINDOWRESIZED, - PGPOST_WINDOWSIZECHANGED, - PGPOST_WINDOWMINIMIZED, - PGPOST_WINDOWMAXIMIZED, - PGPOST_WINDOWRESTORED, - PGPOST_WINDOWENTER, - PGPOST_WINDOWLEAVE, - PGPOST_WINDOWFOCUSGAINED, - PGPOST_WINDOWFOCUSLOST, - PGPOST_WINDOWCLOSE, - PGPOST_WINDOWTAKEFOCUS, - PGPOST_WINDOWHITTEST, - - PGE_USEREVENT, /* this event must stay in this position only */ - - PG_NUMEVENTS = - SDL_LASTEVENT /* Not an event. Indicates end of user events. */ -} PygameEventCode; - -typedef enum { - SDL_APPFOCUSMOUSE, - SDL_APPINPUTFOCUS, - SDL_APPACTIVE -} PygameAppCode; - -/* Surface flags: based on SDL 1.2 flags */ -typedef enum { - PGS_SWSURFACE = 0x00000000, - PGS_HWSURFACE = 0x00000001, - PGS_ASYNCBLIT = 0x00000004, - - PGS_ANYFORMAT = 0x10000000, - PGS_HWPALETTE = 0x20000000, - PGS_DOUBLEBUF = 0x40000000, - PGS_FULLSCREEN = 0x80000000, - PGS_SCALED = 0x00000200, - - PGS_OPENGL = 0x00000002, - PGS_OPENGLBLIT = 0x0000000A, - PGS_RESIZABLE = 0x00000010, - PGS_NOFRAME = 0x00000020, - PGS_SHOWN = 0x00000040, /* Added from SDL 2 */ - PGS_HIDDEN = 0x00000080, /* Added from SDL 2 */ - - PGS_HWACCEL = 0x00000100, - PGS_SRCCOLORKEY = 0x00001000, - PGS_RLEACCELOK = 0x00002000, - PGS_RLEACCEL = 0x00004000, - PGS_SRCALPHA = 0x00010000, - PGS_PREALLOC = 0x01000000 -} PygameSurfaceFlags; - -// TODO Implement check below in a way that does not break CI -/* New buffer protocol (PEP 3118) implemented on all supported Py versions. -#if !defined(Py_TPFLAGS_HAVE_NEWBUFFER) -#error No support for PEP 3118/Py_TPFLAGS_HAVE_NEWBUFFER. Please use a -supported Python version. #endif */ - -#define RAISE(x, y) (PyErr_SetString((x), (y)), (PyObject *)NULL) -#define DEL_ATTR_NOT_SUPPORTED_CHECK(name, value) \ - do { \ - if (!value) { \ - if (name) { \ - PyErr_Format(PyExc_AttributeError, \ - "Cannot delete attribute %s", name); \ - } \ - else { \ - PyErr_SetString(PyExc_AttributeError, \ - "Cannot delete attribute"); \ - } \ - return -1; \ - } \ - } while (0) - -/* - * Initialization checks - */ - -#define VIDEO_INIT_CHECK() \ - if (!SDL_WasInit(SDL_INIT_VIDEO)) \ - return RAISE(pgExc_SDLError, "video system not initialized") - -#define CDROM_INIT_CHECK() \ - if (!SDL_WasInit(SDL_INIT_CDROM)) \ - return RAISE(pgExc_SDLError, "cdrom system not initialized") - -#define JOYSTICK_INIT_CHECK() \ - if (!SDL_WasInit(SDL_INIT_JOYSTICK)) \ - return RAISE(pgExc_SDLError, "joystick system not initialized") - -/* thread check */ -#ifdef WITH_THREAD -#define PG_CHECK_THREADS() (1) -#else /* ~WITH_THREAD */ -#define PG_CHECK_THREADS() \ - (RAISE(PyExc_NotImplementedError, "Python built without thread support")) -#endif /* ~WITH_THREAD */ - -#define PyType_Init(x) (((x).ob_type) = &PyType_Type) - -/* - * event module internals - */ -struct pgEventObject { - PyObject_HEAD int type; - PyObject *dict; -}; - -/* - * surflock module internals - */ -typedef struct { - PyObject_HEAD PyObject *surface; - PyObject *lockobj; - PyObject *weakrefs; -} pgLifetimeLockObject; - -/* - * surface module internals - */ -struct pgSubSurface_Data { - PyObject *owner; - int pixeloffset; - int offsetx, offsety; -}; - -/* - * color module internals - */ -struct pgColorObject { - PyObject_HEAD Uint8 data[4]; - Uint8 len; -}; - -/* - * include public API - */ -#include "include/_pygame.h" - -/* Slot counts. - * Remember to keep these constants up to date. - */ - -#define PYGAMEAPI_RECT_NUMSLOTS 5 -#define PYGAMEAPI_JOYSTICK_NUMSLOTS 2 -#define PYGAMEAPI_DISPLAY_NUMSLOTS 2 -#define PYGAMEAPI_SURFACE_NUMSLOTS 4 -#define PYGAMEAPI_SURFLOCK_NUMSLOTS 8 -#define PYGAMEAPI_RWOBJECT_NUMSLOTS 7 -#define PYGAMEAPI_PIXELARRAY_NUMSLOTS 2 -#define PYGAMEAPI_COLOR_NUMSLOTS 5 -#define PYGAMEAPI_MATH_NUMSLOTS 2 -#define PYGAMEAPI_CDROM_NUMSLOTS 2 -#define PYGAMEAPI_BASE_NUMSLOTS 24 -#define PYGAMEAPI_EVENT_NUMSLOTS 6 - -#endif /* _PYGAME_INTERNAL_H */ From 0cd1fbd9202840646e643bf90c694f7a3c5f4457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20=C5=9Amigiel?= Date: Fri, 1 Apr 2022 19:00:12 +0200 Subject: [PATCH 3/4] =?UTF-8?q?Usu=C5=84=20'venv/Include/site/python3.9/py?= =?UTF-8?q?game/surface.h'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- venv/Include/site/python3.9/pygame/surface.h | 355 ------------------- 1 file changed, 355 deletions(-) delete mode 100644 venv/Include/site/python3.9/pygame/surface.h diff --git a/venv/Include/site/python3.9/pygame/surface.h b/venv/Include/site/python3.9/pygame/surface.h deleted file mode 100644 index eb9bbed..0000000 --- a/venv/Include/site/python3.9/pygame/surface.h +++ /dev/null @@ -1,355 +0,0 @@ -/* - pygame - Python Game Library - Copyright (C) 2000-2001 Pete Shinners - Copyright (C) 2007 Marcus von Appen - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Pete Shinners - pete@shinners.org -*/ - -#ifndef SURFACE_H -#define SURFACE_H - -/* This is defined in SDL.h */ -#if defined(_POSIX_C_SOURCE) -#undef _POSIX_C_SOURCE -#endif - -#include -#include "pygame.h" - -/* Blend modes */ -#define PYGAME_BLEND_ADD 0x1 -#define PYGAME_BLEND_SUB 0x2 -#define PYGAME_BLEND_MULT 0x3 -#define PYGAME_BLEND_MIN 0x4 -#define PYGAME_BLEND_MAX 0x5 - -#define PYGAME_BLEND_RGB_ADD 0x1 -#define PYGAME_BLEND_RGB_SUB 0x2 -#define PYGAME_BLEND_RGB_MULT 0x3 -#define PYGAME_BLEND_RGB_MIN 0x4 -#define PYGAME_BLEND_RGB_MAX 0x5 - -#define PYGAME_BLEND_RGBA_ADD 0x6 -#define PYGAME_BLEND_RGBA_SUB 0x7 -#define PYGAME_BLEND_RGBA_MULT 0x8 -#define PYGAME_BLEND_RGBA_MIN 0x9 -#define PYGAME_BLEND_RGBA_MAX 0x10 -#define PYGAME_BLEND_PREMULTIPLIED 0x11 -#define PYGAME_BLEND_ALPHA_SDL2 0x12 - -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define GET_PIXEL_24(b) (b[0] + (b[1] << 8) + (b[2] << 16)) -#else -#define GET_PIXEL_24(b) (b[2] + (b[1] << 8) + (b[0] << 16)) -#endif - -#define GET_PIXEL(pxl, bpp, source) \ - switch (bpp) { \ - case 2: \ - pxl = *((Uint16 *)(source)); \ - break; \ - case 4: \ - pxl = *((Uint32 *)(source)); \ - break; \ - default: { \ - Uint8 *b = (Uint8 *)source; \ - pxl = GET_PIXEL_24(b); \ - } break; \ - } - -#define GET_PIXELVALS(_sR, _sG, _sB, _sA, px, fmt, ppa) \ - SDL_GetRGBA(px, fmt, &(_sR), &(_sG), &(_sB), &(_sA)); \ - if (!ppa) { \ - _sA = 255; \ - } - -#define GET_PIXELVALS_1(sr, sg, sb, sa, _src, _fmt) \ - sr = _fmt->palette->colors[*((Uint8 *)(_src))].r; \ - sg = _fmt->palette->colors[*((Uint8 *)(_src))].g; \ - sb = _fmt->palette->colors[*((Uint8 *)(_src))].b; \ - sa = 255; - -/* For 1 byte palette pixels */ -#define SET_PIXELVAL(px, fmt, _dR, _dG, _dB, _dA) \ - *(px) = (Uint8)SDL_MapRGBA(fmt, _dR, _dG, _dB, _dA) - -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SET_OFFSETS_24(or, og, ob, fmt) \ - { \ - or = (fmt->Rshift == 0 ? 0 : fmt->Rshift == 8 ? 1 : 2); \ - og = (fmt->Gshift == 0 ? 0 : fmt->Gshift == 8 ? 1 : 2); \ - ob = (fmt->Bshift == 0 ? 0 : fmt->Bshift == 8 ? 1 : 2); \ - } - -#define SET_OFFSETS_32(or, og, ob, fmt) \ - { \ - or = (fmt->Rshift == 0 ? 0 \ - : fmt->Rshift == 8 ? 1 \ - : fmt->Rshift == 16 ? 2 \ - : 3); \ - og = (fmt->Gshift == 0 ? 0 \ - : fmt->Gshift == 8 ? 1 \ - : fmt->Gshift == 16 ? 2 \ - : 3); \ - ob = (fmt->Bshift == 0 ? 0 \ - : fmt->Bshift == 8 ? 1 \ - : fmt->Bshift == 16 ? 2 \ - : 3); \ - } -#else -#define SET_OFFSETS_24(or, og, ob, fmt) \ - { \ - or = (fmt->Rshift == 0 ? 2 : fmt->Rshift == 8 ? 1 : 0); \ - og = (fmt->Gshift == 0 ? 2 : fmt->Gshift == 8 ? 1 : 0); \ - ob = (fmt->Bshift == 0 ? 2 : fmt->Bshift == 8 ? 1 : 0); \ - } - -#define SET_OFFSETS_32(or, og, ob, fmt) \ - { \ - or = (fmt->Rshift == 0 ? 3 \ - : fmt->Rshift == 8 ? 2 \ - : fmt->Rshift == 16 ? 1 \ - : 0); \ - og = (fmt->Gshift == 0 ? 3 \ - : fmt->Gshift == 8 ? 2 \ - : fmt->Gshift == 16 ? 1 \ - : 0); \ - ob = (fmt->Bshift == 0 ? 3 \ - : fmt->Bshift == 8 ? 2 \ - : fmt->Bshift == 16 ? 1 \ - : 0); \ - } -#endif - -#define CREATE_PIXEL(buf, r, g, b, a, bp, ft) \ - switch (bp) { \ - case 2: \ - *((Uint16 *)(buf)) = ((r >> ft->Rloss) << ft->Rshift) | \ - ((g >> ft->Gloss) << ft->Gshift) | \ - ((b >> ft->Bloss) << ft->Bshift) | \ - ((a >> ft->Aloss) << ft->Ashift); \ - break; \ - case 4: \ - *((Uint32 *)(buf)) = ((r >> ft->Rloss) << ft->Rshift) | \ - ((g >> ft->Gloss) << ft->Gshift) | \ - ((b >> ft->Bloss) << ft->Bshift) | \ - ((a >> ft->Aloss) << ft->Ashift); \ - break; \ - } - -/* Pretty good idea from Tom Duff :-). */ -#define LOOP_UNROLLED4(code, n, width) \ - n = (width + 3) / 4; \ - switch (width & 3) { \ - case 0: \ - do { \ - code; \ - case 3: \ - code; \ - case 2: \ - code; \ - case 1: \ - code; \ - } while (--n > 0); \ - } - -/* Used in the srcbpp == dstbpp == 1 blend functions */ -#define REPEAT_3(code) \ - code; \ - code; \ - code; - -#define REPEAT_4(code) \ - code; \ - code; \ - code; \ - code; - -#define BLEND_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ - tmp = dR + sR; \ - dR = (tmp <= 255 ? tmp : 255); \ - tmp = dG + sG; \ - dG = (tmp <= 255 ? tmp : 255); \ - tmp = dB + sB; \ - dB = (tmp <= 255 ? tmp : 255); - -#define BLEND_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ - tmp = dR - sR; \ - dR = (tmp >= 0 ? tmp : 0); \ - tmp = dG - sG; \ - dG = (tmp >= 0 ? tmp : 0); \ - tmp = dB - sB; \ - dB = (tmp >= 0 ? tmp : 0); - -#define BLEND_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \ - dR = (dR && sR) ? (dR * sR) >> 8 : 0; \ - dG = (dG && sG) ? (dG * sG) >> 8 : 0; \ - dB = (dB && sB) ? (dB * sB) >> 8 : 0; - -#define BLEND_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \ - if (sR < dR) { \ - dR = sR; \ - } \ - if (sG < dG) { \ - dG = sG; \ - } \ - if (sB < dB) { \ - dB = sB; \ - } - -#define BLEND_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \ - if (sR > dR) { \ - dR = sR; \ - } \ - if (sG > dG) { \ - dG = sG; \ - } \ - if (sB > dB) { \ - dB = sB; \ - } - -#define BLEND_RGBA_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ - tmp = dR + sR; \ - dR = (tmp <= 255 ? tmp : 255); \ - tmp = dG + sG; \ - dG = (tmp <= 255 ? tmp : 255); \ - tmp = dB + sB; \ - dB = (tmp <= 255 ? tmp : 255); \ - tmp = dA + sA; \ - dA = (tmp <= 255 ? tmp : 255); - -#define BLEND_RGBA_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ - tmp = dR - sR; \ - dR = (tmp >= 0 ? tmp : 0); \ - tmp = dG - sG; \ - dG = (tmp >= 0 ? tmp : 0); \ - tmp = dB - sB; \ - dB = (tmp >= 0 ? tmp : 0); \ - tmp = dA - sA; \ - dA = (tmp >= 0 ? tmp : 0); - -#define BLEND_RGBA_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \ - dR = (dR && sR) ? (dR * sR) >> 8 : 0; \ - dG = (dG && sG) ? (dG * sG) >> 8 : 0; \ - dB = (dB && sB) ? (dB * sB) >> 8 : 0; \ - dA = (dA && sA) ? (dA * sA) >> 8 : 0; - -#define BLEND_RGBA_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \ - if (sR < dR) { \ - dR = sR; \ - } \ - if (sG < dG) { \ - dG = sG; \ - } \ - if (sB < dB) { \ - dB = sB; \ - } \ - if (sA < dA) { \ - dA = sA; \ - } - -#define BLEND_RGBA_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \ - if (sR > dR) { \ - dR = sR; \ - } \ - if (sG > dG) { \ - dG = sG; \ - } \ - if (sB > dB) { \ - dB = sB; \ - } \ - if (sA > dA) { \ - dA = sA; \ - } - -#if 1 -/* Choose an alpha blend equation. If the sign is preserved on a right shift - * then use a specialized, faster, equation. Otherwise a more general form, - * where all additions are done before the shift, is needed. - */ -#if (-1 >> 1) < 0 -#define ALPHA_BLEND_COMP(sC, dC, sA) ((((sC - dC) * sA + sC) >> 8) + dC) -#else -#define ALPHA_BLEND_COMP(sC, dC, sA) (((dC << 8) + (sC - dC) * sA + sC) >> 8) -#endif - -#define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \ - do { \ - if (dA) { \ - dR = ALPHA_BLEND_COMP(sR, dR, sA); \ - dG = ALPHA_BLEND_COMP(sG, dG, sA); \ - dB = ALPHA_BLEND_COMP(sB, dB, sA); \ - dA = sA + dA - ((sA * dA) / 255); \ - } \ - else { \ - dR = sR; \ - dG = sG; \ - dB = sB; \ - dA = sA; \ - } \ - } while (0) - -#define ALPHA_BLEND_PREMULTIPLIED_COMP(sC, dC, sA) \ - (sC + dC - ((dC + 1) * sA >> 8)) - -#define ALPHA_BLEND_PREMULTIPLIED(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ - do { \ - dR = ALPHA_BLEND_PREMULTIPLIED_COMP(sR, dR, sA); \ - dG = ALPHA_BLEND_PREMULTIPLIED_COMP(sG, dG, sA); \ - dB = ALPHA_BLEND_PREMULTIPLIED_COMP(sB, dB, sA); \ - dA = ALPHA_BLEND_PREMULTIPLIED_COMP(sA, dA, sA); \ - } while (0) -#elif 0 - -#define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \ - do { \ - if (sA) { \ - if (dA && sA < 255) { \ - int dContrib = dA * (255 - sA) / 255; \ - dA = sA + dA - ((sA * dA) / 255); \ - dR = (dR * dContrib + sR * sA) / dA; \ - dG = (dG * dContrib + sG * sA) / dA; \ - dB = (dB * dContrib + sB * sA) / dA; \ - } \ - else { \ - dR = sR; \ - dG = sG; \ - dB = sB; \ - dA = sA; \ - } \ - } \ - } while (0) -#endif - -int -surface_fill_blend(SDL_Surface *surface, SDL_Rect *rect, Uint32 color, - int blendargs); - -void -surface_respect_clip_rect(SDL_Surface *surface, SDL_Rect *rect); - -int -pygame_AlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, - SDL_Rect *dstrect, int the_args); - -int -pygame_Blit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, - SDL_Rect *dstrect, int the_args); - -#endif /* SURFACE_H */ From 682d59b6a61d7f475151d7f9fa505d48882da027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20=C5=9Amigiel?= Date: Fri, 1 Apr 2022 19:00:18 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Usu=C5=84=20'venv/Include/site/python3.9/py?= =?UTF-8?q?game/scrap.h'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- venv/Include/site/python3.9/pygame/scrap.h | 147 --------------------- 1 file changed, 147 deletions(-) delete mode 100644 venv/Include/site/python3.9/pygame/scrap.h diff --git a/venv/Include/site/python3.9/pygame/scrap.h b/venv/Include/site/python3.9/pygame/scrap.h deleted file mode 100644 index b3265a3..0000000 --- a/venv/Include/site/python3.9/pygame/scrap.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - pygame - Python Game Library - Copyright (C) 2006, 2007 Rene Dudfield, Marcus von Appen - - Originally put in the public domain by Sam Lantinga. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef SCRAP_H -#define SCRAP_H - -/* This is unconditionally defined in Python.h */ -#if defined(_POSIX_C_SOURCE) -#undef _POSIX_C_SOURCE -#endif - -#include - -/* Handle clipboard text and data in arbitrary formats */ - -/** - * Predefined supported pygame scrap types. - */ -#define PYGAME_SCRAP_TEXT "text/plain" -#define PYGAME_SCRAP_BMP "image/bmp" -#define PYGAME_SCRAP_PPM "image/ppm" -#define PYGAME_SCRAP_PBM "image/pbm" - -/** - * The supported scrap clipboard types. - * - * This is only relevant in a X11 environment, which supports mouse - * selections as well. For Win32 and MacOS environments the default - * clipboard is used, no matter what value is passed. - */ -typedef enum { - SCRAP_CLIPBOARD, - SCRAP_SELECTION /* only supported in X11 environments. */ -} ScrapClipType; - -/** - * Macro for initialization checks. - */ -#define PYGAME_SCRAP_INIT_CHECK() \ - if (!pygame_scrap_initialized()) \ - return (PyErr_SetString(pgExc_SDLError, "scrap system not initialized."), \ - NULL) - -/** - * \brief Checks, whether the pygame scrap module was initialized. - * - * \return 1 if the modules was initialized, 0 otherwise. - */ -extern int -pygame_scrap_initialized(void); - -/** - * \brief Initializes the pygame scrap module internals. Call this before any - * other method. - * - * \return 1 on successful initialization, 0 otherwise. - */ -extern int -pygame_scrap_init(void); - -/** - * \brief Checks, whether the pygame window lost the clipboard focus or not. - * - * \return 1 if the window lost the focus, 0 otherwise. - */ -extern int -pygame_scrap_lost(void); - -/** - * \brief Places content of a specific type into the clipboard. - * - * \note For X11 the following notes are important: The following types - * are reserved for internal usage and thus will throw an error on - * setting them: "TIMESTAMP", "TARGETS", "SDL_SELECTION". - * Setting PYGAME_SCRAP_TEXT ("text/plain") will also automatically - * set the X11 types "STRING" (XA_STRING), "TEXT" and "UTF8_STRING". - * - * For Win32 the following notes are important: Setting - * PYGAME_SCRAP_TEXT ("text/plain") will also automatically set - * the Win32 type "TEXT" (CF_TEXT). - * - * For QNX the following notes are important: Setting - * PYGAME_SCRAP_TEXT ("text/plain") will also automatically set - * the QNX type "TEXT" (Ph_CL_TEXT). - * - * \param type The type of the content. - * \param srclen The length of the content. - * \param src The NULL terminated content. - * \return 1, if the content could be successfully pasted into the clipboard, - * 0 otherwise. - */ -extern int -pygame_scrap_put(char *type, int srclen, char *src); - -/** - * \brief Gets the current content from the clipboard. - * - * \note The received content does not need to be the content previously - * placed in the clipboard using pygame_put_scrap(). See the - * pygame_put_scrap() notes for more details. - * - * \param type The type of the content to receive. - * \param count The size of the returned content. - * \return The content or NULL in case of an error or if no content of the - * specified type was available. - */ -extern char * -pygame_scrap_get(char *type, unsigned long *count); - -/** - * \brief Gets the currently available content types from the clipboard. - * - * \return The different available content types or NULL in case of an - * error or if no content type is available. - */ -extern char ** -pygame_scrap_get_types(void); - -/** - * \brief Checks whether content for the specified scrap type is currently - * available in the clipboard. - * - * \param type The type to check for. - * \return 1, if there is content and 0 otherwise. - */ -extern int -pygame_scrap_contains(char *type); - -#endif /* SCRAP_H */