*/
-#include "clef-item.hh"
+#include "clef.hh"
#include "string.hh"
#include "molecule.hh"
#include "item.hh"
-Clef_item::Clef_item (SCM s)
- : Item (s)
-{}
-
-
/*
FIXME: should use symbol.
-FIXME: this should be schemified.
*/
-void
-Clef_item::before_line_breaking ()
+MAKE_SCHEME_CALLBACK(Clef,before_line_breaking);
+SCM
+Clef::before_line_breaking (SCM smob)
{
- SCM style_sym =get_elt_property ("style");
+ Item * s = dynamic_cast<Item*> (unsmob_element (smob));
+
+ SCM style_sym =s->get_elt_property ("style");
String style;
if (gh_string_p (style_sym))
style = ly_scm2string (style_sym);
- SCM glyph = get_elt_property ("glyph");
+ SCM glyph = s->get_elt_property ("glyph");
if (gh_string_p (glyph))
{
- String s = ly_scm2string (glyph);
+ String str = ly_scm2string (glyph);
/*
FIXME: should use fontsize property to set clef changes.
*/
- if (get_elt_property ("non-default") &&
- break_status_dir() != RIGHT && style != "fullSizeChanges")
+ if (s->get_elt_property ("non-default") &&
+ s->break_status_dir() != RIGHT && style != "fullSizeChanges")
{
- s += "_change";
- set_elt_property ("glyph", ly_str02scm (s.ch_C()));
+ str += "_change";
+ s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));
}
}
else
{
- suicide ();
- return;
+ s->suicide ();
+ return SCM_UNSPECIFIED;
}
- // ugh.
- /* why not suicide? */
- if (style == "transparent") // UGH. JUNKME
- {
- set_elt_property ("molecule-callback", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- }
+ return SCM_UNSPECIFIED;
}
+bool
+Clef::has_interface (Score_element* me)
+{
+ return me->has_interface (ly_symbol2scm ("clef-interface"));
+}
+
+
+void
+Clef::set_interface (Score_element* me)
+{
+ me->set_interface (ly_symbol2scm ("clef-interface"));
+}