From 0c895209d2d1425389100e6be734b960475c6883 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 14 Apr 2003 12:04:32 +0000 Subject: merged with emebbeded-tab-branch --- src/FbTk/FbWindow.hh | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index 92f2ba5..23b7880 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh @@ -1,5 +1,5 @@ // FbWindow.hh for FbTk - fluxbox toolkit -// Copyright (c) 2002 Henrik Kinnunen (fluxgen at users.sourceforge.net) +// Copyright (c) 2002 - 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -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.8 2003/02/02 22:03:27 fluxgen Exp $ +// $Id: FbWindow.hh,v 1.9 2003/04/14 12:04:32 fluxgen Exp $ #ifndef FBTK_FBWINDOW_HH #define FBTK_FBWINDOW_HH @@ -38,7 +38,7 @@ public: FbWindow(); FbWindow(const FbWindow &win_copy); FbWindow(int screen_num, - int x, int y, size_t width, size_t height, long eventmask, + int x, int y, unsigned int width, unsigned int height, long eventmask, bool overrride_redirect = false, int depth = CopyFromParent, int class_type = InputOutput); @@ -65,19 +65,19 @@ public: virtual void showSubwindows(); virtual void move(int x, int y); - virtual void resize(size_t width, size_t height); - virtual void moveResize(int x, int y, size_t width, size_t height); - void lower(); - void raise(); + virtual void resize(unsigned int width, unsigned int height); + virtual void moveResize(int x, int y, unsigned int width, unsigned int height); + virtual void lower(); + virtual void raise(); const FbWindow *parent() const { return m_parent; } Window window() const { return m_window; } int x() const { return m_x; } int y() const { return m_y; } - size_t width() const { return m_width; } - size_t height() const { return m_height; } - size_t borderWidth() const { return m_border_width; } + unsigned int width() const { return m_width; } + unsigned int height() const { return m_height; } + unsigned int borderWidth() const { return m_border_width; } int screenNumber() const; /// compare X window bool operator == (Window win) const { return m_window == win; } @@ -86,24 +86,46 @@ public: bool operator == (const FbWindow &win) const { return m_window == win.m_window; } bool operator != (const FbWindow &win) const { return m_window != win.m_window; } +protected: + explicit FbWindow(Window client); private: void updateGeometry(); - void create(Window parent, int x, int y, size_t width, size_t height, long eventmask, + void create(Window parent, int x, int y, unsigned int width, unsigned int height, + long eventmask, bool override_redirect, int depth, int class_type); static Display *s_display; - const FbWindow *m_parent; + const FbWindow *m_parent; int m_screen_num; Window m_window; ///< the X window int m_x, m_y; ///< position of window - size_t m_width, m_height; ///< size of window - size_t m_border_width; // border size - + unsigned int m_width, m_height; ///< size of window + unsigned int m_border_width; // border size + bool m_destroy; ///< wheter the x window was created before }; bool operator == (Window win, const FbWindow &fbwin); +class ChangeProperty { +public: + ChangeProperty(Display *disp, Atom prop, int mode, + unsigned char *state, int num):m_disp(disp), + m_prop(prop), m_state(state), m_num(num), m_mode(mode){ + + } + void operator () (FbTk::FbWindow *win) { + XChangeProperty(m_disp, win->window(), m_prop, m_prop, 32, m_mode, + m_state, m_num); + } +private: + Display *m_disp; + Atom m_prop; + unsigned char *m_state; + int m_num; + int m_mode; +}; + }; // end namespace FbTk #endif // FBTK_FBWINDOW_HH -- cgit v0.11.2