aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/FbWindow.cc53
-rw-r--r--src/FbTk/FbWindow.hh2
2 files changed, 32 insertions, 23 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index 056e2f1..fb68eb9 100644
--- a/src/FbTk/FbWindow.cc
+++ b/src/FbTk/FbWindow.cc
@@ -43,21 +43,28 @@
43 43
44namespace FbTk { 44namespace FbTk {
45 45
46FbWindow::FbWindow():FbDrawable(), m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), 46FbWindow::FbWindow():
47 m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true), 47 FbDrawable(),
48 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), m_renderer(0) { 48 m_parent(0), m_screen_num(0), m_window(0),
49 m_x(0), m_y(0), m_width(0), m_height(0),
50 m_border_width(0), m_border_color(0),
51 m_depth(0), m_destroy(true),
52 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0),
53 m_renderer(0) {
49 54
50} 55}
51 56
52FbWindow::FbWindow(const FbWindow& the_copy):FbDrawable(), 57FbWindow::FbWindow(const FbWindow& the_copy):
53 m_parent(the_copy.parent()), 58 FbDrawable(),
54 m_screen_num(the_copy.screenNumber()), m_window(the_copy.window()), 59 m_parent(the_copy.parent()),
55 m_x(the_copy.x()), m_y(the_copy.y()), 60 m_screen_num(the_copy.screenNumber()), m_window(the_copy.window()),
56 m_width(the_copy.width()), m_height(the_copy.height()), 61 m_x(the_copy.x()), m_y(the_copy.y()),
57 m_border_width(the_copy.borderWidth()), 62 m_width(the_copy.width()), m_height(the_copy.height()),
58 m_depth(the_copy.depth()), m_destroy(true), 63 m_border_width(the_copy.borderWidth()),
59 m_lastbg_color_set(false), m_lastbg_color(0), 64 m_border_color(the_copy.borderColor()),
60 m_lastbg_pm(0), m_renderer(the_copy.m_renderer) { 65 m_depth(the_copy.depth()), m_destroy(true),
66 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0),
67 m_renderer(the_copy.m_renderer) {
61 the_copy.m_window = 0; 68 the_copy.m_window = 0;
62} 69}
63 70
@@ -100,17 +107,14 @@ FbWindow::FbWindow(const FbWindow &parent,
100 107
101}; 108};
102 109
103FbWindow::FbWindow(Window client):FbDrawable(), m_parent(0), 110FbWindow::FbWindow(Window client):
104 m_screen_num(0), 111 FbDrawable(),
105 m_window(0), 112 m_parent(0), m_screen_num(0), m_window(0),
106 m_x(0), m_y(0), 113 m_x(0), m_y(0), m_width(1), m_height(1),
107 m_width(1), m_height(1), 114 m_border_width(0), m_border_color(0),
108 m_border_width(0), 115 m_depth(0), m_destroy(false), // don't destroy this window
109 m_depth(0), 116 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0),
110 m_destroy(false), // don't destroy this window 117 m_renderer(0) {
111 m_lastbg_color_set(false), m_lastbg_color(0),
112 m_lastbg_pm(0), m_renderer(0) {
113
114 setNew(client); 118 setNew(client);
115} 119}
116 120
@@ -235,6 +239,7 @@ void FbWindow::updateBackground(bool only_if_alpha) {
235 239
236void FbWindow::setBorderColor(const FbTk::Color &border_color) { 240void FbWindow::setBorderColor(const FbTk::Color &border_color) {
237 XSetWindowBorder(display(), m_window, border_color.pixel()); 241 XSetWindowBorder(display(), m_window, border_color.pixel());
242 m_border_color = border_color.pixel();
238} 243}
239 244
240void FbWindow::setBorderWidth(unsigned int size) { 245void FbWindow::setBorderWidth(unsigned int size) {
@@ -373,6 +378,7 @@ FbWindow &FbWindow::operator = (const FbWindow &win) {
373 m_width = win.width(); 378 m_width = win.width();
374 m_height = win.height(); 379 m_height = win.height();
375 m_border_width = win.borderWidth(); 380 m_border_width = win.borderWidth();
381 m_border_color = win.borderColor();
376 m_depth = win.depth(); 382 m_depth = win.depth();
377 // take over this window 383 // take over this window
378 win.m_window = 0; 384 win.m_window = 0;
@@ -601,6 +607,7 @@ void FbWindow::create(Window parent, int x, int y,
601 607
602 608
603 m_border_width = 0; 609 m_border_width = 0;
610 m_border_color = 0;
604 611
605 long valmask = CWEventMask; 612 long valmask = CWEventMask;
606 XSetWindowAttributes values; 613 XSetWindowAttributes values;
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh
index e9f8e30..f212e50 100644
--- a/src/FbTk/FbWindow.hh
+++ b/src/FbTk/FbWindow.hh
@@ -177,6 +177,7 @@ public:
177 unsigned int width() const { return m_width; } 177 unsigned int width() const { return m_width; }
178 unsigned int height() const { return m_height; } 178 unsigned int height() const { return m_height; }
179 unsigned int borderWidth() const { return m_border_width; } 179 unsigned int borderWidth() const { return m_border_width; }
180 unsigned long borderColor() const { return m_border_color; }
180 unsigned int depth() const { return m_depth; } 181 unsigned int depth() const { return m_depth; }
181 unsigned char alpha() const; 182 unsigned char alpha() const;
182 int screenNumber() const; 183 int screenNumber() const;
@@ -225,6 +226,7 @@ private:
225 int m_x, m_y; ///< position of window 226 int m_x, m_y; ///< position of window
226 unsigned int m_width, m_height; ///< size of window 227 unsigned int m_width, m_height; ///< size of window
227 unsigned int m_border_width; ///< border size 228 unsigned int m_border_width; ///< border size
229 unsigned long m_border_color; ///< border color
228 unsigned int m_depth; ///< bit depth 230 unsigned int m_depth; ///< bit depth
229 bool m_destroy; ///< wheter the x window was created before 231 bool m_destroy; ///< wheter the x window was created before
230 std::auto_ptr<FbTk::Transparent> m_transparent; 232 std::auto_ptr<FbTk::Transparent> m_transparent;