kigo-gui-framework 2.8__tar.gz → 3.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.
- {kigo_gui_framework-2.8/kigo_gui_framework.egg-info → kigo_gui_framework-3.0}/PKG-INFO +3 -2
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/README.txt +2 -1
- kigo_gui_framework-3.0/kigo/app.py +113 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0/kigo_gui_framework.egg-info}/PKG-INFO +3 -2
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/pyproject.toml +2 -2
- kigo_gui_framework-2.8/kigo/app.py +0 -107
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/MANIFEST.in +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/_init_.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/accelerate.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/fx_gl2d.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/fx_quick.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/gpu.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/hud.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/hwaccel.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/media.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/physics.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/physics_policy.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/platform.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/runtime.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/shader_demo.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/shim.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/skins.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/style.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/tree.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo/widgets.py +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo_gui_framework.egg-info/SOURCES.txt +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo_gui_framework.egg-info/dependency_links.txt +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo_gui_framework.egg-info/requires.txt +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo_gui_framework.egg-info/top_level.txt +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/setup.cfg +0 -0
- {kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/setup.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kigo-gui-framework
|
|
3
|
-
Version:
|
|
4
|
-
Summary: Kigo
|
|
3
|
+
Version: 3.0
|
|
4
|
+
Summary: Kigo can log things in .json. Not telemetry. And even though Class 5 is tough you will get updates do not worry.
|
|
5
5
|
Author-email: "Anand Kumar, Utkarsh Raghav Roy" <swiss.armyknife@icloud.com>
|
|
6
6
|
License: zlib
|
|
7
7
|
Keywords: gui,qt,pyqt6,physics,pybullet,simulation,robotics,animation
|
|
@@ -32,3 +32,4 @@ Linux
|
|
|
32
32
|
Mac
|
|
33
33
|
Windous
|
|
34
34
|
ChromeOS
|
|
35
|
+
Do not use v2.8 (missing __init__.py)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Zlib
|
|
2
|
+
# kigo/app.py
|
|
3
|
+
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from kigo.platform_info import summary as platform_summary
|
|
7
|
+
from kigo.logging import JsonLogger
|
|
8
|
+
from kigo.qt.backend import QtCore, QtWidgets
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class App:
|
|
12
|
+
"""
|
|
13
|
+
Base Kigo application class.
|
|
14
|
+
|
|
15
|
+
Features:
|
|
16
|
+
- JSON logging (opt-in via `log = "on"`)
|
|
17
|
+
- Cross-platform Qt backend
|
|
18
|
+
- Clean lifecycle hooks
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, *, dev: bool = False):
|
|
22
|
+
# ----------------------------------
|
|
23
|
+
# Detect logging switch
|
|
24
|
+
# ----------------------------------
|
|
25
|
+
enabled = False
|
|
26
|
+
try:
|
|
27
|
+
enabled = globals().get("log") in ("on", True)
|
|
28
|
+
except Exception:
|
|
29
|
+
enabled = False
|
|
30
|
+
|
|
31
|
+
self.log = JsonLogger(enabled=enabled)
|
|
32
|
+
self.dev = dev
|
|
33
|
+
|
|
34
|
+
if enabled:
|
|
35
|
+
self.log.info("Kigo logging enabled")
|
|
36
|
+
|
|
37
|
+
# ----------------------------------
|
|
38
|
+
# Qt application
|
|
39
|
+
# ----------------------------------
|
|
40
|
+
self.qt_app = QtWidgets.QApplication(sys.argv)
|
|
41
|
+
|
|
42
|
+
# ----------------------------------
|
|
43
|
+
# Platform info (one-time snapshot)
|
|
44
|
+
# ----------------------------------
|
|
45
|
+
self.platform = platform_summary()
|
|
46
|
+
|
|
47
|
+
if enabled:
|
|
48
|
+
self.log.info("Platform detected", **self.platform)
|
|
49
|
+
|
|
50
|
+
# ----------------------------------
|
|
51
|
+
# Lifecycle hooks
|
|
52
|
+
# ----------------------------------
|
|
53
|
+
self._started = False
|
|
54
|
+
|
|
55
|
+
# --------------------------------------
|
|
56
|
+
# Lifecycle hooks (override these)
|
|
57
|
+
# --------------------------------------
|
|
58
|
+
|
|
59
|
+
def on_start(self):
|
|
60
|
+
"""Called once after QApplication is ready."""
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
def on_exit(self):
|
|
64
|
+
"""Called right before application exits."""
|
|
65
|
+
pass
|
|
66
|
+
|
|
67
|
+
# --------------------------------------
|
|
68
|
+
# Internal lifecycle
|
|
69
|
+
# --------------------------------------
|
|
70
|
+
|
|
71
|
+
def _start(self):
|
|
72
|
+
if self._started:
|
|
73
|
+
return
|
|
74
|
+
self._started = True
|
|
75
|
+
|
|
76
|
+
if self.log.enabled:
|
|
77
|
+
self.log.info("App starting")
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
self.on_start()
|
|
81
|
+
except Exception as e:
|
|
82
|
+
if self.log.enabled:
|
|
83
|
+
self.log.error("Error in on_start", error=str(e))
|
|
84
|
+
raise
|
|
85
|
+
|
|
86
|
+
def _exit(self):
|
|
87
|
+
if self.log.enabled:
|
|
88
|
+
self.log.info("App exiting")
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
self.on_exit()
|
|
92
|
+
except Exception as e:
|
|
93
|
+
if self.log.enabled:
|
|
94
|
+
self.log.error("Error in on_exit", error=str(e))
|
|
95
|
+
|
|
96
|
+
# --------------------------------------
|
|
97
|
+
# Run
|
|
98
|
+
# --------------------------------------
|
|
99
|
+
|
|
100
|
+
def run(self):
|
|
101
|
+
"""
|
|
102
|
+
Start the Qt event loop.
|
|
103
|
+
"""
|
|
104
|
+
self._start()
|
|
105
|
+
|
|
106
|
+
exit_code = 0
|
|
107
|
+
try:
|
|
108
|
+
exit_code = self.qt_app.exec()
|
|
109
|
+
finally:
|
|
110
|
+
self._exit()
|
|
111
|
+
|
|
112
|
+
sys.exit(exit_code)
|
|
113
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kigo-gui-framework
|
|
3
|
-
Version:
|
|
4
|
-
Summary: Kigo
|
|
3
|
+
Version: 3.0
|
|
4
|
+
Summary: Kigo can log things in .json. Not telemetry. And even though Class 5 is tough you will get updates do not worry.
|
|
5
5
|
Author-email: "Anand Kumar, Utkarsh Raghav Roy" <swiss.armyknife@icloud.com>
|
|
6
6
|
License: zlib
|
|
7
7
|
Keywords: gui,qt,pyqt6,physics,pybullet,simulation,robotics,animation
|
|
@@ -32,3 +32,4 @@ Linux
|
|
|
32
32
|
Mac
|
|
33
33
|
Windous
|
|
34
34
|
ChromeOS
|
|
35
|
+
Do not use v2.8 (missing __init__.py)
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kigo-gui-framework"
|
|
7
|
-
version = "
|
|
8
|
-
description = "Kigo
|
|
7
|
+
version = "3.0"
|
|
8
|
+
description = "Kigo can log things in .json. Not telemetry. And even though Class 5 is tough you will get updates do not worry."
|
|
9
9
|
readme = "README.txt"
|
|
10
10
|
requires-python = ">=3.8"
|
|
11
11
|
license = { text = "zlib" }
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: Zlib
|
|
2
|
-
# kigo/app.py
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
import sys
|
|
6
|
-
import time
|
|
7
|
-
|
|
8
|
-
from kigo.qt.backend import QtCore, QtWidgets, IS_ANDROID
|
|
9
|
-
from kigo.android import AndroidLifecycle, is_android
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class App:
|
|
13
|
-
"""
|
|
14
|
-
Base application class for Kigo.
|
|
15
|
-
|
|
16
|
-
- Desktop: PyQt6
|
|
17
|
-
- Android: PySide6
|
|
18
|
-
- Touch-friendly
|
|
19
|
-
- Lifecycle-aware
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
def __init__(self, *, dev: bool = False):
|
|
23
|
-
self.dev = dev
|
|
24
|
-
self._last_time = time.perf_counter()
|
|
25
|
-
|
|
26
|
-
# ----------------------------------
|
|
27
|
-
# Qt Application
|
|
28
|
-
# ----------------------------------
|
|
29
|
-
self.qt_app = QtWidgets.QApplication.instance()
|
|
30
|
-
if self.qt_app is None:
|
|
31
|
-
self.qt_app = QtWidgets.QApplication(sys.argv)
|
|
32
|
-
|
|
33
|
-
# ----------------------------------
|
|
34
|
-
# Android lifecycle
|
|
35
|
-
# ----------------------------------
|
|
36
|
-
self.lifecycle = None
|
|
37
|
-
if is_android():
|
|
38
|
-
self.lifecycle = AndroidLifecycle(self.qt_app)
|
|
39
|
-
self.lifecycle.paused.connect(self.on_pause)
|
|
40
|
-
self.lifecycle.resumed.connect(self.on_resume)
|
|
41
|
-
|
|
42
|
-
# ----------------------------------
|
|
43
|
-
# Frame update timer
|
|
44
|
-
# ----------------------------------
|
|
45
|
-
self._timer = QtCore.QTimer()
|
|
46
|
-
self._timer.timeout.connect(self._tick)
|
|
47
|
-
|
|
48
|
-
# --------------------------------------------------
|
|
49
|
-
# App lifecycle (override in subclasses)
|
|
50
|
-
# --------------------------------------------------
|
|
51
|
-
def on_start(self):
|
|
52
|
-
"""
|
|
53
|
-
Called once when the app starts.
|
|
54
|
-
Override this to build UI.
|
|
55
|
-
"""
|
|
56
|
-
pass
|
|
57
|
-
|
|
58
|
-
def on_pause(self):
|
|
59
|
-
"""
|
|
60
|
-
Android only: app moved to background.
|
|
61
|
-
Override if needed.
|
|
62
|
-
"""
|
|
63
|
-
if self.dev:
|
|
64
|
-
print("[Kigo] App paused")
|
|
65
|
-
|
|
66
|
-
def on_resume(self):
|
|
67
|
-
"""
|
|
68
|
-
Android only: app returned to foreground.
|
|
69
|
-
Override if needed.
|
|
70
|
-
"""
|
|
71
|
-
if self.dev:
|
|
72
|
-
print("[Kigo] App resumed")
|
|
73
|
-
|
|
74
|
-
def update(self, dt: float):
|
|
75
|
-
"""
|
|
76
|
-
Called every frame.
|
|
77
|
-
Override for animations, logic, physics.
|
|
78
|
-
"""
|
|
79
|
-
pass
|
|
80
|
-
|
|
81
|
-
# --------------------------------------------------
|
|
82
|
-
# Internal loop
|
|
83
|
-
# --------------------------------------------------
|
|
84
|
-
def _tick(self):
|
|
85
|
-
now = time.perf_counter()
|
|
86
|
-
dt = now - self._last_time
|
|
87
|
-
self._last_time = now
|
|
88
|
-
self.update(dt)
|
|
89
|
-
|
|
90
|
-
# --------------------------------------------------
|
|
91
|
-
# Run
|
|
92
|
-
# --------------------------------------------------
|
|
93
|
-
def run(self, fps: int = 60):
|
|
94
|
-
"""
|
|
95
|
-
Start the application.
|
|
96
|
-
"""
|
|
97
|
-
self.on_start()
|
|
98
|
-
|
|
99
|
-
interval_ms = int(1000 / max(1, fps))
|
|
100
|
-
self._timer.start(interval_ms)
|
|
101
|
-
|
|
102
|
-
if self.dev:
|
|
103
|
-
backend = "PySide6" if IS_ANDROID else "PyQt6"
|
|
104
|
-
platform = "Android" if is_android() else "Desktop"
|
|
105
|
-
print(f"[Kigo] Running on {platform} using {backend}")
|
|
106
|
-
|
|
107
|
-
return self.qt_app.exec()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kigo_gui_framework-2.8 → kigo_gui_framework-3.0}/kigo_gui_framework.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|