mini-arcade-native-backend 0.4.5__cp39-cp39-win_amd64.whl → 0.5.0__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ from __future__ import annotations
7
7
  import os
8
8
  import sys
9
9
  from pathlib import Path
10
- from typing import Union
10
+ from typing import Optional, Union
11
11
 
12
12
  # --- 1) Make sure Windows can find SDL2.dll when using vcpkg ------------------
13
13
 
@@ -37,13 +37,27 @@ if sys.platform == "win32":
37
37
 
38
38
  # Justification: Need to import core after setting DLL path on Windows
39
39
  # pylint: disable=wrong-import-position
40
- from mini_arcade_core import Backend, Event, EventType
41
- from mini_arcade_core.keymaps.sdl import SDL_KEYCODE_TO_KEY
40
+ # Justification: When mini-arcade-core is installed in editable mode, import-error
41
+ # false positive can occur.
42
+ # pylint: disable=import-error
43
+ from mini_arcade_core.backend import ( # pyright: ignore[reportMissingImports]
44
+ Backend,
45
+ )
46
+ from mini_arcade_core.backend.events import ( # pyright: ignore[reportMissingImports]
47
+ Event,
48
+ EventType,
49
+ )
50
+ from mini_arcade_core.backend.sdl_map import ( # pyright: ignore[reportMissingImports]
51
+ SDL_KEYCODE_TO_KEY,
52
+ )
42
53
 
43
54
  # Justification: Importing the native extension module
44
55
  # pylint: disable=import-self,no-name-in-module
45
56
  from . import _native as native
46
57
 
58
+ # pylint: enable=import-error
59
+
60
+
47
61
  # --- 2) Now import core + define NativeBackend as before ---
48
62
 
49
63
 
@@ -108,7 +122,7 @@ class NativeBackend(Backend):
108
122
  self._fonts_by_size[font_size] = font_id
109
123
  return font_id
110
124
 
111
- def init(self, width: int, height: int, title: str):
125
+ def init(self, width: int, height: int, title: Optional[str] = None):
112
126
  """
113
127
  Initialize the backend with a window of given width, height, and title.
114
128
 
@@ -119,8 +133,10 @@ class NativeBackend(Backend):
119
133
  :type height: int
120
134
 
121
135
  :param title: Title of the window.
122
- :type title: str
136
+ :type title: Optional[str]
123
137
  """
138
+ if title is None:
139
+ title = ""
124
140
  self._engine.init(width, height, title)
125
141
 
126
142
  # Load font if provided
@@ -130,6 +146,15 @@ class NativeBackend(Backend):
130
146
  )
131
147
  self._fonts_by_size[self._font_size] = self._default_font_id
132
148
 
149
+ def set_window_title(self, title: str):
150
+ """
151
+ Set the window title.
152
+
153
+ :param title: Title of the window.
154
+ :type title: str
155
+ """
156
+ self._engine.set_window_title(title)
157
+
133
158
  def set_clear_color(self, r: int, g: int, b: int):
134
159
  """
135
160
  Set the background/clear color used by begin_frame.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mini-arcade-native-backend
3
- Version: 0.4.5
3
+ Version: 0.5.0
4
4
  Summary: Native SDL2 backend for mini-arcade-core using SDL2 + pybind11.
5
5
  Author-Email: Santiago Rincon <rincores@gmail.com>
6
6
  License: Copyright (c) 2025 Santiago Rincón
@@ -24,7 +24,7 @@ License: Copyright (c) 2025 Santiago Rincón
24
24
  SOFTWARE.
25
25
 
26
26
  Requires-Python: <3.12,>=3.9
27
- Requires-Dist: mini-arcade-core~=0.9
27
+ Requires-Dist: mini-arcade-core~=1.0
28
28
  Provides-Extra: dev
29
29
  Requires-Dist: pytest~=8.3; extra == "dev"
30
30
  Requires-Dist: pytest-cov~=6.0; extra == "dev"
@@ -0,0 +1,6 @@
1
+ mini_arcade_native_backend/__init__.py,sha256=CtzaxGTyVhLBVDB6naaqR0LCCz3CSuUpJP2SXQGCz64,12704
2
+ mini_arcade_native_backend/_native.cp39-win_amd64.pyd,sha256=AWWKVEbfySsajm5OwPUQWi3t4HTVkWrsoiLXNSBOuZ8,226816
3
+ mini_arcade_native_backend-0.5.0.dist-info/METADATA,sha256=BrvJBIkrJ0pxAxOSm1yV9_Ga88JFpOMB6G7mUgRSaZY,10517
4
+ mini_arcade_native_backend-0.5.0.dist-info/WHEEL,sha256=9tsL4JT94eZPTkcS3bNng2riasYJMxXndrO9CxUfJHs,104
5
+ mini_arcade_native_backend-0.5.0.dist-info/licenses/LICENSE,sha256=cZRgTdRJ3YASekMxkGAvylB2nROh4ov228DxAogK3yY,1115
6
+ mini_arcade_native_backend-0.5.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- mini_arcade_native_backend/__init__.py,sha256=CeWzMbCkL2W4TFCqWtxBixiF5G2rurklJNtc_gSCaSw,11997
2
- mini_arcade_native_backend/_native.cp39-win_amd64.pyd,sha256=xFYfXul88i2rNXEworptnITNVQDO151AhDZOp5o7S9s,225280
3
- mini_arcade_native_backend-0.4.5.dist-info/METADATA,sha256=tQXwTCO3E-bfFCLD66R-GR0_WXm-d6PHvkYoRa7AC2c,10517
4
- mini_arcade_native_backend-0.4.5.dist-info/WHEEL,sha256=9tsL4JT94eZPTkcS3bNng2riasYJMxXndrO9CxUfJHs,104
5
- mini_arcade_native_backend-0.4.5.dist-info/licenses/LICENSE,sha256=cZRgTdRJ3YASekMxkGAvylB2nROh4ov228DxAogK3yY,1115
6
- mini_arcade_native_backend-0.4.5.dist-info/RECORD,,