Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / src / ngmx / xutil.h
1 /*
2  * $Id$
3  * 
4  *                This source code is part of
5  * 
6  *                 G   R   O   M   A   C   S
7  * 
8  *          GROningen MAchine for Chemical Simulations
9  * 
10  *                        VERSION 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
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.
20  * 
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.
27  * 
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.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Good gRace! Old Maple Actually Chews Slate
35  */
36
37 #ifndef _xutil_h
38 #define _xutil_h
39
40 static char *SRCID_xutil_h = "$Id$";
41 #ifdef HAVE_IDENT
42 #ident  "@(#) xutil.h 1.5 11/11/92"
43 #endif /* HAVE_IDENT */
44
45 #include "typedefs.h"
46 #include "writeps.h"
47 #include "Xstuff.h"
48 #include "x11.h"
49
50 #define OFFS_X          4
51 #define OFFS_Y          4
52
53 typedef struct {
54   Window self,Parent;
55   unsigned long  color;
56   char   *text;
57   bool   bFocus;
58   int    x,y,width,height,bwidth;
59   Cursor cursor;
60 } t_windata;
61
62 extern int CheckWin(Window win,char *file, int line);
63
64 #define CheckWindow(win) CheckWin(win,__FILE__,__LINE__)
65
66 extern void LightBorder(Display *disp, Window win, unsigned long color);
67
68 extern void SpecialTextInRect(t_x11 *x11,XFontStruct *font,Drawable win,
69                               char *s,int x,int y,int width,int height,
70                               eXPos eX,eYPos eY);
71
72 extern void TextInRect(t_x11 *x11, Drawable win,
73                        char *s, int x, int y, int width, int height,
74                        eXPos eX, eYPos eY);
75
76 extern void TextInWin(t_x11 *x11, t_windata *win, char *s, eXPos eX, eYPos eY);
77
78 extern void InitWin(t_windata *win, int x0,int y0, int w, int h, int bw, char *text);
79
80 extern void FreeWin(Display *disp, t_windata *win);
81
82 extern void ExposeWin(Display *disp,Window win);
83
84 extern void RectWin(Display *disp, GC gc, t_windata *win, unsigned long color);
85
86 extern void XDrawRoundRect(Display *disp, Window win, GC gc,
87                            int x, int y, int w, int h);
88
89 extern void RoundRectWin(Display *disp, GC gc, t_windata *win,
90                          int offsx, int offsy,unsigned long color);
91
92 extern void PushMouse(Display *disp, Window dest, int x, int y);
93
94 extern void PopMouse(Display *disp);
95
96 extern bool HelpPressed(XEvent *event);
97
98 extern bool GrabOK(FILE *out, int err);
99 /* Return TRUE if grab succeeded, prints a message to out 
100  * and returns FALSE otherwise.
101  */
102
103 #endif  /* _xutil_h */