]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/tie.hh
* lily/tie-formatting-problem.cc (find_optimal_tie_configuration):
[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 class Tie_configuration
19 {
20 public:
21   int position_;
22   Direction dir_;
23   Real delta_y_;
24
25
26   Interval attachment_x_;
27   Grob *tie_;
28   int head_position_;
29   
30   Tie_configuration ();
31   void center_tie_vertically (Tie_details const &);
32   Bezier get_bezier (Tie_details const &) const;
33   Real height (Tie_details const&) const;
34   
35   static int compare (Tie_configuration const &a,
36                       Tie_configuration const &b);
37   static Real distance (Tie_configuration const &a,
38                        Tie_configuration const &b);
39 };
40
41 INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
42
43 class Ties_configuration
44 {
45 public:
46   Array<Tie_configuration> ties_;
47 };
48
49 class Tie
50 {
51 public:
52   static void set_head (Grob *, Direction, Grob *head);
53   static bool has_interface (Grob *);
54   static Grob *head (Grob *, Direction);
55   static int get_column_rank (Grob *, Direction);
56   static int get_position (Grob *);
57   static Direction get_default_dir (Grob *);
58   static void get_configuration (Grob *, Tie_configuration *,
59                                  Tie_formatting_problem const &);
60   static void set_control_points (Grob *, Grob *,
61                                   Tie_configuration const&,
62                                   Tie_details const&);
63   static void set_default_control_points (Grob *);
64   DECLARE_SCHEME_CALLBACK (print, (SCM));
65   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
66   DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
67   DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
68   static int compare (Grob *const &s1,
69                       Grob *const &s2);
70
71   static Interval get_default_attachments (Spanner *me, Grob *common, Real gap,
72                                            int *staff_position, bool *in_between,
73                                            Tie_details const &);
74   
75 };
76
77
78 #endif // TIE_HH