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