~mir-team/mir/trunk

« back to all changes in this revision

Viewing changes to include/server/mir/shell/application_session.h

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2013-04-25 23:50:01 UTC
  • mfrom: (526.2.22 mir1)
  • Revision ID: tarmac-20130425235001-c3b3x2yyb3eldyx1
frontend, shell, tests: surface-states updated to avoid supplying dependencies through public member functions.

Approved by PS Jenkins bot, Chris Halse Rogers, Robert Ancell, Kevin DuBois.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
namespace mir
27
27
{
 
28
namespace events
 
29
{
28
30
class EventSink;
29
 
 
 
31
}
30
32
namespace shell
31
33
{
32
34
class SurfaceFactory;
38
40
public:
39
41
    explicit ApplicationSession(std::shared_ptr<SurfaceFactory> const& surface_factory, 
40
42
        std::shared_ptr<InputTargetListener> const& input_target_listener, std::string const& session_name);
 
43
 
 
44
    ApplicationSession(
 
45
        std::shared_ptr<SurfaceFactory> const& surface_factory,
 
46
        std::shared_ptr<InputTargetListener> const& input_target_listener,
 
47
        std::string const& session_name,
 
48
        std::shared_ptr<events::EventSink> const& sink);
 
49
 
41
50
    ~ApplicationSession();
42
51
 
43
52
    frontend::SurfaceId create_surface(frontend::SurfaceCreationParameters const& params);
55
64
 
56
65
    int configure_surface(frontend::SurfaceId id, MirSurfaceAttrib attrib, int value);
57
66
 
58
 
    void set_event_sink(std::shared_ptr<mir::EventSink> const& sink);
59
 
 
60
67
protected:
61
68
    ApplicationSession(ApplicationSession const&) = delete;
62
69
    ApplicationSession& operator=(ApplicationSession const&) = delete;
65
72
    std::shared_ptr<SurfaceFactory> const surface_factory;
66
73
    std::shared_ptr<InputTargetListener> const input_target_listener;
67
74
    std::string const session_name;
 
75
    std::shared_ptr<events::EventSink> const event_sink;
68
76
 
69
77
    frontend::SurfaceId next_id();
70
78
 
74
82
    Surfaces::const_iterator checked_find(frontend::SurfaceId id) const;
75
83
    std::mutex mutable surfaces_mutex;
76
84
    Surfaces surfaces;
77
 
 
78
 
    std::shared_ptr<EventSink> event_sink;
79
85
};
80
86
 
81
87
}