]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/engraver.hh
* lily/context.cc (Context): take key argument in ctor.
[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--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef ENGRAVER_HH
11 #define ENGRAVER_HH
12
13 #include "lily-proto.hh"
14 #include "array.hh"
15 #include "event.hh"
16 #include "grob-info.hh"
17 #include "translator.hh"
18
19
20 /**
21   a struct which processes events, and creates the #Grob#s.
22   It may use derived classes. 
23   */
24 class Engraver : public virtual Translator {
25     
26   friend class Engraver_group_engraver;
27 protected:
28   /*
29     take note of item/spanner
30     put item in spanner. Adjust local key; etc.
31
32     Default: ignore the info
33     */
34   virtual void acknowledge_grob (Grob_info) {}
35
36   /** Do things with stuff found in acknowledge_grob. Ugh. Should
37      be looped with acknowledge_grob.
38      
39    */
40   virtual void process_acknowledged_grobs () {}
41
42   virtual void announce_grob (Grob_info);
43   Engraver_group_engraver*get_daddy_engraver () const;
44   
45 public:
46   /**
47     Announce element. Default: pass on to daddy. Utility
48     */
49   void announce_grob (Grob*, SCM cause);
50   
51   Score_engraver * get_score_engraver () const;
52   /**
53     override other ctor
54    */
55   TRANSLATOR_DECLARATIONS(Engraver);
56 };
57
58 #define make_item(x,cause) make_item_from_properties (this, ly_symbol2scm (x), cause, x)
59 #define make_spanner(x,cause) make_spanner_from_properties (this, ly_symbol2scm (x), cause, x)
60 Item* make_item_from_properties (Engraver * tg, SCM x, SCM cause, const char *name);
61 Spanner* make_spanner_from_properties (Engraver * tg, SCM x, SCM cause, const char*name);
62
63
64
65
66 #endif // ENGRAVER_HH