~mir-team/mir/development-branch

« back to all changes in this revision

Viewing changes to src/server/scene/default_coordinate_translator.h

  • Committer: Tarmac
  • Author(s): Christopher James Halse Rogers
  • Date: 2014-10-27 22:31:16 UTC
  • mfrom: (1840.3.30 bug-bug-debug-the-bugs)
  • Revision ID: tarmac-20141027223116-h1ggv4pjurucd2d9
Add a debug interface to translate from surface to screen coordinates.

This is the Mir part of the infrastructure for Autopilot to determine the screen location of widgets, for full-stack testing.

This is hidden behind a --debug server option, to make it absolutely clear that applications cannot depend on this functionality outside of a constrained environment.

(See also https://lists.ubuntu.com/archives/mir-devel/2014-August/000848.html)

Fixes: https://bugs.launchpad.net/mir/+bug/1346633. Fixes: https://bugs.launchpad.net/bugs/1346633.

Approved by PS Jenkins bot, Alberto Aguirre, Alan Griffiths, Andreas Pokorny, Alexandros Frantzis.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 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: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef MIR_FRONTEND_DEFAULT_COORDINATE_TRANSLATOR_H_
 
20
#define MIR_FRONTEND_DEFAULT_COORDINATE_TRANSLATOR_H_
 
21
 
 
22
#include "mir/scene/coordinate_translator.h"
 
23
 
 
24
namespace mir
 
25
{
 
26
namespace scene
 
27
{
 
28
class DefaultCoordinateTranslator : public CoordinateTranslator
 
29
{
 
30
public:
 
31
    geometry::Point surface_to_screen(std::shared_ptr<frontend::Surface> surface, int32_t x, int32_t y);
 
32
};
 
33
 
 
34
}
 
35
}
 
36
 
 
37
#endif // MIR_FRONTEND_DEFAULT_COORDINATE_TRANSLATOR_H_