X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FXAtom.h;h=9e6a6aedda8cbfc6809c42854fd87977baadb6e6;hb=a85c9a7c6e88d94a833941d3efc368cf11243579;hp=92291f698ea208981ae443b08e8f1d4856a7d613;hpb=cc7cb82debabb98b6cca375f53fe29da7ae4fad4;p=chaz%2Fopenbox diff --git a/src/XAtom.h b/src/XAtom.h index 92291f69..9e6a6aed 100644 --- a/src/XAtom.h +++ b/src/XAtom.h @@ -22,11 +22,14 @@ #ifndef __XAtom_h #define __XAtom_h +#include "../config.h" + #include #include #include -class XDisplay; +class Openbox; +class ScreenInfo; class XAtom { typedef std::vector SupportWindows; @@ -36,6 +39,10 @@ class XAtom { SupportWindows _support_windows; Atom +#ifdef HAVE_GETPID + openbox_pid, +#endif // HAVE_GETPID + // window hints wm_colormap_windows, wm_protocols, @@ -46,7 +53,7 @@ class XAtom { motif_wm_hints, openbox_attributes, openbox_change_attributes, - openbox_hints; + openbox_hints, // blackbox-protocol atoms (wm -> client) openbox_structure_messages, @@ -57,7 +64,7 @@ class XAtom { openbox_notify_current_workspace, openbox_notify_workspace_count, openbox_notify_window_raise, - openbox_notify_window_lower; + openbox_notify_window_lower, // blackbox-protocol atoms (client -> wm) openbox_change_workspace, openbox_change_window_focus, @@ -95,10 +102,10 @@ class XAtom { net_wm_ping; Atom getAtom(const char *name) const; - void setSupported(const XScreen *screen) const; + void setSupported(const ScreenInfo *screen); - void setValue(Window win, Atom atom, Atom type, unsigned char *data, int size, - int nelements, bool append); + void setValue(Window win, Atom atom, Atom type, unsigned char *data, + int size, int nelements, bool append) const; bool getValue(Window win, Atom atom, Atom type, unsigned long *nelements, unsigned char **value, int size) const; @@ -107,38 +114,42 @@ class XAtom { XAtom& operator=(const XAtom&); public: - XAtom(XDisplay *display); + XAtom(Openbox &ob); virtual ~XAtom(); - void setValue(Window win, Atom atom, long value) const; // a 32-bit CARDINAL - void setValue(Window win, Atom atom, Atom value) const; - void setValue(Window win, Atom atom, Window value) const; - void setValue(Window win, Atom atom, Pixmap value) const; - void setValue(Window win, Atom atom, std::string &value) const; + void setCardValue(Window win, Atom atom, long value) const; // 32-bit CARDINAL + 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 addValue(Window win, Atom atom, long value) const; // a 32-bit CARDINAL - void addValue(Window win, Atom atom, Atom value) const; - void addValue(Window win, Atom atom, Window value) const; - void addValue(Window win, Atom atom, Pixmap value) const; - void addValue(Window win, Atom atom, 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; // the 'value' is allocated inside the function and // delete [] value needs to be called when you are done with it. // teh 'value' array returned is null terminated, and has 'nelements' // elements in it plus the null. - bool getValue(Window win, Atom atom, unsigned long *nelements, - long **value) const; // a 32-bit CARDINAL - bool getValue(Window win, Atom atom, unsigned long *nelements, + bool getCardValue(Window win, Atom atom, unsigned long *nelements, + long **value) const; // 32-bit CARDINAL + bool getAtomValue(Window win, Atom atom, unsigned long *nelements, Atom **value) const; - bool getValue(Window win, Atom atom, unsigned long *nelements, + bool getWindowValue(Window win, Atom atom, unsigned long *nelements, Window **value) const; - bool getValue(Window win, Atom atom, unsigned long *nelements, + bool getPixmapValue(Window win, Atom atom, unsigned long *nelements, Pixmap **value) const; - bool getValue(Window win, Atom atom, unsigned long *nelements, + bool getStringValue(Window win, Atom atom, unsigned long *nelements, std::string &value) const; void eraseValue(Window win, Atom atom) const; +#ifdef HAVE_GETPID + inline Atom openboxPid() const { return openbox_pid; } +#endif // HAVE_GETPID + inline Atom wmChangeState() const { return wm_change_state; } inline Atom wmState() const { return wm_state; } inline Atom wmDelete() const { return wm_delete_window; }