diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-03 15:57:31 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-03 15:57:31 +0100 |
commit | 492dc525de0103ff0c6d1726c82d7b7e0440126e (patch) | |
tree | 14f1f5710af97fd952c59ebcdc4b37d033bf7888 | |
parent | 54e8ad8b8701a813035b4035d63fe067563bec90 (diff) | |
download | ffi-efl-492dc525de0103ff0c6d1726c82d7b7e0440126e.zip ffi-efl-492dc525de0103ff0c6d1726c82d7b7e0440126e.tar.gz |
generate ehal binding
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | lib/efl/native/ehal.rb | 104 | ||||
-rwxr-xr-x | tools/extract-api.sh | 1 | ||||
-rwxr-xr-x | tools/genruby.rb | 2 |
4 files changed, 108 insertions, 0 deletions
@@ -2,6 +2,7 @@ * add e_dbus native binding * add enotify native binding * add ebluez native binding + * add ehal native binding 2012-12-21 Jérémy Zurcher <jeremy@asynk.ch> * release 0.0.16 diff --git a/lib/efl/native/ehal.rb b/lib/efl/native/ehal.rb new file mode 100644 index 0000000..36e3ec3 --- /dev/null +++ b/lib/efl/native/ehal.rb @@ -0,0 +1,104 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/edbus' +# +module Efl + # + module Ehal + # + FCT_PREFIX = 'e_hal_' 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 'ehal' + # + # ENUMS + # typedef enum {...} E_Hal_Property_Type; + enum :e_hal_property_type, [ :e_hal_property_type_string, :e_hal_property_type_int, :e_hal_property_type_uint64, :e_hal_property_type_bool, + :e_hal_property_type_double, :e_hal_property_type_strlist ] + # + # TYPEDEFS + # typedef struct E_Hal_Property E_Hal_Property; + typedef :pointer, :e_hal_property + # typedef struct E_Hal_Properties E_Hal_Properties; + typedef :pointer, :e_hal_properties + # typedef struct E_Hal_Properties E_Hal_Device_Get_All_Properties_Return; + typedef :pointer, :e_hal_device_get_all_properties_return + # typedef struct E_Hal_Property E_Hal_Device_Get_Property_Return; + typedef :pointer, :e_hal_device_get_property_return + # typedef struct E_Hal_Bool_Return E_Hal_Device_Query_Capability_Return; + typedef :pointer, :e_hal_device_query_capability_return + # typedef struct E_Hal_String_List_Return E_Hal_String_List_Return; + typedef :pointer, :e_hal_string_list_return + # typedef struct E_Hal_String_List_Return E_Hal_Manager_Get_All_Devices_Return; + typedef :pointer, :e_hal_manager_get_all_devices_return + # typedef struct E_Hal_Bool_Return E_Hal_Manager_Device_Exists_Return; + typedef :pointer, :e_hal_manager_device_exists_return + # typedef struct E_Hal_String_List_Return E_Hal_Manager_Find_Device_String_Match_Return; + typedef :pointer, :e_hal_manager_find_device_string_match_return + # typedef struct E_Hal_String_List_Return E_Hal_Manager_Find_Device_By_Capability_Return; + typedef :pointer, :e_hal_manager_find_device_by_capability_return + # typedef struct E_Hal_UDI_Return E_Hal_Manager_Device_Added; + typedef :pointer, :e_hal_manager_device_added + # typedef struct E_Hal_UDI_Return E_Hal_Manager_Device_Removed; + typedef :pointer, :e_hal_manager_device_removed + # typedef struct E_Hal_Capability E_Hal_Manager_New_Capability; + typedef :pointer, :e_hal_manager_new_capability + # + # FUNCTIONS + fcts = [ + # EAPI int e_hal_init(void); + [ :e_hal_init, [ ], :int ], + # EAPI int e_hal_shutdown(void); + [ :e_hal_shutdown, [ ], :int ], + # EAPI DBusPendingCall *e_hal_device_get_property(E_DBus_Connection *conn, const char *udi, const char *property, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_device_get_property, [ :e_dbus_connection, :string, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_device_get_all_properties(E_DBus_Connection *conn, const char *udi, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_device_get_all_properties, [ :e_dbus_connection, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_device_query_capability(E_DBus_Connection *conn, const char *udi, const char *capability, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_device_query_capability, [ :e_dbus_connection, :string, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_manager_get_all_devices(E_DBus_Connection *conn, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_manager_get_all_devices, [ :e_dbus_connection, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_manager_device_exists(E_DBus_Connection *conn, const char *udi, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_manager_device_exists, [ :e_dbus_connection, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_manager_find_device_string_match(E_DBus_Connection *conn, const char *key, const char *value, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_manager_find_device_string_match, [ :e_dbus_connection, :string, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_manager_find_device_by_capability(E_DBus_Connection *conn, const char *capability, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_manager_find_device_by_capability, [ :e_dbus_connection, :string, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI void e_hal_property_free(E_Hal_Property *prop); + [ :e_hal_property_free, [ :e_hal_property ], :void ], + # EAPI const char *e_hal_property_string_get(E_Hal_Properties *properties, const char *key, int *err); + [ :e_hal_property_string_get, [ :e_hal_properties, :string, :pointer ], :string ], + # EAPI Eina_Bool e_hal_property_bool_get(E_Hal_Properties *properties, const char *key, int *err); + [ :e_hal_property_bool_get, [ :e_hal_properties, :string, :pointer ], :bool ], + # EAPI int e_hal_property_int_get(E_Hal_Properties *properties, const char *key, int *err); + [ :e_hal_property_int_get, [ :e_hal_properties, :string, :pointer ], :int ], + # EAPI uint64_t e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err); + [ :e_hal_property_uint64_get, [ :e_hal_properties, :string, :pointer ], :ulong_long ], + # EAPI double e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *err); + [ :e_hal_property_double_get, [ :e_hal_properties, :string, :pointer ], :double ], + # EAPI const Eina_List *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err); + [ :e_hal_property_strlist_get, [ :e_hal_properties, :string, :pointer ], :eina_list ], + # EAPI DBusPendingCall *e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Eina_List *options, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_device_volume_mount, [ :e_dbus_connection, :string, :string, :string, :eina_list, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Eina_List *options, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_device_volume_unmount, [ :e_dbus_connection, :string, :eina_list, :e_dbus_callback_func_cb, :pointer ], :pointer ], + # EAPI DBusPendingCall *e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Eina_List *options, E_DBus_Callback_Func cb_func, void *data); + [ :e_hal_device_volume_eject, [ :e_dbus_connection, :string, :eina_list, :e_dbus_callback_func_cb, :pointer ], :pointer ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/extract-api.sh b/tools/extract-api.sh index b442d74..04a6a8c 100755 --- a/tools/extract-api.sh +++ b/tools/extract-api.sh @@ -59,6 +59,7 @@ 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_Hal.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 30dcad0..7686a2a 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -246,6 +246,7 @@ TYPES = { 'unsigned short' => ':ushort', 'unsigned long int' => ':ulong', 'unsigned long long' => ':ulong_long', + 'uint64_t' => ':ulong_long', 'char *' => ':string', # FIXME ?!?! 'fd_set *' => ':pointer', 'FILE *' => ':pointer', @@ -307,6 +308,7 @@ libs << efl_h('efreet_trash','Efreet_Trash.h','EfreetTrash',nil,nil,["#{NATIVE}/ 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}/edbus"]) libs << efl_h('ebluez','E_Bluez.h','Ebluez','e_bluez','ebluez.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"]) libs << efl_h('ethumb','Ethumb_Plugin.h','EthumbPlugin',nil,nil,["#{NATIVE}/evas","#{NATIVE}/ecore_evas","#{NATIVE}/ethumb"]) |