diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 10bb6739..c24e94cf 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -979,70 +979,7 @@ struct weston_backend_config { size_t struct_size; }; -struct weston_backend { - void (*destroy)(struct weston_compositor *compositor); - - /** Begin a repaint sequence - * - * Provides the backend with explicit markers around repaint - * sequences, which may allow the backend to aggregate state - * application. This call will be bracketed by the repaint_flush (on - * success), or repaint_cancel (when any output in the grouping fails - * repaint). - * - * Returns an opaque pointer, which the backend may use as private - * data referring to the repaint cycle. - */ - void * (*repaint_begin)(struct weston_compositor *compositor); - - /** Cancel a repaint sequence - * - * Cancels a repaint sequence, when an error has occurred during - * one output's repaint; see repaint_begin. - * - * @param repaint_data Data returned by repaint_begin - */ - void (*repaint_cancel)(struct weston_compositor *compositor, - void *repaint_data); - - /** Conclude a repaint sequence - * - * Called on successful completion of a repaint sequence; see - * repaint_begin. - * - * @param repaint_data Data returned by repaint_begin - */ - int (*repaint_flush)(struct weston_compositor *compositor, - void *repaint_data); - - /** Allocate a new output - * - * @param compositor The compositor. - * @param name Name for the new output. - * - * Allocates a new output structure that embeds a weston_output, - * initializes it, and returns the pointer to the weston_output - * member. - * - * Must set weston_output members @c destroy, @c enable and @c disable. - */ - struct weston_output * - (*create_output)(struct weston_compositor *compositor, - const char *name); - - /** Notify of device addition/removal - * - * @param compositor The compositor. - * @param device The device that has changed. - * @param added Where it was added (or removed) - * - * Called when a device has been added/removed from the session. - * The backend can decide what to do based on whether it is a - * device that it is controlling or not. - */ - void (*device_changed)(struct weston_compositor *compositor, - dev_t device, bool added); -}; +struct weston_backend; /** Callback for saving calibration * diff --git a/libweston/backend.h b/libweston/backend.h index 568fcec4..4d5a64ff 100644 --- a/libweston/backend.h +++ b/libweston/backend.h @@ -25,9 +25,78 @@ * SOFTWARE. */ +/* + * This header contains the libweston ABI exported only for internal backends. + */ + #ifndef LIBWESTON_BACKEND_INTERNAL_H #define LIBWESTON_BACKEND_INTERNAL_H +struct weston_backend { + void (*destroy)(struct weston_compositor *compositor); + + /** Begin a repaint sequence + * + * Provides the backend with explicit markers around repaint + * sequences, which may allow the backend to aggregate state + * application. This call will be bracketed by the repaint_flush (on + * success), or repaint_cancel (when any output in the grouping fails + * repaint). + * + * Returns an opaque pointer, which the backend may use as private + * data referring to the repaint cycle. + */ + void * (*repaint_begin)(struct weston_compositor *compositor); + + /** Cancel a repaint sequence + * + * Cancels a repaint sequence, when an error has occurred during + * one output's repaint; see repaint_begin. + * + * @param repaint_data Data returned by repaint_begin + */ + void (*repaint_cancel)(struct weston_compositor *compositor, + void *repaint_data); + + /** Conclude a repaint sequence + * + * Called on successful completion of a repaint sequence; see + * repaint_begin. + * + * @param repaint_data Data returned by repaint_begin + */ + int (*repaint_flush)(struct weston_compositor *compositor, + void *repaint_data); + + /** Allocate a new output + * + * @param compositor The compositor. + * @param name Name for the new output. + * + * Allocates a new output structure that embeds a weston_output, + * initializes it, and returns the pointer to the weston_output + * member. + * + * Must set weston_output members @c destroy, @c enable and @c disable. + */ + struct weston_output * + (*create_output)(struct weston_compositor *compositor, + const char *name); + + /** Notify of device addition/removal + * + * @param compositor The compositor. + * @param device The device that has changed. + * @param added Where it was added (or removed) + * + * Called when a device has been added/removed from the session. + * The backend can decide what to do based on whether it is a + * device that it is controlling or not. + */ + void (*device_changed)(struct weston_compositor *compositor, + dev_t device, bool added); +}; + /* weston_head */ void diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c index 9c10c097..9b3c52fa 100644 --- a/libweston/launcher-logind.c +++ b/libweston/launcher-logind.c @@ -39,6 +39,7 @@ #include #include +#include "backend.h" #include "dbus.h" #include "launcher-impl.h"