/*
 * 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.h
 * Title : entry of shell 
 */

#ifndef _FX_SHELL_H_
#define _FX_SHELL_H_

#include "compositor.h"
#include "fx-surface.h"

#ifdef __cplusplus
extern "C" {
#endif

#define FX_SHELL_SEAT_NAME      "fx_shell_seat"

/* Typedefs */
enum fx_shell_animation_type {
    FX_SHELL_ANIMATION_NONE,

    FX_SHELL_ANIMATION_ZOOM,
    FX_SHELL_ANIMATION_FADE,
    FX_SHELL_ANIMATION_DIM_LAYER,
    FX_SHELL_ANIMATION_SLIDE,
};

enum fx_shell_fade_type {
    FADE_IN,
    FADE_OUT,
};
struct fx_shell_output {
    struct fx_shell 
        *shell;
    struct weston_output *
        output;
    struct wl_listener   
        destroy_listener;
    struct wl_list       
        link;

    struct weston_view *
        black_view;
#if 0
    struct weston_surface *
        background_surface;
    struct wl_listener 
        background_surface_listener;
#endif /* 0 */
};
struct fx_shell {
    struct weston_compositor *
        compositor;
    struct weston_fx_shell*
        weston_fx_shell;

    struct wl_listener
        destroy_listener;

    struct wl_array
        layers;
    struct weston_layer
        background_layer;

    struct wl_listener
        pointer_focus_listener;

    struct {
        struct wl_client *
            client;
        struct wl_resource *
            fx_shell;
        struct wl_listener
            client_destroy_listener;
    } child;

    struct {
        struct weston_view *
            view;
        struct weston_view_animation *
            animation;
        enum fx_shell_fade_type 
            type;
    } fade;

    enum fx_shell_animation_type win_animation_type;
    enum fx_shell_animation_type win_close_animation_type;

    struct wl_listener
        seat_create_listener;
    struct wl_listener
        output_create_listener;
    struct wl_listener
        output_move_listener;
    struct wl_list output_list;

    struct wl_global*
        controller;
    struct wl_global*
        fx_surface_extension;
    struct wl_global*
        qt_surface_extension;
    struct wl_global*
        fx_swkeyboard;
};

/* Procedures */
void
fx_shell_raise_shell_surface( struct fx_shell_surface *shell_surface );
void
fx_shell_lower_shell_surface( struct fx_shell_surface *shell_surface );
struct weston_view*
fx_shell_get_shell_surface_view( struct fx_shell_surface *shell_surface );

#ifdef __cplusplus
}
#endif

#endif /* _FX_SHELL_H_ */

