]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/engraver.hh
* scm/music-functions.scm (has-request-chord): don't use
[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--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef ENGRAVER_HH
11 #define ENGRAVER_HH
12
13 #include "event.hh"
14 #include "grob-info.hh"
15 #include "translator.hh"
16
17 /**
18   a struct which processes events, and creates the #Grob#s.
19   It may use derived classes. 
20   */
21 class Engraver : public virtual Translator {
22     
23   friend class Engraver_group_engraver;
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
33   /** Do things with stuff found in acknowledge_grob. Ugh. Should
34      be looped with acknowledge_grob.
35      
36    */
37   virtual void process_acknowledged_grobs () {}
38
39   virtual void announce_grob (Grob_info);
40   Engraver_group_engraver*get_daddy_engraver () const;
41   
42 public:
43   /**
44     Announce element. Default: pass on to daddy. Utility
45     */
46   void announce_grob (Grob*, SCM cause);
47   
48   Score_engraver * get_score_engraver () const;
49   /**
50     override other ctor
51    */
52   TRANSLATOR_DECLARATIONS(Engraver);
53 };
54
55 #define make_item(x, cause) make_item_from_properties (this, ly_symbol2scm (x), cause, x)
56 #define make_spanner(x, cause) make_spanner_from_properties (this, ly_symbol2scm (x), cause, x)
57 Item* make_item_from_properties (Engraver * tg, SCM x, SCM cause, const char *name);
58 Spanner* make_spanner_from_properties (Engraver * tg, SCM x, SCM cause, const char*name);
59
60
61
62
63 #endif // ENGRAVER_HH