Fix loading order.
[cl-notify.git] / bindings.lisp
blob027b08547114dbfdfff5c579f23618cd786bb8bb
1 (in-package :cl-notify)
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; The library ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 (define-foreign-library libnotify
6 (:unix (:or "libnotify.so.1" "libnotify.so"))
7 (t (:default "libnotify")))
9 (use-foreign-library libnotify)
11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13 (defctype gboolean :int)
14 (defctype NotifyNotification :pointer)
16 (defcenum NotifyUrgency
17 :low :normal :critical)
19 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Glib ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21 (defcfun "g_object_unref" :void (object :pointer))
22 (defcfun "g_free" :void (mem :pointer))
24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; libnotify ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26 (defcfun ("notify_init" notify_init) gboolean (name :string))
28 (defcfun "notify_notification_new" NotifyNotification
29 (summary :string) (body :string) (icon :string)
30 (attach :pointer))
32 (defcfun "notify_notification_set_timeout" :void
33 (n NotifyNotification)
34 (timeout :int))
36 (defcfun "notify_notification_show" gboolean
37 (n NotifyNotification)
38 (err :pointer))
40 (defcfun "notify_notification_update" gboolean
41 (n NotifyNotification)
42 (summary :string) (body :string) (icon :string))
44 (defcfun "notify_get_server_info" gboolean
45 (name :pointer)
46 (vendor :pointer)
47 (version :pointer)
48 (spec-version :pointer))
50 (defcfun "notify_notification_set_urgency" :void
51 (n NotifyNotification)
52 (u NotifyUrgency))
54 ;; libnotify hints
57 (defcfun "notify_notification_set_hint_int32" :void
58 (n NotifyNotification)
59 (key :string)
60 (value :int))
62 (defcfun "notify_notification_set_hint_double" :void
63 (n NotifyNotification)
64 (key :string)
65 (value :double))
67 (defcfun "notify_notification_set_hint_string" :void
68 (n NotifyNotification)
69 (key :string)
70 (value :string))
72 (defcfun "notify_notification_set_hint_byte" :void
73 (n NotifyNotification)
74 (key :string)
75 (value :uchar))
77 (defcfun "notify_notification_set_hint_byte_array" :void
78 (n NotifyNotification)
79 (key :string)
80 (value :pointer)
81 (len :int))
83 (defcfun "notify_notification_clear_hints" :void
84 (n NotifyNotification))