15#include <glibmm/i18n.h>
16#include <glibmm/utility.h>
17#include <gtkmm/button.h>
18#include <gtkmm/label.h>
19#include <gtkmm/image.h>
45namespace LivePathEffect {
49 Effect* effect,
const gchar * default_value)
54 must_recalculate_pwd2(false),
90 if (lpeitems.size() == 1) {
126 std::vector<SPObject *> objs;
135 objs.push_back(linked_obj);
150 if (strvalue[0] ==
'#') {
153 Glib::ustring id_tmp;
157 if (tmpsuccessor && tmpsuccessor->
getId()) {
158 id_tmp = tmpsuccessor->
getId();
159 id_tmp.insert(id_tmp.begin(),
'#');
165 href = g_strdup(id_tmp.empty() ? strvalue : id_tmp.c_str());
176 g_warning(
"%s", e.what());
223 auto const _widget = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
225 auto const pLabel = Gtk::make_managed<Gtk::Label>(
param_label);
228 Gtk::Image * pIcon =
nullptr;
229 Gtk::Button * pButton =
nullptr;
231 pIcon = Gtk::manage(
sp_get_icon_image(
"tool-node-editor", Gtk::IconSize::NORMAL));
232 pButton = Gtk::make_managed<Gtk::Button>();
233 pButton->set_has_frame(
false);
234 pButton->set_child(*pIcon);
237 pButton->set_tooltip_text(_(
"Edit on-canvas"));
242 pButton = Gtk::make_managed<Gtk::Button>();
243 pButton->set_has_frame(
false);
244 pButton->set_child(*pIcon);
248 pButton->set_tooltip_text(_(
"Copy path"));
253 pButton = Gtk::make_managed<Gtk::Button>();
254 pButton->set_has_frame(
false);
255 pButton->set_child(*pIcon);
258 pButton->set_tooltip_text(_(
"Paste path"));
262 pButton = Gtk::make_managed<Gtk::Button>();
263 pButton->set_has_frame(
false);
264 pButton->set_child(*pIcon);
267 pButton->set_tooltip_text(_(
"Link to path in clipboard"));
286 std::set<ShapeRecord> shapes;
289 r.
role = SHAPE_ROLE_LPE_PARAM;
304 nt->_multipath->setItems(shapes);
373 if (newpath.
empty()) {
411 if ( to ==
nullptr ) {
417 if (is<SPItem>(to)) {
460 if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
461 SP_OBJECT_CHILD_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG))
475 if (!
_updating && flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
476 SP_OBJECT_CHILD_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG))
478 std::optional<SPCurve>
curve;
479 if (
auto shape = cast<SPShape>(linked_obj)) {
487 auto text = cast<SPText>(linked_obj);
489 bool hidden = text->isHidden();
492 text->setHidden(
false);
493 curve = text->getNormalizedBpath();
494 text->setHidden(
true);
502 curve = text->getNormalizedBpath();
530 SPItem *
item = SP_ACTIVE_DESKTOP->getSelection()->singleItem();
531 if (
item !=
nullptr) {
543 SPItem *
item = SP_ACTIVE_DESKTOP->getSelection()->singleItem();
544 std::string svgd_new;
545 if (
item !=
nullptr) {
549 svgd = svgd_new.c_str();
576 if (pathid.empty()) {
581 pathid.insert(pathid.begin(),
'#');
582 if (
href && strcmp(pathid.c_str(),
href) == 0 ) {
TODO: insert short description here.
3x3 matrix representing an affine transformation.
Affine inverse() const
Compute the inverse matrix.
Adaptor that creates 2D functions from 1D ones.
void clear()
Remove all paths from the vector.
bool empty() const
Check whether the vector contains any paths.
Function defined as discrete pieces.
void concat(const Piecewise< T > &other)
RAII-style mechanism for creating a temporary undo-insensitive context.
bool isOnClipboard()
The lpe is on clipboard.
std::vector< SPLPEItem * > getCurrrentLPEItems() const
void makeUndoDone(Glib::ustring message)
LivePathEffectObject * getLPEObj()
Inkscape::Display::TemporaryItem * ownerlocator
void setUpdating(bool updating)
Glib::ustring param_tooltip
void connect_selection_changed()
void param_write_to_repr(const char *svgd)
Glib::ustring param_label
void linked_transformed(Geom::Affine const *rel_transf, SPItem *moved_item)
Geom::PathVector const & get_pathvector() const
bool param_readSVGValue(const gchar *strvalue) override
virtual void linked_modified_callback(SPObject *linked_obj, guint flags)
sigc::connection ref_changed_connection
sigc::connection linked_modified_connection
void linked_deleted(SPObject *deleted)
void param_editOncanvas(SPItem *item, SPDesktop *dt) override
Geom::Piecewise< Geom::D2< Geom::SBasis > > const & get_pwd2()
void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector< Geom::PathVector > &hp_vec) override
void set_new_value(Geom::PathVector const &newpath, bool write_to_svg)
void param_setup_nodepath(Inkscape::NodePath::Path *np) override
sigc::connection linked_deleted_connection
void paste_param_path(const char *svgd)
void linkitem(Glib::ustring pathid)
void param_set_default() override
void on_copy_button_click()
bool must_recalculate_pwd2
void on_link_button_click()
PathParam(const Glib::ustring &label, const Glib::ustring &tip, const Glib::ustring &key, Inkscape::UI::Widget::Registry *wr, Effect *effect, const gchar *default_value="M0,0 L1,1")
sigc::signal< void()> signal_path_changed
void start_listening(SPObject *to)
std::vector< SPObject * > param_get_satellites() override
Glib::ustring param_getSVGValue() const override
void param_transform_multiply(Geom::Affine const &postmul, bool set) override
void on_edit_button_click()
void ref_changed(SPObject *old_ref, SPObject *new_ref)
void set_buttons(bool edit_button, bool copy_button, bool paste_button, bool link_button)
sigc::signal< void()> signal_path_pasted
sigc::connection linked_transformed_connection
Geom::PathVector _pathvector
void on_paste_button_click()
void linked_modified(SPObject *linked_obj, guint flags)
Glib::ustring param_getDefaultSVGValue() const override
void param_update_default(const gchar *default_value) override
void param_set_and_write_default()
Geom::Affine get_relative_affine()
Geom::Piecewise< Geom::D2< Geom::SBasis > > _pwd2
Gtk::Widget * param_newWidget() override
SPItem * getObject() const
System-wide clipboard manager.
virtual void copyPathParameter(Inkscape::LivePathEffect::PathParam *)=0
static ClipboardManager * get()
virtual Glib::ustring getShapeOrTextObjectId(SPDesktop *desktop)=0
virtual Glib::ustring getPathParameter(SPDesktop *desktop)=0
void detach()
Detaches from the currently attached URI target, if any; the current referrent is signaled as NULL.
bool isAttached() const
Returns true if there is currently an attached URI.
sigc::signal< void(SPObject *, SPObject *)> changedSignal()
Accessor for the referrent change notification signal; this signal is emitted whenever the URIReferen...
void attach(URI const &uri)
Attaches to a URI, relative to the specified document.
Represents an URI as per RFC 2396.
static std::optional< SPCurve > ptr_to_opt(T const &p)
To do: update description of desktop.
SPDocument * getDocument() const
Inkscape::UI::Tools::ToolBase * getTool() const
Typed SVG document implementation.
SPObject * getObjectByHref(std::string const &href) const
Base class for visual SVG elements.
Geom::Affine i2dt_affine() const
Returns the transformation from item to desktop coords.
Geom::Affine getRelativeTransform(SPObject const *obj) const
Geom::Affine i2doc_affine() const
Returns the accumulated transformation of the item and all its ancestors, including root's viewport.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
void requestModified(unsigned int flags)
Requests that a modification notification signal be emitted later (e.g.
sigc::connection connectDelete(sigc::slot< void(SPObject *)> slot)
Connects a slot to be called when an object is deleted.
char const * getId() const
Returns the objects current ID string.
sigc::connection connectModified(sigc::slot< void(SPObject *, unsigned int)> slot)
Connects to the modification notification signal.
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
System-wide clipboard management - class declaration.
Lifts one dimensional objects into 2D.
Editable view implementation.
TODO: insert short description here.
Gtk::Image * sp_get_icon_image(Glib::ustring const &icon_name, int size)
Multi path manipulator - a tool component that edits multiple paths at once.
PathVector path_from_piecewise(Piecewise< D2< SBasis > > const &B, double tol, bool only_cubicbeziers=false)
Make a path from a d2 sbasis.
Affine identity()
Create an identity matrix.
void pack_start(Gtk::Box &box, Gtk::Widget &child, bool const expand, bool const fill, unsigned const padding)
Adds child to box, packed with reference to the start of box.
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
Helpers for using Gtk::Boxes, encapsulating large changes between GTK3 & GTK4.
PathVector - a sequence of subpaths.
Conversion between SBasis and Bezier basis polynomials.
Structures that store data needed for shape editing which are not contained directly in the XML node.
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
Geom::Affine edit_transform
parse SVG path specifications
Geom::PathVector sp_svg_read_pathv(char const *str)
static void sp_svg_write_path(Inkscape::SVG::PathString &str, Geom::Path const &p, bool normalize=false)