#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Notify.Objects.Notification
(
Notification(..) ,
IsNotification ,
toNotification ,
noNotification ,
#if ENABLE_OVERLOADING
NotificationAddActionMethodInfo ,
#endif
notificationAddAction ,
#if ENABLE_OVERLOADING
NotificationClearActionsMethodInfo ,
#endif
notificationClearActions ,
#if ENABLE_OVERLOADING
NotificationClearHintsMethodInfo ,
#endif
notificationClearHints ,
#if ENABLE_OVERLOADING
NotificationCloseMethodInfo ,
#endif
notificationClose ,
#if ENABLE_OVERLOADING
NotificationGetClosedReasonMethodInfo ,
#endif
notificationGetClosedReason ,
notificationNew ,
#if ENABLE_OVERLOADING
NotificationSetAppNameMethodInfo ,
#endif
notificationSetAppName ,
#if ENABLE_OVERLOADING
NotificationSetCategoryMethodInfo ,
#endif
notificationSetCategory ,
#if ENABLE_OVERLOADING
NotificationSetHintMethodInfo ,
#endif
notificationSetHint ,
#if ENABLE_OVERLOADING
NotificationSetHintByteMethodInfo ,
#endif
notificationSetHintByte ,
#if ENABLE_OVERLOADING
NotificationSetHintByteArrayMethodInfo ,
#endif
notificationSetHintByteArray ,
#if ENABLE_OVERLOADING
NotificationSetHintDoubleMethodInfo ,
#endif
notificationSetHintDouble ,
#if ENABLE_OVERLOADING
NotificationSetHintInt32MethodInfo ,
#endif
notificationSetHintInt32 ,
#if ENABLE_OVERLOADING
NotificationSetHintStringMethodInfo ,
#endif
notificationSetHintString ,
#if ENABLE_OVERLOADING
NotificationSetHintUint32MethodInfo ,
#endif
notificationSetHintUint32 ,
#if ENABLE_OVERLOADING
NotificationSetIconFromPixbufMethodInfo ,
#endif
notificationSetIconFromPixbuf ,
#if ENABLE_OVERLOADING
NotificationSetImageFromPixbufMethodInfo,
#endif
notificationSetImageFromPixbuf ,
#if ENABLE_OVERLOADING
NotificationSetTimeoutMethodInfo ,
#endif
notificationSetTimeout ,
#if ENABLE_OVERLOADING
NotificationSetUrgencyMethodInfo ,
#endif
notificationSetUrgency ,
#if ENABLE_OVERLOADING
NotificationShowMethodInfo ,
#endif
notificationShow ,
#if ENABLE_OVERLOADING
NotificationUpdateMethodInfo ,
#endif
notificationUpdate ,
#if ENABLE_OVERLOADING
NotificationAppNamePropertyInfo ,
#endif
constructNotificationAppName ,
getNotificationAppName ,
#if ENABLE_OVERLOADING
notificationAppName ,
#endif
setNotificationAppName ,
#if ENABLE_OVERLOADING
NotificationBodyPropertyInfo ,
#endif
clearNotificationBody ,
constructNotificationBody ,
getNotificationBody ,
#if ENABLE_OVERLOADING
notificationBody ,
#endif
setNotificationBody ,
#if ENABLE_OVERLOADING
NotificationClosedReasonPropertyInfo ,
#endif
getNotificationClosedReason ,
#if ENABLE_OVERLOADING
notificationClosedReason ,
#endif
#if ENABLE_OVERLOADING
NotificationIconNamePropertyInfo ,
#endif
clearNotificationIconName ,
constructNotificationIconName ,
getNotificationIconName ,
#if ENABLE_OVERLOADING
notificationIconName ,
#endif
setNotificationIconName ,
#if ENABLE_OVERLOADING
NotificationIdPropertyInfo ,
#endif
constructNotificationId ,
getNotificationId ,
#if ENABLE_OVERLOADING
notificationId ,
#endif
setNotificationId ,
#if ENABLE_OVERLOADING
NotificationSummaryPropertyInfo ,
#endif
clearNotificationSummary ,
constructNotificationSummary ,
getNotificationSummary ,
#if ENABLE_OVERLOADING
notificationSummary ,
#endif
setNotificationSummary ,
C_NotificationClosedCallback ,
NotificationClosedCallback ,
#if 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.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)
foreign import ccall "notify_notification_get_type"
c_notify_notification_get_type :: IO GType
instance GObject Notification where
gobjectType = c_notify_notification_get_type
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 = liftIO . unsafeCastTo Notification
noNotification :: Maybe Notification
noNotification = Nothing
#if 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 "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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
type NotificationClosedCallback =
IO ()
noNotificationClosedCallback :: Maybe NotificationClosedCallback
noNotificationClosedCallback = 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 cb = liftIO $ do
let cb' = wrap_NotificationClosedCallback cb
mk_NotificationClosedCallback cb' >>= B.GClosure.newGClosure
wrap_NotificationClosedCallback ::
NotificationClosedCallback ->
C_NotificationClosedCallback
wrap_NotificationClosedCallback _cb _ _ = do
_cb
onNotificationClosed :: (IsNotification a, MonadIO m) => a -> NotificationClosedCallback -> m SignalHandlerId
onNotificationClosed obj cb = liftIO $ do
let cb' = wrap_NotificationClosedCallback cb
cb'' <- mk_NotificationClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' SignalConnectBefore
afterNotificationClosed :: (IsNotification a, MonadIO m) => a -> NotificationClosedCallback -> m SignalHandlerId
afterNotificationClosed obj cb = liftIO $ do
let cb' = wrap_NotificationClosedCallback cb
cb'' <- mk_NotificationClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' SignalConnectAfter
getNotificationAppName :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationAppName obj = liftIO $ B.Properties.getObjectPropertyString obj "app-name"
setNotificationAppName :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationAppName obj val = liftIO $ B.Properties.setObjectPropertyString obj "app-name" (Just val)
constructNotificationAppName :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationAppName val = B.Properties.constructObjectPropertyString "app-name" (Just val)
#if ENABLE_OVERLOADING
data NotificationAppNamePropertyInfo
instance AttrInfo NotificationAppNamePropertyInfo where
type AttrAllowedOps NotificationAppNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint NotificationAppNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NotificationAppNamePropertyInfo = IsNotification
type AttrGetType NotificationAppNamePropertyInfo = (Maybe T.Text)
type AttrLabel NotificationAppNamePropertyInfo = "app-name"
type AttrOrigin NotificationAppNamePropertyInfo = Notification
attrGet _ = getNotificationAppName
attrSet _ = setNotificationAppName
attrConstruct _ = constructNotificationAppName
attrClear _ = undefined
#endif
getNotificationBody :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationBody obj = liftIO $ B.Properties.getObjectPropertyString obj "body"
setNotificationBody :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationBody obj val = liftIO $ B.Properties.setObjectPropertyString obj "body" (Just val)
constructNotificationBody :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationBody val = B.Properties.constructObjectPropertyString "body" (Just val)
clearNotificationBody :: (MonadIO m, IsNotification o) => o -> m ()
clearNotificationBody obj = liftIO $ B.Properties.setObjectPropertyString obj "body" (Nothing :: Maybe T.Text)
#if ENABLE_OVERLOADING
data NotificationBodyPropertyInfo
instance AttrInfo NotificationBodyPropertyInfo where
type AttrAllowedOps NotificationBodyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint NotificationBodyPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NotificationBodyPropertyInfo = IsNotification
type AttrGetType NotificationBodyPropertyInfo = (Maybe T.Text)
type AttrLabel NotificationBodyPropertyInfo = "body"
type AttrOrigin NotificationBodyPropertyInfo = Notification
attrGet _ = getNotificationBody
attrSet _ = setNotificationBody
attrConstruct _ = constructNotificationBody
attrClear _ = clearNotificationBody
#endif
getNotificationClosedReason :: (MonadIO m, IsNotification o) => o -> m Int32
getNotificationClosedReason obj = liftIO $ B.Properties.getObjectPropertyInt32 obj "closed-reason"
#if ENABLE_OVERLOADING
data NotificationClosedReasonPropertyInfo
instance AttrInfo NotificationClosedReasonPropertyInfo where
type AttrAllowedOps NotificationClosedReasonPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint NotificationClosedReasonPropertyInfo = (~) ()
type AttrBaseTypeConstraint NotificationClosedReasonPropertyInfo = IsNotification
type AttrGetType NotificationClosedReasonPropertyInfo = Int32
type AttrLabel NotificationClosedReasonPropertyInfo = "closed-reason"
type AttrOrigin NotificationClosedReasonPropertyInfo = Notification
attrGet _ = getNotificationClosedReason
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getNotificationIconName :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationIconName obj = liftIO $ B.Properties.getObjectPropertyString obj "icon-name"
setNotificationIconName :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationIconName obj val = liftIO $ B.Properties.setObjectPropertyString obj "icon-name" (Just val)
constructNotificationIconName :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationIconName val = B.Properties.constructObjectPropertyString "icon-name" (Just val)
clearNotificationIconName :: (MonadIO m, IsNotification o) => o -> m ()
clearNotificationIconName obj = liftIO $ B.Properties.setObjectPropertyString obj "icon-name" (Nothing :: Maybe T.Text)
#if ENABLE_OVERLOADING
data NotificationIconNamePropertyInfo
instance AttrInfo NotificationIconNamePropertyInfo where
type AttrAllowedOps NotificationIconNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint NotificationIconNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NotificationIconNamePropertyInfo = IsNotification
type AttrGetType NotificationIconNamePropertyInfo = (Maybe T.Text)
type AttrLabel NotificationIconNamePropertyInfo = "icon-name"
type AttrOrigin NotificationIconNamePropertyInfo = Notification
attrGet _ = getNotificationIconName
attrSet _ = setNotificationIconName
attrConstruct _ = constructNotificationIconName
attrClear _ = clearNotificationIconName
#endif
getNotificationId :: (MonadIO m, IsNotification o) => o -> m Int32
getNotificationId obj = liftIO $ B.Properties.getObjectPropertyInt32 obj "id"
setNotificationId :: (MonadIO m, IsNotification o) => o -> Int32 -> m ()
setNotificationId obj val = liftIO $ B.Properties.setObjectPropertyInt32 obj "id" val
constructNotificationId :: (IsNotification o) => Int32 -> IO (GValueConstruct o)
constructNotificationId val = B.Properties.constructObjectPropertyInt32 "id" val
#if ENABLE_OVERLOADING
data NotificationIdPropertyInfo
instance AttrInfo NotificationIdPropertyInfo where
type AttrAllowedOps NotificationIdPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint NotificationIdPropertyInfo = (~) Int32
type AttrBaseTypeConstraint NotificationIdPropertyInfo = IsNotification
type AttrGetType NotificationIdPropertyInfo = Int32
type AttrLabel NotificationIdPropertyInfo = "id"
type AttrOrigin NotificationIdPropertyInfo = Notification
attrGet _ = getNotificationId
attrSet _ = setNotificationId
attrConstruct _ = constructNotificationId
attrClear _ = undefined
#endif
getNotificationSummary :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationSummary obj = liftIO $ B.Properties.getObjectPropertyString obj "summary"
setNotificationSummary :: (MonadIO m, IsNotification o) => o -> T.Text -> m ()
setNotificationSummary obj val = liftIO $ B.Properties.setObjectPropertyString obj "summary" (Just val)
constructNotificationSummary :: (IsNotification o) => T.Text -> IO (GValueConstruct o)
constructNotificationSummary val = B.Properties.constructObjectPropertyString "summary" (Just val)
clearNotificationSummary :: (MonadIO m, IsNotification o) => o -> m ()
clearNotificationSummary obj = liftIO $ B.Properties.setObjectPropertyString obj "summary" (Nothing :: Maybe T.Text)
#if ENABLE_OVERLOADING
data NotificationSummaryPropertyInfo
instance AttrInfo NotificationSummaryPropertyInfo where
type AttrAllowedOps NotificationSummaryPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint NotificationSummaryPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NotificationSummaryPropertyInfo = IsNotification
type AttrGetType NotificationSummaryPropertyInfo = (Maybe T.Text)
type AttrLabel NotificationSummaryPropertyInfo = "summary"
type AttrOrigin NotificationSummaryPropertyInfo = Notification
attrGet _ = getNotificationSummary
attrSet _ = setNotificationSummary
attrConstruct _ = constructNotificationSummary
attrClear _ = clearNotificationSummary
#endif
#if 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 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 ENABLE_OVERLOADING
data NotificationClosedSignalInfo
instance SignalInfo NotificationClosedSignalInfo where
type HaskellCallbackType NotificationClosedSignalInfo = NotificationClosedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_NotificationClosedCallback cb
cb'' <- mk_NotificationClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' connectMode
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 summary body icon = liftIO $ do
summary' <- textToCString summary
maybeBody <- case body of
Nothing -> return nullPtr
Just jBody -> do
jBody' <- textToCString jBody
return jBody'
maybeIcon <- case icon of
Nothing -> return nullPtr
Just jIcon -> do
jIcon' <- textToCString jIcon
return jIcon'
result <- notify_notification_new summary' maybeBody maybeIcon
checkUnexpectedReturnNULL "notificationNew" result
result' <- (wrapObject Notification) result
freeMem summary'
freeMem maybeBody
freeMem maybeIcon
return result'
#if 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 notification action label callback = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
action' <- textToCString action
label' <- textToCString label
callback' <- Notify.Callbacks.mk_ActionCallback (Notify.Callbacks.wrap_ActionCallback Nothing (Notify.Callbacks.drop_closures_ActionCallback callback))
let userData = castFunPtrToPtr callback'
let freeFunc = safeFreeFunPtrPtr
notify_notification_add_action notification' action' label' callback' userData freeFunc
touchManagedPtr notification
freeMem action'
freeMem label'
return ()
#if 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 notification = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
notify_notification_clear_actions notification'
touchManagedPtr notification
return ()
#if 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 notification = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
notify_notification_clear_hints notification'
touchManagedPtr notification
return ()
#if 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 notification = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
onException (do
_ <- propagateGError $ notify_notification_close notification'
touchManagedPtr notification
return ()
) (do
return ()
)
#if 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 notification = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
result <- notify_notification_get_closed_reason notification'
touchManagedPtr notification
return result
#if 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 notification appName = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
appName' <- textToCString appName
notify_notification_set_app_name notification' appName'
touchManagedPtr notification
freeMem appName'
return ()
#if 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 notification category = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
category' <- textToCString category
notify_notification_set_category notification' category'
touchManagedPtr notification
freeMem category'
return ()
#if 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 notification key value = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
key' <- textToCString key
maybeValue <- case value of
Nothing -> return nullPtr
Just jValue -> do
jValue' <- unsafeManagedPtrGetPtr jValue
return jValue'
notify_notification_set_hint notification' key' maybeValue
touchManagedPtr notification
whenJust value touchManagedPtr
freeMem key'
return ()
#if 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 notification key value = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
key' <- textToCString key
notify_notification_set_hint_byte notification' key' value
touchManagedPtr notification
freeMem key'
return ()
#if 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 notification key value = liftIO $ do
let len = fromIntegral $ B.length value
notification' <- unsafeManagedPtrCastPtr notification
key' <- textToCString key
value' <- packByteString value
notify_notification_set_hint_byte_array notification' key' value' len
touchManagedPtr notification
freeMem key'
freeMem value'
return ()
#if 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 notification key value = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
key' <- textToCString key
let value' = realToFrac value
notify_notification_set_hint_double notification' key' value'
touchManagedPtr notification
freeMem key'
return ()
#if 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 notification key value = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
key' <- textToCString key
notify_notification_set_hint_int32 notification' key' value
touchManagedPtr notification
freeMem key'
return ()
#if 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 notification key value = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
key' <- textToCString key
value' <- textToCString value
notify_notification_set_hint_string notification' key' value'
touchManagedPtr notification
freeMem key'
freeMem value'
return ()
#if 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 notification key value = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
key' <- textToCString key
notify_notification_set_hint_uint32 notification' key' value
touchManagedPtr notification
freeMem key'
return ()
#if 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 notification icon = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
icon' <- unsafeManagedPtrCastPtr icon
notify_notification_set_icon_from_pixbuf notification' icon'
touchManagedPtr notification
touchManagedPtr icon
return ()
#if 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 notification pixbuf = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
pixbuf' <- unsafeManagedPtrCastPtr pixbuf
notify_notification_set_image_from_pixbuf notification' pixbuf'
touchManagedPtr notification
touchManagedPtr pixbuf
return ()
#if 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 notification timeout = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
notify_notification_set_timeout notification' timeout
touchManagedPtr notification
return ()
#if 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 notification urgency = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
let urgency' = (fromIntegral . fromEnum) urgency
notify_notification_set_urgency notification' urgency'
touchManagedPtr notification
return ()
#if 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 notification = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
onException (do
_ <- propagateGError $ notify_notification_show notification'
touchManagedPtr notification
return ()
) (do
return ()
)
#if 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 notification summary body icon = liftIO $ do
notification' <- unsafeManagedPtrCastPtr notification
summary' <- textToCString summary
maybeBody <- case body of
Nothing -> return nullPtr
Just jBody -> do
jBody' <- textToCString jBody
return jBody'
maybeIcon <- case icon of
Nothing -> return nullPtr
Just jIcon -> do
jIcon' <- textToCString jIcon
return jIcon'
result <- notify_notification_update notification' summary' maybeBody maybeIcon
let result' = (/= 0) result
touchManagedPtr notification
freeMem summary'
freeMem maybeBody
freeMem maybeIcon
return result'
#if 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