@img/sharp-libvips-dev 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/README.md +47 -0
  2. package/cplusplus/VConnection.cpp +151 -0
  3. package/cplusplus/VError.cpp +49 -0
  4. package/cplusplus/VImage.cpp +1548 -0
  5. package/cplusplus/VInterpolate.cpp +62 -0
  6. package/cplusplus/VRegion.cpp +27 -0
  7. package/cplusplus/index.js +1 -0
  8. package/cplusplus/vips-operators.cpp +3760 -0
  9. package/include/aom/aom.h +127 -0
  10. package/include/aom/aom_codec.h +573 -0
  11. package/include/aom/aom_decoder.h +257 -0
  12. package/include/aom/aom_encoder.h +1137 -0
  13. package/include/aom/aom_external_partition.h +452 -0
  14. package/include/aom/aom_frame_buffer.h +84 -0
  15. package/include/aom/aom_image.h +448 -0
  16. package/include/aom/aom_integer.h +68 -0
  17. package/include/aom/aomcx.h +2112 -0
  18. package/include/aom/aomdx.h +604 -0
  19. package/include/archive.h +1212 -0
  20. package/include/archive_entry.h +723 -0
  21. package/include/cairo/cairo-deprecated.h +123 -0
  22. package/include/cairo/cairo-features.h +29 -0
  23. package/include/cairo/cairo-ft.h +118 -0
  24. package/include/cairo/cairo-gobject.h +192 -0
  25. package/include/cairo/cairo-svg.h +130 -0
  26. package/include/cairo/cairo-version.h +8 -0
  27. package/include/cairo/cairo.h +3281 -0
  28. package/include/cgif.h +80 -0
  29. package/include/expat.h +1064 -0
  30. package/include/expat_config.h +140 -0
  31. package/include/expat_external.h +165 -0
  32. package/include/ffi.h +531 -0
  33. package/include/ffitarget.h +164 -0
  34. package/include/fontconfig/fcfreetype.h +59 -0
  35. package/include/fontconfig/fcprivate.h +134 -0
  36. package/include/fontconfig/fontconfig.h +1158 -0
  37. package/include/freetype2/freetype/config/ftconfig.h +51 -0
  38. package/include/freetype2/freetype/config/ftheader.h +836 -0
  39. package/include/freetype2/freetype/config/ftmodule.h +21 -0
  40. package/include/freetype2/freetype/config/ftoption.h +1014 -0
  41. package/include/freetype2/freetype/config/ftstdlib.h +185 -0
  42. package/include/freetype2/freetype/config/integer-types.h +250 -0
  43. package/include/freetype2/freetype/config/mac-support.h +49 -0
  44. package/include/freetype2/freetype/config/public-macros.h +138 -0
  45. package/include/freetype2/freetype/freetype.h +5337 -0
  46. package/include/freetype2/freetype/ftadvanc.h +188 -0
  47. package/include/freetype2/freetype/ftbbox.h +101 -0
  48. package/include/freetype2/freetype/ftbdf.h +212 -0
  49. package/include/freetype2/freetype/ftbitmap.h +329 -0
  50. package/include/freetype2/freetype/ftbzip2.h +102 -0
  51. package/include/freetype2/freetype/ftcache.h +1087 -0
  52. package/include/freetype2/freetype/ftchapters.h +168 -0
  53. package/include/freetype2/freetype/ftcid.h +167 -0
  54. package/include/freetype2/freetype/ftcolor.h +1667 -0
  55. package/include/freetype2/freetype/ftdriver.h +1246 -0
  56. package/include/freetype2/freetype/fterrdef.h +283 -0
  57. package/include/freetype2/freetype/fterrors.h +296 -0
  58. package/include/freetype2/freetype/ftfntfmt.h +93 -0
  59. package/include/freetype2/freetype/ftgasp.h +143 -0
  60. package/include/freetype2/freetype/ftglyph.h +750 -0
  61. package/include/freetype2/freetype/ftgxval.h +354 -0
  62. package/include/freetype2/freetype/ftgzip.h +151 -0
  63. package/include/freetype2/freetype/ftimage.h +1284 -0
  64. package/include/freetype2/freetype/ftincrem.h +348 -0
  65. package/include/freetype2/freetype/ftlcdfil.h +323 -0
  66. package/include/freetype2/freetype/ftlist.h +296 -0
  67. package/include/freetype2/freetype/ftlzw.h +100 -0
  68. package/include/freetype2/freetype/ftmac.h +289 -0
  69. package/include/freetype2/freetype/ftmm.h +805 -0
  70. package/include/freetype2/freetype/ftmodapi.h +807 -0
  71. package/include/freetype2/freetype/ftmoderr.h +204 -0
  72. package/include/freetype2/freetype/ftotval.h +206 -0
  73. package/include/freetype2/freetype/ftoutln.h +588 -0
  74. package/include/freetype2/freetype/ftparams.h +218 -0
  75. package/include/freetype2/freetype/ftpfr.h +179 -0
  76. package/include/freetype2/freetype/ftrender.h +244 -0
  77. package/include/freetype2/freetype/ftsizes.h +159 -0
  78. package/include/freetype2/freetype/ftsnames.h +272 -0
  79. package/include/freetype2/freetype/ftstroke.h +773 -0
  80. package/include/freetype2/freetype/ftsynth.h +104 -0
  81. package/include/freetype2/freetype/ftsystem.h +350 -0
  82. package/include/freetype2/freetype/fttrigon.h +350 -0
  83. package/include/freetype2/freetype/fttypes.h +617 -0
  84. package/include/freetype2/freetype/ftwinfnt.h +276 -0
  85. package/include/freetype2/freetype/otsvg.h +336 -0
  86. package/include/freetype2/freetype/t1tables.h +793 -0
  87. package/include/freetype2/freetype/ttnameid.h +1235 -0
  88. package/include/freetype2/freetype/tttables.h +855 -0
  89. package/include/freetype2/freetype/tttags.h +124 -0
  90. package/include/freetype2/ft2build.h +42 -0
  91. package/include/fribidi/fribidi-arabic.h +81 -0
  92. package/include/fribidi/fribidi-begindecls.h +3 -0
  93. package/include/fribidi/fribidi-bidi-types-list.h +96 -0
  94. package/include/fribidi/fribidi-bidi-types.h +405 -0
  95. package/include/fribidi/fribidi-bidi.h +142 -0
  96. package/include/fribidi/fribidi-brackets.h +89 -0
  97. package/include/fribidi/fribidi-char-sets-list.h +54 -0
  98. package/include/fribidi/fribidi-char-sets.h +106 -0
  99. package/include/fribidi/fribidi-common.h +152 -0
  100. package/include/fribidi/fribidi-config.h +23 -0
  101. package/include/fribidi/fribidi-deprecated.h +175 -0
  102. package/include/fribidi/fribidi-enddecls.h +3 -0
  103. package/include/fribidi/fribidi-flags.h +72 -0
  104. package/include/fribidi/fribidi-joining-types-list.h +44 -0
  105. package/include/fribidi/fribidi-joining-types.h +249 -0
  106. package/include/fribidi/fribidi-joining.h +74 -0
  107. package/include/fribidi/fribidi-mirroring.h +86 -0
  108. package/include/fribidi/fribidi-shape.h +71 -0
  109. package/include/fribidi/fribidi-types.h +79 -0
  110. package/include/fribidi/fribidi-unicode-version.h +10 -0
  111. package/include/fribidi/fribidi-unicode.h +105 -0
  112. package/include/fribidi/fribidi.h +129 -0
  113. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-animation.h +221 -0
  114. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-autocleanups.h +37 -0
  115. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h +525 -0
  116. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-enum-types.h +40 -0
  117. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-features.h +115 -0
  118. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h +481 -0
  119. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-loader.h +113 -0
  120. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-macros.h +718 -0
  121. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-marshal.h +33 -0
  122. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h +70 -0
  123. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-transform.h +168 -0
  124. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h +46 -0
  125. package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h +165 -0
  126. package/include/gio-unix-2.0/gio/gdesktopappinfo.h +200 -0
  127. package/include/gio-unix-2.0/gio/gfiledescriptorbased.h +67 -0
  128. package/include/gio-unix-2.0/gio/gunixfdmessage.h +86 -0
  129. package/include/gio-unix-2.0/gio/gunixinputstream.h +85 -0
  130. package/include/gio-unix-2.0/gio/gunixmounts.h +172 -0
  131. package/include/gio-unix-2.0/gio/gunixoutputstream.h +84 -0
  132. package/include/glib-2.0/gio/gaction.h +100 -0
  133. package/include/glib-2.0/gio/gactiongroup.h +163 -0
  134. package/include/glib-2.0/gio/gactiongroupexporter.h +47 -0
  135. package/include/glib-2.0/gio/gactionmap.h +101 -0
  136. package/include/glib-2.0/gio/gappinfo.h +369 -0
  137. package/include/glib-2.0/gio/gapplication.h +257 -0
  138. package/include/glib-2.0/gio/gapplicationcommandline.h +124 -0
  139. package/include/glib-2.0/gio/gasyncinitable.h +132 -0
  140. package/include/glib-2.0/gio/gasyncresult.h +87 -0
  141. package/include/glib-2.0/gio/gbufferedinputstream.h +135 -0
  142. package/include/glib-2.0/gio/gbufferedoutputstream.h +88 -0
  143. package/include/glib-2.0/gio/gbytesicon.h +54 -0
  144. package/include/glib-2.0/gio/gcancellable.h +120 -0
  145. package/include/glib-2.0/gio/gcharsetconverter.h +65 -0
  146. package/include/glib-2.0/gio/gcontenttype.h +84 -0
  147. package/include/glib-2.0/gio/gconverter.h +98 -0
  148. package/include/glib-2.0/gio/gconverterinputstream.h +82 -0
  149. package/include/glib-2.0/gio/gconverteroutputstream.h +82 -0
  150. package/include/glib-2.0/gio/gcredentials.h +87 -0
  151. package/include/glib-2.0/gio/gdatagrambased.h +146 -0
  152. package/include/glib-2.0/gio/gdatainputstream.h +182 -0
  153. package/include/glib-2.0/gio/gdataoutputstream.h +127 -0
  154. package/include/glib-2.0/gio/gdbusactiongroup.h +56 -0
  155. package/include/glib-2.0/gio/gdbusaddress.h +67 -0
  156. package/include/glib-2.0/gio/gdbusauthobserver.h +53 -0
  157. package/include/glib-2.0/gio/gdbusconnection.h +691 -0
  158. package/include/glib-2.0/gio/gdbuserror.h +111 -0
  159. package/include/glib-2.0/gio/gdbusinterface.h +83 -0
  160. package/include/glib-2.0/gio/gdbusinterfaceskeleton.h +129 -0
  161. package/include/glib-2.0/gio/gdbusintrospection.h +327 -0
  162. package/include/glib-2.0/gio/gdbusmenumodel.h +47 -0
  163. package/include/glib-2.0/gio/gdbusmessage.h +204 -0
  164. package/include/glib-2.0/gio/gdbusmethodinvocation.h +136 -0
  165. package/include/glib-2.0/gio/gdbusnameowning.h +117 -0
  166. package/include/glib-2.0/gio/gdbusnamewatching.h +104 -0
  167. package/include/glib-2.0/gio/gdbusobject.h +80 -0
  168. package/include/glib-2.0/gio/gdbusobjectmanager.h +96 -0
  169. package/include/glib-2.0/gio/gdbusobjectmanagerclient.h +148 -0
  170. package/include/glib-2.0/gio/gdbusobjectmanagerserver.h +95 -0
  171. package/include/glib-2.0/gio/gdbusobjectproxy.h +81 -0
  172. package/include/glib-2.0/gio/gdbusobjectskeleton.h +98 -0
  173. package/include/glib-2.0/gio/gdbusproxy.h +220 -0
  174. package/include/glib-2.0/gio/gdbusserver.h +62 -0
  175. package/include/glib-2.0/gio/gdbusutils.h +65 -0
  176. package/include/glib-2.0/gio/gdebugcontroller.h +81 -0
  177. package/include/glib-2.0/gio/gdebugcontrollerdbus.h +71 -0
  178. package/include/glib-2.0/gio/gdrive.h +274 -0
  179. package/include/glib-2.0/gio/gdtlsclientconnection.h +77 -0
  180. package/include/glib-2.0/gio/gdtlsconnection.h +230 -0
  181. package/include/glib-2.0/gio/gdtlsserverconnection.h +71 -0
  182. package/include/glib-2.0/gio/gemblem.h +63 -0
  183. package/include/glib-2.0/gio/gemblemedicon.h +83 -0
  184. package/include/glib-2.0/gio/gfile.h +1359 -0
  185. package/include/glib-2.0/gio/gfileattribute.h +86 -0
  186. package/include/glib-2.0/gio/gfileenumerator.h +154 -0
  187. package/include/glib-2.0/gio/gfileicon.h +59 -0
  188. package/include/glib-2.0/gio/gfileinfo.h +1546 -0
  189. package/include/glib-2.0/gio/gfileinputstream.h +116 -0
  190. package/include/glib-2.0/gio/gfileiostream.h +123 -0
  191. package/include/glib-2.0/gio/gfilemonitor.h +100 -0
  192. package/include/glib-2.0/gio/gfilenamecompleter.h +81 -0
  193. package/include/glib-2.0/gio/gfileoutputstream.h +124 -0
  194. package/include/glib-2.0/gio/gfilterinputstream.h +80 -0
  195. package/include/glib-2.0/gio/gfilteroutputstream.h +80 -0
  196. package/include/glib-2.0/gio/gicon.h +133 -0
  197. package/include/glib-2.0/gio/ginetaddress.h +125 -0
  198. package/include/glib-2.0/gio/ginetaddressmask.h +86 -0
  199. package/include/glib-2.0/gio/ginetsocketaddress.h +80 -0
  200. package/include/glib-2.0/gio/ginitable.h +107 -0
  201. package/include/glib-2.0/gio/ginputstream.h +218 -0
  202. package/include/glib-2.0/gio/gio-autocleanups.h +155 -0
  203. package/include/glib-2.0/gio/gio-visibility.h +952 -0
  204. package/include/glib-2.0/gio/gio.h +186 -0
  205. package/include/glib-2.0/gio/gioenums.h +2149 -0
  206. package/include/glib-2.0/gio/gioenumtypes.h +207 -0
  207. package/include/glib-2.0/gio/gioerror.h +58 -0
  208. package/include/glib-2.0/gio/giomodule.h +199 -0
  209. package/include/glib-2.0/gio/gioscheduler.h +56 -0
  210. package/include/glib-2.0/gio/giostream.h +137 -0
  211. package/include/glib-2.0/gio/giotypes.h +660 -0
  212. package/include/glib-2.0/gio/glistmodel.h +74 -0
  213. package/include/glib-2.0/gio/gliststore.h +97 -0
  214. package/include/glib-2.0/gio/gloadableicon.h +101 -0
  215. package/include/glib-2.0/gio/gmemoryinputstream.h +92 -0
  216. package/include/glib-2.0/gio/gmemorymonitor.h +64 -0
  217. package/include/glib-2.0/gio/gmemoryoutputstream.h +109 -0
  218. package/include/glib-2.0/gio/gmenu.h +184 -0
  219. package/include/glib-2.0/gio/gmenuexporter.h +55 -0
  220. package/include/glib-2.0/gio/gmenumodel.h +307 -0
  221. package/include/glib-2.0/gio/gmount.h +278 -0
  222. package/include/glib-2.0/gio/gmountoperation.h +179 -0
  223. package/include/glib-2.0/gio/gnativesocketaddress.h +67 -0
  224. package/include/glib-2.0/gio/gnativevolumemonitor.h +63 -0
  225. package/include/glib-2.0/gio/gnetworkaddress.h +82 -0
  226. package/include/glib-2.0/gio/gnetworking.h +81 -0
  227. package/include/glib-2.0/gio/gnetworkmonitor.h +101 -0
  228. package/include/glib-2.0/gio/gnetworkservice.h +77 -0
  229. package/include/glib-2.0/gio/gnotification.h +103 -0
  230. package/include/glib-2.0/gio/goutputstream.h +334 -0
  231. package/include/glib-2.0/gio/gpermission.h +129 -0
  232. package/include/glib-2.0/gio/gpollableinputstream.h +106 -0
  233. package/include/glib-2.0/gio/gpollableoutputstream.h +127 -0
  234. package/include/glib-2.0/gio/gpollableutils.h +66 -0
  235. package/include/glib-2.0/gio/gpowerprofilemonitor.h +65 -0
  236. package/include/glib-2.0/gio/gpropertyaction.h +49 -0
  237. package/include/glib-2.0/gio/gproxy.h +130 -0
  238. package/include/glib-2.0/gio/gproxyaddress.h +88 -0
  239. package/include/glib-2.0/gio/gproxyaddressenumerator.h +83 -0
  240. package/include/glib-2.0/gio/gproxyresolver.h +97 -0
  241. package/include/glib-2.0/gio/gremoteactiongroup.h +77 -0
  242. package/include/glib-2.0/gio/gresolver.h +299 -0
  243. package/include/glib-2.0/gio/gresource.h +132 -0
  244. package/include/glib-2.0/gio/gseekable.h +105 -0
  245. package/include/glib-2.0/gio/gsettings.h +347 -0
  246. package/include/glib-2.0/gio/gsettingsbackend.h +176 -0
  247. package/include/glib-2.0/gio/gsettingsschema.h +115 -0
  248. package/include/glib-2.0/gio/gsimpleaction.h +65 -0
  249. package/include/glib-2.0/gio/gsimpleactiongroup.h +99 -0
  250. package/include/glib-2.0/gio/gsimpleasyncresult.h +164 -0
  251. package/include/glib-2.0/gio/gsimpleiostream.h +47 -0
  252. package/include/glib-2.0/gio/gsimplepermission.h +47 -0
  253. package/include/glib-2.0/gio/gsimpleproxyresolver.h +91 -0
  254. package/include/glib-2.0/gio/gsocket.h +330 -0
  255. package/include/glib-2.0/gio/gsocketaddress.h +84 -0
  256. package/include/glib-2.0/gio/gsocketaddressenumerator.h +103 -0
  257. package/include/glib-2.0/gio/gsocketclient.h +199 -0
  258. package/include/glib-2.0/gio/gsocketconnectable.h +83 -0
  259. package/include/glib-2.0/gio/gsocketconnection.h +117 -0
  260. package/include/glib-2.0/gio/gsocketcontrolmessage.h +113 -0
  261. package/include/glib-2.0/gio/gsocketlistener.h +157 -0
  262. package/include/glib-2.0/gio/gsocketservice.h +95 -0
  263. package/include/glib-2.0/gio/gsrvtarget.h +60 -0
  264. package/include/glib-2.0/gio/gsubprocess.h +169 -0
  265. package/include/glib-2.0/gio/gsubprocesslauncher.h +121 -0
  266. package/include/glib-2.0/gio/gtask.h +207 -0
  267. package/include/glib-2.0/gio/gtcpconnection.h +71 -0
  268. package/include/glib-2.0/gio/gtcpwrapperconnection.h +71 -0
  269. package/include/glib-2.0/gio/gtestdbus.h +74 -0
  270. package/include/glib-2.0/gio/gthemedicon.h +70 -0
  271. package/include/glib-2.0/gio/gthreadedsocketservice.h +83 -0
  272. package/include/glib-2.0/gio/gtlsbackend.h +115 -0
  273. package/include/glib-2.0/gio/gtlscertificate.h +125 -0
  274. package/include/glib-2.0/gio/gtlsclientconnection.h +88 -0
  275. package/include/glib-2.0/gio/gtlsconnection.h +214 -0
  276. package/include/glib-2.0/gio/gtlsdatabase.h +249 -0
  277. package/include/glib-2.0/gio/gtlsfiledatabase.h +60 -0
  278. package/include/glib-2.0/gio/gtlsinteraction.h +150 -0
  279. package/include/glib-2.0/gio/gtlspassword.h +121 -0
  280. package/include/glib-2.0/gio/gtlsserverconnection.h +71 -0
  281. package/include/glib-2.0/gio/gunixconnection.h +102 -0
  282. package/include/glib-2.0/gio/gunixcredentialsmessage.h +89 -0
  283. package/include/glib-2.0/gio/gunixfdlist.h +97 -0
  284. package/include/glib-2.0/gio/gunixsocketaddress.h +83 -0
  285. package/include/glib-2.0/gio/gvfs.h +170 -0
  286. package/include/glib-2.0/gio/gvolume.h +255 -0
  287. package/include/glib-2.0/gio/gvolumemonitor.h +156 -0
  288. package/include/glib-2.0/gio/gzlibcompressor.h +64 -0
  289. package/include/glib-2.0/gio/gzlibdecompressor.h +60 -0
  290. package/include/glib-2.0/glib/deprecated/gallocator.h +88 -0
  291. package/include/glib-2.0/glib/deprecated/gcache.h +77 -0
  292. package/include/glib-2.0/glib/deprecated/gcompletion.h +85 -0
  293. package/include/glib-2.0/glib/deprecated/gmain.h +137 -0
  294. package/include/glib-2.0/glib/deprecated/grel.h +107 -0
  295. package/include/glib-2.0/glib/deprecated/gthread.h +295 -0
  296. package/include/glib-2.0/glib/galloca.h +147 -0
  297. package/include/glib-2.0/glib/garray.h +323 -0
  298. package/include/glib-2.0/glib/gasyncqueue.h +126 -0
  299. package/include/glib-2.0/glib/gatomic.h +587 -0
  300. package/include/glib-2.0/glib/gbacktrace.h +74 -0
  301. package/include/glib-2.0/glib/gbase64.h +63 -0
  302. package/include/glib-2.0/glib/gbitlock.h +78 -0
  303. package/include/glib-2.0/glib/gbookmarkfile.h +300 -0
  304. package/include/glib-2.0/glib/gbytes.h +99 -0
  305. package/include/glib-2.0/glib/gcharset.h +49 -0
  306. package/include/glib-2.0/glib/gchecksum.h +106 -0
  307. package/include/glib-2.0/glib/gconvert.h +179 -0
  308. package/include/glib-2.0/glib/gdataset.h +156 -0
  309. package/include/glib-2.0/glib/gdate.h +309 -0
  310. package/include/glib-2.0/glib/gdatetime.h +275 -0
  311. package/include/glib-2.0/glib/gdir.h +54 -0
  312. package/include/glib-2.0/glib/genviron.h +65 -0
  313. package/include/glib-2.0/glib/gerror.h +263 -0
  314. package/include/glib-2.0/glib/gfileutils.h +223 -0
  315. package/include/glib-2.0/glib/ggettext.h +65 -0
  316. package/include/glib-2.0/glib/ghash.h +206 -0
  317. package/include/glib-2.0/glib/ghmac.h +85 -0
  318. package/include/glib-2.0/glib/ghook.h +204 -0
  319. package/include/glib-2.0/glib/ghostutils.h +45 -0
  320. package/include/glib-2.0/glib/gi18n-lib.h +38 -0
  321. package/include/glib-2.0/glib/gi18n.h +34 -0
  322. package/include/glib-2.0/glib/giochannel.h +407 -0
  323. package/include/glib-2.0/glib/gkeyfile.h +332 -0
  324. package/include/glib-2.0/glib/glib-autocleanups.h +105 -0
  325. package/include/glib-2.0/glib/glib-typeof.h +47 -0
  326. package/include/glib-2.0/glib/glib-visibility.h +952 -0
  327. package/include/glib-2.0/glib/glist.h +179 -0
  328. package/include/glib-2.0/glib/gmacros.h +1425 -0
  329. package/include/glib-2.0/glib/gmain.h +862 -0
  330. package/include/glib-2.0/glib/gmappedfile.h +60 -0
  331. package/include/glib-2.0/glib/gmarkup.h +265 -0
  332. package/include/glib-2.0/glib/gmem.h +425 -0
  333. package/include/glib-2.0/glib/gmessages.h +690 -0
  334. package/include/glib-2.0/glib/gnode.h +309 -0
  335. package/include/glib-2.0/glib/goption.h +409 -0
  336. package/include/glib-2.0/glib/gpathbuf.h +90 -0
  337. package/include/glib-2.0/glib/gpattern.h +65 -0
  338. package/include/glib-2.0/glib/gpoll.h +122 -0
  339. package/include/glib-2.0/glib/gprimes.h +52 -0
  340. package/include/glib-2.0/glib/gprintf.h +59 -0
  341. package/include/glib-2.0/glib/gqsort.h +47 -0
  342. package/include/glib-2.0/glib/gquark.h +70 -0
  343. package/include/glib-2.0/glib/gqueue.h +205 -0
  344. package/include/glib-2.0/glib/grand.h +101 -0
  345. package/include/glib-2.0/glib/grcbox.h +91 -0
  346. package/include/glib-2.0/glib/grefcount.h +179 -0
  347. package/include/glib-2.0/glib/grefstring.h +59 -0
  348. package/include/glib-2.0/glib/gscanner.h +301 -0
  349. package/include/glib-2.0/glib/gsequence.h +175 -0
  350. package/include/glib-2.0/glib/gshell.h +59 -0
  351. package/include/glib-2.0/glib/gslice.h +117 -0
  352. package/include/glib-2.0/glib/gslist.h +166 -0
  353. package/include/glib-2.0/glib/gspawn.h +323 -0
  354. package/include/glib-2.0/glib/gstdio.h +231 -0
  355. package/include/glib-2.0/glib/gstrfuncs.h +504 -0
  356. package/include/glib-2.0/glib/gstring.h +296 -0
  357. package/include/glib-2.0/glib/gstringchunk.h +59 -0
  358. package/include/glib-2.0/glib/gstrvbuilder.h +69 -0
  359. package/include/glib-2.0/glib/gtestutils.h +763 -0
  360. package/include/glib-2.0/glib/gthread.h +603 -0
  361. package/include/glib-2.0/glib/gthreadpool.h +105 -0
  362. package/include/glib-2.0/glib/gtimer.h +80 -0
  363. package/include/glib-2.0/glib/gtimezone.h +98 -0
  364. package/include/glib-2.0/glib/gtrashstack.h +60 -0
  365. package/include/glib-2.0/glib/gtree.h +181 -0
  366. package/include/glib-2.0/glib/gtypes.h +591 -0
  367. package/include/glib-2.0/glib/gunicode.h +974 -0
  368. package/include/glib-2.0/glib/guri.h +420 -0
  369. package/include/glib-2.0/glib/gutils.h +479 -0
  370. package/include/glib-2.0/glib/guuid.h +42 -0
  371. package/include/glib-2.0/glib/gvariant.h +541 -0
  372. package/include/glib-2.0/glib/gvarianttype.h +384 -0
  373. package/include/glib-2.0/glib/gversion.h +57 -0
  374. package/include/glib-2.0/glib/gversionmacros.h +490 -0
  375. package/include/glib-2.0/glib/gwin32.h +142 -0
  376. package/include/glib-2.0/glib-object.h +46 -0
  377. package/include/glib-2.0/glib-unix.h +125 -0
  378. package/include/glib-2.0/glib.h +121 -0
  379. package/include/glib-2.0/gmodule/gmodule-visibility.h +952 -0
  380. package/include/glib-2.0/gmodule.h +147 -0
  381. package/include/glib-2.0/gobject/gbinding.h +156 -0
  382. package/include/glib-2.0/gobject/gbindinggroup.h +85 -0
  383. package/include/glib-2.0/gobject/gboxed.h +124 -0
  384. package/include/glib-2.0/gobject/gclosure.h +323 -0
  385. package/include/glib-2.0/gobject/genums.h +381 -0
  386. package/include/glib-2.0/gobject/glib-enumtypes.h +25 -0
  387. package/include/glib-2.0/gobject/glib-types.h +400 -0
  388. package/include/glib-2.0/gobject/gmarshal.h +434 -0
  389. package/include/glib-2.0/gobject/gobject-autocleanups.h +33 -0
  390. package/include/glib-2.0/gobject/gobject-visibility.h +952 -0
  391. package/include/glib-2.0/gobject/gobject.h +953 -0
  392. package/include/glib-2.0/gobject/gobjectnotifyqueue.c +199 -0
  393. package/include/glib-2.0/gobject/gparam.h +476 -0
  394. package/include/glib-2.0/gobject/gparamspecs.h +1151 -0
  395. package/include/glib-2.0/gobject/gsignal.h +647 -0
  396. package/include/glib-2.0/gobject/gsignalgroup.h +98 -0
  397. package/include/glib-2.0/gobject/gsourceclosure.h +40 -0
  398. package/include/glib-2.0/gobject/gtype.h +2703 -0
  399. package/include/glib-2.0/gobject/gtypemodule.h +302 -0
  400. package/include/glib-2.0/gobject/gtypeplugin.h +136 -0
  401. package/include/glib-2.0/gobject/gvalue.h +212 -0
  402. package/include/glib-2.0/gobject/gvaluearray.h +106 -0
  403. package/include/glib-2.0/gobject/gvaluecollector.h +290 -0
  404. package/include/glib-2.0/gobject/gvaluetypes.h +318 -0
  405. package/include/harfbuzz/hb-aat-layout.h +795 -0
  406. package/include/harfbuzz/hb-aat.h +38 -0
  407. package/include/harfbuzz/hb-blob.h +160 -0
  408. package/include/harfbuzz/hb-buffer.h +799 -0
  409. package/include/harfbuzz/hb-common.h +938 -0
  410. package/include/harfbuzz/hb-cplusplus.hh +223 -0
  411. package/include/harfbuzz/hb-deprecated.h +309 -0
  412. package/include/harfbuzz/hb-draw.h +340 -0
  413. package/include/harfbuzz/hb-face.h +187 -0
  414. package/include/harfbuzz/hb-features.h +119 -0
  415. package/include/harfbuzz/hb-font.h +1153 -0
  416. package/include/harfbuzz/hb-ft.h +145 -0
  417. package/include/harfbuzz/hb-glib.h +56 -0
  418. package/include/harfbuzz/hb-map.h +143 -0
  419. package/include/harfbuzz/hb-ot-color.h +155 -0
  420. package/include/harfbuzz/hb-ot-deprecated.h +147 -0
  421. package/include/harfbuzz/hb-ot-font.h +45 -0
  422. package/include/harfbuzz/hb-ot-layout.h +549 -0
  423. package/include/harfbuzz/hb-ot-math.h +333 -0
  424. package/include/harfbuzz/hb-ot-meta.h +72 -0
  425. package/include/harfbuzz/hb-ot-metrics.h +129 -0
  426. package/include/harfbuzz/hb-ot-name.h +164 -0
  427. package/include/harfbuzz/hb-ot-shape.h +53 -0
  428. package/include/harfbuzz/hb-ot-var.h +191 -0
  429. package/include/harfbuzz/hb-ot.h +49 -0
  430. package/include/harfbuzz/hb-paint.h +1029 -0
  431. package/include/harfbuzz/hb-set.h +203 -0
  432. package/include/harfbuzz/hb-shape-plan.h +122 -0
  433. package/include/harfbuzz/hb-shape.h +74 -0
  434. package/include/harfbuzz/hb-style.h +81 -0
  435. package/include/harfbuzz/hb-subset-repacker.h +81 -0
  436. package/include/harfbuzz/hb-subset.h +241 -0
  437. package/include/harfbuzz/hb-unicode.h +643 -0
  438. package/include/harfbuzz/hb-version.h +95 -0
  439. package/include/harfbuzz/hb.h +51 -0
  440. package/include/index.js +1 -0
  441. package/include/jconfig.h +37 -0
  442. package/include/jerror.h +335 -0
  443. package/include/jmorecfg.h +382 -0
  444. package/include/jpeglib.h +1210 -0
  445. package/include/lcms2.h +1958 -0
  446. package/include/lcms2_plugin.h +700 -0
  447. package/include/libexif/_stdint.h +2 -0
  448. package/include/libexif/exif-byte-order.h +48 -0
  449. package/include/libexif/exif-content.h +181 -0
  450. package/include/libexif/exif-data-type.h +46 -0
  451. package/include/libexif/exif-data.h +267 -0
  452. package/include/libexif/exif-entry.h +186 -0
  453. package/include/libexif/exif-format.h +65 -0
  454. package/include/libexif/exif-ifd.h +51 -0
  455. package/include/libexif/exif-loader.h +128 -0
  456. package/include/libexif/exif-log.h +116 -0
  457. package/include/libexif/exif-mem.h +91 -0
  458. package/include/libexif/exif-mnote-data.h +122 -0
  459. package/include/libexif/exif-tag.h +307 -0
  460. package/include/libexif/exif-utils.h +194 -0
  461. package/include/libheif/heif.h +2092 -0
  462. package/include/libheif/heif_cxx.h +1359 -0
  463. package/include/libheif/heif_plugin.h +306 -0
  464. package/include/libheif/heif_version.h +38 -0
  465. package/include/libimagequant.h +111 -0
  466. package/include/libpng16/png.h +3247 -0
  467. package/include/libpng16/pngconf.h +623 -0
  468. package/include/libpng16/pnglibconf.h +219 -0
  469. package/include/librsvg-2.0/librsvg/rsvg-cairo.h +395 -0
  470. package/include/librsvg-2.0/librsvg/rsvg-features.h +184 -0
  471. package/include/librsvg-2.0/librsvg/rsvg-version.h +13 -0
  472. package/include/librsvg-2.0/librsvg/rsvg.h +1456 -0
  473. package/include/libxml2/libxml/HTMLparser.h +320 -0
  474. package/include/libxml2/libxml/HTMLtree.h +147 -0
  475. package/include/libxml2/libxml/SAX.h +204 -0
  476. package/include/libxml2/libxml/SAX2.h +173 -0
  477. package/include/libxml2/libxml/c14n.h +128 -0
  478. package/include/libxml2/libxml/catalog.h +182 -0
  479. package/include/libxml2/libxml/chvalid.h +230 -0
  480. package/include/libxml2/libxml/debugXML.h +217 -0
  481. package/include/libxml2/libxml/dict.h +81 -0
  482. package/include/libxml2/libxml/encoding.h +233 -0
  483. package/include/libxml2/libxml/entities.h +151 -0
  484. package/include/libxml2/libxml/globals.h +529 -0
  485. package/include/libxml2/libxml/hash.h +236 -0
  486. package/include/libxml2/libxml/list.h +137 -0
  487. package/include/libxml2/libxml/nanoftp.h +186 -0
  488. package/include/libxml2/libxml/nanohttp.h +81 -0
  489. package/include/libxml2/libxml/parser.h +1265 -0
  490. package/include/libxml2/libxml/parserInternals.h +662 -0
  491. package/include/libxml2/libxml/pattern.h +100 -0
  492. package/include/libxml2/libxml/relaxng.h +218 -0
  493. package/include/libxml2/libxml/schemasInternals.h +958 -0
  494. package/include/libxml2/libxml/schematron.h +142 -0
  495. package/include/libxml2/libxml/threads.h +94 -0
  496. package/include/libxml2/libxml/tree.h +1314 -0
  497. package/include/libxml2/libxml/uri.h +94 -0
  498. package/include/libxml2/libxml/valid.h +448 -0
  499. package/include/libxml2/libxml/xinclude.h +129 -0
  500. package/include/libxml2/libxml/xlink.h +189 -0
  501. package/include/libxml2/libxml/xmlIO.h +369 -0
  502. package/include/libxml2/libxml/xmlautomata.h +146 -0
  503. package/include/libxml2/libxml/xmlerror.h +919 -0
  504. package/include/libxml2/libxml/xmlexports.h +50 -0
  505. package/include/libxml2/libxml/xmlmemory.h +228 -0
  506. package/include/libxml2/libxml/xmlmodule.h +57 -0
  507. package/include/libxml2/libxml/xmlreader.h +428 -0
  508. package/include/libxml2/libxml/xmlregexp.h +222 -0
  509. package/include/libxml2/libxml/xmlsave.h +88 -0
  510. package/include/libxml2/libxml/xmlschemas.h +246 -0
  511. package/include/libxml2/libxml/xmlschemastypes.h +152 -0
  512. package/include/libxml2/libxml/xmlstring.h +140 -0
  513. package/include/libxml2/libxml/xmlunicode.h +202 -0
  514. package/include/libxml2/libxml/xmlversion.h +526 -0
  515. package/include/libxml2/libxml/xmlwriter.h +488 -0
  516. package/include/libxml2/libxml/xpath.h +575 -0
  517. package/include/libxml2/libxml/xpathInternals.h +632 -0
  518. package/include/libxml2/libxml/xpointer.h +137 -0
  519. package/include/orc-0.4/orc/orc-stdint.h +1 -0
  520. package/include/orc-0.4/orc/orc.h +16 -0
  521. package/include/orc-0.4/orc/orcarm.h +879 -0
  522. package/include/orc-0.4/orc/orcbytecode.h +35 -0
  523. package/include/orc-0.4/orc/orcbytecodes.h +255 -0
  524. package/include/orc-0.4/orc/orccode.h +53 -0
  525. package/include/orc-0.4/orc/orccompiler.h +176 -0
  526. package/include/orc-0.4/orc/orcconstant.h +39 -0
  527. package/include/orc-0.4/orc/orccpu.h +21 -0
  528. package/include/orc-0.4/orc/orccpuinsn.h +40 -0
  529. package/include/orc-0.4/orc/orcdebug.h +158 -0
  530. package/include/orc-0.4/orc/orcemulateopcodes.h +203 -0
  531. package/include/orc-0.4/orc/orcexecutor.h +135 -0
  532. package/include/orc-0.4/orc/orcfunctions.h +93 -0
  533. package/include/orc-0.4/orc/orcinstruction.h +39 -0
  534. package/include/orc-0.4/orc/orcinternal.h +46 -0
  535. package/include/orc-0.4/orc/orclimits.h +94 -0
  536. package/include/orc-0.4/orc/orcmips.h +229 -0
  537. package/include/orc-0.4/orc/orcmmx.h +79 -0
  538. package/include/orc-0.4/orc/orcneon.h +43 -0
  539. package/include/orc-0.4/orc/orconce.h +166 -0
  540. package/include/orc-0.4/orc/orcopcode.h +63 -0
  541. package/include/orc-0.4/orc/orcparse.h +27 -0
  542. package/include/orc-0.4/orc/orcpowerpc.h +209 -0
  543. package/include/orc-0.4/orc/orcprogram.h +192 -0
  544. package/include/orc-0.4/orc/orcrule.h +52 -0
  545. package/include/orc-0.4/orc/orcsse.h +55 -0
  546. package/include/orc-0.4/orc/orctarget.h +115 -0
  547. package/include/orc-0.4/orc/orcutils.h +238 -0
  548. package/include/orc-0.4/orc/orcvariable.h +81 -0
  549. package/include/orc-0.4/orc/orcx86.h +199 -0
  550. package/include/orc-0.4/orc/orcx86insn.h +672 -0
  551. package/include/pango-1.0/pango/pango-attributes.h +748 -0
  552. package/include/pango-1.0/pango/pango-bidi-type.h +117 -0
  553. package/include/pango-1.0/pango/pango-break.h +144 -0
  554. package/include/pango-1.0/pango/pango-color.h +75 -0
  555. package/include/pango-1.0/pango/pango-context.h +116 -0
  556. package/include/pango-1.0/pango/pango-coverage.h +108 -0
  557. package/include/pango-1.0/pango/pango-direction.h +72 -0
  558. package/include/pango-1.0/pango/pango-engine.h +457 -0
  559. package/include/pango-1.0/pango/pango-enum-types.h +120 -0
  560. package/include/pango-1.0/pango/pango-features.h +10 -0
  561. package/include/pango-1.0/pango/pango-font.h +699 -0
  562. package/include/pango-1.0/pango/pango-fontmap.h +132 -0
  563. package/include/pango-1.0/pango/pango-fontset-simple.h +64 -0
  564. package/include/pango-1.0/pango/pango-fontset.h +134 -0
  565. package/include/pango-1.0/pango/pango-glyph-item.h +175 -0
  566. package/include/pango-1.0/pango/pango-glyph.h +270 -0
  567. package/include/pango-1.0/pango/pango-gravity.h +137 -0
  568. package/include/pango-1.0/pango/pango-item.h +165 -0
  569. package/include/pango-1.0/pango/pango-language.h +70 -0
  570. package/include/pango-1.0/pango/pango-layout.h +554 -0
  571. package/include/pango-1.0/pango/pango-markup.h +52 -0
  572. package/include/pango-1.0/pango/pango-matrix.h +130 -0
  573. package/include/pango-1.0/pango/pango-modules.h +84 -0
  574. package/include/pango-1.0/pango/pango-ot.h +427 -0
  575. package/include/pango-1.0/pango/pango-renderer.h +290 -0
  576. package/include/pango-1.0/pango/pango-script.h +335 -0
  577. package/include/pango-1.0/pango/pango-tabs.h +117 -0
  578. package/include/pango-1.0/pango/pango-types.h +244 -0
  579. package/include/pango-1.0/pango/pango-utils.h +187 -0
  580. package/include/pango-1.0/pango/pango-version-macros.h +756 -0
  581. package/include/pango-1.0/pango/pango.h +54 -0
  582. package/include/pango-1.0/pango/pangocairo.h +220 -0
  583. package/include/pango-1.0/pango/pangofc-decoder.h +122 -0
  584. package/include/pango-1.0/pango/pangofc-font.h +120 -0
  585. package/include/pango-1.0/pango/pangofc-fontmap.h +244 -0
  586. package/include/pango-1.0/pango/pangoft2.h +158 -0
  587. package/include/pixman-1/pixman-version.h +54 -0
  588. package/include/pixman-1/pixman.h +1419 -0
  589. package/include/png.h +3247 -0
  590. package/include/pngconf.h +623 -0
  591. package/include/pnglibconf.h +219 -0
  592. package/include/spng.h +537 -0
  593. package/include/tiff.h +899 -0
  594. package/include/tiffconf.h +145 -0
  595. package/include/tiffio.h +653 -0
  596. package/include/tiffvers.h +36 -0
  597. package/include/vips/VConnection8.h +150 -0
  598. package/include/vips/VError8.h +76 -0
  599. package/include/vips/VImage8.h +6065 -0
  600. package/include/vips/VInterpolate8.h +77 -0
  601. package/include/vips/VRegion8.h +155 -0
  602. package/include/vips/arithmetic.h +571 -0
  603. package/include/vips/basic.h +113 -0
  604. package/include/vips/buf.h +118 -0
  605. package/include/vips/colour.h +306 -0
  606. package/include/vips/connection.h +570 -0
  607. package/include/vips/conversion.h +357 -0
  608. package/include/vips/convolution.h +95 -0
  609. package/include/vips/create.h +161 -0
  610. package/include/vips/dbuf.h +103 -0
  611. package/include/vips/debug.h +74 -0
  612. package/include/vips/draw.h +113 -0
  613. package/include/vips/enumtypes.h +181 -0
  614. package/include/vips/error.h +142 -0
  615. package/include/vips/foreign.h +993 -0
  616. package/include/vips/format.h +135 -0
  617. package/include/vips/freqfilt.h +64 -0
  618. package/include/vips/gate.h +82 -0
  619. package/include/vips/generate.h +92 -0
  620. package/include/vips/header.h +312 -0
  621. package/include/vips/histogram.h +85 -0
  622. package/include/vips/image.h +605 -0
  623. package/include/vips/interpolate.h +141 -0
  624. package/include/vips/memory.h +96 -0
  625. package/include/vips/morphology.h +73 -0
  626. package/include/vips/mosaicing.h +80 -0
  627. package/include/vips/object.h +706 -0
  628. package/include/vips/operation.h +182 -0
  629. package/include/vips/private.h +227 -0
  630. package/include/vips/rect.h +80 -0
  631. package/include/vips/region.h +238 -0
  632. package/include/vips/resample.h +123 -0
  633. package/include/vips/sbuf.h +144 -0
  634. package/include/vips/semaphore.h +77 -0
  635. package/include/vips/thread.h +72 -0
  636. package/include/vips/threadpool.h +160 -0
  637. package/include/vips/transform.h +89 -0
  638. package/include/vips/type.h +305 -0
  639. package/include/vips/util.h +406 -0
  640. package/include/vips/vector.h +183 -0
  641. package/include/vips/version.h +26 -0
  642. package/include/vips/vips.h +194 -0
  643. package/include/vips/vips8 +60 -0
  644. package/include/webp/decode.h +504 -0
  645. package/include/webp/demux.h +363 -0
  646. package/include/webp/encode.h +552 -0
  647. package/include/webp/mux.h +530 -0
  648. package/include/webp/mux_types.h +98 -0
  649. package/include/webp/sharpyuv/sharpyuv.h +103 -0
  650. package/include/webp/sharpyuv/sharpyuv_csp.h +60 -0
  651. package/include/webp/types.h +72 -0
  652. package/include/zconf.h +203 -0
  653. package/include/zlib.h +1855 -0
  654. package/include/zlib_name_mangling.h +8 -0
  655. package/package.json +30 -0
  656. package/versions.json +31 -0
