index f9a280b8604dcd9aee25bc9a869ba849a504859a..726c0ad948f866a3f99a3033c7b4917cb7475b57 100644 (file)
+#include <gtkmm.h>
#include "ui/widget/color-picker.h"
#include "ui/widget/scalar-unit.h"
#include "ui/widget/color-picker.h"
#include "ui/widget/scalar-unit.h"
_page_snap(1, 1),
_prefs_path("dialogs.documentoptions")
{
_page_snap(1, 1),
_prefs_path("dialogs.documentoptions")
{
- hide();
set_resizable (false);
_tt.enable();
get_vbox()->set_spacing (4);
set_resizable (false);
_tt.enable();
get_vbox()->set_spacing (4);
{
update();
{
update();
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(SP_DT_NAMEDVIEW(SP_ACTIVE_DESKTOP));
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->addListener (&_repr_events, this);
repr->addListener (&_repr_events, this);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->addListener (&_repr_events, this);
_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
DocumentProperties::~DocumentProperties()
{
DocumentProperties::~DocumentProperties()
{
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(SP_DT_NAMEDVIEW(SP_ACTIVE_DESKTOP));
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->removeListenerByData (this);
repr->removeListenerByData (this);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->removeListenerByData (this);
_doc_replaced_connection.disconnect();
}
_doc_replaced_connection.disconnect();
}
_rcp_bord.init (_("Border _color:"), _("Page border color"),
_("Color of the page border"),
"bordercolor", "borderopacity", _wr);
_rcp_bord.init (_("Border _color:"), _("Page border color"),
_("Color of the page border"),
"bordercolor", "borderopacity", _wr);
- _rcb_shad.init (_("_Show border shadow"), "If set, page border shows a shadow on its right and lower side", "inkscape:showpageshadow", _wr, false);
+ _rcb_shad.init (_("_Show border shadow"), _("If set, page border shows a shadow on its right and lower side"), "inkscape:showpageshadow", _wr, false);
_rum_deflt.init (_("Default _units:"), "inkscape:document-units", _wr);
_rum_deflt.init (_("Default _units:"), "inkscape:document-units", _wr);
+
Gtk::Label* label_gen = manage (new Gtk::Label);
label_gen->set_markup (_("<b>General</b>"));
Gtk::Label* label_bor = manage (new Gtk::Label);
Gtk::Label* label_gen = manage (new Gtk::Label);
label_gen->set_markup (_("<b>General</b>"));
Gtk::Label* label_bor = manage (new Gtk::Label);
label_gen, 0,
_rum_deflt._label, _rum_deflt._sel,
_rcp_bg._label, _rcp_bg._cp,
label_gen, 0,
_rum_deflt._label, _rum_deflt._sel,
_rcp_bg._label, _rcp_bg._cp,
- 0, 0,
+ 0, 0,
label_for, 0,
0, &_page_sizer,
label_for, 0,
0, &_page_sizer,
- 0, 0,
+ 0, 0,
label_bor, 0,
0, _rcb_canb._button,
0, _rcb_bord._button,
label_bor, 0,
0, _rcb_canb._button,
0, _rcb_bord._button,
_rcbsnon.init (_("Snap to object _nodes"),
_("Snap to other object nodes"),
"inkscape:object-nodes", _wr);
_rcbsnon.init (_("Snap to object _nodes"),
_("Snap to other object nodes"),
"inkscape:object-nodes", _wr);
- _rsu_sno.init (_("Snap s_ensitivity:"),
+ _rsu_sno.init (_("Snap s_ensitivity:"), _("Always snap"),
_("Controls max. snapping distance from object"),
_("Controls max. snapping distance from object"),
+ _("If set, objects snap to the nearest object when moved, regardless of distance"),
"objecttolerance", _wr);
_rcbsnbb.init (_("Snap _bounding boxes to grid"),
_("Snap the edges of the object bounding boxes"),
"objecttolerance", _wr);
_rcbsnbb.init (_("Snap _bounding boxes to grid"),
_("Snap the edges of the object bounding boxes"),
_rcbsnnod.init (_("Snap nodes to _grid"),
_("Snap path nodes, text baselines, ellipse centers, etc."),
"inkscape:grid-points", _wr);
_rcbsnnod.init (_("Snap nodes to _grid"),
_("Snap path nodes, text baselines, ellipse centers, etc."),
"inkscape:grid-points", _wr);
- _rsu_sn.init (_("Snap sens_itivity:"),
+ _rsu_sn.init (_("Snap sens_itivity:"), _("Always snap"),
_("Controls max. snapping distance from grid"),
_("Controls max. snapping distance from grid"),
+ _("If set, objects snap to the nearest grid line when moved, regardless of distance"),
"gridtolerance", _wr);
_rcb_snpgui.init (_("Snap bounding boxes to g_uides"),
_("Snap the edges of the object bounding boxes"),
"gridtolerance", _wr);
_rcb_snpgui.init (_("Snap bounding boxes to g_uides"),
_("Snap the edges of the object bounding boxes"),
_rcb_snbgui.init (_("Snap p_oints to guides"),
_("Snap path nodes, text baselines, ellipse centers, etc."),
"inkscape:guide-points", _wr);
_rcb_snbgui.init (_("Snap p_oints to guides"),
_("Snap path nodes, text baselines, ellipse centers, etc."),
"inkscape:guide-points", _wr);
- _rsu_gusn.init (_("Snap sensiti_vity:"),
- _("Controls max. snapping distance from guides"), "guidetolerance", _wr);
- _rrb_pix.init (_("Sensitivity:"), _("S_creen pixels"), _("p_x units"),
- _("Sensitivity is always the same, regardless of zoom."),
- _("Sensitivity changes with zoom; zooming in will enlarge max. snapping distance."),
- _("inkscape:has_abs_tolerance"), _wr);
+ _rsu_gusn.init (_("Snap sensiti_vity:"), _("Always snap"),
+ _("Controls max. snapping distance from guides"),
+ _("If set, objects snap to the nearest guide when moved, regardless of distance"),
+ "guidetolerance", _wr);
+// _rrb_pix.init (_("Sensitivity:"), _("S_creen pixels"), _("p_x units"),
+// _("Sensitivity is always the same, regardless of zoom."),
+// _("Sensitivity changes with zoom; zooming in will enlarge max. snapping distance."),
+// _("inkscape:has_abs_tolerance"), _wr);
Gtk::Label *label_o = manage (new Gtk::Label);
label_o->set_markup (_("<b>Object Snapping</b>"));
Gtk::Label *label_gr = manage (new Gtk::Label);
Gtk::Label *label_o = manage (new Gtk::Label);
label_o->set_markup (_("<b>Object Snapping</b>"));
Gtk::Label *label_gr = manage (new Gtk::Label);
0, _rcbsnnob._button,
0, _rcbsnop._button,
0, _rcbsnon._button,
0, _rcbsnnob._button,
0, _rcbsnop._button,
0, _rcbsnon._button,
- 0, _rsu_sno._hbox,
+ 0, _rsu_sno._vbox,
0, 0,
label_gr, 0,
0, _rcbsnbb._button,
0, _rcbsnnod._button,
0, 0,
label_gr, 0,
0, _rcbsnbb._button,
0, _rcbsnnod._button,
- 0, _rsu_sn._hbox,
+ 0, _rsu_sn._vbox,
0, 0,
label_gu, 0,
0, _rcb_snpgui._button,
0, _rcb_snbgui._button,
0, 0,
label_gu, 0,
0, _rcb_snpgui._button,
0, _rcb_snbgui._button,
- 0, _rsu_gusn._hbox,
- 0, 0,
- 0, _rrb_pix._hbox,
+ 0, _rsu_gusn._vbox,
+// 0, 0,
+// 0, _rrb_pix._hbox,
};
attach_all (_page_snap.table(), array, sizeof(array));
};
attach_all (_page_snap.table(), array, sizeof(array));
if (_wr.isUpdating()) return;
SPDesktop *dt = SP_ACTIVE_DESKTOP;
if (_wr.isUpdating()) return;
SPDesktop *dt = SP_ACTIVE_DESKTOP;
- SPNamedView *nv = SP_DT_NAMEDVIEW(dt);
+ SPNamedView *nv = sp_desktop_namedview(dt);
_wr.setUpdating (true);
set_sensitive (true);
_wr.setUpdating (true);
set_sensitive (true);
if (nv->doc_units)
_rum_deflt.setUnit (nv->doc_units);
if (nv->doc_units)
_rum_deflt.setUnit (nv->doc_units);
- double const doc_w_px = sp_document_width(SP_DT_DOCUMENT(dt));
- double const doc_h_px = sp_document_height(SP_DT_DOCUMENT(dt));
+ double const doc_w_px = sp_document_width(sp_desktop_document(dt));
+ double const doc_h_px = sp_document_height(sp_desktop_document(dt));
_page_sizer.setDim (doc_w_px, doc_h_px);
//-----------------------------------------------------------grid page
_page_sizer.setDim (doc_w_px, doc_h_px);
//-----------------------------------------------------------grid page
_rcp_hgui.setRgba32 (nv->guidehicolor);
//-----------------------------------------------------------snap
_rcp_hgui.setRgba32 (nv->guidehicolor);
//-----------------------------------------------------------snap
- _rcbsnbo.setActive (nv->snap_object_bbox);
- _rcbsnnob.setActive (nv->snap_object_point);
- _rcbsnop.setActive (nv->snap_object_paths);
- _rcbsnop.setActive (nv->snap_object_nodes);
+ _rcbsnbo.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::BBOX_POINT));
+ _rcbsnnob.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::SNAP_POINT));
+ _rcbsnop.setActive (nv->snap_manager.object.getSnapToPaths());
+ _rcbsnop.setActive (nv->snap_manager.object.getSnapToNodes());
_rsu_sno.setValue (nv->objecttolerance, nv->has_abs_tolerance);
_rsu_sno.setValue (nv->objecttolerance, nv->has_abs_tolerance);
- _rcbsnbb.setActive (nv->snap_grid_bbox);
- _rcbsnnod.setActive (nv->snap_grid_point);
+ _rcbsnbb.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::BBOX_POINT));
+ _rcbsnnod.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::SNAP_POINT));
_rsu_sn.setValue (nv->gridtolerance, nv->has_abs_tolerance);
_rsu_sn.setValue (nv->gridtolerance, nv->has_abs_tolerance);
- _rcb_snpgui.setActive (nv->snap_guide_bbox);
- _rcb_snbgui.setActive (nv->snap_guide_point);
+ _rcb_snpgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::BBOX_POINT));
+ _rcb_snbgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::SNAP_POINT));
_rsu_gusn.setValue (nv->guidetolerance, nv->has_abs_tolerance);
_rsu_gusn.setValue (nv->guidetolerance, nv->has_abs_tolerance);
- _rrb_pix.setValue (true);
+// _rrb_pix.setValue (true);
_wr.setUpdating (false);
}
_wr.setUpdating (false);
}
if (!_instance)
return;
if (!_instance)
return;
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(SP_DT_NAMEDVIEW(SP_ACTIVE_DESKTOP));
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->addListener (&_repr_events, _instance);
repr->addListener (&_repr_events, _instance);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->addListener (&_repr_events, _instance);
_instance->_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_instance->update();
}
_instance->_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_instance->update();
}
if (!_instance)
return;
if (!_instance)
return;
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(SP_DT_NAMEDVIEW(SP_ACTIVE_DESKTOP));
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->removeListenerByData (_instance);
repr->removeListenerByData (_instance);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->removeListenerByData (_instance);
_instance->_doc_replaced_connection.disconnect();
}
_instance->_doc_replaced_connection.disconnect();
}
if (!_instance)
return;
if (!_instance)
return;
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(SP_DT_NAMEDVIEW(dt));
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(dt));
repr->addListener (&_repr_events, _instance);
repr->addListener (&_repr_events, _instance);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(doc->root);
+ root->addListener (&_repr_events, _instance);
_instance->update();
}
_instance->update();
}