;; From glib/gconvert.h

(define-enum-extended ConvertError
  (in-module "G")
  (c-name "GConvertError")
  (values
    '("no-conversion" "G_CONVERT_ERROR_NO_CONVERSION" "0")
    '("illegal-sequence" "G_CONVERT_ERROR_ILLEGAL_SEQUENCE" "1")
    '("failed" "G_CONVERT_ERROR_FAILED" "2")
    '("partial-input" "G_CONVERT_ERROR_PARTIAL_INPUT" "3")
    '("bad-uri" "G_CONVERT_ERROR_BAD_URI" "4")
    '("not-absolute-path" "G_CONVERT_ERROR_NOT_ABSOLUTE_PATH" "5")
  )
)

;; From glib/gdate.h

(define-enum-extended DateDMY
  (in-module "G")
  (c-name "GDateDMY")
  (values
    '("day" "G_DATE_DAY" "0")
    '("month" "G_DATE_MONTH" "1")
    '("year" "G_DATE_YEAR" "2")
  )
)

(define-enum-extended DateWeekday
  (in-module "G")
  (c-name "GDateWeekday")
  (values
    '("bad-weekday" "G_DATE_BAD_WEEKDAY" "0")
    '("monday" "G_DATE_MONDAY" "1")
    '("tuesday" "G_DATE_TUESDAY" "2")
    '("wednesday" "G_DATE_WEDNESDAY" "3")
    '("thursday" "G_DATE_THURSDAY" "4")
    '("friday" "G_DATE_FRIDAY" "5")
    '("saturday" "G_DATE_SATURDAY" "6")
    '("sunday" "G_DATE_SUNDAY" "7")
  )
)

(define-enum-extended DateMonth
  (in-module "G")
  (c-name "GDateMonth")
  (values
    '("bad-month" "G_DATE_BAD_MONTH" "0")
    '("january" "G_DATE_JANUARY" "1")
    '("february" "G_DATE_FEBRUARY" "2")
    '("march" "G_DATE_MARCH" "3")
    '("april" "G_DATE_APRIL" "4")
    '("may" "G_DATE_MAY" "5")
    '("june" "G_DATE_JUNE" "6")
    '("july" "G_DATE_JULY" "7")
    '("august" "G_DATE_AUGUST" "8")
    '("september" "G_DATE_SEPTEMBER" "9")
    '("october" "G_DATE_OCTOBER" "10")
    '("november" "G_DATE_NOVEMBER" "11")
    '("december" "G_DATE_DECEMBER" "12")
  )
)

;; From glib/gfileutils.h

(define-enum-extended FileError
  (in-module "G")
  (c-name "GFileError")
  (values
    '("exist" "G_FILE_ERROR_EXIST" "0")
    '("isdir" "G_FILE_ERROR_ISDIR" "1")
    '("acces" "G_FILE_ERROR_ACCES" "2")
    '("nametoolong" "G_FILE_ERROR_NAMETOOLONG" "3")
    '("noent" "G_FILE_ERROR_NOENT" "4")
    '("notdir" "G_FILE_ERROR_NOTDIR" "5")
    '("nxio" "G_FILE_ERROR_NXIO" "6")
    '("nodev" "G_FILE_ERROR_NODEV" "7")
    '("rofs" "G_FILE_ERROR_ROFS" "8")
    '("txtbsy" "G_FILE_ERROR_TXTBSY" "9")
    '("fault" "G_FILE_ERROR_FAULT" "10")
    '("loop" "G_FILE_ERROR_LOOP" "11")
    '("nospc" "G_FILE_ERROR_NOSPC" "12")
    '("nomem" "G_FILE_ERROR_NOMEM" "13")
    '("mfile" "G_FILE_ERROR_MFILE" "14")
    '("nfile" "G_FILE_ERROR_NFILE" "15")
    '("badf" "G_FILE_ERROR_BADF" "16")
    '("inval" "G_FILE_ERROR_INVAL" "17")
    '("pipe" "G_FILE_ERROR_PIPE" "18")
    '("again" "G_FILE_ERROR_AGAIN" "19")
    '("intr" "G_FILE_ERROR_INTR" "20")
    '("io" "G_FILE_ERROR_IO" "21")
    '("perm" "G_FILE_ERROR_PERM" "22")
    '("failed" "G_FILE_ERROR_FAILED" "23")
  )
)

