storing layouts in window properties and restoring when Jrugr restarted
[jrugr.git] / src / xkeyboard.h
blob7d98ab1c9ef669da99f518808f521d61b58f2c51
1 /*************************************************************************
2 * based on xkeyboard.h by Leonid Zeitlin (lz@europe.com) *
3 * heavily modified by Ketmar // Vampire Avalon *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 *************************************************************************/
11 #ifndef JRUGRXKEYBOARD_H
12 #define JRUGRXKEYBOARD_H
14 #include "jrugrdefs.h"
17 typedef struct {
18 QString name;
19 QString sym;
20 } XkbLayoutInfo;
23 typedef QList<XkbLayoutInfo> QXkbLayoutList;
26 class XKeyboard : public QObject {
27 Q_OBJECT
28 public:
29 XKeyboard ();
30 ~XKeyboard ();
32 inline bool isXKBAvailable () { return mXKbAvailable; } // is XKEYBOARD extension available in the X server?
34 int groupCount (); // return number of the currently configured keyboard groups
35 void groupNames (QStringList &list); // get the names of the currently configured keyboard groups
36 void symbolNames (QStringList &list); // get the 'short' names of the currently configured keyboard groups
38 void groupInfo (QXkbLayoutList &list);
40 void setActiveGroup (int groupno); // set the current keyboard group to the given groupno
41 int activeGroup (); // return the current keyboard group index
43 void processEvent (XEvent *ev);
45 static int findBySym (const QXkbLayoutList &lst, const QString &sym);
47 signals:
48 void groupChanged (int groupno); // signals that new keyboard group is selected
49 void layoutChanged (); // signals that keyboard layout has changed and thus we need to reconfigure
51 private:
52 int mEventCode;
53 bool mXKbAvailable;
57 #endif