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