Back to index

gcompris  8.2.2
Defines | Functions | Variables
score.c File Reference
#include "gcompris.h"

Go to the source code of this file.

Defines

#define NUMBERSWIDTH   110

Functions

static void display_number (GnomeCanvasGroup *parent, guint x, guint y, char *operand_str)
void gc_score_start (ScoreStyleList style, guint gx, guint gy, guint gmax)
void gc_score_end ()
void gc_score_set (guint value)

Variables

static GnomeCanvasGroup * boardRootItem = NULL
 This includes an API to count scores in gcompris.
static guint x
static guint y
static guint max
static ScoreStyleList currentStyle

Define Documentation

#define NUMBERSWIDTH   110

Definition at line 126 of file score.c.


Function Documentation

static void display_number ( GnomeCanvasGroup *  parent,
guint  x,
guint  y,
char *  operand_str 
) [static]

Definition at line 129 of file score.c.

{

  x -= NUMBERSWIDTH;

  gnome_canvas_item_new (parent,
                      gnome_canvas_text_get_type (),
                      "text", operand_str,
                      "font", gc_skin_font_board_huge_bold,
                      "x", (double) x+2,
                      "y", (double) y+2,
                      "anchor", GTK_ANCHOR_CENTER,
                      "fill_color_rgba", 0x7a8699FF,
                      NULL);
  gnome_canvas_item_new (parent,
                      gnome_canvas_text_get_type (),
                      "text", operand_str,
                      "font", gc_skin_font_board_huge_bold,
                      "x", (double) x,
                      "y", (double) y,
                      "anchor", GTK_ANCHOR_CENTER,
                      "fill_color_rgba", 0xe5e532FF,
                      NULL);
}

Here is the caller graph for this function:

void gc_score_end ( )

Definition at line 72 of file score.c.

{
  if(boardRootItem!=NULL)
    gtk_object_destroy (GTK_OBJECT(boardRootItem));
  
  boardRootItem=NULL;
}

Here is the caller graph for this function:

void gc_score_set ( guint  value)

Definition at line 81 of file score.c.

{

  if(boardRootItem!=NULL)
    gtk_object_destroy (GTK_OBJECT(boardRootItem));

  boardRootItem = GNOME_CANVAS_GROUP(
                                 gnome_canvas_item_new (
                                                     gnome_canvas_root(gc_board_get_current()->canvas),
                                                     gnome_canvas_group_get_type (),
                                                     "x", (double) x,
                                                     "y", (double) y,
                                                     NULL));

  switch(currentStyle) {
  case SCORESTYLE_NOTE :
    {
      gchar *tmp;
      GdkPixbuf *button_pixmap = NULL;

      button_pixmap = gc_skin_pixmap_load("button_large.png");
      gnome_canvas_item_new (boardRootItem,
                          gnome_canvas_pixbuf_get_type (),
                          "pixbuf",  button_pixmap,
                          "x",  (double) 0,
                          "y",  (double) -gdk_pixbuf_get_height(button_pixmap)/2,
                          NULL);
      gdk_pixbuf_unref(button_pixmap);

      tmp = g_strdup_printf("%d/%d", value, max);
      display_number(boardRootItem, gdk_pixbuf_get_width(button_pixmap)+10, 0, tmp);
      g_free(tmp);
    }
    break;
  default:
    break;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gc_score_start ( ScoreStyleList  style,
guint  gx,
guint  gy,
guint  gmax 
)

Definition at line 53 of file score.c.

{

  currentStyle = style;
  x = gx;
  y = gy;
  max = gmax;


  switch(currentStyle) {
  case SCORESTYLE_NOTE :
    break;
  default:
    break;
  }
}

Here is the caller graph for this function:


Variable Documentation

GnomeCanvasGroup* boardRootItem = NULL [static]

This includes an API to count scores in gcompris.

Definition at line 29 of file score.c.

Definition at line 32 of file score.c.

guint max [static]

Definition at line 31 of file score.c.

guint x [static]

Definition at line 31 of file score.c.

guint y [static]

Definition at line 31 of file score.c.