1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
22 #define parent_style qwindowsstyle
23 #define PARENT_STYLE QWindowsStyle
26 #define PARENT_INC(x) QUOTE(x.h)
28 //#include PARENT_INC(parent_style)
29 #include <qwindowsstyle.h>
32 #include <qdockwindow.h>
33 #include <qstyleplugin.h>
35 #if defined SALOMESTYLE_EXPORTS
37 #define SALOMESTYLE_EXPORT _declspec( dllexport )
39 #define SALOMESTYLE_EXPORT
43 #define SALOMESTYLE_EXPORT _declspec( dllimport )
45 #define SALOMESTYLE_EXPORT
51 class SALOMESTYLE_EXPORT SalomeStyle : public PARENT_STYLE
55 virtual ~SalomeStyle();
57 virtual void polish( QWidget* );
59 virtual bool eventFilter( QObject*, QEvent* );
61 static void mix( const double, QRgb&, const QRgb& );
62 static void mix( const double, QPixmap&, const QColor& );
63 static void mix( const double, const QColor&, const QColor&, QColor& );
65 static void toGrayscale( QPixmap&, double = 1.0 );
67 virtual void drawPrimitive( PrimitiveElement, QPainter*, const QRect&,
68 const QColorGroup&, SFlags = Style_Default,
69 const QStyleOption& = QStyleOption::Default ) const;
71 virtual void drawControl( ControlElement, QPainter*, const QWidget*,
72 const QRect&, const QColorGroup&, SFlags = Style_Default,
73 const QStyleOption& = QStyleOption::Default ) const;
75 virtual QRect subRect( SubRect, const QWidget* ) const;
77 virtual void drawComplexControl( ComplexControl, QPainter*, const QWidget*,
78 const QRect&, const QColorGroup&, SFlags = Style_Default,
79 SCFlags = SC_All, SCFlags = SC_None,
80 const QStyleOption& = QStyleOption::Default ) const;
82 virtual QPixmap stylePixmap( StylePixmap, const QWidget* = 0,
83 const QStyleOption& = QStyleOption::Default ) const;
85 virtual int pixelMetric( PixelMetric, const QWidget* widget = 0 ) const;
88 typedef enum { LeftToRight, RightToLeft, UpToDown, DownToUp } Direction;
90 typedef double (*gradient_func)( double );
92 void drawGradient( QPainter*, const QRect&, const QColor&,
93 const QColor&, const Direction, gradient_func ) const;
95 QString titleText( const QString&, const int, const QFontMetrics& ) const;
98 QWidget* myTitleParent;
101 class SalomeStylePlugin : public QStylePlugin
105 virtual ~SalomeStylePlugin();
107 virtual QStringList keys() const;
108 virtual QStyle* create( const QString& );