1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

plugin: export backend_register

It's unclear which functions a custom backend will need, let's be
conversative first.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-05-23 06:49:59 +01:00
parent 7ae185850f
commit d9bc1798b1
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
4 changed files with 12 additions and 7 deletions

View file

@ -21,9 +21,10 @@ static struct backend_info {
bool can_present;
} *backend_registry = NULL;
bool backend_register(uint64_t major, uint64_t minor, const char *name,
struct backend_base *(*init)(session_t *ps, xcb_window_t target),
bool can_present) {
bool PICOM_PUBLIC_API backend_register(uint64_t major, uint64_t minor, const char *name,
struct backend_base *(*init)(session_t *ps,
xcb_window_t target),
bool can_present) {
if (major != PICOM_BACKEND_MAJOR) {
log_error("Backend %s has incompatible major version %" PRIu64
", expected %lu",

View file

@ -463,9 +463,10 @@ bool backend_execute(struct backend_base *backend, image_handle target, unsigned
/// `name` is the name of the backend, `init` is the function to initialize the backend,
/// `can_present` should be true if the backend can present the back buffer to the screen,
/// false otherwise (e.g. if the backend does off screen rendering, etc.)
bool backend_register(uint64_t major, uint64_t minor, const char *name,
struct backend_base *(*init)(session_t *ps, xcb_window_t target),
bool can_present);
bool PICOM_PUBLIC_API backend_register(uint64_t major, uint64_t minor, const char *name,
struct backend_base *(*init)(session_t *ps,
xcb_window_t target),
bool can_present);
struct backend_info *backend_find(const char *name);
struct backend_base *
backend_init(struct backend_info *info, session_t *ps, xcb_window_t target);

View file

@ -126,6 +126,8 @@
#else
# define thread_local _Pragma("GCC error \"No thread local storage support\"") __error__
#endif
#define PICOM_PUBLIC_API __attribute__((visibility("default")))
// clang-format on
typedef unsigned long ulong;

View file

@ -86,7 +86,8 @@ subdir('backend')
picom = executable('picom', srcs, c_args: cflags,
dependencies: [ base_deps, deps, test_h_dep ],
install: true, include_directories: picom_inc)
install: true, include_directories: picom_inc,
export_dynamic: true, gnu_symbol_visibility: 'hidden')
if get_option('unittest')
test('picom unittest', picom, args: [ '--unittest' ])