summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/aboutbox.cpp8
-rw-r--r--src/ui/dialog/align-and-distribute.cpp8
-rw-r--r--src/ui/dialog/document-properties.cpp16
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp8
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp5
-rw-r--r--src/ui/dialog/print.cpp8
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp2
-rw-r--r--src/ui/dialog/swatches.cpp10
-rw-r--r--src/ui/dialog/tile.cpp2
10 files changed, 35 insertions, 36 deletions
diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp
index 7ed00ad19..8c102b57f 100644
--- a/src/ui/dialog/aboutbox.cpp
+++ b/src/ui/dialog/aboutbox.cpp
@@ -147,7 +147,7 @@ Gtk::Widget *build_splash_widget() {
// should be in UTF-*8..
char *about=g_build_filename(INKSCAPE_SCREENSDIR, _("about.svg"), NULL);
- SPDocument *doc=SPDocument::createDoc (about, TRUE);
+ SPDocument *doc=SPDocument::createNewDoc (about, TRUE);
g_free(about);
g_return_val_if_fail(doc != NULL, NULL);
@@ -155,12 +155,12 @@ Gtk::Widget *build_splash_widget() {
if ( version && SP_IS_TEXT(version) ) {
sp_te_set_repr_text_multiline (SP_TEXT (version), Inkscape::version_string);
}
- sp_document_ensure_up_to_date(doc);
+ doc->ensure_up_to_date();
GtkWidget *v=sp_svg_view_widget_new(doc);
- double width=sp_document_width(doc);
- double height=sp_document_height(doc);
+ double width=doc->getWidth();
+ double height=doc->getHeight();
doc->doUnref();
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index d7e3d1766..0b47f42ab 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -163,8 +163,8 @@ private :
}
case AlignAndDistribute::PAGE:
- mp = Geom::Point(a.mx1 * sp_document_width(sp_desktop_document(desktop)),
- a.my1 * sp_document_height(sp_desktop_document(desktop)));
+ mp = Geom::Point(a.mx1 * sp_desktop_document(desktop)->getWidth(),
+ a.my1 * sp_desktop_document(desktop)->getHeight());
break;
case AlignAndDistribute::DRAWING:
@@ -215,7 +215,7 @@ private :
it != selected.end();
it++)
{
- sp_document_ensure_up_to_date(sp_desktop_document (desktop));
+ sp_desktop_document (desktop)->ensure_up_to_date();
if (!sel_as_group)
b = (*it)->getBboxDesktop();
if (b) {
@@ -621,7 +621,7 @@ private :
it != selected.end();
++it)
{
- sp_document_ensure_up_to_date(sp_desktop_document (desktop));
+ sp_desktop_document (desktop)->ensure_up_to_date();
Geom::OptRect item_box = (*it)->getBboxDesktop ();
if (item_box) {
// find new center, staying within bbox
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 33fdf8327..970c609af 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -460,7 +460,7 @@ void
DocumentProperties::populate_linked_profiles_box()
{
_LinkedProfilesListStore->clear();
- const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "iccprofile" );
+ const GSList *current = SP_ACTIVE_DOCUMENT->get_resource_list( "iccprofile" );
if (current) _emb_profiles_observer.set(SP_OBJECT(current->data)->parent);
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
@@ -517,7 +517,7 @@ void DocumentProperties::removeSelectedProfile(){
}
}
- const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "iccprofile" );
+ const GSList *current = SP_ACTIVE_DOCUMENT->get_resource_list( "iccprofile" );
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj);
@@ -589,7 +589,7 @@ DocumentProperties::build_cms()
_LinkedProfilesList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::linked_profiles_list_button_release));
cms_create_popup_menu(_LinkedProfilesList, sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile));
- const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "defs" );
+ const GSList *current = SP_ACTIVE_DOCUMENT->get_resource_list( "defs" );
if (current) {
_emb_profiles_observer.set(SP_OBJECT(current->data)->parent);
}
@@ -647,7 +647,7 @@ DocumentProperties::build_scripting()
#endif // ENABLE_LCMS
//TODO: review this observers code:
- const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "script" );
+ const GSList *current = SP_ACTIVE_DOCUMENT->get_resource_list( "script" );
if (current) {
_ext_scripts_observer.set(SP_OBJECT(current->data)->parent);
}
@@ -686,7 +686,7 @@ void DocumentProperties::removeExternalScript(){
}
}
- const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "script" );
+ const GSList *current = SP_ACTIVE_DOCUMENT->get_resource_list( "script" );
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
SPScript* script = (SPScript*) obj;
@@ -703,7 +703,7 @@ void DocumentProperties::removeExternalScript(){
void DocumentProperties::populate_external_scripts_box(){
_ExternalScriptsListStore->clear();
- const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "script" );
+ const GSList *current = SP_ACTIVE_DOCUMENT->get_resource_list( "script" );
if (current) _ext_scripts_observer.set(SP_OBJECT(current->data)->parent);
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
@@ -822,8 +822,8 @@ DocumentProperties::update()
if (nv->doc_units)
_rum_deflt.setUnit (nv->doc_units);
- double const doc_w_px = sp_document_width(sp_desktop_document(dt));
- double const doc_h_px = sp_document_height(sp_desktop_document(dt));
+ double const doc_w_px = sp_desktop_document(dt)->getWidth();
+ double const doc_h_px = sp_desktop_document(dt)->getHeight();
_page_sizer.setDim (doc_w_px, doc_h_px);
_page_sizer.updateFitMarginsUI(SP_OBJECT_REPR(nv));
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp
index eb2d33eee..5a9f37bf0 100644
--- a/src/ui/dialog/filedialogimpl-gtkmm.cpp
+++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp
@@ -151,7 +151,7 @@ bool SVGPreview::setFileName(Glib::ustring &theFileName)
* I don't know why passing false to keepalive is bad. But it
* prevents the display of an svg with a non-ascii filename
*/
- SPDocument *doc = SPDocument::createDoc (fileName.c_str(), true);
+ SPDocument *doc = SPDocument::createNewDoc (fileName.c_str(), true);
if (!doc) {
g_warning("SVGView: error loading document '%s'\n", fileName.c_str());
return false;
@@ -172,7 +172,7 @@ bool SVGPreview::setFromMem(char const *xmlBuffer)
return false;
gint len = (gint)strlen(xmlBuffer);
- SPDocument *doc = SPDocument::createDocFromMem(xmlBuffer, len, 0);
+ SPDocument *doc = SPDocument::createNewDocFromMem(xmlBuffer, len, 0);
if (!doc) {
g_warning("SVGView: error loading buffer '%s'\n",xmlBuffer);
return false;
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index 8a0c70f7c..aabb3c2df 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -887,7 +887,7 @@ bool FileOpenDialogImplWin32::set_svg_preview()
gchar *utf8string = g_utf16_to_utf8((const gunichar2*)_path_string,
_MAX_PATH, NULL, NULL, NULL);
- SPDocument *svgDoc = SPDocument::createDoc (utf8string, true);
+ SPDocument *svgDoc = SPDocument::createNewDoc (utf8string, true);
g_free(utf8string);
// Check the document loaded properly
@@ -899,8 +899,8 @@ bool FileOpenDialogImplWin32::set_svg_preview()
}
// Get the size of the document
- const double svgWidth = sp_document_width(svgDoc);
- const double svgHeight = sp_document_height(svgDoc);
+ const double svgWidth = svgDoc->getWidth();
+ const double svgHeight = svgDoc->getHeight();
// Find the minimum scale to fit the image inside the preview area
const double scaleFactorX = PreviewSize / svgWidth;
@@ -917,7 +917,7 @@ bool FileOpenDialogImplWin32::set_svg_preview()
// write object bbox to area
Geom::OptRect maybeArea(area);
- sp_document_ensure_up_to_date (svgDoc);
+ svgDoc->ensure_up_to_date ();
static_cast<(SPItem *)>(svgDoc->root)->invoke_bbox( maybeArea,
static_cast<(SPItem *)>(svgDoc->root)->i2d_affine(), TRUE);
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 1672c4b69..7baf2d71f 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1144,8 +1144,7 @@ void FilterEffectsDialog::FilterModifier::on_activate_desktop(Application*, SPDe
me->_resource_changed.disconnect();
me->_resource_changed =
- sp_document_resources_changed_connect(sp_desktop_document(desktop), "filter",
- sigc::mem_fun(me, &FilterModifier::update_filters));
+ sp_desktop_document(desktop)->resources_changed_connect("filter",sigc::mem_fun(me, &FilterModifier::update_filters));
me->_dialog.setDesktop(desktop);
@@ -1262,7 +1261,7 @@ void FilterEffectsDialog::FilterModifier::update_filters()
{
SPDesktop* desktop = _dialog.getDesktop();
SPDocument* document = sp_desktop_document(desktop);
- const GSList* filters = sp_document_get_resource_list(document, "filter");
+ const GSList* filters = document->get_resource_list("filter");
_model->clear();
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp
index 60cab06a2..808386171 100644
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
@@ -46,8 +46,8 @@ static void draw_page(
if (junk->_tab->as_bitmap()) {
// Render as exported PNG
- gdouble width = sp_document_width(junk->_doc);
- gdouble height = sp_document_height(junk->_doc);
+ gdouble width = (junk->_doc)->getWidth();
+ gdouble height = (junk->_doc)->getHeight();
gdouble dpi = junk->_tab->bitmap_dpi();
std::string tmp_png;
std::string tmp_base = "inkscape-print-png-XXXXXX";
@@ -190,8 +190,8 @@ Print::Print(SPDocument *doc, SPItem *base) :
// set up paper size to match the document size
gtk_print_operation_set_unit (_printop, GTK_UNIT_POINTS);
GtkPageSetup *page_setup = gtk_page_setup_new();
- gdouble doc_width = sp_document_width(_doc) * PT_PER_PX;
- gdouble doc_height = sp_document_height(_doc) * PT_PER_PX;
+ gdouble doc_width = _doc->getWidth() * PT_PER_PX;
+ gdouble doc_height = _doc->getHeight() * PT_PER_PX;
GtkPaperSize *paper_size;
if (doc_width > doc_height) {
gtk_page_setup_set_orientation (page_setup, GTK_PAGE_ORIENTATION_LANDSCAPE);
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 998f4e1e1..7f41c4d6b 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -243,7 +243,7 @@ void SvgFontsDialog::update_fonts()
{
SPDesktop* desktop = this->getDesktop();
SPDocument* document = sp_desktop_document(desktop);
- const GSList* fonts = sp_document_get_resource_list(document, "font");
+ const GSList* fonts = document->get_resource_list("font");
_model->clear();
for(const GSList *l = fonts; l; l = l->next) {
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index 90e9e5f7b..d5d48a528 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -127,7 +127,7 @@ static void editGradient( GtkMenuItem */*menuitem*/, gpointer /*user_data*/ )
SPDocument *doc = desktop ? desktop->doc() : 0;
if (doc) {
std::string targetName(bounceTarget->def.descr);
- const GSList *gradients = sp_document_get_resource_list(doc, "gradient");
+ const GSList *gradients = doc->get_resource_list("gradient");
for (const GSList *item = gradients; item; item = item->next) {
SPGradient* grad = SP_GRADIENT(item->data);
if ( targetName == grad->getId() ) {
@@ -178,7 +178,7 @@ void SwatchesPanelHook::convertGradient( GtkMenuItem * /*menuitem*/, gpointer us
if ( doc && (index >= 0) && (static_cast<guint>(index) < popupItems.size()) ) {
Glib::ustring targetName = popupItems[index];
- const GSList *gradients = sp_document_get_resource_list(doc, "gradient");
+ const GSList *gradients = doc->get_resource_list("gradient");
for (const GSList *item = gradients; item; item = item->next) {
SPGradient* grad = SP_GRADIENT(item->data);
if ( targetName == grad->getId() ) {
@@ -306,7 +306,7 @@ gboolean colorItemHandleButtonPress( GtkWidget* widget, GdkEventButton* event, g
SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(wdgt);
if ( dtw && dtw->desktop ) {
// Pick up all gradients with vectors
- const GSList *gradients = sp_document_get_resource_list(dtw->desktop->doc(), "gradient");
+ const GSList *gradients = (dtw->desktop->doc())->get_resource_list("gradient");
gint index = 0;
for (const GSList *curr = gradients; curr; curr = curr->next) {
SPGradient* grad = SP_GRADIENT(curr->data);
@@ -759,7 +759,7 @@ void SwatchesPanel::_trackDocument( SwatchesPanel *panel, SPDocument *document )
}
docPerPanel[panel] = document;
if (!found) {
- sigc::connection conn1 = sp_document_resources_changed_connect( document, "gradient", sigc::bind(sigc::ptr_fun(&SwatchesPanel::handleGradientsChange), document) );
+ sigc::connection conn1 = document->resources_changed_connect( "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))) );
@@ -797,7 +797,7 @@ static void recalcSwatchContents(SPDocument* doc,
{
std::vector<SPGradient*> newList;
- const GSList *gradients = sp_document_get_resource_list(doc, "gradient");
+ const GSList *gradients = doc->get_resource_list("gradient");
for (const GSList *item = gradients; item; item = item->next) {
SPGradient* grad = SP_GRADIENT(item->data);
if ( grad->isSwatch() ) {
diff --git a/src/ui/dialog/tile.cpp b/src/ui/dialog/tile.cpp
index dfb319f90..546fdd8f0 100644
--- a/src/ui/dialog/tile.cpp
+++ b/src/ui/dialog/tile.cpp
@@ -159,7 +159,7 @@ void TileDialog::Grid_Arrange ()
grid_top = 99999;
SPDesktop *desktop = getDesktop();
- sp_document_ensure_up_to_date(sp_desktop_document(desktop));
+ sp_desktop_document(desktop)->ensure_up_to_date();
Inkscape::Selection *selection = sp_desktop_selection (desktop);
const GSList *items = selection ? selection->itemList() : 0;