aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira@fluxbox.org>2015-02-08 10:06:58 (GMT)
committerMathias Gumz <akira@fluxbox.org>2015-02-08 10:06:58 (GMT)
commit9f824b89fd2f7f7705f4ef3d086d34fb5ba520cb (patch)
tree3c8f4e9bc56aced6b1370c06246d65b43e4a7941
parent495846f1eebaec4960d74451d211a2b20417ef9f (diff)
downloadfluxbox-9f824b89fd2f7f7705f4ef3d086d34fb5ba520cb.zip
fluxbox-9f824b89fd2f7f7705f4ef3d086d34fb5ba520cb.tar.bz2
Move internal code to internal side of FbTk::Transparent
-rw-r--r--src/FbTk/Transparent.cc28
-rw-r--r--src/FbTk/Transparent.hh15
2 files changed, 23 insertions, 20 deletions
diff --git a/src/FbTk/Transparent.cc b/src/FbTk/Transparent.cc
index 7db207a..b5bcca9 100644
--- a/src/FbTk/Transparent.cc
+++ b/src/FbTk/Transparent.cc
@@ -25,15 +25,13 @@
25 25
26#ifdef HAVE_XRENDER 26#ifdef HAVE_XRENDER
27#include <X11/extensions/Xrender.h> 27#include <X11/extensions/Xrender.h>
28#endif // HAVE_XRENDER
29 28
30#include <iostream> 29#include <iostream>
31#include <stdio.h> 30#include <cstdio>
32
33 31
34#ifdef HAVE_XRENDER
35using std::cerr; 32using std::cerr;
36using std::endl; 33using std::endl;
34
37#endif // HAVE_XRENDER 35#endif // HAVE_XRENDER
38 36
39 37
@@ -99,16 +97,14 @@ Picture createAlphaPic(Window drawable, int alpha) {
99 return alpha_pic; 97 return alpha_pic;
100} 98}
101#endif // HAVE_XRENDER 99#endif // HAVE_XRENDER
102}
103 100
104namespace FbTk { 101bool s_init = false;
102bool s_render = false;
103bool s_composite = false;
104bool s_use_composite = false;
105 105
106bool Transparent::s_init = false; 106void init() {
107bool Transparent::s_render = false;
108bool Transparent::s_composite = false;
109bool Transparent::s_use_composite = false;
110 107
111void Transparent::init() {
112 Display *disp = FbTk::App::instance()->display(); 108 Display *disp = FbTk::App::instance()->display();
113 109
114 int major_opcode, first_event, first_error; 110 int major_opcode, first_event, first_error;
@@ -129,6 +125,16 @@ void Transparent::init() {
129 s_init = true; 125 s_init = true;
130} 126}
131 127
128}
129
130namespace FbTk {
131
132bool Transparent::haveRender() {
133 if (!s_init)
134 init();
135 return s_render;
136}
137
132void Transparent::usePseudoTransparent(bool force) { 138void Transparent::usePseudoTransparent(bool force) {
133 if (!s_init) 139 if (!s_init)
134 init(); 140 init();
diff --git a/src/FbTk/Transparent.hh b/src/FbTk/Transparent.hh
index 8e9d9b9..a0c689e 100644
--- a/src/FbTk/Transparent.hh
+++ b/src/FbTk/Transparent.hh
@@ -29,6 +29,12 @@ namespace FbTk {
29/// renders to drawable together with an alpha mask 29/// renders to drawable together with an alpha mask
30class Transparent { 30class Transparent {
31public: 31public:
32
33 static bool haveComposite(bool for_real = false);
34 static bool haveRender();
35 static void usePseudoTransparent(bool force);
36
37
32 Transparent(Drawable source, Drawable dest, int alpha, int screen_num); 38 Transparent(Drawable source, Drawable dest, int alpha, int screen_num);
33 ~Transparent(); 39 ~Transparent();
34 /// sets alpha value 40 /// sets alpha value
@@ -49,9 +55,6 @@ public:
49 Drawable dest() const { return m_dest; } 55 Drawable dest() const { return m_dest; }
50 Drawable source() const { return m_source; } 56 Drawable source() const { return m_source; }
51 57
52 static bool haveComposite(bool for_real = false);
53 static bool haveRender() { if (!s_init) init(); return s_render; }
54 static void usePseudoTransparent(bool force);
55 58
56private: 59private:
57 void freeAlpha(); 60 void freeAlpha();
@@ -61,12 +64,6 @@ private:
61 unsigned long m_dest_pic; 64 unsigned long m_dest_pic;
62 Drawable m_source, m_dest; 65 Drawable m_source, m_dest;
63 unsigned char m_alpha; 66 unsigned char m_alpha;
64
65 static bool s_init;
66 static bool s_render; ///< wheter we have RENDER support
67 static bool s_composite; ///< wheter we have Composite support
68 static bool s_use_composite; ///< whether or not to use Composite
69 static void init();
70}; 67};
71 68
72} // end namespace FbTk 69} // end namespace FbTk