+/* scherzo - Music notation training
+ *
+ * score - Utilities for drawing (simple) musical scores
+ *
+ * Copyright © 2010 Carl Worth
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/ .
+ */
+
+#include "score.h"
+
+void
+score_init (score_t *score)
+{
+ score->space_height = 6;
+}
+
+void
+_draw_staff (score_t *score, cairo_t *cr)
+{
+ int i;
+
+ cairo_save (cr);
+
+ for (i = 0; i < 5; i++) {
+ cairo_move_to (cr, 0, i * score->space_height + 0.5);
+ cairo_rel_line_to (cr, score->width, 0);
+ }
+
+ cairo_set_line_width (cr, 1.0);
+
+ cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+}
+
+void
+score_set_width (score_t *score, int width)
+{
+ score->width = width;
+}
+
+void
+score_draw (score_t *score, cairo_t *cr)
+{
+ _draw_staff (score, cr);
+}