From 3027bf1341cf3ac82889846ceeb1e9cf7f955502 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 19 May 2003 22:38:55 +0000 Subject: property and changeProperty --- src/FbTk/FbWindow.cc | 33 ++++++++++++++++++++++++++++++++- src/FbTk/FbWindow.hh | 18 +++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index ed97ecc..722b414 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWindow.cc,v 1.19 2003/05/19 08:27:49 rathnor Exp $ +// $Id: FbWindow.cc,v 1.20 2003/05/19 22:38:55 fluxgen Exp $ #include "FbWindow.hh" #include "EventManager.hh" @@ -188,6 +188,37 @@ void FbWindow::unsetCursor() { XUndefineCursor(s_display, window()); } + +bool FbWindow::property(Atom property, + long long_offset, long long_length, + bool do_delete, + Atom req_type, + Atom *actual_type_return, + int *actual_format_return, + unsigned long *nitems_return, + unsigned long *bytes_after_return, + unsigned char **prop_return) const { + if (XGetWindowProperty(s_display, window(), + property, long_offset, long_length, do_delete, + req_type, actual_type_return, + actual_format_return, nitems_return, + bytes_after_return, prop_return) == Success) + return true; + + return false; +} + +void FbWindow::changeProperty(Atom property, Atom type, + int format, + int mode, + unsigned char *data, + int nelements) { + + XChangeProperty(s_display, m_window, property, type, + format, mode, + data, nelements); +} + int FbWindow::screenNumber() const { return m_screen_num; } diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index f8a5505..45928c0 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWindow.hh,v 1.16 2003/05/17 10:42:34 fluxgen Exp $ +// $Id: FbWindow.hh,v 1.17 2003/05/19 22:38:54 fluxgen Exp $ #ifndef FBTK_FBWINDOW_HH #define FBTK_FBWINDOW_HH @@ -90,6 +90,22 @@ public: /// uses the parents cursor instead void unsetCursor(); + bool property(Atom property, + long long_offset, long long_length, + bool do_delete, + Atom req_type, + Atom *actual_type_return, + int *actual_format_return, + unsigned long *nitems_return, + unsigned long *bytes_after_return, + unsigned char **prop_return) const; + + void changeProperty(Atom property, Atom type, + int format, + int mode, + unsigned char *data, + int nelements); + /// @return parent FbWindow const FbWindow *parent() const { return m_parent; } /// @return real X window -- cgit v0.11.2