property-init.ly: Organize, cleanup.
[lilypond/mpolesky.git] / lily / grob-interface-scheme.cc
blob635ce5fc08c44a28725251eee5843c713316b632
1 /*
2 grob-interface-scheme.cc -- implement grob interface bindings.
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #include "lily-guile.hh"
10 #include "std-string.hh"
12 static SCM all_ifaces;
14 void
15 internal_add_interface (SCM a, SCM b, SCM c)
17 if (!all_ifaces)
19 SCM tab = scm_c_make_hash_table (59);
20 all_ifaces = tab;
21 scm_permanent_object (tab);
24 SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED);
26 scm_hashq_set_x (all_ifaces, a, entry);
29 LY_DEFINE (ly_add_interface, "ly:add-interface",
30 3, 0, 0, (SCM iface, SCM desc, SCM props),
31 "Add a new grob interface. @var{iface} is the"
32 " interface name, @var{desc} is the interface"
33 " description, and @var{props} is the list of"
34 " user-settable properties for the interface.")
36 LY_ASSERT_TYPE (ly_is_symbol, iface, 1);
37 LY_ASSERT_TYPE (scm_is_string, desc, 2);
38 LY_ASSERT_TYPE (ly_is_list, props, 3);
40 internal_add_interface (iface, desc, props);
42 return SCM_UNSPECIFIED;
45 LY_DEFINE (ly_all_grob_interfaces, "ly:all-grob-interfaces",
46 0, 0, 0, (),
47 "Return the hash table with all grob interface descriptions.")
49 return all_ifaces;