You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
177 lines
6.6 KiB
177 lines
6.6 KiB
15 years ago
|
/*
|
||
|
* High Contrast Style (version 1.0)
|
||
|
* Copyright (C) 2004 Olaf Schmidt <ojschmidt@kde.org>
|
||
|
*
|
||
|
* Derived from Axes Style
|
||
|
* Copyright (C) 2003 Maksim Orlovich <orlovich@cs.rochester.edu>
|
||
|
*
|
||
|
* Axes Style based on KDE 3 HighColor Style,
|
||
|
* Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
|
||
|
* (C) 2001-2002 Fredrik Höglund <fredrik@kde.org>
|
||
|
*
|
||
|
* KDE 3 HighColor Style drawing routines adapted from the KDE2 HCStyle,
|
||
|
* Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
|
||
|
* (C) 2000 Dirk Mueller <mueller@kde.org>
|
||
|
* (C) 2001 Martijn Klingens <klingens@kde.org>
|
||
|
*
|
||
12 years ago
|
* Includes portions from TDEStyle,
|
||
15 years ago
|
* Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
|
||
|
*
|
||
|
* Many thanks to Bradley T. Hughes for the 3 button scrollbar code.
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License version 2 as published by the Free Software Foundation.
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef __HIGHCONTRAST_H
|
||
|
#define __HIGHCONTRAST_H
|
||
|
|
||
14 years ago
|
#include <tqbitmap.h>
|
||
|
#include <tqintdict.h>
|
||
15 years ago
|
#include <kdrawutil.h>
|
||
|
#include <kpixmap.h>
|
||
12 years ago
|
#include <tdestyle.h>
|
||
15 years ago
|
|
||
|
|
||
14 years ago
|
class TQPopupMenu;
|
||
15 years ago
|
|
||
12 years ago
|
class HighContrastStyle : public TDEStyle
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
HighContrastStyle();
|
||
|
virtual ~HighContrastStyle();
|
||
|
|
||
14 years ago
|
void polish( TQPalette& pal );
|
||
15 years ago
|
|
||
12 years ago
|
void polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * );
|
||
|
void unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * );
|
||
15 years ago
|
|
||
12 years ago
|
void drawTDEStylePrimitive( TDEStylePrimitive kpe,
|
||
14 years ago
|
TQPainter* p,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQRect &r,
|
||
|
const TQColorGroup &cg,
|
||
15 years ago
|
SFlags flags = Style_Default,
|
||
12 years ago
|
const TQStyleOption& = TQStyleOption::Default,
|
||
|
const TQWidget* widget = 0 ) const;
|
||
15 years ago
|
|
||
12 years ago
|
void drawPrimitive( TQ_PrimitiveElement pe,
|
||
14 years ago
|
TQPainter* p,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQRect &r,
|
||
|
const TQColorGroup &cg,
|
||
15 years ago
|
SFlags flags = Style_Default,
|
||
14 years ago
|
const TQStyleOption& = TQStyleOption::Default ) const;
|
||
15 years ago
|
|
||
13 years ago
|
void drawControl( TQ_ControlElement element,
|
||
14 years ago
|
TQPainter *p,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQRect &r,
|
||
|
const TQColorGroup &cg,
|
||
15 years ago
|
SFlags flags = Style_Default,
|
||
12 years ago
|
const TQStyleOption& = TQStyleOption::Default,
|
||
|
const TQWidget *widget = 0 ) const;
|
||
15 years ago
|
|
||
13 years ago
|
void drawControlMask( TQ_ControlElement element,
|
||
14 years ago
|
TQPainter *p,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQRect &r,
|
||
12 years ago
|
const TQStyleOption& = TQStyleOption::Default,
|
||
|
const TQWidget *widget = 0 ) const;
|
||
15 years ago
|
|
||
13 years ago
|
void drawComplexControl( TQ_ComplexControl control,
|
||
14 years ago
|
TQPainter *p,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQRect &r,
|
||
|
const TQColorGroup &cg,
|
||
15 years ago
|
SFlags flags = Style_Default,
|
||
|
SCFlags controls = SC_All,
|
||
|
SCFlags active = SC_None,
|
||
12 years ago
|
const TQStyleOption& = TQStyleOption::Default,
|
||
|
const TQWidget *widget = 0 ) const;
|
||
15 years ago
|
|
||
13 years ago
|
void drawComplexControlMask( TQ_ComplexControl control,
|
||
14 years ago
|
TQPainter *p,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
const ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQRect &r,
|
||
12 years ago
|
const TQStyleOption& = TQStyleOption::Default,
|
||
|
const TQWidget *widget = 0 ) const;
|
||
15 years ago
|
|
||
14 years ago
|
TQRect querySubControlMetrics( TQ_ComplexControl control,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
ControlElementFlags elementFlags,
|
||
15 years ago
|
SubControl subcontrol,
|
||
12 years ago
|
const TQStyleOption& opt = TQStyleOption::Default,
|
||
|
const TQWidget* widget = 0 ) const;
|
||
15 years ago
|
|
||
|
|
||
14 years ago
|
void drawItem( TQPainter *p,
|
||
|
const TQRect &r,
|
||
15 years ago
|
int flags,
|
||
14 years ago
|
const TQColorGroup &cg,
|
||
15 years ago
|
bool enabled,
|
||
14 years ago
|
const TQPixmap *pixmap,
|
||
|
const TQString &text,
|
||
15 years ago
|
int len = -1,
|
||
14 years ago
|
const TQColor *penColor = 0 ) const;
|
||
15 years ago
|
|
||
12 years ago
|
int pixelMetric( PixelMetric m, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQWidget *widget = 0 ) const;
|
||
15 years ago
|
|
||
12 years ago
|
int kPixelMetric( TDEStylePixelMetric m, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQWidget *widget = 0 ) const;
|
||
15 years ago
|
|
||
12 years ago
|
TQSize sizeFromContents( ContentsType contents,
|
||
12 years ago
|
const TQStyleControlElementData &ceData,
|
||
12 years ago
|
ControlElementFlags elementFlags,
|
||
14 years ago
|
const TQSize &contentSize,
|
||
12 years ago
|
const TQStyleOption& opt,
|
||
|
const TQWidget *widget = 0 ) const;
|
||
15 years ago
|
|
||
12 years ago
|
TQRect subRect (SubRect subrect, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQWidget * widget) const;
|
||
15 years ago
|
|
||
12 years ago
|
int styleHint(TQ_StyleHint, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags,
|
||
12 years ago
|
const TQStyleOption & = TQStyleOption::Default,
|
||
|
TQStyleHintReturn * = 0, const TQWidget * = 0 ) const;
|
||
|
|
||
15 years ago
|
protected:
|
||
12 years ago
|
virtual bool objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e );
|
||
15 years ago
|
|
||
|
private:
|
||
14 years ago
|
void setColorsNormal (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const;
|
||
|
void setColorsButton (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const;
|
||
|
void setColorsText (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const;
|
||
|
void setColorsHighlight (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled) const;
|
||
|
void setColorsByState (TQPainter* p, const TQColorGroup& cg, const TQColor& fg, const TQColor& bg, int flags, int highlight) const;
|
||
|
|
||
|
void drawRect (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const;
|
||
|
void drawRoundRect (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const;
|
||
|
void drawEllipse (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const;
|
||
14 years ago
|
void drawArrow (TQPainter* p, TQRect r, TQ_PrimitiveElement arrow, int offset = 0) const;
|
||
15 years ago
|
|
||
|
int basicLineWidth;
|
||
|
// Disable copy constructor and = operator
|
||
|
HighContrastStyle( const HighContrastStyle & );
|
||
|
HighContrastStyle& operator=( const HighContrastStyle & );
|
||
|
};
|
||
|
#endif
|