~ubuntu-branches/ubuntu/utopic/mir/utopic-proposed

« back to all changes in this revision

Viewing changes to src/server/scene/default_configuration.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2014-03-10 19:28:46 UTC
  • mto: This revision was merged to the branch mainline in revision 63.
  • Revision ID: package-import@ubuntu.com-20140310192846-rq9qm3ec26yrelo2
Tags: upstream-0.1.6+14.04.20140310
ImportĀ upstreamĀ versionĀ 0.1.6+14.04.20140310

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
#include "mir/default_server_configuration.h"
 
20
 
20
21
#include "mir/graphics/display.h"
21
22
#include "mir/graphics/gl_context.h"
22
23
#include "mir/input/input_configuration.h"
32
33
#include "session_manager.h"
33
34
#include "surface_allocator.h"
34
35
#include "surface_controller.h"
35
 
#include "scene_report.h"
36
36
#include "surface_source.h"
37
37
#include "surface_stack.h"
38
38
#include "threaded_snapshot_strategy.h"
39
39
 
40
40
namespace mc = mir::compositor;
41
41
namespace mf = mir::frontend;
42
 
namespace ml = mir::logging;
43
42
namespace ms = mir::scene;
44
43
namespace msh = mir::shell;
45
44
 
125
124
        });
126
125
}
127
126
 
128
 
std::shared_ptr<ms::SceneReport>
129
 
mir::DefaultServerConfiguration::the_scene_report()
130
 
{
131
 
    return scene_report([this]() -> std::shared_ptr<ms::SceneReport>
132
 
    {
133
 
        auto opt = the_options()->get<std::string>(scene_report_opt);
134
 
 
135
 
        if (opt == log_opt_value)
136
 
        {
137
 
            return std::make_shared<ml::SceneReport>(the_logger());
138
 
        }
139
 
        else if (opt == off_opt_value)
140
 
        {
141
 
            return std::make_shared<ms::NullSceneReport>();
142
 
        }
143
 
        else
144
 
        {
145
 
            throw AbnormalExit(std::string("Invalid ") + scene_report_opt + " option: " + opt +
146
 
                " (valid options are: \"" + off_opt_value + "\" and \"" + log_opt_value + "\")");
147
 
        }
148
 
    });
149
 
}
150
 
 
151
127
std::shared_ptr<ms::BroadcastingSessionEventSink>
152
128
mir::DefaultServerConfiguration::the_broadcasting_session_event_sink()
153
129
{
205
181
    return the_mediating_display_changer();
206
182
}
207
183
 
208
 
std::function<void()>
209
 
mir::DefaultServerConfiguration::force_threads_to_unblock_callback()
210
 
{
211
 
    auto shell_sessions = the_session_container();
212
 
    return [shell_sessions]
213
 
    {
214
 
        shell_sessions->for_each([](std::shared_ptr<msh::Session> const& session)
215
 
        {
216
 
            session->force_requests_to_complete();
217
 
        });
218
 
    };
219
 
}
220
 
 
221
184
std::shared_ptr<mf::EventSink>
222
185
mir::DefaultServerConfiguration::the_global_event_sink()
223
186
{