OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 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 | 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 | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return typecheck_grob (symbol, upc->unpure_part ()) | 59 return typecheck_grob (symbol, upc->unpure_part ()) |
60 && typecheck_grob (symbol, upc->pure_part ()); | 60 && typecheck_grob (symbol, upc->pure_part ()); |
61 return ly_is_procedure (value) | 61 return ly_is_procedure (value) |
62 || type_check_assignment (symbol, value, ly_symbol2scm ("backend-type?")); | 62 || type_check_assignment (symbol, value, ly_symbol2scm ("backend-type?")); |
63 } | 63 } |
64 | 64 |
65 class Grob_properties : public Simple_smob<Grob_properties> | 65 class Grob_properties : public Simple_smob<Grob_properties> |
66 { | 66 { |
67 public: | 67 public: |
68 SCM mark_smob () const; | 68 SCM mark_smob () const; |
69 static const char type_p_name_[]; | 69 static const char * const type_p_name_; |
70 private: | 70 private: |
71 friend class Grob_property_info; | 71 friend class Grob_property_info; |
72 friend SCM ly_make_grob_properties (SCM); | 72 friend SCM ly_make_grob_properties (SCM); |
73 // alist_ may contain unexpanded nested overrides | 73 // alist_ may contain unexpanded nested overrides |
74 SCM alist_; | 74 SCM alist_; |
75 // based_on_ is the cooked_ value from the next higher context that | 75 // based_on_ is the cooked_ value from the next higher context that |
76 // alist_ is based on | 76 // alist_ is based on |
77 SCM based_on_; | 77 SCM based_on_; |
78 // cooked_ is a version of alist_ where nested overrides have been | 78 // cooked_ is a version of alist_ where nested overrides have been |
79 // expanded | 79 // expanded |
(...skipping 10 matching lines...) Expand all Loading... |
90 | 90 |
91 Grob_properties (SCM alist, SCM based_on) : | 91 Grob_properties (SCM alist, SCM based_on) : |
92 alist_ (alist), based_on_ (based_on), | 92 alist_ (alist), based_on_ (based_on), |
93 // if the constructor was called with lists possibly containing | 93 // if the constructor was called with lists possibly containing |
94 // partial overrides, we would need to initialize with based_on in | 94 // partial overrides, we would need to initialize with based_on in |
95 // order to trigger an initial update. But this should never | 95 // order to trigger an initial update. But this should never |
96 // happen, so we initialize straight with alist. | 96 // happen, so we initialize straight with alist. |
97 cooked_ (alist), cooked_from_ (alist), nested_ (0) { } | 97 cooked_ (alist), cooked_from_ (alist), nested_ (0) { } |
98 }; | 98 }; |
99 | 99 |
100 const char Grob_properties::type_p_name_[] = "ly:grob-properties?"; | 100 const char * const Grob_properties::type_p_name_ = "ly:grob-properties?"; |
101 | 101 |
102 SCM | 102 SCM |
103 Grob_properties::mark_smob () const | 103 Grob_properties::mark_smob () const |
104 { | 104 { |
105 scm_gc_mark (alist_); | 105 scm_gc_mark (alist_); |
106 scm_gc_mark (based_on_); | 106 scm_gc_mark (based_on_); |
107 scm_gc_mark (cooked_); | 107 scm_gc_mark (cooked_); |
108 return cooked_from_; | 108 return cooked_from_; |
109 } | 109 } |
110 | 110 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 where.props_->based_on_ = daddy_props; | 435 where.props_->based_on_ = daddy_props; |
436 alist = partial_list_copy (alist, based_on, daddy_props); | 436 alist = partial_list_copy (alist, based_on, daddy_props); |
437 where.props_->alist_ = alist; | 437 where.props_->alist_ = alist; |
438 } | 438 } |
439 if (scm_is_eq (where.props_->cooked_from_, alist)) | 439 if (scm_is_eq (where.props_->cooked_from_, alist)) |
440 return where.props_->cooked_; | 440 return where.props_->cooked_; |
441 where.props_->cooked_from_ = alist; | 441 where.props_->cooked_from_ = alist; |
442 where.props_->cooked_ = nalist_to_alist (alist, where.props_->nested_); | 442 where.props_->cooked_ = nalist_to_alist (alist, where.props_->nested_); |
443 return where.props_->cooked_; | 443 return where.props_->cooked_; |
444 } | 444 } |
OLD | NEW |