]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/score-element.hh
release: 1.1.35
[lilypond.git] / lily / include / score-element.hh
index 919333c9a6edd79b22e52db776cc9cd4c01b9913..eaaaf1482bb48a54f99e75bf3ccf7be15d7c07be 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  score-element.hh -- part of GNU LilyPond
+  score-element.hh -- declare Score_element
 
-  (c) 1996,97 Han-Wen Nienhuys
+  (c) 1996-1999 Han-Wen Nienhuys
 */
 
 #ifndef STAFFELEM_HH
@@ -11,7 +11,8 @@
 #include "virtual-methods.hh"
 #include "directed-graph.hh"
 #include "graphical-element.hh"
-
+#include "protected-scm.hh"
+#include "lily-guile.hh"
 
 
 typedef void (Score_element::*Score_element_method_pointer) (void);
@@ -23,70 +24,80 @@ typedef void (Score_element::*Score_element_method_pointer) (void);
   which are implemented in the Directed_graph_node class: all elements
   form an acyclic graph.
 
-  (elem) */
-class Score_element : private Directed_graph_node, public virtual Graphical_element {
+  (elem)
+
+
+Element Properties:
+
+Boolean (true iff defined)
+
+ break_helper_only -- if defined try to junk this after calcing breakpoints.
+
+ transparent -- do not calc. output
+
+*/
+class Score_element : public virtual Graphical_element {
+  Protected_scm element_property_alist_;
+  Link_array<Score_element> dependency_arr_;
+  Lookup * lookup_l_;
 public:
-  Paper_score *pscore_l_;    
+  Score_element *original_l_;
+
+  /**
+    Administration: Where are we?. This is mainly used by Super_element and
+    Score_element::calcalute_dependencies ()
+
+    0 means ORPHAN,
+    -1 means deleted
+    
+   */
+  int status_i_;
+
+  Paper_score *pscore_l_;
   Molecule * output_p_;
   Score_element ();
   Score_element (Score_element const&);
   virtual void print () const;
-    
-  Paper_def *paper () const;
+
+  /*
+    properties
+   */
+  SCM get_elt_property (SCM sym) const;
+  void set_elt_property (SCM sym, SCM val);
+  SCM remove_elt_property (SCM key);
+
+  /*
+    related classes.
+   */
+  Paper_def *paper_l () const;
   Lookup const *lookup_l () const;
 
   virtual ~Score_element ();
-      
-
   void add_processing ();
 
-  /**
-    Remove all  links (dependencies, dependents, Axis_group_elements.
-    */
-  void unlink ();
   void substitute_dependency (Score_element*,Score_element*);
   void remove_dependency (Score_element*);
   /**
     add a dependency. It may be the 0 pointer, in which case, it is ignored.
     */
   void add_dependency (Score_element*);    
-
   virtual Line_of_score * line_l () const;
-  virtual bool linked_b () const;
+  bool linked_b () const;
   VIRTUAL_COPY_CONS(Score_element);
  
-  /// do not print anything black
-  bool transparent_b_;
-
-  int size_i_;
-  
   // ugh: no protection. Denk na, Vrij Veilig
   void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
 
-protected:
-  /**
-    Administration: Where are we?. This is mainly used by Super_element and
-    Score_element::calcalute_dependencies ()
-
-    0 means ORPHAN,
-    -1 means deleted
-    
-   */
-public:
-  int status_i_;
 protected:
   Score_element* dependency (int) const;
-  Score_element* dependent (int) const;
-  int dependent_size () const;
   int dependency_size () const;
   
   virtual void output_processing ();
-  void junk_links ();
   virtual Interval do_height () const;
   virtual Interval do_width () const;
     
   /// do printing of derived info.
-  virtual void do_print () const {}
+  virtual void do_print () const;
   /// generate the molecule    
   virtual Molecule* do_brew_molecule_p () const;
   ///executed directly after the item is added to the Paper_score
@@ -101,16 +112,14 @@ protected:
   /// do calculations after determining horizontal spacing
   virtual void do_post_processing ();
     
-  virtual void do_substitute_dependency (Score_element * , Score_element *);
-  virtual void do_substitute_dependent (Score_element *, Score_element *);
+  virtual void do_substitute_element_pointer (Score_element * , Score_element *);
   virtual void do_break_processing ();
   virtual void handle_broken_dependencies ();
   virtual void handle_prebroken_dependencies ();
   virtual void handle_prebroken_dependents ();
   virtual Link_array<Score_element> get_extra_dependencies () const;
-  virtual void do_unlink ();
-  virtual void do_junk_links ();
-  
+
+  static Interval dim_cache_callback (Dimension_cache*);
 };