/*
 * Copyright © 2016 Quentin "Sardem FF7" Glidic
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */
/*
 * (C) Copyright 2014, Fuji Xerox Co.,Ltd.  All rights reserved.
 * File name : fx-shell-data.h
 * Title : shell common data
 */

#ifndef WESTON_FX_SHELL_H
#define WESTON_FX_SHELL_H

#include "compositor.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Typedefs */
struct weston_fx_shell;
struct fx_shell_surface;

struct weston_fx_shell_api {
    size_t struct_size;

    void ( *surface_added )(
            struct fx_shell_surface *shell_surface,
            void *user_data );
    void ( *surface_removed )(
            struct fx_shell_surface *shell_surface,
            void *user_data );
    void ( *committed )(
            struct fx_shell_surface *shell_surface,
            int32_t sx,
            int32_t sy,
            void *user_data );
    void ( *set_parent )(
            struct fx_shell_surface *shell_surface,
            struct fx_shell_surface *parent_shell_surface,
            void *user_data );
    void ( *fullscreen_requested )(
            struct fx_shell_surface *shell_surface,
            bool fullscreen,
            struct weston_output *output,
            void *user_data );
};

/* Procedures */
struct weston_fx_shell *
weston_fx_shell_create(
        struct weston_compositor *compositor,
        const struct weston_fx_shell_api *api,
        void *user_data );
void
weston_fx_shell_destroy(
        struct weston_fx_shell *weston_fx_shell );

struct weston_compositor *
weston_fx_shell_get_compositor(
        struct weston_fx_shell *weston_fx_shell );
struct wl_display *
weston_fx_shell_get_display(
        struct weston_fx_shell *weston_fx_shell );

void
weston_fx_shell_api_surface_added(
        struct weston_fx_shell *weston_fx_shell,
        struct fx_shell_surface *shell_surface );
void
weston_fx_shell_api_surface_removed(
        struct weston_fx_shell *weston_fx_shell,
        struct fx_shell_surface *shell_surface );
void
weston_fx_shell_api_committed(
        struct weston_fx_shell *weston_fx_shell,
        struct fx_shell_surface *shell_surface,
        int32_t sx,
        int32_t sy );
void
weston_fx_shell_api_set_parent(
        struct weston_fx_shell *weston_fx_shell,
        struct fx_shell_surface *shell_surface,
        struct fx_shell_surface *parent_shell_surface );
void
weston_fx_shell_api_fullscreen_requested(
        struct weston_fx_shell *weston_fx_shell,
        struct fx_shell_surface *shell_surface,
        bool fullscreen,
        struct weston_output *output );

#ifdef __cplusplus
}
#endif

#endif /* WESTON_FX_SHELL_H */
