summaryrefslogtreecommitdiff
path: root/src/WinClient.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/WinClient.hh')
-rw-r--r--src/WinClient.hh53
1 files changed, 7 insertions, 46 deletions
diff --git a/src/WinClient.hh b/src/WinClient.hh
index deb98b9..4a5cf27 100644
--- a/src/WinClient.hh
+++ b/src/WinClient.hh
@@ -24,6 +24,7 @@
24#ifndef WINCLIENT_HH 24#ifndef WINCLIENT_HH
25#define WINCLIENT_HH 25#define WINCLIENT_HH
26 26
27#include "Focusable.hh"
27#include "Window.hh" 28#include "Window.hh"
28#include "Subject.hh" 29#include "Subject.hh"
29#include "FbWindow.hh" 30#include "FbWindow.hh"
@@ -35,7 +36,7 @@ class BScreen;
35class Strut; 36class Strut;
36 37
37/// Holds client window info 38/// Holds client window info
38class WinClient:public FbTk::FbWindow { 39class WinClient: public Focusable, public FbTk::FbWindow {
39public: 40public:
40 typedef std::list<WinClient *> TransientList; 41 typedef std::list<WinClient *> TransientList;
41 // this structure only contains 3 elements... the Motif 2.0 structure contains 42 // this structure only contains 3 elements... the Motif 2.0 structure contains
@@ -69,7 +70,6 @@ public:
69 /// updates transient window information 70 /// updates transient window information
70 void updateTransientInfo(); 71 void updateTransientInfo();
71 72
72 void updateBlackboxHints();
73 void updateMWMHints(); 73 void updateMWMHints();
74 void updateWMHints(); 74 void updateWMHints();
75 void updateWMNormalHints(); 75 void updateWMNormalHints();
@@ -78,6 +78,9 @@ public:
78 void clearStrut(); 78 void clearStrut();
79 79
80 bool focus(); // calls Window->setCurrentClient to give focus to this client 80 bool focus(); // calls Window->setCurrentClient to give focus to this client
81 bool isFocused() const;
82 void setAttentionState(bool value);
83 const std::string &title() const;
81 84
82 /** 85 /**
83 * Changes width and height to the nearest (lower) value 86 * Changes width and height to the nearest (lower) value
@@ -106,17 +109,7 @@ public:
106 bool getAttrib(XWindowAttributes &attr) const; 109 bool getAttrib(XWindowAttributes &attr) const;
107 bool getWMName(XTextProperty &textprop) const; 110 bool getWMName(XTextProperty &textprop) const;
108 bool getWMIconName(XTextProperty &textprop) const; 111 bool getWMIconName(XTextProperty &textprop) const;
109 /// @return name member of class structure 112 std::string getWMRole() const;
110 const std::string &getWMClassName() const;
111 /// @return class member of class structure
112 const std::string &getWMClassClass() const;
113
114 BScreen &screen() { return m_screen; }
115 const BScreen &screen() const { return m_screen; }
116 /// notifies when this client dies
117 FbTk::Subject &dieSig() { return m_diesig; }
118 /// notifies when this client becomes focused
119 FbTk::Subject &focusSig() { return m_focussig; }
120 113
121 inline WinClient *transientFor() { return transient_for; } 114 inline WinClient *transientFor() { return transient_for; }
122 inline const WinClient *transientFor() const { return transient_for; } 115 inline const WinClient *transientFor() const { return transient_for; }
@@ -128,15 +121,6 @@ public:
128 inline bool isStateModal() const { return m_modal; } 121 inline bool isStateModal() const { return m_modal; }
129 void setStateModal(bool state); 122 void setStateModal(bool state);
130 123
131 const FbTk::FbPixmap &iconPixmap() const { return m_icon_pixmap; }
132 const FbTk::FbPixmap &iconMask() const { return m_icon_mask; }
133 const bool usePixmap() const { return m_icon_pixmap.drawable() != None; }
134 const bool useMask() const { return m_icon_mask.drawable() != None; }
135
136 inline const std::string &title() const { return m_title; }
137 inline const std::string &iconTitle() const { return m_icon_title; }
138 inline const FluxboxWindow *fbwindow() const { return m_win; }
139 inline FluxboxWindow *fbwindow() { return m_win; }
140 inline int gravity() const { return m_win_gravity; } 124 inline int gravity() const { return m_win_gravity; }
141 125
142 bool hasGroupLeftWindow() const; 126 bool hasGroupLeftWindow() const;
@@ -144,14 +128,11 @@ public:
144 Window getGroupLeftWindow() const; 128 Window getGroupLeftWindow() const;
145 129
146 inline int getFocusMode() const { return m_focus_mode; } 130 inline int getFocusMode() const { return m_focus_mode; }
147 inline const FluxboxWindow::BlackboxHints *getBlackboxHint() const { return m_blackbox_hint; }
148 inline const MwmHints *getMwmHint() const { return m_mwm_hint; } 131 inline const MwmHints *getMwmHint() const { return m_mwm_hint; }
149 132
150 inline unsigned int maxWidth() const { return max_width; } 133 inline unsigned int maxWidth() const { return max_width; }
151 inline unsigned int maxHeight() const { return max_height; } 134 inline unsigned int maxHeight() const { return max_height; }
152 135
153
154 static const int PropBlackboxHintsElements = 5;
155 static const int PropMwmHintsElements = 3; 136 static const int PropMwmHintsElements = 3;
156 137
157 /** 138 /**
@@ -172,15 +153,6 @@ public:
172 unsigned long initial_state, normal_hint_flags, wm_hint_flags; 153 unsigned long initial_state, normal_hint_flags, wm_hint_flags;
173 154
174 155
175
176 class WinClientSubj: public FbTk::Subject {
177 public:
178 explicit WinClientSubj(WinClient &client):m_winclient(client) { }
179 WinClient &winClient() { return m_winclient; }
180 private:
181 WinClient &m_winclient;
182 };
183
184 enum FocusMode { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE }; 156 enum FocusMode { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE };
185 157
186private: 158private:
@@ -192,8 +164,6 @@ private:
192 // some transient (or us) is no longer modal 164 // some transient (or us) is no longer modal
193 void removeModal() { --m_modal_count; } 165 void removeModal() { --m_modal_count; }
194 166
195 FluxboxWindow *m_win;
196
197 // number of transients which we are modal for 167 // number of transients which we are modal for
198 int m_modal_count; 168 int m_modal_count;
199 bool m_modal; 169 bool m_modal;
@@ -201,22 +171,13 @@ private:
201 171
202 int m_win_gravity; 172 int m_win_gravity;
203 173
204 std::string m_title, m_icon_title; 174 std::string m_icon_title;
205 std::string m_class_name, m_instance_name;
206 bool m_title_override, m_icon_title_override; 175 bool m_title_override, m_icon_title_override;
207 176
208 FbTk::FbPixmap m_icon_pixmap;
209 FbTk::FbPixmap m_icon_mask;
210
211 FluxboxWindow::BlackboxHints *m_blackbox_hint;
212 MwmHints *m_mwm_hint; 177 MwmHints *m_mwm_hint;
213 178
214 int m_focus_mode; 179 int m_focus_mode;
215 180
216 WinClientSubj m_diesig;
217 WinClientSubj m_focussig;
218 BScreen &m_screen;
219
220 Strut *m_strut; 181 Strut *m_strut;
221 // map transient_for X window to winclient transient 182 // map transient_for X window to winclient transient
222 // (used if transient_for FbWindow was created after transient) 183 // (used if transient_for FbWindow was created after transient)