2 * Copyright © 2010-2012 Intel Corporation
3 * Copyright © 2011-2012 Collabora, Ltd.
4 * Copyright © 2013 Raspberry Pi Foundation
5 * Copyright © 2013-2014 TOYOTA MOTOR CORPORATION.
7 * Permission to use, copy, modify, distribute, and sell this software and
8 * its documentation for any purpose is hereby granted without fee, provided
9 * that the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of the copyright holders not be used in
12 * advertising or publicity pertaining to distribution of the software
13 * without specific, written prior permission. The copyright holders make
14 * no representations about the suitability of this software for any
15 * purpose. It is provided "as is" without express or implied warranty.
17 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
18 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
21 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
22 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
23 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28 #include <weston/compositor.h>
43 enum exposay_target_state {
44 EXPOSAY_TARGET_OVERVIEW, /* show all windows */
45 EXPOSAY_TARGET_CANCEL, /* return to normal, same focus */
46 EXPOSAY_TARGET_SWITCH, /* return to normal, switch focus */
49 enum exposay_layout_state {
50 EXPOSAY_LAYOUT_INACTIVE = 0, /* normal desktop */
51 EXPOSAY_LAYOUT_ANIMATE_TO_INACTIVE, /* in transition to normal */
52 EXPOSAY_LAYOUT_OVERVIEW, /* show all windows */
53 EXPOSAY_LAYOUT_ANIMATE_TO_OVERVIEW, /* in transition to all windows */
56 struct focus_surface {
57 struct weston_surface *surface;
58 struct weston_view *view;
59 struct weston_transform workspace_transform;
63 struct weston_layer layer;
65 struct wl_list focus_list;
66 struct wl_listener seat_destroyed_listener;
68 struct focus_surface *fsurf_front;
69 struct focus_surface *fsurf_back;
70 struct weston_view_animation *focus_animation;
73 struct desktop_shell {
74 struct weston_compositor *compositor;
76 struct wl_listener idle_listener;
77 struct wl_listener wake_listener;
78 struct wl_listener destroy_listener;
79 struct wl_listener show_input_panel_listener;
80 struct wl_listener hide_input_panel_listener;
81 struct wl_listener update_input_panel_listener;
83 struct weston_layer fullscreen_layer;
84 struct weston_layer panel_layer;
85 struct weston_layer background_layer;
86 struct weston_layer lock_layer;
87 struct weston_layer input_panel_layer;
89 struct wl_listener pointer_focus_listener;
90 struct weston_surface *grab_surface;
93 struct weston_process process;
94 struct wl_client *client;
95 struct wl_resource *desktop_shell;
96 struct wl_listener client_destroy_listener;
103 bool showing_input_panels;
104 bool prepare_event_sent;
107 struct weston_surface *surface;
108 pixman_box32_t cursor_rectangle;
111 struct weston_surface *lock_surface;
112 struct wl_listener lock_surface_listener;
115 struct wl_array array;
116 unsigned int current;
119 struct wl_list client_list;
121 struct weston_animation animation;
122 struct wl_list anim_sticky_list;
124 uint32_t anim_timestamp;
126 struct workspace *anim_from;
127 struct workspace *anim_to;
133 struct wl_resource *binding;
134 struct weston_process process;
135 struct wl_event_source *timer;
139 struct wl_resource *binding;
140 struct wl_list surfaces;
144 struct weston_view *view;
145 struct weston_view_animation *animation;
147 struct wl_event_source *startup_timer;
151 /* XXX: Make these exposay_surfaces. */
152 struct weston_view *focus_prev;
153 struct weston_view *focus_current;
154 struct weston_view *clicked;
155 struct workspace *workspace;
156 struct weston_seat *seat;
157 struct wl_list surface_list;
159 struct weston_keyboard_grab grab_kbd;
160 struct weston_pointer_grab grab_ptr;
162 enum exposay_target_state state_target;
163 enum exposay_layout_state state_cur;
164 int in_flight; /* number of animations still running */
181 uint32_t binding_modifier;
182 uint32_t exposay_modifier;
183 enum animation_type win_animation_type;
184 enum animation_type startup_animation_type;
185 enum animation_type focus_animation_type;
187 struct wl_listener output_create_listener;
188 struct wl_list output_list;
194 set_alpha_if_fullscreen(struct shell_surface *shsurf);
196 struct weston_output *
197 get_default_output(struct weston_compositor *compositor);
200 get_default_view(struct weston_surface *surface);
202 struct shell_surface *
203 get_shell_surface(struct weston_surface *surface);
206 get_current_workspace(struct desktop_shell *shell);
209 lower_fullscreen_layer(struct desktop_shell *shell);
212 activate(struct desktop_shell *shell, struct weston_surface *es,
213 struct weston_seat *seat);
216 exposay_binding(struct weston_seat *seat,
217 enum weston_keyboard_modifier modifier,
220 input_panel_setup(struct desktop_shell *shell);
222 input_panel_destroy(struct desktop_shell *shell);