Export to GitHub

lilypond - issue #4328

Patch: Add means to display objects accessible from a grob


Posted on Mar 24, 2015 by Quick Bird

Add means to display objects accessible from a grob

A convenient means of displaying the grobs and grob-arrays pointed to by various internal properties of a given grob would be very helpful for debugging and development purposes. For example, it would facilitate the creation of advanced tweaks, which frequently require "lateral" access to other grobs.

The output of the function 'grob::display-objects' shows all of the grobs accessible to a given grob through ly:grob-object, along with the relevant interfaces and properties. It includes properties which are empty: not all properties within an interface may be set for or used by a grob supporting that interface.

http://codereview.appspot.com/217260043

Comment #1

Posted on Mar 24, 2015 by Quick Bird

Here's an example of usage:

\version "2.19.18"

%% To write to a file: %#(set-current-output-port (open-output-file "pointers.txt"))

% Note: the example uses 'after-line-breaking, but you can use the function % within callbacks for other properties.

{ \override Dots.after-line-breaking = #grob::display-objects \override NoteHead.after-line-breaking = #grob::display-objects \override NoteColumn.after-line-breaking = #grob::display-objects \override Score.VerticalAxisGroup.after-line-breaking = #grob::display-objects cis4. }

Comment #2

Posted on Mar 24, 2015 by Quick Bird

Example of use within a callback:

{ \override Dots.color = #(lambda (grob) (grob::display-objects grob) red) }

Comment #3

Posted on Mar 24, 2015 by Quick Kangaroo

Patchy the autobot says: passes tests. includes a full make doc

Comment #4

Posted on Mar 25, 2015 by Quick Kangaroo

Patch on countdown for March 28th

Comment #5

Posted on Mar 28, 2015 by Quick Kangaroo

Patch counted down - please push

Comment #6

Posted on Mar 28, 2015 by Quick Bird

Pushed to staging as commit f4f75589864371d3a6c50eace36561a73203acee.

Comment #7

Posted on Apr 28, 2015 by Happy Wombat

(No comment was entered for this change.)

Status: Verified

Labels:
Type-Enhancement Fixed_2_19_18