]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.67
authorfred <fred>
Sun, 24 Mar 2002 19:45:19 +0000 (19:45 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:45:19 +0000 (19:45 +0000)
lily/general-script-def.cc [new file with mode: 0644]
lily/text-def.cc

diff --git a/lily/general-script-def.cc b/lily/general-script-def.cc
new file mode 100644 (file)
index 0000000..e35a56c
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+  general-script-def.cc -- implement General_script_def
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "general-script-def.hh"
+#include "debug.hh"
+#include "symbol.hh"
+int
+General_script_def::staff_dir_i()const
+{
+    return -1;
+}
+int
+General_script_def::rel_stem_dir_i()const
+{
+    return 0;
+}
+int
+General_script_def::priority_i()const
+{
+    return 1000;
+}
+
+bool
+General_script_def::inside_b()const
+{
+    return false;
+}
+
+bool
+General_script_def::equal_b(General_script_def const&g)const
+{
+    if (name() != g.name())
+       return false;
+
+    return do_equal_b(g);
+}
+
+bool
+General_script_def::do_equal_b(General_script_def const&)const
+{
+    return true;
+}
+
+
+void
+General_script_def::print() const
+{
+    mtor << name() << "{";
+    do_print();
+    mtor << "}";
+}
+
+void
+General_script_def::do_print() const
+{
+}
+
+Atom
+General_script_def::get_atom(Paper_def*, int)const
+{
+    Symbol s;
+    return Atom(s);
+}
+IMPLEMENT_STATIC_NAME(General_script_def);
index a601d4367ca031b03dd8870b668a47bc4ac95f1b..a9e95ef68d4fc2bd424dccac193de3422482f8e7 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  text-def.cc -- implement Text_def
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "debug.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
@@ -6,9 +14,9 @@
 #include "dimen.hh"
 
 Interval
-Text_def::width() const
+Text_def::width(Paper_def * p) const
 {
-    Atom a = create_atom();
+    Atom a = get_atom(p,0);
 
     Real guess_width_f = text_str_.length_i() * a.sym.dim.x.length(); // ugh
     Interval i(0, guess_width_f);
@@ -20,20 +28,19 @@ Text_def::width() const
 Text_def::Text_def()
 {   
     align_i_ = 1;                      // right
-    pdef_l_ = 0;
     style_str_ = "roman";
 }
 bool
-Text_def::compare(Text_def const &def)
+Text_def::do_equal_b(Text_def const &def)const
 {
     return align_i_ == def.align_i_ && text_str_ == def.text_str_
        && style_str_ == def.style_str_;
 }
 
 Atom
-Text_def::create_atom() const
+Text_def::get_atom(Paper_def *p, int ) const
 {
-    return pdef_l_->lookup_l()->text(style_str_, text_str_, -align_i_);
+    return p->lookup_l()->text(style_str_, text_str_, -align_i_);
 }
 
 void
@@ -42,3 +49,4 @@ Text_def::print() const
     mtor << "Text `" << text_str_ << "\', style " <<
        style_str_ << "align " << align_i_ << '\n';
 }
+IMPLEMENT_STATIC_NAME(Text_def);