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

« back to all changes in this revision

Viewing changes to src/drawtimesig.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:
13
13
 *
14
14
 */
15
15
void
16
 
draw_timesig (GdkPixmap * pixmap, GdkGC * gc, GdkFont * font, gint xx, gint y,
 
16
draw_timesig (cairo_t *cr, gint xx, gint y,
17
17
              gint time1, gint time2)
18
18
{
19
 
  PangoContext *context =
20
 
    gdk_pango_context_get_for_screen (gdk_drawable_get_screen (pixmap));;
21
 
  PangoLayout *layout = pango_layout_new (context);
22
 
  PangoFontDescription *desc =
23
 
    pango_font_description_from_string (TIMESIGFONT);
24
19
  static GString *timesigtop;
25
20
  static GString *timesigbottom;
26
21
 
33
28
  g_string_sprintf (timesigbottom, "%d", time2);
34
29
 
35
30
 
36
 
  pango_layout_set_text (layout, timesigtop->str, -1);
37
 
  pango_layout_set_font_description (layout, desc);
38
31
  gint extra = LINE_SPACE / 2;
39
 
  gdk_draw_layout (pixmap, gc, xx, y - extra, layout);  //hard coded LINESPACE*0.5
40
 
 
41
 
  pango_layout_set_text (layout, timesigbottom->str, -1);
42
 
  pango_layout_set_font_description (layout, desc);
43
 
  extra = (3 * LINE_SPACE) / 2;
44
 
  gdk_draw_layout (pixmap, gc, xx, y + extra, layout);  //hardcoded LINESPACE * 1.5
45
 
  pango_font_description_free (desc);
 
32
  cairo_select_font_face( cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL );
 
33
  cairo_set_font_size( cr, 24.0 );
 
34
 
 
35
  cairo_move_to( cr, xx,y+20 );
 
36
  cairo_show_text( cr, timesigtop->str );
 
37
 
 
38
  cairo_move_to( cr, xx,y+40 );
 
39
  cairo_show_text( cr, timesigbottom->str );
46
40
}