]> git.cworth.org Git - scherzo/blobdiff - score.h
Draw a second staff (and vertical lines at the beginning and end of staff).
[scherzo] / score.h
diff --git a/score.h b/score.h
index 26b976683cadb23bcfc47870fe7abe7022a00626..ece395137be54c92949c3d1951cc3f0d9368e1df 100644 (file)
--- a/score.h
+++ b/score.h
 
 #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);