33#include <giomm/themedicon.h>
34#include <glibmm/main.h>
35#include <gtkmm/adjustment.h>
37#include <gtkmm/button.h>
38#include <gtkmm/entry.h>
39#include <gtkmm/enums.h>
40#include <gtkmm/grid.h>
41#include <gtkmm/label.h>
42#include <gtkmm/listboxrow.h>
43#include <gtkmm/menubutton.h>
44#include <gtkmm/object.h>
45#include <gtkmm/popover.h>
46#include <gtkmm/popovermenu.h>
47#include <gtkmm/spinbutton.h>
48#include <gtkmm/togglebutton.h>
49#include <gtkmm/widget.h>
50#include <glibmm/convert.h>
51#include <gtkmm/image.h>
52#include <gtkmm/liststore.h>
53#include <gtkmm/sizegroup.h>
54#include <sigc++/adaptors/bind.h>
55#include <sigc++/functors/mem_fun.h>
66#include <sigc++/scoped_connection.h>
95class GridWidget final :
public Gtk::Box
101 SPGrid *getGrid() {
return _grid; }
102 XML::Node *getGridRepr() {
return _repr; }
106 XML::Node *_repr =
nullptr;
108 Gtk::Button* _delete = Gtk::make_managed<Gtk::Button>();
109 Gtk::MenuButton* _options = Gtk::make_managed<Gtk::MenuButton>();
110 Gtk::Popover* _opt_items = Gtk::make_managed<Gtk::Popover>();
111 Gtk::Image* _icon = Gtk::make_managed<Gtk::Image>();
112 Gtk::Label* _id = Gtk::make_managed<Gtk::Label>();
113 Gtk::MenuButton* _align = Gtk::make_managed<Gtk::MenuButton>();
114 Gtk::Popover* _align_popup = Gtk::make_managed<Gtk::Popover>();
116 UI::Widget::Registry _wr;
118 RegisteredSwitchButton *_enabled =
nullptr;
119 RegisteredCheckButton *_snap_visible_only =
nullptr;
120 RegisteredToggleButton *_visible =
nullptr;
121 RegisteredCheckButton *_dotted =
nullptr;
122 AlignmentSelector *_alignment =
nullptr;
124 RegisteredUnitMenu *_units =
nullptr;
125 RegisteredScalarUnit *_origin_x =
nullptr;
126 RegisteredScalarUnit *_origin_y =
nullptr;
127 RegisteredScalarUnit *_spacing_x =
nullptr;
128 RegisteredScalarUnit *_spacing_y =
nullptr;
129 RegisteredScalar *_angle_x =
nullptr;
130 RegisteredScalar *_angle_z =
nullptr;
131 RegisteredColorPicker *_grid_color =
nullptr;
132 RegisteredInteger *_no_of_lines =
nullptr;
133 RegisteredScalarUnit* _gap_x =
nullptr;
134 RegisteredScalarUnit* _gap_y =
nullptr;
135 RegisteredScalarUnit* _margin_x =
nullptr;
136 RegisteredScalarUnit* _margin_y =
nullptr;
137 Gtk::MenuButton* _angle_popup = Gtk::make_managed<Gtk::MenuButton>();
138 Gtk::Entry* _aspect_ratio =
nullptr;
140 sigc::scoped_connection _modified_signal;
153 gtk_widget_set_visible(
child,
true);
154 btn.set_child(*Gtk::manage(Glib::wrap(
child)));
155 btn.set_has_frame(
false);
161 auto const selection = tree_view.get_selection();
162 if (!selection)
return false;
164 auto const it = selection->get_selected();
165 if (!it)
return false;
167 auto const mi = Gtk::make_managed<UI::Widget::PopoverMenuItem>(_(
"_Remove"),
true);
168 mi->signal_activate().connect(slot);
169 auto const menu = Gtk::make_managed<UI::Widget::PopoverMenu>(Gtk::PositionType::BOTTOM);
175 menu->popup_at(tree_view, click->x, click->y);
179 auto const column = tree_view.get_column(0);
180 g_return_val_if_fail(column,
false);
181 auto rect = Gdk::Rectangle{};
182 tree_view.get_cell_area(Gtk::TreePath{it}, *column, rect);
183 menu->popup_at(tree_view, rect.get_x() + rect.get_width () / 2.0,
184 rect.get_y() + rect.get_height());
194 :
DialogBase(
"/dialogs/documentoptions",
"DocumentProperties")
196 , _page_guides(
Gtk::make_managed<UI::Widget::
NotebookPage>(1, 1, true))
198 , _page_scripting(
Gtk::make_managed<UI::Widget::
NotebookPage>(1, 1, true))
199 , _page_external_scripts(
Gtk::make_managed<UI::Widget::
NotebookPage>(1, 1))
200 , _page_embedded_scripts(
Gtk::make_managed<UI::Widget::
NotebookPage>(1, 1))
201 , _page_metadata1(
Gtk::make_managed<UI::Widget::
NotebookPage>(1, 1, true))
202 , _page_metadata2(
Gtk::make_managed<UI::Widget::
NotebookPage>(1, 1, true))
205 , _rcb_sgui(_(
"Show _guides"), _(
"Show or hide guides"),
"showguides", _wr)
206 , _rcb_lgui(_(
"Lock all guides"), _(
"Toggle lock of all guides in the document"),
"inkscape:lockguides", _wr)
207 , _rcp_gui(_(
"Guide co_lor:"), _(
"Guideline color"), _(
"Color of guidelines"),
"guidecolor",
"guideopacity", _wr)
208 , _rcp_hgui(_(
"_Highlight color:"), _(
"Highlighted guideline color"),
209 _(
"Color of a guideline when it is under mouse"),
"guidehicolor",
"guidehiopacity", _wr)
210 , _create_guides_btn(_(
"Create guides around the current page"))
211 , _delete_guides_btn(_(
"Delete all guides"))
213 , _grids_label_def(
"",
Gtk::Align::START)
217 , _namedview_connection(this)
218 , _root_connection(this)
231 _notebook.signal_switch_page().connect([
this](Gtk::Widget
const *,
unsigned const page){
261void attach_all(Gtk::Grid &table, Gtk::Widget *
const arr[],
unsigned const n)
263 for (
unsigned i = 0, r = 0; i < n; i += 2) {
264 if (arr[i] && arr[i+1]) {
265 arr[i]->set_hexpand();
266 arr[i+1]->set_hexpand();
267 arr[i]->set_valign(Gtk::Align::CENTER);
268 arr[i+1]->set_valign(Gtk::Align::CENTER);
269 table.attach(*arr[i], 0, r, 1, 1);
270 table.attach(*arr[i+1], 1, r, 1, 1);
273 arr[i+1]->set_hexpand();
274 arr[i+1]->set_valign(Gtk::Align::CENTER);
275 table.attach(*arr[i+1], 0, r, 2, 1);
277 auto &
label =
dynamic_cast<Gtk::Label &
>(*arr[i]);
279 label.set_halign(Gtk::Align::START);
280 label.set_valign(Gtk::Align::CENTER);
281 table.attach(
label, 0, r, 2, 1);
283 auto const space = Gtk::make_managed<Gtk::Box>();
285 space->set_halign(Gtk::Align::CENTER);
286 space->set_valign(Gtk::Align::CENTER);
287 table.attach(*space, 0, r, 1, 1);
371 if (
scale <= 0)
return;
400 for (
auto grid : nv->grids) {
429 if (
root->viewBox_set) {
432 auto vh =
root->viewBox.height();
433 if (vw > 0 && vh > 0) {
438 auto w =
root->width.computed;
439 auto h =
root->height.computed;
440 if (
w > 0 && h > 0) {
447 return std::optional<Geom::Scale>();
461 bool uniform = fabs(sx - sy) < eps;
496 case PageProperties::Color::Desk:
499 case PageProperties::Color::Background:
502 case PageProperties::Color::Border:
517 case PageProperties::Dimension::PageTemplate:
518 case PageProperties::Dimension::PageSize:
523 case PageProperties::Dimension::ViewboxSize:
527 case PageProperties::Dimension::ViewboxPosition:
531 case PageProperties::Dimension::ScaleContent:
533 case PageProperties::Dimension::Scale:
545 case PageProperties::Check::Checkerboard:
548 case PageProperties::Check::Border:
551 case PageProperties::Check::BorderOnTop:
554 case PageProperties::Check::Shadow:
557 case PageProperties::Check::AntiAlias:
560 case PageProperties::Check::ClipToPage:
563 case PageProperties::Check::PageLabelStyle:
566 case PageProperties::Check::YAxisPointsDown:
569 case PageProperties::Check::OriginCurrentPage:
579 if (element == PageProperties::Units::Display) {
583 else if (element == PageProperties::Units::Document) {
604 auto const label_gui = Gtk::make_managed<Gtk::Label>();
605 label_gui->set_markup (_(
"<b>Guides</b>"));
612 auto const inner = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 4);
617 auto const spacer = Gtk::make_managed<Gtk::Label>();
618 Gtk::Widget *
const widget_array[] =
627 inner->set_hexpand(
false);
644 cms_system.refreshProfiles();
645 for (
auto const &
profile: cms_system.getProfiles()) {
646 Gtk::TreeModel::Row row;
649 if (!first &&
profile->inHome() != home)
680 if (str.empty())
return;
682 auto val = str.at(0);
683 if ((val <
'A' || val >
'Z') && (val <
'a' || val >
'z') && val !=
'_' && val !=
':') {
686 for (std::size_t i = 1; i < str.size(); i++) {
687 auto val = str.at(i);
688 if ((val <
'A' || val >
'Z') && (val <
'a' || val >
'z') && (val <
'0' || val >
'9') &&
689 val !=
'_' && val !=
':' && val !=
'-' && val !=
'.') {
690 if (str.at(i - 1) ==
'-') {
694 str.replace(i, 1,
"-");
698 if (str.at(str.size() - 1) ==
'-') {
725template <
typename From,
typename To>
726struct static_caster { To * operator () (From * value)
const {
return static_cast<To *
>(value); } };
734 std::set<Inkscape::ColorProfile *> _current;
735 std::transform(
current.begin(),
737 std::inserter(_current, _current.begin()),
738 static_caster<SPObject, Inkscape::ColorProfile>());
740 for (
auto const &
profile: _current) {
751 _unlink_btn.set_sensitive(sel->count_selected_rows () > 0);
768 colorprofile->deleteObject(
true,
false);
778 Gtk::TreeModel::const_iterator
const &iter)
786 Gtk::Label *label_link= Gtk::make_managed<Gtk::Label>(
"", Gtk::Align::START);
787 label_link->set_markup (_(
"<b>Linked Color Profiles:</b>"));
788 auto const label_avail = Gtk::make_managed<Gtk::Label>(
"", Gtk::Align::START);
789 label_avail->set_markup (_(
"<b>Available Color Profiles:</b>"));
796 label_link->set_hexpand();
797 label_link->set_halign(Gtk::Align::START);
798 label_link->set_valign(Gtk::Align::CENTER);
809 auto const spacer = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
812 spacer->set_hexpand();
813 spacer->set_valign(Gtk::Align::CENTER);
818 label_avail->set_hexpand();
819 label_avail->set_halign(Gtk::Align::START);
820 label_avail->set_valign(Gtk::Align::CENTER);
870 Gtk::Label *label_external= Gtk::make_managed<Gtk::Label>(
"", Gtk::Align::START);
871 label_external->set_markup (_(
"<b>External script files:</b>"));
873 _external_add_btn.set_tooltip_text(_(
"Add the current file name or browse for a file"));
881 label_external->set_hexpand();
882 label_external->set_halign(Gtk::Align::START);
883 label_external->set_valign(Gtk::Align::CENTER);
894 auto const spacer_external = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
897 spacer_external->set_hexpand();
898 spacer_external->set_valign(Gtk::Align::CENTER);
926 Gtk::Label *label_embedded= Gtk::make_managed<Gtk::Label>(
"", Gtk::Align::START);
927 label_embedded->set_markup (_(
"<b>Embedded script files:</b>"));
941 label_embedded->set_hexpand();
942 label_embedded->set_halign(Gtk::Align::START);
943 label_embedded->set_valign(Gtk::Align::CENTER);
960 auto const spacer_embedded = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
962 spacer_embedded->set_hexpand();
963 spacer_embedded->set_valign(Gtk::Align::CENTER);
976 Gtk::Label *label_embedded_content= Gtk::make_managed<Gtk::Label>(
"", Gtk::Align::START);
977 label_embedded_content->set_markup (_(
"<b>Content:</b>"));
979 label_embedded_content->set_hexpand();
980 label_embedded_content->set_halign(Gtk::Align::START);
981 label_embedded_content->set_valign(Gtk::Align::CENTER);
1040 auto const label = Gtk::make_managed<Gtk::Label>();
1041 label->set_markup (_(
"<b>Dublin Core Entities</b>"));
1042 label->set_halign(Gtk::Align::START);
1043 label->set_valign(Gtk::Align::CENTER);
1052 w->
_label.set_halign(Gtk::Align::START);
1053 w->_label.set_valign(Gtk::Align::CENTER);
1056 w->_packable->set_hexpand();
1057 w->_packable->set_valign(Gtk::Align::CENTER);
1058 if (
streq(entity->name,
"description")) {
1060 w->_packable->set_valign(Gtk::Align::FILL);
1061 w->_packable->set_vexpand();
1069 auto const button_save = Gtk::make_managed<Gtk::Button>(_(
"_Save as default"),
true);
1070 button_save->set_tooltip_text(_(
"Save this metadata as the default metadata"));
1071 auto const button_load = Gtk::make_managed<Gtk::Button>(_(
"Use _default"),
true);
1072 button_load->set_tooltip_text(_(
"Use the previously saved default metadata here"));
1074 auto const box_buttons = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL, 4);
1075 UI::pack_end(*box_buttons, *button_save,
true,
true, 6);
1076 UI::pack_end(*box_buttons, *button_load,
true,
true, 6);
1078 box_buttons->set_halign(Gtk::Align::END);
1079 box_buttons->set_homogeneous();
1085 auto const llabel = Gtk::make_managed<Gtk::Label>();
1086 llabel->set_markup (_(
"<b>License</b>"));
1087 llabel->set_halign(Gtk::Align::START);
1088 llabel->set_valign(Gtk::Align::CENTER);
1096 _licensor.set_valign(Gtk::Align::CENTER);
1130 static std::string open_path;
1134 static std::vector<std::pair<Glib::ustring, Glib::ustring>>
const filters {
1135 {_(
"JavaScript Files"),
"*.js"}
1185 auto script = cast<SPScript>(obj);
1186 if (script && (
name == script->xlinkhref)) {
1218 if (
auto repr = obj->getRepr()){
1262 bool voidscript=
true;
1265 if (
id == obj->getId()){
1266 int count = (int) obj->children.size();
1269 g_warning(
"TODO: Found a script element with multiple (%d) child nodes! We must implement support for that!", count);
1276 if (
auto const content =
child->getRepr()->content()) {
1305 if (
id == obj->getId()) {
1309 auto tmp = obj->children | boost::adaptors::transformed([](
SPObject& o) {
return &o; });
1310 std::vector<SPObject*> vec(tmp.begin(), tmp.end());
1311 for (
auto const child: vec) {
1312 child->deleteObject();
1335 g_assert(obj !=
nullptr);
1339 auto script = cast<SPScript>(obj);
1340 g_assert(script !=
nullptr);
1341 if (script->xlinkhref)
1378 auto const widget = Gtk::make_managed<Inkscape::UI::Widget::GridWidget>(grid);
1384 row->property_activatable() =
false;
1395 if (
auto widget =
dynamic_cast<Inkscape::UI::Widget::GridWidget*
>(row->get_child())) {
1396 if (&
node == widget->getGridRepr()) {
1420 auto btn = Gtk::make_managed<Gtk::Button>();
1421 btn->set_size_request(120);
1422 auto hbox = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL, 5);
1423 hbox->set_halign(Gtk::Align::CENTER);
1424 hbox->set_valign(Gtk::Align::CENTER);
1426 auto icon_image = Gtk::make_managed<Gtk::Image>();
1427 icon_image->set_from_icon_name(
"plus");
1428 icon_image->set_icon_size(Gtk::IconSize::NORMAL);
1429 hbox->append(*icon_image);
1431 auto btn_label = Gtk::make_managed<Gtk::Label>(_(
"New Grid"));
1432 btn_label->set_valign(Gtk::Align::CENTER);
1433 hbox->append(*btn_label);
1435 btn->set_child(*hbox);
1442 _no_grids.set_text(_(
"There are no grids defined."));
1443 _no_grids.set_halign(Gtk::Align::CENTER);
1446 _no_grids.add_css_class(
"informational-text");
1451 _grids_list.set_selection_mode(Gtk::SelectionMode::NONE);
1452 _grids_wnd.set_policy(Gtk::PolicyType::NEVER, Gtk::PolicyType::AUTOMATIC);
1464 if (
root->viewBox_set) {
1467 _page->
set_dimension(PageProperties::Dimension::ViewboxSize, vb.width(), vb.height());
1491 bool percent = doc_w_unit ==
"%";
1492 if (doc_w_unit ==
"") {
1494 }
else if (doc_w_unit ==
"%" &&
root->viewBox_set) {
1496 doc_w =
root->viewBox.width();
1498 double doc_h =
root->height.value;
1500 percent = percent || doc_h_unit ==
"%";
1501 if (doc_h_unit ==
"") {
1503 }
else if (doc_h_unit ==
"%" &&
root->viewBox_set) {
1505 doc_h =
root->viewBox.height();
1509 _page->
set_check(PageProperties::Check::UnsupportedSize, percent);
1512 _page->
set_unit(PageProperties::Units::Document, doc_w_unit);
1517 if (nv->display_units) {
1518 _page->
set_unit(PageProperties::Units::Display, nv->display_units->abbr);
1520 _page->
set_check(PageProperties::Check::Checkerboard, nv->desk_checkerboard);
1521 _page->
set_color(PageProperties::Color::Desk, nv->getDeskColor());
1522 _page->
set_color(PageProperties::Color::Background, page_manager.getBackgroundColor());
1523 _page->
set_check(PageProperties::Check::Border, page_manager.border_show);
1524 _page->
set_check(PageProperties::Check::BorderOnTop, page_manager.border_on_top);
1525 _page->
set_color(PageProperties::Color::Border, page_manager.getBorderColor());
1526 _page->
set_check(PageProperties::Check::Shadow, page_manager.shadow_show);
1527 _page->
set_check(PageProperties::Check::PageLabelStyle, page_manager.label_style !=
"default");
1528 _page->
set_check(PageProperties::Check::AntiAlias, nv->antialias_rendering);
1529 _page->
set_check(PageProperties::Check::ClipToPage, nv->clip_to_page);
1530 _page->
set_check(PageProperties::Check::YAxisPointsDown, nv->is_y_axis_down());
1531 _page->
set_check(PageProperties::Check::OriginCurrentPage, nv->get_origin_follows_page());
1544 bool read_only =
false;
1556 if (
id == Gtk::ResponseType::DELETE_EVENT ||
id == Gtk::ResponseType::CLOSE)
1562 if (
id == Gtk::ResponseType::CLOSE)
1570 it->load_from_preferences ();
1595 _node->removeObserver(*
this);
1602 if (
auto grid = cast<SPGrid>(_dialog->getDocument()->getObjectByRepr(&
child))) {
1603 _dialog->add_grid_widget(grid);
1609 _dialog->remove_grid_widget(
child);
1614 _dialog->update_widgets();
1661 if (
auto adj =
_grids_wnd.get_vadjustment()) {
1662 adj->set_value(adj->get_upper());
1683 action->activate(doc_unit->
abbr);
1696GridWidget::GridWidget(
SPGrid *grid)
1697 :
Gtk::Box(
Gtk::Orientation::VERTICAL)
1699 , _repr(grid->getRepr())
1701 set_halign(Gtk::Align::CENTER);
1702 add_css_class(
"grid-row-definition");
1707 constexpr int SPACE = 4;
1708 constexpr int POPUP_MARGIN = 8;
1710 _wr.setUpdating(
true);
1713 _grid_type.add_row(icon,
label,
static_cast<int>(type));
1715 _grid_type.refilter();
1717 _enabled = Gtk::make_managed<Inkscape::UI::Widget::RegisteredSwitchButton>(
"",
1718 _(
"Makes the grid available for working with on the canvas."),
1719 "enabled", _wr,
false, repr, doc);
1721 _snap_visible_only = Gtk::make_managed<Inkscape::UI::Widget::RegisteredCheckButton>(
1722 _(
"Snap to visible _grid lines only"),
1723 _(
"When zoomed out, not all grid lines will be displayed. Only the visible ones will be snapped to"),
1724 "snapvisiblegridlinesonly", _wr,
false, repr, doc);
1726 _visible = Gtk::make_managed<Inkscape::UI::Widget::RegisteredToggleButton>(
"",
1727 _(
"Determines whether the grid is displayed or not. Objects are still snapped to invisible grids."),
1728 "visible", _wr,
false, repr, doc,
1729 "object-visible",
"object-hidden");
1730 _visible->set_child(*Gtk::make_managed<Gtk::Image>(Gio::ThemedIcon::create(
"object-visible")));
1732 _alignment = Gtk::make_managed<Inkscape::UI::Widget::AlignmentSelector>();
1733 _alignment->connectAlignmentClicked([
this, grid](
int const align) {
1742 _dotted = Gtk::make_managed<Inkscape::UI::Widget::RegisteredCheckButton>(
1743 _(
"_Show dots instead of lines"), _(
"If set, displays dots at gridpoints instead of gridlines"),
1744 "dotted", _wr,
false, repr, doc );
1746 auto vbox = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, SPACE);
1747 auto align = Gtk::make_managed<Gtk::Label>(_(
"Align to page:"));
1748 align->set_margin_top(8);
1749 vbox->append(*align);
1750 vbox->append(*_alignment);
1751 _align_popup->set_child(*vbox);
1753 auto angle_popover = Gtk::make_managed<Gtk::Popover>();
1754 angle_popover->set_has_arrow(
false);
1755 _angle_popup->set_popover(*angle_popover);
1756 _angle_popup->set_valign(Gtk::Align::FILL);
1758 auto angle = Gtk::make_managed<Gtk::Label>(_(
"Set angle from aspect ratio:"));
1759 angle->set_xalign(0);
1760 auto subgrid = Gtk::make_managed<Gtk::Grid>();
1761 subgrid->set_margin(POPUP_MARGIN);
1762 subgrid->set_row_spacing(SPACE);
1763 subgrid->set_column_spacing(SPACE);
1764 _aspect_ratio = Gtk::make_managed<Gtk::Entry>();
1765 _aspect_ratio->set_max_width_chars(9);
1766 subgrid->attach(*angle, 0, 0);
1767 subgrid->attach(*_aspect_ratio, 0, 1);
1768 auto apply = Gtk::make_managed<Gtk::Button>(_(
"Set"));
1769 apply->set_halign(Gtk::Align::CENTER);
1770 apply->set_size_request(100);
1771 subgrid->attach(*apply, 0, 2);
1775 apply->set_tooltip_text(_(
"Automatically calculate angles from width to height ratio\nof a single grid parallelogram"));
1776 apply->signal_clicked().connect([=,
this](){
1778 auto const result = ExpressionEvaluator{
get_text(*_aspect_ratio)}.evaluate().value;
1781 auto angle = Geom::deg_from_rad(std::atan(1.0 /
result));
1782 if (angle > 0.0 && angle < 90.0) {
1783 _angle_x->setValue(angle,
false);
1784 _angle_z->setValue(angle,
false);
1787 catch (EvaluatorException& e) {
1791 angle_popover->set_child(*subgrid);
1792 angle_popover->signal_show().connect([
this](){
1795 auto ax = _grid->getAngleX();
1796 auto az = _grid->getAngleZ();
1799 auto ratio = std::tan(Geom::rad_from_deg(ax));
1801 _aspect_ratio->set_text(ratio > 1.0 ?
1802 Glib::ustring::format(
"1 : ", ratio) :
1809 _units = Gtk::make_managed<RegisteredUnitMenu>(
1810 _(
"Grid _units:"),
"units", _wr, repr, doc);
1811 _origin_x = Gtk::make_managed<RegisteredScalarUnit>(
1812 _(
"_Origin X:"), _(
"X coordinate of grid origin"),
"originx",
1813 *_units, _wr, repr, doc,
RSU_x);
1814 _origin_y = Gtk::make_managed<RegisteredScalarUnit>(
1815 _(
"O_rigin Y:"), _(
"Y coordinate of grid origin"),
"originy",
1816 *_units, _wr, repr, doc,
RSU_y);
1817 _spacing_x = Gtk::make_managed<RegisteredScalarUnit>(
1818 "-", _(
"Distance between horizontal grid lines"),
"spacingx",
1819 *_units, _wr, repr, doc,
RSU_x);
1820 _spacing_y = Gtk::make_managed<RegisteredScalarUnit>(
1821 "-", _(
"Distance between vertical grid lines"),
"spacingy",
1822 *_units, _wr, repr, doc,
RSU_y);
1824 _gap_x = Gtk::make_managed<RegisteredScalarUnit>(
1825 _(
"Gap _X:"), _(
"Horizontal distance between blocks"),
"gapx",
1826 *_units, _wr, repr, doc,
RSU_x);
1827 _gap_y = Gtk::make_managed<RegisteredScalarUnit>(
1828 _(
"Gap _Y:"), _(
"Vertical distance between blocks"),
"gapy",
1829 *_units, _wr, repr, doc,
RSU_y);
1830 _margin_x = Gtk::make_managed<RegisteredScalarUnit>(
1831 _(
"_Margin X:"), _(
"Right and left margins"),
"marginx",
1832 *_units, _wr, repr, doc,
RSU_x);
1833 _margin_y = Gtk::make_managed<RegisteredScalarUnit>(
1834 _(
"M_argin Y:"), _(
"Top and bottom margins"),
"marginy",
1835 *_units, _wr, repr, doc,
RSU_y);
1837 _angle_x = Gtk::make_managed<RegisteredScalar>(
1838 _(
"An_gle X:"), _(
"Angle of x-axis"),
"gridanglex", _wr, repr, doc);
1839 _angle_z = Gtk::make_managed<RegisteredScalar>(
1840 _(
"Ang_le Z:"), _(
"Angle of z-axis"),
"gridanglez", _wr, repr, doc);
1841 _grid_color = Gtk::make_managed<RegisteredColorPicker>(
1842 "", _(
"Grid color"),
1843 _(
"Color of the grid lines"),
1844 "empcolor",
"empopacity", _wr, repr, doc);
1851 color.addOpacity(0.5);
1855 _grid_color->set_spacing(0);
1856 _no_of_lines = Gtk::make_managed<RegisteredInteger>(
1857 _(
"Major grid line e_very:"), _(
"Number of lines"),
1858 "empspacing", _wr, repr, doc);
1861 _units->set_undo_parameters(_(
"Change grid units"),
"show-grid",
"grid-settings");
1862 _angle_x->set_undo_parameters(_(
"Change grid dimensions"),
"show-grid",
"grid-settings");
1863 _angle_z->set_undo_parameters(_(
"Change grid dimensions"),
"show-grid",
"grid-settings");
1864 _grid_color->set_undo_parameters(_(
"Change grid color"),
"show-grid",
"grid-settings");
1865 _no_of_lines->set_undo_parameters(_(
"Change grid number of lines"),
"show-grid",
"grid-settings");
1866 for (
auto widget : {_origin_x, _origin_y, _spacing_x, _spacing_y, _gap_x, _gap_y, _margin_x, _margin_y}) {
1867 widget->set_undo_parameters(_(
"Change grid dimensions"),
"show-grid",
"grid-settings");
1870 for (
auto labelled :
std::to_array<Labelled*>(
1871 {_units, _origin_x, _origin_y, _spacing_x, _spacing_y, _gap_x, _gap_y, _margin_x, _margin_y,
1872 _angle_x, _angle_z, _no_of_lines})) {
1873 labelled->getLabel()->set_hexpand();
1876 _units->set_hexpand();
1877 _angle_x->set_hexpand();
1878 _angle_z->set_hexpand();
1879 _no_of_lines->set_hexpand();
1880 _no_of_lines->setWidthChars(5);
1882 _origin_x->setProgrammatically =
false;
1883 _origin_y->setProgrammatically =
false;
1885 auto main_grid = Gtk::make_managed<Gtk::Grid>();
1886 main_grid->set_column_homogeneous();
1887 main_grid->set_column_spacing(4 * SPACE);
1889 auto buttons = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
1890 buttons->set_spacing(SPACE);
1891 buttons->append(*_visible);
1892 buttons->append(*_grid_color);
1893 _delete->set_child(*Gtk::make_managed<Gtk::Image>(Gio::ThemedIcon::create(
"edit-delete")));
1894 _delete->set_tooltip_text(_(
"Delete this grid"));
1895 _delete->signal_clicked().connect([
this](){
1896 auto doc = getGrid()->document;
1897 getGrid()->deleteObject();
1900 _delete->set_hexpand();
1901 _delete->set_halign(Gtk::Align::END);
1902 buttons->append(*_delete);
1903 buttons->append(*_options);
1904 _options->set_popover(*_opt_items);
1905 _options->set_icon_name(
"gear");
1906 auto items = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL);
1907 items->set_spacing(SPACE);
1908 items->set_margin(POPUP_MARGIN);
1909 items->append(*_snap_visible_only);
1910 items->append(*_dotted);
1911 _opt_items->set_child(*
items);
1912 _opt_items->set_has_arrow(
false);
1914 _align->set_label(C_(
"popup-align-grid-origin",
"Align"));
1915 _align->set_tooltip_text(_(
"Align grid origin relative to active page."));
1916 _align_popup->set_has_arrow(
false);
1917 _align->set_popover(*_align_popup);
1919 auto left_col = Gtk::make_managed<Gtk::Grid>();
1920 main_grid->attach(*left_col, 0, 1);
1922 auto right_col = Gtk::make_managed<Gtk::Grid>();
1923 main_grid->attach(*right_col, 1, 1);
1925 for (
auto grid : {left_col, right_col}) {
1926 grid->set_column_spacing(SPACE);
1927 grid->set_row_spacing(SPACE);
1930 auto first_row_height = Gtk::SizeGroup::create(Gtk::SizeGroup::Mode::VERTICAL);
1932 auto box = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
1933 box->set_spacing(SPACE);
1934 box->append(*_enabled);
1935 _id->set_ellipsize(Pango::EllipsizeMode::END);
1937 _grid_type.set_hexpand();
1938 _grid_type.set_halign(Gtk::Align::END);
1939 _grid_type.set_active_by_id(
static_cast<int>(_grid->getType()));
1940 _grid_type.signal_changed().connect([&,
this](
int index){
1942 if (
index < 0)
return;
1947 _grid_type.set_tooltip_text(_(
"Change to a different grid type."));
1948 box->append(_grid_type);
1949 left_col->attach(*box, 0, row, 2);
1950 right_col->attach(*buttons, 0, row, 2);
1952 first_row_height->add_widget(*box);
1953 first_row_height->add_widget(*buttons);
1956 auto lbox = Gtk::make_managed<Gtk::Box>();
1957 lbox->set_size_request(0, SPACE);
1958 left_col->attach(*lbox, 0, row);
1959 auto rbox = Gtk::make_managed<Gtk::Box>();
1960 rbox->set_size_request(0, SPACE);
1961 right_col->attach(*rbox, 0, row++);
1964 int first_row = row;
1965 left_col->attach(*_units, 0, row++, 2);
1967 auto cur_grid = left_col;
1968 for (
auto rs :
std::to_array<Scalar*>({
1970 _spacing_x, _spacing_y, _angle_x, _angle_z, _gap_x, _gap_y,
1972 _origin_x, _origin_y, _margin_x, _margin_y})) {
1975 rs->setWidthChars(12);
1977 if (
rs == _origin_x) {
1978 cur_grid = right_col;
1981 cur_grid->attach(*_align, 0, row++,
width);
1982 _align->set_halign(Gtk::Align::END);
1984 if (
rs == _angle_x) {
1985 cur_grid->attach(*_angle_popup, 1, row, 1, 2);
1987 if (
rs == _angle_x ||
rs == _angle_z) {
1988 rs->setWidthChars(8);
1991 cur_grid->attach(*
rs, 0, row++,
width);
1994 left_col->attach(*_no_of_lines, 0, row++, 2);
1997 if (!_wr.isUpdating()) {
1998 _modified_signal.block();
2000 _modified_signal.unblock();
2007 std::vector<Gtk::Widget*> widgets;
2009 if (
dynamic_cast<Gtk::SpinButton*
>(&
w) ||
2010 dynamic_cast<Gtk::ToggleButton*
>(&
w) ||
2011 dynamic_cast<Gtk::MenuButton*
>(&
w) ||
2012 dynamic_cast<Gtk::Label*
>(&
w) ||
2013 dynamic_cast<LabelledColorPicker*
>(&
w)
2015 widgets.push_back(&
w);
2021 _enabled->setSubordinateWidgets(std::move(widgets));
2023 _wr.setUpdating(
false);
2029void GridWidget::update()
2031 _wr.setUpdating (
true);
2032 auto scale = _grid->document->getDocumentScale();
2038 _units->setUnit(_grid->getUnit()->abbr);
2045 auto spacing = _grid->getSpacing() *
scale;
2046 _spacing_x->setValueKeepUnit(spacing[
Geom::X],
"px");
2047 _spacing_y->setValueKeepUnit(spacing[
Geom::Y],
"px");
2048 _spacing_x->getLabel()->set_markup_with_mnemonic(modular ? _(
"Block _width:") : _(
"Spacing _X:"));
2049 _spacing_y->getLabel()->set_markup_with_mnemonic(modular ? _(
"Block _height:") : _(
"Spacing _Y:"));
2051 auto show = [](Gtk::Widget*
w,
bool do_show){
2052 w->set_visible(do_show);
2055 show(_angle_x, axonometric);
2056 show(_angle_z, axonometric);
2057 show(_angle_popup, axonometric);
2059 _angle_x->setValue(_grid->getAngleX());
2060 _angle_z->setValue(_grid->getAngleZ());
2063 show(_gap_x, modular);
2064 show(_gap_y, modular);
2065 show(_margin_x, modular);
2066 show(_margin_y, modular);
2068 auto gap = _grid->get_gap() *
scale;
2070 _gap_x->setValueKeepUnit(gap.x(),
"px");
2071 _gap_y->setValueKeepUnit(gap.y(),
"px");
2072 _margin_x->setValueKeepUnit(
margin.x(),
"px");
2073 _margin_y->setValueKeepUnit(
margin.y(),
"px");
2076 _grid_color->setColor(_grid->getMajorColor());
2078 show(_no_of_lines, !modular);
2079 _no_of_lines->setValue(_grid->getMajorLineInterval());
2081 _enabled->set_active(_grid->isEnabled());
2082 _visible->setActive(_grid->isVisible());
2085 _dotted->setActive(_grid->isDotted());
2087 _snap_visible_only->setActive(_grid->getSnapToVisibleOnly());
2090 _enabled->set_active(_grid->snapper()->getEnabled());
2092 show(_dotted, rectangular);
2093 show(_spacing_x, !axonometric);
2095 _icon->set_from_icon_name(_grid->typeName());
2096 auto id = _grid->getId() ? _grid->getId() :
"-";
2098 _id->set_tooltip_text(
id);
2100 _wr.setUpdating(
false);
Various trigoniometric helper functions.
@ INKSCAPE_ANTIALIAS_RENDERING
@ INKSCAPE_DESK_CHECKERBOARD
@ INKSCAPE_CLIP_TO_PAGE_RENDERING
@ INKSCAPE_ORIGIN_CORRECTION
static CRect from_xywh(Coord x, Coord y, Coord w, Coord h)
Create rectangle from origin and dimensions.
C height() const
Get the vertical extent of the rectangle.
C width() const
Get the horizontal extent of the rectangle.
CPoint min() const
Get the corner of the rectangle with smallest coordinate values.
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
sigc::connection connectChanged(const sigc::slot< void()> &slot)
ColorProfile * getColorProfileForSpace(std::string const &name) const
Get the document color-profile SPObject for the named cms profile.
void attachProfileToDoc(std::string const &lookup, ColorProfileStorage storage, RenderingIntent intent, std::string name="")
Attach the named profile to the document.
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)
static void maybeDone(SPDocument *document, const gchar *keyconst, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
void scalePages(Geom::Scale const &scale)
Change page size, margins and bleeds by a set amount.
bool selectPage(SPPage *page)
Set the given page as the selected page.
Preference storage class.
static Preferences * get()
Access the singleton Preferences object.
void setString(Glib::ustring const &pref_path, Glib::ustring const &value)
Set an UTF-8 string value.
DialogBase is the base class for the dialog system.
SPDocument * getDocument() const
Glib::ustring const _prefs_path
SPDesktop * getDesktop() const
Gtk::TreeModelColumn< bool > separatorColumn
Gtk::TreeModelColumn< Glib::ustring > fileColumn
Gtk::TreeModelColumn< Glib::ustring > nameColumn
Gtk::TreeModelColumn< Glib::ustring > idColumn
Gtk::TreeModelColumn< Glib::ustring > filenameColumn
Gtk::TreeModelColumn< Glib::ustring > nameColumn
void notifyChildRemoved(XML::Node &node, XML::Node &child, XML::Node *prev) final
Child removal callback.
void notifyAttributeChanged(XML::Node &node, GQuark name, Util::ptr_shared old_value, Util::ptr_shared new_value) final
Attribute change callback.
Inkscape::XML::Node * _node
void notifyChildAdded(XML::Node &node, XML::Node &child, XML::Node *prev) final
Child addition callback.
void connect(Inkscape::XML::Node *node)
Gtk::Box _grids_hbox_crea
UI::Widget::NotebookPage * _page_external_scripts
void set_viewbox_pos(SPDesktop *desktop, double x, double y)
sigc::scoped_connection _on_idle_scroll
void changeEmbeddedScript()
bool _AvailableProfilesList_separator(Glib::RefPtr< Gtk::TreeModel > const &model, Gtk::TreeModel::const_iterator const &iter)
Gtk::Button _external_add_btn
UI::Widget::RegisteredColorPicker _rcp_hgui
void load_default_metadata()
EmbeddedScriptsColumns _EmbeddedScriptsListColumns
void onColorProfileSelectRow()
UI::Widget::PageProperties * _page
void populate_linked_profiles_box()
void onExternalScriptSelectRow()
void populate_available_profiles()
Populates the available color profiles combo box.
Glib::RefPtr< Gtk::ListStore > _LinkedProfilesListStore
Gtk::ScrolledWindow _EmbeddedContentScroller
void editEmbeddedScript()
void onEmbeddedScriptSelectRow()
Gtk::ScrolledWindow _LinkedProfilesListScroller
Gtk::Button _embed_remove_btn
Glib::RefPtr< Gtk::ListStore > _AvailableProfilesListStore
Glib::RefPtr< Gtk::ListStore > _ExternalScriptsListStore
void remove_grid_widget(XML::Node &node)
UI::Widget::NotebookPage * _page_page
void rebuild_gridspage()
Called for updating the dialog.
void onNewGrid(GridType type)
sigc::scoped_connection _cms_connection
Gtk::Button _external_remove_btn
void populate_script_lists()
UI::Widget::RegisteredColorPicker _rcp_gui
UI::Widget::RegisteredCheckButton _rcb_lgui
UI::Widget::PopoverBin _popoverbin
Gtk::ScrolledWindow _EmbeddedScriptsListScroller
Gtk::TextView _EmbeddedContent
UI::Widget::NotebookPage * _page_scripting
UI::Widget::NotebookPage * _page_metadata1
UI::Widget::NotebookPage * _page_metadata2
virtual void on_response(int)
Gtk::Button _delete_guides_btn
ExternalScriptsColumns _ExternalScriptsListColumns
UI::Widget::NotebookPage * _page_cms
void display_unit_change(const Inkscape::Util::Unit *unit)
Gtk::TreeView _LinkedProfilesList
void set_document_scale(SPDesktop *desktop, double scale_x)
Gtk::ScrolledWindow _ExternalScriptsListScroller
void add_grid_widget(SPGrid *grid)
Gtk::ComboBox _AvailableProfilesList
Gtk::TreeView _EmbeddedScriptsList
void documentReplaced() override
Glib::RefPtr< Gtk::ListStore > _EmbeddedScriptsListStore
Gtk::Button _create_guides_btn
void removeSelectedProfile()
UI::Widget::NotebookPage * _page_guides
Gtk::Box _embed_button_box
void set_viewbox_size(SPDesktop *desktop, double width, double height)
void removeEmbeddedScript()
void build_gridspage()
Build grid page of dialog.
void linkSelectedProfile()
Links the selected color profile in the combo box to the document.
void browseExternalScript()
UI::Widget::Licensor _licensor
void update_scale_ui(SPDesktop *desktop)
void update() override
The update() method is essential to Gtk state management.
Gtk::ScrolledWindow _grids_wnd
void update_grid_placeholder()
AvailableProfilesColumns _AvailableProfilesListColumns
WatchConnection _root_connection
WatchConnection _namedview_connection
UI::Widget::NotebookPage * _page_embedded_scripts
Glib::RefPtr< Gtk::SizeGroup > _grids_unified_size
LinkedProfilesColumns _LinkedProfilesListColumns
Gtk::Button _embed_new_btn
Gtk::TreeView _ExternalScriptsList
void removeExternalScript()
Inkscape::XML::SignalObserver _scripts_observer
void set_content_scale(SPDesktop *desktop, double scale_x)
void save_default_metadata()
void update_viewbox(SPDesktop *desktop)
void update_viewbox_ui(SPDesktop *desktop)
void update_widgets()
Update dialog widgets from desktop.
UI::Widget::RegisteredCheckButton _rcb_sgui
Gtk::Notebook _scripting_notebook
static EntityEntry * create(rdf_work_entity_t *ent, Registry &wr)
A tabbed notebook page for dialogs.
auto signal_check_toggled()
auto signal_color_changed()
virtual void set_unit(Units unit, const Glib::ustring &abbr)=0
virtual void set_check(Check element, bool checked)=0
auto signal_resize_to_fit()
auto signal_dimension_changed()
virtual void set_dimension(Dimension dim, double x, double y)=0
static PageProperties * create()
auto signal_unit_changed()
virtual void set_color(Color element, Colors::Color const &)=0
double value(Unit const *u) const
Return the quantity's value in the specified unit.
Unit const * getUnit(Glib::ustring const &name) const
Retrieve a given unit based on its string identifier.
Interface for refcounted XML nodes.
virtual void addChild(Node *child, Node *after)=0
Insert another node as a child of this node.
void setAttributeOrRemoveIfEmpty(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
Change an attribute of this node.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
bool setAttributeCssDouble(Util::const_char_ptr key, double val)
Set a property attribute to val [slightly rounded], in the format required for CSS properties: in par...
virtual void addObserver(NodeObserver &observer)=0
Add an object that will be notified of the changes to this node.
bool setAttributeSvgDouble(Util::const_char_ptr key, double val)
For attributes where an exponent is allowed.
virtual Node * root()=0
Get the root node of this node's document.
sigc::signal< void()> & signal_changed()
To do: update description of desktop.
SPDocument * getDocument() const
InkscapeWindow const * getInkscapeWindow() const
SPNamedView * getNamedView() const
Inkscape::Selection * getSelection() const
Typed SVG document implementation.
void scaleContentBy(Geom::Scale const &delta)
Scale the content, used by file-update and document properties when modifying the the document's view...
Glib::RefPtr< Gio::SimpleActionGroup > getActionGroup()
const Geom::Affine & doc2dt() const
Document to desktop coordinate transformation.
void setWidthAndHeight(const Inkscape::Util::Quantity &width, const Inkscape::Util::Quantity &height, bool changeSize=true)
SPRoot * getRoot()
Returns our SPRoot.
SPObject * getObjectById(std::string const &id) const
void setModifiedSinceSave(bool const modified=true)
Indicate to the user if the document has been modified since the last save by displaying a "*" in fro...
void fitToRect(Geom::Rect const &rect, bool with_margins=false)
Given a Geom::Rect that may, for example, correspond to the bbox of an object, this function fits the...
std::vector< SPObject * > const getResourceList(char const *key)
Geom::Point getDimensions() const
Geom::Rect getViewBox() const
Inkscape::PageManager & getPageManager()
Inkscape::XML::Document * getReprDoc()
Our Inkscape::XML::Document.
bool is_yaxisdown() const
True if the desktop Y-axis points down, false if it points up.
SPNamedView * getNamedView()
Get the namedview for this document, creates it if it's not found.
Geom::Scale getDocumentScale(bool computed=true) const
Returns document scale as defined by width/height (in pixels) and viewBox (real world to user-units).
void setViewBox()
Set default viewbox calculated from document properties.
Inkscape::Colors::DocumentCMS & getDocumentCMS()
Inkscape::Util::Quantity getHeight() const
static void create_new(SPDocument *doc, Inkscape::XML::Node *parent, GridType type)
void setOrigin(Geom::Point const &new_origin)
void translateChildItems(Geom::Translate const &tr)
std::vector< SPGuide * > guides
void change_bool_setting(SPAttr key, bool value)
void change_color(SPAttr color_key, SPAttr opacity_key, Colors::Color const &color)
std::vector< SPGrid * > grids
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
sigc::connection connectModified(sigc::slot< void(SPObject *, unsigned int)> slot)
Connects to the modification notification signal.
SPObject of the color-profile object found a direct child of defs.
double inner(valarray< double > const &x, valarray< double > const &y)
vector< vpsc::Rectangle * > rs
static char const *const current
Document properties dialog, Gtkmm-style.
TODO: insert short description here.
Gtk::Image * sp_get_icon_image(Glib::ustring const &icon_name, int size)
Macro for icon names used in Inkscape.
Inkscape::XML::Node * node
Inkscape - An SVG editor.
double angle(std::vector< Point > const &A)
void get_start_directory(std::string &start_path, Glib::ustring const &prefs_path, bool try_document_dir)
Find the start directory for a file dialog.
void sanitizeName(std::string &str)
Cleans up name to remove disallowed characters.
static void connect_remove_popup_menu(Gtk::TreeView &tree_view, UI::Widget::PopoverBin &pb, sigc::slot< void()> slot)
void set_color(SPDesktop *desktop, Glib::ustring operation, SPAttr color_key, SPAttr opacity_key, Colors::Color const &color)
static bool do_remove_popup_menu(PopupMenuOptionalClick const click, Gtk::TreeView &tree_view, UI::Widget::PopoverBin &pb, sigc::slot< void()> const &slot)
void set_document_scale_helper(SPDocument &document, double scale)
static constexpr int SPACE_SIZE_Y
void set_document_dimensions(SPDesktop *desktop, double width, double height, const Inkscape::Util::Unit *unit)
static void docprops_style_button(Gtk::Button &btn, char const *iconName)
std::optional< Geom::Scale > get_document_scale_helper(SPDocument &doc)
void attach_all(Gtk::Grid &table, Gtk::Widget *const arr[], unsigned const n)
Helper function that sets widgets in a 2 by n table.
void set_namedview_bool(SPDesktop *desktop, const Glib::ustring &operation, SPAttr key, bool on)
static constexpr int SPACE_SIZE_X
void pack_end(Gtk::Box &box, Gtk::Widget &child, bool const expand, bool const fill, unsigned const padding)
Adds child to box, packed with reference to the end of box.
Gtk::Widget * for_each_descendant(Gtk::Widget &widget, Func &&func)
Like for_each_child() but also tests the initial widget & recurses through childrenʼs children.
void on_popup_menu(Gtk::Widget &widget, PopupMenuSlot slot)
Connect slot to a widgetʼs key and button events that traditionally trigger a popup menu,...
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.
std::optional< PopupMenuClick > PopupMenuOptionalClick
Optional: not present if popup wasnʼt triggered by click.
ptr_shared format(char const *format,...) G_GNUC_PRINTF(1
static void append(std::vector< T > &target, std::vector< T > &&source)
Glib::RefPtr< Gio::File > choose_file_open(Glib::ustring const &title, Gtk::Window *parent, Glib::RefPtr< Gio::ListStore< Gtk::FileFilter > > const &filters_model, std::string ¤t_folder, Glib::ustring const &accept)
Synchronously run a Gtk::FileDialog to open a single file for reading data.
static cairo_user_data_key_t key
Helpers for using Gtk::Boxes, encapsulating large changes between GTK3 & GTK4.
Singleton class to access the preferences file in a convenient way.
Authors: see git history.
struct rdf_work_entity_t rdf_work_entities[]
void sp_repr_unparent(Inkscape::XML::Node *repr)
Remove repr from children of its parent node.
SPRoot: SVG <svg> implementation.
TODO: insert short description here.
bool streq(char const *a, char const *b)
Convenience/readability wrapper for strcmp(a,b)==0.
Interface for XML documents.
virtual Node * createTextNode(char const *content)=0
virtual Node * createElement(char const *name)=0
Geom::IntPoint dimensions(const Cairo::RefPtr< Cairo::ImageSurface > &surface)