summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-measure-segments.h
blob: 01b23cc6ea33bd760200d592369a12b79c406e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef INKSCAPE_LPE_MEASURE_SEGMENTS_H
#define INKSCAPE_LPE_MEASURE_SEGMENTS_H

/*
 * Author(s):
 *     Jabiertxo Arraiza Cenoz <jabier.arraiza@marker.es>
 *
 * Copyright (C) 2014 Author(s)
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */
#include <gtkmm.h>

#include "live_effects/effect.h"
#include "live_effects/parameter/bool.h"
#include "live_effects/parameter/colorpicker.h"
#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/fontbutton.h"
#include "live_effects/parameter/message.h"
#include "live_effects/parameter/satellitearray.h"
#include "live_effects/parameter/text.h"
#include "live_effects/parameter/unit.h"

namespace Inkscape {
namespace LivePathEffect {

enum OrientationMethod {
    OM_HORIZONTAL,
    OM_VERTICAL,
    OM_PARALLEL,
    OM_END
};

class LPEMeasureSegments : public Effect {
public:
    LPEMeasureSegments(LivePathEffectObject *lpeobject);
    ~LPEMeasureSegments() override;
    void doOnApply(SPLPEItem const* lpeitem) override;
    void doBeforeEffect (SPLPEItem const* lpeitem) override;
    void doOnRemove(SPLPEItem const* /*lpeitem*/) override;
    void doEffect (SPCurve * curve) override {};
    void doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) override;
    bool doOnOpen(SPLPEItem const *lpeitem) override;
    void processObjects(LPEAction lpe_action) override;
    Gtk::Widget * newWidget() override;
    void createLine(Geom::Point start,Geom::Point end, Glib::ustring name, size_t counter, bool main, bool remove, bool arrows = false);
    void createTextLabel(Geom::Point pos, size_t counter, double length, Geom::Coord angle, bool remove, bool valid);
    void createArrowMarker(Glib::ustring mode);
    bool isWhitelist(size_t i,  std::string listsegments, bool whitelist);
    void on_my_switch_page(Gtk::Widget* page, guint page_number);
private:
    UnitParam unit;
    EnumParam<OrientationMethod> orientation;
    ColorPickerParam coloropacity;
    FontButtonParam fontbutton;
    ScalarParam precision;
    ScalarParam fix_overlaps;
    ScalarParam position;
    ScalarParam text_top_bottom;
    ScalarParam helpline_distance;
    ScalarParam helpline_overlap;
    ScalarParam line_width;
    ScalarParam scale;
    TextParam format;
    TextParam blacklist;
    BoolParam scale_sensitive;
    BoolParam active_projection;
    BoolParam whitelist;
    BoolParam showindex;
    BoolParam arrows_outside;
    BoolParam flip_side;
    BoolParam local_locale;
    BoolParam rotate_anotation;
    BoolParam hide_back;
    BoolParam hide_arrows;
    BoolParam onbbox;
    BoolParam bboxonly;
    BoolParam centers;
    BoolParam maxmin;
    BoolParam smallx100;
    std::vector<Glib::ustring> items;
    SatelliteArrayParam linked_items;
    ScalarParam distance_projection;
    ScalarParam angle_projection;
    BoolParam avoid_overlapping;
    MessageParam helpdata;
    Glib::ustring display_unit;
    double fontsize;
    double anotation_width;
    double previous_size;
    guint32 rgb32;
    double arrow_gap;
    guint pagenumber;
    gchar const* locale_base;
    size_t prevsatellitecount = 0;
    bool prev_active_projection = false;
    SPObject *parent = nullptr;
    LPEMeasureSegments(const LPEMeasureSegments &) = delete;
    LPEMeasureSegments &operator=(const LPEMeasureSegments &) = delete;

};

} //namespace LivePathEffect
} //namespace Inkscape

#endif

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :