3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * Gyas ROwers Mature At Cryogenic Speed
58 void show_logo(t_x11 *x11,t_logo *logo)
60 XMapWindow(x11->disp,logo->wd.self);
61 XMapSubwindows(x11->disp,logo->wd.self);
64 void hide_logo(t_x11 *x11,t_logo *logo)
66 XUnmapWindow(x11->disp,logo->wd.self);
69 static gmx_bool LogoCallBack(t_x11 *x11,XEvent *event, Window w, void *data)
71 /* Assume window is 100x110 */
72 static gmx_bool bFirst=TRUE;
78 static t_circle c[] = {
79 { 10,YOFFS+12,CSIZE,&LIGHTGREEN },
80 { 20,YOFFS+22,CSIZE,&LIGHTGREEN },
81 { 20,YOFFS+34,OSIZE,&LIGHTRED },
82 { 30,YOFFS+12,NSIZE,&LIGHTCYAN },
83 { 30,YOFFS+ 2,HSIZE ,&WHITE },
84 { 40,YOFFS+22,CSIZE,&LIGHTGREEN },
85 { 40,YOFFS+34,CSIZE,&LIGHTGREEN },
86 { 50,YOFFS+12,CSIZE,&LIGHTGREEN },
87 { 50,YOFFS ,OSIZE,&LIGHTRED },
88 { 60,YOFFS+22,NSIZE,&LIGHTCYAN },
89 { 60,YOFFS+32,HSIZE, &WHITE },
90 { 70,YOFFS+12,CSIZE,&LIGHTGREEN },
91 { 80,YOFFS+22,CSIZE,&LIGHTGREEN },
92 { 80,YOFFS+34,OSIZE,&LIGHTRED },
93 { 90,YOFFS+12,NSIZE,&LIGHTCYAN },
94 { 90,YOFFS+ 2,HSIZE,&WHITE },
95 {100,YOFFS+22,CSIZE,&LIGHTGREEN }
97 static int lines[] = {
98 0,1, 1,2, 1,3, 3,4, 3,5, 5,6, 5,7, 7,8, 7,9,
99 9,10, 9,11, 11,12, 12,13, 12,14, 14,15, 14,16
102 static t_mess Mess[] = {
103 { "GROMACS", 0, 20, NULL },
104 { NULL, 16, 9, NULL },
105 { "Copyright (c) 1991-2010", COFFS+ 2, 9, NULL },
106 { "D.v.d.Spoel, E.Lindahl, B.Hess", COFFS+11, 9, NULL },
107 { "& Groningen University ", COFFS+20, 9, NULL },
108 { "click to dismiss", COFFS+31, 8, NULL }
110 #define NMESS asize(Mess)
119 wfac=wd->width/110.0;
120 hfac=wd->height/110.0;
121 for(i=0; (i<asize(c)); i++) {
125 Mess[1].text=GromacsVersion();
126 for(i=0; (i<NMESS); i++) {
129 Mess[i].fnt = (i==0) ? logo->bigfont : (i==NMESS-1) ? x11->font :
134 switch (event->type) {
136 XSetForeground(x11->disp,x11->gc,WHITE);
137 XSetLineAttributes(x11->disp,x11->gc,3,LineSolid,CapNotLast,JoinRound);
138 for(i=0; (i<asize(lines)); i+=2) {
139 XDrawLine(x11->disp,wd->self,x11->gc,
140 c[lines[i]].x,c[lines[i]].y,c[lines[i+1]].x,c[lines[i+1]].y);
142 XSetLineAttributes(x11->disp,x11->gc,1,LineSolid,CapNotLast,JoinRound);
143 for(i=0; (i<asize(c)); i++) {
144 XSetForeground(x11->disp,x11->gc,*(c[i].col));
145 XFillCircle(x11->disp,wd->self,x11->gc,c[i].x,c[i].y,c[i].rad);
147 XSetForeground(x11->disp,x11->gc,BLACK);
148 XDrawRectangle(x11->disp,wd->self,x11->gc,2,2,wd->width-5,wd->height-5);
149 for(i=0; (i<asize(Mess)); i++)
150 SpecialTextInRect(x11,Mess[i].fnt,wd->self,Mess[i].text,
151 0,Mess[i].y,wd->width,Mess[i].h,
153 XSetForeground(x11->disp,x11->gc,x11->fg);
157 return logo->bQuitOnClick;
166 t_logo *init_logo(t_x11 *x11,Window parent,gmx_bool bQuitOnClick)
168 static const char *bfname[]= {
169 "-b&h-lucida-bold-i-normal-sans-34-240-100-100-p-215-iso8859-1",
170 "-b&h-lucida-bold-i-normal-sans-26-190-100-100-p-166-iso8859-1",
171 "lucidasans-bolditalic-24",
172 "lucidasans-italic-24",
176 #define NBF asize(bfname)
177 static const char *sfname[]= {
178 "lucidasans-bold-18",
182 #define NSF asize(sfname)
189 logo->bQuitOnClick = bQuitOnClick;
190 InitWin(&logo->wd,0,0,360,270,1,"GROMACS");
192 if ((newcol=getenv("LOGO"))!=NULL)
193 GetNamedColor(x11,newcol,&bg);
194 logo->wd.self=XCreateSimpleWindow(x11->disp,parent,
195 logo->wd.x, logo->wd.y,
196 logo->wd.width,logo->wd.height,
197 logo->wd.bwidth,WHITE,bg);
198 for (i=0,logo->bigfont=NULL; (i<NBF); i++)
199 if ((logo->bigfont=XLoadQueryFont(x11->disp,bfname[i]))!=NULL)
206 fprintf(stderr,"Big Logofont: %s\n",bfname[i]);
208 for (i=0,logo->smallfont=NULL; (i<NSF); i++)
209 if ((logo->smallfont=XLoadQueryFont(x11->disp,sfname[i]))!=NULL)
216 fprintf(stderr,"Small Logofont: %s\n",sfname[i]);
218 x11->RegisterCallback(x11,logo->wd.self,parent,LogoCallBack,logo);
219 x11->SetInputMask(x11,logo->wd.self,ButtonPressMask | ExposureMask);
224 void done_logo(t_x11 *x11,t_logo *logo)
226 x11->UnRegisterCallback(x11,logo->wd.self);