2 translator-group.hh -- declare Translator_group
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef TRANSLATOR_GROUP_HH
11 #define TRANSLATOR_GROUP_HH
14 #include "lily-proto.hh"
15 #include "virtual-methods.hh"
16 #include "translator.hh"
21 typedef void (Translator::*Method_pointer)(void);
23 class Scheme_hash_table;
26 should make a struct out of this, and move SCM list stuff in here.
28 struct Translator_group_initializer {
29 static SCM modify_definition (SCM, SCM, bool);
31 static void set_acceptor (Translator*,SCM accepts, bool add);
32 static void add_element (Translator*,SCM name);
33 static void remove_element (Translator*,SCM name);
34 static void add_last_element (Translator*,SCM name);
35 static void apply_pushpop_property (Translator*trans, SCM syms, SCM eprop, SCM val);
36 static void add_push_property (Translator*, SCM,SCM,SCM);
37 static void add_pop_property (Translator*, SCM,SCM);
41 /** Make some kind of Elements from Requests. Elements are made by
42 hierarchically grouped Translators
44 class Translator_group : public virtual Translator {
46 Scheme_hash_table *properties_dict () const;
50 friend class Interpretation_context_handle;
54 SCM add_translator (SCM, Translator*);
55 void execute_single_pushpop_property (SCM prop, SCM sym, SCM val);
56 SCM get_property (SCM name_sym) const;
57 void set_property (String var_name, SCM value);
58 void set_property (SCM var_sym, SCM value);
59 Translator_group *where_defined (SCM name_sym) const;
63 VIRTUAL_COPY_CONS(Translator);
64 Translator_group(Translator_group const &);
66 void add_group_translator (Translator *trans_p);
69 /// Score_register = 0, Staff_registers = 1, etc)
70 Translator_group* ancestor_l (int l=1);
72 bool is_bottom_translator_b () const;
73 bool removable_b() const;
74 void terminate_translator (Translator*r_l);
75 Translator *remove_translator_p (Translator*trans_l);
76 void check_removal ();
77 // Translator *get_simple_translator (String) const;
78 Translator_group *find_existing_translator_l (String n, String id);
79 Translator_group *find_create_translator_l (String n, String id);
80 Link_array<Translator_group> path_to_acceptable_translator (String alias, Music_output_def*) const;
82 Translator_group*get_default_interpreter();
85 bool try_music_on_nongroup_children (Music *m);
87 virtual void do_print () const;
88 virtual void do_process_music ();
89 virtual void do_add_processing ();
90 virtual bool do_try_music (Music* req_l);
91 virtual void do_pre_move_processing();
92 virtual void do_post_move_processing();
93 virtual void do_creation_processing();
94 virtual void do_removal_processing();
95 virtual void each (Method_pointer);
99 #endif // TRANSLATOR_GROUP_HH