source file of the GNU LilyPond music typesetter
- (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
}
-
Molecule
Lookup::dashed_slur (Bezier b, Real thick, Real dash)
{
return Molecule (box, at);
}
-
-
-
Molecule
Lookup::blank (Box b)
{
return Molecule (b,at);
}
+
Molecule
Lookup::frame (Box b, Real thick)
{
edges[o][DOWN] = b[o][DOWN] - thick/2;
edges[o][UP] = b[o][UP] + thick/2;
-
m.add_molecule (filledbox (edges));
}
while (flip (&d) != LEFT);
{
Real alpha = (curve.control_[3] - curve.control_[0]).arg ();
Bezier back = curve;
-
+ Offset perp = curvethick * complex_exp (Offset (0, alpha + M_PI/2)) * 0.5;
back.reverse ();
- back.control_[1] += curvethick * complex_exp (Offset (0, alpha + M_PI/2));
- back.control_[2] += curvethick * complex_exp (Offset (0, alpha + M_PI/2));
+ back.control_[1] += perp;
+ back.control_[2] += perp;
+ curve.control_[1] -= perp;
+ curve.control_[2] -= perp;
+
SCM scontrols[8];
for (int i=4; i--;)
ly_quote_scm (list),
gh_double2scm (linethick),
SCM_UNDEFINED));
+ Box b(curve.extent (X_AXIS),
+ curve.extent (Y_AXIS));
+
+ b[X_AXIS].unite (back.extent (X_AXIS));
+ b[Y_AXIS].unite (back.extent (Y_AXIS));
- Box b (curve.extent (X_AXIS), curve.extent (Y_AXIS));
return Molecule (b, at);
}
+/*
+ TODO: junk me.
+ */
Molecule
Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
{
return Molecule (b, slashnodot); // http://slashnodot.org
}
+
+
+
+Molecule
+Lookup::bracket (Axis a, Interval iv, Direction d, Real thick, Real protude)
+{
+ Box b;
+ Axis other = Axis((a+1)%2);
+ b[a] = iv;
+ b[other] = Interval(-1, 1) * thick * 0.5;
+
+ Molecule m = filledbox (b);
+
+ b[a] = Interval (iv[UP] - thick, iv[UP]);
+ Interval oi = Interval (-thick/2, thick/2 + protude) ;
+ oi *= d;
+ b[other] = oi;
+ m.add_molecule (filledbox (b));
+ b[a] = Interval (iv[DOWN], iv[DOWN] +thick);
+ m.add_molecule (filledbox(b));
+
+ return m;
+}
+
+SCM
+ly_bracket (SCM a, SCM iv, SCM d, SCM t, SCM p)
+{
+ SCM_ASSERT_TYPE(ly_axis_p (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
+ SCM_ASSERT_TYPE(ly_number_pair_p (iv), iv, SCM_ARG1, __FUNCTION__, "number pair") ;
+ SCM_ASSERT_TYPE(ly_dir_p (d), a, SCM_ARG1, __FUNCTION__, "direction") ;
+ SCM_ASSERT_TYPE(gh_number_p (t), a, SCM_ARG1, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE(gh_number_p(p), a, SCM_ARG1, __FUNCTION__, "number") ;
+
+
+ return Lookup::bracket ((Axis)gh_scm2int (a), ly_scm2interval (iv),
+ (Direction)gh_scm2int (d), gh_scm2double (t), gh_scm2double (p)).smobbed_copy ();
+}
+
+static void
+lookup_init ()
+{
+ scm_c_define_gsubr ("ly-bracket", 5, 0, 0, (Scheme_function_unknown) ly_bracket);
+}
+
+ADD_SCM_INIT_FUNC (lookup,lookup_init);
+