* VERSION 3.2.0
* Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
+ * Copyright (c) 2001-2013, The GROMACS development team,
* check out http://www.gromacs.org for more information.
* This program is free software; you can redistribute it and/or
#include <config.h>
#endif
+#include <string.h>
#include "typedefs.h"
-#include <Xstuff.h>
-#include <x11.h>
#include "sysstuff.h"
-#include <string.h>
#include "smalloc.h"
#include "string2.h"
+#include "Xstuff.h"
+#include "x11.h"
/* These colours will be mapped to black on a monochrome screen */
unsigned long BLACK, BLUE, GREEN, CYAN, RED, BROWN, GREY, DARKGREY;
"9x15", "6x13", "fixed"
};
#define MAXNAMES (sizeof(fontnames)/sizeof(fontnames[0]))
- int i;
+ unsigned int i;
XFontStruct *font;
int count;
char **fontlist;
- gmx_bool bFont = FALSE;
+ bool bFont = false;
if (name)
{
- bFont = (gmx_bool) ((font = XLQF(err, disp, name)) != NULL);
+ bFont = ((font = XLQF(err, disp, name)) != NULL);
}
else
{
for (i = 0; (!bFont && (i < MAXNAMES)); i++)
{
- bFont = (gmx_bool) ((font = XLQF(err, disp, fontnames[i])) != NULL);
+ bFont = ((font = XLQF(err, disp, fontnames[i])) != NULL);
}
if (!bFont)
fontlist = XListFonts(disp, "?", 1, &count);
if (count != 0)
{
- bFont = (gmx_bool) ((font = XLQF(err, disp, fontlist[0])) != NULL);
+ bFont = ((font = XLQF(err, disp, fontlist[0])) != NULL);
}
}
if (!bFont)
return curs;
}
-typedef struct {
- Window w;
- gmx_bool b;
-} t_peek;
-
-static Bool TestEvent(Display *disp, XEvent *event, char *arg)
-{
- t_peek *tp;
-
- fprintf(stderr, "TestEvent\n");
- tp = (t_peek *)arg;
- if ((event->xany.window == tp->w) && (event->type == ConfigureNotify))
- {
- tp->b = TRUE;
- return True;
- }
- return False;
-}
-
static void MainLoop(t_x11 *x11)
{
- gmx_bool bReturn;
+ bool bReturn;
XEvent event;
t_wlist *curs;
Window w;
- for (bReturn = FALSE; (!bReturn); )
+ for (bReturn = false; (!bReturn); )
{
if (x11->wlist)
{
curs = GetWList(x11, w);
if (!curs)
{
- bReturn = TRUE;
+ bReturn = true;
}
if (!bReturn)
{
XCloseDisplay(x11->disp);
}
-static void Xrm(int *argc, char *argv[])
-{
- /*
- static XrmOptionDescRec opTable[] = {
- {"-background", "*background",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-bd", "*borderColor",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-bg", "*background",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-borderwidth", "*TopLevelShell.borderwidth",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-bordercolor", "*borderColor",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-bw", "*TopLevelShell.borderColor",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-display", ".display",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-fg", "*foreground",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-fn", "*font",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-font", "*font",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-foreground", "*foreground",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-geometry", ".TopLevelShell.geometry",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-iconic", ".TopLevelShell.iconic",
- XrmoptionNoArg, (caddr_t) "on"},
- {"-name", ".name",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-reverse", "*reverseVideo",
- XrmoptionNoArg, (caddr_t) "on"},
- {"-rv", "*reverseVideo",
- XrmoptionNoArg, (caddr_t) "on"},
- {"-synchronous", ".synchronous",
- XrmoptionNoArg, (caddr_t) "on"},
- {"-title", ".TopLevelShell.title",
- XrmoptionSepArg, (caddr_t) NULL},
- {"-xrm", NULL,
- XrmoptionSepArg, (caddr_t) NULL},
- };
- #define TABLELENGTH (sizeof(opTable)/sizeof(opTable[0]))
- XrmInitialize();*/
-}
-
static void Flush(t_x11 *x11)
{
fflush(x11->console);
char *display;
char *fontname;
char *title, *FG = NULL, *BG = NULL;
- gmx_bool bVerbose = FALSE;
+ bool bVerbose = false;
int i;
title = strdup(argv[0]);
title = strdup(argv[++i]);
break;
case 'v':
- bVerbose = TRUE;
+ bVerbose = true;
break;
default:
ARGV[ARGC++] = argv[i];
if (x11->depth > 1)
{
/* Not B & W, Look what kind of screen we've got... */
- for (i = 0; (i < NCLASS); i++)
+ for (i = 0; (i < (int)NCLASS); i++)
{
if (!XMatchVisualInfo(x11->disp, x11->screen, x11->depth,
v_class[i], &v_info))