    {- |
    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.X11Cursor
        (

    -- * Exported types
        X11Cursor(..)                           ,
        IsX11Cursor                             ,
        toX11Cursor                             ,
        noX11Cursor                             ,

     -- * Methods
    -- ** getXcursor #method:getXcursor#

    #if ENABLE_OVERLOADING
        X11CursorGetXcursorMethodInfo           ,
    #endif
        x11CursorGetXcursor                     ,

    -- ** getXdisplay #method:getXdisplay#

    #if ENABLE_OVERLOADING
        X11CursorGetXdisplayMethodInfo          ,
    #endif
        x11CursorGetXdisplay                    ,

        ) 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.Cursor as Gdk.Cursor
    import qualified GI.Xlib.Structs.Display as Xlib.Display

    -- | Memory-managed wrapper type.
    newtype X11Cursor = X11Cursor (ManagedPtr X11Cursor)
    foreign import ccall "gdk_x11_cursor_get_type"
        c_gdk_x11_cursor_get_type :: IO GType

    instance GObject X11Cursor where
        gobjectType _ = c_gdk_x11_cursor_get_type

    -- | Type class for types which can be safely cast to `X11Cursor`, for instance with `toX11Cursor`.
    class GObject o => IsX11Cursor o
    #if MIN_VERSION_base(4,9,0)
    instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError X11Cursor a) =>
        IsX11Cursor a
    #endif
    instance IsX11Cursor X11Cursor
    instance Gdk.Cursor.IsCursor X11Cursor
    instance GObject.Object.IsObject X11Cursor

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

    -- | A convenience alias for `Nothing` :: `Maybe` `X11Cursor`.
    noX11Cursor :: Maybe X11Cursor
    noX11Cursor = Nothing

    #if ENABLE_OVERLOADING
    type family ResolveX11CursorMethod (t :: Symbol) (o :: *) :: * where
        ResolveX11CursorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
        ResolveX11CursorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
        ResolveX11CursorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
        ResolveX11CursorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
        ResolveX11CursorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
        ResolveX11CursorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
        ResolveX11CursorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
        ResolveX11CursorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
        ResolveX11CursorMethod "ref" o = Gdk.Cursor.CursorRefMethodInfo
        ResolveX11CursorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
        ResolveX11CursorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
        ResolveX11CursorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
        ResolveX11CursorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
        ResolveX11CursorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
        ResolveX11CursorMethod "unref" o = Gdk.Cursor.CursorUnrefMethodInfo
        ResolveX11CursorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
        ResolveX11CursorMethod "getCursorType" o = Gdk.Cursor.CursorGetCursorTypeMethodInfo
        ResolveX11CursorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
        ResolveX11CursorMethod "getDisplay" o = Gdk.Cursor.CursorGetDisplayMethodInfo
        ResolveX11CursorMethod "getImage" o = Gdk.Cursor.CursorGetImageMethodInfo
        ResolveX11CursorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
        ResolveX11CursorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
        ResolveX11CursorMethod "getSurface" o = Gdk.Cursor.CursorGetSurfaceMethodInfo
        ResolveX11CursorMethod "getXcursor" o = X11CursorGetXcursorMethodInfo
        ResolveX11CursorMethod "getXdisplay" o = X11CursorGetXdisplayMethodInfo
        ResolveX11CursorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
        ResolveX11CursorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
        ResolveX11CursorMethod l o = O.MethodResolutionFailed l o

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

    #if MIN_VERSION_base(4,9,0)
    instance (info ~ ResolveX11CursorMethod t X11Cursor, O.MethodInfo info X11Cursor p) => O.IsLabel t (X11Cursor -> 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 X11Cursor
    type instance O.AttributeList X11Cursor = X11CursorAttributeList
    type X11CursorAttributeList = ('[ '("cursorType", Gdk.Cursor.CursorCursorTypePropertyInfo), '("display", Gdk.Cursor.CursorDisplayPropertyInfo)] :: [(Symbol, *)])
    #endif

    #if ENABLE_OVERLOADING
    #endif

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

    #endif

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

    foreign import ccall "gdk_x11_cursor_get_xcursor" gdk_x11_cursor_get_xcursor ::
        Ptr X11Cursor ->                        -- cursor : TInterface (Name {namespace = "GdkX11", name = "X11Cursor"})
        IO CULong

    {- |
    Returns the X cursor belonging to a 'GI.Gdk.Objects.Cursor.Cursor'.
    -}
    x11CursorGetXcursor ::
        (B.CallStack.HasCallStack, MonadIO m, IsX11Cursor a) =>
        a
        {- ^ /@cursor@/: a 'GI.Gdk.Objects.Cursor.Cursor'. -}
        -> m CULong
        {- ^ __Returns:__ an Xlib Cursor. -}
    x11CursorGetXcursor cursor = liftIO $ do
        cursor' <- unsafeManagedPtrCastPtr cursor
        result <- gdk_x11_cursor_get_xcursor cursor'
        touchManagedPtr cursor
        return result

    #if ENABLE_OVERLOADING
    data X11CursorGetXcursorMethodInfo
    instance (signature ~ (m CULong), MonadIO m, IsX11Cursor a) => O.MethodInfo X11CursorGetXcursorMethodInfo a signature where
        overloadedMethod _ = x11CursorGetXcursor

    #endif

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

    foreign import ccall "gdk_x11_cursor_get_xdisplay" gdk_x11_cursor_get_xdisplay ::
        Ptr X11Cursor ->                        -- cursor : TInterface (Name {namespace = "GdkX11", name = "X11Cursor"})
        IO (Ptr Xlib.Display.Display)

    {- |
    Returns the display of a 'GI.Gdk.Objects.Cursor.Cursor'.
    -}
    x11CursorGetXdisplay ::
        (B.CallStack.HasCallStack, MonadIO m, IsX11Cursor a) =>
        a
        {- ^ /@cursor@/: a 'GI.Gdk.Objects.Cursor.Cursor'. -}
        -> m Xlib.Display.Display
        {- ^ __Returns:__ an Xlib Display*. -}
    x11CursorGetXdisplay cursor = liftIO $ do
        cursor' <- unsafeManagedPtrCastPtr cursor
        result <- gdk_x11_cursor_get_xdisplay cursor'
        checkUnexpectedReturnNULL "x11CursorGetXdisplay" result
        result' <- (newPtr Xlib.Display.Display) result
        touchManagedPtr cursor
        return result'

    #if ENABLE_OVERLOADING
    data X11CursorGetXdisplayMethodInfo
    instance (signature ~ (m Xlib.Display.Display), MonadIO m, IsX11Cursor a) => O.MethodInfo X11CursorGetXdisplayMethodInfo a signature where
        overloadedMethod _ = x11CursorGetXdisplay

    #endif