2 stencil.hh -- declare Stencil
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include <stdlib.h> // size_t
12 #include "lily-proto.hh"
15 #include "direction.hh"
16 #include "lily-guile.hh"
19 /** a group of individually translated symbols. You can add stencils
20 to the top, to the right, etc.
22 It is implemented as a "tree" of scheme expressions, as in
24 Expr = combine Expr Expr
25 | translate Offset Expr
29 SCHEME is a Scheme expression that --when eval'd-- produces the
33 Because of the way that Stencil is implemented, it is the most
34 efficient to add "fresh" stencils to what you're going to build.
38 Empty stencils have empty dimensions. If add_at_edge is used to
39 init the stencil, we assume that
40 DIMENSIONS = (Interval (0,0),Interval (0,0)
44 friend SCM ly_stencil_set_extent_x (SCM, SCM, SCM);
47 This provides the reference point of the symbol, for example with
48 characters, it is on the base line of the character. Usually,
55 DECLARE_SIMPLE_SMOBS (Stencil,);
60 Offset origin () const;
61 SCM get_expr () const;
64 Set dimensions to empty, or to (Interval (0,0),Interval (0,0) */
65 void set_empty (bool);
66 Stencil moved_to_edge (Axis a, Direction d, const Stencil &m, Real padding,
69 void add_at_edge (Axis a, Direction d, const Stencil &m, Real padding,
71 void add_stencil (Stencil const &m);
72 void translate (Offset);
73 void align_to (Axis a, Real x);
74 void translate_axis (Real,Axis);
76 Interval extent (Axis) const;
77 Box extent_box () const;
78 bool is_empty () const;
80 static SCM ly_get_stencil_extent (SCM mol, SCM axis);
81 static SCM ly_set_stencil_extent_x (SCM,SCM,SCM);
82 static SCM ly_stencil_combined_at_edge (SCM,SCM,SCM,SCM,SCM);
86 DECLARE_UNSMOB(Stencil,stencil);
87 SCM fontify_atom (Font_metric const*, SCM atom);
89 Stencil create_stencil (SCM print);