feat(globalmenu) #43

Merged
S4NKALP merged 28 commits from feat/globalmenu into macos 2026-07-28 15:35:19 +00:00
Showing only changes of commit 1b4c319fdb - Show all commits
@@ -38,9 +38,11 @@ Once compiled, you can easily load the library into any Python script using PyGO
```python ```python
import gi import gi
gi.require_version("AppCapture", "1.0") gi.require_version("AppCapture", "1.0")
from gi.repository import AppCapture from gi.repository import AppCapture
def on_frame_ready(capture, address, data, width, height, stride): def on_frame_ready(capture, address, data, width, height, stride):
# 'data' is a GLib.Bytes object containing the raw ARGB32 pixel data # 'data' is a GLib.Bytes object containing the raw ARGB32 pixel data
# Convert it to a Cairo Surface or GdkPixbuf # Convert it to a Cairo Surface or GdkPixbuf
@@ -49,9 +51,11 @@ def on_frame_ready(capture, address, data, width, height, stride):
# Example: Request the next frame, but wait for damage (0% CPU idle) # Example: Request the next frame, but wait for damage (0% CPU idle)
capture.capture_by_handle(address, 300, 168, True) capture.capture_by_handle(address, 300, 168, True)
def on_frame_failed(capture, address, reason): def on_frame_failed(capture, address, reason):
print(f"Failed to capture {address}: {reason}") print(f"Failed to capture {address}: {reason}")
# 1. Initialize the capture module # 1. Initialize the capture module
capture = AppCapture.Capture() capture = AppCapture.Capture()
capture.connect("frame-ready", on_frame_ready) capture.connect("frame-ready", on_frame_ready)