diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-16 16:50:48 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-16 16:50:48 +0100 |
commit | cfc1d6b1393c9211c4a03dbd32e77ef5bbb203d7 (patch) | |
tree | a96e24b169f71254fb4ff89864aaa90cea8af9d2 /lib/efl | |
parent | fe91b9f280db39f2bdd31ca36c941d1319944b21 (diff) | |
download | ffi-efl-cfc1d6b1393c9211c4a03dbd32e77ef5bbb203d7.zip ffi-efl-cfc1d6b1393c9211c4a03dbd32e77ef5bbb203d7.tar.gz |
update emap API
Diffstat (limited to 'lib/efl')
-rw-r--r-- | lib/efl/native/emap.rb | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/lib/efl/native/emap.rb b/lib/efl/native/emap.rb index 6fb4fdb..8e970c7 100644 --- a/lib/efl/native/emap.rb +++ b/lib/efl/native/emap.rb @@ -1,18 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'efl/ffi' +require 'efl/native' # module Efl # module EMap # - FCT_PREFIX = 'emap_' + FCT_PREFIX = 'emap_' unless const_defined? :FCT_PREFIX # - def self.method_missing m, *args, &block - sym, args_s = ModuleHelper.find_function m, FCT_PREFIX - self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(#{args_s}); yield r if block_given?; r; end" - self.send m, *args, &block + def self.method_missing meth, *args, &block + sym = Efl::MethodResolver.resolve self, meth, FCT_PREFIX + self.send sym, *args, &block end # end @@ -28,10 +27,8 @@ module Efl # TYPEDEFS # typedef struct emap_route EMap_Route; typedef :pointer, :emap_route - typedef :pointer, :emap_route_p # typedef struct emap_route_node EMap_Route_Node; typedef :pointer, :emap_route_node - typedef :pointer, :emap_route_node_p # # CALLBACKS # @@ -44,43 +41,43 @@ module Efl # EAPI int emap_shutdown(); [ :emap_shutdown, [ ], :int ], # EAPI EMap_Route *emap_route_new(); - [ :emap_route_new, [ ], :emap_route_p ], + [ :emap_route_new, [ ], :pointer ], # EAPI void emap_route_node_add(EMap_Route *route, EMap_Route_Node *node); - [ :emap_route_node_add, [ :emap_route_p, :emap_route_node_p ], :void ], + [ :emap_route_node_add, [ :pointer, :pointer ], :void ], # EAPI void emap_route_free(EMap_Route *route); - [ :emap_route_free, [ :emap_route_p ], :void ], + [ :emap_route_free, [ :pointer ], :void ], # EAPI void emap_route_name_set(EMap_Route *route, const char *name); - [ :emap_route_name_set, [ :emap_route_p, :string ], :void ], + [ :emap_route_name_set, [ :pointer, :string ], :void ], # EAPI const char *emap_route_name_get(EMap_Route *route); - [ :emap_route_name_get, [ :emap_route_p ], :string ], + [ :emap_route_name_get, [ :pointer ], :string ], # EAPI Eina_List *emap_route_nodes_get(EMap_Route *route); - [ :emap_route_nodes_get, [ :emap_route_p ], :eina_list_p ], + [ :emap_route_nodes_get, [ :pointer ], :pointer ], # EAPI double emap_route_distance_get(EMap_Route *route); - [ :emap_route_distance_get, [ :emap_route_p ], :double ], + [ :emap_route_distance_get, [ :pointer ], :double ], # EAPI EMap_Route_Node *emap_route_node_new(); - [ :emap_route_node_new, [ ], :emap_route_node_p ], + [ :emap_route_node_new, [ ], :pointer ], # EAPI void emap_route_node_lon_set(EMap_Route_Node *node, double lon); - [ :emap_route_node_lon_set, [ :emap_route_node_p, :double ], :void ], + [ :emap_route_node_lon_set, [ :pointer, :double ], :void ], # EAPI void emap_route_node_lat_set(EMap_Route_Node *node, double lat); - [ :emap_route_node_lat_set, [ :emap_route_node_p, :double ], :void ], + [ :emap_route_node_lat_set, [ :pointer, :double ], :void ], # EAPI double emap_route_node_lon_get(EMap_Route_Node *node); - [ :emap_route_node_lon_get, [ :emap_route_node_p ], :double ], + [ :emap_route_node_lon_get, [ :pointer ], :double ], # EAPI double emap_route_node_lat_get(EMap_Route_Node *node); - [ :emap_route_node_lat_get, [ :emap_route_node_p ], :double ], + [ :emap_route_node_lat_get, [ :pointer ], :double ], # EAPI void emap_route_node_elevation_set(EMap_Route_Node *node, double elevation); - [ :emap_route_node_elevation_set, [ :emap_route_node_p, :double ], :void ], + [ :emap_route_node_elevation_set, [ :pointer, :double ], :void ], # EAPI double emap_route_node_elevation_get(EMap_Route_Node *node); - [ :emap_route_node_elevation_get, [ :emap_route_node_p ], :double ], + [ :emap_route_node_elevation_get, [ :pointer ], :double ], # EAPI void emap_route_node_time_set(EMap_Route_Node *node, time_t time); - [ :emap_route_node_time_set, [ :emap_route_node_p, :ulong ], :void ], + [ :emap_route_node_time_set, [ :pointer, :ulong ], :void ], # EAPI time_t emap_route_node_time_get(EMap_Route_Node *node); - [ :emap_route_node_time_get, [ :emap_route_node_p ], :ulong ], + [ :emap_route_node_time_get, [ :pointer ], :ulong ], # EAPI double emap_route_nodes_distance_get(EMap_Route_Node *A, EMap_Route_Node *B); - [ :emap_route_nodes_distance_get, [ :emap_route_node_p, :emap_route_node_p ], :double ], + [ :emap_route_nodes_distance_get, [ :pointer, :pointer ], :double ], # EAPI void emap_route_node_free(EMap_Route_Node *node); - [ :emap_route_node_free, [ :emap_route_node_p ], :void ], + [ :emap_route_node_free, [ :pointer ], :void ], # EAPI EMap_Route * emap_route_gpx_new(const char *file); - [ :emap_route_gpx_new, [ :string ], :emap_route_p ], + [ :emap_route_gpx_new, [ :string ], :pointer ], ] # attach_fcts fcts |