xext-so_wrap.c 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. // This file is generated. Do not edit!
  2. // see https://github.com/hpvb/dynload-wrapper for details
  3. // generated by generate-wrapper.py 0.7 on 2024-12-12 14:50:47
  4. // flags: generate-wrapper.py --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xext.h --include ./thirdparty/linuxbsd_headers/X11/extensions/shape.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/shape.h --soname libXext.so.6 --init-name xext --output-header ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.c --ignore-other --implementation-header thirdparty/linuxbsd_headers/X11/Xlib.h
  5. //
  6. #include <stdint.h>
  7. #include "thirdparty/linuxbsd_headers/X11/Xlib.h"
  8. #define XShapeQueryExtension XShapeQueryExtension_dylibloader_orig_xext
  9. #define XShapeQueryVersion XShapeQueryVersion_dylibloader_orig_xext
  10. #define XShapeCombineRegion XShapeCombineRegion_dylibloader_orig_xext
  11. #define XShapeCombineRectangles XShapeCombineRectangles_dylibloader_orig_xext
  12. #define XShapeCombineMask XShapeCombineMask_dylibloader_orig_xext
  13. #define XShapeCombineShape XShapeCombineShape_dylibloader_orig_xext
  14. #define XShapeOffsetShape XShapeOffsetShape_dylibloader_orig_xext
  15. #define XShapeQueryExtents XShapeQueryExtents_dylibloader_orig_xext
  16. #define XShapeSelectInput XShapeSelectInput_dylibloader_orig_xext
  17. #define XShapeInputSelected XShapeInputSelected_dylibloader_orig_xext
  18. #define XShapeGetRectangles XShapeGetRectangles_dylibloader_orig_xext
  19. #include "thirdparty/linuxbsd_headers/X11/extensions/Xext.h"
  20. #include "thirdparty/linuxbsd_headers/X11/extensions/shape.h"
  21. #undef XShapeQueryExtension
  22. #undef XShapeQueryVersion
  23. #undef XShapeCombineRegion
  24. #undef XShapeCombineRectangles
  25. #undef XShapeCombineMask
  26. #undef XShapeCombineShape
  27. #undef XShapeOffsetShape
  28. #undef XShapeQueryExtents
  29. #undef XShapeSelectInput
  30. #undef XShapeInputSelected
  31. #undef XShapeGetRectangles
  32. #include <dlfcn.h>
  33. #include <stdio.h>
  34. int (*XShapeQueryExtension_dylibloader_wrapper_xext)(Display *, int *, int *);
  35. int (*XShapeQueryVersion_dylibloader_wrapper_xext)(Display *, int *, int *);
  36. void (*XShapeCombineRegion_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Region, int);
  37. void (*XShapeCombineRectangles_dylibloader_wrapper_xext)(Display *, Window, int, int, int, XRectangle *, int, int, int);
  38. void (*XShapeCombineMask_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Pixmap, int);
  39. void (*XShapeCombineShape_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Window, int, int);
  40. void (*XShapeOffsetShape_dylibloader_wrapper_xext)(Display *, Window, int, int, int);
  41. int (*XShapeQueryExtents_dylibloader_wrapper_xext)(Display *, Window, int *, int *, int *, unsigned int *, unsigned int *, int *, int *, int *, unsigned int *, unsigned int *);
  42. void (*XShapeSelectInput_dylibloader_wrapper_xext)(Display *, Window, unsigned long);
  43. unsigned long (*XShapeInputSelected_dylibloader_wrapper_xext)(Display *, Window);
  44. XRectangle *(*XShapeGetRectangles_dylibloader_wrapper_xext)(Display *, Window, int, int *, int *);
  45. int initialize_xext(int verbose) {
  46. void *handle;
  47. char *error;
  48. handle = dlopen("libXext.so.6", RTLD_LAZY);
  49. if (!handle) {
  50. if (verbose) {
  51. fprintf(stderr, "%s\n", dlerror());
  52. }
  53. return(1);
  54. }
  55. dlerror();
  56. // XShapeQueryExtension
  57. *(void **) (&XShapeQueryExtension_dylibloader_wrapper_xext) = dlsym(handle, "XShapeQueryExtension");
  58. if (verbose) {
  59. error = dlerror();
  60. if (error != NULL) {
  61. fprintf(stderr, "%s\n", error);
  62. }
  63. }
  64. // XShapeQueryVersion
  65. *(void **) (&XShapeQueryVersion_dylibloader_wrapper_xext) = dlsym(handle, "XShapeQueryVersion");
  66. if (verbose) {
  67. error = dlerror();
  68. if (error != NULL) {
  69. fprintf(stderr, "%s\n", error);
  70. }
  71. }
  72. // XShapeCombineRegion
  73. *(void **) (&XShapeCombineRegion_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineRegion");
  74. if (verbose) {
  75. error = dlerror();
  76. if (error != NULL) {
  77. fprintf(stderr, "%s\n", error);
  78. }
  79. }
  80. // XShapeCombineRectangles
  81. *(void **) (&XShapeCombineRectangles_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineRectangles");
  82. if (verbose) {
  83. error = dlerror();
  84. if (error != NULL) {
  85. fprintf(stderr, "%s\n", error);
  86. }
  87. }
  88. // XShapeCombineMask
  89. *(void **) (&XShapeCombineMask_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineMask");
  90. if (verbose) {
  91. error = dlerror();
  92. if (error != NULL) {
  93. fprintf(stderr, "%s\n", error);
  94. }
  95. }
  96. // XShapeCombineShape
  97. *(void **) (&XShapeCombineShape_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineShape");
  98. if (verbose) {
  99. error = dlerror();
  100. if (error != NULL) {
  101. fprintf(stderr, "%s\n", error);
  102. }
  103. }
  104. // XShapeOffsetShape
  105. *(void **) (&XShapeOffsetShape_dylibloader_wrapper_xext) = dlsym(handle, "XShapeOffsetShape");
  106. if (verbose) {
  107. error = dlerror();
  108. if (error != NULL) {
  109. fprintf(stderr, "%s\n", error);
  110. }
  111. }
  112. // XShapeQueryExtents
  113. *(void **) (&XShapeQueryExtents_dylibloader_wrapper_xext) = dlsym(handle, "XShapeQueryExtents");
  114. if (verbose) {
  115. error = dlerror();
  116. if (error != NULL) {
  117. fprintf(stderr, "%s\n", error);
  118. }
  119. }
  120. // XShapeSelectInput
  121. *(void **) (&XShapeSelectInput_dylibloader_wrapper_xext) = dlsym(handle, "XShapeSelectInput");
  122. if (verbose) {
  123. error = dlerror();
  124. if (error != NULL) {
  125. fprintf(stderr, "%s\n", error);
  126. }
  127. }
  128. // XShapeInputSelected
  129. *(void **) (&XShapeInputSelected_dylibloader_wrapper_xext) = dlsym(handle, "XShapeInputSelected");
  130. if (verbose) {
  131. error = dlerror();
  132. if (error != NULL) {
  133. fprintf(stderr, "%s\n", error);
  134. }
  135. }
  136. // XShapeGetRectangles
  137. *(void **) (&XShapeGetRectangles_dylibloader_wrapper_xext) = dlsym(handle, "XShapeGetRectangles");
  138. if (verbose) {
  139. error = dlerror();
  140. if (error != NULL) {
  141. fprintf(stderr, "%s\n", error);
  142. }
  143. }
  144. return 0;
  145. }