(define-flags-extended FileTest
  (in-module "G")
  (c-name "GFileTest")
  (values
    '("is-regular" "G_FILE_TEST_IS_REGULAR" "1 << 0")
    '("is-symlink" "G_FILE_TEST_IS_SYMLINK" "1 << 1")
    '("is-dir" "G_FILE_TEST_IS_DIR" "1 << 2")
    '("is-executable" "G_FILE_TEST_IS_EXECUTABLE" "1 << 3")
    '("exists" "G_FILE_TEST_EXISTS" "1 << 4")
  )
)

;; From glib/ghook.h

(define-flags-extended HookFlagMask
  (in-module "G")
  (c-name "GHookFlagMask")
  (values
    '("active" "G_HOOK_FLAG_ACTIVE" "1 << 0")
    '("in-call" "G_HOOK_FLAG_IN_CALL" "1 << 1")
    '("mask" "G_HOOK_FLAG_MASK" "0x0f")
  )
)

;; From glib/giochannel.h

(define-enum-extended IOError
  (in-module "G")
  (c-name "GIOError")
  (values
    '("none" "G_IO_ERROR_NONE" "0")
    '("again" "G_IO_ERROR_AGAIN" "1")
    '("inval" "G_IO_ERROR_INVAL" "2")
    '("unknown" "G_IO_ERROR_UNKNOWN" "3")
  )
)

(define-enum-extended IOChannelError
  (in-module "G")
  (c-name "GIOChannelError")
  (values
    '("fbig" "G_IO_CHANNEL_ERROR_FBIG" "0")
    '("inval" "G_IO_CHANNEL_ERROR_INVAL" "1")
    '("io" "G_IO_CHANNEL_ERROR_IO" "2")
    '("isdir" "G_IO_CHANNEL_ERROR_ISDIR" "3")
    '("nospc" "G_IO_CHANNEL_ERROR_NOSPC" "4")
    '("nxio" "G_IO_CHANNEL_ERROR_NXIO" "5")
    '("overflow" "G_IO_CHANNEL_ERROR_OVERFLOW" "6")
    '("pipe" "G_IO_CHANNEL_ERROR_PIPE" "7")
    '("failed" "G_IO_CHANNEL_ERROR_FAILED" "8")
  )
)

(define-enum-extended IOStatus
  (in-module "G")
  (c-name "GIOStatus")
  (values
    '("error" "G_IO_STATUS_ERROR" "0")
    '("normal" "G_IO_STATUS_NORMAL" "1")
    '("eof" "G_IO_STATUS_EOF" "2")
    '("again" "G_IO_STATUS_AGAIN" "3")
  )
)

(define-enum-extended SeekType
  (in-module "G")
  (c-name "GSeekType")
  (values
    '("cur" "G_SEEK_CUR" "0")
    '("set" "G_SEEK_SET" "1")
    '("end" "G_SEEK_END" "2")
  )
)

(define-enum-extended IOCondition
  (in-module "G")
  (c-name "GIOCondition")
  (values
  )
)

(define-flags-extended IOFlags
  (in-module "G")
  (c-name "GIOFlags")
  (values
    '("append" "G_IO_FLAG_APPEND" "1 << 0")
    '("nonblock" "G_IO_FLAG_NONBLOCK" "1 << 1")
    '("is-readable" "G_IO_FLAG_IS_READABLE" "1 << 2")
    '("is-writeable" "G_IO_FLAG_IS_WRITEABLE" "1 << 3")
    '("is-seekable" "G_IO_FLAG_IS_SEEKABLE" "1 << 4")
    '("mask" "G_IO_FLAG_MASK" "0x1F")
    '("get-mask" "G_IO_FLAG_GET_MASK" "0x1F")
    '("set-mask" "G_IO_FLAG_SET_MASK" "0x03")
  )
)

