]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/engraver.hh
release: 1.1.0
[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,  1997--1998 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 "request.hh"
16 #include "score-element-info.hh"
17 #include "staff-info.hh"
18 #include "translator.hh"
19
20
21 /**
22   a struct which processes requests, and creates the #Score_element#s.
23   It may use derived classes. Hungarian postfix: grav
24   
25   */
26 class Engraver : public virtual Translator {
27     
28   friend class Engraver_group_engraver;
29
30 protected:
31     
32
33   /// utility
34   Paper_def * paper() const;
35   /**
36     Invoke walker method to typeset element. Default: pass on to daddy.
37     */
38   virtual void typeset_element (Score_element*elem_p);
39
40     
41   /**
42     take note of item/spanner
43     put item in spanner. Adjust local key; etc.
44
45     Default: ignore the info
46     */
47   virtual void acknowledge_element (Score_element_info) {}
48
49   /** Do things with stuff found in acknowledge_element. Ugh. Should
50      be looped with acknowledge_element.
51      
52    */
53   virtual void process_acknowledged () {}
54   /**
55     Announce element. Default: pass on to daddy. Utility
56     */
57   virtual void announce_element (Score_element_info);
58    
59   /**
60     Get information on the staff. Default: ask daddy.
61     */
62   virtual Staff_info get_staff_info() const;
63   virtual void fill_staff_info (Staff_info&);
64
65 public:
66   TRANSLATOR_CLONE(Engraver);
67   Engraver_group_engraver * daddy_grav_l() const;
68   /**
69     override other ctor
70    */
71   Engraver () {}
72
73   DECLARE_MY_RUNTIME_TYPEINFO;
74   virtual Engraver * access_Engraver () { return this; }
75 };
76
77
78 #endif // ENGRAVER_HH
79