gdkpixbuf-input.cpp revision 4c5b6cd53eb59c0347f65490e6de3621f80a3443
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <boost/scoped_ptr.hpp>
#include "document-private.h"
#include <dir-util.h>
#include "gdkpixbuf-input.h"
#include "preferences.h"
#include "selection-chemistry.h"
#include "sp-image.h"
#include "document-undo.h"
#include "image-resolution.h"
#include "display/cairo-utils.h"
#include <set>
namespace Inkscape {
namespace Extension {
namespace Internal {
{
// Determine whether the image should be embedded
// std::cout << "GkdpixbufInput::open: "
// << " ask: " << ask
// << ", link: " << link
// << ", forcexdpi: " << forcexdpi
// << ", scale: " << scale << std::endl;
// std::cout << " in preferences: "
// << " ask: " << !mod->get_param_bool("do_not_ask")
// << ", link: " << mod->get_param_optiongroup("link")
// << ", mod_dpi: " << mod->get_param_optiongroup("dpi")
// << ", scale: " << mod->get_param_optiongroup("scale") << std::endl;
if( ask ) {
}
if( forcexdpi != mod_forcexdpi ) {
}
}
}
// TODO: the pixbuf is created again from the base64-encoded attribute in SPImage.
// Find a way to create the pixbuf only once.
if (pb) {
double defaultxdpi = prefs->getDouble("/dialogs/import/defaultxdpi/value", Inkscape::Util::Quantity::convert(1, "in", "px"));
ImageResolution *ir = 0;
double xscale = 1;
double yscale = 1;
}
} else {
}
delete ir; // deleting NULL is safe
// Create image node
// Added 11 Feb 2014 as we now honor "preserveAspectRatio" and this is
// what Inkscaper's expect.
}
if (embed) {
} else {
// convert filename to uri
if(_uri) {
} else {
}
}
// Add it to the current layer
// Set viewBox if it doesn't exist
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
}
// restore undo, as now this document may be shown to the user if a bitmap was opened
} else {
printf("GdkPixbuf loader failed\n");
}
return doc;
}
#include "clear-n_.h"
void
GdkpixbufInput::init(void)
{
/* \todo I'm not sure if I need to free this list */
formatlist != NULL;
for (int i = 0; extensions[i] != NULL; i++) {
/* thanks but no thanks, we'll handle SVG extensions... */
continue;
}
continue;
}
continue;
}
"<name>%s</name>\n"
"<id>org.inkscape.input.gdkpixbuf.%s</id>\n"
"<param name='link' type='optiongroup' appearance='full' _gui-text='" N_("Image Import Type:") "' _gui-description='" N_("Embed results in stand-alone, larger SVG files. Link references a file outside this SVG document and all files must be moved together.") "' >\n"
"</param>\n"
"<param name='dpi' type='optiongroup' appearance='full' _gui-text='" N_("Image DPI:") "' _gui-description='" N_("Take information from file or use default bitmap import resolution as defined in the preferences.") "' >\n"
"</param>\n"
"<param name='scale' type='optiongroup' appearance='full' _gui-text='" N_("Image Rendering Mode:") "' _gui-description='" N_("When an image is upscaled, apply smoothing or keep blocky (pixelated). (Will not work in all browsers.)") "' >\n"
"</param>\n"
"<param name=\"do_not_ask\" _gui-description='" N_("Hide the dialog next time and always apply the same actions.") "' gui-text=\"" N_("Don't ask again") "\" type=\"boolean\" >false</param>\n"
"<input>\n"
"<extension>.%s</extension>\n"
"<mimetype>%s</mimetype>\n"
"<filetypename>%s (*.%s)</filetypename>\n"
"<filetypetooltip>%s</filetypetooltip>\n"
"</input>\n"
"</inkscape-extension>",
extensions[i],
extensions[i],
mimetypes[j],
name,
extensions[i],
);
}}
}
}
} } } /* namespace Inkscape, Extension, Implementation */
/*
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 :