diff options
-rw-r--r-- | src/FbTk/FbWindow.hh | 52 |
1 files 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 @@ | |||
1 | // FbWindow.hh for FbTk - fluxbox toolkit | 1 | // FbWindow.hh for FbTk - fluxbox toolkit |
2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen at users.sourceforge.net) | 2 | // Copyright (c) 2002 - 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) |
3 | // | 3 | // |
4 | // Permission is hereby granted, free of charge, to any person obtaining a | 4 | // Permission is hereby granted, free of charge, to any person obtaining a |
5 | // copy of this software and associated documentation files (the "Software"), | 5 | // copy of this software and associated documentation files (the "Software"), |
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWindow.hh,v 1.8 2003/02/02 22:03:27 fluxgen Exp $ | 22 | // $Id: FbWindow.hh,v 1.9 2003/04/14 12:04:32 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef FBTK_FBWINDOW_HH | 24 | #ifndef FBTK_FBWINDOW_HH |
25 | #define FBTK_FBWINDOW_HH | 25 | #define FBTK_FBWINDOW_HH |
@@ -38,7 +38,7 @@ public: | |||
38 | FbWindow(); | 38 | FbWindow(); |
39 | FbWindow(const FbWindow &win_copy); | 39 | FbWindow(const FbWindow &win_copy); |
40 | FbWindow(int screen_num, | 40 | FbWindow(int screen_num, |
41 | int x, int y, size_t width, size_t height, long eventmask, | 41 | int x, int y, unsigned int width, unsigned int height, long eventmask, |
42 | bool overrride_redirect = false, | 42 | bool overrride_redirect = false, |
43 | int depth = CopyFromParent, | 43 | int depth = CopyFromParent, |
44 | int class_type = InputOutput); | 44 | int class_type = InputOutput); |
@@ -65,19 +65,19 @@ public: | |||
65 | virtual void showSubwindows(); | 65 | virtual void showSubwindows(); |
66 | 66 | ||
67 | virtual void move(int x, int y); | 67 | virtual void move(int x, int y); |
68 | virtual void resize(size_t width, size_t height); | 68 | virtual void resize(unsigned int width, unsigned int height); |
69 | virtual void moveResize(int x, int y, size_t width, size_t height); | 69 | virtual void moveResize(int x, int y, unsigned int width, unsigned int height); |
70 | void lower(); | 70 | virtual void lower(); |
71 | void raise(); | 71 | virtual void raise(); |
72 | 72 | ||
73 | 73 | ||
74 | const FbWindow *parent() const { return m_parent; } | 74 | const FbWindow *parent() const { return m_parent; } |
75 | Window window() const { return m_window; } | 75 | Window window() const { return m_window; } |
76 | int x() const { return m_x; } | 76 | int x() const { return m_x; } |
77 | int y() const { return m_y; } | 77 | int y() const { return m_y; } |
78 | size_t width() const { return m_width; } | 78 | unsigned int width() const { return m_width; } |
79 | size_t height() const { return m_height; } | 79 | unsigned int height() const { return m_height; } |
80 | size_t borderWidth() const { return m_border_width; } | 80 | unsigned int borderWidth() const { return m_border_width; } |
81 | int screenNumber() const; | 81 | int screenNumber() const; |
82 | /// compare X window | 82 | /// compare X window |
83 | bool operator == (Window win) const { return m_window == win; } | 83 | bool operator == (Window win) const { return m_window == win; } |
@@ -86,24 +86,46 @@ public: | |||
86 | bool operator == (const FbWindow &win) const { return m_window == win.m_window; } | 86 | bool operator == (const FbWindow &win) const { return m_window == win.m_window; } |
87 | bool operator != (const FbWindow &win) const { return m_window != win.m_window; } | 87 | bool operator != (const FbWindow &win) const { return m_window != win.m_window; } |
88 | 88 | ||
89 | protected: | ||
90 | explicit FbWindow(Window client); | ||
89 | private: | 91 | private: |
90 | void updateGeometry(); | 92 | void updateGeometry(); |
91 | void create(Window parent, int x, int y, size_t width, size_t height, long eventmask, | 93 | void create(Window parent, int x, int y, unsigned int width, unsigned int height, |
94 | long eventmask, | ||
92 | bool override_redirect, | 95 | bool override_redirect, |
93 | int depth, | 96 | int depth, |
94 | int class_type); | 97 | int class_type); |
95 | static Display *s_display; | 98 | static Display *s_display; |
96 | const FbWindow *m_parent; | 99 | const FbWindow *m_parent; |
97 | int m_screen_num; | 100 | int m_screen_num; |
98 | Window m_window; ///< the X window | 101 | Window m_window; ///< the X window |
99 | int m_x, m_y; ///< position of window | 102 | int m_x, m_y; ///< position of window |
100 | size_t m_width, m_height; ///< size of window | 103 | unsigned int m_width, m_height; ///< size of window |
101 | size_t m_border_width; // border size | 104 | unsigned int m_border_width; // border size |
102 | 105 | bool m_destroy; ///< wheter the x window was created before | |
103 | }; | 106 | }; |
104 | 107 | ||
105 | bool operator == (Window win, const FbWindow &fbwin); | 108 | bool operator == (Window win, const FbWindow &fbwin); |
106 | 109 | ||
110 | class ChangeProperty { | ||
111 | public: | ||
112 | ChangeProperty(Display *disp, Atom prop, int mode, | ||
113 | unsigned char *state, int num):m_disp(disp), | ||
114 | m_prop(prop), m_state(state), m_num(num), m_mode(mode){ | ||
115 | |||
116 | } | ||
117 | void operator () (FbTk::FbWindow *win) { | ||
118 | XChangeProperty(m_disp, win->window(), m_prop, m_prop, 32, m_mode, | ||
119 | m_state, m_num); | ||
120 | } | ||
121 | private: | ||
122 | Display *m_disp; | ||
123 | Atom m_prop; | ||
124 | unsigned char *m_state; | ||
125 | int m_num; | ||
126 | int m_mode; | ||
127 | }; | ||
128 | |||
107 | }; // end namespace FbTk | 129 | }; // end namespace FbTk |
108 | 130 | ||
109 | #endif // FBTK_FBWINDOW_HH | 131 | #endif // FBTK_FBWINDOW_HH |