1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
6 %% This file is in the public domain.
10 lsrtags = "devel, tweaks-and-overrides, scheme-language"
12 %% Translation of GIT committish: b482c3e5b56c3841a88d957e0ca12964bd3e64fa
15 Al trabajar con los callbacks de un grob, puede ser de mucha ayuda
16 entender el @qq{árbol genealógico} de un grob. La mayor parte de los
17 grobs tienen @qq{padres} que influyen en el posicionamiento del grob.
18 los padres X e Y influyen en las posiciones horizontal y vertical del
19 grob, respectivamente. Además, cada pade puede tener padres a su vez.
22 Por desgracia, existen varios aspectos de la genealogía de un grob que
23 pueden llevar a confusión:
28 @item Los tipos de padre que tiene un grob pueden depender del
31 @item Para ciertos grobs, los padres X e Y son el mismo.
33 @item Un @qq{ancestro} concreto puede estar relacionado con un grob de
36 @item El concepto de @qq{generaciones} es engañoso.
41 Por ejemplo, el grob @code{System} puede ser tanto un padre (sobre el
42 lado Y) como un abuelo (dos veces en el lado X) de un grob
43 @code{VerticalAlignment}.
46 Este macro imprime, en la consola, una representación textual de la
47 genealogía de un grob.
50 Cuando se llama de esta forma
54 \\once \\override NoteHead #'before-line-breaking = #display-ancestry
60 Se genera la siguiente salida:
64 ------------------------------------
66 NoteHead X,Y: NoteColumn
70 X: NonMusicalPaperColumn
73 X: NonMusicalPaperColumn
80 doctitlees = "Imprimir el árbol genealógico de un grob"
82 %% Translation of GIT committish: 904ea9fed4c66f5b86f3ac6ffb9fa273f082f371
84 Lorsque l'on manipule des rappels d'objet (@emph{grob callbacks}), il
85 peut être intéressant d'en maîtriser les « ascendants ». La plupart des
86 objets graphiques ont des parents, lesquels auront une influence sur le
87 positionnement de l'objet en question. Ainsi, les parents des côtés X
88 et Y influenceront respectivement les positions horizontale et verticale
89 de l'objet. De plus, chacun des parents peut avoir ses propres parents.
91 Certains aspects de la lignée d'un objet peuvent toutefois porter à
94 -- Les types de parents d'un @emph{grob} peuvent dépendre du contexte.
96 -- Dans le cas de certains @emph{grobs}, les parents X et Y peuvent être
99 -- Un « ascendant » particulier peut dépendre d'un @emph{grob} de
100 différentes manières.
102 -- Le concept de « génération » est trompeur.
104 Par exemple, l'objet @code{System} peut, vis à vis d'un objet
105 @code{VerticalAlignment}, être à la fois parent (par son
106 côté Y) et grand parent (par deux fois du côté X).
108 La macro ci-dessous affiche à l'écran une représentation textuelle de
109 l'ascendance d'un @emph{grob}.
112 Elle se lance ainsi :
116 \\once \\override NoteHead #'before-line-breaking = #display-ancestry
121 et génère la sortie suivante :
124 ------------------------------------
126 NoteHead X,Y: NoteColumn
130 X: NonMusicalPaperColumn
133 X: NonMusicalPaperColumn
139 doctitlefr = "Affichage de la généalogie d'un objet"
142 When working with grob callbacks, it can be helpful to understand a
143 grob's @qq{ancestry}. Most grobs have @qq{parents} which influence the
144 positioning of the grob. X- and Y-parents influence the horizontal and
145 vertical positions for the grob, respectively. Additionally, each
146 parent may have parents of its own.
149 Unfortunately, there are several aspects of a grob's ancestry that can
152 * The types of parents a grob has may depend on context. * For some
153 grobs, the X- and Y-parents are the same. * A particular @qq{ancestor}
154 may be related to a grob in multiple ways. * The concept of
155 @qq{generations} is misleading.
158 For example, the @code{System} grob can be both parent (on the Y-side)
159 and grandparent (twice on the X-side) to a @code{VerticalAlignment}
163 This macro prints (to the console) a textual representation of a grob's
171 \\once \\override NoteHead #'before-line-breaking = #display-ancestry
175 The following output is generated:
178 ------------------------------------
180 NoteHead X,Y: NoteColumn
184 X: NonMusicalPaperColumn
187 X: NonMusicalPaperColumn
194 doctitle = "Displaying grob ancestry"
197 #(define (grob-name grob)
199 (assoc-ref (ly:grob-property grob 'meta) 'name)
202 #(define (get-ancestry grob)
203 (if (not (null? (ly:grob-parent grob X)))
204 (list (grob-name grob)
205 (get-ancestry (ly:grob-parent grob X))
206 (get-ancestry (ly:grob-parent grob Y)))
209 #(define (format-ancestry lst padding)
211 (symbol->string (car lst))
214 (if (list? (cadr lst))
215 (format-ancestry (cadr lst) (+ padding 3))
216 (symbol->string (cadr lst))))
218 (if (list? (caddr lst))
219 (format-ancestry (caddr lst) (+ padding 3))
220 (symbol->string (caddr lst)))))
221 (if (equal? X-ancestry Y-ancestry)
224 (make-string padding #\space)
226 (if (list? (cadr lst))
227 (format-ancestry (cadr lst) (+ padding 5))
228 (symbol->string (cadr lst))))
231 (make-string padding #\space)
234 (make-string padding #\space)
239 #(define (display-ancestry grob)
240 (format (current-error-port)
243 (format-ancestry (get-ancestry grob) 0)))
246 \once \override NoteHead #'before-line-breaking = #display-ancestry
248 \once \override Accidental #'before-line-breaking = #display-ancestry
249 \once \override Arpeggio #'before-line-breaking = #display-ancestry