PageRenderTime 28ms CodeModel.GetById 32ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ngmx/Xstuff.h

https://github.com/aastr/GROMACS
C Header | 173 lines | 122 code | 13 blank | 38 comment | 0 complexity | a194393da18369a6d8b058962854a19c MD5 | raw file
Possible License(s): GPL-2.0
  1. /*
  2. *
  3. * This source code is part of
  4. *
  5. * G R O M A C S
  6. *
  7. * GROningen MAchine for Chemical Simulations
  8. *
  9. * VERSION 3.2.0
  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.
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version 2
  17. * of the License, or (at your option) any later version.
  18. *
  19. * If you want to redistribute modifications, please consider that
  20. * scientific software is very special. Version control is crucial -
  21. * bugs must be traceable. We will be happy to consider code for
  22. * inclusion in the official distribution, but derived work must not
  23. * be called official GROMACS. Details are found in the README & COPYING
  24. * files - if they are missing, get the official version at www.gromacs.org.
  25. *
  26. * To help us fund GROMACS development, we humbly ask that you cite
  27. * the papers on the package - you can find them in the top README file.
  28. *
  29. * For more info, check our website at http://www.gromacs.org
  30. *
  31. * And Hey:
  32. * Gyas ROwers Mature At Cryogenic Speed
  33. */
  34. #ifndef _Xstuff_h
  35. #define _Xstuff_h
  36. /* The altivec extensions for ppc define some stupid overlapping
  37. * macros like pixel and vector - turn them off here, we only
  38. * need them in the inner loops.
  39. */
  40. #ifdef __VEC__
  41. #undef pixel
  42. #endif
  43. #include <X11/Xlib.h>
  44. #include <X11/Xutil.h>
  45. #include <X11/keysym.h>
  46. #include <X11/cursorfont.h>
  47. #include <X11/Xresource.h>
  48. #ifdef _acc_
  49. typedef unsigned char bmchar;
  50. #else
  51. typedef char bmchar;
  52. #endif /* _acc */
  53. #define XTextHeight(font) ((font)->max_bounds.ascent+(font)->max_bounds.descent)
  54. #define XDrawCircle(disp,win,gc,x,y,rad) \
  55. XDrawArc(disp,win,gc,x-rad,y-rad,2*rad,2*rad,0,64*360)
  56. #define XFillCircle(disp,win,gc,x,y,rad) \
  57. XFillArc(disp,win,gc,x-rad,y-rad,2*rad,2*rad,0,64*360)
  58. #ifdef NEED_XSTUFF
  59. extern void XSelectInput(Display *display,Window w,long event_mask);
  60. extern void XChangeWindowAttributes(Display *display,Window w,
  61. unsigned long valuemask,
  62. XSetWindowAttributes *attributes);
  63. extern void XSetWindowBackgroundPixmap(Display *disp,Drawable d,Pixmap pm);
  64. extern Status XMatchVisualInfo(Display *display,int screen,int depth,
  65. int class,XVisualInfo *vinfo_return);
  66. extern Status XParseColor(Display *display,Colormap colormap,char *spec,
  67. XColor *exact_def_return);
  68. extern Status XAllocColor(Display *display,Colormap colormap,
  69. XColor *screen_in_out);
  70. extern Status XAllocNamedColor(Display *disp, Colormap cmap, char *colorname,
  71. XColor *colorcell_def, XColor *rgb_db_def);
  72. extern Status XQueryColor(Display *disp, Colormap cmap,
  73. XColor *colorcell_def);
  74. extern void XDrawArc(Display *display,Drawable d,GC gc,int x,int y,
  75. unsigned int width,unsigned int height,int angle1,
  76. int angle2);
  77. extern void XFillArc(Display *display,Drawable d,GC gc,int x,int y,
  78. unsigned int width,unsigned int height,int angle1,
  79. int angle2);
  80. extern void XDrawLine(Display *display,Drawable d,GC gc,int x1,int y1,
  81. int x2,int y2);
  82. extern void XDrawLines(Display *display,Drawable d,GC gc,XPoint *points,
  83. int npoints, int mode);
  84. extern void XMapWindow(Display *display,Window w);
  85. extern void XMapSubwindows(Display *display,Window w);
  86. extern void XUnmapSubwindows(Display *display, Window w);
  87. extern void XUnmapWindow(Display *display, Window w);
  88. extern void XNextEvent(Display *display,XEvent *report);
  89. extern Bool XCheckTypedEvent(Display *display,int event_type,
  90. XEvent *event_return);
  91. extern void XSetForeground(Display *display,GC gc,
  92. unsigned long foreground);
  93. extern void XClearWindow(Display *disp,Window w);
  94. extern void XClearArea(Display *display,Window w,int x,int y,
  95. unsigned int width,unsigned int height,
  96. Bool exposures);
  97. extern void XDrawRectangle(Display *display,Drawable d,GC gc,
  98. int x, int y, int width, int height);
  99. extern void XDrawRectangles(Display *display,Drawable d,GC gc,
  100. XRectangle rectangles[],int nrectangles);
  101. extern void XDrawString(Display *display,Drawable d,GC gc,int x,int y,
  102. char *string,int length);
  103. extern void XDrawLine(Display *display,Drawable d,GC gc,
  104. int x1,int y1,int x2,int y2);
  105. extern void XSetStandardProperties(Display *display,Window w,
  106. char *window_name,char *icon_name,
  107. Pixmap icon_pixmap,char **argv,int argc,
  108. XSizeHints *hints);
  109. extern int XLookupString(XKeyEvent *event_struct,char *buffer_return,
  110. int bytes_buffer,KeySym *keysym_return,
  111. XComposeStatus *status_in_out);
  112. extern void XSetGraphicsExposures(Display *display,GC gc,
  113. Bool graphics_exposures);
  114. extern void XMapRaised(Display *display,Window w);
  115. extern void XSync(Display *display,Bool discard);
  116. extern void XFlush(Display *display);
  117. extern void XSetStandardProperties(Display *display,Window w,
  118. char *window_name,char *icon_name,
  119. Pixmap icon_pixmap,char **argv,int argc,
  120. XSizeHints *hints);
  121. extern Status XSendEvent(Display *display,Window w,Bool propagate,
  122. long event_mask,XEvent *event_send);
  123. extern void XFreeGC(Display *display,GC gc);
  124. extern void XCloseDisplay(Display *display);
  125. extern void XNextEvent(Display *display,XEvent *report);
  126. extern Bool XCheckTypedEvent(Display *display,int event_type,
  127. XEvent *event_return);
  128. extern void XSetForeground(Display *display,GC gc,
  129. unsigned long foreground);
  130. extern Bool XCheckMaskEvent(Display *display,long event_mask,
  131. XEvent *event_return);
  132. extern int XResizeWindow(Display *display, Window w,
  133. unsigned int width, unsigned int height);
  134. extern int XMoveWindow(Display *display, Window w,
  135. unsigned int x, unsigned int y);
  136. extern void XFreePixmap(Display *display,Pixmap pixmap);
  137. extern void XCopyGC(Display *display, GC src, long valuemask,
  138. GC dest);
  139. extern int XTextWidth(XFontStruct *font_struct, char *string, int count);
  140. extern void XSetDashes(Display *display, GC gc, int dash_offset,
  141. unsigned char dash_list[], int n);
  142. extern void XBell(Display *disp,int volume);
  143. extern void XDrawRectangle(Display *disp,Drawable d, GC gc,
  144. int x,int y, int w,int h);
  145. extern void XFillRectangle(Display *disp,Drawable d, GC gc,
  146. int x,int y, int w,int h);
  147. extern void XDestroySubwindows(Display *disp, Window Win);
  148. extern void XDestroyWindow(Display *disp, Window Win);
  149. extern void XQueryPointer(Display *disp,Window Win,Window *root,
  150. Window *child,int *root_x,int *root_y,
  151. int *win_x,int *win_y, unsigned int *keybut);
  152. extern void XWarpPointer(Display *disp, Window src, Window dest,
  153. int src_x, int src_y, unsigned int src_w, unsigned int src_h,
  154. int dest_x, int dest_y);
  155. extern void XGetGeometry(Display *disp, Window w,Window *root,
  156. int *x, int *y, unsigned int *width, unsigned int *height,
  157. unsigned int *border_width, unsigned int *depth);
  158. #endif /* NEED_XSTUFF */
  159. #endif /* _Xstuff_h */