]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/atom.hh
release: 1.1.33
[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 //#define ATOM_SMOB
19
20 #ifdef ATOM_SMOB
21
22 /// a symbol which can be translated, and freely copied
23 class Atom {
24   static long smob_tag_;
25
26   static SCM smob_mark (SCM);
27   static scm_sizet smob_free (SCM);
28   static int smob_display (SCM, SCM, scm_print_state*);
29 public:
30   SCM make_smob () const;
31
32   Offset off_;
33   Atom (SCM s);
34
35   static SCM make_atom (SCM outputfunc);
36   SCM copy_self () const;
37   static Atom *atom_l (SCM);
38
39   /// Is #obj# a Foo?
40   static bool Atom_b(SCM obj);
41   static void init_smob ();
42   
43   SCM func_;
44   SCM font_;
45 };
46
47 #else
48
49 class Atom {
50 public:
51   Atom (SCM s);
52   Offset off_;
53   /*
54     SCM expression that (when evaluated) gives a TeX string
55 representing a musical notation symbol.  */
56   Protected_scm func_;
57   Protected_scm font_;
58 };
59
60 #endif
61
62 #endif