]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/prob.hh
e90355c5eba65ca04ac80039e8c8c68a6a91adda
[lilypond.git] / lily / include / prob.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2004--2014  Jan Nieuwenhuizen <janneke@gnu.org>
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 PROPERTY_OBJECT_HH
21 #define PROPERTY_OBJECT_HH
22
23 #include "stencil.hh"
24 #include "virtual-methods.hh"
25
26 /*
27   A formatted "system" (A block of titling also is a Property_object)
28
29   To save memory, we don't keep around the System grobs, but put the
30   formatted content of the grob is put into a
31   Property_object. Page-breaking handles Property_object objects.
32 */
33
34 class Prob : public Smob<Prob>
35 {
36 public:
37   int print_smob (SCM, scm_print_state *);
38   SCM mark_smob ();
39   static SCM equal_p (SCM, SCM);
40   static const char type_p_name_[];
41   virtual ~Prob ();
42 private:
43   DECLARE_CLASSNAME (Prob);
44
45   void init_vars ();
46 protected:
47   SCM mutable_property_alist_;
48   SCM immutable_property_alist_;
49   SCM type_;
50
51   virtual void derived_mark () const;
52   virtual SCM copy_mutable_properties () const;
53   virtual void type_check_assignment (SCM, SCM) const;
54
55 public:
56   Prob (SCM, SCM);
57   Prob (Prob const &);
58   virtual string name () const;
59   SCM type () const { return type_; }
60   SCM get_property_alist (bool _mutable) const;
61   SCM internal_get_property (SCM sym) const;
62   void instrumented_set_property (SCM, SCM, const char *, int, const char *);
63   void internal_set_property (SCM sym, SCM val);
64 };
65
66
67 SCM ly_prob_set_property_x (SCM system, SCM sym, SCM value);
68 SCM ly_prob_property (SCM prob, SCM sym, SCM val);
69
70 SCM ly_prob_type_p (SCM obj, SCM sym);
71
72 #endif /* PROPERTY_OBJECT_HH */