    -- GENERATED by C->Haskell Compiler, version 0.13.13 (gtk2hs branch) "Bin IO", 27 May 2012 (Haskell)
    -- Edit the ORIGINAL .chs file instead!

    {-# LANGUAGE OverloadedStrings #-}

    {-# LINE 1 "./System/Glib/GValueTypes.chs" #-}
    -- -*-haskell-*-
    --  GIMP Toolkit (GTK) GValueTypes
    --
    --  Author : Axel Simon
    --
    --  Created: 1 June 2001
    --
    --  Copyright (c) 1999..2002 Axel Simon
    --
    --  This library is free software; you can redistribute it and/or
    --  modify it under the terms of the GNU Lesser General Public
    --  License as published by the Free Software Foundation; either
    --  version 2.1 of the License, or (at your option) any later version.
    --
    --  This library is distributed in the hope that it will be useful,
    --  but WITHOUT ANY WARRANTY; without even the implied warranty of
    --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    --  Lesser General Public License for more details.
    --
    -- |
    -- Maintainer  : gtk2hs-users@lists.sourceforge.net
    -- Stability   : provisional
    -- Portability : portable (depends on GHC)
    --
    -- This is used by the implementation of properties and by the
    -- 'Graphics.UI.Gtk.TreeList.TreeModel' and
    -- related modules.
    --
    module System.Glib.GValueTypes (
      valueSetUInt,
      valueGetUInt,
      valueSetInt,
      valueGetInt,
      valueSetUInt64,
      valueGetUInt64,
      valueSetInt64,
      valueGetInt64,
      valueSetBool,
      valueGetBool,
      valueSetPointer,
      valueGetPointer,
      valueSetFloat,
      valueGetFloat,
      valueSetDouble,
      valueGetDouble,
      valueSetEnum,
      valueGetEnum,
      valueSetFlags,
      valueGetFlags,
      valueSetString,
      valueGetString,
      valueSetMaybeString,
      valueGetMaybeString,
      valueSetFilePath,
      valueGetFilePath,
      valueSetMaybeFilePath,
      valueGetMaybeFilePath,
      valueSetBoxed,
      valueGetBoxed,
      valueSetGObject,
      valueGetGObject,
      valueSetMaybeGObject,
      valueGetMaybeGObject,
      ) where

    import Control.Monad    (liftM)

    import System.Glib.FFI
    import System.Glib.Flags
    import System.Glib.UTFString
    import System.Glib.GValue           (GValue(GValue))
    import System.Glib.GObject

    {-# LINE 75 "./System/Glib/GValueTypes.chs" #-}

    valueSetUInt :: GValue -> Word -> IO ()
    valueSetUInt :: GValue -> Word -> IO ()
    valueSetUInt GValue
    gvalue Word
    value =
      (\(GValue Ptr GValue
    arg1) CUInt
    arg2 -> Ptr GValue -> CUInt -> IO ()
    g_value_set_uint Ptr GValue
    arg1 CUInt
    arg2) GValue
    gvalue (Word -> CUInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word
    value)

    valueGetUInt :: GValue -> IO Word
    valueGetUInt :: GValue -> IO Word
    valueGetUInt GValue
    gvalue =
      (CUInt -> Word) -> IO CUInt -> IO Word
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CUInt -> Word
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (IO CUInt -> IO Word) -> IO CUInt -> IO Word
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CUInt
    g_value_get_uint Ptr GValue
    arg1) GValue
    gvalue

    valueSetInt :: GValue -> Int -> IO ()
    valueSetInt :: GValue -> Int -> IO ()
    valueSetInt GValue
    gvalue Int
    value =
      (\(GValue Ptr GValue
    arg1) CInt
    arg2 -> Ptr GValue -> CInt -> IO ()
    g_value_set_int Ptr GValue
    arg1 CInt
    arg2) GValue
    gvalue (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    value)

    valueGetInt :: GValue -> IO Int
    valueGetInt :: GValue -> IO Int
    valueGetInt GValue
    gvalue =
      (CInt -> Int) -> IO CInt -> IO Int
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CInt
    g_value_get_int Ptr GValue
    arg1) GValue
    gvalue

    valueSetUInt64 :: GValue -> Word64 -> IO ()
    valueSetUInt64 :: GValue -> Word64 -> IO ()
    valueSetUInt64 GValue
    gvalue Word64
    value =
      (\(GValue Ptr GValue
    arg1) CULong
    arg2 -> Ptr GValue -> CULong -> IO ()
    g_value_set_uint64 Ptr GValue
    arg1 CULong
    arg2) GValue
    gvalue (Word64 -> CULong
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word64
    value)

    valueGetUInt64 :: GValue -> IO Word64
    valueGetUInt64 :: GValue -> IO Word64
    valueGetUInt64 GValue
    gvalue =
      (CULong -> Word64) -> IO CULong -> IO Word64
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CULong -> Word64
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (IO CULong -> IO Word64) -> IO CULong -> IO Word64
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CULong
    g_value_get_uint64 Ptr GValue
    arg1) GValue
    gvalue

    valueSetInt64 :: GValue -> Int64 -> IO ()
    valueSetInt64 :: GValue -> Int64 -> IO ()
    valueSetInt64 GValue
    gvalue Int64
    value =
      (\(GValue Ptr GValue
    arg1) CLong
    arg2 -> Ptr GValue -> CLong -> IO ()
    g_value_set_int64 Ptr GValue
    arg1 CLong
    arg2) GValue
    gvalue (Int64 -> CLong
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int64
    value)

    valueGetInt64 :: GValue -> IO Int64
    valueGetInt64 :: GValue -> IO Int64
    valueGetInt64 GValue
    gvalue =
      (CLong -> Int64) -> IO CLong -> IO Int64
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CLong -> Int64
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (IO CLong -> IO Int64) -> IO CLong -> IO Int64
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CLong
    g_value_get_int64 Ptr GValue
    arg1) GValue
    gvalue

    valueSetBool :: GValue -> Bool -> IO ()
    valueSetBool :: GValue -> Bool -> IO ()
    valueSetBool GValue
    gvalue Bool
    value =
      (\(GValue Ptr GValue
    arg1) CInt
    arg2 -> Ptr GValue -> CInt -> IO ()
    g_value_set_boolean Ptr GValue
    arg1 CInt
    arg2) GValue
    gvalue (Bool -> CInt
    forall a. Num a => Bool -> a
    fromBool Bool
    value)

    valueGetBool :: GValue -> IO Bool
    valueGetBool :: GValue -> IO Bool
    valueGetBool GValue
    gvalue =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CInt
    g_value_get_boolean Ptr GValue
    arg1) GValue
    gvalue

    -- These functions should probably never be used as they are dangerous.
    --
    valueSetPointer :: GValue -> (Ptr ()) -> IO ()
    valueSetPointer :: GValue -> Ptr () -> IO ()
    valueSetPointer GValue
    gvalue Ptr ()
    value =
      (\(GValue Ptr GValue
    arg1) Ptr ()
    arg2 -> Ptr GValue -> Ptr () -> IO ()
    g_value_set_pointer Ptr GValue
    arg1 Ptr ()
    arg2) GValue
    gvalue Ptr ()
    value

    valueGetPointer :: GValue -> IO (Ptr ())
    valueGetPointer :: GValue -> IO (Ptr ())
    valueGetPointer GValue
    gvalue =
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO (Ptr ())
    g_value_get_pointer Ptr GValue
    arg1) GValue
    gvalue

    valueSetFloat :: GValue -> Float -> IO ()
    valueSetFloat :: GValue -> Float -> IO ()
    valueSetFloat GValue
    gvalue Float
    value =
      (\(GValue Ptr GValue
    arg1) CFloat
    arg2 -> Ptr GValue -> CFloat -> IO ()
    g_value_set_float Ptr GValue
    arg1 CFloat
    arg2) GValue
    gvalue (Float -> CFloat
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Float
    value)

    valueGetFloat :: GValue -> IO Float
    valueGetFloat :: GValue -> IO Float
    valueGetFloat GValue
    gvalue =
      (CFloat -> Float) -> IO CFloat -> IO Float
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CFloat -> Float
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CFloat -> IO Float) -> IO CFloat -> IO Float
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CFloat
    g_value_get_float Ptr GValue
    arg1) GValue
    gvalue

    valueSetDouble :: GValue -> Double -> IO ()
    valueSetDouble :: GValue -> Double -> IO ()
    valueSetDouble GValue
    gvalue Double
    value =
      (\(GValue Ptr GValue
    arg1) CDouble
    arg2 -> Ptr GValue -> CDouble -> IO ()
    g_value_set_double Ptr GValue
    arg1 CDouble
    arg2) GValue
    gvalue (Double -> CDouble
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Double
    value)

    valueGetDouble :: GValue -> IO Double
    valueGetDouble :: GValue -> IO Double
    valueGetDouble GValue
    gvalue =
      (CDouble -> Double) -> IO CDouble -> IO Double
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CDouble -> Double
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CDouble -> IO Double) -> IO CDouble -> IO Double
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CDouble
    g_value_get_double Ptr GValue
    arg1) GValue
    gvalue

    valueSetEnum :: Enum enum => GValue -> enum -> IO ()
    valueSetEnum :: forall enum. Enum enum => GValue -> enum -> IO ()
    valueSetEnum GValue
    gvalue enum
    value =
      (\(GValue Ptr GValue
    arg1) CInt
    arg2 -> Ptr GValue -> CInt -> IO ()
    g_value_set_enum Ptr GValue
    arg1 CInt
    arg2) GValue
    gvalue (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> Int -> CInt
    forall a b. (a -> b) -> a -> b
    $ enum -> Int
    forall a. Enum a => a -> Int
    fromEnum enum
    value)

    valueGetEnum :: Enum enum => GValue -> IO enum
    valueGetEnum :: forall enum. Enum enum => GValue -> IO enum
    valueGetEnum GValue
    gvalue =
      (CInt -> enum) -> IO CInt -> IO enum
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Int -> enum
    forall a. Enum a => Int -> a
    toEnum (Int -> enum) -> (CInt -> Int) -> CInt -> enum
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral) (IO CInt -> IO enum) -> IO CInt -> IO enum
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CInt
    g_value_get_enum Ptr GValue
    arg1) GValue
    gvalue

    valueSetFlags :: Flags flag => GValue -> [flag] -> IO ()
    valueSetFlags :: forall flag. Flags flag => GValue -> [flag] -> IO ()
    valueSetFlags GValue
    gvalue [flag]
    value =
      (\(GValue Ptr GValue
    arg1) CUInt
    arg2 -> Ptr GValue -> CUInt -> IO ()
    g_value_set_flags Ptr GValue
    arg1 CUInt
    arg2) GValue
    gvalue (Int -> CUInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CUInt) -> Int -> CUInt
    forall a b. (a -> b) -> a -> b
    $ [flag] -> Int
    forall a. Flags a => [a] -> Int
    fromFlags [flag]
    value)

    valueGetFlags :: Flags flag => GValue -> IO [flag]
    valueGetFlags :: forall flag. Flags flag => GValue -> IO [flag]
    valueGetFlags GValue
    gvalue =
      (CUInt -> [flag]) -> IO CUInt -> IO [flag]
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Int -> [flag]
    forall a. Flags a => Int -> [a]
    toFlags (Int -> [flag]) -> (CUInt -> Int) -> CUInt -> [flag]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CUInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral) (IO CUInt -> IO [flag]) -> IO CUInt -> IO [flag]
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CUInt
    g_value_get_flags Ptr GValue
    arg1) GValue
    gvalue

    valueSetString :: GlibString string => GValue -> string -> IO ()
    valueSetString :: forall string. GlibString string => GValue -> string -> IO ()
    valueSetString GValue
    gvalue string
    str =
      string -> (CString -> IO ()) -> IO ()
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    str ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \CString
    strPtr ->
      (\(GValue Ptr GValue
    arg1) CString
    arg2 -> Ptr GValue -> CString -> IO ()
    g_value_set_string Ptr GValue
    arg1 CString
    arg2) GValue
    gvalue CString
    strPtr

    valueGetString :: GlibString string => GValue -> IO string
    valueGetString :: forall string. GlibString string => GValue -> IO string
    valueGetString GValue
    gvalue = do
      CString
    strPtr <- (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CString
    g_value_get_string Ptr GValue
    arg1) GValue
    gvalue
      if CString
    strPtr CString -> CString -> Bool
    forall a. Eq a => a -> a -> Bool
    == CString
    forall a. Ptr a
    nullPtr
        then string -> IO string
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return string
    ""
        else CString -> IO string
    forall s. GlibString s => CString -> IO s
    peekUTFString CString
    strPtr

    valueSetMaybeString :: GlibString string => GValue -> Maybe string -> IO ()
    valueSetMaybeString :: forall string. GlibString string => GValue -> Maybe string -> IO ()
    valueSetMaybeString GValue
    gvalue (Just string
    str) =
      string -> (CString -> IO ()) -> IO ()
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    str ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \CString
    strPtr ->
      (\(GValue Ptr GValue
    arg1) CString
    arg2 -> Ptr GValue -> CString -> IO ()
    g_value_set_string Ptr GValue
    arg1 CString
    arg2) GValue
    gvalue CString
    strPtr

    valueSetMaybeString GValue
    gvalue Maybe string
    Nothing =
      (\(GValue Ptr GValue
    arg1) CString
    arg2 -> Ptr GValue -> CString -> IO ()
    g_value_set_static_string Ptr GValue
    arg1 CString
    arg2) GValue
    gvalue CString
    forall a. Ptr a
    nullPtr

    valueGetMaybeString :: GlibString string => GValue -> IO (Maybe string)
    valueGetMaybeString :: forall string. GlibString string => GValue -> IO (Maybe string)
    valueGetMaybeString GValue
    gvalue =
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CString
    g_value_get_string Ptr GValue
    arg1) GValue
    gvalue
      IO CString -> (CString -> IO (Maybe string)) -> IO (Maybe string)
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= (CString -> IO string) -> CString -> IO (Maybe string)
    forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
    maybePeek CString -> IO string
    forall s. GlibString s => CString -> IO s
    peekUTFString

    valueSetFilePath :: GlibFilePath string => GValue -> string -> IO ()
    valueSetFilePath :: forall string. GlibFilePath string => GValue -> string -> IO ()
    valueSetFilePath GValue
    gvalue string
    str =
      string -> (CString -> IO ()) -> IO ()
    forall a. string -> (CString -> IO a) -> IO a
    forall fp a. GlibFilePath fp => fp -> (CString -> IO a) -> IO a
    withUTFFilePath string
    str ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \CString
    strPtr ->
      (\(GValue Ptr GValue
    arg1) CString
    arg2 -> Ptr GValue -> CString -> IO ()
    g_value_set_string Ptr GValue
    arg1 CString
    arg2) GValue
    gvalue CString
    strPtr

    valueGetFilePath :: GlibFilePath string => GValue -> IO string
    valueGetFilePath :: forall string. GlibFilePath string => GValue -> IO string
    valueGetFilePath GValue
    gvalue = do
      CString
    strPtr <- (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CString
    g_value_get_string Ptr GValue
    arg1) GValue
    gvalue
      if CString
    strPtr CString -> CString -> Bool
    forall a. Eq a => a -> a -> Bool
    == CString
    forall a. Ptr a
    nullPtr
        then string -> IO string
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return string
    ""
        else CString -> IO string
    forall fp. GlibFilePath fp => CString -> IO fp
    peekUTFFilePath CString
    strPtr

    valueSetMaybeFilePath :: GlibFilePath string => GValue -> Maybe string -> IO ()
    valueSetMaybeFilePath :: forall string.
    GlibFilePath string =>
    GValue -> Maybe string -> IO ()
    valueSetMaybeFilePath GValue
    gvalue (Just string
    str) =
      string -> (CString -> IO ()) -> IO ()
    forall a. string -> (CString -> IO a) -> IO a
    forall fp a. GlibFilePath fp => fp -> (CString -> IO a) -> IO a
    withUTFFilePath string
    str ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \CString
    strPtr ->
      (\(GValue Ptr GValue
    arg1) CString
    arg2 -> Ptr GValue -> CString -> IO ()
    g_value_set_string Ptr GValue
    arg1 CString
    arg2) GValue
    gvalue CString
    strPtr

    valueSetMaybeFilePath GValue
    gvalue Maybe string
    Nothing =
      (\(GValue Ptr GValue
    arg1) CString
    arg2 -> Ptr GValue -> CString -> IO ()
    g_value_set_static_string Ptr GValue
    arg1 CString
    arg2) GValue
    gvalue CString
    forall a. Ptr a
    nullPtr

    valueGetMaybeFilePath :: GlibFilePath string => GValue -> IO (Maybe string)
    valueGetMaybeFilePath :: forall string. GlibFilePath string => GValue -> IO (Maybe string)
    valueGetMaybeFilePath GValue
    gvalue =
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO CString
    g_value_get_string Ptr GValue
    arg1) GValue
    gvalue
      IO CString -> (CString -> IO (Maybe string)) -> IO (Maybe string)
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= (CString -> IO string) -> CString -> IO (Maybe string)
    forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
    maybePeek CString -> IO string
    forall fp. GlibFilePath fp => CString -> IO fp
    peekUTFFilePath

    valueSetBoxed :: (boxed -> (Ptr boxed -> IO ()) -> IO ()) -> GValue -> boxed -> IO ()
    valueSetBoxed :: forall boxed.
    (boxed -> (Ptr boxed -> IO ()) -> IO ())
    -> GValue -> boxed -> IO ()
    valueSetBoxed boxed -> (Ptr boxed -> IO ()) -> IO ()
    with GValue
    gvalue boxed
    boxed =
      boxed -> (Ptr boxed -> IO ()) -> IO ()
    with boxed
    boxed ((Ptr boxed -> IO ()) -> IO ()) -> (Ptr boxed -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr boxed
    boxedPtr -> do
      (\(GValue Ptr GValue
    arg1) Ptr ()
    arg2 -> Ptr GValue -> Ptr () -> IO ()
    g_value_set_boxed Ptr GValue
    arg1 Ptr ()
    arg2) GValue
    gvalue (Ptr boxed -> Ptr ()
    forall a b. Ptr a -> Ptr b
    castPtr Ptr boxed
    boxedPtr)

    valueGetBoxed :: (Ptr boxed -> IO boxed) -> GValue -> IO boxed
    valueGetBoxed :: forall boxed. (Ptr boxed -> IO boxed) -> GValue -> IO boxed
    valueGetBoxed Ptr boxed -> IO boxed
    peek GValue
    gvalue =
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO (Ptr ())
    g_value_get_boxed Ptr GValue
    arg1) GValue
    gvalue IO (Ptr ()) -> (Ptr () -> IO boxed) -> IO boxed
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr boxed -> IO boxed
    peek (Ptr boxed -> IO boxed)
    -> (Ptr () -> Ptr boxed) -> Ptr () -> IO boxed
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr () -> Ptr boxed
    forall a b. Ptr a -> Ptr b
    castPtr

    -- for some weird reason the API says that gv is a gpointer, not a GObject
    --
    valueSetGObject :: GObjectClass gobj => GValue -> gobj -> IO ()
    valueSetGObject :: forall gobj. GObjectClass gobj => GValue -> gobj -> IO ()
    valueSetGObject GValue
    gvalue gobj
    obj =
      ForeignPtr GObject -> (Ptr GObject -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ((GObject -> ForeignPtr GObject
    unGObject(GObject -> ForeignPtr GObject)
    -> (gobj -> GObject) -> gobj -> ForeignPtr GObject
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .gobj -> GObject
    forall o. GObjectClass o => o -> GObject
    toGObject) gobj
    obj) ((Ptr GObject -> IO ()) -> IO ())
    -> (Ptr GObject -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr GObject
    objPtr ->
        (\(GValue Ptr GValue
    arg1) Ptr ()
    arg2 -> Ptr GValue -> Ptr () -> IO ()
    g_value_set_object Ptr GValue
    arg1 Ptr ()
    arg2) GValue
    gvalue (Ptr GObject -> Ptr ()
    forall a b. Ptr a -> Ptr b
    castPtr Ptr GObject
    objPtr)

    -- Unsafe because it performs an unchecked downcast. Only for internal use.
    --
    valueGetGObject :: GObjectClass gobj => GValue -> IO gobj
    valueGetGObject :: forall gobj. GObjectClass gobj => GValue -> IO gobj
    valueGetGObject GValue
    gvalue =
      (GObject -> gobj) -> IO GObject -> IO gobj
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM GObject -> gobj
    forall o. GObjectClass o => GObject -> o
    unsafeCastGObject (IO GObject -> IO gobj) -> IO GObject -> IO gobj
    forall a b. (a -> b) -> a -> b
    $
      (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
    -> IO (Ptr GObject) -> IO GObject
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewGObject (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
    forall {a}. (ForeignPtr GObject -> GObject, FinalizerPtr a)
    mkGObject (IO (Ptr GObject) -> IO GObject) -> IO (Ptr GObject) -> IO GObject
    forall a b. (a -> b) -> a -> b
    $
      FilePath -> IO (Ptr GObject) -> IO (Ptr GObject)
    forall a. FilePath -> IO (Ptr a) -> IO (Ptr a)
    throwIfNull FilePath
    "GValue.valueGetObject: extracting invalid object" (IO (Ptr GObject) -> IO (Ptr GObject))
    -> IO (Ptr GObject) -> IO (Ptr GObject)
    forall a b. (a -> b) -> a -> b
    $
      (Ptr () -> Ptr GObject) -> IO (Ptr ()) -> IO (Ptr GObject)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Ptr () -> Ptr GObject
    forall a b. Ptr a -> Ptr b
    castPtr (IO (Ptr ()) -> IO (Ptr GObject))
    -> IO (Ptr ()) -> IO (Ptr GObject)
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO (Ptr ())
    g_value_get_object Ptr GValue
    arg1) GValue
    gvalue

    valueSetMaybeGObject :: GObjectClass gobj => GValue -> (Maybe gobj) -> IO ()
    valueSetMaybeGObject :: forall gobj. GObjectClass gobj => GValue -> Maybe gobj -> IO ()
    valueSetMaybeGObject GValue
    gvalue (Just gobj
    obj) = GValue -> gobj -> IO ()
    forall gobj. GObjectClass gobj => GValue -> gobj -> IO ()
    valueSetGObject GValue
    gvalue gobj
    obj
    valueSetMaybeGObject GValue
    gvalue Maybe gobj
    Nothing =
        (\(GValue Ptr GValue
    arg1) Ptr ()
    arg2 -> Ptr GValue -> Ptr () -> IO ()
    g_value_set_object Ptr GValue
    arg1 Ptr ()
    arg2) GValue
    gvalue Ptr ()
    forall a. Ptr a
    nullPtr

    valueGetMaybeGObject :: GObjectClass gobj => GValue -> IO (Maybe gobj)
    valueGetMaybeGObject :: forall gobj. GObjectClass gobj => GValue -> IO (Maybe gobj)
    valueGetMaybeGObject GValue
    gvalue =
      (Maybe GObject -> Maybe gobj)
    -> IO (Maybe GObject) -> IO (Maybe gobj)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM ((GObject -> gobj) -> Maybe GObject -> Maybe gobj
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM GObject -> gobj
    forall o. GObjectClass o => GObject -> o
    unsafeCastGObject) (IO (Maybe GObject) -> IO (Maybe gobj))
    -> IO (Maybe GObject) -> IO (Maybe gobj)
    forall a b. (a -> b) -> a -> b
    $
      (IO (Ptr GObject) -> IO GObject)
    -> IO (Ptr GObject) -> IO (Maybe GObject)
    forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
    maybeNull ((ForeignPtr GObject -> GObject, FinalizerPtr GObject)
    -> IO (Ptr GObject) -> IO GObject
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewGObject (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
    forall {a}. (ForeignPtr GObject -> GObject, FinalizerPtr a)
    mkGObject) (IO (Ptr GObject) -> IO (Maybe GObject))
    -> IO (Ptr GObject) -> IO (Maybe GObject)
    forall a b. (a -> b) -> a -> b
    $
      (Ptr () -> Ptr GObject) -> IO (Ptr ()) -> IO (Ptr GObject)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Ptr () -> Ptr GObject
    forall a b. Ptr a -> Ptr b
    castPtr (IO (Ptr ()) -> IO (Ptr GObject))
    -> IO (Ptr ()) -> IO (Ptr GObject)
    forall a b. (a -> b) -> a -> b
    $
      (\(GValue Ptr GValue
    arg1) -> Ptr GValue -> IO (Ptr ())
    g_value_get_object Ptr GValue
    arg1) GValue
    gvalue

    foreign import ccall unsafe "g_value_set_uint"
      g_value_set_uint :: ((Ptr GValue) -> (CUInt -> (IO ())))

    foreign import ccall unsafe "g_value_get_uint"
      g_value_get_uint :: ((Ptr GValue) -> (IO CUInt))

    foreign import ccall unsafe "g_value_set_int"
      g_value_set_int :: ((Ptr GValue) -> (CInt -> (IO ())))

    foreign import ccall unsafe "g_value_get_int"
      g_value_get_int :: ((Ptr GValue) -> (IO CInt))

    foreign import ccall unsafe "g_value_set_uint64"
      g_value_set_uint64 :: ((Ptr GValue) -> (CULong -> (IO ())))

    foreign import ccall unsafe "g_value_get_uint64"
      g_value_get_uint64 :: ((Ptr GValue) -> (IO CULong))

    foreign import ccall unsafe "g_value_set_int64"
      g_value_set_int64 :: ((Ptr GValue) -> (CLong -> (IO ())))

    foreign import ccall unsafe "g_value_get_int64"
      g_value_get_int64 :: ((Ptr GValue) -> (IO CLong))

    foreign import ccall unsafe "g_value_set_boolean"
      g_value_set_boolean :: ((Ptr GValue) -> (CInt -> (IO ())))

    foreign import ccall unsafe "g_value_get_boolean"
      g_value_get_boolean :: ((Ptr GValue) -> (IO CInt))

    foreign import ccall unsafe "g_value_set_pointer"
      g_value_set_pointer :: ((Ptr GValue) -> ((Ptr ()) -> (IO ())))

    foreign import ccall unsafe "g_value_get_pointer"
      g_value_get_pointer :: ((Ptr GValue) -> (IO (Ptr ())))

    foreign import ccall unsafe "g_value_set_float"
      g_value_set_float :: ((Ptr GValue) -> (CFloat -> (IO ())))

    foreign import ccall unsafe "g_value_get_float"
      g_value_get_float :: ((Ptr GValue) -> (IO CFloat))

    foreign import ccall unsafe "g_value_set_double"
      g_value_set_double :: ((Ptr GValue) -> (CDouble -> (IO ())))

    foreign import ccall unsafe "g_value_get_double"
      g_value_get_double :: ((Ptr GValue) -> (IO CDouble))

    foreign import ccall unsafe "g_value_set_enum"
      g_value_set_enum :: ((Ptr GValue) -> (CInt -> (IO ())))

    foreign import ccall unsafe "g_value_get_enum"
      g_value_get_enum :: ((Ptr GValue) -> (IO CInt))

    foreign import ccall unsafe "g_value_set_flags"
      g_value_set_flags :: ((Ptr GValue) -> (CUInt -> (IO ())))

    foreign import ccall unsafe "g_value_get_flags"
      g_value_get_flags :: ((Ptr GValue) -> (IO CUInt))

    foreign import ccall unsafe "g_value_set_string"
      g_value_set_string :: ((Ptr GValue) -> ((Ptr CChar) -> (IO ())))

    foreign import ccall unsafe "g_value_get_string"
      g_value_get_string :: ((Ptr GValue) -> (IO (Ptr CChar)))

    foreign import ccall unsafe "g_value_set_static_string"
      g_value_set_static_string :: ((Ptr GValue) -> ((Ptr CChar) -> (IO ())))

    foreign import ccall unsafe "g_value_set_boxed"
      g_value_set_boxed :: ((Ptr GValue) -> ((Ptr ()) -> (IO ())))

    foreign import ccall unsafe "g_value_get_boxed"
      g_value_get_boxed :: ((Ptr GValue) -> (IO (Ptr ())))

    foreign import ccall unsafe "g_value_set_object"
      g_value_set_object :: ((Ptr GValue) -> ((Ptr ()) -> (IO ())))

    foreign import ccall unsafe "g_value_get_object"
      g_value_get_object :: ((Ptr GValue) -> (IO (Ptr ())))