16#include <glibmm/i18n.h>
35 selection->unlinkRecursive(
true);
36 selection->pathUnion();
44 selection->unlinkRecursive(
true);
45 selection->pathDiff();
53 selection->unlinkRecursive(
true);
54 selection->pathIntersect();
62 selection->unlinkRecursive(
true);
63 selection->pathSymDiff();
71 selection->unlinkRecursive(
true);
80 selection->unlinkRecursive(
true);
81 selection->pathSlice();
111 selection->setList(boolean_builder.shape_commit(
true,
true));
120 selection->setList(boolean_builder.shape_commit(
true,
true));
163 Glib::Variant<double> d = Glib::VariantBase::cast_dynamic<Glib::Variant<double> >(value);
169 dt->getSelection()->unlinkRecursive(
true);
176 Glib::Variant<double> d = Glib::VariantBase::cast_dynamic<Glib::Variant<double> >(value);
182 dt->getSelection()->unlinkRecursive(
true);
224 auto action = win->lookup_action(
"shape-builder-mode");
225 auto saction = std::dynamic_pointer_cast<Gio::SimpleAction>(action);
226 saction->change_state((
int)value);
227 pref->
setInt(
"/tools/booleans/mode", value);
234 if (
auto action = win->lookup_action(
"shape-builder-replace")) {
236 action->get_state(active);
238 action->change_state(active);
239 pref->
setBool(
"/tools/booleans/replace", active);
244const Glib::ustring
SECTION = NC_(
"Action Section",
"Path");
249 {
"app.path-union", N_(
"Union"),
SECTION, N_(
"Create union of selected paths")},
250 {
"app.path-difference", N_(
"Difference"),
SECTION, N_(
"Create difference of selected paths (bottom minus top)")},
251 {
"app.path-intersection", N_(
"Intersection"),
SECTION, N_(
"Create intersection of selected paths")},
252 {
"app.path-exclusion", N_(
"Exclusion"),
SECTION, N_(
"Create exclusive OR of selected paths (those parts that belong to only one path)")},
253 {
"app.path-division", N_(
"Division"),
SECTION, N_(
"Cut the bottom path into pieces")},
254 {
"app.path-cut", N_(
"Cut Path"),
SECTION, N_(
"Cut the bottom path's stroke into pieces, removing fill")},
255 {
"app.path-combine", N_(
"Combine"),
SECTION, N_(
"Combine several paths into one")},
256 {
"app.path-break-apart", N_(
"Break Apart"),
SECTION, N_(
"Break selected paths into subpaths")},
257 {
"app.path-split", N_(
"Split Apart"),
SECTION, N_(
"Split selected paths into non-overlapping sections")},
258 {
"app.path-fracture", N_(
"Fracture"),
SECTION, N_(
"Fracture one or more overlapping objects into all possible segments")},
259 {
"app.path-flatten", NC_(
"Path flatten",
"Flatten"),
SECTION, N_(
"Flatten one or more overlapping objects into their visible parts")},
260 {
"app.path-fill-between-paths", N_(
"Fill between paths"),
SECTION, N_(
"Create a fill object using the selected paths")},
261 {
"app.path-simplify", N_(
"Simplify"),
SECTION, N_(
"Simplify selected paths (remove extra nodes)")},
263 {
"win.path-inset", N_(
"Inset"),
SECTION, N_(
"Inset selected paths")},
264 {
"win.path-offset", N_(
"Offset"),
SECTION, N_(
"Offset selected paths")},
265 {
"win.path-offset-dynamic", N_(
"Dynamic Offset"),
SECTION, N_(
"Create a dynamic offset object")},
266 {
"win.path-offset-linked", N_(
"Linked Offset"),
SECTION, N_(
"Create a dynamic offset object linked to the original path")},
267 {
"win.path-reverse", N_(
"Reverse"),
SECTION, N_(
"Reverse the direction of selected paths (useful for flipping markers)")},
268 {
"win.path-inset-screen", N_(
"Inset Screen"),
SECTION, N_(
"Inset selected paths by screen pixels")},
269 {
"win.path-offset-screen", N_(
"Offset Screen"),
SECTION, N_(
"Offset selected paths by screen pixels")},
271 {
"win.shape-builder-mode(0)", N_(
"Shape Builder: Add"),
SECTION, N_(
"Add shapes by clicking or clicking and dragging")},
272 {
"win.shape-builder-mode(1)", N_(
"Shape Builder: Delete"),
SECTION, N_(
"Remove shapes by clicking or clicking and dragging")},
273 {
"win.shape-builder-replace", N_(
"Replace Objects"),
SECTION, N_(
"Remove selected objects when shape building is completed")},
282 gapp->add_action(
"path-union", sigc::bind(sigc::ptr_fun(&
object_path_union), app));
287 gapp->add_action(
"path-cut", sigc::bind(sigc::ptr_fun(&
select_path_cut), app));
290 gapp->add_action(
"path-split", sigc::bind(sigc::ptr_fun(&
select_path_split), app));
293 gapp->add_action(
"path-fill-between-paths", sigc::bind(sigc::ptr_fun(&
fill_between_paths), app));
303 auto const Double = Glib::VariantType(Glib::VARIANT_TYPE_DOUBLE);
306 int current_mode = prefs->getInt(
"/tools/booleans/mode", 0);
307 bool replace = prefs->getBool(
"/tools/booleans/replace",
true);
310 win->add_action(
"path-inset", sigc::bind(sigc::ptr_fun(&
select_path_inset), win));
312 win->add_action_with_parameter(
"path-inset-screen", Double, sigc::bind(sigc::ptr_fun(&
select_path_inset_screen), win));
313 win->add_action_with_parameter(
"path-offset-screen", Double, sigc::bind(sigc::ptr_fun(&
select_path_offset_screen), win));
317 win->add_action_radio_integer(
"shape-builder-mode", sigc::bind(sigc::ptr_fun(&
shape_builder_mode), win), current_mode);
318 win->add_action_bool(
"shape-builder-replace", sigc::bind(sigc::ptr_fun(&
shape_builder_replace), win), replace);
void select_path_inset(InkscapeWindow *win)
void select_path_offset_dynamic(InkscapeWindow *win)
void select_path_reverse(InkscapeWindow *win)
const Glib::ustring SECTION
void select_path_exclusion(InkscapeApplication *app)
void select_path_fracture(InkscapeApplication *app)
void select_path_simplify(InkscapeApplication *app)
void select_path_intersection(InkscapeApplication *app)
void select_path_offset(InkscapeWindow *win)
void select_path_offset_screen(const Glib::VariantBase &value, InkscapeWindow *win)
void select_path_inset_screen(const Glib::VariantBase &value, InkscapeWindow *win)
void select_path_division(InkscapeApplication *app)
void select_path_flatten(InkscapeApplication *app)
void fill_between_paths(InkscapeApplication *app)
void shape_builder_replace(InkscapeWindow *win)
void select_path_cut(InkscapeApplication *app)
void select_path_combine(InkscapeApplication *app)
void object_path_union(InkscapeApplication *app)
void select_path_split(InkscapeApplication *app)
static const std::vector< std::vector< Glib::ustring > > raw_data_path
void select_path_offset_linked(InkscapeWindow *win)
void select_path_break_apart(InkscapeApplication *app)
void shape_builder_mode(int value, InkscapeWindow *win)
void select_path_difference(InkscapeApplication *app)
void add_actions_path(InkscapeApplication *app)
InkActionExtraData & get_action_extra_data()
Gio::Application * gio_app()
The Gio application instance, never NULL.
Inkscape::Selection * get_active_selection()
SPDesktop * get_desktop()
static void done(SPDocument *document, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
void breakApart(bool skip_undo=false, bool overlapping=true, bool silent=false)
void removeLPESRecursive(bool keep_paths)
bool strokesToPaths(bool legacy=false, bool skip_undo=false)
bool unlinkRecursive(const bool skip_undo=false, const bool force=false, const bool silent=false)
Recursively unlink any clones present in the current selection, including clones which are used to cl...
bool simplifyPaths(bool skip_undo=false)
void fillBetweenMany()
Creates a linked fill between all the objects in the current selection using the "Fill Between Many" ...
Preference storage class.
static Preferences * get()
Access the singleton Preferences object.
void setInt(Glib::ustring const &pref_path, int value)
Set an integer value.
void setBool(Glib::ustring const &pref_path, bool value)
Set a Boolean value.
To do: update description of desktop.
Inkscape::Selection * getSelection() const
Editable view implementation.
TODO: insert short description here.
Macro for icon names used in Inkscape.
Inkscape - An SVG editor.
void reverse(SPDesktop *dt)
void sp_selected_path_create_updating_offset_object_zero(SPDesktop *desktop)
void sp_selected_path_offset(SPDesktop *desktop)
void sp_selected_path_inset_screen(SPDesktop *desktop, double pixels)
void sp_selected_path_create_offset_object_zero(SPDesktop *desktop)
void sp_selected_path_offset_screen(SPDesktop *desktop, double pixels)
void sp_selected_path_inset(SPDesktop *desktop)
Singleton class to access the preferences file in a convenient way.