nr-arena-image.cpp revision 2dadeac589b876f1a79a87f5e6da45a594769bfa
#define __NR_ARENA_IMAGE_C__
/*
* 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 "../preferences.h"
#include "nr-arena-image.h"
#include "style.h"
#include "display/cairo-utils.h"
#include "display/nr-arena.h"
#include "display/nr-filter.h"
#include "sp-filter.h"
#include "sp-filter-reference.h"
int nr_arena_image_x_sample = 1;
int nr_arena_image_y_sample = 1;
/*
* NRArenaCanvasImage
*
*/
static unsigned int nr_arena_image_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
static unsigned int nr_arena_image_render (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags);
static NRArenaItem *nr_arena_image_pick (NRArenaItem *item, Geom::Point p, double delta, unsigned int sticky);
static NRArenaItemClass *parent_class;
nr_arena_image_get_type (void)
{
if (!type) {
"NRArenaImage",
sizeof (NRArenaImageClass),
sizeof (NRArenaImage),
(void (*) (NRObjectClass *)) nr_arena_image_class_init,
(void (*) (NRObject *)) nr_arena_image_init);
}
return type;
}
static void
{
}
static void
{
}
static void
{
}
}
static unsigned int
nr_arena_image_update( NRArenaItem *item, NRRectL */*area*/, NRGC *gc, unsigned int /*state*/, unsigned int /*reset*/ )
{
// clear old bbox
/* Copy affine */
/* Calculate bbox */
} else {
}
return NR_ARENA_ITEM_STATE_ALL;
}
static unsigned int
nr_arena_image_render( cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int /*flags*/ )
{
if (!ct)
if (!outline) {
// FIXME: at the moment gdk_cairo_set_source_pixbuf creates an ARGB copy
cairo_save(ct);
cairo_clip(ct);
}
} else { // outline; draw a rect instead
cairo_save(ct);
// the box
// the diagonals
}
}
/** Calculates the closest distance from p to the segment a1-a2*/
double
{
// calculate sides of the triangle and their squares
double a_2 = a * a;
// if one of the angles at the base is > 90, return the corresponding side
// otherwise calculate the height to the base
}
static NRArenaItem *
{
if (outline) {
// frame
// diagonals
return NULL;
} else {
return NULL;
return NULL;
// is the alpha not transparent?
}
}
{
}
return r;
}
/* Utility */
void
{
// when done in this order, it won't break if pb == image->pixbuf and the refcount is 1
g_object_ref (pb);
}
}
}
void
{
}
void
{
}
void
{
}
{
//if image has a filter
}
} else {
//no filter set for this image
}
image->background_new = true;
}
}
/*
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 :