]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/translator-group.hh
release: 1.5.45
[lilypond.git] / lily / include / translator-group.hh
1 /*
2   translator-group.hh -- declare Translator_group
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef TRANSLATOR_GROUP_HH
11 #define TRANSLATOR_GROUP_HH
12
13 #include "string.hh"
14 #include "lily-proto.hh"
15 #include "virtual-methods.hh"
16 #include "translator.hh"
17 #include "parray.hh"
18 #include "smobs.hh"
19
20 // egcs
21 typedef void (Translator::*Method_pointer) (void);
22 #define set_property(x,y) internal_set_property(ly_symbol2scm(x),y)
23 #define set_children_property(x,y) internal_set_children_property(ly_symbol2scm(x),y)
24
25 class Scheme_hash_table;
26
27
28 /** Make some kind of Elements from Requests. Elements are made by
29   hierarchically grouped Translators
30   */
31 class Translator_group : public virtual Translator {
32
33   Scheme_hash_table *properties_dict () const;
34   int iterator_count_;
35
36   friend class Interpretation_context_handle;
37   SCM add_translator (SCM, Translator*);
38
39 protected:
40   ~Translator_group ();
41 public:
42   void execute_single_pushpop_property (SCM prop, SCM sym, SCM val);
43   SCM internal_get_property (SCM name_sym) const;
44
45   void unset_property (SCM var_sym);
46   void internal_set_property (SCM var_sym, SCM value);  
47   void internal_set_children_property (SCM var_sym, SCM value);  
48   Translator_group *where_defined (SCM name_sym) const;
49
50   String id_str_;
51
52   VIRTUAL_COPY_CONS (Translator);
53   Translator_group (Translator_group const &);
54   Translator_group ();
55   void add_fresh_group_translator (Translator *trans_p);
56   void add_used_group_translator (Translator *trans_p);
57   
58   /// Score_register = 0, Staff_registers = 1, etc)
59   Translator_group* ancestor_l (int l=1);
60   int depth_i () const;
61   bool is_bottom_translator_b () const;
62   bool removable_b () const;
63   void terminate_translator (Translator*r_l);
64   Translator *remove_translator_p (Translator*trans_l);
65   void check_removal ();
66   // Translator *get_simple_translator (String) const;
67   Translator_group *find_existing_translator_l (String n, String id);
68   Translator_group *find_create_translator_l (String n, String id);
69   Link_array<Translator_group> path_to_acceptable_translator (String alias, Music_output_def*) const;
70   Translator_group*get_default_interpreter ();
71
72 public:
73   bool try_music_on_nongroup_children (Music *m);
74   
75   virtual void do_announces ();
76   virtual bool try_music (Music* req_l);       
77   virtual void stop_translation_timestep ();
78   virtual void start_translation_timestep ();   
79   virtual void initialize ();
80   virtual void finalize ();
81   virtual void each (Method_pointer);
82 };
83
84 #endif // TRANSLATOR_GROUP_HH