SDL_x11dyn.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "../../SDL_internal.h"
  19. #ifndef _SDL_x11dyn_h
  20. #define _SDL_x11dyn_h
  21. #include <X11/Xlib.h>
  22. #include <X11/Xutil.h>
  23. #include <X11/Xatom.h>
  24. #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
  25. #include <X11/XKBlib.h>
  26. #endif
  27. /* Apparently some X11 systems can't include this multiple times... */
  28. #ifndef SDL_INCLUDED_XLIBINT_H
  29. #define SDL_INCLUDED_XLIBINT_H 1
  30. #include <X11/Xlibint.h>
  31. #endif
  32. #include <X11/Xproto.h>
  33. #include <X11/extensions/Xext.h>
  34. #include <X11/extensions/extutil.h>
  35. #ifndef NO_SHARED_MEMORY
  36. #include <sys/ipc.h>
  37. #include <sys/shm.h>
  38. #include <X11/extensions/XShm.h>
  39. #endif
  40. #if SDL_VIDEO_DRIVER_X11_XCURSOR
  41. #include <X11/Xcursor/Xcursor.h>
  42. #endif
  43. #if SDL_VIDEO_DRIVER_X11_XDBE
  44. #include <X11/extensions/Xdbe.h>
  45. #endif
  46. #if SDL_VIDEO_DRIVER_X11_XINERAMA
  47. #include <X11/extensions/Xinerama.h>
  48. #endif
  49. #if SDL_VIDEO_DRIVER_X11_XINPUT2
  50. #include <X11/extensions/XInput2.h>
  51. #endif
  52. #if SDL_VIDEO_DRIVER_X11_XRANDR
  53. #include <X11/extensions/Xrandr.h>
  54. #endif
  55. #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
  56. #include <X11/extensions/scrnsaver.h>
  57. #endif
  58. #if SDL_VIDEO_DRIVER_X11_XSHAPE
  59. #include <X11/extensions/shape.h>
  60. #endif
  61. #if SDL_VIDEO_DRIVER_X11_XVIDMODE
  62. #include <X11/extensions/xf86vmode.h>
  63. #endif
  64. #ifdef __cplusplus
  65. extern "C"
  66. {
  67. #endif
  68. /* evil function signatures... */
  69. typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *, xEvent *);
  70. typedef int (*SDL_X11_XSynchronizeRetType) (Display *);
  71. typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *, xEvent *);
  72. int SDL_X11_LoadSymbols(void);
  73. void SDL_X11_UnloadSymbols(void);
  74. /* Declare all the function pointers and wrappers... */
  75. #define SDL_X11_MODULE(modname)
  76. #define SDL_X11_SYM(rc,fn,params,args,ret) \
  77. typedef rc (*SDL_DYNX11FN_##fn) params; \
  78. extern SDL_DYNX11FN_##fn X11_##fn;
  79. #include "SDL_x11sym.h"
  80. #undef SDL_X11_MODULE
  81. #undef SDL_X11_SYM
  82. /* Annoying varargs entry point... */
  83. #ifdef X_HAVE_UTF8_STRING
  84. typedef XIC(*SDL_DYNX11FN_XCreateIC) (XIM,...);
  85. typedef char *(*SDL_DYNX11FN_XGetICValues) (XIC, ...);
  86. extern SDL_DYNX11FN_XCreateIC X11_XCreateIC;
  87. extern SDL_DYNX11FN_XGetICValues X11_XGetICValues;
  88. #endif
  89. /* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
  90. #define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname;
  91. #define SDL_X11_SYM(rc,fn,params,args,ret)
  92. #include "SDL_x11sym.h"
  93. #undef SDL_X11_MODULE
  94. #undef SDL_X11_SYM
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /* !defined _SDL_x11dyn_h */
  99. /* vi: set ts=4 sw=4 expandtab: */