#ifndef _FX_SCREEN_SHARE_H_
#define _FX_SCREEN_SHARE_H_

#include "compositor.h"
#include "plugin-registry.h"

#ifdef  __cplusplus
extern "C" {
#endif

/* Typedefs */
struct screen_share;
struct fx_screen_share_listener {
    void ( *connection )(
            struct fx_screen_share_listener *listener,
            int connected );
};

#define WESTON_FX_SCREEN_SHARE_API_NAME \
    "weston_fx_screen_share_api_v1"

struct weston_fx_screen_share_api {
    struct screen_share*
        (*create)(
            struct weston_compositor *compositor,
            const char* section_name,
            struct fx_screen_share_listener *listener );
    void
        (*destroy)( struct screen_share* ss );
};

static inline const struct weston_fx_screen_share_api *
weston_fx_screen_share_get_api(struct weston_compositor *compositor)
{
    const void *api
        = weston_plugin_api_get(
            compositor,
            WESTON_FX_SCREEN_SHARE_API_NAME,
            sizeof ( struct weston_fx_screen_share_api ) );

    return (const struct weston_fx_screen_share_api *) api;
}

#ifdef  __cplusplus
}
#endif

#endif /* _FX_SCREEN_SHARE_H_ */

