kigo-gui-framework 4.2__tar.gz → 4.4__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-4.2/kigo_gui_framework.egg-info → kigo_gui_framework-4.4}/PKG-INFO +2 -3
- kigo_gui_framework-4.4/kigo/NET/grpc/server.py +12 -0
- kigo_gui_framework-4.4/kigo/NET/grpc/service.py +9 -0
- kigo_gui_framework-4.4/kigo/NET/webrtc/client.py +19 -0
- kigo_gui_framework-4.4/kigo/NET/webrtc/server.py +9 -0
- kigo_gui_framework-4.4/kigo/__init__.py +15 -0
- kigo_gui_framework-4.4/kigo/core/features.py +33 -0
- kigo_gui_framework-4.4/kigo/examples/HELLO_WASM.py +33 -0
- kigo_gui_framework-4.4/kigo/examples/demo-effects.py +123 -0
- kigo_gui_framework-4.4/kigo/examples/ecs_example.py +27 -0
- kigo_gui_framework-4.4/kigo/examples/example window.py +21 -0
- kigo_gui_framework-4.4/kigo/examples/example_effects.py +43 -0
- kigo_gui_framework-4.4/kigo/examples/example_hello_world.py +12 -0
- kigo_gui_framework-4.4/kigo/examples/example_networking.py +71 -0
- kigo_gui_framework-4.4/kigo/examples/example_physics_basic.py +20 -0
- kigo_gui_framework-4.4/kigo/examples/example_touch_ui.py +17 -0
- kigo_gui_framework-4.4/kigo/examples/example_ui_effects.py +139 -0
- kigo_gui_framework-4.4/kigo/examples/skins_demos.py +61 -0
- kigo_gui_framework-4.4/kigo/examples/smoke_example.py +21 -0
- kigo_gui_framework-4.4/kigo/examples/testdrive.py +541 -0
- kigo_gui_framework-4.4/kigo/examples/touch_example.py +29 -0
- kigo_gui_framework-4.4/kigo/foliage/__init__.py +15 -0
- kigo_gui_framework-4.4/kigo/foliage/cluster.py +32 -0
- kigo_gui_framework-4.4/kigo/foliage/grass.py +38 -0
- kigo_gui_framework-4.4/kigo/foliage/instance.py +23 -0
- kigo_gui_framework-4.4/kigo/foliage/lod.py +12 -0
- kigo_gui_framework-4.4/kigo/foliage/manager.py +124 -0
- kigo_gui_framework-4.4/kigo/foliage/renderer.py +97 -0
- kigo_gui_framework-4.4/kigo/foliage/scatter.py +76 -0
- kigo_gui_framework-4.4/kigo/foliage/types.py +33 -0
- kigo_gui_framework-4.4/kigo/foliage/wind.py +20 -0
- kigo_gui_framework-4.4/kigo/render/gpuinst.py +11 -0
- kigo_gui_framework-4.4/kigo/render/sdfgi_resources.py +58 -0
- kigo_gui_framework-4.4/kigo/render/wgpu_foliage_renderer.py +436 -0
- kigo_gui_framework-4.4/kigo/render/wgpu_renderer.py +33 -0
- kigo_gui_framework-4.4/kigo/scene/__init__.py +7 -0
- kigo_gui_framework-4.4/kigo/scene/foliage_node.py +21 -0
- kigo_gui_framework-4.4/kigo/scene/io.py +39 -0
- kigo_gui_framework-4.4/kigo/scene/node.py +22 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4/kigo_gui_framework.egg-info}/PKG-INFO +2 -3
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo_gui_framework.egg-info/SOURCES.txt +49 -11
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo_gui_framework.egg-info/requires.txt +0 -1
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/pyproject.toml +2 -3
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/MANIFEST.in +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/README.txt +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/DEBG/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/DEBG/debug_panel.py +0 -0
- {kigo_gui_framework-4.2/kigo/net → kigo_gui_framework-4.4/kigo/NET}/__init__.py +0 -0
- {kigo_gui_framework-4.2/kigo/net → kigo_gui_framework-4.4/kigo/NET}/qnetwork.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/_api.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/_init_.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/accelerate.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/android/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/android/info.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/android/lifecycle.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/android/ossupport.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/app.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/cli/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/cli/doctor.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/cli/main.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/compile/ast_opt.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/compile/pipeline.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/debug/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/debug/freeze.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/ecs/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/ecs/component.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/ecs/entity.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/ecs/render.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/ecs/system.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/ecs/world.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/fx_gl2d.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/fx_quick.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/gl/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/gl/ssao.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/gpu.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/hiz/hiz.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/hud.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/hwaccel.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/ECS/ecs_inspector.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/ECS/panel.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/ECS/tree.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/inspector.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/overlay.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/panel.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/web/bridge.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/inspector/web/dom_inspector.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/logging/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/logging/jsonlog.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/media.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/meshlets/build.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/meshlets/runtime.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/nui/node.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/pbr/material_system.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/physics/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/physics/_native/bindings.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/physics/_native/physics.dll +0 -0
- {kigo_gui_framework-4.2/kigo → kigo_gui_framework-4.4/kigo/physics}/qt/__init__.py +0 -0
- {kigo_gui_framework-4.2/kigo → kigo_gui_framework-4.4/kigo/physics}/qt/backend.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/physics/world.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/physics.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/physics_policy.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/platform.py +0 -0
- {kigo_gui_framework-4.2/kigo/render → kigo_gui_framework-4.4/kigo/renderer}/__init__.py +0 -0
- {kigo_gui_framework-4.2/kigo/render → kigo_gui_framework-4.4/kigo/renderer}/base/renderer.py +0 -0
- {kigo_gui_framework-4.2/kigo/render → kigo_gui_framework-4.4/kigo/renderer}/base/shader.py +0 -0
- {kigo_gui_framework-4.2/kigo/render → kigo_gui_framework-4.4/kigo/renderer}/dx/renderer.py +0 -0
- {kigo_gui_framework-4.2/kigo/render → kigo_gui_framework-4.4/kigo/renderer}/dx/ssao.py +0 -0
- {kigo_gui_framework-4.2/kigo/render → kigo_gui_framework-4.4/kigo/renderer}/select.py +0 -0
- {kigo_gui_framework-4.2/kigo/render → kigo_gui_framework-4.4/kigo/renderer}/wgpu/renderer.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/runtime.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/sdfgi/radiance.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/sdfgi/radiance_sample.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/shader_cache.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/shader_demo.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/shim.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/skins.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/streaming/loader.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/streaming/manager.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/streaming/meshlet_stream.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/studio/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/studio/core.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/studio/overlay.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/style.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/tree.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/wasm/__init__.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/wasm/executor.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/wasm/module.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo/widgets.py +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo_gui_framework.egg-info/dependency_links.txt +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo_gui_framework.egg-info/entry_points.txt +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/kigo_gui_framework.egg-info/top_level.txt +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/setup.cfg +0 -0
- {kigo_gui_framework-4.2 → kigo_gui_framework-4.4}/setup.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kigo-gui-framework
|
|
3
|
-
Version: 4.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 4.4
|
|
4
|
+
Summary: Added GPU instancing, a grass system, WebRTC and grRPC networking (basically what I call Rhythm. Got selected to represent school in English 😊╰(*°▽°*)╯
|
|
5
5
|
Author: Anand Kumar
|
|
6
6
|
License: Zlib
|
|
7
7
|
Keywords: gui,qt,pyqt,webengine,opengl,wasm,android,chromeos,framework
|
|
@@ -15,7 +15,6 @@ Requires-Python: >=3.9
|
|
|
15
15
|
Description-Content-Type: text/plain
|
|
16
16
|
Requires-Dist: PyQt6
|
|
17
17
|
Requires-Dist: pybullet
|
|
18
|
-
Requires-Dist: pybullet-data
|
|
19
18
|
Requires-Dist: PyQt6-WebEngine
|
|
20
19
|
Requires-Dist: wgpu-py
|
|
21
20
|
Requires-Dist: wasmtime
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from .service import KigoService
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class GRPCServer:
|
|
5
|
+
def __init__(self):
|
|
6
|
+
self.service = KigoService()
|
|
7
|
+
|
|
8
|
+
def start(self):
|
|
9
|
+
print("[gRPC] Server started. 🚨GRPC service.py is simple for now, so heavy connections might be hampered. This is not your fault, it is my fault.")
|
|
10
|
+
|
|
11
|
+
def handle(self, cmd):
|
|
12
|
+
return self.service.run_command(cmd)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class WebRTCClient:
|
|
5
|
+
def __init__(self):
|
|
6
|
+
self.enabled = False
|
|
7
|
+
|
|
8
|
+
def enable(self):
|
|
9
|
+
self.enabled = True
|
|
10
|
+
print("[KIGO] WebRTC On")
|
|
11
|
+
def disable(self):
|
|
12
|
+
self.enabled = False
|
|
13
|
+
print("[KIGO] WebRTC Off")
|
|
14
|
+
|
|
15
|
+
async def connect(self, url):
|
|
16
|
+
if not self.enabled:
|
|
17
|
+
return
|
|
18
|
+
|
|
19
|
+
print(f"[WebRTC] connecting to {url}")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from .core.features import FeatureRegistry
|
|
2
|
+
|
|
3
|
+
_features = FeatureRegistry()
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def enable(name):
|
|
7
|
+
return _features.enable(name)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def disable(name):
|
|
11
|
+
return _features.disable(name)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def feature(name):
|
|
15
|
+
return _features._features.get(name)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class FeatureRegistry:
|
|
2
|
+
def __init__(self):
|
|
3
|
+
self._features = {}
|
|
4
|
+
|
|
5
|
+
def register(self, name, feature):
|
|
6
|
+
self._features[name] = feature
|
|
7
|
+
|
|
8
|
+
def enable(self, name):
|
|
9
|
+
if name not in self._features:
|
|
10
|
+
print(f"[KIGO] Feature '{name}' not available")
|
|
11
|
+
return False
|
|
12
|
+
|
|
13
|
+
feature = self._features[name]
|
|
14
|
+
if hasattr(feature, "enable"):
|
|
15
|
+
feature.enable()
|
|
16
|
+
|
|
17
|
+
print(f"[KIGO] Enabled feature: {name}")
|
|
18
|
+
return True
|
|
19
|
+
|
|
20
|
+
def disable(self, name):
|
|
21
|
+
if name not in self._features:
|
|
22
|
+
return False
|
|
23
|
+
|
|
24
|
+
feature = self._features[name]
|
|
25
|
+
if hasattr(feature, "disable"):
|
|
26
|
+
feature.disable()
|
|
27
|
+
|
|
28
|
+
print(f"[KIGO] Disabled feature: {name}")
|
|
29
|
+
return True
|
|
30
|
+
|
|
31
|
+
def is_enabled(self, name):
|
|
32
|
+
f = self._features.get(name)
|
|
33
|
+
return getattr(f, "enabled", False)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from kigo.app import App
|
|
2
|
+
from kigo.accelerate import hot
|
|
3
|
+
from kigo.ui import Window, VBox, Label, Button
|
|
4
|
+
|
|
5
|
+
@hot(wasm="mul42", module="math")
|
|
6
|
+
def heavy(x: int) -> int:
|
|
7
|
+
return x * 42
|
|
8
|
+
|
|
9
|
+
class HelloWasm(App):
|
|
10
|
+
def on_start(self):
|
|
11
|
+
self.main_window = Window(
|
|
12
|
+
title="Hello Kigo (WASM)",
|
|
13
|
+
size=(500, 300)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
self.result = Label("0")
|
|
17
|
+
|
|
18
|
+
def run():
|
|
19
|
+
value = self.call(heavy, 10)
|
|
20
|
+
self.result.set_text(str(value))
|
|
21
|
+
|
|
22
|
+
self.main_window.set_content(
|
|
23
|
+
VBox(
|
|
24
|
+
Label("Running in WASM mode"),
|
|
25
|
+
self.result,
|
|
26
|
+
Button("Run hot function", on_click=run),
|
|
27
|
+
spacing=16
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
self.main_window.show()
|
|
32
|
+
|
|
33
|
+
HelloWasm(mode="wasm", dev=True).run()
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# examples/demo_css_media_tree.py
|
|
2
|
+
|
|
3
|
+
from kigo.app import App
|
|
4
|
+
from kigo.widgets import (
|
|
5
|
+
StyleManager,
|
|
6
|
+
KIGO_BASE_CSS,
|
|
7
|
+
KIGO_TOKENS_DARK,
|
|
8
|
+
KIGO_TOKENS_LIGHT,
|
|
9
|
+
TreeView,
|
|
10
|
+
VideoPlayerWidget,
|
|
11
|
+
Card,
|
|
12
|
+
QPushButton,
|
|
13
|
+
)
|
|
14
|
+
from kigo.qt import QtWidgets
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
# --------------------------------------------------
|
|
19
|
+
# Create Kigo app (no physics needed)
|
|
20
|
+
# --------------------------------------------------
|
|
21
|
+
app = App(
|
|
22
|
+
title="Kigo Demo – CSS + Media + Tree",
|
|
23
|
+
size=(1200, 700),
|
|
24
|
+
physics="No",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# --------------------------------------------------
|
|
28
|
+
# Apply CSS-like styling (dark theme)
|
|
29
|
+
# --------------------------------------------------
|
|
30
|
+
StyleManager.apply(KIGO_BASE_CSS, tokens=KIGO_TOKENS_DARK)
|
|
31
|
+
|
|
32
|
+
root = QtWidgets.QWidget()
|
|
33
|
+
layout = QtWidgets.QHBoxLayout(root)
|
|
34
|
+
layout.setSpacing(16)
|
|
35
|
+
|
|
36
|
+
# ==================================================
|
|
37
|
+
# LEFT: Tree / Hierarchy
|
|
38
|
+
# ==================================================
|
|
39
|
+
tree_card = Card("Hierarchy / Tree")
|
|
40
|
+
tree = TreeView()
|
|
41
|
+
|
|
42
|
+
tree.set_data({
|
|
43
|
+
"Company": {
|
|
44
|
+
"Engineering": {
|
|
45
|
+
"Frontend": ["UI", "Themes"],
|
|
46
|
+
"Backend": ["API", "Database"],
|
|
47
|
+
},
|
|
48
|
+
"Sales": {
|
|
49
|
+
"APAC": ["India", "SEA"],
|
|
50
|
+
"EMEA": ["EU", "MEA"],
|
|
51
|
+
},
|
|
52
|
+
"Support": {
|
|
53
|
+
"Tier 1": ["Tickets", "Chat"],
|
|
54
|
+
"Tier 2": ["Escalations"],
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
tree_card.add_widget(tree)
|
|
60
|
+
layout.addWidget(tree_card, 1)
|
|
61
|
+
|
|
62
|
+
# ==================================================
|
|
63
|
+
# RIGHT: Media Player
|
|
64
|
+
# ==================================================
|
|
65
|
+
media_card = Card("Video Player")
|
|
66
|
+
|
|
67
|
+
# ⚠️ Change this path to an actual video on your machine
|
|
68
|
+
VIDEO_PATH = r"C:\path\to\your\video.mp4"
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
video = VideoPlayerWidget(VIDEO_PATH)
|
|
72
|
+
media_card.add_widget(video)
|
|
73
|
+
except ImportError as e:
|
|
74
|
+
# Graceful fallback if QtMultimedia is missing
|
|
75
|
+
error_label = QtWidgets.QLabel(
|
|
76
|
+
"QtMultimedia not available.\n"
|
|
77
|
+
"Install a Qt build with multimedia support."
|
|
78
|
+
)
|
|
79
|
+
error_label.setWordWrap(True)
|
|
80
|
+
media_card.add_widget(error_label)
|
|
81
|
+
|
|
82
|
+
layout.addWidget(media_card, 2)
|
|
83
|
+
|
|
84
|
+
# ==================================================
|
|
85
|
+
# TOP-RIGHT: Theme Toggle (CSS demo)
|
|
86
|
+
# ==================================================
|
|
87
|
+
btn_row = QtWidgets.QHBoxLayout()
|
|
88
|
+
btn_wrap = QtWidgets.QWidget()
|
|
89
|
+
btn_wrap.setLayout(btn_row)
|
|
90
|
+
|
|
91
|
+
dark_btn = QPushButton("Dark Theme")
|
|
92
|
+
light_btn = QPushButton("Light Theme")
|
|
93
|
+
|
|
94
|
+
dark_btn.setProperty("kigoClass", "primary")
|
|
95
|
+
light_btn.setProperty("kigoClass", "danger")
|
|
96
|
+
|
|
97
|
+
def set_dark():
|
|
98
|
+
StyleManager.apply(KIGO_BASE_CSS, tokens=KIGO_TOKENS_DARK)
|
|
99
|
+
StyleManager.refresh_widget(dark_btn)
|
|
100
|
+
StyleManager.refresh_widget(light_btn)
|
|
101
|
+
|
|
102
|
+
def set_light():
|
|
103
|
+
StyleManager.apply(KIGO_BASE_CSS, tokens=KIGO_TOKENS_LIGHT)
|
|
104
|
+
StyleManager.refresh_widget(dark_btn)
|
|
105
|
+
StyleManager.refresh_widget(light_btn)
|
|
106
|
+
|
|
107
|
+
dark_btn.clicked.connect(set_dark)
|
|
108
|
+
light_btn.clicked.connect(set_light)
|
|
109
|
+
|
|
110
|
+
btn_row.addWidget(dark_btn)
|
|
111
|
+
btn_row.addWidget(light_btn)
|
|
112
|
+
|
|
113
|
+
media_card.add_widget(btn_wrap)
|
|
114
|
+
|
|
115
|
+
# --------------------------------------------------
|
|
116
|
+
# Add everything to Kigo App
|
|
117
|
+
# --------------------------------------------------
|
|
118
|
+
app.add_widget(root)
|
|
119
|
+
app.run()
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
if __name__ == "__main__":
|
|
123
|
+
main()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from kigo.ecs import World, Component, System
|
|
2
|
+
|
|
3
|
+
class Position(Component):
|
|
4
|
+
def __init__(self, x=0, y=0):
|
|
5
|
+
self.x = x
|
|
6
|
+
self.y = y
|
|
7
|
+
|
|
8
|
+
class Velocity(Component):
|
|
9
|
+
def __init__(self, vx=0, vy=0):
|
|
10
|
+
self.vx = vx
|
|
11
|
+
self.vy = vy
|
|
12
|
+
|
|
13
|
+
class MovementSystem(System):
|
|
14
|
+
def update(self, world, dt):
|
|
15
|
+
for e in world.get_entities_with(Position, Velocity):
|
|
16
|
+
pos = world.get_component(e, Position)
|
|
17
|
+
vel = world.get_component(e, Velocity)
|
|
18
|
+
pos.x += vel.vx * dt
|
|
19
|
+
pos.y += vel.vy * dt
|
|
20
|
+
|
|
21
|
+
world = World()
|
|
22
|
+
e = world.create_entity()
|
|
23
|
+
world.add_component(e, Position())
|
|
24
|
+
world.add_component(e, Velocity(10, 0))
|
|
25
|
+
world.add_system(MovementSystem())
|
|
26
|
+
|
|
27
|
+
world.update(1.0)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# examples/example_build_test.py
|
|
2
|
+
|
|
3
|
+
from kigo.app import App
|
|
4
|
+
from kigo.widgets import TouchButton, Card
|
|
5
|
+
from kigo.qt import qt_info
|
|
6
|
+
|
|
7
|
+
# Print which Qt backend is active
|
|
8
|
+
print("Qt backend info:", qt_info())
|
|
9
|
+
|
|
10
|
+
app = App(
|
|
11
|
+
title="Kigo Build Test",
|
|
12
|
+
physics="No"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
card = Card("Kigo Build OK ✅")
|
|
16
|
+
btn = TouchButton("Hello from Kigo")
|
|
17
|
+
|
|
18
|
+
card.add_widget(btn)
|
|
19
|
+
app.add_widget(card)
|
|
20
|
+
|
|
21
|
+
app.run()
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
# examples/example_effects.py
|
|
3
|
+
from kigo import App
|
|
4
|
+
from kigo.widgets import TouchButton, Card
|
|
5
|
+
|
|
6
|
+
physics = "Yes" # global toggle
|
|
7
|
+
|
|
8
|
+
app = App(
|
|
9
|
+
title="Kigo Effects (Bullet-driven)",
|
|
10
|
+
physics=physics,
|
|
11
|
+
physics_fps=120,
|
|
12
|
+
pad_x_px=28,
|
|
13
|
+
pad_y_px=28,
|
|
14
|
+
pixels_per_meter=90.0,
|
|
15
|
+
bullet_gui=False
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# SPRING
|
|
19
|
+
spring_card = Card("spring (k=50, c=5)")
|
|
20
|
+
spring_card.add_widget(TouchButton("Springy"))
|
|
21
|
+
app.add_widget(spring_card, effect="spring", k=50.0, c=5.0)
|
|
22
|
+
|
|
23
|
+
# BOUNCE
|
|
24
|
+
bounce_card = Card("bounce (freq=1.0, force=14)")
|
|
25
|
+
bounce_card.add_widget(TouchButton("Bouncy"))
|
|
26
|
+
app.add_widget(bounce_card, effect="bounce", freq=1.0, force=14.0)
|
|
27
|
+
|
|
28
|
+
# FALL
|
|
29
|
+
fall_card = Card("fall (drops once)")
|
|
30
|
+
fall_card.add_widget(TouchButton("Falling"))
|
|
31
|
+
app.add_widget(fall_card, effect="fall")
|
|
32
|
+
|
|
33
|
+
# GRAVITY
|
|
34
|
+
gravity_card = Card("gravity (just gravity)")
|
|
35
|
+
gravity_card.add_widget(TouchButton("Gravity"))
|
|
36
|
+
app.add_widget(gravity_card, effect="gravity")
|
|
37
|
+
|
|
38
|
+
# MOVE (lateral)
|
|
39
|
+
move_card = Card("move (axis=x, freq=0.7, force=8)")
|
|
40
|
+
move_card.add_widget(TouchButton("Mover"))
|
|
41
|
+
app.add_widget(move_card, effect="move", axis="x", freq=0.7, force=8.0)
|
|
42
|
+
|
|
43
|
+
app.run()
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from kigo.app import App
|
|
2
|
+
from kigo.qt.backend import QtWidgets, QtCore
|
|
3
|
+
from kigo.net import req
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class NetworkDemo(App):
|
|
7
|
+
def on_start(self):
|
|
8
|
+
# Main window
|
|
9
|
+
self.win = QtWidgets.QMainWindow()
|
|
10
|
+
self.win.setWindowTitle("Kigo Networking Demo (req)")
|
|
11
|
+
self.win.resize(800, 520)
|
|
12
|
+
|
|
13
|
+
# UI
|
|
14
|
+
root = QtWidgets.QWidget()
|
|
15
|
+
layout = QtWidgets.QVBoxLayout(root)
|
|
16
|
+
|
|
17
|
+
top = QtWidgets.QHBoxLayout()
|
|
18
|
+
self.url = QtWidgets.QLineEdit()
|
|
19
|
+
self.url.setPlaceholderText("https://example.com")
|
|
20
|
+
self.url.setText("https://example.com")
|
|
21
|
+
self.fetch_btn = QtWidgets.QPushButton("Fetch")
|
|
22
|
+
self.fetch_btn.clicked.connect(self.fetch)
|
|
23
|
+
|
|
24
|
+
top.addWidget(self.url, 1)
|
|
25
|
+
top.addWidget(self.fetch_btn)
|
|
26
|
+
|
|
27
|
+
self.status = QtWidgets.QLabel("Ready.")
|
|
28
|
+
self.status.setStyleSheet("font-weight: bold;")
|
|
29
|
+
|
|
30
|
+
self.out = QtWidgets.QPlainTextEdit()
|
|
31
|
+
self.out.setReadOnly(True)
|
|
32
|
+
|
|
33
|
+
layout.addLayout(top)
|
|
34
|
+
layout.addWidget(self.status)
|
|
35
|
+
layout.addWidget(self.out, 1)
|
|
36
|
+
|
|
37
|
+
self.win.setCentralWidget(root)
|
|
38
|
+
self.win.show()
|
|
39
|
+
|
|
40
|
+
def fetch(self):
|
|
41
|
+
url = self.url.text().strip()
|
|
42
|
+
if not url:
|
|
43
|
+
return
|
|
44
|
+
|
|
45
|
+
# Basic UX feedback
|
|
46
|
+
self.fetch_btn.setEnabled(False)
|
|
47
|
+
self.status.setText("Fetching…")
|
|
48
|
+
QtWidgets.QApplication.processEvents()
|
|
49
|
+
|
|
50
|
+
# Optional: add a simple User-Agent for stricter sites
|
|
51
|
+
headers = {"User-Agent": "KigoNet/1.0 (Qt QNetworkAccessManager)"}
|
|
52
|
+
|
|
53
|
+
r = req(url, headers=headers, timeout_ms=15000)
|
|
54
|
+
|
|
55
|
+
# Display result
|
|
56
|
+
if r.ok:
|
|
57
|
+
self.status.setText(f"OK {r.status} — {r.url}")
|
|
58
|
+
else:
|
|
59
|
+
self.status.setText(f"ERROR {r.status} — {r.error or 'unknown error'}")
|
|
60
|
+
|
|
61
|
+
# Show first part of body to keep UI snappy
|
|
62
|
+
body = r.text
|
|
63
|
+
if len(body) > 20000:
|
|
64
|
+
body = body[:20000] + "\n\n…(truncated)…"
|
|
65
|
+
|
|
66
|
+
self.out.setPlainText(body)
|
|
67
|
+
self.fetch_btn.setEnabled(True)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
NetworkDemo(dev=True).run()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
from PyQt6.QtWidgets import QApplication
|
|
3
|
+
from kigo.physics import PhysicsEngine
|
|
4
|
+
|
|
5
|
+
app = QApplication([])
|
|
6
|
+
|
|
7
|
+
engine = PhysicsEngine(use_gui=True, fps=120)
|
|
8
|
+
engine.setup_scene()
|
|
9
|
+
|
|
10
|
+
cube = engine.spawn_object("cube", position=(0, 0, 2), size=0.3)
|
|
11
|
+
sphere = engine.spawn_object("sphere", position=(1, 0, 2), size=0.2)
|
|
12
|
+
|
|
13
|
+
engine.toggle_simulation(True)
|
|
14
|
+
|
|
15
|
+
def on_frame():
|
|
16
|
+
print("Cube height:", engine.get_pos(cube)[2])
|
|
17
|
+
|
|
18
|
+
engine.frame_updated.connect(on_frame)
|
|
19
|
+
|
|
20
|
+
app.exec()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
from PyQt6.QtWidgets import QTextEdit
|
|
3
|
+
from kigo import App, TouchButton, Card, TouchScrollArea
|
|
4
|
+
|
|
5
|
+
app = App("Touch UI Demo")
|
|
6
|
+
|
|
7
|
+
editor = QTextEdit("Swipe to scroll...\n" * 50)
|
|
8
|
+
TouchScrollArea(editor)
|
|
9
|
+
|
|
10
|
+
card = Card("Touch Components Demo")
|
|
11
|
+
button = TouchButton("Tap Here")
|
|
12
|
+
|
|
13
|
+
card.add_widget(editor)
|
|
14
|
+
card.add_widget(button)
|
|
15
|
+
|
|
16
|
+
app.add_widget(card)
|
|
17
|
+
app.run()
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
|
|
2
|
+
# examples/example_ui_physics.py
|
|
3
|
+
|
|
4
|
+
import sys
|
|
5
|
+
import time
|
|
6
|
+
|
|
7
|
+
from PyQt6.QtWidgets import QApplication, QWidget, QLabel
|
|
8
|
+
from PyQt6.QtCore import QTimer
|
|
9
|
+
from PyQt6.QtGui import QMouseEvent
|
|
10
|
+
|
|
11
|
+
from kigo.physics import (
|
|
12
|
+
UIPhysicsWorld,
|
|
13
|
+
UIBody,
|
|
14
|
+
SnapConstraint,
|
|
15
|
+
OrbitConstraint,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# ------------------------------------------------------------
|
|
19
|
+
# Simple widget wrapper that binds a QLabel to a UIBody
|
|
20
|
+
# ------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
class PhysicsLabel(QLabel):
|
|
23
|
+
def __init__(self, text: str, body: UIBody, world: UIPhysicsWorld, parent=None):
|
|
24
|
+
super().__init__(text, parent)
|
|
25
|
+
self.body = body
|
|
26
|
+
self.world = world
|
|
27
|
+
|
|
28
|
+
self.setStyleSheet("""
|
|
29
|
+
QLabel {
|
|
30
|
+
background: #2d89ef;
|
|
31
|
+
color: white;
|
|
32
|
+
padding: 8px 14px;
|
|
33
|
+
border-radius: 6px;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
}
|
|
36
|
+
""")
|
|
37
|
+
self.adjustSize()
|
|
38
|
+
self.setMouseTracking(True)
|
|
39
|
+
|
|
40
|
+
# ---- mouse → physics interaction ----
|
|
41
|
+
def mousePressEvent(self, e: QMouseEvent):
|
|
42
|
+
if e.buttons():
|
|
43
|
+
self.world.drag.pointer_down(self.body, e.globalPosition().x(), e.globalPosition().y())
|
|
44
|
+
|
|
45
|
+
def mouseMoveEvent(self, e: QMouseEvent):
|
|
46
|
+
self.world.drag.pointer_move(e.globalPosition().x(), e.globalPosition().y())
|
|
47
|
+
|
|
48
|
+
def mouseReleaseEvent(self, e: QMouseEvent):
|
|
49
|
+
self.world.drag.pointer_up()
|
|
50
|
+
|
|
51
|
+
def sync_from_body(self):
|
|
52
|
+
self.move(int(self.body.x), int(self.body.y))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# ------------------------------------------------------------
|
|
56
|
+
# Main demo window
|
|
57
|
+
# ------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
class Demo(QWidget):
|
|
60
|
+
def __init__(self):
|
|
61
|
+
super().__init__()
|
|
62
|
+
self.setWindowTitle("Kigo v1.4 UI Physics Demo")
|
|
63
|
+
self.resize(900, 600)
|
|
64
|
+
|
|
65
|
+
# ---- Physics world ----
|
|
66
|
+
self.world = UIPhysicsWorld()
|
|
67
|
+
self.world.set_bounds(0, 0, self.width(), self.height(), bounce=0.2)
|
|
68
|
+
|
|
69
|
+
# ---- Draggable floating panel ----
|
|
70
|
+
panel_body = UIBody(
|
|
71
|
+
x=120, y=120,
|
|
72
|
+
w=160, h=48,
|
|
73
|
+
damping=0.94
|
|
74
|
+
)
|
|
75
|
+
self.world.add_body(panel_body)
|
|
76
|
+
self.world.add_constraint(
|
|
77
|
+
panel_body,
|
|
78
|
+
SnapConstraint(grid=16, threshold=12, snap_to_centers=True)
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
self.panel = PhysicsLabel("Drag me (snap + throw)", panel_body, self.world, self)
|
|
82
|
+
|
|
83
|
+
# ---- Center anchor (static) ----
|
|
84
|
+
anchor_body = UIBody(
|
|
85
|
+
x=420, y=260,
|
|
86
|
+
w=120, h=40,
|
|
87
|
+
mode="static"
|
|
88
|
+
)
|
|
89
|
+
self.world.add_body(anchor_body)
|
|
90
|
+
self.anchor = PhysicsLabel("Anchor", anchor_body, self.world, self)
|
|
91
|
+
self.anchor.setStyleSheet("QLabel { background: #444; color: #eee; padding: 8px; }")
|
|
92
|
+
|
|
93
|
+
# ---- Orbiting widget ----
|
|
94
|
+
orbiter_body = UIBody(
|
|
95
|
+
x=500, y=260,
|
|
96
|
+
w=110, h=40,
|
|
97
|
+
damping=0.98
|
|
98
|
+
)
|
|
99
|
+
self.world.add_body(orbiter_body)
|
|
100
|
+
self.world.add_constraint(
|
|
101
|
+
orbiter_body,
|
|
102
|
+
OrbitConstraint(
|
|
103
|
+
target=anchor_body,
|
|
104
|
+
radius=140,
|
|
105
|
+
angular_velocity=1.2,
|
|
106
|
+
soft=True
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
self.orbiter = PhysicsLabel("Orbiting", orbiter_body, self.world, self)
|
|
110
|
+
self.orbiter.setStyleSheet("QLabel { background: #00a300; color: white; padding: 8px; }")
|
|
111
|
+
|
|
112
|
+
# ---- render timer ----
|
|
113
|
+
self._last = time.perf_counter()
|
|
114
|
+
self.timer = QTimer(self)
|
|
115
|
+
self.timer.timeout.connect(self.tick)
|
|
116
|
+
self.timer.start(16) # ~60 FPS
|
|
117
|
+
|
|
118
|
+
def tick(self):
|
|
119
|
+
now = time.perf_counter()
|
|
120
|
+
dt = now - self._last
|
|
121
|
+
self._last = now
|
|
122
|
+
|
|
123
|
+
self.world.step(dt)
|
|
124
|
+
|
|
125
|
+
# sync widgets from physics bodies
|
|
126
|
+
self.panel.sync_from_body()
|
|
127
|
+
self.anchor.sync_from_body()
|
|
128
|
+
self.orbiter.sync_from_body()
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
# ------------------------------------------------------------
|
|
132
|
+
# Run
|
|
133
|
+
# ------------------------------------------------------------
|
|
134
|
+
|
|
135
|
+
if __name__ == "__main__":
|
|
136
|
+
app = QApplication(sys.argv)
|
|
137
|
+
win = Demo()
|
|
138
|
+
win.show()
|
|
139
|
+
sys.exit(app.exec())
|