Skip to content

Commit daf8265

Browse files
committed
Merge branch 'main' into hwnd-param
2 parents 33d990c + 7075280 commit daf8265

File tree

140 files changed

+1963
-1080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1963
-1080
lines changed

.github/workflows/build-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
166166

167167
- name: Build and test wheels
168-
uses: pypa/cibuildwheel@v2.12.0
168+
uses: pypa/cibuildwheel@v2.12.1
169169

170170
- uses: actions/upload-artifact@v3
171171
with:

.github/workflows/build-manylinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
CIBW_MANYLINUX_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
119119
CIBW_MANYLINUX_PYPY_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
120120

121-
uses: pypa/cibuildwheel@v2.12.0
121+
uses: pypa/cibuildwheel@v2.12.1
122122

123123
# We upload the generated files under github actions assets
124124
- name: Upload dist

.github/workflows/build-ubuntu-sdist.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ jobs:
5757
# install numpy from pip and not apt because the one from pip is newer,
5858
# and has typestubs
5959
run: |
60-
sudo apt-mark hold grub-efi-amd64-signed
6160
sudo apt-get update --fix-missing
6261
sudo apt-get upgrade
6362
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev

.github/workflows/cppcheck.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626

2727
- name: Install deps
2828
run: |
29-
sudo apt-mark hold grub-efi-amd64-signed
3029
sudo apt-get update --fix-missing
3130
sudo apt-get upgrade
3231
sudo apt install cppcheck

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Pygame build process: config.py setup.py
1+
# pygame-ce build process: config.py setup.py
22
/Setup
33
*.pyc
44
/build/

buildconfig/Setup.Emscripten.SDL2.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ image src_c/void.c
4242
base src_c/void.c
4343
bufferproxy src_c/void.c
4444
color src_c/void.c
45-
controller src_c/void.c
45+
controller_old src_c/void.c
4646
display src_c/void.c
4747
draw src_c/void.c
4848
event src_c/void.c
@@ -60,9 +60,10 @@ surface src_c/void.c
6060
surflock src_c/void.c
6161
rect src_c/void.c
6262
rwobject src_c/void.c
63+
system src_c/void.c
6364

6465
#_sdl2.controller src_c/_sdl2/controller.c $(SDL) $(DEBUG) -Isrc_c
65-
_sdl2.controller src_c/void.c
66+
_sdl2.controller_old src_c/void.c
6667

6768
#_sdl2.touch src_c/_sdl2/touch.c $(SDL) $(DEBUG) -Isrc_c
6869
_sdl2.touch src_c/void.c

buildconfig/Setup.SDL2.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _sdl2.audio src_c/_sdl2/audio.c $(SDL) $(DEBUG) -Isrc_c
3737
_sdl2.video src_c/_sdl2/video.c src_c/pgcompat.c $(SDL) $(DEBUG) -Isrc_c
3838
_sdl2.mixer src_c/_sdl2/mixer.c $(SDL) $(MIXER) $(DEBUG) -Isrc_c
3939
_sdl2.touch src_c/_sdl2/touch.c $(SDL) $(DEBUG) -Isrc_c
40-
_sdl2.controller src_c/_sdl2/controller.c $(SDL) $(DEBUG) -Isrc_c
40+
_sdl2.controller_old src_c/_sdl2/controller_old.c $(SDL) $(DEBUG) -Isrc_c
4141

4242
GFX = src_c/SDL_gfx/SDL_gfxPrimitives.c
4343
#GFX = src_c/SDL_gfx/SDL_gfxBlitFunc.c src_c/SDL_gfx/SDL_gfxPrimitives.c
@@ -74,3 +74,4 @@ pixelarray src_c/pixelarray.c $(SDL) $(DEBUG)
7474
math src_c/math.c $(SDL) $(DEBUG)
7575
pixelcopy src_c/pixelcopy.c $(SDL) $(DEBUG)
7676
newbuffer src_c/newbuffer.c $(SDL) $(DEBUG)
77+
system src_c/system.c $(SDL) $(DEBUG)

buildconfig/bundle_docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#! /usr/bin/env python
22

3-
"""Tar-zip the pygame documents and examples.
3+
"""Tar-zip the pygame-ce documents and examples.
44
5-
Run this script from the pygame source root directory.
5+
Run this script from the pygame-ce source root directory.
66
"""
77

88
import os

buildconfig/config_msys2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Config on MSYS2"""
22

33
# The search logic is adapted from config_win.
4-
# This assumes that the PyGame dependencies are resolved
4+
# This assumes that the pygame-ce dependencies are resolved
55
# by MSYS2 packages.
66

