]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/pointer-group-interface.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / pointer-group-interface.hh
1 /*
2   pointer-group-interface.hh -- declare Pointer_group_interface
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 POINTER_GROUP_INTERFACE_HH
10 #define POINTER_GROUP_INTERFACE_HH
11
12 #include "std-vector.hh"
13 #include "lily-proto.hh"
14 #include "lily-guile.hh"
15
16 struct Pointer_group_interface
17 {
18 public:
19   static int count (Grob *, SCM);
20   static void add_grob (Grob *, SCM nm, Grob *e);
21   static void add_grob (Grob *, SCM nm, SCM x);
22   static void add_unordered_grob (Grob *, SCM nm, Grob *);
23   static void set_ordered (Grob *, SCM, bool);
24   static Grob_array *get_grob_array (Grob*, SCM);
25   static Grob *find_grob (Grob*, SCM, bool (*pred) (Grob*));
26 };
27
28 vector<Grob*> const &internal_extract_grob_array (Grob const *elt, SCM symbol);
29 vector<Item*> internal_extract_item_array (Grob const *elt, SCM symbol);
30
31 #define extract_grob_array(x, prop) internal_extract_grob_array (x, ly_symbol2scm (prop))
32 #define extract_item_array(x, prop) internal_extract_item_array (x, ly_symbol2scm (prop))
33
34 /*
35   This is dubious coding style, but lets not risk that we change the
36   representation of grob sets again.
37 */
38 #define extract_grob_set(grob, prop, set)                               \
39   vector<Grob*> const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop)))
40 #define extract_item_set(grob, prop, set)                               \
41   vector<Item*> set (internal_extract_item_array (grob, ly_symbol2scm (prop)))
42
43 #endif /* POINTER_GROUP_INTERFACE_HH */
44