4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * Good gRace! Old Maple Actually Chews Slate
36 static char *SRCID_logo_c = "$Id$";
56 void show_logo(t_x11 *x11,t_logo *logo)
58 XMapWindow(x11->disp,logo->wd.self);
59 XMapSubwindows(x11->disp,logo->wd.self);
62 void hide_logo(t_x11 *x11,t_logo *logo)
64 XUnmapWindow(x11->disp,logo->wd.self);
67 static bool LogoCallBack(t_x11 *x11,XEvent *event, Window w, void *data)
69 /* Assume window is 100x110 */
70 static bool bFirst=TRUE;
76 static t_circle c[] = {
77 { 10,YOFFS+12,CSIZE,&LIGHTGREEN },
78 { 20,YOFFS+22,CSIZE,&LIGHTGREEN },
79 { 20,YOFFS+34,OSIZE,&LIGHTRED },
80 { 30,YOFFS+12,NSIZE,&LIGHTCYAN },
81 { 30,YOFFS+ 2,HSIZE ,&WHITE },
82 { 40,YOFFS+22,CSIZE,&LIGHTGREEN },
83 { 40,YOFFS+34,CSIZE,&LIGHTGREEN },
84 { 50,YOFFS+12,CSIZE,&LIGHTGREEN },
85 { 50,YOFFS ,OSIZE,&LIGHTRED },
86 { 60,YOFFS+22,NSIZE,&LIGHTCYAN },
87 { 60,YOFFS+32,HSIZE, &WHITE },
88 { 70,YOFFS+12,CSIZE,&LIGHTGREEN },
89 { 80,YOFFS+22,CSIZE,&LIGHTGREEN },
90 { 80,YOFFS+34,OSIZE,&LIGHTRED },
91 { 90,YOFFS+12,NSIZE,&LIGHTCYAN },
92 { 90,YOFFS+ 2,HSIZE,&WHITE },
93 {100,YOFFS+22,CSIZE,&LIGHTGREEN }
95 static int lines[] = {
96 0,1, 1,2, 1,3, 3,4, 3,5, 5,6, 5,7, 7,8, 7,9,
97 9,10, 9,11, 11,12, 12,13, 12,14, 14,15, 14,16
100 static t_mess Mess[] = {
101 { "GROMACS", 0, 20, NULL },
102 { NULL, 16, 9, NULL },
103 { "Copyright (c) 1991-1998", COFFS+ 2, 9, NULL },
104 { "Dept. of Biophysical Chemistry", COFFS+11, 9, NULL },
105 { "University of Groningen", COFFS+20, 9, NULL },
106 { "click to dismiss", COFFS+31, 8, NULL }
108 #define NMESS asize(Mess)
117 wfac=wd->width/110.0;
118 hfac=wd->height/110.0;
119 for(i=0; (i<asize(c)); i++) {
123 Mess[1].text=GromacsVersion();
124 for(i=0; (i<NMESS); i++) {
127 Mess[i].fnt = (i==0) ? logo->bigfont : (i==NMESS-1) ? x11->font :
132 switch (event->type) {
134 XSetForeground(x11->disp,x11->gc,WHITE);
135 XSetLineAttributes(x11->disp,x11->gc,3,LineSolid,CapNotLast,JoinRound);
136 for(i=0; (i<asize(lines)); i+=2) {
137 XDrawLine(x11->disp,wd->self,x11->gc,
138 c[lines[i]].x,c[lines[i]].y,c[lines[i+1]].x,c[lines[i+1]].y);
140 XSetLineAttributes(x11->disp,x11->gc,1,LineSolid,CapNotLast,JoinRound);
141 for(i=0; (i<asize(c)); i++) {
142 XSetForeground(x11->disp,x11->gc,*(c[i].col));
143 XFillCircle(x11->disp,wd->self,x11->gc,c[i].x,c[i].y,c[i].rad);
145 XSetForeground(x11->disp,x11->gc,BLACK);
146 XDrawRectangle(x11->disp,wd->self,x11->gc,2,2,wd->width-5,wd->height-5);
147 for(i=0; (i<asize(Mess)); i++)
148 SpecialTextInRect(x11,Mess[i].fnt,wd->self,Mess[i].text,
149 0,Mess[i].y,wd->width,Mess[i].h,
151 XSetForeground(x11->disp,x11->gc,x11->fg);
163 t_logo *init_logo(t_x11 *x11,Window parent)
165 static char *bfname[]= {
166 "-b&h-lucida-bold-i-normal-sans-34-240-100-100-p-215-iso8859-1",
167 "-b&h-lucida-bold-i-normal-sans-26-190-100-100-p-166-iso8859-1",
168 "lucidasans-bolditalic-24",
169 "lucidasans-italic-24",
173 #define NBF asize(bfname)
174 static char *sfname[]= {
175 "lucidasans-bold-18",
179 #define NSF asize(sfname)
186 InitWin(&logo->wd,0,0,360,270,1,"GROMACS");
188 if ((newcol=getenv("LOGO"))!=NULL)
189 GetNamedColor(x11,newcol,&bg);
190 logo->wd.self=XCreateSimpleWindow(x11->disp,parent,
191 logo->wd.x, logo->wd.y,
192 logo->wd.width,logo->wd.height,
193 logo->wd.bwidth,WHITE,bg);
194 for (i=0,logo->bigfont=NULL; (i<NBF); i++)
195 if ((logo->bigfont=XLoadQueryFont(x11->disp,bfname[i]))!=NULL)
202 fprintf(stderr,"Big Logofont: %s\n",bfname[i]);
204 for (i=0,logo->smallfont=NULL; (i<NSF); i++)
205 if ((logo->smallfont=XLoadQueryFont(x11->disp,sfname[i]))!=NULL)
212 fprintf(stderr,"Small Logofont: %s\n",sfname[i]);
214 x11->RegisterCallback(x11,logo->wd.self,parent,LogoCallBack,logo);
215 x11->SetInputMask(x11,logo->wd.self,ButtonPressMask | ExposureMask);
220 void done_logo(t_x11 *x11,t_logo *logo)
222 x11->UnRegisterCallback(x11,logo->wd.self);