]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/pointer-group-interface.hh
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[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--2006 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 };
26
27 vector<Grob*> const &internal_extract_grob_array (Grob const *elt, SCM symbol);
28 vector<Item*> internal_extract_item_array (Grob const *elt, SCM symbol);
29
30 #define extract_grob_array(x, prop) internal_extract_grob_array (x, ly_symbol2scm (prop))
31 #define extract_item_array(x, prop) internal_extract_item_array (x, ly_symbol2scm (prop))
32
33 /*
34   This is dubious coding style, but lets not risk that we change the
35   representation of grob sets again.
36 */
37 #define extract_grob_set(grob, prop, set)                               \
38   vector<Grob*> const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop)))
39 #define extract_item_set(grob, prop, set)                               \
40   vector<Item*> set (internal_extract_item_array (grob, ly_symbol2scm (prop)))
41
42 #endif /* POINTER_GROUP_INTERFACE_HH */
43