;; From glib/gmarkup.h

(define-enum-extended MarkupError
  (in-module "G")
  (c-name "GMarkupError")
  (values
    '("bad-utf8" "G_MARKUP_ERROR_BAD_UTF8" "0")
    '("empty" "G_MARKUP_ERROR_EMPTY" "1")
    '("parse" "G_MARKUP_ERROR_PARSE" "2")
    '("unknown-element" "G_MARKUP_ERROR_UNKNOWN_ELEMENT" "3")
    '("unknown-attribute" "G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE" "4")
    '("invalid-content" "G_MARKUP_ERROR_INVALID_CONTENT" "5")
  )
)

(define-flags-extended MarkupParseFlags
  (in-module "G")
  (c-name "GMarkupParseFlags")
  (values
    '("g" "G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG" "1 << 0")
  )
)

;; From glib/gmessages.h

(define-flags-extended LogLevelFlags
  (in-module "G")
  (c-name "GLogLevelFlags")
  (values
    '("flag-recursion" "G_LOG_FLAG_RECURSION" "1 << 0")
    '("flag-fatal" "G_LOG_FLAG_FATAL" "1 << 1")
    '("level-error" "G_LOG_LEVEL_ERROR" "1 << 2")
    '("level-critical" "G_LOG_LEVEL_CRITICAL" "1 << 3")
    '("level-warning" "G_LOG_LEVEL_WARNING" "1 << 4")
    '("level-message" "G_LOG_LEVEL_MESSAGE" "1 << 5")
    '("level-info" "G_LOG_LEVEL_INFO" "1 << 6")
    '("level-debug" "G_LOG_LEVEL_DEBUG" "1 << 7")
    '("level-mask" "G_LOG_LEVEL_MASK" "0xFFFFFFFE")
  )
)

;; From glib/gnode.h

(define-flags-extended TraverseFlags
  (in-module "G")
  (c-name "GTraverseFlags")
  (values
    '("leafs" "G_TRAVERSE_LEAFS" "1 << 0")
    '("non-leafs" "G_TRAVERSE_NON_LEAFS" "1 << 1")
    '("all" "G_TRAVERSE_ALL" "0x1")
    '("mask" "G_TRAVERSE_MASK" "0x03")
  )
)

(define-enum-extended TraverseType
  (in-module "G")
  (c-name "GTraverseType")
  (values
    '("in-order" "G_IN_ORDER" "0")
    '("pre-order" "G_PRE_ORDER" "1")
    '("post-order" "G_POST_ORDER" "2")
    '("level-order" "G_LEVEL_ORDER" "3")
  )
)

;; From glib/gscanner.h

(define-enum-extended ErrorType
  (in-module "G")
  (c-name "GErrorType")
  (values
    '("unknown" "G_ERR_UNKNOWN" "0")
    '("unexp-eof" "G_ERR_UNEXP_EOF" "1")
    '("unexp-eof-in-string" "G_ERR_UNEXP_EOF_IN_STRING" "2")
    '("unexp-eof-in-comment" "G_ERR_UNEXP_EOF_IN_COMMENT" "3")
    '("non-digit-in-const" "G_ERR_NON_DIGIT_IN_CONST" "4")
    '("digit-radix" "G_ERR_DIGIT_RADIX" "5")
    '("float-radix" "G_ERR_FLOAT_RADIX" "6")
    '("float-malformed" "G_ERR_FLOAT_MALFORMED" "7")
  )
)

