Main Page | Class List | Directories | File List | Class Members | File Members | Related Pages

colorcircle.h

Go to the documentation of this file.
00001 // $Id: colorcircle.h,v 1.1 2005/06/06 13:26:20 rcr_muc Exp $
00002 // palette to choose color from
00003 // 2005-05-22 rcr
00004 
00005 #ifndef COLORCIRCLE_H
00006 #define COLORCIRCLE_H
00007 
00008 #include <qpixmap.h>
00009 #include <qwmatrix.h>
00010 #include <qsize.h>
00011 #include <qframe.h>
00012 #include <qpoint.h>
00013 
00014 #include "rcolor.h"
00015 
00016 class QPainter;
00017 
00018 class ColorCircle : public QFrame
00019 {
00020   Q_OBJECT
00021 
00022   QWMatrix wm;
00023   QSize palSize, frameSize;
00024   QPixmap cpm, tpm, bg;
00025   double innerRadius, outerRadius;
00026   double center;
00027   int icenter, irad, orad;
00028   int currentHue, currentSat, currentVal, currentAlpha;
00029   double circleWidth;
00030 
00031   void makeCircle();
00032   void makeTriangle( int );
00033   double arcTan( double, double );  // return value 0 < x < 2π
00034   void calcVertices( int, int*, int*, int*, int*, int*, int* );
00035   bool isInTriangle( int, int );
00036   void calcSV( int, int, int*, int* );
00037   void calcCoords( int*, int* );
00038 public:
00039   ColorCircle( QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
00040   ~ColorCircle();
00041   void setColor( const rColor& );
00042 
00043 protected:
00044   void drawContents( QPainter* );
00045   void mouseReleaseEvent( QMouseEvent* );
00046 
00047 signals:
00048   void colorChanged( const rColor& );
00049 };
00050 
00051 #endif // COLORCIRCLE_H

Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for colordlg $Revision:1.1$ by Rolf C. Rönnau using doxygen 1.4.2