| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ | 5 #ifndef UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
| 6 #define UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ | 6 #define UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <xkbcommon/xkbcommon.h> | 9 #include <xkbcommon/xkbcommon.h> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "ui/events/ozone/layout/xkb/xkb_key_code_converter.h" | 23 #include "ui/events/ozone/layout/xkb/xkb_key_code_converter.h" |
| 24 | 24 |
| 25 namespace ui { | 25 namespace ui { |
| 26 | 26 |
| 27 class EVENTS_OZONE_LAYOUT_EXPORT XkbKeyboardLayoutEngine | 27 class EVENTS_OZONE_LAYOUT_EXPORT XkbKeyboardLayoutEngine |
| 28 : public KeyboardLayoutEngine { | 28 : public KeyboardLayoutEngine { |
| 29 public: | 29 public: |
| 30 XkbKeyboardLayoutEngine(const XkbKeyCodeConverter& converter); | 30 XkbKeyboardLayoutEngine(const XkbKeyCodeConverter& converter); |
| 31 ~XkbKeyboardLayoutEngine() override; | 31 ~XkbKeyboardLayoutEngine() override; |
| 32 | 32 |
| 33 void SetKeymapFromStringForTest(const char* keymap_string); | |
| 34 | |
| 35 // KeyboardLayoutEngine: | 33 // KeyboardLayoutEngine: |
| 36 bool CanSetCurrentLayout() const override; | 34 bool CanSetCurrentLayout() const override; |
| 37 bool SetCurrentLayoutByName(const std::string& layout_name) override; | 35 bool SetCurrentLayoutByName(const std::string& layout_name) override; |
| 36 // Required by Ozone/Wayland (at least) for non ChromeOS builds. See |
| 37 // http://xkbcommon.org/doc/current/md_doc_quick-guide.html for further info. |
| 38 bool SetCurrentLayoutFromString(const std::string& keymap_string) override; |
| 38 | 39 |
| 39 bool UsesISOLevel5Shift() const override; | 40 bool UsesISOLevel5Shift() const override; |
| 40 bool UsesAltGr() const override; | 41 bool UsesAltGr() const override; |
| 41 | 42 |
| 42 bool Lookup(DomCode dom_code, | 43 bool Lookup(DomCode dom_code, |
| 43 int flags, | 44 int flags, |
| 44 DomKey* dom_key, | 45 DomKey* dom_key, |
| 45 KeyboardCode* key_code) const override; | 46 KeyboardCode* key_code) const override; |
| 46 | 47 |
| 47 static void ParseLayoutName(const std::string& layout_name, | 48 static void ParseLayoutName(const std::string& layout_name, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 113 |
| 113 std::string current_layout_name_; | 114 std::string current_layout_name_; |
| 114 | 115 |
| 115 // Support weak pointers for attach & detach callbacks. | 116 // Support weak pointers for attach & detach callbacks. |
| 116 base::WeakPtrFactory<XkbKeyboardLayoutEngine> weak_ptr_factory_; | 117 base::WeakPtrFactory<XkbKeyboardLayoutEngine> weak_ptr_factory_; |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 } // namespace ui | 120 } // namespace ui |
| 120 | 121 |
| 121 #endif // UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ | 122 #endif // UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
| OLD | NEW |