]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.67
authorfred <fred>
Sun, 24 Mar 2002 19:45:09 +0000 (19:45 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:45:09 +0000 (19:45 +0000)
lib/include/input.hh
lily/atom.cc [new file with mode: 0644]
lily/include/atom.hh [new file with mode: 0644]
lily/include/symbol.hh

index f87385c4280b384a92738e1021c964fbc9fb0f3f..e68940257c9cda1151063a8a49ac7c719703a161 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef INPUT_HH
 #define INPUT_HH
 
+#include "proto.hh"
+
 /**
   Base class for anything that records its poisition in the parse file.
  */
diff --git a/lily/atom.cc b/lily/atom.cc
new file mode 100644 (file)
index 0000000..0ca9649
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+  atom.cc -- implement Atom
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "symbol.hh"
+#include "tex.hh"
+#include "interval.hh"
+#include "dimen.hh"
+#include "string.hh"
+#include "varray.hh"
+#include "debug.hh"
+
+
+
+void
+Atom::print() const
+{
+    mtor << "texstring: " <<sym.tex<<"\n";    
+}
+
+Box
+Atom::extent() const
+{
+    Box b( sym.dim);
+    b.translate(off);
+    return b;
+}
+
+Atom::Atom(Symbol s)
+{
+    sym=s;
+}
+
+
+String
+Atom::TeX_string() const
+{
+    /* infinity checks. */
+    assert( abs(off.x) < 100 CM);
+    assert( abs(off.y) < 100 CM);
+    
+    // whugh.. Hard coded...
+    String s("\\placebox{%}{%}{%}");
+    Array<String> a;
+    a.push(print_dimen(off.y));
+    a.push(print_dimen(off.x));
+    a.push(sym.tex);
+    return substitute_args(s, a);
+}
diff --git a/lily/include/atom.hh b/lily/include/atom.hh
new file mode 100644 (file)
index 0000000..5e9f260
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+  atom.hh -- declare 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef ATOM_HH
+#define ATOM_HH
+
+#include "symbol.hh"
+#error
+
+
+#endif // ATOM_HH
index 6e04d049cff068a9ec34244e5ef4af096236494b..96fbd7c9b89383a691f43e239ece5ea654b2935b 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  symbol.hh -- declare Symbol, Atom
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #ifndef SYMBOL_HH
 #define SYMBOL_HH
 
@@ -14,4 +22,24 @@ struct Symbol {
     String str()const;         // for printing.
 };
 
+
+/// a symbol which can be translated, and freely copied
+struct Atom {
+    Offset off;
+    Symbol sym;
+
+    /* *************** */
+    
+    void translate(Offset o) {
+       off += o;
+    }
+    
+    /// how big is #this#?
+    Box extent() const;
+    Atom(Symbol s);
+
+    void print() const;
+
+    String TeX_string() const;
+};
 #endif