X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Fproperty.cc;h=bda4ecea2ad6dc3a06383a2be4236574f2f9101b;hb=8b0daa912e72085994cfd804a60ba4113ba27148;hp=232803cdd053b8e824ac8d8ca32ec5f6c860ab28;hpb=4947902d269213edee40f3f31f97721fa0dd3877;p=chaz%2Fopenbox diff --git a/otk/property.cc b/otk/property.cc index 232803cd..bda4ecea 100644 --- a/otk/property.cc +++ b/otk/property.cc @@ -17,7 +17,7 @@ namespace otk { Property::Property() { - assert(Display::display); + assert(**display); // make sure asserts fire if there is a problem memset(_atoms, 0, sizeof(_atoms)); @@ -163,7 +163,7 @@ Property::~Property() */ Atom Property::create(const char *name) const { - Atom a = XInternAtom(Display::display, name, False); + Atom a = XInternAtom(**display, name, False); assert(a); return a; } @@ -181,7 +181,7 @@ void Property::set(Window win, Atom atom, Atom type, assert(win != None); assert(atom != None); assert(type != None); assert(nelements == 0 || (nelements > 0 && data != (unsigned char *) 0)); assert(size == 8 || size == 16 || size == 32); - XChangeProperty(Display::display, win, atom, type, size, + XChangeProperty(**display, win, atom, type, size, (append ? PropModeAppend : PropModeReplace), data, nelements); } @@ -253,6 +253,7 @@ void Property::set(Window win, Atoms atom, StringType type, } ustring value; + value.setUtf8(u); StringVect::const_iterator it = strings.begin(); const StringVect::const_iterator end = strings.end(); @@ -291,7 +292,7 @@ bool Property::get(Window win, Atom atom, Atom type, bool ret = False; // try get the first element - result = XGetWindowProperty(Display::display, win, atom, 0l, 1l, + result = XGetWindowProperty(**display, win, atom, 0l, 1l, False, AnyPropertyType, &ret_type, &ret_size, nelements, &ret_bytes, &c_val); ret = (result == Success && ret_type == type && ret_size == size && @@ -309,7 +310,7 @@ bool Property::get(Window win, Atom atom, Atom type, int remain = (ret_bytes - 1)/sizeof(long) + 1 + 1; if (remain > size/8 * (signed)maxread) // dont get more than the max remain = size/8 * (signed)maxread; - result = XGetWindowProperty(Display::display, win, atom, 0l, + result = XGetWindowProperty(**display, win, atom, 0l, remain, False, type, &ret_type, &ret_size, nelements, &ret_bytes, &c_val); ret = (result == Success && ret_type == type && ret_size == size && @@ -382,7 +383,7 @@ bool Property::get(Window win, Atoms atom, StringType type, bool Property::get(Window win, Atoms atom, StringType type, - unsigned long *nelements, StringVect *strings) const + unsigned long *nelements, StringVect *strings) const { assert(atom >= 0 && atom < NUM_ATOMS); assert(type >= 0 && type < NUM_STRING_TYPE); @@ -430,7 +431,7 @@ bool Property::get(Window win, Atoms atom, StringType type, void Property::erase(Window win, Atoms atom) const { assert(atom >= 0 && atom < NUM_ATOMS); - XDeleteProperty(Display::display, win, _atoms[atom]); + XDeleteProperty(**display, win, _atoms[atom]); } }