{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) -} module GI.Notify.Objects.Notification ( -- * Exported types Notification(..) , NotificationK , toNotification , noNotification , -- * Methods -- ** notificationAddAction notificationAddAction , -- ** notificationClearActions notificationClearActions , -- ** notificationClearHints notificationClearHints , -- ** notificationClose notificationClose , -- ** notificationGetClosedReason notificationGetClosedReason , -- ** notificationNew notificationNew , -- ** notificationSetAppName notificationSetAppName , -- ** notificationSetCategory notificationSetCategory , -- ** notificationSetHint notificationSetHint , -- ** notificationSetHintByte notificationSetHintByte , -- ** notificationSetHintByteArray notificationSetHintByteArray , -- ** notificationSetHintDouble notificationSetHintDouble , -- ** notificationSetHintInt32 notificationSetHintInt32 , -- ** notificationSetHintString notificationSetHintString , -- ** notificationSetHintUint32 notificationSetHintUint32 , -- ** notificationSetIconFromPixbuf notificationSetIconFromPixbuf , -- ** notificationSetImageFromPixbuf notificationSetImageFromPixbuf , -- ** notificationSetTimeout notificationSetTimeout , -- ** notificationSetUrgency notificationSetUrgency , -- ** notificationShow notificationShow , -- ** notificationUpdate notificationUpdate , -- * Properties -- ** AppName NotificationAppNamePropertyInfo , constructNotificationAppName , getNotificationAppName , setNotificationAppName , -- ** Body NotificationBodyPropertyInfo , constructNotificationBody , getNotificationBody , setNotificationBody , -- ** ClosedReason NotificationClosedReasonPropertyInfo , getNotificationClosedReason , -- ** IconName NotificationIconNamePropertyInfo , constructNotificationIconName , getNotificationIconName , setNotificationIconName , -- ** Id NotificationIdPropertyInfo , constructNotificationId , getNotificationId , setNotificationId , -- ** Summary NotificationSummaryPropertyInfo , constructNotificationSummary , getNotificationSummary , setNotificationSummary , -- * Signals -- ** Closed NotificationClosedCallback , NotificationClosedCallbackC , NotificationClosedSignalInfo , afterNotificationClosed , mkNotificationClosedCallback , noNotificationClosedCallback , notificationClosedCallbackWrapper , notificationClosedClosure , onNotificationClosed , ) where import Prelude () import Data.GI.Base.ShortPrelude import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import GI.Notify.Types import GI.Notify.Callbacks import qualified GI.GLib as GLib import qualified GI.GObject as GObject import qualified GI.GdkPixbuf as GdkPixbuf newtype Notification = Notification (ForeignPtr Notification) foreign import ccall "notify_notification_get_type" c_notify_notification_get_type :: IO GType type instance ParentTypes Notification = NotificationParentTypes type NotificationParentTypes = '[GObject.Object] instance GObject Notification where gobjectIsInitiallyUnowned _ = False gobjectType _ = c_notify_notification_get_type class GObject o => NotificationK o instance (GObject o, IsDescendantOf Notification o) => NotificationK o toNotification :: NotificationK o => o -> IO Notification toNotification = unsafeCastTo Notification noNotification :: Maybe Notification noNotification = Nothing -- signal Notification::closed type NotificationClosedCallback = IO () noNotificationClosedCallback :: Maybe NotificationClosedCallback noNotificationClosedCallback = Nothing type NotificationClosedCallbackC = Ptr () -> -- object Ptr () -> -- user_data IO () foreign import ccall "wrapper" mkNotificationClosedCallback :: NotificationClosedCallbackC -> IO (FunPtr NotificationClosedCallbackC) notificationClosedClosure :: NotificationClosedCallback -> IO Closure notificationClosedClosure cb = newCClosure =<< mkNotificationClosedCallback wrapped where wrapped = notificationClosedCallbackWrapper cb notificationClosedCallbackWrapper :: NotificationClosedCallback -> Ptr () -> Ptr () -> IO () notificationClosedCallbackWrapper _cb _ _ = do _cb onNotificationClosed :: (GObject a, MonadIO m) => a -> NotificationClosedCallback -> m SignalHandlerId onNotificationClosed obj cb = liftIO $ connectNotificationClosed obj cb SignalConnectBefore afterNotificationClosed :: (GObject a, MonadIO m) => a -> NotificationClosedCallback -> m SignalHandlerId afterNotificationClosed obj cb = connectNotificationClosed obj cb SignalConnectAfter connectNotificationClosed :: (GObject a, MonadIO m) => a -> NotificationClosedCallback -> SignalConnectMode -> m SignalHandlerId connectNotificationClosed obj cb after = liftIO $ do cb' <- mkNotificationClosedCallback (notificationClosedCallbackWrapper cb) connectSignalFunPtr obj "closed" cb' after -- VVV Prop "app-name" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable,PropertyWritable] getNotificationAppName :: (MonadIO m, NotificationK o) => o -> m T.Text getNotificationAppName obj = liftIO $ getObjectPropertyString obj "app-name" setNotificationAppName :: (MonadIO m, NotificationK o) => o -> T.Text -> m () setNotificationAppName obj val = liftIO $ setObjectPropertyString obj "app-name" val constructNotificationAppName :: T.Text -> IO ([Char], GValue) constructNotificationAppName val = constructObjectPropertyString "app-name" val data NotificationAppNamePropertyInfo instance AttrInfo NotificationAppNamePropertyInfo where type AttrAllowedOps NotificationAppNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint NotificationAppNamePropertyInfo = (~) T.Text type AttrBaseTypeConstraint NotificationAppNamePropertyInfo = NotificationK type AttrGetType NotificationAppNamePropertyInfo = T.Text type AttrLabel NotificationAppNamePropertyInfo = "Notification::app-name" attrGet _ = getNotificationAppName attrSet _ = setNotificationAppName attrConstruct _ = constructNotificationAppName -- VVV Prop "body" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] getNotificationBody :: (MonadIO m, NotificationK o) => o -> m T.Text getNotificationBody obj = liftIO $ getObjectPropertyString obj "body" setNotificationBody :: (MonadIO m, NotificationK o) => o -> T.Text -> m () setNotificationBody obj val = liftIO $ setObjectPropertyString obj "body" val constructNotificationBody :: T.Text -> IO ([Char], GValue) constructNotificationBody val = constructObjectPropertyString "body" val data NotificationBodyPropertyInfo instance AttrInfo NotificationBodyPropertyInfo where type AttrAllowedOps NotificationBodyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint NotificationBodyPropertyInfo = (~) T.Text type AttrBaseTypeConstraint NotificationBodyPropertyInfo = NotificationK type AttrGetType NotificationBodyPropertyInfo = T.Text type AttrLabel NotificationBodyPropertyInfo = "Notification::body" attrGet _ = getNotificationBody attrSet _ = setNotificationBody attrConstruct _ = constructNotificationBody -- VVV Prop "closed-reason" -- Type: TBasicType TInt32 -- Flags: [PropertyReadable] getNotificationClosedReason :: (MonadIO m, NotificationK o) => o -> m Int32 getNotificationClosedReason obj = liftIO $ getObjectPropertyCInt obj "closed-reason" data NotificationClosedReasonPropertyInfo instance AttrInfo NotificationClosedReasonPropertyInfo where type AttrAllowedOps NotificationClosedReasonPropertyInfo = '[ 'AttrGet] type AttrSetTypeConstraint NotificationClosedReasonPropertyInfo = (~) () type AttrBaseTypeConstraint NotificationClosedReasonPropertyInfo = NotificationK type AttrGetType NotificationClosedReasonPropertyInfo = Int32 type AttrLabel NotificationClosedReasonPropertyInfo = "Notification::closed-reason" attrGet _ = getNotificationClosedReason attrSet _ = undefined attrConstruct _ = undefined -- VVV Prop "icon-name" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] getNotificationIconName :: (MonadIO m, NotificationK o) => o -> m T.Text getNotificationIconName obj = liftIO $ getObjectPropertyString obj "icon-name" setNotificationIconName :: (MonadIO m, NotificationK o) => o -> T.Text -> m () setNotificationIconName obj val = liftIO $ setObjectPropertyString obj "icon-name" val constructNotificationIconName :: T.Text -> IO ([Char], GValue) constructNotificationIconName val = constructObjectPropertyString "icon-name" val data NotificationIconNamePropertyInfo instance AttrInfo NotificationIconNamePropertyInfo where type AttrAllowedOps NotificationIconNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint NotificationIconNamePropertyInfo = (~) T.Text type AttrBaseTypeConstraint NotificationIconNamePropertyInfo = NotificationK type AttrGetType NotificationIconNamePropertyInfo = T.Text type AttrLabel NotificationIconNamePropertyInfo = "Notification::icon-name" attrGet _ = getNotificationIconName attrSet _ = setNotificationIconName attrConstruct _ = constructNotificationIconName -- VVV Prop "id" -- Type: TBasicType TInt32 -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] getNotificationId :: (MonadIO m, NotificationK o) => o -> m Int32 getNotificationId obj = liftIO $ getObjectPropertyCInt obj "id" setNotificationId :: (MonadIO m, NotificationK o) => o -> Int32 -> m () setNotificationId obj val = liftIO $ setObjectPropertyCInt obj "id" val constructNotificationId :: Int32 -> IO ([Char], GValue) constructNotificationId val = constructObjectPropertyCInt "id" val data NotificationIdPropertyInfo instance AttrInfo NotificationIdPropertyInfo where type AttrAllowedOps NotificationIdPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint NotificationIdPropertyInfo = (~) Int32 type AttrBaseTypeConstraint NotificationIdPropertyInfo = NotificationK type AttrGetType NotificationIdPropertyInfo = Int32 type AttrLabel NotificationIdPropertyInfo = "Notification::id" attrGet _ = getNotificationId attrSet _ = setNotificationId attrConstruct _ = constructNotificationId -- VVV Prop "summary" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] getNotificationSummary :: (MonadIO m, NotificationK o) => o -> m T.Text getNotificationSummary obj = liftIO $ getObjectPropertyString obj "summary" setNotificationSummary :: (MonadIO m, NotificationK o) => o -> T.Text -> m () setNotificationSummary obj val = liftIO $ setObjectPropertyString obj "summary" val constructNotificationSummary :: T.Text -> IO ([Char], GValue) constructNotificationSummary val = constructObjectPropertyString "summary" val data NotificationSummaryPropertyInfo instance AttrInfo NotificationSummaryPropertyInfo where type AttrAllowedOps NotificationSummaryPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint NotificationSummaryPropertyInfo = (~) T.Text type AttrBaseTypeConstraint NotificationSummaryPropertyInfo = NotificationK type AttrGetType NotificationSummaryPropertyInfo = T.Text type AttrLabel NotificationSummaryPropertyInfo = "Notification::summary" attrGet _ = getNotificationSummary attrSet _ = setNotificationSummary attrConstruct _ = constructNotificationSummary type instance AttributeList Notification = NotificationAttributeList type NotificationAttributeList = ('[ '("app-name", NotificationAppNamePropertyInfo), '("body", NotificationBodyPropertyInfo), '("closed-reason", NotificationClosedReasonPropertyInfo), '("icon-name", NotificationIconNamePropertyInfo), '("id", NotificationIdPropertyInfo), '("summary", NotificationSummaryPropertyInfo)] :: [(Symbol, *)]) data NotificationClosedSignalInfo instance SignalInfo NotificationClosedSignalInfo where type HaskellCallbackType NotificationClosedSignalInfo = NotificationClosedCallback connectSignal _ = connectNotificationClosed type instance SignalList Notification = NotificationSignalList type NotificationSignalList = ('[ '("closed", NotificationClosedSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)]) -- method Notification::new -- method type : Constructor -- Args : [Arg {argName = "summary", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "body", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "icon", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "summary", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "body", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "icon", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Notify" "Notification" -- throws : False -- Skip return : False foreign import ccall "notify_notification_new" notify_notification_new :: CString -> -- summary : TBasicType TUTF8 CString -> -- body : TBasicType TUTF8 CString -> -- icon : TBasicType TUTF8 IO (Ptr Notification) notificationNew :: (MonadIO m) => T.Text -> -- summary Maybe (T.Text) -> -- body Maybe (T.Text) -> -- icon 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 "notify_notification_new" result result' <- (wrapObject Notification) result freeMem summary' freeMem maybeBody freeMem maybeIcon return result' -- method Notification::add_action -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "action", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "callback", argType = TInterface "Notify" "ActionCallback", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeNotified, argClosure = 4, argDestroy = 5, transfer = TransferNothing},Arg {argName = "user_data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "free_func", argType = TInterface "GLib" "DestroyNotify", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "action", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "callback", argType = TInterface "Notify" "ActionCallback", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeNotified, argClosure = 4, argDestroy = 5, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_add_action" notify_notification_add_action :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- action : TBasicType TUTF8 CString -> -- label : TBasicType TUTF8 FunPtr ActionCallbackC -> -- callback : TInterface "Notify" "ActionCallback" Ptr () -> -- user_data : TBasicType TVoid FunPtr GLib.DestroyNotifyC -> -- free_func : TInterface "GLib" "DestroyNotify" IO () notificationAddAction :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- action T.Text -> -- label ActionCallback -> -- callback m () notificationAddAction _obj action label callback = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj action' <- textToCString action label' <- textToCString label callback' <- mkActionCallback (actionCallbackWrapper Nothing callback) let user_data = castFunPtrToPtr callback' let free_func = safeFreeFunPtrPtr notify_notification_add_action _obj' action' label' callback' user_data free_func touchManagedPtr _obj freeMem action' freeMem label' return () -- method Notification::clear_actions -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_clear_actions" notify_notification_clear_actions :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" IO () notificationClearActions :: (MonadIO m, NotificationK a) => a -> -- _obj m () notificationClearActions _obj = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj notify_notification_clear_actions _obj' touchManagedPtr _obj return () -- method Notification::clear_hints -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_clear_hints" notify_notification_clear_hints :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" IO () notificationClearHints :: (MonadIO m, NotificationK a) => a -> -- _obj m () notificationClearHints _obj = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj notify_notification_clear_hints _obj' touchManagedPtr _obj return () -- method Notification::close -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : True -- Skip return : False foreign import ccall "notify_notification_close" notify_notification_close :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" Ptr (Ptr GError) -> -- error IO CInt notificationClose :: (MonadIO m, NotificationK a) => a -> -- _obj m () notificationClose _obj = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj onException (do _ <- propagateGError $ notify_notification_close _obj' touchManagedPtr _obj return () ) (do return () ) -- method Notification::get_closed_reason -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TInt32 -- throws : False -- Skip return : False foreign import ccall "notify_notification_get_closed_reason" notify_notification_get_closed_reason :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" IO Int32 notificationGetClosedReason :: (MonadIO m, NotificationK a) => a -> -- _obj m Int32 notificationGetClosedReason _obj = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj result <- notify_notification_get_closed_reason _obj' touchManagedPtr _obj return result -- method Notification::set_app_name -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "app_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "app_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_app_name" notify_notification_set_app_name :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- app_name : TBasicType TUTF8 IO () notificationSetAppName :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- app_name m () notificationSetAppName _obj app_name = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj app_name' <- textToCString app_name notify_notification_set_app_name _obj' app_name' touchManagedPtr _obj freeMem app_name' return () -- method Notification::set_category -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "category", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "category", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_category" notify_notification_set_category :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- category : TBasicType TUTF8 IO () notificationSetCategory :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- category m () notificationSetCategory _obj category = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj category' <- textToCString category notify_notification_set_category _obj' category' touchManagedPtr _obj freeMem category' return () -- method Notification::set_hint -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_hint" notify_notification_set_hint :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- key : TBasicType TUTF8 Ptr GVariant -> -- value : TVariant IO () notificationSetHint :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- key Maybe (GVariant) -> -- value m () notificationSetHint _obj key value = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj key' <- textToCString key maybeValue <- case value of Nothing -> return nullPtr Just jValue -> do let jValue' = unsafeManagedPtrGetPtr jValue return jValue' notify_notification_set_hint _obj' key' maybeValue touchManagedPtr _obj freeMem key' return () -- method Notification::set_hint_byte -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUInt8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUInt8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_hint_byte" notify_notification_set_hint_byte :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- key : TBasicType TUTF8 Word8 -> -- value : TBasicType TUInt8 IO () {-# DEPRECATED notificationSetHintByte ["(Since version 0.6.)","Use notify_notification_set_hint() instead"]#-} notificationSetHintByte :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- key Word8 -> -- value m () notificationSetHintByte _obj key value = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj key' <- textToCString key notify_notification_set_hint_byte _obj' key' value touchManagedPtr _obj freeMem key' return () -- method Notification::set_hint_byte_array -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUInt8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "len", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUInt8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "len", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_hint_byte_array" notify_notification_set_hint_byte_array :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- key : TBasicType TUTF8 Word8 -> -- value : TBasicType TUInt8 Word64 -> -- len : TBasicType TUInt64 IO () {-# DEPRECATED notificationSetHintByteArray ["(Since version 0.6.)","Use notify_notification_set_hint() instead"]#-} notificationSetHintByteArray :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- key Word8 -> -- value Word64 -> -- len m () notificationSetHintByteArray _obj key value len = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj key' <- textToCString key notify_notification_set_hint_byte_array _obj' key' value len touchManagedPtr _obj freeMem key' return () -- method Notification::set_hint_double -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_hint_double" notify_notification_set_hint_double :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- key : TBasicType TUTF8 CDouble -> -- value : TBasicType TDouble IO () {-# DEPRECATED notificationSetHintDouble ["(Since version 0.6.)","Use notify_notification_set_hint() instead"]#-} notificationSetHintDouble :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- key Double -> -- value m () notificationSetHintDouble _obj key value = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj key' <- textToCString key let value' = realToFrac value notify_notification_set_hint_double _obj' key' value' touchManagedPtr _obj freeMem key' return () -- method Notification::set_hint_int32 -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_hint_int32" notify_notification_set_hint_int32 :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- key : TBasicType TUTF8 Int32 -> -- value : TBasicType TInt32 IO () {-# DEPRECATED notificationSetHintInt32 ["(Since version 0.6.)","Use notify_notification_set_hint() instead"]#-} notificationSetHintInt32 :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- key Int32 -> -- value m () notificationSetHintInt32 _obj key value = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj key' <- textToCString key notify_notification_set_hint_int32 _obj' key' value touchManagedPtr _obj freeMem key' return () -- method Notification::set_hint_string -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_hint_string" notify_notification_set_hint_string :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- key : TBasicType TUTF8 CString -> -- value : TBasicType TUTF8 IO () {-# DEPRECATED notificationSetHintString ["(Since version 0.6.)","Use notify_notification_set_hint() instead"]#-} notificationSetHintString :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- key T.Text -> -- value m () notificationSetHintString _obj key value = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj key' <- textToCString key value' <- textToCString value notify_notification_set_hint_string _obj' key' value' touchManagedPtr _obj freeMem key' freeMem value' return () -- method Notification::set_hint_uint32 -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_hint_uint32" notify_notification_set_hint_uint32 :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- key : TBasicType TUTF8 Word32 -> -- value : TBasicType TUInt32 IO () {-# DEPRECATED notificationSetHintUint32 ["(Since version 0.6.)","Use notify_notification_set_hint() instead"]#-} notificationSetHintUint32 :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- key Word32 -> -- value m () notificationSetHintUint32 _obj key value = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj key' <- textToCString key notify_notification_set_hint_uint32 _obj' key' value touchManagedPtr _obj freeMem key' return () -- method Notification::set_icon_from_pixbuf -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "icon", argType = TInterface "GdkPixbuf" "Pixbuf", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "icon", argType = TInterface "GdkPixbuf" "Pixbuf", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_icon_from_pixbuf" notify_notification_set_icon_from_pixbuf :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" Ptr GdkPixbuf.Pixbuf -> -- icon : TInterface "GdkPixbuf" "Pixbuf" IO () {-# DEPRECATED notificationSetIconFromPixbuf ["use notify_notification_set_image_from_pixbuf() instead."]#-} notificationSetIconFromPixbuf :: (MonadIO m, NotificationK a, GdkPixbuf.PixbufK b) => a -> -- _obj b -> -- icon m () notificationSetIconFromPixbuf _obj icon = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let icon' = unsafeManagedPtrCastPtr icon notify_notification_set_icon_from_pixbuf _obj' icon' touchManagedPtr _obj touchManagedPtr icon return () -- method Notification::set_image_from_pixbuf -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "pixbuf", argType = TInterface "GdkPixbuf" "Pixbuf", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "pixbuf", argType = TInterface "GdkPixbuf" "Pixbuf", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_image_from_pixbuf" notify_notification_set_image_from_pixbuf :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" Ptr GdkPixbuf.Pixbuf -> -- pixbuf : TInterface "GdkPixbuf" "Pixbuf" IO () notificationSetImageFromPixbuf :: (MonadIO m, NotificationK a, GdkPixbuf.PixbufK b) => a -> -- _obj b -> -- pixbuf m () notificationSetImageFromPixbuf _obj pixbuf = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let pixbuf' = unsafeManagedPtrCastPtr pixbuf notify_notification_set_image_from_pixbuf _obj' pixbuf' touchManagedPtr _obj touchManagedPtr pixbuf return () -- method Notification::set_timeout -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "timeout", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "timeout", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_timeout" notify_notification_set_timeout :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" Int32 -> -- timeout : TBasicType TInt32 IO () notificationSetTimeout :: (MonadIO m, NotificationK a) => a -> -- _obj Int32 -> -- timeout m () notificationSetTimeout _obj timeout = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj notify_notification_set_timeout _obj' timeout touchManagedPtr _obj return () -- method Notification::set_urgency -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "urgency", argType = TInterface "Notify" "Urgency", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "urgency", argType = TInterface "Notify" "Urgency", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "notify_notification_set_urgency" notify_notification_set_urgency :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CUInt -> -- urgency : TInterface "Notify" "Urgency" IO () notificationSetUrgency :: (MonadIO m, NotificationK a) => a -> -- _obj Urgency -> -- urgency m () notificationSetUrgency _obj urgency = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let urgency' = (fromIntegral . fromEnum) urgency notify_notification_set_urgency _obj' urgency' touchManagedPtr _obj return () -- method Notification::show -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : True -- Skip return : False foreign import ccall "notify_notification_show" notify_notification_show :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" Ptr (Ptr GError) -> -- error IO CInt notificationShow :: (MonadIO m, NotificationK a) => a -> -- _obj m () notificationShow _obj = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj onException (do _ <- propagateGError $ notify_notification_show _obj' touchManagedPtr _obj return () ) (do return () ) -- method Notification::update -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "summary", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "body", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "icon", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Notify" "Notification", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "summary", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "body", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "icon", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : False -- Skip return : False foreign import ccall "notify_notification_update" notify_notification_update :: Ptr Notification -> -- _obj : TInterface "Notify" "Notification" CString -> -- summary : TBasicType TUTF8 CString -> -- body : TBasicType TUTF8 CString -> -- icon : TBasicType TUTF8 IO CInt notificationUpdate :: (MonadIO m, NotificationK a) => a -> -- _obj T.Text -> -- summary Maybe (T.Text) -> -- body Maybe (T.Text) -> -- icon m Bool notificationUpdate _obj summary body icon = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj 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 _obj' summary' maybeBody maybeIcon let result' = (/= 0) result touchManagedPtr _obj freeMem summary' freeMem maybeBody freeMem maybeIcon return result'