{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Notify.Objects.Notification
(
Notification(..) ,
IsNotification ,
toNotification ,
noNotification ,
#if defined(ENABLE_OVERLOADING)
ResolveNotificationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
NotificationAddActionMethodInfo ,
#endif
notificationAddAction ,
#if defined(ENABLE_OVERLOADING)
NotificationClearActionsMethodInfo ,
#endif
notificationClearActions ,
#if defined(ENABLE_OVERLOADING)
NotificationClearHintsMethodInfo ,
#endif
notificationClearHints ,
#if defined(ENABLE_OVERLOADING)
NotificationCloseMethodInfo ,
#endif
notificationClose ,
#if defined(ENABLE_OVERLOADING)
NotificationGetClosedReasonMethodInfo ,
#endif
notificationGetClosedReason ,
notificationNew ,
#if defined(ENABLE_OVERLOADING)
NotificationSetAppNameMethodInfo ,
#endif
notificationSetAppName ,
#if defined(ENABLE_OVERLOADING)
NotificationSetCategoryMethodInfo ,
#endif
notificationSetCategory ,
#if defined(ENABLE_OVERLOADING)
NotificationSetHintMethodInfo ,
#endif
notificationSetHint ,
#if defined(ENABLE_OVERLOADING)
NotificationSetHintByteMethodInfo ,
#endif
notificationSetHintByte ,
#if defined(ENABLE_OVERLOADING)
NotificationSetHintByteArrayMethodInfo ,
#endif
notificationSetHintByteArray ,
#if defined(ENABLE_OVERLOADING)
NotificationSetHintDoubleMethodInfo ,
#endif
notificationSetHintDouble ,
#if defined(ENABLE_OVERLOADING)
NotificationSetHintInt32MethodInfo ,
#endif
notificationSetHintInt32 ,
#if defined(ENABLE_OVERLOADING)
NotificationSetHintStringMethodInfo ,
#endif
notificationSetHintString ,
#if defined(ENABLE_OVERLOADING)
NotificationSetHintUint32MethodInfo ,
#endif
notificationSetHintUint32 ,
#if defined(ENABLE_OVERLOADING)
NotificationSetIconFromPixbufMethodInfo ,
#endif
notificationSetIconFromPixbuf ,
#if defined(ENABLE_OVERLOADING)
NotificationSetImageFromPixbufMethodInfo,
#endif
notificationSetImageFromPixbuf ,
#if defined(ENABLE_OVERLOADING)
NotificationSetTimeoutMethodInfo ,
#endif
notificationSetTimeout ,
#if defined(ENABLE_OVERLOADING)
NotificationSetUrgencyMethodInfo ,
#endif
notificationSetUrgency ,
#if defined(ENABLE_OVERLOADING)
NotificationShowMethodInfo ,
#endif
notificationShow ,
#if defined(ENABLE_OVERLOADING)
NotificationUpdateMethodInfo ,
#endif
notificationUpdate ,
#if defined(ENABLE_OVERLOADING)
NotificationAppNamePropertyInfo ,
#endif
constructNotificationAppName ,
getNotificationAppName ,
#if defined(ENABLE_OVERLOADING)
notificationAppName ,
#endif
setNotificationAppName ,
#if defined(ENABLE_OVERLOADING)
NotificationBodyPropertyInfo ,
#endif
clearNotificationBody ,
constructNotificationBody ,
getNotificationBody ,
#if defined(ENABLE_OVERLOADING)
notificationBody ,
#endif
setNotificationBody ,
#if defined(ENABLE_OVERLOADING)
NotificationClosedReasonPropertyInfo ,
#endif
getNotificationClosedReason ,
#if defined(ENABLE_OVERLOADING)
notificationClosedReason ,
#endif
#if defined(ENABLE_OVERLOADING)
NotificationIconNamePropertyInfo ,
#endif
clearNotificationIconName ,
constructNotificationIconName ,
getNotificationIconName ,
#if defined(ENABLE_OVERLOADING)
notificationIconName ,
#endif
setNotificationIconName ,
#if defined(ENABLE_OVERLOADING)
NotificationIdPropertyInfo ,
#endif
constructNotificationId ,
getNotificationId ,
#if defined(ENABLE_OVERLOADING)
notificationId ,
#endif
setNotificationId ,
#if defined(ENABLE_OVERLOADING)
NotificationSummaryPropertyInfo ,
#endif
clearNotificationSummary ,
constructNotificationSummary ,
getNotificationSummary ,
#if defined(ENABLE_OVERLOADING)
notificationSummary ,
#endif
setNotificationSummary ,
C_NotificationClosedCallback ,
NotificationClosedCallback ,
#if defined(ENABLE_OVERLOADING)
NotificationClosedSignalInfo ,
#endif
afterNotificationClosed ,
genClosure_NotificationClosed ,
mk_NotificationClosedCallback ,
noNotificationClosedCallback ,
onNotificationClosed ,
wrap_NotificationClosedCallback ,
) 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.GClosure as B.GClosure
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.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
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 GHC.OverloadedLabels as OL
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Notify.Callbacks as Notify.Callbacks
import {-# SOURCE #-} qualified GI.Notify.Enums as Notify.Enums
newtype Notification = Notification (ManagedPtr Notification)
deriving (Notification -> Notification -> Bool
(Notification -> Notification -> Bool)
-> (Notification -> Notification -> Bool) -> Eq Notification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Notification -> Notification -> Bool
$c/= :: Notification -> Notification -> Bool
== :: Notification -> Notification -> Bool
$c== :: Notification -> Notification -> Bool
Eq)
foreign import ccall "notify_notification_get_type"
c_notify_notification_get_type :: IO GType
instance GObject Notification where
gobjectType :: IO GType
gobjectType = IO GType
c_notify_notification_get_type
instance B.GValue.IsGValue Notification where
toGValue :: Notification -> IO GValue
toGValue o :: Notification
o = do
GType
gtype <- IO GType
c_notify_notification_get_type
Notification -> (Ptr Notification -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Notification
o (GType
-> (GValue -> Ptr Notification -> IO ())
-> Ptr Notification
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Notification -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Notification
fromGValue gv :: GValue
gv = do
Ptr Notification
ptr <- GValue -> IO (Ptr Notification)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Notification)
(ManagedPtr Notification -> Notification)
-> Ptr Notification -> IO Notification
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Notification -> Notification
Notification Ptr Notification
ptr
class (GObject o, O.IsDescendantOf Notification o) => IsNotification o
instance (GObject o, O.IsDescendantOf Notification o) => IsNotification o
instance O.HasParentTypes Notification
type instance O.ParentTypes Notification = '[GObject.Object.Object]
toNotification :: (MonadIO m, IsNotification o) => o -> m Notification
toNotification :: o -> m Notification
toNotification = IO Notification -> m Notification
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Notification -> m Notification)
-> (o -> IO Notification) -> o -> m Notification
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Notification -> Notification) -> o -> IO Notification
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Notification -> Notification
Notification
noNotification :: Maybe Notification
noNotification :: Maybe Notification
noNotification = Maybe Notification
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveNotificationMethod (t :: Symbol) (o :: *) :: * where
ResolveNotificationMethod "addAction" o = NotificationAddActionMethodInfo
ResolveNotificationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveNotificationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveNotificationMethod "clearActions" o = NotificationClearActionsMethodInfo
ResolveNotificationMethod "clearHints" o = NotificationClearHintsMethodInfo
ResolveNotificationMethod "close" o = NotificationCloseMethodInfo
ResolveNotificationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveNotificationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveNotificationMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveNotificationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveNotificationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveNotificationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveNotificationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveNotificationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveNotificationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveNotificationMethod "show" o = NotificationShowMethodInfo
ResolveNotificationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveNotificationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveNotificationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveNotificationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveNotificationMethod "update" o = NotificationUpdateMethodInfo
ResolveNotificationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveNotificationMethod "getClosedReason" o = NotificationGetClosedReasonMethodInfo
ResolveNotificationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveNotificationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveNotificationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveNotificationMethod "setAppName" o = NotificationSetAppNameMethodInfo
ResolveNotificationMethod "setCategory" o = NotificationSetCategoryMethodInfo
ResolveNotificationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveNotificationMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveNotificationMethod "setHint" o = NotificationSetHintMethodInfo
ResolveNotificationMethod "setHintByte" o = NotificationSetHintByteMethodInfo
ResolveNotificationMethod "setHintByteArray" o = NotificationSetHintByteArrayMethodInfo
ResolveNotificationMethod "setHintDouble" o = NotificationSetHintDoubleMethodInfo
ResolveNotificationMethod "setHintInt32" o = NotificationSetHintInt32MethodInfo
ResolveNotificationMethod "setHintString" o = NotificationSetHintStringMethodInfo
ResolveNotificationMethod "setHintUint32" o = NotificationSetHintUint32MethodInfo
ResolveNotificationMethod "setIconFromPixbuf" o = NotificationSetIconFromPixbufMethodInfo
ResolveNotificationMethod "setImageFromPixbuf" o = NotificationSetImageFromPixbufMethodInfo
ResolveNotificationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveNotificationMethod "setTimeout" o = NotificationSetTimeoutMethodInfo
ResolveNotificationMethod "setUrgency" o = NotificationSetUrgencyMethodInfo
ResolveNotificationMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveNotificationMethod t Notification, O.MethodInfo info Notification p) => OL.IsLabel t (Notification -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type NotificationClosedCallback =
IO ()
noNotificationClosedCallback :: Maybe NotificationClosedCallback
noNotificationClosedCallback :: Maybe (IO ())
noNotificationClosedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_NotificationClosedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_NotificationClosedCallback :: C_NotificationClosedCallback -> IO (FunPtr C_NotificationClosedCallback)
genClosure_NotificationClosed :: MonadIO m => NotificationClosedCallback -> m (GClosure C_NotificationClosedCallback)
genClosure_NotificationClosed :: IO () -> m (GClosure C_NotificationClosedCallback)
genClosure_NotificationClosed cb :: IO ()
cb = IO (GClosure C_NotificationClosedCallback)
-> m (GClosure C_NotificationClosedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_NotificationClosedCallback)
-> m (GClosure C_NotificationClosedCallback))
-> IO (GClosure C_NotificationClosedCallback)
-> m (GClosure C_NotificationClosedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_NotificationClosedCallback
cb' = IO () -> C_NotificationClosedCallback
wrap_NotificationClosedCallback IO ()
cb
C_NotificationClosedCallback
-> IO (FunPtr C_NotificationClosedCallback)
mk_NotificationClosedCallback C_NotificationClosedCallback
cb' IO (FunPtr C_NotificationClosedCallback)
-> (FunPtr C_NotificationClosedCallback
-> IO (GClosure C_NotificationClosedCallback))
-> IO (GClosure C_NotificationClosedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_NotificationClosedCallback
-> IO (GClosure C_NotificationClosedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_NotificationClosedCallback ::
NotificationClosedCallback ->
C_NotificationClosedCallback
wrap_NotificationClosedCallback :: IO () -> C_NotificationClosedCallback
wrap_NotificationClosedCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onNotificationClosed :: (IsNotification a, MonadIO m) => a -> NotificationClosedCallback -> m SignalHandlerId
onNotificationClosed :: a -> IO () -> m SignalHandlerId
onNotificationClosed obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
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 cb' :: C_NotificationClosedCallback
cb' = IO () -> C_NotificationClosedCallback
wrap_NotificationClosedCallback IO ()
cb
FunPtr C_NotificationClosedCallback
cb'' <- C_NotificationClosedCallback
-> IO (FunPtr C_NotificationClosedCallback)
mk_NotificationClosedCallback C_NotificationClosedCallback
cb'
a
-> Text
-> FunPtr C_NotificationClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "closed" FunPtr C_NotificationClosedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterNotificationClosed :: (IsNotification a, MonadIO m) => a -> NotificationClosedCallback -> m SignalHandlerId
afterNotificationClosed :: a -> IO () -> m SignalHandlerId
afterNotificationClosed obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
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 cb' :: C_NotificationClosedCallback
cb' = IO () -> C_NotificationClosedCallback
wrap_NotificationClosedCallback IO ()
cb
FunPtr C_NotificationClosedCallback
cb'' <- C_NotificationClosedCallback
-> IO (FunPtr C_NotificationClosedCallback)
mk_NotificationClosedCallback C_NotificationClosedCallback
cb'
a
-> Text
-> FunPtr C_NotificationClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "closed" FunPtr C_NotificationClosedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data NotificationClosedSignalInfo
instance SignalInfo NotificationClosedSignalInfo where
type HaskellCallbackType NotificationClosedSignalInfo = NotificationClosedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_NotificationClosedCallback cb
cb'' <- mk_NotificationClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' connectMode detail
#endif
getNotificationAppName :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationAppName :: o -> m (Maybe Text)
getNotificationAppName obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "app-name"
setNotificationAppName :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationAppName :: o -> Text -> m ()
setNotificationAppName obj :: o
obj val :: Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "app-name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructNotificationAppName :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationAppName :: Text -> IO (GValueConstruct o)
constructNotificationAppName val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "app-name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
#if defined(ENABLE_OVERLOADING)
data NotificationAppNamePropertyInfo
instance AttrInfo NotificationAppNamePropertyInfo where
type AttrAllowedOps NotificationAppNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint NotificationAppNamePropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationAppNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint NotificationAppNamePropertyInfo = (~) T.Text
type AttrTransferType NotificationAppNamePropertyInfo = T.Text
type AttrGetType NotificationAppNamePropertyInfo = (Maybe T.Text)
type AttrLabel NotificationAppNamePropertyInfo = "app-name"
type AttrOrigin NotificationAppNamePropertyInfo = Notification
attrGet = getNotificationAppName
attrSet = setNotificationAppName
attrTransfer _ v = do
return v
attrConstruct = constructNotificationAppName
attrClear = undefined
#endif
getNotificationBody :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationBody :: o -> m (Maybe Text)
getNotificationBody obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "body"
setNotificationBody :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationBody :: o -> Text -> m ()
setNotificationBody obj :: o
obj val :: Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "body" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructNotificationBody :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationBody :: Text -> IO (GValueConstruct o)
constructNotificationBody val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "body" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
clearNotificationBody :: (MonadIO m, IsNotification o) => o -> m ()
clearNotificationBody :: o -> m ()
clearNotificationBody obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "body" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data NotificationBodyPropertyInfo
instance AttrInfo NotificationBodyPropertyInfo where
type AttrAllowedOps NotificationBodyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint NotificationBodyPropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationBodyPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint NotificationBodyPropertyInfo = (~) T.Text
type AttrTransferType NotificationBodyPropertyInfo = T.Text
type AttrGetType NotificationBodyPropertyInfo = (Maybe T.Text)
type AttrLabel NotificationBodyPropertyInfo = "body"
type AttrOrigin NotificationBodyPropertyInfo = Notification
attrGet = getNotificationBody
attrSet = setNotificationBody
attrTransfer _ v = do
return v
attrConstruct = constructNotificationBody
attrClear = clearNotificationBody
#endif
getNotificationClosedReason :: (MonadIO m, IsNotification o) => o -> m Int32
getNotificationClosedReason :: o -> m Int32
getNotificationClosedReason obj :: o
obj = IO Int32 -> m Int32
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
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj "closed-reason"
#if defined(ENABLE_OVERLOADING)
data NotificationClosedReasonPropertyInfo
instance AttrInfo NotificationClosedReasonPropertyInfo where
type AttrAllowedOps NotificationClosedReasonPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint NotificationClosedReasonPropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationClosedReasonPropertyInfo = (~) ()
type AttrTransferTypeConstraint NotificationClosedReasonPropertyInfo = (~) ()
type AttrTransferType NotificationClosedReasonPropertyInfo = ()
type AttrGetType NotificationClosedReasonPropertyInfo = Int32
type AttrLabel NotificationClosedReasonPropertyInfo = "closed-reason"
type AttrOrigin NotificationClosedReasonPropertyInfo = Notification
attrGet = getNotificationClosedReason
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getNotificationIconName :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationIconName :: o -> m (Maybe Text)
getNotificationIconName obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "icon-name"
setNotificationIconName :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationIconName :: o -> Text -> m ()
setNotificationIconName obj :: o
obj val :: Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "icon-name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructNotificationIconName :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationIconName :: Text -> IO (GValueConstruct o)
constructNotificationIconName val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "icon-name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
clearNotificationIconName :: (MonadIO m, IsNotification o) => o -> m ()
clearNotificationIconName :: o -> m ()
clearNotificationIconName obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "icon-name" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data NotificationIconNamePropertyInfo
instance AttrInfo NotificationIconNamePropertyInfo where
type AttrAllowedOps NotificationIconNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint NotificationIconNamePropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationIconNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint NotificationIconNamePropertyInfo = (~) T.Text
type AttrTransferType NotificationIconNamePropertyInfo = T.Text
type AttrGetType NotificationIconNamePropertyInfo = (Maybe T.Text)
type AttrLabel NotificationIconNamePropertyInfo = "icon-name"
type AttrOrigin NotificationIconNamePropertyInfo = Notification
attrGet = getNotificationIconName
attrSet = setNotificationIconName
attrTransfer _ v = do
return v
attrConstruct = constructNotificationIconName
attrClear = clearNotificationIconName
#endif
getNotificationId :: (MonadIO m, IsNotification o) => o -> m Int32
getNotificationId :: o -> m Int32
getNotificationId obj :: o
obj = IO Int32 -> m Int32
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
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj "id"
setNotificationId :: (MonadIO m, IsNotification o) => o -> Int32 -> m ()
setNotificationId :: o -> Int32 -> m ()
setNotificationId obj :: o
obj val :: Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Int32 -> IO ()
forall a. GObject a => a -> String -> Int32 -> IO ()
B.Properties.setObjectPropertyInt32 o
obj "id" Int32
val
constructNotificationId :: (IsNotification o) => Int32 -> IO (GValueConstruct o)
constructNotificationId :: Int32 -> IO (GValueConstruct o)
constructNotificationId val :: Int32
val = String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 "id" Int32
val
#if defined(ENABLE_OVERLOADING)
data NotificationIdPropertyInfo
instance AttrInfo NotificationIdPropertyInfo where
type AttrAllowedOps NotificationIdPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint NotificationIdPropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationIdPropertyInfo = (~) Int32
type AttrTransferTypeConstraint NotificationIdPropertyInfo = (~) Int32
type AttrTransferType NotificationIdPropertyInfo = Int32
type AttrGetType NotificationIdPropertyInfo = Int32
type AttrLabel NotificationIdPropertyInfo = "id"
type AttrOrigin NotificationIdPropertyInfo = Notification
attrGet = getNotificationId
attrSet = setNotificationId
attrTransfer _ v = do
return v
attrConstruct = constructNotificationId
attrClear = undefined
#endif
getNotificationSummary :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationSummary :: o -> m (Maybe Text)
getNotificationSummary obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "summary"
setNotificationSummary :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationSummary :: o -> Text -> m ()
setNotificationSummary obj :: o
obj val :: Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "summary" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructNotificationSummary :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationSummary :: Text -> IO (GValueConstruct o)
constructNotificationSummary val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "summary" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
clearNotificationSummary :: (MonadIO m, IsNotification o) => o -> m ()
clearNotificationSummary :: o -> m ()
clearNotificationSummary obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "summary" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data NotificationSummaryPropertyInfo
instance AttrInfo NotificationSummaryPropertyInfo where
type AttrAllowedOps NotificationSummaryPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint NotificationSummaryPropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationSummaryPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint NotificationSummaryPropertyInfo = (~) T.Text
type AttrTransferType NotificationSummaryPropertyInfo = T.Text
type AttrGetType NotificationSummaryPropertyInfo = (Maybe T.Text)
type AttrLabel NotificationSummaryPropertyInfo = "summary"
type AttrOrigin NotificationSummaryPropertyInfo = Notification
attrGet = getNotificationSummary
attrSet = setNotificationSummary
attrTransfer _ v = do
return v
attrConstruct = constructNotificationSummary
attrClear = clearNotificationSummary
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Notification
type instance O.AttributeList Notification = NotificationAttributeList
type NotificationAttributeList = ('[ '("appName", NotificationAppNamePropertyInfo), '("body", NotificationBodyPropertyInfo), '("closedReason", NotificationClosedReasonPropertyInfo), '("iconName", NotificationIconNamePropertyInfo), '("id", NotificationIdPropertyInfo), '("summary", NotificationSummaryPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
notificationAppName :: AttrLabelProxy "appName"
notificationAppName = AttrLabelProxy
notificationBody :: AttrLabelProxy "body"
notificationBody = AttrLabelProxy
notificationClosedReason :: AttrLabelProxy "closedReason"
notificationClosedReason = AttrLabelProxy
notificationIconName :: AttrLabelProxy "iconName"
notificationIconName = AttrLabelProxy
notificationId :: AttrLabelProxy "id"
notificationId = AttrLabelProxy
notificationSummary :: AttrLabelProxy "summary"
notificationSummary = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Notification = NotificationSignalList
type NotificationSignalList = ('[ '("closed", NotificationClosedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "notify_notification_new" notify_notification_new ::
CString ->
CString ->
CString ->
IO (Ptr Notification)
notificationNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (T.Text)
-> Maybe (T.Text)
-> m Notification
notificationNew :: Text -> Maybe Text -> Maybe Text -> m Notification
notificationNew summary :: Text
summary body :: Maybe Text
body icon :: Maybe Text
icon = IO Notification -> m Notification
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Notification -> m Notification)
-> IO Notification -> m Notification
forall a b. (a -> b) -> a -> b
$ do
CString
summary' <- Text -> IO CString
textToCString Text
summary
CString
maybeBody <- case Maybe Text
body of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBody :: Text
jBody -> do
CString
jBody' <- Text -> IO CString
textToCString Text
jBody
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBody'
CString
maybeIcon <- case Maybe Text
icon of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jIcon :: Text
jIcon -> do
CString
jIcon' <- Text -> IO CString
textToCString Text
jIcon
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jIcon'
Ptr Notification
result <- CString -> CString -> CString -> IO (Ptr Notification)
notify_notification_new CString
summary' CString
maybeBody CString
maybeIcon
Text -> Ptr Notification -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "notificationNew" Ptr Notification
result
Notification
result' <- ((ManagedPtr Notification -> Notification)
-> Ptr Notification -> IO Notification
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Notification -> Notification
Notification) Ptr Notification
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
summary'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBody
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeIcon
Notification -> IO Notification
forall (m :: * -> *) a. Monad m => a -> m a
return Notification
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "notify_notification_add_action" notify_notification_add_action ::
Ptr Notification ->
CString ->
CString ->
FunPtr Notify.Callbacks.C_ActionCallback ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
notificationAddAction ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> T.Text
-> Notify.Callbacks.ActionCallback
-> m ()
notificationAddAction :: a -> Text -> Text -> ActionCallback -> m ()
notificationAddAction notification :: a
notification action :: Text
action label :: Text
label callback :: ActionCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
action' <- Text -> IO CString
textToCString Text
action
CString
label' <- Text -> IO CString
textToCString Text
label
FunPtr C_ActionCallback
callback' <- C_ActionCallback -> IO (FunPtr C_ActionCallback)
Notify.Callbacks.mk_ActionCallback (Maybe (Ptr (FunPtr C_ActionCallback))
-> ActionCallback_WithClosures -> C_ActionCallback
Notify.Callbacks.wrap_ActionCallback Maybe (Ptr (FunPtr C_ActionCallback))
forall a. Maybe a
Nothing (ActionCallback -> ActionCallback_WithClosures
Notify.Callbacks.drop_closures_ActionCallback ActionCallback
callback))
let userData :: Ptr ()
userData = FunPtr C_ActionCallback -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ActionCallback
callback'
let freeFunc :: FunPtr (Ptr a -> IO ())
freeFunc = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
Ptr Notification
-> CString
-> CString
-> FunPtr C_ActionCallback
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
notify_notification_add_action Ptr Notification
notification' CString
action' CString
label' FunPtr C_ActionCallback
callback' Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
freeFunc
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
action'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
label'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationAddActionMethodInfo
instance (signature ~ (T.Text -> T.Text -> Notify.Callbacks.ActionCallback -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationAddActionMethodInfo a signature where
overloadedMethod = notificationAddAction
#endif
foreign import ccall "notify_notification_clear_actions" notify_notification_clear_actions ::
Ptr Notification ->
IO ()
notificationClearActions ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m ()
notificationClearActions :: a -> m ()
notificationClearActions notification :: a
notification = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Ptr Notification -> IO ()
notify_notification_clear_actions Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationClearActionsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationClearActionsMethodInfo a signature where
overloadedMethod = notificationClearActions
#endif
foreign import ccall "notify_notification_clear_hints" notify_notification_clear_hints ::
Ptr Notification ->
IO ()
notificationClearHints ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m ()
notificationClearHints :: a -> m ()
notificationClearHints notification :: a
notification = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Ptr Notification -> IO ()
notify_notification_clear_hints Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationClearHintsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationClearHintsMethodInfo a signature where
overloadedMethod = notificationClearHints
#endif
foreign import ccall "notify_notification_close" notify_notification_close ::
Ptr Notification ->
Ptr (Ptr GError) ->
IO CInt
notificationClose ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m ()
notificationClose :: a -> m ()
notificationClose notification :: a
notification = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Notification -> Ptr (Ptr GError) -> IO CInt
notify_notification_close Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data NotificationCloseMethodInfo
instance (signature ~ (m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationCloseMethodInfo a signature where
overloadedMethod = notificationClose
#endif
foreign import ccall "notify_notification_get_closed_reason" notify_notification_get_closed_reason ::
Ptr Notification ->
IO Int32
notificationGetClosedReason ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m Int32
notificationGetClosedReason :: a -> m Int32
notificationGetClosedReason notification :: a
notification = IO Int32 -> m Int32
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
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Int32
result <- Ptr Notification -> IO Int32
notify_notification_get_closed_reason Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data NotificationGetClosedReasonMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsNotification a) => O.MethodInfo NotificationGetClosedReasonMethodInfo a signature where
overloadedMethod = notificationGetClosedReason
#endif
foreign import ccall "notify_notification_set_app_name" notify_notification_set_app_name ::
Ptr Notification ->
CString ->
IO ()
notificationSetAppName ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> m ()
notificationSetAppName :: a -> Text -> m ()
notificationSetAppName notification :: a
notification appName :: Text
appName = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
appName' <- Text -> IO CString
textToCString Text
appName
Ptr Notification -> CString -> IO ()
notify_notification_set_app_name Ptr Notification
notification' CString
appName'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
appName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetAppNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetAppNameMethodInfo a signature where
overloadedMethod = notificationSetAppName
#endif
foreign import ccall "notify_notification_set_category" notify_notification_set_category ::
Ptr Notification ->
CString ->
IO ()
notificationSetCategory ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> m ()
notificationSetCategory :: a -> Text -> m ()
notificationSetCategory notification :: a
notification category :: Text
category = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
category' <- Text -> IO CString
textToCString Text
category
Ptr Notification -> CString -> IO ()
notify_notification_set_category Ptr Notification
notification' CString
category'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
category'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetCategoryMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetCategoryMethodInfo a signature where
overloadedMethod = notificationSetCategory
#endif
foreign import ccall "notify_notification_set_hint" notify_notification_set_hint ::
Ptr Notification ->
CString ->
Ptr GVariant ->
IO ()
notificationSetHint ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> Maybe (GVariant)
-> m ()
notificationSetHint :: a -> Text -> Maybe GVariant -> m ()
notificationSetHint notification :: a
notification key :: Text
key value :: Maybe GVariant
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr GVariant
maybeValue <- case Maybe GVariant
value of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jValue :: GVariant
jValue -> do
Ptr GVariant
jValue' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jValue
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jValue'
Ptr Notification -> CString -> Ptr GVariant -> IO ()
notify_notification_set_hint Ptr Notification
notification' CString
key' Ptr GVariant
maybeValue
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
value GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetHintMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetHintMethodInfo a signature where
overloadedMethod = notificationSetHint
#endif
foreign import ccall "notify_notification_set_hint_byte" notify_notification_set_hint_byte ::
Ptr Notification ->
CString ->
Word8 ->
IO ()
{-# DEPRECATED notificationSetHintByte ["(Since version 0.6.)","Use 'GI.Notify.Objects.Notification.notificationSetHint' instead"] #-}
notificationSetHintByte ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> Word8
-> m ()
notificationSetHintByte :: a -> Text -> Word8 -> m ()
notificationSetHintByte notification :: a
notification key :: Text
key value :: Word8
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr Notification -> CString -> Word8 -> IO ()
notify_notification_set_hint_byte Ptr Notification
notification' CString
key' Word8
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetHintByteMethodInfo
instance (signature ~ (T.Text -> Word8 -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetHintByteMethodInfo a signature where
overloadedMethod = notificationSetHintByte
#endif
foreign import ccall "notify_notification_set_hint_byte_array" notify_notification_set_hint_byte_array ::
Ptr Notification ->
CString ->
Ptr Word8 ->
Word64 ->
IO ()
{-# DEPRECATED notificationSetHintByteArray ["(Since version 0.6.)","Use 'GI.Notify.Objects.Notification.notificationSetHint' instead"] #-}
notificationSetHintByteArray ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> ByteString
-> m ()
notificationSetHintByteArray :: a -> Text -> ByteString -> m ()
notificationSetHintByteArray notification :: a
notification key :: Text
key value :: ByteString
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let len :: Word64
len = Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
value
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr Word8
value' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
value
Ptr Notification -> CString -> Ptr Word8 -> Word64 -> IO ()
notify_notification_set_hint_byte_array Ptr Notification
notification' CString
key' Ptr Word8
value' Word64
len
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
value'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetHintByteArrayMethodInfo
instance (signature ~ (T.Text -> ByteString -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetHintByteArrayMethodInfo a signature where
overloadedMethod = notificationSetHintByteArray
#endif
foreign import ccall "notify_notification_set_hint_double" notify_notification_set_hint_double ::
Ptr Notification ->
CString ->
CDouble ->
IO ()
{-# DEPRECATED notificationSetHintDouble ["(Since version 0.6.)","Use 'GI.Notify.Objects.Notification.notificationSetHint' instead"] #-}
notificationSetHintDouble ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> Double
-> m ()
notificationSetHintDouble :: a -> Text -> Double -> m ()
notificationSetHintDouble notification :: a
notification key :: Text
key value :: Double
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
key' <- Text -> IO CString
textToCString Text
key
let value' :: CDouble
value' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
value
Ptr Notification -> CString -> CDouble -> IO ()
notify_notification_set_hint_double Ptr Notification
notification' CString
key' CDouble
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetHintDoubleMethodInfo
instance (signature ~ (T.Text -> Double -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetHintDoubleMethodInfo a signature where
overloadedMethod = notificationSetHintDouble
#endif
foreign import ccall "notify_notification_set_hint_int32" notify_notification_set_hint_int32 ::
Ptr Notification ->
CString ->
Int32 ->
IO ()
{-# DEPRECATED notificationSetHintInt32 ["(Since version 0.6.)","Use 'GI.Notify.Objects.Notification.notificationSetHint' instead"] #-}
notificationSetHintInt32 ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> Int32
-> m ()
notificationSetHintInt32 :: a -> Text -> Int32 -> m ()
notificationSetHintInt32 notification :: a
notification key :: Text
key value :: Int32
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr Notification -> CString -> Int32 -> IO ()
notify_notification_set_hint_int32 Ptr Notification
notification' CString
key' Int32
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetHintInt32MethodInfo
instance (signature ~ (T.Text -> Int32 -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetHintInt32MethodInfo a signature where
overloadedMethod = notificationSetHintInt32
#endif
foreign import ccall "notify_notification_set_hint_string" notify_notification_set_hint_string ::
Ptr Notification ->
CString ->
CString ->
IO ()
{-# DEPRECATED notificationSetHintString ["(Since version 0.6.)","Use 'GI.Notify.Objects.Notification.notificationSetHint' instead"] #-}
notificationSetHintString ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> T.Text
-> m ()
notificationSetHintString :: a -> Text -> Text -> m ()
notificationSetHintString notification :: a
notification key :: Text
key value :: Text
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
key' <- Text -> IO CString
textToCString Text
key
CString
value' <- Text -> IO CString
textToCString Text
value
Ptr Notification -> CString -> CString -> IO ()
notify_notification_set_hint_string Ptr Notification
notification' CString
key' CString
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetHintStringMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetHintStringMethodInfo a signature where
overloadedMethod = notificationSetHintString
#endif
foreign import ccall "notify_notification_set_hint_uint32" notify_notification_set_hint_uint32 ::
Ptr Notification ->
CString ->
Word32 ->
IO ()
{-# DEPRECATED notificationSetHintUint32 ["(Since version 0.6.)","Use 'GI.Notify.Objects.Notification.notificationSetHint' instead"] #-}
notificationSetHintUint32 ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> Word32
-> m ()
notificationSetHintUint32 :: a -> Text -> Word32 -> m ()
notificationSetHintUint32 notification :: a
notification key :: Text
key value :: Word32
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr Notification -> CString -> Word32 -> IO ()
notify_notification_set_hint_uint32 Ptr Notification
notification' CString
key' Word32
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetHintUint32MethodInfo
instance (signature ~ (T.Text -> Word32 -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetHintUint32MethodInfo a signature where
overloadedMethod = notificationSetHintUint32
#endif
foreign import ccall "notify_notification_set_icon_from_pixbuf" notify_notification_set_icon_from_pixbuf ::
Ptr Notification ->
Ptr GdkPixbuf.Pixbuf.Pixbuf ->
IO ()
{-# DEPRECATED notificationSetIconFromPixbuf ["use 'GI.Notify.Objects.Notification.notificationSetImageFromPixbuf' instead."] #-}
notificationSetIconFromPixbuf ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a, GdkPixbuf.Pixbuf.IsPixbuf b) =>
a
-> b
-> m ()
notificationSetIconFromPixbuf :: a -> b -> m ()
notificationSetIconFromPixbuf notification :: a
notification icon :: b
icon = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Ptr Pixbuf
icon' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
icon
Ptr Notification -> Ptr Pixbuf -> IO ()
notify_notification_set_icon_from_pixbuf Ptr Notification
notification' Ptr Pixbuf
icon'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
icon
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetIconFromPixbufMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsNotification a, GdkPixbuf.Pixbuf.IsPixbuf b) => O.MethodInfo NotificationSetIconFromPixbufMethodInfo a signature where
overloadedMethod = notificationSetIconFromPixbuf
#endif
foreign import ccall "notify_notification_set_image_from_pixbuf" notify_notification_set_image_from_pixbuf ::
Ptr Notification ->
Ptr GdkPixbuf.Pixbuf.Pixbuf ->
IO ()
notificationSetImageFromPixbuf ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a, GdkPixbuf.Pixbuf.IsPixbuf b) =>
a
-> b
-> m ()
notificationSetImageFromPixbuf :: a -> b -> m ()
notificationSetImageFromPixbuf notification :: a
notification pixbuf :: b
pixbuf = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Ptr Pixbuf
pixbuf' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
pixbuf
Ptr Notification -> Ptr Pixbuf -> IO ()
notify_notification_set_image_from_pixbuf Ptr Notification
notification' Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
pixbuf
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetImageFromPixbufMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsNotification a, GdkPixbuf.Pixbuf.IsPixbuf b) => O.MethodInfo NotificationSetImageFromPixbufMethodInfo a signature where
overloadedMethod = notificationSetImageFromPixbuf
#endif
foreign import ccall "notify_notification_set_timeout" notify_notification_set_timeout ::
Ptr Notification ->
Int32 ->
IO ()
notificationSetTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> Int32
-> m ()
notificationSetTimeout :: a -> Int32 -> m ()
notificationSetTimeout notification :: a
notification timeout :: Int32
timeout = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Ptr Notification -> Int32 -> IO ()
notify_notification_set_timeout Ptr Notification
notification' Int32
timeout
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetTimeoutMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetTimeoutMethodInfo a signature where
overloadedMethod = notificationSetTimeout
#endif
foreign import ccall "notify_notification_set_urgency" notify_notification_set_urgency ::
Ptr Notification ->
CUInt ->
IO ()
notificationSetUrgency ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> Notify.Enums.Urgency
-> m ()
notificationSetUrgency :: a -> Urgency -> m ()
notificationSetUrgency notification :: a
notification urgency :: Urgency
urgency = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
let urgency' :: CUInt
urgency' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Urgency -> Int) -> Urgency -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Urgency -> Int
forall a. Enum a => a -> Int
fromEnum) Urgency
urgency
Ptr Notification -> CUInt -> IO ()
notify_notification_set_urgency Ptr Notification
notification' CUInt
urgency'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetUrgencyMethodInfo
instance (signature ~ (Notify.Enums.Urgency -> m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationSetUrgencyMethodInfo a signature where
overloadedMethod = notificationSetUrgency
#endif
foreign import ccall "notify_notification_show" notify_notification_show ::
Ptr Notification ->
Ptr (Ptr GError) ->
IO CInt
notificationShow ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m ()
notificationShow :: a -> m ()
notificationShow notification :: a
notification = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Notification -> Ptr (Ptr GError) -> IO CInt
notify_notification_show Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data NotificationShowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsNotification a) => O.MethodInfo NotificationShowMethodInfo a signature where
overloadedMethod = notificationShow
#endif
foreign import ccall "notify_notification_update" notify_notification_update ::
Ptr Notification ->
CString ->
CString ->
CString ->
IO CInt
notificationUpdate ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> Maybe (T.Text)
-> Maybe (T.Text)
-> m Bool
notificationUpdate :: a -> Text -> Maybe Text -> Maybe Text -> m Bool
notificationUpdate notification :: a
notification summary :: Text
summary body :: Maybe Text
body icon :: Maybe Text
icon = IO Bool -> m Bool
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
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
summary' <- Text -> IO CString
textToCString Text
summary
CString
maybeBody <- case Maybe Text
body of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBody :: Text
jBody -> do
CString
jBody' <- Text -> IO CString
textToCString Text
jBody
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBody'
CString
maybeIcon <- case Maybe Text
icon of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jIcon :: Text
jIcon -> do
CString
jIcon' <- Text -> IO CString
textToCString Text
jIcon
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jIcon'
CInt
result <- Ptr Notification -> CString -> CString -> CString -> IO CInt
notify_notification_update Ptr Notification
notification' CString
summary' CString
maybeBody CString
maybeIcon
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
summary'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBody
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeIcon
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data NotificationUpdateMethodInfo
instance (signature ~ (T.Text -> Maybe (T.Text) -> Maybe (T.Text) -> m Bool), MonadIO m, IsNotification a) => O.MethodInfo NotificationUpdateMethodInfo a signature where
overloadedMethod = notificationUpdate
#endif