/* * Interface for a class to get keyboard layout information and change layouts * * Copyright (C) 2008 by Jay Bromley * * This file is part of Xkb-switch. * Xkb-switch is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Xkb-switch is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Xkb-switch. If not, see . */ #ifndef XKEYBOARD_H #define XKEYBOARD_H #include #include #include #include #include #include #include #include using std::string; namespace kb { typedef std::vector string_vector; class XKeyboard { public: Display* _display; int _deviceId; XkbDescRec* _kbdDescPtr; XKeyboard(); ~XKeyboard(); // Opens display (or throw std::runtime_error) void open_display(void); // Gets the current layout int get_group() const; // Sets the layout void set_group(int num); // Returns keyboard layout string void build_layout(string_vector& vec); // Waits for kb event void wait_event(); private: }; } #endif