]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/atom.hh
eb231dc7fd1522883ee8a3eca520933e1881218c
[lilypond.git] / lily / include / atom.hh
1 /*
2   atom.hh -- declare Atom
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef ATOM_HH
10 #define ATOM_HH
11
12 #include "protected-scm.hh"
13 #include "string.hh"
14 #include "box.hh"
15 #include "lily-proto.hh"
16 #include "lily-guile.hh"
17
18
19 #ifdef ATOM_SMOB
20
21 /// a symbol which can be translated, and freely copied
22 class Atom {
23   static long smob_tag_;
24
25   static SCM smob_mark (SCM);
26   static scm_sizet smob_free (SCM);
27   static int smob_display (SCM, SCM, scm_print_state*);
28   SCM make_smob () const;
29 public:
30   Offset off_;
31   Atom (SCM s);
32
33   static SCM make_atom (SCM outputfunc);
34   SCM copy_self () const;
35   static Atom *atom_l (SCM);
36
37   /// Is #obj# a Foo?
38   static bool Atom_b(SCM obj);
39   static void init_smob ();
40   
41   SCM func_;
42   SCM font_;
43 };
44
45 #else
46
47 class Atom {
48 public:
49   Atom (SCM s);
50   Offset off_;
51   /*
52     SCM expression that (when evaluated) gives a TeX string
53 representing a musical notation symbol.  */
54   Protected_scm func_;
55   Protected_scm font_;
56 };
57
58 #endif
59
60 #endif