;; From gdk-pixbuf-core.h

;; Original typedef:
;; typedef enum
;; {
;;         GDK_PIXBUF_ALPHA_BILEVEL,
;;         GDK_PIXBUF_ALPHA_FULL
;; } GdkPixbufAlphaMode;

(define-enum-extended PixbufAlphaMode
  (in-module "Gdk")
  (c-name "GdkPixbufAlphaMode")
  (values
    '("bilevel" "GDK_PIXBUF_ALPHA_BILEVEL" "0")
    '("full" "GDK_PIXBUF_ALPHA_FULL" "1")
  )
)

;; Original typedef:
;; typedef enum {
;; 	GDK_COLORSPACE_RGB
;; } GdkColorspace;

(define-enum-extended Colorspace
  (in-module "Gdk")
  (c-name "GdkColorspace")
  (values
    '("rgb" "GDK_COLORSPACE_RGB" "0")
  )
)

;; Original typedef:
;; typedef enum {
;;         /* image data hosed */
;;         GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
;;         /* no mem to load image */
;;         GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
;;         /* bad option passed to save routine */
;;         GDK_PIXBUF_ERROR_BAD_OPTION,
;;         /* unsupported image type (sort of an ENOSYS) */
;;         GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
;;         /* unsupported operation (load, save) for image type */
;;         GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
;;         GDK_PIXBUF_ERROR_FAILED,
;;         GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION
;; } GdkPixbufError;

(define-enum-extended PixbufError
  (in-module "Gdk")
  (c-name "GdkPixbufError")
  (values
    '("corrupt-image" "GDK_PIXBUF_ERROR_CORRUPT_IMAGE" "0")
    '("insufficient-memory" "GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY" "1")
    '("bad-option" "GDK_PIXBUF_ERROR_BAD_OPTION" "2")
    '("unknown-type" "GDK_PIXBUF_ERROR_UNKNOWN_TYPE" "3")
    '("unsupported-operation" "GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION" "4")
    '("failed" "GDK_PIXBUF_ERROR_FAILED" "5")
    '("incomplete-animation" "GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION" "6")
  )
)

;; From gdk-pixbuf-io.h

;; Original typedef:
;; typedef enum /*< skip >*/
;; {
;;   GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0,
;;   GDK_PIXBUF_FORMAT_SCALABLE = 1 << 1,
;;   GDK_PIXBUF_FORMAT_THREADSAFE = 1 << 2
;; } GdkPixbufFormatFlags;

(define-flags-extended PixbufFormatFlags
  (in-module "Gdk")
  (c-name "GdkPixbufFormatFlags")
  (values
    '("writable" "GDK_PIXBUF_FORMAT_WRITABLE" "1 << 0")
    '("scalable" "GDK_PIXBUF_FORMAT_SCALABLE" "1 << 1")
    '("threadsafe" "GDK_PIXBUF_FORMAT_THREADSAFE" "1 << 2")
  )
)

;; From gdk-pixbuf-transform.h

;; Original typedef:
;; typedef enum {
;; 	GDK_INTERP_NEAREST,
;; 	GDK_INTERP_TILES,
;; 	GDK_INTERP_BILINEAR,
;; 	GDK_INTERP_HYPER
;; } GdkInterpType;

(define-enum-extended InterpType
  (in-module "Gdk")
  (c-name "GdkInterpType")
  (values
    '("nearest" "GDK_INTERP_NEAREST" "0")
    '("tiles" "GDK_INTERP_TILES" "1")
    '("bilinear" "GDK_INTERP_BILINEAR" "2")
    '("hyper" "GDK_INTERP_HYPER" "3")
  )
)

;; Original typedef:
;; typedef enum {
;; 	GDK_PIXBUF_ROTATE_NONE             =   0,
;; 	GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE =  90,
;; 	GDK_PIXBUF_ROTATE_UPSIDEDOWN       = 180,
;; 	GDK_PIXBUF_ROTATE_CLOCKWISE        = 270
;; } GdkPixbufRotation;

