2
* Copyright © 2015 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored By: Alan Griffiths <alan@octopull.co.uk>
19
#ifndef MIR_SHELL_DEFAULT_SHELL_H_
20
#define MIR_SHELL_DEFAULT_SHELL_H_
22
#include "mir/frontend/shell.h"
23
#include "mir/shell/focus_controller.h"
29
namespace scene { class SessionCoordinator; }
35
class DefaultShell : public frontend::Shell, public FocusController
39
std::shared_ptr<FocusSetter> const& focus_setter,
40
std::shared_ptr<scene::SessionCoordinator> const& session_coordinator);
42
void focus_next() override;
44
std::weak_ptr<scene::Session> focussed_application() const override;
46
void set_focus_to(std::shared_ptr<scene::Session> const& focus) override;
48
virtual std::shared_ptr<frontend::Session> open_session(
50
std::string const& name,
51
std::shared_ptr<frontend::EventSink> const& sink) override;
53
virtual void close_session(std::shared_ptr<frontend::Session> const& session) override;
55
void handle_surface_created(std::shared_ptr<frontend::Session> const& session) override;
57
std::shared_ptr<frontend::PromptSession> start_prompt_session_for(
58
std::shared_ptr<frontend::Session> const& session,
59
scene::PromptSessionCreationParameters const& params) override;
61
void add_prompt_provider_for(
62
std::shared_ptr<frontend::PromptSession> const& prompt_session,
63
std::shared_ptr<frontend::Session> const& session) override;
65
void stop_prompt_session(std::shared_ptr<frontend::PromptSession> const& prompt_session) override;
67
frontend::SurfaceId create_surface(std::shared_ptr<frontend::Session> const& session, scene::SurfaceCreationParameters const& params) override;
69
void destroy_surface(std::shared_ptr<frontend::Session> const& session, frontend::SurfaceId surface) override;
71
int set_surface_attribute(
72
std::shared_ptr<frontend::Session> const& session,
73
frontend::SurfaceId surface_id,
74
MirSurfaceAttrib attrib,
77
int get_surface_attribute(
78
std::shared_ptr<frontend::Session> const& session,
79
frontend::SurfaceId surface_id,
80
MirSurfaceAttrib attrib) override;
83
std::shared_ptr<FocusSetter> const focus_setter;
84
std::shared_ptr<scene::SessionCoordinator> const session_coordinator;
87
std::weak_ptr<scene::Session> focus_application;
89
void set_focus_to_locked(std::unique_lock<std::mutex> const& lock, std::shared_ptr<scene::Session> const& next_focus);
94
#endif /* MIR_SHELL_DEFAULT_SHELL_H_ */