]> git.donarmstrong.com Git - lilypond.git/blob - lily/page-marker.cc
Issue 4360: Reorganize smob initialization to make it more reliable
[lilypond.git] / lily / page-marker.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2007--2015 Nicolas Sceaux <nicolas.sceaux@free.fr>
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 #include "page-marker.hh"
21
22 ADD_SMOB_INIT (Page_marker);
23
24 Page_marker::Page_marker ()
25 {
26   symbol_ = SCM_EOL;
27   permission_ = SCM_EOL;
28   label_ = SCM_EOL;
29   smobify_self ();
30 }
31
32 Page_marker::Page_marker (Page_marker const &src)
33   : Smob<Page_marker> ()
34 {
35   symbol_ = src.symbol_;
36   permission_ = src.permission_;
37   label_ = src.label_;
38   smobify_self ();
39 }
40
41 Page_marker::~Page_marker ()
42 {
43 }
44
45 const char Page_marker::type_p_name_[] = "ly:page-marker?";
46
47 SCM
48 Page_marker::mark_smob ()
49 {
50   scm_gc_mark (symbol_);
51   scm_gc_mark (permission_);
52   scm_gc_mark (label_);
53   return SCM_EOL;
54 }
55
56 SCM
57 Page_marker::permission_symbol ()
58 {
59   return symbol_;
60 }
61
62 SCM
63 Page_marker::permission_value ()
64 {
65   return permission_;
66 }
67
68 SCM
69 Page_marker::label ()
70 {
71   return label_;
72 }
73
74 void
75 Page_marker::set_permission (SCM symbol, SCM permission)
76 {
77   symbol_ = symbol;
78   permission_ = permission;
79 }
80
81 void
82 Page_marker::set_label (SCM label)
83 {
84   label_ = label;
85 }