2 grob.hh -- declare Grob
4 source file of the LilyPond music typesetter
6 (c) 1996--2005 Han-Wen Nienhuys
12 #include "virtual-methods.hh"
13 #include "dimension-cache.hh"
14 #include "grob-interface.hh"
15 #include "object-key.hh"
17 typedef void (Grob:: *Grob_method_pointer) (void);
22 DECLARE_SMOBS (Grob, foo);
26 Object_key const *key_;
27 SCM immutable_property_alist_;
28 SCM mutable_property_alist_;
32 If this is a property, it accounts for 25% of the property
39 friend SCM ly_grob_properties (SCM);
40 friend SCM ly_grob_basic_properties (SCM);
41 friend void check_interfaces_for_property (Grob const *, SCM);
42 void substitute_object_links (SCM, SCM);
44 DECLARE_CLASSNAME(Grob);
45 Real get_offset (Axis a) const;
47 DECLARE_SCHEME_CALLBACK(same_axis_parent_positioning, (SCM, SCM));
48 DECLARE_SCHEME_CALLBACK(other_axis_parent_positioning, (SCM, SCM));
50 Object_key const *get_key () const;
54 /* TODO: junk this member. */
57 Dimension_cache dim_cache_[NO_AXES];
59 Grob (SCM basic_props, Object_key const *);
60 Grob (Grob const &, int copy_count);
62 virtual Grob *clone (int count) const;
63 static SCM stencil_extent (Grob*, Axis);
64 DECLARE_SCHEME_CALLBACK (stencil_height, (SCM smob));
65 DECLARE_SCHEME_CALLBACK (stencil_width, (SCM smob));
72 SCM internal_get_property (SCM symbol) const;
73 SCM get_property_data (SCM symbol) const;
74 SCM internal_get_object (SCM symbol) const;
76 void del_property (SCM symbol);
77 void internal_set_property (SCM sym, SCM val);
78 void internal_set_object (SCM sym, SCM val);
80 SCM try_callback (SCM, SCM);
82 SCM get_property_alist_chain (SCM) const;
83 static SCM ly_grob_set_property (SCM, SCM, SCM);
84 static SCM ly_grob_property (SCM, SCM);
86 void warning (String) const;
87 void programming_error (String) const;
89 Output_def *get_layout () const;
90 virtual System *get_system () const;
91 virtual void do_break_processing ();
92 virtual Grob *find_broken_piece (System *) const;
93 virtual void discretionary_processing ();
94 virtual void derived_mark () const;
96 Stencil *get_stencil () const;
97 Stencil get_print_stencil () const;
100 bool is_live () const;
102 bool internal_has_interface (SCM intf);
103 static bool has_interface (Grob *me);
104 SCM get_interfaces () const;
106 virtual void handle_broken_dependencies ();
107 virtual void handle_prebroken_dependencies ();
109 Interval extent (Grob *refpoint, Axis) const;
111 void translate_axis (Real, Axis);
112 Real relative_coordinate (Grob const *refp, Axis) const;
113 Grob *common_refpoint (Grob const *s, Axis a) const;
115 // duh. slim down interface here. (todo)
116 bool has_offset_callback (SCM callback, Axis) const;
117 void add_offset_callback (SCM callback, Axis);
118 void flush_extent_cache (Axis);
120 void set_parent (Grob *e, Axis);
123 Grob *get_parent (Axis a) const;
124 void fixup_refpoint ();
127 DECLARE_UNSMOB (Grob, grob);
128 Spanner *unsmob_spanner (SCM);
129 Item *unsmob_item (SCM);
131 Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a);
132 Grob *common_refpoint_of_array (Link_array<Grob> const &, Grob *, Axis a);
134 void set_break_subsititution (SCM criterion);
135 SCM substitute_object_alist (SCM alist, SCM dest);
137 Link_array<Grob> ly_scm2grobs (SCM ell);
138 SCM ly_grobs2scm (Link_array<Grob> a);
140 Interval robust_relative_extent (Grob *, Grob *, Axis);
142 bool is_callback_chain (SCM s);
143 SCM callback_chain_extract_procedures (SCM chain_smob);