summaryrefslogtreecommitdiffstats
path: root/src/ui/toolbar/gradient-toolbar.h
blob: 58f5cff67bbde970fee776fdec62103790a677dd (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
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef SEEN_GRADIENT_TOOLBAR_H
#define SEEN_GRADIENT_TOOLBAR_H

/*
 * Gradient aux toolbar
 *
 * Authors:
 *   bulia byak <bulia@dr.com>
 *
 * Copyright (C) 2005 authors
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#include "toolbar.h"

#include <gtkmm/adjustment.h>

class SPDesktop;
class SPGradient;
class SPStop;
class SPObject;

namespace Gtk {
class ComboBoxText;
class RadioToolButton;
class ToolButton;
class ToolItem;
}

namespace Inkscape {
class Selection;

namespace UI {
namespace Tools {
class ToolBase;
}

namespace Widget {
class ComboToolItem;
class SpinButtonToolItem;
}

namespace Toolbar {
class GradientToolbar : public Toolbar {
private:
    std::vector<Gtk::RadioToolButton *> _new_type_buttons;
    std::vector<Gtk::RadioToolButton *> _new_fillstroke_buttons;
    UI::Widget::ComboToolItem *_select_cb;
    UI::Widget::ComboToolItem *_spread_cb;
    UI::Widget::ComboToolItem *_stop_cb;

    Gtk::ToolButton *_stops_add_item;
    Gtk::ToolButton *_stops_delete_item;
    Gtk::ToolButton *_stops_reverse_item;
    Gtk::ToggleToolButton *_linked_item;

    UI::Widget::SpinButtonToolItem *_offset_item;

    Glib::RefPtr<Gtk::Adjustment> _offset_adj;
    bool _offset_adj_changed;

    void new_type_changed(int mode);
    void new_fillstroke_changed(int mode);
    void gradient_changed(int active);
    SPGradient * get_selected_gradient();
    void spread_changed(int active);
    void stop_changed(int active);
    void select_dragger_by_stop(SPGradient          *gradient,
                                UI::Tools::ToolBase *ev);
    SPStop * get_selected_stop();
    void stop_set_offset();
    void stop_offset_adjustment_changed();
    void add_stop();
    void remove_stop();
    void reverse();
    void linked_changed();
    void check_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec);
    void selection_changed(Inkscape::Selection *selection);
    int update_stop_list( SPGradient *gradient, SPStop *new_stop, bool gr_multi);
    int select_stop_in_list(SPGradient *gradient, SPStop *new_stop);
    void select_stop_by_draggers(SPGradient *gradient, UI::Tools::ToolBase *ev);
    void selection_modified(Inkscape::Selection *selection, guint flags);
    void drag_selection_changed(gpointer dragger);
    void defs_release(SPObject * defs);
    void defs_modified(SPObject *defs, guint flags);

    sigc::connection _connection_changed;
    sigc::connection _connection_modified;
    sigc::connection _connection_subselection_changed;
    sigc::connection _connection_defs_release;
    sigc::connection _connection_defs_modified;

protected:
    GradientToolbar(SPDesktop *desktop);

public:
    static GtkWidget * create(SPDesktop *desktop);
};

}
}
}

#endif /* !SEEN_GRADIENT_TOOLBAR_H */