{-# LINE 2 "./System/GIO/File/FileMonitor.chs" #-}
module System.GIO.File.FileMonitor (
FileMonitor(..),
FileMonitorClass,
FileMonitorEvent(..),
fileMonitorCancel,
fileMonitorIsCancelled,
fileMonitorCancelled,
fileMonitorRateLimit,
fileMonitorChanged,
) where
import Control.Monad
import System.GIO.Enums
import System.Glib.Attributes
import System.Glib.FFI
import System.Glib.Flags
import System.Glib.GError
import System.Glib.GObject
import System.Glib.Properties
import System.Glib.Signals
import System.Glib.UTFString
import System.GIO.Signals
{-# LINE 73 "./System/GIO/File/FileMonitor.chs" #-}
import System.GIO.Types
{-# LINE 74 "./System/GIO/File/FileMonitor.chs" #-}
fileMonitorCancel :: FileMonitorClass monitor => monitor
-> IO Bool
fileMonitorCancel :: forall monitor. FileMonitorClass monitor => monitor -> IO Bool
fileMonitorCancel monitor
monitor =
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$ (\(FileMonitor ForeignPtr FileMonitor
arg1) -> ForeignPtr FileMonitor -> (Ptr FileMonitor -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FileMonitor
arg1 ((Ptr FileMonitor -> IO CInt) -> IO CInt)
-> (Ptr FileMonitor -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr FileMonitor
argPtr1 ->Ptr FileMonitor -> IO CInt
g_file_monitor_cancel Ptr FileMonitor
argPtr1) (monitor -> FileMonitor
forall o. FileMonitorClass o => o -> FileMonitor
toFileMonitor monitor
monitor)
fileMonitorIsCancelled :: FileMonitorClass monitor => monitor
-> IO Bool
fileMonitorIsCancelled :: forall monitor. FileMonitorClass monitor => monitor -> IO Bool
fileMonitorIsCancelled monitor
monitor =
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$ (\(FileMonitor ForeignPtr FileMonitor
arg1) -> ForeignPtr FileMonitor -> (Ptr FileMonitor -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FileMonitor
arg1 ((Ptr FileMonitor -> IO CInt) -> IO CInt)
-> (Ptr FileMonitor -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr FileMonitor
argPtr1 ->Ptr FileMonitor -> IO CInt
g_file_monitor_is_cancelled Ptr FileMonitor
argPtr1) (monitor -> FileMonitor
forall o. FileMonitorClass o => o -> FileMonitor
toFileMonitor monitor
monitor)
fileMonitorCancelled :: FileMonitorClass monitor => ReadAttr monitor Bool
fileMonitorCancelled :: forall monitor. FileMonitorClass monitor => ReadAttr monitor Bool
fileMonitorCancelled = String -> ReadAttr monitor Bool
forall gobj. GObjectClass gobj => String -> ReadAttr gobj Bool
readAttrFromBoolProperty String
"cancelled"
fileMonitorRateLimit :: FileMonitorClass monitor => Attr monitor Int
fileMonitorRateLimit :: forall monitor. FileMonitorClass monitor => Attr monitor Int
fileMonitorRateLimit = String -> Attr monitor Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"rate-limit"
fileMonitorChanged :: FileMonitorClass monitor => Signal monitor (Maybe File -> Maybe File -> FileMonitorEvent -> IO ())
fileMonitorChanged :: forall monitor.
FileMonitorClass monitor =>
Signal
monitor (Maybe File -> Maybe File -> FileMonitorEvent -> IO ())
fileMonitorChanged = (Bool
-> monitor
-> (Maybe File -> Maybe File -> FileMonitorEvent -> IO ())
-> IO (ConnectId monitor))
-> Signal
monitor (Maybe File -> Maybe File -> FileMonitorEvent -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String
-> Bool
-> monitor
-> (Maybe File -> Maybe File -> FileMonitorEvent -> IO ())
-> IO (ConnectId monitor)
forall a' b' c obj.
(GObjectClass a', GObjectClass b', Enum c, GObjectClass obj) =>
String
-> Bool
-> obj
-> (Maybe a' -> Maybe b' -> c -> IO ())
-> IO (ConnectId obj)
connect_MOBJECT_MOBJECT_ENUM__NONE String
"changed")
foreign import ccall safe "g_file_monitor_cancel"
g_file_monitor_cancel :: ((Ptr FileMonitor) -> (IO CInt))
foreign import ccall safe "g_file_monitor_is_cancelled"
g_file_monitor_is_cancelled :: ((Ptr FileMonitor) -> (IO CInt))