summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog1
-rw-r--r--lib/efl/native/enotification_daemon.rb66
-rwxr-xr-xtools/extract-api.sh1
-rwxr-xr-xtools/genruby.rb2
4 files changed, 70 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index e6f17ad..cc1a6ae 100644
--- a/Changelog
+++ b/Changelog
@@ -5,6 +5,7 @@
* add ehal native binding
* add eofono native binding
* add eukit native binding
+ * add enotification_daemon native binding
2012-12-21 Jérémy Zurcher <jeremy@asynk.ch>
* release 0.0.16
diff --git a/lib/efl/native/enotification_daemon.rb b/lib/efl/native/enotification_daemon.rb
new file mode 100644
index 0000000..1355c77
--- /dev/null
+++ b/lib/efl/native/enotification_daemon.rb
@@ -0,0 +1,66 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/native'
+require 'efl/native/enotify'
+#
+module Efl
+ #
+ module EnotificationDaemon
+ #
+ FCT_PREFIX = 'e_notification_daemon_' unless const_defined? :FCT_PREFIX
+ #
+ def self.method_missing meth, *args, &block
+ sym = Efl::MethodResolver.resolve self, meth, FCT_PREFIX
+ self.send sym, *args, &block
+ end
+ #
+ end
+ #
+ module Native
+ #
+ ffi_lib 'enotify'
+ #
+ # TYPEDEFS
+ # typedef struct E_Notification_Daemon E_Notification_Daemon;
+ typedef :pointer, :e_notification_daemon
+ # typedef struct E_Notification_View E_Notification_View;
+ typedef :pointer, :e_notification_view
+ #
+ # CALLBACKS
+ # typedef int (*E_Notification_Daemon_Callback_Notify) (E_Notification_Daemon *daemon, E_Notification *notification);
+ callback :e_notification_daemon_callback_notify_cb, [ :e_notification_daemon, :e_notification ], :int
+ # typedef void (*E_Notification_Daemon_Callback_Close_Notification) (E_Notification_Daemon *daemon, unsigned int notification_id);
+ callback :e_notification_daemon_callback_close_notification_cb, [ :e_notification_daemon, :uint ], :void
+ #
+ # FUNCTIONS
+ fcts = [
+ # EAPI int e_notification_daemon_init(void);
+ [ :e_notification_daemon_init, [ ], :int ],
+ # EAPI int e_notification_daemon_shutdown(void);
+ [ :e_notification_daemon_shutdown, [ ], :int ],
+ # EAPI E_Notification_Daemon *e_notification_daemon_add(const char *name, const char *vendor);
+ [ :e_notification_daemon_add, [ :string, :string ], :e_notification_daemon ],
+ # EAPI void e_notification_daemon_free(E_Notification_Daemon *d);
+ [ :e_notification_daemon_free, [ :e_notification_daemon ], :void ],
+ # EAPI void e_notification_daemon_data_set(E_Notification_Daemon *daemon, void *data);
+ [ :e_notification_daemon_data_set, [ :e_notification_daemon, :pointer ], :void ],
+ # EAPI void *e_notification_daemon_data_get(E_Notification_Daemon *daemon);
+ [ :e_notification_daemon_data_get, [ :e_notification_daemon ], :pointer ],
+ # EAPI void e_notification_daemon_callback_notify_set(E_Notification_Daemon *daemon, E_Notification_Daemon_Callback_Notify func);
+ [ :e_notification_daemon_callback_notify_set, [ :e_notification_daemon, :e_notification_daemon_callback_notify_cb ], :void ],
+ # EAPI void e_notification_daemon_callback_close_notification_set(E_Notification_Daemon *daemon, E_Notification_Daemon_Callback_Close_Notification func);
+ [ :e_notification_daemon_callback_close_notification_set, [ :e_notification_daemon, :e_notification_daemon_callback_close_notification_cb ],
+ :void ],
+ # EAPI void e_notification_daemon_signal_notification_closed(E_Notification_Daemon *daemon, unsigned int id, E_Notification_Closed_Reason reason);
+ [ :e_notification_daemon_signal_notification_closed, [ :e_notification_daemon, :uint, :e_notification_closed_reason ], :void ],
+ # EAPI void e_notification_daemon_signal_action_invoked(E_Notification_Daemon *daemon, unsigned int notification_id, const char *action_id);
+ [ :e_notification_daemon_signal_action_invoked, [ :e_notification_daemon, :uint, :string ], :void ],
+ ]
+ #
+ attach_fcts fcts
+ #
+ end
+end
+#
+# EOF
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
index 089d7bd..2719797 100755
--- a/tools/extract-api.sh
+++ b/tools/extract-api.sh
@@ -58,6 +58,7 @@ for header in \
"${INCLUDE}/efreet-1/Efreet_Trash.h" \
"${INCLUDE}/e_dbus-1/E_DBus.h" \
"${INCLUDE}/e_dbus-1/E_Notify.h" \
+ "${INCLUDE}/e_dbus-1/E_Notification_Daemon.h" \
"${INCLUDE}/e_dbus-1/E_Bluez.h" \
"${INCLUDE}/e_dbus-1/E_Hal.h" \
"${INCLUDE}/e_dbus-1/E_Ofono.h" \
diff --git a/tools/genruby.rb b/tools/genruby.rb
index 754a7ab..a201b79 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -257,6 +257,7 @@ TYPES = {
'struct timeval *' => ':pointer',
'struct sockaddr *' => ':pointer',
'DBusBusType' => ':int',
+ 'E_Notification_Closed_Reason' => ':e_notification_closed_reason', # cheating
}
ETYPES = {
'Eina_Bool' => ':bool'
@@ -309,6 +310,7 @@ libs << efl_h('efreet_mime','Efreet_Mime.h','EfreetMime')
libs << efl_h('efreet_trash','Efreet_Trash.h','EfreetTrash',nil,nil,["#{NATIVE}/eina_list","#{NATIVE}/efreet_uri"])
libs << efl_h('edbus','E_DBus.h','Edbus',nil,'edbus.rb',["#{NATIVE}/eina_list"])
libs << efl_h('enotify','E_Notify.h','Enotify','e_notification','enotify.rb',["#{NATIVE}/evas","#{NATIVE}/edbus"])
+libs << efl_h('enotify','E_Notification_Daemon.h','EnotificationDaemon','e_notification_daemon','enotification_daemon.rb',["#{NATIVE}/enotify"])
libs << efl_h('ebluez','E_Bluez.h','Ebluez','e_bluez','ebluez.rb',["#{NATIVE}/edbus"])
libs << efl_h('eofono','E_Ofono.h','Eofono','e_ofono','eofono.rb',["#{NATIVE}/edbus"])
libs << efl_h('eukit','E_Ukit.h','Eukit','e_ukit','eukit.rb',["#{NATIVE}/edbus"])