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

« back to all changes in this revision

Viewing changes to src/server/input/android/default_android_input_configuration.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Alberto Aguirre, Ubuntu daily release
  • Date: 2014-11-20 16:41:15 UTC
  • mfrom: (1.1.78)
  • Revision ID: package-import@ubuntu.com-20141120164115-icb4r8ekhfuj1abj
Tags: 0.9.0+15.04.20141120.1-0ubuntu1
[ Alberto Aguirre ]
* New upstream release 0.9.0 (https://launchpad.net/mir/+milestone/0.9.0)
  - Enhancements:
    . New simpler API to configure and run a mir server.
    . The event loop is now based on GLib's main loop library instead of
      Boost.Asio.
    . For Android platforms, the server now sends buffer fence fds to its
      clients instead of potentially stalling the compositor thread waiting
      for them to be signalled.
    . New client debug interface to translate from surface to screen
      coordinates.
  - ABI summary: Servers need rebuilding, but clients do not;
    . Mirclient ABI unchanged at 8
    . Mircommon ABI bumped to 3
    . Mirplatform ABI bumped to 4
    . Mirserver ABI bumped to 27
  - Bug fixes:
    . Add a debug interface to translate from surface to screen coordinates
      (LP: #1346633)
    . Ensure a buffer requested by a surface is not delivered 
      after the surface is deleted (LP: #1376324)
    . Overlays are not displayed onscreen in some positions (LP: #1378326)
    . Server aborts when an exception is thrown from the main thread
      (LP: #1378740)
    . Fix race causing lost alarm notifications (LP: #1381925)
    . Avoid lifecycle notifications racing with connection release
      (LP: #1386646)
    . Improve error checking and reporting for the client library
     (LP: #1390388)
    . Mir demo-shell now detects power button using proper Linux scan codes
     (LP: #1303817)
    . A prompt session with an invalid application pid should be an error
      (LP: #1377968)
    . When XDG_RUNTIME_DIR is defined but pointing to a non-existing 
      directory use "/tmp" (LP: #1304873)
    . [regression] demo-shell bypass is not used on fullscreen surfaces if 
      there are windowed surfaces behind (LP: #1378706)
    . Mir upgrade through dist-upgrade installs incorrect platform
      (LP: #1378995)
    . Fix Mir progressbar example using internal glibc defines(LP: #239272)
    . Stop the default_lifecycle_event_handler raising SIGHUP while 
      disconnecting (LP: #1386185)
    . [regression] Mir fails to build with MIR_ENABLE_TESTS=OFF (LP: #1388539)
    . [regression] mir_demo_server_basic does not start (LP: #1391923)

[ Ubuntu daily release ]
* New rebuild forced

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2013-2014 Canonical Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU General Public License version 3,
6
 
 * as published by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Authored by: Robert Carr <robert.carr@canonical.com>
17
 
                Andreas Pokorny <andreas.pokorny@canonical.com>
18
 
 */
19
 
 
20
 
#include "mir/input/android/default_android_input_configuration.h"
21
 
#include "event_filter_dispatcher_policy.h"
22
 
#include "android_input_reader_policy.h"
23
 
#include "android_input_thread.h"
24
 
#include "android_input_registrar.h"
25
 
#include "android_input_targeter.h"
26
 
#include "android_input_target_enumerator.h"
27
 
#include "android_input_manager.h"
28
 
#include "input_translator.h"
29
 
#include "common_input_thread.h"
30
 
 
31
 
#include "mir/input/event_filter.h"
32
 
 
33
 
#include <EventHub.h>
34
 
#include <InputDispatcher.h>
35
 
 
36
 
#include "mir/input/event_filter.h"
37
 
 
38
 
#include <EventHub.h>
39
 
#include <InputDispatcher.h>
40
 
#include <InputReader.h>
41
 
 
42
 
#include <string>
43
 
 
44
 
namespace droidinput = android;
45
 
 
46
 
namespace mi = mir::input;
47
 
namespace mia = mi::android;
48
 
namespace ms = mir::scene;
49
 
namespace msh = mir::shell;
50
 
 
51
 
mia::DefaultInputConfiguration::DefaultInputConfiguration(
52
 
    std::shared_ptr<mi::InputDispatcher> const& input_dispatcher,
53
 
    std::shared_ptr<mi::InputRegion> const& input_region,
54
 
    std::shared_ptr<CursorListener> const& cursor_listener,
55
 
    std::shared_ptr<TouchVisualizer> const& touch_visualizer,
56
 
    std::shared_ptr<mi::InputReport> const& input_report) :
57
 
    input_dispatcher(input_dispatcher),
58
 
    input_region(input_region),
59
 
    cursor_listener(cursor_listener),
60
 
    touch_visualizer(touch_visualizer),
61
 
    input_report(input_report)
62
 
{
63
 
}
64
 
 
65
 
mia::DefaultInputConfiguration::~DefaultInputConfiguration()
66
 
{
67
 
}
68
 
 
69
 
std::shared_ptr<droidinput::EventHubInterface> mia::DefaultInputConfiguration::the_event_hub()
70
 
{
71
 
    return event_hub(
72
 
        [this]()
73
 
        {
74
 
            return std::make_shared<droidinput::EventHub>(input_report);
75
 
        });
76
 
}
77
 
 
78
 
std::shared_ptr<droidinput::InputReaderPolicyInterface> mia::DefaultInputConfiguration::the_reader_policy()
79
 
{
80
 
    return reader_policy(
81
 
        [this]()
82
 
        {
83
 
            return std::make_shared<mia::InputReaderPolicy>(input_region, cursor_listener, touch_visualizer);
84
 
        });
85
 
}
86
 
 
87
 
 
88
 
std::shared_ptr<droidinput::InputReaderInterface> mia::DefaultInputConfiguration::the_reader()
89
 
{
90
 
    return reader(
91
 
        [this]()
92
 
        {
93
 
            return std::make_shared<droidinput::InputReader>(
94
 
                the_event_hub(), the_reader_policy(), the_input_translator());
95
 
        });
96
 
}
97
 
 
98
 
std::shared_ptr<mia::InputThread> mia::DefaultInputConfiguration::the_reader_thread()
99
 
{
100
 
    return reader_thread(
101
 
        [this]()
102
 
        {
103
 
            return std::make_shared<CommonInputThread>("Mir/InputReader",
104
 
                                                       new droidinput::InputReaderThread(the_reader()));
105
 
        });
106
 
}
107
 
 
108
 
std::shared_ptr<droidinput::InputListenerInterface> mia::DefaultInputConfiguration::the_input_translator()
109
 
{
110
 
    return std::make_shared<mia::InputTranslator>(input_dispatcher);
111
 
}
112
 
 
113
 
std::shared_ptr<mi::InputManager> mia::DefaultInputConfiguration::the_input_manager()
114
 
{
115
 
    return input_manager(
116
 
        [this]() -> std::shared_ptr<mi::InputManager>
117
 
        {
118
 
            return std::make_shared<mia::InputManager>(
119
 
                the_event_hub(),
120
 
                the_reader_thread());
121
 
        });
122
 
}
123