37#include <portability.h>
49static float aColor[] = { 1.0, 0.0, 0.0, 1.0 };
155 const int BUFSIZE = 1024;
168 while (name != NULL) {
192 const int BUFSIZE = 1024;
207 snprintf(buf, BUFSIZE,
"drivers/%s/%s.xml", curDrv->
dname, curDrv->
dname);
211 if (robhdle != NULL) {
262 if ((curDrv->
index == robotIdx) && (strcmp(curDrv->
dname, cardllname) == 0)) {
276 if ((strlen(cardllname) == 0) || (curDrv->
human)) {
317 const int BUFSIZE = 1024;
380 snprintf(buf, BUFSIZE,
"%sdrivers",
GetLibDir ());
384 if (curmod != NULL) {
386 curmod = curmod->
next;
389 sp = strrchr(curmod->
sopath,
'/');
396 dname[strlen(dname) - strlen(DLLEXT) - 1] = 0;
397 snprintf(buf, BUFSIZE,
"%sdrivers/%s/%s.xml",
GetLocalDir(), dname, dname);
400 snprintf(buf, BUFSIZE,
"drivers/%s/%s.xml", dname, dname);
410 snprintf(path, BUFSIZE,
"cars/%s/%s.xml", carName, carName);
411 if (!stat(path, &st)) {
416 curDrv->
dname = strdup(dname);
418 curDrv->
car = carhdle;
427 GfOut(
"Driver %s not selected because car %s is not readable\n", curmod->
modInfo[i].
name, carName);
430 GfOut(
"Driver %s not selected because car %s is not present\n", curmod->
modInfo[i].
name, carName);
435 }
while (curmod != list);
444 for (i = 1; i < nCars+1; i++) {
451 if (curDrv != NULL) {
453 if ((curDrv->
index == robotIdx || strcmp(curDrv->
name, robotName) == 0) && (strcmp(curDrv->
dname, cardllname) == 0)) {
456 curDrv->sel = index++;
466 if (curDrv != NULL) {
468 if (curDrv->
sel == 0) {
478 if (curDrv != NULL) {
480 if ((curDrv->
index == robotIdx) && (strcmp(curDrv->
dname, cardllname) == 0)) {
486 if (curDrv == NULL) {
490 if (curDrv == NULL) {
static int nbSelectedDrivers
static void rmdsDeactivate(void *screen)
static void rmdsAcceptFocus(void)
static void rmdsUpdateAcceptTip(void)
static int unselectedScrollList
static void rmFreeDrvList(void)
static void rmMove(int delta)
static int PickDrvNameLabelId
static int AcceptDisabledTipLabelId
static void rmdsUpdateAcceptState(void)
static int AcceptTipLabelId
static int PickDrvCategoryLabelId
static void rmdsSelect(void)
static void rmdsAcceptFocusLost(void)
static void rmdsSetFocus(void)
static int selectedScrollList
static const char * AcceptTipMessage
static const char * NoDriverSelectedMessage
static int nbMaxSelectedDrivers
static void rmdsAddKeys(void)
static void rmdsClickOnDriver(void)
static int PickDrvCarLabelId
static int AcceptButtonId
static void rmSelectDeselect(void)
static void rmdsActivate(void)
int GfuiButtonGetFocused(void)
Get the Id of the button focused in the current screen.
void * GfuiScreenCreateExAction(float *bgColor, const tGfuiAction &onActivate, const tGfuiAction &onDeactivate, int mouseAllowed)
Create a screen.
void GfuiHelpScreen(void *prevScreen)
Generate a help screen.
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
int GfuiFontHeight(int font)
Get the height of an initialized GUI font.
void GfuiScreenRelease(void *scr)
Release the given screen.
int GfuiScrollListCreateAction(void *scr, int font, int x, int y, int align, int width, int height, int scrollBarPos, const tGfuiAction &onSelect)
Create a new scroll list.
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
void GfuiAddKeyAction(void *scr, unsigned char key, const char *descr, const tGfuiAction &onKeyPressed, const tGfuiAction &onKeyReleased)
Add a Keyboard callback to a screen.
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
int GfuiScrollListInsertElement(void *scr, int Id, char *element, int index, void *userData)
Insert an element in a scroll list.
int GfuiVisibilitySet(void *scr, int id, int visible)
Set/unset the visibility attribute of an object.
void GfuiAddSKeyAction(void *scr, int key, const char *descr, const tGfuiAction &onKeyPressed, const tGfuiAction &onKeyReleased)
Add a Special Keyboard shortcut to the screen.
char * GfuiScrollListExtractElement(void *scr, int Id, int index, void **userData)
Extract the specified element from the scroll list.
int GfuiEnable(void *scr, int id, int flag)
Enable / Disable an object.
char * GfuiScrollListGetSelectedElement(void *scr, int Id, void **userData)
Get the selected element from the scroll list.
char * GfuiScrollListExtractSelectedElement(void *scr, int Id, void **userData)
Extract the selected element from the scroll list (removed).
int GfuiTipCreate(void *scr, const char *text, int maxlen)
Add a Tip (generally associated with a button).
char * GfuiScrollListGetElement(void *scr, int Id, int index, void **userData)
Get the specified element from the scroll list.
int GfuiLabelCreateEx(void *scr, const char *text, float *fgColor, int font, int x, int y, int align, int maxlen)
Create a new label (extended version).
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
int GfuiScreenIsActive(void *screen)
Tell if the screen is active or not.
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
int GfuiButtonCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, const tGfuiAction &onPush, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
Add a button to a screen.
int GfuiScrollListMoveSelectedElement(void *scr, int Id, int delta)
Move the selected element within the scroll list.
int GfModFreeInfoList(tModList **modlist)
Free the info contained in the specified list.
int GfModInfoDir(unsigned int gfid, char *dir, int level, tModList **modlist)
Get the generic module information of the DLLs of the specified directory.
const char * GfParmGetStr(void *parmHandle, const char *path, const char *key, const char *deflt)
Get a string parameter from the parameter set handle.
int GfParmSetStr(void *handle, const char *path, const char *key, const char *val)
Set a string parameter in the parameter set handle.
tdble GfParmGetNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt)
Get a numerical parameter from the parameter set handle.
char * GfParmGetName(void *handle)
Get the name property of the parameter set handle.
int GfParmSetNum(void *handle, const char *path, const char *key, const char *unit, tdble val)
Set a numerical parameter in the parameter set handle.
void GfParmReleaseHandle(void *parmHandle)
Release given parameter set handle parmHandle.
void * GfParmReadFile(const char *file, int mode)
Read parameter set from file and return handle to parameter set.
int GfParmListClean(void *handle, const char *path)
Remove all the subsections in a section in the parameter set handle.
int GfParmGetEltNb(void *handle, const char *path)
Count the number of subsections in a section in the parameter set handle.
void GfuiScreenShot(void *)
Save a screen shot in png format.
#define GF_TAILQ_INSERT_TAIL(head, elm, field)
Insert an element at the tail.
#define GF_TAILQ_INIT(head)
Head initialization (Mandatory)
#define GF_TAILQ_HEAD(name, type)
Head type definition.
#define GF_TAILQ_NEXT(elm, field)
Next element of a TAILQ.
#define GF_TAILQ_REMOVE(head, elm, field)
Remove an element.
#define GF_TAILQ_FIRST(head)
First element of a TAILQ.
#define GF_TAILQ_INSERT_HEAD(head, elm, field)
Insert an element at the head.
#define RM_ATTR_FOCUSEDIDX
GF_TAILQ_ENTRY(struct DrvElt) link
int index
index if multiple interface in one dll
char * name
name of the module (short) (NULL if no module)
tModInfo modInfo[MAX_MOD_ITF]
module info list for this dll
char * sopath
path name of file
struct ModList * next
next module in list
Structure for driver selection.
#define GFPARM_RMODE_STD
Return a new handle sharing cached data for this filename, if available.
#define MAX_MOD_ITF
Maximum number of interface in one DLL.
struct ModList tModList
list of module interfaces
#define GFUI_INVISIBLE
Object invisibility flag.
#define GFUI_FONT_MEDIUM_C
std::function< void()> tGfuiAction
#define GFUI_VISIBLE
Object visibility flag.