tdecore
ksvgiconpainter.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSVGIconPainter_H
00022 #define KSVGIconPainter_H
00023
00024 #include <libart_lgpl/art_render.h>
00025 #include <libart_lgpl/art_render_gradient.h>
00026
00027 class TQImage;
00028 class TQColor;
00029 class TQWMatrix;
00030 class TQDomElement;
00031 class TQPointArray;
00032
00033 class TDECORE_EXPORT KSVGIconPainter
00034 {
00035 public:
00036 KSVGIconPainter(int width, int height);
00037 ~KSVGIconPainter();
00038
00039 void setDrawWidth(int dwidth);
00040 void setDrawHeight(int dheight);
00041
00042 TQImage *image();
00043
00044 TQWMatrix *worldMatrix();
00045
00046 void finish();
00047
00048 void setUseFill(bool fill);
00049 void setUseStroke(bool stroke);
00050
00051 void setStrokeWidth(double width);
00052 void setStrokeMiterLimit(const TQString &miter);
00053 void setCapStyle(const TQString &cap);
00054 void setJoinStyle(const TQString &join);
00055 void setStrokeColor(const TQString &stroke);
00056 void setFillColor(const TQString &fill);
00057 void setFillRule(const TQString &fillRule);
00058 void setOpacity(const TQString &opacity);
00059 void setFillOpacity(const TQString &fillOpacity);
00060 void setStrokeOpacity(const TQString &strokeOpacity);
00061 void setStrokeDashOffset(const TQString &dashOffset);
00062 void setStrokeDashArray(const TQString &dashes);
00063
00064 void setWorldMatrix(TQWMatrix *worldMatrix);
00065 void setClippingRect(int x, int y, int w, int h);
00066
00067 void drawRectangle(double x, double y, double w, double h, double rx, double ry);
00068 void drawEllipse(double cx, double cy, double rx, double ry);
00069 void drawLine(double x1, double y1, double x2, double y2);
00070 void drawPolyline(TQPointArray polyArray, int points = -1);
00071 void drawPolygon(TQPointArray polyArray);
00072 void drawPath(const TQString &data, bool fill);
00073 void drawImage(double x, double y, TQImage &image);
00074
00075 TQColor parseColor(const TQString ¶m);
00076 TQ_UINT32 toArtColor(const TQColor &color);
00077 TQ_UINT32 parseOpacity(const TQString &data);
00078
00079 double toPixel(const TQString &s, bool hmode);
00080 double dpi();
00081
00082 ArtGradientLinear *linearGradient(const TQString &id);
00083 void addLinearGradient(const TQString &id, ArtGradientLinear *gradient);
00084
00085 TQDomElement linearGradientElement(ArtGradientLinear *linear);
00086 void addLinearGradientElement(ArtGradientLinear *gradient, TQDomElement element);
00087
00088 ArtGradientRadial *radialGradient(const TQString &id);
00089 void addRadialGradient(const TQString &id, ArtGradientRadial *gradient);
00090
00091 TQDomElement radialGradientElement(ArtGradientRadial *radial);
00092 void addRadialGradientElement(ArtGradientRadial *gradient, TQDomElement element);
00093
00094 TQWMatrix parseTransform(const TQString &transform);
00095
00096 private:
00097 struct Private;
00098 Private *d;
00099 };
00100
00101 #endif