1 /***************************************************************************
2 
3     file                 : racemantools.h
4     created              : Sat Mar 18 23:33:01 CET 2000
5     copyright            : (C) 2000-2013 by Eric Espie, Bernhard Wymann
6     email                : torcs@free.fr
7     version              : $Id: racescreens.h,v 1.2.2.6 2014/05/20 11:02:18 berniw Exp $
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  *                                                                         *
13  *   This program is free software; you can redistribute it and/or modify  *
14  *   it under the terms of the GNU General Public License as published by  *
15  *   the Free Software Foundation; either version 2 of the License, or     *
16  *   (at your option) any later version.                                   *
17  *                                                                         *
18  ***************************************************************************/
19 
20 #ifndef __RACEMANTOOLS_H__
21 #define __RACEMANTOOLS_H__
22 
23 #include <car.h>
24 #include <raceman.h>
25 #include <track.h>
26 #include <simu.h>
27 
28 
29 /** @brief Structure for track selection
30  *  @ingroup racemantools
31  */
32 typedef struct
33 {
34 	void *param;			/**< Pointer to race manager parameter set (to set the track) */
35 	void *prevScreen;		/**< Race manager screen to go back */
36 	void *nextScreen;		/**< Race manager screen to go after select */
37 	tTrackItf trackItf;		/**< Track module interface */
38 } tRmTrackSelect;
39 
40 
41 /** @brief Structure for driver selection
42  *  @ingroup racemantools
43  */
44 typedef struct
45 {
46 	void *param;		/**< Pointer to race manager parameter set (to set the driver) */
47 	void *prevScreen;	/**< Race manager screen to go back */
48 	void *nextScreen;	/**< Race manager screen to go after select */
49 } tRmDrvSelect;
50 
51 
52 /** @brief Structure for configuring parameters
53  *  @ingroup racemantools
54  */
55 typedef struct
56 {
57 	void *param;			/**< Pointer to race manager parameter set (to set the parameters) */
58 	void *prevScreen;		/**< Race manager screen to go back */
59 	void *nextScreen;		/**< Race manager screen to go after select */
60 	const char *title;		/**< Title for race parameters (for screen title) */
61 	unsigned int confMask;	/**< Tell what to configure */
62 #define RM_CONF_RACE_LEN	0x00000001
63 #define RM_CONF_DISP_MODE	0x00000002
64 } tRmRaceParam;
65 
66 
67 /** @brief Callback function definition for handling file selection
68  *  @ingroup racemantools
69  */
70 typedef void (*tfSelectFile) (char *);
71 
72 
73 /** @brief Structure for file selection
74  *  @ingroup racemantools
75  */
76 typedef struct
77 {
78 	const char *title;		/**< Title for file selection (for screen title) */
79 	char *path;				/**< Directory containing the files to list */
80 	void *prevScreen;		/**< Link to previous screen */
81 	tfSelectFile select;	/**< Callback function to handle the selection (store the selection in the caller) */
82 } tRmFileSelect;
83 
84 
85 extern void RmTrackSelect(void * /* vs */);
86 extern char *RmGetTrackName(char * /* category */, char * /* trackName */);
87 extern char *RmGetCategoryName(char /* *category*/);
88 
89 extern void RmDriversSelect(void * /* vs */);
90 
91 extern void RmPitMenuStart(tCarElt * /* car */, tRmInfo *rmInfo, void * /* userdata */, tfuiCallback /* callback */);
92 extern void *RmCarSetupScreenInit(void *prevMenu, tCarElt *car, tRmInfo* reInfo);
93 
94 extern void RmLoadingScreenStart(const char * /* text */, const char * /* bgimg */);
95 extern void RmLoadingScreenSetText(const char * /* text */);
96 extern void RmShutdownLoadingScreen(void);
97 
98 extern void RmShowResults(void * /* prevHdle */, tRmInfo * /* info */);
99 
100 extern void *RmTwoStateScreen(const char *title,
101 			      const char *label1, const char *tip1, void *screen1,
102 			      const char *label2, const char *tip2, void *screen2);
103 
104 extern void *RmTriStateScreen(const char *title,
105 			      const char *label1, const char *tip1, void *screen1,
106 			      const char *label2, const char *tip2, void *screen2,
107 			      const char *label3, const char *tip3, void *screen3);
108 
109 extern void *RmFourStateScreen(const char *title,
110 			       const char *label1, const char *tip1, void *screen1,
111 			       const char *label2, const char *tip2, void *screen2,
112 			       const char *label3, const char *tip3, void *screen3,
113 			       const char *label4, const char *tip4, void *screen4);
114 
115 extern void *RmNStateScreen(
116 					 const char *title,
117 					 const char** label,
118 					 const char** tip,
119 					 void** screen,
120 					 const int n
121 );
122 
123 extern void RmDisplayStartRace(tRmInfo *info, void *startScr, void *abortScr);
124 
125 
126 extern void RmRaceParamMenu(void *vrp);
127 
128 extern void RmShowStandings(void *prevHdle, tRmInfo *info);
129 
130 extern void RmFileSelect(void *vs);
131 
132 #endif /* __RACEMANTOOLS_H__ */
133 
134