77
try:

buildconfig/stubs/gen_stubs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
doc_as_comment = __doc__.replace("\n", "\n# ").strip() if __doc__ else ""
1313
info_header = f"{doc_as_comment} IMPORTANT NOTE: Do not edit this file by hand!\n\n"
1414

15-
# pygame submodules that are auto-imported must be kept in this list
16-
# keep in mind that not all pygame modules are auto-imported, hence not all
17-
# pygame submodules make it to this list
15+
# pygame-ce submodules that are auto-imported must be kept in this list
16+
# keep in mind that not all pygame-ce modules are auto-imported, hence not all
17+
# pygame-ce submodules make it to this list
1818
PG_AUTOIMPORT_SUBMODS = [
1919
"display",
2020
"draw",
@@ -34,7 +34,6 @@
3434
"sprite",
3535
"surfarray",
3636
"transform",
37-
"fastevent",
3837
"scrap",
3938
"threads",
4039
"version",
@@ -50,6 +49,7 @@
5049
"surflock",
5150
"sysfont",
5251
"_debug"
52+
"system",
5353
]
5454

5555
# pygame classes that are autoimported into main namespace are kept in this dict

buildconfig/stubs/mypy_allow_list.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ pygame\.pkgdata
2929
pygame\.pypm
3030
pygame\._sdl2\.mixer
3131
pygame\.sysfont.*
32+
33+
# temporarily ignore the controller module while it is being converted
34+
# to C
35+
pygame\._sdl2\.controller

