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