]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/tie.hh
release commit
[lilypond.git] / lily / include / tie.hh
1 /*
2   tie.hh -- declare Tie
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef TIE_HH
10 #define TIE_HH
11
12 #include "lily-guile.hh"
13 #include "lily-proto.hh"
14 #include "skyline.hh"
15
16
17
18 Interval
19 get_skyline_attachment (Drul_array< Array < Skyline_entry > > const &skylines,
20                         Real y1);
21
22 struct Tie_details
23 {
24   Real height_limit_;
25   Real ratio_;
26   Real staff_space_;
27   Real x_gap_;
28   Real between_length_limit_;
29   
30   Tie_details ();
31   void init (Grob *);
32 };
33   
34 struct Tie_configuration
35 {
36   int head_position_;
37   int position_;
38   
39   Direction dir_;
40   Interval attachment_x_;
41   Real delta_y_;
42   
43   Tie_configuration ();
44   void center_tie_vertically (Tie_details const &);
45   Bezier get_bezier (Tie_details const &) const;
46   Real height (Tie_details const&) const;
47   
48   static int compare (Tie_configuration const &a,
49                       Tie_configuration const &b);
50   static Real distance (Tie_configuration const &a,
51                        Tie_configuration const &b);
52 };
53
54 INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
55
56 class Tie
57 {
58 public:
59   static void set_head (Grob *, Direction, Grob *head);
60   static bool has_interface (Grob *);
61   static Grob *head (Grob *, Direction);
62   static int get_column_rank (Grob *, Direction);
63   static int get_position (Grob *);
64   static Direction get_default_dir (Grob *);
65   static void get_configuration (Grob *, Grob *, Tie_configuration *,
66                                  Drul_array< Array<Skyline_entry> > const *,
67                                  Tie_details const & 
68                                  );
69   static void set_control_points (Grob *, Grob *,Tie_configuration const&,
70                                   Tie_details const&
71                                   );
72   static void set_default_control_points (Grob *);
73   DECLARE_SCHEME_CALLBACK (print, (SCM));
74   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
75   DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
76   DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
77   static int compare (Grob *const &s1,
78                       Grob *const &s2);
79
80   static Interval get_default_attachments (Spanner *me, Grob *common, Real gap,
81                                            int *staff_position, bool *in_between,
82                                            Tie_details const &);
83   
84 };
85
86
87 #endif // TIE_HH