77631263bb0c901509a17744685f85bcb078eb74
[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 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
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)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Great Red Oystrich Makes All Chemists Sane
28  */
29
30 #ifndef _xutil_h
31 #define _xutil_h
32
33 static char *SRCID_xutil_h = "$Id$";
34
35 #ifdef HAVE_IDENT
36 #ident  "@(#) xutil.h 1.5 11/11/92"
37 #endif /* HAVE_IDENT */
38
39 #include "typedefs.h"
40 #include "writeps.h"
41 #include "Xstuff.h"
42 #include "x11.h"
43
44 #define OFFS_X          4
45 #define OFFS_Y          4
46
47 typedef struct {
48   Window self,Parent;
49   unsigned long  color;
50   char   *text;
51   bool   bFocus;
52   int    x,y,width,height,bwidth;
53   Cursor cursor;
54 } t_windata;
55
56 extern int CheckWin(Window win,char *file, int line);
57
58 #define CheckWindow(win) CheckWin(win,__FILE__,__LINE__)
59
60 extern void LightBorder(Display *disp, Window win, unsigned long color);
61
62 extern void SpecialTextInRect(t_x11 *x11,XFontStruct *font,Drawable win,
63                               char *s,int x,int y,int width,int height,
64                               eXPos eX,eYPos eY);
65
66 extern void TextInRect(t_x11 *x11, Drawable win,
67                        char *s, int x, int y, int width, int height,
68                        eXPos eX, eYPos eY);
69
70 extern void TextInWin(t_x11 *x11, t_windata *win, char *s, eXPos eX, eYPos eY);
71
72 extern void InitWin(t_windata *win, int x0,int y0, int w, int h, int bw, char *text);
73
74 extern void FreeWin(Display *disp, t_windata *win);
75
76 extern void ExposeWin(Display *disp,Window win);
77
78 extern void RectWin(Display *disp, GC gc, t_windata *win, unsigned long color);
79
80 extern void XDrawRoundRect(Display *disp, Window win, GC gc,
81                            int x, int y, int w, int h);
82
83 extern void RoundRectWin(Display *disp, GC gc, t_windata *win,
84                          int offsx, int offsy,unsigned long color);
85
86 extern void PushMouse(Display *disp, Window dest, int x, int y);
87
88 extern void PopMouse(Display *disp);
89
90 extern bool HelpPressed(XEvent *event);
91
92 extern bool GrabOK(FILE *out, int err);
93 /* Return TRUE if grab succeeded, prints a message to out 
94  * and returns FALSE otherwise.
95  */
96
97 #endif  /* _xutil_h */