/*
* Set a string property value on a window.
*/
-void XAtom::setStringValue(Window win, Atom atom, std::string &value) const {
+void XAtom::setStringValue(Window win, Atom atom,
+ const std::string &value) const {
setValue(win, atom, XA_STRING,
const_cast<unsigned char*>
(reinterpret_cast<const unsigned char*>(value.c_str())),
/*
* Add characters to a string property value on a window.
*/
-void XAtom::addStringValue(Window win, Atom atom, std::string &value) const {
+void XAtom::addStringValue(Window win, Atom atom,
+ const std::string &value) const {
setValue(win, atom, XA_STRING,
const_cast<unsigned char*>
(reinterpret_cast<const unsigned char *>
/*
* Gets an string property's value from a window.
*/
-bool XAtom::getStringValue(Window win, Atom atom, unsigned long *nelements,
- std::string &value) const {
+bool XAtom::getStringValue(Window win, Atom atom, std::string &value) const {
unsigned char *data;
- bool ret = XAtom::getValue(win, atom, XA_STRING, nelements, &data, 8);
+ unsigned long nelements;
+ bool ret = XAtom::getValue(win, atom, XA_STRING, &nelements, &data, 8);
if (ret)
value = reinterpret_cast<char*>(data);
return ret;
void setAtomValue(Window win, Atom atom, Atom value) const;
void setWindowValue(Window win, Atom atom, Window value) const;
void setPixmapValue(Window win, Atom atom, Pixmap value) const;
- void setStringValue(Window win, Atom atom, std::string &value) const;
+ void setStringValue(Window win, Atom atom, const std::string &value) const;
void addCardValue(Window win, Atom atom, long value) const; // 32-bit CARDINAL
void addAtomValue(Window win, Atom atom, Atom value) const;
void addWindowValue(Window win, Atom atom, Window value) const;
void addPixmapValue(Window win, Atom atom, Pixmap value) const;
- void addStringValue(Window win, Atom atom, std::string &value) const;
+ void addStringValue(Window win, Atom atom, const std::string &value) const;
// the 'value' is allocated inside the function and
// delete [] value needs to be called when you are done with it.
Window **value) const;
bool getPixmapValue(Window win, Atom atom, unsigned long *nelements,
Pixmap **value) const;
- bool getStringValue(Window win, Atom atom, unsigned long *nelements,
- std::string &value) const;
+ bool getStringValue(Window win, Atom atom, std::string &value) const;
void eraseValue(Window win, Atom atom) const;