]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/engraver.hh
Fix some bugs in the dynamic engraver and PostScript backend
[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--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef ENGRAVER_HH
10 #define ENGRAVER_HH
11
12 #include "music.hh"
13 #include "grob-info.hh"
14 #include "translator.hh"
15
16 /**
17    a struct which processes events, and creates the #Grob#s.
18    It may use derived classes.
19 */
20 class Engraver : public Translator
21 {
22
23   friend class Engraver_group;
24 protected:
25   /*
26     take note of item/spanner
27     put item in spanner. Adjust local key; etc.
28
29     Default: ignore the info
30   */
31   virtual void acknowledge_grob (Grob_info) {}
32   virtual void announce_grob (Grob_info);
33   virtual void announce_end_grob (Grob_info);
34   Engraver_group *get_daddy_engraver () const;
35
36 public:
37   /**
38      Announce element. Default: pass on to daddy. Utility
39   */
40   void announce_grob (Grob *, SCM cause);
41   void announce_end_grob (Grob *, SCM cause);
42
43   /**
44      override other ctor
45   */
46   TRANSLATOR_DECLARATIONS (Engraver);
47 };
48
49 #define make_item(x, cause) make_item_from_properties (this, ly_symbol2scm (x), cause, x)
50 #define make_spanner(x, cause) make_spanner_from_properties (this, ly_symbol2scm (x), cause, x)
51 #define make_paper_column(x) make_paper_column_from_properties (this, ly_symbol2scm (x), x)
52 Grob *make_grob_from_properties (Engraver *tr, SCM symbol, SCM cause, char const *name);
53 Item *make_item_from_properties (Engraver *tg, SCM x, SCM cause, char const *name);
54 Spanner *make_spanner_from_properties (Engraver *tg, SCM x, SCM cause, char const *name);
55 Paper_column *make_paper_column_from_properties (Engraver *tg, SCM x, char const *name);
56
57 #endif // ENGRAVER_HH