2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef TRANSLATOR_GROUP_HH
21 #define TRANSLATOR_GROUP_HH
23 #include "callback.hh"
24 #include "listener.hh"
25 #include "translator.hh"
27 class Translator_group : public Smob<Translator_group>
30 SCM mark_smob () const;
31 int print_smob (SCM, scm_print_state *) const;
32 static const char * const type_p_name_;
33 virtual ~Translator_group ();
35 void precompute_method_bindings ();
36 vector<Method_instance>
37 precomputed_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT];
39 SCM protected_events_;
41 void create_child_translator (SCM);
44 DECLARE_CLASSNAME (Translator_group);
46 virtual void connect_to_context (Context *c);
47 virtual void disconnect_from_context ();
48 virtual SCM get_simple_trans_list ();
49 virtual void initialize ();
50 virtual void finalize ();
52 void protect_event (SCM ev);
54 void stop_translation_timestep ();
55 void start_translation_timestep ();
59 void precomputed_translator_foreach (Translator_precompute_index);
61 Context *context () const { return context_; }
63 SCM simple_trans_list_;
66 friend class Context_def;
67 virtual void derived_mark () const;
70 SCM names_to_translators (SCM namelist, Context *tg);
71 void recurse_over_translators (Context *c, SCM tr_method,
72 SCM tr_group_method, Direction);
73 void precomputed_recurse_over_translators (Context *c, Translator_precompute_index idx, Direction dir);
74 Translator_group *get_translator_group (SCM sym);
77 #define ADD_TRANSLATOR_GROUP(classname, desc, grobs, read, write) foobar
80 #endif // TRANSLATOR_GROUP_HH