KHTML
LinearGradientAttributes.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef LinearGradientAttributes_h
00023 #define LinearGradientAttributes_h
00024
00025 #include "GradientAttributes.h"
00026
00027 #if ENABLE(SVG)
00028
00029 namespace WebCore
00030 {
00031 struct LinearGradientAttributes : GradientAttributes {
00032 LinearGradientAttributes()
00033 : m_x1(0.0)
00034 , m_y1(0.0)
00035 , m_x2(1.0)
00036 , m_y2(0.0)
00037 , m_x1Set(false)
00038 , m_y1Set(false)
00039 , m_x2Set(false)
00040 , m_y2Set(false)
00041 {
00042 }
00043
00044 double x1() const { return m_x1; }
00045 double y1() const { return m_y1; }
00046 double x2() const { return m_x2; }
00047 double y2() const { return m_y2; }
00048
00049 void setX1(double value) { m_x1 = value; m_x1Set = true; }
00050 void setY1(double value) { m_y1 = value; m_y1Set = true; }
00051 void setX2(double value) { m_x2 = value; m_x2Set = true; }
00052 void setY2(double value) { m_y2 = value; m_y2Set = true; }
00053
00054 bool hasX1() const { return m_x1Set; }
00055 bool hasY1() const { return m_y1Set; }
00056 bool hasX2() const { return m_x2Set; }
00057 bool hasY2() const { return m_y2Set; }
00058
00059 private:
00060
00061 double m_x1;
00062 double m_y1;
00063 double m_x2;
00064 double m_y2;
00065
00066
00067 bool m_x1Set : 1;
00068 bool m_y1Set : 1;
00069 bool m_x2Set : 1;
00070 bool m_y2Set : 1;
00071 };
00072
00073 }
00074
00075 #endif // ENABLE(SVG)
00076 #endif
00077
00078