canvas-arena.cpp revision 4678f28e4cec6b2fdc9fc53833ab2265065cc481
/*
* RGBA display list system for inkscape
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "display/display-forward.h"
#include "display/sp-canvas-util.h"
#include "helper/sp-marshal.h"
#include "display/nr-arena.h"
#include "display/nr-arena-group.h"
#include "display/canvas-arena.h"
#include "display/cairo-utils.h"
enum {
};
static void sp_canvas_arena_update (SPCanvasItem *item, Geom::Affine const &affine, unsigned int flags);
static double sp_canvas_arena_point (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item);
static void sp_canvas_arena_visible_area_changed (SPCanvasItem *item, Geom::IntRect const &old_area, Geom::IntRect const &new_area);
{NULL},
};
static SPCanvasItemClass *parent_class;
sp_canvas_arena_get_type (void)
{
if (!type) {
sizeof (SPCanvasArenaClass),
sizeof (SPCanvasArena),
0,
};
}
return type;
}
static void
{
}
static void
{
nr_active_object_add_listener ((NRActiveObject *) arena->arena, (NRObjectEventVector *) &carenaev, sizeof (carenaev), arena);
}
static void
{
}
}
}
}
}
static void
{
NRArenaItem *new_arena = nr_arena_item_invoke_pick (arena->root, arena->c, arena->arena->delta, arena->sticky);
/* fixme: */
}
/* fixme: This is not optimal - better track ::destroy (Lauris) */
}
}
}
}
static void
{
// todo: handle NR_ARENA_ITEM_RENDER_NO_CACHE
if (!r || r->hasZeroArea()) return;
}
}
{
if (!r || r->hasZeroArea()) return; // nothing to do
// clear area to paint
cairo_clip(ct);
cairo_save(ct);
cairo_set_source_rgba(ct, 0,0,0,0);
}
static void
{
}
static double
{
NRArenaItem *picked = nr_arena_item_invoke_pick (arena->root, p, arena->arena->delta, arena->sticky);
if (picked) {
*actual_item = item;
return 0.0;
}
return 1e18;
}
static void
sp_canvas_arena_visible_area_changed (SPCanvasItem *item, Geom::IntRect const &old_area, Geom::IntRect const &new_area)
{
cairo_set_source_surface(ct, arena->cache, old_area.left() - new_area.left(), old_area.top() - new_area.top());
// invalidate newly exposed areas
/*
* +----------------------+
* | top strip |
* +-------+------+-------+
* | | | |
* | left | old | right |
* | strip | area | strip |
* | | | |
* +-------+------+-------+
* | bottom strip |
* +----------------------+
*/
// top strip
}
// left strip
}
// right strip
}
// bottom strip
}
}
static gint
{
case GDK_ENTER_NOTIFY:
//g_warning ("Cursor entered to arena with already active item");
}
/* TODO ... event -> arena transform? */
/* fixme: Not sure abut this, but seems the right thing (Lauris) */
nr_arena_item_invoke_update (arena->root, NULL, &arena->gc, NR_ARENA_ITEM_STATE_PICK, NR_ARENA_ITEM_STATE_NONE);
arena->active = nr_arena_item_invoke_pick (arena->root, arena->c, arena->arena->delta, arena->sticky);
}
break;
case GDK_LEAVE_NOTIFY:
}
break;
case GDK_MOTION_NOTIFY:
/* TODO ... event -> arena transform? */
/* fixme: Not sure abut this, but seems the right thing (Lauris) */
nr_arena_item_invoke_update (arena->root, NULL, &arena->gc, NR_ARENA_ITEM_STATE_PICK, NR_ARENA_ITEM_STATE_NONE);
/* fixme: */
}
}
}
break;
default:
/* Just send event */
break;
}
return ret;
}
static gint
{
/* Send event to arena */
return ret;
}
static void
{
}
static void
{
if (!area) return;
}
void
{
/* fixme: repick? */
}
void
{
/* fixme: repick? */
}
void
{
}
/*
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 :