~mir-team/mir/development-branch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * Copyright © 2014 Canonical Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 2 or 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
 */

#include "mir_toolkit/debug/surface.h"

#include "mir_surface.h"
#include "mir/mir_buffer_stream.h"

int mir_debug_window_id(MirWindow* window)
{
    return window->id();
}

uint32_t mir_debug_window_current_buffer_id(MirWindow* window)
{
    return window->get_buffer_stream()->get_current_buffer_id();
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

bool mir_debug_surface_coords_to_screen(MirSurface* surface,
                                       int x, int y,
                                       int* screen_x, int* screen_y)
{
    return surface->translate_to_screen_coordinates(x, y, screen_x, screen_y);
}

uint32_t mir_debug_surface_current_buffer_id(MirSurface* surface)
{
    return mir_debug_window_current_buffer_id(surface);
}

int mir_debug_surface_id(MirSurface* surface)
{
    return mir_debug_window_id(surface);
}

#pragma GCC diagnostic pop