1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = gobject-Generic-values.html 27 * outPack = gobject 28 * outFile = Value 29 * strct = GValue 30 * realStrct= 31 * ctorStrct= 32 * clss = Value 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - g_value_ 41 * omit structs: 42 * - GValue 43 * omit prefixes: 44 * omit code: 45 * - g_value_init 46 * - g_value_reset 47 * omit signals: 48 * imports: 49 * - glib.Str 50 * - gobject.ParamSpec 51 * - gdk.Pixbuf 52 * - glib.Variant 53 * - glib.VariantType 54 * structWrap: 55 * - GParamSpec* -> ParamSpec 56 * - GValue* -> Value 57 * - GVariant* -> Variant 58 * - GVariantType* -> VariantType 59 * module aliases: 60 * local aliases: 61 * overrides: 62 */ 63 64 module gobject.Value; 65 66 public import gtkc.gobjecttypes; 67 68 private import gtkc.gobject; 69 private import glib.ConstructionException; 70 private import gobject.ObjectG; 71 72 73 private import glib.Str; 74 private import gobject.ParamSpec; 75 private import gdk.Pixbuf; 76 private import glib.Variant; 77 private import glib.VariantType; 78 79 80 81 82 /** 83 * Description 84 * The GValue structure is basically a variable container that consists 85 * of a type identifier and a specific value of that type. 86 * The type identifier within a GValue structure always determines the 87 * type of the associated value. 88 * To create a undefined GValue structure, simply create a zero-filled 89 * GValue structure. To initialize the GValue, use the g_value_init() 90 * function. A GValue cannot be used until it is initialized. 91 * The basic type operations (such as freeing and copying) are determined 92 * by the GTypeValueTable associated with the type ID stored in the GValue. 93 * Other GValue operations (such as converting values between types) are 94 * provided by this interface. 95 * The code in the example program below demonstrates GValue's 96 * features. 97 * $(DDOC_COMMENT example) 98 */ 99 public class Value 100 { 101 102 /** the main Gtk struct */ 103 protected GValue* gValue; 104 105 106 public GValue* getValueStruct() 107 { 108 return gValue; 109 } 110 111 112 /** the main Gtk struct as a void* */ 113 protected void* getStruct() 114 { 115 return cast(void*)gValue; 116 } 117 118 /** 119 * Sets our main struct and passes it to the parent class 120 */ 121 public this (GValue* gValue) 122 { 123 this.gValue = gValue; 124 } 125 126 /** */ 127 public this() 128 { 129 this(new GValue); 130 } 131 132 /** */ 133 this(Pixbuf pixbuf) 134 { 135 GValue* v = new GValue; 136 //v.g_type = DUIType.PIXBUF; 137 v.g_type = Pixbuf.getType(); 138 v.data1.v_pointer = cast(void*)(pixbuf.getPixbufStruct()); 139 this(v); 140 } 141 142 /** */ 143 this(string value) 144 { 145 this(); 146 init(GType.STRING); 147 setString(value); 148 } 149 150 /** */ 151 this(int value) 152 { 153 this(); 154 init(GType.INT); 155 setInt(value); 156 } 157 158 /** */ 159 this(float value) 160 { 161 this(); 162 init(GType.FLOAT); 163 setFloat(value); 164 } 165 166 /** */ 167 this(double value) 168 { 169 this(); 170 init(GType.DOUBLE); 171 setDouble(value); 172 } 173 174 /** 175 * Initializes value with the default value of type. 176 * Params: 177 * value = A zero-filled (uninitialized) GValue structure. 178 * g_type = Type the GValue should hold values of. 179 * Returns: 180 * the GValue structure that has been passed in 181 */ 182 public Value init(GType gType) 183 { 184 // GValue* g_value_init (GValue *value, GType g_type); 185 g_value_init(gValue, gType); 186 return this; 187 } 188 189 /** 190 * Clears the current value in value and resets it to the default value 191 * (as if the value had just been initialized). 192 * Params: 193 * value = An initialized GValue structure. 194 * Returns: 195 * the GValue structure that has been passed in 196 */ 197 public Value reset() 198 { 199 // GValue* g_value_reset (GValue *value); 200 g_value_reset(gValue); 201 return this; 202 } 203 204 205 206 /** 207 * Description 208 * GValue provides an abstract container structure which can be 209 * copied, transformed and compared while holding a value of any 210 * (derived) type, which is registered as a GType with a 211 * GTypeValueTable in its GTypeInfo structure. Parameter 212 * specifications for most value types can be created as GParamSpec 213 * derived instances, to implement e.g. GObject properties which 214 * operate on GValue containers. 215 * Parameter names need to start with a letter (a-z or A-Z). Subsequent 216 * characters can be letters, numbers or a '-'. 217 * All other characters are replaced by a '-' during construction. 218 */ 219 220 /** 221 * Copies the value of src_value into dest_value. 222 * Params: 223 * destValue = An initialized GValue structure of the same type as src_value. 224 */ 225 public void copy(Value destValue) 226 { 227 // void g_value_copy (const GValue *src_value, GValue *dest_value); 228 g_value_copy(gValue, (destValue is null) ? null : destValue.getValueStruct()); 229 } 230 231 /** 232 * Clears the current value in value and "unsets" the type, 233 * this releases all resources associated with this GValue. 234 * An unset value is the same as an uninitialized (zero-filled) 235 * GValue structure. 236 */ 237 public void unset() 238 { 239 // void g_value_unset (GValue *value); 240 g_value_unset(gValue); 241 } 242 243 /** 244 * Sets value from an instantiatable type via the 245 * value_table's collect_value() function. 246 */ 247 public void setInstance(void* instanc) 248 { 249 // void g_value_set_instance (GValue *value, gpointer instance); 250 g_value_set_instance(gValue, instanc); 251 } 252 253 /** 254 * Determines if value will fit inside the size of a pointer value. 255 * This is an internal function introduced mainly for C marshallers. 256 * Returns: TRUE if value will fit inside a pointer value. 257 */ 258 public int fitsPointer() 259 { 260 // gboolean g_value_fits_pointer (const GValue *value); 261 return g_value_fits_pointer(gValue); 262 } 263 264 /** 265 * Returns: the value contents as pointer. This function asserts that g_value_fits_pointer() returned TRUE for the passed in value. This is an internal function introduced mainly for C marshallers. [transfer none] 266 */ 267 public void* peekPointer() 268 { 269 // gpointer g_value_peek_pointer (const GValue *value); 270 return g_value_peek_pointer(gValue); 271 } 272 273 /** 274 * Returns whether a GValue of type src_type can be copied into 275 * a GValue of type dest_type. 276 * Params: 277 * srcType = source type to be copied. 278 * destType = destination type for copying. 279 * Returns: TRUE if g_value_copy() is possible with src_type and dest_type. 280 */ 281 public static int typeCompatible(GType srcType, GType destType) 282 { 283 // gboolean g_value_type_compatible (GType src_type, GType dest_type); 284 return g_value_type_compatible(srcType, destType); 285 } 286 287 /** 288 * Check whether g_value_transform() is able to transform values 289 * of type src_type into values of type dest_type. 290 * Params: 291 * srcType = Source type. 292 * destType = Target type. 293 * Returns: TRUE if the transformation is possible, FALSE otherwise. 294 */ 295 public static int typeTransformable(GType srcType, GType destType) 296 { 297 // gboolean g_value_type_transformable (GType src_type, GType dest_type); 298 return g_value_type_transformable(srcType, destType); 299 } 300 301 /** 302 * Tries to cast the contents of src_value into a type appropriate 303 * to store in dest_value, e.g. to transform a G_TYPE_INT value 304 * into a G_TYPE_FLOAT value. Performing transformations between 305 * value types might incur precision lossage. Especially 306 * transformations into strings might reveal seemingly arbitrary 307 * results and shouldn't be relied upon for production code (such 308 * as rcfile value or object property serialization). 309 * Params: 310 * destValue = Target value. 311 * Returns: Whether a transformation rule was found and could be applied. Upon failing transformations, dest_value is left untouched. 312 */ 313 public int transform(Value destValue) 314 { 315 // gboolean g_value_transform (const GValue *src_value, GValue *dest_value); 316 return g_value_transform(gValue, (destValue is null) ? null : destValue.getValueStruct()); 317 } 318 319 /** 320 * Registers a value transformation function for use in g_value_transform(). 321 * A previously registered transformation function for src_type and dest_type 322 * will be replaced. 323 * Params: 324 * srcType = Source type. 325 * destType = Target type. 326 * transformFunc = a function which transforms values of type src_type 327 * into value of type dest_type 328 */ 329 public static void registerTransformFunc(GType srcType, GType destType, GValueTransform transformFunc) 330 { 331 // void g_value_register_transform_func (GType src_type, GType dest_type, GValueTransform transform_func); 332 g_value_register_transform_func(srcType, destType, transformFunc); 333 } 334 335 /** 336 * Return a newly allocated string, which describes the contents of a 337 * GValue. The main purpose of this function is to describe GValue 338 * contents for debugging output, the way in which the contents are 339 * described may change between different GLib versions. 340 * Returns: Newly allocated string. 341 */ 342 public string gStrdupValueContents() 343 { 344 // gchar * g_strdup_value_contents (const GValue *value); 345 return Str.toString(g_strdup_value_contents(gValue)); 346 } 347 348 /** 349 * Creates a new GParamSpecBoolean instance specifying a G_TYPE_BOOLEAN 350 * property. 351 * See g_param_spec_internal() for details on property names. 352 * Params: 353 * name = canonical name of the property specified 354 * nick = nick name for the property specified 355 * blurb = description of the property specified 356 * defaultValue = default value for the property specified 357 * flags = flags for the property specified 358 * Returns: a newly created parameter specification 359 */ 360 public static ParamSpec gParamSpecBoolean(string name, string nick, string blurb, int defaultValue, GParamFlags flags) 361 { 362 // GParamSpec * g_param_spec_boolean (const gchar *name, const gchar *nick, const gchar *blurb, gboolean default_value, GParamFlags flags); 363 auto p = g_param_spec_boolean(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), defaultValue, flags); 364 365 if(p is null) 366 { 367 return null; 368 } 369 370 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 371 } 372 373 /** 374 * Set the contents of a G_TYPE_BOOLEAN GValue to v_boolean. 375 * Params: 376 * vBoolean = boolean value to be set 377 */ 378 public void setBoolean(int vBoolean) 379 { 380 // void g_value_set_boolean (GValue *value, gboolean v_boolean); 381 g_value_set_boolean(gValue, vBoolean); 382 } 383 384 /** 385 * Get the contents of a G_TYPE_BOOLEAN GValue. 386 * Returns: boolean contents of value 387 */ 388 public int getBoolean() 389 { 390 // gboolean g_value_get_boolean (const GValue *value); 391 return g_value_get_boolean(gValue); 392 } 393 394 /** 395 * Creates a new GParamSpecChar instance specifying a G_TYPE_CHAR property. 396 * Params: 397 * name = canonical name of the property specified 398 * nick = nick name for the property specified 399 * blurb = description of the property specified 400 * minimum = minimum value for the property specified 401 * maximum = maximum value for the property specified 402 * defaultValue = default value for the property specified 403 * flags = flags for the property specified 404 * Returns: a newly created parameter specification 405 */ 406 public static ParamSpec gParamSpecChar(string name, string nick, string blurb, byte minimum, byte maximum, byte defaultValue, GParamFlags flags) 407 { 408 // GParamSpec * g_param_spec_char (const gchar *name, const gchar *nick, const gchar *blurb, gint8 minimum, gint8 maximum, gint8 default_value, GParamFlags flags); 409 auto p = g_param_spec_char(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 410 411 if(p is null) 412 { 413 return null; 414 } 415 416 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 417 } 418 419 /** 420 * Set the contents of a G_TYPE_CHAR GValue to v_char. 421 * Params: 422 * vChar = character value to be set 423 */ 424 public void setChar(char vChar) 425 { 426 // void g_value_set_char (GValue *value, gchar v_char); 427 g_value_set_char(gValue, vChar); 428 } 429 430 /** 431 * Get the contents of a G_TYPE_CHAR GValue. 432 * Returns: character contents of value 433 */ 434 public char getChar() 435 { 436 // gchar g_value_get_char (const GValue *value); 437 return g_value_get_char(gValue); 438 } 439 440 /** 441 * Creates a new GParamSpecUChar instance specifying a G_TYPE_UCHAR property. 442 * Params: 443 * name = canonical name of the property specified 444 * nick = nick name for the property specified 445 * blurb = description of the property specified 446 * minimum = minimum value for the property specified 447 * maximum = maximum value for the property specified 448 * defaultValue = default value for the property specified 449 * flags = flags for the property specified 450 * Returns: a newly created parameter specification 451 */ 452 public static ParamSpec gParamSpecUchar(string name, string nick, string blurb, ubyte minimum, ubyte maximum, ubyte defaultValue, GParamFlags flags) 453 { 454 // GParamSpec * g_param_spec_uchar (const gchar *name, const gchar *nick, const gchar *blurb, guint8 minimum, guint8 maximum, guint8 default_value, GParamFlags flags); 455 auto p = g_param_spec_uchar(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 456 457 if(p is null) 458 { 459 return null; 460 } 461 462 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 463 } 464 465 /** 466 * Set the contents of a G_TYPE_UCHAR GValue to v_uchar. 467 * Params: 468 * vUchar = unsigned character value to be set 469 */ 470 public void setUchar(char vUchar) 471 { 472 // void g_value_set_uchar (GValue *value, guchar v_uchar); 473 g_value_set_uchar(gValue, vUchar); 474 } 475 476 /** 477 * Get the contents of a G_TYPE_UCHAR GValue. 478 * Returns: unsigned character contents of value 479 */ 480 public char getUchar() 481 { 482 // guchar g_value_get_uchar (const GValue *value); 483 return g_value_get_uchar(gValue); 484 } 485 486 /** 487 * Creates a new GParamSpecInt instance specifying a G_TYPE_INT property. 488 * See g_param_spec_internal() for details on property names. 489 * Params: 490 * name = canonical name of the property specified 491 * nick = nick name for the property specified 492 * blurb = description of the property specified 493 * minimum = minimum value for the property specified 494 * maximum = maximum value for the property specified 495 * defaultValue = default value for the property specified 496 * flags = flags for the property specified 497 * Returns: a newly created parameter specification 498 */ 499 public static ParamSpec gParamSpecInt(string name, string nick, string blurb, int minimum, int maximum, int defaultValue, GParamFlags flags) 500 { 501 // GParamSpec * g_param_spec_int (const gchar *name, const gchar *nick, const gchar *blurb, gint minimum, gint maximum, gint default_value, GParamFlags flags); 502 auto p = g_param_spec_int(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 503 504 if(p is null) 505 { 506 return null; 507 } 508 509 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 510 } 511 512 /** 513 * Set the contents of a G_TYPE_INT GValue to v_int. 514 * Params: 515 * vInt = integer value to be set 516 */ 517 public void setInt(int vInt) 518 { 519 // void g_value_set_int (GValue *value, gint v_int); 520 g_value_set_int(gValue, vInt); 521 } 522 523 /** 524 * Get the contents of a G_TYPE_INT GValue. 525 * Returns: integer contents of value 526 */ 527 public int getInt() 528 { 529 // gint g_value_get_int (const GValue *value); 530 return g_value_get_int(gValue); 531 } 532 533 /** 534 * Creates a new GParamSpecUInt instance specifying a G_TYPE_UINT property. 535 * See g_param_spec_internal() for details on property names. 536 * Params: 537 * name = canonical name of the property specified 538 * nick = nick name for the property specified 539 * blurb = description of the property specified 540 * minimum = minimum value for the property specified 541 * maximum = maximum value for the property specified 542 * defaultValue = default value for the property specified 543 * flags = flags for the property specified 544 * Returns: a newly created parameter specification 545 */ 546 public static ParamSpec gParamSpecUint(string name, string nick, string blurb, uint minimum, uint maximum, uint defaultValue, GParamFlags flags) 547 { 548 // GParamSpec * g_param_spec_uint (const gchar *name, const gchar *nick, const gchar *blurb, guint minimum, guint maximum, guint default_value, GParamFlags flags); 549 auto p = g_param_spec_uint(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 550 551 if(p is null) 552 { 553 return null; 554 } 555 556 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 557 } 558 559 /** 560 * Set the contents of a G_TYPE_UINT GValue to v_uint. 561 * Params: 562 * vUint = unsigned integer value to be set 563 */ 564 public void setUint(uint vUint) 565 { 566 // void g_value_set_uint (GValue *value, guint v_uint); 567 g_value_set_uint(gValue, vUint); 568 } 569 570 /** 571 * Get the contents of a G_TYPE_UINT GValue. 572 * Returns: unsigned integer contents of value 573 */ 574 public uint getUint() 575 { 576 // guint g_value_get_uint (const GValue *value); 577 return g_value_get_uint(gValue); 578 } 579 580 /** 581 * Creates a new GParamSpecLong instance specifying a G_TYPE_LONG property. 582 * See g_param_spec_internal() for details on property names. 583 * Params: 584 * name = canonical name of the property specified 585 * nick = nick name for the property specified 586 * blurb = description of the property specified 587 * minimum = minimum value for the property specified 588 * maximum = maximum value for the property specified 589 * defaultValue = default value for the property specified 590 * flags = flags for the property specified 591 * Returns: a newly created parameter specification 592 */ 593 public static ParamSpec gParamSpecLong(string name, string nick, string blurb, glong minimum, glong maximum, glong defaultValue, GParamFlags flags) 594 { 595 // GParamSpec * g_param_spec_long (const gchar *name, const gchar *nick, const gchar *blurb, glong minimum, glong maximum, glong default_value, GParamFlags flags); 596 auto p = g_param_spec_long(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 597 598 if(p is null) 599 { 600 return null; 601 } 602 603 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 604 } 605 606 /** 607 * Set the contents of a G_TYPE_LONG GValue to v_long. 608 * Params: 609 * vLong = long integer value to be set 610 */ 611 public void setLong(glong vLong) 612 { 613 // void g_value_set_long (GValue *value, glong v_long); 614 g_value_set_long(gValue, vLong); 615 } 616 617 /** 618 * Get the contents of a G_TYPE_LONG GValue. 619 * Returns: long integer contents of value 620 */ 621 public glong getLong() 622 { 623 // glong g_value_get_long (const GValue *value); 624 return g_value_get_long(gValue); 625 } 626 627 /** 628 * Creates a new GParamSpecULong instance specifying a G_TYPE_ULONG 629 * property. 630 * See g_param_spec_internal() for details on property names. 631 * Params: 632 * name = canonical name of the property specified 633 * nick = nick name for the property specified 634 * blurb = description of the property specified 635 * minimum = minimum value for the property specified 636 * maximum = maximum value for the property specified 637 * defaultValue = default value for the property specified 638 * flags = flags for the property specified 639 * Returns: a newly created parameter specification 640 */ 641 public static ParamSpec gParamSpecUlong(string name, string nick, string blurb, gulong minimum, gulong maximum, gulong defaultValue, GParamFlags flags) 642 { 643 // GParamSpec * g_param_spec_ulong (const gchar *name, const gchar *nick, const gchar *blurb, gulong minimum, gulong maximum, gulong default_value, GParamFlags flags); 644 auto p = g_param_spec_ulong(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 645 646 if(p is null) 647 { 648 return null; 649 } 650 651 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 652 } 653 654 /** 655 * Set the contents of a G_TYPE_ULONG GValue to v_ulong. 656 * Params: 657 * vUlong = unsigned long integer value to be set 658 */ 659 public void setUlong(gulong vUlong) 660 { 661 // void g_value_set_ulong (GValue *value, gulong v_ulong); 662 g_value_set_ulong(gValue, vUlong); 663 } 664 665 /** 666 * Get the contents of a G_TYPE_ULONG GValue. 667 * Returns: unsigned long integer contents of value 668 */ 669 public gulong getUlong() 670 { 671 // gulong g_value_get_ulong (const GValue *value); 672 return g_value_get_ulong(gValue); 673 } 674 675 /** 676 * Creates a new GParamSpecInt64 instance specifying a G_TYPE_INT64 property. 677 * See g_param_spec_internal() for details on property names. 678 * Params: 679 * name = canonical name of the property specified 680 * nick = nick name for the property specified 681 * blurb = description of the property specified 682 * minimum = minimum value for the property specified 683 * maximum = maximum value for the property specified 684 * defaultValue = default value for the property specified 685 * flags = flags for the property specified 686 * Returns: a newly created parameter specification 687 */ 688 public static ParamSpec gParamSpecInt64(string name, string nick, string blurb, long minimum, long maximum, long defaultValue, GParamFlags flags) 689 { 690 // GParamSpec * g_param_spec_int64 (const gchar *name, const gchar *nick, const gchar *blurb, gint64 minimum, gint64 maximum, gint64 default_value, GParamFlags flags); 691 auto p = g_param_spec_int64(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 692 693 if(p is null) 694 { 695 return null; 696 } 697 698 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 699 } 700 701 /** 702 * Set the contents of a G_TYPE_INT64 GValue to v_int64. 703 * Params: 704 * vInt64 = 64bit integer value to be set 705 */ 706 public void setInt64(long vInt64) 707 { 708 // void g_value_set_int64 (GValue *value, gint64 v_int64); 709 g_value_set_int64(gValue, vInt64); 710 } 711 712 /** 713 * Get the contents of a G_TYPE_INT64 GValue. 714 * Returns: 64bit integer contents of value 715 */ 716 public long getInt64() 717 { 718 // gint64 g_value_get_int64 (const GValue *value); 719 return g_value_get_int64(gValue); 720 } 721 722 /** 723 * Creates a new GParamSpecUInt64 instance specifying a G_TYPE_UINT64 724 * property. 725 * See g_param_spec_internal() for details on property names. 726 * Params: 727 * name = canonical name of the property specified 728 * nick = nick name for the property specified 729 * blurb = description of the property specified 730 * minimum = minimum value for the property specified 731 * maximum = maximum value for the property specified 732 * defaultValue = default value for the property specified 733 * flags = flags for the property specified 734 * Returns: a newly created parameter specification 735 */ 736 public static ParamSpec gParamSpecUint64(string name, string nick, string blurb, ulong minimum, ulong maximum, ulong defaultValue, GParamFlags flags) 737 { 738 // GParamSpec * g_param_spec_uint64 (const gchar *name, const gchar *nick, const gchar *blurb, guint64 minimum, guint64 maximum, guint64 default_value, GParamFlags flags); 739 auto p = g_param_spec_uint64(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 740 741 if(p is null) 742 { 743 return null; 744 } 745 746 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 747 } 748 749 /** 750 * Set the contents of a G_TYPE_UINT64 GValue to v_uint64. 751 * Params: 752 * vUint64 = unsigned 64bit integer value to be set 753 */ 754 public void setUint64(ulong vUint64) 755 { 756 // void g_value_set_uint64 (GValue *value, guint64 v_uint64); 757 g_value_set_uint64(gValue, vUint64); 758 } 759 760 /** 761 * Get the contents of a G_TYPE_UINT64 GValue. 762 * Returns: unsigned 64bit integer contents of value 763 */ 764 public ulong getUint64() 765 { 766 // guint64 g_value_get_uint64 (const GValue *value); 767 return g_value_get_uint64(gValue); 768 } 769 770 /** 771 * Creates a new GParamSpecFloat instance specifying a G_TYPE_FLOAT property. 772 * See g_param_spec_internal() for details on property names. 773 * Params: 774 * name = canonical name of the property specified 775 * nick = nick name for the property specified 776 * blurb = description of the property specified 777 * minimum = minimum value for the property specified 778 * maximum = maximum value for the property specified 779 * defaultValue = default value for the property specified 780 * flags = flags for the property specified 781 * Returns: a newly created parameter specification 782 */ 783 public static ParamSpec gParamSpecFloat(string name, string nick, string blurb, float minimum, float maximum, float defaultValue, GParamFlags flags) 784 { 785 // GParamSpec * g_param_spec_float (const gchar *name, const gchar *nick, const gchar *blurb, gfloat minimum, gfloat maximum, gfloat default_value, GParamFlags flags); 786 auto p = g_param_spec_float(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 787 788 if(p is null) 789 { 790 return null; 791 } 792 793 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 794 } 795 796 /** 797 * Set the contents of a G_TYPE_FLOAT GValue to v_float. 798 * Params: 799 * vFloat = float value to be set 800 */ 801 public void setFloat(float vFloat) 802 { 803 // void g_value_set_float (GValue *value, gfloat v_float); 804 g_value_set_float(gValue, vFloat); 805 } 806 807 /** 808 * Get the contents of a G_TYPE_FLOAT GValue. 809 * Returns: float contents of value 810 */ 811 public float getFloat() 812 { 813 // gfloat g_value_get_float (const GValue *value); 814 return g_value_get_float(gValue); 815 } 816 817 /** 818 * Creates a new GParamSpecDouble instance specifying a G_TYPE_DOUBLE 819 * property. 820 * See g_param_spec_internal() for details on property names. 821 * Params: 822 * name = canonical name of the property specified 823 * nick = nick name for the property specified 824 * blurb = description of the property specified 825 * minimum = minimum value for the property specified 826 * maximum = maximum value for the property specified 827 * defaultValue = default value for the property specified 828 * flags = flags for the property specified 829 * Returns: a newly created parameter specification 830 */ 831 public static ParamSpec gParamSpecDouble(string name, string nick, string blurb, double minimum, double maximum, double defaultValue, GParamFlags flags) 832 { 833 // GParamSpec * g_param_spec_double (const gchar *name, const gchar *nick, const gchar *blurb, gdouble minimum, gdouble maximum, gdouble default_value, GParamFlags flags); 834 auto p = g_param_spec_double(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), minimum, maximum, defaultValue, flags); 835 836 if(p is null) 837 { 838 return null; 839 } 840 841 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 842 } 843 844 /** 845 * Set the contents of a G_TYPE_DOUBLE GValue to v_double. 846 * Params: 847 * vDouble = double value to be set 848 */ 849 public void setDouble(double vDouble) 850 { 851 // void g_value_set_double (GValue *value, gdouble v_double); 852 g_value_set_double(gValue, vDouble); 853 } 854 855 /** 856 * Get the contents of a G_TYPE_DOUBLE GValue. 857 * Returns: double contents of value 858 */ 859 public double getDouble() 860 { 861 // gdouble g_value_get_double (const GValue *value); 862 return g_value_get_double(gValue); 863 } 864 865 /** 866 * Creates a new GParamSpecEnum instance specifying a G_TYPE_ENUM 867 * property. 868 * See g_param_spec_internal() for details on property names. 869 * Params: 870 * name = canonical name of the property specified 871 * nick = nick name for the property specified 872 * blurb = description of the property specified 873 * enumType = a GType derived from G_TYPE_ENUM 874 * defaultValue = default value for the property specified 875 * flags = flags for the property specified 876 * Returns: a newly created parameter specification 877 */ 878 public static ParamSpec gParamSpecEnum(string name, string nick, string blurb, GType enumType, int defaultValue, GParamFlags flags) 879 { 880 // GParamSpec * g_param_spec_enum (const gchar *name, const gchar *nick, const gchar *blurb, GType enum_type, gint default_value, GParamFlags flags); 881 auto p = g_param_spec_enum(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), enumType, defaultValue, flags); 882 883 if(p is null) 884 { 885 return null; 886 } 887 888 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 889 } 890 891 /** 892 * Set the contents of a G_TYPE_ENUM GValue to v_enum. 893 * Params: 894 * vEnum = enum value to be set 895 */ 896 public void setEnum(int vEnum) 897 { 898 // void g_value_set_enum (GValue *value, gint v_enum); 899 g_value_set_enum(gValue, vEnum); 900 } 901 902 /** 903 * Get the contents of a G_TYPE_ENUM GValue. 904 * Returns: enum contents of value 905 */ 906 public int getEnum() 907 { 908 // gint g_value_get_enum (const GValue *value); 909 return g_value_get_enum(gValue); 910 } 911 912 /** 913 * Creates a new GParamSpecFlags instance specifying a G_TYPE_FLAGS 914 * property. 915 * See g_param_spec_internal() for details on property names. 916 * Params: 917 * name = canonical name of the property specified 918 * nick = nick name for the property specified 919 * blurb = description of the property specified 920 * flagsType = a GType derived from G_TYPE_FLAGS 921 * defaultValue = default value for the property specified 922 * flags = flags for the property specified 923 * Returns: a newly created parameter specification 924 */ 925 public static ParamSpec gParamSpecFlags(string name, string nick, string blurb, GType flagsType, uint defaultValue, GParamFlags flags) 926 { 927 // GParamSpec * g_param_spec_flags (const gchar *name, const gchar *nick, const gchar *blurb, GType flags_type, guint default_value, GParamFlags flags); 928 auto p = g_param_spec_flags(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), flagsType, defaultValue, flags); 929 930 if(p is null) 931 { 932 return null; 933 } 934 935 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 936 } 937 938 /** 939 * Set the contents of a G_TYPE_FLAGS GValue to v_flags. 940 * Params: 941 * vFlags = flags value to be set 942 */ 943 public void setFlags(uint vFlags) 944 { 945 // void g_value_set_flags (GValue *value, guint v_flags); 946 g_value_set_flags(gValue, vFlags); 947 } 948 949 /** 950 * Get the contents of a G_TYPE_FLAGS GValue. 951 * Returns: flags contents of value 952 */ 953 public uint getFlags() 954 { 955 // guint g_value_get_flags (const GValue *value); 956 return g_value_get_flags(gValue); 957 } 958 959 /** 960 * Creates a new GParamSpecString instance. 961 * See g_param_spec_internal() for details on property names. 962 * Params: 963 * name = canonical name of the property specified 964 * nick = nick name for the property specified 965 * blurb = description of the property specified 966 * defaultValue = default value for the property specified 967 * flags = flags for the property specified 968 * Returns: a newly created parameter specification 969 */ 970 public static ParamSpec gParamSpecString(string name, string nick, string blurb, string defaultValue, GParamFlags flags) 971 { 972 // GParamSpec * g_param_spec_string (const gchar *name, const gchar *nick, const gchar *blurb, const gchar *default_value, GParamFlags flags); 973 auto p = g_param_spec_string(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), Str.toStringz(defaultValue), flags); 974 975 if(p is null) 976 { 977 return null; 978 } 979 980 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 981 } 982 983 /** 984 * Set the contents of a G_TYPE_STRING GValue to v_string. 985 * Params: 986 * vString = caller-owned string to be duplicated for the GValue 987 */ 988 public void setString(string vString) 989 { 990 // void g_value_set_string (GValue *value, const gchar *v_string); 991 g_value_set_string(gValue, Str.toStringz(vString)); 992 } 993 994 /** 995 * Set the contents of a G_TYPE_STRING GValue to v_string. 996 * The string is assumed to be static, and is thus not duplicated 997 * when setting the GValue. 998 * Params: 999 * vString = static string to be set 1000 */ 1001 public void setStaticString(string vString) 1002 { 1003 // void g_value_set_static_string (GValue *value, const gchar *v_string); 1004 g_value_set_static_string(gValue, Str.toStringz(vString)); 1005 } 1006 1007 /** 1008 * Sets the contents of a G_TYPE_STRING GValue to v_string. 1009 * Since 2.4 1010 * Params: 1011 * vString = string to take ownership of 1012 */ 1013 public void takeString(string vString) 1014 { 1015 // void g_value_take_string (GValue *value, gchar *v_string); 1016 g_value_take_string(gValue, Str.toStringz(vString)); 1017 } 1018 1019 /** 1020 * Warning 1021 * g_value_set_string_take_ownership has been deprecated since version 2.4 and should not be used in newly-written code. Use g_value_take_string() instead. 1022 * This is an internal function introduced mainly for C marshallers. 1023 * Params: 1024 * vString = duplicated unowned string to be set 1025 */ 1026 public void setStringTakeOwnership(string vString) 1027 { 1028 // void g_value_set_string_take_ownership (GValue *value, gchar *v_string); 1029 g_value_set_string_take_ownership(gValue, Str.toStringz(vString)); 1030 } 1031 1032 /** 1033 * Get the contents of a G_TYPE_STRING GValue. 1034 * Returns: string content of value 1035 */ 1036 public string getString() 1037 { 1038 // const gchar * g_value_get_string (const GValue *value); 1039 return Str.toString(g_value_get_string(gValue)); 1040 } 1041 1042 /** 1043 * Get a copy the contents of a G_TYPE_STRING GValue. 1044 * Returns: a newly allocated copy of the string content of value 1045 */ 1046 public string dupString() 1047 { 1048 // gchar * g_value_dup_string (const GValue *value); 1049 return Str.toString(g_value_dup_string(gValue)); 1050 } 1051 1052 /** 1053 * Creates a new GParamSpecParam instance specifying a G_TYPE_PARAM 1054 * property. 1055 * See g_param_spec_internal() for details on property names. 1056 * Params: 1057 * name = canonical name of the property specified 1058 * nick = nick name for the property specified 1059 * blurb = description of the property specified 1060 * paramType = a GType derived from G_TYPE_PARAM 1061 * flags = flags for the property specified 1062 * Returns: a newly created parameter specification 1063 */ 1064 public static ParamSpec gParamSpecParam(string name, string nick, string blurb, GType paramType, GParamFlags flags) 1065 { 1066 // GParamSpec * g_param_spec_param (const gchar *name, const gchar *nick, const gchar *blurb, GType param_type, GParamFlags flags); 1067 auto p = g_param_spec_param(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), paramType, flags); 1068 1069 if(p is null) 1070 { 1071 return null; 1072 } 1073 1074 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1075 } 1076 1077 /** 1078 * Set the contents of a G_TYPE_PARAM GValue to param. 1079 * Params: 1080 * param = the GParamSpec to be set 1081 */ 1082 public void setParam(ParamSpec param) 1083 { 1084 // void g_value_set_param (GValue *value, GParamSpec *param); 1085 g_value_set_param(gValue, (param is null) ? null : param.getParamSpecStruct()); 1086 } 1087 1088 /** 1089 * Sets the contents of a G_TYPE_PARAM GValue to param and takes 1090 * over the ownership of the callers reference to param; the caller 1091 * doesn't have to unref it any more. 1092 * Since 2.4 1093 * Params: 1094 * param = the GParamSpec to be set 1095 */ 1096 public void takeParam(ParamSpec param) 1097 { 1098 // void g_value_take_param (GValue *value, GParamSpec *param); 1099 g_value_take_param(gValue, (param is null) ? null : param.getParamSpecStruct()); 1100 } 1101 1102 /** 1103 * Warning 1104 * g_value_set_param_take_ownership has been deprecated since version 2.4 and should not be used in newly-written code. Use g_value_take_param() instead. 1105 * This is an internal function introduced mainly for C marshallers. 1106 * Params: 1107 * param = the GParamSpec to be set 1108 */ 1109 public void setParamTakeOwnership(ParamSpec param) 1110 { 1111 // void g_value_set_param_take_ownership (GValue *value, GParamSpec *param); 1112 g_value_set_param_take_ownership(gValue, (param is null) ? null : param.getParamSpecStruct()); 1113 } 1114 1115 /** 1116 * Get the contents of a G_TYPE_PARAM GValue. 1117 * Returns: GParamSpec content of value. [transfer none] 1118 */ 1119 public ParamSpec getParam() 1120 { 1121 // GParamSpec * g_value_get_param (const GValue *value); 1122 auto p = g_value_get_param(gValue); 1123 1124 if(p is null) 1125 { 1126 return null; 1127 } 1128 1129 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1130 } 1131 1132 /** 1133 * Get the contents of a G_TYPE_PARAM GValue, increasing its 1134 * reference count. 1135 * Returns: GParamSpec content of value, should be unreferenced when no longer needed. 1136 */ 1137 public ParamSpec dupParam() 1138 { 1139 // GParamSpec * g_value_dup_param (const GValue *value); 1140 auto p = g_value_dup_param(gValue); 1141 1142 if(p is null) 1143 { 1144 return null; 1145 } 1146 1147 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1148 } 1149 1150 /** 1151 * Creates a new GParamSpecBoxed instance specifying a G_TYPE_BOXED 1152 * derived property. 1153 * See g_param_spec_internal() for details on property names. 1154 * Params: 1155 * name = canonical name of the property specified 1156 * nick = nick name for the property specified 1157 * blurb = description of the property specified 1158 * boxedType = G_TYPE_BOXED derived type of this property 1159 * flags = flags for the property specified 1160 * Returns: a newly created parameter specification 1161 */ 1162 public static ParamSpec gParamSpecBoxed(string name, string nick, string blurb, GType boxedType, GParamFlags flags) 1163 { 1164 // GParamSpec * g_param_spec_boxed (const gchar *name, const gchar *nick, const gchar *blurb, GType boxed_type, GParamFlags flags); 1165 auto p = g_param_spec_boxed(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), boxedType, flags); 1166 1167 if(p is null) 1168 { 1169 return null; 1170 } 1171 1172 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1173 } 1174 1175 /** 1176 * Set the contents of a G_TYPE_BOXED derived GValue to v_boxed. 1177 * Params: 1178 * vBoxed = boxed value to be set 1179 */ 1180 public void setBoxed(void* vBoxed) 1181 { 1182 // void g_value_set_boxed (GValue *value, gconstpointer v_boxed); 1183 g_value_set_boxed(gValue, vBoxed); 1184 } 1185 1186 /** 1187 * Set the contents of a G_TYPE_BOXED derived GValue to v_boxed. 1188 * The boxed value is assumed to be static, and is thus not duplicated 1189 * when setting the GValue. 1190 * Params: 1191 * vBoxed = static boxed value to be set 1192 */ 1193 public void setStaticBoxed(void* vBoxed) 1194 { 1195 // void g_value_set_static_boxed (GValue *value, gconstpointer v_boxed); 1196 g_value_set_static_boxed(gValue, vBoxed); 1197 } 1198 1199 /** 1200 * Sets the contents of a G_TYPE_BOXED derived GValue to v_boxed 1201 * and takes over the ownership of the callers reference to v_boxed; 1202 * the caller doesn't have to unref it any more. 1203 * Since 2.4 1204 * Params: 1205 * vBoxed = duplicated unowned boxed value to be set 1206 */ 1207 public void takeBoxed(void* vBoxed) 1208 { 1209 // void g_value_take_boxed (GValue *value, gconstpointer v_boxed); 1210 g_value_take_boxed(gValue, vBoxed); 1211 } 1212 1213 /** 1214 * Warning 1215 * g_value_set_boxed_take_ownership has been deprecated since version 2.4 and should not be used in newly-written code. Use g_value_take_boxed() instead. 1216 * This is an internal function introduced mainly for C marshallers. 1217 * Params: 1218 * vBoxed = duplicated unowned boxed value to be set 1219 */ 1220 public void setBoxedTakeOwnership(void* vBoxed) 1221 { 1222 // void g_value_set_boxed_take_ownership (GValue *value, gconstpointer v_boxed); 1223 g_value_set_boxed_take_ownership(gValue, vBoxed); 1224 } 1225 1226 /** 1227 * Get the contents of a G_TYPE_BOXED derived GValue. 1228 * Returns: boxed contents of value. [transfer none] 1229 */ 1230 public void* getBoxed() 1231 { 1232 // gpointer g_value_get_boxed (const GValue *value); 1233 return g_value_get_boxed(gValue); 1234 } 1235 1236 /** 1237 * Get the contents of a G_TYPE_BOXED derived GValue. Upon getting, 1238 * the boxed value is duplicated and needs to be later freed with 1239 * g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (value), 1240 * return_value); 1241 * Returns: boxed contents of value 1242 */ 1243 public void* dupBoxed() 1244 { 1245 // gpointer g_value_dup_boxed (const GValue *value); 1246 return g_value_dup_boxed(gValue); 1247 } 1248 1249 /** 1250 * Creates a new GParamSpecPoiner instance specifying a pointer property. 1251 * See g_param_spec_internal() for details on property names. 1252 * Params: 1253 * name = canonical name of the property specified 1254 * nick = nick name for the property specified 1255 * blurb = description of the property specified 1256 * flags = flags for the property specified 1257 * Returns: a newly created parameter specification 1258 */ 1259 public static ParamSpec gParamSpecPointer(string name, string nick, string blurb, GParamFlags flags) 1260 { 1261 // GParamSpec * g_param_spec_pointer (const gchar *name, const gchar *nick, const gchar *blurb, GParamFlags flags); 1262 auto p = g_param_spec_pointer(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), flags); 1263 1264 if(p is null) 1265 { 1266 return null; 1267 } 1268 1269 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1270 } 1271 1272 /** 1273 * Set the contents of a pointer GValue to v_pointer. 1274 * Params: 1275 * vPointer = pointer value to be set 1276 */ 1277 public void setPointer(void* vPointer) 1278 { 1279 // void g_value_set_pointer (GValue *value, gpointer v_pointer); 1280 g_value_set_pointer(gValue, vPointer); 1281 } 1282 1283 /** 1284 * Get the contents of a pointer GValue. 1285 * Returns: pointer contents of value. [transfer none] 1286 */ 1287 public void* getPointer() 1288 { 1289 // gpointer g_value_get_pointer (const GValue *value); 1290 return g_value_get_pointer(gValue); 1291 } 1292 1293 /** 1294 * Creates a new GParamSpecBoxed instance specifying a G_TYPE_OBJECT 1295 * derived property. 1296 * See g_param_spec_internal() for details on property names. 1297 * Params: 1298 * name = canonical name of the property specified 1299 * nick = nick name for the property specified 1300 * blurb = description of the property specified 1301 * objectType = G_TYPE_OBJECT derived type of this property 1302 * flags = flags for the property specified 1303 * Returns: a newly created parameter specification 1304 */ 1305 public static ParamSpec gParamSpecObject(string name, string nick, string blurb, GType objectType, GParamFlags flags) 1306 { 1307 // GParamSpec * g_param_spec_object (const gchar *name, const gchar *nick, const gchar *blurb, GType object_type, GParamFlags flags); 1308 auto p = g_param_spec_object(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), objectType, flags); 1309 1310 if(p is null) 1311 { 1312 return null; 1313 } 1314 1315 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1316 } 1317 1318 /** 1319 * Set the contents of a G_TYPE_OBJECT derived GValue to v_object. 1320 * g_value_set_object() increases the reference count of v_object 1321 * (the GValue holds a reference to v_object). If you do not wish 1322 * to increase the reference count of the object (i.e. you wish to 1323 * pass your current reference to the GValue because you no longer 1324 * need it), use g_value_take_object() instead. 1325 * It is important that your GValue holds a reference to v_object (either its 1326 * own, or one it has taken) to ensure that the object won't be destroyed while 1327 * the GValue still exists). 1328 * Params: 1329 * vObject = object value to be set. [type GObject.Object] 1330 */ 1331 public void setObject(void* vObject) 1332 { 1333 // void g_value_set_object (GValue *value, gpointer v_object); 1334 g_value_set_object(gValue, vObject); 1335 } 1336 1337 /** 1338 * Sets the contents of a G_TYPE_OBJECT derived GValue to v_object 1339 * and takes over the ownership of the callers reference to v_object; 1340 * the caller doesn't have to unref it any more (i.e. the reference 1341 * count of the object is not increased). 1342 * If you want the GValue to hold its own reference to v_object, use 1343 * g_value_set_object() instead. 1344 * Since 2.4 1345 * Params: 1346 * vObject = object value to be set 1347 */ 1348 public void takeObject(void* vObject) 1349 { 1350 // void g_value_take_object (GValue *value, gpointer v_object); 1351 g_value_take_object(gValue, vObject); 1352 } 1353 1354 /** 1355 * Warning 1356 * g_value_set_object_take_ownership has been deprecated since version 2.4 and should not be used in newly-written code. Use g_value_take_object() instead. 1357 * This is an internal function introduced mainly for C marshallers. 1358 * Params: 1359 * vObject = object value to be set 1360 */ 1361 public void setObjectTakeOwnership(void* vObject) 1362 { 1363 // void g_value_set_object_take_ownership (GValue *value, gpointer v_object); 1364 g_value_set_object_take_ownership(gValue, vObject); 1365 } 1366 1367 /** 1368 * Get the contents of a G_TYPE_OBJECT derived GValue. 1369 * Returns: object contents of value. [type GObject.Object][transfer none] 1370 */ 1371 public void* getObject() 1372 { 1373 // gpointer g_value_get_object (const GValue *value); 1374 return g_value_get_object(gValue); 1375 } 1376 1377 /** 1378 * Get the contents of a G_TYPE_OBJECT derived GValue, increasing 1379 * its reference count. If the contents of the GValue are NULL, then 1380 * NULL will be returned. 1381 * Returns: object content of value, should be unreferenced when no longer needed. [type GObject.Object][transfer full] 1382 */ 1383 public void* dupObject() 1384 { 1385 // gpointer g_value_dup_object (const GValue *value); 1386 return g_value_dup_object(gValue); 1387 } 1388 1389 /** 1390 * Creates a new GParamSpecUnichar instance specifying a G_TYPE_UINT 1391 * property. GValue structures for this property can be accessed with 1392 * g_value_set_uint() and g_value_get_uint(). 1393 * See g_param_spec_internal() for details on property names. 1394 * Params: 1395 * name = canonical name of the property specified 1396 * nick = nick name for the property specified 1397 * blurb = description of the property specified 1398 * defaultValue = default value for the property specified 1399 * flags = flags for the property specified 1400 * Returns: a newly created parameter specification 1401 */ 1402 public static ParamSpec gParamSpecUnichar(string name, string nick, string blurb, gunichar defaultValue, GParamFlags flags) 1403 { 1404 // GParamSpec * g_param_spec_unichar (const gchar *name, const gchar *nick, const gchar *blurb, gunichar default_value, GParamFlags flags); 1405 auto p = g_param_spec_unichar(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), defaultValue, flags); 1406 1407 if(p is null) 1408 { 1409 return null; 1410 } 1411 1412 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1413 } 1414 1415 /** 1416 * Creates a new GParamSpecValueArray instance specifying a 1417 * G_TYPE_VALUE_ARRAY property. G_TYPE_VALUE_ARRAY is a 1418 * G_TYPE_BOXED type, as such, GValue structures for this property 1419 * can be accessed with g_value_set_boxed() and g_value_get_boxed(). 1420 * See g_param_spec_internal() for details on property names. 1421 * Params: 1422 * name = canonical name of the property specified 1423 * nick = nick name for the property specified 1424 * blurb = description of the property specified 1425 * elementSpec = a GParamSpec describing the elements contained in 1426 * arrays of this property, may be NULL 1427 * flags = flags for the property specified 1428 * Returns: a newly created parameter specification 1429 */ 1430 public static ParamSpec gParamSpecValueArray(string name, string nick, string blurb, ParamSpec elementSpec, GParamFlags flags) 1431 { 1432 // GParamSpec * g_param_spec_value_array (const gchar *name, const gchar *nick, const gchar *blurb, GParamSpec *element_spec, GParamFlags flags); 1433 auto p = g_param_spec_value_array(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), (elementSpec is null) ? null : elementSpec.getParamSpecStruct(), flags); 1434 1435 if(p is null) 1436 { 1437 return null; 1438 } 1439 1440 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1441 } 1442 1443 /** 1444 * Creates a new property of type GParamSpecOverride. This is used 1445 * to direct operations to another paramspec, and will not be directly 1446 * useful unless you are implementing a new base type similar to GObject. 1447 * Since 2.4 1448 * Params: 1449 * name = the name of the property. 1450 * overridden = The property that is being overridden 1451 * Returns: the newly created GParamSpec 1452 */ 1453 public static ParamSpec gParamSpecOverride(string name, ParamSpec overridden) 1454 { 1455 // GParamSpec * g_param_spec_override (const gchar *name, GParamSpec *overridden); 1456 auto p = g_param_spec_override(Str.toStringz(name), (overridden is null) ? null : overridden.getParamSpecStruct()); 1457 1458 if(p is null) 1459 { 1460 return null; 1461 } 1462 1463 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1464 } 1465 1466 /** 1467 * Creates a new GParamSpecGType instance specifying a 1468 * G_TYPE_GTYPE property. 1469 * See g_param_spec_internal() for details on property names. 1470 * Since 2.10 1471 * Params: 1472 * name = canonical name of the property specified 1473 * nick = nick name for the property specified 1474 * blurb = description of the property specified 1475 * isAType = a GType whose subtypes are allowed as values 1476 * of the property (use G_TYPE_NONE for any type) 1477 * flags = flags for the property specified 1478 * Returns: a newly created parameter specification 1479 */ 1480 public static ParamSpec gParamSpecGtype(string name, string nick, string blurb, GType isAType, GParamFlags flags) 1481 { 1482 // GParamSpec * g_param_spec_gtype (const gchar *name, const gchar *nick, const gchar *blurb, GType is_a_type, GParamFlags flags); 1483 auto p = g_param_spec_gtype(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), isAType, flags); 1484 1485 if(p is null) 1486 { 1487 return null; 1488 } 1489 1490 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1491 } 1492 1493 /** 1494 * Get the contents of a G_TYPE_GTYPE GValue. 1495 * Since 2.12 1496 * Returns: the GType stored in value 1497 */ 1498 public GType getGtype() 1499 { 1500 // GType g_value_get_gtype (const GValue *value); 1501 return g_value_get_gtype(gValue); 1502 } 1503 1504 /** 1505 * Set the contents of a G_TYPE_GTYPE GValue to v_gtype. 1506 * Since 2.12 1507 * Params: 1508 * vGtype = GType to be set 1509 */ 1510 public void setGtype(GType vGtype) 1511 { 1512 // void g_value_set_gtype (GValue *value, GType v_gtype); 1513 g_value_set_gtype(gValue, vGtype); 1514 } 1515 1516 /** 1517 * Creates a new GParamSpecVariant instance specifying a GVariant 1518 * property. 1519 * If default_value is floating, it is consumed. 1520 * See g_param_spec_internal() for details on property names. 1521 * Since 2.26 1522 * Params: 1523 * name = canonical name of the property specified 1524 * nick = nick name for the property specified 1525 * blurb = description of the property specified 1526 * type = a GVariantType 1527 * defaultValue = a GVariant of type type to use as the 1528 * default value, or NULL. [allow-none] 1529 * flags = flags for the property specified 1530 * Returns: the newly created GParamSpec 1531 */ 1532 public static ParamSpec gParamSpecVariant(string name, string nick, string blurb, VariantType type, Variant defaultValue, GParamFlags flags) 1533 { 1534 // GParamSpec * g_param_spec_variant (const gchar *name, const gchar *nick, const gchar *blurb, const GVariantType *type, GVariant *default_value, GParamFlags flags); 1535 auto p = g_param_spec_variant(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), (type is null) ? null : type.getVariantTypeStruct(), (defaultValue is null) ? null : defaultValue.getVariantStruct(), flags); 1536 1537 if(p is null) 1538 { 1539 return null; 1540 } 1541 1542 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 1543 } 1544 1545 /** 1546 * Get the contents of a variant GValue. 1547 * Since 2.26 1548 * Returns: variant contents of value 1549 */ 1550 public Variant getVariant() 1551 { 1552 // GVariant * g_value_get_variant (const GValue *value); 1553 auto p = g_value_get_variant(gValue); 1554 1555 if(p is null) 1556 { 1557 return null; 1558 } 1559 1560 return ObjectG.getDObject!(Variant)(cast(GVariant*) p); 1561 } 1562 1563 /** 1564 * Get the contents of a variant GValue, increasing its refcount. 1565 * Since 2.26 1566 * Returns: variant contents of value, should be unrefed using g_variant_unref() when no longer needed 1567 */ 1568 public Variant dupVariant() 1569 { 1570 // GVariant * g_value_dup_variant (const GValue *value); 1571 auto p = g_value_dup_variant(gValue); 1572 1573 if(p is null) 1574 { 1575 return null; 1576 } 1577 1578 return ObjectG.getDObject!(Variant)(cast(GVariant*) p); 1579 } 1580 1581 /** 1582 * Set the contents of a variant GValue to variant. 1583 * If the variant is floating, it is consumed. 1584 * Since 2.26 1585 * Params: 1586 * variant = a GVariant, or NULL 1587 */ 1588 public void setVariant(Variant variant) 1589 { 1590 // void g_value_set_variant (GValue *value, GVariant *variant); 1591 g_value_set_variant(gValue, (variant is null) ? null : variant.getVariantStruct()); 1592 } 1593 1594 /** 1595 * Set the contents of a variant GValue to variant, and takes over 1596 * the ownership of the caller's reference to variant; 1597 * the caller doesn't have to unref it any more (i.e. the reference 1598 * count of the variant is not increased). 1599 * It is a programmer error to pass a floating variant to this function. 1600 * In particular this means that callbacks in closures, and signal handlers 1601 * for signals of return type G_TYPE_VARIANT, must never return floating 1602 * variants. 1603 * If you want the GValue to hold its own reference to variant, use 1604 * g_value_set_variant() instead. 1605 * This is an internal function introduced mainly for C marshallers. 1606 * Since 2.26 1607 * Params: 1608 * variant = a GVariant, or NULL 1609 */ 1610 public void takeVariant(Variant variant) 1611 { 1612 // void g_value_take_variant (GValue *value, GVariant *variant); 1613 g_value_take_variant(gValue, (variant is null) ? null : variant.getVariantStruct()); 1614 } 1615 }