]> git.donarmstrong.com Git - lilypond.git/blob - hdr/complexwalker.hh
a67d5b881a2ee5bae0a14ba7a51fccd4e46824fb
[lilypond.git] / hdr / complexwalker.hh
1 /*
2   complexwalker.hh -- declare Complex_walker
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef COMPLEXWALKER_HH
8 #define COMPLEXWALKER_HH
9
10 #include "proto.hh"
11 #include "assoc.hh"
12 #include "staffwalker.hh"
13 #include "staffeleminfo.hh"
14 #include "plist.hh"
15
16 /**
17   A staff walker which uses registers to decide what to print
18  */
19 class Complex_walker: public Staff_walker {
20     bool try_command_request(Command_req *req_l);
21     void do_change_group( Voice * v, String group_id_str);
22     void do_announces();
23     void try_request(Request*req);    
24     int c0_position_i_;
25
26     Array<Item*> prebreak_item_p_arr_;
27     Array<Item*> nobreak_item_p_arr_;
28     Array<Item*> postbreak_item_p_arr_;
29     
30 public:
31     
32     IPointerList<Voice_registers *> voice_reg_list_;
33     IPointerList<Voice_group_registers*> group_reg_list_;
34     Assoc<Voice *, Voice_group_registers *> voice_group_map_;
35     
36     Array<Staff_elem_info> announce_info_arr_;
37     Walker_registers *walk_regs_p_;
38     
39     /* *************** */
40
41     Voice_registers *find_voice_reg(Voice*v_l)const;
42     Voice_registers *get_voice_reg(Voice*v_l);
43     
44     /** search for voice_group containing #v_l#
45
46       @return
47       pointer if found,  0 if not found.
48       */
49     Voice_group_registers *find_voice_group(Voice* v_l)const;
50
51     /// search. Create if necessary
52     Voice_group_registers *get_voice_group(Voice* v_l);
53     /** search for voice_group named #id#
54
55       @return
56       pointer if found,  0 if not found.
57       */
58     Voice_group_registers *find_voice_group(const char* id)const;
59
60     /**
61       search for voice_group named #id#, create if necessary
62       */
63     Voice_group_registers *get_voice_group(const char*);
64
65     Array<Voice_registers *> get_voice_regs(Voice_group_registers *) const;
66     
67     void regs_process_requests();
68     void typeset_breakable_item(Item * pre_p ,
69                                 Item * nobreak_p, Item * post_p);
70     void typeset_element(Staff_elem *elem_p);
71     void announce_element(Staff_elem_info);
72     virtual void process_requests();
73     virtual void do_post_move();
74     virtual void do_pre_move();
75     /**
76       @return the position of central c.
77      */
78     int c0_position_i() const;
79
80     /**
81       set the position of central c.
82       @param the new position
83      */
84     void set_c0_position(int j);
85     Complex_walker(Complex_staff*);
86     ~Complex_walker();
87
88     Complex_staff *staff();
89 private:
90 };
91
92
93 #endif // COMPLEXWALKER_HH
94
95