diff options
| author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-26 00:41:16 +0000 |
|---|---|---|
| committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-26 00:41:16 +0000 |
| commit | 698569f8428ca088f764d704034a1330517b98c0 (patch) | |
| tree | bf45be6946ebbbee9cce5a5bcf838f4c952d87e6 /chalk/ui/kcurve.h | |
| parent | 2785103a6bd4de55bd26d79e34d0fdd4b329a73a (diff) | |
| download | koffice-698569f8428ca088f764d704034a1330517b98c0.tar.gz koffice-698569f8428ca088f764d704034a1330517b98c0.zip | |
Finish rebranding of Krita as Chalk
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238363 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'chalk/ui/kcurve.h')
| -rw-r--r-- | chalk/ui/kcurve.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/chalk/ui/kcurve.h b/chalk/ui/kcurve.h new file mode 100644 index 000000000..820b5f5ad --- /dev/null +++ b/chalk/ui/kcurve.h @@ -0,0 +1,80 @@ +/* ============================================================ + * + * Copyright 2004-2005 by Gilles Caulier (original work as digikam curveswidget) + * Copyright 2005 by Casper Boemann (reworked to be generic) + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) + * any later version. + * + * This program 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 General Public License for more details. + * + * ============================================================ */ + +#ifndef KCURVE_H +#define KCURVE_H + +// TQt includes. + +#include <tqwidget.h> +#include <tqcolor.h> +#include <tqpair.h> +#include <tqsortedlist.h> +#include <koffice_export.h> +class KRITAUI_EXPORT KCurve : public TQWidget +{ +Q_OBJECT + TQ_OBJECT + +public: + KCurve(TQWidget *tqparent = 0, const char *name = 0, WFlags f = 0); + + virtual ~KCurve(); + + void reset(void); + void setCurveGuide(TQColor color); + void setPixmap(TQPixmap pix); + + +signals: + + void modified(void); + +protected: + + void keyPressEvent(TQKeyEvent *); + void paintEvent(TQPaintEvent *); + void mousePressEvent (TQMouseEvent * e); + void mouseReleaseEvent ( TQMouseEvent * e ); + void mouseMoveEvent ( TQMouseEvent * e ); + void leaveEvent ( TQEvent * ); + +public: + static double getCurveValue(TQPtrList<TQPair<double,double> > &curve, double x); + double getCurveValue(double x); + + TQPtrList<TQPair<double,double> > getCurve(); + void setCurve(TQPtrList<TQPair<double,double> >inlist); + +private: + double m_leftmost; + double m_rightmost; + TQPair<double,double> *m_grab_point; + bool m_dragging; + double m_grabOffsetX; + double m_grabOffsetY; + + bool m_readOnlyMode; + bool m_guideVisible; + TQColor m_colorGuide; + TQPtrList<TQPair<double,double> > m_points; + TQPixmap *m_pix; +}; + + +#endif /* KCURVE_H */ |
