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 ();
113 QAbstractEventDispatcher
*mEDisp
;
115 QString mLangThemePath
;
116 QXkbLayoutList mGroupInfo
; // list of all active groups (those that can be activated)
117 int mActiveGroup
; // currently active group
120 QSystemTrayIcon
*mTrayIcon
;
125 QWIHash mKnownWindows
;
127 QList
<int> mDeskLangs
;
128 QList
<Window
> mDeskActiveWindows
;
131 Window mActiveWindow
;
133 bool mDeskJustChanged
;
135 QString mCfgFileName
;
137 #ifdef K8_MPLAYER_HACK