diff options
author | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2011-04-14 10:36:09 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2011-04-14 10:36:09 +0200 |
commit | 1e7bb5c2b2358188067e2af256b7b07664a5f732 (patch) | |
tree | 98e182cd97a0849ad4d938f8ebe734a40d642dce | |
parent | cc0f3f9e31ad216224b44f3a7897108cd96e17bb (diff) | |
download | ffi-efl-1e7bb5c2b2358188067e2af256b7b07664a5f732.zip ffi-efl-1e7bb5c2b2358188067e2af256b7b07664a5f732.tar.gz |
update edje, use FFIHelper
-rw-r--r-- | lib/e17/edje.rb | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/e17/edje.rb b/lib/e17/edje.rb index 4abeb0b..1e5ff87 100644 --- a/lib/e17/edje.rb +++ b/lib/e17/edje.rb @@ -1,29 +1,26 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'ffi' +require 'e17/ffi_helper' # module E17 module EDJE # + extend FFIHelper extend FFI::Library # ffi_lib 'edje' - [ + # + fcts = [ + # TODO + # http://docs.enlightenment.org/auto/edje/Edje_8h.html [ :edje_init, [], :int], [ :edje_shutdown, [], :int], - ].each do |func| - begin - attach_function *func - rescue Object => e - puts "Could not attach #{func} #{e.message}" - end - end + ] + # + attach_fcts fcts # - class << self - alias init edje_init - alias shutdown edje_shutdown - end + create_aliases 'edje_'.length, fcts # end end |