diff options
author | akir <akir> | 2004-09-09 14:29:10 (GMT) |
---|---|---|
committer | akir <akir> | 2004-09-09 14:29:10 (GMT) |
commit | 1d355a91925536ba2b4f0ffe652cb72540c91000 (patch) | |
tree | e323adb7f34038f1cdcd9c773339bb7ab679641f /src/FbTk/FbWindow.cc | |
parent | 7507098440e300c0126affbdd469456653b41e95 (diff) | |
download | fluxbox-1d355a91925536ba2b4f0ffe652cb72540c91000.zip fluxbox-1d355a91925536ba2b4f0ffe652cb72540c91000.tar.bz2 |
transfered ::getRootPixmap from several places to new home, FbPixmap
Diffstat (limited to 'src/FbTk/FbWindow.cc')
-rw-r--r-- | src/FbTk/FbWindow.cc | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 2209835..5417c09 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -19,9 +19,10 @@ | |||
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.cc,v 1.37 2004/08/31 15:26:39 rathnor Exp $ | 22 | // $Id: FbWindow.cc,v 1.38 2004/09/09 14:29:10 akir Exp $ |
23 | 23 | ||
24 | #include "FbWindow.hh" | 24 | #include "FbWindow.hh" |
25 | #include "FbPixmap.hh" | ||
25 | 26 | ||
26 | #include "EventManager.hh" | 27 | #include "EventManager.hh" |
27 | #include "Color.hh" | 28 | #include "Color.hh" |
@@ -43,31 +44,6 @@ | |||
43 | 44 | ||
44 | namespace FbTk { | 45 | namespace FbTk { |
45 | 46 | ||
46 | namespace { | ||
47 | Pixmap getRootPixmap(int screen_num) { | ||
48 | Pixmap root_pm = 0; | ||
49 | // get root pixmap for transparency | ||
50 | Display *disp = FbTk::App::instance()->display(); | ||
51 | Atom real_type; | ||
52 | int real_format; | ||
53 | unsigned long items_read, items_left; | ||
54 | unsigned int *data; | ||
55 | if (XGetWindowProperty(disp, RootWindow(disp, screen_num), | ||
56 | XInternAtom(disp, "_XROOTPMAP_ID", false), | ||
57 | 0L, 1L, | ||
58 | false, XA_PIXMAP, &real_type, | ||
59 | &real_format, &items_read, &items_left, | ||
60 | (unsigned char **) &data) == Success && | ||
61 | items_read) { | ||
62 | root_pm = (Pixmap) (*data); | ||
63 | XFree(data); | ||
64 | } | ||
65 | |||
66 | return root_pm; | ||
67 | } | ||
68 | |||
69 | }; // end anonymous namespace | ||
70 | |||
71 | Display *FbWindow::s_display = 0; | 47 | Display *FbWindow::s_display = 0; |
72 | 48 | ||
73 | FbWindow::FbWindow():m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), | 49 | FbWindow::FbWindow():m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), |
@@ -207,7 +183,7 @@ void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, u | |||
207 | return; | 183 | return; |
208 | 184 | ||
209 | // update source and destination if needed | 185 | // update source and destination if needed |
210 | Pixmap root = getRootPixmap(screenNumber()); | 186 | Pixmap root = FbPixmap::getRootPixmap(screenNumber()); |
211 | if (m_transparent->source() != root) | 187 | if (m_transparent->source() != root) |
212 | m_transparent->setSource(root, screenNumber()); | 188 | m_transparent->setSource(root, screenNumber()); |
213 | 189 | ||
@@ -245,7 +221,7 @@ void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, u | |||
245 | void FbWindow::setAlpha(unsigned char alpha) { | 221 | void FbWindow::setAlpha(unsigned char alpha) { |
246 | #ifdef HAVE_XRENDER | 222 | #ifdef HAVE_XRENDER |
247 | if (m_transparent.get() == 0 && alpha < 255) { | 223 | if (m_transparent.get() == 0 && alpha < 255) { |
248 | m_transparent.reset(new Transparent(getRootPixmap(screenNumber()), window(), alpha, screenNumber())); | 224 | m_transparent.reset(new Transparent(FbPixmap::getRootPixmap(screenNumber()), window(), alpha, screenNumber())); |
249 | } else if (alpha < 255 && alpha != m_transparent->alpha()) | 225 | } else if (alpha < 255 && alpha != m_transparent->alpha()) |
250 | m_transparent->setAlpha(alpha); | 226 | m_transparent->setAlpha(alpha); |
251 | else if (alpha == 255) | 227 | else if (alpha == 255) |