From c314d05553b6105b983267a97d14429681d90ae2 Mon Sep 17 00:00:00 2001 From: rathnor Date: Thu, 12 Jun 2003 15:13:23 +0000 Subject: add some property accessors --- src/WinClient.cc | 47 ++++++++++++++++++++++++++++++++++++++++++++++- src/WinClient.hh | 5 ++++- 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.cc,v 1.10 2003/06/12 14:51:59 fluxgen Exp $ +// $Id: WinClient.cc,v 1.11 2003/06/12 15:13:23 rathnor Exp $ #include "WinClient.hh" @@ -176,6 +176,51 @@ bool WinClient::getWMIconName(XTextProperty &textprop) const { return XGetWMName(FbTk::App::instance()->display(), window(), &textprop); } +const std::string WinClient::getWMClassName() const { + XClassHint ch; + + if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) { +#ifdef DEBUG + cerr<<"Failed to read class hint!"<(ch.res_name); + XFree(ch.res_name); + } else + m_instance_name = ""; + + if (ch.res_class != 0) + XFree(ch.res_class); + + return m_instance_name; + } +} + +const std::string WinClient::getWMClassClass() const { + XClassHint ch; + + if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) { +#ifdef DEBUG + cerr<<"Failed to read class hint!"<(ch.res_class); + XFree(ch.res_class); + } else + m_class_name = ""; + return m_class_name; + } +} + void WinClient::updateTransientInfo() { if (m_win == 0) 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.hh,v 1.5 2003/05/14 12:07:05 fluxgen Exp $ +// $Id: WinClient.hh,v 1.6 2003/06/12 15:13:23 rathnor Exp $ #ifndef WINCLIENT_HH #define WINCLIENT_HH @@ -48,6 +48,9 @@ public: bool getAttrib(XWindowAttributes &attr) const; bool getWMName(XTextProperty &textprop) const; bool getWMIconName(XTextProperty &textprop) const; + const std::string getWMClassName() const; // name member of class structure + const std::string getWMClassClass() const; // class member of class structure + inline const std::string getTitle() const { return m_title; } void updateTitle(); void updateIconTitle(); BScreen &screen() { return m_screen; } -- cgit v0.11.2