2 * Copyright © 2010-2012 Intel Corporation
3 * Copyright © 2011-2012 Collabora, Ltd.
4 * Copyright © 2013 Raspberry Pi Foundation
6 * Permission to use, copy, modify, distribute, and sell this software and
7 * its documentation for any purpose is hereby granted without fee, provided
8 * that the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of the copyright holders not be used in
11 * advertising or publicity pertaining to distribution of the software
12 * without specific, written prior permission. The copyright holders make
13 * no representations about the suitability of this software for any
14 * purpose. It is provided "as is" without express or implied warranty.
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
20 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
21 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27 #include "compositor.h"
42 enum exposay_target_state {
43 EXPOSAY_TARGET_OVERVIEW, /* show all windows */
44 EXPOSAY_TARGET_CANCEL, /* return to normal, same focus */
45 EXPOSAY_TARGET_SWITCH, /* return to normal, switch focus */
48 enum exposay_layout_state {
49 EXPOSAY_LAYOUT_INACTIVE = 0, /* normal desktop */
50 EXPOSAY_LAYOUT_ANIMATE_TO_INACTIVE, /* in transition to normal */
51 EXPOSAY_LAYOUT_OVERVIEW, /* show all windows */
52 EXPOSAY_LAYOUT_ANIMATE_TO_OVERVIEW, /* in transition to all windows */
55 struct focus_surface {
56 struct weston_surface *surface;
57 struct weston_view *view;
58 struct weston_transform workspace_transform;
62 struct weston_layer layer;
64 struct wl_list focus_list;
65 struct wl_listener seat_destroyed_listener;
67 struct focus_surface *fsurf_front;
68 struct focus_surface *fsurf_back;
69 struct weston_view_animation *focus_animation;
72 struct desktop_shell {
73 struct weston_compositor *compositor;
75 struct wl_listener idle_listener;
76 struct wl_listener wake_listener;
77 struct wl_listener destroy_listener;
78 struct wl_listener show_input_panel_listener;
79 struct wl_listener hide_input_panel_listener;
80 struct wl_listener update_input_panel_listener;
82 struct weston_layer fullscreen_layer;
83 struct weston_layer panel_layer;
84 struct weston_layer background_layer;
85 struct weston_layer lock_layer;
86 struct weston_layer input_panel_layer;
88 struct wl_listener pointer_focus_listener;
89 struct weston_surface *grab_surface;
92 struct weston_process process;
93 struct wl_client *client;
94 struct wl_resource *desktop_shell;
95 struct wl_listener client_destroy_listener;
102 bool showing_input_panels;
103 bool prepare_event_sent;
106 struct weston_surface *surface;
107 pixman_box32_t cursor_rectangle;
110 struct weston_surface *lock_surface;
111 struct wl_listener lock_surface_listener;
114 struct wl_array array;
115 unsigned int current;
118 struct wl_list client_list;
120 struct weston_animation animation;
121 struct wl_list anim_sticky_list;
123 uint32_t anim_timestamp;
125 struct workspace *anim_from;
126 struct workspace *anim_to;
132 struct wl_resource *binding;
133 struct weston_process process;
134 struct wl_event_source *timer;
138 struct wl_resource *binding;
139 struct wl_list surfaces;
143 struct weston_view *view;
144 struct weston_view_animation *animation;
146 struct wl_event_source *startup_timer;
150 /* XXX: Make these exposay_surfaces. */
151 struct weston_view *focus_prev;
152 struct weston_view *focus_current;
153 struct weston_view *clicked;
154 struct workspace *workspace;
155 struct weston_seat *seat;
156 struct wl_list surface_list;
158 struct weston_keyboard_grab grab_kbd;
159 struct weston_pointer_grab grab_ptr;
161 enum exposay_target_state state_target;
162 enum exposay_layout_state state_cur;
163 int in_flight; /* number of animations still running */
180 uint32_t binding_modifier;
181 uint32_t exposay_modifier;
182 enum animation_type win_animation_type;
183 enum animation_type startup_animation_type;
184 enum animation_type focus_animation_type;
186 struct wl_listener output_create_listener;
187 struct wl_list output_list;
193 set_alpha_if_fullscreen(struct shell_surface *shsurf);
195 struct weston_output *
196 get_default_output(struct weston_compositor *compositor);
199 get_default_view(struct weston_surface *surface);
201 struct shell_surface *
202 get_shell_surface(struct weston_surface *surface);
205 get_current_workspace(struct desktop_shell *shell);
208 lower_fullscreen_layer(struct desktop_shell *shell);
211 activate(struct desktop_shell *shell, struct weston_surface *es,
212 struct weston_seat *seat);
215 exposay_binding(struct weston_seat *seat,
216 enum weston_keyboard_modifier modifier,
219 input_panel_setup(struct desktop_shell *shell);
221 input_panel_destroy(struct desktop_shell *shell);