]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-def.hh
ea7b9d39e329421ae2e86b328c14e75386cc7d14
[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@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 "varray.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   Lookup *lookup_p_;
40   Scope* scope_p_;
41   static int default_count_i_;
42
43 protected:
44   VIRTUAL_COPY_CONS(Paper_def,Music_output_def);
45
46 public:    
47   virtual ~Paper_def ();
48   DECLARE_MY_RUNTIME_TYPEINFO;
49
50   Array<Interval> shape_int_a_;
51
52   Real get_var (String) const;
53   void reinit ();
54   Paper_def ();
55   void set (Lookup*);
56
57   Paper_def (Paper_def const&);
58   /// The distance between beams of multiplicity_i
59   Real interbeam_f (int multiplicity_i) const;
60
61   /// The thickness of a beam
62   Real beam_thickness_f () const;
63
64   /// The distance between lines
65   Real interline_f () const;
66   /// half the distance between lines
67   Real internote_f () const;
68
69   /// thickness of the standard line 
70   Real rule_thickness () const;
71
72   /// thickness of the staff line
73   Real staffline_f () const;
74
75   Interval line_dimensions_int (int) const;
76   Real linewidth_f () const;
77
78   /// height of the staff
79   Real staffheight_f () const;
80
81   /// width of a crotchet ball
82   Real note_width () const;
83   void print () const;
84
85   Lookup const * lookup_l ();   // TODO naming
86
87   /** convert a duration to an idealspacing
88     influence using the geometric_ and  parameters.
89     */
90   Real duration_to_dist (Moment, Real) const;
91   Real geometric_spacing (Moment) const;
92   Real arithmetic_constant (Moment minimal_mom) const;
93   Real arithmetic_spacing (Moment mom,Real constant) const;
94   virtual int get_next_default_count () const;
95   String TeX_output_settings_str () const;
96   // urg
97   friend int yyparse (void*);
98 };
99
100 #endif // Paper_def_HH
101