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