flood-context.cpp revision 5c966d6b11e9ff99d8a820bf7bc56ce2662880da
#define __SP_FLOOD_CONTEXT_C__
/*
* Flood fill drawing context
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* John Bintz <jcoswell@coswellproductions.org>
*
* Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) 2000-2005 authors
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "config.h"
#include <gdk/gdkkeysyms.h>
#include <queue>
#include "macros.h"
#include "display/sp-canvas.h"
#include "document.h"
#include "sp-namedview.h"
#include "sp-object.h"
#include "sp-rect.h"
#include "selection.h"
#include "selection-chemistry.h"
#include "desktop-handles.h"
#include "snap.h"
#include "desktop.h"
#include "desktop-style.h"
#include "message-context.h"
#include "pixmaps/cursor-rect.xpm"
#include "flood-context.h"
#include "sp-metrics.h"
#include "object-edit.h"
#include "xml/node-event-vector.h"
#include "prefs-utils.h"
#include "context-fns.h"
#include "display/nr-arena-item.h"
#include "display/nr-arena.h"
#include "display/nr-arena-image.h"
#include "display/canvas-arena.h"
#include "helper/png-write.h"
#include "libnr/nr-pixops.h"
#include "libnr/nr-matrix-rotate-ops.h"
#include "libnr/nr-matrix-translate-ops.h"
#include "libnr/nr-rotate-fns.h"
#include "libnr/nr-scale-ops.h"
#include "libnr/nr-scale-translate-ops.h"
#include "libnr/nr-translate-matrix-ops.h"
#include "libnr/nr-translate-scale-ops.h"
#include "libnr/nr-matrix-ops.h"
#include "sp-item.h"
#include "sp-root.h"
#include "sp-defs.h"
#include "splivarot.h"
#include "libnr/n-art-bpath.h"
#include "trace/potrace/inkscape-potrace.h"
static gint sp_flood_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event);
static SPEventContextClass *parent_class;
struct SPEBP {
guchar r, g, b, a;
unsigned (*status)(float, void *);
void *data;
};
{
if (!type) {
sizeof(SPFloodContextClass),
sizeof(SPFloodContext),
4,
NULL, /* value_table */
};
}
return type;
}
{
}
{
event_context->xp = 0;
event_context->yp = 0;
event_context->tolerance = 0;
event_context->within_tolerance = false;
}
{
/* fixme: This is necessary because we do not grab */
}
ec->shape_repr = 0;
}
if (rc->_message_context) {
delete rc->_message_context;
}
}
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
/**
\brief Callback that processes the "changed" signal on the selection;
destroys old and creates new knotholder
*/
{
ec->shape_repr = 0;
}
if (item) {
if (shape_repr) {
}
}
}
{
}
if (item) {
if (shape_repr) {
}
}
);
}
/**
Hide all items which are not listed in list, recursively, skipping groups and defs
*/
static void
{
if (SP_IS_ITEM(o)
&& !SP_IS_DEFS(o)
&& !SP_IS_ROOT(o)
&& !SP_IS_GROUP(o)
&& !g_slist_find(list, o))
{
}
// recurse
if (!g_slist_find(list, o)) {
}
}
}
}
static void try_add_to_queue(std::queue<NR::Point> *fill_queue, guchar *px, int x, int y, int width) {
if (t[3] == 0) {
}
}
long totalNodeCount = 0L;
/* Set style */
delete path;
expanded_path->Reset();
delete path_shape;
delete expanded_path_shape;
delete expanded_path;
if (reprobj) {
}
}
}
/* Create new arena */
/* Create ArenaItems and set transform */
NRArenaItem *root = sp_item_invoke_show(SP_ITEM(sp_document_root(document)), arena, dkey, SP_ITEM_SHOW_DISPLAY);
final_bbox.x0 = 0;
nr_arena_item_invoke_update(root, &final_bbox, &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_NONE);
// /* Set up pixblocks */
//
// /* Render */
NRPixBlock B;
nr_pixblock_release(&B);
//
NR::Point pw = NR::Point(event->button.x / zoom_scale, sp_document_height(document) + (event->button.y / zoom_scale)) * affine;
while (!fill_queue.empty()) {
fill_queue.pop();
// nothing at this point
if (s[3] == 0) {
unsigned char *t, *trace_t;
bool ok = false;
do {
ok = false;
// go left
if (left >= 0) {
if (t[3] == 0) {
t[0] = 255; t[3] = 255;
}
}
} while (ok);
do {
ok = false;
// go left
if (t[3] == 0) {
t[0] = 255; t[3] = 255;
}
}
} while (ok);
}
}
TRUE,
NULL);
/* Free Arena and ArenaItem */
}
static gint sp_flood_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event)
{
case GDK_BUTTON_PRESS:
}
break;
// motion and release are always on root (why?)
default:
break;
}
}
return ret;
}
{
case GDK_BUTTON_PRESS:
}
break;
default:
break;
}
if (!ret) {
}
}
return ret;
}
{
_("Create floodangle"));
}
}
/*
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 :