2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
22 #include <cstdlib> // size_t
25 #include "lily-proto.hh"
29 /** a group of individually translated symbols. You can add stencils
30 to the top, to the right, etc.
32 It is implemented as a "tree" of scheme expressions, as in
34 Expr = combine Expr-list
35 | translate Offset Expr
36 | origin (ORIGIN) Expr
41 SCHEME is a Scheme expression that --when eval'd-- produces the
46 * Because of the way that Stencil is implemented, it is the most
47 efficient to add "fresh" stencils to what you're going to build.
49 * Do not create Stencil objects on the heap. That includes passing
50 around Stencil* which are produced by unsmob_stencil(). Either
51 copy Stencil objects, or use SCM references.
53 * Empty stencils have empty dimensions. If add_at_edge is used to
54 init the stencil, we assume that
56 DIMENSIONS = (Interval (0, 0), Interval (0, 0)
63 DECLARE_SIMPLE_SMOBS (Stencil);
71 Set dimensions to empty, or to (Interval (0, 0), Interval (0, 0) */
72 void set_empty (bool);
73 void add_at_edge (Axis a, Direction d, const Stencil &m, Real padding);
74 void add_stencil (Stencil const &m);
75 void translate (Offset);
76 Stencil translated (Offset) const;
77 void rotate (Real, Offset);
78 void rotate_degrees (Real, Offset);
79 void rotate_degrees_absolute (Real, Offset);
80 void align_to (Axis a, Real x);
81 void translate_axis (Real, Axis);
82 void scale (Real, Real);
84 Interval extent (Axis) const;
85 Box extent_box () const;
86 bool is_empty () const;
87 Stencil in_color (Real r, Real g, Real b) const;
90 DECLARE_UNSMOB (Stencil, stencil);
92 void interpret_stencil_expression (SCM expr,
93 void (*func) (void *, SCM),
96 SCM find_expression_fonts (SCM expr);
98 void register_stencil_head (SCM symbol);
99 bool is_stencil_head (SCM symbol);
100 SCM all_stencil_heads ();
103 #endif /* STENCIL_HH */