1 #ifndef __NR_ARENA_GLYPHS_H__
2 #define __NR_ARENA_GLYPHS_H__
4 /*
5 * RGBA display list system for inkscape
6 *
7 * Author:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 2002 Lauris Kaplinski
11 *
12 * Released under GNU GPL
13 *
14 */
16 #define NR_TYPE_ARENA_GLYPHS (nr_arena_glyphs_get_type ())
17 #define NR_ARENA_GLYPHS(obj) (NR_CHECK_INSTANCE_CAST ((obj), NR_TYPE_ARENA_GLYPHS, NRArenaGlyphs))
18 #define NR_IS_ARENA_GLYPHS(obj) (NR_CHECK_INSTANCE_TYPE ((obj), NR_TYPE_ARENA_GLYPHS))
20 #include <libnrtype/nrtype-forward.h>
22 #include <display/curve.h>
23 #include <forward.h>
24 #include <sp-paint-server.h>
25 #include <display/nr-arena-item.h>
27 #define test_glyph_liv
29 class Shape;
31 NRType nr_arena_glyphs_get_type (void);
33 struct NRArenaGlyphs : public NRArenaItem {
34 /* Glyphs data */
35 SPStyle *style;
36 NRMatrix g_transform;
37 font_instance *font;
38 gint glyph;
40 raster_font *rfont;
41 raster_font *sfont;
42 float x, y;
44 // NRMatrix cached_tr;
45 // Shape *cached_shp;
46 // bool cached_shp_dirty;
47 // bool cached_style_dirty;
49 // Shape *stroke_shp;
51 static NRArenaGlyphs *create(NRArena *arena) {
52 NRArenaGlyphs *obj=reinterpret_cast<NRArenaGlyphs *>(nr_object_new(NR_TYPE_ARENA_GLYPHS));
53 obj->init(arena);
54 return obj;
55 }
56 };
58 struct NRArenaGlyphsClass {
59 NRArenaItemClass parent_class;
60 };
62 void nr_arena_glyphs_set_path (NRArenaGlyphs *glyphs,
63 SPCurve *curve, unsigned int lieutenant,
64 font_instance *font, int glyph,
65 const NRMatrix *transform);
66 void nr_arena_glyphs_set_style (NRArenaGlyphs *glyphs, SPStyle *style);
68 /* Integrated group of component glyphss */
70 typedef struct NRArenaGlyphsGroup NRArenaGlyphsGroup;
71 typedef struct NRArenaGlyphsGroupClass NRArenaGlyphsGroupClass;
73 #include "nr-arena-group.h"
75 #define NR_TYPE_ARENA_GLYPHS_GROUP (nr_arena_glyphs_group_get_type ())
76 #define NR_ARENA_GLYPHS_GROUP(obj) (NR_CHECK_INSTANCE_CAST ((obj), NR_TYPE_ARENA_GLYPHS_GROUP, NRArenaGlyphsGroup))
77 #define NR_IS_ARENA_GLYPHS_GROUP(obj) (NR_CHECK_INSTANCE_TYPE ((obj), NR_TYPE_ARENA_GLYPHS_GROUP))
79 NRType nr_arena_glyphs_group_get_type (void);
81 struct NRArenaGlyphsGroup : public NRArenaGroup {
82 SPStyle *style;
83 NRRect paintbox;
84 /* State data */
85 SPPainter *fill_painter;
86 SPPainter *stroke_painter;
88 static NRArenaGlyphsGroup *create(NRArena *arena) {
89 NRArenaGlyphsGroup *obj=reinterpret_cast<NRArenaGlyphsGroup *>(nr_object_new(NR_TYPE_ARENA_GLYPHS_GROUP));
90 obj->init(arena);
91 return obj;
92 }
93 };
95 struct NRArenaGlyphsGroupClass {
96 NRArenaGroupClass parent_class;
97 };
99 /* Utility functions */
101 void nr_arena_glyphs_group_clear (NRArenaGlyphsGroup *group);
103 void nr_arena_glyphs_group_add_component (NRArenaGlyphsGroup *group, font_instance *font, int glyph, const NRMatrix *transform);
105 void nr_arena_glyphs_group_set_style (NRArenaGlyphsGroup *group, SPStyle *style);
107 void nr_arena_glyphs_group_set_paintbox (NRArenaGlyphsGroup *group, const NRRect *pbox);
109 #endif