/**
* @file
* Pixel art tracing settings dialog - implementation.
*/
/* Authors:
* Bob Jamison <rjamison@titan.com>
* Stéphane Gimenez <dev@gim.name>
* VinÃcius dos Santos Oliveira <vini.ipsmaker@gmail.com>
* Other dudes from The Inkscape Organization
*
* Copyright (C) 2004-2013 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef GLIBMM_DISABLE_DEPRECATED
# include <glibmm/dispatcher.h>
#else // GLIBMM_DISABLE_DEPRECATED
# include <glibmm/dispatcher.h>
#endif // GLIBMM_DISABLE_DEPRECATED
#include "pixelartdialog.h"
#include <gtkmm/radiobutton.h>
#include <gtkmm/messagedialog.h>
#include "ui/widget/spinbutton.h"
#include "desktop.h"
#include "desktop-tracker.h"
#include "message-stack.h"
#include "selection.h"
#include "preferences.h"
#include "sp-image.h"
#include "display/cairo-utils.h"
#include "libdepixelize/kopftracer2011.h"
#include <algorithm>
#include "document.h"
#include "xml/document.h"
#include "svg/svg-color.h"
#include "color.h"
#include "svg/css-ostringstream.h"
#include "document-undo.h"
#ifdef HAVE_OPENMP
#include <omp.h>
#endif // HAVE_OPENMP
namespace Inkscape {
namespace UI {
namespace Dialog {
/**
* A dialog for adjusting pixel art -> vector tracing parameters
*/
{
public:
private:
struct Input
{
SVGLength x;
SVGLength y;
};
struct Output
{
{}
SVGLength x;
SVGLength y;
};
//############ Events
void responseCallback(int response_id);
//############ UI Logic
void vectorize();
void setDefaults();
void updatePreview();
bool ignorePreview;
bool pendingPreview;
//############ UI
#endif // LIBDEPIXELIZE_INKSCAPE_ENABLE_SMOOTH
//############ UI Logic data
//############ Threads
void workerThread();
void onWorkerThreadFinished();
};
{
}
{
}
ignorePreview(false),
pendingPreview(false)
{
// Heuristics
{
{
}
{
}
}
// Output
{
#endif // LIBDEPIXELIZE_INKSCAPE_ENABLE_SMOOTH
}
// Buttons
{
//## The OK button
if (mainCancelButton) {
mainCancelButton->set_sensitive(false);
}
}
setDefaults();
desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &PixelArtDialogImpl::setTargetDesktop) );
}
{
if (response_id == GTK_RESPONSE_OK) {
vectorize();
} else if (response_id == GTK_RESPONSE_CANCEL) {
// libdepixelize's interface need to be extended to allow aborts
g_atomic_int_set(&abortThread, true);
} else if (response_id == GTK_RESPONSE_HELP) {
setDefaults();
} else {
hide();
return;
}
}
{
#else // LIBDEPIXELIZE_INKSCAPE_ENABLE_SMOOTH
#endif // LIBDEPIXELIZE_INKSCAPE_ENABLE_SMOOTH
#ifdef HAVE_OPENMP
#else
1,
#endif // HAVE_OPENMP
1, 256);
return options;
}
{
return;
}
if ( !SP_IS_IMAGE(*i) )
continue;
" wise to save your document before continuing."
"\n\nContinue the procedure (without saving)?");
Gtk::BUTTONS_OK_CANCEL, true);
continue;
}
}
return;
}
mainCancelButton->set_sensitive(true);
mainOkButton->set_sensitive(false);
lastOptions = options();
g_atomic_int_set(&abortThread, false);
/*joinable =*/true);
}
{
" wise to save your document before continuing."
"\n\nContinue the procedure (without saving)?");
Gtk::BUTTONS_OK_CANCEL, true);
return;
}
if ( voronoiRadioButton.get_active() ) {
} else {
}
}
{
{
{
gchar b[64];
sp_svg_write_color(b, sizeof(b),
}
{
}
}
}
{
+ ')').c_str());
}
_("Trace pixel art"));
// Flush pending updates
}
{
ignorePreview = true;
#else // LIBDEPIXELIZE_INKSCAPE_ENABLE_SMOOTH
#endif // LIBDEPIXELIZE_INKSCAPE_ENABLE_SMOOTH
ignorePreview = false;
if ( pendingPreview )
}
{
if ( ignorePreview ) {
pendingPreview = true;
return;
}
// TODO: update preview
pendingPreview = false;
}
{
}
dispatcher();
}
{
importOutput(*it);
}
mainCancelButton->set_sensitive(false);
mainOkButton->set_sensitive(true);
}
/**
* Factory method. Use this to create a new PixelArtDialog
*/
{
return *dialog;
}
{
}
} //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:fileencoding=utf-8:textwidth=99 :