;;(define-enum-extended TokenType
;;  (in-module "G")
;;  (c-name "GTokenType")
;;  (values
;;    '("eof" "G_TOKEN_EOF" "0")
;;    '("left-paren" "G_TOKEN_LEFT_PAREN" "'('")
;;    '("right-paren" "G_TOKEN_RIGHT_PAREN" "')'")
;;    '("left-curly" "G_TOKEN_LEFT_CURLY" "'{'")
;;    '("right-curly" "G_TOKEN_RIGHT_CURLY" "']'")
;;    '("left-brace" "G_TOKEN_LEFT_BRACE" "'['")
;;    '("right-brace" "G_TOKEN_RIGHT_BRACE" "']'")
;;    '("equal-sign" "G_TOKEN_EQUAL_SIGN" "'='")
;;    '("comma" "G_TOKEN_COMMA" "','")
;;    '("none" "G_TOKEN_NONE" "256")
;;    '("error" "G_TOKEN_ERROR" "257")
;;    '("char" "G_TOKEN_CHAR" "258")
;;    '("binary" "G_TOKEN_BINARY" "259")
;;    '("octal" "G_TOKEN_OCTAL" "260")
;;    '("int" "G_TOKEN_INT" "261")
;;    '("hex" "G_TOKEN_HEX" "262")
;;    '("float" "G_TOKEN_FLOAT" "263")
;;    '("string" "G_TOKEN_STRING" "264")
;;    '("symbol" "G_TOKEN_SYMBOL" "265")
;;    '("identifier" "G_TOKEN_IDENTIFIER" "266")
;;    '("identifier-null" "G_TOKEN_IDENTIFIER_NULL" "267")
;;    '("comment-single" "G_TOKEN_COMMENT_SINGLE" "268")
;;    '("comment-multi" "G_TOKEN_COMMENT_MULTI" "269")
;;    '("last" "G_TOKEN_LAST" "270")
;;  )
;;)

;; From glib/gshell.h

(define-enum-extended ShellError
  (in-module "G")
  (c-name "GShellError")
  (values
    '("bad-quoting" "G_SHELL_ERROR_BAD_QUOTING" "0")
    '("empty-string" "G_SHELL_ERROR_EMPTY_STRING" "1")
    '("failed" "G_SHELL_ERROR_FAILED" "2")
  )
)

;; From glib/gspawn.h

(define-enum-extended SpawnError
  (in-module "G")
  (c-name "GSpawnError")
  (values
    '("fork" "G_SPAWN_ERROR_FORK" "0")
    '("read" "G_SPAWN_ERROR_READ" "1")
    '("chdir" "G_SPAWN_ERROR_CHDIR" "2")
    '("acces" "G_SPAWN_ERROR_ACCES" "3")
    '("perm" "G_SPAWN_ERROR_PERM" "4")
    '("2big" "G_SPAWN_ERROR_2BIG" "5")
    '("noexec" "G_SPAWN_ERROR_NOEXEC" "6")
    '("nametoolong" "G_SPAWN_ERROR_NAMETOOLONG" "7")
    '("noent" "G_SPAWN_ERROR_NOENT" "8")
    '("nomem" "G_SPAWN_ERROR_NOMEM" "9")
    '("notdir" "G_SPAWN_ERROR_NOTDIR" "10")
    '("loop" "G_SPAWN_ERROR_LOOP" "11")
    '("txtbusy" "G_SPAWN_ERROR_TXTBUSY" "12")
    '("io" "G_SPAWN_ERROR_IO" "13")
    '("nfile" "G_SPAWN_ERROR_NFILE" "14")
    '("mfile" "G_SPAWN_ERROR_MFILE" "15")
    '("inval" "G_SPAWN_ERROR_INVAL" "16")
    '("isdir" "G_SPAWN_ERROR_ISDIR" "17")
    '("libbad" "G_SPAWN_ERROR_LIBBAD" "18")
  )
)

(define-flags-extended SpawnFlags
  (in-module "G")
  (c-name "GSpawnFlags")
  (values
    '("leave-descriptors-open" "G_SPAWN_LEAVE_DESCRIPTORS_OPEN" "1 << 0")
    '("do-not-reap-child" "G_SPAWN_DO_NOT_REAP_CHILD" "1 << 1")
    '("search-path" "G_SPAWN_SEARCH_PATH" "1 << 2")
    '("stdout-to-dev-null" "G_SPAWN_STDOUT_TO_DEV_NULL" "1 << 3")
    '("stderr-to-dev-null" "G_SPAWN_STDERR_TO_DEV_NULL" "1 << 4")
    '("child-inherits-stdin" "G_SPAWN_CHILD_INHERITS_STDIN" "1 << 5")
    '("file-and-argv-zero" "G_SPAWN_FILE_AND_ARGV_ZERO" "1 << 6")
  )
)

