]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/grob-array.hh
* lily/break-substitution.cc (fast_substitute_grob_array): do
[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 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #ifndef GROB_ARRAY_HH
11 #define GROB_ARRAY_HH
12
13 #include "lily-proto.hh"
14 #include "smobs.hh"
15 #include "parray.hh"
16
17 class Grob_array
18 {
19   Link_array<Grob> grobs_;
20   bool ordered_;
21   
22   DECLARE_SIMPLE_SMOBS(Grob_array,);
23
24   Grob_array ();
25 public:
26   bool ordered () const { return ordered_; }
27   void set_ordered (bool b) { ordered_ = b; }
28   Item *item (int i);
29   Spanner *spanner (int i);
30   Grob * grob (int i) { return grobs_.elem (i); }
31   int size () const { return grobs_.size(); }
32   bool is_empty () const;
33   void clear ();  
34   void add (Grob *x) { grobs_.push (x); }
35   void set_array (Link_array<Grob> const &src);
36   Link_array<Grob> &array_reference ();
37   Link_array<Grob> const &array () const;
38   static SCM make_array ();
39 };
40
41 DECLARE_UNSMOB (Grob_array, grob_array);
42
43 Link_array<Grob> const &ly_scm2link_array (SCM x);
44 SCM grob_list_to_grob_array (SCM lst);
45
46
47 #endif /* GROB_ARRAY_HH */
48