~mir-team/mir/attestable-timestamps

« back to all changes in this revision

Viewing changes to examples/demo-shell/demo_shell.cpp

  • Committer: Daniel van Vugt
  • Date: 2014-03-06 06:05:17 UTC
  • mfrom: (1454 development-branch)
  • mto: This revision was merged to the branch mainline in revision 1463.
  • Revision ID: daniel.van.vugt@canonical.com-20140306060517-yhff25duwlo5otn1
MergeĀ latestĀ development-branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
/// \example demo_shell.cpp A simple mir shell
20
20
 
 
21
#include "demo_renderer.h"
21
22
#include "window_manager.h"
22
23
#include "fullscreen_placement_strategy.h"
23
24
#include "../server_configuration.h"
27
28
#include "mir/report_exception.h"
28
29
#include "mir/graphics/display.h"
29
30
#include "mir/input/composite_event_filter.h"
 
31
#include "mir/compositor/renderer_factory.h"
30
32
 
31
33
#include <iostream>
32
34
 
42
44
namespace examples
43
45
{
44
46
 
45
 
struct DemoServerConfiguration : mir::examples::ServerConfiguration
46
 
{
 
47
class DemoRendererFactory : public compositor::RendererFactory
 
48
{
 
49
public:
 
50
    std::unique_ptr<compositor::Renderer> create_renderer_for(
 
51
        geometry::Rectangle const& rect) override
 
52
    {
 
53
        return std::unique_ptr<compositor::Renderer>(new DemoRenderer(rect));
 
54
    }
 
55
};
 
56
 
 
57
class DemoServerConfiguration : public mir::examples::ServerConfiguration
 
58
{
 
59
public:
47
60
    DemoServerConfiguration(int argc, char const* argv[],
48
61
                            std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)
49
62
      : ServerConfiguration([argc, argv]
82
95
        return composite_filter;
83
96
    }
84
97
 
 
98
    std::shared_ptr<compositor::RendererFactory> the_renderer_factory() override
 
99
    {
 
100
        return std::make_shared<DemoRendererFactory>();
 
101
    }
 
102
 
 
103
private:
85
104
    std::vector<std::shared_ptr<mi::EventFilter>> const filter_list;
86
105
};
87
106