From 9f824b89fd2f7f7705f4ef3d086d34fb5ba520cb Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sun, 8 Feb 2015 11:06:58 +0100 Subject: Move internal code to internal side of FbTk::Transparent --- src/FbTk/Transparent.cc | 28 +++++++++++++++++----------- src/FbTk/Transparent.hh | 15 ++++++--------- 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 @@ #ifdef HAVE_XRENDER #include -#endif // HAVE_XRENDER #include -#include - +#include -#ifdef HAVE_XRENDER using std::cerr; using std::endl; + #endif // HAVE_XRENDER @@ -99,16 +97,14 @@ Picture createAlphaPic(Window drawable, int alpha) { return alpha_pic; } #endif // HAVE_XRENDER -} -namespace FbTk { +bool s_init = false; +bool s_render = false; +bool s_composite = false; +bool s_use_composite = false; -bool Transparent::s_init = false; -bool Transparent::s_render = false; -bool Transparent::s_composite = false; -bool Transparent::s_use_composite = false; +void init() { -void Transparent::init() { Display *disp = FbTk::App::instance()->display(); int major_opcode, first_event, first_error; @@ -129,6 +125,16 @@ void Transparent::init() { s_init = true; } +} + +namespace FbTk { + +bool Transparent::haveRender() { + if (!s_init) + init(); + return s_render; +} + void Transparent::usePseudoTransparent(bool force) { if (!s_init) 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 { /// renders to drawable together with an alpha mask class Transparent { public: + + static bool haveComposite(bool for_real = false); + static bool haveRender(); + static void usePseudoTransparent(bool force); + + Transparent(Drawable source, Drawable dest, int alpha, int screen_num); ~Transparent(); /// sets alpha value @@ -49,9 +55,6 @@ public: Drawable dest() const { return m_dest; } Drawable source() const { return m_source; } - static bool haveComposite(bool for_real = false); - static bool haveRender() { if (!s_init) init(); return s_render; } - static void usePseudoTransparent(bool force); private: void freeAlpha(); @@ -61,12 +64,6 @@ private: unsigned long m_dest_pic; Drawable m_source, m_dest; unsigned char m_alpha; - - static bool s_init; - static bool s_render; ///< wheter we have RENDER support - static bool s_composite; ///< wheter we have Composite support - static bool s_use_composite; ///< whether or not to use Composite - static void init(); }; } // end namespace FbTk -- cgit v0.11.2