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 typeset a "command" item. Default: pass on to daddy.
69 If the column is not breakable, #pre_p# and #post_p# are junked
71 virtual void typeset_breakable_item(Item * nobreak_p);
73 Invoke walker method to typeset element. Default: pass on to daddy.
75 virtual void typeset_element(Score_elem*elem_p);
78 take note of item/spanner
79 put item in spanner. Adjust local key; etc.
81 Default: ignore the info
83 virtual void acknowledge_element(Score_elem_info) {}
85 Announce element. Default: pass on to daddy. Utility
87 virtual void announce_element(Score_elem_info);
89 Set Feature of the engraver(s). Default: ignore Feature.
91 virtual void set_feature(Feature){}
93 ask daddy for a feature
95 virtual Scalar get_feature(String type_str);
97 Does this equal or contain a certain engraver?
100 virtual void sync_features() {}
102 virtual bool contains_b(Engraver*grav_l)const;
104 Get information on the staff. Default: ask daddy.
106 virtual Staff_info get_staff_info()const;
107 virtual void fill_staff_info(Staff_info&);
110 virtual void do_print()const;
113 Default: always return false
115 virtual bool do_try_request(Request *req_l);
117 void pre_move_processing();
118 void process_requests();
120 try to fit the request in this engraver
123 false: not noted, not taken.
125 true: request swallowed. Don't try to put the request elsewhere.
128 bool try_request(Request*);
129 bool is_bottom_engraver() const;
131 void post_move_processing();
133 Engraver_group_engraver * daddy_grav_l_;
136 virtual ~Engraver(){}
137 DECLARE_MY_RUNTIME_TYPEINFO;
142 A macro to automate administration of engravers.
144 #define ADD_THIS_ENGRAVER(c) \
146 static Engraver * globalctor (){ \
150 add_engraver(c::static_name(), globalctor); \
155 typedef Engraver*(*Grav_ctor)(void);
156 void add_engraver(String s, Grav_ctor f);
158 #endif // ENGRAVER_HH