~ubuntu-branches/ubuntu/oneiric/denemo/oneiric

« back to all changes in this revision

Viewing changes to src/drawfigure.c

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-10-27 08:00:18 UTC
  • mfrom: (1.3.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20101027080018-tuekd0869v8ptnqv
Tags: upstream-0.8.16
ImportĀ upstreamĀ versionĀ 0.8.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *
16
16
 */
17
17
void
18
 
draw_figure (GdkPixmap * pixmap, GdkGC * gc, GdkFont * font,
 
18
draw_figure (cairo_t *cr,
19
19
             gint xx, gint y, DenemoObject * theobj)
20
20
{
21
 
  PangoContext *context;
22
 
  PangoLayout *layout;
23
 
  PangoFontDescription *desc;
24
21
  gchar *text = NULL;
25
 
  gint length = 0;
26
22
  chord *ch;
27
23
  if (theobj->type == FIGURE)
28
24
    {
34
30
      if (ch->is_figure)
35
31
        {
36
32
          text = ((GString *) (ch->figure))->str;
37
 
          length = ((GString *) (ch->figure))->len;
38
33
        }
39
34
      else
40
35
        {
42
37
          chord *mych = (chord *) mud->object;
43
38
          GString *mygstr = (GString *) mych->figure;
44
39
          text = mygstr->str;
45
 
          length = mygstr->len;
46
40
        }
47
41
 
48
42
    }
49
 
#ifdef DEBUG
50
 
  g_print ("%s, %d\n", text, length);
51
 
#endif
52
 
 
53
 
  context =
54
 
    gdk_pango_context_get_for_screen (gdk_drawable_get_screen (pixmap));
55
 
  layout = pango_layout_new (context);
56
 
  pango_layout_set_text (layout, text, -1);
57
 
  desc = pango_font_description_from_string (FONT);
58
 
  pango_layout_set_font_description (layout, desc);
59
 
  pango_font_description_free (desc);
60
 
  //gdk_draw_text (pixmap, lyricfont, gc, xx, y+STAFF_HEIGHT+10, text, length);
61
 
  gdk_draw_layout (pixmap, gc, xx, y + STAFF_HEIGHT + 10, layout);
62
 
 
63
 
 
 
43
  g_debug ("%s\n", text);
 
44
 
 
45
  drawnormaltext_cr( cr, text, xx, y + STAFF_HEIGHT + 10 );
64
46
}
65
47
 
66
48