]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-def.hh
b42c400af4155494e75534b73bbc438bf127a663
[lilypond.git] / lily / include / paper-def.hh
1 /*
2   paper-def.hh -- declare Paper_def
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef PAPER_DEF_HH
11 #define PAPER_DEF_HH
12 #include "lily-proto.hh"
13
14 #include "real.hh"
15
16 #include "moment.hh"
17 #include "array.hh"
18 #include "interval.hh"
19 #include "music-output-def.hh"
20
21 /** 
22
23   Symbols, dimensions and constants pertaining to visual output.
24
25   This struct takes care of all kinds of symbols, dimensions and
26   constants. Most of them are related to the point-size of the fonts,
27   so therefore, the lookup table for symbols is also in here.
28
29   TODO: 
30   
31   add support for multiple fontsizes 
32
33   add support for other len->wid conversions.
34
35   Input_engraver should be in here.
36  */
37 class Paper_def : public Music_output_def 
38 {
39   Assoc<int, Lookup *> *lookup_p_assoc_p_;
40   static int default_count_i_;
41   bool ps_b_;
42
43 public:    
44   virtual ~Paper_def ();
45   DECLARE_MY_RUNTIME_TYPEINFO;
46   VIRTUAL_COPY_CONS (Paper_def,Music_output_def);
47
48   Array<Interval> shape_int_a_;
49
50   Real get_var (String) const;
51   void reinit ();
52   Paper_def ();
53   void set_lookup (int, Lookup*);
54
55   Paper_def (Paper_def const&);
56   /// The distance between beams of multiplicity_i
57   Real interbeam_f (int multiplicity_i) const;
58
59   /// The thickness of a beam
60   Real beam_thickness_f () const;
61
62   /// The distance between lines
63   Real interline_f () const;
64   /// half the distance between lines
65   Real internote_f () const;
66
67   /// thickness of the standard line 
68   Real rule_thickness () const;
69
70   /// thickness of the staff line
71   Real staffline_f () const;
72
73   Interval line_dimensions_int (int) const;
74   Real linewidth_f () const;
75
76   /// height of the staff
77   Real staffheight_f () const;
78
79   /// width of a crotchet ball
80   Real note_width () const;
81   void print () const;
82
83   Lookup const * lookup_l (int sz) const;       // TODO naming
84
85   virtual Paper_def* paper_l ();
86   virtual String dimension_str (Real r) const;
87   virtual Lookup* lookup_p (Lookup const&) const;
88   virtual Lookup* lookup_p (Symtables const&) const;
89   virtual String unknown_str () const;
90
91   /** convert a duration to an idealspacing
92     influence using the geometric_ and  paratime_signatures.
93     */
94   Real duration_to_dist (Moment, Real) const;
95   Real geometric_spacing (Moment) const;
96   Real arithmetic_constant (Moment minimal_mom) const;
97   Real arithmetic_spacing (Moment mom,Real constant) const;
98   virtual int get_next_default_count () const;
99   virtual String output_settings_str () const;
100   // urg
101   friend int yyparse (void*);
102 };
103
104 #endif // PAPER_DEF_HH
105