1 ////////////////////////////////////////
3 ////////////////////////////////////////
7 #define K8_MPLAYER_HACK
8 #define MPLAYER_HACK_TIMEOUT (300)
11 #include "jrugrdefs.h"
12 #include "xkeyboard.h"
15 #include "jrugrconfui.h"
17 #include <QAbstractEventDispatcher>
18 #ifdef K8_MPLAYER_HACK
26 int layout
; // language for this window
30 typedef QHash
<Window
, WinInfo
*> QWIHash
;
31 typedef QHashIterator
<Window
, WinInfo
*> QWIHashIterator
;
32 typedef QMutableHashIterator
<Window
, WinInfo
*> QWIHashMutableIterator
;
35 class Jrugr
: public QApplication
{
39 Jrugr (int &argc
, char **argv
);
47 void changeLayout (int index
);
48 void activeWindowChanged ();
49 void activeDesktopChanged ();
50 void clientListChanged ();
53 void onLayoutChanged ();
54 void onGroupChanged (int index
);
57 void trayClicked (QSystemTrayIcon::ActivationReason reason
);
63 void actionsActivate (QAction
*action
);
64 void onChangeLayout (int index
);
66 void doActiveWindowChanged ();
67 void doActiveDesktopChanged ();
68 void onClientListChanged ();
70 #ifdef K8_MPLAYER_HACK
75 virtual bool x11EventFilter (XEvent
*);
77 void mousePressEvent (QMouseEvent
*);
78 int setKeyLayout (QString keyConf
);
87 QIcon
langIcon (const QString
&lsym
, int wdt
=32, int hgt
=22, bool noFlag
=false); // get icon for language defined by it's sym ("us", etc)
89 void onActiveWindowChanged (Window w
);
90 void onActiveDesktopChanged (int desk
);
92 void installFacehuggers ();
94 bool isKnownWindow (Window w
) const;
95 bool isKnownApp (Window w
) const;
97 WinInfo
*findWindowInfo (Window w
);
98 WinInfo
*findAppInfo (Window w
); // find application info for the given window
100 int desktopLayout (int desk
) const;
101 void setDesktopLayout (int desk
, int group
);
103 Window
deskActiveWindow (int desk
);
104 void setDeskActiveWindow (int desk
, Window w
);
106 void windowDies (Window w
);
108 #ifdef K8_MPLAYER_HACK
109 bool deactivateMPlayer ();
112 int layIndex (Window w
, const QString
&propname
, bool unknownIsZero
=false) const;
115 QAbstractEventDispatcher
*mEDisp
;
117 QString mLangThemePath
;
118 QXkbLayoutList mGroupInfo
; // list of all active groups (those that can be activated)
119 int mActiveGroup
; // currently active group
122 QSystemTrayIcon
*mTrayIcon
;
127 QWIHash mKnownWindows
;
129 QList
<int> mDeskLangs
;
130 QList
<Window
> mDeskActiveWindows
;
133 Window mActiveWindow
;
135 bool mDeskJustChanged
;
137 QString mCfgFileName
;
139 #ifdef K8_MPLAYER_HACK