(define-enum-extended PixbufRotation
  (in-module "Gdk")
  (c-name "GdkPixbufRotation")
  (values
    '("none" "GDK_PIXBUF_ROTATE_NONE" "0")
    '("counterclockwise" "GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE" "90")
    '("upsidedown" "GDK_PIXBUF_ROTATE_UPSIDEDOWN" "180")
    '("clockwise" "GDK_PIXBUF_ROTATE_CLOCKWISE" "270")
  )
)

;; From gdk-pixdata.h

;; Original typedef:
;; typedef enum
;; {
;;   /* colorspace + alpha */
;;   GDK_PIXDATA_COLOR_TYPE_RGB    = 0x01,
;;   GDK_PIXDATA_COLOR_TYPE_RGBA   = 0x02,
;;   GDK_PIXDATA_COLOR_TYPE_MASK   = 0xff,
;;   /* width, support 8bits only currently */
;;   GDK_PIXDATA_SAMPLE_WIDTH_8    = 0x01 << 16,
;;   GDK_PIXDATA_SAMPLE_WIDTH_MASK = 0x0f << 16,
;;   /* encoding */
;;   GDK_PIXDATA_ENCODING_RAW      = 0x01 << 24,
;;   GDK_PIXDATA_ENCODING_RLE      = 0x02 << 24,
;;   GDK_PIXDATA_ENCODING_MASK     = 0x0f << 24
;; } GdkPixdataType;

(define-flags-extended PixdataType
  (in-module "Gdk")
  (c-name "GdkPixdataType")
  (values
    '("color-type-rgb" "GDK_PIXDATA_COLOR_TYPE_RGB" "0x01")
    '("color-type-rgba" "GDK_PIXDATA_COLOR_TYPE_RGBA" "0x02")
    '("color-type-mask" "GDK_PIXDATA_COLOR_TYPE_MASK" "0xff")
    '("sample-width-8" "GDK_PIXDATA_SAMPLE_WIDTH_8" "0x01 << 16")
    '("sample-width-mask" "GDK_PIXDATA_SAMPLE_WIDTH_MASK" "0x0f << 16")
    '("encoding-raw" "GDK_PIXDATA_ENCODING_RAW" "0x01 << 24")
    '("encoding-rle" "GDK_PIXDATA_ENCODING_RLE" "0x02 << 24")
    '("encoding-mask" "GDK_PIXDATA_ENCODING_MASK" "0x0f << 24")
  )
)

;; Original typedef:
;; typedef enum
;; {
;;   /* type of source to save */
;;   GDK_PIXDATA_DUMP_PIXDATA_STREAM	= 0,
;;   GDK_PIXDATA_DUMP_PIXDATA_STRUCT	= 1,
;;   GDK_PIXDATA_DUMP_MACROS		= 2,
;;   /* type of variables to use */
;;   GDK_PIXDATA_DUMP_GTYPES		= 0,
;;   GDK_PIXDATA_DUMP_CTYPES		= 1 << 8,
;;   GDK_PIXDATA_DUMP_STATIC		= 1 << 9,
;;   GDK_PIXDATA_DUMP_CONST		= 1 << 10,
;;   /* save RLE decoder macro? */
;;   GDK_PIXDATA_DUMP_RLE_DECODER		= 1 << 16
;; } GdkPixdataDumpType;

(define-flags-extended PixdataDumpType
  (in-module "Gdk")
  (c-name "GdkPixdataDumpType")
  (values
    '("pixdata-stream" "GDK_PIXDATA_DUMP_PIXDATA_STREAM" "0x0")
    '("pixdata-struct" "GDK_PIXDATA_DUMP_PIXDATA_STRUCT" "0x1")
    '("macros" "GDK_PIXDATA_DUMP_MACROS" "0x2")
    '("gtypes" "GDK_PIXDATA_DUMP_GTYPES" "0x0")
    '("ctypes" "GDK_PIXDATA_DUMP_CTYPES" "1 << 8")
    '("static" "GDK_PIXDATA_DUMP_STATIC" "1 << 9")
    '("const" "GDK_PIXDATA_DUMP_CONST" "1 << 10")
    '("rle-decoder" "GDK_PIXDATA_DUMP_RLE_DECODER" "1 << 16")
  )
)

