1 //      (_||_/
2 //      (    )       Class de la Sourie
3 //     ( o  0 )
4 //-OOO�--(_)---�OOO---------------------------------------
5 //                   Copyright (C) 2006 By Dominique Roux-Serret
6 // .OOOo      oOOO.  roux-serret@ifrance.com
7 //-(   )------(   )---------------------------------------
8 //  ( (        ) /   Le 23/03/2006
9 //   (_)      (_/
10 
11 //    This program is free software; you can redistribute it and/or modify
12 //    it under the terms of the GNU General Public License as published by
13 //    the Free Software Foundation; either version 2 or version 3 of the License.
14 
15 //    This program is distributed in the hope that it will be useful,
16 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
17 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 //    GNU General Public License for more details.
19 
20 //    You should have received a copy of the GNU General Public License along
21 //    with this program; if not, write to the Free Software Foundation, Inc.,
22 //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 
24 #ifndef _SOURIE_DOM_
25 #define _SOURIE_DOM_
26 
27 #include <SDL/SDL.h>
28 
29 /*** Structure pour la position dans le menu Py ***/
30 /**************************************************/
31 struct mPy {      // DepX==-1 si derniere entr�e
32   int DepX,DepY;
33   int FinX,FinY;
34   int Py;
35   bool Valide;   // Si doit valider un enter quand click de la sourie
36 };
37 
38 struct mBoutton { // DepX=-1 si derniere entr�e
39   int DepX,DepY;
40   int FinX,FinY;
41   int Valeur;
42   int *Adr;
43 };
44 
45 /*** D�finition de la class Tableau ***/
46 /**************************************/
47 class Mouse {
48  public:
49   Mouse(void);
50   ~Mouse(void);
51 
52   void InitStart(void); // Initialise les coordonn�es de la sourie
53   void Init(struct mPy *tPy,struct mBoutton *B=NULL); // Initialise la sourie
54   void GetEvent(SDL_Event &event,int &Py); // Prend les evenements
55   void Affiche(int NumEcran);             // Affiche le curseur
56 
57   int Px,Py; // Position r�el de la sourie
58   struct mPy *tPy;   // Pointe sur coordon�es pour Py
59   struct mBoutton *Bo; // Pointe sur les coordonn�es des bouttons
60 };
61 
62 #endif
63