~mir-team/mir/cursor-spike-phase-2

« back to all changes in this revision

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

Add CursorImage and CursorRepository interfaces. Port the builtin cursor to these and port the GBM cursor to use them

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
#include <boost/throw_exception.hpp>
34
34
 
 
35
#include "builtin_cursor_repository.h"
 
36
 
35
37
#include <map>
36
38
 
37
39
namespace mg = mir::graphics;
137
139
        [this]() -> std::shared_ptr<mg::Cursor>
138
140
        {
139
141
            // For now we only support a hardware cursor.
140
 
            return the_display()->create_hardware_cursor();
 
142
            return the_display()->create_hardware_cursor(the_default_cursor_image());
 
143
        });
 
144
}
 
145
 
 
146
std::shared_ptr<mg::CursorImage>
 
147
mir::DefaultServerConfiguration::the_default_cursor_image()
 
148
{
 
149
    return default_cursor_image(
 
150
        [this]()
 
151
        {
 
152
            return the_cursor_repository()->lookup_cursor("default", "arrow");
 
153
        });
 
154
}
 
155
 
 
156
std::shared_ptr<mg::CursorRepository>
 
157
mir::DefaultServerConfiguration::the_cursor_repository()
 
158
{
 
159
    return cursor_repository(
 
160
        [this]()
 
161
        {
 
162
            return std::make_shared<mg::BuiltinCursorRepository>();
141
163
        });
142
164
}
143
165