Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Unified Diff: ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h

Issue 2639053002: [ozone/wayland] Implement basic keyboard handling support (Closed)
Patch Set: addressed kpschoedel's review Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/ozone/platform/wayland/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h
diff --git a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h
index a338c18da655f44148c2f4ded001145a90fc87f6..4869af535e7b1529657d0d0c6148081b1ff4e89b 100644
--- a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h
+++ b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h
@@ -72,18 +72,23 @@ class EVENTS_OZONE_LAYOUT_EXPORT XkbKeyboardLayoutEngine
xkb_keysym_t xkb_keysym,
base::char16 character) const;
+ // Sets a new XKB keymap. This updates xkb_state_ (which takes ownership
+ // of the keymap), and updates xkb_flag_map_ for the new keymap.
+ virtual void SetKeymap(xkb_keymap* keymap);
+
// Maps DomCode to xkb_keycode_t.
const XkbKeyCodeConverter& key_code_converter_;
+ // libxkbcommon uses explicit reference counting for its structures,
+ // so we need to trigger its cleanup.
+ std::unique_ptr<xkb_state, XkbStateDeleter> xkb_state_;
+
private:
struct XkbKeymapEntry {
std::string layout_name;
xkb_keymap* keymap;
};
std::vector<XkbKeymapEntry> xkb_keymaps_;
- // Sets a new XKB keymap. This updates xkb_state_ (which takes ownership
- // of the keymap), and updates xkb_flag_map_ for the new keymap.
- void SetKeymap(xkb_keymap* keymap);
// Returns the XKB modifiers flags corresponding to the given EventFlags.
xkb_mod_mask_t EventFlagsToXkbFlags(int ui_flags) const;
@@ -107,10 +112,7 @@ class EVENTS_OZONE_LAYOUT_EXPORT XkbKeyboardLayoutEngine
void OnKeymapLoaded(const std::string& layout_name,
std::unique_ptr<char, base::FreeDeleter> keymap_str);
- // libxkbcommon uses explicit reference counting for its structures,
- // so we need to trigger its cleanup.
std::unique_ptr<xkb_context, XkbContextDeleter> xkb_context_;
- std::unique_ptr<xkb_state, XkbStateDeleter> xkb_state_;
std::string current_layout_name_;
« no previous file with comments | « no previous file | ui/ozone/platform/wayland/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698