libnotify 0.0.1.1 → 0.0.1.2
raw patch · 3 files changed
+21/−27 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- System/Libnotify/Internal.hsc +10/−2
- System/Libnotify/Types.hsc +7/−21
- libnotify.cabal +4/−4
System/Libnotify/Internal.hsc view
@@ -9,8 +9,8 @@ ( Notification , initNotify, uninitNotify, isInitted , newNotify, updateNotify, showNotify- , setTimeout, expiresDefault, expiresNever, expires- , setCategory, setUrgency, setIconFromPixbuf, setImageFromPixbuf+ , setTimeout, setCategory, setUrgency+ , setIconFromPixbuf, setImageFromPixbuf , setHintInt32, setHintDouble, setHintString, setHintByte, setHintByteArray, clearHints , addAction, clearActions, closeNotify ) where@@ -98,6 +98,10 @@ setTimeout :: Timeout -> Notification -> IO () setTimeout timeout notify = notify_notification_set_timeout notify (getTimeout timeout)+ where getTimeout :: Timeout -> CInt+ getTimeout Default = #const NOTIFY_EXPIRES_DEFAULT+ getTimeout Infinite = #const NOTIFY_EXPIRES_NEVER+ getTimeout (Custom t) = fromIntegral t foreign import ccall unsafe "libnotify/notify.h notify_notification_set_timeout" notify_notification_set_timeout :: Notification -> CInt -> IO ()@@ -113,6 +117,10 @@ setUrgency :: Urgency -> Notification -> IO () setUrgency urgency notify = notify_notification_set_urgency notify (getUrgency urgency)+ where getUrgency :: Urgency -> CInt+ getUrgency Low = #const NOTIFY_URGENCY_LOW+ getUrgency Normal = #const NOTIFY_URGENCY_NORMAL+ getUrgency Critical = #const NOTIFY_URGENCY_CRITICAL foreign import ccall unsafe "libnotify/notify.h notify_notification_set_urgency" notify_notification_set_urgency :: Notification -> CInt -> IO ()
System/Libnotify/Types.hsc view
@@ -6,9 +6,7 @@ #include <libnotify/notify.h> module System.Libnotify.Types- ( Timeout, getTimeout, expiresDefault, expiresNever, expires- , Urgency, getUrgency, notifyUrgencyLow, notifyUrgencyNormal, notifyUrgencyCritical- , Category+ ( Timeout(..), Urgency(..), Category , Title, Body, Icon , Key , ServerInfo(..)@@ -17,27 +15,15 @@ import Control.Exception (Exception) import Data.Typeable (Typeable)-import Foreign (Ptr) import Foreign.C --- | Timeout in seconds after which notification is closed.-newtype Timeout = Timeout {getTimeout :: CInt}-#{enum Timeout, Timeout,- expiresDefault = NOTIFY_EXPIRES_DEFAULT,- expiresNever = NOTIFY_EXPIRES_NEVER-}---- | Sets custom 'Timeout'.-expires :: Int -> Timeout-expires = Timeout . fromIntegral+-- | Urgency can be used by the notification server to prioritize notifications.+-- Although urgency does not work with notify-osd.+data Urgency = Low | Normal | Critical --- | Urgency can be used by the notification server to filter or display the data in a certain way.-newtype Urgency = Urgency {getUrgency :: CInt}-#{enum Urgency, Urgency,- notifyUrgencyLow = NOTIFY_URGENCY_LOW,- notifyUrgencyNormal = NOTIFY_URGENCY_NORMAL,- notifyUrgencyCritical = NOTIFY_URGENCY_CRITICAL-}+-- | Timeout in seconds after which notification is closed.+-- Although timeout does not work with notify-osd.+data Timeout = Default | Custom Int | Infinite -- | Category can be used by the notification server to filter or display the data in a certain way. type Category = String
libnotify.cabal view
@@ -1,17 +1,17 @@ Name: libnotify-Version: 0.0.1.1+Version: 0.0.1.2 Description: Usable binding to libnotify library. License: MIT License-file: LICENSE Author: Emon Tsukimiya, Matvey Aksenov Maintainer: Matvey Aksenov <matvey.aksenov@gmail.com>-Category: System, Utils+Category: System, Desktop Synopsis: Haskell binding for Libnotify Cabal-Version: >= 1.6 Build-Type: Simple Library- Build-Depends: base >= 3 && < 4.4, bytestring, glib, gtk, mtl+ Build-Depends: base >= 3 && < 5, bytestring, glib, gtk, mtl Exposed-Modules: System.Libnotify, System.Libnotify.Internal, System.Libnotify.Server, System.Libnotify.Types Pkgconfig-Depends: libnotify Extensions: DeriveDataTypeable, FlexibleInstances, FlexibleContexts@@ -23,4 +23,4 @@ source-repository this type: git location: https://github.com/supki/haskell-libnotify- tag: v0.0.1.1+ tag: v0.0.1.2