2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1999--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
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
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef SELF_ALIGNMENT_INTERFACE_HH
21 #define SELF_ALIGNMENT_INTERFACE_HH
23 #include "lily-proto.hh"
24 #include "grob-interface.hh"
26 struct Self_alignment_interface
28 DECLARE_GROB_INTERFACE ();
30 static SCM aligned_on_self (Grob *me, Axis a, bool pure, int start, int end);
31 static SCM centered_on_object (Grob *me, Axis a);
32 static SCM aligned_on_parent (Grob *me, Axis a);
33 static SCM avoid_colliding_grobs (Grob *me, Axis a, Real offset);
34 static void set_center_parent (Grob *me, Axis a);
35 static void set_align_self (Grob *me, Axis a);
36 static void avoid_x_collisions (Grob *me);
38 DECLARE_SCHEME_CALLBACK (x_aligned_on_self, (SCM element));
39 DECLARE_SCHEME_CALLBACK (y_aligned_on_self, (SCM element));
41 DECLARE_SCHEME_CALLBACK (pure_y_aligned_on_self, (SCM element, SCM start, SCM end));
43 DECLARE_SCHEME_CALLBACK (centered_on_note_columns, (SCM element));
44 DECLARE_SCHEME_CALLBACK (centered_on_x_parent, (SCM element));
45 DECLARE_SCHEME_CALLBACK (centered_on_y_parent, (SCM element));
46 DECLARE_SCHEME_CALLBACK (x_centered_on_y_parent, (SCM element));
47 DECLARE_SCHEME_CALLBACK (avoid_x_colliding_grobs, (SCM element, SCM offset));
48 DECLARE_SCHEME_CALLBACK (x_colliding_grobs, (SCM element));
49 DECLARE_SCHEME_CALLBACK (aligned_on_x_parent, (SCM element));
50 DECLARE_SCHEME_CALLBACK (aligned_on_y_parent, (SCM element));