/z88dk/include/X11/Xz88dk.h

# · C Header · 130 lines · 70 code · 46 blank · 14 comment · 0 complexity · 63381fd4411c305eb29500401c47ceae MD5 · raw file

  1. /* $Id: Xz88dk.h,v 1.1 2008/03/17 14:29:45 stefano Exp $ */
  2. #ifndef _XZ88DK_H_
  3. #define _XZ88DK_H_
  4. #include <X11/Xlib.h>
  5. //#include <graphics.h>
  6. //#include <games.h>
  7. //#include <stdio.h>
  8. #ifdef _BUILDING_X
  9. extern int _x_proportional;
  10. extern int _y_proportional;
  11. extern char *_xchar_proportional;
  12. extern int _X_int1;
  13. extern int _X_int2;
  14. extern int _X_int3;
  15. extern int _x_must_expose;
  16. #else
  17. int _x_proportional;
  18. int _y_proportional;
  19. char *_xchar_proportional;
  20. int _X_int1;
  21. int _X_int2;
  22. int _X_int3;
  23. int _x_must_expose=1;
  24. #endif
  25. /* Base X objects */
  26. extern struct _XDisplay __LIB__ *XOpenDisplay(char *display_name);
  27. extern void __LIB__ XCloseDisplay(struct _XDisplay *display);
  28. extern int __LIB__ DefaultScreen(struct _XDisplay *display);
  29. extern int __LIB__ RootWindow(struct _XDisplay *display,int screen);
  30. extern Window __LIB__ XCreateSimpleWindow(struct _XDisplay *display, Window rootwindow, int x, int y, int width, int height, int border_width, int forecolor, int backcolor);
  31. extern int __LIB__ XDestroyWindow(struct _XDisplay *display, Window win);
  32. extern struct GC __LIB__ *XCreateGC(struct _XDisplay *display, Window win, int valuemask, int values);
  33. extern void __LIB__ XFreeGC(struct _XDisplay *display, struct _XGC gc);
  34. /* Base X objects properties */
  35. extern char __LIB__ *XDisplayName(char *display_name);
  36. extern int __LIB__ DisplayWidth(struct _XDisplay *display,int screen);
  37. extern int __LIB__ DisplayHeight(struct _XDisplay *display,int screen);
  38. extern int __LIB__ DefaultDepth(struct _XDisplay *display,int screen);
  39. extern int __LIB__ BlackPixel(struct _XDisplay *display, int screen);
  40. extern int __LIB__ WhitePixel(struct _XDisplay *display, int screen);
  41. extern void __LIB__ XMapWindow(struct _XDisplay *display, Window win);
  42. extern void __LIB__ XSetForeground(struct _XDisplay *display, struct _XGC gc, int color);
  43. extern void __LIB__ XSetLineAttributes(struct _XDisplay *display, struct _XGC gc, int line_width, int line_style, int cap_style, int join_style);
  44. extern void __LIB__ XSetDashes(struct _XDisplay *display, struct _XGC gc, int dash_offset, int dash_list, int list_length);
  45. extern void __LIB__ XSetStandardProperties(struct _XDisplay *display, Window win, char *window_name, char *icon_name, char *icon_pixmap, char *argv, int argc, int size_hints);
  46. /* Events */
  47. extern void __LIB__ XSelectInput(struct _XDisplay *display, Window win, int event_mask);
  48. extern void __LIB__ XNextEvent(struct _XDisplay *display, int *event);
  49. extern Bool __LIB__ XCheckWindowEvent(struct _XDisplay *display, Window win, int event_mask, int event);
  50. extern int __LIB__ XCheckTypedEvent(struct _XDisplay *display, int type, int event);
  51. extern int __LIB__ XFlush(struct _XDisplay *display);
  52. /* Text handling */
  53. extern int __LIB__ XTextWidth(struct _XFontStruct *font_struct, char *string, int count);
  54. extern struct _XFontStruct __LIB__ XLoadQueryFont(struct _XDisplay *display, char *fontname);
  55. extern void __LIB__ XDrawString(struct _XDisplay *display, Window win, struct _XGC gc, int x, int y, char *text, int textlen);
  56. extern void __LIB__ XUnloadFont(struct _XDisplay *display, Font font);
  57. extern void __LIB__ XSetFont(struct _XDisplay *display, struct _XGC gc, Font font);
  58. /* Pictures handling */
  59. extern Pixmap __LIB__ XCreateBitmapFromData(struct _XDisplay *display, Window win, char *bits, int width, int height);
  60. /* Graphics drawing functions */
  61. // It could even work, but the window positioning offset !
  62. //#define XDrawRectangle drawb
  63. extern void __LIB__ XDrawRectangle(struct _XDisplay *display, Window win, struct _XGC gc, int x, int y, int width, int height);
  64. extern void __LIB__ XDrawPoint(struct _XDisplay *display, Window win, struct _XGC gc, int x, int y);
  65. extern void __LIB__ XDrawLine(struct _XDisplay *display, Window win, struct _XGC gc, int x1, int y1, int x2, int y2);
  66. extern void __LIB__ XClearWindow(struct _XDisplay *display, Window win, struct _XGC gc, int x, int y, int width, int height, Bool Exposures);
  67. /* Internal declarations */
  68. extern char __LIB__ *_xfindchar(char c, char *font);
  69. extern void __LIB__ _xfputc (char c, char *font, Bool bold);
  70. /* Internal structures */
  71. struct _XWIN {
  72. int x;
  73. int y;
  74. int width; // Drawable area width
  75. int height; // Drawable area height
  76. int a_x; // area x pos
  77. int a_y; // area y pos
  78. int full_width;
  79. int full_height;
  80. char *title;
  81. char *icon;
  82. char *background;
  83. };
  84. #endif /* _XZ88DK_H_ */