using property and changeProperty
fluxgen fluxgen
3 files changed,
49 insertions(+),
64 deletions(-)
M
src/Ewmh.cc
→
src/Ewmh.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.25 2003/05/15 12:00:42 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.26 2003/05/19 22:40:16 fluxgen Exp $ #include "Ewmh.hh"@@ -56,8 +56,8 @@
if (wincheck != None) { m_windows.push_back(wincheck); - XChangeProperty(disp, screen.rootWindow().window(), m_net_supporting_wm_check, XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wincheck, 1); + screen.rootWindow().changeProperty(m_net_supporting_wm_check, XA_WINDOW, 32, + PropModeReplace, (unsigned char *) &wincheck, 1); XChangeProperty(disp, wincheck, m_net_supporting_wm_check, XA_WINDOW, 32, PropModeReplace, (unsigned char *) &wincheck, 1);@@ -86,18 +86,16 @@ m_net_desktop_names,
m_net_supporting_wm_check }; - XChangeProperty(disp, screen.rootWindow().window(), - m_net_supported, XA_ATOM, 32, - PropModeReplace, - (unsigned char *) &atomsupported, - (sizeof atomsupported)/sizeof atomsupported[0]); + screen.rootWindow().changeProperty(m_net_supported, XA_ATOM, 32, + PropModeReplace, + (unsigned char *) &atomsupported, + (sizeof atomsupported)/sizeof atomsupported[0]); } void Ewmh::setupWindow(FluxboxWindow &win) { - Display *disp = FbTk::App::instance()->display(); Atom ret_type; int fmt; unsigned long nitems, bytes_after;@@ -112,10 +110,9 @@ setState(win, flags);
XFree(data); } */ - if (XGetWindowProperty(disp, win.clientWindow(), - m_net_wm_desktop, 0, 1, False, XA_CARDINAL, - &ret_type, &fmt, &nitems, &bytes_after, - (unsigned char **) &data) == Success && data) { + if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL, + &ret_type, &fmt, &nitems, &bytes_after, + (unsigned char **) &data) && data) { unsigned int desktop = static_cast<unsigned int>(*data); if (desktop == 0xFFFFFFFF && !win.isStuck()) win.stick();@@ -192,11 +189,9 @@ }
//number of windows to show in client list num = win; - XChangeProperty(FbTk::App::instance()->display(), - screen.rootWindow().window(), - m_net_client_list, - XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)wl, num); + screen.rootWindow().changeProperty(m_net_client_list, + XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)wl, num); delete [] wl; }@@ -224,18 +219,15 @@ }
void Ewmh::updateCurrentWorkspace(BScreen &screen) { size_t workspace = screen.currentWorkspaceID(); - XChangeProperty(FbTk::App::instance()->display(), - screen.rootWindow().window(), - m_net_current_desktop, XA_CARDINAL, 32, PropModeReplace, - (unsigned char *)&workspace, 1); + screen.rootWindow().changeProperty(m_net_current_desktop, XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&workspace, 1); } void Ewmh::updateWorkspaceCount(BScreen &screen) { size_t numworkspaces = screen.getCount(); - XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), - m_net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, - (unsigned char *)&numworkspaces, 1); + screen.rootWindow().changeProperty(m_net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&numworkspaces, 1); } void Ewmh::updateState(FluxboxWindow &win) {
M
src/Gnome.cc
→
src/Gnome.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Gnome.cc,v 1.24 2003/05/15 12:00:42 fluxgen Exp $ +// $Id: Gnome.cc,v 1.25 2003/05/19 22:40:40 fluxgen Exp $ #include "Gnome.hh"@@ -53,9 +53,9 @@ // create the GNOME window
Window gnome_win = XCreateSimpleWindow(disp, screen.rootWindow().window(), 0, 0, 5, 5, 0, 0, 0); // supported WM check - XChangeProperty(disp, screen.rootWindow().window(), - m_gnome_wm_supporting_wm_check, - XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); + screen.rootWindow().changeProperty(m_gnome_wm_supporting_wm_check, + XA_CARDINAL, 32, + PropModeReplace, (unsigned char *) &gnome_win, 1); XChangeProperty(disp, gnome_win, m_gnome_wm_supporting_wm_check,@@ -71,9 +71,10 @@ m_gnome_wm_win_layer
}; //list atoms that we support - XChangeProperty(disp, screen.rootWindow().window(), - m_gnome_wm_prot, XA_ATOM, 32, PropModeReplace, - (unsigned char *)gnomeatomlist, (sizeof gnomeatomlist)/sizeof gnomeatomlist[0]); + screen.rootWindow().changeProperty(m_gnome_wm_prot, + XA_ATOM, 32, PropModeReplace, + (unsigned char *)gnomeatomlist, + (sizeof gnomeatomlist)/sizeof gnomeatomlist[0]); m_gnomewindows.push_back(gnome_win);@@ -92,10 +93,9 @@ int fmt;
unsigned long nitems, bytes_after; long flags, *data = 0; - if (XGetWindowProperty(disp, win.clientWindow(), - m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL, - &ret_type, &fmt, &nitems, &bytes_after, - (unsigned char **) &data) == Success && data) { + if (win.winClient().property(m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL, + &ret_type, &fmt, &nitems, &bytes_after, + (unsigned char **) &data) && data) { flags = *data; setState(&win, flags); XFree (data);@@ -172,11 +172,9 @@ }
} //number of windows to show in client list num = win; - XChangeProperty(FbTk::App::instance()->display(), - screen.rootWindow().window(), - m_gnome_wm_win_client_list, - XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)wl, num); + screen.rootWindow().changeProperty(m_gnome_wm_win_client_list, + XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)wl, num); delete[] wl; }@@ -206,19 +204,16 @@ }
void Gnome::updateCurrentWorkspace(BScreen &screen) { int workspace = screen.currentWorkspaceID(); - XChangeProperty(FbTk::App::instance()->display(), - screen.rootWindow().window(), - m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace, - (unsigned char *)&workspace, 1); + screen.rootWindow().changeProperty(m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&workspace, 1); updateClientList(screen); // make sure the client list is updated too } void Gnome::updateWorkspaceCount(BScreen &screen) { int numworkspaces = screen.getCount(); - XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), - m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace, - (unsigned char *)&numworkspaces, 1); + screen.rootWindow().changeProperty(m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&numworkspaces, 1); } void Gnome::updateWorkspace(FluxboxWindow &win) {@@ -227,9 +222,9 @@ #ifdef DEBUG
cerr<<__FILE__<<"("<<__LINE__<<"): setting workspace("<<val<< ") for window("<<&win<<")"<<endl; #endif // DEBUG - XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(), - m_gnome_wm_win_workspace, - XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); + win.winClient().changeProperty(m_gnome_wm_win_workspace, + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&val, 1); } void Gnome::updateState(FluxboxWindow &win) {@@ -242,18 +237,18 @@ state |= WIN_STATE_MINIMIZED;
if (win.isShaded()) state |= WIN_STATE_SHADED; - XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(), - m_gnome_wm_win_state, - XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); + win.winClient().changeProperty(m_gnome_wm_win_state, + XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&state, 1); } void Gnome::updateLayer(FluxboxWindow &win) { //TODO - map from flux layers to gnome ones // our layers are in the opposite direction to GNOME int layernum = Fluxbox::instance()->getDesktopLayer() - win.layerNum(); - XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(), - m_gnome_wm_win_layer, - XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&layernum, 1); + win.winClient().changeProperty(m_gnome_wm_win_layer, + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&layernum, 1); }
M
src/Window.cc
→
src/Window.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.181 2003/05/19 15:39:06 rathnor Exp $ +// $Id: Window.cc,v 1.182 2003/05/19 22:43:48 fluxgen Exp $ #include "Window.hh"@@ -1023,8 +1023,7 @@ int format;
Atom atom_return; unsigned long num, len; Atom motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False); - if (!XGetWindowProperty(display, m_client->window(), - motif_wm_hints, 0, + if (!m_client->property(motif_wm_hints, 0, PropMwmHintsElements, false, motif_wm_hints, &atom_return, &format, &num, &len,@@ -1835,12 +1834,11 @@ unsigned long ulfoo, nitems;
FbAtoms *fbatoms = FbAtoms::instance(); BlackboxAttributes *net; - if (XGetWindowProperty(display, m_client->window(), - fbatoms->getFluxboxAttributesAtom(), 0l, + if (m_client->property(fbatoms->getFluxboxAttributesAtom(), 0l, PropBlackboxAttributesElements, false, fbatoms->getFluxboxAttributesAtom(), &atom_return, &foo, - &nitems, &ulfoo, (unsigned char **) &net) == - Success && net && nitems == (unsigned)PropBlackboxAttributesElements) { + &nitems, &ulfoo, (unsigned char **) &net) && + net && nitems == (unsigned)PropBlackboxAttributesElements) { m_blackbox_attrib.flags = net->flags; m_blackbox_attrib.attrib = net->attrib; m_blackbox_attrib.workspace = net->workspace;