summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2006-04-17 04:46:51 +0000
committermental <mental@users.sourceforge.net>2006-04-17 04:46:51 +0000
commit805747f6b136ad2e89f5ca1020ca43506d2b5391 (patch)
treebeded9b49a5f2f5a3ac956ded5604cee5d61cd0c /src/ui/dialog
parentSP_DT_DOCUMENT -> sp_desktop_document (diff)
downloadinkscape-805747f6b136ad2e89f5ca1020ca43506d2b5391.tar.gz
inkscape-805747f6b136ad2e89f5ca1020ca43506d2b5391.zip
Get rid of the SP_DT_* macros which do nothing more than provide additional, confusing, names for other functions. If shorter names are desired, the actual functions should be renamed -- or better, made into member functions.
(bzr r532)
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/align-and-distribute.cpp42
-rw-r--r--src/ui/dialog/dialog.cpp2
-rw-r--r--src/ui/dialog/document-metadata.cpp10
-rw-r--r--src/ui/dialog/document-properties.cpp16
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp6
-rw-r--r--src/ui/dialog/session-player.cpp2
-rw-r--r--src/ui/dialog/transformation.cpp12
7 files changed, 45 insertions, 45 deletions
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index fc8b6b2f5..08e197586 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -118,7 +118,7 @@ private :
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;
@@ -159,14 +159,14 @@ private :
}
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
- ( (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;
@@ -200,7 +200,7 @@ private :
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]);
@@ -215,7 +215,7 @@ private :
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) );
}
@@ -287,7 +287,7 @@ private :
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;
@@ -374,7 +374,7 @@ private :
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;
@@ -408,7 +408,7 @@ private :
{
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;
@@ -478,13 +478,13 @@ private :
// 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);
- sp_document_done(SP_DT_DOCUMENT(SP_ACTIVE_DESKTOP));
+ sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP));
}
};
@@ -508,12 +508,12 @@ private :
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);
- sp_document_done(SP_DT_DOCUMENT(SP_ACTIVE_DESKTOP));
+ sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP));
}
};
@@ -537,12 +537,12 @@ private :
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);
- sp_document_done (SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP));
+ sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP));
}
};
@@ -563,7 +563,7 @@ private :
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;
@@ -590,7 +590,7 @@ private :
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 +
@@ -605,7 +605,7 @@ private :
// 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));
}
};
@@ -649,7 +649,7 @@ private :
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;
@@ -717,7 +717,7 @@ private :
}
if (changed) {
- sp_document_done (SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP));
+ sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP));
}
}
};
@@ -727,7 +727,7 @@ private :
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);
}
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp
index 7cb360a43..074ee0d36 100644
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
@@ -331,7 +331,7 @@ Dialog::onDesktopActivated (SPDesktop *desktop)
Inkscape::Selection*
Dialog::_getSelection()
{
- return SP_DT_SELECTION(SP_ACTIVE_DESKTOP);
+ return sp_desktop_selection(SP_ACTIVE_DESKTOP);
}
void
diff --git a/src/ui/dialog/document-metadata.cpp b/src/ui/dialog/document-metadata.cpp
index bbe64b201..090cb42ca 100644
--- a/src/ui/dialog/document-metadata.cpp
+++ b/src/ui/dialog/document-metadata.cpp
@@ -103,7 +103,7 @@ DocumentMetadata::init()
{
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);
_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
@@ -120,7 +120,7 @@ DocumentMetadata::init()
DocumentMetadata::~DocumentMetadata()
{
- 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);
_doc_replaced_connection.disconnect();
@@ -261,7 +261,7 @@ on_activate_desktop (Inkscape::Application *, SPDesktop* dt, void*)
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);
_instance->_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_instance->update();
@@ -273,7 +273,7 @@ on_deactivate_desktop (Inkscape::Application *, SPDesktop* dt, void*)
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);
_instance->_doc_replaced_connection.disconnect();
}
@@ -284,7 +284,7 @@ on_doc_replaced (SPDesktop* dt, SPDocument* doc)
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);
_instance->update();
}
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 8a1035eb3..9951f5956 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -109,7 +109,7 @@ DocumentProperties::init()
{
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);
_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
@@ -126,7 +126,7 @@ DocumentProperties::init()
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);
_doc_replaced_connection.disconnect();
}
@@ -361,7 +361,7 @@ DocumentProperties::update()
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);
@@ -375,8 +375,8 @@ DocumentProperties::update()
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
@@ -462,7 +462,7 @@ on_activate_desktop (Inkscape::Application *, SPDesktop* dt, void*)
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);
_instance->_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_instance->update();
@@ -474,7 +474,7 @@ on_deactivate_desktop (Inkscape::Application *, SPDesktop* dt, void*)
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);
_instance->_doc_replaced_connection.disconnect();
}
@@ -485,7 +485,7 @@ on_doc_replaced (SPDesktop* dt, SPDocument* doc)
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);
_instance->update();
}
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 4dd20682f..3ebf50eb9 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -215,10 +215,10 @@ void StyleFromSelectionToTool(gchar const *prefs_path, StyleSwatch *swatch)
if (desktop == NULL)
return;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (selection->isEmpty()) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE,
+ sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE,
_("<b>No objects selected</b> to take the style from."));
return;
}
@@ -227,7 +227,7 @@ void StyleFromSelectionToTool(gchar const *prefs_path, StyleSwatch *swatch)
/* TODO: If each item in the selection has the same style then don't consider it an error.
* Maybe we should try to handle multiple selections anyway, e.g. the intersection of the
* style attributes for the selected items. */
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE,
+ sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE,
_("<b>More than one object selected.</b> Cannot take style from multiple objects."));
return;
}
diff --git a/src/ui/dialog/session-player.cpp b/src/ui/dialog/session-player.cpp
index 48c3ff5ef..97ef5618e 100644
--- a/src/ui/dialog/session-player.cpp
+++ b/src/ui/dialog/session-player.cpp
@@ -182,7 +182,7 @@ SessionPlaybackDialogImpl::_respCallback(int resp)
switch (result) {
case Gtk::RESPONSE_OK:
this->_sm->clearDocument();
- sp_document_done(SP_DT_DOCUMENT(this->_desktop));
+ sp_document_done(sp_desktop_document(this->_desktop));
this->_sm->loadSessionFile(sessionfiledlg.get_filename());
this->_openfile.set_text(this->_sfp->filename());
break;
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp
index 92baa7b81..28710ace3 100644
--- a/src/ui/dialog/transformation.cpp
+++ b/src/ui/dialog/transformation.cpp
@@ -437,7 +437,7 @@ void
Transformation::onSwitchPage(GtkNotebookPage *page,
guint pagenum)
{
- updateSelection((PageType)pagenum, SP_DT_SELECTION(SP_ACTIVE_DESKTOP));
+ updateSelection((PageType)pagenum, sp_desktop_selection(SP_ACTIVE_DESKTOP));
}
void
@@ -581,7 +581,7 @@ Transformation::applyPageMove(Inkscape::Selection *selection)
x - bbox.min()[NR::X], y - bbox.min()[NR::Y]);
}
- sp_document_done ( SP_DT_DOCUMENT (selection->desktop()) );
+ sp_document_done ( sp_desktop_document (selection->desktop()) );
}
void
@@ -632,7 +632,7 @@ Transformation::applyPageScale(Inkscape::Selection *selection)
sp_selection_scale_relative(selection, center, scale);
}
- sp_document_done(SP_DT_DOCUMENT(selection->desktop()));
+ sp_document_done(sp_desktop_document(selection->desktop()));
}
void
@@ -650,7 +650,7 @@ Transformation::applyPageRotate(Inkscape::Selection *selection)
sp_selection_rotate_relative(selection, center, angle);
}
- sp_document_done(SP_DT_DOCUMENT(selection->desktop()));
+ sp_document_done(sp_desktop_document(selection->desktop()));
}
void
@@ -702,7 +702,7 @@ Transformation::applyPageSkew(Inkscape::Selection *selection)
}
}
- sp_document_done(SP_DT_DOCUMENT(selection->desktop()));
+ sp_document_done(sp_desktop_document(selection->desktop()));
}
@@ -727,7 +727,7 @@ Transformation::applyPageTransform(Inkscape::Selection *selection)
sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform
}
- sp_document_done(SP_DT_DOCUMENT(selection->desktop()));
+ sp_document_done(sp_desktop_document(selection->desktop()));
}