nr-arena-glyphs.cpp revision cefdba1595ab39197d47d6e89d850c3509aa22b9
/*
* RGBA display list system for inkscape
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2002 Lauris Kaplinski
*
* Released under GNU GPL
*
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "libnr/nr-convert2geom.h"
#include "style.h"
#include "display/nr-arena.h"
#include "display/nr-arena-glyphs.h"
#include <cairo.h>
#include "display/cairo-utils.h"
#ifdef test_glyph_liv
#include "../display/canvas-bpath.h"
#include "libnrtype/font-instance.h"
// defined in nr-arena-shape.cpp
#endif
#ifdef ENABLE_SVG_FONTS
#include "nr-svgfonts.h"
#endif //#ifdef ENABLE_SVG_FONTS
static guint nr_arena_glyphs_update(NRArenaItem *item, NRRectL *area, NRGC *gc, guint state, guint reset);
static NRArenaItem *nr_arena_glyphs_pick(NRArenaItem *item, Geom::Point p, double delta, unsigned int sticky);
static NRArenaItemClass *glyphs_parent_class;
nr_arena_glyphs_get_type(void)
{
if (!type) {
"NRArenaGlyphs",
sizeof(NRArenaGlyphsClass),
sizeof(NRArenaGlyphs),
(void (*)(NRObjectClass *)) nr_arena_glyphs_class_init,
(void (*)(NRObject *)) nr_arena_glyphs_init);
}
return type;
}
static void
{
}
static void
{
}
static void
{
}
}
static guint
nr_arena_glyphs_update(NRArenaItem *item, NRRectL */*area*/, NRGC *gc, guint /*state*/, guint /*reset*/)
{
return NR_ARENA_ITEM_STATE_ALL;
if (ggroup->nrstyle.fill.type == NRStyle::PAINT_NONE && ggroup->nrstyle.stroke.type == NRStyle::PAINT_NONE)
return NR_ARENA_ITEM_STATE_ALL;
glyphs->x = t[4];
glyphs->y = t[5];
}
// those pesky miters, now
if ( miterMax > 0.01 ) {
// grunt mode. we should compute the various miters instead
// (one for each point on the curve)
}
}
if (b) {
} else {
}
return NR_ARENA_ITEM_STATE_ALL;
}
{
// TODO : render to greyscale pixblock provided for clipping
}
static NRArenaItem *
{
double const x = p[Geom::X];
double const y = p[Geom::Y];
/* With text we take a simple approach: pick if the point is in a characher bbox */
if ((x + delta >= item->bbox.x0) && (y + delta >= item->bbox.y0) && (x - delta <= item->bbox.x1) && (y - delta <= item->bbox.y1)) return item;
return NULL;
}
void
nr_arena_glyphs_set_path(NRArenaGlyphs *glyphs, SPCurve */*curve*/, unsigned int /*lieutenant*/, font_instance *font, gint glyph, Geom::Affine const *transform)
{
if (transform) {
} else {
}
}
static guint nr_arena_glyphs_group_update(NRArenaItem *item, NRRectL *area, NRGC *gc, guint state, guint reset);
static unsigned int nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags);
static NRArenaItem *nr_arena_glyphs_group_pick(NRArenaItem *item, Geom::Point p, gdouble delta, unsigned int sticky);
static NRArenaGroupClass *group_parent_class;
{
if (!type) {
"NRArenaGlyphsGroup",
sizeof(NRArenaGlyphsGroupClass),
sizeof(NRArenaGlyphsGroup),
(void (*)(NRObjectClass *)) nr_arena_glyphs_group_class_init,
(void (*)(NRObject *)) nr_arena_glyphs_group_init);
}
return type;
}
static void
{
}
static void
{
}
static void
{
}
}
static guint
{
return NR_ARENA_ITEM_STATE_ALL;
}
static unsigned int nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock * /*pb*/, unsigned int /*flags*/)
{
NRArenaItem *child = 0;
if (!ct) {
}
cairo_fill(ct);
}
}
// NOTE: this is very similar to nr-arena-shape.cpp; the only difference is path feeding
bool has_stroke, has_fill;
cairo_save(ct);
if (has_fill || has_stroke) {
cairo_save(ct);
}
if (has_fill) {
}
if (has_stroke) {
}
} // has fill or stroke pattern
}
static unsigned int nr_arena_glyphs_group_clip(cairo_t * /*ct*/, NRArenaItem *item, NRRectL * /*area*/)
{
//NRArenaGroup *group = NR_ARENA_GROUP(item);
// Render children fill mask
/*
for (NRArenaItem *child = group->children; child != NULL; child = child->next) {
ret = nr_arena_glyphs_fill_mask(NR_ARENA_GLYPHS(child), area, pb);
if (!(ret & NR_ARENA_ITEM_STATE_RENDER)) return ret;
}*/
return ret;
}
static NRArenaItem *
{
return picked;
}
void
{
}
}
void
nr_arena_glyphs_group_add_component(NRArenaGlyphsGroup *sg, font_instance *font, int glyph, Geom::Affine const &transform)
{
: NULL );
if ( pathv ) {
}
}
void
{
}
void
{
} else {
}
}
/*
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 :