]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/engraver.hh
5f74491e949fbe75be5e22a5813f91f371af5ca1
[lilypond.git] / lily / include / engraver.hh
1 /*
2   engraver.hh -- declare Engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef ENGRAVER_HH
10 #define ENGRAVER_HH
11
12 #include "grob-info.hh"
13 #include "translator.hh"
14
15 /**
16    a struct which processes events, and creates the #Grob#s.
17    It may use derived classes.
18 */
19 class Engraver : public Translator
20 {
21   Grob *internal_make_grob (SCM sym, SCM cause, char const *name,
22                             char const *f, int l, char const *fun);
23
24   friend class Engraver_group;
25 protected:
26   /*
27     take note of item/spanner
28     put item in spanner. Adjust local key; etc.
29
30     Default: ignore the info
31   */
32   virtual void acknowledge_grob (Grob_info) {}
33   virtual void announce_grob (Grob_info);
34   virtual void announce_end_grob (Grob_info);
35   Engraver_group *get_daddy_engraver () const;
36
37 public:
38   /**
39      Announce element. Default: pass on to daddy. Utility
40   */
41   void announce_grob (Grob *, SCM cause);
42   void announce_end_grob (Grob *, SCM cause);
43
44   Item *internal_make_item (SCM sym, SCM cause, char const *name,
45                             char const *f, int l, char const *fun);
46   Spanner *internal_make_spanner (SCM sym, SCM cause, char const *name,
47                                   char const *f, int l, char const *fun);
48   Paper_column *internal_make_column (SCM sym, char const *name,
49                                       char const *f, int l, char const *fun);
50
51   /**
52      override other ctor
53   */
54   TRANSLATOR_DECLARATIONS (Engraver);
55 };
56
57 #define make_item(x, cause) internal_make_item (ly_symbol2scm (x), cause, x, __FILE__, __LINE__, __FUNCTION__)
58 #define make_spanner(x, cause) internal_make_spanner (ly_symbol2scm (x), cause, x, __FILE__, __LINE__, __FUNCTION__)
59 #define make_paper_column(x) internal_make_column (ly_symbol2scm (x), x, __FILE__, __LINE__, __FUNCTION__)
60
61
62 #endif // ENGRAVER_HH