    {- |
    Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
    License    : LGPL-2.1
    Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

    /No description available in the introspection data./
    -}

    #define ENABLE_OVERLOADING \
           (!defined(__HADDOCK_VERSION__))

    module GI.GdkX11.Objects.X11Visual
        (

    -- * Exported types
        X11Visual(..)                           ,
        IsX11Visual                             ,
        toX11Visual                             ,
        noX11Visual                             ,

     -- * Methods
    -- ** getXvisual #method:getXvisual#

    #if ENABLE_OVERLOADING
        X11VisualGetXvisualMethodInfo           ,
    #endif
        x11VisualGetXvisual                     ,

        ) where

    import Data.GI.Base.ShortPrelude
    import qualified Data.GI.Base.ShortPrelude as SP
    import qualified Data.GI.Base.Overloading as O
    import qualified Prelude as P

    import qualified Data.GI.Base.Attributes as GI.Attributes
    import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
    import qualified Data.GI.Base.GError as B.GError
    import qualified Data.GI.Base.GVariant as B.GVariant
    import qualified Data.GI.Base.GValue as B.GValue
    import qualified Data.GI.Base.GParamSpec as B.GParamSpec
    import qualified Data.GI.Base.CallStack as B.CallStack
    import qualified Data.Text as T
    import qualified Data.ByteString.Char8 as B
    import qualified Data.Map as Map
    import qualified Foreign.Ptr as FP

    import qualified GI.GObject.Objects.Object as GObject.Object
    import qualified GI.Gdk.Objects.Visual as Gdk.Visual
    import qualified GI.Xlib.Structs.Visual as Xlib.Visual

    -- | Memory-managed wrapper type.
    newtype X11Visual = X11Visual (ManagedPtr X11Visual)
    foreign import ccall "gdk_x11_visual_get_type"
        c_gdk_x11_visual_get_type :: IO GType

    instance GObject X11Visual where
        gobjectType _ = c_gdk_x11_visual_get_type

    -- | Type class for types which can be safely cast to `X11Visual`, for instance with `toX11Visual`.
    class GObject o => IsX11Visual o
    #if MIN_VERSION_base(4,9,0)
    instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError X11Visual a) =>
        IsX11Visual a
    #endif
    instance IsX11Visual X11Visual
    instance Gdk.Visual.IsVisual X11Visual
    instance GObject.Object.IsObject X11Visual

    -- | Cast to `X11Visual`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
    toX11Visual :: (MonadIO m, IsX11Visual o) => o -> m X11Visual
    toX11Visual = liftIO . unsafeCastTo X11Visual

    -- | A convenience alias for `Nothing` :: `Maybe` `X11Visual`.
    noX11Visual :: Maybe X11Visual
    noX11Visual = Nothing

    #if ENABLE_OVERLOADING
    type family ResolveX11VisualMethod (t :: Symbol) (o :: *) :: * where
        ResolveX11VisualMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
        ResolveX11VisualMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
        ResolveX11VisualMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
        ResolveX11VisualMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
        ResolveX11VisualMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
        ResolveX11VisualMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
        ResolveX11VisualMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
        ResolveX11VisualMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
        ResolveX11VisualMethod "ref" o = GObject.Object.ObjectRefMethodInfo
        ResolveX11VisualMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
        ResolveX11VisualMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
        ResolveX11VisualMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
        ResolveX11VisualMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
        ResolveX11VisualMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
        ResolveX11VisualMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
        ResolveX11VisualMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
        ResolveX11VisualMethod "getBitsPerRgb" o = Gdk.Visual.VisualGetBitsPerRgbMethodInfo
        ResolveX11VisualMethod "getBluePixelDetails" o = Gdk.Visual.VisualGetBluePixelDetailsMethodInfo
        ResolveX11VisualMethod "getByteOrder" o = Gdk.Visual.VisualGetByteOrderMethodInfo
        ResolveX11VisualMethod "getColormapSize" o = Gdk.Visual.VisualGetColormapSizeMethodInfo
        ResolveX11VisualMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
        ResolveX11VisualMethod "getDepth" o = Gdk.Visual.VisualGetDepthMethodInfo
        ResolveX11VisualMethod "getGreenPixelDetails" o = Gdk.Visual.VisualGetGreenPixelDetailsMethodInfo
        ResolveX11VisualMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
        ResolveX11VisualMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
        ResolveX11VisualMethod "getRedPixelDetails" o = Gdk.Visual.VisualGetRedPixelDetailsMethodInfo
        ResolveX11VisualMethod "getScreen" o = Gdk.Visual.VisualGetScreenMethodInfo
        ResolveX11VisualMethod "getVisualType" o = Gdk.Visual.VisualGetVisualTypeMethodInfo
        ResolveX11VisualMethod "getXvisual" o = X11VisualGetXvisualMethodInfo
        ResolveX11VisualMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
        ResolveX11VisualMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
        ResolveX11VisualMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveX11VisualMethod t X11Visual, O.MethodInfo info X11Visual p) => O.IsLabelProxy t (X11Visual -> p) where
        fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

    #if MIN_VERSION_base(4,9,0)
    instance (info ~ ResolveX11VisualMethod t X11Visual, O.MethodInfo info X11Visual p) => O.IsLabel t (X11Visual -> p) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
    #else
        fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
    #endif
    #endif

    #endif

    #if ENABLE_OVERLOADING
    instance O.HasAttributeList X11Visual
    type instance O.AttributeList X11Visual = X11VisualAttributeList
    type X11VisualAttributeList = ('[ ] :: [(Symbol, *)])
    #endif

    #if ENABLE_OVERLOADING
    #endif

    #if ENABLE_OVERLOADING
    type instance O.SignalList X11Visual = X11VisualSignalList
    type X11VisualSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

    #endif

    -- method X11Visual::get_xvisual
    -- method type : OrdinaryMethod
    -- Args : [Arg {argCName = "visual", argType = TInterface (Name {namespace = "GdkX11", name = "X11Visual"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkVisual.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
    -- Lengths : []
    -- returnType : Just (TInterface (Name {namespace = "xlib", name = "Visual"}))
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_x11_visual_get_xvisual" gdk_x11_visual_get_xvisual ::
        Ptr X11Visual ->                        -- visual : TInterface (Name {namespace = "GdkX11", name = "X11Visual"})
        IO (Ptr Xlib.Visual.Visual)

    {- |
    Returns the X visual belonging to a 'GI.Gdk.Objects.Visual.Visual'.
    -}
    x11VisualGetXvisual ::
        (B.CallStack.HasCallStack, MonadIO m, IsX11Visual a) =>
        a
        {- ^ /@visual@/: a 'GI.Gdk.Objects.Visual.Visual'. -}
        -> m Xlib.Visual.Visual
        {- ^ __Returns:__ an Xlib Visual*. -}
    x11VisualGetXvisual visual = liftIO $ do
        visual' <- unsafeManagedPtrCastPtr visual
        result <- gdk_x11_visual_get_xvisual visual'
        checkUnexpectedReturnNULL "x11VisualGetXvisual" result
        result' <- (newPtr Xlib.Visual.Visual) result
        touchManagedPtr visual
        return result'

    #if ENABLE_OVERLOADING
    data X11VisualGetXvisualMethodInfo
    instance (signature ~ (m Xlib.Visual.Visual), MonadIO m, IsX11Visual a) => O.MethodInfo X11VisualGetXvisualMethodInfo a signature where
        overloadedMethod _ = x11VisualGetXvisual

    #endif