Skip to content

Commit

Permalink
Merge pull request #159 from heuer/issue_155
Browse files Browse the repository at this point in the history
Added support for the Single-pixel buffer protocol.
  • Loading branch information
flacjacket authored Mar 18, 2024
2 parents ca6eb1d + 827860c commit 80b45bb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wlroots/ffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,12 @@ def has_xwayland() -> bool:
struct wlr_server_decoration_manager *manager, uint32_t default_mode);
"""

# types/wlr_single_pixel_buffer_v1.h
CDEF += """
struct wlr_single_pixel_buffer_manager_v1 *wlr_single_pixel_buffer_manager_v1_create(
struct wl_display *display);
"""

# types/wlr_touch.h
CDEF += """
struct wlr_touch {
Expand Down Expand Up @@ -2894,6 +2900,7 @@ def has_xwayland() -> bool:
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_subcompositor.h>
#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_single_pixel_buffer_v1.h>
#include <wlr/types/wlr_touch.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
#include <wlr/types/wlr_virtual_pointer_v1.h>
Expand Down
22 changes: 22 additions & 0 deletions wlroots/wlr_types/single_pixel_buffer_v1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pywayland.server import Display

from wlroots import Ptr, lib


class SinglePixelBufferManagerV1(Ptr):
"""Global factory for single-pixel buffers.
This protocol extension allows clients to create single-pixel buffers.
Compositors supporting this protocol extension should also support the
viewporter protocol extension (see wlr_types.viewporter.Viewporter).
Clients may use viewporter to scale a single-pixel buffer to a desired size.
"""

def __init__(self, display: Display) -> None:
"""Binds the manager to the provided display.
:param display: The wayland display
"""
self._ptr = lib.wlr_single_pixel_buffer_manager_v1_create(display._ptr)

0 comments on commit 80b45bb

Please sign in to comment.