summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-03 16:59:54 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-03 16:59:54 +0100
commitb58bd1ec64eaec38112e27474fc7dd857009581d (patch)
tree7703b48aa75ce96658d94bd91ded6e4e0041cf3c
parent84c2d84aff9e8e0adcbbe272d959746f14940d39 (diff)
downloadffi-efl-b58bd1ec64eaec38112e27474fc7dd857009581d.zip
ffi-efl-b58bd1ec64eaec38112e27474fc7dd857009581d.tar.gz
generate eukit binding
-rw-r--r--Changelog2
-rw-r--r--lib/efl/native/eukit.rb115
-rwxr-xr-xtools/extract-api.sh3
-rwxr-xr-xtools/genruby.rb3
4 files changed, 122 insertions, 1 deletions
diff --git a/Changelog b/Changelog
index 0aa3e77..e6f17ad 100644
--- a/Changelog
+++ b/Changelog
@@ -3,6 +3,8 @@
* add enotify native binding
* add ebluez native binding
* add ehal native binding
+ * add eofono native binding
+ * add eukit native binding
2012-12-21 Jérémy Zurcher <jeremy@asynk.ch>
* release 0.0.16
diff --git a/lib/efl/native/eukit.rb b/lib/efl/native/eukit.rb
new file mode 100644
index 0000000..4b82105
--- /dev/null
+++ b/lib/efl/native/eukit.rb
@@ -0,0 +1,115 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/native'
+require 'efl/native/edbus'
+#
+module Efl
+ #
+ module Eukit
+ #
+ FCT_PREFIX = 'e_ukit_' 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 'eukit'
+ #
+ # ENUMS
+ # typedef enum {...} E_Ukit_Property_Type;
+ enum :e_ukit_property_type, [ :e_ukit_property_type_string, :e_ukit_property_type_int, :e_ukit_property_type_uint32,
+ :e_ukit_property_type_uint64, :e_ukit_property_type_int64, :e_ukit_property_type_bool, :e_ukit_property_type_double, :e_ukit_property_type_strlist ]
+ # typedef enum {...} E_UPower_Battery_Type;
+ enum :e_upower_battery_type, [ :e_upower_battery_unknown, :e_upower_battery_lion, :e_upower_battery_lpolymer, :e_upower_battery_lironphos,
+ :e_upower_battery_lead, :e_upower_battery_nicad, :e_upower_battery_metalhydryde ]
+ # typedef enum {...} E_Upower_State;
+ enum :e_upower_state, [ :e_upower_state_unknown, :e_upower_state_charging, :e_upower_state_discharging, :e_upower_state_empty,
+ :e_upower_state_full, :e_upower_state_pendingcharge, :e_upower_state_pendingdischarge ]
+ # typedef enum {...} E_Upower_Source;
+ enum :e_upower_source, [ :e_upower_source_unknown, :e_upower_source_ac, :e_upower_source_battery, :e_upower_source_ups,
+ :e_upower_source_monitor, :e_upower_source_mouse, :e_upower_source_keyboard, :e_upower_source_pda, :e_upower_source_phone ]
+ #
+ # TYPEDEFS
+ # typedef struct E_Ukit_Property E_Ukit_Property;
+ typedef :pointer, :e_ukit_property
+ # typedef struct E_Ukit_Properties E_Ukit_Properties;
+ typedef :pointer, :e_ukit_properties
+ # typedef struct E_Ukit_Properties E_Ukit_Get_All_Properties_Return;
+ typedef :pointer, :e_ukit_get_all_properties_return
+ # typedef struct E_Ukit_Property E_Ukit_Get_Property_Return;
+ typedef :pointer, :e_ukit_get_property_return
+ # typedef struct E_Ukit_String_List_Return E_Ukit_String_List_Return;
+ typedef :pointer, :e_ukit_string_list_return
+ # typedef struct E_Ukit_String_List_Return E_Ukit_Get_All_Devices_Return;
+ typedef :pointer, :e_ukit_get_all_devices_return
+ # typedef struct E_Ukit_UDI_Return E_Ukit_Device_Added;
+ typedef :pointer, :e_ukit_device_added
+ # typedef struct E_Ukit_UDI_Return E_Ukit_Device_Removed;
+ typedef :pointer, :e_ukit_device_removed
+ # typedef struct E_Ukit_Capability E_Ukit_New_Capability;
+ typedef :pointer, :e_ukit_new_capability
+ #
+ # FUNCTIONS
+ fcts = [
+ # EAPI int e_ukit_init(void);
+ [ :e_ukit_init, [ ], :int ],
+ # EAPI int e_ukit_shutdown(void);
+ [ :e_ukit_shutdown, [ ], :int ],
+ # EAPI DBusPendingCall *e_udisks_get_property(E_DBus_Connection *conn, const char *udi, const char *property, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_udisks_get_property, [ :e_dbus_connection, :string, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall *e_udisks_get_all_properties(E_DBus_Connection *conn, const char *udi, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_udisks_get_all_properties, [ :e_dbus_connection, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall *e_udisks_get_all_devices(E_DBus_Connection *conn, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_udisks_get_all_devices, [ :e_dbus_connection, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall *e_upower_get_property(E_DBus_Connection *conn, const char *udi, const char *property, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_upower_get_property, [ :e_dbus_connection, :string, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall *e_upower_get_all_properties(E_DBus_Connection *conn, const char *udi, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_upower_get_all_properties, [ :e_dbus_connection, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall *e_upower_get_all_devices(E_DBus_Connection *conn, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_upower_get_all_devices, [ :e_dbus_connection, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall * e_upower_suspend_allowed(E_DBus_Connection *conn, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_upower_suspend_allowed, [ :e_dbus_connection, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall * e_upower_suspend(E_DBus_Connection *conn, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_upower_suspend, [ :e_dbus_connection, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall * e_upower_hibernate(E_DBus_Connection *conn, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_upower_hibernate, [ :e_dbus_connection, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI DBusPendingCall * e_upower_hibernate_allowed(E_DBus_Connection *conn, E_DBus_Callback_Func cb_func, void *data);
+ [ :e_upower_hibernate_allowed, [ :e_dbus_connection, :e_dbus_callback_func_cb, :pointer ], :pointer ],
+ # EAPI void e_ukit_property_free(E_Ukit_Property *prop);
+ [ :e_ukit_property_free, [ :e_ukit_property ], :void ],
+ # EAPI const char *e_ukit_property_string_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_string_get, [ :e_ukit_properties, :string, :pointer ], :string ],
+ # EAPI Eina_Bool e_ukit_property_bool_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_bool_get, [ :e_ukit_properties, :string, :pointer ], :bool ],
+ # EAPI int e_ukit_property_int_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_int_get, [ :e_ukit_properties, :string, :pointer ], :int ],
+ # EAPI uint32_t e_ukit_property_uint32_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_uint32_get, [ :e_ukit_properties, :string, :pointer ], :uint ],
+ # EAPI uint64_t e_ukit_property_uint64_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_uint64_get, [ :e_ukit_properties, :string, :pointer ], :ulong_long ],
+ # EAPI int64_t e_ukit_property_int64_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_int64_get, [ :e_ukit_properties, :string, :pointer ], :long_long ],
+ # EAPI double e_ukit_property_double_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_double_get, [ :e_ukit_properties, :string, :pointer ], :double ],
+ # EAPI const Eina_List *e_ukit_property_strlist_get(E_Ukit_Properties *properties, const char *key, int *err);
+ [ :e_ukit_property_strlist_get, [ :e_ukit_properties, :string, :pointer ], :eina_list ],
+ # EAPI DBusPendingCall *e_udisks_volume_mount(E_DBus_Connection *conn, const char *udi, const char *fstype, Eina_List *options);
+ [ :e_udisks_volume_mount, [ :e_dbus_connection, :string, :string, :eina_list ], :pointer ],
+ # EAPI DBusPendingCall *e_udisks_volume_unmount(E_DBus_Connection *conn, const char *udi, Eina_List *options);
+ [ :e_udisks_volume_unmount, [ :e_dbus_connection, :string, :eina_list ], :pointer ],
+ # EAPI DBusPendingCall *e_udisks_volume_eject(E_DBus_Connection *conn, const char *udi, Eina_List *options);
+ [ :e_udisks_volume_eject, [ :e_dbus_connection, :string, :eina_list ], :pointer ],
+ ]
+ #
+ attach_fcts fcts
+ #
+ end
+end
+#
+# EOF
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
index 5924ac4..089d7bd 100755
--- a/tools/extract-api.sh
+++ b/tools/extract-api.sh
@@ -59,8 +59,9 @@ for header in \
"${INCLUDE}/e_dbus-1/E_DBus.h" \
"${INCLUDE}/e_dbus-1/E_Notify.h" \
"${INCLUDE}/e_dbus-1/E_Bluez.h" \
- "${INCLUDE}/e_dbus-1/E_Ofono.h" \
"${INCLUDE}/e_dbus-1/E_Hal.h" \
+ "${INCLUDE}/e_dbus-1/E_Ofono.h" \
+ "${INCLUDE}/e_dbus-1/E_Ukit.h" \
"${INCLUDE}/ethumb-1/Ethumb.h" \
"${INCLUDE}/ethumb-1/Ethumb_Client.h" \
"${INCLUDE}/ethumb-1/Ethumb_Plugin.h" \
diff --git a/tools/genruby.rb b/tools/genruby.rb
index f059428..754a7ab 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -246,6 +246,8 @@ TYPES = {
'unsigned short' => ':ushort',
'unsigned long int' => ':ulong',
'unsigned long long' => ':ulong_long',
+ 'uint32_t' => ':uint',
+ 'int64_t' => ':long_long',
'uint64_t' => ':ulong_long',
'char *' => ':string', # FIXME ?!?!
'fd_set *' => ':pointer',
@@ -309,6 +311,7 @@ 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('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"])
libs << efl_h('ehal','E_Hal.h','Ehal','e_hal','ehal.rb',["#{NATIVE}/edbus"])
libs << efl_h('ethumb','Ethumb.h','Ethumb')
libs << efl_h('ethumb_client','Ethumb_Client.h','EthumbClient',nil,nil,["#{NATIVE}/ethumb"])