;; From glib/gstrfuncs.h

(define-enum-extended AsciiType
  (in-module "G")
  (c-name "GAsciiType")
  (values
    '("alnum" "G_ASCII_ALNUM" "1 << 0")
    '("alpha" "G_ASCII_ALPHA" "1 << 1")
    '("cntrl" "G_ASCII_CNTRL" "1 << 2")
    '("digit" "G_ASCII_DIGIT" "1 << 3")
    '("graph" "G_ASCII_GRAPH" "1 << 4")
    '("lower" "G_ASCII_LOWER" "1 << 5")
    '("print" "G_ASCII_PRINT" "1 << 6")
    '("punct" "G_ASCII_PUNCT" "1 << 7")
    '("space" "G_ASCII_SPACE" "1 << 8")
    '("upper" "G_ASCII_UPPER" "1 << 9")
    '("xdigit" "G_ASCII_XDIGIT" "1 << 10")
  )
)

;; From glib/gthread.h

(define-enum-extended ThreadError
  (in-module "G")
  (c-name "GThreadError")
  (values
    '("n" "G_THREAD_ERROR_AGAIN" "0")
  )
)

(define-enum-extended ThreadPriority
  (in-module "G")
  (c-name "GThreadPriority")
  (values
    '("low" "G_THREAD_PRIORITY_LOW" "0")
    '("normal" "G_THREAD_PRIORITY_NORMAL" "1")
    '("high" "G_THREAD_PRIORITY_HIGH" "2")
    '("urgent" "G_THREAD_PRIORITY_URGENT" "3")
  )
)

;; From glib/gunicode.h

(define-enum-extended UnicodeType
  (in-module "G")
  (c-name "GUnicodeType")
  (values
    '("control" "G_UNICODE_CONTROL" "0")
    '("format" "G_UNICODE_FORMAT" "1")
    '("unassigned" "G_UNICODE_UNASSIGNED" "2")
    '("private-use" "G_UNICODE_PRIVATE_USE" "3")
    '("surrogate" "G_UNICODE_SURROGATE" "4")
    '("lowercase-letter" "G_UNICODE_LOWERCASE_LETTER" "5")
    '("modifier-letter" "G_UNICODE_MODIFIER_LETTER" "6")
    '("other-letter" "G_UNICODE_OTHER_LETTER" "7")
    '("titlecase-letter" "G_UNICODE_TITLECASE_LETTER" "8")
    '("uppercase-letter" "G_UNICODE_UPPERCASE_LETTER" "9")
    '("combining-mark" "G_UNICODE_COMBINING_MARK" "10")
    '("enclosing-mark" "G_UNICODE_ENCLOSING_MARK" "11")
    '("non-spacing-mark" "G_UNICODE_NON_SPACING_MARK" "12")
    '("decimal-number" "G_UNICODE_DECIMAL_NUMBER" "13")
    '("letter-number" "G_UNICODE_LETTER_NUMBER" "14")
    '("other-number" "G_UNICODE_OTHER_NUMBER" "15")
    '("connect-punctuation" "G_UNICODE_CONNECT_PUNCTUATION" "16")
    '("dash-punctuation" "G_UNICODE_DASH_PUNCTUATION" "17")
    '("close-punctuation" "G_UNICODE_CLOSE_PUNCTUATION" "18")
    '("final-punctuation" "G_UNICODE_FINAL_PUNCTUATION" "19")
    '("initial-punctuation" "G_UNICODE_INITIAL_PUNCTUATION" "20")
    '("other-punctuation" "G_UNICODE_OTHER_PUNCTUATION" "21")
    '("open-punctuation" "G_UNICODE_OPEN_PUNCTUATION" "22")
    '("currency-symbol" "G_UNICODE_CURRENCY_SYMBOL" "23")
    '("modifier-symbol" "G_UNICODE_MODIFIER_SYMBOL" "24")
    '("math-symbol" "G_UNICODE_MATH_SYMBOL" "25")
    '("other-symbol" "G_UNICODE_OTHER_SYMBOL" "26")
    '("line-separator" "G_UNICODE_LINE_SEPARATOR" "27")
    '("paragraph-separator" "G_UNICODE_PARAGRAPH_SEPARATOR" "28")
    '("space-separator" "G_UNICODE_SPACE_SEPARATOR" "29")
  )
)

