0fb27fd12e
The define KWIN_SINGLETON adds to a class definition: public: static Foo *create(QObject *parent = 0); static Foo *self() { return s_self; } protected: explicit Foo(QObject *parent = 0); private: static Foo *s_self; There is an additional define KWIN_SINGLETON_VARIABLE to set a different name than s_self. The define KWIN_SINGLETON_FACTORY can be used to generate the create method. It expands to: Foo *Foo::s_self = 0; Foo *Foo::create(QObject *parent) { Q_ASSERT(!s_self); s_self = new Foo(parent); return s_self; } In addition there are defines to again set a different variable name and to create an object of another inheriting class. All the classes currently using this pattern are adjusted to use these new defines. In a few places the name was adjusted. E.g. in Compositor the factory method was called createCompositor instead of create. REVIEW: 109865 |
||
---|---|---|
.. | ||
anidata.cpp | ||
anidata_p.h | ||
CMakeLists.txt | ||
kwinanimationeffect.cpp | ||
kwinanimationeffect.h | ||
kwinconfig.h.cmake | ||
kwineffects.cpp | ||
kwineffects.h | ||
kwinglcolorcorrection.cpp | ||
kwinglcolorcorrection.h | ||
kwinglcolorcorrection_p.h | ||
kwinglobals.cpp | ||
kwinglobals.h | ||
kwinglplatform.cpp | ||
kwinglplatform.h | ||
kwingltexture.cpp | ||
kwingltexture.h | ||
kwingltexture_p.h | ||
kwinglutils.cpp | ||
kwinglutils.h | ||
kwinglutils_funcs.cpp | ||
kwinglutils_funcs.h | ||
kwinxrenderutils.cpp | ||
kwinxrenderutils.h | ||
Mainpage.dox | ||
Messages.sh |