{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.FileMonitor
(
FileMonitor(..) ,
IsFileMonitor ,
toFileMonitor ,
#if defined(ENABLE_OVERLOADING)
ResolveFileMonitorMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FileMonitorCancelMethodInfo ,
#endif
fileMonitorCancel ,
#if defined(ENABLE_OVERLOADING)
FileMonitorEmitEventMethodInfo ,
#endif
fileMonitorEmitEvent ,
#if defined(ENABLE_OVERLOADING)
FileMonitorIsCancelledMethodInfo ,
#endif
fileMonitorIsCancelled ,
#if defined(ENABLE_OVERLOADING)
FileMonitorSetRateLimitMethodInfo ,
#endif
fileMonitorSetRateLimit ,
#if defined(ENABLE_OVERLOADING)
FileMonitorCancelledPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
fileMonitorCancelled ,
#endif
getFileMonitorCancelled ,
#if defined(ENABLE_OVERLOADING)
FileMonitorRateLimitPropertyInfo ,
#endif
constructFileMonitorRateLimit ,
#if defined(ENABLE_OVERLOADING)
fileMonitorRateLimit ,
#endif
getFileMonitorRateLimit ,
setFileMonitorRateLimit ,
FileMonitorChangedCallback ,
#if defined(ENABLE_OVERLOADING)
FileMonitorChangedSignalInfo ,
#endif
afterFileMonitorChanged ,
onFileMonitorChanged ,
) 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.Enums as GLib.Enums
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GLib.Structs.TimeVal as GLib.TimeVal
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.AppInfo as Gio.AppInfo
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Drive as Gio.Drive
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Mount as Gio.Mount
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Volume as Gio.Volume
import {-# SOURCE #-} qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FileEnumerator as Gio.FileEnumerator
import {-# SOURCE #-} qualified GI.Gio.Objects.FileIOStream as Gio.FileIOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInputStream as Gio.FileInputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileOutputStream as Gio.FileOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.MountOperation as Gio.MountOperation
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfo as Gio.FileAttributeInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfoList as Gio.FileAttributeInfoList
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeMatcher as Gio.FileAttributeMatcher
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.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
#endif
newtype FileMonitor = FileMonitor (SP.ManagedPtr FileMonitor)
deriving (FileMonitor -> FileMonitor -> Bool
(FileMonitor -> FileMonitor -> Bool)
-> (FileMonitor -> FileMonitor -> Bool) -> Eq FileMonitor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FileMonitor -> FileMonitor -> Bool
== :: FileMonitor -> FileMonitor -> Bool
$c/= :: FileMonitor -> FileMonitor -> Bool
/= :: FileMonitor -> FileMonitor -> Bool
Eq)
instance SP.ManagedPtrNewtype FileMonitor where
toManagedPtr :: FileMonitor -> ManagedPtr FileMonitor
toManagedPtr (FileMonitor ManagedPtr FileMonitor
p) = ManagedPtr FileMonitor
p
foreign import ccall "g_file_monitor_get_type"
c_g_file_monitor_get_type :: IO B.Types.GType
instance B.Types.TypedObject FileMonitor where
glibType :: IO GType
glibType = IO GType
c_g_file_monitor_get_type
instance B.Types.GObject FileMonitor
class (SP.GObject o, O.IsDescendantOf FileMonitor o) => IsFileMonitor o
instance (SP.GObject o, O.IsDescendantOf FileMonitor o) => IsFileMonitor o
instance O.HasParentTypes FileMonitor
type instance O.ParentTypes FileMonitor = '[GObject.Object.Object]
toFileMonitor :: (MIO.MonadIO m, IsFileMonitor o) => o -> m FileMonitor
toFileMonitor :: forall (m :: * -> *) o.
(MonadIO m, IsFileMonitor o) =>
o -> m FileMonitor
toFileMonitor = IO FileMonitor -> m FileMonitor
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO FileMonitor -> m FileMonitor)
-> (o -> IO FileMonitor) -> o -> m FileMonitor
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr FileMonitor -> FileMonitor) -> o -> IO FileMonitor
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr FileMonitor -> FileMonitor
FileMonitor
instance B.GValue.IsGValue (Maybe FileMonitor) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_file_monitor_get_type
gvalueSet_ :: Ptr GValue -> Maybe FileMonitor -> IO ()
gvalueSet_ Ptr GValue
gv Maybe FileMonitor
P.Nothing = Ptr GValue -> Ptr FileMonitor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr FileMonitor
forall a. Ptr a
FP.nullPtr :: FP.Ptr FileMonitor)
gvalueSet_ Ptr GValue
gv (P.Just FileMonitor
obj) = FileMonitor -> (Ptr FileMonitor -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FileMonitor
obj (Ptr GValue -> Ptr FileMonitor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe FileMonitor)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr FileMonitor)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr FileMonitor)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject FileMonitor ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveFileMonitorMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveFileMonitorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileMonitorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileMonitorMethod "cancel" o = FileMonitorCancelMethodInfo
ResolveFileMonitorMethod "emitEvent" o = FileMonitorEmitEventMethodInfo
ResolveFileMonitorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileMonitorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileMonitorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileMonitorMethod "isCancelled" o = FileMonitorIsCancelledMethodInfo
ResolveFileMonitorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileMonitorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileMonitorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileMonitorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileMonitorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileMonitorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileMonitorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileMonitorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileMonitorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileMonitorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileMonitorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileMonitorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileMonitorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileMonitorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileMonitorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileMonitorMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFileMonitorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileMonitorMethod "setRateLimit" o = FileMonitorSetRateLimitMethodInfo
ResolveFileMonitorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileMonitorMethod t FileMonitor, O.OverloadedMethod info FileMonitor p) => OL.IsLabel t (FileMonitor -> 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 ~ ResolveFileMonitorMethod t FileMonitor, O.OverloadedMethod info FileMonitor p, R.HasField t FileMonitor p) => R.HasField t FileMonitor p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveFileMonitorMethod t FileMonitor, O.OverloadedMethodInfo info FileMonitor) => OL.IsLabel t (O.MethodProxy info FileMonitor) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type FileMonitorChangedCallback =
Gio.File.File
-> Maybe Gio.File.File
-> Gio.Enums.FileMonitorEvent
-> IO ()
type C_FileMonitorChangedCallback =
Ptr FileMonitor ->
Ptr Gio.File.File ->
Ptr Gio.File.File ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_FileMonitorChangedCallback :: C_FileMonitorChangedCallback -> IO (FunPtr C_FileMonitorChangedCallback)
wrap_FileMonitorChangedCallback ::
GObject a => (a -> FileMonitorChangedCallback) ->
C_FileMonitorChangedCallback
wrap_FileMonitorChangedCallback :: forall a.
GObject a =>
(a -> FileMonitorChangedCallback) -> C_FileMonitorChangedCallback
wrap_FileMonitorChangedCallback a -> FileMonitorChangedCallback
gi'cb Ptr FileMonitor
gi'selfPtr Ptr File
file Ptr File
otherFile CUInt
eventType Ptr ()
_ = do
file' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
Gio.File.File) Ptr File
file
maybeOtherFile <-
if otherFile == FP.nullPtr
then return Nothing
else do
otherFile' <- (newObject Gio.File.File) otherFile
return $ Just otherFile'
let eventType' = (Int -> FileMonitorEvent
forall a. Enum a => Int -> a
toEnum (Int -> FileMonitorEvent)
-> (CUInt -> Int) -> CUInt -> FileMonitorEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
eventType
B.ManagedPtr.withNewObject gi'selfPtr $ \FileMonitor
gi'self -> a -> FileMonitorChangedCallback
gi'cb (FileMonitor -> a
forall a b. Coercible a b => a -> b
Coerce.coerce FileMonitor
gi'self) File
file' Maybe File
maybeOtherFile FileMonitorEvent
eventType'
onFileMonitorChanged :: (IsFileMonitor a, MonadIO m) => a -> ((?self :: a) => FileMonitorChangedCallback) -> m SignalHandlerId
onFileMonitorChanged :: forall a (m :: * -> *).
(IsFileMonitor a, MonadIO m) =>
a
-> ((?self::a) => FileMonitorChangedCallback) -> m SignalHandlerId
onFileMonitorChanged a
obj (?self::a) => FileMonitorChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> FileMonitorChangedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => FileMonitorChangedCallback
FileMonitorChangedCallback
cb
let wrapped' :: C_FileMonitorChangedCallback
wrapped' = (a -> FileMonitorChangedCallback) -> C_FileMonitorChangedCallback
forall a.
GObject a =>
(a -> FileMonitorChangedCallback) -> C_FileMonitorChangedCallback
wrap_FileMonitorChangedCallback a -> FileMonitorChangedCallback
wrapped
wrapped'' <- C_FileMonitorChangedCallback
-> IO (FunPtr C_FileMonitorChangedCallback)
mk_FileMonitorChangedCallback C_FileMonitorChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectBefore Nothing
afterFileMonitorChanged :: (IsFileMonitor a, MonadIO m) => a -> ((?self :: a) => FileMonitorChangedCallback) -> m SignalHandlerId
afterFileMonitorChanged :: forall a (m :: * -> *).
(IsFileMonitor a, MonadIO m) =>
a
-> ((?self::a) => FileMonitorChangedCallback) -> m SignalHandlerId
afterFileMonitorChanged a
obj (?self::a) => FileMonitorChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> FileMonitorChangedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => FileMonitorChangedCallback
FileMonitorChangedCallback
cb
let wrapped' :: C_FileMonitorChangedCallback
wrapped' = (a -> FileMonitorChangedCallback) -> C_FileMonitorChangedCallback
forall a.
GObject a =>
(a -> FileMonitorChangedCallback) -> C_FileMonitorChangedCallback
wrap_FileMonitorChangedCallback a -> FileMonitorChangedCallback
wrapped
wrapped'' <- C_FileMonitorChangedCallback
-> IO (FunPtr C_FileMonitorChangedCallback)
mk_FileMonitorChangedCallback C_FileMonitorChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data FileMonitorChangedSignalInfo
instance SignalInfo FileMonitorChangedSignalInfo where
type HaskellCallbackType FileMonitorChangedSignalInfo = FileMonitorChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_FileMonitorChangedCallback cb
cb'' <- mk_FileMonitorChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileMonitor::changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileMonitor.html#g:signal:changed"})
#endif
getFileMonitorCancelled :: (MonadIO m, IsFileMonitor o) => o -> m Bool
getFileMonitorCancelled :: forall (m :: * -> *) o. (MonadIO m, IsFileMonitor o) => o -> m Bool
getFileMonitorCancelled 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
"cancelled"
#if defined(ENABLE_OVERLOADING)
data FileMonitorCancelledPropertyInfo
instance AttrInfo FileMonitorCancelledPropertyInfo where
type AttrAllowedOps FileMonitorCancelledPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint FileMonitorCancelledPropertyInfo = IsFileMonitor
type AttrSetTypeConstraint FileMonitorCancelledPropertyInfo = (~) ()
type AttrTransferTypeConstraint FileMonitorCancelledPropertyInfo = (~) ()
type AttrTransferType FileMonitorCancelledPropertyInfo = ()
type AttrGetType FileMonitorCancelledPropertyInfo = Bool
type AttrLabel FileMonitorCancelledPropertyInfo = "cancelled"
type AttrOrigin FileMonitorCancelledPropertyInfo = FileMonitor
attrGet = getFileMonitorCancelled
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileMonitor.cancelled"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileMonitor.html#g:attr:cancelled"
})
#endif
getFileMonitorRateLimit :: (MonadIO m, IsFileMonitor o) => o -> m Int32
getFileMonitorRateLimit :: forall (m :: * -> *) o.
(MonadIO m, IsFileMonitor o) =>
o -> m Int32
getFileMonitorRateLimit 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
"rate-limit"
setFileMonitorRateLimit :: (MonadIO m, IsFileMonitor o) => o -> Int32 -> m ()
setFileMonitorRateLimit :: forall (m :: * -> *) o.
(MonadIO m, IsFileMonitor o) =>
o -> Int32 -> m ()
setFileMonitorRateLimit o
obj Int32
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 -> Int32 -> IO ()
forall a. GObject a => a -> String -> Int32 -> IO ()
B.Properties.setObjectPropertyInt32 o
obj String
"rate-limit" Int32
val
constructFileMonitorRateLimit :: (IsFileMonitor o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructFileMonitorRateLimit :: forall o (m :: * -> *).
(IsFileMonitor o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructFileMonitorRateLimit 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
"rate-limit" Int32
val
#if defined(ENABLE_OVERLOADING)
data FileMonitorRateLimitPropertyInfo
instance AttrInfo FileMonitorRateLimitPropertyInfo where
type AttrAllowedOps FileMonitorRateLimitPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint FileMonitorRateLimitPropertyInfo = IsFileMonitor
type AttrSetTypeConstraint FileMonitorRateLimitPropertyInfo = (~) Int32
type AttrTransferTypeConstraint FileMonitorRateLimitPropertyInfo = (~) Int32
type AttrTransferType FileMonitorRateLimitPropertyInfo = Int32
type AttrGetType FileMonitorRateLimitPropertyInfo = Int32
type AttrLabel FileMonitorRateLimitPropertyInfo = "rate-limit"
type AttrOrigin FileMonitorRateLimitPropertyInfo = FileMonitor
attrGet = getFileMonitorRateLimit
attrSet = setFileMonitorRateLimit
attrTransfer _ v = do
return v
attrConstruct = constructFileMonitorRateLimit
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileMonitor.rateLimit"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileMonitor.html#g:attr:rateLimit"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FileMonitor
type instance O.AttributeList FileMonitor = FileMonitorAttributeList
type FileMonitorAttributeList = ('[ '("cancelled", FileMonitorCancelledPropertyInfo), '("rateLimit", FileMonitorRateLimitPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
fileMonitorCancelled :: AttrLabelProxy "cancelled"
fileMonitorCancelled = AttrLabelProxy
fileMonitorRateLimit :: AttrLabelProxy "rateLimit"
fileMonitorRateLimit = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList FileMonitor = FileMonitorSignalList
type FileMonitorSignalList = ('[ '("changed", FileMonitorChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_file_monitor_cancel" g_file_monitor_cancel ::
Ptr FileMonitor ->
IO CInt
fileMonitorCancel ::
(B.CallStack.HasCallStack, MonadIO m, IsFileMonitor a) =>
a
-> m Bool
fileMonitorCancel :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileMonitor a) =>
a -> m Bool
fileMonitorCancel a
monitor = 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
monitor' <- a -> IO (Ptr FileMonitor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
monitor
result <- g_file_monitor_cancel monitor'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr monitor
return result'
#if defined(ENABLE_OVERLOADING)
data FileMonitorCancelMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileMonitor a) => O.OverloadedMethod FileMonitorCancelMethodInfo a signature where
overloadedMethod = fileMonitorCancel
instance O.OverloadedMethodInfo FileMonitorCancelMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileMonitor.fileMonitorCancel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileMonitor.html#v:fileMonitorCancel"
})
#endif
foreign import ccall "g_file_monitor_emit_event" g_file_monitor_emit_event ::
Ptr FileMonitor ->
Ptr Gio.File.File ->
Ptr Gio.File.File ->
CUInt ->
IO ()
fileMonitorEmitEvent ::
(B.CallStack.HasCallStack, MonadIO m, IsFileMonitor a, Gio.File.IsFile b, Gio.File.IsFile c) =>
a
-> b
-> c
-> Gio.Enums.FileMonitorEvent
-> m ()
fileMonitorEmitEvent :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsFileMonitor a, IsFile b, IsFile c) =>
a -> b -> c -> FileMonitorEvent -> m ()
fileMonitorEmitEvent a
monitor b
child c
otherFile FileMonitorEvent
eventType = 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
monitor' <- a -> IO (Ptr FileMonitor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
monitor
child' <- unsafeManagedPtrCastPtr child
otherFile' <- unsafeManagedPtrCastPtr otherFile
let eventType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (FileMonitorEvent -> Int) -> FileMonitorEvent -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FileMonitorEvent -> Int
forall a. Enum a => a -> Int
fromEnum) FileMonitorEvent
eventType
g_file_monitor_emit_event monitor' child' otherFile' eventType'
touchManagedPtr monitor
touchManagedPtr child
touchManagedPtr otherFile
return ()
#if defined(ENABLE_OVERLOADING)
data FileMonitorEmitEventMethodInfo
instance (signature ~ (b -> c -> Gio.Enums.FileMonitorEvent -> m ()), MonadIO m, IsFileMonitor a, Gio.File.IsFile b, Gio.File.IsFile c) => O.OverloadedMethod FileMonitorEmitEventMethodInfo a signature where
overloadedMethod = fileMonitorEmitEvent
instance O.OverloadedMethodInfo FileMonitorEmitEventMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileMonitor.fileMonitorEmitEvent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileMonitor.html#v:fileMonitorEmitEvent"
})
#endif
foreign import ccall "g_file_monitor_is_cancelled" g_file_monitor_is_cancelled ::
Ptr FileMonitor ->
IO CInt
fileMonitorIsCancelled ::
(B.CallStack.HasCallStack, MonadIO m, IsFileMonitor a) =>
a
-> m Bool
fileMonitorIsCancelled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileMonitor a) =>
a -> m Bool
fileMonitorIsCancelled a
monitor = 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
monitor' <- a -> IO (Ptr FileMonitor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
monitor
result <- g_file_monitor_is_cancelled monitor'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr monitor
return result'
#if defined(ENABLE_OVERLOADING)
data FileMonitorIsCancelledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileMonitor a) => O.OverloadedMethod FileMonitorIsCancelledMethodInfo a signature where
overloadedMethod = fileMonitorIsCancelled
instance O.OverloadedMethodInfo FileMonitorIsCancelledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileMonitor.fileMonitorIsCancelled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileMonitor.html#v:fileMonitorIsCancelled"
})
#endif
foreign import ccall "g_file_monitor_set_rate_limit" g_file_monitor_set_rate_limit ::
Ptr FileMonitor ->
Int32 ->
IO ()
fileMonitorSetRateLimit ::
(B.CallStack.HasCallStack, MonadIO m, IsFileMonitor a) =>
a
-> Int32
-> m ()
fileMonitorSetRateLimit :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileMonitor a) =>
a -> Int32 -> m ()
fileMonitorSetRateLimit a
monitor Int32
limitMsecs = 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
monitor' <- a -> IO (Ptr FileMonitor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
monitor
g_file_monitor_set_rate_limit monitor' limitMsecs
touchManagedPtr monitor
return ()
#if defined(ENABLE_OVERLOADING)
data FileMonitorSetRateLimitMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsFileMonitor a) => O.OverloadedMethod FileMonitorSetRateLimitMethodInfo a signature where
overloadedMethod = fileMonitorSetRateLimit
instance O.OverloadedMethodInfo FileMonitorSetRateLimitMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileMonitor.fileMonitorSetRateLimit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileMonitor.html#v:fileMonitorSetRateLimit"
})
#endif