Can't use make_spanner_from_properties() because we have to use
beam_settings_.
*/
- Spanner *beam = new Spanner (beam_settings_, 0);
+ Spanner *beam = new Spanner (beam_settings_);
for (vsize i = 0; i < stems_->size (); i++)
Beam::add_stem (beam, (*stems_)[i]);
SCM props = updated_grob_properties (context (), symbol);
- Object_key const *key = 0;
Grob *grob = 0;
SCM handle = scm_sloppy_assq (ly_symbol2scm ("meta"), props);
SCM klass = scm_cdr (scm_sloppy_assq (ly_symbol2scm ("class"), scm_cdr (handle)));
if (klass == ly_symbol2scm ("Item"))
- grob = new Item (props, key);
+ grob = new Item (props);
else if (klass == ly_symbol2scm ("Spanner"))
- grob = new Spanner (props, key);
+ grob = new Spanner (props);
else if (klass == ly_symbol2scm ("Paper_column"))
- grob = new Paper_column (props, key);
+ grob = new Paper_column (props);
assert (grob);
announce_grob (grob, cause);
return ly_bool2scm (b);
}
-LY_DEFINE (ly_grob_key, "ly:grob-key",
- 1, 0, 0,
- (SCM grob),
- "Return the object-key for @var{grob}.")
-{
- Grob *me = unsmob_grob (grob);
- SCM_ASSERT_TYPE (me, grob, SCM_ARG1, __FUNCTION__, "Grob");
-
- return me->key () ? me->key ()->self_scm () : SCM_EOL;
-}
-
LY_DEFINE (ly_grob_default_font, "ly:grob-default-font",
1, 0, 0, (SCM grob),
"Return the default font for grob @var{gr}.")
Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
scm_gc_mark (s->immutable_property_alist_);
- if (s->key_)
- scm_gc_mark (s->key_->self_scm ());
-
/* Do not mark the parents. The pointers in the mutable
property list form two tree like structures (one for X
relations, one for Y relations). Marking these can be done
#include "ly-smobs.icc"
Grob *
-Grob::clone (int count) const
+Grob::clone () const
{
- return new Grob (*this, count);
+ return new Grob (*this);
}
-Grob::Grob (SCM basicprops,
- Object_key const *key)
+Grob::Grob (SCM basicprops)
{
- key_ = key;
/* FIXME: default should be no callback. */
self_scm_ = SCM_EOL;
GC. After smobify_self (), they are. */
smobify_self ();
- /*
- We always get a new key object for a new grob.
- */
- if (key_)
- ((Object_key *)key_)->unprotect ();
-
SCM meta = get_property ("meta");
if (scm_is_pair (meta))
{
set_property ("Y-extent", Grob::stencil_height_proc);
}
-Grob::Grob (Grob const &s, int copy_index)
+Grob::Grob (Grob const &s)
: dim_cache_ (s.dim_cache_)
{
- key_ = 0; // (use_object_keys) ? new Copied_key (s.key_, copy_index) : 0;
original_ = (Grob *) & s;
self_scm_ = SCM_EOL;
layout_ = 0;
smobify_self ();
- if (key_)
- ((Object_key *)key_)->unprotect ();
}
Grob::~Grob ()
#include "virtual-methods.hh"
#include "dimension-cache.hh"
#include "grob-interface.hh"
-#include "object-key.hh"
class Grob
{
Dimension_cache dim_cache_[NO_AXES];
Output_def *layout_;
Grob *original_;
- Object_key const *key_;
/* SCM data */
SCM immutable_property_alist_;
Output_def *layout () const { return layout_; }
Grob *original () const { return original_; }
SCM interfaces () const { return interfaces_; }
- Object_key const *key () const { return key_; }
/* life & death */
- Grob (SCM basic_props, Object_key const *);
- Grob (Grob const &, int copy_count);
- virtual Grob *clone (int count) const;
+ Grob (SCM basic_props);
+ Grob (Grob const &);
+ virtual Grob *clone () const;
/* forced death */
void suicide ();
DECLARE_CLASSNAME(Item);
public:
- Item (SCM, Object_key const *);
- Item (Item const &, int count);
+ Item (SCM);
+ Item (Item const &);
- virtual Grob *clone (int count) const;
+ virtual Grob *clone () const;
static bool is_non_musical (Grob *);
bool is_broken () const;
extern string prefix_directory;
extern bool use_object_keys;
extern bool strict_infinity_checking;
-extern string init_scheme_code_string_global;
+extern string init_scheme_code_global;
extern string init_scheme_variables_global;
/*
friend void set_loose_columns (System *which, Column_x_positions const *posns);
friend class System;
public:
- Paper_column (SCM, Object_key const *);
- Paper_column (Paper_column const &, int count);
+ Paper_column (SCM);
+ Paper_column (Paper_column const &);
- virtual Grob *clone (int count) const;
+ virtual Grob *clone () const;
virtual void do_break_processing ();
virtual Paper_column *get_column () const;
virtual System *get_system () const;
void set_bound (Direction d, Grob *);
Item *get_bound (Direction d) const;
- Spanner (SCM, Object_key const *);
- Spanner (Spanner const &, int copy_count);
+ Spanner (SCM);
+ Spanner (Spanner const &);
bool is_broken () const;
void do_break ();
Real spanner_length () const;
protected:
void set_my_columns ();
- virtual Grob *clone (int count) const;
+ virtual Grob *clone () const;
virtual void do_break_processing ();
};
SCM get_paper_system ();
SCM get_paper_systems ();
- System (SCM, Object_key const *);
- System (System const &, int);
+ System (SCM);
+ System (System const &);
int element_count () const;
int spanner_count () const;
protected:
virtual void derived_mark () const;
- virtual Grob *clone (int count) const;
+ virtual Grob *clone () const;
};
void set_loose_columns (System *which, Column_x_positions const *posns);
+++ /dev/null
-/*
- tweak-registration.hh -- declare
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
-*/
-
-#ifndef TWEAK_REGISTRATION_HH
-#define TWEAK_REGISTRATION_HH
-
-#include <map>
-using namespace std;
-
-#include "lily-proto.hh"
-
-typedef map<Object_key const *, SCM, Object_key_less> Tweak_map;
-
-class Tweak_registry
-{
- Tweak_map tweaks_;
- Object_key_undumper *undumper_;
-
- DECLARE_SMOBS (Tweak_registry);
-
-public:
- Tweak_registry ();
-
- Object_key_undumper *undumper () const;
- void clear ();
- void insert_grob_tweak (Grob *, SCM);
- void replace_grob_tweak (Grob *, SCM);
- SCM get_tweaks (Grob *);
- SCM list_tweaks ();
- void insert_tweak_from_file (SCM);
-};
-
-extern Tweak_registry *global_registry_;
-
-DECLARE_UNSMOB (Tweak_registry, tweak_registry);
-
-#endif /* TWEAK_REGISTRATION_HH */
#include "pointer-group-interface.hh"
Grob *
-Item::clone (int count) const
+Item::clone () const
{
- return new Item (*this, count);
+ return new Item (*this);
}
-Item::Item (SCM s, Object_key const *key)
- : Grob (s, key)
+Item::Item (SCM s)
+ : Grob (s)
{
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] = 0;
}
/**
Item copy ctor. Copy nothing: everything should be a elt property
or a special purpose pointer (such as broken_to_drul_[]) */
-Item::Item (Item const &s, int copy_count)
- : Grob (s, copy_count)
+Item::Item (Item const &s)
+ : Grob (s)
{
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] = 0;
}
{
Drul_array<Item *> new_copies;
Direction i = LEFT;
- int count = 0;
do
{
- Grob *dolly = clone (count++);
+ Grob *dolly = clone ();
Item *item = dynamic_cast<Item *> (dolly);
get_root_system (this)->typeset_grob (item);
new_copies[i] = item;
/* Scheme code to execute before parsing, after .scm init.
This is where -e arguments are appended to. */
-string init_scheme_code_string_global;
+string init_scheme_code_global;
string init_scheme_variables_global;
/* Generate preview of first system. */
break;
case 'e':
- init_scheme_code_string_global += option_parser->optional_argument_str0_ + string (" ");
+ init_scheme_code_global += option_parser->optional_argument_str0_ + string (" ");
break;
case 'w':
warranty ();
/* doc */ "Generate noteheads.",
/* create */
"NoteHead ",
- /* read */ "middleCPosition",
- /* write */ "");
+ /* read */
+ "middleCPosition",
+ /* write */
+ "");
#include "string-convert.hh"
Grob *
-Paper_column::clone (int count) const
+Paper_column::clone () const
{
- return new Paper_column (*this, count);
+ return new Paper_column (*this);
}
void
return (Paper_column *) (this);
}
-Paper_column::Paper_column (SCM l, Object_key const *key)
- : Item (l, key) // guh.?
+Paper_column::Paper_column (SCM l)
+ : Item (l)
{
system_ = 0;
rank_ = -1;
}
-Paper_column::Paper_column (Paper_column const &src, int count)
- : Item (src, count)
+Paper_column::Paper_column (Paper_column const &src)
+ : Item (src)
{
system_ = 0;
rank_ = src.rank_;
LY_DEFINE (ly_command_line_code, "ly:command-line-code", 0, 0, 0, (),
"The Scheme specified on command-line with @samp{-e}.")
{
- return ly_string2scm (init_scheme_code_string_global);
+ return ly_string2scm (init_scheme_code_global);
}
LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (),
SCM props = updated_grob_properties (context (), ly_symbol2scm ("System"));
- Object_key const *sys_key = 0;
- pscore_->typeset_system (new System (props, sys_key));
+ pscore_->typeset_system (new System (props));
system_ = pscore_->root_system ();
context ()->set_property ("rootSystem", system_->self_scm ());
#include "warn.hh"
Grob *
-Spanner::clone (int count) const
+Spanner::clone () const
{
- return new Spanner (*this, count);
+ return new Spanner (*this);
}
void
programming_error ("no broken bound");
else if (bound->get_system ())
{
- Spanner *span = dynamic_cast<Spanner *> (clone (broken_intos_.size ()));
+ Spanner *span = dynamic_cast<Spanner *> (clone ());
span->set_bound (LEFT, bound);
span->set_bound (RIGHT, bound);
continue;
}
- Spanner *span = dynamic_cast<Spanner *> (clone (broken_intos_.size ()));
+ Spanner *span = dynamic_cast<Spanner *> (clone ());
span->set_bound (LEFT, bounds[LEFT]);
span->set_bound (RIGHT, bounds[RIGHT]);
Pointer_group_interface::add_grob (i, ly_symbol2scm ("bounded-by-me"), this);
}
-Spanner::Spanner (SCM s, Object_key const *key)
- : Grob (s, key)
+Spanner::Spanner (SCM s)
+ : Grob (s)
{
break_index_ = 0;
spanned_drul_[LEFT] = 0;
spanned_drul_[RIGHT] = 0;
}
-Spanner::Spanner (Spanner const &s, int count)
- : Grob (s, count)
+Spanner::Spanner (Spanner const &s)
+ : Grob (s)
{
spanned_drul_[LEFT] = spanned_drul_[RIGHT] = 0;
}
#include "pointer-group-interface.hh"
#include "spacing-interface.hh"
#include "staff-symbol-referencer.hh"
-#include "tweak-registration.hh"
#include "warn.hh"
#include "lookup.hh"
extern bool debug_skylines;
-System::System (System const &src, int count)
- : Spanner (src, count)
+System::System (System const &src)
+ : Spanner (src)
{
all_elements_ = 0;
pscore_ = 0;
init_elements ();
}
-System::System (SCM s, Object_key const *key)
- : Spanner (s, key)
+System::System (SCM s)
+ : Spanner (s)
{
all_elements_ = 0;
rank_ = 0;
}
Grob *
-System::clone (int index) const
+System::clone () const
{
- return new System (*this, index);
+ return new System (*this);
}
int
{
for (vsize i = 0; i < breaking.size (); i++)
{
- System *system = dynamic_cast<System *> (clone (broken_intos_.size ()));
+ System *system = dynamic_cast<System *> (clone ());
system->rank_ = broken_intos_.size ();
vector<Grob*> c (breaking[i].cols_);
if (ly_is_equal (right_ev->get_property ("pitch"),
left_ev->get_property ("pitch")))
{
- Grob *p = new Spanner (heads_to_tie_[i].tie_definition_, 0);
+ Grob *p = new Spanner (heads_to_tie_[i].tie_definition_);
SCM cause = heads_to_tie_[i].tie_event_
? heads_to_tie_[i].tie_event_->self_scm ()