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 module gtkc.glibtypes; 26 27 public alias uint uid_t; 28 public alias int pid_t; 29 30 version( Windows ) 31 { 32 alias int glong; 33 alias uint gulong; 34 } 35 else version( X86_64 ) 36 { 37 alias long glong; 38 alias ulong gulong; 39 } 40 else 41 { 42 alias int glong; 43 alias uint gulong; 44 } 45 46 version( Windows ) 47 enum _utfPostfix = "_utf8"; 48 else 49 enum _utfPostfix = ""; 50 51 version (Windows) 52 { 53 private import core.stdc.stdio; 54 55 static if( !is(typeof(fdopen(0, null))) ) 56 { 57 extern (C) FILE* fdopen(int, char*); 58 } 59 } 60 61 static if ( __VERSION__ >= 2063 ) 62 { 63 public import std.typecons : scoped; 64 65 template Scoped(T) 66 { 67 alias typeof(scoped!T(cast(typeof(T.tupleof[0]))null)) Scoped; 68 } 69 } 70 else 71 { 72 // I'm getting the following error on the older dmd versions: 73 // this for Scoped_store needs to be type Scoped not type inout(Scoped!(T)). 74 // Unlike the phobos version this does use GC alocated memory for the object. 75 // Within GtkD this is used to make sure destroy is called on the object 76 // so it releases the resources it holds. 77 struct Scoped(T) 78 { 79 T payload; 80 81 alias payload this; 82 83 @disable this(); 84 @disable this(this); 85 86 ~this() 87 { 88 .destroy(payload); 89 } 90 } 91 92 auto scoped(T, Args...)(auto ref Args args) if (is(T == class)) 93 { 94 Scoped!(T) result = void; 95 result.payload = new T(args); 96 97 return result; 98 } 99 } 100 101 /** 102 * Get the length of a zero terminated array. 103 */ 104 size_t getArrayLength(T)(T* arr) 105 { 106 size_t len; 107 108 for ( ; arr[len]; len++ ){} 109 110 return len; 111 } 112 113 unittest 114 { 115 assert(getArrayLength("aaaaaaaaa\0".ptr) == 9); 116 } 117 118 Type* gMalloc(Type)() 119 { 120 import gtkc.glib; 121 return cast(Type*)g_malloc0(Type.sizeof); 122 } 123 124 alias void* GIConv; 125 126 /** 127 * Integer representing a day of the month; between 1 and 31. 128 * #G_DATE_BAD_DAY represents an invalid day of the month. 129 */ 130 public alias ubyte GDateDay; 131 132 /** 133 * Integer representing a year; #G_DATE_BAD_YEAR is the invalid 134 * value. The year must be 1 or higher; negative (BC) years are not 135 * allowed. The year is represented with four digits. 136 */ 137 public alias ushort GDateYear; 138 139 /** 140 * Opaque type. See g_mutex_locker_new() for details. 141 */ 142 public alias void GMutexLocker; 143 144 /** 145 * A type which is used to hold a process identification. 146 * 147 * On UNIX, processes are identified by a process id (an integer), 148 * while Windows uses process handles (which are pointers). 149 * 150 * GPid is used in GLib only for descendant processes spawned with 151 * the g_spawn functions. 152 */ 153 public alias int GPid; 154 155 /** 156 * A GQuark is a non-zero integer which uniquely identifies a 157 * particular string. A GQuark value of zero is associated to %NULL. 158 */ 159 public alias uint GQuark; 160 161 /** 162 * A typedef alias for gchar**. This is mostly useful when used together with 163 * g_auto(). 164 */ 165 public alias char** GStrv; 166 167 /** 168 * Simply a replacement for time_t. It has been deprecated 169 * since it is not equivalent to time_t on 64-bit platforms 170 * with a 64-bit time_t. Unrelated to #GTimer. 171 * 172 * Note that #GTime is defined to always be a 32-bit integer, 173 * unlike time_t which may be 64-bit on some systems. Therefore, 174 * #GTime will overflow in the year 2038, and you cannot use the 175 * address of a #GTime variable as argument to the UNIX time() 176 * function. 177 * 178 * Instead, do the following: 179 * |[<!-- language="C" --> 180 * time_t ttime; 181 * GTime gtime; 182 * 183 * time (&ttime); 184 * gtime = (GTime)ttime; 185 * ]| 186 */ 187 public alias int GTime; 188 189 /** 190 * A value representing an interval of time, in microseconds. 191 */ 192 public alias long GTimeSpan; 193 194 enum GPriority 195 { 196 HIGH = -100, 197 DEFAULT = 0, 198 HIGH_IDLE = 100, 199 DEFAULT_IDLE = 200, 200 LOW = 300 201 } 202 203 204 public enum GAsciiType 205 { 206 ALNUM = 1, 207 ALPHA = 2, 208 CNTRL = 4, 209 DIGIT = 8, 210 GRAPH = 16, 211 LOWER = 32, 212 PRINT = 64, 213 PUNCT = 128, 214 SPACE = 256, 215 UPPER = 512, 216 XDIGIT = 1024, 217 } 218 alias GAsciiType AsciiType; 219 220 /** 221 * Error codes returned by bookmark file parsing. 222 */ 223 public enum GBookmarkFileError 224 { 225 /** 226 * URI was ill-formed 227 */ 228 INVALID_URI = 0, 229 /** 230 * a requested field was not found 231 */ 232 INVALID_VALUE = 1, 233 /** 234 * a requested application did 235 * not register a bookmark 236 */ 237 APP_NOT_REGISTERED = 2, 238 /** 239 * a requested URI was not found 240 */ 241 URI_NOT_FOUND = 3, 242 /** 243 * document was ill formed 244 */ 245 READ = 4, 246 /** 247 * the text being parsed was 248 * in an unknown encoding 249 */ 250 UNKNOWN_ENCODING = 5, 251 /** 252 * an error occurred while writing 253 */ 254 WRITE = 6, 255 /** 256 * requested file was not found 257 */ 258 FILE_NOT_FOUND = 7, 259 } 260 alias GBookmarkFileError BookmarkFileError; 261 262 /** 263 * The hashing algorithm to be used by #GChecksum when performing the 264 * digest of some data. 265 * 266 * Note that the #GChecksumType enumeration may be extended at a later 267 * date to include new hashing algorithm types. 268 * 269 * Since: 2.16 270 */ 271 public enum GChecksumType 272 { 273 /** 274 * Use the MD5 hashing algorithm 275 */ 276 MD5 = 0, 277 /** 278 * Use the SHA-1 hashing algorithm 279 */ 280 SHA1 = 1, 281 /** 282 * Use the SHA-256 hashing algorithm 283 */ 284 SHA256 = 2, 285 /** 286 * Use the SHA-512 hashing algorithm (Since: 2.36) 287 */ 288 SHA512 = 3, 289 /** 290 * Use the SHA-384 hashing algorithm (Since: 2.51) 291 */ 292 SHA384 = 4, 293 } 294 alias GChecksumType ChecksumType; 295 296 /** 297 * Error codes returned by character set conversion routines. 298 */ 299 public enum GConvertError 300 { 301 /** 302 * Conversion between the requested character 303 * sets is not supported. 304 */ 305 NO_CONVERSION = 0, 306 /** 307 * Invalid byte sequence in conversion input. 308 */ 309 ILLEGAL_SEQUENCE = 1, 310 /** 311 * Conversion failed for some reason. 312 */ 313 FAILED = 2, 314 /** 315 * Partial character sequence at end of input. 316 */ 317 PARTIAL_INPUT = 3, 318 /** 319 * URI is invalid. 320 */ 321 BAD_URI = 4, 322 /** 323 * Pathname is not an absolute path. 324 */ 325 NOT_ABSOLUTE_PATH = 5, 326 /** 327 * No memory available. Since: 2.40 328 */ 329 NO_MEMORY = 6, 330 } 331 alias GConvertError ConvertError; 332 333 /** 334 * This enumeration isn't used in the API, but may be useful if you need 335 * to mark a number as a day, month, or year. 336 */ 337 public enum GDateDMY 338 { 339 /** 340 * a day 341 */ 342 DAY = 0, 343 /** 344 * a month 345 */ 346 MONTH = 1, 347 /** 348 * a year 349 */ 350 YEAR = 2, 351 } 352 alias GDateDMY DateDMY; 353 354 /** 355 * Enumeration representing a month; values are #G_DATE_JANUARY, 356 * #G_DATE_FEBRUARY, etc. #G_DATE_BAD_MONTH is the invalid value. 357 */ 358 public enum GDateMonth 359 { 360 /** 361 * invalid value 362 */ 363 BAD_MONTH = 0, 364 /** 365 * January 366 */ 367 JANUARY = 1, 368 /** 369 * February 370 */ 371 FEBRUARY = 2, 372 /** 373 * March 374 */ 375 MARCH = 3, 376 /** 377 * April 378 */ 379 APRIL = 4, 380 /** 381 * May 382 */ 383 MAY = 5, 384 /** 385 * June 386 */ 387 JUNE = 6, 388 /** 389 * July 390 */ 391 JULY = 7, 392 /** 393 * August 394 */ 395 AUGUST = 8, 396 /** 397 * September 398 */ 399 SEPTEMBER = 9, 400 /** 401 * October 402 */ 403 OCTOBER = 10, 404 /** 405 * November 406 */ 407 NOVEMBER = 11, 408 /** 409 * December 410 */ 411 DECEMBER = 12, 412 } 413 alias GDateMonth DateMonth; 414 415 /** 416 * Enumeration representing a day of the week; #G_DATE_MONDAY, 417 * #G_DATE_TUESDAY, etc. #G_DATE_BAD_WEEKDAY is an invalid weekday. 418 */ 419 public enum GDateWeekday 420 { 421 /** 422 * invalid value 423 */ 424 BAD_WEEKDAY = 0, 425 /** 426 * Monday 427 */ 428 MONDAY = 1, 429 /** 430 * Tuesday 431 */ 432 TUESDAY = 2, 433 /** 434 * Wednesday 435 */ 436 WEDNESDAY = 3, 437 /** 438 * Thursday 439 */ 440 THURSDAY = 4, 441 /** 442 * Friday 443 */ 444 FRIDAY = 5, 445 /** 446 * Saturday 447 */ 448 SATURDAY = 6, 449 /** 450 * Sunday 451 */ 452 SUNDAY = 7, 453 } 454 alias GDateWeekday DateWeekday; 455 456 /** 457 * The possible errors, used in the @v_error field 458 * of #GTokenValue, when the token is a %G_TOKEN_ERROR. 459 */ 460 public enum GErrorType 461 { 462 /** 463 * unknown error 464 */ 465 UNKNOWN = 0, 466 /** 467 * unexpected end of file 468 */ 469 UNEXP_EOF = 1, 470 /** 471 * unterminated string constant 472 */ 473 UNEXP_EOF_IN_STRING = 2, 474 /** 475 * unterminated comment 476 */ 477 UNEXP_EOF_IN_COMMENT = 3, 478 /** 479 * non-digit character in a number 480 */ 481 NON_DIGIT_IN_CONST = 4, 482 /** 483 * digit beyond radix in a number 484 */ 485 DIGIT_RADIX = 5, 486 /** 487 * non-decimal floating point number 488 */ 489 FLOAT_RADIX = 6, 490 /** 491 * malformed floating point number 492 */ 493 FLOAT_MALFORMED = 7, 494 } 495 alias GErrorType ErrorType; 496 497 /** 498 * Values corresponding to @errno codes returned from file operations 499 * on UNIX. Unlike @errno codes, GFileError values are available on 500 * all systems, even Windows. The exact meaning of each code depends 501 * on what sort of file operation you were performing; the UNIX 502 * documentation gives more details. The following error code descriptions 503 * come from the GNU C Library manual, and are under the copyright 504 * of that manual. 505 * 506 * It's not very portable to make detailed assumptions about exactly 507 * which errors will be returned from a given operation. Some errors 508 * don't occur on some systems, etc., sometimes there are subtle 509 * differences in when a system will report a given error, etc. 510 */ 511 public enum GFileError 512 { 513 /** 514 * Operation not permitted; only the owner of 515 * the file (or other resource) or processes with special privileges 516 * can perform the operation. 517 */ 518 EXIST = 0, 519 /** 520 * File is a directory; you cannot open a directory 521 * for writing, or create or remove hard links to it. 522 */ 523 ISDIR = 1, 524 /** 525 * Permission denied; the file permissions do not 526 * allow the attempted operation. 527 */ 528 ACCES = 2, 529 /** 530 * Filename too long. 531 */ 532 NAMETOOLONG = 3, 533 /** 534 * No such file or directory. This is a "file 535 * doesn't exist" error for ordinary files that are referenced in 536 * contexts where they are expected to already exist. 537 */ 538 NOENT = 4, 539 /** 540 * A file that isn't a directory was specified when 541 * a directory is required. 542 */ 543 NOTDIR = 5, 544 /** 545 * No such device or address. The system tried to 546 * use the device represented by a file you specified, and it 547 * couldn't find the device. This can mean that the device file was 548 * installed incorrectly, or that the physical device is missing or 549 * not correctly attached to the computer. 550 */ 551 NXIO = 6, 552 /** 553 * The underlying file system of the specified file 554 * does not support memory mapping. 555 */ 556 NODEV = 7, 557 /** 558 * The directory containing the new link can't be 559 * modified because it's on a read-only file system. 560 */ 561 ROFS = 8, 562 /** 563 * Text file busy. 564 */ 565 TXTBSY = 9, 566 /** 567 * You passed in a pointer to bad memory. 568 * (GLib won't reliably return this, don't pass in pointers to bad 569 * memory.) 570 */ 571 FAULT = 10, 572 /** 573 * Too many levels of symbolic links were encountered 574 * in looking up a file name. This often indicates a cycle of symbolic 575 * links. 576 */ 577 LOOP = 11, 578 /** 579 * No space left on device; write operation on a 580 * file failed because the disk is full. 581 */ 582 NOSPC = 12, 583 /** 584 * No memory available. The system cannot allocate 585 * more virtual memory because its capacity is full. 586 */ 587 NOMEM = 13, 588 /** 589 * The current process has too many files open and 590 * can't open any more. Duplicate descriptors do count toward this 591 * limit. 592 */ 593 MFILE = 14, 594 /** 595 * There are too many distinct file openings in the 596 * entire system. 597 */ 598 NFILE = 15, 599 /** 600 * Bad file descriptor; for example, I/O on a 601 * descriptor that has been closed or reading from a descriptor open 602 * only for writing (or vice versa). 603 */ 604 BADF = 16, 605 /** 606 * Invalid argument. This is used to indicate 607 * various kinds of problems with passing the wrong argument to a 608 * library function. 609 */ 610 INVAL = 17, 611 /** 612 * Broken pipe; there is no process reading from the 613 * other end of a pipe. Every library function that returns this 614 * error code also generates a 'SIGPIPE' signal; this signal 615 * terminates the program if not handled or blocked. Thus, your 616 * program will never actually see this code unless it has handled 617 * or blocked 'SIGPIPE'. 618 */ 619 PIPE = 18, 620 /** 621 * Resource temporarily unavailable; the call might 622 * work if you try again later. 623 */ 624 AGAIN = 19, 625 /** 626 * Interrupted function call; an asynchronous signal 627 * occurred and prevented completion of the call. When this 628 * happens, you should try the call again. 629 */ 630 INTR = 20, 631 /** 632 * Input/output error; usually used for physical read 633 * or write errors. i.e. the disk or other physical device hardware 634 * is returning errors. 635 */ 636 IO = 21, 637 /** 638 * Operation not permitted; only the owner of the 639 * file (or other resource) or processes with special privileges can 640 * perform the operation. 641 */ 642 PERM = 22, 643 /** 644 * Function not implemented; this indicates that 645 * the system is missing some functionality. 646 */ 647 NOSYS = 23, 648 /** 649 * Does not correspond to a UNIX error code; this 650 * is the standard "failed for unspecified reason" error code present 651 * in all #GError error code enumerations. Returned if no specific 652 * code applies. 653 */ 654 FAILED = 24, 655 } 656 alias GFileError FileError; 657 658 /** 659 * A test to perform on a file using g_file_test(). 660 */ 661 public enum GFileTest 662 { 663 /** 664 * %TRUE if the file is a regular file 665 * (not a directory). Note that this test will also return %TRUE 666 * if the tested file is a symlink to a regular file. 667 */ 668 IS_REGULAR = 1, 669 /** 670 * %TRUE if the file is a symlink. 671 */ 672 IS_SYMLINK = 2, 673 /** 674 * %TRUE if the file is a directory. 675 */ 676 IS_DIR = 4, 677 /** 678 * %TRUE if the file is executable. 679 */ 680 IS_EXECUTABLE = 8, 681 /** 682 * %TRUE if the file exists. It may or may not 683 * be a regular file. 684 */ 685 EXISTS = 16, 686 } 687 alias GFileTest FileTest; 688 689 /** 690 * Flags to modify the format of the string returned by g_format_size_full(). 691 */ 692 public enum GFormatSizeFlags 693 { 694 /** 695 * behave the same as g_format_size() 696 */ 697 DEFAULT = 0, 698 /** 699 * include the exact number of bytes as part 700 * of the returned string. For example, "45.6 kB (45,612 bytes)". 701 */ 702 LONG_FORMAT = 1, 703 /** 704 * use IEC (base 1024) units with "KiB"-style 705 * suffixes. IEC units should only be used for reporting things with 706 * a strong "power of 2" basis, like RAM sizes or RAID stripe sizes. 707 * Network and storage sizes should be reported in the normal SI units. 708 */ 709 IEC_UNITS = 2, 710 } 711 alias GFormatSizeFlags FormatSizeFlags; 712 713 /** 714 * Flags used internally in the #GHook implementation. 715 */ 716 public enum GHookFlagMask 717 { 718 /** 719 * set if the hook has not been destroyed 720 */ 721 ACTIVE = 1, 722 /** 723 * set if the hook is currently being run 724 */ 725 IN_CALL = 2, 726 /** 727 * A mask covering all bits reserved for 728 * hook flags; see %G_HOOK_FLAG_USER_SHIFT 729 */ 730 MASK = 15, 731 } 732 alias GHookFlagMask HookFlagMask; 733 734 /** 735 * Error codes returned by #GIOChannel operations. 736 */ 737 public enum GIOChannelError 738 { 739 /** 740 * File too large. 741 */ 742 FBIG = 0, 743 /** 744 * Invalid argument. 745 */ 746 INVAL = 1, 747 /** 748 * IO error. 749 */ 750 IO = 2, 751 /** 752 * File is a directory. 753 */ 754 ISDIR = 3, 755 /** 756 * No space left on device. 757 */ 758 NOSPC = 4, 759 /** 760 * No such device or address. 761 */ 762 NXIO = 5, 763 /** 764 * Value too large for defined datatype. 765 */ 766 OVERFLOW = 6, 767 /** 768 * Broken pipe. 769 */ 770 PIPE = 7, 771 /** 772 * Some other error. 773 */ 774 FAILED = 8, 775 } 776 alias GIOChannelError IOChannelError; 777 778 /** 779 * A bitwise combination representing a condition to watch for on an 780 * event source. 781 */ 782 public enum GIOCondition 783 { 784 /** 785 * There is data to read. 786 */ 787 IN = 1, 788 /** 789 * Data can be written (without blocking). 790 */ 791 OUT = 4, 792 /** 793 * There is urgent data to read. 794 */ 795 PRI = 2, 796 /** 797 * Error condition. 798 */ 799 ERR = 8, 800 /** 801 * Hung up (the connection has been broken, usually for 802 * pipes and sockets). 803 */ 804 HUP = 16, 805 /** 806 * Invalid request. The file descriptor is not open. 807 */ 808 NVAL = 32, 809 } 810 alias GIOCondition IOCondition; 811 812 /** 813 * #GIOError is only used by the deprecated functions 814 * g_io_channel_read(), g_io_channel_write(), and g_io_channel_seek(). 815 */ 816 public enum GIOError 817 { 818 /** 819 * no error 820 */ 821 NONE = 0, 822 /** 823 * an EAGAIN error occurred 824 */ 825 AGAIN = 1, 826 /** 827 * an EINVAL error occurred 828 */ 829 INVAL = 2, 830 /** 831 * another error occurred 832 */ 833 UNKNOWN = 3, 834 } 835 alias GIOError IOError; 836 837 /** 838 * Specifies properties of a #GIOChannel. Some of the flags can only be 839 * read with g_io_channel_get_flags(), but not changed with 840 * g_io_channel_set_flags(). 841 */ 842 public enum GIOFlags 843 { 844 /** 845 * turns on append mode, corresponds to %O_APPEND 846 * (see the documentation of the UNIX open() syscall) 847 */ 848 APPEND = 1, 849 /** 850 * turns on nonblocking mode, corresponds to 851 * %O_NONBLOCK/%O_NDELAY (see the documentation of the UNIX open() 852 * syscall) 853 */ 854 NONBLOCK = 2, 855 /** 856 * indicates that the io channel is readable. 857 * This flag cannot be changed. 858 */ 859 IS_READABLE = 4, 860 /** 861 * indicates that the io channel is writable. 862 * This flag cannot be changed. 863 */ 864 IS_WRITABLE = 8, 865 /** 866 * a misspelled version of @G_IO_FLAG_IS_WRITABLE 867 * that existed before the spelling was fixed in GLib 2.30. It is kept 868 * here for compatibility reasons. Deprecated since 2.30 869 */ 870 IS_WRITEABLE = 8, 871 /** 872 * indicates that the io channel is seekable, 873 * i.e. that g_io_channel_seek_position() can be used on it. 874 * This flag cannot be changed. 875 */ 876 IS_SEEKABLE = 16, 877 /** 878 * the mask that specifies all the valid flags. 879 */ 880 MASK = 31, 881 /** 882 * the mask of the flags that are returned from 883 * g_io_channel_get_flags() 884 */ 885 GET_MASK = 31, 886 /** 887 * the mask of the flags that the user can modify 888 * with g_io_channel_set_flags() 889 */ 890 SET_MASK = 3, 891 } 892 alias GIOFlags IOFlags; 893 894 /** 895 * Stati returned by most of the #GIOFuncs functions. 896 */ 897 public enum GIOStatus 898 { 899 /** 900 * An error occurred. 901 */ 902 ERROR = 0, 903 /** 904 * Success. 905 */ 906 NORMAL = 1, 907 /** 908 * End of file. 909 */ 910 EOF = 2, 911 /** 912 * Resource temporarily unavailable. 913 */ 914 AGAIN = 3, 915 } 916 alias GIOStatus IOStatus; 917 918 /** 919 * Error codes returned by key file parsing. 920 */ 921 public enum GKeyFileError 922 { 923 /** 924 * the text being parsed was in 925 * an unknown encoding 926 */ 927 UNKNOWN_ENCODING = 0, 928 /** 929 * document was ill-formed 930 */ 931 PARSE = 1, 932 /** 933 * the file was not found 934 */ 935 NOT_FOUND = 2, 936 /** 937 * a requested key was not found 938 */ 939 KEY_NOT_FOUND = 3, 940 /** 941 * a requested group was not found 942 */ 943 GROUP_NOT_FOUND = 4, 944 /** 945 * a value could not be parsed 946 */ 947 INVALID_VALUE = 5, 948 } 949 alias GKeyFileError KeyFileError; 950 951 /** 952 * Flags which influence the parsing. 953 */ 954 public enum GKeyFileFlags 955 { 956 /** 957 * No flags, default behaviour 958 */ 959 NONE = 0, 960 /** 961 * Use this flag if you plan to write the 962 * (possibly modified) contents of the key file back to a file; 963 * otherwise all comments will be lost when the key file is 964 * written back. 965 */ 966 KEEP_COMMENTS = 1, 967 /** 968 * Use this flag if you plan to write the 969 * (possibly modified) contents of the key file back to a file; 970 * otherwise only the translations for the current language will be 971 * written back. 972 */ 973 KEEP_TRANSLATIONS = 2, 974 } 975 alias GKeyFileFlags KeyFileFlags; 976 977 /** 978 * Flags specifying the level of log messages. 979 * 980 * It is possible to change how GLib treats messages of the various 981 * levels using g_log_set_handler() and g_log_set_fatal_mask(). 982 */ 983 public enum GLogLevelFlags 984 { 985 /** 986 * internal flag 987 */ 988 FLAG_RECURSION = 1, 989 /** 990 * internal flag 991 */ 992 FLAG_FATAL = 2, 993 /** 994 * log level for errors, see g_error(). 995 * This level is also used for messages produced by g_assert(). 996 */ 997 LEVEL_ERROR = 4, 998 /** 999 * log level for critical warning messages, see 1000 * g_critical(). 1001 * This level is also used for messages produced by g_return_if_fail() 1002 * and g_return_val_if_fail(). 1003 */ 1004 LEVEL_CRITICAL = 8, 1005 /** 1006 * log level for warnings, see g_warning() 1007 */ 1008 LEVEL_WARNING = 16, 1009 /** 1010 * log level for messages, see g_message() 1011 */ 1012 LEVEL_MESSAGE = 32, 1013 /** 1014 * log level for informational messages, see g_info() 1015 */ 1016 LEVEL_INFO = 64, 1017 /** 1018 * log level for debug messages, see g_debug() 1019 */ 1020 LEVEL_DEBUG = 128, 1021 /** 1022 * a mask including all log levels 1023 */ 1024 LEVEL_MASK = -4, 1025 } 1026 alias GLogLevelFlags LogLevelFlags; 1027 1028 /** 1029 * Return values from #GLogWriterFuncs to indicate whether the given log entry 1030 * was successfully handled by the writer, or whether there was an error in 1031 * handling it (and hence a fallback writer should be used). 1032 * 1033 * If a #GLogWriterFunc ignores a log entry, it should return 1034 * %G_LOG_WRITER_HANDLED. 1035 * 1036 * Since: 2.50 1037 */ 1038 public enum GLogWriterOutput 1039 { 1040 /** 1041 * Log writer has handled the log entry. 1042 */ 1043 HANDLED = 1, 1044 /** 1045 * Log writer could not handle the log entry. 1046 */ 1047 UNHANDLED = 0, 1048 } 1049 alias GLogWriterOutput LogWriterOutput; 1050 1051 /** 1052 * A mixed enumerated type and flags field. You must specify one type 1053 * (string, strdup, boolean, tristate). Additionally, you may optionally 1054 * bitwise OR the type with the flag %G_MARKUP_COLLECT_OPTIONAL. 1055 * 1056 * It is likely that this enum will be extended in the future to 1057 * support other types. 1058 */ 1059 public enum GMarkupCollectType 1060 { 1061 /** 1062 * used to terminate the list of attributes 1063 * to collect 1064 */ 1065 INVALID = 0, 1066 /** 1067 * collect the string pointer directly from 1068 * the attribute_values[] array. Expects a parameter of type (const 1069 * char **). If %G_MARKUP_COLLECT_OPTIONAL is specified and the 1070 * attribute isn't present then the pointer will be set to %NULL 1071 */ 1072 STRING = 1, 1073 /** 1074 * as with %G_MARKUP_COLLECT_STRING, but 1075 * expects a parameter of type (char **) and g_strdup()s the 1076 * returned pointer. The pointer must be freed with g_free() 1077 */ 1078 STRDUP = 2, 1079 /** 1080 * expects a parameter of type (gboolean *) 1081 * and parses the attribute value as a boolean. Sets %FALSE if the 1082 * attribute isn't present. Valid boolean values consist of 1083 * (case-insensitive) "false", "f", "no", "n", "0" and "true", "t", 1084 * "yes", "y", "1" 1085 */ 1086 BOOLEAN = 3, 1087 /** 1088 * as with %G_MARKUP_COLLECT_BOOLEAN, but 1089 * in the case of a missing attribute a value is set that compares 1090 * equal to neither %FALSE nor %TRUE G_MARKUP_COLLECT_OPTIONAL is 1091 * implied 1092 */ 1093 TRISTATE = 4, 1094 /** 1095 * can be bitwise ORed with the other fields. 1096 * If present, allows the attribute not to appear. A default value 1097 * is set depending on what value type is used 1098 */ 1099 OPTIONAL = 65536, 1100 } 1101 alias GMarkupCollectType MarkupCollectType; 1102 1103 /** 1104 * Error codes returned by markup parsing. 1105 */ 1106 public enum GMarkupError 1107 { 1108 /** 1109 * text being parsed was not valid UTF-8 1110 */ 1111 BAD_UTF8 = 0, 1112 /** 1113 * document contained nothing, or only whitespace 1114 */ 1115 EMPTY = 1, 1116 /** 1117 * document was ill-formed 1118 */ 1119 PARSE = 2, 1120 /** 1121 * error should be set by #GMarkupParser 1122 * functions; element wasn't known 1123 */ 1124 UNKNOWN_ELEMENT = 3, 1125 /** 1126 * error should be set by #GMarkupParser 1127 * functions; attribute wasn't known 1128 */ 1129 UNKNOWN_ATTRIBUTE = 4, 1130 /** 1131 * error should be set by #GMarkupParser 1132 * functions; content was invalid 1133 */ 1134 INVALID_CONTENT = 5, 1135 /** 1136 * error should be set by #GMarkupParser 1137 * functions; a required attribute was missing 1138 */ 1139 MISSING_ATTRIBUTE = 6, 1140 } 1141 alias GMarkupError MarkupError; 1142 1143 /** 1144 * Flags that affect the behaviour of the parser. 1145 */ 1146 public enum GMarkupParseFlags 1147 { 1148 /** 1149 * flag you should not use 1150 */ 1151 DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1, 1152 /** 1153 * When this flag is set, CDATA marked 1154 * sections are not passed literally to the @passthrough function of 1155 * the parser. Instead, the content of the section (without the 1156 * `<![CDATA[` and `]]>`) is 1157 * passed to the @text function. This flag was added in GLib 2.12 1158 */ 1159 TREAT_CDATA_AS_TEXT = 2, 1160 /** 1161 * Normally errors caught by GMarkup 1162 * itself have line/column information prefixed to them to let the 1163 * caller know the location of the error. When this flag is set the 1164 * location information is also prefixed to errors generated by the 1165 * #GMarkupParser implementation functions 1166 */ 1167 PREFIX_ERROR_POSITION = 4, 1168 /** 1169 * Ignore (don't report) qualified 1170 * attributes and tags, along with their contents. A qualified 1171 * attribute or tag is one that contains ':' in its name (ie: is in 1172 * another namespace). Since: 2.40. 1173 */ 1174 IGNORE_QUALIFIED = 8, 1175 } 1176 alias GMarkupParseFlags MarkupParseFlags; 1177 1178 /** 1179 * Defines how a Unicode string is transformed in a canonical 1180 * form, standardizing such issues as whether a character with 1181 * an accent is represented as a base character and combining 1182 * accent or as a single precomposed character. Unicode strings 1183 * should generally be normalized before comparing them. 1184 */ 1185 public enum GNormalizeMode 1186 { 1187 /** 1188 * standardize differences that do not affect the 1189 * text content, such as the above-mentioned accent representation 1190 */ 1191 DEFAULT = 0, 1192 /** 1193 * another name for %G_NORMALIZE_DEFAULT 1194 */ 1195 NFD = 0, 1196 /** 1197 * like %G_NORMALIZE_DEFAULT, but with 1198 * composed forms rather than a maximally decomposed form 1199 */ 1200 DEFAULT_COMPOSE = 1, 1201 /** 1202 * another name for %G_NORMALIZE_DEFAULT_COMPOSE 1203 */ 1204 NFC = 1, 1205 /** 1206 * beyond %G_NORMALIZE_DEFAULT also standardize the 1207 * "compatibility" characters in Unicode, such as SUPERSCRIPT THREE 1208 * to the standard forms (in this case DIGIT THREE). Formatting 1209 * information may be lost but for most text operations such 1210 * characters should be considered the same 1211 */ 1212 ALL = 2, 1213 /** 1214 * another name for %G_NORMALIZE_ALL 1215 */ 1216 NFKD = 2, 1217 /** 1218 * like %G_NORMALIZE_ALL, but with composed 1219 * forms rather than a maximally decomposed form 1220 */ 1221 ALL_COMPOSE = 3, 1222 /** 1223 * another name for %G_NORMALIZE_ALL_COMPOSE 1224 */ 1225 NFKC = 3, 1226 } 1227 alias GNormalizeMode NormalizeMode; 1228 1229 /** 1230 * The possible statuses of a one-time initialization function 1231 * controlled by a #GOnce struct. 1232 * 1233 * Since: 2.4 1234 */ 1235 public enum GOnceStatus 1236 { 1237 /** 1238 * the function has not been called yet. 1239 */ 1240 NOTCALLED = 0, 1241 /** 1242 * the function call is currently in progress. 1243 */ 1244 PROGRESS = 1, 1245 /** 1246 * the function has been called. 1247 */ 1248 READY = 2, 1249 } 1250 alias GOnceStatus OnceStatus; 1251 1252 /** 1253 * The #GOptionArg enum values determine which type of extra argument the 1254 * options expect to find. If an option expects an extra argument, it can 1255 * be specified in several ways; with a short option: `-x arg`, with a long 1256 * option: `--name arg` or combined in a single argument: `--name=arg`. 1257 */ 1258 public enum GOptionArg 1259 { 1260 /** 1261 * No extra argument. This is useful for simple flags. 1262 */ 1263 NONE = 0, 1264 /** 1265 * The option takes a string argument. 1266 */ 1267 STRING = 1, 1268 /** 1269 * The option takes an integer argument. 1270 */ 1271 INT = 2, 1272 /** 1273 * The option provides a callback (of type 1274 * #GOptionArgFunc) to parse the extra argument. 1275 */ 1276 CALLBACK = 3, 1277 /** 1278 * The option takes a filename as argument. 1279 */ 1280 FILENAME = 4, 1281 /** 1282 * The option takes a string argument, multiple 1283 * uses of the option are collected into an array of strings. 1284 */ 1285 STRING_ARRAY = 5, 1286 /** 1287 * The option takes a filename as argument, 1288 * multiple uses of the option are collected into an array of strings. 1289 */ 1290 FILENAME_ARRAY = 6, 1291 /** 1292 * The option takes a double argument. The argument 1293 * can be formatted either for the user's locale or for the "C" locale. 1294 * Since 2.12 1295 */ 1296 DOUBLE = 7, 1297 /** 1298 * The option takes a 64-bit integer. Like 1299 * %G_OPTION_ARG_INT but for larger numbers. The number can be in 1300 * decimal base, or in hexadecimal (when prefixed with `0x`, for 1301 * example, `0xffffffff`). Since 2.12 1302 */ 1303 INT64 = 8, 1304 } 1305 alias GOptionArg OptionArg; 1306 1307 /** 1308 * Error codes returned by option parsing. 1309 */ 1310 public enum GOptionError 1311 { 1312 /** 1313 * An option was not known to the parser. 1314 * This error will only be reported, if the parser hasn't been instructed 1315 * to ignore unknown options, see g_option_context_set_ignore_unknown_options(). 1316 */ 1317 UNKNOWN_OPTION = 0, 1318 /** 1319 * A value couldn't be parsed. 1320 */ 1321 BAD_VALUE = 1, 1322 /** 1323 * A #GOptionArgFunc callback failed. 1324 */ 1325 FAILED = 2, 1326 } 1327 alias GOptionError OptionError; 1328 1329 /** 1330 * Flags which modify individual options. 1331 */ 1332 public enum GOptionFlags 1333 { 1334 /** 1335 * No flags. Since: 2.42. 1336 */ 1337 NONE = 0, 1338 /** 1339 * The option doesn't appear in `--help` output. 1340 */ 1341 HIDDEN = 1, 1342 /** 1343 * The option appears in the main section of the 1344 * `--help` output, even if it is defined in a group. 1345 */ 1346 IN_MAIN = 2, 1347 /** 1348 * For options of the %G_OPTION_ARG_NONE kind, this 1349 * flag indicates that the sense of the option is reversed. 1350 */ 1351 REVERSE = 4, 1352 /** 1353 * For options of the %G_OPTION_ARG_CALLBACK kind, 1354 * this flag indicates that the callback does not take any argument 1355 * (like a %G_OPTION_ARG_NONE option). Since 2.8 1356 */ 1357 NO_ARG = 8, 1358 /** 1359 * For options of the %G_OPTION_ARG_CALLBACK 1360 * kind, this flag indicates that the argument should be passed to the 1361 * callback in the GLib filename encoding rather than UTF-8. Since 2.8 1362 */ 1363 FILENAME = 16, 1364 /** 1365 * For options of the %G_OPTION_ARG_CALLBACK 1366 * kind, this flag indicates that the argument supply is optional. 1367 * If no argument is given then data of %GOptionParseFunc will be 1368 * set to NULL. Since 2.8 1369 */ 1370 OPTIONAL_ARG = 32, 1371 /** 1372 * This flag turns off the automatic conflict 1373 * resolution which prefixes long option names with `groupname-` if 1374 * there is a conflict. This option should only be used in situations 1375 * where aliasing is necessary to model some legacy commandline interface. 1376 * It is not safe to use this option, unless all option groups are under 1377 * your direct control. Since 2.8. 1378 */ 1379 NOALIAS = 64, 1380 } 1381 alias GOptionFlags OptionFlags; 1382 1383 /** 1384 * Flags specifying compile-time options. 1385 * 1386 * Since: 2.14 1387 */ 1388 public enum GRegexCompileFlags 1389 { 1390 /** 1391 * Letters in the pattern match both upper- and 1392 * lowercase letters. This option can be changed within a pattern 1393 * by a "(?i)" option setting. 1394 */ 1395 CASELESS = 1, 1396 /** 1397 * By default, GRegex treats the strings as consisting 1398 * of a single line of characters (even if it actually contains 1399 * newlines). The "start of line" metacharacter ("^") matches only 1400 * at the start of the string, while the "end of line" metacharacter 1401 * ("$") matches only at the end of the string, or before a terminating 1402 * newline (unless #G_REGEX_DOLLAR_ENDONLY is set). When 1403 * #G_REGEX_MULTILINE is set, the "start of line" and "end of line" 1404 * constructs match immediately following or immediately before any 1405 * newline in the string, respectively, as well as at the very start 1406 * and end. This can be changed within a pattern by a "(?m)" option 1407 * setting. 1408 */ 1409 MULTILINE = 2, 1410 /** 1411 * A dot metacharater (".") in the pattern matches all 1412 * characters, including newlines. Without it, newlines are excluded. 1413 * This option can be changed within a pattern by a ("?s") option setting. 1414 */ 1415 DOTALL = 4, 1416 /** 1417 * Whitespace data characters in the pattern are 1418 * totally ignored except when escaped or inside a character class. 1419 * Whitespace does not include the VT character (code 11). In addition, 1420 * characters between an unescaped "#" outside a character class and 1421 * the next newline character, inclusive, are also ignored. This can 1422 * be changed within a pattern by a "(?x)" option setting. 1423 */ 1424 EXTENDED = 8, 1425 /** 1426 * The pattern is forced to be "anchored", that is, 1427 * it is constrained to match only at the first matching point in the 1428 * string that is being searched. This effect can also be achieved by 1429 * appropriate constructs in the pattern itself such as the "^" 1430 * metacharater. 1431 */ 1432 ANCHORED = 16, 1433 /** 1434 * A dollar metacharacter ("$") in the pattern 1435 * matches only at the end of the string. Without this option, a 1436 * dollar also matches immediately before the final character if 1437 * it is a newline (but not before any other newlines). This option 1438 * is ignored if #G_REGEX_MULTILINE is set. 1439 */ 1440 DOLLAR_ENDONLY = 32, 1441 /** 1442 * Inverts the "greediness" of the quantifiers so that 1443 * they are not greedy by default, but become greedy if followed by "?". 1444 * It can also be set by a "(?U)" option setting within the pattern. 1445 */ 1446 UNGREEDY = 512, 1447 /** 1448 * Usually strings must be valid UTF-8 strings, using this 1449 * flag they are considered as a raw sequence of bytes. 1450 */ 1451 RAW = 2048, 1452 /** 1453 * Disables the use of numbered capturing 1454 * parentheses in the pattern. Any opening parenthesis that is not 1455 * followed by "?" behaves as if it were followed by "?:" but named 1456 * parentheses can still be used for capturing (and they acquire numbers 1457 * in the usual way). 1458 */ 1459 NO_AUTO_CAPTURE = 4096, 1460 /** 1461 * Optimize the regular expression. If the pattern will 1462 * be used many times, then it may be worth the effort to optimize it 1463 * to improve the speed of matches. 1464 */ 1465 OPTIMIZE = 8192, 1466 /** 1467 * Limits an unanchored pattern to match before (or at) the 1468 * first newline. Since: 2.34 1469 */ 1470 FIRSTLINE = 262144, 1471 /** 1472 * Names used to identify capturing subpatterns need not 1473 * be unique. This can be helpful for certain types of pattern when it 1474 * is known that only one instance of the named subpattern can ever be 1475 * matched. 1476 */ 1477 DUPNAMES = 524288, 1478 /** 1479 * Usually any newline character or character sequence is 1480 * recognized. If this option is set, the only recognized newline character 1481 * is '\r'. 1482 */ 1483 NEWLINE_CR = 1048576, 1484 /** 1485 * Usually any newline character or character sequence is 1486 * recognized. If this option is set, the only recognized newline character 1487 * is '\n'. 1488 */ 1489 NEWLINE_LF = 2097152, 1490 /** 1491 * Usually any newline character or character sequence is 1492 * recognized. If this option is set, the only recognized newline character 1493 * sequence is '\r\n'. 1494 */ 1495 NEWLINE_CRLF = 3145728, 1496 /** 1497 * Usually any newline character or character sequence 1498 * is recognized. If this option is set, the only recognized newline character 1499 * sequences are '\r', '\n', and '\r\n'. Since: 2.34 1500 */ 1501 NEWLINE_ANYCRLF = 5242880, 1502 /** 1503 * Usually any newline character or character sequence 1504 * is recognised. If this option is set, then "\R" only recognizes the newline 1505 * characters '\r', '\n' and '\r\n'. Since: 2.34 1506 */ 1507 BSR_ANYCRLF = 8388608, 1508 /** 1509 * Changes behaviour so that it is compatible with 1510 * JavaScript rather than PCRE. Since: 2.34 1511 */ 1512 JAVASCRIPT_COMPAT = 33554432, 1513 } 1514 alias GRegexCompileFlags RegexCompileFlags; 1515 1516 /** 1517 * Error codes returned by regular expressions functions. 1518 * 1519 * Since: 2.14 1520 */ 1521 public enum GRegexError 1522 { 1523 /** 1524 * Compilation of the regular expression failed. 1525 */ 1526 COMPILE = 0, 1527 /** 1528 * Optimization of the regular expression failed. 1529 */ 1530 OPTIMIZE = 1, 1531 /** 1532 * Replacement failed due to an ill-formed replacement 1533 * string. 1534 */ 1535 REPLACE = 2, 1536 /** 1537 * The match process failed. 1538 */ 1539 MATCH = 3, 1540 /** 1541 * Internal error of the regular expression engine. 1542 * Since 2.16 1543 */ 1544 INTERNAL = 4, 1545 /** 1546 * "\\" at end of pattern. Since 2.16 1547 */ 1548 STRAY_BACKSLASH = 101, 1549 /** 1550 * "\\c" at end of pattern. Since 2.16 1551 */ 1552 MISSING_CONTROL_CHAR = 102, 1553 /** 1554 * Unrecognized character follows "\\". 1555 * Since 2.16 1556 */ 1557 UNRECOGNIZED_ESCAPE = 103, 1558 /** 1559 * Numbers out of order in "{}" 1560 * quantifier. Since 2.16 1561 */ 1562 QUANTIFIERS_OUT_OF_ORDER = 104, 1563 /** 1564 * Number too big in "{}" quantifier. 1565 * Since 2.16 1566 */ 1567 QUANTIFIER_TOO_BIG = 105, 1568 /** 1569 * Missing terminating "]" for 1570 * character class. Since 2.16 1571 */ 1572 UNTERMINATED_CHARACTER_CLASS = 106, 1573 /** 1574 * Invalid escape sequence 1575 * in character class. Since 2.16 1576 */ 1577 INVALID_ESCAPE_IN_CHARACTER_CLASS = 107, 1578 /** 1579 * Range out of order in character class. 1580 * Since 2.16 1581 */ 1582 RANGE_OUT_OF_ORDER = 108, 1583 /** 1584 * Nothing to repeat. Since 2.16 1585 */ 1586 NOTHING_TO_REPEAT = 109, 1587 /** 1588 * Unrecognized character after "(?", 1589 * "(?<" or "(?P". Since 2.16 1590 */ 1591 UNRECOGNIZED_CHARACTER = 112, 1592 /** 1593 * POSIX named classes are 1594 * supported only within a class. Since 2.16 1595 */ 1596 POSIX_NAMED_CLASS_OUTSIDE_CLASS = 113, 1597 /** 1598 * Missing terminating ")" or ")" 1599 * without opening "(". Since 2.16 1600 */ 1601 UNMATCHED_PARENTHESIS = 114, 1602 /** 1603 * Reference to non-existent 1604 * subpattern. Since 2.16 1605 */ 1606 INEXISTENT_SUBPATTERN_REFERENCE = 115, 1607 /** 1608 * Missing terminating ")" after comment. 1609 * Since 2.16 1610 */ 1611 UNTERMINATED_COMMENT = 118, 1612 /** 1613 * Regular expression too large. 1614 * Since 2.16 1615 */ 1616 EXPRESSION_TOO_LARGE = 120, 1617 /** 1618 * Failed to get memory. Since 2.16 1619 */ 1620 MEMORY_ERROR = 121, 1621 /** 1622 * Lookbehind assertion is not 1623 * fixed length. Since 2.16 1624 */ 1625 VARIABLE_LENGTH_LOOKBEHIND = 125, 1626 /** 1627 * Malformed number or name after "(?(". 1628 * Since 2.16 1629 */ 1630 MALFORMED_CONDITION = 126, 1631 /** 1632 * Conditional group contains 1633 * more than two branches. Since 2.16 1634 */ 1635 TOO_MANY_CONDITIONAL_BRANCHES = 127, 1636 /** 1637 * Assertion expected after "(?(". 1638 * Since 2.16 1639 */ 1640 ASSERTION_EXPECTED = 128, 1641 /** 1642 * Unknown POSIX class name. 1643 * Since 2.16 1644 */ 1645 UNKNOWN_POSIX_CLASS_NAME = 130, 1646 /** 1647 * POSIX collating 1648 * elements are not supported. Since 2.16 1649 */ 1650 POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED = 131, 1651 /** 1652 * Character value in "\\x{...}" sequence 1653 * is too large. Since 2.16 1654 */ 1655 HEX_CODE_TOO_LARGE = 134, 1656 /** 1657 * Invalid condition "(?(0)". Since 2.16 1658 */ 1659 INVALID_CONDITION = 135, 1660 /** 1661 * \\C not allowed in 1662 * lookbehind assertion. Since 2.16 1663 */ 1664 SINGLE_BYTE_MATCH_IN_LOOKBEHIND = 136, 1665 /** 1666 * Recursive call could loop indefinitely. 1667 * Since 2.16 1668 */ 1669 INFINITE_LOOP = 140, 1670 /** 1671 * Missing terminator 1672 * in subpattern name. Since 2.16 1673 */ 1674 MISSING_SUBPATTERN_NAME_TERMINATOR = 142, 1675 /** 1676 * Two named subpatterns have 1677 * the same name. Since 2.16 1678 */ 1679 DUPLICATE_SUBPATTERN_NAME = 143, 1680 /** 1681 * Malformed "\\P" or "\\p" sequence. 1682 * Since 2.16 1683 */ 1684 MALFORMED_PROPERTY = 146, 1685 /** 1686 * Unknown property name after "\\P" or 1687 * "\\p". Since 2.16 1688 */ 1689 UNKNOWN_PROPERTY = 147, 1690 /** 1691 * Subpattern name is too long 1692 * (maximum 32 characters). Since 2.16 1693 */ 1694 SUBPATTERN_NAME_TOO_LONG = 148, 1695 /** 1696 * Too many named subpatterns (maximum 1697 * 10,000). Since 2.16 1698 */ 1699 TOO_MANY_SUBPATTERNS = 149, 1700 /** 1701 * Octal value is greater than "\\377". 1702 * Since 2.16 1703 */ 1704 INVALID_OCTAL_VALUE = 151, 1705 /** 1706 * "DEFINE" group contains more 1707 * than one branch. Since 2.16 1708 */ 1709 TOO_MANY_BRANCHES_IN_DEFINE = 154, 1710 /** 1711 * Repeating a "DEFINE" group is not allowed. 1712 * This error is never raised. Since: 2.16 Deprecated: 2.34 1713 */ 1714 DEFINE_REPETION = 155, 1715 /** 1716 * Inconsistent newline options. 1717 * Since 2.16 1718 */ 1719 INCONSISTENT_NEWLINE_OPTIONS = 156, 1720 /** 1721 * "\\g" is not followed by a braced, 1722 * angle-bracketed, or quoted name or number, or by a plain number. Since: 2.16 1723 */ 1724 MISSING_BACK_REFERENCE = 157, 1725 /** 1726 * relative reference must not be zero. Since: 2.34 1727 */ 1728 INVALID_RELATIVE_REFERENCE = 158, 1729 /** 1730 * the backtracing 1731 * control verb used does not allow an argument. Since: 2.34 1732 */ 1733 BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN = 159, 1734 /** 1735 * unknown backtracing 1736 * control verb. Since: 2.34 1737 */ 1738 UNKNOWN_BACKTRACKING_CONTROL_VERB = 160, 1739 /** 1740 * number is too big in escape sequence. Since: 2.34 1741 */ 1742 NUMBER_TOO_BIG = 161, 1743 /** 1744 * Missing subpattern name. Since: 2.34 1745 */ 1746 MISSING_SUBPATTERN_NAME = 162, 1747 /** 1748 * Missing digit. Since 2.34 1749 */ 1750 MISSING_DIGIT = 163, 1751 /** 1752 * In JavaScript compatibility mode, 1753 * "[" is an invalid data character. Since: 2.34 1754 */ 1755 INVALID_DATA_CHARACTER = 164, 1756 /** 1757 * different names for subpatterns of the 1758 * same number are not allowed. Since: 2.34 1759 */ 1760 EXTRA_SUBPATTERN_NAME = 165, 1761 /** 1762 * the backtracing control 1763 * verb requires an argument. Since: 2.34 1764 */ 1765 BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED = 166, 1766 /** 1767 * "\\c" must be followed by an ASCII 1768 * character. Since: 2.34 1769 */ 1770 INVALID_CONTROL_CHAR = 168, 1771 /** 1772 * "\\k" is not followed by a braced, angle-bracketed, or 1773 * quoted name. Since: 2.34 1774 */ 1775 MISSING_NAME = 169, 1776 /** 1777 * "\\N" is not supported in a class. Since: 2.34 1778 */ 1779 NOT_SUPPORTED_IN_CLASS = 171, 1780 /** 1781 * too many forward references. Since: 2.34 1782 */ 1783 TOO_MANY_FORWARD_REFERENCES = 172, 1784 /** 1785 * the name is too long in "(*MARK)", "(*PRUNE)", 1786 * "(*SKIP)", or "(*THEN)". Since: 2.34 1787 */ 1788 NAME_TOO_LONG = 175, 1789 /** 1790 * the character value in the \\u sequence is 1791 * too large. Since: 2.34 1792 */ 1793 CHARACTER_VALUE_TOO_LARGE = 176, 1794 } 1795 alias GRegexError RegexError; 1796 1797 /** 1798 * Flags specifying match-time options. 1799 * 1800 * Since: 2.14 1801 */ 1802 public enum GRegexMatchFlags 1803 { 1804 /** 1805 * The pattern is forced to be "anchored", that is, 1806 * it is constrained to match only at the first matching point in the 1807 * string that is being searched. This effect can also be achieved by 1808 * appropriate constructs in the pattern itself such as the "^" 1809 * metacharater. 1810 */ 1811 ANCHORED = 16, 1812 /** 1813 * Specifies that first character of the string is 1814 * not the beginning of a line, so the circumflex metacharacter should 1815 * not match before it. Setting this without #G_REGEX_MULTILINE (at 1816 * compile time) causes circumflex never to match. This option affects 1817 * only the behaviour of the circumflex metacharacter, it does not 1818 * affect "\A". 1819 */ 1820 NOTBOL = 128, 1821 /** 1822 * Specifies that the end of the subject string is 1823 * not the end of a line, so the dollar metacharacter should not match 1824 * it nor (except in multiline mode) a newline immediately before it. 1825 * Setting this without #G_REGEX_MULTILINE (at compile time) causes 1826 * dollar never to match. This option affects only the behaviour of 1827 * the dollar metacharacter, it does not affect "\Z" or "\z". 1828 */ 1829 NOTEOL = 256, 1830 /** 1831 * An empty string is not considered to be a valid 1832 * match if this option is set. If there are alternatives in the pattern, 1833 * they are tried. If all the alternatives match the empty string, the 1834 * entire match fails. For example, if the pattern "a?b?" is applied to 1835 * a string not beginning with "a" or "b", it matches the empty string 1836 * at the start of the string. With this flag set, this match is not 1837 * valid, so GRegex searches further into the string for occurrences 1838 * of "a" or "b". 1839 */ 1840 NOTEMPTY = 1024, 1841 /** 1842 * Turns on the partial matching feature, for more 1843 * documentation on partial matching see g_match_info_is_partial_match(). 1844 */ 1845 PARTIAL = 32768, 1846 /** 1847 * Overrides the newline definition set when 1848 * creating a new #GRegex, setting the '\r' character as line terminator. 1849 */ 1850 NEWLINE_CR = 1048576, 1851 /** 1852 * Overrides the newline definition set when 1853 * creating a new #GRegex, setting the '\n' character as line terminator. 1854 */ 1855 NEWLINE_LF = 2097152, 1856 /** 1857 * Overrides the newline definition set when 1858 * creating a new #GRegex, setting the '\r\n' characters sequence as line terminator. 1859 */ 1860 NEWLINE_CRLF = 3145728, 1861 /** 1862 * Overrides the newline definition set when 1863 * creating a new #GRegex, any Unicode newline sequence 1864 * is recognised as a newline. These are '\r', '\n' and '\rn', and the 1865 * single characters U+000B LINE TABULATION, U+000C FORM FEED (FF), 1866 * U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and 1867 * U+2029 PARAGRAPH SEPARATOR. 1868 */ 1869 NEWLINE_ANY = 4194304, 1870 /** 1871 * Overrides the newline definition set when 1872 * creating a new #GRegex; any '\r', '\n', or '\r\n' character sequence 1873 * is recognized as a newline. Since: 2.34 1874 */ 1875 NEWLINE_ANYCRLF = 5242880, 1876 /** 1877 * Overrides the newline definition for "\R" set when 1878 * creating a new #GRegex; only '\r', '\n', or '\r\n' character sequences 1879 * are recognized as a newline by "\R". Since: 2.34 1880 */ 1881 BSR_ANYCRLF = 8388608, 1882 /** 1883 * Overrides the newline definition for "\R" set when 1884 * creating a new #GRegex; any Unicode newline character or character sequence 1885 * are recognized as a newline by "\R". These are '\r', '\n' and '\rn', and the 1886 * single characters U+000B LINE TABULATION, U+000C FORM FEED (FF), 1887 * U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and 1888 * U+2029 PARAGRAPH SEPARATOR. Since: 2.34 1889 */ 1890 BSR_ANY = 16777216, 1891 /** 1892 * An alias for #G_REGEX_MATCH_PARTIAL. Since: 2.34 1893 */ 1894 PARTIAL_SOFT = 32768, 1895 /** 1896 * Turns on the partial matching feature. In contrast to 1897 * to #G_REGEX_MATCH_PARTIAL_SOFT, this stops matching as soon as a partial match 1898 * is found, without continuing to search for a possible complete match. See 1899 * g_match_info_is_partial_match() for more information. Since: 2.34 1900 */ 1901 PARTIAL_HARD = 134217728, 1902 /** 1903 * Like #G_REGEX_MATCH_NOTEMPTY, but only applied to 1904 * the start of the matched string. For anchored 1905 * patterns this can only happen for pattern containing "\K". Since: 2.34 1906 */ 1907 NOTEMPTY_ATSTART = 268435456, 1908 } 1909 alias GRegexMatchFlags RegexMatchFlags; 1910 1911 /** 1912 * An enumeration specifying the base position for a 1913 * g_io_channel_seek_position() operation. 1914 */ 1915 public enum GSeekType 1916 { 1917 /** 1918 * the current position in the file. 1919 */ 1920 CUR = 0, 1921 /** 1922 * the start of the file. 1923 */ 1924 SET = 1, 1925 /** 1926 * the end of the file. 1927 */ 1928 END = 2, 1929 } 1930 alias GSeekType SeekType; 1931 1932 /** 1933 * Error codes returned by shell functions. 1934 */ 1935 public enum GShellError 1936 { 1937 /** 1938 * Mismatched or otherwise mangled quoting. 1939 */ 1940 BAD_QUOTING = 0, 1941 /** 1942 * String to be parsed was empty. 1943 */ 1944 EMPTY_STRING = 1, 1945 /** 1946 * Some other error. 1947 */ 1948 FAILED = 2, 1949 } 1950 alias GShellError ShellError; 1951 1952 public enum GSliceConfig 1953 { 1954 ALWAYS_MALLOC = 1, 1955 BYPASS_MAGAZINES = 2, 1956 WORKING_SET_MSECS = 3, 1957 COLOR_INCREMENT = 4, 1958 CHUNK_SIZES = 5, 1959 CONTENTION_COUNTER = 6, 1960 } 1961 alias GSliceConfig SliceConfig; 1962 1963 /** 1964 * Error codes returned by spawning processes. 1965 */ 1966 public enum GSpawnError 1967 { 1968 /** 1969 * Fork failed due to lack of memory. 1970 */ 1971 FORK = 0, 1972 /** 1973 * Read or select on pipes failed. 1974 */ 1975 READ = 1, 1976 /** 1977 * Changing to working directory failed. 1978 */ 1979 CHDIR = 2, 1980 /** 1981 * execv() returned `EACCES` 1982 */ 1983 ACCES = 3, 1984 /** 1985 * execv() returned `EPERM` 1986 */ 1987 PERM = 4, 1988 /** 1989 * execv() returned `E2BIG` 1990 */ 1991 TOO_BIG = 5, 1992 /** 1993 * execv() returned `ENOEXEC` 1994 */ 1995 NOEXEC = 6, 1996 /** 1997 * execv() returned `ENAMETOOLONG` 1998 */ 1999 NAMETOOLONG = 7, 2000 /** 2001 * execv() returned `ENOENT` 2002 */ 2003 NOENT = 8, 2004 /** 2005 * execv() returned `ENOMEM` 2006 */ 2007 NOMEM = 9, 2008 /** 2009 * execv() returned `ENOTDIR` 2010 */ 2011 NOTDIR = 10, 2012 /** 2013 * execv() returned `ELOOP` 2014 */ 2015 LOOP = 11, 2016 /** 2017 * execv() returned `ETXTBUSY` 2018 */ 2019 TXTBUSY = 12, 2020 /** 2021 * execv() returned `EIO` 2022 */ 2023 IO = 13, 2024 /** 2025 * execv() returned `ENFILE` 2026 */ 2027 NFILE = 14, 2028 /** 2029 * execv() returned `EMFILE` 2030 */ 2031 MFILE = 15, 2032 /** 2033 * execv() returned `EINVAL` 2034 */ 2035 INVAL = 16, 2036 /** 2037 * execv() returned `EISDIR` 2038 */ 2039 ISDIR = 17, 2040 /** 2041 * execv() returned `ELIBBAD` 2042 */ 2043 LIBBAD = 18, 2044 /** 2045 * Some other fatal failure, 2046 * `error->message` should explain. 2047 */ 2048 FAILED = 19, 2049 } 2050 alias GSpawnError SpawnError; 2051 2052 /** 2053 * Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes(). 2054 */ 2055 public enum GSpawnFlags 2056 { 2057 /** 2058 * no flags, default behaviour 2059 */ 2060 DEFAULT = 0, 2061 /** 2062 * the parent's open file descriptors will 2063 * be inherited by the child; otherwise all descriptors except stdin, 2064 * stdout and stderr will be closed before calling exec() in the child. 2065 */ 2066 LEAVE_DESCRIPTORS_OPEN = 1, 2067 /** 2068 * the child will not be automatically reaped; 2069 * you must use g_child_watch_add() yourself (or call waitpid() or handle 2070 * `SIGCHLD` yourself), or the child will become a zombie. 2071 */ 2072 DO_NOT_REAP_CHILD = 2, 2073 /** 2074 * `argv[0]` need not be an absolute path, it will be 2075 * looked for in the user's `PATH`. 2076 */ 2077 SEARCH_PATH = 4, 2078 /** 2079 * the child's standard output will be discarded, 2080 * instead of going to the same location as the parent's standard output. 2081 */ 2082 STDOUT_TO_DEV_NULL = 8, 2083 /** 2084 * the child's standard error will be discarded. 2085 */ 2086 STDERR_TO_DEV_NULL = 16, 2087 /** 2088 * the child will inherit the parent's standard 2089 * input (by default, the child's standard input is attached to `/dev/null`). 2090 */ 2091 CHILD_INHERITS_STDIN = 32, 2092 /** 2093 * the first element of `argv` is the file to 2094 * execute, while the remaining elements are the actual argument vector 2095 * to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]` 2096 * as the file to execute, and passes all of `argv` to the child. 2097 */ 2098 FILE_AND_ARGV_ZERO = 64, 2099 /** 2100 * if `argv[0]` is not an abolute path, 2101 * it will be looked for in the `PATH` from the passed child environment. 2102 * Since: 2.34 2103 */ 2104 SEARCH_PATH_FROM_ENVP = 128, 2105 /** 2106 * create all pipes with the `O_CLOEXEC` flag set. 2107 * Since: 2.40 2108 */ 2109 CLOEXEC_PIPES = 256, 2110 } 2111 alias GSpawnFlags SpawnFlags; 2112 2113 /** 2114 * The type of file to return the filename for, when used with 2115 * g_test_build_filename(). 2116 * 2117 * These two options correspond rather directly to the 'dist' and 2118 * 'built' terminology that automake uses and are explicitly used to 2119 * distinguish between the 'srcdir' and 'builddir' being separate. All 2120 * files in your project should either be dist (in the 2121 * `EXTRA_DIST` or `dist_schema_DATA` 2122 * sense, in which case they will always be in the srcdir) or built (in 2123 * the `BUILT_SOURCES` sense, in which case they will 2124 * always be in the builddir). 2125 * 2126 * Note: as a general rule of automake, files that are generated only as 2127 * part of the build-from-git process (but then are distributed with the 2128 * tarball) always go in srcdir (even if doing a srcdir != builddir 2129 * build from git) and are considered as distributed files. 2130 * 2131 * Since: 2.38 2132 */ 2133 public enum GTestFileType 2134 { 2135 /** 2136 * a file that was included in the distribution tarball 2137 */ 2138 DIST = 0, 2139 /** 2140 * a file that was built on the compiling machine 2141 */ 2142 BUILT = 1, 2143 } 2144 alias GTestFileType TestFileType; 2145 2146 public enum GTestLogType 2147 { 2148 NONE = 0, 2149 ERROR = 1, 2150 START_BINARY = 2, 2151 LIST_CASE = 3, 2152 SKIP_CASE = 4, 2153 START_CASE = 5, 2154 STOP_CASE = 6, 2155 MIN_RESULT = 7, 2156 MAX_RESULT = 8, 2157 MESSAGE = 9, 2158 START_SUITE = 10, 2159 STOP_SUITE = 11, 2160 } 2161 alias GTestLogType TestLogType; 2162 2163 /** 2164 * Flags to pass to g_test_trap_subprocess() to control input and output. 2165 * 2166 * Note that in contrast with g_test_trap_fork(), the default is to 2167 * not show stdout and stderr. 2168 */ 2169 public enum GTestSubprocessFlags 2170 { 2171 /** 2172 * If this flag is given, the child 2173 * process will inherit the parent's stdin. Otherwise, the child's 2174 * stdin is redirected to `/dev/null`. 2175 */ 2176 STDIN = 1, 2177 /** 2178 * If this flag is given, the child 2179 * process will inherit the parent's stdout. Otherwise, the child's 2180 * stdout will not be visible, but it will be captured to allow 2181 * later tests with g_test_trap_assert_stdout(). 2182 */ 2183 STDOUT = 2, 2184 /** 2185 * If this flag is given, the child 2186 * process will inherit the parent's stderr. Otherwise, the child's 2187 * stderr will not be visible, but it will be captured to allow 2188 * later tests with g_test_trap_assert_stderr(). 2189 */ 2190 STDERR = 4, 2191 } 2192 alias GTestSubprocessFlags TestSubprocessFlags; 2193 2194 /** 2195 * Test traps are guards around forked tests. 2196 * These flags determine what traps to set. 2197 * 2198 * Deprecated: #GTestTrapFlags is used only with g_test_trap_fork(), 2199 * which is deprecated. g_test_trap_subprocess() uses 2200 * #GTestTrapSubprocessFlags. 2201 */ 2202 public enum GTestTrapFlags 2203 { 2204 /** 2205 * Redirect stdout of the test child to 2206 * `/dev/null` so it cannot be observed on the console during test 2207 * runs. The actual output is still captured though to allow later 2208 * tests with g_test_trap_assert_stdout(). 2209 */ 2210 SILENCE_STDOUT = 128, 2211 /** 2212 * Redirect stderr of the test child to 2213 * `/dev/null` so it cannot be observed on the console during test 2214 * runs. The actual output is still captured though to allow later 2215 * tests with g_test_trap_assert_stderr(). 2216 */ 2217 SILENCE_STDERR = 256, 2218 /** 2219 * If this flag is given, stdin of the 2220 * child process is shared with stdin of its parent process. 2221 * It is redirected to `/dev/null` otherwise. 2222 */ 2223 INHERIT_STDIN = 512, 2224 } 2225 alias GTestTrapFlags TestTrapFlags; 2226 2227 /** 2228 * Possible errors of thread related functions. 2229 */ 2230 public enum GThreadError 2231 { 2232 /** 2233 * a thread couldn't be created due to resource 2234 * shortage. Try again later. 2235 */ 2236 THREAD_ERROR_AGAIN = 0, 2237 } 2238 alias GThreadError ThreadError; 2239 2240 /** 2241 * Disambiguates a given time in two ways. 2242 * 2243 * First, specifies if the given time is in universal or local time. 2244 * 2245 * Second, if the time is in local time, specifies if it is local 2246 * standard time or local daylight time. This is important for the case 2247 * where the same local time occurs twice (during daylight savings time 2248 * transitions, for example). 2249 */ 2250 public enum GTimeType 2251 { 2252 /** 2253 * the time is in local standard time 2254 */ 2255 STANDARD = 0, 2256 /** 2257 * the time is in local daylight time 2258 */ 2259 DAYLIGHT = 1, 2260 /** 2261 * the time is in UTC 2262 */ 2263 UNIVERSAL = 2, 2264 } 2265 alias GTimeType TimeType; 2266 2267 /** 2268 * The possible types of token returned from each 2269 * g_scanner_get_next_token() call. 2270 */ 2271 public enum GTokenType 2272 { 2273 /** 2274 * the end of the file 2275 */ 2276 EOF = 0, 2277 /** 2278 * a '(' character 2279 */ 2280 LEFT_PAREN = 40, 2281 /** 2282 * a ')' character 2283 */ 2284 RIGHT_PAREN = 41, 2285 /** 2286 * a '{' character 2287 */ 2288 LEFT_CURLY = 123, 2289 /** 2290 * a '}' character 2291 */ 2292 RIGHT_CURLY = 125, 2293 /** 2294 * a '[' character 2295 */ 2296 LEFT_BRACE = 91, 2297 /** 2298 * a ']' character 2299 */ 2300 RIGHT_BRACE = 93, 2301 /** 2302 * a '=' character 2303 */ 2304 EQUAL_SIGN = 61, 2305 /** 2306 * a ',' character 2307 */ 2308 COMMA = 44, 2309 /** 2310 * not a token 2311 */ 2312 NONE = 256, 2313 /** 2314 * an error occurred 2315 */ 2316 ERROR = 257, 2317 /** 2318 * a character 2319 */ 2320 CHAR = 258, 2321 /** 2322 * a binary integer 2323 */ 2324 BINARY = 259, 2325 /** 2326 * an octal integer 2327 */ 2328 OCTAL = 260, 2329 /** 2330 * an integer 2331 */ 2332 INT = 261, 2333 /** 2334 * a hex integer 2335 */ 2336 HEX = 262, 2337 /** 2338 * a floating point number 2339 */ 2340 FLOAT = 263, 2341 /** 2342 * a string 2343 */ 2344 STRING = 264, 2345 /** 2346 * a symbol 2347 */ 2348 SYMBOL = 265, 2349 /** 2350 * an identifier 2351 */ 2352 IDENTIFIER = 266, 2353 /** 2354 * a null identifier 2355 */ 2356 IDENTIFIER_NULL = 267, 2357 /** 2358 * one line comment 2359 */ 2360 COMMENT_SINGLE = 268, 2361 /** 2362 * multi line comment 2363 */ 2364 COMMENT_MULTI = 269, 2365 } 2366 alias GTokenType TokenType; 2367 2368 /** 2369 * Specifies which nodes are visited during several of the tree 2370 * functions, including g_node_traverse() and g_node_find(). 2371 */ 2372 public enum GTraverseFlags 2373 { 2374 /** 2375 * only leaf nodes should be visited. This name has 2376 * been introduced in 2.6, for older version use 2377 * %G_TRAVERSE_LEAFS. 2378 */ 2379 LEAVES = 1, 2380 /** 2381 * only non-leaf nodes should be visited. This 2382 * name has been introduced in 2.6, for older 2383 * version use %G_TRAVERSE_NON_LEAFS. 2384 */ 2385 NON_LEAVES = 2, 2386 /** 2387 * all nodes should be visited. 2388 */ 2389 ALL = 3, 2390 /** 2391 * a mask of all traverse flags. 2392 */ 2393 MASK = 3, 2394 /** 2395 * identical to %G_TRAVERSE_LEAVES. 2396 */ 2397 LEAFS = 1, 2398 /** 2399 * identical to %G_TRAVERSE_NON_LEAVES. 2400 */ 2401 NON_LEAFS = 2, 2402 } 2403 alias GTraverseFlags TraverseFlags; 2404 2405 /** 2406 * Specifies the type of traveral performed by g_tree_traverse(), 2407 * g_node_traverse() and g_node_find(). The different orders are 2408 * illustrated here: 2409 * - In order: A, B, C, D, E, F, G, H, I 2410 * ![](Sorted_binary_tree_inorder.svg) 2411 * - Pre order: F, B, A, D, C, E, G, I, H 2412 * ![](Sorted_binary_tree_preorder.svg) 2413 * - Post order: A, C, E, D, B, H, I, G, F 2414 * ![](Sorted_binary_tree_postorder.svg) 2415 * - Level order: F, B, G, A, D, I, C, E, H 2416 * ![](Sorted_binary_tree_breadth-first_traversal.svg) 2417 */ 2418 public enum GTraverseType 2419 { 2420 /** 2421 * vists a node's left child first, then the node itself, 2422 * then its right child. This is the one to use if you 2423 * want the output sorted according to the compare 2424 * function. 2425 */ 2426 IN_ORDER = 0, 2427 /** 2428 * visits a node, then its children. 2429 */ 2430 PRE_ORDER = 1, 2431 /** 2432 * visits the node's children, then the node itself. 2433 */ 2434 POST_ORDER = 2, 2435 /** 2436 * is not implemented for 2437 * [balanced binary trees][glib-Balanced-Binary-Trees]. 2438 * For [n-ary trees][glib-N-ary-Trees], it 2439 * vists the root node first, then its children, then 2440 * its grandchildren, and so on. Note that this is less 2441 * efficient than the other orders. 2442 */ 2443 LEVEL_ORDER = 3, 2444 } 2445 alias GTraverseType TraverseType; 2446 2447 /** 2448 * These are the possible line break classifications. 2449 * 2450 * Since new unicode versions may add new types here, applications should be ready 2451 * to handle unknown values. They may be regarded as %G_UNICODE_BREAK_UNKNOWN. 2452 * 2453 * See [Unicode Line Breaking Algorithm](http://www.unicode.org/unicode/reports/tr14/). 2454 */ 2455 public enum GUnicodeBreakType 2456 { 2457 /** 2458 * Mandatory Break (BK) 2459 */ 2460 MANDATORY = 0, 2461 /** 2462 * Carriage Return (CR) 2463 */ 2464 CARRIAGE_RETURN = 1, 2465 /** 2466 * Line Feed (LF) 2467 */ 2468 LINE_FEED = 2, 2469 /** 2470 * Attached Characters and Combining Marks (CM) 2471 */ 2472 COMBINING_MARK = 3, 2473 /** 2474 * Surrogates (SG) 2475 */ 2476 SURROGATE = 4, 2477 /** 2478 * Zero Width Space (ZW) 2479 */ 2480 ZERO_WIDTH_SPACE = 5, 2481 /** 2482 * Inseparable (IN) 2483 */ 2484 INSEPARABLE = 6, 2485 /** 2486 * Non-breaking ("Glue") (GL) 2487 */ 2488 NON_BREAKING_GLUE = 7, 2489 /** 2490 * Contingent Break Opportunity (CB) 2491 */ 2492 CONTINGENT = 8, 2493 /** 2494 * Space (SP) 2495 */ 2496 SPACE = 9, 2497 /** 2498 * Break Opportunity After (BA) 2499 */ 2500 AFTER = 10, 2501 /** 2502 * Break Opportunity Before (BB) 2503 */ 2504 BEFORE = 11, 2505 /** 2506 * Break Opportunity Before and After (B2) 2507 */ 2508 BEFORE_AND_AFTER = 12, 2509 /** 2510 * Hyphen (HY) 2511 */ 2512 HYPHEN = 13, 2513 /** 2514 * Nonstarter (NS) 2515 */ 2516 NON_STARTER = 14, 2517 /** 2518 * Opening Punctuation (OP) 2519 */ 2520 OPEN_PUNCTUATION = 15, 2521 /** 2522 * Closing Punctuation (CL) 2523 */ 2524 CLOSE_PUNCTUATION = 16, 2525 /** 2526 * Ambiguous Quotation (QU) 2527 */ 2528 QUOTATION = 17, 2529 /** 2530 * Exclamation/Interrogation (EX) 2531 */ 2532 EXCLAMATION = 18, 2533 /** 2534 * Ideographic (ID) 2535 */ 2536 IDEOGRAPHIC = 19, 2537 /** 2538 * Numeric (NU) 2539 */ 2540 NUMERIC = 20, 2541 /** 2542 * Infix Separator (Numeric) (IS) 2543 */ 2544 INFIX_SEPARATOR = 21, 2545 /** 2546 * Symbols Allowing Break After (SY) 2547 */ 2548 SYMBOL = 22, 2549 /** 2550 * Ordinary Alphabetic and Symbol Characters (AL) 2551 */ 2552 ALPHABETIC = 23, 2553 /** 2554 * Prefix (Numeric) (PR) 2555 */ 2556 PREFIX = 24, 2557 /** 2558 * Postfix (Numeric) (PO) 2559 */ 2560 POSTFIX = 25, 2561 /** 2562 * Complex Content Dependent (South East Asian) (SA) 2563 */ 2564 COMPLEX_CONTEXT = 26, 2565 /** 2566 * Ambiguous (Alphabetic or Ideographic) (AI) 2567 */ 2568 AMBIGUOUS = 27, 2569 /** 2570 * Unknown (XX) 2571 */ 2572 UNKNOWN = 28, 2573 /** 2574 * Next Line (NL) 2575 */ 2576 NEXT_LINE = 29, 2577 /** 2578 * Word Joiner (WJ) 2579 */ 2580 WORD_JOINER = 30, 2581 /** 2582 * Hangul L Jamo (JL) 2583 */ 2584 HANGUL_L_JAMO = 31, 2585 /** 2586 * Hangul V Jamo (JV) 2587 */ 2588 HANGUL_V_JAMO = 32, 2589 /** 2590 * Hangul T Jamo (JT) 2591 */ 2592 HANGUL_T_JAMO = 33, 2593 /** 2594 * Hangul LV Syllable (H2) 2595 */ 2596 HANGUL_LV_SYLLABLE = 34, 2597 /** 2598 * Hangul LVT Syllable (H3) 2599 */ 2600 HANGUL_LVT_SYLLABLE = 35, 2601 /** 2602 * Closing Parenthesis (CP). Since 2.28 2603 */ 2604 CLOSE_PARANTHESIS = 36, 2605 /** 2606 * Conditional Japanese Starter (CJ). Since: 2.32 2607 */ 2608 CONDITIONAL_JAPANESE_STARTER = 37, 2609 /** 2610 * Hebrew Letter (HL). Since: 2.32 2611 */ 2612 HEBREW_LETTER = 38, 2613 /** 2614 * Regional Indicator (RI). Since: 2.36 2615 */ 2616 REGIONAL_INDICATOR = 39, 2617 /** 2618 * Emoji Base (EB). Since: 2.50 2619 */ 2620 EMOJI_BASE = 40, 2621 /** 2622 * Emoji Modifier (EM). Since: 2.50 2623 */ 2624 EMOJI_MODIFIER = 41, 2625 /** 2626 * Zero Width Joiner (ZWJ). Since: 2.50 2627 */ 2628 ZERO_WIDTH_JOINER = 42, 2629 } 2630 alias GUnicodeBreakType UnicodeBreakType; 2631 2632 /** 2633 * The #GUnicodeScript enumeration identifies different writing 2634 * systems. The values correspond to the names as defined in the 2635 * Unicode standard. The enumeration has been added in GLib 2.14, 2636 * and is interchangeable with #PangoScript. 2637 * 2638 * Note that new types may be added in the future. Applications 2639 * should be ready to handle unknown values. 2640 * See [Unicode Standard Annex #24: Script names](http://www.unicode.org/reports/tr24/). 2641 */ 2642 public enum GUnicodeScript 2643 { 2644 /** 2645 * a value never returned from g_unichar_get_script() 2646 */ 2647 INVALID_CODE = -1, 2648 /** 2649 * a character used by multiple different scripts 2650 */ 2651 COMMON = 0, 2652 /** 2653 * a mark glyph that takes its script from the 2654 * base glyph to which it is attached 2655 */ 2656 INHERITED = 1, 2657 /** 2658 * Arabic 2659 */ 2660 ARABIC = 2, 2661 /** 2662 * Armenian 2663 */ 2664 ARMENIAN = 3, 2665 /** 2666 * Bengali 2667 */ 2668 BENGALI = 4, 2669 /** 2670 * Bopomofo 2671 */ 2672 BOPOMOFO = 5, 2673 /** 2674 * Cherokee 2675 */ 2676 CHEROKEE = 6, 2677 /** 2678 * Coptic 2679 */ 2680 COPTIC = 7, 2681 /** 2682 * Cyrillic 2683 */ 2684 CYRILLIC = 8, 2685 /** 2686 * Deseret 2687 */ 2688 DESERET = 9, 2689 /** 2690 * Devanagari 2691 */ 2692 DEVANAGARI = 10, 2693 /** 2694 * Ethiopic 2695 */ 2696 ETHIOPIC = 11, 2697 /** 2698 * Georgian 2699 */ 2700 GEORGIAN = 12, 2701 /** 2702 * Gothic 2703 */ 2704 GOTHIC = 13, 2705 /** 2706 * Greek 2707 */ 2708 GREEK = 14, 2709 /** 2710 * Gujarati 2711 */ 2712 GUJARATI = 15, 2713 /** 2714 * Gurmukhi 2715 */ 2716 GURMUKHI = 16, 2717 /** 2718 * Han 2719 */ 2720 HAN = 17, 2721 /** 2722 * Hangul 2723 */ 2724 HANGUL = 18, 2725 /** 2726 * Hebrew 2727 */ 2728 HEBREW = 19, 2729 /** 2730 * Hiragana 2731 */ 2732 HIRAGANA = 20, 2733 /** 2734 * Kannada 2735 */ 2736 KANNADA = 21, 2737 /** 2738 * Katakana 2739 */ 2740 KATAKANA = 22, 2741 /** 2742 * Khmer 2743 */ 2744 KHMER = 23, 2745 /** 2746 * Lao 2747 */ 2748 LAO = 24, 2749 /** 2750 * Latin 2751 */ 2752 LATIN = 25, 2753 /** 2754 * Malayalam 2755 */ 2756 MALAYALAM = 26, 2757 /** 2758 * Mongolian 2759 */ 2760 MONGOLIAN = 27, 2761 /** 2762 * Myanmar 2763 */ 2764 MYANMAR = 28, 2765 /** 2766 * Ogham 2767 */ 2768 OGHAM = 29, 2769 /** 2770 * Old Italic 2771 */ 2772 OLD_ITALIC = 30, 2773 /** 2774 * Oriya 2775 */ 2776 ORIYA = 31, 2777 /** 2778 * Runic 2779 */ 2780 RUNIC = 32, 2781 /** 2782 * Sinhala 2783 */ 2784 SINHALA = 33, 2785 /** 2786 * Syriac 2787 */ 2788 SYRIAC = 34, 2789 /** 2790 * Tamil 2791 */ 2792 TAMIL = 35, 2793 /** 2794 * Telugu 2795 */ 2796 TELUGU = 36, 2797 /** 2798 * Thaana 2799 */ 2800 THAANA = 37, 2801 /** 2802 * Thai 2803 */ 2804 THAI = 38, 2805 /** 2806 * Tibetan 2807 */ 2808 TIBETAN = 39, 2809 /** 2810 * Canadian Aboriginal 2811 */ 2812 CANADIAN_ABORIGINAL = 40, 2813 /** 2814 * Yi 2815 */ 2816 YI = 41, 2817 /** 2818 * Tagalog 2819 */ 2820 TAGALOG = 42, 2821 /** 2822 * Hanunoo 2823 */ 2824 HANUNOO = 43, 2825 /** 2826 * Buhid 2827 */ 2828 BUHID = 44, 2829 /** 2830 * Tagbanwa 2831 */ 2832 TAGBANWA = 45, 2833 /** 2834 * Braille 2835 */ 2836 BRAILLE = 46, 2837 /** 2838 * Cypriot 2839 */ 2840 CYPRIOT = 47, 2841 /** 2842 * Limbu 2843 */ 2844 LIMBU = 48, 2845 /** 2846 * Osmanya 2847 */ 2848 OSMANYA = 49, 2849 /** 2850 * Shavian 2851 */ 2852 SHAVIAN = 50, 2853 /** 2854 * Linear B 2855 */ 2856 LINEAR_B = 51, 2857 /** 2858 * Tai Le 2859 */ 2860 TAI_LE = 52, 2861 /** 2862 * Ugaritic 2863 */ 2864 UGARITIC = 53, 2865 /** 2866 * New Tai Lue 2867 */ 2868 NEW_TAI_LUE = 54, 2869 /** 2870 * Buginese 2871 */ 2872 BUGINESE = 55, 2873 /** 2874 * Glagolitic 2875 */ 2876 GLAGOLITIC = 56, 2877 /** 2878 * Tifinagh 2879 */ 2880 TIFINAGH = 57, 2881 /** 2882 * Syloti Nagri 2883 */ 2884 SYLOTI_NAGRI = 58, 2885 /** 2886 * Old Persian 2887 */ 2888 OLD_PERSIAN = 59, 2889 /** 2890 * Kharoshthi 2891 */ 2892 KHAROSHTHI = 60, 2893 /** 2894 * an unassigned code point 2895 */ 2896 UNKNOWN = 61, 2897 /** 2898 * Balinese 2899 */ 2900 BALINESE = 62, 2901 /** 2902 * Cuneiform 2903 */ 2904 CUNEIFORM = 63, 2905 /** 2906 * Phoenician 2907 */ 2908 PHOENICIAN = 64, 2909 /** 2910 * Phags-pa 2911 */ 2912 PHAGS_PA = 65, 2913 /** 2914 * N'Ko 2915 */ 2916 NKO = 66, 2917 /** 2918 * Kayah Li. Since 2.16.3 2919 */ 2920 KAYAH_LI = 67, 2921 /** 2922 * Lepcha. Since 2.16.3 2923 */ 2924 LEPCHA = 68, 2925 /** 2926 * Rejang. Since 2.16.3 2927 */ 2928 REJANG = 69, 2929 /** 2930 * Sundanese. Since 2.16.3 2931 */ 2932 SUNDANESE = 70, 2933 /** 2934 * Saurashtra. Since 2.16.3 2935 */ 2936 SAURASHTRA = 71, 2937 /** 2938 * Cham. Since 2.16.3 2939 */ 2940 CHAM = 72, 2941 /** 2942 * Ol Chiki. Since 2.16.3 2943 */ 2944 OL_CHIKI = 73, 2945 /** 2946 * Vai. Since 2.16.3 2947 */ 2948 VAI = 74, 2949 /** 2950 * Carian. Since 2.16.3 2951 */ 2952 CARIAN = 75, 2953 /** 2954 * Lycian. Since 2.16.3 2955 */ 2956 LYCIAN = 76, 2957 /** 2958 * Lydian. Since 2.16.3 2959 */ 2960 LYDIAN = 77, 2961 /** 2962 * Avestan. Since 2.26 2963 */ 2964 AVESTAN = 78, 2965 /** 2966 * Bamum. Since 2.26 2967 */ 2968 BAMUM = 79, 2969 /** 2970 * Egyptian Hieroglpyhs. Since 2.26 2971 */ 2972 EGYPTIAN_HIEROGLYPHS = 80, 2973 /** 2974 * Imperial Aramaic. Since 2.26 2975 */ 2976 IMPERIAL_ARAMAIC = 81, 2977 /** 2978 * Inscriptional Pahlavi. Since 2.26 2979 */ 2980 INSCRIPTIONAL_PAHLAVI = 82, 2981 /** 2982 * Inscriptional Parthian. Since 2.26 2983 */ 2984 INSCRIPTIONAL_PARTHIAN = 83, 2985 /** 2986 * Javanese. Since 2.26 2987 */ 2988 JAVANESE = 84, 2989 /** 2990 * Kaithi. Since 2.26 2991 */ 2992 KAITHI = 85, 2993 /** 2994 * Lisu. Since 2.26 2995 */ 2996 LISU = 86, 2997 /** 2998 * Meetei Mayek. Since 2.26 2999 */ 3000 MEETEI_MAYEK = 87, 3001 /** 3002 * Old South Arabian. Since 2.26 3003 */ 3004 OLD_SOUTH_ARABIAN = 88, 3005 /** 3006 * Old Turkic. Since 2.28 3007 */ 3008 OLD_TURKIC = 89, 3009 /** 3010 * Samaritan. Since 2.26 3011 */ 3012 SAMARITAN = 90, 3013 /** 3014 * Tai Tham. Since 2.26 3015 */ 3016 TAI_THAM = 91, 3017 /** 3018 * Tai Viet. Since 2.26 3019 */ 3020 TAI_VIET = 92, 3021 /** 3022 * Batak. Since 2.28 3023 */ 3024 BATAK = 93, 3025 /** 3026 * Brahmi. Since 2.28 3027 */ 3028 BRAHMI = 94, 3029 /** 3030 * Mandaic. Since 2.28 3031 */ 3032 MANDAIC = 95, 3033 /** 3034 * Chakma. Since: 2.32 3035 */ 3036 CHAKMA = 96, 3037 /** 3038 * Meroitic Cursive. Since: 2.32 3039 */ 3040 MEROITIC_CURSIVE = 97, 3041 /** 3042 * Meroitic Hieroglyphs. Since: 2.32 3043 */ 3044 MEROITIC_HIEROGLYPHS = 98, 3045 /** 3046 * Miao. Since: 2.32 3047 */ 3048 MIAO = 99, 3049 /** 3050 * Sharada. Since: 2.32 3051 */ 3052 SHARADA = 100, 3053 /** 3054 * Sora Sompeng. Since: 2.32 3055 */ 3056 SORA_SOMPENG = 101, 3057 /** 3058 * Takri. Since: 2.32 3059 */ 3060 TAKRI = 102, 3061 /** 3062 * Bassa. Since: 2.42 3063 */ 3064 BASSA_VAH = 103, 3065 /** 3066 * Caucasian Albanian. Since: 2.42 3067 */ 3068 CAUCASIAN_ALBANIAN = 104, 3069 /** 3070 * Duployan. Since: 2.42 3071 */ 3072 DUPLOYAN = 105, 3073 /** 3074 * Elbasan. Since: 2.42 3075 */ 3076 ELBASAN = 106, 3077 /** 3078 * Grantha. Since: 2.42 3079 */ 3080 GRANTHA = 107, 3081 /** 3082 * Kjohki. Since: 2.42 3083 */ 3084 KHOJKI = 108, 3085 /** 3086 * Khudawadi, Sindhi. Since: 2.42 3087 */ 3088 KHUDAWADI = 109, 3089 /** 3090 * Linear A. Since: 2.42 3091 */ 3092 LINEAR_A = 110, 3093 /** 3094 * Mahajani. Since: 2.42 3095 */ 3096 MAHAJANI = 111, 3097 /** 3098 * Manichaean. Since: 2.42 3099 */ 3100 MANICHAEAN = 112, 3101 /** 3102 * Mende Kikakui. Since: 2.42 3103 */ 3104 MENDE_KIKAKUI = 113, 3105 /** 3106 * Modi. Since: 2.42 3107 */ 3108 MODI = 114, 3109 /** 3110 * Mro. Since: 2.42 3111 */ 3112 MRO = 115, 3113 /** 3114 * Nabataean. Since: 2.42 3115 */ 3116 NABATAEAN = 116, 3117 /** 3118 * Old North Arabian. Since: 2.42 3119 */ 3120 OLD_NORTH_ARABIAN = 117, 3121 /** 3122 * Old Permic. Since: 2.42 3123 */ 3124 OLD_PERMIC = 118, 3125 /** 3126 * Pahawh Hmong. Since: 2.42 3127 */ 3128 PAHAWH_HMONG = 119, 3129 /** 3130 * Palmyrene. Since: 2.42 3131 */ 3132 PALMYRENE = 120, 3133 /** 3134 * Pau Cin Hau. Since: 2.42 3135 */ 3136 PAU_CIN_HAU = 121, 3137 /** 3138 * Psalter Pahlavi. Since: 2.42 3139 */ 3140 PSALTER_PAHLAVI = 122, 3141 /** 3142 * Siddham. Since: 2.42 3143 */ 3144 SIDDHAM = 123, 3145 /** 3146 * Tirhuta. Since: 2.42 3147 */ 3148 TIRHUTA = 124, 3149 /** 3150 * Warang Citi. Since: 2.42 3151 */ 3152 WARANG_CITI = 125, 3153 /** 3154 * Ahom. Since: 2.48 3155 */ 3156 AHOM = 126, 3157 /** 3158 * Anatolian Hieroglyphs. Since: 2.48 3159 */ 3160 ANATOLIAN_HIEROGLYPHS = 127, 3161 /** 3162 * Hatran. Since: 2.48 3163 */ 3164 HATRAN = 128, 3165 /** 3166 * Multani. Since: 2.48 3167 */ 3168 MULTANI = 129, 3169 /** 3170 * Old Hungarian. Since: 2.48 3171 */ 3172 OLD_HUNGARIAN = 130, 3173 /** 3174 * Signwriting. Since: 2.48 3175 */ 3176 SIGNWRITING = 131, 3177 /** 3178 * Adlam. Since: 2.50 3179 */ 3180 ADLAM = 132, 3181 /** 3182 * Bhaiksuki. Since: 2.50 3183 */ 3184 BHAIKSUKI = 133, 3185 /** 3186 * Marchen. Since: 2.50 3187 */ 3188 MARCHEN = 134, 3189 /** 3190 * Newa. Since: 2.50 3191 */ 3192 NEWA = 135, 3193 /** 3194 * Osage. Since: 2.50 3195 */ 3196 OSAGE = 136, 3197 /** 3198 * Tangut. Since: 2.50 3199 */ 3200 TANGUT = 137, 3201 } 3202 alias GUnicodeScript UnicodeScript; 3203 3204 /** 3205 * These are the possible character classifications from the 3206 * Unicode specification. 3207 * See [Unicode Character Database](http://www.unicode.org/reports/tr44/#General_Category_Values). 3208 */ 3209 public enum GUnicodeType 3210 { 3211 /** 3212 * General category "Other, Control" (Cc) 3213 */ 3214 CONTROL = 0, 3215 /** 3216 * General category "Other, Format" (Cf) 3217 */ 3218 FORMAT = 1, 3219 /** 3220 * General category "Other, Not Assigned" (Cn) 3221 */ 3222 UNASSIGNED = 2, 3223 /** 3224 * General category "Other, Private Use" (Co) 3225 */ 3226 PRIVATE_USE = 3, 3227 /** 3228 * General category "Other, Surrogate" (Cs) 3229 */ 3230 SURROGATE = 4, 3231 /** 3232 * General category "Letter, Lowercase" (Ll) 3233 */ 3234 LOWERCASE_LETTER = 5, 3235 /** 3236 * General category "Letter, Modifier" (Lm) 3237 */ 3238 MODIFIER_LETTER = 6, 3239 /** 3240 * General category "Letter, Other" (Lo) 3241 */ 3242 OTHER_LETTER = 7, 3243 /** 3244 * General category "Letter, Titlecase" (Lt) 3245 */ 3246 TITLECASE_LETTER = 8, 3247 /** 3248 * General category "Letter, Uppercase" (Lu) 3249 */ 3250 UPPERCASE_LETTER = 9, 3251 /** 3252 * General category "Mark, Spacing" (Mc) 3253 */ 3254 SPACING_MARK = 10, 3255 /** 3256 * General category "Mark, Enclosing" (Me) 3257 */ 3258 ENCLOSING_MARK = 11, 3259 /** 3260 * General category "Mark, Nonspacing" (Mn) 3261 */ 3262 NON_SPACING_MARK = 12, 3263 /** 3264 * General category "Number, Decimal Digit" (Nd) 3265 */ 3266 DECIMAL_NUMBER = 13, 3267 /** 3268 * General category "Number, Letter" (Nl) 3269 */ 3270 LETTER_NUMBER = 14, 3271 /** 3272 * General category "Number, Other" (No) 3273 */ 3274 OTHER_NUMBER = 15, 3275 /** 3276 * General category "Punctuation, Connector" (Pc) 3277 */ 3278 CONNECT_PUNCTUATION = 16, 3279 /** 3280 * General category "Punctuation, Dash" (Pd) 3281 */ 3282 DASH_PUNCTUATION = 17, 3283 /** 3284 * General category "Punctuation, Close" (Pe) 3285 */ 3286 CLOSE_PUNCTUATION = 18, 3287 /** 3288 * General category "Punctuation, Final quote" (Pf) 3289 */ 3290 FINAL_PUNCTUATION = 19, 3291 /** 3292 * General category "Punctuation, Initial quote" (Pi) 3293 */ 3294 INITIAL_PUNCTUATION = 20, 3295 /** 3296 * General category "Punctuation, Other" (Po) 3297 */ 3298 OTHER_PUNCTUATION = 21, 3299 /** 3300 * General category "Punctuation, Open" (Ps) 3301 */ 3302 OPEN_PUNCTUATION = 22, 3303 /** 3304 * General category "Symbol, Currency" (Sc) 3305 */ 3306 CURRENCY_SYMBOL = 23, 3307 /** 3308 * General category "Symbol, Modifier" (Sk) 3309 */ 3310 MODIFIER_SYMBOL = 24, 3311 /** 3312 * General category "Symbol, Math" (Sm) 3313 */ 3314 MATH_SYMBOL = 25, 3315 /** 3316 * General category "Symbol, Other" (So) 3317 */ 3318 OTHER_SYMBOL = 26, 3319 /** 3320 * General category "Separator, Line" (Zl) 3321 */ 3322 LINE_SEPARATOR = 27, 3323 /** 3324 * General category "Separator, Paragraph" (Zp) 3325 */ 3326 PARAGRAPH_SEPARATOR = 28, 3327 /** 3328 * General category "Separator, Space" (Zs) 3329 */ 3330 SPACE_SEPARATOR = 29, 3331 } 3332 alias GUnicodeType UnicodeType; 3333 3334 /** 3335 * These are logical ids for special directories which are defined 3336 * depending on the platform used. You should use g_get_user_special_dir() 3337 * to retrieve the full path associated to the logical id. 3338 * 3339 * The #GUserDirectory enumeration can be extended at later date. Not 3340 * every platform has a directory for every logical id in this 3341 * enumeration. 3342 * 3343 * Since: 2.14 3344 */ 3345 public enum GUserDirectory 3346 { 3347 /** 3348 * the user's Desktop directory 3349 */ 3350 DIRECTORY_DESKTOP = 0, 3351 /** 3352 * the user's Documents directory 3353 */ 3354 DIRECTORY_DOCUMENTS = 1, 3355 /** 3356 * the user's Downloads directory 3357 */ 3358 DIRECTORY_DOWNLOAD = 2, 3359 /** 3360 * the user's Music directory 3361 */ 3362 DIRECTORY_MUSIC = 3, 3363 /** 3364 * the user's Pictures directory 3365 */ 3366 DIRECTORY_PICTURES = 4, 3367 /** 3368 * the user's shared directory 3369 */ 3370 DIRECTORY_PUBLIC_SHARE = 5, 3371 /** 3372 * the user's Templates directory 3373 */ 3374 DIRECTORY_TEMPLATES = 6, 3375 /** 3376 * the user's Movies directory 3377 */ 3378 DIRECTORY_VIDEOS = 7, 3379 /** 3380 * the number of enum values 3381 */ 3382 N_DIRECTORIES = 8, 3383 } 3384 alias GUserDirectory UserDirectory; 3385 3386 /** 3387 * The range of possible top-level types of #GVariant instances. 3388 * 3389 * Since: 2.24 3390 */ 3391 public enum GVariantClass 3392 { 3393 /** 3394 * The #GVariant is a boolean. 3395 */ 3396 BOOLEAN = 98, 3397 /** 3398 * The #GVariant is a byte. 3399 */ 3400 BYTE = 121, 3401 /** 3402 * The #GVariant is a signed 16 bit integer. 3403 */ 3404 INT16 = 110, 3405 /** 3406 * The #GVariant is an unsigned 16 bit integer. 3407 */ 3408 UINT16 = 113, 3409 /** 3410 * The #GVariant is a signed 32 bit integer. 3411 */ 3412 INT32 = 105, 3413 /** 3414 * The #GVariant is an unsigned 32 bit integer. 3415 */ 3416 UINT32 = 117, 3417 /** 3418 * The #GVariant is a signed 64 bit integer. 3419 */ 3420 INT64 = 120, 3421 /** 3422 * The #GVariant is an unsigned 64 bit integer. 3423 */ 3424 UINT64 = 116, 3425 /** 3426 * The #GVariant is a file handle index. 3427 */ 3428 HANDLE = 104, 3429 /** 3430 * The #GVariant is a double precision floating 3431 * point value. 3432 */ 3433 DOUBLE = 100, 3434 /** 3435 * The #GVariant is a normal string. 3436 */ 3437 STRING = 115, 3438 /** 3439 * The #GVariant is a D-Bus object path 3440 * string. 3441 */ 3442 OBJECT_PATH = 111, 3443 /** 3444 * The #GVariant is a D-Bus signature string. 3445 */ 3446 SIGNATURE = 103, 3447 /** 3448 * The #GVariant is a variant. 3449 */ 3450 VARIANT = 118, 3451 /** 3452 * The #GVariant is a maybe-typed value. 3453 */ 3454 MAYBE = 109, 3455 /** 3456 * The #GVariant is an array. 3457 */ 3458 ARRAY = 97, 3459 /** 3460 * The #GVariant is a tuple. 3461 */ 3462 TUPLE = 40, 3463 /** 3464 * The #GVariant is a dictionary entry. 3465 */ 3466 DICT_ENTRY = 123, 3467 } 3468 alias GVariantClass VariantClass; 3469 3470 /** 3471 * Error codes returned by parsing text-format GVariants. 3472 */ 3473 public enum GVariantParseError 3474 { 3475 /** 3476 * generic error (unused) 3477 */ 3478 FAILED = 0, 3479 /** 3480 * a non-basic #GVariantType was given where a basic type was expected 3481 */ 3482 BASIC_TYPE_EXPECTED = 1, 3483 /** 3484 * cannot infer the #GVariantType 3485 */ 3486 CANNOT_INFER_TYPE = 2, 3487 /** 3488 * an indefinite #GVariantType was given where a definite type was expected 3489 */ 3490 DEFINITE_TYPE_EXPECTED = 3, 3491 /** 3492 * extra data after parsing finished 3493 */ 3494 INPUT_NOT_AT_END = 4, 3495 /** 3496 * invalid character in number or unicode escape 3497 */ 3498 INVALID_CHARACTER = 5, 3499 /** 3500 * not a valid #GVariant format string 3501 */ 3502 INVALID_FORMAT_STRING = 6, 3503 /** 3504 * not a valid object path 3505 */ 3506 INVALID_OBJECT_PATH = 7, 3507 /** 3508 * not a valid type signature 3509 */ 3510 INVALID_SIGNATURE = 8, 3511 /** 3512 * not a valid #GVariant type string 3513 */ 3514 INVALID_TYPE_STRING = 9, 3515 /** 3516 * could not find a common type for array entries 3517 */ 3518 NO_COMMON_TYPE = 10, 3519 /** 3520 * the numerical value is out of range of the given type 3521 */ 3522 NUMBER_OUT_OF_RANGE = 11, 3523 /** 3524 * the numerical value is out of range for any type 3525 */ 3526 NUMBER_TOO_BIG = 12, 3527 /** 3528 * cannot parse as variant of the specified type 3529 */ 3530 TYPE_ERROR = 13, 3531 /** 3532 * an unexpected token was encountered 3533 */ 3534 UNEXPECTED_TOKEN = 14, 3535 /** 3536 * an unknown keyword was encountered 3537 */ 3538 UNKNOWN_KEYWORD = 15, 3539 /** 3540 * unterminated string constant 3541 */ 3542 UNTERMINATED_STRING_CONSTANT = 16, 3543 /** 3544 * no value given 3545 */ 3546 VALUE_EXPECTED = 17, 3547 } 3548 alias GVariantParseError VariantParseError; 3549 3550 /** 3551 * Flags passed to g_module_open(). 3552 * Note that these flags are not supported on all platforms. 3553 */ 3554 public enum GModuleFlags 3555 { 3556 /** 3557 * specifies that symbols are only resolved when 3558 * needed. The default action is to bind all symbols when the module 3559 * is loaded. 3560 */ 3561 LAZY = 1, 3562 /** 3563 * specifies that symbols in the module should 3564 * not be added to the global name space. The default action on most 3565 * platforms is to place symbols in the module in the global name space, 3566 * which may cause conflicts with existing symbols. 3567 */ 3568 LOCAL = 2, 3569 /** 3570 * mask for all flags. 3571 */ 3572 MASK = 3, 3573 } 3574 alias GModuleFlags ModuleFlags; 3575 3576 /** 3577 * Contains the public fields of a GArray. 3578 */ 3579 struct GArray 3580 { 3581 /** 3582 * a pointer to the element data. The data may be moved as 3583 * elements are added to the #GArray. 3584 */ 3585 char* data; 3586 /** 3587 * the number of elements in the #GArray not including the 3588 * possible terminating zero element. 3589 */ 3590 uint len; 3591 } 3592 3593 struct GAsyncQueue; 3594 3595 struct GBookmarkFile; 3596 3597 /** 3598 * Contains the public fields of a GByteArray. 3599 */ 3600 struct GByteArray 3601 { 3602 /** 3603 * a pointer to the element data. The data may be moved as 3604 * elements are added to the #GByteArray 3605 */ 3606 ubyte* data; 3607 /** 3608 * the number of elements in the #GByteArray 3609 */ 3610 uint len; 3611 } 3612 3613 struct GBytes; 3614 3615 struct GChecksum; 3616 3617 struct GCond 3618 { 3619 void* p; 3620 uint[2] i; 3621 } 3622 3623 /** 3624 * The #GData struct is an opaque data structure to represent a 3625 * [Keyed Data List][glib-Keyed-Data-Lists]. It should only be 3626 * accessed via the following functions. 3627 */ 3628 struct GData; 3629 3630 struct GDate 3631 { 3632 import std.bitmanip: bitfields; 3633 mixin(bitfields!( 3634 uint, "julianDays", 32, 3635 uint, "julian", 1, 3636 uint, "dmy", 1, 3637 uint, "day", 6, 3638 uint, "month", 4, 3639 uint, "year", 16, 3640 uint, "", 4 3641 )); 3642 } 3643 3644 struct GDateTime; 3645 3646 /** 3647 * Associates a string with a bit flag. 3648 * Used in g_parse_debug_string(). 3649 */ 3650 struct GDebugKey 3651 { 3652 /** 3653 * the string 3654 */ 3655 const(char)* key; 3656 /** 3657 * the flag 3658 */ 3659 uint value; 3660 } 3661 3662 struct GDir; 3663 3664 /** 3665 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign, 3666 * mantissa and exponent of IEEE floats and doubles. These unions are defined 3667 * as appropriate for a given platform. IEEE floats and doubles are supported 3668 * (used for storage) by at least Intel, PPC and Sparc. 3669 */ 3670 struct GDoubleIEEE754 3671 { 3672 union 3673 { 3674 /** 3675 * the double value 3676 */ 3677 double vDouble; 3678 struct Mpn 3679 { 3680 import std.bitmanip: bitfields; 3681 mixin(bitfields!( 3682 uint, "mantissaLow", 32, 3683 uint, "mantissaHigh", 20, 3684 uint, "biasedExponent", 11, 3685 uint, "sign", 1 3686 )); 3687 } 3688 Mpn mpn; 3689 } 3690 } 3691 3692 struct GError 3693 { 3694 /** 3695 * error domain, e.g. #G_FILE_ERROR 3696 */ 3697 GQuark domain; 3698 /** 3699 * error code, e.g. %G_FILE_ERROR_NOENT 3700 */ 3701 int code; 3702 /** 3703 * human-readable informative error message 3704 */ 3705 char* message; 3706 } 3707 3708 /** 3709 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign, 3710 * mantissa and exponent of IEEE floats and doubles. These unions are defined 3711 * as appropriate for a given platform. IEEE floats and doubles are supported 3712 * (used for storage) by at least Intel, PPC and Sparc. 3713 */ 3714 struct GFloatIEEE754 3715 { 3716 union 3717 { 3718 /** 3719 * the double value 3720 */ 3721 float vFloat; 3722 struct Mpn 3723 { 3724 import std.bitmanip: bitfields; 3725 mixin(bitfields!( 3726 uint, "mantissa", 23, 3727 uint, "biasedExponent", 8, 3728 uint, "sign", 1 3729 )); 3730 } 3731 Mpn mpn; 3732 } 3733 } 3734 3735 /** 3736 * The #GHashTable struct is an opaque data structure to represent a 3737 * [Hash Table][glib-Hash-Tables]. It should only be accessed via the 3738 * following functions. 3739 */ 3740 struct GHashTable; 3741 3742 struct GHashTableIter 3743 { 3744 void* dummy1; 3745 void* dummy2; 3746 void* dummy3; 3747 int dummy4; 3748 bool dummy5; 3749 void* dummy6; 3750 } 3751 3752 struct GHmac; 3753 3754 struct GHook 3755 { 3756 /** 3757 * data which is passed to func when this hook is invoked 3758 */ 3759 void* data; 3760 /** 3761 * pointer to the next hook in the list 3762 */ 3763 GHook* next; 3764 /** 3765 * pointer to the previous hook in the list 3766 */ 3767 GHook* prev; 3768 /** 3769 * the reference count of this hook 3770 */ 3771 uint refCount; 3772 /** 3773 * the id of this hook, which is unique within its list 3774 */ 3775 gulong hookId; 3776 /** 3777 * flags which are set for this hook. See #GHookFlagMask for 3778 * predefined flags 3779 */ 3780 uint flags; 3781 /** 3782 * the function to call when this hook is invoked. The possible 3783 * signatures for this function are #GHookFunc and #GHookCheckFunc 3784 */ 3785 void* func; 3786 /** 3787 * the default @finalize_hook function of a #GHookList calls 3788 * this member of the hook that is being finalized 3789 */ 3790 GDestroyNotify destroy; 3791 } 3792 3793 struct GHookList 3794 { 3795 /** 3796 * the next free #GHook id 3797 */ 3798 gulong seqId; 3799 import std.bitmanip: bitfields; 3800 mixin(bitfields!( 3801 uint, "hookSize", 16, 3802 uint, "isSetup", 1, 3803 uint, "", 15 3804 )); 3805 /** 3806 * the first #GHook element in the list 3807 */ 3808 GHook* hooks; 3809 /** 3810 * unused 3811 */ 3812 void* dummy3; 3813 /** 3814 * the function to call to finalize a #GHook element. 3815 * The default behaviour is to call the hooks @destroy function 3816 */ 3817 GHookFinalizeFunc finalizeHook; 3818 /** 3819 * unused 3820 */ 3821 void*[2] dummy; 3822 } 3823 3824 struct GIOChannel 3825 { 3826 int refCount; 3827 GIOFuncs* funcs; 3828 char* encoding; 3829 GIConv readCd; 3830 GIConv writeCd; 3831 char* lineTerm; 3832 uint lineTermLen; 3833 size_t bufSize; 3834 GString* readBuf; 3835 GString* encodedReadBuf; 3836 GString* writeBuf; 3837 char[6] partialWriteBuf; 3838 import std.bitmanip: bitfields; 3839 mixin(bitfields!( 3840 uint, "useBuffer", 1, 3841 uint, "doEncode", 1, 3842 uint, "closeOnUnref", 1, 3843 uint, "isReadable", 1, 3844 uint, "isWriteable", 1, 3845 uint, "isSeekable", 1, 3846 uint, "", 26 3847 )); 3848 void* reserved1; 3849 void* reserved2; 3850 } 3851 3852 /** 3853 * A table of functions used to handle different types of #GIOChannel 3854 * in a generic way. 3855 */ 3856 struct GIOFuncs 3857 { 3858 /** */ 3859 extern(C) GIOStatus function(GIOChannel* channel, char* buf, size_t count, size_t* bytesRead, GError** err) ioRead; 3860 /** */ 3861 extern(C) GIOStatus function(GIOChannel* channel, const(char)* buf, size_t count, size_t* bytesWritten, GError** err) ioWrite; 3862 /** */ 3863 extern(C) GIOStatus function(GIOChannel* channel, long offset, GSeekType type, GError** err) ioSeek; 3864 /** */ 3865 extern(C) GIOStatus function(GIOChannel* channel, GError** err) ioClose; 3866 /** */ 3867 extern(C) GSource* function(GIOChannel* channel, GIOCondition condition) ioCreateWatch; 3868 /** */ 3869 extern(C) void function(GIOChannel* channel) ioFree; 3870 /** */ 3871 extern(C) GIOStatus function(GIOChannel* channel, GIOFlags flags, GError** err) ioSetFlags; 3872 /** */ 3873 extern(C) GIOFlags function(GIOChannel* channel) ioGetFlags; 3874 } 3875 3876 struct GKeyFile; 3877 3878 /** 3879 * The #GList struct is used for each element in a doubly-linked list. 3880 */ 3881 struct GList 3882 { 3883 /** 3884 * holds the element's data, which can be a pointer to any kind 3885 * of data, or any integer value using the 3886 * [Type Conversion Macros][glib-Type-Conversion-Macros] 3887 */ 3888 void* data; 3889 /** 3890 * contains the link to the next element in the list 3891 */ 3892 GList* next; 3893 /** 3894 * contains the link to the previous element in the list 3895 */ 3896 GList* prev; 3897 } 3898 3899 /** 3900 * Structure representing a single field in a structured log entry. See 3901 * g_log_structured() for details. 3902 * 3903 * Log fields may contain arbitrary values, including binary with embedded nul 3904 * bytes. If the field contains a string, the string must be UTF-8 encoded and 3905 * have a trailing nul byte. Otherwise, @length must be set to a non-negative 3906 * value. 3907 * 3908 * Since: 2.50 3909 */ 3910 struct GLogField 3911 { 3912 /** 3913 * field name (UTF-8 string) 3914 */ 3915 const(char)* key; 3916 /** 3917 * field value (arbitrary bytes) 3918 */ 3919 void* value; 3920 /** 3921 * length of @value, in bytes, or -1 if it is nul-terminated 3922 */ 3923 ptrdiff_t length; 3924 } 3925 3926 struct GMainContext; 3927 3928 struct GMainLoop; 3929 3930 struct GMappedFile; 3931 3932 struct GMarkupParseContext; 3933 3934 /** 3935 * Any of the fields in #GMarkupParser can be %NULL, in which case they 3936 * will be ignored. Except for the @error function, any of these callbacks 3937 * can set an error; in particular the %G_MARKUP_ERROR_UNKNOWN_ELEMENT, 3938 * %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, and %G_MARKUP_ERROR_INVALID_CONTENT 3939 * errors are intended to be set from these callbacks. If you set an error 3940 * from a callback, g_markup_parse_context_parse() will report that error 3941 * back to its caller. 3942 */ 3943 struct GMarkupParser 3944 { 3945 /** */ 3946 extern(C) void function(GMarkupParseContext* context, const(char)* elementName, char** attributeNames, char** attributeValues, void* userData, GError** err) startElement; 3947 /** */ 3948 extern(C) void function(GMarkupParseContext* context, const(char)* elementName, void* userData, GError** err) endElement; 3949 /** */ 3950 extern(C) void function(GMarkupParseContext* context, const(char)* text, size_t textLen, void* userData, GError** err) text; 3951 /** */ 3952 extern(C) void function(GMarkupParseContext* context, const(char)* passthroughText, size_t textLen, void* userData, GError** err) passthrough; 3953 /** */ 3954 extern(C) void function(GMarkupParseContext* context, GError* error, void* userData) error; 3955 } 3956 3957 struct GMatchInfo; 3958 3959 /** 3960 * A set of functions used to perform memory allocation. The same #GMemVTable must 3961 * be used for all allocations in the same program; a call to g_mem_set_vtable(), 3962 * if it exists, should be prior to any use of GLib. 3963 * 3964 * This functions related to this has been deprecated in 2.46, and no longer work. 3965 */ 3966 struct GMemVTable 3967 { 3968 /** */ 3969 extern(C) void* function(size_t nBytes) malloc; 3970 /** */ 3971 extern(C) void* function(void* mem, size_t nBytes) realloc; 3972 /** */ 3973 extern(C) void function(void* mem) free; 3974 /** */ 3975 extern(C) void* function(size_t nBlocks, size_t nBlockBytes) calloc; 3976 /** */ 3977 extern(C) void* function(size_t nBytes) tryMalloc; 3978 /** */ 3979 extern(C) void* function(void* mem, size_t nBytes) tryRealloc; 3980 } 3981 3982 struct GMutex 3983 { 3984 union 3985 { 3986 void* p; 3987 uint[2] i; 3988 } 3989 } 3990 3991 struct GNode 3992 { 3993 /** 3994 * contains the actual data of the node. 3995 */ 3996 void* data; 3997 /** 3998 * points to the node's next sibling (a sibling is another 3999 * #GNode with the same parent). 4000 */ 4001 GNode* next; 4002 /** 4003 * points to the node's previous sibling. 4004 */ 4005 GNode* prev; 4006 /** 4007 * points to the parent of the #GNode, or is %NULL if the 4008 * #GNode is the root of the tree. 4009 */ 4010 GNode* parent; 4011 /** 4012 * points to the first child of the #GNode. The other 4013 * children are accessed by using the @next pointer of each 4014 * child. 4015 */ 4016 GNode* children; 4017 } 4018 4019 struct GOnce 4020 { 4021 /** 4022 * the status of the #GOnce 4023 */ 4024 GOnceStatus status; 4025 /** 4026 * the value returned by the call to the function, if @status 4027 * is %G_ONCE_STATUS_READY 4028 */ 4029 void* retval; 4030 } 4031 4032 struct GOptionContext; 4033 4034 /** 4035 * A GOptionEntry struct defines a single option. To have an effect, they 4036 * must be added to a #GOptionGroup with g_option_context_add_main_entries() 4037 * or g_option_group_add_entries(). 4038 */ 4039 struct GOptionEntry 4040 { 4041 /** 4042 * The long name of an option can be used to specify it 4043 * in a commandline as `--long_name`. Every option must have a 4044 * long name. To resolve conflicts if multiple option groups contain 4045 * the same long name, it is also possible to specify the option as 4046 * `--groupname-long_name`. 4047 */ 4048 const(char)* longName; 4049 /** 4050 * If an option has a short name, it can be specified 4051 * `-short_name` in a commandline. @short_name must be a printable 4052 * ASCII character different from '-', or zero if the option has no 4053 * short name. 4054 */ 4055 char shortName; 4056 /** 4057 * Flags from #GOptionFlags 4058 */ 4059 int flags; 4060 /** 4061 * The type of the option, as a #GOptionArg 4062 */ 4063 GOptionArg arg; 4064 /** 4065 * If the @arg type is %G_OPTION_ARG_CALLBACK, then @arg_data 4066 * must point to a #GOptionArgFunc callback function, which will be 4067 * called to handle the extra argument. Otherwise, @arg_data is a 4068 * pointer to a location to store the value, the required type of 4069 * the location depends on the @arg type: 4070 * - %G_OPTION_ARG_NONE: %gboolean 4071 * - %G_OPTION_ARG_STRING: %gchar* 4072 * - %G_OPTION_ARG_INT: %gint 4073 * - %G_OPTION_ARG_FILENAME: %gchar* 4074 * - %G_OPTION_ARG_STRING_ARRAY: %gchar** 4075 * - %G_OPTION_ARG_FILENAME_ARRAY: %gchar** 4076 * - %G_OPTION_ARG_DOUBLE: %gdouble 4077 * If @arg type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_FILENAME, 4078 * the location will contain a newly allocated string if the option 4079 * was given. That string needs to be freed by the callee using g_free(). 4080 * Likewise if @arg type is %G_OPTION_ARG_STRING_ARRAY or 4081 * %G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev(). 4082 */ 4083 void* argData; 4084 /** 4085 * the description for the option in `--help` 4086 * output. The @description is translated using the @translate_func 4087 * of the group, see g_option_group_set_translation_domain(). 4088 */ 4089 const(char)* description; 4090 /** 4091 * The placeholder to use for the extra argument parsed 4092 * by the option in `--help` output. The @arg_description is translated 4093 * using the @translate_func of the group, see 4094 * g_option_group_set_translation_domain(). 4095 */ 4096 const(char)* argDescription; 4097 } 4098 4099 struct GOptionGroup; 4100 4101 struct GPatternSpec; 4102 4103 /** 4104 * Represents a file descriptor, which events to poll for, and which events 4105 * occurred. 4106 */ 4107 struct GPollFD 4108 { 4109 /** 4110 * the file descriptor to poll (or a HANDLE on Win32) 4111 */ 4112 int fd; 4113 /** 4114 * a bitwise combination from #GIOCondition, specifying which 4115 * events should be polled for. Typically for reading from a file 4116 * descriptor you would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and 4117 * for writing you would use %G_IO_OUT | %G_IO_ERR. 4118 */ 4119 ushort events; 4120 /** 4121 * a bitwise combination of flags from #GIOCondition, returned 4122 * from the poll() function to indicate which events occurred. 4123 */ 4124 ushort revents; 4125 } 4126 4127 struct GPrivate 4128 { 4129 void* p; 4130 GDestroyNotify notify; 4131 void*[2] future; 4132 } 4133 4134 /** 4135 * Contains the public fields of a pointer array. 4136 */ 4137 struct GPtrArray 4138 { 4139 /** 4140 * points to the array of pointers, which may be moved when the 4141 * array grows 4142 */ 4143 void** pdata; 4144 /** 4145 * number of pointers in the array 4146 */ 4147 uint len; 4148 } 4149 4150 struct GQueue 4151 { 4152 /** 4153 * a pointer to the first element of the queue 4154 */ 4155 GList* head; 4156 /** 4157 * a pointer to the last element of the queue 4158 */ 4159 GList* tail; 4160 /** 4161 * the number of elements in the queue 4162 */ 4163 uint length; 4164 } 4165 4166 struct GRWLock 4167 { 4168 void* p; 4169 uint[2] i; 4170 } 4171 4172 struct GRand; 4173 4174 struct GRecMutex 4175 { 4176 void* p; 4177 uint[2] i; 4178 } 4179 4180 struct GRegex; 4181 4182 /** 4183 * The #GSList struct is used for each element in the singly-linked 4184 * list. 4185 */ 4186 struct GSList 4187 { 4188 /** 4189 * holds the element's data, which can be a pointer to any kind 4190 * of data, or any integer value using the 4191 * [Type Conversion Macros][glib-Type-Conversion-Macros] 4192 */ 4193 void* data; 4194 /** 4195 * contains the link to the next element in the list. 4196 */ 4197 GSList* next; 4198 } 4199 4200 struct GScanner 4201 { 4202 /** 4203 * unused 4204 */ 4205 void* userData; 4206 /** 4207 * unused 4208 */ 4209 uint maxParseErrors; 4210 /** 4211 * g_scanner_error() increments this field 4212 */ 4213 uint parseErrors; 4214 /** 4215 * name of input stream, featured by the default message handler 4216 */ 4217 const(char)* inputName; 4218 /** 4219 * quarked data 4220 */ 4221 GData* qdata; 4222 /** 4223 * link into the scanner configuration 4224 */ 4225 GScannerConfig* config; 4226 /** 4227 * token parsed by the last g_scanner_get_next_token() 4228 */ 4229 GTokenType token; 4230 /** 4231 * value of the last token from g_scanner_get_next_token() 4232 */ 4233 GTokenValue value; 4234 /** 4235 * line number of the last token from g_scanner_get_next_token() 4236 */ 4237 uint line; 4238 /** 4239 * char number of the last token from g_scanner_get_next_token() 4240 */ 4241 uint position; 4242 /** 4243 * token parsed by the last g_scanner_peek_next_token() 4244 */ 4245 GTokenType nextToken; 4246 /** 4247 * value of the last token from g_scanner_peek_next_token() 4248 */ 4249 GTokenValue nextValue; 4250 /** 4251 * line number of the last token from g_scanner_peek_next_token() 4252 */ 4253 uint nextLine; 4254 /** 4255 * char number of the last token from g_scanner_peek_next_token() 4256 */ 4257 uint nextPosition; 4258 GHashTable* symbolTable; 4259 int inputFd; 4260 const(char)* text; 4261 const(char)* textEnd; 4262 char* buffer; 4263 uint scopeId; 4264 /** 4265 * handler function for _warn and _error 4266 */ 4267 GScannerMsgFunc msgHandler; 4268 } 4269 4270 /** 4271 * Specifies the #GScanner parser configuration. Most settings can 4272 * be changed during the parsing phase and will affect the lexical 4273 * parsing of the next unpeeked token. 4274 */ 4275 struct GScannerConfig 4276 { 4277 /** 4278 * specifies which characters should be skipped 4279 * by the scanner (the default is the whitespace characters: space, 4280 * tab, carriage-return and line-feed). 4281 */ 4282 char* csetSkipCharacters; 4283 /** 4284 * specifies the characters which can start 4285 * identifiers (the default is #G_CSET_a_2_z, "_", and #G_CSET_A_2_Z). 4286 */ 4287 char* csetIdentifierFirst; 4288 /** 4289 * specifies the characters which can be used 4290 * in identifiers, after the first character (the default is 4291 * #G_CSET_a_2_z, "_0123456789", #G_CSET_A_2_Z, #G_CSET_LATINS, 4292 * #G_CSET_LATINC). 4293 */ 4294 char* csetIdentifierNth; 4295 /** 4296 * specifies the characters at the start and 4297 * end of single-line comments. The default is "#\n" which means 4298 * that single-line comments start with a '#' and continue until 4299 * a '\n' (end of line). 4300 */ 4301 char* cpairCommentSingle; 4302 import std.bitmanip: bitfields; 4303 mixin(bitfields!( 4304 uint, "caseSensitive", 1, 4305 uint, "skipCommentMulti", 1, 4306 uint, "skipCommentSingle", 1, 4307 uint, "scanCommentMulti", 1, 4308 uint, "scanIdentifier", 1, 4309 uint, "scanIdentifier1char", 1, 4310 uint, "scanIdentifierNULL", 1, 4311 uint, "scanSymbols", 1, 4312 uint, "scanBinary", 1, 4313 uint, "scanOctal", 1, 4314 uint, "scanFloat", 1, 4315 uint, "scanHex", 1, 4316 uint, "scanHexDollar", 1, 4317 uint, "scanStringSq", 1, 4318 uint, "scanStringDq", 1, 4319 uint, "numbers2Int", 1, 4320 uint, "int2Float", 1, 4321 uint, "identifier2String", 1, 4322 uint, "char2Token", 1, 4323 uint, "symbol2Token", 1, 4324 uint, "scope0Fallback", 1, 4325 uint, "storeInt64", 1, 4326 uint, "", 10 4327 )); 4328 uint paddingDummy; 4329 } 4330 4331 struct GSequence; 4332 4333 struct GSequenceIter; 4334 4335 struct GSource 4336 { 4337 void* callbackData; 4338 GSourceCallbackFuncs* callbackFuncs; 4339 GSourceFuncs* sourceFuncs; 4340 uint refCount; 4341 GMainContext* context; 4342 int priority; 4343 uint flags; 4344 uint sourceId; 4345 GSList* pollFds; 4346 GSource* prev; 4347 GSource* next; 4348 char* name; 4349 GSourcePrivate* priv; 4350 } 4351 4352 /** 4353 * The `GSourceCallbackFuncs` struct contains 4354 * functions for managing callback objects. 4355 */ 4356 struct GSourceCallbackFuncs 4357 { 4358 /** */ 4359 extern(C) void function(void* cbData) doref; 4360 /** */ 4361 extern(C) void function(void* cbData) unref; 4362 /** */ 4363 extern(C) void function(void* cbData, GSource* source, GSourceFunc* func, void** data) get; 4364 } 4365 4366 /** 4367 * The `GSourceFuncs` struct contains a table of 4368 * functions used to handle event sources in a generic manner. 4369 * 4370 * For idle sources, the prepare and check functions always return %TRUE 4371 * to indicate that the source is always ready to be processed. The prepare 4372 * function also returns a timeout value of 0 to ensure that the poll() call 4373 * doesn't block (since that would be time wasted which could have been spent 4374 * running the idle function). 4375 * 4376 * For timeout sources, the prepare and check functions both return %TRUE 4377 * if the timeout interval has expired. The prepare function also returns 4378 * a timeout value to ensure that the poll() call doesn't block too long 4379 * and miss the next timeout. 4380 * 4381 * For file descriptor sources, the prepare function typically returns %FALSE, 4382 * since it must wait until poll() has been called before it knows whether 4383 * any events need to be processed. It sets the returned timeout to -1 to 4384 * indicate that it doesn't mind how long the poll() call blocks. In the 4385 * check function, it tests the results of the poll() call to see if the 4386 * required condition has been met, and returns %TRUE if so. 4387 */ 4388 struct GSourceFuncs 4389 { 4390 /** */ 4391 extern(C) int function(GSource* source, int* timeout) prepare; 4392 /** */ 4393 extern(C) int function(GSource* source) check; 4394 /** */ 4395 extern(C) int function(GSource* source, GSourceFunc callback, void* userData) dispatch; 4396 /** */ 4397 extern(C) void function(GSource* source) finalize; 4398 GSourceFunc closureCallback; 4399 GSourceDummyMarshal closureMarshal; 4400 } 4401 4402 struct GSourcePrivate; 4403 4404 /** 4405 * A type corresponding to the appropriate struct type for the stat() 4406 * system call, depending on the platform and/or compiler being used. 4407 * 4408 * See g_stat() for more information. 4409 */ 4410 struct GStatBuf; 4411 4412 struct GString 4413 { 4414 /** 4415 * points to the character data. It may move as text is added. 4416 * The @str field is null-terminated and so 4417 * can be used as an ordinary C string. 4418 */ 4419 char* str; 4420 /** 4421 * contains the length of the string, not including the 4422 * terminating nul byte. 4423 */ 4424 size_t len; 4425 /** 4426 * the number of bytes that can be stored in the 4427 * string before it needs to be reallocated. May be larger than @len. 4428 */ 4429 size_t allocatedLen; 4430 } 4431 4432 struct GStringChunk; 4433 4434 /** 4435 * An opaque structure representing a test case. 4436 */ 4437 struct GTestCase; 4438 4439 struct GTestConfig 4440 { 4441 bool testInitialized; 4442 bool testQuick; 4443 bool testPerf; 4444 bool testVerbose; 4445 bool testQuiet; 4446 bool testUndefined; 4447 } 4448 4449 struct GTestLogBuffer 4450 { 4451 GString* data; 4452 GSList* msgs; 4453 } 4454 4455 struct GTestLogMsg 4456 { 4457 GTestLogType logType; 4458 uint nStrings; 4459 char** strings; 4460 uint nNums; 4461 long* nums; 4462 } 4463 4464 struct GTestSuite; 4465 4466 struct GThread; 4467 4468 struct GThreadPool 4469 { 4470 /** 4471 * the function to execute in the threads of this pool 4472 */ 4473 GFunc func; 4474 /** 4475 * the user data for the threads of this pool 4476 */ 4477 void* userData; 4478 /** 4479 * are all threads exclusive to this pool 4480 */ 4481 bool exclusive; 4482 } 4483 4484 struct GTimeVal 4485 { 4486 /** 4487 * seconds 4488 */ 4489 glong tvSec; 4490 /** 4491 * microseconds 4492 */ 4493 glong tvUsec; 4494 } 4495 4496 struct GTimeZone; 4497 4498 struct GTimer; 4499 4500 /** 4501 * A union holding the value of the token. 4502 */ 4503 struct GTokenValue 4504 { 4505 union 4506 { 4507 /** 4508 * token symbol value 4509 */ 4510 void* vSymbol; 4511 /** 4512 * token identifier value 4513 */ 4514 char* vIdentifier; 4515 /** 4516 * token binary integer value 4517 */ 4518 gulong vBinary; 4519 /** 4520 * octal integer value 4521 */ 4522 gulong vOctal; 4523 /** 4524 * integer value 4525 */ 4526 gulong vInt; 4527 /** 4528 * 64-bit integer value 4529 */ 4530 ulong vInt64; 4531 /** 4532 * floating point value 4533 */ 4534 double vFloat; 4535 /** 4536 * hex integer value 4537 */ 4538 gulong vHex; 4539 /** 4540 * string value 4541 */ 4542 char* vString; 4543 /** 4544 * comment value 4545 */ 4546 char* vComment; 4547 /** 4548 * character value 4549 */ 4550 char vChar; 4551 /** 4552 * error value 4553 */ 4554 uint vError; 4555 } 4556 } 4557 4558 /** 4559 * Each piece of memory that is pushed onto the stack 4560 * is cast to a GTrashStack*. 4561 * 4562 * Deprecated: #GTrashStack is deprecated without replacement 4563 */ 4564 struct GTrashStack 4565 { 4566 /** 4567 * pointer to the previous element of the stack, 4568 * gets stored in the first `sizeof (gpointer)` 4569 * bytes of the element 4570 */ 4571 GTrashStack* next; 4572 } 4573 4574 struct GTree; 4575 4576 struct GVariant; 4577 4578 struct GVariantBuilder 4579 { 4580 union U 4581 { 4582 struct S 4583 { 4584 size_t partialMagic; 4585 GVariantType* type; 4586 size_t[14] y; 4587 } 4588 S s; 4589 size_t[16] x; 4590 } 4591 U u; 4592 } 4593 4594 struct GVariantDict 4595 { 4596 union U 4597 { 4598 struct S 4599 { 4600 GVariant* asv; 4601 size_t partialMagic; 4602 size_t[14] y; 4603 } 4604 S s; 4605 size_t[16] x; 4606 } 4607 U u; 4608 } 4609 4610 struct GVariantIter 4611 { 4612 size_t[16] x; 4613 } 4614 4615 struct GVariantType; 4616 4617 struct GModule; 4618 4619 /** 4620 * Prototype of a #GChildWatchSource callback, called when a child 4621 * process has exited. To interpret @status, see the documentation 4622 * for g_spawn_check_exit_status(). 4623 * 4624 * Params: 4625 * pid = the process id of the child process 4626 * status = Status information about the child process, encoded 4627 * in a platform-specific manner 4628 * userData = user data passed to g_child_watch_add() 4629 */ 4630 public alias extern(C) void function(GPid pid, int status, void* userData) GChildWatchFunc; 4631 4632 /** 4633 * Specifies the type of a comparison function used to compare two 4634 * values. The function should return a negative integer if the first 4635 * value comes before the second, 0 if they are equal, or a positive 4636 * integer if the first value comes after the second. 4637 * 4638 * Params: 4639 * a = a value 4640 * b = a value to compare with 4641 * userData = user data 4642 * 4643 * Returns: negative value if @a < @b; zero if @a = @b; positive 4644 * value if @a > @b 4645 */ 4646 public alias extern(C) int function(void* a, void* b, void* userData) GCompareDataFunc; 4647 4648 /** 4649 * Specifies the type of a comparison function used to compare two 4650 * values. The function should return a negative integer if the first 4651 * value comes before the second, 0 if they are equal, or a positive 4652 * integer if the first value comes after the second. 4653 * 4654 * Params: 4655 * a = a value 4656 * b = a value to compare with 4657 * 4658 * Returns: negative value if @a < @b; zero if @a = @b; positive 4659 * value if @a > @b 4660 */ 4661 public alias extern(C) int function(void* a, void* b) GCompareFunc; 4662 4663 /** 4664 * A function of this signature is used to copy the node data 4665 * when doing a deep-copy of a tree. 4666 * 4667 * Params: 4668 * src = A pointer to the data which should be copied 4669 * data = Additional data 4670 * 4671 * Returns: A pointer to the copy 4672 * 4673 * Since: 2.4 4674 */ 4675 public alias extern(C) void* function(void* src, void* data) GCopyFunc; 4676 4677 /** 4678 * Specifies the type of function passed to g_dataset_foreach(). It is 4679 * called with each #GQuark id and associated data element, together 4680 * with the @user_data parameter supplied to g_dataset_foreach(). 4681 * 4682 * Params: 4683 * keyId = the #GQuark id to identifying the data element. 4684 * data = the data element. 4685 * userData = user data passed to g_dataset_foreach(). 4686 */ 4687 public alias extern(C) void function(GQuark keyId, void* data, void* userData) GDataForeachFunc; 4688 4689 /** 4690 * Specifies the type of function which is called when a data element 4691 * is destroyed. It is passed the pointer to the data element and 4692 * should free any memory and resources allocated for it. 4693 * 4694 * Params: 4695 * data = the data element. 4696 */ 4697 public alias extern(C) void function(void* data) GDestroyNotify; 4698 4699 /** 4700 * The type of functions that are used to 'duplicate' an object. 4701 * What this means depends on the context, it could just be 4702 * incrementing the reference count, if @data is a ref-counted 4703 * object. 4704 * 4705 * Params: 4706 * data = the data to duplicate 4707 * userData = user data that was specified in g_datalist_id_dup_data() 4708 * 4709 * Returns: a duplicate of data 4710 */ 4711 public alias extern(C) void* function(void* data, void* userData) GDuplicateFunc; 4712 4713 /** 4714 * Specifies the type of a function used to test two values for 4715 * equality. The function should return %TRUE if both values are equal 4716 * and %FALSE otherwise. 4717 * 4718 * Params: 4719 * a = a value 4720 * b = a value to compare with 4721 * 4722 * Returns: %TRUE if @a = @b; %FALSE otherwise 4723 */ 4724 public alias extern(C) int function(void* a, void* b) GEqualFunc; 4725 4726 /** 4727 * Declares a type of function which takes an arbitrary 4728 * data pointer argument and has no return value. It is 4729 * not currently used in GLib or GTK+. 4730 * 4731 * Params: 4732 * data = a data pointer 4733 */ 4734 public alias extern(C) void function(void* data) GFreeFunc; 4735 4736 /** 4737 * Specifies the type of functions passed to g_list_foreach() and 4738 * g_slist_foreach(). 4739 * 4740 * Params: 4741 * data = the element's data 4742 * userData = user data passed to g_list_foreach() or g_slist_foreach() 4743 */ 4744 public alias extern(C) void function(void* data, void* userData) GFunc; 4745 4746 /** 4747 * Specifies the type of the function passed to g_hash_table_foreach(). 4748 * It is called with each key/value pair, together with the @user_data 4749 * parameter which is passed to g_hash_table_foreach(). 4750 * 4751 * Params: 4752 * key = a key 4753 * value = the value corresponding to the key 4754 * userData = user data passed to g_hash_table_foreach() 4755 */ 4756 public alias extern(C) void function(void* key, void* value, void* userData) GHFunc; 4757 4758 /** 4759 * Specifies the type of the function passed to 4760 * g_hash_table_foreach_remove(). It is called with each key/value 4761 * pair, together with the @user_data parameter passed to 4762 * g_hash_table_foreach_remove(). It should return %TRUE if the 4763 * key/value pair should be removed from the #GHashTable. 4764 * 4765 * Params: 4766 * key = a key 4767 * value = the value associated with the key 4768 * userData = user data passed to g_hash_table_remove() 4769 * 4770 * Returns: %TRUE if the key/value pair should be removed from the 4771 * #GHashTable 4772 */ 4773 public alias extern(C) int function(void* key, void* value, void* userData) GHRFunc; 4774 4775 /** 4776 * Specifies the type of the hash function which is passed to 4777 * g_hash_table_new() when a #GHashTable is created. 4778 * 4779 * The function is passed a key and should return a #guint hash value. 4780 * The functions g_direct_hash(), g_int_hash() and g_str_hash() provide 4781 * hash functions which can be used when the key is a #gpointer, #gint*, 4782 * and #gchar* respectively. 4783 * 4784 * g_direct_hash() is also the appropriate hash function for keys 4785 * of the form `GINT_TO_POINTER (n)` (or similar macros). 4786 * 4787 * <!-- FIXME: Need more here. --> A good hash functions should produce 4788 * hash values that are evenly distributed over a fairly large range. 4789 * The modulus is taken with the hash table size (a prime number) to 4790 * find the 'bucket' to place each key into. The function should also 4791 * be very fast, since it is called for each key lookup. 4792 * 4793 * Note that the hash functions provided by GLib have these qualities, 4794 * but are not particularly robust against manufactured keys that 4795 * cause hash collisions. Therefore, you should consider choosing 4796 * a more secure hash function when using a GHashTable with keys 4797 * that originate in untrusted data (such as HTTP requests). 4798 * Using g_str_hash() in that situation might make your application 4799 * vulerable to 4800 * [Algorithmic Complexity Attacks](https://lwn.net/Articles/474912/). 4801 * 4802 * The key to choosing a good hash is unpredictability. Even 4803 * cryptographic hashes are very easy to find collisions for when the 4804 * remainder is taken modulo a somewhat predictable prime number. There 4805 * must be an element of randomness that an attacker is unable to guess. 4806 * 4807 * Params: 4808 * key = a key 4809 * 4810 * Returns: the hash value corresponding to the key 4811 */ 4812 public alias extern(C) uint function(void* key) GHashFunc; 4813 4814 /** 4815 * Defines the type of a hook function that can be invoked 4816 * by g_hook_list_invoke_check(). 4817 * 4818 * Params: 4819 * data = the data field of the #GHook is passed to the hook function here 4820 * 4821 * Returns: %FALSE if the #GHook should be destroyed 4822 */ 4823 public alias extern(C) int function(void* data) GHookCheckFunc; 4824 4825 /** 4826 * Defines the type of function used by g_hook_list_marshal_check(). 4827 * 4828 * Params: 4829 * hook = a #GHook 4830 * marshalData = user data 4831 * 4832 * Returns: %FALSE if @hook should be destroyed 4833 */ 4834 public alias extern(C) int function(GHook* hook, void* marshalData) GHookCheckMarshaller; 4835 4836 /** 4837 * Defines the type of function used to compare #GHook elements in 4838 * g_hook_insert_sorted(). 4839 * 4840 * Params: 4841 * newHook = the #GHook being inserted 4842 * sibling = the #GHook to compare with @new_hook 4843 * 4844 * Returns: a value <= 0 if @new_hook should be before @sibling 4845 */ 4846 public alias extern(C) int function(GHook* newHook, GHook* sibling) GHookCompareFunc; 4847 4848 /** 4849 * Defines the type of function to be called when a hook in a 4850 * list of hooks gets finalized. 4851 * 4852 * Params: 4853 * hookList = a #GHookList 4854 * hook = the hook in @hook_list that gets finalized 4855 */ 4856 public alias extern(C) void function(GHookList* hookList, GHook* hook) GHookFinalizeFunc; 4857 4858 /** 4859 * Defines the type of the function passed to g_hook_find(). 4860 * 4861 * Params: 4862 * hook = a #GHook 4863 * data = user data passed to g_hook_find_func() 4864 * 4865 * Returns: %TRUE if the required #GHook has been found 4866 */ 4867 public alias extern(C) int function(GHook* hook, void* data) GHookFindFunc; 4868 4869 /** 4870 * Defines the type of a hook function that can be invoked 4871 * by g_hook_list_invoke(). 4872 * 4873 * Params: 4874 * data = the data field of the #GHook is passed to the hook function here 4875 */ 4876 public alias extern(C) void function(void* data) GHookFunc; 4877 4878 /** 4879 * Defines the type of function used by g_hook_list_marshal(). 4880 * 4881 * Params: 4882 * hook = a #GHook 4883 * marshalData = user data 4884 */ 4885 public alias extern(C) void function(GHook* hook, void* marshalData) GHookMarshaller; 4886 4887 /** 4888 * Specifies the type of function passed to g_io_add_watch() or 4889 * g_io_add_watch_full(), which is called when the requested condition 4890 * on a #GIOChannel is satisfied. 4891 * 4892 * Params: 4893 * source = the #GIOChannel event source 4894 * condition = the condition which has been satisfied 4895 * data = user data set in g_io_add_watch() or g_io_add_watch_full() 4896 * 4897 * Returns: the function should return %FALSE if the event source 4898 * should be removed 4899 */ 4900 public alias extern(C) int function(GIOChannel* source, GIOCondition condition, void* data) GIOFunc; 4901 4902 /** 4903 * Specifies the prototype of log handler functions. 4904 * 4905 * The default log handler, g_log_default_handler(), automatically appends a 4906 * new-line character to @message when printing it. It is advised that any 4907 * custom log handler functions behave similarly, so that logging calls in user 4908 * code do not need modifying to add a new-line character to the message if the 4909 * log handler is changed. 4910 * 4911 * This is not used if structured logging is enabled; see 4912 * [Using Structured Logging][using-structured-logging]. 4913 * 4914 * Params: 4915 * logDomain = the log domain of the message 4916 * logLevel = the log level of the message (including the 4917 * fatal and recursion flags) 4918 * message = the message to process 4919 * userData = user data, set in g_log_set_handler() 4920 */ 4921 public alias extern(C) void function(const(char)* logDomain, GLogLevelFlags logLevel, const(char)* message, void* userData) GLogFunc; 4922 4923 /** 4924 * Writer function for log entries. A log entry is a collection of one or more 4925 * #GLogFields, using the standard [field names from journal 4926 * specification](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html). 4927 * See g_log_structured() for more information. 4928 * 4929 * Writer functions must ignore fields which they do not recognise, unless they 4930 * can write arbitrary binary output, as field values may be arbitrary binary. 4931 * 4932 * @log_level is guaranteed to be included in @fields as the `PRIORITY` field, 4933 * but is provided separately for convenience of deciding whether or where to 4934 * output the log entry. 4935 * 4936 * Params: 4937 * logLevel = log level of the message 4938 * fields = fields forming the message 4939 * nFields = number of @fields 4940 * userData = user data passed to g_log_set_writer_func() 4941 * 4942 * Returns: %G_LOG_WRITER_HANDLED if the log entry was handled successfully; 4943 * %G_LOG_WRITER_UNHANDLED otherwise 4944 * 4945 * Since: 2.50 4946 */ 4947 public alias extern(C) GLogWriterOutput function(GLogLevelFlags logLevel, GLogField* fields, size_t nFields, void* userData) GLogWriterFunc; 4948 4949 /** 4950 * Specifies the type of function passed to g_node_children_foreach(). 4951 * The function is called with each child node, together with the user 4952 * data passed to g_node_children_foreach(). 4953 * 4954 * Params: 4955 * node = a #GNode. 4956 * data = user data passed to g_node_children_foreach(). 4957 */ 4958 public alias extern(C) void function(GNode* node, void* data) GNodeForeachFunc; 4959 4960 /** 4961 * Specifies the type of function passed to g_node_traverse(). The 4962 * function is called with each of the nodes visited, together with the 4963 * user data passed to g_node_traverse(). If the function returns 4964 * %TRUE, then the traversal is stopped. 4965 * 4966 * Params: 4967 * node = a #GNode. 4968 * data = user data passed to g_node_traverse(). 4969 * 4970 * Returns: %TRUE to stop the traversal. 4971 */ 4972 public alias extern(C) int function(GNode* node, void* data) GNodeTraverseFunc; 4973 4974 /** 4975 * The type of function to be passed as callback for %G_OPTION_ARG_CALLBACK 4976 * options. 4977 * 4978 * Params: 4979 * optionName = The name of the option being parsed. This will be either a 4980 * single dash followed by a single letter (for a short name) or two dashes 4981 * followed by a long option name. 4982 * value = The value to be parsed. 4983 * data = User data added to the #GOptionGroup containing the option when it 4984 * was created with g_option_group_new() 4985 * 4986 * Returns: %TRUE if the option was successfully parsed, %FALSE if an error 4987 * occurred, in which case @error should be set with g_set_error() 4988 * 4989 * Throws: GException on failure. 4990 */ 4991 public alias extern(C) int function(const(char)* optionName, const(char)* value, void* data, GError** err) GOptionArgFunc; 4992 4993 /** 4994 * The type of function to be used as callback when a parse error occurs. 4995 * 4996 * Params: 4997 * context = The active #GOptionContext 4998 * group = The group to which the function belongs 4999 * data = User data added to the #GOptionGroup containing the option when it 5000 * was created with g_option_group_new() 5001 * 5002 * Throws: GException on failure. 5003 */ 5004 public alias extern(C) void function(GOptionContext* context, GOptionGroup* group, void* data, GError** err) GOptionErrorFunc; 5005 5006 /** 5007 * The type of function that can be called before and after parsing. 5008 * 5009 * Params: 5010 * context = The active #GOptionContext 5011 * group = The group to which the function belongs 5012 * data = User data added to the #GOptionGroup containing the option when it 5013 * was created with g_option_group_new() 5014 * 5015 * Returns: %TRUE if the function completed successfully, %FALSE if an error 5016 * occurred, in which case @error should be set with g_set_error() 5017 * 5018 * Throws: GException on failure. 5019 */ 5020 public alias extern(C) int function(GOptionContext* context, GOptionGroup* group, void* data, GError** err) GOptionParseFunc; 5021 5022 /** 5023 * Specifies the type of function passed to g_main_context_set_poll_func(). 5024 * The semantics of the function should match those of the poll() system call. 5025 * 5026 * Params: 5027 * ufds = an array of #GPollFD elements 5028 * nfsd = the number of elements in @ufds 5029 * timeout = the maximum time to wait for an event of the file descriptors. 5030 * A negative value indicates an infinite timeout. 5031 * 5032 * Returns: the number of #GPollFD elements which have events or errors 5033 * reported, or -1 if an error occurred. 5034 */ 5035 public alias extern(C) int function(GPollFD* ufds, uint nfsd, int timeout) GPollFunc; 5036 5037 /** 5038 * Specifies the type of the print handler functions. 5039 * These are called with the complete formatted string to output. 5040 * 5041 * Params: 5042 * str = the message to output 5043 */ 5044 public alias extern(C) void function(const(char)* str) GPrintFunc; 5045 5046 /** 5047 * Specifies the type of the function passed to g_regex_replace_eval(). 5048 * It is called for each occurrence of the pattern in the string passed 5049 * to g_regex_replace_eval(), and it should append the replacement to 5050 * @result. 5051 * 5052 * Params: 5053 * matchInfo = the #GMatchInfo generated by the match. 5054 * Use g_match_info_get_regex() and g_match_info_get_string() if you 5055 * need the #GRegex or the matched string. 5056 * result = a #GString containing the new string 5057 * userData = user data passed to g_regex_replace_eval() 5058 * 5059 * Returns: %FALSE to continue the replacement process, %TRUE to stop it 5060 * 5061 * Since: 2.14 5062 */ 5063 public alias extern(C) int function(GMatchInfo* matchInfo, GString* result, void* userData) GRegexEvalCallback; 5064 5065 /** 5066 * Specifies the type of the message handler function. 5067 * 5068 * Params: 5069 * scanner = a #GScanner 5070 * message = the message 5071 * error = %TRUE if the message signals an error, 5072 * %FALSE if it signals a warning. 5073 */ 5074 public alias extern(C) void function(GScanner* scanner, char* message, int error) GScannerMsgFunc; 5075 5076 /** 5077 * A #GSequenceIterCompareFunc is a function used to compare iterators. 5078 * It must return zero if the iterators compare equal, a negative value 5079 * if @a comes before @b, and a positive value if @b comes before @a. 5080 * 5081 * Params: 5082 * a = a #GSequenceIter 5083 * b = a #GSequenceIter 5084 * data = user data 5085 * 5086 * Returns: zero if the iterators are equal, a negative value if @a 5087 * comes before @b, and a positive value if @b comes before @a. 5088 */ 5089 public alias extern(C) int function(GSequenceIter* a, GSequenceIter* b, void* data) GSequenceIterCompareFunc; 5090 5091 /** 5092 * This is just a placeholder for #GClosureMarshal, 5093 * which cannot be used here for dependency reasons. 5094 */ 5095 public alias extern(C) void function() GSourceDummyMarshal; 5096 5097 /** 5098 * Specifies the type of function passed to g_timeout_add(), 5099 * g_timeout_add_full(), g_idle_add(), and g_idle_add_full(). 5100 * 5101 * Params: 5102 * userData = data passed to the function, set when the source was 5103 * created with one of the above functions 5104 * 5105 * Returns: %FALSE if the source should be removed. #G_SOURCE_CONTINUE and 5106 * #G_SOURCE_REMOVE are more memorable names for the return value. 5107 */ 5108 public alias extern(C) int function(void* userData) GSourceFunc; 5109 5110 /** 5111 * Specifies the type of the setup function passed to g_spawn_async(), 5112 * g_spawn_sync() and g_spawn_async_with_pipes(), which can, in very 5113 * limited ways, be used to affect the child's execution. 5114 * 5115 * On POSIX platforms, the function is called in the child after GLib 5116 * has performed all the setup it plans to perform, but before calling 5117 * exec(). Actions taken in this function will only affect the child, 5118 * not the parent. 5119 * 5120 * On Windows, the function is called in the parent. Its usefulness on 5121 * Windows is thus questionable. In many cases executing the child setup 5122 * function in the parent can have ill effects, and you should be very 5123 * careful when porting software to Windows that uses child setup 5124 * functions. 5125 * 5126 * However, even on POSIX, you are extremely limited in what you can 5127 * safely do from a #GSpawnChildSetupFunc, because any mutexes that were 5128 * held by other threads in the parent process at the time of the fork() 5129 * will still be locked in the child process, and they will never be 5130 * unlocked (since the threads that held them don't exist in the child). 5131 * POSIX allows only async-signal-safe functions (see signal(7)) to be 5132 * called in the child between fork() and exec(), which drastically limits 5133 * the usefulness of child setup functions. 5134 * 5135 * In particular, it is not safe to call any function which may 5136 * call malloc(), which includes POSIX functions such as setenv(). 5137 * If you need to set up the child environment differently from 5138 * the parent, you should use g_get_environ(), g_environ_setenv(), 5139 * and g_environ_unsetenv(), and then pass the complete environment 5140 * list to the `g_spawn...` function. 5141 * 5142 * Params: 5143 * userData = user data to pass to the function. 5144 */ 5145 public alias extern(C) void function(void* userData) GSpawnChildSetupFunc; 5146 5147 /** 5148 * The type used for test case functions that take an extra pointer 5149 * argument. 5150 * 5151 * Params: 5152 * userData = the data provided when registering the test 5153 * 5154 * Since: 2.28 5155 */ 5156 public alias extern(C) void function(void* userData) GTestDataFunc; 5157 5158 /** 5159 * The type used for functions that operate on test fixtures. This is 5160 * used for the fixture setup and teardown functions as well as for the 5161 * testcases themselves. 5162 * 5163 * @user_data is a pointer to the data that was given when registering 5164 * the test case. 5165 * 5166 * @fixture will be a pointer to the area of memory allocated by the 5167 * test framework, of the size requested. If the requested size was 5168 * zero then @fixture will be equal to @user_data. 5169 * 5170 * Params: 5171 * fixture = the test fixture 5172 * userData = the data provided when registering the test 5173 * 5174 * Since: 2.28 5175 */ 5176 public alias extern(C) void function(void* fixture, void* userData) GTestFixtureFunc; 5177 5178 /** 5179 * The type used for test case functions. 5180 * 5181 * Since: 2.28 5182 */ 5183 public alias extern(C) void function() GTestFunc; 5184 5185 /** 5186 * Specifies the prototype of fatal log handler functions. 5187 * 5188 * Params: 5189 * logDomain = the log domain of the message 5190 * logLevel = the log level of the message (including the fatal and recursion flags) 5191 * message = the message to process 5192 * userData = user data, set in g_test_log_set_fatal_handler() 5193 * 5194 * Returns: %TRUE if the program should abort, %FALSE otherwise 5195 * 5196 * Since: 2.22 5197 */ 5198 public alias extern(C) int function(const(char)* logDomain, GLogLevelFlags logLevel, const(char)* message, void* userData) GTestLogFatalFunc; 5199 5200 /** 5201 * Specifies the type of the @func functions passed to g_thread_new() 5202 * or g_thread_try_new(). 5203 * 5204 * Params: 5205 * data = data passed to the thread 5206 * 5207 * Returns: the return value of the thread 5208 */ 5209 public alias extern(C) void* function(void* data) GThreadFunc; 5210 5211 /** 5212 * The type of functions which are used to translate user-visible 5213 * strings, for <option>--help</option> output. 5214 * 5215 * Params: 5216 * str = the untranslated string 5217 * data = user data specified when installing the function, e.g. 5218 * in g_option_group_set_translate_func() 5219 * 5220 * Returns: a translation of the string for the current locale. 5221 * The returned string is owned by GLib and must not be freed. 5222 */ 5223 public alias extern(C) const(char)* function(const(char)* str, void* data) GTranslateFunc; 5224 5225 /** 5226 * Specifies the type of function passed to g_tree_traverse(). It is 5227 * passed the key and value of each node, together with the @user_data 5228 * parameter passed to g_tree_traverse(). If the function returns 5229 * %TRUE, the traversal is stopped. 5230 * 5231 * Params: 5232 * key = a key of a #GTree node 5233 * value = the value corresponding to the key 5234 * data = user data passed to g_tree_traverse() 5235 * 5236 * Returns: %TRUE to stop the traversal 5237 */ 5238 public alias extern(C) int function(void* key, void* value, void* data) GTraverseFunc; 5239 5240 /** 5241 * The type of functions to be called when a UNIX fd watch source 5242 * triggers. 5243 * 5244 * Params: 5245 * fd = the fd that triggered the event 5246 * condition = the IO conditions reported on @fd 5247 * userData = user data passed to g_unix_fd_add() 5248 * 5249 * Returns: %FALSE if the source should be removed 5250 */ 5251 public alias extern(C) int function(int fd, GIOCondition condition, void* userData) GUnixFDSourceFunc; 5252 5253 /** 5254 * Declares a type of function which takes no arguments 5255 * and has no return value. It is used to specify the type 5256 * function passed to g_atexit(). 5257 */ 5258 public alias extern(C) void function() GVoidFunc; 5259 5260 /** 5261 * Specifies the type of the module initialization function. 5262 * If a module contains a function named g_module_check_init() it is called 5263 * automatically when the module is loaded. It is passed the #GModule structure 5264 * and should return %NULL on success or a string describing the initialization 5265 * error. 5266 * 5267 * Params: 5268 * modul = the #GModule corresponding to the module which has just been loaded 5269 * 5270 * Returns: %NULL on success, or a string describing the initialization error 5271 */ 5272 public alias extern(C) const(char)* function(GModule* modul) GModuleCheckInit; 5273 5274 /** 5275 * Specifies the type of the module function called when it is unloaded. 5276 * If a module contains a function named g_module_unload() it is called 5277 * automatically when the module is unloaded. 5278 * It is passed the #GModule structure. 5279 * 5280 * Params: 5281 * modul = the #GModule about to be unloaded 5282 */ 5283 public alias extern(C) void function(GModule* modul) GModuleUnload;