2
// --------------------------------------------------------------------
4
// --------------------------------------------------------------------
7
This file is part of the extensible drawing editor Ipe.
8
Copyright (C) 1993-2009 Otfried Cheong
10
Ipe is free software; you can redistribute it and/or modify it
11
under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 3 of the License, or
13
(at your option) any later version.
15
As a special exception, you have permission to link Ipe with the
16
CGAL library and distribute executables, as long as you follow the
17
requirements of the Gnu General Public License in regard to all of
18
the software in the executable aside from CGAL.
20
Ipe is distributed in the hope that it will be useful, but WITHOUT
21
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23
License for more details.
25
You should have received a copy of the GNU General Public License
26
along with Ipe; if not, you can find it at
27
"http://www.gnu.org/copyleft/gpl.html", or write to the Free
28
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37
// avoid including Lua headers here
38
typedef struct lua_State lua_State;
40
// --------------------------------------------------------------------
43
using namespace ipeqt;
45
extern void push_button(lua_State *L, int button);
47
class IpeTransformTool : public TransformTool {
49
IpeTransformTool(Canvas *canvas, Page *page, int view, TType type,
50
bool withShift, lua_State *L0, int method);
52
virtual void report();
58
class LuaTool : public Tool {
60
LuaTool(Canvas *canvas, lua_State *L0, int luatool);
63
void setColor(Color color) { iColor = color; }
65
virtual void mouseButton(int button, bool press);
66
virtual void mouseMove(int button);
67
virtual bool key(int code, int modifiers, String text);
74
class ShapeTool : public LuaTool {
76
enum TMarkType { EVertex = 1, ESplineCP, EBezierCP, ECenter,
77
ERadius, EMinor, ECurrent, EScissor,
80
ShapeTool(Canvas *canvas, lua_State *L0, int luatool);
82
void setShape(Shape shape, int which = 0);
84
void addMark(const Vector &v, TMarkType t);
86
virtual void draw(Painter &painter) const;
94
std::vector<SMark> iMarks;
97
class PasteTool : public LuaTool {
99
PasteTool(Canvas *canvas, lua_State *L0, int luatool, Object *obj);
102
void setMatrix(Matrix m) { iMatrix = m; }
104
virtual void draw(Painter &painter) const;
110
// --------------------------------------------------------------------