4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Great Red Oystrich Makes All Chemists Sane
29 static char *SRCID_logo_c
= "$Id$";
50 void show_logo(t_x11
*x11
,t_logo
*logo
)
52 XMapWindow(x11
->disp
,logo
->wd
.self
);
53 XMapSubwindows(x11
->disp
,logo
->wd
.self
);
56 void hide_logo(t_x11
*x11
,t_logo
*logo
)
58 XUnmapWindow(x11
->disp
,logo
->wd
.self
);
61 static bool LogoCallBack(t_x11
*x11
,XEvent
*event
, Window w
, void *data
)
63 /* Assume window is 100x110 */
64 static bool bFirst
=TRUE
;
70 static t_circle c
[] = {
71 { 10,YOFFS
+12,CSIZE
,&LIGHTGREEN
},
72 { 20,YOFFS
+22,CSIZE
,&LIGHTGREEN
},
73 { 20,YOFFS
+34,OSIZE
,&LIGHTRED
},
74 { 30,YOFFS
+12,NSIZE
,&LIGHTCYAN
},
75 { 30,YOFFS
+ 2,HSIZE
,&WHITE
},
76 { 40,YOFFS
+22,CSIZE
,&LIGHTGREEN
},
77 { 40,YOFFS
+34,CSIZE
,&LIGHTGREEN
},
78 { 50,YOFFS
+12,CSIZE
,&LIGHTGREEN
},
79 { 50,YOFFS
,OSIZE
,&LIGHTRED
},
80 { 60,YOFFS
+22,NSIZE
,&LIGHTCYAN
},
81 { 60,YOFFS
+32,HSIZE
, &WHITE
},
82 { 70,YOFFS
+12,CSIZE
,&LIGHTGREEN
},
83 { 80,YOFFS
+22,CSIZE
,&LIGHTGREEN
},
84 { 80,YOFFS
+34,OSIZE
,&LIGHTRED
},
85 { 90,YOFFS
+12,NSIZE
,&LIGHTCYAN
},
86 { 90,YOFFS
+ 2,HSIZE
,&WHITE
},
87 {100,YOFFS
+22,CSIZE
,&LIGHTGREEN
}
89 static int lines
[] = {
90 0,1, 1,2, 1,3, 3,4, 3,5, 5,6, 5,7, 7,8, 7,9,
91 9,10, 9,11, 11,12, 12,13, 12,14, 14,15, 14,16
94 static t_mess Mess
[] = {
95 { "GROMACS", 0, 20, NULL
},
96 { NULL
, 16, 9, NULL
},
97 { "Copyright (c) 1991-1998", COFFS
+ 2, 9, NULL
},
98 { "Dept. of Biophysical Chemistry", COFFS
+11, 9, NULL
},
99 { "University of Groningen", COFFS
+20, 9, NULL
},
100 { "click to dismiss", COFFS
+31, 8, NULL
}
102 #define NMESS asize(Mess)
111 wfac
=wd
->width
/110.0;
112 hfac
=wd
->height
/110.0;
113 for(i
=0; (i
<asize(c
)); i
++) {
117 Mess
[1].text
=GromacsVersion();
118 for(i
=0; (i
<NMESS
); i
++) {
121 Mess
[i
].fnt
= (i
==0) ? logo
->bigfont
: (i
==NMESS
-1) ? x11
->font
:
126 switch (event
->type
) {
128 XSetForeground(x11
->disp
,x11
->gc
,WHITE
);
129 XSetLineAttributes(x11
->disp
,x11
->gc
,3,LineSolid
,CapNotLast
,JoinRound
);
130 for(i
=0; (i
<asize(lines
)); i
+=2) {
131 XDrawLine(x11
->disp
,wd
->self
,x11
->gc
,
132 c
[lines
[i
]].x
,c
[lines
[i
]].y
,c
[lines
[i
+1]].x
,c
[lines
[i
+1]].y
);
134 XSetLineAttributes(x11
->disp
,x11
->gc
,1,LineSolid
,CapNotLast
,JoinRound
);
135 for(i
=0; (i
<asize(c
)); i
++) {
136 XSetForeground(x11
->disp
,x11
->gc
,*(c
[i
].col
));
137 XFillCircle(x11
->disp
,wd
->self
,x11
->gc
,c
[i
].x
,c
[i
].y
,c
[i
].rad
);
139 XSetForeground(x11
->disp
,x11
->gc
,BLACK
);
140 XDrawRectangle(x11
->disp
,wd
->self
,x11
->gc
,2,2,wd
->width
-5,wd
->height
-5);
141 for(i
=0; (i
<asize(Mess
)); i
++)
142 SpecialTextInRect(x11
,Mess
[i
].fnt
,wd
->self
,Mess
[i
].text
,
143 0,Mess
[i
].y
,wd
->width
,Mess
[i
].h
,
145 XSetForeground(x11
->disp
,x11
->gc
,x11
->fg
);
157 t_logo
*init_logo(t_x11
*x11
,Window parent
)
159 static char *bfname
[]= {
160 "-b&h-lucida-bold-i-normal-sans-34-240-100-100-p-215-iso8859-1",
161 "-b&h-lucida-bold-i-normal-sans-26-190-100-100-p-166-iso8859-1",
162 "lucidasans-bolditalic-24",
163 "lucidasans-italic-24",
167 #define NBF asize(bfname)
168 static char *sfname
[]= {
169 "lucidasans-bold-18",
173 #define NSF asize(sfname)
180 InitWin(&logo
->wd
,0,0,360,270,1,"GROMACS");
182 if ((newcol
=getenv("LOGO"))!=NULL
)
183 GetNamedColor(x11
,newcol
,&bg
);
184 logo
->wd
.self
=XCreateSimpleWindow(x11
->disp
,parent
,
185 logo
->wd
.x
, logo
->wd
.y
,
186 logo
->wd
.width
,logo
->wd
.height
,
187 logo
->wd
.bwidth
,WHITE
,bg
);
188 for (i
=0,logo
->bigfont
=NULL
; (i
<NBF
); i
++)
189 if ((logo
->bigfont
=XLoadQueryFont(x11
->disp
,bfname
[i
]))!=NULL
)
196 fprintf(stderr
,"Big Logofont: %s\n",bfname
[i
]);
198 for (i
=0,logo
->smallfont
=NULL
; (i
<NSF
); i
++)
199 if ((logo
->smallfont
=XLoadQueryFont(x11
->disp
,sfname
[i
]))!=NULL
)
206 fprintf(stderr
,"Small Logofont: %s\n",sfname
[i
]);
208 x11
->RegisterCallback(x11
,logo
->wd
.self
,parent
,LogoCallBack
,logo
);
209 x11
->SetInputMask(x11
,logo
->wd
.self
,ButtonPressMask
| ExposureMask
);
214 void done_logo(t_x11
*x11
,t_logo
*logo
)
216 x11
->UnRegisterCallback(x11
,logo
->wd
.self
);