rest -> stem -> beam -> interpolate_y_position ()
*/
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Beam, rest_collision_callback, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Beam, rest_collision_callback, 2, 1, "");
SCM
Beam::rest_collision_callback (SCM smob, SCM prev_offset)
{
LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0,
(SCM font),
"Given the font metric @var{font}, return the "
- "magnification, relative to the current outputs-cale.")
+ "magnification, relative to the current output-scale.")
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
static SCM doc_hash_table;
void ly_add_function_documentation (SCM func,
- char const *fname,
- char const *varlist,
- char const *doc)
+ string fname,
+ string varlist,
+ string doc)
{
- if (!strlen (doc))
+ if (doc == "")
return;
if (!doc_hash_table)
scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
ly_string2scm (s));
- SCM entry = scm_cons (scm_from_locale_string (varlist), scm_from_locale_string (doc));
- scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
+ SCM entry = scm_cons (ly_string2scm (varlist), ly_string2scm (doc));
+ scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname.c_str()), entry);
}
LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation",
Make TYPE::FUNC available as a Scheme function.
*/
string mangle_cxx_identifier (string);
-#define MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE, FUNC, ARGCOUNT, OPTIONAL_COUNT) \
+#define MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE, FUNC, ARGCOUNT, OPTIONAL_COUNT, DOC) \
SCM TYPE ::FUNC ## _proc; \
void \
TYPE ## _ ## FUNC ## _init_functions () \
TYPE ::FUNC ## _proc = scm_c_define_gsubr (id.c_str(), \
(ARGCOUNT-OPTIONAL_COUNT), OPTIONAL_COUNT, 0, \
(Scheme_function_unknown) TYPE::FUNC); \
+ ly_add_function_documentation (TYPE :: FUNC ## _proc, id.c_str(), "", \
+ DOC); \
scm_c_export (id.c_str (), NULL); \
} \
\
ADD_SCM_INIT_FUNC (TYPE ## _ ## FUNC ## _callback, \
TYPE ## _ ## FUNC ## _init_functions);
+#define MAKE_DOCUMENTED_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT, DOC) \
+ MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE, FUNC, ARGCOUNT, 0, DOC);
+
#define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \
- MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE,FUNC,ARGCOUNT,0);
+ MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE,FUNC,ARGCOUNT, 0, "");
void
-ly_add_function_documentation (SCM proc, char const *fname,
- char const *varlist,
- char const *doc);
+ly_add_function_documentation (SCM proc, string fname, string varlist, string doc);
#define ADD_SCM_INIT_FUNC(name, func) \
class name ## _scm_initter \
LY_DEFINE (ly_layout_lookup, "ly:output-def-lookup",
2, 1, 0, (SCM pap, SCM sym, SCM def),
- "Lookup @var{sym} in @var{pap}. "
+ "Lookup @var{sym} in the Output_def @var{pap}. "
"Return the value or @var{def} (which defaults to @code{'()}) if undefined.")
{
Output_def *op = unsmob_output_def (pap);
return scm_from_double (0.0);
}
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Rest_collision, force_shift_callback_rest, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Rest_collision, force_shift_callback_rest, 2, 1, "");
SCM
Rest_collision::force_shift_callback_rest (SCM rest, SCM offset)
{
}
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, x_aligned_side, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, x_aligned_side, 2, 1, "");
SCM
Side_position_interface::x_aligned_side (SCM smob, SCM current_off)
{
return axis_aligned_side_helper (smob, X_AXIS, false, 0, 0, current_off);
}
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, y_aligned_side, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, y_aligned_side, 2, 1, "");
SCM
Side_position_interface::y_aligned_side (SCM smob, SCM current_off)
{
return axis_aligned_side_helper (smob, Y_AXIS, false, 0, 0, current_off);
}
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, pure_y_aligned_side, 4, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, pure_y_aligned_side, 4, 1, "");
SCM
Side_position_interface::pure_y_aligned_side (SCM smob, SCM start, SCM end, SCM cur_off)
{
Pointer_group_interface::add_grob (me, ly_symbol2scm ("encompass-objects"), n);
}
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, pure_outside_slur_callback, 4, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, pure_outside_slur_callback, 4, 1, "");
SCM
Slur::pure_outside_slur_callback (SCM grob, SCM start_scm, SCM end_scm, SCM offset_scm)
{
return scm_from_double (offset + dir * slur->pure_height (slur, start, end).length () / 4);
}
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1, "");
SCM
Slur::outside_slur_callback (SCM grob, SCM offset_scm)
{
return fm->word_stencil (str).smobbed_copy ();
}
-MAKE_SCHEME_CALLBACK (Text_interface, interpret_markup, 3);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Text_interface, interpret_markup, 3, 0,
+ "Convert a text markup into a stencil. "
+"Takes 3 arguments, @var{layout}, @var{props} and @var{markup}. "
+"\n\n"
+"@var{layout} is a @code{\\layout} block; it may be obtained from a grob with "
+"@code{ly:grob-layout}. @var{props} is a alist chain, ie. a list of alists. "
+"This is typically obtained with "
+"@code{(ly:grob-alist-chain (ly:layout-lookup layout 'text-font-defaults))}. "
+"@var{markup} is the markup text to be processed. "
+ );
SCM
Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup)
{
}
ADD_INTERFACE (Text_interface,
- "A scheme markup text, see @usermanref{Text markup}.",
+ "A scheme markup text, see @usermanref{Text markup} and "
+ "@usermanref{New markup command definition}. "
+ "\n\n"
+ "There are two important commands: ly:text-interface::print, which is a "
+ "grob callback, and ly:text-interface::interpret-markup ",
+
+ /* props */
"baseline-skip "
"text "
"word-space "