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) 1999--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1999--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 23 matching lines...) Expand all Loading... |
34 void | 34 void |
35 Script_column::add_side_positioned (Grob *me, Grob *script) | 35 Script_column::add_side_positioned (Grob *me, Grob *script) |
36 { | 36 { |
37 SCM p = script->get_property ("script-priority"); | 37 SCM p = script->get_property ("script-priority"); |
38 if (!scm_is_number (p)) | 38 if (!scm_is_number (p)) |
39 return; | 39 return; |
40 | 40 |
41 Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), script); | 41 Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), script); |
42 } | 42 } |
43 | 43 |
| 44 int |
| 45 pushed_by_slur (Grob *g) |
| 46 { |
| 47 return g->get_property ("avoid-slur") == ly_symbol2scm ("outside") |
| 48 || g->get_property ("avoid-slur") == ly_symbol2scm ("around"); |
| 49 } |
| 50 |
44 LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less", | 51 LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less", |
45 2, 0, 0, (SCM a, SCM b), | 52 2, 0, 0, (SCM a, SCM b), |
46 "Compare two grobs by script priority. For internal use.") | 53 "Compare two grobs by script priority. For internal use.") |
47 { | 54 { |
48 Grob *i1 = unsmob_grob (a); | 55 Grob *i1 = unsmob_grob (a); |
49 Grob *i2 = unsmob_grob (b); | 56 Grob *i2 = unsmob_grob (b); |
| 57 |
| 58 /* |
| 59 * avoid-staff of slur trumps script priority. If one grob is |
| 60 * supposed to be printed outside a slur and another grob inside, |
| 61 * we place the inside grob below the outside even if the inside |
| 62 * grob has a higher script-priority. |
| 63 */ |
| 64 if (unsmob_grob (i1->get_object ("slur")) |
| 65 && unsmob_grob (i2->get_object ("slur"))) |
| 66 { |
| 67 int push1 = pushed_by_slur (i1); |
| 68 int push2 = pushed_by_slur (i2); |
| 69 if (push1 != push2) |
| 70 return push1 < push2 ? SCM_BOOL_T : SCM_BOOL_F; |
| 71 } |
50 | 72 |
51 SCM p1 = i1->get_property ("script-priority"); | 73 SCM p1 = i1->get_property ("script-priority"); |
52 SCM p2 = i2->get_property ("script-priority"); | 74 SCM p2 = i2->get_property ("script-priority"); |
53 | 75 |
54 return scm_to_int (p1) < scm_to_int (p2) ? SCM_BOOL_T : SCM_BOOL_F; | 76 return scm_to_int (p1) < scm_to_int (p2) ? SCM_BOOL_T : SCM_BOOL_F; |
55 } | 77 } |
56 | 78 |
57 MAKE_SCHEME_CALLBACK (Script_column, row_before_line_breaking, 1); | 79 MAKE_SCHEME_CALLBACK (Script_column, row_before_line_breaking, 1); |
58 SCM | 80 SCM |
59 Script_column::row_before_line_breaking (SCM smob) | 81 Script_column::row_before_line_breaking (SCM smob) |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 195 } |
174 } | 196 } |
175 | 197 |
176 ADD_INTERFACE (Script_column, | 198 ADD_INTERFACE (Script_column, |
177 "An interface that sorts scripts according to their" | 199 "An interface that sorts scripts according to their" |
178 " @code{script-priority} and @code{outside-staff-priority}.", | 200 " @code{script-priority} and @code{outside-staff-priority}.", |
179 | 201 |
180 /* properties */ | 202 /* properties */ |
181 "" | 203 "" |
182 ); | 204 ); |
LEFT | RIGHT |