Mir
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 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;
39  {
40  }
41 
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"};
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 
Definition: as_render_target.h:27
std::string options
Definition: keymap.h:53
std::ostream & operator<<(std::ostream &out, Keymap const &rhs)
Definition: keymap.h:70
std::string layout
Definition: keymap.h:51
std::string variant
Definition: keymap.h:52
std::string model
Definition: keymap.h:50
Definition: keymap.h:31
bool operator!=(Keymap const &lhs, Keymap const &rhs)
Definition: keymap.h:65
Keymap(std::string &&model, std::string &&layout, std::string &&variant, std::string &&options)
Definition: keymap.h:34
Keymap(std::string const &model, std::string const &layout, std::string const &variant, std::string const &options)
Definition: keymap.h:42
bool operator==(Keymap const &lhs, Keymap const &rhs)
Definition: keymap.h:57

Copyright © 2012-2016 Canonical Ltd.
Generated on Wed Oct 11 22:26:23 UTC 2017