2 engraver.hh -- declare Engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
13 #include "lily-proto.hh"
16 #include "score-elem-info.hh"
17 #include "staff-info.hh"
23 a struct which processes requests, and creates the #Score_elem#s.
24 It may use derived classes. Hungarian postfix: grav
30 friend class Engraver_group_engraver;
32 You cannot copy a Engraver
34 Engraver(const Engraver&){}
50 virtual Paper_def * paper() const;
53 /// make items/spanners with the requests you got
54 virtual void do_process_requests(){}
56 /** typeset any items/spanners. Default: do nothing
58 virtual void do_pre_move_processing(){}
59 /** reset any appropriate data. Default: do nothing
61 virtual void do_post_move_processing(){}
64 virtual void do_creation_processing () {}
65 virtual void do_removal_processing() {}
68 Invoke walker method to typeset element. Default: pass on to daddy.
70 virtual void typeset_element(Score_elem*elem_p);
73 take note of item/spanner
74 put item in spanner. Adjust local key; etc.
76 Default: ignore the info
78 virtual void acknowledge_element(Score_elem_info) {}
80 Announce element. Default: pass on to daddy. Utility
82 virtual void announce_element(Score_elem_info);
84 Set Feature of the engraver(s). Default: ignore Feature.
86 virtual void set_feature(Feature){}
88 ask daddy for a feature
90 virtual Scalar get_feature(String type_str);
92 Does this equal or contain a certain engraver?
95 virtual void sync_features() {}
97 virtual bool contains_b(Engraver*grav_l)const;
99 Get information on the staff. Default: ask daddy.
101 virtual Staff_info get_staff_info()const;
102 virtual void fill_staff_info(Staff_info&);
105 virtual void do_print()const;
108 Default: always return false
110 virtual bool do_try_request(Request *req_l);
112 void pre_move_processing();
113 void process_requests();
115 try to fit the request in this engraver
118 false: not noted, not taken.
120 true: request swallowed. Don't try to put the request elsewhere.
123 bool try_request(Request*);
124 bool is_bottom_engraver() const;
126 void post_move_processing();
127 void removal_processing();
129 Engraver_group_engraver * daddy_grav_l_;
132 virtual ~Engraver(){}
133 DECLARE_MY_RUNTIME_TYPEINFO;
138 A macro to automate administration of engravers.
140 #define ADD_THIS_ENGRAVER(c) \
142 static Engraver * globalctor (){ \
146 add_engraver(c::static_name(), globalctor); \
151 typedef Engraver*(*Grav_ctor)(void);
152 void add_engraver(String s, Grav_ctor f);
154 #endif // ENGRAVER_HH