summaryrefslogtreecommitdiff
path: root/lily/include
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>2000-05-29 00:12:41 +0200
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2000-05-29 00:12:41 +0200
commitb0064942493df77833e6e41e05d362850f4874b0 (patch)
treebcd020c0471124a678c62791188f9aa072beacb4 /lily/include
parent910faf0de802844cdafde781ce42af71986297bc (diff)
release: 1.3.56
=========== * Molecules are now generated via callbacks exclusively; most calls to set_elt_property ("transparent) have been replaced by suicide(). 1.3.54.h
Diffstat (limited to 'lily/include')
-rw-r--r--lily/include/bar.hh2
-rw-r--r--lily/include/beam.hh2
-rw-r--r--lily/include/breathing-sign.hh4
-rw-r--r--lily/include/chord-name.hh4
-rw-r--r--lily/include/crescendo.hh4
-rw-r--r--lily/include/dots.hh2
-rw-r--r--lily/include/extender-engraver.hh50
-rw-r--r--lily/include/extender-spanner.hh6
-rw-r--r--lily/include/hyphen-engraver.hh1
-rw-r--r--lily/include/hyphen-spanner.hh2
-rw-r--r--lily/include/key-item.hh2
-rw-r--r--lily/include/local-key-item.hh4
-rw-r--r--lily/include/molecule.hh5
-rw-r--r--lily/include/multi-measure-rest.hh2
-rw-r--r--lily/include/note-head.hh2
-rw-r--r--lily/include/rest.hh4
-rw-r--r--lily/include/score-element.hh26
-rw-r--r--lily/include/script.hh2
-rw-r--r--lily/include/slur.hh2
-rw-r--r--lily/include/spanner.hh1
-rw-r--r--lily/include/staff-symbol.hh2
-rw-r--r--lily/include/stem-tremolo.hh4
-rw-r--r--lily/include/stem.hh6
-rw-r--r--lily/include/sustain-pedal.hh4
-rw-r--r--lily/include/system-start-delimiter.hh4
-rw-r--r--lily/include/text-item.hh4
-rw-r--r--lily/include/tie.hh2
-rw-r--r--lily/include/time-signature.hh2
-rw-r--r--lily/include/tuplet-spanner.hh4
-rw-r--r--lily/include/volta-spanner.hh2
30 files changed, 89 insertions, 72 deletions
diff --git a/lily/include/bar.hh b/lily/include/bar.hh
index f770c3aac2..6673cea6f9 100644
--- a/lily/include/bar.hh
+++ b/lily/include/bar.hh
@@ -18,6 +18,8 @@ public:
Molecule compound_barline (String, Real height) const;
Molecule simple_barline (Real wid, Real height) const;
+ static SCM scheme_molecule (SCM);
+
protected:
virtual void before_line_breaking ();
diff --git a/lily/include/beam.hh b/lily/include/beam.hh
index 27a19a1769..99eac088af 100644
--- a/lily/include/beam.hh
+++ b/lily/include/beam.hh
@@ -26,6 +26,8 @@
class Beam : public Spanner
{
public:
+ static SCM scheme_molecule (SCM);
+
int stem_count () const;
Stem* stem (int) const;
diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh
index fb212868b5..a2b0181d2b 100644
--- a/lily/include/breathing-sign.hh
+++ b/lily/include/breathing-sign.hh
@@ -20,6 +20,8 @@
class Breathing_sign : public Item
{
public:
+ static SCM scheme_molecule (SCM);
+
VIRTUAL_COPY_CONS(Score_element);
Breathing_sign (SCM s);
protected:
@@ -27,6 +29,4 @@ protected:
virtual Molecule do_brew_molecule () const;
};
-
-
#endif // BREATHING_SIGN_HH
diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh
index 2f77bb4b1d..f2c930c031 100644
--- a/lily/include/chord-name.hh
+++ b/lily/include/chord-name.hh
@@ -22,7 +22,9 @@
class Chord_name : public Item
{
public:
- VIRTUAL_COPY_CONS (Score_element);
+ static SCM scheme_molecule (SCM);
+
+VIRTUAL_COPY_CONS (Score_element);
Molecule ly_word2molecule (SCM scm) const;
Molecule ly_text2molecule (SCM scm) const;
Chord_name(SCM s);
diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh
index b5a46c8433..e43f005e61 100644
--- a/lily/include/crescendo.hh
+++ b/lily/include/crescendo.hh
@@ -18,7 +18,9 @@
*/
class Crescendo : public Spanner {
public:
- Crescendo(SCM);
+ static SCM scheme_molecule (SCM);
+
+Crescendo(SCM);
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule do_brew_molecule() const;
diff --git a/lily/include/dots.hh b/lily/include/dots.hh
index e1bf806390..8f33241c68 100644
--- a/lily/include/dots.hh
+++ b/lily/include/dots.hh
@@ -29,7 +29,9 @@ protected:
virtual Molecule do_brew_molecule () const;
virtual void after_line_breaking ();
public:
+ static SCM scheme_molecule (SCM);
+
Dots (SCM);
};
diff --git a/lily/include/extender-engraver.hh b/lily/include/extender-engraver.hh
deleted file mode 100644
index 9973f41d31..0000000000
--- a/lily/include/extender-engraver.hh
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- extender-engraver.hh -- declare Extender_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999 Glen Prideaux <glenprideaux@iname.com>,
- Han-Wen Nienhuys, Jan Nieuwenhuizen.
-*/
-
-#ifndef EXTENDER_ENGRAVER_HH
-#define EXTENDER_ENGRAVER_HH
-
-#include "engraver.hh"
-#include "drul-array.hh"
-#include "extender-spanner.hh"
-#include "pqueue.hh"
-#include "extender-engraver.hh"
-
-
-/**
- Generate an centred extender. Should make a Extender_spanner that
- typesets a nice centred extender of varying length depending on the
- gap between syllables.
-
- We remember the last Text_item that come across. When we get a
- request, we create the spanner, and attach the left point to the
- last lyrics, and the right point to any lyrics we receive by
- then. */
-class Extender_engraver : public Engraver
-{
- Text_item * last_lyric_l_;
- Text_item * current_lyric_l_;
- Extender_req* req_l_;
- Extender_spanner* extender_spanner_p_;
-public:
- Extender_engraver ();
- VIRTUAL_COPY_CONS (Translator);
-
-protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void do_removal_processing();
- virtual void do_process_music();
- virtual bool do_try_music (Music*);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing ();
-private:
-
-};
-
-#endif // EXTENDER_ENGRAVER_HH
diff --git a/lily/include/extender-spanner.hh b/lily/include/extender-spanner.hh
index 862318e7ea..b921217dbe 100644
--- a/lily/include/extender-spanner.hh
+++ b/lily/include/extender-spanner.hh
@@ -27,11 +27,13 @@
extend beond, lasting the whole duration of the melissima
(as in MUP, urg).
*/
-class Extender_spanner : public Spanner
+class Lyric_extender : public Spanner
{
public:
- Extender_spanner (SCM);
+ Lyric_extender (SCM);
void set_textitem (Direction, Item*);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual Molecule do_brew_molecule () const;
diff --git a/lily/include/hyphen-engraver.hh b/lily/include/hyphen-engraver.hh
index 4db4d25bff..160b9e2673 100644
--- a/lily/include/hyphen-engraver.hh
+++ b/lily/include/hyphen-engraver.hh
@@ -13,7 +13,6 @@
#include "drul-array.hh"
#include "hyphen-spanner.hh"
#include "pqueue.hh"
-#include "extender-engraver.hh"
/**
diff --git a/lily/include/hyphen-spanner.hh b/lily/include/hyphen-spanner.hh
index 24c1ab7299..1270bce805 100644
--- a/lily/include/hyphen-spanner.hh
+++ b/lily/include/hyphen-spanner.hh
@@ -23,6 +23,8 @@ class Hyphen_spanner : public Spanner
public:
Hyphen_spanner (SCM);
void set_textitem (Direction, Item*);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual Molecule do_brew_molecule () const;
diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh
index b8430c4272..2c7f396ab4 100644
--- a/lily/include/key-item.hh
+++ b/lily/include/key-item.hh
@@ -31,6 +31,8 @@ public:
Key_item (SCM);
void add (int pitch, int acc);
void add_old (int pitch, int acc);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual Molecule do_brew_molecule() const;
diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh
index db072f0dfe..ca368dc30a 100644
--- a/lily/include/local-key-item.hh
+++ b/lily/include/local-key-item.hh
@@ -41,7 +41,9 @@ class Local_key_item : public Item
Molecule accidental (int,bool,bool) const;
public:
Local_key_item (SCM );
- void add_pitch (Musical_pitch, bool cautionary, bool natural);
+ static SCM scheme_molecule (SCM);
+
+void add_pitch (Musical_pitch, bool cautionary, bool natural);
protected:
virtual void before_line_breaking ();
virtual Molecule do_brew_molecule() const;
diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh
index d9cd2bb11a..b8153c72a0 100644
--- a/lily/include/molecule.hh
+++ b/lily/include/molecule.hh
@@ -71,11 +71,16 @@ public:
void translate_axis (Real,Axis);
Interval extent (Axis) const;
+ /**
+ codify THIS into a Scheme expression.
+ */
+ SCM create_scheme () const;
bool empty_b() const;
};
SCM fontify_atom (Font_metric*, SCM atom);
+Molecule create_molecule (SCM scheme_molecule);
diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh
index 0258c9a7ee..eba41029b2 100644
--- a/lily/include/multi-measure-rest.hh
+++ b/lily/include/multi-measure-rest.hh
@@ -17,6 +17,8 @@ class Multi_measure_rest : public Spanner
{
public:
Multi_measure_rest (SCM);
+ static SCM scheme_molecule (SCM);
+
void add_column (Item*);
Molecule compound_rest (int)const;
diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh
index 85442c0b00..0ce36022fc 100644
--- a/lily/include/note-head.hh
+++ b/lily/include/note-head.hh
@@ -23,6 +23,8 @@ class Note_head : public Rhythmic_head
{
public:
static int compare (Note_head * const &a, Note_head *const &b) ;
+ static SCM scheme_molecule (SCM);
+
Molecule ledger_line (Interval) const;
Note_head (SCM);
diff --git a/lily/include/rest.hh b/lily/include/rest.hh
index cb62ce3883..0b0ebef383 100644
--- a/lily/include/rest.hh
+++ b/lily/include/rest.hh
@@ -25,6 +25,8 @@ protected:
virtual void after_line_breaking ();
virtual Molecule do_brew_molecule () const;
public:
- Rest (SCM s);
+ static SCM scheme_molecule (SCM);
+
+Rest (SCM s);
};
#endif // REST_HH
diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh
index 16a0d8b39a..276fe75e3e 100644
--- a/lily/include/score-element.hh
+++ b/lily/include/score-element.hh
@@ -162,7 +162,7 @@ public:
/// generate rods & springs
virtual void do_space_processing ();
virtual void discretionary_processing ();
-
+ virtual void do_derived_mark ();
/// do calculations before determining horizontal spacing
virtual void before_line_breaking ();
/// do calculations after determining horizontal spacing
@@ -182,17 +182,16 @@ protected:
be handled by GUILE gc. */
virtual ~Score_element ();
- /// generate the molecule
- virtual Molecule do_brew_molecule () const;
///executed directly after the item is added to the Paper_score
virtual void do_add_processing ();
-
+ virtual Molecule do_brew_molecule ()const;
+
static Interval dim_cache_callback (Dimension_cache const*);
public:
static SCM ly_set_elt_property (SCM, SCM,SCM);
static SCM ly_get_elt_property (SCM, SCM);
-
+ static SCM scheme_molecule (SCM);
virtual void handle_broken_dependencies ();
virtual void handle_prebroken_dependencies ();
@@ -246,6 +245,23 @@ public:
Score_element * unsmob_element (SCM);
+#define MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(TYPE) \
+SCM \
+TYPE::scheme_molecule (SCM smob) \
+{ \
+ TYPE * b = dynamic_cast<TYPE*> (unsmob_element (smob)); \
+ return b ? b->do_brew_molecule ().create_scheme () : SCM_EOL; \
+} \
+ \
+void \
+TYPE ## __init_functions () \
+{ \
+ scm_make_gsubr (#TYPE "::scheme_molecule", 1, 0, 0, \
+ (SCM(*)(...))TYPE::scheme_molecule); \
+} \
+ \
+ADD_SCM_INIT_FUNC(TYPE ## _molecule, TYPE ## __init_functions); \
+
#endif // STAFFELEM_HH
diff --git a/lily/include/script.hh b/lily/include/script.hh
index 4d8441584d..0204e81112 100644
--- a/lily/include/script.hh
+++ b/lily/include/script.hh
@@ -23,7 +23,9 @@ class Script : public Item
Molecule get_molecule (Direction d) const;
public:
Script (SCM);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual void before_line_breaking ();
virtual void after_line_breaking ();
diff --git a/lily/include/slur.hh b/lily/include/slur.hh
index 3ab1dff6bd..a44f1f4bd4 100644
--- a/lily/include/slur.hh
+++ b/lily/include/slur.hh
@@ -20,6 +20,8 @@ public:
VIRTUAL_COPY_CONS(Score_element);
void add_column (Note_column*);
+ static SCM scheme_molecule (SCM);
+
protected:
diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh
index b3e894804d..34339a18f9 100644
--- a/lily/include/spanner.hh
+++ b/lily/include/spanner.hh
@@ -49,6 +49,7 @@ public:
virtual Array<Rod> get_rods () const;
virtual Array<Spring> get_springs () const;
virtual Score_element* find_broken_piece (Line_of_score*) const;
+ virtual void do_derived_mark ();
protected:
void set_my_columns ();
VIRTUAL_COPY_CONS(Score_element);
diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh
index 676886c7ec..4ed5b22af0 100644
--- a/lily/include/staff-symbol.hh
+++ b/lily/include/staff-symbol.hh
@@ -22,7 +22,9 @@ public:
int steps_i() const;
int line_count () const;
Staff_symbol (SCM s);
+ static SCM scheme_molecule (SCM);
+
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule do_brew_molecule() const;
diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh
index 11c1c93af8..ec2e7b4426 100644
--- a/lily/include/stem-tremolo.hh
+++ b/lily/include/stem-tremolo.hh
@@ -20,7 +20,9 @@ protected:
static Interval dim_callback (Score_element*, Axis);
public:
- Stem_tremolo (SCM);
+ static SCM scheme_molecule (SCM);
+
+Stem_tremolo (SCM);
void set_stem (Stem *);
};
diff --git a/lily/include/stem.hh b/lily/include/stem.hh
index 8ae9771fca..44d054f011 100644
--- a/lily/include/stem.hh
+++ b/lily/include/stem.hh
@@ -43,6 +43,10 @@
class Stem : public Item
{
public:
+ static SCM scheme_molecule (SCM);
+
+
+
/// log of the duration. Eg. 4 -> 16th note -> 2 flags
int flag_i () const;
@@ -83,10 +87,8 @@ protected:
Real get_default_stem_end_position () const;
void position_noteheads();
-
Real stem_end_position () const;
static Real off_callback (Score_element const*, Axis);
-protected:
Molecule flag () const;
virtual void before_line_breaking();
diff --git a/lily/include/sustain-pedal.hh b/lily/include/sustain-pedal.hh
index 9f17f20361..505723c316 100644
--- a/lily/include/sustain-pedal.hh
+++ b/lily/include/sustain-pedal.hh
@@ -31,7 +31,9 @@
class Sustain_pedal : public Item
{
public:
- VIRTUAL_COPY_CONS (Score_element);
+ static SCM scheme_molecule (SCM);
+
+VIRTUAL_COPY_CONS (Score_element);
Sustain_pedal (SCM);
protected:
virtual Molecule do_brew_molecule () const;
diff --git a/lily/include/system-start-delimiter.hh b/lily/include/system-start-delimiter.hh
index d84acd97d0..b3f545daf7 100644
--- a/lily/include/system-start-delimiter.hh
+++ b/lily/include/system-start-delimiter.hh
@@ -19,7 +19,9 @@ class System_start_delimiter : public Spanner
{
public:
System_start_delimiter (SCM);
- VIRTUAL_COPY_CONS (Score_element);
+ static SCM scheme_molecule (SCM);
+
+VIRTUAL_COPY_CONS (Score_element);
protected:
virtual void after_line_breaking();
virtual Molecule do_brew_molecule () const;
diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh
index 818a5a3139..d70347307a 100644
--- a/lily/include/text-item.hh
+++ b/lily/include/text-item.hh
@@ -19,7 +19,9 @@ class Text_item : public Item
{
public:
VIRTUAL_COPY_CONS (Score_element);
- Text_item (SCM s);
+ static SCM scheme_molecule (SCM);
+
+Text_item (SCM s);
protected:
virtual Molecule do_brew_molecule () const;
};
diff --git a/lily/include/tie.hh b/lily/include/tie.hh
index 7de2697cfa..71e0e86c87 100644
--- a/lily/include/tie.hh
+++ b/lily/include/tie.hh
@@ -25,7 +25,9 @@ public:
Note_head* head (Direction) const;
Real position_f () const;
+ static SCM scheme_molecule (SCM);
+
virtual Direction get_default_dir() const;
protected:
diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh
index 6744bff15e..ac4a49f237 100644
--- a/lily/include/time-signature.hh
+++ b/lily/include/time-signature.hh
@@ -27,6 +27,8 @@ protected:
virtual Molecule do_brew_molecule() const;
public:
Time_signature (SCM);
+ static SCM scheme_molecule (SCM);
+
/*
TODO: make this SCM!
diff --git a/lily/include/tuplet-spanner.hh b/lily/include/tuplet-spanner.hh
index 51789988b6..e7390afbf2 100644
--- a/lily/include/tuplet-spanner.hh
+++ b/lily/include/tuplet-spanner.hh
@@ -21,7 +21,9 @@ class Tuplet_spanner : public Spanner
{
public:
Tuplet_spanner (SCM);
-
+ static SCM scheme_molecule (SCM);
+
+
void add_column (Note_column*);
void add_beam (Beam*);
protected:
diff --git a/lily/include/volta-spanner.hh b/lily/include/volta-spanner.hh
index a1f9b0ebfe..a9a05605da 100644
--- a/lily/include/volta-spanner.hh
+++ b/lily/include/volta-spanner.hh
@@ -17,7 +17,7 @@ class Volta_spanner : public Spanner
{
public:
Volta_spanner (SCM);
-
+ static SCM scheme_molecule (SCM);
void add_column (Note_column*);
void add_bar (Bar*);