sp-ctrlline.cpp revision 68a136703d96e42fba5a2464e2eb09eb3fee5815
#define __INKSCAPE_CTRLLINE_C__
/*
* Simple straight line
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
* Copyright (C) 2007 Johan Engelen
* Copyright (C) 1999-2002 Lauris Kaplinski
*
* Released under GNU GPL
*/
/*
* TODO:
* Draw it by hand - we really do not need aa stuff for it
*
*/
#include "display-forward.h"
#include "sp-canvas-util.h"
#include "sp-ctrlline.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <color.h>
static SPCanvasItemClass *parent_class;
sp_ctrlline_get_type (void)
{
if (!type) {
GtkTypeInfo info = {
"SPCtrlLine",
sizeof (SPCtrlLine),
sizeof (SPCtrlLineClass),
};
}
return type;
}
static void
{
}
static void
{
}
static void
{
}
}
static void
{
/*
// CAIRO FIXME: after SPCanvasBuf is switched to unpacked 32bit rgb, rendering can be done via cairo:
cairo_surface_t* cst = cairo_image_surface_create_for_data (
buf->buf,
CAIRO_FORMAT_RGB24,
buf->rect.x1 - buf->rect.x0,
buf->rect.y1 - buf->rect.y0,
buf->buf_rowstride
);
cairo_t *ct = cairo_create (cst);
guint32 rgba = ctrlline->rgba;
cairo_set_source_rgba(ct, SP_RGBA32_R_F(rgba), SP_RGBA32_G_F(rgba), SP_RGBA32_B_F(rgba), SP_RGBA32_A_F(rgba));
cairo_set_line_width(ct, 0.5);
cairo_new_path(ct);
cairo_move_to (ct, ctrlline->s.x - buf->rect.x0, ctrlline->s.y - buf->rect.y0);
cairo_line_to (ct, ctrlline->e.x - buf->rect.x0, ctrlline->e.y - buf->rect.y0);
cairo_stroke(ct);
cairo_destroy (ct);
cairo_surface_finish (cst);
cairo_surface_destroy (cst);
*/
// CAIRO FIXME: instead of this:
nr_pixblock_render_ctrl_rgba (ctrlline->shp,ctrlline->rgba,area,(char*)buf->buf, buf->buf_rowstride);
}
}
static void
{
sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
if (parent_class->update)
/*
// CAIRO FIXME: all that is needed for update with cairo:
NR::Point s = NR::Point(cl->s.x, cl->s.y) * affine;
NR::Point e = NR::Point(cl->e.x, cl->e.y) * affine;
cl->s.x = s[NR::X];
cl->s.y = s[NR::Y];
cl->e.x = e[NR::X];
cl->e.y = e[NR::Y];
item->x1 = (int)(MIN(s[NR::X], e[NR::X]) - 1);
item->y1 = (int)(MIN(s[NR::Y], e[NR::Y]) - 1);
item->x2 = (int)(MAX(s[NR::X], e[NR::X]) + 1);
item->y2 = (int)(MAX(s[NR::Y], e[NR::Y]) + 1);
*/
// CAIRO FIXME: instead of:
}
} else {
}
}
delete thePath;
sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
}
void
{
sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
}
}
#define EPSILON 1e-6
void
{
}
}
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:encoding=utf-8:textwidth=99 :