30#include <glibmm/i18n.h>
31#include <gtkmm/adjustment.h>
32#include <gtkmm/builder.h>
33#include <gtkmm/togglebutton.h>
78 _orthogonal_btn.set_active(prefs->getBool(
"/tools/connector/orthogonal"));
81 _directed_btn.set_active(prefs->getBool(
"/tools/connector/directedlayout"));
84 _overlap_btn.set_active(prefs->getBool(
"/tools/connector/avoidoverlaplayout"));
87 get_widget<Gtk::Button>(
builder,
"avoid_btn")
90 get_widget<Gtk::Button>(
builder,
"ignore_btn")
93 get_widget<Gtk::Button>(
builder,
"graph_btn")
130 auto const adj = btn.get_adjustment();
131 auto const path =
"/tools/connector/" +
name;
134 adj->signal_value_changed().connect(sigc::mem_fun(*
this, value_changed_mem_fun));
165 auto value = is_orthog ?
"orthogonal" :
"polyline";
167 bool modified =
false;
179 DocumentUndo::done(doc, is_orthog ? _(
"Set connector type: orthogonal"): _(
"Set connector type: polyline"), INKSCAPE_ICON(
"draw-connector"));
200 char value[G_ASCII_DTOSTR_BUF_SIZE];
201 g_ascii_dtostr(value, G_ASCII_DTOSTR_BUF_SIZE, newValue);
203 bool modified =
false;
215 DocumentUndo::done(doc, _(
"Change connector curvature"), INKSCAPE_ICON(
"draw-connector"));
229 if (!repr->attribute(
"inkscape:connector-spacing") &&
245 repr->setAttributeCssDouble(
"inkscape:connector-spacing",
_spacing_item.get_adjustment()->get_value());
248 bool modified =
false;
256 DocumentUndo::done(doc, _(
"Change connector spacing"), INKSCAPE_ICON(
"draw-connector"));
269 auto vec = std::vector<SPItem *>{tmp.begin(), tmp.end()};
272 prefs->setInt(
"/options/clonecompensation/value", saved_compensation);
289 if (
auto path = cast<SPPath>(selection->
singleItem())) {
291 _curvature_item.get_adjustment()->set_value(path->connEndPair.getCurvature());
306 static auto const connector_spacing_quark = g_quark_from_static_string(
"inkscape:connector-spacing");
307 if (
name == connector_spacing_quark) {
static void done(SPDocument *document, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
static bool getUndoSensitive(SPDocument const *document)
SPGroup * currentRoot() const
Returns current root (=bottom) layer.
SPItemRange items()
Returns a range of selected SPItems.
SPItem * singleItem()
Returns a single selected item.
double getDouble(Glib::ustring const &pref_path, double def=0.0, Glib::ustring const &unit="")
Retrieve a floating point value.
static Preferences * get()
Access the singleton Preferences object.
void setDouble(Glib::ustring const &pref_path, double value)
Set a floating point value.
void setBool(Glib::ustring const &pref_path, bool value)
Set a Boolean value.
The set of selected SPObjects for a given document and layer model.
sigc::connection connectChanged(sigc::slot< void(Selection *)> slot)
Connects a slot to be notified of selection changes.
Interface for refcounted XML nodes.
virtual void addObserver(NodeObserver &observer)=0
Add an object that will be notified of the changes to this node.
virtual void removeObserver(NodeObserver &observer)=0
Remove an object from the list of observers.
void handleSettingChange()
To do: update description of desktop.
SPDocument * getDocument() const
SPNamedView * getNamedView() const
Inkscape::Selection * getSelection() const
Inkscape::LayerManager & layerManager()
SPAvoidRef & getAvoidRef()
void setAttribute(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
Inkscape::XML::Node * updateRepr(unsigned int flags=SP_OBJECT_WRITE_EXT)
Updates the object's repr based on the object's state.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
void avoid_item_move(Geom::Affine const *, SPItem *moved_item)
std::vector< SPItem * > get_avoided_items(SPObject *from, SPDesktop *desktop, bool initialised)
A class for handling shape interaction with libavoid.
static const double defaultConnSpacing
static const double defaultConnCurvature
Editable view implementation.
TODO: insert short description here.
@ SP_CLONE_COMPENSATION_UNMOVED
void graphlayout(std::vector< SPItem * > const &items)
Takes a list of inkscape items, extracts the graph defined by connectors between them,...
Macro for icon names used in Inkscape.
Affine identity()
Create an identity matrix.
static R & anchor(R &r)
Increments the reference count of a anchored object.
static R & release(R &r)
Decrements the reference count of a anchored object.
W & get_widget(const Glib::RefPtr< Gtk::Builder > &builder, const char *id)
W & get_derived_widget(const Glib::RefPtr< Gtk::Builder > &builder, const char *id, Args &&... args)
Glib::RefPtr< Gtk::Builder > create_builder(const char *filename)
Glib::RefPtr< Gtk::Builder > builder