summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-06-04 02:45:55 +0000
committerJon A. Cruz <jon@joncruz.org>2011-06-04 02:45:55 +0000
commit3638efba5bec8a6afc9211aa6bbe289767d20b38 (patch)
treecbf344e828109b1c37e2feee53cddd0c68a8cf83 /src/ui/dialog
parentgerman translation update (diff)
downloadinkscape-3638efba5bec8a6afc9211aa6bbe289767d20b38.tar.gz
inkscape-3638efba5bec8a6afc9211aa6bbe289767d20b38.zip
Removed outdated/unsafe SP_DOCUMENT_DEFS macro and reduced usage of SP_ROOT() gtk type function/macro.
(bzr r10254)
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/align-and-distribute.cpp3
-rw-r--r--src/ui/dialog/document-properties.cpp12
-rw-r--r--src/ui/dialog/find.cpp1
-rw-r--r--src/ui/dialog/layers.cpp7
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp4
-rw-r--r--src/ui/dialog/swatches.cpp4
6 files changed, 17 insertions, 14 deletions
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index 81e2b64a9..a2169c0b3 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -43,6 +43,7 @@
#include "util/glib-list-iterators.h"
#include "verbs.h"
#include "widgets/icon.h"
+#include "sp-root.h"
#include "align-and-distribute.h"
@@ -171,7 +172,7 @@ private :
case AlignAndDistribute::DRAWING:
{
- Geom::OptRect b = static_cast<SPItem *>( sp_desktop_document(desktop)->getRoot() )->getBboxDesktop();
+ Geom::OptRect b = sp_desktop_document(desktop)->getRoot()->getBboxDesktop();
if (b) {
mp = Geom::Point(a.mx0 * b->min()[Geom::X] + a.mx1 * b->max()[Geom::X],
a.my0 * b->min()[Geom::Y] + a.my1 * b->max()[Geom::Y]);
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 0c001da4b..b2ca2a3a8 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -145,7 +145,7 @@ DocumentProperties::init()
Inkscape::XML::Node *repr = sp_desktop_namedview(getDesktop())->getRepr();
repr->addListener (&_repr_events, this);
- Inkscape::XML::Node *root = sp_desktop_document(getDesktop())->root->getRepr();
+ Inkscape::XML::Node *root = sp_desktop_document(getDesktop())->getRoot()->getRepr();
root->addListener (&_repr_events, this);
show_all_children();
@@ -156,7 +156,7 @@ DocumentProperties::~DocumentProperties()
{
Inkscape::XML::Node *repr = sp_desktop_namedview(getDesktop())->getRepr();
repr->removeListenerByData (this);
- Inkscape::XML::Node *root = sp_desktop_document(getDesktop())->root->getRepr();
+ Inkscape::XML::Node *root = sp_desktop_document(getDesktop())->getRoot()->getRepr();
root->removeListenerByData (this);
}
@@ -421,7 +421,7 @@ DocumentProperties::linkSelectedProfile()
xml_doc->root()->addChild(defsRepr, NULL);
}
- g_assert(SP_ROOT(desktop->doc()->root)->defs);
+ g_assert(desktop->doc()->getDefs());
defsRepr->addChild(cprofRepr, NULL);
// TODO check if this next line was sometimes needed. It being there caused an assertion.
@@ -877,7 +877,7 @@ DocumentProperties::_handleDocumentReplaced(SPDesktop* desktop, SPDocument *docu
{
Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr();
repr->addListener(&_repr_events, this);
- Inkscape::XML::Node *root = document->root->getRepr();
+ Inkscape::XML::Node *root = document->getRoot()->getRepr();
root->addListener(&_repr_events, this);
update();
}
@@ -887,7 +887,7 @@ DocumentProperties::_handleActivateDesktop(Inkscape::Application *, SPDesktop *d
{
Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr();
repr->addListener(&_repr_events, this);
- Inkscape::XML::Node *root = sp_desktop_document(desktop)->root->getRepr();
+ Inkscape::XML::Node *root = sp_desktop_document(desktop)->getRoot()->getRepr();
root->addListener(&_repr_events, this);
update();
}
@@ -897,7 +897,7 @@ DocumentProperties::_handleDeactivateDesktop(Inkscape::Application *, SPDesktop
{
Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr();
repr->removeListenerByData(this);
- Inkscape::XML::Node *root = sp_desktop_document(desktop)->root->getRepr();
+ Inkscape::XML::Node *root = sp_desktop_document(desktop)->getRoot()->getRepr();
root->removeListenerByData(this);
}
diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp
index bdae14c62..aa6b4081e 100644
--- a/src/ui/dialog/find.cpp
+++ b/src/ui/dialog/find.cpp
@@ -50,6 +50,7 @@
#include "sp-use.h"
#include "sp-image.h"
#include "sp-offset.h"
+#include "sp-root.h"
#include "xml/repr.h"
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index 0eca5bbca..30924ab86 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -35,6 +35,7 @@
#include "verbs.h"
#include "widgets/icon.h"
#include "xml/repr.h"
+#include "sp-root.h"
#include "layers.h"
@@ -293,7 +294,7 @@ bool LayersPanel::_checkForUpdated(const Gtk::TreePath &/*path*/, const Gtk::Tre
}
void LayersPanel::_selectLayer( SPObject *layer ) {
- if ( !layer || (_desktop && _desktop->doc() && (layer == _desktop->doc()->root)) ) {
+ if ( !layer || (_desktop && _desktop->doc() && (layer == _desktop->doc()->getRoot())) ) {
if ( _tree.get_selection()->count_selected_rows() != 0 ) {
_tree.get_selection()->unselect_all();
}
@@ -328,7 +329,7 @@ void LayersPanel::_layersChanged()
// g_message("_layersChanged()");
if (_desktop) {
SPDocument* document = _desktop->doc();
- SPObject* root = document->root;
+ SPRoot* root = document->getRoot();
if ( root ) {
_selectedConnection.block();
if ( _desktop->layer_manager && _desktop->layer_manager->includes( root ) ) {
@@ -402,7 +403,7 @@ void LayersPanel::_pushTreeSelectionToCurrent()
_desktop->layer_manager->setCurrentLayer( inTree );
}
} else {
- _desktop->layer_manager->setCurrentLayer( _desktop->doc()->root );
+ _desktop->layer_manager->setCurrentLayer( _desktop->doc()->getRoot() );
}
}
}
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 4d53154d8..fbca0bf10 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -794,7 +794,7 @@ SPFont *new_font(SPDocument *document)
{
g_return_val_if_fail(document != NULL, NULL);
- SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document);
+ SPDefs *defs = document->getDefs();
Inkscape::XML::Document *xml_doc = document->getReprDoc();
@@ -911,7 +911,7 @@ SvgFontsDialog::SvgFontsDialog()
_FontsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::fonts_list_button_release));
create_fonts_popup_menu(_FontsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_font));
- _defs_observer.set(SP_DOCUMENT_DEFS(sp_desktop_document(this->getDesktop())));
+ _defs_observer.set(sp_desktop_document(this->getDesktop())->getDefs());
_defs_observer.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::update_fonts));
_getContents()->show_all();
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index 935fe9806..0f4626126 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -858,8 +858,8 @@ void SwatchesPanel::_trackDocument( SwatchesPanel *panel, SPDocument *document )
docPerPanel[panel] = document;
if (!found) {
sigc::connection conn1 = document->connectResourcesChanged( "gradient", sigc::bind(sigc::ptr_fun(&SwatchesPanel::handleGradientsChange), document) );
- sigc::connection conn2 = SP_DOCUMENT_DEFS(document)->connectRelease( sigc::hide(sigc::bind(sigc::ptr_fun(&SwatchesPanel::handleDefsModified), document)) );
- sigc::connection conn3 = SP_DOCUMENT_DEFS(document)->connectModified( sigc::hide(sigc::hide(sigc::bind(sigc::ptr_fun(&SwatchesPanel::handleDefsModified), document))) );
+ sigc::connection conn2 = document->getDefs()->connectRelease( sigc::hide(sigc::bind(sigc::ptr_fun(&SwatchesPanel::handleDefsModified), document)) );
+ sigc::connection conn3 = document->getDefs()->connectModified( sigc::hide(sigc::hide(sigc::bind(sigc::ptr_fun(&SwatchesPanel::handleDefsModified), document))) );
DocTrack *dt = new DocTrack(document, conn1, conn2, conn3);
docTrackings.push_back(dt);