]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.7
authorfred <fred>
Sun, 24 Mar 2002 19:53:29 +0000 (19:53 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:53:29 +0000 (19:53 +0000)
lily/include/axis-group.hh [new file with mode: 0644]
lily/include/elem-group.hh

diff --git a/lily/include/axis-group.hh b/lily/include/axis-group.hh
new file mode 100644 (file)
index 0000000..bdf758c
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+axis-group.hh -- declare Axis_group_administration, Axis_group_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Axis_group_administration_HH
+#define Axis_group_administration_HH
+
+#include "parray.hh"
+#include "axes.hh"
+#include "real.hh"
+#include "lily-proto.hh"
+#include "score-elem.hh"
+/**
+  Do the dirty work for Axis_group_element.
+ */
+struct Axis_group_administration {
+    Link_array<Score_elem> elem_l_arr_;
+    
+    Interval extent(Axis)const;
+    void print() const ;
+    Axis_group_administration(Axis_group_administration const&);
+    Axis_group_administration(){}
+    void remove_all(Axis a1,Axis a2);
+    
+    bool contains_b(Score_elem const *)const;
+    void add_element(Score_elem*, Axis_group_element*, Axis a1, Axis a2);
+    void remove_element(Score_elem*, Axis a1, Axis a2);
+};
+
+/** 
+  Treat a group of elements a unity in either or both axis sense .
+  This is a wrapper around Axis_group_administration
+  */
+class Axis_group_element : public virtual Score_elem {
+protected:
+    Axis_group_administration axis_admin_;
+    virtual void do_print()const;
+    virtual Link_array<Score_elem> get_extra_dependencies()const;
+    virtual void do_unlink();
+
+public:
+    virtual void remove_all()=0;
+    virtual void add_element(Score_elem*)=0;
+    virtual void remove_element(Score_elem*)=0;
+    virtual bool contains_b(Score_elem const *)const;
+    DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // Axis_group_administration_HH
index 9569dcd90cee3e08161bdb0499c385d524acb2fd..baf3010c09b2c41a1a044a44e05f1dc105dcc28f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  elem-group.hh -- declare Horizontal_vertical_group
+  elem-group.hh -- declare Horizontal_vertical_group_element
 
   source file of the GNU LilyPond music typesetter
 
 #define ELEM_GROUP_HH
 
 #include "score-elem.hh"
+#include "axis-group.hh"
 
-class Elbement_group: public virtual Score_elem {
+
+
+/**
+  Treat a group of elements a unity in horizontal sense .
+  A column is a typical Vertical_group.
+ */
+class Horizontal_group_element : public virtual Axis_group_element {
 protected:
-    Link_array<Score_elem> elem_l_arr_;
-    
-    virtual void do_print() const ;
-public:
-    Elbement_group(Elbement_group const&);
-    Elbement_group();
-    bool contains_b(Score_elem const *)const;
-    void add_element(Score_elem*);
-    DECLARE_MY_RUNTIME_TYPEINFO;
-};
+    virtual void remove_all();
+    virtual Interval do_width()const;
 
-class Horizontal_group : public Elbement_group {
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
-    Horizontal_group(){}
-    void add_element(Score_elem*);
-    Horizontal_group(Horizontal_group const&);
-    void remove_element(Score_elem*);
+    virtual void add_element(Score_elem*);
+    virtual void remove_element(Score_elem*);
 
-protected:
-    virtual Horizontal_group * horizontal_group() { return this; }
-    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
-    virtual void do_print() const ;
-    virtual void translate_x(Real);
-    virtual Interval do_width()const;
 };
-
-class Vertical_group : public Elbement_group {
+/**
+  Like Horizontal_group_element, but in X direction
+ */
+class Vertical_group_element : public virtual Axis_group_element {
 protected:
-    virtual void translate_y(Real);
-    virtual void do_print() const ;
     virtual Interval do_height()const;
-    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
-    virtual Vertical_group * vertical_group() { return this; }
+    virtual void remove_all();
+
 public:
-    void add_element(Score_elem*);
-    void remove_element(Score_elem*);
-    
-    Vertical_group(Vertical_group const &);
-    Vertical_group(){}
+    virtual void add_element(Score_elem*);
+    virtual void remove_element(Score_elem*);
     DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
@@ -61,18 +48,16 @@ public:
   dimensions are the unions of the dimensions of what it contains.
   Translation means translating the contents.
   */
-class Horizontal_vertical_group : public Vertical_group
-                                 public Horizontal_group 
+class Horizontal_vertical_group_element : public Vertical_group_element
+                                 public Horizontal_group_element 
 {  
 protected:
-    virtual Horizontal_vertical_group* elem_group() { return this; }
+    virtual void remove_all();
 public:
-    Horizontal_vertical_group();
-    bool contains_b(Score_elem const *)const;
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
-    virtual void do_print() const;
-    void add_element(Score_elem*);
+    virtual void add_element(Score_elem*);
+    virtual void remove_element(Score_elem*);
+    
+    DECLARE_MY_RUNTIME_TYPEINFO;    
 };
 
 #endif // ELEM_GROUP_HH