*/
#include "align-interface.hh"
-#include "spanner.hh"
-#include "item.hh"
#include "axis-group-interface.hh"
-#include "pointer-group-interface.hh"
-#include "hara-kiri-group-spanner.hh"
#include "grob-array.hh"
+#include "hara-kiri-group-spanner.hh"
#include "international.hh"
+#include "item.hh"
+#include "paper-column.hh"
+#include "pointer-group-interface.hh"
+#include "spanner.hh"
+#include "skyline-pair.hh"
#include "system.hh"
#include "warn.hh"
-#include "paper-column.hh"
/*
TODO: for vertical spacing, should also include a rod & spring
#include "paper-column.hh"
#include "paper-score.hh"
#include "separation-item.hh"
+#include "skyline-pair.hh"
#include "stencil.hh"
#include "system.hh"
#include "warn.hh"
class Simultaneous_music_iterator;
class Skyline;
class Skyline_entry;
+class Skyline_pair;
class Slur_configuration;
class Slur_score_state;
class Source_file;
formatted content of the grob is put into a
Property_object. Page-breaking handles Property_object objects.
*/
+
class Prob
{
DECLARE_SMOBS (Prob);
void instrumented_set_property (SCM, SCM, const char*, int, const char*);
void internal_set_property (SCM sym, SCM val);
};
+
DECLARE_UNSMOB(Prob,prob);
+
SCM ly_prob_set_property_x (SCM system, SCM sym, SCM value);
SCM ly_prob_property (SCM system, SCM sym, SCM dfault);
+SCM ly_prob_type_p (SCM obj, SCM sym);
+
#endif /* PROPERTY_OBJECT_HH */
--- /dev/null
+/*
+ skyline-pair.hh -- declare Skyline_pair
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#ifndef SKYLINE_PAIR_HH
+#define SKYLINE_PAIR_HH
+
+#include "skyline.hh"
+
+class Skyline_pair
+{
+private:
+ Drul_array<Skyline> skylines_;
+
+ DECLARE_SIMPLE_SMOBS(Skyline_pair);
+public:
+ Skyline_pair ();
+ Skyline_pair (vector<Box> const &boxes, Real horizon_padding, Axis a);
+ Skyline_pair (Box const &, Real horizon_padding, Axis a);
+ void raise (Real);
+ void shift (Real);
+ void insert (Box const &, Real horizon_padding, Axis);
+ void merge (Skyline_pair const &other);
+ Skyline &operator [] (Direction d);
+ Skyline const &operator [] (Direction d) const;
+ bool is_empty () const;
+ void print () const;
+};
+
+#endif /* SKYLINE_PAIR_HH */
bool is_empty () const;
};
-class Skyline_pair
-{
-private:
- Drul_array<Skyline> skylines_;
-
- DECLARE_SIMPLE_SMOBS(Skyline_pair);
-public:
- Skyline_pair ();
- Skyline_pair (vector<Box> const &boxes, Real horizon_padding, Axis a);
- Skyline_pair (Box const &, Real horizon_padding, Axis a);
- void raise (Real);
- void shift (Real);
- void insert (Box const &, Real horizon_padding, Axis);
- void merge (Skyline_pair const &other);
- Skyline &operator [] (Direction d);
- Skyline const &operator [] (Direction d) const;
- bool is_empty () const;
-};
-
#endif /* SKYLINE_HH */
#include "paper-column.hh"
-#include "break-align-interface.hh"
-#include "moment.hh"
-#include "paper-score.hh"
-#include "warn.hh"
#include "axis-group-interface.hh"
-#include "spaceable-grob.hh"
-#include "text-interface.hh"
-#include "lookup.hh"
+#include "break-align-interface.hh"
#include "font-interface.hh"
-#include "output-def.hh"
-#include "pointer-group-interface.hh"
#include "grob-array.hh"
-#include "system.hh"
-#include "spring.hh"
#include "lookup.hh"
+#include "lookup.hh"
+#include "moment.hh"
+#include "output-def.hh"
+#include "paper-score.hh"
+#include "pointer-group-interface.hh"
#include "separation-item.hh"
+#include "skyline-pair.hh"
+#include "spaceable-grob.hh"
+#include "spring.hh"
#include "string-convert.hh"
+#include "system.hh"
+#include "text-interface.hh"
+#include "warn.hh"
Grob *
Paper_column::clone () const
--- /dev/null
+/*
+ paper-system-scheme.cc -- implement Paper_system bindings.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#include "prob.hh"
+
+#include "skyline-pair.hh"
+
+LY_DEFINE (ly_paper_system_p, "ly:paper-system?",
+ 1, 0, 0, (SCM obj),
+ "Type predicate.")
+{
+ return ly_prob_type_p (obj, ly_symbol2scm ("paper-system"));
+}
+
+LY_DEFINE (ly_paper_system_minimum_distance, "ly:paper-system-minimum-distance",
+ 2, 0, 0, (SCM sys1, SCM sys2),
+ "Measure the minimum distance between these two paper-systems,"
+ " using their stored skylines if possible and falling back to"
+ " their extents otherwise.")
+{
+ Real ret = 0;
+ Prob *p1 = unsmob_prob (sys1);
+ Prob *p2 = unsmob_prob (sys2);
+ Skyline_pair *sky1 = Skyline_pair::unsmob (p1->get_property ("vertical-skylines"));
+ Skyline_pair *sky2 = Skyline_pair::unsmob (p2->get_property ("vertical-skylines"));
+
+ if (sky1 && sky2)
+ ret = (*sky1)[DOWN].distance ((*sky2)[UP]);
+ else
+ {
+ Stencil *s1 = unsmob_stencil (p1->get_property ("stencil"));
+ Stencil *s2 = unsmob_stencil (p2->get_property ("stencil"));
+ Interval iv1 = s1->extent (Y_AXIS);
+ Interval iv2 = s2->extent (Y_AXIS);
+ ret = iv2[UP] - iv1[DOWN];
+ }
+ return scm_from_double (ret);
+}
*/
#include "prob.hh"
-#include "skyline.hh"
LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
2, 1, 0, (SCM obj, SCM sym, SCM value),
return pr->unprotect ();
}
-
-
-LY_DEFINE (ly_paper_system_p, "ly:paper-system?",
- 1, 0, 0, (SCM obj),
- "Type predicate.")
-{
- return ly_prob_type_p (obj, ly_symbol2scm ("paper-system"));
-}
-
-LY_DEFINE (ly_paper_system_minimum_distance, "ly:paper-system-minimum-distance",
- 2, 0, 0, (SCM sys1, SCM sys2),
- "Measure the minimum distance between these two paper-systems,"
- " using their stored skylines if possible and falling back to"
- " their extents otherwise.")
-{
- Real ret = 0;
- Prob *p1 = unsmob_prob (sys1);
- Prob *p2 = unsmob_prob (sys2);
- Skyline_pair *sky1 = Skyline_pair::unsmob (p1->get_property ("vertical-skylines"));
- Skyline_pair *sky2 = Skyline_pair::unsmob (p2->get_property ("vertical-skylines"));
-
- if (sky1 && sky2)
- ret = (*sky1)[DOWN].distance ((*sky2)[UP]);
- else
- {
- Stencil *s1 = unsmob_stencil (p1->get_property ("stencil"));
- Stencil *s2 = unsmob_stencil (p2->get_property ("stencil"));
- Interval iv1 = s1->extent (Y_AXIS);
- Interval iv2 = s2->extent (Y_AXIS);
- ret = iv2[UP] - iv1[DOWN];
- }
- return scm_from_double (ret);
-}
#include "separation-item.hh"
+#include "accidental-placement.hh"
#include "axis-group-interface.hh"
#include "lookup.hh"
#include "note-head.hh"
-#include "stencil.hh"
-#include "skyline.hh"
#include "paper-column.hh"
-#include "warn.hh"
#include "pointer-group-interface.hh"
-#include "accidental-placement.hh"
+#include "skyline-pair.hh"
+#include "stencil.hh"
+#include "warn.hh"
void
Separation_item::add_item (Grob *s, Item *i)
--- /dev/null
+/*
+ skyline-pair.cc -- implement Skyline_pair
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#include "skyline-pair.hh"
+
+#include "ly-smobs.icc"
+
+Skyline_pair::Skyline_pair ()
+ : skylines_ (Skyline (DOWN), Skyline (UP))
+{
+}
+
+Skyline_pair::Skyline_pair (vector<Box> const &boxes, Real padding, Axis a)
+ : skylines_ (Skyline (boxes, padding, a, DOWN), Skyline (boxes, padding, a, UP))
+{
+}
+
+Skyline_pair::Skyline_pair (Box const &b, Real padding, Axis a)
+ : skylines_ (Skyline (b, padding, a, DOWN), Skyline (b, padding, a, UP))
+{
+}
+
+void
+Skyline_pair::raise (Real r)
+{
+ skylines_[UP].raise (r);
+ skylines_[DOWN].raise (r);
+}
+
+void
+Skyline_pair::shift (Real r)
+{
+ skylines_[UP].shift (r);
+ skylines_[DOWN].shift (r);
+}
+
+void
+Skyline_pair::insert (Box const &b, Real padding, Axis a)
+{
+ skylines_[UP].insert (b, padding, a);
+ skylines_[DOWN].insert (b, padding, a);
+}
+
+void
+Skyline_pair::merge (Skyline_pair const &other)
+{
+ skylines_[UP].merge (other[UP]);
+ skylines_[DOWN].merge (other[DOWN]);
+}
+
+
+bool
+Skyline_pair::is_empty () const
+{
+ return skylines_[UP].is_empty ()
+ && skylines_[DOWN].is_empty ();
+}
+
+Skyline&
+Skyline_pair::operator [] (Direction d)
+{
+ return skylines_[d];
+}
+
+Skyline const&
+Skyline_pair::operator [] (Direction d) const
+{
+ return skylines_[d];
+}
+
+IMPLEMENT_SIMPLE_SMOBS (Skyline_pair);
+IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?");
+IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair);
+
+
+
+SCM
+Skyline_pair::mark_smob (SCM)
+{
+ return SCM_EOL;
+}
+
+int
+Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *)
+{
+ Skyline_pair *r = (Skyline_pair *) SCM_CELL_WORD_1 (s);
+ (void) r;
+
+ scm_puts ("#<Skyline-pair>", port);
+ return 1;
+}
return b.end_ == infinity_f && b.y_intercept_ == -infinity_f;
}
-Skyline_pair::Skyline_pair ()
- : skylines_ (Skyline (DOWN), Skyline (UP))
-{
-}
-
-Skyline_pair::Skyline_pair (vector<Box> const &boxes, Real padding, Axis a)
- : skylines_ (Skyline (boxes, padding, a, DOWN), Skyline (boxes, padding, a, UP))
-{
-}
-
-Skyline_pair::Skyline_pair (Box const &b, Real padding, Axis a)
- : skylines_ (Skyline (b, padding, a, DOWN), Skyline (b, padding, a, UP))
-{
-}
-
-void
-Skyline_pair::raise (Real r)
-{
- skylines_[UP].raise (r);
- skylines_[DOWN].raise (r);
-}
-
-void
-Skyline_pair::shift (Real r)
-{
- skylines_[UP].shift (r);
- skylines_[DOWN].shift (r);
-}
-
-void
-Skyline_pair::insert (Box const &b, Real padding, Axis a)
-{
- skylines_[UP].insert (b, padding, a);
- skylines_[DOWN].insert (b, padding, a);
-}
-
-void
-Skyline_pair::merge (Skyline_pair const &other)
-{
- skylines_[UP].merge (other[UP]);
- skylines_[DOWN].merge (other[DOWN]);
-}
-
-bool
-Skyline_pair::is_empty () const
-{
- return skylines_[UP].is_empty ()
- && skylines_[DOWN].is_empty ();
-}
-
-Skyline&
-Skyline_pair::operator [] (Direction d)
-{
- return skylines_[d];
-}
-
-Skyline const&
-Skyline_pair::operator [] (Direction d) const
-{
- return skylines_[d];
-}
/****************************************************************/
IMPLEMENT_TYPE_P (Skyline, "ly:skyline?");
IMPLEMENT_DEFAULT_EQUAL_P (Skyline);
-IMPLEMENT_SIMPLE_SMOBS (Skyline_pair);
-IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?");
-IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair);
-
SCM
Skyline::mark_smob (SCM)
{
return 1;
}
-
-SCM
-Skyline_pair::mark_smob (SCM)
-{
- return SCM_EOL;
-}
-
-int
-Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *)
-{
- Skyline_pair *r = (Skyline_pair *) SCM_CELL_WORD_1 (s);
- (void) r;
-
- scm_puts ("#<Skyline-pair>", port);
- return 1;
-}
#include "paper-column.hh"
#include "separation-item.hh"
#include "skyline.hh"
+#include "skyline-pair.hh"
#include "system.hh"
/* return the right-pointing skyline of the left-items and the left-pointing
#include "paper-score.hh"
#include "pointer-group-interface.hh"
#include "separation-item.hh"
+#include "skyline-pair.hh"
#include "spaceable-grob.hh"
#include "spacing-interface.hh"
#include "staff-spacing.hh"
#include "axis-group-interface.hh"
#include "grob-array.hh"
#include "international.hh"
+#include "lookup.hh"
#include "main.hh"
#include "output-def.hh"
#include "paper-column.hh"
#include "paper-score.hh"
#include "paper-system.hh"
#include "pointer-group-interface.hh"
+#include "skyline-pair.hh"
#include "staff-symbol-referencer.hh"
#include "warn.hh"
-#include "lookup.hh"
extern bool debug_skylines;