{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.UnixOutputStream
(
UnixOutputStream(..) ,
IsUnixOutputStream ,
toUnixOutputStream ,
#if defined(ENABLE_OVERLOADING)
ResolveUnixOutputStreamMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
UnixOutputStreamGetCloseFdMethodInfo ,
#endif
unixOutputStreamGetCloseFd ,
#if defined(ENABLE_OVERLOADING)
UnixOutputStreamGetFdMethodInfo ,
#endif
unixOutputStreamGetFd ,
unixOutputStreamNew ,
#if defined(ENABLE_OVERLOADING)
UnixOutputStreamSetCloseFdMethodInfo ,
#endif
unixOutputStreamSetCloseFd ,
#if defined(ENABLE_OVERLOADING)
UnixOutputStreamCloseFdPropertyInfo ,
#endif
constructUnixOutputStreamCloseFd ,
getUnixOutputStreamCloseFd ,
setUnixOutputStreamCloseFd ,
#if defined(ENABLE_OVERLOADING)
unixOutputStreamCloseFd ,
#endif
#if defined(ENABLE_OVERLOADING)
UnixOutputStreamFdPropertyInfo ,
#endif
constructUnixOutputStreamFd ,
getUnixOutputStreamFd ,
#if defined(ENABLE_OVERLOADING)
unixOutputStreamFd ,
#endif
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.FileDescriptorBased as Gio.FileDescriptorBased
import {-# SOURCE #-} qualified GI.Gio.Interfaces.PollableOutputStream as Gio.PollableOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.FileDescriptorBased as Gio.FileDescriptorBased
import {-# SOURCE #-} qualified GI.Gio.Interfaces.PollableOutputStream as Gio.PollableOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
#endif
newtype UnixOutputStream = UnixOutputStream (SP.ManagedPtr UnixOutputStream)
deriving (UnixOutputStream -> UnixOutputStream -> Bool
(UnixOutputStream -> UnixOutputStream -> Bool)
-> (UnixOutputStream -> UnixOutputStream -> Bool)
-> Eq UnixOutputStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UnixOutputStream -> UnixOutputStream -> Bool
== :: UnixOutputStream -> UnixOutputStream -> Bool
$c/= :: UnixOutputStream -> UnixOutputStream -> Bool
/= :: UnixOutputStream -> UnixOutputStream -> Bool
Eq)
instance SP.ManagedPtrNewtype UnixOutputStream where
toManagedPtr :: UnixOutputStream -> ManagedPtr UnixOutputStream
toManagedPtr (UnixOutputStream ManagedPtr UnixOutputStream
p) = ManagedPtr UnixOutputStream
p
foreign import ccall "g_unix_output_stream_get_type"
c_g_unix_output_stream_get_type :: IO B.Types.GType
instance B.Types.TypedObject UnixOutputStream where
glibType :: IO GType
glibType = IO GType
c_g_unix_output_stream_get_type
instance B.Types.GObject UnixOutputStream
class (SP.GObject o, O.IsDescendantOf UnixOutputStream o) => IsUnixOutputStream o
instance (SP.GObject o, O.IsDescendantOf UnixOutputStream o) => IsUnixOutputStream o
instance O.HasParentTypes UnixOutputStream
type instance O.ParentTypes UnixOutputStream = '[Gio.OutputStream.OutputStream, GObject.Object.Object, Gio.FileDescriptorBased.FileDescriptorBased, Gio.PollableOutputStream.PollableOutputStream]
toUnixOutputStream :: (MIO.MonadIO m, IsUnixOutputStream o) => o -> m UnixOutputStream
toUnixOutputStream :: forall (m :: * -> *) o.
(MonadIO m, IsUnixOutputStream o) =>
o -> m UnixOutputStream
toUnixOutputStream = IO UnixOutputStream -> m UnixOutputStream
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO UnixOutputStream -> m UnixOutputStream)
-> (o -> IO UnixOutputStream) -> o -> m UnixOutputStream
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr UnixOutputStream -> UnixOutputStream)
-> o -> IO UnixOutputStream
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr UnixOutputStream -> UnixOutputStream
UnixOutputStream
instance B.GValue.IsGValue (Maybe UnixOutputStream) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_unix_output_stream_get_type
gvalueSet_ :: Ptr GValue -> Maybe UnixOutputStream -> IO ()
gvalueSet_ Ptr GValue
gv Maybe UnixOutputStream
P.Nothing = Ptr GValue -> Ptr UnixOutputStream -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr UnixOutputStream
forall a. Ptr a
FP.nullPtr :: FP.Ptr UnixOutputStream)
gvalueSet_ Ptr GValue
gv (P.Just UnixOutputStream
obj) = UnixOutputStream -> (Ptr UnixOutputStream -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr UnixOutputStream
obj (Ptr GValue -> Ptr UnixOutputStream -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe UnixOutputStream)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr UnixOutputStream)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr UnixOutputStream)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject UnixOutputStream ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveUnixOutputStreamMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveUnixOutputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveUnixOutputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveUnixOutputStreamMethod "canPoll" o = Gio.PollableOutputStream.PollableOutputStreamCanPollMethodInfo
ResolveUnixOutputStreamMethod "clearPending" o = Gio.OutputStream.OutputStreamClearPendingMethodInfo
ResolveUnixOutputStreamMethod "close" o = Gio.OutputStream.OutputStreamCloseMethodInfo
ResolveUnixOutputStreamMethod "closeAsync" o = Gio.OutputStream.OutputStreamCloseAsyncMethodInfo
ResolveUnixOutputStreamMethod "closeFinish" o = Gio.OutputStream.OutputStreamCloseFinishMethodInfo
ResolveUnixOutputStreamMethod "createSource" o = Gio.PollableOutputStream.PollableOutputStreamCreateSourceMethodInfo
ResolveUnixOutputStreamMethod "flush" o = Gio.OutputStream.OutputStreamFlushMethodInfo
ResolveUnixOutputStreamMethod "flushAsync" o = Gio.OutputStream.OutputStreamFlushAsyncMethodInfo
ResolveUnixOutputStreamMethod "flushFinish" o = Gio.OutputStream.OutputStreamFlushFinishMethodInfo
ResolveUnixOutputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveUnixOutputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveUnixOutputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveUnixOutputStreamMethod "hasPending" o = Gio.OutputStream.OutputStreamHasPendingMethodInfo
ResolveUnixOutputStreamMethod "isClosed" o = Gio.OutputStream.OutputStreamIsClosedMethodInfo
ResolveUnixOutputStreamMethod "isClosing" o = Gio.OutputStream.OutputStreamIsClosingMethodInfo
ResolveUnixOutputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveUnixOutputStreamMethod "isWritable" o = Gio.PollableOutputStream.PollableOutputStreamIsWritableMethodInfo
ResolveUnixOutputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveUnixOutputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveUnixOutputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveUnixOutputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveUnixOutputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveUnixOutputStreamMethod "splice" o = Gio.OutputStream.OutputStreamSpliceMethodInfo
ResolveUnixOutputStreamMethod "spliceAsync" o = Gio.OutputStream.OutputStreamSpliceAsyncMethodInfo
ResolveUnixOutputStreamMethod "spliceFinish" o = Gio.OutputStream.OutputStreamSpliceFinishMethodInfo
ResolveUnixOutputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveUnixOutputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveUnixOutputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveUnixOutputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveUnixOutputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveUnixOutputStreamMethod "write" o = Gio.OutputStream.OutputStreamWriteMethodInfo
ResolveUnixOutputStreamMethod "writeAll" o = Gio.OutputStream.OutputStreamWriteAllMethodInfo
ResolveUnixOutputStreamMethod "writeAllAsync" o = Gio.OutputStream.OutputStreamWriteAllAsyncMethodInfo
ResolveUnixOutputStreamMethod "writeAllFinish" o = Gio.OutputStream.OutputStreamWriteAllFinishMethodInfo
ResolveUnixOutputStreamMethod "writeAsync" o = Gio.OutputStream.OutputStreamWriteAsyncMethodInfo
ResolveUnixOutputStreamMethod "writeBytes" o = Gio.OutputStream.OutputStreamWriteBytesMethodInfo
ResolveUnixOutputStreamMethod "writeBytesAsync" o = Gio.OutputStream.OutputStreamWriteBytesAsyncMethodInfo
ResolveUnixOutputStreamMethod "writeBytesFinish" o = Gio.OutputStream.OutputStreamWriteBytesFinishMethodInfo
ResolveUnixOutputStreamMethod "writeFinish" o = Gio.OutputStream.OutputStreamWriteFinishMethodInfo
ResolveUnixOutputStreamMethod "writeNonblocking" o = Gio.PollableOutputStream.PollableOutputStreamWriteNonblockingMethodInfo
ResolveUnixOutputStreamMethod "writev" o = Gio.OutputStream.OutputStreamWritevMethodInfo
ResolveUnixOutputStreamMethod "writevAll" o = Gio.OutputStream.OutputStreamWritevAllMethodInfo
ResolveUnixOutputStreamMethod "writevAllAsync" o = Gio.OutputStream.OutputStreamWritevAllAsyncMethodInfo
ResolveUnixOutputStreamMethod "writevAllFinish" o = Gio.OutputStream.OutputStreamWritevAllFinishMethodInfo
ResolveUnixOutputStreamMethod "writevAsync" o = Gio.OutputStream.OutputStreamWritevAsyncMethodInfo
ResolveUnixOutputStreamMethod "writevFinish" o = Gio.OutputStream.OutputStreamWritevFinishMethodInfo
ResolveUnixOutputStreamMethod "writevNonblocking" o = Gio.PollableOutputStream.PollableOutputStreamWritevNonblockingMethodInfo
ResolveUnixOutputStreamMethod "getCloseFd" o = UnixOutputStreamGetCloseFdMethodInfo
ResolveUnixOutputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveUnixOutputStreamMethod "getFd" o = UnixOutputStreamGetFdMethodInfo
ResolveUnixOutputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveUnixOutputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveUnixOutputStreamMethod "setCloseFd" o = UnixOutputStreamSetCloseFdMethodInfo
ResolveUnixOutputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveUnixOutputStreamMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveUnixOutputStreamMethod "setPending" o = Gio.OutputStream.OutputStreamSetPendingMethodInfo
ResolveUnixOutputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveUnixOutputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveUnixOutputStreamMethod t UnixOutputStream, O.OverloadedMethod info UnixOutputStream p) => OL.IsLabel t (UnixOutputStream -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveUnixOutputStreamMethod t UnixOutputStream, O.OverloadedMethod info UnixOutputStream p, R.HasField t UnixOutputStream p) => R.HasField t UnixOutputStream p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveUnixOutputStreamMethod t UnixOutputStream, O.OverloadedMethodInfo info UnixOutputStream) => OL.IsLabel t (O.MethodProxy info UnixOutputStream) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getUnixOutputStreamCloseFd :: (MonadIO m, IsUnixOutputStream o) => o -> m Bool
getUnixOutputStreamCloseFd :: forall (m :: * -> *) o.
(MonadIO m, IsUnixOutputStream o) =>
o -> m Bool
getUnixOutputStreamCloseFd o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"close-fd"
setUnixOutputStreamCloseFd :: (MonadIO m, IsUnixOutputStream o) => o -> Bool -> m ()
setUnixOutputStreamCloseFd :: forall (m :: * -> *) o.
(MonadIO m, IsUnixOutputStream o) =>
o -> Bool -> m ()
setUnixOutputStreamCloseFd o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"close-fd" Bool
val
constructUnixOutputStreamCloseFd :: (IsUnixOutputStream o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructUnixOutputStreamCloseFd :: forall o (m :: * -> *).
(IsUnixOutputStream o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructUnixOutputStreamCloseFd Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"close-fd" Bool
val
#if defined(ENABLE_OVERLOADING)
data UnixOutputStreamCloseFdPropertyInfo
instance AttrInfo UnixOutputStreamCloseFdPropertyInfo where
type AttrAllowedOps UnixOutputStreamCloseFdPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint UnixOutputStreamCloseFdPropertyInfo = IsUnixOutputStream
type AttrSetTypeConstraint UnixOutputStreamCloseFdPropertyInfo = (~) Bool
type AttrTransferTypeConstraint UnixOutputStreamCloseFdPropertyInfo = (~) Bool
type AttrTransferType UnixOutputStreamCloseFdPropertyInfo = Bool
type AttrGetType UnixOutputStreamCloseFdPropertyInfo = Bool
type AttrLabel UnixOutputStreamCloseFdPropertyInfo = "close-fd"
type AttrOrigin UnixOutputStreamCloseFdPropertyInfo = UnixOutputStream
attrGet = getUnixOutputStreamCloseFd
attrSet = setUnixOutputStreamCloseFd
attrTransfer _ v = do
return v
attrConstruct = constructUnixOutputStreamCloseFd
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.UnixOutputStream.closeFd"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-UnixOutputStream.html#g:attr:closeFd"
})
#endif
getUnixOutputStreamFd :: (MonadIO m, IsUnixOutputStream o) => o -> m Int32
getUnixOutputStreamFd :: forall (m :: * -> *) o.
(MonadIO m, IsUnixOutputStream o) =>
o -> m Int32
getUnixOutputStreamFd o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"fd"
constructUnixOutputStreamFd :: (IsUnixOutputStream o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructUnixOutputStreamFd :: forall o (m :: * -> *).
(IsUnixOutputStream o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructUnixOutputStreamFd Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"fd" Int32
val
#if defined(ENABLE_OVERLOADING)
data UnixOutputStreamFdPropertyInfo
instance AttrInfo UnixOutputStreamFdPropertyInfo where
type AttrAllowedOps UnixOutputStreamFdPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint UnixOutputStreamFdPropertyInfo = IsUnixOutputStream
type AttrSetTypeConstraint UnixOutputStreamFdPropertyInfo = (~) Int32
type AttrTransferTypeConstraint UnixOutputStreamFdPropertyInfo = (~) Int32
type AttrTransferType UnixOutputStreamFdPropertyInfo = Int32
type AttrGetType UnixOutputStreamFdPropertyInfo = Int32
type AttrLabel UnixOutputStreamFdPropertyInfo = "fd"
type AttrOrigin UnixOutputStreamFdPropertyInfo = UnixOutputStream
attrGet = getUnixOutputStreamFd
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructUnixOutputStreamFd
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.UnixOutputStream.fd"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-UnixOutputStream.html#g:attr:fd"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList UnixOutputStream
type instance O.AttributeList UnixOutputStream = UnixOutputStreamAttributeList
type UnixOutputStreamAttributeList = ('[ '("closeFd", UnixOutputStreamCloseFdPropertyInfo), '("fd", UnixOutputStreamFdPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
unixOutputStreamCloseFd :: AttrLabelProxy "closeFd"
unixOutputStreamCloseFd = AttrLabelProxy
unixOutputStreamFd :: AttrLabelProxy "fd"
unixOutputStreamFd = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList UnixOutputStream = UnixOutputStreamSignalList
type UnixOutputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_unix_output_stream_new" g_unix_output_stream_new ::
Int32 ->
CInt ->
IO (Ptr UnixOutputStream)
unixOutputStreamNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Int32
-> Bool
-> m UnixOutputStream
unixOutputStreamNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Int32 -> Bool -> m UnixOutputStream
unixOutputStreamNew Int32
fd Bool
closeFd = IO UnixOutputStream -> m UnixOutputStream
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnixOutputStream -> m UnixOutputStream)
-> IO UnixOutputStream -> m UnixOutputStream
forall a b. (a -> b) -> a -> b
$ do
let closeFd' :: CInt
closeFd' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
closeFd
result <- Int32 -> CInt -> IO (Ptr UnixOutputStream)
g_unix_output_stream_new Int32
fd CInt
closeFd'
checkUnexpectedReturnNULL "unixOutputStreamNew" result
result' <- (wrapObject UnixOutputStream) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_unix_output_stream_get_close_fd" g_unix_output_stream_get_close_fd ::
Ptr UnixOutputStream ->
IO CInt
unixOutputStreamGetCloseFd ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixOutputStream a) =>
a
-> m Bool
unixOutputStreamGetCloseFd :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUnixOutputStream a) =>
a -> m Bool
unixOutputStreamGetCloseFd a
stream = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
stream' <- a -> IO (Ptr UnixOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
result <- g_unix_output_stream_get_close_fd stream'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr stream
return result'
#if defined(ENABLE_OVERLOADING)
data UnixOutputStreamGetCloseFdMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsUnixOutputStream a) => O.OverloadedMethod UnixOutputStreamGetCloseFdMethodInfo a signature where
overloadedMethod = unixOutputStreamGetCloseFd
instance O.OverloadedMethodInfo UnixOutputStreamGetCloseFdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.UnixOutputStream.unixOutputStreamGetCloseFd",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-UnixOutputStream.html#v:unixOutputStreamGetCloseFd"
})
#endif
foreign import ccall "g_unix_output_stream_get_fd" g_unix_output_stream_get_fd ::
Ptr UnixOutputStream ->
IO Int32
unixOutputStreamGetFd ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixOutputStream a) =>
a
-> m Int32
unixOutputStreamGetFd :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUnixOutputStream a) =>
a -> m Int32
unixOutputStreamGetFd a
stream = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
stream' <- a -> IO (Ptr UnixOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
result <- g_unix_output_stream_get_fd stream'
touchManagedPtr stream
return result
#if defined(ENABLE_OVERLOADING)
data UnixOutputStreamGetFdMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsUnixOutputStream a) => O.OverloadedMethod UnixOutputStreamGetFdMethodInfo a signature where
overloadedMethod = unixOutputStreamGetFd
instance O.OverloadedMethodInfo UnixOutputStreamGetFdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.UnixOutputStream.unixOutputStreamGetFd",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-UnixOutputStream.html#v:unixOutputStreamGetFd"
})
#endif
foreign import ccall "g_unix_output_stream_set_close_fd" g_unix_output_stream_set_close_fd ::
Ptr UnixOutputStream ->
CInt ->
IO ()
unixOutputStreamSetCloseFd ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixOutputStream a) =>
a
-> Bool
-> m ()
unixOutputStreamSetCloseFd :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUnixOutputStream a) =>
a -> Bool -> m ()
unixOutputStreamSetCloseFd a
stream Bool
closeFd = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
stream' <- a -> IO (Ptr UnixOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
let closeFd' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
closeFd
g_unix_output_stream_set_close_fd stream' closeFd'
touchManagedPtr stream
return ()
#if defined(ENABLE_OVERLOADING)
data UnixOutputStreamSetCloseFdMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsUnixOutputStream a) => O.OverloadedMethod UnixOutputStreamSetCloseFdMethodInfo a signature where
overloadedMethod = unixOutputStreamSetCloseFd
instance O.OverloadedMethodInfo UnixOutputStreamSetCloseFdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.UnixOutputStream.unixOutputStreamSetCloseFd",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-UnixOutputStream.html#v:unixOutputStreamSetCloseFd"
})
#endif