]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/context-def.hh
Merge branch 'lilypond/translation' of ssh://trettig@git.sv.gnu.org/srv/git/lilypond...
[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--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef CONTEXT_DEF_HH
10 #define CONTEXT_DEF_HH
11
12 #include "std-vector.hh"
13 #include "lily-proto.hh"
14 #include "smobs.hh"
15 #include "input.hh"
16 #include "virtual-methods.hh"
17
18
19 /*
20   The definition of a interpretation context as given in the
21   input. The lists are stored in order of definition.
22 */
23 struct Context_def
24 {
25 private:
26   /*
27     these lists store the definition, in opposite order of entry
28   */
29   SCM translator_mods_;
30   SCM accept_mods_;
31   SCM property_ops_;
32   SCM description_;
33   SCM context_name_;
34   SCM context_aliases_;
35   SCM translator_group_type_;
36   SCM default_child_;
37   SCM input_location_;
38 public:
39   Input *origin () const;
40   void add_context_mod (SCM);
41   SCM get_default_child (SCM user_mods) const;
42   SCM get_context_name () const { return context_name_; }
43   SCM get_accepted (SCM user_mods) const;
44   SCM get_property_ops () const { return property_ops_; }
45   SCM get_translator_names (SCM) const;
46   SCM get_translator_group_type () const { return translator_group_type_; }
47   void set_acceptor (SCM accepts, bool add);
48
49   VIRTUAL_COPY_CONSTRUCTOR(Context_def, Context_def);
50
51   vector<Context_def*> path_to_acceptable_context (SCM type_string,
52                                                    Output_def *, SCM) const;
53   Context *instantiate (SCM extra_ops);
54
55   SCM to_alist () const;
56   static SCM make_scm ();
57
58   void apply_default_property_operations (Context *);
59
60 private:
61   DECLARE_SMOBS (Context_def);
62   Context_def ();
63   Context_def (Context_def const &);
64 };
65
66 DECLARE_UNSMOB (Context_def, context_def);
67
68 #endif /* CONTEXT_DEF_HH */
69