]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/grob-array.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / grob-array.hh
1 /*
2   grob-array.hh -- declare Grob_array
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef GROB_ARRAY_HH
10 #define GROB_ARRAY_HH
11
12 #include "lily-proto.hh"
13 #include "smobs.hh"
14 #include "std-vector.hh"
15
16 class Grob_array
17 {
18   vector<Grob*> grobs_;
19   bool ordered_;
20
21   DECLARE_SIMPLE_SMOBS (Grob_array);
22
23   Grob_array ();
24 public:
25   bool ordered () const { return ordered_; }
26   void set_ordered (bool b) { ordered_ = b; }
27   Item *item (vsize i);
28   Spanner *spanner (vsize i);
29   Grob *grob (vsize i) { return grobs_.at (i); }
30   vsize size () const { return grobs_.size (); }
31   bool empty () const;
32   void remove_duplicates ();
33   void clear ();
34   void add (Grob *x) { grobs_.push_back (x); }
35   void set_array (vector<Grob*> const &src);
36   vector<Grob*> &array_reference ();
37   vector<Grob*> const &array () const;
38   static SCM make_array ();
39 };
40
41 DECLARE_UNSMOB (Grob_array, grob_array);
42
43 vector<Grob*> const &ly_scm2link_array (SCM x);
44 SCM grob_list_to_grob_array (SCM lst);
45
46 #endif /* GROB_ARRAY_HH */
47