]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-def.hh
release: 1.1.35
[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--1999 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 #include "lily-guile.hh"
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
34   
35
36   add support for other len->wid conversions.
37
38   Input_engraver should be in here.
39
40
41   Interesting variables:
42   
43   /// The distance between lines
44   interline
45   
46  */
47 class Paper_def : public Music_output_def 
48 {
49   Hash_table<int, Lookup *> *lookup_p_tab_p_;
50   static int default_count_i_;
51
52 protected:
53   VIRTUAL_COPY_CONS(Music_output_def);
54
55 public:    
56   virtual ~Paper_def ();
57   
58
59   Array<Interval> shape_int_a_;
60   Real get_realvar (SCM symbol) const;
61   Real get_var (String id) const;
62
63   SCM get_scm_var (SCM sym) const;
64   
65   void reinit ();
66   Paper_def ();
67   void set_lookup (int, Lookup*);
68
69   Paper_def (Paper_def const&);
70   /// The distance between beams of multiplicity_i
71   Real interbeam_f (int multiplicity_i) const;
72
73   /// The thickness of a beam
74   Real beam_thickness_f () const;
75
76   /// thickness of the standard line 
77   Real rule_thickness () const;
78
79   /// thickness of the staff line
80   Real staffline_f () const;
81
82   Interval line_dimensions_int (int) const;
83   Real linewidth_f () const;
84
85   /// height of the staff
86   Real staffheight_f () const;
87
88   /// width of a crotchet ball
89   Real note_width () const;
90   void print () const;
91
92   Lookup const * lookup_l (int sz) const;       // TODO naming
93
94   /** convert a duration to an idealspacing
95     influence using the geometric_ and  paratime_signatures.
96     */
97   Real length_mom_to_dist (Moment, Real) const;
98   Real geometric_spacing (Moment) const;
99   Real arithmetic_constant (Moment minimal_mom) const;
100   Real arithmetic_spacing (Moment mom,Real constant) const;
101   virtual int get_next_default_count () const;
102   static void reset_default_count();
103
104   void output_settings (Paper_outputter*) const;
105   Paper_outputter* paper_outputter_p (Paper_stream*, Scope*, String) const;
106   Paper_stream* paper_stream_p () const;
107   String base_output_str () const;
108
109   // urg
110   friend int yyparse (void*);
111 };
112
113 #endif // Paper_def_HH