2 grob.hh -- declare Grob
4 source file of the LilyPond music typesetter
6 (c) 1996--2007 Han-Wen Nienhuys
13 #include "virtual-methods.hh"
14 #include "dimension-cache.hh"
15 #include "grob-interface.hh"
21 DECLARE_CLASSNAME(Grob);
27 Dimension_cache dim_cache_[NO_AXES];
32 SCM immutable_property_alist_;
33 SCM mutable_property_alist_;
37 If this is a property, it accounts for 25% of the property
42 void substitute_object_links (SCM, SCM);
43 Real get_offset (Axis a) const;
44 SCM try_callback (SCM, SCM);
45 SCM try_callback_on_alist (SCM *, SCM, SCM);
46 void internal_set_value_on_alist (SCM *alist, SCM sym, SCM val);
53 friend SCM ly_grob_properties (SCM);
54 friend SCM ly_grob_basic_properties (SCM);
56 /* standard callbacks */
57 DECLARE_SCHEME_CALLBACK(x_parent_positioning, (SCM));
58 DECLARE_SCHEME_CALLBACK(y_parent_positioning, (SCM));
59 DECLARE_SCHEME_CALLBACK (stencil_height, (SCM smob));
60 DECLARE_SCHEME_CALLBACK (stencil_width, (SCM smob));
63 Output_def *layout () const { return layout_; }
64 Grob *original () const { return original_; }
65 SCM interfaces () const { return interfaces_; }
68 Grob (SCM basic_props);
70 virtual Grob *clone () const;
74 bool is_live () const;
80 SCM get_property_alist_chain (SCM) const;
81 SCM internal_get_property (SCM symbol) const;
82 SCM internal_get_property_data (SCM symbol) const;
83 SCM internal_get_non_callback_marker_property_data (SCM symbol) const;
84 SCM internal_get_object (SCM symbol) const;
85 void internal_set_object (SCM sym, SCM val);
86 void internal_del_property (SCM symbol);
87 void instrumented_set_property (SCM, SCM, char const*, int, char const*);
88 void internal_set_property (SCM sym, SCM val);
91 void warning (string) const;
92 void programming_error (string) const;
96 virtual System *get_system () const;
97 virtual void do_break_processing ();
98 virtual Grob *find_broken_piece (System *) const;
99 virtual void discretionary_processing ();
100 virtual void derived_mark () const;
101 virtual void handle_broken_dependencies ();
102 virtual void handle_prebroken_dependencies ();
105 Stencil *get_stencil () const;
106 Stencil get_print_stencil () const;
109 bool internal_has_interface (SCM intf);
110 DECLARE_GROB_INTERFACE();
113 void translate_axis (Real, Axis);
114 Real relative_coordinate (Grob const *refp, Axis) const;
115 Real pure_relative_y_coordinate (Grob const *refp, int start, int end);
116 Real maybe_pure_coordinate (Grob const *refp, Axis a, bool pure, int start, int end);
119 Interval extent (Grob *refpoint, Axis) const;
120 void flush_extent_cache (Axis);
121 virtual Interval pure_height (Grob *refpoint, int start_col, int end_col);
122 Interval maybe_pure_extent (Grob *refpoint, Axis, bool pure, int start, int end);
125 Grob *common_refpoint (Grob const *s, Axis a) const;
126 void set_parent (Grob *e, Axis);
127 Grob *get_parent (Axis a) const;
128 void fixup_refpoint ();
130 virtual Interval_t<int> spanned_rank_interval () const;
134 DECLARE_UNSMOB (Grob, grob);
135 Spanner *unsmob_spanner (SCM);
136 Item *unsmob_item (SCM);
139 Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a);
140 Grob *common_refpoint_of_array (vector<Grob*> const &, Grob *, Axis a);
141 System *get_root_system (Grob *me);
144 Interval robust_relative_extent (Grob *, Grob *, Axis);
146 /* offset/extent callbacks. */
147 void add_offset_callback (Grob *g, SCM proc, Axis a);
148 void chain_offset_callback (Grob *g, SCM proc, Axis a);
149 SCM axis_offset_symbol (Axis a);
150 SCM axis_parent_positioning (Axis a);
152 SCM call_pure_function (SCM unpure, SCM args, int start, int end);
154 void set_nested_property (Grob *, SCM property_path, SCM value);