2018-12-12 22:29:57 +01:00
|
|
|
#ifndef XDPW_H
|
|
|
|
#define XDPW_H
|
|
|
|
|
|
|
|
#include <wayland-client.h>
|
2020-03-06 20:41:53 +01:00
|
|
|
#ifdef HAVE_SYSTEMD
|
2018-12-12 22:29:57 +01:00
|
|
|
#include <systemd/sd-bus.h>
|
2020-03-06 20:41:53 +01:00
|
|
|
#elif HAVE_ELOGIND
|
|
|
|
#include <elogind/sd-bus.h>
|
|
|
|
#endif
|
2020-02-20 20:59:46 +01:00
|
|
|
#include "logger.h"
|
2020-03-10 20:46:37 +01:00
|
|
|
#include "screencast.h"
|
|
|
|
|
|
|
|
struct xdpw_state {
|
|
|
|
sd_bus *bus;
|
|
|
|
struct wl_display *wl_display;
|
|
|
|
struct pw_loop *pw_loop;
|
|
|
|
|
|
|
|
struct screencast_context screencast;
|
|
|
|
};
|
2018-12-12 22:29:57 +01:00
|
|
|
|
2018-12-13 18:03:44 +01:00
|
|
|
struct xdpw_request {
|
|
|
|
sd_bus_slot *slot;
|
|
|
|
};
|
|
|
|
|
2019-12-09 12:55:12 +01:00
|
|
|
struct xdpw_session {
|
|
|
|
sd_bus_slot *slot;
|
|
|
|
};
|
|
|
|
|
2019-07-24 16:59:40 +02:00
|
|
|
enum {
|
|
|
|
PORTAL_RESPONSE_SUCCESS = 0,
|
|
|
|
PORTAL_RESPONSE_CANCELLED = 1,
|
|
|
|
PORTAL_RESPONSE_ENDED = 2
|
|
|
|
};
|
|
|
|
|
2020-03-10 20:46:37 +01:00
|
|
|
int init_screenshot(struct xdpw_state *state);
|
|
|
|
int init_screencast(struct xdpw_state *state, const char *output_name,
|
|
|
|
const char *forced_pixelformat);
|
2018-12-12 22:29:57 +01:00
|
|
|
|
2018-12-13 18:03:44 +01:00
|
|
|
struct xdpw_request *request_create(sd_bus *bus, const char *object_path);
|
|
|
|
void request_destroy(struct xdpw_request *req);
|
|
|
|
|
2019-12-09 12:55:12 +01:00
|
|
|
struct xdpw_session *session_create(sd_bus *bus, const char *object_path);
|
|
|
|
void session_destroy(struct xdpw_session *req);
|
|
|
|
|
2018-12-12 22:29:57 +01:00
|
|
|
#endif
|