]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/scheme-engraver.hh
Run grand-replace (issue 3765)
[lilypond.git] / lily / include / scheme-engraver.hh
1 /*
2   scheme-engraver.hh -- declare Scheme_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   Copyright (c) 2009--2014 Han-Wen Nienhuys <hanwen@lilypond.org>
7
8   LilyPond is free software: you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation, either version 3 of the License, or
11   (at your option) any later version.
12
13   LilyPond is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef SCHEME_ENGRAVER_HH
23 #define SCHEME_ENGRAVER_HH
24
25 #include "engraver.hh"
26
27 class Scheme_engraver : public Engraver
28 {
29 public:
30   void init_from_scheme (SCM definition);
31   TRANSLATOR_DECLARATIONS_NO_LISTENER (Scheme_engraver);
32
33   static Listener get_listener (void *generic_arg, SCM event);
34
35 protected:
36   ~Scheme_engraver ();
37
38   void stop_translation_timestep ();
39   void start_translation_timestep ();
40   void process_music ();
41   void process_acknowledged ();
42
43   virtual void initialize ();
44   virtual void finalize ();
45   virtual void derived_mark () const;
46   virtual translator_listener_record *get_listener_list () const;
47   virtual bool must_be_last () const;
48
49 private:
50   void acknowledge_grob_by_hash (Grob_info info, SCM iface_function_hash);
51   void init_acknowledgers (SCM alist, SCM *hash);
52
53   DECLARE_ACKNOWLEDGER (grob);
54   DECLARE_END_ACKNOWLEDGER (grob);
55
56   bool must_be_last_;
57
58   SCM acknowledge_grob_function_;
59   SCM stop_translation_timestep_function_;
60   SCM start_translation_timestep_function_;
61   SCM process_music_function_;
62   SCM process_acknowledged_function_;
63   SCM initialize_function_;
64   SCM finalize_function_;
65
66   // hashq table of interface-symbol -> scheme-function
67   SCM interface_acknowledger_hash_;
68   SCM interface_end_acknowledger_hash_;
69
70   // Alist of listened-symbol . scheme-function
71   SCM listeners_alist_;
72
73   // We dont use this, but need it for the documentation boilerplate.
74   static translator_listener_record *listener_list_;
75   translator_listener_record *per_instance_listeners_;
76 };
77
78 #endif /* SCHEME_ENGRAVER_HH */
79