Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

1138 wiersze
33 KiB

  1. /* GObject - GLib Type, Object, Parameter and Signal Library
  2. * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General
  15. * Public License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. *
  19. * gparamspecs.h: GLib default param specs
  20. */
  21. #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
  22. #error "Only <glib-object.h> can be included directly."
  23. #endif
  24. #ifndef __G_PARAMSPECS_H__
  25. #define __G_PARAMSPECS_H__
  26. #include <gobject/gvalue.h>
  27. #include <gobject/genums.h>
  28. #include <gobject/gboxed.h>
  29. #include <gobject/gobject.h>
  30. G_BEGIN_DECLS
  31. /* --- type macros --- */
  32. /**
  33. * G_TYPE_PARAM_CHAR:
  34. *
  35. * The #GType of #GParamSpecChar.
  36. */
  37. #define G_TYPE_PARAM_CHAR (g_param_spec_types[0])
  38. /**
  39. * G_IS_PARAM_SPEC_CHAR:
  40. * @pspec: a valid #GParamSpec instance
  41. *
  42. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_CHAR.
  43. *
  44. * Returns: %TRUE on success.
  45. */
  46. #define G_IS_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR))
  47. /**
  48. * G_PARAM_SPEC_CHAR:
  49. * @pspec: a valid #GParamSpec instance
  50. *
  51. * Cast a #GParamSpec instance into a #GParamSpecChar.
  52. */
  53. #define G_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CHAR, GParamSpecChar))
  54. /**
  55. * G_TYPE_PARAM_UCHAR:
  56. *
  57. * The #GType of #GParamSpecUChar.
  58. */
  59. #define G_TYPE_PARAM_UCHAR (g_param_spec_types[1])
  60. /**
  61. * G_IS_PARAM_SPEC_UCHAR:
  62. * @pspec: a valid #GParamSpec instance
  63. *
  64. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UCHAR.
  65. *
  66. * Returns: %TRUE on success.
  67. */
  68. #define G_IS_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UCHAR))
  69. /**
  70. * G_PARAM_SPEC_UCHAR:
  71. * @pspec: a valid #GParamSpec instance
  72. *
  73. * Cast a #GParamSpec instance into a #GParamSpecUChar.
  74. */
  75. #define G_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UCHAR, GParamSpecUChar))
  76. /**
  77. * G_TYPE_PARAM_BOOLEAN:
  78. *
  79. * The #GType of #GParamSpecBoolean.
  80. */
  81. #define G_TYPE_PARAM_BOOLEAN (g_param_spec_types[2])
  82. /**
  83. * G_IS_PARAM_SPEC_BOOLEAN:
  84. * @pspec: a valid #GParamSpec instance
  85. *
  86. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_BOOLEAN.
  87. *
  88. * Returns: %TRUE on success.
  89. */
  90. #define G_IS_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOOLEAN))
  91. /**
  92. * G_PARAM_SPEC_BOOLEAN:
  93. * @pspec: a valid #GParamSpec instance
  94. *
  95. * Cast a #GParamSpec instance into a #GParamSpecBoolean.
  96. */
  97. #define G_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOOLEAN, GParamSpecBoolean))
  98. /**
  99. * G_TYPE_PARAM_INT:
  100. *
  101. * The #GType of #GParamSpecInt.
  102. */
  103. #define G_TYPE_PARAM_INT (g_param_spec_types[3])
  104. /**
  105. * G_IS_PARAM_SPEC_INT:
  106. * @pspec: a valid #GParamSpec instance
  107. *
  108. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_INT.
  109. *
  110. * Returns: %TRUE on success.
  111. */
  112. #define G_IS_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT))
  113. /**
  114. * G_PARAM_SPEC_INT:
  115. * @pspec: a valid #GParamSpec instance
  116. *
  117. * Cast a #GParamSpec instance into a #GParamSpecInt.
  118. */
  119. #define G_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT, GParamSpecInt))
  120. /**
  121. * G_TYPE_PARAM_UINT:
  122. *
  123. * The #GType of #GParamSpecUInt.
  124. */
  125. #define G_TYPE_PARAM_UINT (g_param_spec_types[4])
  126. /**
  127. * G_IS_PARAM_SPEC_UINT:
  128. * @pspec: a valid #GParamSpec instance
  129. *
  130. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UINT.
  131. *
  132. * Returns: %TRUE on success.
  133. */
  134. #define G_IS_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT))
  135. /**
  136. * G_PARAM_SPEC_UINT:
  137. * @pspec: a valid #GParamSpec instance
  138. *
  139. * Cast a #GParamSpec instance into a #GParamSpecUInt.
  140. */
  141. #define G_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT, GParamSpecUInt))
  142. /**
  143. * G_TYPE_PARAM_LONG:
  144. *
  145. * The #GType of #GParamSpecLong.
  146. */
  147. #define G_TYPE_PARAM_LONG (g_param_spec_types[5])
  148. /**
  149. * G_IS_PARAM_SPEC_LONG:
  150. * @pspec: a valid #GParamSpec instance
  151. *
  152. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_LONG.
  153. *
  154. * Returns: %TRUE on success.
  155. */
  156. #define G_IS_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_LONG))
  157. /**
  158. * G_PARAM_SPEC_LONG:
  159. * @pspec: a valid #GParamSpec instance
  160. *
  161. * Cast a #GParamSpec instance into a #GParamSpecLong.
  162. */
  163. #define G_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_LONG, GParamSpecLong))
  164. /**
  165. * G_TYPE_PARAM_ULONG:
  166. *
  167. * The #GType of #GParamSpecULong.
  168. */
  169. #define G_TYPE_PARAM_ULONG (g_param_spec_types[6])
  170. /**
  171. * G_IS_PARAM_SPEC_ULONG:
  172. * @pspec: a valid #GParamSpec instance
  173. *
  174. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_ULONG.
  175. *
  176. * Returns: %TRUE on success.
  177. */
  178. #define G_IS_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ULONG))
  179. /**
  180. * G_PARAM_SPEC_ULONG:
  181. * @pspec: a valid #GParamSpec instance
  182. *
  183. * Cast a #GParamSpec instance into a #GParamSpecULong.
  184. */
  185. #define G_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ULONG, GParamSpecULong))
  186. /**
  187. * G_TYPE_PARAM_INT64:
  188. *
  189. * The #GType of #GParamSpecInt64.
  190. */
  191. #define G_TYPE_PARAM_INT64 (g_param_spec_types[7])
  192. /**
  193. * G_IS_PARAM_SPEC_INT64:
  194. * @pspec: a valid #GParamSpec instance
  195. *
  196. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_INT64.
  197. *
  198. * Returns: %TRUE on success.
  199. */
  200. #define G_IS_PARAM_SPEC_INT64(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT64))
  201. /**
  202. * G_PARAM_SPEC_INT64:
  203. * @pspec: a valid #GParamSpec instance
  204. *
  205. * Cast a #GParamSpec instance into a #GParamSpecInt64.
  206. */
  207. #define G_PARAM_SPEC_INT64(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT64, GParamSpecInt64))
  208. /**
  209. * G_TYPE_PARAM_UINT64:
  210. *
  211. * The #GType of #GParamSpecUInt64.
  212. */
  213. #define G_TYPE_PARAM_UINT64 (g_param_spec_types[8])
  214. /**
  215. * G_IS_PARAM_SPEC_UINT64:
  216. * @pspec: a valid #GParamSpec instance
  217. *
  218. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UINT64.
  219. *
  220. * Returns: %TRUE on success.
  221. */
  222. #define G_IS_PARAM_SPEC_UINT64(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT64))
  223. /**
  224. * G_PARAM_SPEC_UINT64:
  225. * @pspec: a valid #GParamSpec instance
  226. *
  227. * Cast a #GParamSpec instance into a #GParamSpecUInt64.
  228. */
  229. #define G_PARAM_SPEC_UINT64(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT64, GParamSpecUInt64))
  230. /**
  231. * G_TYPE_PARAM_UNICHAR:
  232. *
  233. * The #GType of #GParamSpecUnichar.
  234. */
  235. #define G_TYPE_PARAM_UNICHAR (g_param_spec_types[9])
  236. /**
  237. * G_PARAM_SPEC_UNICHAR:
  238. * @pspec: a valid #GParamSpec instance
  239. *
  240. * Cast a #GParamSpec instance into a #GParamSpecUnichar.
  241. */
  242. #define G_PARAM_SPEC_UNICHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UNICHAR, GParamSpecUnichar))
  243. /**
  244. * G_IS_PARAM_SPEC_UNICHAR:
  245. * @pspec: a valid #GParamSpec instance
  246. *
  247. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UNICHAR.
  248. *
  249. * Returns: %TRUE on success.
  250. */
  251. #define G_IS_PARAM_SPEC_UNICHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UNICHAR))
  252. /**
  253. * G_TYPE_PARAM_ENUM:
  254. *
  255. * The #GType of #GParamSpecEnum.
  256. */
  257. #define G_TYPE_PARAM_ENUM (g_param_spec_types[10])
  258. /**
  259. * G_IS_PARAM_SPEC_ENUM:
  260. * @pspec: a valid #GParamSpec instance
  261. *
  262. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_ENUM.
  263. *
  264. * Returns: %TRUE on success.
  265. */
  266. #define G_IS_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ENUM))
  267. /**
  268. * G_PARAM_SPEC_ENUM:
  269. * @pspec: a valid #GParamSpec instance
  270. *
  271. * Cast a #GParamSpec instance into a #GParamSpecEnum.
  272. */
  273. #define G_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ENUM, GParamSpecEnum))
  274. /**
  275. * G_TYPE_PARAM_FLAGS:
  276. *
  277. * The #GType of #GParamSpecFlags.
  278. */
  279. #define G_TYPE_PARAM_FLAGS (g_param_spec_types[11])
  280. /**
  281. * G_IS_PARAM_SPEC_FLAGS:
  282. * @pspec: a valid #GParamSpec instance
  283. *
  284. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_FLAGS.
  285. *
  286. * Returns: %TRUE on success.
  287. */
  288. #define G_IS_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLAGS))
  289. /**
  290. * G_PARAM_SPEC_FLAGS:
  291. * @pspec: a valid #GParamSpec instance
  292. *
  293. * Cast a #GParamSpec instance into a #GParamSpecFlags.
  294. */
  295. #define G_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLAGS, GParamSpecFlags))
  296. /**
  297. * G_TYPE_PARAM_FLOAT:
  298. *
  299. * The #GType of #GParamSpecFloat.
  300. */
  301. #define G_TYPE_PARAM_FLOAT (g_param_spec_types[12])
  302. /**
  303. * G_IS_PARAM_SPEC_FLOAT:
  304. * @pspec: a valid #GParamSpec instance
  305. *
  306. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_FLOAT.
  307. *
  308. * Returns: %TRUE on success.
  309. */
  310. #define G_IS_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLOAT))
  311. /**
  312. * G_PARAM_SPEC_FLOAT:
  313. * @pspec: a valid #GParamSpec instance
  314. *
  315. * Cast a #GParamSpec instance into a #GParamSpecFloat.
  316. */
  317. #define G_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLOAT, GParamSpecFloat))
  318. /**
  319. * G_TYPE_PARAM_DOUBLE:
  320. *
  321. * The #GType of #GParamSpecDouble.
  322. */
  323. #define G_TYPE_PARAM_DOUBLE (g_param_spec_types[13])
  324. /**
  325. * G_IS_PARAM_SPEC_DOUBLE:
  326. * @pspec: a valid #GParamSpec instance
  327. *
  328. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_DOUBLE.
  329. *
  330. * Returns: %TRUE on success.
  331. */
  332. #define G_IS_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_DOUBLE))
  333. /**
  334. * G_PARAM_SPEC_DOUBLE:
  335. * @pspec: a valid #GParamSpec instance
  336. *
  337. * Cast a #GParamSpec instance into a #GParamSpecDouble.
  338. */
  339. #define G_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_DOUBLE, GParamSpecDouble))
  340. /**
  341. * G_TYPE_PARAM_STRING:
  342. *
  343. * The #GType of #GParamSpecString.
  344. */
  345. #define G_TYPE_PARAM_STRING (g_param_spec_types[14])
  346. /**
  347. * G_IS_PARAM_SPEC_STRING:
  348. * @pspec: a valid #GParamSpec instance
  349. *
  350. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_STRING.
  351. *
  352. * Returns: %TRUE on success.
  353. */
  354. #define G_IS_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_STRING))
  355. /**
  356. * G_PARAM_SPEC_STRING:
  357. * @pspec: a valid #GParamSpec instance
  358. *
  359. * Casts a #GParamSpec instance into a #GParamSpecString.
  360. */
  361. #define G_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_STRING, GParamSpecString))
  362. /**
  363. * G_TYPE_PARAM_PARAM:
  364. *
  365. * The #GType of #GParamSpecParam.
  366. */
  367. #define G_TYPE_PARAM_PARAM (g_param_spec_types[15])
  368. /**
  369. * G_IS_PARAM_SPEC_PARAM:
  370. * @pspec: a valid #GParamSpec instance
  371. *
  372. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_PARAM.
  373. *
  374. * Returns: %TRUE on success.
  375. */
  376. #define G_IS_PARAM_SPEC_PARAM(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_PARAM))
  377. /**
  378. * G_PARAM_SPEC_PARAM:
  379. * @pspec: a valid #GParamSpec instance
  380. *
  381. * Casts a #GParamSpec instance into a #GParamSpecParam.
  382. */
  383. #define G_PARAM_SPEC_PARAM(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_PARAM, GParamSpecParam))
  384. /**
  385. * G_TYPE_PARAM_BOXED:
  386. *
  387. * The #GType of #GParamSpecBoxed.
  388. */
  389. #define G_TYPE_PARAM_BOXED (g_param_spec_types[16])
  390. /**
  391. * G_IS_PARAM_SPEC_BOXED:
  392. * @pspec: a valid #GParamSpec instance
  393. *
  394. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_BOXED.
  395. *
  396. * Returns: %TRUE on success.
  397. */
  398. #define G_IS_PARAM_SPEC_BOXED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOXED))
  399. /**
  400. * G_PARAM_SPEC_BOXED:
  401. * @pspec: a valid #GParamSpec instance
  402. *
  403. * Cast a #GParamSpec instance into a #GParamSpecBoxed.
  404. */
  405. #define G_PARAM_SPEC_BOXED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOXED, GParamSpecBoxed))
  406. /**
  407. * G_TYPE_PARAM_POINTER:
  408. *
  409. * The #GType of #GParamSpecPointer.
  410. */
  411. #define G_TYPE_PARAM_POINTER (g_param_spec_types[17])
  412. /**
  413. * G_IS_PARAM_SPEC_POINTER:
  414. * @pspec: a valid #GParamSpec instance
  415. *
  416. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_POINTER.
  417. *
  418. * Returns: %TRUE on success.
  419. */
  420. #define G_IS_PARAM_SPEC_POINTER(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_POINTER))
  421. /**
  422. * G_PARAM_SPEC_POINTER:
  423. * @pspec: a valid #GParamSpec instance
  424. *
  425. * Casts a #GParamSpec instance into a #GParamSpecPointer.
  426. */
  427. #define G_PARAM_SPEC_POINTER(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_POINTER, GParamSpecPointer))
  428. /**
  429. * G_TYPE_PARAM_VALUE_ARRAY:
  430. *
  431. * The #GType of #GParamSpecValueArray.
  432. */
  433. #define G_TYPE_PARAM_VALUE_ARRAY (g_param_spec_types[18])
  434. /**
  435. * G_IS_PARAM_SPEC_VALUE_ARRAY:
  436. * @pspec: a valid #GParamSpec instance
  437. *
  438. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VALUE_ARRAY.
  439. *
  440. * Returns: %TRUE on success.
  441. */
  442. #define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY))
  443. /**
  444. * G_PARAM_SPEC_VALUE_ARRAY:
  445. * @pspec: a valid #GParamSpec instance
  446. *
  447. * Cast a #GParamSpec instance into a #GParamSpecValueArray.
  448. */
  449. #define G_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray))
  450. /**
  451. * G_TYPE_PARAM_OBJECT:
  452. *
  453. * The #GType of #GParamSpecObject.
  454. */
  455. #define G_TYPE_PARAM_OBJECT (g_param_spec_types[19])
  456. /**
  457. * G_IS_PARAM_SPEC_OBJECT:
  458. * @pspec: a valid #GParamSpec instance
  459. *
  460. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_OBJECT.
  461. *
  462. * Returns: %TRUE on success.
  463. */
  464. #define G_IS_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OBJECT))
  465. /**
  466. * G_PARAM_SPEC_OBJECT:
  467. * @pspec: a valid #GParamSpec instance
  468. *
  469. * Casts a #GParamSpec instance into a #GParamSpecObject.
  470. */
  471. #define G_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OBJECT, GParamSpecObject))
  472. /**
  473. * G_TYPE_PARAM_OVERRIDE:
  474. *
  475. * The #GType of #GParamSpecOverride.
  476. *
  477. * Since: 2.4
  478. */
  479. #define G_TYPE_PARAM_OVERRIDE (g_param_spec_types[20])
  480. /**
  481. * G_IS_PARAM_SPEC_OVERRIDE:
  482. * @pspec: a #GParamSpec
  483. *
  484. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_OVERRIDE.
  485. *
  486. * Since: 2.4
  487. * Returns: %TRUE on success.
  488. */
  489. #define G_IS_PARAM_SPEC_OVERRIDE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OVERRIDE))
  490. /**
  491. * G_PARAM_SPEC_OVERRIDE:
  492. * @pspec: a #GParamSpec
  493. *
  494. * Casts a #GParamSpec into a #GParamSpecOverride.
  495. *
  496. * Since: 2.4
  497. */
  498. #define G_PARAM_SPEC_OVERRIDE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OVERRIDE, GParamSpecOverride))
  499. /**
  500. * G_TYPE_PARAM_GTYPE:
  501. *
  502. * The #GType of #GParamSpecGType.
  503. *
  504. * Since: 2.10
  505. */
  506. #define G_TYPE_PARAM_GTYPE (g_param_spec_types[21])
  507. /**
  508. * G_IS_PARAM_SPEC_GTYPE:
  509. * @pspec: a #GParamSpec
  510. *
  511. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_GTYPE.
  512. *
  513. * Since: 2.10
  514. * Returns: %TRUE on success.
  515. */
  516. #define G_IS_PARAM_SPEC_GTYPE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_GTYPE))
  517. /**
  518. * G_PARAM_SPEC_GTYPE:
  519. * @pspec: a #GParamSpec
  520. *
  521. * Casts a #GParamSpec into a #GParamSpecGType.
  522. *
  523. * Since: 2.10
  524. */
  525. #define G_PARAM_SPEC_GTYPE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_GTYPE, GParamSpecGType))
  526. /**
  527. * G_TYPE_PARAM_VARIANT:
  528. *
  529. * The #GType of #GParamSpecVariant.
  530. *
  531. * Since: 2.26
  532. */
  533. #define G_TYPE_PARAM_VARIANT (g_param_spec_types[22])
  534. /**
  535. * G_IS_PARAM_SPEC_VARIANT:
  536. * @pspec: a #GParamSpec
  537. *
  538. * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VARIANT.
  539. *
  540. * Returns: %TRUE on success
  541. *
  542. * Since: 2.26
  543. */
  544. #define G_IS_PARAM_SPEC_VARIANT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VARIANT))
  545. /**
  546. * G_PARAM_SPEC_VARIANT:
  547. * @pspec: a #GParamSpec
  548. *
  549. * Casts a #GParamSpec into a #GParamSpecVariant.
  550. *
  551. * Since: 2.26
  552. */
  553. #define G_PARAM_SPEC_VARIANT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VARIANT, GParamSpecVariant))
  554. /* --- typedefs & structures --- */
  555. typedef struct _GParamSpecChar GParamSpecChar;
  556. typedef struct _GParamSpecUChar GParamSpecUChar;
  557. typedef struct _GParamSpecBoolean GParamSpecBoolean;
  558. typedef struct _GParamSpecInt GParamSpecInt;
  559. typedef struct _GParamSpecUInt GParamSpecUInt;
  560. typedef struct _GParamSpecLong GParamSpecLong;
  561. typedef struct _GParamSpecULong GParamSpecULong;
  562. typedef struct _GParamSpecInt64 GParamSpecInt64;
  563. typedef struct _GParamSpecUInt64 GParamSpecUInt64;
  564. typedef struct _GParamSpecUnichar GParamSpecUnichar;
  565. typedef struct _GParamSpecEnum GParamSpecEnum;
  566. typedef struct _GParamSpecFlags GParamSpecFlags;
  567. typedef struct _GParamSpecFloat GParamSpecFloat;
  568. typedef struct _GParamSpecDouble GParamSpecDouble;
  569. typedef struct _GParamSpecString GParamSpecString;
  570. typedef struct _GParamSpecParam GParamSpecParam;
  571. typedef struct _GParamSpecBoxed GParamSpecBoxed;
  572. typedef struct _GParamSpecPointer GParamSpecPointer;
  573. typedef struct _GParamSpecValueArray GParamSpecValueArray;
  574. typedef struct _GParamSpecObject GParamSpecObject;
  575. typedef struct _GParamSpecOverride GParamSpecOverride;
  576. typedef struct _GParamSpecGType GParamSpecGType;
  577. typedef struct _GParamSpecVariant GParamSpecVariant;
  578. /**
  579. * GParamSpecChar:
  580. * @parent_instance: private #GParamSpec portion
  581. * @minimum: minimum value for the property specified
  582. * @maximum: maximum value for the property specified
  583. * @default_value: default value for the property specified
  584. *
  585. * A #GParamSpec derived structure that contains the meta data for character properties.
  586. */
  587. struct _GParamSpecChar
  588. {
  589. GParamSpec parent_instance;
  590. gint8 minimum;
  591. gint8 maximum;
  592. gint8 default_value;
  593. };
  594. /**
  595. * GParamSpecUChar:
  596. * @parent_instance: private #GParamSpec portion
  597. * @minimum: minimum value for the property specified
  598. * @maximum: maximum value for the property specified
  599. * @default_value: default value for the property specified
  600. *
  601. * A #GParamSpec derived structure that contains the meta data for unsigned character properties.
  602. */
  603. struct _GParamSpecUChar
  604. {
  605. GParamSpec parent_instance;
  606. guint8 minimum;
  607. guint8 maximum;
  608. guint8 default_value;
  609. };
  610. /**
  611. * GParamSpecBoolean:
  612. * @parent_instance: private #GParamSpec portion
  613. * @default_value: default value for the property specified
  614. *
  615. * A #GParamSpec derived structure that contains the meta data for boolean properties.
  616. */
  617. struct _GParamSpecBoolean
  618. {
  619. GParamSpec parent_instance;
  620. gboolean default_value;
  621. };
  622. /**
  623. * GParamSpecInt:
  624. * @parent_instance: private #GParamSpec portion
  625. * @minimum: minimum value for the property specified
  626. * @maximum: maximum value for the property specified
  627. * @default_value: default value for the property specified
  628. *
  629. * A #GParamSpec derived structure that contains the meta data for integer properties.
  630. */
  631. struct _GParamSpecInt
  632. {
  633. GParamSpec parent_instance;
  634. gint minimum;
  635. gint maximum;
  636. gint default_value;
  637. };
  638. /**
  639. * GParamSpecUInt:
  640. * @parent_instance: private #GParamSpec portion
  641. * @minimum: minimum value for the property specified
  642. * @maximum: maximum value for the property specified
  643. * @default_value: default value for the property specified
  644. *
  645. * A #GParamSpec derived structure that contains the meta data for unsigned integer properties.
  646. */
  647. struct _GParamSpecUInt
  648. {
  649. GParamSpec parent_instance;
  650. guint minimum;
  651. guint maximum;
  652. guint default_value;
  653. };
  654. /**
  655. * GParamSpecLong:
  656. * @parent_instance: private #GParamSpec portion
  657. * @minimum: minimum value for the property specified
  658. * @maximum: maximum value for the property specified
  659. * @default_value: default value for the property specified
  660. *
  661. * A #GParamSpec derived structure that contains the meta data for long integer properties.
  662. */
  663. struct _GParamSpecLong
  664. {
  665. GParamSpec parent_instance;
  666. glong minimum;
  667. glong maximum;
  668. glong default_value;
  669. };
  670. /**
  671. * GParamSpecULong:
  672. * @parent_instance: private #GParamSpec portion
  673. * @minimum: minimum value for the property specified
  674. * @maximum: maximum value for the property specified
  675. * @default_value: default value for the property specified
  676. *
  677. * A #GParamSpec derived structure that contains the meta data for unsigned long integer properties.
  678. */
  679. struct _GParamSpecULong
  680. {
  681. GParamSpec parent_instance;
  682. gulong minimum;
  683. gulong maximum;
  684. gulong default_value;
  685. };
  686. /**
  687. * GParamSpecInt64:
  688. * @parent_instance: private #GParamSpec portion
  689. * @minimum: minimum value for the property specified
  690. * @maximum: maximum value for the property specified
  691. * @default_value: default value for the property specified
  692. *
  693. * A #GParamSpec derived structure that contains the meta data for 64bit integer properties.
  694. */
  695. struct _GParamSpecInt64
  696. {
  697. GParamSpec parent_instance;
  698. gint64 minimum;
  699. gint64 maximum;
  700. gint64 default_value;
  701. };
  702. /**
  703. * GParamSpecUInt64:
  704. * @parent_instance: private #GParamSpec portion
  705. * @minimum: minimum value for the property specified
  706. * @maximum: maximum value for the property specified
  707. * @default_value: default value for the property specified
  708. *
  709. * A #GParamSpec derived structure that contains the meta data for unsigned 64bit integer properties.
  710. */
  711. struct _GParamSpecUInt64
  712. {
  713. GParamSpec parent_instance;
  714. guint64 minimum;
  715. guint64 maximum;
  716. guint64 default_value;
  717. };
  718. /**
  719. * GParamSpecUnichar:
  720. * @parent_instance: private #GParamSpec portion
  721. * @default_value: default value for the property specified
  722. *
  723. * A #GParamSpec derived structure that contains the meta data for unichar (unsigned integer) properties.
  724. */
  725. struct _GParamSpecUnichar
  726. {
  727. GParamSpec parent_instance;
  728. gunichar default_value;
  729. };
  730. /**
  731. * GParamSpecEnum:
  732. * @parent_instance: private #GParamSpec portion
  733. * @enum_class: the #GEnumClass for the enum
  734. * @default_value: default value for the property specified
  735. *
  736. * A #GParamSpec derived structure that contains the meta data for enum
  737. * properties.
  738. */
  739. struct _GParamSpecEnum
  740. {
  741. GParamSpec parent_instance;
  742. GEnumClass *enum_class;
  743. gint default_value;
  744. };
  745. /**
  746. * GParamSpecFlags:
  747. * @parent_instance: private #GParamSpec portion
  748. * @flags_class: the #GFlagsClass for the flags
  749. * @default_value: default value for the property specified
  750. *
  751. * A #GParamSpec derived structure that contains the meta data for flags
  752. * properties.
  753. */
  754. struct _GParamSpecFlags
  755. {
  756. GParamSpec parent_instance;
  757. GFlagsClass *flags_class;
  758. guint default_value;
  759. };
  760. /**
  761. * GParamSpecFloat:
  762. * @parent_instance: private #GParamSpec portion
  763. * @minimum: minimum value for the property specified
  764. * @maximum: maximum value for the property specified
  765. * @default_value: default value for the property specified
  766. * @epsilon: values closer than @epsilon will be considered identical
  767. * by g_param_values_cmp(); the default value is 1e-30.
  768. *
  769. * A #GParamSpec derived structure that contains the meta data for float properties.
  770. */
  771. struct _GParamSpecFloat
  772. {
  773. GParamSpec parent_instance;
  774. gfloat minimum;
  775. gfloat maximum;
  776. gfloat default_value;
  777. gfloat epsilon;
  778. };
  779. /**
  780. * GParamSpecDouble:
  781. * @parent_instance: private #GParamSpec portion
  782. * @minimum: minimum value for the property specified
  783. * @maximum: maximum value for the property specified
  784. * @default_value: default value for the property specified
  785. * @epsilon: values closer than @epsilon will be considered identical
  786. * by g_param_values_cmp(); the default value is 1e-90.
  787. *
  788. * A #GParamSpec derived structure that contains the meta data for double properties.
  789. */
  790. struct _GParamSpecDouble
  791. {
  792. GParamSpec parent_instance;
  793. gdouble minimum;
  794. gdouble maximum;
  795. gdouble default_value;
  796. gdouble epsilon;
  797. };
  798. /**
  799. * GParamSpecString:
  800. * @parent_instance: private #GParamSpec portion
  801. * @default_value: default value for the property specified
  802. * @cset_first: a string containing the allowed values for the first byte
  803. * @cset_nth: a string containing the allowed values for the subsequent bytes
  804. * @substitutor: the replacement byte for bytes which don't match @cset_first or @cset_nth.
  805. * @null_fold_if_empty: replace empty string by %NULL
  806. * @ensure_non_null: replace %NULL strings by an empty string
  807. *
  808. * A #GParamSpec derived structure that contains the meta data for string
  809. * properties.
  810. */
  811. struct _GParamSpecString
  812. {
  813. GParamSpec parent_instance;
  814. gchar *default_value;
  815. gchar *cset_first;
  816. gchar *cset_nth;
  817. gchar substitutor;
  818. guint null_fold_if_empty : 1;
  819. guint ensure_non_null : 1;
  820. };
  821. /**
  822. * GParamSpecParam:
  823. * @parent_instance: private #GParamSpec portion
  824. *
  825. * A #GParamSpec derived structure that contains the meta data for %G_TYPE_PARAM
  826. * properties.
  827. */
  828. struct _GParamSpecParam
  829. {
  830. GParamSpec parent_instance;
  831. };
  832. /**
  833. * GParamSpecBoxed:
  834. * @parent_instance: private #GParamSpec portion
  835. *
  836. * A #GParamSpec derived structure that contains the meta data for boxed properties.
  837. */
  838. struct _GParamSpecBoxed
  839. {
  840. GParamSpec parent_instance;
  841. };
  842. /**
  843. * GParamSpecPointer:
  844. * @parent_instance: private #GParamSpec portion
  845. *
  846. * A #GParamSpec derived structure that contains the meta data for pointer properties.
  847. */
  848. struct _GParamSpecPointer
  849. {
  850. GParamSpec parent_instance;
  851. };
  852. /**
  853. * GParamSpecValueArray:
  854. * @parent_instance: private #GParamSpec portion
  855. * @element_spec: a #GParamSpec describing the elements contained in arrays of this property, may be %NULL
  856. * @fixed_n_elements: if greater than 0, arrays of this property will always have this many elements
  857. *
  858. * A #GParamSpec derived structure that contains the meta data for #GValueArray properties.
  859. */
  860. struct _GParamSpecValueArray
  861. {
  862. GParamSpec parent_instance;
  863. GParamSpec *element_spec;
  864. guint fixed_n_elements;
  865. };
  866. /**
  867. * GParamSpecObject:
  868. * @parent_instance: private #GParamSpec portion
  869. *
  870. * A #GParamSpec derived structure that contains the meta data for object properties.
  871. */
  872. struct _GParamSpecObject
  873. {
  874. GParamSpec parent_instance;
  875. };
  876. /**
  877. * GParamSpecOverride:
  878. *
  879. * This is a type of #GParamSpec type that simply redirects operations to
  880. * another paramspec. All operations other than getting or
  881. * setting the value are redirected, including accessing the nick and
  882. * blurb, validating a value, and so forth. See
  883. * g_param_spec_get_redirect_target() for retrieving the overidden
  884. * property. #GParamSpecOverride is used in implementing
  885. * g_object_class_override_property(), and will not be directly useful
  886. * unless you are implementing a new base type similar to GObject.
  887. *
  888. * Since: 2.4
  889. */
  890. struct _GParamSpecOverride
  891. {
  892. /*< private >*/
  893. GParamSpec parent_instance;
  894. GParamSpec *overridden;
  895. };
  896. /**
  897. * GParamSpecGType:
  898. * @parent_instance: private #GParamSpec portion
  899. * @is_a_type: a #GType whose subtypes can occur as values
  900. *
  901. * A #GParamSpec derived structure that contains the meta data for #GType properties.
  902. *
  903. * Since: 2.10
  904. */
  905. struct _GParamSpecGType
  906. {
  907. GParamSpec parent_instance;
  908. GType is_a_type;
  909. };
  910. /**
  911. * GParamSpecVariant:
  912. * @parent_instance: private #GParamSpec portion
  913. * @type: a #GVariantType, or %NULL
  914. * @default_value: a #GVariant, or %NULL
  915. *
  916. * A #GParamSpec derived structure that contains the meta data for #GVariant properties.
  917. *
  918. * Since: 2.26
  919. */
  920. struct _GParamSpecVariant
  921. {
  922. GParamSpec parent_instance;
  923. GVariantType *type;
  924. GVariant *default_value;
  925. /*< private >*/
  926. gpointer padding[4];
  927. };
  928. /* --- GParamSpec prototypes --- */
  929. GParamSpec* g_param_spec_char (const gchar *name,
  930. const gchar *nick,
  931. const gchar *blurb,
  932. gint8 minimum,
  933. gint8 maximum,
  934. gint8 default_value,
  935. GParamFlags flags);
  936. GParamSpec* g_param_spec_uchar (const gchar *name,
  937. const gchar *nick,
  938. const gchar *blurb,
  939. guint8 minimum,
  940. guint8 maximum,
  941. guint8 default_value,
  942. GParamFlags flags);
  943. GParamSpec* g_param_spec_boolean (const gchar *name,
  944. const gchar *nick,
  945. const gchar *blurb,
  946. gboolean default_value,
  947. GParamFlags flags);
  948. GParamSpec* g_param_spec_int (const gchar *name,
  949. const gchar *nick,
  950. const gchar *blurb,
  951. gint minimum,
  952. gint maximum,
  953. gint default_value,
  954. GParamFlags flags);
  955. GParamSpec* g_param_spec_uint (const gchar *name,
  956. const gchar *nick,
  957. const gchar *blurb,
  958. guint minimum,
  959. guint maximum,
  960. guint default_value,
  961. GParamFlags flags);
  962. GParamSpec* g_param_spec_long (const gchar *name,
  963. const gchar *nick,
  964. const gchar *blurb,
  965. glong minimum,
  966. glong maximum,
  967. glong default_value,
  968. GParamFlags flags);
  969. GParamSpec* g_param_spec_ulong (const gchar *name,
  970. const gchar *nick,
  971. const gchar *blurb,
  972. gulong minimum,
  973. gulong maximum,
  974. gulong default_value,
  975. GParamFlags flags);
  976. GParamSpec* g_param_spec_int64 (const gchar *name,
  977. const gchar *nick,
  978. const gchar *blurb,
  979. gint64 minimum,
  980. gint64 maximum,
  981. gint64 default_value,
  982. GParamFlags flags);
  983. GParamSpec* g_param_spec_uint64 (const gchar *name,
  984. const gchar *nick,
  985. const gchar *blurb,
  986. guint64 minimum,
  987. guint64 maximum,
  988. guint64 default_value,
  989. GParamFlags flags);
  990. GParamSpec* g_param_spec_unichar (const gchar *name,
  991. const gchar *nick,
  992. const gchar *blurb,
  993. gunichar default_value,
  994. GParamFlags flags);
  995. GParamSpec* g_param_spec_enum (const gchar *name,
  996. const gchar *nick,
  997. const gchar *blurb,
  998. GType enum_type,
  999. gint default_value,
  1000. GParamFlags flags);
  1001. GParamSpec* g_param_spec_flags (const gchar *name,
  1002. const gchar *nick,
  1003. const gchar *blurb,
  1004. GType flags_type,
  1005. guint default_value,
  1006. GParamFlags flags);
  1007. GParamSpec* g_param_spec_float (const gchar *name,
  1008. const gchar *nick,
  1009. const gchar *blurb,
  1010. gfloat minimum,
  1011. gfloat maximum,
  1012. gfloat default_value,
  1013. GParamFlags flags);
  1014. GParamSpec* g_param_spec_double (const gchar *name,
  1015. const gchar *nick,
  1016. const gchar *blurb,
  1017. gdouble minimum,
  1018. gdouble maximum,
  1019. gdouble default_value,
  1020. GParamFlags flags);
  1021. GParamSpec* g_param_spec_string (const gchar *name,
  1022. const gchar *nick,
  1023. const gchar *blurb,
  1024. const gchar *default_value,
  1025. GParamFlags flags);
  1026. GParamSpec* g_param_spec_param (const gchar *name,
  1027. const gchar *nick,
  1028. const gchar *blurb,
  1029. GType param_type,
  1030. GParamFlags flags);
  1031. GParamSpec* g_param_spec_boxed (const gchar *name,
  1032. const gchar *nick,
  1033. const gchar *blurb,
  1034. GType boxed_type,
  1035. GParamFlags flags);
  1036. GParamSpec* g_param_spec_pointer (const gchar *name,
  1037. const gchar *nick,
  1038. const gchar *blurb,
  1039. GParamFlags flags);
  1040. GParamSpec* g_param_spec_value_array (const gchar *name,
  1041. const gchar *nick,
  1042. const gchar *blurb,
  1043. GParamSpec *element_spec,
  1044. GParamFlags flags);
  1045. GParamSpec* g_param_spec_object (const gchar *name,
  1046. const gchar *nick,
  1047. const gchar *blurb,
  1048. GType object_type,
  1049. GParamFlags flags);
  1050. GParamSpec* g_param_spec_override (const gchar *name,
  1051. GParamSpec *overridden);
  1052. GParamSpec* g_param_spec_gtype (const gchar *name,
  1053. const gchar *nick,
  1054. const gchar *blurb,
  1055. GType is_a_type,
  1056. GParamFlags flags);
  1057. GParamSpec* g_param_spec_variant (const gchar *name,
  1058. const gchar *nick,
  1059. const gchar *blurb,
  1060. const GVariantType *type,
  1061. GVariant *default_value,
  1062. GParamFlags flags);
  1063. /* --- internal --- */
  1064. /* We prefix variable declarations so they can
  1065. * properly get exported in windows dlls.
  1066. */
  1067. #ifndef GOBJECT_VAR
  1068. # ifdef G_PLATFORM_WIN32
  1069. # ifdef GOBJECT_STATIC_COMPILATION
  1070. # define GOBJECT_VAR extern
  1071. # else /* !GOBJECT_STATIC_COMPILATION */
  1072. # ifdef GOBJECT_COMPILATION
  1073. # ifdef DLL_EXPORT
  1074. # define GOBJECT_VAR __declspec(dllexport)
  1075. # else /* !DLL_EXPORT */
  1076. # define GOBJECT_VAR extern
  1077. # endif /* !DLL_EXPORT */
  1078. # else /* !GOBJECT_COMPILATION */
  1079. # define GOBJECT_VAR extern __declspec(dllimport)
  1080. # endif /* !GOBJECT_COMPILATION */
  1081. # endif /* !GOBJECT_STATIC_COMPILATION */
  1082. # else /* !G_PLATFORM_WIN32 */
  1083. # define GOBJECT_VAR extern
  1084. # endif /* !G_PLATFORM_WIN32 */
  1085. #endif /* GOBJECT_VAR */
  1086. GOBJECT_VAR GType *g_param_spec_types;
  1087. G_END_DECLS
  1088. #endif /* __G_PARAMSPECS_H__ */