Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
livepatheffect-editor.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
5/* Authors:
6 * Jabiertxof
7 * Adam Belis (UX/Design)
8 *
9 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
10 */
11
12#ifndef LIVEPATHEFFECTEDITOR_H
13#define LIVEPATHEFFECTEDITOR_H
14
16#include "object/sp-lpe-item.h" // PathEffectList
19
20namespace Glib {
21class ValueBase;
22} // namespace Glib
23
24namespace Gtk {
25class Box;
26class Builder;
27class Button;
28class Expander;
29class Label;
30class ListBox;
31class ListStore;
32class Widget;
33} // namespace Gtk
34
35namespace Inkscape {
36class Selection;
37} // namespace Inkscape
38
40class Effect;
41class LPEObjectReference;
42} // namespace Inkscape::LivePathEffect
43
44class SPLPEItem;
45
46namespace Inkscape::UI::Dialog {
47
48/*
49 * @brief The LivePathEffectEditor class
50 */
51class LivePathEffectEditor final : public DialogBase
52{
53public:
56 void focus_dialog() override;
57 void move_list(int origin, int dest);
58
59 using LPEExpander = std::pair<Gtk::Expander *, PathEffectSharedPtr>;
60 void showParams(LPEExpander const &expanderdata, bool changed);
61
62private:
63 std::vector<LPEExpander> _LPEExpanders;
64 bool updating = false;
66 SPUse *_current_use = nullptr;
67 LPEExpander current_lperef = {nullptr, nullptr};
69 bool dnd = false;
70 Glib::RefPtr<Gtk::Builder> _builder;
71 Gtk::ListBox& LPEListBox;
72 int dndx = 0;
73 int dndy = 0;
74
75 struct LPEMetadata;
76 void add_lpes(UI::Widget::CompletionPopup &, bool symbolic, std::vector<LPEMetadata> &&lpes);
77 Glib::ustring get_tooltip(LivePathEffect::EffectType, Glib::ustring const &untranslated_label);
78
79 void clear_lpe_list();
81 void selectionModified(Inkscape::Selection *selection, unsigned flags) final;
83 void expanded_notify(Gtk::Expander *expander);
85 bool showWarning(std::string const &msg);
86 void toggleVisible(Inkscape::LivePathEffect::Effect *lpe, Gtk::Button *visbutton);
87 bool can_apply(LivePathEffect::EffectType, Glib::ustring const &item_type, bool has_clip, bool has_mask);
88 void removeEffect(Gtk::Expander * expander);
89 [[nodiscard]] bool on_drop(Gtk::Widget &widget,
90 Glib::ValueBase const &value, int pos_target);
91 void effect_list_reload(SPLPEItem *lpeitem);
92 void selection_info();
93 void clearMenu();
94 void setMenu();
95 bool lpeFlatten(PathEffectSharedPtr const &lperef);
97
98 void add_item_actions(PathEffectSharedPtr const &lperef,
99 Glib::ustring const &, Gtk::Widget &item,
100 bool is_first, bool is_last);
101 void enable_item_action(Gtk::Widget &item, Glib::ustring const &name, bool enabled);
102 void enable_fav_actions(Gtk::Widget &item, bool has_fav);
104 void (SPLPEItem::* const method)(),
105 Glib::ustring const &description);
107 void (LivePathEffect::Effect::* const method)());
109 Glib::ustring const &untranslated_label, Gtk::Widget &item,
110 bool has_fav);
111
113 Gtk::Box& _LPEContainer;
116 Gtk::ListBox&_LPEParentBox;
119 Glib::RefPtr<Gtk::ListStore> _LPEList;
120 Glib::RefPtr<Gtk::ListStore> _LPEListFilter;
122 Gtk::Widget *effectwidget = nullptr;
123 Gtk::Widget *popupwidg = nullptr;
124 GtkWidget *currentdrag = nullptr;
125 bool _reload_menu = false;
127 bool _freezeexpander = false;
128 Glib::ustring _item_type;
129 bool _has_clip = false;
130 bool _has_mask = false;
131 bool _experimental = false;
132};
133
134} // namespace Inkscape::UI::Dialog
135
136#endif // LIVEPATHEFFECTEDITOR_H
137
138/*
139 Local Variables:
140 mode:c++
141 c-file-style:"stroustrup"
142 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
143 indent-tabs-mode:nil
144 fill-column:99
145 End:
146*/
147// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Point origin
Definition aa.cpp:227
Simplified management of enumerations of LPE items with UI labels.
The set of selected SPObjects for a given document and layer model.
Definition selection.h:80
DialogBase is the base class for the dialog system.
Definition dialog-base.h:40
void do_item_action_favorite(PathEffectSharedPtr const &lpreref, Glib::ustring const &untranslated_label, Gtk::Widget &item, bool has_fav)
bool can_apply(LivePathEffect::EffectType, Glib::ustring const &item_type, bool has_clip, bool has_mask)
Glib::ustring get_tooltip(LivePathEffect::EffectType, Glib::ustring const &untranslated_label)
void onAdd(Inkscape::LivePathEffect::EffectType etype)
void add_item_actions(PathEffectSharedPtr const &lperef, Glib::ustring const &, Gtk::Widget &item, bool is_first, bool is_last)
void do_item_action_defaults(PathEffectSharedPtr const &lpreref, void(LivePathEffect::Effect::*const method)())
void onSelectionChanged(Inkscape::Selection *selection)
bool showWarning(std::string const &msg)
void enable_fav_actions(Gtk::Widget &item, bool has_fav)
void enable_item_action(Gtk::Widget &item, Glib::ustring const &name, bool enabled)
void selectionChanged(Inkscape::Selection *selection) final
void do_item_action_undoable(PathEffectSharedPtr const &lperef, void(SPLPEItem::*const method)(), Glib::ustring const &description)
Inkscape::UI::Widget::CompletionPopup _lpes_popup
bool lpeFlatten(PathEffectSharedPtr const &lperef)
void add_lpes(UI::Widget::CompletionPopup &, bool symbolic, std::vector< LPEMetadata > &&lpes)
void toggleVisible(Inkscape::LivePathEffect::Effect *lpe, Gtk::Button *visbutton)
void selectionModified(Inkscape::Selection *selection, unsigned flags) final
bool on_drop(Gtk::Widget &widget, Glib::ValueBase const &value, int pos_target)
std::pair< Gtk::Expander *, PathEffectSharedPtr > LPEExpander
const LivePathEffect::EnumEffectDataConverter< LivePathEffect::EffectType > & converter
void showParams(LPEExpander const &expanderdata, bool changed)
Definition sp-use.h:25
Glib::ustring msg
A base class for all dialogs.
SPItem * item
Definition desktop.h:50
Live Path Effects code.
Dialog code.
Definition desktop.h:117
Helper class to stream background task notifications as a series of messages.
Base class for live path effect items.
std::list< PathEffectSharedPtr > PathEffectList
Definition sp-lpe-item.h:45
std::shared_ptr< Inkscape::LivePathEffect::LPEObjectReference > PathEffectSharedPtr
Definition sp-lpe-item.h:44
Glib::ustring name
Definition toolbars.cpp:55