Changeset View
Changeset View
Standalone View
Standalone View
gmenu-dbusmenu-proxy/menuproxy.h
Show All 21 Lines | |||||
22 | #include <QObject> | 22 | #include <QObject> | ||
23 | #include <QByteArray> | 23 | #include <QByteArray> | ||
24 | #include <QHash> | 24 | #include <QHash> | ||
25 | #include <QWindow> // for WId | 25 | #include <QWindow> // for WId | ||
26 | 26 | | |||
27 | #include <xcb/xcb_atom.h> | 27 | #include <xcb/xcb_atom.h> | ||
28 | 28 | | |||
29 | class QDBusServiceWatcher; | 29 | class QDBusServiceWatcher; | ||
30 | class QTimer; | ||||
31 | | ||||
32 | class KDirWatch; | ||||
30 | 33 | | |||
31 | class Window; | 34 | class Window; | ||
32 | 35 | | |||
33 | class MenuProxy : public QObject | 36 | class MenuProxy : public QObject | ||
34 | { | 37 | { | ||
35 | Q_OBJECT | 38 | Q_OBJECT | ||
36 | 39 | | |||
37 | public: | 40 | public: | ||
38 | MenuProxy(); | 41 | MenuProxy(); | ||
39 | ~MenuProxy() override; | 42 | ~MenuProxy() override; | ||
40 | 43 | | |||
41 | private Q_SLOTS: | 44 | private Q_SLOTS: | ||
42 | void onWindowAdded(WId id); | 45 | void onWindowAdded(WId id); | ||
43 | void onWindowRemoved(WId id); | 46 | void onWindowRemoved(WId id); | ||
44 | 47 | | |||
45 | private: | 48 | private: | ||
46 | bool init(); | 49 | bool init(); | ||
47 | void teardown(); | 50 | void teardown(); | ||
48 | 51 | | |||
49 | void setGtkShellShowsMenuBar(bool show); | 52 | static QString gtkRc2Path(); | ||
53 | static QString gtk3SettingsIniPath(); | ||||
54 | | ||||
55 | void enableGtkSettings(bool enabled); | ||||
56 | | ||||
57 | void writeGtk2Settings(); | ||||
58 | void writeGtk3Settings(); | ||||
59 | | ||||
60 | void addOrRemoveAppMenuGtkModule(QStringList &list); | ||||
50 | 61 | | |||
51 | xcb_connection_t *m_xConnection; | 62 | xcb_connection_t *m_xConnection; | ||
52 | 63 | | |||
53 | QByteArray getWindowPropertyString(WId id, const QByteArray &name); | 64 | QByteArray getWindowPropertyString(WId id, const QByteArray &name); | ||
54 | void writeWindowProperty(WId id, const QByteArray &name, const QByteArray &value); | 65 | void writeWindowProperty(WId id, const QByteArray &name, const QByteArray &value); | ||
55 | xcb_atom_t getAtom(const QByteArray &name); | 66 | xcb_atom_t getAtom(const QByteArray &name); | ||
56 | 67 | | |||
57 | QHash<WId, Window *> m_windows; | 68 | QHash<WId, Window *> m_windows; | ||
58 | 69 | | |||
59 | QDBusServiceWatcher *m_serviceWatcher; | 70 | QDBusServiceWatcher *m_serviceWatcher; | ||
60 | 71 | | |||
72 | KDirWatch *m_gtk2RcWatch; | ||||
73 | QTimer *m_writeGtk2SettingsTimer; | ||||
74 | | ||||
75 | bool m_enabled = false; | ||||
76 | | ||||
61 | }; | 77 | }; |