]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-column.cc
Merge remote-tracking branch 'origin/master' into translation
[lilypond.git] / lily / paper-column.cc
index 4379ce1a1d1228c8288485eb95c3b18fd1041f9f..1cb1452c852dba5eef1ad055387bbab354df5aa4 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -218,6 +218,23 @@ Paper_column::break_align_width (Grob *me, SCM align_sym)
   return align->extent (p, X_AXIS);
 }
 
+/*
+  Loop through elements of a PaperColumn, find all grobs implementing specified
+  interface and return their combined extent.
+*/
+Interval
+Paper_column::get_interface_extent (Grob *column, SCM iface, Axis a)
+{
+  Interval extent = Interval (0, 0);
+  extract_grob_set (column, "elements", elts);
+
+  for (vsize i = 0; i < elts.size (); i++)
+    if (elts[i]->internal_has_interface (iface))
+      extent.unite (robust_relative_extent (elts[i], elts[i], a));
+
+  return extent;
+}
+
 /*
   Print a:
   - vertical line,