]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/unpure-pure-container.hh
Run grand replace for 2015.
[lilypond.git] / lily / include / unpure-pure-container.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef UNPURE_PURE_CONTAINER_HH
21 #define UNPURE_PURE_CONTAINER_HH
22
23 #include "lily-guile.hh"
24 #include "small-smobs.hh"
25
26 class Unpure_pure_container : public Smob2<Unpure_pure_container>
27 {
28 public:
29   static const char type_p_name_ [];
30   SCM unpure_part () const { return scm1 (); }
31   // A container that has the same callback for both 'pure' and 'unpure' lookups
32   // and which ignores the 'start' and 'end' columnns.
33   // Such a callback will give the same answer for tentative or final layouts.
34   bool is_unchanging () const { return SCM_UNBNDP (scm2 ()); }
35   SCM pure_part () const;
36   static SCM make_smob (SCM a, SCM b = SCM_UNDEFINED)
37   {
38     if (SCM_UNBNDP (b) && !ly_is_procedure (a))
39       return Smob2<Unpure_pure_container>::make_smob (a, a);
40     return Smob2<Unpure_pure_container>::make_smob (a, b);
41   }
42   int print_smob (SCM, scm_print_state *);
43 };
44
45 #endif /* UNPURE_PURE_CONTAINER_HH */