]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/context-def.hh
* flower
[lilypond.git] / lily / include / context-def.hh
1 /*
2   context-def.hh -- declare Context_def
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef CONTEXT_DEF_HH
10 #define CONTEXT_DEF_HH
11
12 #include "lily-proto.hh"
13 #include "smobs.hh"
14 #include "input.hh"
15
16 /*
17   The definition of a interpretation context as given in the
18   input. The lists are stored in order of definition.
19 */
20 struct Context_def : public Input
21 {
22 private:
23   /*
24     these lists store the definition, in opposite order of entry
25   */
26   SCM translator_mods_;
27   SCM accept_mods_;
28   SCM property_ops_;
29   SCM description_;
30   SCM context_name_;
31   SCM context_aliases_;
32   SCM translator_group_type_;
33
34 public:
35   void add_context_mod (SCM);
36   SCM default_child_context_name ();
37   SCM get_context_name () const;
38   SCM get_accepted (SCM) const;
39   SCM get_property_ops () const { return property_ops_; }
40   SCM get_translator_names (SCM) const;
41   void set_acceptor (SCM accepts, bool add);
42
43   Link_array<Context_def> path_to_acceptable_context (SCM type_string,
44                                                       Output_def *) const;
45   Context *instantiate (SCM extra_ops, Object_key const *);
46
47   SCM to_alist () const;
48   static SCM make_scm ();
49
50   SCM clone_scm () const;
51   void apply_default_property_operations (Context *);
52
53 private:
54   DECLARE_SMOBS (Context_def, foo);
55   Context_def ();
56   Context_def (Context_def const &);
57 };
58
59 DECLARE_UNSMOB (Context_def, context_def);
60
61 #endif /* CONTEXT_DEF_HH */
62