Moved ngmx to C++, renamed it to view.
[alexxy/gromacs.git] / src / programs / view / logo.cpp
similarity index 94%
rename from src/ngmx/logo.c
rename to src/programs/view/logo.cpp
index 4a4dbb5e9b10127ae2d67df80d2f69dcc614ffba..f0980df08261bdfe3186367a7d8fca9f09b4daf1 100644 (file)
@@ -9,7 +9,7 @@
  *                        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
 #endif
 
 #include "sysstuff.h"
+#include "macros.h"
 #include "xutil.h"
 #include "Xstuff.h"
 #include "smalloc.h"
-#include "macros.h"
 #include "copyrite.h"
 #include "logo.h"
 
@@ -66,10 +66,10 @@ void hide_logo(t_x11 *x11, t_logo *logo)
     XUnmapWindow(x11->disp, logo->wd.self);
 }
 
-static gmx_bool LogoCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
+static bool LogoCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
 {
     /* Assume window is 100x110 */
-    static gmx_bool bFirst = TRUE;
+    static bool bFirst = true;
 #define CSIZE 9
 #define NSIZE 8
 #define OSIZE 9
@@ -84,7 +84,7 @@ static gmx_bool LogoCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
         { 40, YOFFS+22, CSIZE, &LIGHTGREEN },
         { 40, YOFFS+34, CSIZE, &LIGHTGREEN },
         { 50, YOFFS+12, CSIZE, &LIGHTGREEN },
-        { 50, YOFFS, OSIZE, &LIGHTRED   },
+        { 50, YOFFS,    OSIZE, &LIGHTRED   },
         { 60, YOFFS+22, NSIZE, &LIGHTCYAN  },
         { 60, YOFFS+32, HSIZE, &WHITE     },
         { 70, YOFFS+12, CSIZE, &LIGHTGREEN },
@@ -102,7 +102,7 @@ static gmx_bool LogoCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
     static t_mess   Mess[] = {
         { "GROMACS",                         0,       20, NULL },
         { NULL,                             16,        9, NULL },
-        { "Copyright (c) 1991-2010",        COFFS+ 2,  9, NULL },
+        { "Copyright (c) 1991-2013",        COFFS+ 2,  9, NULL },
         { "D.v.d.Spoel, E.Lindahl, B.Hess", COFFS+11,  9, NULL },
         { "& Groningen University ",        COFFS+20,  9, NULL },
         { "click to dismiss",               COFFS+31,  8, NULL }
@@ -132,7 +132,7 @@ static gmx_bool LogoCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
             Mess[i].fnt = (i == 0) ? logo->bigfont : (i == NMESS-1) ? x11->font :
                 logo->smallfont;
         }
-        bFirst = FALSE;
+        bFirst = false;
     }
     switch (event->type)
     {
@@ -152,7 +152,7 @@ static gmx_bool LogoCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
             }
             XSetForeground(x11->disp, x11->gc, BLACK);
             XDrawRectangle(x11->disp, wd->self, x11->gc, 2, 2, wd->width-5, wd->height-5);
-            for (i = 0; (i < asize(Mess)); i++)
+            for (i = 0; (i < NMESS); i++)
             {
                 SpecialTextInRect(x11, Mess[i].fnt, wd->self, Mess[i].text,
                                   0, Mess[i].y, wd->width, Mess[i].h,
@@ -168,10 +168,10 @@ static gmx_bool LogoCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
             break;
     }
 
-    return FALSE;
+    return false;
 }
 
-t_logo *init_logo(t_x11 *x11, Window parent, gmx_bool bQuitOnClick)
+t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
 {
     static const char *bfname[] = {
         "-b&h-lucida-bold-i-normal-sans-34-240-100-100-p-215-iso8859-1",
@@ -188,7 +188,7 @@ t_logo *init_logo(t_x11 *x11, Window parent, gmx_bool bQuitOnClick)
         "fixed"
     };
 #define NSF asize(sfname)
-    int                i;
+    unsigned int       i;
     unsigned long      bg;
     char              *newcol;
     t_logo            *logo;