(define-enum-extended UnicodeBreakType
  (in-module "G")
  (c-name "GUnicodeBreakType")
  (values
    '("mandatory" "G_UNICODE_BREAK_MANDATORY" "0")
    '("carriage-return" "G_UNICODE_BREAK_CARRIAGE_RETURN" "1")
    '("line-feed" "G_UNICODE_BREAK_LINE_FEED" "2")
    '("combining-mark" "G_UNICODE_BREAK_COMBINING_MARK" "3")
    '("surrogate" "G_UNICODE_BREAK_SURROGATE" "4")
    '("zero-width-space" "G_UNICODE_BREAK_ZERO_WIDTH_SPACE" "5")
    '("inseparable" "G_UNICODE_BREAK_INSEPARABLE" "6")
    '("non-breaking-glue" "G_UNICODE_BREAK_NON_BREAKING_GLUE" "7")
    '("contingent" "G_UNICODE_BREAK_CONTINGENT" "8")
    '("space" "G_UNICODE_BREAK_SPACE" "9")
    '("after" "G_UNICODE_BREAK_AFTER" "10")
    '("before" "G_UNICODE_BREAK_BEFORE" "11")
    '("before-and-after" "G_UNICODE_BREAK_BEFORE_AND_AFTER" "12")
    '("hyphen" "G_UNICODE_BREAK_HYPHEN" "13")
    '("non-starter" "G_UNICODE_BREAK_NON_STARTER" "14")
    '("open-punctuation" "G_UNICODE_BREAK_OPEN_PUNCTUATION" "15")
    '("close-punctuation" "G_UNICODE_BREAK_CLOSE_PUNCTUATION" "16")
    '("quotation" "G_UNICODE_BREAK_QUOTATION" "17")
    '("exclamation" "G_UNICODE_BREAK_EXCLAMATION" "18")
    '("ideographic" "G_UNICODE_BREAK_IDEOGRAPHIC" "19")
    '("numeric" "G_UNICODE_BREAK_NUMERIC" "20")
    '("infix-separator" "G_UNICODE_BREAK_INFIX_SEPARATOR" "21")
    '("symbol" "G_UNICODE_BREAK_SYMBOL" "22")
    '("alphabetic" "G_UNICODE_BREAK_ALPHABETIC" "23")
    '("prefix" "G_UNICODE_BREAK_PREFIX" "24")
    '("postfix" "G_UNICODE_BREAK_POSTFIX" "25")
    '("complex-context" "G_UNICODE_BREAK_COMPLEX_CONTEXT" "26")
    '("ambiguous" "G_UNICODE_BREAK_AMBIGUOUS" "27")
    '("unknown" "G_UNICODE_BREAK_UNKNOWN" "28")
  )
)

(define-enum-extended NormalizeMode
  (in-module "G")
  (c-name "GNormalizeMode")
  (values
    '("default" "G_NORMALIZE_DEFAULT" "0")
    '("nfd" "G_NORMALIZE_NFD" "0")
    '("default-compose" "G_NORMALIZE_DEFAULT_COMPOSE" "1")
    '("nfc" "G_NORMALIZE_NFC" "1")
    '("all" "G_NORMALIZE_ALL" "2")
    '("nfkd" "G_NORMALIZE_NFKD" "2")
    '("all-compose" "G_NORMALIZE_ALL_COMPOSE" "3")
    '("nfkc" "G_NORMALIZE_NFKC" "3")
  )
)

