xinit.h 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef _XINIT_
  2. #define _XINIT_ 1
  3. #define TRUE 1
  4. #define FALSE 0
  5. #include <X11/Xlib.h>
  6. #include <X11/Xutil.h>
  7. #include <X11/Xos.h>
  8. #include <X11/Xatom.h>
  9. #include <X11/extensions/Xext.h>
  10. //#include <X11/extensions/extutil.h>
  11. //#include <X11/extensions/xf86vmode.h>
  12. #define STANDARDPTR XC_left_ptr
  13. #define WORKINGPTR XC_watch
  14. #include "xstoneage.h"
  15. #define memToVal(PTR,LEN) (\
  16. (LEN) == 1 ? (unsigned long)( *( (byte *)(PTR)) ) : \
  17. (LEN) == 2 ? (unsigned long)(((unsigned long)(*( (byte *)(PTR)) ))<< 8) \
  18. + ( *(((byte *)(PTR))+1) ) : \
  19. (LEN) == 3 ? (unsigned long)(((unsigned long)(*( (byte *)(PTR)) ))<<16) \
  20. + (((unsigned long)(*(((byte *)(PTR))+1)))<< 8) \
  21. + ( *(((byte *)(PTR))+2) ) : \
  22. (unsigned long)(((unsigned long)(*( (byte *)(PTR)) ))<<24) \
  23. + (((unsigned long)(*(((byte *)(PTR))+1)))<<16) \
  24. + (((unsigned long)(*(((byte *)(PTR))+2)))<< 8) \
  25. + ( *(((byte *)(PTR))+3) ) )
  26. #define valToMem(VAL,PTR,LEN) (\
  27. (LEN) == 1 ? (*( (byte *)(PTR) ) = ( VAL ) ) : \
  28. (LEN) == 2 ? (*( (byte *)(PTR) ) = (((unsigned long)(VAL))>> 8), \
  29. *(((byte *)(PTR))+1) = ( VAL ) ) : \
  30. (LEN) == 3 ? (*( (byte *)(PTR) ) = (((unsigned long)(VAL))>>16), \
  31. *(((byte *)(PTR))+1) = (((unsigned long)(VAL))>> 8), \
  32. *(((byte *)(PTR))+2) = ( VAL ) ) : \
  33. (*( (byte *)(PTR) ) = (((unsigned long)(VAL))>>24), \
  34. *(((byte *)(PTR))+1) = (((unsigned long)(VAL))>>16), \
  35. *(((byte *)(PTR))+2) = (((unsigned long)(VAL))>> 8), \
  36. *(((byte *)(PTR))+3) = ( VAL ) ))
  37. #define FADEIN 0
  38. #define FADEOUT 1
  39. #define FADEINOUT 2
  40. #define MOTIF_WM_HINTS_DECORATIONS (1L << 1)
  41. typedef struct
  42. {
  43. long flags;
  44. long functions;
  45. long decorations;
  46. long input_mode;
  47. long status;
  48. } _motif_wm_hints;
  49. _motif_wm_hints motif_wm_hints;
  50. int scr;
  51. Display *dis;
  52. Window win;
  53. XEvent report;
  54. GC gc;
  55. XGCValues gcv;
  56. Colormap colormap;
  57. Visual *vsl;
  58. XWindowChanges newcfg;
  59. XWindowAttributes attr;
  60. //FILE *f;
  61. int red_shift,blue_shift,green_shift;
  62. unsigned char pal[768];
  63. char title[256];
  64. int titlelen;
  65. void initdisplay(char* file, int x, int y);
  66. void CopyImage(int mode, XImage *bg, int x1, int y1, XImage* ximage, int x2, int y2, int w, int h);
  67. void fadeImage(int fadetype, int x, int y, XImage* ximage);
  68. void subtitle(int x, int y, XImage* ximage, XImage* bg);
  69. void dopause(int x, int y, int legend, XImage* pause, XImage* bg);
  70. unsigned long int MkColor(int r, int g, int b);
  71. unsigned long int MkColorTGA(int r, int g, int b);
  72. void closedisplay();
  73. void DestroyImage(XImage *ximage);
  74. void fadeimage(int fadetype, int x, int y, XImage *ximage);
  75. #endif