2 grob.hh -- declare Grob
4 source file of the LilyPond music typesetter
6 (c) 1996--2006 Han-Wen Nienhuys
12 #include "virtual-methods.hh"
13 #include "dimension-cache.hh"
14 #include "grob-interface.hh"
15 #include "object-key.hh"
20 DECLARE_SMOBS (Grob, foo);
21 DECLARE_CLASSNAME(Grob);
27 Dimension_cache dim_cache_[NO_AXES];
30 Object_key const *key_;
33 SCM immutable_property_alist_;
34 SCM mutable_property_alist_;
38 If this is a property, it accounts for 25% of the property
43 void substitute_object_links (SCM, SCM);
44 Real get_offset (Axis a) const;
45 SCM try_callback (SCM, SCM);
51 friend SCM ly_grob_properties (SCM);
52 friend SCM ly_grob_basic_properties (SCM);
54 /* standard callbacks */
55 DECLARE_SCHEME_CALLBACK(x_parent_positioning, (SCM));
56 DECLARE_SCHEME_CALLBACK(y_parent_positioning, (SCM));
57 DECLARE_SCHEME_CALLBACK (stencil_height, (SCM smob));
58 DECLARE_SCHEME_CALLBACK (stencil_width, (SCM smob));
61 Output_def *layout () const { return layout_; }
62 Grob *original () const { return original_; }
63 SCM interfaces () const { return interfaces_; }
64 Object_key const *key () const { return key_; }
67 Grob (SCM basic_props, Object_key const *);
68 Grob (Grob const &, int copy_count);
69 virtual Grob *clone (int count) const;
73 bool is_live () const;
79 SCM get_property_alist_chain (SCM) const;
80 SCM internal_get_property (SCM symbol) const;
81 SCM get_property_data (SCM symbol) const;
82 SCM internal_get_object (SCM symbol) const;
83 void del_property (SCM symbol);
84 void internal_set_property (SCM sym, SCM val);
85 void internal_set_object (SCM sym, SCM val);
88 void warning (String) const;
89 void programming_error (String) const;
93 virtual System *get_system () const;
94 virtual void do_break_processing ();
95 virtual Grob *find_broken_piece (System *) const;
96 virtual void discretionary_processing ();
97 virtual void derived_mark () const;
98 virtual void handle_broken_dependencies ();
99 virtual void handle_prebroken_dependencies ();
102 Stencil *get_stencil () const;
103 Stencil get_print_stencil () const;
106 bool internal_has_interface (SCM intf);
107 static bool has_interface (Grob *me);
110 void translate_axis (Real, Axis);
111 Real relative_coordinate (Grob const *refp, Axis) const;
114 Interval extent (Grob *refpoint, Axis) const;
115 void flush_extent_cache (Axis);
118 Grob *common_refpoint (Grob const *s, Axis a) const;
119 void set_parent (Grob *e, Axis);
120 Grob *get_parent (Axis a) const;
121 void fixup_refpoint ();
125 DECLARE_UNSMOB (Grob, grob);
126 Spanner *unsmob_spanner (SCM);
127 Item *unsmob_item (SCM);
130 Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a);
131 Grob *common_refpoint_of_array (Link_array<Grob> const &, Grob *, Axis a);
132 System *get_root_system (Grob *me);
135 Interval robust_relative_extent (Grob *, Grob *, Axis);
137 /* offset/extent callbacks. */
138 void add_offset_callback (Grob *g, SCM proc, Axis a);
139 void chain_offset_callback (Grob *g, SCM proc, Axis a);
140 SCM axis_offset_symbol (Axis a);
141 SCM axis_parent_positioning (Axis a);