buildconfig/stubs/pygame/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ from pygame import (
2626
sprite as sprite,
2727
surfarray as surfarray,
2828
transform as transform,
29-
fastevent as fastevent,
3029
scrap as scrap,
3130
threads as threads,
3231
version as version,
@@ -42,6 +41,7 @@ from pygame import (
4241
surflock as surflock,
4342
sysfont as sysfont,
4443
_debug as _debug,
44+
system as system,
4545
)
4646

4747
from .rect import Rect as Rect

buildconfig/stubs/pygame/display.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,6 @@ def get_allow_screensaver() -> bool: ...
7676
def set_allow_screensaver(value: bool = True) -> None: ...
7777
def get_desktop_sizes() -> List[Tuple[int, int]]: ...
7878
def is_fullscreen() -> bool: ...
79+
def is_vsync() -> bool: ...
80+
def get_current_refresh_rate() -> int: ...
81+
def get_desktop_refresh_rates() -> List[int]: ...

buildconfig/stubs/pygame/fastevent.pyi

Lines changed: 0 additions & 11 deletions
This file was deleted.

buildconfig/stubs/pygame/font.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def SysFont(
2828
) -> Font: ...
2929

3030
class Font:
31+
name: str
3132
bold: bool
3233
italic: bool
3334
underline: bool

buildconfig/stubs/pygame/image.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ _to_string_format = Literal[
1212
_from_buffer_format = Literal["P", "RGB", "BGR", "BGRA", "RGBX", "RGBA", "ARGB"]
1313
_from_string_format = Literal["P", "RGB", "RGBX", "RGBA", "ARGB", "BGRA"]
1414

15-
def load(filename: FileArg, namehint: str = "") -> Surface: ...
16-
def save(surface: Surface, filename: FileArg, namehint: str = "") -> None: ...
15+
def load(file: FileArg, namehint: str = "") -> Surface: ...
16+
def save(surface: Surface, file: FileArg, namehint: str = "") -> None: ...
1717
def get_sdl_image_version(linked: bool = True) -> Optional[Tuple[int, int, int]]: ...
1818
def get_extended() -> bool: ...
1919
def tostring(
@@ -46,6 +46,6 @@ def frombuffer(
4646
format: _from_buffer_format,
4747
pitch: int = -1,
4848
) -> Surface: ...
49-
def load_basic(filename: FileArg) -> Surface: ...
50-
def load_extended(filename: FileArg, namehint: str = "") -> Surface: ...
51-
def save_extended(surface: Surface, filename: FileArg, namehint: str = "") -> None: ...
49+
def load_basic(file: FileArg) -> Surface: ...
50+
def load_extended(file: FileArg, namehint: str = "") -> Surface: ...
51+
def save_extended(surface: Surface, file: FileArg, namehint: str = "") -> None: ...

buildconfig/stubs/pygame/sprite.pyi

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ _Group = AbstractGroup[_SpriteSupportsGroup]
2727

2828
# protocol helps with structural subtyping for typevars in sprite group generics
2929
class _SupportsSprite(Protocol):
30+
@property
31+
def image(self) -> Optional[Surface]: ...
32+
@image.setter
33+
def image(self, value: Optional[Surface]) -> None: ...
34+
@property
35+
def rect(self) -> Optional[Rect]: ...
36+
@rect.setter
37+
def rect(self, value: Optional[Rect]) -> None: ...
3038
@property
3139
def layer(self) -> int: ...
3240
@layer.setter
@@ -53,6 +61,14 @@ class _SupportsDirtySprite(_SupportsSprite, Protocol):
5361

5462
# concrete sprite implementation class
5563
class Sprite(_SupportsSprite):
64+
@property
65+
def image(self) -> Optional[Surface]: ...
66+
@image.setter
67+
def image(self, value: Optional[Surface]) -> None: ...
68+
@property
69+
def rect(self) -> Optional[Rect]: ...
70+
@rect.setter
71+
def rect(self, value: Optional[Rect]) -> None: ...
5672
@property
5773
def layer(self) -> int: ...
5874
@layer.setter
@@ -84,11 +100,13 @@ _TGroup = TypeVar("_TGroup", bound=AbstractGroup)
84100
# sprite functions don't need all sprite attributes to be present in the
85101
# arguments passed, they only use a few which are marked in the below protocols
86102
class _HasRect(Protocol):
87-
rect: Rect
103+
@property
104+
def rect(self) -> Optional[Rect]: ...
88105

89106
# image in addition to rect
90107
class _HasImageAndRect(_HasRect, Protocol):
91-
image: Surface
108+
@property
109+
def image(self) -> Optional[Surface]: ...
92110

93111
# mask in addition to rect
94112
class _HasMaskAndRect(_HasRect, Protocol):

buildconfig/stubs/pygame/system.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import List, Optional
2+
3+
from typing_extensions import TypedDict
4+
5+
# dict at runtime, TypedDict exists solely for the typechecking benefits
6+
class _Locale(TypedDict):
7+
language: str
8+
country: Optional[str]
9+
10+
def get_pref_path(org: str, app: str) -> str: ...
11+
def get_pref_locales() -> List[_Locale]: ...

buildconfig/stubs/pygame/transform.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,15 @@ def threshold(
5353
search_surf: Optional[Surface] = None,
5454
inverse_set: bool = False,
5555
) -> int: ...
56+
def box_blur(
57+
surface: Surface,
58+
radius: int,
59+
repeat_edge_pixels: bool = True,
60+
dest_surface: Optional[Surface] = None
61+
) -> Surface: ...
62+
def gaussian_blur(
63+
surface: Surface,
64+
radius: int,
65+
repeat_edge_pixels: bool = True,
66+
dest_surface: Optional[Surface] = None
67+
) -> Surface: ...

docs/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def _iterpath(path):
1212
yield last
1313

1414

15-
# for test suite to confirm pygame built with local docs
15+
# for test suite to confirm pygame-ce built with local docs
1616
def has_local_docs():
1717
pkg_dir = os.path.dirname(os.path.abspath(__file__))
1818
main_page = os.path.join(pkg_dir, "generated", "index.html")

docs/reST/c_api/surface.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ Header file: src_c/include/pygame.h
4242
This is a macro. Argument *x* is assumed to be a Surface, or subclass of
4343
Surface, instance.
4444
45-
.. c:function:: int pgSurface_Blit(PyObject *dstobj, PyObject *srcobj, SDL_Rect *dstrect, SDL_Rect *srcrect, int the_args)
45+
.. c:function:: int pgSurface_Blit(PyObject *dstobj, PyObject *srcobj, SDL_Rect *dstrect, SDL_Rect *srcrect, int blend_flags)
4646
4747
Blit the *srcrect* portion of Surface *srcobj* onto Surface *dstobj* at *srcobj*
4848
49-
Argument *the_args* indicates the type of blit to perform:
49+
Argument *blend_flags* indicates the type of blit to perform:
5050
Normal blit (``0``), ``PYGAME_BLEND_ADD``, ``PYGAME_BLEND_SUB``,
5151
``PYGAME_BLEND_SUB``, ``PYGAME_BLEND_MULT``, ``PYGAME_BLEND_MIN``,
5252
``PYGAME_BLEND_MAX``, ``PYGAME_BLEND_RGBA_ADD``, ``PYGAME_BLEND_RGBA_SUB``,

docs/reST/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Pygame documentation build configuration file, created by
2+
# pygame-ce documentation build configuration file, created by
33
# sphinx-quickstart on Sat Mar 5 11:56:39 2011.
44
#
55
# This file is execfile()d with the current directory set to its containing dir.

0 commit comments

Comments
 (0)