]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/atom.hh
release: 1.1.36
[lilypond.git] / lily / include / atom.hh
index f9621382bc3145370371b23ebe53808b1e53244e..15fc068f5e7a696e27f66a1843f197b10f941010 100644 (file)
@@ -3,37 +3,60 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #ifndef ATOM_HH
 #define ATOM_HH
 
-#include "lily-guile.hh"
+#include "protected-scm.hh"
 #include "string.hh"
 #include "box.hh"
 #include "lily-proto.hh"
+#include "lily-guile.hh"
+
+//#define ATOM_SMOB
+
+#ifdef ATOM_SMOB
 
 /// a symbol which can be translated, and freely copied
 class Atom {
+  static long smob_tag_;
+
+  static SCM smob_mark (SCM);
+  static scm_sizet smob_free (SCM);
+  static int smob_display (SCM, SCM, scm_print_state*);
+public:
+  SCM make_smob () const;
+
   Offset off_;
+  Atom (SCM s);
+
+  static SCM make_atom (SCM outputfunc);
+  SCM copy_self () const;
+  static Atom *atom_l (SCM);
+
+  /// Is #obj# a Foo?
+  static bool Atom_b(SCM obj);
+  static void init_smob ();
+  
+  SCM func_;
+  SCM font_;
+};
+
+#else
+
+class Atom {
 public:
-  // urg, only used as a temp buffer
-  String str_;
-  String font_;
-  SCM lambda_;
-  Box dim_;
-
-  Offset offset () const;
-  String str() const;          // for printing.
-  Atom (String, Box);
-  Atom ();
-  void translate (Offset o);
-  void translate_axis (Real r,Axis a);
-  /// how big is #this#?
-  Box extent() const;
-  void print() const;
-  bool check_infinity_b () const;
-  bool empty() const;
+  Atom (SCM s);
+  Offset off_;
+  /*
+    SCM expression that (when evaluated) gives a TeX string
+representing a musical notation symbol.  */
+  Protected_scm func_;
+  Protected_scm font_;
 };
+
+#endif
+
 #endif