Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/boards/awele.h
blob: 9716ed6526a1f1cb480580344f4ebf5d778bc919 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * gcompris - awele.h
 *
 * Copyright (C) 2005 Frederic Mazzarol This program is
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, see <http://www.gnu.org/licenses/>.
 */


#define BOUTON "awele/bouton1.png"	//Chemin relatif vers fichiers boutons
#define BOUTON_NOTIFY "awele/bouton1_notify.png"	//Chemin relatif vers fichiers boutons cliqués
#define BOUTON_CLIC "awele/bouton1_clic.png"	//Chemin relatif vers fichiers boutons cliqués
#define BEAN "awele/graine1.png"	//Chemin relatif vers fichiers graines

#define Y_BOUTONS 412		//Abcisse des boutons

#define WIDTH 800 	// Largeur Fenetre
#define HEIGHT 600	// Hauteur Fenetre
/**
*	Tableau de graines
*/
typedef struct {
	GnomeCanvasItem *beanPixbuf;
	char hole;
}BEANHOLE_LINK;


typedef struct {
    GnomeCanvasItem *msg;	//Item message pour dialogue avec utilisateur
    GnomeCanvasItem *nbBeansHole[12];	//Tableau d'item affichant le nbre de graine par trou.
    BEANHOLE_LINK *ptBeansHoleLink;	//pointeur sur structures stockant les item graines et la case dans laquelle elles se trouvent.
    GnomeCanvasItem *button[6];	//Item des boutons (affichés avec pixbufButton)
    GdkPixbuf *pixbufButtonNotify[6];	//pixbux des boutons notifiés
    GdkPixbuf *pixbufButton[6];	//pixbuf des boutons(selection de la case a jouer)
    GdkPixbuf *pixbufButtonClicked[6];	//pixbuf des boutons cliqués
    GnomeCanvasItem *Captures[2];	//Tableau d'item affichage nbre graine capturées.
    GdkPixbuf *pixbufBeans[4];	//pixbufs des graines
} GRAPHICS_ELT;

typedef struct {
    short int numeroCase;
    GRAPHICS_ELT *graphsElt;
} CALLBACK_ARGS;

/*
*	Fonctions de traitement des events, signaux et rappels
*/
static gint buttonClick (GtkWidget *item, GdkEvent *event, gpointer data);

/**
*	Fonctions Mise a jour de l'affichage
*/
static BEANHOLE_LINK * updateNbBeans (int alpha);
static void updateCapturedBeans (void);
static void initBoardGraphics (GRAPHICS_ELT *graphsElt);