2 grob.hh -- declare Grob
4 source file of the LilyPond music typesetter
6 (c) 1996--2004 Han-Wen Nienhuys
13 #include "virtual-methods.hh"
14 #include "lily-guile.hh"
15 #include "lily-proto.hh"
17 #include "dimension-cache.hh"
18 #include "grob-interface.hh"
21 for administration of what was done already
24 ORPHAN=0, // not yet added to Paper_score
26 PRECALCED, // calcs before spacing done
27 POSTCALCING, // busy calculating. This is used to trap cyclic deps.
28 POSTCALCED, // after spacing calcs done
31 typedef void (Grob::*Grob_method_pointer) (void);
34 /* Basic G[raphical output] O[bject]. */
38 SCM immutable_property_alist_;
39 SCM mutable_property_alist_;
42 void substitute_mutable_properties(SCM,SCM);
48 TODO: junk this member.
51 Dimension_cache dim_cache_[NO_AXES];
53 Grob (SCM basic_props);
55 VIRTUAL_COPY_CONSTRUCTOR(Grob,Grob);
62 SCM internal_get_property (SCM) const;
63 void internal_set_property (SCM, SCM val);
64 void add_to_list_property (SCM, SCM);
65 void warning (String)const;
66 void programming_error (String)const;
68 Output_def *get_paper () const;
69 void add_dependency (Grob*);
70 virtual System *get_system () const;
72 void calculate_dependencies (int final, int busy, SCM funcname);
75 virtual void do_break_processing ();
76 virtual Grob *find_broken_piece (System*) const;
77 virtual void discretionary_processing ();
78 virtual SCM do_derived_mark () const;
80 Stencil * get_stencil () const;
81 SCM get_uncached_stencil () const;
83 SCM get_property_alist_chain (SCM) const;
85 bool is_live () const;
87 DECLARE_SCHEME_CALLBACK (stencil_extent, (SCM smob, SCM axis));
89 static SCM ly_grob_set_property (SCM, SCM,SCM);
90 static SCM ly_grob_property (SCM, SCM);
92 bool internal_has_interface (SCM intf);
93 static bool has_interface (Grob*me);
95 virtual void handle_broken_dependencies ();
96 virtual void handle_prebroken_dependencies ();
98 DECLARE_SMOBS (Grob,foo);
102 bool is_empty (Axis a) const;
104 Interval extent (Grob * refpoint, Axis) const;
106 void translate_axis (Real, Axis);
107 Real relative_coordinate (Grob const* refp, Axis) const;
108 Grob*common_refpoint (Grob const* s, Axis a) const;
110 // duh. slim down interface here. (todo)
111 bool has_offset_callback (SCM callback, Axis)const;
112 void add_offset_callback (SCM callback, Axis);
113 bool has_extent_callback (SCM, Axis)const;
114 void set_extent (SCM , Axis);
115 Real get_offset (Axis a) const;
117 void set_parent (Grob* e, Axis);
118 Grob *get_parent (Axis a) const { return dim_cache_[a].parent_; }
120 DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
123 DECLARE_UNSMOB(Grob,grob);
124 Spanner* unsmob_spanner (SCM );
125 Item* unsmob_item (SCM );
127 Grob*common_refpoint_of_list (SCM elt_list, Grob * , Axis a);
128 Grob*common_refpoint_of_array (Link_array<Grob> const&, Grob * , Axis a);
130 void set_break_subsititution (SCM criterion);
131 SCM substitute_mutable_property_alist (SCM alist);
133 Link_array<Grob> ly_scm2grobs (SCM l);
134 SCM ly_grobs2scm (Link_array<Grob> a);