~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2014-10-10 14:01:26 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20141010140126-n1czko8na1kuz4ll
Tags: upstream-0.8.0+14.10.20141010
ImportĀ upstreamĀ versionĀ 0.8.0+14.10.20141010

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "event_filter_chain.h"
31
31
#include "null_input_configuration.h"
32
32
#include "cursor_controller.h"
 
33
#include "touchspot_controller.h"
33
34
#include "null_input_dispatcher.h"
34
35
#include "null_input_targeter.h"
35
36
#include "xcursor_loader.h"
114
115
            auto dispatcher = std::make_shared<droidinput::InputDispatcher>(
115
116
                the_dispatcher_policy(),
116
117
                the_input_report(),
117
 
                std::make_shared<mia::InputTargetEnumerator>(the_input_targets(), registrar));
 
118
                std::make_shared<mia::InputTargetEnumerator>(the_input_scene(), registrar));
118
119
            registrar->set_dispatcher(dispatcher);
119
120
            return dispatcher;
120
121
        });
234
235
    return cursor_listener(
235
236
        [this]() -> std::shared_ptr<mi::CursorListener>
236
237
        {
237
 
            return std::make_shared<mi::CursorController>(the_input_targets(), 
 
238
            return std::make_shared<mi::CursorController>(the_input_scene(), 
238
239
                the_cursor(), the_default_cursor_image());
239
240
        });
240
241
 
243
244
std::shared_ptr<mi::TouchVisualizer>
244
245
mir::DefaultServerConfiguration::the_touch_visualizer()
245
246
{
246
 
    struct NullTouchVisualizer : public mi::TouchVisualizer
247
 
    {
248
 
        void visualize_touches(std::vector<Spot> const& /* touches */) override
249
 
        {
250
 
        }
251
 
    };
252
247
    return touch_visualizer(
253
 
        [this]()
 
248
        [this]() -> std::shared_ptr<mi::TouchVisualizer>
254
249
        {
255
 
            return std::make_shared<NullTouchVisualizer>();
 
250
            auto visualizer = std::make_shared<mi::TouchspotController>(the_buffer_allocator(), the_buffer_writer(),
 
251
                the_input_scene());
 
252
 
 
253
            // The visualizer is disabled by default and can be enabled statically via
 
254
            // the MIR_SERVER_ENABLE_TOUCHSPOTS option. In the USC/unity8/autopilot case
 
255
            // it will be toggled at runtime via com.canonical.Unity.Screen DBus interface
 
256
            if (the_options()->is_set(options::touchspots_opt))
 
257
            {
 
258
                visualizer->enable();
 
259
            }
 
260
            
 
261
            return visualizer;
256
262
        });
257
263
}
258
264