index 4acbbbb43a1a7547baede2f6dbd194f95c3473d9..08e1975867ce860407c6968f66cb76d7c3666ece 100644 (file)
_id(id),
_parent(parent)
{
_id(id),
_parent(parent)
{
- Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( _id, GTK_ICON_SIZE_LARGE_TOOLBAR) );
+ Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( _id, Inkscape::ICON_SIZE_LARGE_TOOLBAR) );
Gtk::Button * pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
Gtk::Button * pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
}
case AlignAndDistribute::PAGE:
}
case AlignAndDistribute::PAGE:
- mp = NR::Point(a.mx1 * sp_document_width(SP_DT_DOCUMENT(desktop)),
- a.my1 * sp_document_height(SP_DT_DOCUMENT(desktop)));
+ mp = NR::Point(a.mx1 * sp_document_width(sp_desktop_document(desktop)),
+ a.my1 * sp_document_height(sp_desktop_document(desktop)));
break;
case AlignAndDistribute::DRAWING:
{
NR::Rect b = sp_item_bbox_desktop
break;
case AlignAndDistribute::DRAWING:
{
NR::Rect b = sp_item_bbox_desktop
- ( (SPItem *) sp_document_root (SP_DT_DOCUMENT (desktop)) );
+ ( (SPItem *) sp_document_root (sp_desktop_document (desktop)) );
mp = NR::Point(a.mx0 * b.min()[NR::X] + a.mx1 * b.max()[NR::X],
a.my0 * b.min()[NR::Y] + a.my1 * b.max()[NR::Y]);
break;
mp = NR::Point(a.mx0 * b.min()[NR::X] + a.mx1 * b.max()[NR::X],
a.my0 * b.min()[NR::Y] + a.my1 * b.max()[NR::Y]);
break;
it != selected.end();
it++)
{
it != selected.end();
it++)
{
- sp_document_ensure_up_to_date(SP_DT_DOCUMENT (desktop));
+ sp_document_ensure_up_to_date(sp_desktop_document (desktop));
NR::Rect b = sp_item_bbox_desktop (*it);
NR::Point const sp(a.sx0 * b.min()[NR::X] + a.sx1 * b.max()[NR::X],
a.sy0 * b.min()[NR::Y] + a.sy1 * b.max()[NR::Y]);
NR::Rect b = sp_item_bbox_desktop (*it);
NR::Point const sp(a.sx0 * b.min()[NR::X] + a.sx1 * b.max()[NR::X],
a.sy0 * b.min()[NR::Y] + a.sy1 * b.max()[NR::Y]);
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
if (changed) {
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
if (changed) {
- sp_document_done ( SP_DT_DOCUMENT (desktop) );
+ sp_document_done ( sp_desktop_document (desktop) );
}
}
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
if (changed) {
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
if (changed) {
- sp_document_done ( SP_DT_DOCUMENT (desktop) );
+ sp_document_done ( sp_desktop_document (desktop) );
}
}
guint _index;
}
}
guint _index;
{
if (!SP_ACTIVE_DESKTOP) return;
{
if (!SP_ACTIVE_DESKTOP) return;
- SPEventContext *event_context = SP_DT_EVENTCONTEXT(SP_ACTIVE_DESKTOP);
+ SPEventContext *event_context = sp_desktop_event_context(SP_ACTIVE_DESKTOP);
if (!SP_IS_NODE_CONTEXT (event_context)) return ;
Inkscape::NodePath::Path *nodepath = SP_NODE_CONTEXT (event_context)->nodepath;
if (!SP_IS_NODE_CONTEXT (event_context)) return ;
Inkscape::NodePath::Path *nodepath = SP_NODE_CONTEXT (event_context)->nodepath;
// xGap and yGap are the minimum space required between bounding rectangles.
double const xGap = removeOverlapXGap.get_value();
double const yGap = removeOverlapYGap.get_value();
// xGap and yGap are the minimum space required between bounding rectangles.
double const xGap = removeOverlapXGap.get_value();
double const yGap = removeOverlapYGap.get_value();
- removeoverlap(SP_DT_SELECTION(SP_ACTIVE_DESKTOP)->itemList(),
+ removeoverlap(sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList(),
xGap, yGap);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
xGap, yGap);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done(SP_DT_DOCUMENT(SP_ACTIVE_DESKTOP));
+ sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP));
}
};
}
};
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
prefs_set_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
prefs_set_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
- graphlayout(SP_DT_SELECTION(SP_ACTIVE_DESKTOP)->itemList());
+ graphlayout(sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList());
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done(SP_DT_DOCUMENT(SP_ACTIVE_DESKTOP));
+ sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP));
}
};
}
};
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
prefs_set_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
prefs_set_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
- unclump ((GSList *) SP_DT_SELECTION(SP_ACTIVE_DESKTOP)->itemList());
+ unclump ((GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList());
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done (SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP));
+ sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP));
}
};
}
};
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
it != selected.end();
++it)
{
it != selected.end();
++it)
{
- sp_document_ensure_up_to_date(SP_DT_DOCUMENT (desktop));
+ sp_document_ensure_up_to_date(sp_desktop_document (desktop));
NR::Rect item_box = sp_item_bbox_desktop (*it);
// find new center, staying within bbox
double x = _dialog.randomize_bbox.min()[NR::X] + item_box.extent(NR::X)/2 +
NR::Rect item_box = sp_item_bbox_desktop (*it);
// find new center, staying within bbox
double x = _dialog.randomize_bbox.min()[NR::X] + item_box.extent(NR::X)/2 +
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done (SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP));
+ sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP));
}
};
}
};
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop) return;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
if (!selection) return;
using Inkscape::Util::GSListConstIterator;
}
if (changed) {
}
if (changed) {
- sp_document_done (SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP));
+ sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP));
}
}
};
}
}
};
void on_tool_changed(Inkscape::Application *inkscape, SPEventContext *context, AlignAndDistribute *daad)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
void on_tool_changed(Inkscape::Application *inkscape, SPEventContext *context, AlignAndDistribute *daad)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- if (desktop && SP_DT_EVENTCONTEXT(desktop))
+ if (desktop && sp_desktop_event_context(desktop))
daad->setMode(tools_active(desktop) == TOOLS_NODES);
}
daad->setMode(tools_active(desktop) == TOOLS_NODES);
}