]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-def.hh
2210b2f4c2eb697d5a7dfb6f78e456e0b1483109
[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 Han-Wen Nienhuys <hanwen@stack.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 "music-output-def.hh"
18
19 /** 
20
21   Symbols, dimensions and constants pertaining to visual output.
22
23   This struct takes care of all kinds of symbols, dimensions and
24   constants. Most of them are related to the point-size of the fonts,
25   so therefore, the lookup table for symbols is also in here.
26
27   TODO: 
28   
29   add support for multiple fontsizes 
30
31   add support for other len->wid conversions.
32
33   Input_engraver should be in here.
34  */
35 class Paper_def : public Music_output_def {
36   Lookup *lookup_p_;
37   Assoc<String, Real> *real_vars_p_;
38
39   Input_translator * itrans_p_;
40 protected:
41   virtual  Global_translator * get_global_translator_p();
42   VIRTUAL_COPY_CONS(Paper_def,Music_output_def);
43   DECLARE_MY_RUNTIME_TYPEINFO;
44 public:    
45   virtual ~Paper_def();
46
47   void set_var (String, Real);
48   Real get_var (String) const;
49   void reinit();
50   Paper_def();
51   void set (Lookup*);
52   void set (Input_translator *);
53
54   Paper_def (Paper_def const&);
55   /// The distance between beams
56   Real interbeam_f() const;
57   /**
58     The distance between lines
59     */
60   Real interline_f() const;
61   /// half the distance between lines
62   Real internote_f() const;
63
64   /// thickness of the standard line 
65   Real rule_thickness() const;
66   Real whole_width() const;
67   Real linewidth_f() const;
68   /// height of the staff
69   Real standard_height() const;
70
71   /// width of a crotchet ball
72   Real note_width() const;
73   void print() const;
74
75   Lookup const * lookup_l();    // TODO naming
76
77   /** convert a duration to an idealspacing
78     influence using the geometric_ and  parameters.
79     */
80   Real duration_to_dist (Moment, Real) const;
81   Real geometric_spacing(Moment) const;
82   Real arithmetic_constant(Moment minimal_mom) const;
83   Real arithmetic_spacing( Moment mom,Real constant) const;
84 };
85
86 #endif // Paper_def_HH
87