Code

Option to display measuring info in geometry tool
[inkscape.git] / src / lpe-tool-context.h
1 #ifndef SP_LPETOOL_CONTEXT_H_SEEN
2 #define SP_LPETOOL_CONTEXT_H_SEEN
4 /*
5  * LPEToolContext: a context for a generic tool composed of subtools that are given by LPEs
6  *
7  * Authors:
8  *   Maximilian Albert <maximilian.albert@gmail.com>
9  *
10  * Copyright (C) 1998 The Free Software Foundation
11  * Copyright (C) 1999-2002 authors
12  * Copyright (C) 2001-2002 Ximian, Inc.
13  * Copyright (C) 2008 Maximilian Albert
14  *
15  * Released under GNU GPL, read the file 'COPYING' for more information
16  */
18 #include "pen-context.h"
19 #include "helper/units.h"
21 #define SP_TYPE_LPETOOL_CONTEXT (sp_lpetool_context_get_type())
22 #define SP_LPETOOL_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_LPETOOL_CONTEXT, SPLPEToolContext))
23 #define SP_LPETOOL_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SP_TYPE_LPETOOL_CONTEXT, SPLPEToolContextClass))
24 #define SP_IS_LPETOOL_CONTEXT(o) (GTK_CHECK_TYPE((o), SP_TYPE_LPETOOL_CONTEXT))
25 #define SP_IS_LPETOOL_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE((k), SP_TYPE_LPETOOL_CONTEXT))
27 class SPLPEToolContext;
28 class SPLPEToolContextClass;
30 /* This is the list of subtools from which the toolbar of the LPETool is built automatically */
31 extern const int num_subtools;
33 extern Inkscape::LivePathEffect::EffectType lpesubtools[];
35 enum LPEToolState {
36     LPETOOL_STATE_PEN,
37     LPETOOL_STATE_NODE
38 };
40 namespace Inkscape {
41 class Selection;
42 }
44 class ShapeEditor;
46 struct SPLPEToolContext : public SPPenContext {
47     ShapeEditor* shape_editor;
48     SPCanvasItem *canvas_bbox;
49     Inkscape::LivePathEffect::EffectType mode;
51     std::map<SPPath *, SPCanvasItem*> *measuring_items;
53     sigc::connection sel_changed_connection;
54     sigc::connection sel_modified_connection;
55 };
57 struct SPLPEToolContextClass : public SPEventContextClass{};
59 int lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type);
60 int lpetool_item_has_construction(SPLPEToolContext *lc, SPItem *item);
61 bool lpetool_try_construction(SPLPEToolContext *lc, Inkscape::LivePathEffect::EffectType const type);
62 void lpetool_context_switch_mode(SPLPEToolContext *lc, Inkscape::LivePathEffect::EffectType const type);
63 void lpetool_get_limiting_bbox_corners(SPDocument *document, Geom::Point &A, Geom::Point &B);
64 void lpetool_context_reset_limiting_bbox(SPLPEToolContext *lc);
65 void lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *selection = NULL);
66 void lpetool_delete_measuring_items(SPLPEToolContext *lc);
67 void lpetool_update_measuring_items(SPLPEToolContext *lc);
68 void lpetool_show_measuring_info(SPLPEToolContext *lc, bool show = true);
70 GType sp_lpetool_context_get_type(void);
72 #endif // SP_LPETOOL_CONTEXT_H_SEEN
74 /*
75   Local Variables:
76   mode:c++
77   c-file-style:"stroustrup"
78   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
79   indent-tabs-mode:nil
80   fill-column:99
81   End:
82 */
83 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :