#include <cairo.h>
-typedef struct score
-{
- /* Height of each space on staff. */
- int space_height;
+typedef struct score score_t;
- /* Total width available to score. */
- int width;
-} score_t;
+/* Allocate a new, empty score object, (with optional ctx as talloc
+ * owner). If ctx is NULL, the caller should call talloc_free on the
+ * score_t* when done with it. Otherwise, the object will be freed
+ * when ctx is freed. */
+score_t *
+score_create (void *ctx);
-void
-score_init (score_t *score);
+/* Set an (approximate) staff height. The actual staff height may
+ * differ due to rounding to achieve evenly spaced, sharply rendered
+ * lines. the actual staff height is returned. */
+int
+score_set_staff_height (score_t *score, int height);
+/* Draw the given score_t onto the given cairo_t.
+ *
+ * The caller can call cairo_translate before calling score_draw to
+ * position the result as desired, (and can call cairo_clip to clip it
+ * if desired). */
void
score_draw (score_t *score, cairo_t *cr);