Mir
include
common
mir
input
keymap.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 it
5
* under the terms of the GNU Lesser General Public License version 2 or 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 Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by:
17
* Andreas Pokorny <andreas.pokorny@canonical.com>
18
*/
19
20
#ifndef MIR_INPUT_KEYMAP_H_
21
#define MIR_INPUT_KEYMAP_H_
22
23
#include <string>
24
#include <ostream>
25
26
namespace
mir
27
{
28
namespace
input
29
{
30
31
struct
Keymap
32
{
33
Keymap
() =
default
;
34
Keymap
(std::string&&
model
,
35
std::string&&
layout
,
36
std::string&&
variant
,
37
std::string&&
options
)
38
:
model
{
model
},
layout
{
layout
},
variant
{
variant
},
options
{
options
}
39
{
40
}
41
42
Keymap
(std::string
const
&
model
,
43
std::string
const
&
layout
,
44
std::string
const
&
variant
,
45
std::string
const
&
options
)
46
: model{model},
layout
{
layout
},
variant
{
variant
},
options
{
options
}
47
{
48
}
49
50
std::string
model
{
"pc105+inet"
};
51
std::string
layout
{
"us"
};
52
std::string
variant
;
53
std::string
options
;
54
55
};
56
57
inline
bool
operator==
(
Keymap
const
& lhs,
Keymap
const
& rhs)
58
{
59
return
lhs.
model
== rhs.
model
&&
60
lhs.
layout
== rhs.
layout
&&
61
lhs.
variant
== rhs.
variant
&&
62
lhs.
options
== rhs.
options
;
63
}
64
65
inline
bool
operator!=
(
Keymap
const
& lhs,
Keymap
const
& rhs)
66
{
67
return
!(lhs == rhs);
68
}
69
70
inline
std::ostream&
operator<<
(std::ostream &out,
Keymap
const
& rhs)
71
{
72
return
out << rhs.
model
<<
"-"
<< rhs.
layout
<<
"-"
<< rhs.
variant
<<
"-"
<< rhs.
options
;
73
}
74
75
}
76
}
77
78
#endif
79
mir
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition:
blob.h:26
mir::input::Keymap::options
std::string options
Definition:
keymap.h:53
mir::input::operator<<
std::ostream & operator<<(std::ostream &out, Keymap const &rhs)
Definition:
keymap.h:70
mir::input::Keymap::Keymap
Keymap()=default
mir::input::Keymap::layout
std::string layout
Definition:
keymap.h:51
mir::input::Keymap::variant
std::string variant
Definition:
keymap.h:52
mir::input::Keymap::model
std::string model
Definition:
keymap.h:50
mir::input::Keymap
Definition:
keymap.h:31
mir::input::operator!=
bool operator!=(Keymap const &lhs, Keymap const &rhs)
Definition:
keymap.h:65
mir::input::Keymap::Keymap
Keymap(std::string &&model, std::string &&layout, std::string &&variant, std::string &&options)
Definition:
keymap.h:34
mir::input::Keymap::Keymap
Keymap(std::string const &model, std::string const &layout, std::string const &variant, std::string const &options)
Definition:
keymap.h:42
mir::input::operator==
bool operator==(Keymap const &lhs, Keymap const &rhs)
Definition:
keymap.h:57
Copyright © 2012-2018 Canonical Ltd.
Generated on Thu Apr 5 15:26:05 UTC 2018