home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scpainterexbase.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-09  |  4.5 KB  |  132 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /* This file is part of the KDE project
  8.    Copyright (C) 2001, 2002, 2003 The Karbon Developers
  9.  
  10.    This library is free software; you can redistribute it and/or
  11.    modify it under the terms of the GNU Library General Public
  12.    License as published by the Free Software Foundation; either
  13.    version 2 of the License, or (at your option) any later version.
  14.  
  15.    This library is distributed in the hope that it will be useful,
  16.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.    Library General Public License for more details.
  19.  
  20.    You should have received a copy of the GNU Library General Public License
  21.    along with this library; see the file COPYING.LIB.  If not, write to
  22.    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  23.    Boston, MA 02111-1307, USA.
  24. */
  25. /* Adapted for Scribus 22.08.2003 by Franz Schmid */
  26. /* Adapted for Scribus 15.01.2006 by Jean Ghali */
  27.  
  28. #ifndef __SCPAINTEREXBASE_H__
  29. #define __SCPAINTEREXBASE_H__
  30.  
  31. #include <QColor>
  32. #include <QFont>
  33. #include <QGlobalStatic>
  34. #include <QList>
  35. #include <QMatrix>
  36. #include <QPixmap>
  37. #include <QStack>
  38.  
  39. #include "scribusapi.h"
  40. #include "scconfig.h"
  41. #include "fpoint.h"
  42. #include "fpointarray.h"
  43. #include "vgradientex.h"
  44. #include "sccolorshade.h"
  45. #include "scimage.h"
  46.  
  47. class ScPattern;
  48.  
  49. class SCRIBUS_API ScPainterExBase
  50. {
  51. protected:
  52.     int m_capabilities;
  53.     ScPainterExBase(void);
  54. public:
  55.  
  56.     virtual ~ScPainterExBase() {};
  57.     enum FillMode { None, Solid, Gradient, Pattern };
  58.     enum ColorMode { rgbMode = 1, cmykMode = 2 };
  59.     enum ImageMode { cmykImages, rgbImages, rgbProofImages, rawImages };
  60.     enum Capabilities{ basic = 0, transparencies = 1, patterns = 2 };
  61.  
  62.     virtual Capabilities capabilities() { return basic; }
  63.     virtual bool hasCapability(Capabilities cap) { return ((m_capabilities & (int) cap) != 0); }
  64.  
  65.     virtual int supportedColorModes() = 0;
  66.     virtual ColorMode preferredColorMode() = 0;
  67.     virtual ImageMode imageMode() = 0;
  68.     
  69.     virtual void begin() = 0;
  70.     virtual void end() = 0;
  71.     virtual void clear() = 0;
  72.     virtual void clear( ScColorShade& ) = 0;
  73.  
  74.     // matrix manipulation
  75.     virtual void setWorldMatrix( const QMatrix & ) = 0;
  76.     virtual const QMatrix worldMatrix() = 0;
  77.     virtual void translate( double, double ) = 0;
  78.     virtual void rotate( double ) = 0;
  79.     virtual void scale( double, double ) = 0;
  80.  
  81.     // drawing
  82.     virtual void moveTo( const double &, const double & ) = 0;
  83.     virtual void lineTo( const double &, const double & ) = 0;
  84.     virtual void curveTo( FPoint p1, FPoint p2, FPoint p3 ) = 0;
  85.     virtual void newPath() = 0;
  86.     virtual void fillTextPath() = 0;
  87.     virtual void strokeTextPath() = 0;
  88.     virtual void fillPath() = 0;
  89.     virtual void strokePath() = 0;
  90.     virtual void setFillRule( bool fillRule ) = 0;
  91.     virtual bool fillRule()  = 0;
  92.     virtual void setFillMode( int fill ) = 0;
  93.     virtual int  fillMode() = 0;
  94.     virtual void setGradient( VGradientEx::Type mode, FPoint orig, FPoint vec, FPoint foc = FPoint(0,0) ) = 0;
  95.     virtual void setPattern ( ScPattern* pattern, QMatrix& patternTransform ) = 0;
  96.     virtual void setClipPath() = 0;
  97.  
  98.     virtual void drawImage( ScImage *image, ScPainterExBase::ImageMode mode ) = 0;
  99.     virtual void setupPolygon(FPointArray *points, bool closed = true) = 0;
  100.     virtual void drawPolygon() = 0;
  101.     virtual void drawPolyLine() = 0;
  102.     virtual void drawLine(FPoint start, FPoint end) = 0;
  103.     virtual void drawRect(double, double, double, double) = 0;
  104.  
  105.     // pen + brush
  106.     virtual ScColorShade pen() = 0;
  107.     virtual ScColorShade brush() = 0;
  108.     virtual void setPen( const ScColorShade &c ) = 0;
  109.     virtual void setPen( const ScColorShade &c, double w, Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo ) = 0;
  110.     virtual void setPenOpacity( double op ) = 0;
  111.     virtual void setLineWidth( double w) = 0;
  112.     virtual void setDash(const QVector<double>& array, double ofs) = 0;
  113.     virtual void setBrush( const ScColorShade & ) = 0;
  114.     virtual void setBrushOpacity( double op ) = 0;
  115.     virtual void setOpacity( double op ) = 0;
  116.     virtual void setFont( const QFont &f ) = 0;
  117.     virtual QFont font() = 0;
  118.  
  119.     // stack management
  120.     virtual void save() = 0;
  121.     virtual void restore() = 0;
  122.  
  123.     virtual void setRasterOp( int op ) = 0;
  124.  
  125.     VGradientEx m_fillGradient;
  126.     VGradientEx m_strokeGradient;
  127.     ScPattern*  m_pattern;
  128.     QMatrix     m_patternTransform;
  129. };
  130.  
  131. #endif
  132.