]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/paper-def.hh
release: 0.1.28
[lilypond.git] / lily / include / paper-def.hh
index cb1c5cbea95aaf15a5f292a92756d303ae77dc28..d87a5e637dd58e320aaae02fd4b672adbd5f469d 100644 (file)
@@ -1,68 +1,88 @@
 /*
   paper-def.hh -- declare Paper_def
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 
 #ifndef PAPER_DEF_HH
 #define PAPER_DEF_HH
-#include "proto.hh"
+#include "lily-proto.hh"
+
 #include "real.hh"
-#include "string.hh"
+
 #include "moment.hh"
+#include "music-output-def.hh"
 
+/** 
 
-/** symbols, dimensions and constants
+  Symbols, dimensions and constants pertaining to visual output.
 
   This struct takes care of all kinds of symbols, dimensions and
- constants. Most of them are related to the point-size of the fonts,
- so therefore, the lookup table for symbols is also in here.
+  constants. Most of them are related to the point-size of the fonts,
+  so therefore, the lookup table for symbols is also in here.
+
+  TODO: 
+  
+  add support for multiple fontsizes 
 
+  add support for other len->wid conversions.
+
+  Input_engraver should be in here.
  */
-class Paper_def {
-    Lookup *lookup_p_;
+class Paper_def : public Music_output_def {
+  Lookup *lookup_p_;
+  Dictionary<Real> *real_vars_p_;
+
+protected:
+  VIRTUAL_COPY_CONS(Paper_def,Music_output_def);
 public:    
-    String outfile;
-
-    Real linewidth;
-
-    /// how much space does a whole note take (ideally?)
-    Real whole_width;
-
-    /// ideal = geometric_ ^ log2(duration)
-    Real geometric_;
-    
-    /* *************** */
-    void reinit();
-    Paper_def(Lookup*);
-    void set(Lookup*);
-    ~Paper_def();
-    Paper_def(Paper_def const&);
-    /**
-      The distance between lines
-     */
-    Real interline()const;
-    /// half the distance between lines
-    Real internote()const;
-
-    /// thickness of the standard line 
-    Real rule_thickness()const;
-
-    /// height of the staff
-    Real standard_height()const;
-
-    /// width of a quaver ball
-    Real note_width() const;
-    void print() const;
-    Lookup const * lookup_l(); // TODO naming
-
-    /** convert a duration to an idealspacing
-      influence using the geometric_ and whole_width parameters.
-      */
-    Real duration_to_dist(Moment);
+  virtual ~Paper_def();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+
+  /**
+    Set or overwrite a variable
+   */
+  void set_var (String, Real);
+  /**
+    Read a variable.  Crash if it doesn't exist.
+   */
+  Real get_var (String) const;
+  void reinit();
+  Paper_def();
+  void set (Lookup*);
+
+  Paper_def (Paper_def const&);
+  /// The distance between beams
+  Real interbeam_f() const;
+  /**
+    The distance between lines
+    */
+  Real interline_f() const;
+  /// half the distance between lines
+  Real internote_f() const;
+
+  /// thickness of the standard line 
+  Real rule_thickness() const;
+  Real linewidth_f() const;
+  /// height of the staff
+  Real standard_height() const;
+
+  /// width of a crotchet ball
+  Real note_width() const;
+  void print() const;
+
+  Lookup const * lookup_l();   // TODO naming
+
+  /** convert a duration to an idealspacing
+    influence using the geometric_ and  parameters.
+    */
+  Real duration_to_dist (Moment, Real) const;
+  Real geometric_spacing(Moment) const;
+  Real arithmetic_constant(Moment minimal_mom) const;
+  Real arithmetic_spacing( Moment mom,Real constant) const;
 };
 
 #endif // Paper_def_HH