aboutsummaryrefslogtreecommitdiff
path: root/src/PropertyTools.hh
blob: 94445313b850b3b7909312b09f590c0c452b7453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef PROPERTY_TOOLS_H
#define PROPERTY_TOOLS_H

#include <X11/Xlib.h>
#include <string>
#include <exception>
#include <vector>

namespace PropertyTools {

class PropertyException: public std::exception {
public:
    PropertyException(const std::string &property) throw():
        m_property(property) {
    }

    ~PropertyException() throw () {
    }

    const char *what() const throw() {
        return m_property.c_str();
    }

private:
    std::string m_property;
};

/// @return Atom name.
std::string getAtomName(Atom atom);


/// @return Integer value for property \c atom
unsigned int getIntProperty(Window win, Atom atom) throw (PropertyException);
Window getWinProperty(Window win, Atom atom) throw (PropertyException);
void getWinArrayProperty(Window win, Atom atom, std::vector<Window> &cont) throw (PropertyException);
} // PropertyTools

#endif // PROPERTY_TOOL_H