X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.h;h=c6ad57e8c5ae1676005dc1802882681e1c961802;hb=8b3ac2b938bd55064a6f260ca7ec9c9a84cd977e;hp=3a2dbacfffacbc88b11387e7bffbb6d3183d5ff9;hpb=196230e7b9144d8cb785eb5e021e89188c7161dc;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index 3a2dbacff..c6ad57e8c 100644 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -1,28 +1,55 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_Tools.h // Created: 11 July 2014 // Author: Vitaly Smetannikov - #ifndef ModuleBase_Tools_H #define ModuleBase_Tools_H #include "ModuleBase.h" -#include -#include +#include + +class QWidget; +class QLayout; + +namespace ModuleBase_Tools { + +/* + * Methods to adjust margins and spacings. + */ +MODULEBASE_EXPORT void adjustMargins(QWidget* theWidget); +MODULEBASE_EXPORT void adjustMargins(QLayout* theLayout); + +MODULEBASE_EXPORT void zeroMargins(QWidget* theWidget); +MODULEBASE_EXPORT void zeroMargins(QLayout* theLayout); + -class GeomAPI_Shape; +/** + * \ingroup GUI + * Methods to modify a resource pixmap + */ -namespace ModuleBase_Tools -{ +//! Create composite pixmap. +//! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates +//! specified relatively to the upper left corner of \a theIcon. - /** - * Returns returns a shape if the result has a shape method. Otherwise returns NULL pointer - */ - MODULEBASE_EXPORT boost::shared_ptr shape(ResultPtr theResult); +//! \param theAdditionalIcon resource text of the additional pixmap +//! \param theIcon resource text of the background pixmap +//! \return resulting pixmap +MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon); - MODULEBASE_EXPORT FeaturePtr feature(ObjectPtr theObject); +//! Generates the pixmap lighter than the resources pixmap. +//! Pixmap \a theIcon is lighted according to the given value. +//! If the lighter value is greater than 100, this functions returns a lighter pixmap. +//! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100, +//! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified. -}; +//! \param resource text of the pixmap +//! \param theLighterValue a lighter factor +//! \return resulting pixmap +MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200); +} -#endif \ No newline at end of file +#endif