~vanvugt/mir/mir-display-config-header

« back to all changes in this revision

Viewing changes to src/include/server/mir/default_server_configuration.h

  • Committer: Tarmac
  • Author(s): Christopher James Halse Rogers
  • Date: 2016-11-15 23:48:01 UTC
  • mfrom: (3730.3.26 reports-as-observers)
  • Revision ID: tarmac-20161115234801-2w603k4v3ffhfl3u
Replace the mir::Server-overridable Reports with Observers.

This resolves two problems:
1) It ensures that Mir will respect the various reporting options we provide, even when the shell wants to hook into some of the reports, and
2) It matches the semantic expectations around Reports vs Observers that (most of) the Mir team have. A couple of report call-sites which are unsafe for Observers are fixed in this branch.

Approved by mir-ci-bot, Kevin DuBois, Andreas Pokorny, Cemil Azizoglu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
class SharedLibrary;
32
32
class SharedLibraryProberReport;
33
33
 
 
34
template<class Observer>
 
35
class ObserverRegistrar;
 
36
 
 
37
template<class Observer>
 
38
class ObserverMultiplexer;
 
39
 
34
40
namespace cookie
35
41
{
36
42
class Authority;
56
62
class ConnectorReport;
57
63
class ProtobufIpcFactory;
58
64
class ConnectionCreator;
59
 
class SessionMediatorReport;
 
65
class SessionMediatorObserver;
60
66
class MessageProcessorReport;
61
67
class SessionAuthorizer;
62
68
class EventSink;
106
112
class Platform;
107
113
class Display;
108
114
class DisplayReport;
109
 
class DisplayConfigurationReport;
 
115
class DisplayConfigurationObserver;
110
116
class GraphicBufferAllocator;
111
117
class Cursor;
112
118
class CursorImage;
120
126
namespace input
121
127
{
122
128
class InputReport;
123
 
class SeatReport;
 
129
class SeatObserver;
124
130
class Scene;
125
131
class InputManager;
126
132
class SurfaceInputDispatcher;
153
159
namespace report
154
160
{
155
161
class ReportFactory;
 
162
class Reports;
156
163
}
157
164
 
158
165
namespace renderer
215
222
    virtual std::shared_ptr<graphics::Cursor> wrap_cursor(std::shared_ptr<graphics::Cursor> const& wrapped);
216
223
    virtual std::shared_ptr<graphics::CursorImage> the_default_cursor_image();
217
224
    virtual std::shared_ptr<input::CursorImages> the_cursor_images();
218
 
    virtual std::shared_ptr<graphics::DisplayConfigurationReport> the_display_configuration_report();
 
225
    std::shared_ptr<ObserverRegistrar<graphics::DisplayConfigurationObserver>>
 
226
        the_display_configuration_observer_registrar();
219
227
 
220
228
    /** @} */
221
229
 
239
247
    /** @name frontend configuration - dependencies
240
248
     * dependencies of frontend on the rest of the Mir
241
249
     *  @{ */
242
 
    virtual std::shared_ptr<frontend::SessionMediatorReport>  the_session_mediator_report();
 
250
    virtual std::shared_ptr<ObserverRegistrar<frontend::SessionMediatorObserver>>
 
251
        the_session_mediator_observer_registrar();
243
252
    virtual std::shared_ptr<frontend::MessageProcessorReport> the_message_processor_report();
244
253
    virtual std::shared_ptr<frontend::SessionAuthorizer>      the_session_authorizer();
245
254
    // the_frontend_shell() is an adapter for the_shell().
306
315
    /** @name input configuration
307
316
     *  @{ */
308
317
    virtual std::shared_ptr<input::InputReport> the_input_report();
309
 
    virtual std::shared_ptr<input::SeatReport> the_seat_report();
 
318
    virtual std::shared_ptr<ObserverRegistrar<input::SeatObserver>> the_seat_observer_registrar();
310
319
    virtual std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter();
311
320
 
312
321
    virtual std::shared_ptr<input::EventFilterChainDispatcher> the_event_filter_chain_dispatcher();
347
356
    std::shared_ptr<options::Option> the_options() const;
348
357
    std::shared_ptr<graphics::nested::MirClientHostConnection>  the_mir_client_host_connection();
349
358
    std::shared_ptr<input::DefaultInputDeviceHub>  the_default_input_device_hub();
 
359
    std::shared_ptr<graphics::DisplayConfigurationObserver> the_display_configuration_observer();
 
360
    std::shared_ptr<input::SeatObserver> the_seat_observer();
 
361
    std::shared_ptr<frontend::SessionMediatorObserver> the_session_mediator_observer();
350
362
 
351
363
    virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();
352
364
    virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer();
371
383
    CachedPtr<frontend::Connector>   prompt_connector;
372
384
 
373
385
    CachedPtr<input::InputReport> input_report;
374
 
    CachedPtr<input::SeatReport> seat_report;
375
386
    CachedPtr<input::EventFilterChainDispatcher> event_filter_chain_dispatcher;
376
387
    CachedPtr<input::CompositeEventFilter> composite_event_filter;
377
388
    CachedPtr<input::InputManager>    input_manager;
393
404
    CachedPtr<input::CursorImages> cursor_images;
394
405
 
395
406
    CachedPtr<frontend::ConnectorReport>   connector_report;
396
 
    CachedPtr<frontend::SessionMediatorReport> session_mediator_report;
397
407
    CachedPtr<frontend::MessageProcessorReport> message_processor_report;
398
408
    CachedPtr<frontend::SessionAuthorizer> session_authorizer;
399
409
    CachedPtr<frontend::EventSink> global_event_sink;
418
428
    CachedPtr<compositor::CompositorReport> compositor_report;
419
429
    CachedPtr<logging::Logger> logger;
420
430
    CachedPtr<graphics::DisplayReport> display_report;
421
 
    CachedPtr<graphics::DisplayConfigurationReport> display_configuration_report;
422
431
    CachedPtr<time::Clock> clock;
423
432
    CachedPtr<MainLoop> main_loop;
424
433
    CachedPtr<ServerStatusListener> server_status_listener;
443
452
private:
444
453
    std::shared_ptr<options::Configuration> const configuration_options;
445
454
    std::shared_ptr<input::EventFilter> const default_filter;
 
455
    CachedPtr<ObserverMultiplexer<graphics::DisplayConfigurationObserver>>
 
456
        display_configuration_observer_multiplexer;
 
457
    CachedPtr<ObserverMultiplexer<input::SeatObserver>>
 
458
        seat_observer_multiplexer;
 
459
    CachedPtr<ObserverMultiplexer<frontend::SessionMediatorObserver>>
 
460
        session_mediator_observer_multiplexer;
 
461
    std::shared_ptr<report::Reports> const reports;
446
462
 
447
463
    virtual std::string the_socket_file() const;
448
464
 
453
469
    std::shared_ptr<scene::BroadcastingSessionEventSink> the_broadcasting_session_event_sink();
454
470
 
455
471
    auto report_factory(char const* report_opt) -> std::unique_ptr<report::ReportFactory>;
 
472
    auto initialise_reports() -> std::shared_ptr<report::Reports>;
456
473
 
457
474
    CachedPtr<shell::detail::FrontendShell> frontend_shell;
458
475
};