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

/abfx/bindings-x11-functions.ads

https://github.com/joewing/tabfx
Ada | 215 lines | 170 code | 45 blank | 0 comment | 0 complexity | 71d2e3342c61e4202e22e4ffe23ace06 MD5 | raw file
  1. with Interfaces.C; use Interfaces.C;
  2. with Interfaces.C.Strings; use Interfaces.C.Strings;
  3. with Bindings.X11.Types; use Bindings.X11.Types;
  4. package Bindings.X11.Functions is
  5. function XOpenDisplay(name : chars_ptr) return Display_Pointer;
  6. pragma Import(C, XOpenDisplay, "XOpenDisplay");
  7. function XDisplayName(str : chars_ptr) return chars_ptr;
  8. pragma Import(C, XDisplayName, "XDisplayName");
  9. function XConnectionNumber(display : Display_Pointer) return int;
  10. pragma Import(C, XConnectionNumber, "XConnectionNumber");
  11. function XPending(display : Display_Pointer) return int;
  12. pragma Import(C, XPending, "XPending");
  13. procedure XStoreName(
  14. display : Display_Pointer;
  15. w : Window_Type;
  16. window_name : chars_ptr);
  17. pragma Import(C, XStoreName, "XStoreName");
  18. procedure XSetWMName(
  19. display : Display_Pointer;
  20. w : Window_Type;
  21. text_prop : XTextProperty_Pointer);
  22. pragma Import(C, XSetWMName, "XSetWMName");
  23. function XInternAtom(
  24. display : Display_Pointer;
  25. atom_name : chars_ptr;
  26. only_if_exists : Bool_Type) return Atom_Type;
  27. pragma Import(C, XInternAtom, "XInternAtom");
  28. procedure XChangeProperty(
  29. display : Display_Pointer;
  30. w : Window_Type;
  31. property, t : Atom_Type;
  32. format : int;
  33. mode : int;
  34. data : Atom_Pointer;
  35. nelements : int);
  36. pragma Import(C, XChangeProperty, "XChangeProperty");
  37. function XLoadFont(display : Display_Pointer; name : chars_ptr)
  38. return Font_Type;
  39. pragma Import(C, XLoadFont, "XLoadFont");
  40. function XLoadQueryFont(
  41. display : Display_Pointer;
  42. name : chars_ptr) return XFontStruct_Pointer;
  43. pragma Import(C, XLoadQueryFont, "XLoadQueryFont");
  44. function XTextWidth(
  45. fs : XFontStruct_Pointer;
  46. str : chars_ptr;
  47. count : int) return int;
  48. pragma Import(C, XTextWidth, "XTextWidth");
  49. procedure XFreeFont(display : Display_Pointer; fs : XFontStruct_Pointer);
  50. pragma Import(C, XFreeFont, "XFreeFont");
  51. procedure XSetFont(
  52. display : Display_Pointer;
  53. g : GC_Type;
  54. font : Font_Type);
  55. pragma Import(C, XSetFont, "XSetFont");
  56. function XCreateGC(
  57. display : Display_Pointer;
  58. d : Drawable_Type;
  59. valuemask : unsigned_long;
  60. values : XGCValues_Pointer)
  61. return GC_Type;
  62. pragma Import(C, XCreateGC, "XCreateGC");
  63. function XFreeGC(
  64. display : Display_Pointer;
  65. g : GC_Type)
  66. return int;
  67. pragma Import(C, XFreeGC, "XFreeGC");
  68. function XCreateSimpleWindow(
  69. display : Display_Pointer;
  70. parent : Window_Type;
  71. x, y : int;
  72. width, height : unsigned;
  73. border_width : unsigned;
  74. border : unsigned_long;
  75. background : unsigned_long)
  76. return Window_Type;
  77. pragma Import(C, XCreateSimpleWindow, "XCreateSimpleWindow");
  78. procedure XDestroyWindow(
  79. display : Display_Pointer;
  80. w : Window_Type);
  81. pragma Import(C, XDestroyWindow, "XDestroyWindow");
  82. function XRootWindow(display : Display_Pointer; screen_number : int)
  83. return Window_Type;
  84. pragma Import(C, XRootWindow, "XRootWindow");
  85. function XDefaultRootWindow(display : Display_Pointer)
  86. return Window_Type;
  87. pragma Import(C, XDefaultRootWindow, "XDefaultRootWindow");
  88. function XDefaultColormap(display : Display_Pointer;
  89. screen : int)
  90. return Colormap_Type;
  91. pragma Import(C, XDefaultColormap, "XDefaultColormap");
  92. function XAddToSaveSet(display : Display_Pointer; w : Window_Type)
  93. return int;
  94. pragma Import(C, XAddToSaveSet, "XAddToSaveSet");
  95. function XAllocColor(display : Display_Pointer;
  96. colormap : Colormap_Type; screen_in_out : XColor_Pointer)
  97. return Status_Type;
  98. pragma Import(C, XAllocColor, "XAllocColor");
  99. procedure XCloseDisplay(display : Display_Pointer);
  100. pragma Import(C, XCloseDisplay, "XCloseDisplay");
  101. procedure XMapWindow(display : Display_Pointer; w : Window_Type);
  102. pragma Import(C, XMapWindow, "XMapWindow");
  103. procedure XUnmapWindow(display : Display_Pointer; w : Window_Type);
  104. pragma Import(C, XUnmapWindow, "XUnmapWindow");
  105. procedure XNextEvent(
  106. display : Display_Pointer;
  107. event_return : XEvent_Pointer);
  108. pragma Import(C, XNextEvent, "XNextEvent");
  109. function XDrawString(
  110. display : Display_Pointer;
  111. d : Drawable_Type;
  112. gc : GC_Type;
  113. x, y : int;
  114. str : chars_ptr;
  115. length : int)
  116. return int;
  117. pragma Import(C, XDrawString, "XDrawString");
  118. procedure XSelectInput(display : Display_Pointer;
  119. w : Window_Type; event_mask : long);
  120. pragma Import(C, XSelectInput, "XSelectInput");
  121. procedure XDrawLine(display : Display_Pointer;
  122. d : Drawable_Type; g : GC_Type;
  123. x1, y1, x2, y2 : int);
  124. pragma Import(C, XDrawLine, "XDrawLine");
  125. procedure XDrawRectangle(
  126. display : Display_Pointer;
  127. d : Drawable_Type;
  128. g : GC_Type;
  129. x, y : int;
  130. width, height : int);
  131. pragma Import(C, XDrawRectangle, "XDrawRectangle");
  132. procedure XFillRectangle(
  133. display : Display_Pointer;
  134. d : Drawable_Type;
  135. g : GC_Type;
  136. x, y : int;
  137. width, height : int);
  138. pragma Import(C, XFillRectangle, "XFillRectangle");
  139. function XSetBackground(display : Display_Pointer;
  140. g : GC_Type; color : unsigned_long) return int;
  141. pragma Import(C, XSetBackground, "XSetBackground");
  142. function XSetForeground(display : Display_Pointer;
  143. g : GC_Type; color : unsigned_long) return int;
  144. pragma Import(C, XSetForeground, "XSetForeground");
  145. procedure XSetWindowBackground(display : Display_Pointer;
  146. w : Window_Type; color : unsigned_long);
  147. pragma Import(C, XSetWindowBackground, "XSetWindowBackground");
  148. procedure XResizeWindow(display : Display_Pointer;
  149. w : Window_Type; width, height : unsigned);
  150. pragma Import(C, XResizeWindow, "XResizeWindow");
  151. procedure XMoveWindow(display : Display_Pointer;
  152. w : Window_Type; x, y : int);
  153. pragma Import(C, XMoveWindow, "XMoveWindow");
  154. procedure XReparentWindow(display : Display_Pointer;
  155. w, p : Window_Type; x, y : int);
  156. pragma Import(C, XReparentWindow, "XReparentWindow");
  157. procedure XClearWindow(display : Display_Pointer; w : Window_Type);
  158. pragma Import(C, XClearWindow, "XClearWindow");
  159. function XKeycodeToKeysym(
  160. display : Display_Pointer;
  161. keycode : KeyCode_Type;
  162. index : int) return KeySym_Type;
  163. pragma Import(C, XKeycodeToKeysym, "XKeycodeToKeysym");
  164. function XChangeWindowAttributes(
  165. display : Display_Pointer;
  166. window : Window_Type;
  167. mask : unsigned_long;
  168. attr : XSetWindowAttributes_Pointer) return int;
  169. pragma Import(C, XChangeWindowAttributes, "XChangeWindowAttributes");
  170. end Bindings.X11.Functions;