1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef INKSCAPE_LPE_MEASURE_SEGMENTS_H
3 #define INKSCAPE_LPE_MEASURE_SEGMENTS_H
4 
5 /*
6  * Author(s):
7  *     Jabiertxo Arraiza Cenoz <jabier.arraiza@marker.es>
8  *
9  * Copyright (C) 2014 Author(s)
10  *
11  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
12  */
13 #include <gtkmm.h>
14 #include "live_effects/effect.h"
15 #include "live_effects/parameter/enum.h"
16 #include "live_effects/parameter/originalitemarray.h"
17 #include "live_effects/parameter/bool.h"
18 #include "live_effects/parameter/colorpicker.h"
19 #include "live_effects/parameter/fontbutton.h"
20 #include "live_effects/parameter/message.h"
21 #include "live_effects/parameter/text.h"
22 #include "live_effects/parameter/unit.h"
23 
24 
25 namespace Inkscape {
26 namespace LivePathEffect {
27 
28 enum OrientationMethod {
29     OM_HORIZONTAL,
30     OM_VERTICAL,
31     OM_PARALLEL,
32     OM_END
33 };
34 
35 class LPEMeasureSegments : public Effect {
36 public:
37     LPEMeasureSegments(LivePathEffectObject *lpeobject);
38     ~LPEMeasureSegments() override;
39     void doOnApply(SPLPEItem const* lpeitem) override;
40     void doBeforeEffect (SPLPEItem const* lpeitem) override;
41     void doOnRemove(SPLPEItem const* /*lpeitem*/) override;
doEffect(SPCurve * curve)42     void doEffect (SPCurve * curve) override {};
43     void doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) override;
44     Gtk::Widget * newWidget() override;
45     void createLine(Geom::Point start,Geom::Point end, Glib::ustring name, size_t counter, bool main, bool remove, bool arrows = false);
46     void createTextLabel(Geom::Point pos, size_t counter, double length, Geom::Coord angle, bool remove, bool valid);
47     void createArrowMarker(Glib::ustring mode);
48     bool isWhitelist(size_t i,  std::string listsegments, bool whitelist);
49     void on_my_switch_page(Gtk::Widget* page, guint page_number);
50 private:
51     UnitParam unit;
52     EnumParam<OrientationMethod> orientation;
53     ColorPickerParam coloropacity;
54     FontButtonParam fontbutton;
55     ScalarParam precision;
56     ScalarParam fix_overlaps;
57     ScalarParam position;
58     ScalarParam text_top_bottom;
59     ScalarParam helpline_distance;
60     ScalarParam helpline_overlap;
61     ScalarParam line_width;
62     ScalarParam scale;
63     TextParam format;
64     TextParam blacklist;
65     BoolParam active_projection;
66     BoolParam whitelist;
67     BoolParam showindex;
68     BoolParam arrows_outside;
69     BoolParam flip_side;
70     BoolParam scale_sensitive;
71     BoolParam local_locale;
72     BoolParam rotate_anotation;
73     BoolParam hide_back;
74     BoolParam hide_arrows;
75     BoolParam onbbox;
76     BoolParam bboxonly;
77     BoolParam centers;
78     BoolParam maxmin;
79     BoolParam smallx100;
80     OriginalItemArrayParam linked_items;
81     ScalarParam distance_projection;
82     ScalarParam angle_projection;
83     BoolParam avoid_overlapping;
84     MessageParam helpdata;
85     Glib::ustring display_unit;
86     double fontsize;
87     double anotation_width;
88     double previous_size;
89     guint32 rgb32;
90     double arrow_gap;
91     guint pagenumber;
92     gchar const* locale_base;
93     LPEMeasureSegments(const LPEMeasureSegments &) = delete;
94     LPEMeasureSegments &operator=(const LPEMeasureSegments &) = delete;
95 
96 };
97 
98 } //namespace LivePathEffect
99 } //namespace Inkscape
100 
101 #endif
102 
103 /*
104   Local Variables:
105   mode:c++
106   c-file-style:"stroustrup"
107   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
108   indent-tabs-mode:nil
109   fill-column:99
110   End:
111 */
112 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
113