LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 Jan Nieuwenhuizen <janneke@gnu.org> | 5 Jan Nieuwenhuizen <janneke@gnu.org> |
6 | 6 |
7 LilyPond is free software: you can redistribute it and/or modify | 7 LilyPond is free software: you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation, either version 3 of the License, or | 9 the Free Software Foundation, either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "warn.hh" | 30 #include "warn.hh" |
31 | 31 |
32 class Flag | 32 class Flag |
33 { | 33 { |
34 public: | 34 public: |
35 DECLARE_SCHEME_CALLBACK (print, (SCM)); | 35 DECLARE_SCHEME_CALLBACK (print, (SCM)); |
36 DECLARE_SCHEME_CALLBACK (glyph_name, (SCM)); | 36 DECLARE_SCHEME_CALLBACK (glyph_name, (SCM)); |
37 DECLARE_SCHEME_CALLBACK (width, (SCM)); | 37 DECLARE_SCHEME_CALLBACK (width, (SCM)); |
38 DECLARE_SCHEME_CALLBACK (calc_y_offset, (SCM)); | 38 DECLARE_SCHEME_CALLBACK (calc_y_offset, (SCM)); |
39 DECLARE_SCHEME_CALLBACK (pure_calc_y_offset, (SCM, SCM, SCM)); | 39 DECLARE_SCHEME_CALLBACK (pure_calc_y_offset, (SCM, SCM, SCM)); |
40 DECLARE_SCHEME_CALLBACK (calc_x_offset, (SCM)); | |
41 DECLARE_GROB_INTERFACE (); | 40 DECLARE_GROB_INTERFACE (); |
42 | 41 |
43 static SCM internal_calc_y_offset (SCM smob, bool pure); | 42 static SCM internal_calc_y_offset (SCM smob, bool pure); |
44 }; | 43 }; |
45 | 44 |
46 MAKE_SCHEME_CALLBACK (Flag, width, 1); | 45 MAKE_SCHEME_CALLBACK (Flag, width, 1); |
47 SCM | 46 SCM |
48 Flag::width (SCM smob) | 47 Flag::width (SCM smob) |
49 { | 48 { |
50 Grob *me = unsmob_grob (smob); | 49 Grob *me = unsmob_grob (smob); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 187 |
189 Interval stem_extent = pure | 188 Interval stem_extent = pure |
190 ? stem->pure_height (stem, 0, INT_MAX) | 189 ? stem->pure_height (stem, 0, INT_MAX) |
191 : stem->extent (stem, Y_AXIS); | 190 : stem->extent (stem, Y_AXIS); |
192 | 191 |
193 return scm_from_double (stem_extent.is_empty () | 192 return scm_from_double (stem_extent.is_empty () |
194 ? 0.0 | 193 ? 0.0 |
195 : stem_extent[d] - d * blot / 2); | 194 : stem_extent[d] - d * blot / 2); |
196 } | 195 } |
197 | 196 |
198 MAKE_SCHEME_CALLBACK (Flag, calc_x_offset, 1); | |
199 SCM | |
200 Flag::calc_x_offset (SCM smob) | |
201 { | |
202 Grob *me = unsmob_grob (smob); | |
203 Grob *stem = me->get_parent (X_AXIS); | |
204 return scm_from_double (stem->extent (stem, X_AXIS)[RIGHT]); | |
205 } | |
206 | |
207 ADD_INTERFACE (Flag, | 197 ADD_INTERFACE (Flag, |
208 "A flag that gets attached to a stem." | 198 "A flag that gets attached to a stem." |
209 "The style property is symbol determining" | 199 "The style property is symbol determining" |
210 " what style of flag glyph is typeset on a" | 200 " what style of flag glyph is typeset on a" |
211 " @code{Stem}. Valid options include @code{'()}" | 201 " @code{Stem}. Valid options include @code{'()}" |
212 " for standard flags, @code{'mensural} and" | 202 " for standard flags, @code{'mensural} and" |
213 " @code{'no-flag}, which switches off the flag.", | 203 " @code{'no-flag}, which switches off the flag.", |
214 | 204 |
215 /* properties */ | 205 /* properties */ |
216 "glyph-name " | 206 "glyph-name " |
217 "style " | 207 "style " |
218 "stroke-style " | 208 "stroke-style " |
219 ); | 209 ); |
LEFT | RIGHT |