diff --git a/wlroots/ffi_build.py b/wlroots/ffi_build.py index 502f29c6..7902da81 100644 --- a/wlroots/ffi_build.py +++ b/wlroots/ffi_build.py @@ -1,9 +1,9 @@ # Copyright (c) 2018 Sean Vig -from pathlib import Path import importlib.util import os import sys +from pathlib import Path from cffi import FFI, VerificationError from pywayland.ffi_build import ffi_builder as pywayland_ffi @@ -384,6 +384,37 @@ def has_xwayland() -> bool: void wlr_data_source_destroy(struct wlr_data_source *source); """ +# types/wlr_export_dmabuf_v1.h +CDEF += """ +struct wlr_export_dmabuf_manager_v1 { + struct wl_global *global; + struct wl_list frames; // wlr_export_dmabuf_frame_v1::link + + struct wl_listener display_destroy; + + struct { + struct wl_signal destroy; + } events; + ...; +}; + +struct wlr_export_dmabuf_frame_v1 { + struct wl_resource *resource; + struct wlr_export_dmabuf_manager_v1 *manager; + struct wl_list link; // wlr_export_dmabuf_manager_v1::frames + + struct wlr_output *output; + + bool cursor_locked; + + struct wl_listener output_commit; + ...; +}; + +struct wlr_export_dmabuf_manager_v1 *wlr_export_dmabuf_manager_v1_create( + struct wl_display *display); +""" + # types/wlr_foreign_toplevel_management_v1.h CDEF += """ struct wlr_foreign_toplevel_manager_v1 { @@ -2352,10 +2383,11 @@ def has_xwayland() -> bool: #include #include #include -#include #include +#include #include #include +#include #include #include #include diff --git a/wlroots/wlr_types/export_dmabuf_v1.py b/wlroots/wlr_types/export_dmabuf_v1.py new file mode 100644 index 00000000..14eec110 --- /dev/null +++ b/wlroots/wlr_types/export_dmabuf_v1.py @@ -0,0 +1,16 @@ +# Copyright (c) 2022 Aakash Sen Sharma + +from pywayland.server import Display, Signal +from wlroots import Ptr, ffi, lib + + +class ExportDmabufManagerV1(Ptr): + def __init__(self, display: Display) -> None: + """A `struct wlr_export_dmabuf_manager_v1` + + :param display: + The wayland display + """ + + self._ptr = lib.wlr_export_dmabuf_manager_v1_create(display._ptr) + self.destroy_event = Signal(ptr=ffi.addressof(self._ptr.events.destroy))