print.cpp revision c823e1769a374d5c2e58db8d6a6730d2f36cec50
/** @file
* @brief Print dialog
*/
/* Authors:
* Kees Cook <kees@outflux.net>
*
* Copyright (C) 2007 Kees Cook
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef WIN32
#include <io.h>
#include <windows.h>
#endif
#include "print.h"
#include "extension/internal/cairo-render-context.h"
#include "extension/internal/cairo-renderer.h"
#include "ui/widget/rendering-options.h"
#include "document.h"
#include "unit-constants.h"
#include "helper/png-write.h"
#include "svg/svg-color.h"
static void
gint /*page_nr*/,
{
//printf("%s %d\n",__FUNCTION__, page_nr);
// Render as exported PNG
int tmp_fd;
// This doesn't seem to work:
//context->set_cairo_context ( Cairo::Context::create (Cairo::ImageSurface::create_from_png (tmp_png) ), dpi, dpi );
//
// so we'll use a surface pattern blat instead...
//
// but the C++ interface isn't implemented in cairomm:
//context->get_cairo_context ()->set_source_surface(Cairo::ImageSurface::create_from_png (tmp_png) );
//
// so do it in C:
{
cairo_get_matrix(cr, &m);
// FIXME: why is the origin offset??
cairo_set_matrix(cr, &m);
}
// Clean up
}
else {
g_warning(_("Could not open temporary PNG for bitmap printing"));
}
}
else {
// Render as vectors
// ctx->setPSLevel(CAIRO_PS_LEVEL_3);
ctx->setTextToPath(false);
ctx->setFilterToBitmap(true);
#ifdef WIN32
//Gtk+ does not take the non printable area into account
//
// This workaround translates the origin from the top left of the
// printable area to the top left of the page.
if (hdc) {
}
#endif
if (ret) {
if (ret) {
}
else {
g_warning(_("Could not set up Document"));
}
}
else {
g_warning(_("Failed to set CairoRenderContext"));
}
// Clean up
}
}
static GObject*
{
//printf("%s\n",__FUNCTION__);
}
static void
GtkPrintContext */*context*/,
gpointer /*user_data*/)
{
//printf("%s\n",__FUNCTION__);
}
namespace Inkscape {
namespace UI {
namespace Dialog {
{
// set up dialog title, based on document name
title += " ";
// set up paper size to match the document size
if (doc_width > doc_height) {
} else {
}
// set up signals
g_signal_connect (_printop, "create-custom-widget", G_CALLBACK (create_custom_widget), _tab.gobj());
// build custom preferences tab
}
{
return Gtk::PRINT_OPERATION_RESULT_APPLY;
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
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:encoding=utf-8:textwidth=99 :