diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-17 10:37:34 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-17 10:37:34 +0000 |
| commit | 1ae24d44779b675dfb80d5e52b73932ece9fe49e (patch) | |
| tree | 7e8f925511edf48890c6e7e0ef88bb60264e8415 /src | |
| parent | update potfiles (diff) | |
| download | inkscape-1ae24d44779b675dfb80d5e52b73932ece9fe49e.tar.gz inkscape-1ae24d44779b675dfb80d5e52b73932ece9fe49e.zip | |
Remove confusing and broken save as PNG option
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/extension/init.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/cairo-png-out.cpp | 126 | ||||
| -rw-r--r-- | src/extension/internal/cairo-png-out.h | 55 |
4 files changed, 0 insertions, 185 deletions
diff --git a/src/extension/CMakeLists.txt b/src/extension/CMakeLists.txt index 8f0f1bcc4..e779f788a 100644 --- a/src/extension/CMakeLists.txt +++ b/src/extension/CMakeLists.txt @@ -33,7 +33,6 @@ set(extension_SRC param/string.cpp internal/bluredge.cpp - internal/cairo-png-out.cpp internal/cairo-ps-out.cpp internal/cairo-render-context.cpp internal/cairo-renderer.cpp @@ -99,7 +98,6 @@ set(extension_SRC implementation/xslt.h internal/bluredge.h - internal/cairo-png-out.h internal/cairo-ps-out.h internal/cairo-render-context.h internal/cairo-renderer-pdf-out.h diff --git a/src/extension/init.cpp b/src/extension/init.cpp index 8e3c757f8..49ac2e802 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -38,7 +38,6 @@ # include "internal/wmf-print.h" #ifdef HAVE_CAIRO_PDF # include "internal/cairo-renderer-pdf-out.h" -# include "internal/cairo-png-out.h" # include "internal/cairo-ps-out.h" #endif #include "internal/pov-out.h" @@ -155,7 +154,6 @@ init() #ifdef HAVE_CAIRO_PDF //g_print ("Using CairoRendererPdfOutput: new pdf exporter\n"); Internal::CairoRendererPdfOutput::init(); - Internal::CairoRendererOutput::init(); Internal::CairoPsOutput::init(); Internal::CairoEpsOutput::init(); diff --git a/src/extension/internal/cairo-png-out.cpp b/src/extension/internal/cairo-png-out.cpp deleted file mode 100644 index 446e593ca..000000000 --- a/src/extension/internal/cairo-png-out.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * A quick hack to use the Cairo renderer to write out a file. This - * then makes 'save as...' PNG. - * - * Authors: - * Ted Gould <ted@gould.cx> - * Ulf Erikson <ulferikson@users.sf.net> - * Jon A. Cruz <jon@joncruz.org> - * Abhishek Sharma - * - * Copyright (C) 2004-2006 Authors - * - * Released under GNU GPL v2+, read the file 'COPYING' for more information. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" // only include where actually required! -#endif - -#ifdef HAVE_CAIRO_PDF - -#include "cairo-png-out.h" -#include "cairo-render-context.h" -#include "cairo-renderer.h" -#include <print.h> -#include "extension/system.h" -#include "extension/print.h" -#include "extension/db.h" -#include "extension/output.h" -#include "display/drawing.h" - -#include "display/curve.h" -#include "display/canvas-bpath.h" -#include "object/sp-item.h" -#include "object/sp-root.h" - -#include "io/sys.h" -#include "document.h" - -namespace Inkscape { -namespace Extension { -namespace Internal { - -bool CairoRendererOutput::check(Inkscape::Extension::Extension * /*module*/) -{ - return true; -} - -static bool -png_render_document_to_file(SPDocument *doc, gchar const *filename) -{ - CairoRenderer *renderer; - CairoRenderContext *ctx; - - doc->ensureUpToDate(); - -/* Start */ - - SPItem *base = doc->getRoot(); - Inkscape::Drawing drawing; - unsigned dkey = SPItem::display_key_new(1); - base->invoke_show(drawing, dkey, SP_ITEM_SHOW_DISPLAY); - - /* Create renderer and context */ - renderer = new CairoRenderer(); - ctx = renderer->createContext(); - - /* Render document */ - bool ret = renderer->setupDocument(ctx, doc, TRUE, 0., nullptr); - if (ret) { - renderer->renderItem(ctx, base); - ctx->saveAsPng(filename); - ret = ctx->finish(); - } - renderer->destroyContext(ctx); - - base->invoke_hide(dkey); -/* end */ - delete renderer; - - return ret; -} - - -/** - \brief This function calls the output module with the filename - \param mod unused - \param doc Document to be saved - \param uri Filename to save to (probably will end in .png) -*/ -void CairoRendererOutput::save(Inkscape::Extension::Output * /*mod*/, SPDocument *doc, gchar const *filename) -{ - if (!png_render_document_to_file(doc, filename)) { - throw Inkscape::Extension::Output::save_failed(); - } -} - -/** - \brief A function allocate a copy of this function. - - This is the definition of Cairo PNG out. This function just - calls the extension system with the memory allocated XML that - describes the data. -*/ -void -CairoRendererOutput::init () -{ - Inkscape::Extension::build_from_mem( - "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n" - "<name>Cairo PNG Output</name>\n" - "<id>org.inkscape.output.png.cairo</id>\n" - "<output>\n" - "<extension>.png</extension>\n" - "<mimetype>image/png</mimetype>\n" - "<filetypename>Cairo PNG (*.png)</filetypename>\n" - "<filetypetooltip>PNG File</filetypetooltip>\n" - "</output>\n" - "</inkscape-extension>", new CairoRendererOutput()); - - return; -} - -} } } /* namespace Inkscape, Extension, Implementation */ - -#endif /* HAVE_CAIRO_PDF */ diff --git a/src/extension/internal/cairo-png-out.h b/src/extension/internal/cairo-png-out.h deleted file mode 100644 index 12ebdae64..000000000 --- a/src/extension/internal/cairo-png-out.h +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * A quick hack to use the print output to write out a file. This - * then makes 'save as...' PNG. - * - * Authors: - * Ted Gould <ted@gould.cx> - * Ulf Erikson <ulferikson@users.sf.net> - * - * Copyright (C) 2004-2006 Authors - * - * Released under GNU GPL v2+, read the file 'COPYING' for more information. - */ - -#ifndef EXTENSION_INTERNAL_CAIRO_PNG_OUT_H -#define EXTENSION_INTERNAL_CAIRO_PNG_OUT_H - -#ifdef HAVE_CONFIG_H -# include "config.h" // only include where actually required! -#endif - -#include "extension/implementation/implementation.h" - -#ifdef HAVE_CAIRO_PDF - -namespace Inkscape { -namespace Extension { -namespace Internal { - -class CairoRendererOutput : Inkscape::Extension::Implementation::Implementation { - -public: - bool check(Inkscape::Extension::Extension *module) override; - void save(Inkscape::Extension::Output *mod, - SPDocument *doc, - gchar const *filename) override; - static void init(); -}; - -} } } /* namespace Inkscape, Extension, Implementation */ - -#endif /* HAVE_CAIRO_PDF */ - -#endif /* !EXTENSION_INTERNAL_CAIRO_PNG_OUT_H */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
