all repos — fluxbox @ 9f824b89fd2f7f7705f4ef3d086d34fb5ba520cb

custom fork of the fluxbox windowmanager

Move internal code to internal side of FbTk::Transparent
Mathias Gumz akira@fluxbox.org
commit

9f824b89fd2f7f7705f4ef3d086d34fb5ba520cb

parent

495846f1eebaec4960d74451d211a2b20417ef9f

2 files changed, 23 insertions(+), 20 deletions(-)

jump to
M src/FbTk/Transparent.ccsrc/FbTk/Transparent.cc

@@ -25,15 +25,13 @@ #include "I18n.hh"

#ifdef HAVE_XRENDER #include <X11/extensions/Xrender.h> -#endif // HAVE_XRENDER #include <iostream> -#include <stdio.h> - +#include <cstdio> -#ifdef HAVE_XRENDER using std::cerr; using std::endl; + #endif // HAVE_XRENDER

@@ -99,16 +97,14 @@

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;

@@ -127,6 +123,16 @@ s_use_composite = true;

} } s_init = true; +} + +} + +namespace FbTk { + +bool Transparent::haveRender() { + if (!s_init) + init(); + return s_render; } void Transparent::usePseudoTransparent(bool force) {
M src/FbTk/Transparent.hhsrc/FbTk/Transparent.hh

@@ -29,6 +29,12 @@

/// 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 @@ int alpha() const { return m_alpha; }

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 @@ unsigned long m_src_pic;

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