dimi-ui 0.1.0__tar.gz
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.
- dimi_ui-0.1.0/PKG-INFO +73 -0
- dimi_ui-0.1.0/README.md +50 -0
- dimi_ui-0.1.0/pyproject.toml +45 -0
- dimi_ui-0.1.0/setup.cfg +4 -0
- dimi_ui-0.1.0/src/dimi/__init__.py +115 -0
- dimi_ui-0.1.0/src/dimi/_app.py +1237 -0
- dimi_ui-0.1.0/src/dimi/_canvas.py +1259 -0
- dimi_ui-0.1.0/src/dimi/_components.py +268 -0
- dimi_ui-0.1.0/src/dimi/_context.py +296 -0
- dimi_ui-0.1.0/src/dimi/_dimi.py +240 -0
- dimi_ui-0.1.0/src/dimi/_entry_line.py +923 -0
- dimi_ui-0.1.0/src/dimi/_error.py +5 -0
- dimi_ui-0.1.0/src/dimi/_icon.py +883 -0
- dimi_ui-0.1.0/src/dimi/_interaction.py +226 -0
- dimi_ui-0.1.0/src/dimi/_node.py +760 -0
- dimi_ui-0.1.0/src/dimi/_primitives.py +344 -0
- dimi_ui-0.1.0/src/dimi/_scroll.py +204 -0
- dimi_ui-0.1.0/src/dimi/_style.py +276 -0
- dimi_ui-0.1.0/src/dimi/_version.py +6 -0
- dimi_ui-0.1.0/src/dimi/app.py +31 -0
- dimi_ui-0.1.0/src/dimi/icon.py +39 -0
- dimi_ui-0.1.0/src/dimi/typehinting.py +65 -0
- dimi_ui-0.1.0/src/dimi/widget.py +29 -0
- dimi_ui-0.1.0/src/dimi_ui.egg-info/PKG-INFO +73 -0
- dimi_ui-0.1.0/src/dimi_ui.egg-info/SOURCES.txt +26 -0
- dimi_ui-0.1.0/src/dimi_ui.egg-info/dependency_links.txt +1 -0
- dimi_ui-0.1.0/src/dimi_ui.egg-info/requires.txt +1 -0
- dimi_ui-0.1.0/src/dimi_ui.egg-info/top_level.txt +1 -0
dimi_ui-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dimi-ui
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Immediate-mode Python & pygame-ce user interface library using a deferred two-pass layout system
|
|
5
|
+
Author-email: Damiano Ricciardi <ricciardi.damiano06@gmail.com>
|
|
6
|
+
Maintainer-email: Damiano Ricciardi <ricciardi.damiano06@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/damusss/dimi-ui
|
|
9
|
+
Project-URL: Documentation, https://github.com/damusss/dimi-ui
|
|
10
|
+
Project-URL: Repository, https://github.com/damusss/dimi-ui.git
|
|
11
|
+
Project-URL: Issues, https://github.com/damusss/dimi-ui/issues
|
|
12
|
+
Keywords: ui,user-interface,immediate-mode
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: pygame
|
|
20
|
+
Requires-Python: >=3.14
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: pygame-ce>=2.5.8
|
|
23
|
+
|
|
24
|
+
# dimi(-ui)
|
|
25
|
+
|
|
26
|
+
> [!WARNING]
|
|
27
|
+
> dimi-ui is still early in development. It supports a limited amount of features and documentation isn't currently
|
|
28
|
+
> available.
|
|
29
|
+
|
|
30
|
+
dimi is an immediate-mode user interface library designed for Python and pygame-ce using a deferred two-pass layout
|
|
31
|
+
system.
|
|
32
|
+
More specifically, the layout engine uses four passes to complete a UI cycle:
|
|
33
|
+
|
|
34
|
+
- declaration pass
|
|
35
|
+
- measure/arrange two-pass layout (size & position resolution)
|
|
36
|
+
- render/interaction resolution pass
|
|
37
|
+
|
|
38
|
+
Element interaction is provided immediately during the declaration pass, allowing immediate application logic, but it
|
|
39
|
+
is actually deferred from the previous frame, which is negligeable at sensible framerates.
|
|
40
|
+
|
|
41
|
+
The library supports both software rendering and the experimental `pygame(-ce)._render` API out of the box. It can be
|
|
42
|
+
used to build UI-only applications or be integrated in existing applications and games.
|
|
43
|
+
|
|
44
|
+
The only supported environment is the latest version of the [pygame-ce (Pygame Community Edition)](https://pyga.me)
|
|
45
|
+
library. Neither upstream pygame nor the outdated `pygame._sdl2.video` API are supported.
|
|
46
|
+
|
|
47
|
+
dimi is intended to be a polished and more immediate-oriented successor of [mili](https://github.com/damusss/mili-ui) (
|
|
48
|
+
limited only by a couple of layout rules required to keep the two-pass system efficient).
|
|
49
|
+
|
|
50
|
+
> [!NOTE]
|
|
51
|
+
> `dimi`, which is the package import name, stands for "deferred immediate mode (user) interface".
|
|
52
|
+
|
|
53
|
+
## Installation & Import
|
|
54
|
+
|
|
55
|
+
Install the latest version thorugh PyPI or clone & install from source:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install dimi-ui
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The import name differs from the PyPI package:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
import dimi
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Every feature can be accessed through the following modules:
|
|
68
|
+
|
|
69
|
+
- `dimi`
|
|
70
|
+
- `dimi.widget`
|
|
71
|
+
- `dimi.app`
|
|
72
|
+
- `dimi.icon`
|
|
73
|
+
- `dimi.typehinting`
|
dimi_ui-0.1.0/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# dimi(-ui)
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> dimi-ui is still early in development. It supports a limited amount of features and documentation isn't currently
|
|
5
|
+
> available.
|
|
6
|
+
|
|
7
|
+
dimi is an immediate-mode user interface library designed for Python and pygame-ce using a deferred two-pass layout
|
|
8
|
+
system.
|
|
9
|
+
More specifically, the layout engine uses four passes to complete a UI cycle:
|
|
10
|
+
|
|
11
|
+
- declaration pass
|
|
12
|
+
- measure/arrange two-pass layout (size & position resolution)
|
|
13
|
+
- render/interaction resolution pass
|
|
14
|
+
|
|
15
|
+
Element interaction is provided immediately during the declaration pass, allowing immediate application logic, but it
|
|
16
|
+
is actually deferred from the previous frame, which is negligeable at sensible framerates.
|
|
17
|
+
|
|
18
|
+
The library supports both software rendering and the experimental `pygame(-ce)._render` API out of the box. It can be
|
|
19
|
+
used to build UI-only applications or be integrated in existing applications and games.
|
|
20
|
+
|
|
21
|
+
The only supported environment is the latest version of the [pygame-ce (Pygame Community Edition)](https://pyga.me)
|
|
22
|
+
library. Neither upstream pygame nor the outdated `pygame._sdl2.video` API are supported.
|
|
23
|
+
|
|
24
|
+
dimi is intended to be a polished and more immediate-oriented successor of [mili](https://github.com/damusss/mili-ui) (
|
|
25
|
+
limited only by a couple of layout rules required to keep the two-pass system efficient).
|
|
26
|
+
|
|
27
|
+
> [!NOTE]
|
|
28
|
+
> `dimi`, which is the package import name, stands for "deferred immediate mode (user) interface".
|
|
29
|
+
|
|
30
|
+
## Installation & Import
|
|
31
|
+
|
|
32
|
+
Install the latest version thorugh PyPI or clone & install from source:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install dimi-ui
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The import name differs from the PyPI package:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import dimi
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Every feature can be accessed through the following modules:
|
|
45
|
+
|
|
46
|
+
- `dimi`
|
|
47
|
+
- `dimi.widget`
|
|
48
|
+
- `dimi.app`
|
|
49
|
+
- `dimi.icon`
|
|
50
|
+
- `dimi.typehinting`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "dimi-ui"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Immediate-mode Python & pygame-ce user interface library using a deferred two-pass layout system"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.14"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Damiano Ricciardi", email = "ricciardi.damiano06@gmail.com" }
|
|
14
|
+
]
|
|
15
|
+
maintainers = [
|
|
16
|
+
{ name = "Damiano Ricciardi", email = "ricciardi.damiano06@gmail.com" }
|
|
17
|
+
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Topic :: Software Development :: User Interfaces",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: pygame",
|
|
26
|
+
]
|
|
27
|
+
keywords = ["ui", "user-interface", "immediate-mode"]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"pygame-ce>=2.5.8",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://github.com/damusss/dimi-ui"
|
|
34
|
+
Documentation = "https://github.com/damusss/dimi-ui" #
|
|
35
|
+
Repository = "https://github.com/damusss/dimi-ui.git"
|
|
36
|
+
Issues = "https://github.com/damusss/dimi-ui/issues"
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.packages.find]
|
|
39
|
+
where = ["src"]
|
|
40
|
+
include = ["dimi*"]
|
|
41
|
+
namespaces = false
|
|
42
|
+
|
|
43
|
+
[tool.ruff]
|
|
44
|
+
line-length = 88
|
|
45
|
+
target-version = "py314"
|
dimi_ui-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"Absolute",
|
|
3
|
+
"Align",
|
|
4
|
+
"Anchor",
|
|
5
|
+
"Axis",
|
|
6
|
+
"Button",
|
|
7
|
+
"ButtonStatus",
|
|
8
|
+
"ChooseAxis",
|
|
9
|
+
"Constraint",
|
|
10
|
+
"Context",
|
|
11
|
+
"ContextOrigin",
|
|
12
|
+
"Corners",
|
|
13
|
+
"Directions",
|
|
14
|
+
"EllipseStyle",
|
|
15
|
+
"Exact",
|
|
16
|
+
"Fill",
|
|
17
|
+
"Font",
|
|
18
|
+
"FontAlign",
|
|
19
|
+
"FontDirection",
|
|
20
|
+
"HoverStatus",
|
|
21
|
+
"Hug",
|
|
22
|
+
"IllegalOperation",
|
|
23
|
+
"ImageFit",
|
|
24
|
+
"ImageRepeat",
|
|
25
|
+
"NinePatch",
|
|
26
|
+
"Percent",
|
|
27
|
+
"Ratio",
|
|
28
|
+
"RectStyle",
|
|
29
|
+
"RenderOrder",
|
|
30
|
+
"RendererCanvas",
|
|
31
|
+
"ScaleQuality",
|
|
32
|
+
"Span",
|
|
33
|
+
"Style",
|
|
34
|
+
"SurfaceCanvas",
|
|
35
|
+
"TextStyle",
|
|
36
|
+
"Transform",
|
|
37
|
+
"Wrap",
|
|
38
|
+
"app",
|
|
39
|
+
"begin",
|
|
40
|
+
"element",
|
|
41
|
+
"ellipse",
|
|
42
|
+
"end",
|
|
43
|
+
"get_current_context",
|
|
44
|
+
"get_interaction",
|
|
45
|
+
"icon",
|
|
46
|
+
"image",
|
|
47
|
+
"push_id",
|
|
48
|
+
"push_style",
|
|
49
|
+
"rect",
|
|
50
|
+
"replace_nested_style",
|
|
51
|
+
"text",
|
|
52
|
+
"typehinting",
|
|
53
|
+
"using",
|
|
54
|
+
"when",
|
|
55
|
+
"widget",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
from . import app, icon, typehinting, widget # todo: animation module
|
|
59
|
+
from ._canvas import RendererCanvas, SurfaceCanvas
|
|
60
|
+
from ._context import Context, ContextOrigin
|
|
61
|
+
from ._dimi import (
|
|
62
|
+
begin,
|
|
63
|
+
element,
|
|
64
|
+
ellipse,
|
|
65
|
+
end,
|
|
66
|
+
get_current_context,
|
|
67
|
+
get_interaction,
|
|
68
|
+
image,
|
|
69
|
+
push_id,
|
|
70
|
+
push_style,
|
|
71
|
+
rect,
|
|
72
|
+
replace_nested_style,
|
|
73
|
+
text,
|
|
74
|
+
using,
|
|
75
|
+
when,
|
|
76
|
+
)
|
|
77
|
+
from ._error import IllegalOperation
|
|
78
|
+
from ._interaction import (
|
|
79
|
+
Button,
|
|
80
|
+
ButtonStatus,
|
|
81
|
+
HoverStatus,
|
|
82
|
+
)
|
|
83
|
+
from ._primitives import (
|
|
84
|
+
Absolute,
|
|
85
|
+
Align,
|
|
86
|
+
Anchor,
|
|
87
|
+
Axis,
|
|
88
|
+
ChooseAxis,
|
|
89
|
+
Constraint,
|
|
90
|
+
Corners,
|
|
91
|
+
Directions,
|
|
92
|
+
Exact,
|
|
93
|
+
Fill,
|
|
94
|
+
Font,
|
|
95
|
+
FontAlign,
|
|
96
|
+
FontDirection,
|
|
97
|
+
Hug,
|
|
98
|
+
ImageFit,
|
|
99
|
+
ImageRepeat,
|
|
100
|
+
NinePatch,
|
|
101
|
+
Percent,
|
|
102
|
+
Ratio,
|
|
103
|
+
RenderOrder,
|
|
104
|
+
ScaleQuality,
|
|
105
|
+
Span,
|
|
106
|
+
Transform,
|
|
107
|
+
Wrap,
|
|
108
|
+
)
|
|
109
|
+
from ._style import (
|
|
110
|
+
EllipseStyle,
|
|
111
|
+
RectStyle,
|
|
112
|
+
Style,
|
|
113
|
+
TextStyle,
|
|
114
|
+
)
|
|
115
|
+
from ._version import __version__ as __version__ # todo add "lazy" with Python 3.15
|