File: drawgrace.c

package info (click to toggle)
denemo 0.5.9-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,500 kB
  • ctags: 2,415
  • sloc: ansic: 23,057; sh: 3,321; yacc: 1,737; makefile: 449; lex: 376
file content (37 lines) | stat: -rw-r--r-- 991 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* drawgrace.c
 *
 * Functions for drawing tuplet indications
 *
 * for Denemo, a gtk+ frontend to GNU Lilypond
 * (c) 1999, 2000, 2001 Adam Tee
 */

#include "utils.h"		/* Includes <gdk.h> */
#include "datastructures.h"

void
draw_gracebracket (GdkPixmap * pixmap, GdkGC * gc, GdkFont * font,
		   gint xx, gint y, mudelaobject * theobj)
{
  static GdkFont *gracebracketfont = NULL;
  static GString *graceopentext;

  if (!gracebracketfont)
    {
      gracebracketfont =
	gdk_fontset_load
	("-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-*");
      if (!gracebracketfont)
	gracebracketfont = font;
      graceopentext = g_string_new (NULL);
    }
  if (theobj->type == GRACE_START)
    {
      g_string_sprintf (graceopentext, _("Grace"));
      gdk_draw_text (pixmap, gracebracketfont, gc, xx, y - 4,
		     graceopentext->str, graceopentext->len);
    }
  else if (theobj->type == GRACE_END)
    gdk_draw_text (pixmap, gracebracketfont, gc, xx, y - 4, _("End grace"),
		   10);
}