aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-06-12 15:13:23 (GMT)
committerrathnor <rathnor>2003-06-12 15:13:23 (GMT)
commitc314d05553b6105b983267a97d14429681d90ae2 (patch)
tree835ddfee957a6cc1a939a8dfd4cc2be4ea282263
parente139cbb0283f7480fc26c58dc3f8a48e69011eab (diff)
downloadfluxbox-c314d05553b6105b983267a97d14429681d90ae2.zip
fluxbox-c314d05553b6105b983267a97d14429681d90ae2.tar.bz2
add some property accessors
-rw-r--r--src/WinClient.cc47
-rw-r--r--src/WinClient.hh5
2 files changed, 50 insertions, 2 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index 1349b1e..f44edc3 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.cc,v 1.10 2003/06/12 14:51:59 fluxgen Exp $ 22// $Id: WinClient.cc,v 1.11 2003/06/12 15:13:23 rathnor Exp $
23 23
24#include "WinClient.hh" 24#include "WinClient.hh"
25 25
@@ -176,6 +176,51 @@ bool WinClient::getWMIconName(XTextProperty &textprop) const {
176 return XGetWMName(FbTk::App::instance()->display(), window(), &textprop); 176 return XGetWMName(FbTk::App::instance()->display(), window(), &textprop);
177} 177}
178 178
179const std::string WinClient::getWMClassName() const {
180 XClassHint ch;
181
182 if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) {
183#ifdef DEBUG
184 cerr<<"Failed to read class hint!"<<endl;
185#endif //DEBUG
186 return "";
187 } else {
188 string m_instance_name;
189 if (ch.res_name != 0) {
190 m_instance_name = const_cast<char *>(ch.res_name);
191 XFree(ch.res_name);
192 } else
193 m_instance_name = "";
194
195 if (ch.res_class != 0)
196 XFree(ch.res_class);
197
198 return m_instance_name;
199 }
200}
201
202const std::string WinClient::getWMClassClass() const {
203 XClassHint ch;
204
205 if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) {
206#ifdef DEBUG
207 cerr<<"Failed to read class hint!"<<endl;
208#endif //DEBUG
209 return "";
210 } else {
211 string m_class_name;
212 if (ch.res_name != 0)
213 XFree(ch.res_name);
214
215 if (ch.res_class != 0) {
216 m_class_name = const_cast<char *>(ch.res_class);
217 XFree(ch.res_class);
218 } else
219 m_class_name = "";
220 return m_class_name;
221 }
222}
223
179void WinClient::updateTransientInfo() { 224void WinClient::updateTransientInfo() {
180 if (m_win == 0) 225 if (m_win == 0)
181 return; 226 return;
diff --git a/src/WinClient.hh b/src/WinClient.hh
index 4d69ee6..ebf542d 100644
--- a/src/WinClient.hh
+++ b/src/WinClient.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.hh,v 1.5 2003/05/14 12:07:05 fluxgen Exp $ 22// $Id: WinClient.hh,v 1.6 2003/06/12 15:13:23 rathnor Exp $
23 23
24#ifndef WINCLIENT_HH 24#ifndef WINCLIENT_HH
25#define WINCLIENT_HH 25#define WINCLIENT_HH
@@ -48,6 +48,9 @@ public:
48 bool getAttrib(XWindowAttributes &attr) const; 48 bool getAttrib(XWindowAttributes &attr) const;
49 bool getWMName(XTextProperty &textprop) const; 49 bool getWMName(XTextProperty &textprop) const;
50 bool getWMIconName(XTextProperty &textprop) const; 50 bool getWMIconName(XTextProperty &textprop) const;
51 const std::string getWMClassName() const; // name member of class structure
52 const std::string getWMClassClass() const; // class member of class structure
53 inline const std::string getTitle() const { return m_title; }
51 void updateTitle(); 54 void updateTitle();
52 void updateIconTitle(); 55 void updateIconTitle();
53 BScreen &screen() { return m_screen; } 56 BScreen &screen() { return m_screen; }