]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/grob.hh
''
[lilypond.git] / lily / include / grob.hh
index aa0d1e13ceae3868e43cd546a0f0b18f81095602..8e8cde5890d8b73d295224b45348b9524c57cd74 100644 (file)
@@ -1,7 +1,7 @@
 /*
   grob.hh -- declare Grob
 
-  (c) 1996-1999--2001 Han-Wen Nienhuys
+  (c) 1996-1999--2002 Han-Wen Nienhuys
 */
 
 #ifndef STAFFELEM_HH
@@ -13,6 +13,7 @@
 #include "lily-proto.hh"
 #include "smobs.hh"
 #include "dimension-cache.hh"
+#include "grob-interface.hh"
 
 /**
     for administration of what was done already
@@ -38,8 +39,6 @@ typedef void (Grob::*Grob_method_pointer) (void);
 class Grob  {
 public:
   SCM immutable_property_alist_;
-
-  // rename me to ``property_alist_''
   SCM mutable_property_alist_;
   
   Grob *original_l_;
@@ -51,7 +50,7 @@ public:
     0 means ORPHAN,
    */
   char status_c_;
-  String name () const;
+
 
   /*
     IDEA: make this a global variable. This is the same for all
@@ -59,20 +58,20 @@ public:
     scores being formatted multithreadedly.
    */
   Paper_score *pscore_l_;
+  Dimension_cache dim_cache_[NO_AXES];
 
   Grob (SCM basic_props);
   Grob (Grob const&);
-
+  String name () const;
+  
   /*
     properties
    */
   SCM internal_get_grob_property (SCM) const;
   void internal_set_grob_property (SCM, SCM val);
   
-#if 0
-  void set_immutable_grob_property (const char * , SCM val);
-  void set_immutable_grob_property (SCM key, SCM val);
-#endif
+  void warning (String)const;
+  void programming_error (String)const;
   
   void set_elt_pointer (const char*, SCM val);
   friend class Property_engraver; //  UGHUGHUGH.
@@ -87,7 +86,7 @@ public:
     add a dependency. It may be the 0 pointer, in which case, it is ignored.
     */
   void add_dependency (Grob*);    
-  virtual Line_of_score * line_l () const;
+  virtual System * line_l () const;
   bool linked_b () const;
 
 
@@ -102,10 +101,10 @@ public:
      #funcptr# is the function to call to update this element.
    */
   void calculate_dependencies (int final, int busy, SCM funcname);
-  static SCM handle_broken_grobs(SCM, SCM criterion);
+
 
   virtual void do_break_processing ();
-  virtual Grob *find_broken_piece (Line_of_score*) const;
+  virtual Grob *find_broken_piece (System*) const;
   virtual void discretionary_processing ();
   virtual SCM do_derived_mark ();
 
@@ -118,62 +117,35 @@ public:
   DECLARE_SCHEME_CALLBACK (point_dimension_callback, (SCM smob, SCM axis));
   DECLARE_SCHEME_CALLBACK (molecule_extent, (SCM smob, SCM axis));
 
-
   static SCM ly_set_grob_property (SCM, SCM,SCM);
   static SCM ly_get_grob_property (SCM, SCM);  
 
-  bool has_interface (SCM intf);
-  void set_interface (SCM intf);
+  bool internal_has_interface (SCM intf);
+  static bool has_interface (Grob*me);  
 
   virtual void handle_broken_dependencies ();
   virtual void handle_prebroken_dependencies ();
 
-
   DECLARE_SMOBS (Grob,foo);
 
   void init ();
-
-  Dimension_cache dim_cache_[NO_AXES];
-
 public:
   bool empty_b (Axis a) const;
 
   Interval extent (Grob * refpoint, Axis) const;
  
-  /**
-    translate in one direction
-    */
-    
   void translate_axis (Real, Axis);
-
-  /**
-     Find the offset relative to D.  If   D equals THIS, then it is 0.
-     Otherwise, it recursively defd as
-
-     OFFSET_ + PARENT_L_->relative_coordinate (D)
-   */
   Real relative_coordinate (Grob const* refp, Axis) const;
-  /**
-    Find the group-element which has both #this# and #s#
-   */
   Grob*common_refpoint (Grob const* s, Axis a) const;
-  Grob*common_refpoint (SCM elt_list, Axis a) const;
+
 
   // duh. slim down interface here. (todo)
   bool has_offset_callback_b (SCM callback, Axis)const;
   void add_offset_callback (SCM callback, Axis);
   bool has_extent_callback_b (SCM, Axis)const;  
-  void set_extent_callback (SCM , Axis);
-  bool has_extent_callback_b (Axis) const;
-
-  
-  /**
-    Invoke callbacks to get offset relative to parent.
-   */
+  void set_extent (SCM , Axis);
   Real get_offset (Axis a) const;
-  /**
-     Set the  parent refpoint of THIS to E
-   */
+  
   void set_parent (Grob* e, Axis);
   
   Grob *get_parent (Axis a) const {   return  dim_cache_[a].parent_l_; }
@@ -184,6 +156,11 @@ DECLARE_UNSMOB(Grob,grob);
 Spanner* unsmob_spanner (SCM );
 Item* unsmob_item (SCM );
 
+Grob*common_refpoint_of_list (SCM elt_list, Grob * , Axis a);
+Grob*common_refpoint_of_array (Link_array<Grob> const&, Grob * , Axis a);
+
+void set_break_subsititution (SCM criterion);
+SCM do_break_substitution (SCM);
 
 #endif // STAFFELEM_HH