#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Interfaces.FileDescriptorBased
(
FileDescriptorBased(..) ,
noFileDescriptorBased ,
IsFileDescriptorBased ,
toFileDescriptorBased ,
#if ENABLE_OVERLOADING
FileDescriptorBasedGetFdMethodInfo ,
#endif
fileDescriptorBasedGetFd ,
) 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
newtype FileDescriptorBased = FileDescriptorBased (ManagedPtr FileDescriptorBased)
noFileDescriptorBased :: Maybe FileDescriptorBased
noFileDescriptorBased = Nothing
#if ENABLE_OVERLOADING
type instance O.SignalList FileDescriptorBased = FileDescriptorBasedSignalList
type FileDescriptorBasedSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_file_descriptor_based_get_type"
c_g_file_descriptor_based_get_type :: IO GType
instance GObject FileDescriptorBased where
gobjectType _ = c_g_file_descriptor_based_get_type
class GObject o => IsFileDescriptorBased o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError FileDescriptorBased a) =>
IsFileDescriptorBased a
#endif
instance IsFileDescriptorBased FileDescriptorBased
instance GObject.Object.IsObject FileDescriptorBased
toFileDescriptorBased :: (MonadIO m, IsFileDescriptorBased o) => o -> m FileDescriptorBased
toFileDescriptorBased = liftIO . unsafeCastTo FileDescriptorBased
#if ENABLE_OVERLOADING
instance O.HasAttributeList FileDescriptorBased
type instance O.AttributeList FileDescriptorBased = FileDescriptorBasedAttributeList
type FileDescriptorBasedAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type family ResolveFileDescriptorBasedMethod (t :: Symbol) (o :: *) :: * where
ResolveFileDescriptorBasedMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileDescriptorBasedMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileDescriptorBasedMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileDescriptorBasedMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileDescriptorBasedMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileDescriptorBasedMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileDescriptorBasedMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileDescriptorBasedMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileDescriptorBasedMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileDescriptorBasedMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileDescriptorBasedMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileDescriptorBasedMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileDescriptorBasedMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileDescriptorBasedMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileDescriptorBasedMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileDescriptorBasedMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileDescriptorBasedMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileDescriptorBasedMethod "getFd" o = FileDescriptorBasedGetFdMethodInfo
ResolveFileDescriptorBasedMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileDescriptorBasedMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileDescriptorBasedMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileDescriptorBasedMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileDescriptorBasedMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileDescriptorBasedMethod t FileDescriptorBased, O.MethodInfo info FileDescriptorBased p) => O.IsLabelProxy t (FileDescriptorBased -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveFileDescriptorBasedMethod t FileDescriptorBased, O.MethodInfo info FileDescriptorBased p) => O.IsLabel t (FileDescriptorBased -> 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
foreign import ccall "g_file_descriptor_based_get_fd" g_file_descriptor_based_get_fd ::
Ptr FileDescriptorBased ->
IO Int32
fileDescriptorBasedGetFd ::
(B.CallStack.HasCallStack, MonadIO m, IsFileDescriptorBased a) =>
a
-> m Int32
fileDescriptorBasedGetFd fdBased = liftIO $ do
fdBased' <- unsafeManagedPtrCastPtr fdBased
result <- g_file_descriptor_based_get_fd fdBased'
touchManagedPtr fdBased
return result
#if ENABLE_OVERLOADING
data FileDescriptorBasedGetFdMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsFileDescriptorBased a) => O.MethodInfo FileDescriptorBasedGetFdMethodInfo a signature where
overloadedMethod _ = fileDescriptorBasedGetFd
#endif