style: adjust clang-format rules (#2186)
Co-authored-by: Vithorio Polten <reach@vithor.io>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// standard includes
|
||||
#include <bitset>
|
||||
|
||||
#ifdef SUNSHINE_BUILD_WAYLAND
|
||||
@@ -11,6 +12,7 @@
|
||||
#include <xdg-output-unstable-v1.h>
|
||||
#endif
|
||||
|
||||
// local includes
|
||||
#include "graphics.h"
|
||||
|
||||
/**
|
||||
@@ -27,8 +29,7 @@ namespace wl {
|
||||
frame_t();
|
||||
egl::surface_descriptor_t sd;
|
||||
|
||||
void
|
||||
destroy();
|
||||
void destroy();
|
||||
};
|
||||
|
||||
class dmabuf_t {
|
||||
@@ -42,50 +43,52 @@ namespace wl {
|
||||
dmabuf_t(dmabuf_t &&) = delete;
|
||||
dmabuf_t(const dmabuf_t &) = delete;
|
||||
|
||||
dmabuf_t &
|
||||
operator=(const dmabuf_t &) = delete;
|
||||
dmabuf_t &
|
||||
operator=(dmabuf_t &&) = delete;
|
||||
dmabuf_t &operator=(const dmabuf_t &) = delete;
|
||||
dmabuf_t &operator=(dmabuf_t &&) = delete;
|
||||
|
||||
dmabuf_t();
|
||||
|
||||
void
|
||||
listen(zwlr_export_dmabuf_manager_v1 *dmabuf_manager, wl_output *output, bool blend_cursor = false);
|
||||
void listen(zwlr_export_dmabuf_manager_v1 *dmabuf_manager, wl_output *output, bool blend_cursor = false);
|
||||
|
||||
~dmabuf_t();
|
||||
|
||||
void
|
||||
frame(
|
||||
void frame(
|
||||
zwlr_export_dmabuf_frame_v1 *frame,
|
||||
std::uint32_t width, std::uint32_t height,
|
||||
std::uint32_t x, std::uint32_t y,
|
||||
std::uint32_t buffer_flags, std::uint32_t flags,
|
||||
std::uint32_t width,
|
||||
std::uint32_t height,
|
||||
std::uint32_t x,
|
||||
std::uint32_t y,
|
||||
std::uint32_t buffer_flags,
|
||||
std::uint32_t flags,
|
||||
std::uint32_t format,
|
||||
std::uint32_t high, std::uint32_t low,
|
||||
std::uint32_t obj_count);
|
||||
std::uint32_t high,
|
||||
std::uint32_t low,
|
||||
std::uint32_t obj_count
|
||||
);
|
||||
|
||||
void
|
||||
object(
|
||||
void object(
|
||||
zwlr_export_dmabuf_frame_v1 *frame,
|
||||
std::uint32_t index,
|
||||
std::int32_t fd,
|
||||
std::uint32_t size,
|
||||
std::uint32_t offset,
|
||||
std::uint32_t stride,
|
||||
std::uint32_t plane_index);
|
||||
std::uint32_t plane_index
|
||||
);
|
||||
|
||||
void
|
||||
ready(
|
||||
void ready(
|
||||
zwlr_export_dmabuf_frame_v1 *frame,
|
||||
std::uint32_t tv_sec_hi, std::uint32_t tv_sec_lo, std::uint32_t tv_nsec);
|
||||
std::uint32_t tv_sec_hi,
|
||||
std::uint32_t tv_sec_lo,
|
||||
std::uint32_t tv_nsec
|
||||
);
|
||||
|
||||
void
|
||||
cancel(
|
||||
void cancel(
|
||||
zwlr_export_dmabuf_frame_v1 *frame,
|
||||
std::uint32_t reason);
|
||||
std::uint32_t reason
|
||||
);
|
||||
|
||||
inline frame_t *
|
||||
get_next_frame() {
|
||||
inline frame_t *get_next_frame() {
|
||||
return current_frame == &frames[0] ? &frames[1] : &frames[0];
|
||||
}
|
||||
|
||||
@@ -102,38 +105,31 @@ namespace wl {
|
||||
monitor_t(monitor_t &&) = delete;
|
||||
monitor_t(const monitor_t &) = delete;
|
||||
|
||||
monitor_t &
|
||||
operator=(const monitor_t &) = delete;
|
||||
monitor_t &
|
||||
operator=(monitor_t &&) = delete;
|
||||
monitor_t &operator=(const monitor_t &) = delete;
|
||||
monitor_t &operator=(monitor_t &&) = delete;
|
||||
|
||||
monitor_t(wl_output *output);
|
||||
|
||||
void
|
||||
xdg_name(zxdg_output_v1 *, const char *name);
|
||||
void
|
||||
xdg_description(zxdg_output_v1 *, const char *description);
|
||||
void
|
||||
xdg_position(zxdg_output_v1 *, std::int32_t x, std::int32_t y);
|
||||
void
|
||||
xdg_size(zxdg_output_v1 *, std::int32_t width, std::int32_t height);
|
||||
void
|
||||
xdg_done(zxdg_output_v1 *) {}
|
||||
void xdg_name(zxdg_output_v1 *, const char *name);
|
||||
void xdg_description(zxdg_output_v1 *, const char *description);
|
||||
void xdg_position(zxdg_output_v1 *, std::int32_t x, std::int32_t y);
|
||||
void xdg_size(zxdg_output_v1 *, std::int32_t width, std::int32_t height);
|
||||
|
||||
void
|
||||
wl_geometry(wl_output *wl_output, std::int32_t x, std::int32_t y,
|
||||
std::int32_t physical_width, std::int32_t physical_height, std::int32_t subpixel,
|
||||
const char *make, const char *model, std::int32_t transform) {}
|
||||
void
|
||||
wl_mode(wl_output *wl_output, std::uint32_t flags,
|
||||
std::int32_t width, std::int32_t height, std::int32_t refresh);
|
||||
void
|
||||
wl_done(wl_output *wl_output) {}
|
||||
void
|
||||
wl_scale(wl_output *wl_output, std::int32_t factor) {}
|
||||
void xdg_done(zxdg_output_v1 *) {
|
||||
}
|
||||
|
||||
void
|
||||
listen(zxdg_output_manager_v1 *output_manager);
|
||||
void wl_geometry(wl_output *wl_output, std::int32_t x, std::int32_t y, std::int32_t physical_width, std::int32_t physical_height, std::int32_t subpixel, const char *make, const char *model, std::int32_t transform) {
|
||||
}
|
||||
|
||||
void wl_mode(wl_output *wl_output, std::uint32_t flags, std::int32_t width, std::int32_t height, std::int32_t refresh);
|
||||
|
||||
void wl_done(wl_output *wl_output) {
|
||||
}
|
||||
|
||||
void wl_scale(wl_output *wl_output, std::int32_t factor) {
|
||||
}
|
||||
|
||||
void listen(zxdg_output_manager_v1 *output_manager);
|
||||
|
||||
wl_output *output;
|
||||
|
||||
@@ -162,31 +158,25 @@ namespace wl {
|
||||
interface_t(interface_t &&) = delete;
|
||||
interface_t(const interface_t &) = delete;
|
||||
|
||||
interface_t &
|
||||
operator=(const interface_t &) = delete;
|
||||
interface_t &
|
||||
operator=(interface_t &&) = delete;
|
||||
interface_t &operator=(const interface_t &) = delete;
|
||||
interface_t &operator=(interface_t &&) = delete;
|
||||
|
||||
interface_t() noexcept;
|
||||
|
||||
void
|
||||
listen(wl_registry *registry);
|
||||
void listen(wl_registry *registry);
|
||||
|
||||
std::vector<std::unique_ptr<monitor_t>> monitors;
|
||||
|
||||
zwlr_export_dmabuf_manager_v1 *dmabuf_manager;
|
||||
zxdg_output_manager_v1 *output_manager;
|
||||
|
||||
bool
|
||||
operator[](interface_e bit) const {
|
||||
bool operator[](interface_e bit) const {
|
||||
return interface[bit];
|
||||
}
|
||||
|
||||
private:
|
||||
void
|
||||
add_interface(wl_registry *registry, std::uint32_t id, const char *interface, std::uint32_t version);
|
||||
void
|
||||
del_interface(wl_registry *registry, uint32_t id);
|
||||
void add_interface(wl_registry *registry, std::uint32_t id, const char *interface, std::uint32_t version);
|
||||
void del_interface(wl_registry *registry, uint32_t id);
|
||||
|
||||
std::bitset<MAX_INTERFACES> interface;
|
||||
|
||||
@@ -201,24 +191,19 @@ namespace wl {
|
||||
* @param display_name The name of the display.
|
||||
* @return 0 on success, -1 on failure.
|
||||
*/
|
||||
int
|
||||
init(const char *display_name = nullptr);
|
||||
int init(const char *display_name = nullptr);
|
||||
|
||||
// Roundtrip with Wayland connection
|
||||
void
|
||||
roundtrip();
|
||||
void roundtrip();
|
||||
|
||||
// Wait up to the timeout to read and dispatch new events
|
||||
bool
|
||||
dispatch(std::chrono::milliseconds timeout);
|
||||
bool dispatch(std::chrono::milliseconds timeout);
|
||||
|
||||
// Get the registry associated with the display
|
||||
// No need to manually free the registry
|
||||
wl_registry *
|
||||
registry();
|
||||
wl_registry *registry();
|
||||
|
||||
inline display_internal_t::pointer
|
||||
get() {
|
||||
inline display_internal_t::pointer get() {
|
||||
return display_internal.get();
|
||||
}
|
||||
|
||||
@@ -226,11 +211,9 @@ namespace wl {
|
||||
display_internal_t display_internal;
|
||||
};
|
||||
|
||||
std::vector<std::unique_ptr<monitor_t>>
|
||||
monitors(const char *display_name = nullptr);
|
||||
std::vector<std::unique_ptr<monitor_t>> monitors(const char *display_name = nullptr);
|
||||
|
||||
int
|
||||
init();
|
||||
int init();
|
||||
} // namespace wl
|
||||
#else
|
||||
|
||||
@@ -243,15 +226,12 @@ namespace wl {
|
||||
monitor_t(monitor_t &&) = delete;
|
||||
monitor_t(const monitor_t &) = delete;
|
||||
|
||||
monitor_t &
|
||||
operator=(const monitor_t &) = delete;
|
||||
monitor_t &
|
||||
operator=(monitor_t &&) = delete;
|
||||
monitor_t &operator=(const monitor_t &) = delete;
|
||||
monitor_t &operator=(monitor_t &&) = delete;
|
||||
|
||||
monitor_t(wl_output *output);
|
||||
|
||||
void
|
||||
listen(zxdg_output_manager_v1 *output_manager);
|
||||
void listen(zxdg_output_manager_v1 *output_manager);
|
||||
|
||||
wl_output *output;
|
||||
|
||||
@@ -261,10 +241,12 @@ namespace wl {
|
||||
platf::touch_port_t viewport;
|
||||
};
|
||||
|
||||
inline std::vector<std::unique_ptr<monitor_t>>
|
||||
monitors(const char *display_name = nullptr) { return {}; }
|
||||
inline std::vector<std::unique_ptr<monitor_t>> monitors(const char *display_name = nullptr) {
|
||||
return {};
|
||||
}
|
||||
|
||||
inline int
|
||||
init() { return -1; }
|
||||
inline int init() {
|
||||
return -1;
|
||||
}
|
||||
} // namespace wl
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user