|
|
|
@ -34,165 +34,169 @@ class KPixmap;
|
|
|
|
|
|
|
|
|
|
class GradientSet
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
enum GradientType {
|
|
|
|
|
Horizontal,
|
|
|
|
|
Vertical,
|
|
|
|
|
HorizontalReverse,
|
|
|
|
|
VerticalReverse,
|
|
|
|
|
GradientTypeCount
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GradientSet(const TQColor &color, int size);
|
|
|
|
|
~GradientSet();
|
|
|
|
|
|
|
|
|
|
KPixmap* gradient(bool horizontal, bool reverse);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
KPixmap *set[GradientTypeCount];
|
|
|
|
|
TQColor color_;
|
|
|
|
|
int size_;
|
|
|
|
|
public:
|
|
|
|
|
enum GradientType {
|
|
|
|
|
Horizontal,
|
|
|
|
|
Vertical,
|
|
|
|
|
HorizontalReverse,
|
|
|
|
|
VerticalReverse,
|
|
|
|
|
GradientTypeCount
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GradientSet(const TQColor &color, int size);
|
|
|
|
|
~GradientSet();
|
|
|
|
|
|
|
|
|
|
KPixmap* gradient(bool horizontal, bool reverse);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
KPixmap *set[GradientTypeCount];
|
|
|
|
|
TQColor color_;
|
|
|
|
|
int size_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PhaseStyle : public KStyle
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
PhaseStyle();
|
|
|
|
|
virtual ~PhaseStyle();
|
|
|
|
|
|
|
|
|
|
void applicationPolish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *);
|
|
|
|
|
void polish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *);
|
|
|
|
|
void polish(TQPalette &pal);
|
|
|
|
|
void unPolish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *);
|
|
|
|
|
|
|
|
|
|
void drawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default) const;
|
|
|
|
|
|
|
|
|
|
void drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawControl(TQ_ControlElement element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawControlMask(TQ_ControlElement element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
SCFlags controls = SC_All,
|
|
|
|
|
SCFlags active = SC_None,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
const TQStyleControlElementData ceData,
|
|
|
|
|
const ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
int pixelMetric(PixelMetric metric, TQStyleControlElementData ceData, ControlElementFlags elementFlags,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
TQRect subRect(SubRect rect, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
TQRect querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
SubControl subcontrol,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
TQSize sizeFromContents(ContentsType contents,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQSize &contentsize,
|
|
|
|
|
const TQStyleOption& option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PhaseStyle(const PhaseStyle &);
|
|
|
|
|
PhaseStyle& operator=(const PhaseStyle &);
|
|
|
|
|
|
|
|
|
|
void drawPhaseBevel(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
const TQColor &fill,
|
|
|
|
|
bool sunken=false,
|
|
|
|
|
bool horizontal=true,
|
|
|
|
|
bool reverse=false) const;
|
|
|
|
|
|
|
|
|
|
void drawPhaseButton(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
const TQColor &fill,
|
|
|
|
|
bool sunken=false) const;
|
|
|
|
|
|
|
|
|
|
void drawPhasePanel(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
bool sunken=false,
|
|
|
|
|
const TQBrush *fill=NULL) const;
|
|
|
|
|
|
|
|
|
|
void drawPhaseTab(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
const SFlags flags) const;
|
|
|
|
|
|
|
|
|
|
void drawPhaseGradient(TQPainter *painter,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
TQColor color,
|
|
|
|
|
bool horizontal,
|
|
|
|
|
int px=0, int py=0,
|
|
|
|
|
int pw=-1, int ph=-1,
|
|
|
|
|
bool reverse=false) const;
|
|
|
|
|
|
|
|
|
|
bool flatToolbar(const TQToolBar *toolbar) const;
|
|
|
|
|
|
|
|
|
|
bool objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e );
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TQMap<unsigned int, TQIntDict<GradientSet> > * gradients;
|
|
|
|
|
bool gradients_;
|
|
|
|
|
bool highlights_;
|
|
|
|
|
bool reverse_;
|
|
|
|
|
bool kicker_;
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
PhaseStyle();
|
|
|
|
|
virtual ~PhaseStyle();
|
|
|
|
|
|
|
|
|
|
void applicationPolish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *);
|
|
|
|
|
void polish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *);
|
|
|
|
|
void polish(TQPalette &pal);
|
|
|
|
|
void unPolish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *);
|
|
|
|
|
|
|
|
|
|
void drawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default) const;
|
|
|
|
|
|
|
|
|
|
void drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawControl(TQ_ControlElement element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawControlMask(TQ_ControlElement element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
SFlags flags = Style_Default,
|
|
|
|
|
SCFlags controls = SC_All,
|
|
|
|
|
SCFlags active = SC_None,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
void drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
const TQStyleControlElementData ceData,
|
|
|
|
|
const ControlElementFlags elementFlags,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
int pixelMetric(PixelMetric metric, TQStyleControlElementData ceData, ControlElementFlags elementFlags,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
TQRect subRect(SubRect rect, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
TQRect querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
SubControl subcontrol,
|
|
|
|
|
const TQStyleOption &option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
TQSize sizeFromContents(ContentsType contents,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQSize &contentsize,
|
|
|
|
|
const TQStyleOption& option = TQStyleOption::Default,
|
|
|
|
|
const TQWidget *widget = 0) const;
|
|
|
|
|
|
|
|
|
|
int styleHint(TQ_StyleHint, TQStyleControlElementData ceData, ControlElementFlags elementFlags,
|
|
|
|
|
const TQStyleOption & = TQStyleOption::Default,
|
|
|
|
|
TQStyleHintReturn * = 0, const TQWidget * = 0 ) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PhaseStyle(const PhaseStyle &);
|
|
|
|
|
PhaseStyle& operator=(const PhaseStyle &);
|
|
|
|
|
|
|
|
|
|
void drawPhaseBevel(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
const TQColor &fill,
|
|
|
|
|
bool sunken=false,
|
|
|
|
|
bool horizontal=true,
|
|
|
|
|
bool reverse=false) const;
|
|
|
|
|
|
|
|
|
|
void drawPhaseButton(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
const TQColor &fill,
|
|
|
|
|
bool sunken=false) const;
|
|
|
|
|
|
|
|
|
|
void drawPhasePanel(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
bool sunken=false,
|
|
|
|
|
const TQBrush *fill=NULL) const;
|
|
|
|
|
|
|
|
|
|
void drawPhaseTab(TQPainter *painter,
|
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
|
const TQColorGroup &group,
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
const SFlags flags) const;
|
|
|
|
|
|
|
|
|
|
void drawPhaseGradient(TQPainter *painter,
|
|
|
|
|
const TQRect &rect,
|
|
|
|
|
TQColor color,
|
|
|
|
|
bool horizontal,
|
|
|
|
|
int px=0, int py=0,
|
|
|
|
|
int pw=-1, int ph=-1,
|
|
|
|
|
bool reverse=false) const;
|
|
|
|
|
|
|
|
|
|
bool flatToolbar(const TQToolBar *toolbar) const;
|
|
|
|
|
|
|
|
|
|
bool objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e );
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TQMap<unsigned int, TQIntDict<GradientSet> > * gradients;
|
|
|
|
|
bool gradients_;
|
|
|
|
|
bool highlights_;
|
|
|
|
|
bool reverse_;
|
|
|
|
|
bool kicker_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // PHASESTYLE_H
|
|
|
|
|