]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.1
authorfred <fred>
Mon, 4 Aug 1997 23:43:19 +0000 (23:43 +0000)
committerfred <fred>
Mon, 4 Aug 1997 23:43:19 +0000 (23:43 +0000)
lily/horizontal-group-item.cc [new file with mode: 0644]
lily/include/horizontal-group-item.hh [new file with mode: 0644]

diff --git a/lily/horizontal-group-item.cc b/lily/horizontal-group-item.cc
new file mode 100644 (file)
index 0000000..15af0bd
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+  horizontal-group-item.cc -- implement Horizontal_group_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "p-col.hh"
+#include "horizontal-group-item.hh"
+
+IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item);
+
+void
+Horizontal_group_item::OK() const
+{
+    for (int i=0; i < elem_l_arr_.size(); i++) {
+       Item * it_l = elem_l_arr_[i]->item();
+       
+       assert(it_l&& it_l->pcol_l_ == pcol_l_ );
+    }
+}
+
+void
+Horizontal_group_item::do_breakable_col_processing()
+{
+    if (!pcol_l_->breakable_b())
+       return;
+    OK();
+    copy_breakable_items();
+    
+    Link_array<Score_elem> elems = elem_l_arr_;
+
+    for (int i=0; i < elems.size(); i++) {
+       Item* it_l = elems[i]->item();
+       for ( int j=0; j < 2; j++) {
+           Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_);
+           ((Horizontal_group_item*)broken_to_a_[j])->add_element( new_l );
+       }
+    }
+}
diff --git a/lily/include/horizontal-group-item.hh b/lily/include/horizontal-group-item.hh
new file mode 100644 (file)
index 0000000..3495af9
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  horizontal-group-item.hh -- declare Horizontal_group_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef HORIZONTAL_GROUP_ITEM_HH
+#define HORIZONTAL_GROUP_ITEM_HH
+
+#include "elem-group.hh"
+#include "item.hh"
+
+class Horizontal_group_item : public Item, public Horizontal_group {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    SCORE_ELEM_CLONE(Horizontal_group_item);
+protected:
+    virtual void do_breakable_col_processing();
+    void OK()const;
+    virtual void do_print() const { Elbement_group::do_print(); }
+};
+
+#endif // HORIZONTAL_GROUP_ITEM_HH