Mir
window_id.h
Go to the documentation of this file.
1/*
2 * Copyright © 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 2 or 3 as
6 * 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: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#ifndef MIR_CLIENT_WINDOW_ID_H
20#define MIR_CLIENT_WINDOW_ID_H
21
24
25#include <memory>
26
27namespace mir
28{
29namespace client
30{
33{
34public:
35 explicit WindowId(MirWindowId* id) : self{id, deleter} {}
36
38
39 auto c_str() const -> char const* { return mir_window_id_as_string(self.get()); }
40
41private:
42 static void deleter(MirWindowId* id) { mir_window_id_release(id); }
43 std::shared_ptr<MirWindowId> self;
44};
45}
46}
47
48#endif //MIR_CLIENT_WINDOW_ID_H
Handle class for MirWindowId - provides automatic reference counting.
Definition: window_id.h:33
WindowId(MirWindow *window)
Definition: window_id.h:37
auto c_str() const -> char const *
Definition: window_id.h:39
WindowId(MirWindowId *id)
Definition: window_id.h:35
struct MirPersistentId MirWindowId
Definition: client_types.h:51
char const * mir_window_id_as_string(MirWindowId *id)
Get a string representation of a MirSurfaceId.
MirWindowId * mir_window_request_window_id_sync(MirWindow *window)
struct MirSurface MirWindow
Definition: client_types.h:43
void mir_window_id_release(MirWindowId *id)
Free a MirWindowId.
Definition: splash_session.h:24

Copyright © 2012-2022 Canonical Ltd.
Generated on Wed Dec 28 21:01:08 UTC 2022
This documentation is licensed under the GPL version 2 or 3.