@@ -0,0 +1,2703 @@
1
+ /* GObject - GLib Type, Object, Parameter and Signal Library
2
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
3
+ *
4
+ * SPDX-License-Identifier: LGPL-2.1-or-later
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General
17
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+ #ifndef __G_TYPE_H__
20
+ #define __G_TYPE_H__
21
+
22
+ #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
23
+ #error "Only <glib-object.h> can be included directly."
24
+ #endif
25
+
26
+ #include <glib.h>
27
+ #include <gobject/gobject-visibility.h>
28
+
29
+ G_BEGIN_DECLS
30
+
31
+ /* Basic Type Macros
32
+ */
33
+ /**
34
+ * G_TYPE_FUNDAMENTAL:
35
+ * @type: A #GType value.
36
+ *
37
+ * The fundamental type which is the ancestor of @type.
38
+ *
39
+ * Fundamental types are types that serve as ultimate bases for the derived types,
40
+ * thus they are the roots of distinct inheritance hierarchies.
41
+ */
42
+ #define G_TYPE_FUNDAMENTAL(type) (g_type_fundamental (type))
43
+ /**
44
+ * G_TYPE_FUNDAMENTAL_MAX:
45
+ *
46
+ * An integer constant that represents the number of identifiers reserved
47
+ * for types that are assigned at compile-time.
48
+ */
49
+ #define G_TYPE_FUNDAMENTAL_MAX (255 << G_TYPE_FUNDAMENTAL_SHIFT)
50
+
51
+ /* Constant fundamental types,
52
+ */
53
+ /**
54
+ * G_TYPE_INVALID:
55
+ *
56
+ * An invalid #GType used as error return value in some functions which return
57
+ * a #GType.
58
+ */
59
+ #define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0)
60
+ /**
61
+ * G_TYPE_NONE:
62
+ *
63
+ * A fundamental type which is used as a replacement for the C
64
+ * void return type.
65
+ */
66
+ #define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1)
67
+ /**
68
+ * G_TYPE_INTERFACE:
69
+ *
70
+ * The fundamental type from which all interfaces are derived.
71
+ */
72
+ #define G_TYPE_INTERFACE G_TYPE_MAKE_FUNDAMENTAL (2)
73
+ /**
74
+ * G_TYPE_CHAR:
75
+ *
76
+ * The fundamental type corresponding to #gchar.
77
+ *
78
+ * The type designated by %G_TYPE_CHAR is unconditionally an 8-bit signed integer.
79
+ * This may or may not be the same type a the C type "gchar".
80
+ */
81
+ #define G_TYPE_CHAR G_TYPE_MAKE_FUNDAMENTAL (3)
82
+ /**
83
+ * G_TYPE_UCHAR:
84
+ *
85
+ * The fundamental type corresponding to #guchar.
86
+ */
87
+ #define G_TYPE_UCHAR G_TYPE_MAKE_FUNDAMENTAL (4)
88
+ /**
89
+ * G_TYPE_BOOLEAN:
90
+ *
91
+ * The fundamental type corresponding to #gboolean.
92
+ */
93
+ #define G_TYPE_BOOLEAN G_TYPE_MAKE_FUNDAMENTAL (5)
94
+ /**
95
+ * G_TYPE_INT:
96
+ *
97
+ * The fundamental type corresponding to #gint.
98
+ */
99
+ #define G_TYPE_INT G_TYPE_MAKE_FUNDAMENTAL (6)
100
+ /**
101
+ * G_TYPE_UINT:
102
+ *
103
+ * The fundamental type corresponding to #guint.
104
+ */
105
+ #define G_TYPE_UINT G_TYPE_MAKE_FUNDAMENTAL (7)
106
+ /**
107
+ * G_TYPE_LONG:
108
+ *
109
+ * The fundamental type corresponding to #glong.
110
+ */
111
+ #define G_TYPE_LONG G_TYPE_MAKE_FUNDAMENTAL (8)
112
+ /**
113
+ * G_TYPE_ULONG:
114
+ *
115
+ * The fundamental type corresponding to #gulong.
116
+ */
117
+ #define G_TYPE_ULONG G_TYPE_MAKE_FUNDAMENTAL (9)
118
+ /**
119
+ * G_TYPE_INT64:
120
+ *
121
+ * The fundamental type corresponding to #gint64.
122
+ */
123
+ #define G_TYPE_INT64 G_TYPE_MAKE_FUNDAMENTAL (10)
124
+ /**
125
+ * G_TYPE_UINT64:
126
+ *
127
+ * The fundamental type corresponding to #guint64.
128
+ */
129
+ #define G_TYPE_UINT64 G_TYPE_MAKE_FUNDAMENTAL (11)
130
+ /**
131
+ * G_TYPE_ENUM:
132
+ *
133
+ * The fundamental type from which all enumeration types are derived.
134
+ */
135
+ #define G_TYPE_ENUM G_TYPE_MAKE_FUNDAMENTAL (12)
136
+ /**
137
+ * G_TYPE_FLAGS:
138
+ *
139
+ * The fundamental type from which all flags types are derived.
140
+ */
141
+ #define G_TYPE_FLAGS G_TYPE_MAKE_FUNDAMENTAL (13)
142
+ /**
143
+ * G_TYPE_FLOAT:
144
+ *
145
+ * The fundamental type corresponding to #gfloat.
146
+ */
147
+ #define G_TYPE_FLOAT G_TYPE_MAKE_FUNDAMENTAL (14)
148
+ /**
149
+ * G_TYPE_DOUBLE:
150
+ *
151
+ * The fundamental type corresponding to #gdouble.
152
+ */
153
+ #define G_TYPE_DOUBLE G_TYPE_MAKE_FUNDAMENTAL (15)
154
+ /**
155
+ * G_TYPE_STRING:
156
+ *
157
+ * The fundamental type corresponding to nul-terminated C strings.
158
+ */
159
+ #define G_TYPE_STRING G_TYPE_MAKE_FUNDAMENTAL (16)
160
+ /**
161
+ * G_TYPE_POINTER:
162
+ *
163
+ * The fundamental type corresponding to #gpointer.
164
+ */
165
+ #define G_TYPE_POINTER G_TYPE_MAKE_FUNDAMENTAL (17)
166
+ /**
167
+ * G_TYPE_BOXED:
168
+ *
169
+ * The fundamental type from which all boxed types are derived.
170
+ */
171
+ #define G_TYPE_BOXED G_TYPE_MAKE_FUNDAMENTAL (18)
172
+ /**
173
+ * G_TYPE_PARAM:
174
+ *
175
+ * The fundamental type from which all #GParamSpec types are derived.
176
+ */
177
+ #define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19)
178
+ /**
179
+ * G_TYPE_OBJECT:
180
+ *
181
+ * The fundamental type for #GObject.
182
+ */
183
+ #define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20)
184
+ /**
185
+ * G_TYPE_VARIANT:
186
+ *
187
+ * The fundamental type corresponding to #GVariant.
188
+ *
189
+ * All floating #GVariant instances passed through the #GType system are
190
+ * consumed.
191
+ *
192
+ * Note that callbacks in closures, and signal handlers
193
+ * for signals of return type %G_TYPE_VARIANT, must never return floating
194
+ * variants.
195
+ *
196
+ * Note: GLib 2.24 did include a boxed type with this name. It was replaced
197
+ * with this fundamental type in 2.26.
198
+ *
199
+ * Since: 2.26
200
+ */
201
+ #define G_TYPE_VARIANT G_TYPE_MAKE_FUNDAMENTAL (21)
202
+
203
+
204
+ /* Reserved fundamental type numbers to create new fundamental
205
+ * type IDs with G_TYPE_MAKE_FUNDAMENTAL().
206
+ *
207
+ * Open an issue on https://gitlab.gnome.org/GNOME/glib/issues/new for
208
+ * reservations.
209
+ */
210
+ /**
211
+ * G_TYPE_FUNDAMENTAL_SHIFT:
212
+ *
213
+ * Shift value used in converting numbers to type IDs.
214
+ */
215
+ #define G_TYPE_FUNDAMENTAL_SHIFT (2)
216
+ /**
217
+ * G_TYPE_MAKE_FUNDAMENTAL:
218
+ * @x: the fundamental type number.
219
+ *
220
+ * Get the type ID for the fundamental type number @x.
221
+ *
222
+ * Use g_type_fundamental_next() instead of this macro to create new fundamental
223
+ * types.
224
+ *
225
+ * Returns: the GType
226
+ */
227
+ #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT))
228
+ /**
229
+ * G_TYPE_RESERVED_GLIB_FIRST:
230
+ *
231
+ * First fundamental type number to create a new fundamental type id with
232
+ * G_TYPE_MAKE_FUNDAMENTAL() reserved for GLib.
233
+ */
234
+ #define G_TYPE_RESERVED_GLIB_FIRST (22)
235
+ /**
236
+ * G_TYPE_RESERVED_GLIB_LAST:
237
+ *
238
+ * Last fundamental type number reserved for GLib.
239
+ */
240
+ #define G_TYPE_RESERVED_GLIB_LAST (31)
241
+ /**
242
+ * G_TYPE_RESERVED_BSE_FIRST:
243
+ *
244
+ * First fundamental type number to create a new fundamental type id with
245
+ * G_TYPE_MAKE_FUNDAMENTAL() reserved for BSE.
246
+ */
247
+ #define G_TYPE_RESERVED_BSE_FIRST (32)
248
+ /**
249
+ * G_TYPE_RESERVED_BSE_LAST:
250
+ *
251
+ * Last fundamental type number reserved for BSE.
252
+ */
253
+ #define G_TYPE_RESERVED_BSE_LAST (48)
254
+ /**
255
+ * G_TYPE_RESERVED_USER_FIRST:
256
+ *
257
+ * First available fundamental type number to create new fundamental
258
+ * type id with G_TYPE_MAKE_FUNDAMENTAL().
259
+ */
260
+ #define G_TYPE_RESERVED_USER_FIRST (49)
261
+
262
+
263
+ /* Type Checking Macros
264
+ */
265
+ /**
266
+ * G_TYPE_IS_FUNDAMENTAL:
267
+ * @type: A #GType value
268
+ *
269
+ * Checks if @type is a fundamental type.
270
+ *
271
+ * Returns: %TRUE is @type is fundamental
272
+ */
273
+ #define G_TYPE_IS_FUNDAMENTAL(type) ((type) <= G_TYPE_FUNDAMENTAL_MAX)
274
+ /**
275
+ * G_TYPE_IS_DERIVED:
276
+ * @type: A #GType value
277
+ *
278
+ * Checks if @type is derived (or in object-oriented terminology:
279
+ * inherited) from another type (this holds true for all non-fundamental
280
+ * types).
281
+ *
282
+ * Returns: %TRUE if @type is derived
283
+ */
284
+ #define G_TYPE_IS_DERIVED(type) ((type) > G_TYPE_FUNDAMENTAL_MAX)
285
+ /**
286
+ * G_TYPE_IS_INTERFACE:
287
+ * @type: A #GType value
288
+ *
289
+ * Checks if @type is an interface type.
290
+ *
291
+ * An interface type provides a pure API, the implementation
292
+ * of which is provided by another type (which is then said to conform
293
+ * to the interface). GLib interfaces are somewhat analogous to Java
294
+ * interfaces and C++ classes containing only pure virtual functions,
295
+ * with the difference that GType interfaces are not derivable (but see
296
+ * g_type_interface_add_prerequisite() for an alternative).
297
+ *
298
+ * Returns: %TRUE if @type is an interface
299
+ */
300
+ #define G_TYPE_IS_INTERFACE(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE)
301
+ /**
302
+ * G_TYPE_IS_CLASSED:
303
+ * @type: A #GType value
304
+ *
305
+ * Checks if @type is a classed type.
306
+ *
307
+ * A classed type has an associated #GTypeClass which can be derived to store
308
+ * class-wide virtual function pointers and data for all instances of the type.
309
+ * This allows for subclassing. All #GObjects are classed; none of the scalar
310
+ * fundamental types built into GLib are classed.
311
+ *
312
+ * Interfaces are not classed: while their #GTypeInterface struct could be
313
+ * considered similar to #GTypeClass, and classes can derive interfaces,
314
+ * #GTypeInterface doesn’t allow for subclassing.
315
+ *
316
+ * Returns: %TRUE if @type is classed
317
+ */
318
+ #define G_TYPE_IS_CLASSED(type) (g_type_test_flags ((type), G_TYPE_FLAG_CLASSED))
319
+ /**
320
+ * G_TYPE_IS_INSTANTIATABLE:
321
+ * @type: A #GType value
322
+ *
323
+ * Checks if @type can be instantiated. Instantiation is the
324
+ * process of creating an instance (object) of this type.
325
+ *
326
+ * Returns: %TRUE if @type is instantiatable
327
+ */
328
+ #define G_TYPE_IS_INSTANTIATABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_INSTANTIATABLE))
329
+ /**
330
+ * G_TYPE_IS_DERIVABLE:
331
+ * @type: A #GType value
332
+ *
333
+ * Checks if @type is a derivable type. A derivable type can
334
+ * be used as the base class of a flat (single-level) class hierarchy.
335
+ *
336
+ * Returns: %TRUE if @type is derivable
337
+ */
338
+ #define G_TYPE_IS_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DERIVABLE))
339
+ /**
340
+ * G_TYPE_IS_DEEP_DERIVABLE:
341
+ * @type: A #GType value
342
+ *
343
+ * Checks if @type is a deep derivable type. A deep derivable type
344
+ * can be used as the base class of a deep (multi-level) class hierarchy.
345
+ *
346
+ * Returns: %TRUE if @type is deep derivable
347
+ */
348
+ #define G_TYPE_IS_DEEP_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE))
349
+ /**
350
+ * G_TYPE_IS_ABSTRACT:
351
+ * @type: A #GType value
352
+ *
353
+ * Checks if @type is an abstract type. An abstract type cannot be
354
+ * instantiated and is normally used as an abstract base class for
355
+ * derived classes.
356
+ *
357
+ * Returns: %TRUE if @type is abstract
358
+ */
359
+ #define G_TYPE_IS_ABSTRACT(type) (g_type_test_flags ((type), G_TYPE_FLAG_ABSTRACT))
360
+ /**
361
+ * G_TYPE_IS_VALUE_ABSTRACT:
362
+ * @type: A #GType value
363
+ *
364
+ * Checks if @type is an abstract value type. An abstract value type introduces
365
+ * a value table, but can't be used for g_value_init() and is normally used as
366
+ * an abstract base type for derived value types.
367
+ *
368
+ * Returns: %TRUE if @type is an abstract value type
369
+ */
370
+ #define G_TYPE_IS_VALUE_ABSTRACT(type) (g_type_test_flags ((type), G_TYPE_FLAG_VALUE_ABSTRACT))
371
+ /**
372
+ * G_TYPE_IS_VALUE_TYPE:
373
+ * @type: A #GType value
374
+ *
375
+ * Checks if @type is a value type and can be used with g_value_init().
376
+ *
377
+ * Returns: %TRUE if @type is a value type
378
+ */
379
+ #define G_TYPE_IS_VALUE_TYPE(type) (g_type_check_is_value_type (type))
380
+ /**
381
+ * G_TYPE_HAS_VALUE_TABLE:
382
+ * @type: A #GType value
383
+ *
384
+ * Checks if @type has a #GTypeValueTable.
385
+ *
386
+ * Returns: %TRUE if @type has a value table
387
+ */
388
+ #define G_TYPE_HAS_VALUE_TABLE(type) (g_type_value_table_peek (type) != NULL)
389
+ /**
390
+ * G_TYPE_IS_FINAL:
391
+ * @type: a #GType value
392
+ *
393
+ * Checks if @type is a final type. A final type cannot be derived any
394
+ * further.
395
+ *
396
+ * Returns: %TRUE if @type is final
397
+ *
398
+ * Since: 2.70
399
+ */
400
+ #define G_TYPE_IS_FINAL(type) (g_type_test_flags ((type), G_TYPE_FLAG_FINAL)) GOBJECT_AVAILABLE_MACRO_IN_2_70
401
+
402
+ /**
403
+ * G_TYPE_IS_DEPRECATED:
404
+ * @type: a #GType value
405
+ *
406
+ * Checks if @type is deprecated. Instantiating a deprecated type will
407
+ * trigger a warning if running with `G_ENABLE_DIAGNOSTIC=1`.
408
+ *
409
+ * Returns: %TRUE if the type is deprecated
410
+ *
411
+ * Since: 2.76
412
+ */
413
+ #define G_TYPE_IS_DEPRECATED(type) (g_type_test_flags ((type), G_TYPE_FLAG_DEPRECATED)) GOBJECT_AVAILABLE_MACRO_IN_2_76
414
+
415
+
416
+ /* Typedefs
417
+ */
418
+ /**
419
+ * GType:
420
+ *
421
+ * A numerical value which represents the unique identifier of a registered
422
+ * type.
423
+ */
424
+ #if GLIB_SIZEOF_SIZE_T != GLIB_SIZEOF_LONG || !defined (G_CXX_STD_VERSION)
425
+ typedef gsize GType;
426
+ #else /* for historic reasons, C++ links against gulong GTypes */
427
+ typedef gulong GType;
428
+ #endif
429
+ typedef struct _GValue GValue;
430
+ typedef union _GTypeCValue GTypeCValue;
431
+ typedef struct _GTypePlugin GTypePlugin;
432
+ typedef struct _GTypeClass GTypeClass;
433
+ typedef struct _GTypeInterface GTypeInterface;
434
+ typedef struct _GTypeInstance GTypeInstance;
435
+ typedef struct _GTypeInfo GTypeInfo;
436
+ typedef struct _GTypeFundamentalInfo GTypeFundamentalInfo;
437
+ typedef struct _GInterfaceInfo GInterfaceInfo;
438
+ typedef struct _GTypeValueTable GTypeValueTable;
439
+ typedef struct _GTypeQuery GTypeQuery;
440
+
441
+
442
+ /* Basic Type Structures
443
+ */
444
+ /**
445
+ * GTypeClass:
446
+ *
447
+ * An opaque structure used as the base of all classes.
448
+ */
449
+ struct _GTypeClass
450
+ {
451
+ /*< private >*/
452
+ GType g_type;
453
+ };
454
+ /**
455
+ * GTypeInstance:
456
+ *
457
+ * An opaque structure used as the base of all type instances.
458
+ */
459
+ struct _GTypeInstance
460
+ {
461
+ /*< private >*/
462
+ GTypeClass *g_class;
463
+ };
464
+ /**
465
+ * GTypeInterface:
466
+ *
467
+ * An opaque structure used as the base of all interface types.
468
+ */
469
+ struct _GTypeInterface
470
+ {
471
+ /*< private >*/
472
+ GType g_type; /* iface type */
473
+ GType g_instance_type;
474
+ };
475
+ /**
476
+ * GTypeQuery:
477
+ * @type: the #GType value of the type
478
+ * @type_name: the name of the type
479
+ * @class_size: the size of the class structure
480
+ * @instance_size: the size of the instance structure
481
+ *
482
+ * A structure holding information for a specific type.
483
+ *
484
+ * See also: g_type_query()
485
+ */
486
+ struct _GTypeQuery
487
+ {
488
+ GType type;
489
+ const gchar *type_name;
490
+ guint class_size;
491
+ guint instance_size;
492
+ };
493
+
494
+
495
+ /* Casts, checks and accessors for structured types
496
+ * usage of these macros is reserved to type implementations only
497
+ */
498
+ /*< protected >*/
499
+ /**
500
+ * G_TYPE_CHECK_INSTANCE:
501
+ * @instance: Location of a #GTypeInstance structure
502
+ *
503
+ * Checks if @instance is a valid #GTypeInstance structure,
504
+ * otherwise issues a warning and returns %FALSE. %NULL is not a valid
505
+ * #GTypeInstance.
506
+ *
507
+ * This macro should only be used in type implementations.
508
+ *
509
+ * Returns: %TRUE if @instance is valid
510
+ */
511
+ #define G_TYPE_CHECK_INSTANCE(instance) (_G_TYPE_CHI ((GTypeInstance*) (instance)))
512
+ /**
513
+ * G_TYPE_CHECK_INSTANCE_CAST:
514
+ * @instance: (nullable): Location of a #GTypeInstance structure
515
+ * @g_type: The type to be returned
516
+ * @c_type: The corresponding C type of @g_type
517
+ *
518
+ * Checks that @instance is an instance of the type identified by @g_type
519
+ * and issues a warning if this is not the case. Returns @instance casted
520
+ * to a pointer to @c_type.
521
+ *
522
+ * No warning will be issued if @instance is %NULL, and %NULL will be returned.
523
+ *
524
+ * This macro should only be used in type implementations.
525
+ */
526
+ #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type))
527
+ /**
528
+ * G_TYPE_CHECK_INSTANCE_TYPE:
529
+ * @instance: (nullable): Location of a #GTypeInstance structure.
530
+ * @g_type: The type to be checked
531
+ *
532
+ * Checks if @instance is an instance of the type identified by @g_type. If
533
+ * @instance is %NULL, %FALSE will be returned.
534
+ *
535
+ * This macro should only be used in type implementations.
536
+ *
537
+ * Returns: %TRUE if @instance is an instance of @g_type
538
+ */
539
+ #define G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type) (_G_TYPE_CIT ((instance), (g_type)))
540
+ /**
541
+ * G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE:
542
+ * @instance: (nullable): Location of a #GTypeInstance structure.
543
+ * @g_type: The fundamental type to be checked
544
+ *
545
+ * Checks if @instance is an instance of the fundamental type identified by @g_type.
546
+ * If @instance is %NULL, %FALSE will be returned.
547
+ *
548
+ * This macro should only be used in type implementations.
549
+ *
550
+ * Returns: %TRUE if @instance is an instance of @g_type
551
+ */
552
+ #define G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE(instance, g_type) (_G_TYPE_CIFT ((instance), (g_type)))
553
+ /**
554
+ * G_TYPE_INSTANCE_GET_CLASS:
555
+ * @instance: Location of the #GTypeInstance structure
556
+ * @g_type: The #GType of the class to be returned
557
+ * @c_type: The C type of the class structure
558
+ *
559
+ * Get the class structure of a given @instance, casted
560
+ * to a specified ancestor type @g_type of the instance.
561
+ *
562
+ * Note that while calling a GInstanceInitFunc(), the class pointer
563
+ * gets modified, so it might not always return the expected pointer.
564
+ *
565
+ * This macro should only be used in type implementations.
566
+ *
567
+ * Returns: a pointer to the class structure
568
+ */
569
+ #define G_TYPE_INSTANCE_GET_CLASS(instance, g_type, c_type) (_G_TYPE_IGC ((instance), (g_type), c_type))
570
+ /**
571
+ * G_TYPE_INSTANCE_GET_INTERFACE:
572
+ * @instance: Location of the #GTypeInstance structure
573
+ * @g_type: The #GType of the interface to be returned
574
+ * @c_type: The C type of the interface structure
575
+ *
576
+ * Get the interface structure for interface @g_type of a given @instance.
577
+ *
578
+ * This macro should only be used in type implementations.
579
+ *
580
+ * Returns: a pointer to the interface structure
581
+ */
582
+ #define G_TYPE_INSTANCE_GET_INTERFACE(instance, g_type, c_type) (_G_TYPE_IGI ((instance), (g_type), c_type))
583
+ /**
584
+ * G_TYPE_CHECK_CLASS_CAST:
585
+ * @g_class: Location of a #GTypeClass structure
586
+ * @g_type: The type to be returned
587
+ * @c_type: The corresponding C type of class structure of @g_type
588
+ *
589
+ * Checks that @g_class is a class structure of the type identified by @g_type
590
+ * and issues a warning if this is not the case. Returns @g_class casted
591
+ * to a pointer to @c_type. %NULL is not a valid class structure.
592
+ *
593
+ * This macro should only be used in type implementations.
594
+ */
595
+ #define G_TYPE_CHECK_CLASS_CAST(g_class, g_type, c_type) (_G_TYPE_CCC ((g_class), (g_type), c_type))
596
+ /**
597
+ * G_TYPE_CHECK_CLASS_TYPE:
598
+ * @g_class: (nullable): Location of a #GTypeClass structure
599
+ * @g_type: The type to be checked
600
+ *
601
+ * Checks if @g_class is a class structure of the type identified by
602
+ * @g_type. If @g_class is %NULL, %FALSE will be returned.
603
+ *
604
+ * This macro should only be used in type implementations.
605
+ *
606
+ * Returns: %TRUE if @g_class is a class structure of @g_type
607
+ */
608
+ #define G_TYPE_CHECK_CLASS_TYPE(g_class, g_type) (_G_TYPE_CCT ((g_class), (g_type)))
609
+ /**
610
+ * G_TYPE_CHECK_VALUE:
611
+ * @value: a #GValue
612
+ *
613
+ * Checks if @value has been initialized to hold values
614
+ * of a value type.
615
+ *
616
+ * This macro should only be used in type implementations.
617
+ *
618
+ * Returns: %TRUE if @value is initialized
619
+ */
620
+ #define G_TYPE_CHECK_VALUE(value) (_G_TYPE_CHV ((value)))
621
+ /**
622
+ * G_TYPE_CHECK_VALUE_TYPE:
623
+ * @value: a #GValue
624
+ * @g_type: The type to be checked
625
+ *
626
+ * Checks if @value has been initialized to hold values
627
+ * of type @g_type.
628
+ *
629
+ * This macro should only be used in type implementations.
630
+ *
631
+ * Returns: %TRUE if @value has been initialized to hold values of type @g_type
632
+ */
633
+ #define G_TYPE_CHECK_VALUE_TYPE(value, g_type) (_G_TYPE_CVH ((value), (g_type)))
634
+ /**
635
+ * G_TYPE_FROM_INSTANCE:
636
+ * @instance: Location of a valid #GTypeInstance structure
637
+ *
638
+ * Get the type identifier from a given @instance structure.
639
+ *
640
+ * This macro should only be used in type implementations.
641
+ *
642
+ * Returns: the #GType
643
+ */
644
+ #define G_TYPE_FROM_INSTANCE(instance) (G_TYPE_FROM_CLASS (((GTypeInstance*) (instance))->g_class))
645
+ /**
646
+ * G_TYPE_FROM_CLASS:
647
+ * @g_class: Location of a valid #GTypeClass structure
648
+ *
649
+ * Get the type identifier from a given @class structure.
650
+ *
651
+ * This macro should only be used in type implementations.
652
+ *
653
+ * Returns: the #GType
654
+ */
655
+ #define G_TYPE_FROM_CLASS(g_class) (((GTypeClass*) (g_class))->g_type)
656
+ /**
657
+ * G_TYPE_FROM_INTERFACE:
658
+ * @g_iface: Location of a valid #GTypeInterface structure
659
+ *
660
+ * Get the type identifier from a given @interface structure.
661
+ *
662
+ * This macro should only be used in type implementations.
663
+ *
664
+ * Returns: the #GType
665
+ */
666
+ #define G_TYPE_FROM_INTERFACE(g_iface) (((GTypeInterface*) (g_iface))->g_type)
667
+
668
+ /**
669
+ * G_TYPE_INSTANCE_GET_PRIVATE:
670
+ * @instance: the instance of a type deriving from @private_type
671
+ * @g_type: the type identifying which private data to retrieve
672
+ * @c_type: The C type for the private structure
673
+ *
674
+ * Gets the private structure for a particular type.
675
+ *
676
+ * The private structure must have been registered in the
677
+ * class_init function with g_type_class_add_private().
678
+ *
679
+ * This macro should only be used in type implementations.
680
+ *
681
+ * Since: 2.4
682
+ * Deprecated: 2.58: Use G_ADD_PRIVATE() and the generated
683
+ * `your_type_get_instance_private()` function instead
684
+ * Returns: (not nullable): a pointer to the private data structure
685
+ */
686
+ #define G_TYPE_INSTANCE_GET_PRIVATE(instance, g_type, c_type) ((c_type*) g_type_instance_get_private ((GTypeInstance*) (instance), (g_type))) GOBJECT_DEPRECATED_MACRO_IN_2_58_FOR(G_ADD_PRIVATE)
687
+
688
+ /**
689
+ * G_TYPE_CLASS_GET_PRIVATE:
690
+ * @klass: the class of a type deriving from @private_type
691
+ * @g_type: the type identifying which private data to retrieve
692
+ * @c_type: The C type for the private structure
693
+ *
694
+ * Gets the private class structure for a particular type.
695
+ *
696
+ * The private structure must have been registered in the
697
+ * get_type() function with g_type_add_class_private().
698
+ *
699
+ * This macro should only be used in type implementations.
700
+ *
701
+ * Since: 2.24
702
+ * Returns: (not nullable): a pointer to the private data structure
703
+ */
704
+ #define G_TYPE_CLASS_GET_PRIVATE(klass, g_type, c_type) ((c_type*) g_type_class_get_private ((GTypeClass*) (klass), (g_type)))
705
+
706
+ /**
707
+ * GTypeDebugFlags:
708
+ * @G_TYPE_DEBUG_NONE: Print no messages
709
+ * @G_TYPE_DEBUG_OBJECTS: Print messages about object bookkeeping
710
+ * @G_TYPE_DEBUG_SIGNALS: Print messages about signal emissions
711
+ * @G_TYPE_DEBUG_MASK: Mask covering all debug flags
712
+ * @G_TYPE_DEBUG_INSTANCE_COUNT: Keep a count of instances of each type
713
+ *
714
+ * These flags used to be passed to g_type_init_with_debug_flags() which
715
+ * is now deprecated.
716
+ *
717
+ * If you need to enable debugging features, use the `GOBJECT_DEBUG`
718
+ * environment variable.
719
+ *
720
+ * Deprecated: 2.36: g_type_init() is now done automatically
721
+ */
722
+ typedef enum /*< skip >*/
723
+ {
724
+ G_TYPE_DEBUG_NONE = 0,
725
+ G_TYPE_DEBUG_OBJECTS = 1 << 0,
726
+ G_TYPE_DEBUG_SIGNALS = 1 << 1,
727
+ G_TYPE_DEBUG_INSTANCE_COUNT = 1 << 2,
728
+ G_TYPE_DEBUG_MASK = 0x07
729
+ } GTypeDebugFlags GOBJECT_DEPRECATED_TYPE_IN_2_36;
730
+
731
+
732
+ /* --- prototypes --- */
733
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
734
+ GOBJECT_DEPRECATED_IN_2_36
735
+ void g_type_init (void);
736
+ GOBJECT_DEPRECATED_IN_2_36
737
+ void g_type_init_with_debug_flags (GTypeDebugFlags debug_flags);
738
+ G_GNUC_END_IGNORE_DEPRECATIONS
739
+
740
+ GOBJECT_AVAILABLE_IN_ALL
741
+ const gchar * g_type_name (GType type);
742
+ GOBJECT_AVAILABLE_IN_ALL
743
+ GQuark g_type_qname (GType type);
744
+ GOBJECT_AVAILABLE_IN_ALL
745
+ GType g_type_from_name (const gchar *name);
746
+ GOBJECT_AVAILABLE_IN_ALL
747
+ GType g_type_parent (GType type);
748
+ GOBJECT_AVAILABLE_IN_ALL
749
+ guint g_type_depth (GType type);
750
+ GOBJECT_AVAILABLE_IN_ALL
751
+ GType g_type_next_base (GType leaf_type,
752
+ GType root_type);
753
+ GOBJECT_AVAILABLE_IN_ALL
754
+ gboolean g_type_is_a (GType type,
755
+ GType is_a_type);
756
+
757
+ /* Hoist exact GType comparisons into the caller */
758
+ #define g_type_is_a(a,b) ((a) == (b) || (g_type_is_a) ((a), (b)))
759
+
760
+ GOBJECT_AVAILABLE_IN_ALL
761
+ gpointer g_type_class_ref (GType type);
762
+ GOBJECT_AVAILABLE_IN_ALL
763
+ gpointer g_type_class_peek (GType type);
764
+ GOBJECT_AVAILABLE_IN_ALL
765
+ gpointer g_type_class_peek_static (GType type);
766
+ GOBJECT_AVAILABLE_IN_ALL
767
+ void g_type_class_unref (gpointer g_class);
768
+ GOBJECT_AVAILABLE_IN_ALL
769
+ gpointer g_type_class_peek_parent (gpointer g_class);
770
+ GOBJECT_AVAILABLE_IN_ALL
771
+ gpointer g_type_interface_peek (gpointer instance_class,
772
+ GType iface_type);
773
+ GOBJECT_AVAILABLE_IN_ALL
774
+ gpointer g_type_interface_peek_parent (gpointer g_iface);
775
+
776
+ GOBJECT_AVAILABLE_IN_ALL
777
+ gpointer g_type_default_interface_ref (GType g_type);
778
+ GOBJECT_AVAILABLE_IN_ALL
779
+ gpointer g_type_default_interface_peek (GType g_type);
780
+ GOBJECT_AVAILABLE_IN_ALL
781
+ void g_type_default_interface_unref (gpointer g_iface);
782
+
783
+ /* g_free() the returned arrays */
784
+ GOBJECT_AVAILABLE_IN_ALL
785
+ GType* g_type_children (GType type,
786
+ guint *n_children);
787
+ GOBJECT_AVAILABLE_IN_ALL
788
+ GType* g_type_interfaces (GType type,
789
+ guint *n_interfaces);
790
+
791
+ /* per-type _static_ data */
792
+ GOBJECT_AVAILABLE_IN_ALL
793
+ void g_type_set_qdata (GType type,
794
+ GQuark quark,
795
+ gpointer data);
796
+ GOBJECT_AVAILABLE_IN_ALL
797
+ gpointer g_type_get_qdata (GType type,
798
+ GQuark quark);
799
+ GOBJECT_AVAILABLE_IN_ALL
800
+ void g_type_query (GType type,
801
+ GTypeQuery *query);
802
+
803
+ GOBJECT_AVAILABLE_IN_2_44
804
+ int g_type_get_instance_count (GType type);
805
+
806
+ /* --- type registration --- */
807
+ /**
808
+ * GBaseInitFunc:
809
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to initialize
810
+ *
811
+ * A callback function used by the type system to do base initialization
812
+ * of the class structures of derived types.
813
+ *
814
+ * This function is called as part of the initialization process of all derived
815
+ * classes and should reallocate or reset all dynamic class members copied over
816
+ * from the parent class.
817
+ *
818
+ * For example, class members (such as strings) that are not sufficiently
819
+ * handled by a plain memory copy of the parent class into the derived class
820
+ * have to be altered. See GClassInitFunc() for a discussion of the class
821
+ * initialization process.
822
+ */
823
+ typedef void (*GBaseInitFunc) (gpointer g_class);
824
+ /**
825
+ * GBaseFinalizeFunc:
826
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to finalize
827
+ *
828
+ * A callback function used by the type system to finalize those portions
829
+ * of a derived types class structure that were setup from the corresponding
830
+ * GBaseInitFunc() function.
831
+ *
832
+ * Class finalization basically works the inverse way in which class
833
+ * initialization is performed.
834
+ *
835
+ * See GClassInitFunc() for a discussion of the class initialization process.
836
+ */
837
+ typedef void (*GBaseFinalizeFunc) (gpointer g_class);
838
+ /**
839
+ * GClassInitFunc:
840
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to initialize.
841
+ * @class_data: The @class_data member supplied via the #GTypeInfo structure.
842
+ *
843
+ * A callback function used by the type system to initialize the class
844
+ * of a specific type.
845
+ *
846
+ * This function should initialize all static class members.
847
+ *
848
+ * The initialization process of a class involves:
849
+ *
850
+ * - Copying common members from the parent class over to the
851
+ * derived class structure.
852
+ * - Zero initialization of the remaining members not copied
853
+ * over from the parent class.
854
+ * - Invocation of the GBaseInitFunc() initializers of all parent
855
+ * types and the class' type.
856
+ * - Invocation of the class' GClassInitFunc() initializer.
857
+ *
858
+ * Since derived classes are partially initialized through a memory copy
859
+ * of the parent class, the general rule is that GBaseInitFunc() and
860
+ * GBaseFinalizeFunc() should take care of necessary reinitialization
861
+ * and release of those class members that were introduced by the type
862
+ * that specified these GBaseInitFunc()/GBaseFinalizeFunc().
863
+ * GClassInitFunc() should only care about initializing static
864
+ * class members, while dynamic class members (such as allocated strings
865
+ * or reference counted resources) are better handled by a GBaseInitFunc()
866
+ * for this type, so proper initialization of the dynamic class members
867
+ * is performed for class initialization of derived types as well.
868
+ *
869
+ * An example may help to correspond the intend of the different class
870
+ * initializers:
871
+ *
872
+ * |[<!-- language="C" -->
873
+ * typedef struct {
874
+ * GObjectClass parent_class;
875
+ * gint static_integer;
876
+ * gchar *dynamic_string;
877
+ * } TypeAClass;
878
+ * static void
879
+ * type_a_base_class_init (TypeAClass *class)
880
+ * {
881
+ * class->dynamic_string = g_strdup ("some string");
882
+ * }
883
+ * static void
884
+ * type_a_base_class_finalize (TypeAClass *class)
885
+ * {
886
+ * g_free (class->dynamic_string);
887
+ * }
888
+ * static void
889
+ * type_a_class_init (TypeAClass *class)
890
+ * {
891
+ * class->static_integer = 42;
892
+ * }
893
+ *
894
+ * typedef struct {
895
+ * TypeAClass parent_class;
896
+ * gfloat static_float;
897
+ * GString *dynamic_gstring;
898
+ * } TypeBClass;
899
+ * static void
900
+ * type_b_base_class_init (TypeBClass *class)
901
+ * {
902
+ * class->dynamic_gstring = g_string_new ("some other string");
903
+ * }
904
+ * static void
905
+ * type_b_base_class_finalize (TypeBClass *class)
906
+ * {
907
+ * g_string_free (class->dynamic_gstring);
908
+ * }
909
+ * static void
910
+ * type_b_class_init (TypeBClass *class)
911
+ * {
912
+ * class->static_float = 3.14159265358979323846;
913
+ * }
914
+ * ]|
915
+ *
916
+ * Initialization of TypeBClass will first cause initialization of
917
+ * TypeAClass (derived classes reference their parent classes, see
918
+ * g_type_class_ref() on this).
919
+ *
920
+ * Initialization of TypeAClass roughly involves zero-initializing its fields,
921
+ * then calling its GBaseInitFunc() type_a_base_class_init() to allocate
922
+ * its dynamic members (dynamic_string), and finally calling its GClassInitFunc()
923
+ * type_a_class_init() to initialize its static members (static_integer).
924
+ * The first step in the initialization process of TypeBClass is then
925
+ * a plain memory copy of the contents of TypeAClass into TypeBClass and
926
+ * zero-initialization of the remaining fields in TypeBClass.
927
+ * The dynamic members of TypeAClass within TypeBClass now need
928
+ * reinitialization which is performed by calling type_a_base_class_init()
929
+ * with an argument of TypeBClass.
930
+ *
931
+ * After that, the GBaseInitFunc() of TypeBClass, type_b_base_class_init()
932
+ * is called to allocate the dynamic members of TypeBClass (dynamic_gstring),
933
+ * and finally the GClassInitFunc() of TypeBClass, type_b_class_init(),
934
+ * is called to complete the initialization process with the static members
935
+ * (static_float).
936
+ *
937
+ * Corresponding finalization counter parts to the GBaseInitFunc() functions
938
+ * have to be provided to release allocated resources at class finalization
939
+ * time.
940
+ */
941
+ typedef void (*GClassInitFunc) (gpointer g_class,
942
+ gpointer class_data);
943
+ /**
944
+ * GClassFinalizeFunc:
945
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to finalize
946
+ * @class_data: The @class_data member supplied via the #GTypeInfo structure
947
+ *
948
+ * A callback function used by the type system to finalize a class.
949
+ *
950
+ * This function is rarely needed, as dynamically allocated class resources
951
+ * should be handled by GBaseInitFunc() and GBaseFinalizeFunc().
952
+ *
953
+ * Also, specification of a GClassFinalizeFunc() in the #GTypeInfo
954
+ * structure of a static type is invalid, because classes of static types
955
+ * will never be finalized (they are artificially kept alive when their
956
+ * reference count drops to zero).
957
+ */
958
+ typedef void (*GClassFinalizeFunc) (gpointer g_class,
959
+ gpointer class_data);
960
+ /**
961
+ * GInstanceInitFunc:
962
+ * @instance: The instance to initialize
963
+ * @g_class: (type GObject.TypeClass): The class of the type the instance is
964
+ * created for
965
+ *
966
+ * A callback function used by the type system to initialize a new
967
+ * instance of a type.
968
+ *
969
+ * This function initializes all instance members and allocates any resources
970
+ * required by it.
971
+ *
972
+ * Initialization of a derived instance involves calling all its parent
973
+ * types instance initializers, so the class member of the instance
974
+ * is altered during its initialization to always point to the class that
975
+ * belongs to the type the current initializer was introduced for.
976
+ *
977
+ * The extended members of @instance are guaranteed to have been filled with
978
+ * zeros before this function is called.
979
+ */
980
+ typedef void (*GInstanceInitFunc) (GTypeInstance *instance,
981
+ gpointer g_class);
982
+ /**
983
+ * GInterfaceInitFunc:
984
+ * @g_iface: (type GObject.TypeInterface): The interface structure to initialize
985
+ * @iface_data: The @interface_data supplied via the #GInterfaceInfo structure
986
+ *
987
+ * A callback function used by the type system to initialize a new
988
+ * interface.
989
+ *
990
+ * This function should initialize all internal data and* allocate any
991
+ * resources required by the interface.
992
+ *
993
+ * The members of @iface_data are guaranteed to have been filled with
994
+ * zeros before this function is called.
995
+ */
996
+ typedef void (*GInterfaceInitFunc) (gpointer g_iface,
997
+ gpointer iface_data);
998
+ /**
999
+ * GInterfaceFinalizeFunc:
1000
+ * @g_iface: (type GObject.TypeInterface): The interface structure to finalize
1001
+ * @iface_data: The @interface_data supplied via the #GInterfaceInfo structure
1002
+ *
1003
+ * A callback function used by the type system to finalize an interface.
1004
+ *
1005
+ * This function should destroy any internal data and release any resources
1006
+ * allocated by the corresponding GInterfaceInitFunc() function.
1007
+ */
1008
+ typedef void (*GInterfaceFinalizeFunc) (gpointer g_iface,
1009
+ gpointer iface_data);
1010
+ /**
1011
+ * GTypeClassCacheFunc:
1012
+ * @cache_data: data that was given to the g_type_add_class_cache_func() call
1013
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure which is
1014
+ * unreferenced
1015
+ *
1016
+ * A callback function which is called when the reference count of a class
1017
+ * drops to zero.
1018
+ *
1019
+ * It may use g_type_class_ref() to prevent the class from being freed. You
1020
+ * should not call g_type_class_unref() from a #GTypeClassCacheFunc function
1021
+ * to prevent infinite recursion, use g_type_class_unref_uncached() instead.
1022
+ *
1023
+ * The functions have to check the class id passed in to figure
1024
+ * whether they actually want to cache the class of this type, since all
1025
+ * classes are routed through the same #GTypeClassCacheFunc chain.
1026
+ *
1027
+ * Returns: %TRUE to stop further #GTypeClassCacheFuncs from being
1028
+ * called, %FALSE to continue
1029
+ */
1030
+ typedef gboolean (*GTypeClassCacheFunc) (gpointer cache_data,
1031
+ GTypeClass *g_class);
1032
+ /**
1033
+ * GTypeInterfaceCheckFunc:
1034
+ * @check_data: data passed to g_type_add_interface_check()
1035
+ * @g_iface: (type GObject.TypeInterface): the interface that has been
1036
+ * initialized
1037
+ *
1038
+ * A callback called after an interface vtable is initialized.
1039
+ *
1040
+ * See g_type_add_interface_check().
1041
+ *
1042
+ * Since: 2.4
1043
+ */
1044
+ typedef void (*GTypeInterfaceCheckFunc) (gpointer check_data,
1045
+ gpointer g_iface);
1046
+ /**
1047
+ * GTypeFundamentalFlags:
1048
+ * @G_TYPE_FLAG_CLASSED: Indicates a classed type
1049
+ * @G_TYPE_FLAG_INSTANTIATABLE: Indicates an instantiatable type (implies classed)
1050
+ * @G_TYPE_FLAG_DERIVABLE: Indicates a flat derivable type
1051
+ * @G_TYPE_FLAG_DEEP_DERIVABLE: Indicates a deep derivable type (implies derivable)
1052
+ *
1053
+ * Bit masks used to check or determine specific characteristics of a
1054
+ * fundamental type.
1055
+ */
1056
+ typedef enum /*< skip >*/
1057
+ {
1058
+ /* There is no G_TYPE_FUNDAMENTAL_FLAGS_NONE: this is implemented to use
1059
+ * the same bits as GTypeFlags */
1060
+ G_TYPE_FLAG_CLASSED = (1 << 0),
1061
+ G_TYPE_FLAG_INSTANTIATABLE = (1 << 1),
1062
+ G_TYPE_FLAG_DERIVABLE = (1 << 2),
1063
+ G_TYPE_FLAG_DEEP_DERIVABLE = (1 << 3)
1064
+ } GTypeFundamentalFlags;
1065
+ /**
1066
+ * GTypeFlags:
1067
+ * @G_TYPE_FLAG_NONE: No special flags. Since: 2.74
1068
+ * @G_TYPE_FLAG_ABSTRACT: Indicates an abstract type. No instances can be
1069
+ * created for an abstract type
1070
+ * @G_TYPE_FLAG_VALUE_ABSTRACT: Indicates an abstract value type, i.e. a type
1071
+ * that introduces a value table, but can't be used for
1072
+ * g_value_init()
1073
+ * @G_TYPE_FLAG_FINAL: Indicates a final type. A final type is a non-derivable
1074
+ * leaf node in a deep derivable type hierarchy tree. Since: 2.70
1075
+ * @G_TYPE_FLAG_DEPRECATED: The type is deprecated and may be removed in a
1076
+ * future version. A warning will be emitted if it is instantiated while
1077
+ * running with `G_ENABLE_DIAGNOSTIC=1`. Since 2.76
1078
+ *
1079
+ * Bit masks used to check or determine characteristics of a type.
1080
+ */
1081
+ typedef enum /*< skip >*/
1082
+ {
1083
+ G_TYPE_FLAG_NONE GOBJECT_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
1084
+ G_TYPE_FLAG_ABSTRACT = (1 << 4),
1085
+ G_TYPE_FLAG_VALUE_ABSTRACT = (1 << 5),
1086
+ G_TYPE_FLAG_FINAL GOBJECT_AVAILABLE_ENUMERATOR_IN_2_70 = (1 << 6),
1087
+ G_TYPE_FLAG_DEPRECATED GOBJECT_AVAILABLE_ENUMERATOR_IN_2_76 = (1 << 7)
1088
+ } GTypeFlags;
1089
+ /**
1090
+ * GTypeInfo:
1091
+ * @class_size: Size of the class structure (required for interface, classed and instantiatable types)
1092
+ * @base_init: Location of the base initialization function (optional)
1093
+ * @base_finalize: Location of the base finalization function (optional)
1094
+ * @class_init: Location of the class initialization function for
1095
+ * classed and instantiatable types. Location of the default vtable
1096
+ * inititalization function for interface types. (optional) This function
1097
+ * is used both to fill in virtual functions in the class or default vtable,
1098
+ * and to do type-specific setup such as registering signals and object
1099
+ * properties.
1100
+ * @class_finalize: Location of the class finalization function for
1101
+ * classed and instantiatable types. Location of the default vtable
1102
+ * finalization function for interface types. (optional)
1103
+ * @class_data: User-supplied data passed to the class init/finalize functions
1104
+ * @instance_size: Size of the instance (object) structure (required for instantiatable types only)
1105
+ * @n_preallocs: Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10 this field is ignored.
1106
+ * @instance_init: Location of the instance initialization function (optional, for instantiatable types only)
1107
+ * @value_table: A #GTypeValueTable function table for generic handling of GValues
1108
+ * of this type (usually only useful for fundamental types)
1109
+ *
1110
+ * This structure is used to provide the type system with the information
1111
+ * required to initialize and destruct (finalize) a type's class and
1112
+ * its instances.
1113
+ *
1114
+ * The initialized structure is passed to the g_type_register_static() function
1115
+ * (or is copied into the provided #GTypeInfo structure in the
1116
+ * g_type_plugin_complete_type_info()). The type system will perform a deep
1117
+ * copy of this structure, so its memory does not need to be persistent
1118
+ * across invocation of g_type_register_static().
1119
+ */
1120
+ struct _GTypeInfo
1121
+ {
1122
+ /* interface types, classed types, instantiated types */
1123
+ guint16 class_size;
1124
+
1125
+ GBaseInitFunc base_init;
1126
+ GBaseFinalizeFunc base_finalize;
1127
+
1128
+ /* interface types, classed types, instantiated types */
1129
+ GClassInitFunc class_init;
1130
+ GClassFinalizeFunc class_finalize;
1131
+ gconstpointer class_data;
1132
+
1133
+ /* instantiated types */
1134
+ guint16 instance_size;
1135
+ guint16 n_preallocs;
1136
+ GInstanceInitFunc instance_init;
1137
+
1138
+ /* value handling */
1139
+ const GTypeValueTable *value_table;
1140
+ };
1141
+ /**
1142
+ * GTypeFundamentalInfo:
1143
+ * @type_flags: #GTypeFundamentalFlags describing the characteristics of the fundamental type
1144
+ *
1145
+ * A structure that provides information to the type system which is
1146
+ * used specifically for managing fundamental types.
1147
+ */
1148
+ struct _GTypeFundamentalInfo
1149
+ {
1150
+ GTypeFundamentalFlags type_flags;
1151
+ };
1152
+ /**
1153
+ * GInterfaceInfo:
1154
+ * @interface_init: location of the interface initialization function
1155
+ * @interface_finalize: location of the interface finalization function
1156
+ * @interface_data: user-supplied data passed to the interface init/finalize functions
1157
+ *
1158
+ * A structure that provides information to the type system which is
1159
+ * used specifically for managing interface types.
1160
+ */
1161
+ struct _GInterfaceInfo
1162
+ {
1163
+ GInterfaceInitFunc interface_init;
1164
+ GInterfaceFinalizeFunc interface_finalize;
1165
+ gpointer interface_data;
1166
+ };
1167
+
1168
+ /**
1169
+ * GTypeValueInitFunc:
1170
+ * @value: the value to initialize
1171
+ *
1172
+ * Initializes the value contents by setting the fields of the `value->data`
1173
+ * array.
1174
+ *
1175
+ * The data array of the #GValue passed into this function was zero-filled
1176
+ * with `memset()`, so no care has to be taken to free any old contents.
1177
+ * For example, in the case of a string value that may never be %NULL, the
1178
+ * implementation might look like:
1179
+ *
1180
+ * |[<!-- language="C" -->
1181
+ * value->data[0].v_pointer = g_strdup ("");
1182
+ * ]|
1183
+ *
1184
+ * Since: 2.78
1185
+ */
1186
+ GOBJECT_AVAILABLE_TYPE_IN_2_78
1187
+ typedef void (* GTypeValueInitFunc) (GValue *value);
1188
+
1189
+ /**
1190
+ * GTypeValueFreeFunc:
1191
+ * @value: the value to free
1192
+ *
1193
+ * Frees any old contents that might be left in the `value->data` array of
1194
+ * the given value.
1195
+ *
1196
+ * No resources may remain allocated through the #GValue contents after this
1197
+ * function returns. E.g. for our above string type:
1198
+ *
1199
+ * |[<!-- language="C" -->
1200
+ * // only free strings without a specific flag for static storage
1201
+ * if (!(value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS))
1202
+ * g_free (value->data[0].v_pointer);
1203
+ * ]|
1204
+ *
1205
+ * Since: 2.78
1206
+ */
1207
+ GOBJECT_AVAILABLE_TYPE_IN_2_78
1208
+ typedef void (* GTypeValueFreeFunc) (GValue *value);
1209
+
1210
+ /**
1211
+ * GTypeValueCopyFunc:
1212
+ * @src_value: the value to copy
1213
+ * @dest_value: (out): the location of the copy
1214
+ *
1215
+ * Copies the content of a #GValue into another.
1216
+ *
1217
+ * The @dest_value is a #GValue with zero-filled data section and @src_value
1218
+ * is a properly initialized #GValue of same type, or derived type.
1219
+ *
1220
+ * The purpose of this function is to copy the contents of @src_value
1221
+ * into @dest_value in a way, that even after @src_value has been freed, the
1222
+ * contents of @dest_value remain valid. String type example:
1223
+ *
1224
+ * |[<!-- language="C" -->
1225
+ * dest_value->data[0].v_pointer = g_strdup (src_value->data[0].v_pointer);
1226
+ * ]|
1227
+ *
1228
+ * Since: 2.78
1229
+ */
1230
+ GOBJECT_AVAILABLE_TYPE_IN_2_78
1231
+ typedef void (* GTypeValueCopyFunc) (const GValue *src_value,
1232
+ GValue *dest_value);
1233
+
1234
+ /**
1235
+ * GTypeValuePeekPointerFunc:
1236
+ * @value: the value to peek
1237
+ *
1238
+ * If the value contents fit into a pointer, such as objects or strings,
1239
+ * return this pointer, so the caller can peek at the current contents.
1240
+ *
1241
+ * To extend on our above string example:
1242
+ *
1243
+ * |[<!-- language="C" -->
1244
+ * return value->data[0].v_pointer;
1245
+ * ]|
1246
+ *
1247
+ * Returns: (transfer none): a pointer to the value contents
1248
+ *
1249
+ * Since: 2.78
1250
+ */
1251
+ GOBJECT_AVAILABLE_TYPE_IN_2_78
1252
+ typedef gpointer (* GTypeValuePeekPointerFunc) (const GValue *value);
1253
+
1254
+ /**
1255
+ * GTypeValueCollectFunc:
1256
+ * @value: the value to initialize
1257
+ * @n_collect_values: the number of collected values
1258
+ * @collect_values: (array length=n_collect_values): the collected values
1259
+ * @collect_flags: optional flags
1260
+ *
1261
+ * This function is responsible for converting the values collected from
1262
+ * a variadic argument list into contents suitable for storage in a #GValue.
1263
+ *
1264
+ * This function should setup @value similar to #GTypeValueInitFunc; e.g.
1265
+ * for a string value that does not allow `NULL` pointers, it needs to either
1266
+ * emit an error, or do an implicit conversion by storing an empty string.
1267
+ *
1268
+ * The @value passed in to this function has a zero-filled data array, so
1269
+ * just like for #GTypeValueInitFunc it is guaranteed to not contain any old
1270
+ * contents that might need freeing.
1271
+ *
1272
+ * The @n_collect_values argument is the string length of the `collect_format`
1273
+ * field of #GTypeValueTable, and `collect_values` is an array of #GTypeCValue
1274
+ * with length of @n_collect_values, containing the collected values according
1275
+ * to `collect_format`.
1276
+ *
1277
+ * The @collect_flags argument provided as a hint by the caller. It may
1278
+ * contain the flag %G_VALUE_NOCOPY_CONTENTS indicating that the collected
1279
+ * value contents may be considered ‘static’ for the duration of the @value
1280
+ * lifetime. Thus an extra copy of the contents stored in @collect_values is
1281
+ * not required for assignment to @value.
1282
+ *
1283
+ * For our above string example, we continue with:
1284
+ *
1285
+ * |[<!-- language="C" -->
1286
+ * if (!collect_values[0].v_pointer)
1287
+ * value->data[0].v_pointer = g_strdup ("");
1288
+ * else if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
1289
+ * {
1290
+ * value->data[0].v_pointer = collect_values[0].v_pointer;
1291
+ * // keep a flag for the value_free() implementation to not free this string
1292
+ * value->data[1].v_uint = G_VALUE_NOCOPY_CONTENTS;
1293
+ * }
1294
+ * else
1295
+ * value->data[0].v_pointer = g_strdup (collect_values[0].v_pointer);
1296
+ * return NULL;
1297
+ * ]|
1298
+ *
1299
+ * It should be noted, that it is generally a bad idea to follow the
1300
+ * %G_VALUE_NOCOPY_CONTENTS hint for reference counted types. Due to
1301
+ * reentrancy requirements and reference count assertions performed
1302
+ * by the signal emission code, reference counts should always be
1303
+ * incremented for reference counted contents stored in the `value->data`
1304
+ * array. To deviate from our string example for a moment, and taking
1305
+ * a look at an exemplary implementation for `GTypeValueTable.collect_value()`
1306
+ * of `GObject`:
1307
+ *
1308
+ * |[<!-- language="C" -->
1309
+ * GObject *object = G_OBJECT (collect_values[0].v_pointer);
1310
+ * g_return_val_if_fail (object != NULL,
1311
+ * g_strdup_printf ("Object %p passed as invalid NULL pointer", object));
1312
+ * // never honour G_VALUE_NOCOPY_CONTENTS for ref-counted types
1313
+ * value->data[0].v_pointer = g_object_ref (object);
1314
+ * return NULL;
1315
+ * ]|
1316
+ *
1317
+ * The reference count for valid objects is always incremented, regardless
1318
+ * of `collect_flags`. For invalid objects, the example returns a newly
1319
+ * allocated string without altering `value`.
1320
+ *
1321
+ * Upon success, `collect_value()` needs to return `NULL`. If, however,
1322
+ * an error condition occurred, `collect_value()` should return a newly
1323
+ * allocated string containing an error diagnostic.
1324
+ *
1325
+ * The calling code makes no assumptions about the `value` contents being
1326
+ * valid upon error returns, `value` is simply thrown away without further
1327
+ * freeing. As such, it is a good idea to not allocate `GValue` contents
1328
+ * prior to returning an error; however, `collect_values()` is not obliged
1329
+ * to return a correctly setup @value for error returns, simply because
1330
+ * any non-`NULL` return is considered a fatal programming error, and
1331
+ * further program behaviour is undefined.
1332
+ *
1333
+ * Returns: (transfer full) (nullable): `NULL` on success, otherwise a
1334
+ * newly allocated error string on failure
1335
+ *
1336
+ * Since: 2.78
1337
+ */
1338
+ GOBJECT_AVAILABLE_TYPE_IN_2_78
1339
+ typedef gchar * (* GTypeValueCollectFunc) (GValue *value,
1340
+ guint n_collect_values,
1341
+ GTypeCValue *collect_values,
1342
+ guint collect_flags);
1343
+
1344
+ /**
1345
+ * GTypeValueLCopyFunc:
1346
+ * @value: the value to lcopy
1347
+ * @n_collect_values: the number of collected values
1348
+ * @collect_values: (array length=n_collect_values): the collected
1349
+ * locations for storage
1350
+ * @collect_flags: optional flags
1351
+ *
1352
+ * This function is responsible for storing the `value`
1353
+ * contents into arguments passed through a variadic argument list which
1354
+ * got collected into `collect_values` according to `lcopy_format`.
1355
+ *
1356
+ * The `n_collect_values` argument equals the string length of
1357
+ * `lcopy_format`, and `collect_flags` may contain %G_VALUE_NOCOPY_CONTENTS.
1358
+ *
1359
+ * In contrast to #GTypeValueCollectFunc, this function is obliged to always
1360
+ * properly support %G_VALUE_NOCOPY_CONTENTS.
1361
+ *
1362
+ * Similar to #GTypeValueCollectFunc the function may prematurely abort by
1363
+ * returning a newly allocated string describing an error condition. To
1364
+ * complete the string example:
1365
+ *
1366
+ * |[<!-- language="C" -->
1367
+ * gchar **string_p = collect_values[0].v_pointer;
1368
+ * g_return_val_if_fail (string_p != NULL,
1369
+ * g_strdup ("string location passed as NULL"));
1370
+ *
1371
+ * if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
1372
+ * *string_p = value->data[0].v_pointer;
1373
+ * else
1374
+ * *string_p = g_strdup (value->data[0].v_pointer);
1375
+ * ]|
1376
+ *
1377
+ * And an illustrative version of this function for reference-counted
1378
+ * types:
1379
+ *
1380
+ * |[<!-- language="C" -->
1381
+ * GObject **object_p = collect_values[0].v_pointer;
1382
+ * g_return_val_if_fail (object_p != NULL,
1383
+ * g_strdup ("object location passed as NULL"));
1384
+ *
1385
+ * if (value->data[0].v_pointer == NULL)
1386
+ * *object_p = NULL;
1387
+ * else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) // always honour
1388
+ * *object_p = value->data[0].v_pointer;
1389
+ * else
1390
+ * *object_p = g_object_ref (value->data[0].v_pointer);
1391
+ *
1392
+ * return NULL;
1393
+ * ]|
1394
+ *
1395
+ * Returns: (transfer full) (nullable): `NULL` on success, otherwise
1396
+ * a newly allocated error string on failure
1397
+ *
1398
+ * Since: 2.78
1399
+ */
1400
+ GOBJECT_AVAILABLE_TYPE_IN_2_78
1401
+ typedef gchar * (* GTypeValueLCopyFunc) (const GValue *value,
1402
+ guint n_collect_values,
1403
+ GTypeCValue *collect_values,
1404
+ guint collect_flags);
1405
+
1406
+ /**
1407
+ * GTypeValueTable:
1408
+ * @value_init: Function to initialize a GValue
1409
+ * @value_free: Function to free a GValue
1410
+ * @value_copy: Function to copy a GValue
1411
+ * @value_peek_pointer: Function to peek the contents of a GValue if they fit
1412
+ * into a pointer
1413
+ * @collect_format: A string format describing how to collect the contents of
1414
+ * this value bit-by-bit. Each character in the format represents
1415
+ * an argument to be collected, and the characters themselves indicate
1416
+ * the type of the argument. Currently supported arguments are:
1417
+ * - `'i'`: Integers, passed as `collect_values[].v_int`
1418
+ * - `'l'`: Longs, passed as `collect_values[].v_long`
1419
+ * - `'d'`: Doubles, passed as `collect_values[].v_double`
1420
+ * - `'p'`: Pointers, passed as `collect_values[].v_pointer`
1421
+ * It should be noted that for variable argument list construction,
1422
+ * ANSI C promotes every type smaller than an integer to an int, and
1423
+ * floats to doubles. So for collection of short int or char, `'i'`
1424
+ * needs to be used, and for collection of floats `'d'`.
1425
+ * @collect_value: Function to initialize a GValue from the values
1426
+ * collected from variadic arguments
1427
+ * @lcopy_format: Format description of the arguments to collect for @lcopy_value,
1428
+ * analogous to @collect_format. Usually, @lcopy_format string consists
1429
+ * only of `'p'`s to provide lcopy_value() with pointers to storage locations.
1430
+ * @lcopy_value: Function to store the contents of a value into the
1431
+ * locations collected from variadic arguments
1432
+ *
1433
+ * The #GTypeValueTable provides the functions required by the #GValue
1434
+ * implementation, to serve as a container for values of a type.
1435
+ */
1436
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
1437
+ struct _GTypeValueTable
1438
+ {
1439
+ GTypeValueInitFunc value_init;
1440
+ GTypeValueFreeFunc value_free;
1441
+ GTypeValueCopyFunc value_copy;
1442
+ GTypeValuePeekPointerFunc value_peek_pointer;
1443
+
1444
+ const gchar *collect_format;
1445
+ GTypeValueCollectFunc collect_value;
1446
+
1447
+ const gchar *lcopy_format;
1448
+ GTypeValueLCopyFunc lcopy_value;
1449
+ };
1450
+ G_GNUC_END_IGNORE_DEPRECATIONS
1451
+
1452
+ GOBJECT_AVAILABLE_IN_ALL
1453
+ GType g_type_register_static (GType parent_type,
1454
+ const gchar *type_name,
1455
+ const GTypeInfo *info,
1456
+ GTypeFlags flags);
1457
+ GOBJECT_AVAILABLE_IN_ALL
1458
+ GType g_type_register_static_simple (GType parent_type,
1459
+ const gchar *type_name,
1460
+ guint class_size,
1461
+ GClassInitFunc class_init,
1462
+ guint instance_size,
1463
+ GInstanceInitFunc instance_init,
1464
+ GTypeFlags flags);
1465
+
1466
+ GOBJECT_AVAILABLE_IN_ALL
1467
+ GType g_type_register_dynamic (GType parent_type,
1468
+ const gchar *type_name,
1469
+ GTypePlugin *plugin,
1470
+ GTypeFlags flags);
1471
+ GOBJECT_AVAILABLE_IN_ALL
1472
+ GType g_type_register_fundamental (GType type_id,
1473
+ const gchar *type_name,
1474
+ const GTypeInfo *info,
1475
+ const GTypeFundamentalInfo *finfo,
1476
+ GTypeFlags flags);
1477
+ GOBJECT_AVAILABLE_IN_ALL
1478
+ void g_type_add_interface_static (GType instance_type,
1479
+ GType interface_type,
1480
+ const GInterfaceInfo *info);
1481
+ GOBJECT_AVAILABLE_IN_ALL
1482
+ void g_type_add_interface_dynamic (GType instance_type,
1483
+ GType interface_type,
1484
+ GTypePlugin *plugin);
1485
+ GOBJECT_AVAILABLE_IN_ALL
1486
+ void g_type_interface_add_prerequisite (GType interface_type,
1487
+ GType prerequisite_type);
1488
+ GOBJECT_AVAILABLE_IN_ALL
1489
+ GType*g_type_interface_prerequisites (GType interface_type,
1490
+ guint *n_prerequisites);
1491
+ GOBJECT_AVAILABLE_IN_2_68
1492
+ GType g_type_interface_instantiatable_prerequisite
1493
+ (GType interface_type);
1494
+ GOBJECT_DEPRECATED_IN_2_58
1495
+ void g_type_class_add_private (gpointer g_class,
1496
+ gsize private_size);
1497
+ GOBJECT_AVAILABLE_IN_2_38
1498
+ gint g_type_add_instance_private (GType class_type,
1499
+ gsize private_size);
1500
+ GOBJECT_AVAILABLE_IN_ALL
1501
+ gpointer g_type_instance_get_private (GTypeInstance *instance,
1502
+ GType private_type);
1503
+ GOBJECT_AVAILABLE_IN_2_38
1504
+ void g_type_class_adjust_private_offset (gpointer g_class,
1505
+ gint *private_size_or_offset);
1506
+
1507
+ GOBJECT_AVAILABLE_IN_ALL
1508
+ void g_type_add_class_private (GType class_type,
1509
+ gsize private_size);
1510
+ GOBJECT_AVAILABLE_IN_ALL
1511
+ gpointer g_type_class_get_private (GTypeClass *klass,
1512
+ GType private_type);
1513
+ GOBJECT_AVAILABLE_IN_2_38
1514
+ gint g_type_class_get_instance_private_offset (gpointer g_class);
1515
+
1516
+ GOBJECT_AVAILABLE_IN_2_34
1517
+ void g_type_ensure (GType type);
1518
+ GOBJECT_AVAILABLE_IN_2_36
1519
+ guint g_type_get_type_registration_serial (void);
1520
+
1521
+
1522
+ /* --- GType boilerplate --- */
1523
+ /**
1524
+ * G_DECLARE_FINAL_TYPE:
1525
+ * @ModuleObjName: The name of the new type, in camel case (like `GtkWidget`)
1526
+ * @module_obj_name: The name of the new type in lowercase, with words
1527
+ * separated by `_` (like `gtk_widget`)
1528
+ * @MODULE: The name of the module, in all caps (like `GTK`)
1529
+ * @OBJ_NAME: The bare name of the type, in all caps (like `WIDGET`)
1530
+ * @ParentName: the name of the parent type, in camel case (like `GtkWidget`)
1531
+ *
1532
+ * A convenience macro for emitting the usual declarations in the header file
1533
+ * for a type which is not (at the present time) intended to be subclassed.
1534
+ *
1535
+ * You might use it in a header as follows:
1536
+ *
1537
+ * |[<!-- language="C" -->
1538
+ * #ifndef _myapp_window_h_
1539
+ * #define _myapp_window_h_
1540
+ *
1541
+ * #include <gtk/gtk.h>
1542
+ *
1543
+ * #define MY_APP_TYPE_WINDOW my_app_window_get_type ()
1544
+ * G_DECLARE_FINAL_TYPE (MyAppWindow, my_app_window, MY_APP, WINDOW, GtkWindow)
1545
+ *
1546
+ * MyAppWindow * my_app_window_new (void);
1547
+ *
1548
+ * ...
1549
+ *
1550
+ * #endif
1551
+ * ]|
1552
+ *
1553
+ * And use it as follow in your C file:
1554
+ *
1555
+ * |[<!-- language="C" -->
1556
+ * struct _MyAppWindow
1557
+ * {
1558
+ * GtkWindow parent;
1559
+ * ...
1560
+ * };
1561
+ * G_DEFINE_TYPE (MyAppWindow, my_app_window, GTK_TYPE_WINDOW)
1562
+ * ]|
1563
+ *
1564
+ * This results in the following things happening:
1565
+ *
1566
+ * - the usual `my_app_window_get_type()` function is declared with a return type of #GType
1567
+ *
1568
+ * - the `MyAppWindow` type is defined as a `typedef` of `struct _MyAppWindow`. The struct itself is not
1569
+ * defined and should be defined from the .c file before G_DEFINE_TYPE() is used.
1570
+ *
1571
+ * - the `MY_APP_WINDOW()` cast is emitted as `static inline` function along with the `MY_APP_IS_WINDOW()` type
1572
+ * checking function
1573
+ *
1574
+ * - the `MyAppWindowClass` type is defined as a struct containing `GtkWindowClass`. This is done for the
1575
+ * convenience of the person defining the type and should not be considered to be part of the ABI. In
1576
+ * particular, without a firm declaration of the instance structure, it is not possible to subclass the type
1577
+ * and therefore the fact that the size of the class structure is exposed is not a concern and it can be
1578
+ * freely changed at any point in the future.
1579
+ *
1580
+ * - g_autoptr() support being added for your type, based on the type of your parent class
1581
+ *
1582
+ * You can only use this function if your parent type also supports g_autoptr().
1583
+ *
1584
+ * Because the type macro (`MY_APP_TYPE_WINDOW` in the above example) is not a callable, you must continue to
1585
+ * manually define this as a macro for yourself.
1586
+ *
1587
+ * The declaration of the `_get_type()` function is the first thing emitted by the macro. This allows this macro
1588
+ * to be used in the usual way with export control and API versioning macros.
1589
+ *
1590
+ * If you want to declare your own class structure, use G_DECLARE_DERIVABLE_TYPE().
1591
+ *
1592
+ * If you are writing a library, it is important to note that it is possible to convert a type from using
1593
+ * G_DECLARE_FINAL_TYPE() to G_DECLARE_DERIVABLE_TYPE() without breaking API or ABI. As a precaution, you
1594
+ * should therefore use G_DECLARE_FINAL_TYPE() until you are sure that it makes sense for your class to be
1595
+ * subclassed. Once a class structure has been exposed it is not possible to change its size or remove or
1596
+ * reorder items without breaking the API and/or ABI.
1597
+ *
1598
+ * Since: 2.44
1599
+ **/
1600
+ #define G_DECLARE_FINAL_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \
1601
+ GType module_obj_name##_get_type (void); \
1602
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
1603
+ typedef struct _##ModuleObjName ModuleObjName; \
1604
+ typedef struct { ParentName##Class parent_class; } ModuleObjName##Class; \
1605
+ \
1606
+ _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
1607
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ModuleObjName##Class, g_type_class_unref) \
1608
+ \
1609
+ G_GNUC_UNUSED static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
1610
+ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
1611
+ G_GNUC_UNUSED static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
1612
+ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
1613
+ G_GNUC_END_IGNORE_DEPRECATIONS
1614
+
1615
+ /**
1616
+ * G_DECLARE_DERIVABLE_TYPE:
1617
+ * @ModuleObjName: The name of the new type, in camel case (like `GtkWidget`)
1618
+ * @module_obj_name: The name of the new type in lowercase, with words
1619
+ * separated by `_` (like `gtk_widget`)
1620
+ * @MODULE: The name of the module, in all caps (like `GTK`)
1621
+ * @OBJ_NAME: The bare name of the type, in all caps (like `WIDGET`)
1622
+ * @ParentName: the name of the parent type, in camel case (like `GtkWidget`)
1623
+ *
1624
+ * A convenience macro for emitting the usual declarations in the
1625
+ * header file for a type which is intended to be subclassed.
1626
+ *
1627
+ * You might use it in a header as follows:
1628
+ *
1629
+ * |[<!-- language="C" -->
1630
+ * #ifndef _gtk_frobber_h_
1631
+ * #define _gtk_frobber_h_
1632
+ *
1633
+ * #define GTK_TYPE_FROBBER gtk_frobber_get_type ()
1634
+ * GDK_AVAILABLE_IN_3_12
1635
+ * G_DECLARE_DERIVABLE_TYPE (GtkFrobber, gtk_frobber, GTK, FROBBER, GtkWidget)
1636
+ *
1637
+ * struct _GtkFrobberClass
1638
+ * {
1639
+ * GtkWidgetClass parent_class;
1640
+ *
1641
+ * void (* handle_frob) (GtkFrobber *frobber,
1642
+ * guint n_frobs);
1643
+ *
1644
+ * gpointer padding[12];
1645
+ * };
1646
+ *
1647
+ * GtkWidget * gtk_frobber_new (void);
1648
+ *
1649
+ * ...
1650
+ *
1651
+ * #endif
1652
+ * ]|
1653
+ *
1654
+ * Since the instance structure is public it is often needed to declare a
1655
+ * private struct as follow in your C file:
1656
+ *
1657
+ * |[<!-- language="C" -->
1658
+ * typedef struct _GtkFrobberPrivate GtkFrobberPrivate;
1659
+ * struct _GtkFrobberPrivate
1660
+ * {
1661
+ * ...
1662
+ * };
1663
+ * G_DEFINE_TYPE_WITH_PRIVATE (GtkFrobber, gtk_frobber, GTK_TYPE_WIDGET)
1664
+ * ]|
1665
+ *
1666
+ * This results in the following things happening:
1667
+ *
1668
+ * - the usual `gtk_frobber_get_type()` function is declared with a return type of #GType
1669
+ *
1670
+ * - the `GtkFrobber` struct is created with `GtkWidget` as the first and only item. You are expected to use
1671
+ * a private structure from your .c file to store your instance variables.
1672
+ *
1673
+ * - the `GtkFrobberClass` type is defined as a typedef to `struct _GtkFrobberClass`, which is left undefined.
1674
+ * You should do this from the header file directly after you use the macro.
1675
+ *
1676
+ * - the `GTK_FROBBER()` and `GTK_FROBBER_CLASS()` casts are emitted as `static inline` functions along with
1677
+ * the `GTK_IS_FROBBER()` and `GTK_IS_FROBBER_CLASS()` type checking functions and `GTK_FROBBER_GET_CLASS()`
1678
+ * function.
1679
+ *
1680
+ * - g_autoptr() support being added for your type, based on the type of your parent class
1681
+ *
1682
+ * You can only use this function if your parent type also supports g_autoptr().
1683
+ *
1684
+ * Because the type macro (`GTK_TYPE_FROBBER` in the above example) is not a callable, you must continue to
1685
+ * manually define this as a macro for yourself.
1686
+ *
1687
+ * The declaration of the `_get_type()` function is the first thing emitted by the macro. This allows this macro
1688
+ * to be used in the usual way with export control and API versioning macros.
1689
+ *
1690
+ * If you are writing a library, it is important to note that it is possible to convert a type from using
1691
+ * G_DECLARE_FINAL_TYPE() to G_DECLARE_DERIVABLE_TYPE() without breaking API or ABI. As a precaution, you
1692
+ * should therefore use G_DECLARE_FINAL_TYPE() until you are sure that it makes sense for your class to be
1693
+ * subclassed. Once a class structure has been exposed it is not possible to change its size or remove or
1694
+ * reorder items without breaking the API and/or ABI. If you want to declare your own class structure, use
1695
+ * G_DECLARE_DERIVABLE_TYPE(). If you want to declare a class without exposing the class or instance
1696
+ * structures, use G_DECLARE_FINAL_TYPE().
1697
+ *
1698
+ * If you must use G_DECLARE_DERIVABLE_TYPE() you should be sure to include some padding at the bottom of your
1699
+ * class structure to leave space for the addition of future virtual functions.
1700
+ *
1701
+ * Since: 2.44
1702
+ **/
1703
+ #define G_DECLARE_DERIVABLE_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \
1704
+ GType module_obj_name##_get_type (void); \
1705
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
1706
+ typedef struct _##ModuleObjName ModuleObjName; \
1707
+ typedef struct _##ModuleObjName##Class ModuleObjName##Class; \
1708
+ struct _##ModuleObjName { ParentName parent_instance; }; \
1709
+ \
1710
+ _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
1711
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ModuleObjName##Class, g_type_class_unref) \
1712
+ \
1713
+ G_GNUC_UNUSED static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
1714
+ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
1715
+ G_GNUC_UNUSED static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_CLASS (gpointer ptr) { \
1716
+ return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
1717
+ G_GNUC_UNUSED static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
1718
+ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
1719
+ G_GNUC_UNUSED static inline gboolean MODULE##_IS_##OBJ_NAME##_CLASS (gpointer ptr) { \
1720
+ return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \
1721
+ G_GNUC_UNUSED static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gpointer ptr) { \
1722
+ return G_TYPE_INSTANCE_GET_CLASS (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
1723
+ G_GNUC_END_IGNORE_DEPRECATIONS
1724
+
1725
+ /**
1726
+ * G_DECLARE_INTERFACE:
1727
+ * @ModuleObjName: The name of the new type, in camel case (like `GtkWidget`)
1728
+ * @module_obj_name: The name of the new type in lowercase, with words
1729
+ * separated by `_` (like `gtk_widget`)
1730
+ * @MODULE: The name of the module, in all caps (like `GTK`)
1731
+ * @OBJ_NAME: The bare name of the type, in all caps (like `WIDGET`)
1732
+ * @PrerequisiteName: the name of the prerequisite type, in camel case (like `GtkWidget`)
1733
+ *
1734
+ * A convenience macro for emitting the usual declarations in the header file for a #GInterface type.
1735
+ *
1736
+ * You might use it in a header as follows:
1737
+ *
1738
+ * |[<!-- language="C" -->
1739
+ * #ifndef _my_model_h_
1740
+ * #define _my_model_h_
1741
+ *
1742
+ * #define MY_TYPE_MODEL my_model_get_type ()
1743
+ * GDK_AVAILABLE_IN_3_12
1744
+ * G_DECLARE_INTERFACE (MyModel, my_model, MY, MODEL, GObject)
1745
+ *
1746
+ * struct _MyModelInterface
1747
+ * {
1748
+ * GTypeInterface g_iface;
1749
+ *
1750
+ * gpointer (* get_item) (MyModel *model);
1751
+ * };
1752
+ *
1753
+ * gpointer my_model_get_item (MyModel *model);
1754
+ *
1755
+ * ...
1756
+ *
1757
+ * #endif
1758
+ * ]|
1759
+ *
1760
+ * And use it as follow in your C file:
1761
+ *
1762
+ * |[<!-- language="C" -->
1763
+ * G_DEFINE_INTERFACE (MyModel, my_model, G_TYPE_OBJECT);
1764
+ *
1765
+ * static void
1766
+ * my_model_default_init (MyModelInterface *iface)
1767
+ * {
1768
+ * ...
1769
+ * }
1770
+ * ]|
1771
+ *
1772
+ * This results in the following things happening:
1773
+ *
1774
+ * - the usual `my_model_get_type()` function is declared with a return type of #GType
1775
+ *
1776
+ * - the `MyModelInterface` type is defined as a typedef to `struct _MyModelInterface`,
1777
+ * which is left undefined. You should do this from the header file directly after
1778
+ * you use the macro.
1779
+ *
1780
+ * - the `MY_MODEL()` cast is emitted as `static inline` functions along with
1781
+ * the `MY_IS_MODEL()` type checking function and `MY_MODEL_GET_IFACE()` function.
1782
+ *
1783
+ * - g_autoptr() support being added for your type, based on your prerequisite type.
1784
+ *
1785
+ * You can only use this function if your prerequisite type also supports g_autoptr().
1786
+ *
1787
+ * Because the type macro (`MY_TYPE_MODEL` in the above example) is not a callable, you must continue to
1788
+ * manually define this as a macro for yourself.
1789
+ *
1790
+ * The declaration of the `_get_type()` function is the first thing emitted by the macro. This allows this macro
1791
+ * to be used in the usual way with export control and API versioning macros.
1792
+ *
1793
+ * Since: 2.44
1794
+ **/
1795
+ #define G_DECLARE_INTERFACE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, PrerequisiteName) \
1796
+ GType module_obj_name##_get_type (void); \
1797
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
1798
+ typedef struct _##ModuleObjName ModuleObjName; \
1799
+ typedef struct _##ModuleObjName##Interface ModuleObjName##Interface; \
1800
+ \
1801
+ _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, PrerequisiteName) \
1802
+ \
1803
+ G_GNUC_UNUSED static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
1804
+ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
1805
+ G_GNUC_UNUSED static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
1806
+ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
1807
+ G_GNUC_UNUSED static inline ModuleObjName##Interface * MODULE##_##OBJ_NAME##_GET_IFACE (gpointer ptr) { \
1808
+ return G_TYPE_INSTANCE_GET_INTERFACE (ptr, module_obj_name##_get_type (), ModuleObjName##Interface); } \
1809
+ G_GNUC_END_IGNORE_DEPRECATIONS
1810
+
1811
+ /**
1812
+ * G_DEFINE_TYPE:
1813
+ * @TN: The name of the new type, in Camel case.
1814
+ * @t_n: The name of the new type, in lowercase, with words
1815
+ * separated by `_`.
1816
+ * @T_P: The #GType of the parent type.
1817
+ *
1818
+ * A convenience macro for type implementations, which declares a class
1819
+ * initialization function, an instance initialization function (see #GTypeInfo
1820
+ * for information about these) and a static variable named `t_n_parent_class`
1821
+ * pointing to the parent class. Furthermore, it defines a `*_get_type()` function.
1822
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1823
+ *
1824
+ * Since: 2.4
1825
+ */
1826
+ #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
1827
+ /**
1828
+ * G_DEFINE_TYPE_WITH_CODE:
1829
+ * @TN: The name of the new type, in Camel case.
1830
+ * @t_n: The name of the new type in lowercase, with words separated by `_`.
1831
+ * @T_P: The #GType of the parent type.
1832
+ * @_C_: Custom code that gets inserted in the `*_get_type()` function.
1833
+ *
1834
+ * A convenience macro for type implementations.
1835
+ *
1836
+ * Similar to G_DEFINE_TYPE(), but allows you to insert custom code into the
1837
+ * `*_get_type()` function, e.g. interface implementations via G_IMPLEMENT_INTERFACE().
1838
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1839
+ *
1840
+ * Since: 2.4
1841
+ */
1842
+ #define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
1843
+ /**
1844
+ * G_DEFINE_TYPE_WITH_PRIVATE:
1845
+ * @TN: The name of the new type, in Camel case.
1846
+ * @t_n: The name of the new type, in lowercase, with words
1847
+ * separated by `_`.
1848
+ * @T_P: The #GType of the parent type.
1849
+ *
1850
+ * A convenience macro for type implementations, which declares a class
1851
+ * initialization function, an instance initialization function (see #GTypeInfo
1852
+ * for information about these), a static variable named `t_n_parent_class`
1853
+ * pointing to the parent class, and adds private instance data to the type.
1854
+ *
1855
+ * Furthermore, it defines a `*_get_type()` function. See G_DEFINE_TYPE_EXTENDED()
1856
+ * for an example.
1857
+ *
1858
+ * Note that private structs added with this macros must have a struct
1859
+ * name of the form `TN ## Private`.
1860
+ *
1861
+ * The private instance data can be retrieved using the automatically generated
1862
+ * getter function `t_n_get_instance_private()`.
1863
+ *
1864
+ * See also: G_ADD_PRIVATE()
1865
+ *
1866
+ * Since: 2.38
1867
+ */
1868
+ #define G_DEFINE_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, G_ADD_PRIVATE (TN))
1869
+ /**
1870
+ * G_DEFINE_ABSTRACT_TYPE:
1871
+ * @TN: The name of the new type, in Camel case.
1872
+ * @t_n: The name of the new type, in lowercase, with words
1873
+ * separated by `_`.
1874
+ * @T_P: The #GType of the parent type.
1875
+ *
1876
+ * A convenience macro for type implementations.
1877
+ *
1878
+ * Similar to G_DEFINE_TYPE(), but defines an abstract type.
1879
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1880
+ *
1881
+ * Since: 2.4
1882
+ */
1883
+ #define G_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, {})
1884
+ /**
1885
+ * G_DEFINE_ABSTRACT_TYPE_WITH_CODE:
1886
+ * @TN: The name of the new type, in Camel case.
1887
+ * @t_n: The name of the new type, in lowercase, with words
1888
+ * separated by `_`.
1889
+ * @T_P: The #GType of the parent type.
1890
+ * @_C_: Custom code that gets inserted in the `type_name_get_type()` function.
1891
+ *
1892
+ * A convenience macro for type implementations.
1893
+ *
1894
+ * Similar to G_DEFINE_TYPE_WITH_CODE(), but defines an abstract type and
1895
+ * allows you to insert custom code into the `*_get_type()` function, e.g.
1896
+ * interface implementations via G_IMPLEMENT_INTERFACE().
1897
+ *
1898
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1899
+ *
1900
+ * Since: 2.4
1901
+ */
1902
+ #define G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
1903
+ /**
1904
+ * G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE:
1905
+ * @TN: The name of the new type, in Camel case.
1906
+ * @t_n: The name of the new type, in lowercase, with words
1907
+ * separated by `_`.
1908
+ * @T_P: The #GType of the parent type.
1909
+ *
1910
+ * Similar to G_DEFINE_TYPE_WITH_PRIVATE(), but defines an abstract type.
1911
+ *
1912
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1913
+ *
1914
+ * Since: 2.38
1915
+ */
1916
+ #define G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, G_ADD_PRIVATE (TN))
1917
+ /**
1918
+ * G_DEFINE_FINAL_TYPE:
1919
+ * @TN: the name of the new type, in Camel case
1920
+ * @t_n: the name of the new type, in lower case, with words
1921
+ * separated by `_` (snake case)
1922
+ * @T_P: the #GType of the parent type
1923
+ *
1924
+ * A convenience macro for type implementations.
1925
+ *
1926
+ * Similar to G_DEFINE_TYPE(), but defines a final type.
1927
+ *
1928
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1929
+ *
1930
+ * Since: 2.70
1931
+ */
1932
+ #define G_DEFINE_FINAL_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_FINAL, {}) GOBJECT_AVAILABLE_MACRO_IN_2_70
1933
+ /**
1934
+ * G_DEFINE_FINAL_TYPE_WITH_CODE:
1935
+ * @TN: the name of the new type, in Camel case
1936
+ * @t_n: the name of the new type, in lower case, with words
1937
+ * separated by `_` (snake case)
1938
+ * @T_P: the #GType of the parent type
1939
+ * @_C_: Custom code that gets inserted in the `type_name_get_type()` function.
1940
+ *
1941
+ * A convenience macro for type implementations.
1942
+ *
1943
+ * Similar to G_DEFINE_TYPE_WITH_CODE(), but defines a final type and
1944
+ * allows you to insert custom code into the `*_get_type()` function, e.g.
1945
+ * interface implementations via G_IMPLEMENT_INTERFACE().
1946
+ *
1947
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1948
+ *
1949
+ * Since: 2.70
1950
+ */
1951
+ #define G_DEFINE_FINAL_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, G_TYPE_FLAG_FINAL) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() GOBJECT_AVAILABLE_MACRO_IN_2_70
1952
+ /**
1953
+ * G_DEFINE_FINAL_TYPE_WITH_PRIVATE:
1954
+ * @TN: the name of the new type, in Camel case
1955
+ * @t_n: the name of the new type, in lower case, with words
1956
+ * separated by `_` (snake case)
1957
+ * @T_P: the #GType of the parent type
1958
+ *
1959
+ * A convenience macro for type implementations.
1960
+ *
1961
+ * Similar to G_DEFINE_TYPE_WITH_PRIVATE(), but defines a final type.
1962
+ *
1963
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
1964
+ *
1965
+ * Since: 2.70
1966
+ */
1967
+ #define G_DEFINE_FINAL_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_FINAL, G_ADD_PRIVATE (TN)) GOBJECT_AVAILABLE_MACRO_IN_2_70
1968
+ /**
1969
+ * G_DEFINE_TYPE_EXTENDED:
1970
+ * @TN: The name of the new type, in Camel case.
1971
+ * @t_n: The name of the new type, in lowercase, with words
1972
+ * separated by `_`.
1973
+ * @T_P: The #GType of the parent type.
1974
+ * @_f_: #GTypeFlags to pass to g_type_register_static()
1975
+ * @_C_: Custom code that gets inserted in the `*_get_type()` function.
1976
+ *
1977
+ * The most general convenience macro for type implementations, on which
1978
+ * G_DEFINE_TYPE(), etc are based.
1979
+ *
1980
+ * |[<!-- language="C" -->
1981
+ * G_DEFINE_TYPE_EXTENDED (GtkGadget,
1982
+ * gtk_gadget,
1983
+ * GTK_TYPE_WIDGET,
1984
+ * 0,
1985
+ * G_ADD_PRIVATE (GtkGadget)
1986
+ * G_IMPLEMENT_INTERFACE (TYPE_GIZMO,
1987
+ * gtk_gadget_gizmo_init));
1988
+ * ]|
1989
+ *
1990
+ * expands to
1991
+ *
1992
+ * |[<!-- language="C" -->
1993
+ * static void gtk_gadget_init (GtkGadget *self);
1994
+ * static void gtk_gadget_class_init (GtkGadgetClass *klass);
1995
+ * static gpointer gtk_gadget_parent_class = NULL;
1996
+ * static gint GtkGadget_private_offset;
1997
+ * static void gtk_gadget_class_intern_init (gpointer klass)
1998
+ * {
1999
+ * gtk_gadget_parent_class = g_type_class_peek_parent (klass);
2000
+ * if (GtkGadget_private_offset != 0)
2001
+ * g_type_class_adjust_private_offset (klass, &GtkGadget_private_offset);
2002
+ * gtk_gadget_class_init ((GtkGadgetClass*) klass);
2003
+ * }
2004
+ * static inline gpointer gtk_gadget_get_instance_private (GtkGadget *self)
2005
+ * {
2006
+ * return (G_STRUCT_MEMBER_P (self, GtkGadget_private_offset));
2007
+ * }
2008
+ *
2009
+ * GType
2010
+ * gtk_gadget_get_type (void)
2011
+ * {
2012
+ * static gsize static_g_define_type_id = 0;
2013
+ * if (g_once_init_enter (&static_g_define_type_id))
2014
+ * {
2015
+ * GType g_define_type_id =
2016
+ * g_type_register_static_simple (GTK_TYPE_WIDGET,
2017
+ * g_intern_static_string ("GtkGadget"),
2018
+ * sizeof (GtkGadgetClass),
2019
+ * (GClassInitFunc) gtk_gadget_class_intern_init,
2020
+ * sizeof (GtkGadget),
2021
+ * (GInstanceInitFunc) gtk_gadget_init,
2022
+ * 0);
2023
+ * {
2024
+ * GtkGadget_private_offset =
2025
+ * g_type_add_instance_private (g_define_type_id, sizeof (GtkGadgetPrivate));
2026
+ * }
2027
+ * {
2028
+ * const GInterfaceInfo g_implement_interface_info = {
2029
+ * (GInterfaceInitFunc) gtk_gadget_gizmo_init
2030
+ * };
2031
+ * g_type_add_interface_static (g_define_type_id, TYPE_GIZMO, &g_implement_interface_info);
2032
+ * }
2033
+ * g_once_init_leave (&static_g_define_type_id, g_define_type_id);
2034
+ * }
2035
+ * return static_g_define_type_id;
2036
+ * }
2037
+ * ]|
2038
+ *
2039
+ * The only pieces which have to be manually provided are the definitions of
2040
+ * the instance and class structure and the definitions of the instance and
2041
+ * class init functions.
2042
+ *
2043
+ * Since: 2.4
2044
+ */
2045
+ #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
2046
+
2047
+ /**
2048
+ * G_DEFINE_INTERFACE:
2049
+ * @TN: The name of the new type, in Camel case.
2050
+ * @t_n: The name of the new type, in lowercase, with words separated by `_`.
2051
+ * @T_P: The #GType of the prerequisite type for the interface, or %G_TYPE_INVALID
2052
+ * for no prerequisite type.
2053
+ *
2054
+ * A convenience macro for #GTypeInterface definitions, which declares
2055
+ * a default vtable initialization function and defines a `*_get_type()`
2056
+ * function.
2057
+ *
2058
+ * The macro expects the interface initialization function to have the
2059
+ * name `t_n ## _default_init`, and the interface structure to have the
2060
+ * name `TN ## Interface`.
2061
+ *
2062
+ * The initialization function has signature
2063
+ * `static void t_n ## _default_init (TypeName##Interface *klass);`, rather than
2064
+ * the full #GInterfaceInitFunc signature, for brevity and convenience. If you
2065
+ * need to use an initialization function with an `iface_data` argument, you
2066
+ * must write the #GTypeInterface definitions manually.
2067
+ *
2068
+ * Since: 2.24
2069
+ */
2070
+ #define G_DEFINE_INTERFACE(TN, t_n, T_P) G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;)
2071
+
2072
+ /**
2073
+ * G_DEFINE_INTERFACE_WITH_CODE:
2074
+ * @TN: The name of the new type, in Camel case.
2075
+ * @t_n: The name of the new type, in lowercase, with words separated by `_`.
2076
+ * @T_P: The #GType of the prerequisite type for the interface, or %G_TYPE_INVALID
2077
+ * for no prerequisite type.
2078
+ * @_C_: Custom code that gets inserted in the `*_get_type()` function.
2079
+ *
2080
+ * A convenience macro for #GTypeInterface definitions.
2081
+ *
2082
+ * Similar to G_DEFINE_INTERFACE(), but allows you to insert custom code
2083
+ * into the `*_get_type()` function, e.g. additional interface implementations
2084
+ * via G_IMPLEMENT_INTERFACE(), or additional prerequisite types.
2085
+ *
2086
+ * See G_DEFINE_TYPE_EXTENDED() for a similar example using
2087
+ * G_DEFINE_TYPE_WITH_CODE().
2088
+ *
2089
+ * Since: 2.24
2090
+ */
2091
+ #define G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TN, t_n, T_P) {_C_;} _G_DEFINE_INTERFACE_EXTENDED_END()
2092
+
2093
+ /**
2094
+ * G_IMPLEMENT_INTERFACE:
2095
+ * @TYPE_IFACE: The #GType of the interface to add
2096
+ * @iface_init: (type GInterfaceInitFunc): The interface init function, of type #GInterfaceInitFunc
2097
+ *
2098
+ * A convenience macro to ease interface addition in the `_C_` section
2099
+ * of G_DEFINE_TYPE_WITH_CODE() or G_DEFINE_ABSTRACT_TYPE_WITH_CODE().
2100
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
2101
+ *
2102
+ * Note that this macro can only be used together with the `G_DEFINE_TYPE_*`
2103
+ * macros, since it depends on variable names from those macros.
2104
+ *
2105
+ * Since: 2.4
2106
+ */
2107
+ #define G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) { \
2108
+ const GInterfaceInfo g_implement_interface_info = { \
2109
+ (GInterfaceInitFunc)(void (*)(void)) iface_init, NULL, NULL \
2110
+ }; \
2111
+ g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
2112
+ }
2113
+
2114
+ /**
2115
+ * G_ADD_PRIVATE:
2116
+ * @TypeName: the name of the type in CamelCase
2117
+ *
2118
+ * A convenience macro to ease adding private data to instances of a new type
2119
+ * in the @_C_ section of G_DEFINE_TYPE_WITH_CODE() or
2120
+ * G_DEFINE_ABSTRACT_TYPE_WITH_CODE().
2121
+ *
2122
+ * For instance:
2123
+ *
2124
+ * |[<!-- language="C" -->
2125
+ * typedef struct _MyObject MyObject;
2126
+ * typedef struct _MyObjectClass MyObjectClass;
2127
+ *
2128
+ * typedef struct {
2129
+ * gint foo;
2130
+ * gint bar;
2131
+ * } MyObjectPrivate;
2132
+ *
2133
+ * G_DEFINE_TYPE_WITH_CODE (MyObject, my_object, G_TYPE_OBJECT,
2134
+ * G_ADD_PRIVATE (MyObject))
2135
+ * ]|
2136
+ *
2137
+ * Will add `MyObjectPrivate` as the private data to any instance of the
2138
+ * `MyObject` type.
2139
+ *
2140
+ * `G_DEFINE_TYPE_*` macros will automatically create a private function
2141
+ * based on the arguments to this macro, which can be used to safely
2142
+ * retrieve the private data from an instance of the type; for instance:
2143
+ *
2144
+ * |[<!-- language="C" -->
2145
+ * gint
2146
+ * my_object_get_foo (MyObject *obj)
2147
+ * {
2148
+ * MyObjectPrivate *priv = my_object_get_instance_private (obj);
2149
+ *
2150
+ * g_return_val_if_fail (MY_IS_OBJECT (obj), 0);
2151
+ *
2152
+ * return priv->foo;
2153
+ * }
2154
+ *
2155
+ * void
2156
+ * my_object_set_bar (MyObject *obj,
2157
+ * gint bar)
2158
+ * {
2159
+ * MyObjectPrivate *priv = my_object_get_instance_private (obj);
2160
+ *
2161
+ * g_return_if_fail (MY_IS_OBJECT (obj));
2162
+ *
2163
+ * if (priv->bar != bar)
2164
+ * priv->bar = bar;
2165
+ * }
2166
+ * ]|
2167
+ *
2168
+ * Since GLib 2.72, the returned `MyObjectPrivate` pointer is guaranteed to be
2169
+ * aligned to at least the alignment of the largest basic GLib type (typically
2170
+ * this is #guint64 or #gdouble). If you need larger alignment for an element in
2171
+ * the struct, you should allocate it on the heap (aligned), or arrange for your
2172
+ * `MyObjectPrivate` struct to be appropriately padded.
2173
+ *
2174
+ * Note that this macro can only be used together with the `G_DEFINE_TYPE_*`
2175
+ * macros, since it depends on variable names from those macros.
2176
+ *
2177
+ * Also note that private structs added with these macros must have a struct
2178
+ * name of the form `TypeNamePrivate`.
2179
+ *
2180
+ * It is safe to call the `_get_instance_private` function on %NULL or invalid
2181
+ * objects since it's only adding an offset to the instance pointer. In that
2182
+ * case the returned pointer must not be dereferenced.
2183
+ *
2184
+ * Since: 2.38
2185
+ */
2186
+ #define G_ADD_PRIVATE(TypeName) { \
2187
+ TypeName##_private_offset = \
2188
+ g_type_add_instance_private (g_define_type_id, sizeof (TypeName##Private)); \
2189
+ }
2190
+
2191
+ /**
2192
+ * G_PRIVATE_OFFSET:
2193
+ * @TypeName: the name of the type in CamelCase
2194
+ * @field: the name of the field in the private data structure
2195
+ *
2196
+ * Evaluates to the offset of the @field inside the instance private data
2197
+ * structure for @TypeName.
2198
+ *
2199
+ * Note that this macro can only be used together with the `G_DEFINE_TYPE_*`
2200
+ * and G_ADD_PRIVATE() macros, since it depends on variable names from
2201
+ * those macros.
2202
+ *
2203
+ * Since: 2.38
2204
+ */
2205
+ #define G_PRIVATE_OFFSET(TypeName, field) \
2206
+ (TypeName##_private_offset + (G_STRUCT_OFFSET (TypeName##Private, field)))
2207
+
2208
+ /**
2209
+ * G_PRIVATE_FIELD_P:
2210
+ * @TypeName: the name of the type in CamelCase
2211
+ * @inst: the instance of @TypeName you wish to access
2212
+ * @field_name: the name of the field in the private data structure
2213
+ *
2214
+ * Evaluates to a pointer to the @field_name inside the @inst private data
2215
+ * structure for @TypeName.
2216
+ *
2217
+ * Note that this macro can only be used together with the `G_DEFINE_TYPE_*`
2218
+ * and G_ADD_PRIVATE() macros, since it depends on variable names from
2219
+ * those macros.
2220
+ *
2221
+ * Since: 2.38
2222
+ */
2223
+ #define G_PRIVATE_FIELD_P(TypeName, inst, field_name) \
2224
+ G_STRUCT_MEMBER_P (inst, G_PRIVATE_OFFSET (TypeName, field_name))
2225
+
2226
+ /**
2227
+ * G_PRIVATE_FIELD:
2228
+ * @TypeName: the name of the type in CamelCase
2229
+ * @inst: the instance of @TypeName you wish to access
2230
+ * @field_type: the type of the field in the private data structure
2231
+ * @field_name: the name of the field in the private data structure
2232
+ *
2233
+ * Evaluates to the @field_name inside the @inst private data
2234
+ * structure for @TypeName.
2235
+ *
2236
+ * Note that this macro can only be used together with the `G_DEFINE_TYPE_*`
2237
+ * and G_ADD_PRIVATE() macros, since it depends on variable names from
2238
+ * those macros.
2239
+ *
2240
+ * Since: 2.38
2241
+ */
2242
+ #define G_PRIVATE_FIELD(TypeName, inst, field_type, field_name) \
2243
+ G_STRUCT_MEMBER (field_type, inst, G_PRIVATE_OFFSET (TypeName, field_name))
2244
+
2245
+ /* we need to have this macro under conditional expansion, as it references
2246
+ * a function that has been added in 2.38. see bug:
2247
+ * https://bugzilla.gnome.org/show_bug.cgi?id=703191
2248
+ */
2249
+ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2250
+ #define _G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
2251
+ static void type_name##_class_intern_init (gpointer klass) \
2252
+ { \
2253
+ type_name##_parent_class = g_type_class_peek_parent (klass); \
2254
+ if (TypeName##_private_offset != 0) \
2255
+ g_type_class_adjust_private_offset (klass, &TypeName##_private_offset); \
2256
+ type_name##_class_init ((TypeName##Class*) klass); \
2257
+ }
2258
+
2259
+ #else
2260
+ #define _G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
2261
+ static void type_name##_class_intern_init (gpointer klass) \
2262
+ { \
2263
+ type_name##_parent_class = g_type_class_peek_parent (klass); \
2264
+ type_name##_class_init ((TypeName##Class*) klass); \
2265
+ }
2266
+ #endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 */
2267
+
2268
+ /* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
2269
+ #define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
2270
+ \
2271
+ static void type_name##_init (TypeName *self); \
2272
+ static void type_name##_class_init (TypeName##Class *klass); \
2273
+ static GType type_name##_get_type_once (void); \
2274
+ static gpointer type_name##_parent_class = NULL; \
2275
+ static gint TypeName##_private_offset; \
2276
+ \
2277
+ _G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
2278
+ \
2279
+ G_GNUC_UNUSED \
2280
+ static inline gpointer \
2281
+ type_name##_get_instance_private (TypeName *self) \
2282
+ { \
2283
+ return (G_STRUCT_MEMBER_P (self, TypeName##_private_offset)); \
2284
+ } \
2285
+ \
2286
+ GType \
2287
+ type_name##_get_type (void) \
2288
+ { \
2289
+ static gsize static_g_define_type_id = 0;
2290
+ /* Prelude goes here */
2291
+
2292
+ /* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
2293
+ #define _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
2294
+ if (g_once_init_enter (&static_g_define_type_id)) \
2295
+ { \
2296
+ GType g_define_type_id = type_name##_get_type_once (); \
2297
+ g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2298
+ } \
2299
+ return static_g_define_type_id; \
2300
+ } /* closes type_name##_get_type() */ \
2301
+ \
2302
+ G_NO_INLINE \
2303
+ static GType \
2304
+ type_name##_get_type_once (void) \
2305
+ { \
2306
+ GType g_define_type_id = \
2307
+ g_type_register_static_simple (TYPE_PARENT, \
2308
+ g_intern_static_string (#TypeName), \
2309
+ sizeof (TypeName##Class), \
2310
+ (GClassInitFunc)(void (*)(void)) type_name##_class_intern_init, \
2311
+ sizeof (TypeName), \
2312
+ (GInstanceInitFunc)(void (*)(void)) type_name##_init, \
2313
+ (GTypeFlags) flags); \
2314
+ { /* custom code follows */
2315
+ #define _G_DEFINE_TYPE_EXTENDED_END() \
2316
+ /* following custom code */ \
2317
+ } \
2318
+ return g_define_type_id; \
2319
+ } /* closes type_name##_get_type_once() */
2320
+
2321
+ /* This was defined before we had G_DEFINE_TYPE_WITH_CODE_AND_PRELUDE, it's simplest
2322
+ * to keep it.
2323
+ */
2324
+ #define _G_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \
2325
+ _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
2326
+ _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
2327
+
2328
+ /* Intentionally using (GTypeFlags) 0 instead of G_TYPE_FLAG_NONE here,
2329
+ * to avoid deprecation warnings with older GLIB_VERSION_MAX_ALLOWED */
2330
+ #define _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PREREQ) \
2331
+ \
2332
+ static void type_name##_default_init (TypeName##Interface *klass); \
2333
+ \
2334
+ GType \
2335
+ type_name##_get_type (void) \
2336
+ { \
2337
+ static gsize static_g_define_type_id = 0; \
2338
+ if (g_once_init_enter (&static_g_define_type_id)) \
2339
+ { \
2340
+ GType g_define_type_id = \
2341
+ g_type_register_static_simple (G_TYPE_INTERFACE, \
2342
+ g_intern_static_string (#TypeName), \
2343
+ sizeof (TypeName##Interface), \
2344
+ (GClassInitFunc)(void (*)(void)) type_name##_default_init, \
2345
+ 0, \
2346
+ (GInstanceInitFunc)NULL, \
2347
+ (GTypeFlags) 0); \
2348
+ if (TYPE_PREREQ != G_TYPE_INVALID) \
2349
+ g_type_interface_add_prerequisite (g_define_type_id, TYPE_PREREQ); \
2350
+ { /* custom code follows */
2351
+ #define _G_DEFINE_INTERFACE_EXTENDED_END() \
2352
+ /* following custom code */ \
2353
+ } \
2354
+ g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2355
+ } \
2356
+ return static_g_define_type_id; \
2357
+ } /* closes type_name##_get_type() */
2358
+
2359
+ /**
2360
+ * G_DEFINE_BOXED_TYPE:
2361
+ * @TypeName: The name of the new type, in Camel case
2362
+ * @type_name: The name of the new type, in lowercase, with words
2363
+ * separated by `_`
2364
+ * @copy_func: the #GBoxedCopyFunc for the new type
2365
+ * @free_func: the #GBoxedFreeFunc for the new type
2366
+ *
2367
+ * A convenience macro for defining a new custom boxed type.
2368
+ *
2369
+ * Using this macro is the recommended way of defining new custom boxed
2370
+ * types, over calling g_boxed_type_register_static() directly. It defines
2371
+ * a `type_name_get_type()` function which will return the newly defined
2372
+ * #GType, enabling lazy instantiation.
2373
+ *
2374
+ * You might start by putting declarations in a header as follows:
2375
+ *
2376
+ * |[<!-- language="C" -->
2377
+ * #define MY_TYPE_STRUCT my_struct_get_type ()
2378
+ * GType my_struct_get_type (void) G_GNUC_CONST;
2379
+ *
2380
+ * MyStruct * my_struct_new (void);
2381
+ * void my_struct_free (MyStruct *self);
2382
+ * MyStruct * my_struct_copy (MyStruct *self);
2383
+ * ]|
2384
+ *
2385
+ * And then use this macro and define your implementation in the source file as
2386
+ * follows:
2387
+ *
2388
+ * |[<!-- language="C" -->
2389
+ * MyStruct *
2390
+ * my_struct_new (void)
2391
+ * {
2392
+ * // ... your code to allocate a new MyStruct ...
2393
+ * }
2394
+ *
2395
+ * void
2396
+ * my_struct_free (MyStruct *self)
2397
+ * {
2398
+ * // ... your code to free a MyStruct ...
2399
+ * }
2400
+ *
2401
+ * MyStruct *
2402
+ * my_struct_copy (MyStruct *self)
2403
+ * {
2404
+ * // ... your code return a newly allocated copy of a MyStruct ...
2405
+ * }
2406
+ *
2407
+ * G_DEFINE_BOXED_TYPE (MyStruct, my_struct, my_struct_copy, my_struct_free)
2408
+ *
2409
+ * void
2410
+ * foo ()
2411
+ * {
2412
+ * MyStruct *ms;
2413
+ *
2414
+ * ms = my_struct_new ();
2415
+ * // ... your code ...
2416
+ * my_struct_free (ms);
2417
+ * }
2418
+ * ]|
2419
+ *
2420
+ * Since: 2.26
2421
+ */
2422
+ #define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
2423
+ /**
2424
+ * G_DEFINE_BOXED_TYPE_WITH_CODE:
2425
+ * @TypeName: The name of the new type, in Camel case
2426
+ * @type_name: The name of the new type, in lowercase, with words
2427
+ * separated by `_`
2428
+ * @copy_func: the #GBoxedCopyFunc for the new type
2429
+ * @free_func: the #GBoxedFreeFunc for the new type
2430
+ * @_C_: Custom code that gets inserted in the `*_get_type()` function
2431
+ *
2432
+ * A convenience macro for boxed type implementations.
2433
+ *
2434
+ * Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into the
2435
+ * `type_name_get_type()` function, e.g. to register value transformations with
2436
+ * g_value_register_transform_func(), for instance:
2437
+ *
2438
+ * |[<!-- language="C" -->
2439
+ * G_DEFINE_BOXED_TYPE_WITH_CODE (GdkRectangle, gdk_rectangle,
2440
+ * gdk_rectangle_copy,
2441
+ * gdk_rectangle_free,
2442
+ * register_rectangle_transform_funcs (g_define_type_id))
2443
+ * ]|
2444
+ *
2445
+ * Similarly to the `G_DEFINE_TYPE_*` family of macros, the #GType of the newly
2446
+ * defined boxed type is exposed in the `g_define_type_id` variable.
2447
+ *
2448
+ * Since: 2.26
2449
+ */
2450
+ #define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
2451
+
2452
+ /* Only use this in non-C++ on GCC >= 2.7, except for Darwin/ppc64.
2453
+ * See https://bugzilla.gnome.org/show_bug.cgi?id=647145
2454
+ */
2455
+ #if !defined (G_CXX_STD_VERSION) && (G_GNUC_CHECK_VERSION(2, 7)) && \
2456
+ !(defined (__APPLE__) && defined (__ppc64__))
2457
+ #define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
2458
+ static GType type_name##_get_type_once (void); \
2459
+ \
2460
+ GType \
2461
+ type_name##_get_type (void) \
2462
+ { \
2463
+ static gsize static_g_define_type_id = 0; \
2464
+ if (g_once_init_enter (&static_g_define_type_id)) \
2465
+ { \
2466
+ GType g_define_type_id = type_name##_get_type_once (); \
2467
+ g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2468
+ } \
2469
+ return static_g_define_type_id; \
2470
+ } \
2471
+ \
2472
+ G_NO_INLINE \
2473
+ static GType \
2474
+ type_name##_get_type_once (void) \
2475
+ { \
2476
+ GType (* _g_register_boxed) \
2477
+ (const gchar *, \
2478
+ union \
2479
+ { \
2480
+ TypeName * (*do_copy_type) (TypeName *); \
2481
+ TypeName * (*do_const_copy_type) (const TypeName *); \
2482
+ GBoxedCopyFunc do_copy_boxed; \
2483
+ } __attribute__((__transparent_union__)), \
2484
+ union \
2485
+ { \
2486
+ void (* do_free_type) (TypeName *); \
2487
+ GBoxedFreeFunc do_free_boxed; \
2488
+ } __attribute__((__transparent_union__)) \
2489
+ ) = g_boxed_type_register_static; \
2490
+ GType g_define_type_id = \
2491
+ _g_register_boxed (g_intern_static_string (#TypeName), copy_func, free_func); \
2492
+ { /* custom code follows */
2493
+ #else
2494
+ #define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
2495
+ static GType type_name##_get_type_once (void); \
2496
+ \
2497
+ GType \
2498
+ type_name##_get_type (void) \
2499
+ { \
2500
+ static gsize static_g_define_type_id = 0; \
2501
+ if (g_once_init_enter (&static_g_define_type_id)) \
2502
+ { \
2503
+ GType g_define_type_id = type_name##_get_type_once (); \
2504
+ g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2505
+ } \
2506
+ return static_g_define_type_id; \
2507
+ } \
2508
+ \
2509
+ G_NO_INLINE \
2510
+ static GType \
2511
+ type_name##_get_type_once (void) \
2512
+ { \
2513
+ GType g_define_type_id = \
2514
+ g_boxed_type_register_static (g_intern_static_string (#TypeName), \
2515
+ (GBoxedCopyFunc) copy_func, \
2516
+ (GBoxedFreeFunc) free_func); \
2517
+ { /* custom code follows */
2518
+ #endif /* __GNUC__ */
2519
+
2520
+ /**
2521
+ * G_DEFINE_POINTER_TYPE:
2522
+ * @TypeName: The name of the new type, in Camel case
2523
+ * @type_name: The name of the new type, in lowercase, with words
2524
+ * separated by `_`
2525
+ *
2526
+ * A convenience macro for pointer type implementations, which defines a
2527
+ * `type_name_get_type()` function registering the pointer type.
2528
+ *
2529
+ * Since: 2.26
2530
+ */
2531
+ #define G_DEFINE_POINTER_TYPE(TypeName, type_name) G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, type_name, {})
2532
+ /**
2533
+ * G_DEFINE_POINTER_TYPE_WITH_CODE:
2534
+ * @TypeName: The name of the new type, in Camel case
2535
+ * @type_name: The name of the new type, in lowercase, with words
2536
+ * separated by `_`
2537
+ * @_C_: Custom code that gets inserted in the `*_get_type()` function
2538
+ *
2539
+ * A convenience macro for pointer type implementations.
2540
+ * Similar to G_DEFINE_POINTER_TYPE(), but allows to insert
2541
+ * custom code into the `type_name_get_type()` function.
2542
+ *
2543
+ * Since: 2.26
2544
+ */
2545
+ #define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_) _G_DEFINE_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
2546
+
2547
+ #define _G_DEFINE_POINTER_TYPE_BEGIN(TypeName, type_name) \
2548
+ static GType type_name##_get_type_once (void); \
2549
+ \
2550
+ GType \
2551
+ type_name##_get_type (void) \
2552
+ { \
2553
+ static gsize static_g_define_type_id = 0; \
2554
+ if (g_once_init_enter (&static_g_define_type_id)) \
2555
+ { \
2556
+ GType g_define_type_id = type_name##_get_type_once (); \
2557
+ g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2558
+ } \
2559
+ return static_g_define_type_id; \
2560
+ } \
2561
+ \
2562
+ G_NO_INLINE \
2563
+ static GType \
2564
+ type_name##_get_type_once (void) \
2565
+ { \
2566
+ GType g_define_type_id = \
2567
+ g_pointer_type_register_static (g_intern_static_string (#TypeName)); \
2568
+ { /* custom code follows */
2569
+
2570
+ /* --- protected (for fundamental type implementations) --- */
2571
+ GOBJECT_AVAILABLE_IN_ALL
2572
+ GTypePlugin* g_type_get_plugin (GType type);
2573
+ GOBJECT_AVAILABLE_IN_ALL
2574
+ GTypePlugin* g_type_interface_get_plugin (GType instance_type,
2575
+ GType interface_type);
2576
+ GOBJECT_AVAILABLE_IN_ALL
2577
+ GType g_type_fundamental_next (void);
2578
+ GOBJECT_AVAILABLE_IN_ALL
2579
+ GType g_type_fundamental (GType type_id);
2580
+ GOBJECT_AVAILABLE_IN_ALL
2581
+ GTypeInstance* g_type_create_instance (GType type);
2582
+ GOBJECT_AVAILABLE_IN_ALL
2583
+ void g_type_free_instance (GTypeInstance *instance);
2584
+
2585
+ GOBJECT_AVAILABLE_IN_ALL
2586
+ void g_type_add_class_cache_func (gpointer cache_data,
2587
+ GTypeClassCacheFunc cache_func);
2588
+ GOBJECT_AVAILABLE_IN_ALL
2589
+ void g_type_remove_class_cache_func (gpointer cache_data,
2590
+ GTypeClassCacheFunc cache_func);
2591
+ GOBJECT_AVAILABLE_IN_ALL
2592
+ void g_type_class_unref_uncached (gpointer g_class);
2593
+
2594
+ GOBJECT_AVAILABLE_IN_ALL
2595
+ void g_type_add_interface_check (gpointer check_data,
2596
+ GTypeInterfaceCheckFunc check_func);
2597
+ GOBJECT_AVAILABLE_IN_ALL
2598
+ void g_type_remove_interface_check (gpointer check_data,
2599
+ GTypeInterfaceCheckFunc check_func);
2600
+
2601
+ GOBJECT_AVAILABLE_IN_ALL
2602
+ GTypeValueTable* g_type_value_table_peek (GType type);
2603
+
2604
+
2605
+ /*< private >*/
2606
+ GOBJECT_AVAILABLE_IN_ALL
2607
+ gboolean g_type_check_instance (GTypeInstance *instance) G_GNUC_PURE;
2608
+ GOBJECT_AVAILABLE_IN_ALL
2609
+ GTypeInstance* g_type_check_instance_cast (GTypeInstance *instance,
2610
+ GType iface_type);
2611
+ GOBJECT_AVAILABLE_IN_ALL
2612
+ gboolean g_type_check_instance_is_a (GTypeInstance *instance,
2613
+ GType iface_type) G_GNUC_PURE;
2614
+ GOBJECT_AVAILABLE_IN_2_42
2615
+ gboolean g_type_check_instance_is_fundamentally_a (GTypeInstance *instance,
2616
+ GType fundamental_type) G_GNUC_PURE;
2617
+ GOBJECT_AVAILABLE_IN_ALL
2618
+ GTypeClass* g_type_check_class_cast (GTypeClass *g_class,
2619
+ GType is_a_type);
2620
+ GOBJECT_AVAILABLE_IN_ALL
2621
+ gboolean g_type_check_class_is_a (GTypeClass *g_class,
2622
+ GType is_a_type) G_GNUC_PURE;
2623
+ GOBJECT_AVAILABLE_IN_ALL
2624
+ gboolean g_type_check_is_value_type (GType type) G_GNUC_CONST;
2625
+ GOBJECT_AVAILABLE_IN_ALL
2626
+ gboolean g_type_check_value (const GValue *value) G_GNUC_PURE;
2627
+ GOBJECT_AVAILABLE_IN_ALL
2628
+ gboolean g_type_check_value_holds (const GValue *value,
2629
+ GType type) G_GNUC_PURE;
2630
+ GOBJECT_AVAILABLE_IN_ALL
2631
+ gboolean g_type_test_flags (GType type,
2632
+ guint flags) G_GNUC_CONST;
2633
+
2634
+
2635
+ /* --- debugging functions --- */
2636
+ GOBJECT_AVAILABLE_IN_ALL
2637
+ const gchar * g_type_name_from_instance (GTypeInstance *instance);
2638
+ GOBJECT_AVAILABLE_IN_ALL
2639
+ const gchar * g_type_name_from_class (GTypeClass *g_class);
2640
+
2641
+
2642
+ /* --- implementation bits --- */
2643
+ #if defined(G_DISABLE_CAST_CHECKS) || defined(__OPTIMIZE__)
2644
+ # define _G_TYPE_CIC(ip, gt, ct) ((ct*) (void *) ip)
2645
+ # define _G_TYPE_CCC(cp, gt, ct) ((ct*) (void *) cp)
2646
+ #else
2647
+ # define _G_TYPE_CIC(ip, gt, ct) \
2648
+ ((ct*) (void *) g_type_check_instance_cast ((GTypeInstance*) ip, gt))
2649
+ # define _G_TYPE_CCC(cp, gt, ct) \
2650
+ ((ct*) (void *) g_type_check_class_cast ((GTypeClass*) cp, gt))
2651
+ #endif
2652
+
2653
+ #define _G_TYPE_CHI(ip) (g_type_check_instance ((GTypeInstance*) ip))
2654
+ #define _G_TYPE_CHV(vl) (g_type_check_value ((GValue*) vl))
2655
+ #define _G_TYPE_IGC(ip, gt, ct) ((ct*) (((GTypeInstance*) ip)->g_class))
2656
+ #define _G_TYPE_IGI(ip, gt, ct) ((ct*) g_type_interface_peek (((GTypeInstance*) ip)->g_class, gt))
2657
+ #define _G_TYPE_CIFT(ip, ft) (g_type_check_instance_is_fundamentally_a ((GTypeInstance*) ip, ft))
2658
+ #ifdef __GNUC__
2659
+ # define _G_TYPE_CIT(ip, gt) (G_GNUC_EXTENSION ({ \
2660
+ GTypeInstance *__inst = (GTypeInstance*) ip; GType __t = gt; gboolean __r; \
2661
+ if (!__inst) \
2662
+ __r = FALSE; \
2663
+ else if (__inst->g_class && __inst->g_class->g_type == __t) \
2664
+ __r = TRUE; \
2665
+ else \
2666
+ __r = g_type_check_instance_is_a (__inst, __t); \
2667
+ __r; \
2668
+ }))
2669
+ # define _G_TYPE_CCT(cp, gt) (G_GNUC_EXTENSION ({ \
2670
+ GTypeClass *__class = (GTypeClass*) cp; GType __t = gt; gboolean __r; \
2671
+ if (!__class) \
2672
+ __r = FALSE; \
2673
+ else if (__class->g_type == __t) \
2674
+ __r = TRUE; \
2675
+ else \
2676
+ __r = g_type_check_class_is_a (__class, __t); \
2677
+ __r; \
2678
+ }))
2679
+ # define _G_TYPE_CVH(vl, gt) (G_GNUC_EXTENSION ({ \
2680
+ const GValue *__val = (const GValue*) vl; GType __t = gt; gboolean __r; \
2681
+ if (!__val) \
2682
+ __r = FALSE; \
2683
+ else if (__val->g_type == __t) \
2684
+ __r = TRUE; \
2685
+ else \
2686
+ __r = g_type_check_value_holds (__val, __t); \
2687
+ __r; \
2688
+ }))
2689
+ #else /* !__GNUC__ */
2690
+ # define _G_TYPE_CIT(ip, gt) (g_type_check_instance_is_a ((GTypeInstance*) ip, gt))
2691
+ # define _G_TYPE_CCT(cp, gt) (g_type_check_class_is_a ((GTypeClass*) cp, gt))
2692
+ # define _G_TYPE_CVH(vl, gt) (g_type_check_value_holds ((const GValue*) vl, gt))
2693
+ #endif /* !__GNUC__ */
2694
+ /**
2695
+ * G_TYPE_FLAG_RESERVED_ID_BIT:
2696
+ *
2697
+ * A bit in the type number that's supposed to be left untouched.
2698
+ */
2699
+ #define G_TYPE_FLAG_RESERVED_ID_BIT ((GType) (1 << 0))
2700
+
2701
+ G_END_DECLS
2702
+
2703
+ #endif /* __G_TYPE_H__ */