typedef Interval (*Extent_callback)(Score_element const *,Axis);
typedef Real (*Offset_callback)(Score_element const *,Axis);
+#define READONLY_PROPS // FIXME.
+
/**
for administration of what was done already
The lookup, determined by the font size. Cache this value.
*/
Lookup * lookup_l_;
-public:
+
/**
properties specific for this element. Destructor will not call
scm_unprotect, so as to allow more flexible GC arrangements. The
need for more scm_protect calls.
*/
- SCM element_property_alist_;
-
+public: // ugh.
+ SCM property_alist_;
+ SCM pointer_alist_;
+#ifndef READONLY_PROPS
+ SCM basic_property_list_;
+#endif
+public:
Score_element *original_l_;
/**
0 means ORPHAN,
*/
char status_i_;
- /**
- Set this if anyone points to me, or if I point to anyone.
-
- JUNKME.
- */
- bool used_b_;
-
char const * name () const;
/*
*/
Paper_score *pscore_l_;
- Score_element ();
+ Score_element (SCM basic_props);
Score_element (Score_element const&);
/*
SCM get_elt_property (String nm) const;
void set_elt_property (String, SCM val);
+ /**
+ Pointers are like properties, but they are subject to a substitution
+ after line breaking.
+ */
+ SCM get_elt_pointer (const char*) const;
+ void set_elt_pointer (const char*, SCM val);
+ friend class Property_engraver; // UGHUGHUGH.
/**
UGH! JUNKME ?
twice may do weird things if Bar::foo has a default set.
*/
- SCM remove_elt_property (String nm);
+ SCM remove_elt_property (const char* nm);
/*
related classes.
/// 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
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 ();
-
+ 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 ();
Score_element * unsmob_element (SCM);
+#define MAKE_SCHEME_SCORE_ELEMENT_NON_DEFAULT_CALLBACKS(TYPE) \
+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); \
+
+#define MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(TYPE) \
+MAKE_SCHEME_SCORE_ELEMENT_NON_DEFAULT_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; \
+} \
+ \
+
#endif // STAFFELEM_HH