]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/grob.hh
release: 1.5.19
[lilypond.git] / lily / include / grob.hh
index 86ef255b4f7cd93a7c8af6873890d844d8e36d8e..e9665ea31b6057f4b75d96cdc740ca0f290f4998 100644 (file)
@@ -1,7 +1,7 @@
 /*
   grob.hh -- declare Grob
 
-  (c) 1996-1999--2000 Han-Wen Nienhuys
+  (c) 1996-1999--2001 Han-Wen Nienhuys
 */
 
 #ifndef STAFFELEM_HH
@@ -28,6 +28,10 @@ enum Grob_status {
 
 typedef void (Grob::*Grob_method_pointer) (void);
 
+
+#define get_grob_property(x) internal_get_grob_property(ly_symbol2scm(x))
+#define set_grob_property(x,y) internal_set_grob_property(ly_symbol2scm(x),y)
+
 /*
    Basic output object.
 */
@@ -46,7 +50,7 @@ public:
 
     0 means ORPHAN,
    */
-  char status_i_;
+  char status_c_;
   String name () const;
 
   /*
@@ -62,12 +66,14 @@ public:
   /*
     properties
    */
-  SCM get_grob_property (const char*) const;
-  SCM get_grob_property (SCM) const;
-  void set_grob_property (const char * , SCM val);
+  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);  
-  void set_grob_property (SCM , SCM val);  
+  void set_immutable_grob_property (SCM key, SCM val);
+#endif
+  
   void set_elt_pointer (const char*, SCM val);
   friend class Property_engraver; //  UGHUGHUGH.
   SCM remove_grob_property (const char* nm);
@@ -85,18 +91,18 @@ public:
   bool linked_b () const;
 
 
-  VIRTUAL_COPY_CONS(Grob);
+  VIRTUAL_COPY_CONS (Grob);
  
   /**
      Recursively track all dependencies of this Grob.  The
-     status_i_ field is used as a mark-field.  It is marked with
+     status_c_ field is used as a mark-field.  It is marked with
      #busy# during execution of this function, and marked with #final#
      when finished.
 
      #funcptr# is the function to call to update this element.
    */
   void calculate_dependencies (int final, int busy, SCM funcname);
-  static SCM handle_broken_smobs (SCM, SCM criterion);
+  static SCM handle_broken_grobs(SCM, SCM criterion);
 
   virtual void do_break_processing ();
   virtual Grob *find_broken_piece (Line_of_score*) const;
@@ -108,9 +114,9 @@ public:
   
   void suicide ();
   
-  DECLARE_SCHEME_CALLBACK(preset_extent, (SCM smob, SCM axis));
-  DECLARE_SCHEME_CALLBACK(point_dimension_callback, (SCM smob, SCM axis));
-  DECLARE_SCHEME_CALLBACK(molecule_extent, (SCM smob, SCM axis));
+  DECLARE_SCHEME_CALLBACK (preset_extent, (SCM smob, SCM axis));
+  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);
@@ -123,7 +129,7 @@ public:
   virtual void handle_prebroken_dependencies ();
 
 
-  DECLARE_SMOBS(Grob,foo);
+  DECLARE_SMOBS (Grob,foo);
 
   void init ();
 
@@ -170,11 +176,11 @@ public:
    */
   void set_parent (Grob* e, Axis);
   
-  Grob *parent_l (Axis a) const;
-  DECLARE_SCHEME_CALLBACK(fixup_refpoint, (SCM));
+  Grob *parent_l (Axis a) const {   return  dim_cache_[a].parent_l_; }
+  DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
 };
 
-Grob * unsmob_grob (SCM);
+DECLARE_UNSMOB(Grob,grob);
 
 #endif // STAFFELEM_HH