2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2014--2015 David Kastrup <dak@gnu.org>
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.
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.
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/>.
20 // This module is concerned with managing grob-properties (more
21 // exactly, grob property templates, as they are not yet part of a
22 // grob) inside of context properties, in a context-hierarchical
23 // manner, with one stack for properties and subproperties per
26 #ifndef GROB_PROPERTIES_HH
27 #define GROB_PROPERTIES_HH
29 #include "lily-proto.hh"
31 // Several algorithms on Grob_properties need self-identifying
32 // information to work properly, but there is no point in storing them
33 // in the Grob_properties data structure itself. Instead we create a
34 // reflective data structure containing all necessary information for
35 // the algorithms processing Grob_properties.
37 class Grob_property_info {
38 Context * const context_;
40 Grob_properties *props_;
42 Grob_property_info (Context *context, SCM symbol, Grob_properties *props = 0)
43 : context_ (context), symbol_ (symbol), props_ (props)
45 operator bool () { return props_; }
46 Grob_property_info find ();
50 SCM push (SCM path, SCM value);
51 SCM temporary_override (SCM path, SCM value);
52 SCM temporary_revert (SCM path);
53 void matched_pop (SCM);
55 void pushpop (SCM path, SCM value)
57 if (SCM_UNBNDP (value))