]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/translator-group.hh
Issue 4878: Make type_p_name_ always char pointer
[lilypond.git] / lily / include / translator-group.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
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.
10
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.
15
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/>.
18 */
19
20 #ifndef TRANSLATOR_GROUP_HH
21 #define TRANSLATOR_GROUP_HH
22
23 #include "callback.hh"
24 #include "listener.hh"
25 #include "translator.hh"
26
27 class Translator_group : public Smob<Translator_group>
28 {
29 public:
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 ();
34 private:
35   void precompute_method_bindings ();
36   vector<Method_instance>
37   precomputed_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT];
38
39   SCM protected_events_;
40
41   void create_child_translator (SCM);
42
43 public:
44   DECLARE_CLASSNAME (Translator_group);
45
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 ();
51
52   void protect_event (SCM ev);
53
54   void stop_translation_timestep ();
55   void start_translation_timestep ();
56
57   Translator_group ();
58
59   void precomputed_translator_foreach (Translator_precompute_index);
60
61   Context *context () const { return context_; }
62 protected:
63   SCM simple_trans_list_;
64   Context *context_;
65
66   friend class Context_def;
67   virtual void derived_mark () const;
68 };
69
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);
75
76 #define foobar
77 #define ADD_TRANSLATOR_GROUP(classname, desc, grobs, read, write) foobar
78
79
80 #endif // TRANSLATOR_GROUP_HH