1 /* AbiWord
2  * Copyright (C) 2003 Dom Lachowicz
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301 USA.
18  */
19 
20 #ifndef GR_TRANSFORM_H
21 #define GR_TRANSFORM_H
22 
23 #include "ut_types.h"
24 
25 class ABI_EXPORT GR_Transform
26 {
27   public:
28 	GR_Transform();
29 	GR_Transform (double a, double b, double c, double d, double e, double f);
30 	GR_Transform (const GR_Transform & op2);
31 
32 	static GR_Transform scale (double x, double y);
linearScale(double p)33 	static GR_Transform linearScale (double p) {
34 		return scale (p, p);
35 	}
36 	static GR_Transform rotate (double theta);
37 	static GR_Transform translate (double x, double y);
38 
getA()39 	inline double getA() const {return m_A;}
getB()40 	inline double getB() const {return m_B;}
getC()41 	inline double getC() const {return m_C;}
getD()42 	inline double getD() const {return m_D;}
getE()43 	inline double getE() const {return m_E;}
getF()44 	inline double getF() const {return m_F;}
45 
46 	bool operator == (const GR_Transform & op2) const;
47 	bool operator != (const GR_Transform & op2) const;
48 
49 	GR_Transform & operator = (const GR_Transform &op2);
50 	GR_Transform operator + (const GR_Transform &op2) const;
51 	GR_Transform & operator += (const GR_Transform &op2);
52 
53   private:
54 	double m_A;
55 	double m_B;
56 	double m_C;
57 	double m_D;
58 	double m_E;
59 	double m_F;
60 };
61 
62 #endif // GR_TRANSFORM_H
63