LEFT | RIGHT |
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) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 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 | 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 | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 LY_DEFINE (ly_stencil_translate_axis, "ly:stencil-translate-axis", | 29 LY_DEFINE (ly_stencil_translate_axis, "ly:stencil-translate-axis", |
30 3, 0, 0, (SCM stil, SCM amount, SCM axis), | 30 3, 0, 0, (SCM stil, SCM amount, SCM axis), |
31 "Return a copy of @var{stil} but translated by @var{amount}" | 31 "Return a copy of @var{stil} but translated by @var{amount}" |
32 " in @var{axis} direction.") | 32 " in @var{axis} direction.") |
33 { | 33 { |
34 Stencil *s = unsmob_stencil (stil); | 34 Stencil *s = unsmob_stencil (stil); |
35 LY_ASSERT_SMOB (Stencil, stil, 1); | 35 LY_ASSERT_SMOB (Stencil, stil, 1); |
36 LY_ASSERT_TYPE (scm_is_number, amount, 2); | 36 LY_ASSERT_TYPE (scm_is_number, amount, 2); |
37 | 37 |
38 LY_ASSERT_TYPE (is_axis, axis, 3); | 38 LY_ASSERT_TYPE (is_axis, axis, 3); |
39 | 39 |
40 Real real_amount = scm_to_double (amount); | 40 Real real_amount = scm_to_double (amount); |
41 | 41 |
42 SCM new_s = s->smobbed_copy (); | 42 SCM new_s = s->smobbed_copy (); |
43 Stencil *q = unsmob_stencil (new_s); | 43 Stencil *q = unsmob_stencil (new_s); |
44 q->translate_axis (real_amount, Axis (scm_to_int (axis))); | 44 q->translate_axis (real_amount, Axis (scm_to_int (axis))); |
45 return new_s; | 45 return new_s; |
46 } | 46 } |
47 | 47 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv), | 283 return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv), |
284 scm_to_double (t), | 284 scm_to_double (t), |
285 scm_to_double (p), | 285 scm_to_double (p), |
286 0.95 * scm_to_double (t)).smobbed_copy (); | 286 0.95 * scm_to_double (t)).smobbed_copy (); |
287 } | 287 } |
288 | 288 |
289 LY_DEFINE (ly_stencil_rotate, "ly:stencil-rotate", | 289 LY_DEFINE (ly_stencil_rotate, "ly:stencil-rotate", |
290 4, 0, 0, (SCM stil, SCM angle, SCM x, SCM y), | 290 4, 0, 0, (SCM stil, SCM angle, SCM x, SCM y), |
291 "Return a stencil @var{stil} rotated @var{angle} degrees around" | 291 "Return a stencil @var{stil} rotated @var{angle} degrees around" |
292 " the relative offset (@var{x}, @var{y}). E.g. an offset of" | 292 " the relative offset (@var{x}, @var{y}). E.g., an offset of" |
293 " (-1, 1) will rotate the stencil around the left upper corner.") | 293 " (-1, 1) will rotate the stencil around the left upper corner.") |
294 { | 294 { |
295 Stencil *s = unsmob_stencil (stil); | 295 Stencil *s = unsmob_stencil (stil); |
296 LY_ASSERT_SMOB (Stencil, stil, 1); | 296 LY_ASSERT_SMOB (Stencil, stil, 1); |
297 LY_ASSERT_TYPE (scm_is_number, angle, 2); | 297 LY_ASSERT_TYPE (scm_is_number, angle, 2); |
298 LY_ASSERT_TYPE (scm_is_number, x, 3); | 298 LY_ASSERT_TYPE (scm_is_number, x, 3); |
299 LY_ASSERT_TYPE (scm_is_number, y, 4); | 299 LY_ASSERT_TYPE (scm_is_number, y, 4); |
300 Real a = scm_to_double (angle); | 300 Real a = scm_to_double (angle); |
301 Real x_off = scm_to_double (x); | 301 Real x_off = scm_to_double (x); |
302 Real y_off = scm_to_double (y); | 302 Real y_off = scm_to_double (y); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 LY_ASSERT_SMOB (Stencil, stil, 1); | 393 LY_ASSERT_SMOB (Stencil, stil, 1); |
394 LY_ASSERT_TYPE (scm_is_number, x, 2); | 394 LY_ASSERT_TYPE (scm_is_number, x, 2); |
395 LY_ASSERT_TYPE (scm_is_number, y, 3); | 395 LY_ASSERT_TYPE (scm_is_number, y, 3); |
396 | 396 |
397 SCM new_s = s->smobbed_copy (); | 397 SCM new_s = s->smobbed_copy (); |
398 Stencil *q = unsmob_stencil (new_s); | 398 Stencil *q = unsmob_stencil (new_s); |
399 | 399 |
400 q->scale (scm_to_double (x), scm_to_double (y)); | 400 q->scale (scm_to_double (x), scm_to_double (y)); |
401 return new_s; | 401 return new_s; |
402 } | 402 } |
LEFT | RIGHT |