index 03cef543a733f963cefb40b6cf236396508a0158..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,
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);
// _rrb_pix.setValue (true);
_rsu_gusn.setValue (nv->guidetolerance, nv->has_abs_tolerance);
// _rrb_pix.setValue (true);
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();
}