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) 1996--2020 Han-Wen Nienhuys | 4 Copyright (C) 1996--2020 Han-Wen Nienhuys |
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 10 matching lines...) Expand all Loading... |
21 #define GROB_HH | 21 #define GROB_HH |
22 | 22 |
23 #include "box.hh" | 23 #include "box.hh" |
24 #include "virtual-methods.hh" | 24 #include "virtual-methods.hh" |
25 #include "dimension-cache.hh" | 25 #include "dimension-cache.hh" |
26 #include "grob-interface.hh" | 26 #include "grob-interface.hh" |
27 #include "lily-proto.hh" | 27 #include "lily-proto.hh" |
28 | 28 |
29 #include <set> | 29 #include <set> |
30 | 30 |
| 31 struct Break_criterion { |
| 32 Direction break_dir_; |
| 33 System *root_system_; |
| 34 System *break_system_; |
| 35 Break_criterion() { |
| 36 break_dir_ = CENTER; |
| 37 root_system_ = NULL; |
| 38 break_system_ = NULL; |
| 39 } |
| 40 }; |
| 41 |
31 class Grob : public Smob<Grob> | 42 class Grob : public Smob<Grob> |
32 { | 43 { |
33 public: | 44 public: |
34 int print_smob (SCM, scm_print_state *) const; | 45 int print_smob (SCM, scm_print_state *) const; |
35 SCM mark_smob () const; | 46 SCM mark_smob () const; |
36 static const char *const type_p_name_; | 47 static const char *const type_p_name_; |
37 virtual ~Grob (); | 48 virtual ~Grob (); |
38 private: | 49 private: |
39 VIRTUAL_CLASS_NAME (Grob); | 50 VIRTUAL_CLASS_NAME (Grob); |
40 | 51 |
41 void init (); | 52 void init (); |
42 | 53 |
43 protected: | 54 protected: |
44 /* data */ | 55 /* data */ |
45 mutable Dimension_cache dim_cache_[NO_AXES]; | 56 mutable Dimension_cache dim_cache_[NO_AXES]; |
46 Output_def *layout_; | 57 Output_def *layout_; |
47 Grob *original_; | 58 Grob *original_; |
48 | 59 |
49 /* SCM data */ | 60 /* SCM data */ |
50 SCM immutable_property_alist_; | 61 SCM immutable_property_alist_; |
51 SCM mutable_property_alist_; | 62 SCM mutable_property_alist_; |
52 SCM object_alist_; | 63 SCM object_alist_; |
53 | 64 |
54 /* | 65 /* |
55 If this is a property, it accounts for 25% of the property | 66 If this is a property, it accounts for 25% of the property |
56 lookups. | 67 lookups. |
57 */ | 68 */ |
58 SCM interfaces_; | 69 SCM interfaces_; |
59 | 70 |
60 void substitute_object_links (SCM, SCM); | 71 void substitute_object_links (Break_criterion, SCM); |
61 Real get_offset (Axis a) const; | 72 Real get_offset (Axis a) const; |
62 SCM try_callback (SCM, SCM); | 73 SCM try_callback (SCM, SCM); |
63 SCM try_callback_on_alist (SCM *, SCM, SCM); | 74 SCM try_callback_on_alist (SCM *, SCM, SCM); |
64 void internal_set_value_on_alist (SCM *alist, SCM sym, SCM val); | 75 void internal_set_value_on_alist (SCM *alist, SCM sym, SCM val); |
65 | 76 |
66 public: | 77 public: |
67 | 78 |
68 /* friends */ | 79 /* friends */ |
69 friend class System; | 80 friend class System; |
70 friend SCM ly_grob_properties (SCM); | 81 friend SCM ly_grob_properties (SCM); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Stream_event *event_cause () const; | 133 Stream_event *event_cause () const; |
123 Stream_event *ultimate_event_cause () const; | 134 Stream_event *ultimate_event_cause () const; |
124 | 135 |
125 /* messages */ | 136 /* messages */ |
126 void warning (const std::string &) const; | 137 void warning (const std::string &) const; |
127 void programming_error (const std::string &) const; | 138 void programming_error (const std::string &) const; |
128 | 139 |
129 /* class hierarchy */ | 140 /* class hierarchy */ |
130 virtual System *get_system () const; | 141 virtual System *get_system () const; |
131 static System *get_system (Grob *); | 142 static System *get_system (Grob *); |
132 virtual void do_break_processing (); | 143 virtual void do_break_processing (System *root); |
133 virtual Grob *find_broken_piece (System *) const; | 144 virtual Grob *find_broken_piece (System *) const; |
134 virtual void break_breakable_item (System *); | 145 virtual void break_breakable_item (System *); |
135 virtual void derived_mark () const; | 146 virtual void derived_mark () const; |
136 virtual void handle_broken_dependencies (); | 147 virtual void handle_broken_dependencies (System *root); |
137 virtual void handle_prebroken_dependencies (); | 148 virtual void handle_prebroken_dependencies (System *root); |
138 virtual bool internal_set_as_bound_of_spanner (Spanner *, Direction) { return
false; } | 149 virtual bool internal_set_as_bound_of_spanner (Spanner *, Direction) { return
false; } |
139 | 150 |
140 /* printing */ | 151 /* printing */ |
141 Stencil *get_stencil () const; | 152 Stencil *get_stencil () const; |
142 Stencil get_print_stencil () const; | 153 Stencil get_print_stencil () const; |
143 | 154 |
144 /* interfaces */ | 155 /* interfaces */ |
145 bool internal_has_interface (SCM intf) const; | 156 bool internal_has_interface (SCM intf) const; |
146 | 157 |
147 /* offsets */ | 158 /* offsets */ |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 void chain_offset_callback (Grob *g, SCM proc, Axis a); | 219 void chain_offset_callback (Grob *g, SCM proc, Axis a); |
209 void chain_callback (Grob *g, SCM proc, SCM sym); | 220 void chain_callback (Grob *g, SCM proc, SCM sym); |
210 SCM axis_offset_symbol (Axis a); | 221 SCM axis_offset_symbol (Axis a); |
211 SCM axis_parent_positioning (Axis a); | 222 SCM axis_parent_positioning (Axis a); |
212 | 223 |
213 SCM call_pure_function (SCM unpure, SCM args, vsize start, vsize end); | 224 SCM call_pure_function (SCM unpure, SCM args, vsize start, vsize end); |
214 | 225 |
215 void set_nested_property (Grob *, SCM property_path, SCM value); | 226 void set_nested_property (Grob *, SCM property_path, SCM value); |
216 | 227 |
217 #endif /* GROB_HH */ | 228 #endif /* GROB_HH */ |
OLD | NEW |