diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-19 08:53:13 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-19 08:53:13 +0200 |
commit | 055aea9c81c370af51ff6331f626ca470f41c2dd (patch) | |
tree | adf2b5588ab21206961b2641db597af93acd0782 | |
parent | b79c8a5851d1d9a5523230158f2d6d5a8b16cdc3 (diff) | |
download | ffi-efl-055aea9c81c370af51ff6331f626ca470f41c2dd.zip ffi-efl-055aea9c81c370af51ff6331f626ca470f41c2dd.tar.gz |
increase Efl::ModuleX::method_missing capabilities
-rw-r--r-- | lib/efl/ffi.rb | 4 | ||||
-rw-r--r-- | lib/efl/native/ecore.rb | 39 | ||||
-rw-r--r-- | lib/efl/native/ecore_evas.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/ecore_getopt.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/ecore_input.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/edje.rb | 30 | ||||
-rw-r--r-- | lib/efl/native/eet.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/eina.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/eina_hash.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/eina_list.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/eina_log.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/eina_types.rb | 25 | ||||
-rw-r--r-- | lib/efl/native/elementary.rb | 41 | ||||
-rw-r--r-- | lib/efl/native/evas.rb | 55 | ||||
-rwxr-xr-x | tools/genruby.rb | 27 |
15 files changed, 389 insertions, 32 deletions
diff --git a/lib/efl/ffi.rb b/lib/efl/ffi.rb index c9f78d7..f66905f 100644 --- a/lib/efl/ffi.rb +++ b/lib/efl/ffi.rb @@ -117,8 +117,8 @@ module Efl meth = ( if Efl::Native.respond_to? sym sym - elsif Efl::Native.respond_to? m - m + elsif Efl::Native.respond_to? m_s + m_s elsif Efl::Native.respond_to? sym+'_get' sym+'_get' elsif Efl::Native.respond_to? m_s+'_get' diff --git a/lib/efl/native/ecore.rb b/lib/efl/native/ecore.rb index d0fe205..71e7daa 100644 --- a/lib/efl/native/ecore.rb +++ b/lib/efl/native/ecore.rb @@ -8,8 +8,29 @@ module Efl module Ecore # def self.method_missing m, *args, &block - sym = 'ecore_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'ecore_'+m_s + 'ecore_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'ecore_'+m_s+'_get' + 'ecore_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end @@ -38,6 +59,8 @@ module Efl typedef :pointer, :ecore_poller_type # typedef enum _Ecore_Pos_Map Ecore_Pos_Map; typedef :pointer, :ecore_pos_map + # typedef enum _Ecore_Animator_Source Ecore_Animator_Source; + typedef :pointer, :ecore_animator_source # typedef struct _Ecore_Exe Ecore_Exe; typedef :pointer, :ecore_exe typedef :pointer, :ecore_exe_p @@ -361,6 +384,8 @@ module Efl [ :ecore_timer_precision_get, [ ], :double ], # EAPI void ecore_timer_precision_set(double precision); [ :ecore_timer_precision_set, [ :double ], :void ], + # EAPI char *ecore_timer_dump(void); + [ :ecore_timer_dump, [ ], :string ], # EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, const void *data); [ :ecore_animator_add, [ :ecore_task_cb, :void_p ], :ecore_animator_p ], # EAPI Ecore_Animator *ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *data); @@ -377,6 +402,16 @@ module Efl [ :ecore_animator_frametime_get, [ ], :double ], # EAPI double ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, double v2); [ :ecore_animator_pos_map, [ :double, :ecore_pos_map, :double, :double ], :double ], + # EAPI void ecore_animator_source_set(Ecore_Animator_Source source); + [ :ecore_animator_source_set, [ :ecore_animator_source ], :void ], + # EAPI Ecore_Animator_Source ecore_animator_source_get(void); + [ :ecore_animator_source_get, [ ], :ecore_animator_source ], + # EAPI void ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *data); + [ :ecore_animator_custom_source_tick_begin_callback_set, [ :ecore_cb, :void_p ], :void ], + # EAPI void ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, const void *data); + [ :ecore_animator_custom_source_tick_end_callback_set, [ :ecore_cb, :void_p ], :void ], + # EAPI void ecore_animator_custom_tick(void); + [ :ecore_animator_custom_tick, [ ], :void ], # EAPI void ecore_poller_poll_interval_set(Ecore_Poller_Type type, double poll_time); [ :ecore_poller_poll_interval_set, [ :ecore_poller_type, :double ], :void ], # EAPI double ecore_poller_poll_interval_get(Ecore_Poller_Type type); diff --git a/lib/efl/native/ecore_evas.rb b/lib/efl/native/ecore_evas.rb index 32035c1..4413980 100644 --- a/lib/efl/native/ecore_evas.rb +++ b/lib/efl/native/ecore_evas.rb @@ -8,8 +8,29 @@ module Efl module EcoreEvas # def self.method_missing m, *args, &block - sym = 'ecore_evas_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'ecore_evas_'+m_s + 'ecore_evas_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'ecore_evas_'+m_s+'_get' + 'ecore_evas_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/ecore_getopt.rb b/lib/efl/native/ecore_getopt.rb index e92b4da..feb74e8 100644 --- a/lib/efl/native/ecore_getopt.rb +++ b/lib/efl/native/ecore_getopt.rb @@ -8,8 +8,29 @@ module Efl module EcoreGetopt # def self.method_missing m, *args, &block - sym = 'ecore_getopt_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'ecore_getopt_'+m_s + 'ecore_getopt_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'ecore_getopt_'+m_s+'_get' + 'ecore_getopt_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/ecore_input.rb b/lib/efl/native/ecore_input.rb index 6123b19..ba246f2 100644 --- a/lib/efl/native/ecore_input.rb +++ b/lib/efl/native/ecore_input.rb @@ -8,8 +8,29 @@ module Efl module EcoreInput # def self.method_missing m, *args, &block - sym = 'ecore_event_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'ecore_event_'+m_s + 'ecore_event_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'ecore_event_'+m_s+'_get' + 'ecore_event_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/edje.rb b/lib/efl/native/edje.rb index d2f315e..8b2d849 100644 --- a/lib/efl/native/edje.rb +++ b/lib/efl/native/edje.rb @@ -8,8 +8,29 @@ module Efl module Edje # def self.method_missing m, *args, &block - sym = 'edje_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'edje_'+m_s + 'edje_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'edje_'+m_s+'_get' + 'edje_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end @@ -50,7 +71,8 @@ module Efl :edje_action_type_reserved00, 9, :edje_action_type_focus_object, 10, :edje_action_type_param_copy, 11, :edje_action_type_param_set, 12, :edje_action_type_last, 13 ] # typedef enum _Edje_Tween_Mode {...} Edje_Tween_Mode; enum :edje_tween_mode, [ :edje_tween_mode_none, 0, :edje_tween_mode_linear, 1, :edje_tween_mode_sinusoidal, 2, :edje_tween_mode_accelerate, 3, - :edje_tween_mode_decelerate, 4, :edje_tween_mode_last, 5 ] + :edje_tween_mode_decelerate, 4, :edje_tween_mode_accelerate_factor, 5, :edje_tween_mode_decelerate_factor, 6, :edje_tween_mode_sinusoidal_factor, 7, + :edje_tween_mode_divisor_interp, 8, :edje_tween_mode_bounce, 9, :edje_tween_mode_spring, 10, :edje_tween_mode_last, 11 ] # typedef enum _Edje_Cursor {...} Edje_Cursor; enum :edje_cursor, [ :edje_cursor_main, :edje_cursor_selection_begin, :edje_cursor_selection_end, :edje_cursor_preedit_start, :edje_cursor_preedit_end, :edje_cursor_user, :edje_cursor_user_extra ] @@ -281,6 +303,8 @@ module Efl [ :edje_object_part_text_select_all, [ :evas_object_p, :string ], :void ], # EAPI void edje_object_part_text_insert (Evas_Object *obj, const char *part, const char *text); [ :edje_object_part_text_insert, [ :evas_object_p, :string, :string ], :void ], + # EAPI void edje_object_part_text_append(Evas_Object *obj, const char *part, const char *text); + [ :edje_object_part_text_append, [ :evas_object_p, :string, :string ], :void ], # EAPI const Eina_List *edje_object_part_text_anchor_list_get (const Evas_Object *obj, const char *part); [ :edje_object_part_text_anchor_list_get, [ :evas_object_p, :string ], :eina_list_p ], # EAPI const Eina_List *edje_object_part_text_anchor_geometry_get (const Evas_Object *obj, const char *part, const char *anchor); diff --git a/lib/efl/native/eet.rb b/lib/efl/native/eet.rb index 11a5e29..e035c85 100644 --- a/lib/efl/native/eet.rb +++ b/lib/efl/native/eet.rb @@ -8,8 +8,29 @@ module Efl module Eet # def self.method_missing m, *args, &block - sym = 'eet_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'eet_'+m_s + 'eet_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'eet_'+m_s+'_get' + 'eet_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/eina.rb b/lib/efl/native/eina.rb index 6f7ea11..a910567 100644 --- a/lib/efl/native/eina.rb +++ b/lib/efl/native/eina.rb @@ -8,8 +8,29 @@ module Efl module Eina # def self.method_missing m, *args, &block - sym = 'eina_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'eina_'+m_s + 'eina_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'eina_'+m_s+'_get' + 'eina_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/eina_hash.rb b/lib/efl/native/eina_hash.rb index d3700c2..f1df86e 100644 --- a/lib/efl/native/eina_hash.rb +++ b/lib/efl/native/eina_hash.rb @@ -8,8 +8,29 @@ module Efl module EinaHash # def self.method_missing m, *args, &block - sym = 'eina_hash_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'eina_hash_'+m_s + 'eina_hash_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'eina_hash_'+m_s+'_get' + 'eina_hash_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/eina_list.rb b/lib/efl/native/eina_list.rb index fe184fd..1d5396a 100644 --- a/lib/efl/native/eina_list.rb +++ b/lib/efl/native/eina_list.rb @@ -8,8 +8,29 @@ module Efl module EinaList # def self.method_missing m, *args, &block - sym = 'eina_list_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'eina_list_'+m_s + 'eina_list_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'eina_list_'+m_s+'_get' + 'eina_list_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/eina_log.rb b/lib/efl/native/eina_log.rb index dd32725..c7b2acb 100644 --- a/lib/efl/native/eina_log.rb +++ b/lib/efl/native/eina_log.rb @@ -8,8 +8,29 @@ module Efl module EinaLog # def self.method_missing m, *args, &block - sym = 'eina_log_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'eina_log_'+m_s + 'eina_log_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'eina_log_'+m_s+'_get' + 'eina_log_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/eina_types.rb b/lib/efl/native/eina_types.rb index 9103946..fbe7130 100644 --- a/lib/efl/native/eina_types.rb +++ b/lib/efl/native/eina_types.rb @@ -8,8 +8,29 @@ module Efl module Eina # def self.method_missing m, *args, &block - sym = 'eina_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'eina_'+m_s + 'eina_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'eina_'+m_s+'_get' + 'eina_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end diff --git a/lib/efl/native/elementary.rb b/lib/efl/native/elementary.rb index fc0f679..7e2dc4d 100644 --- a/lib/efl/native/elementary.rb +++ b/lib/efl/native/elementary.rb @@ -9,8 +9,29 @@ module Efl module Elm # def self.method_missing m, *args, &block - sym = 'elm_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'elm_'+m_s + 'elm_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'elm_'+m_s+'_get' + 'elm_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end @@ -3211,6 +3232,22 @@ module Efl [ :elm_segment_control_item_selected_get, [ :evas_object_p ], :elm_segment_item_p ], # EAPI void elm_segment_control_item_selected_set(Elm_Segment_Item *it, Eina_Bool select); [ :elm_segment_control_item_selected_set, [ :elm_segment_item_p, :eina_bool ], :void ], + # EAPI Evas_Object *elm_grid_add(Evas_Object *parent); + [ :elm_grid_add, [ :evas_object_p ], :evas_object_p ], + # EAPI void elm_grid_size_set(Evas_Object *obj, int w, int h); + [ :elm_grid_size_set, [ :evas_object_p, :int, :int ], :void ], + # EAPI void elm_grid_size_get(Evas_Object *obj, int *w, int *h); + [ :elm_grid_size_get, [ :evas_object_p, :int_p, :int_p ], :void ], + # EAPI void elm_grid_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h); + [ :elm_grid_pack, [ :evas_object_p, :evas_object_p, :int, :int, :int, :int ], :void ], + # EAPI void elm_grid_unpack(Evas_Object *obj, Evas_Object *subobj); + [ :elm_grid_unpack, [ :evas_object_p, :evas_object_p ], :void ], + # EAPI void elm_grid_clear(Evas_Object *obj, Eina_Bool clear); + [ :elm_grid_clear, [ :evas_object_p, :eina_bool ], :void ], + # EAPI void elm_grid_pack_set(Evas_Object *subobj, int x, int y, int w, int h); + [ :elm_grid_pack_set, [ :evas_object_p, :int, :int, :int, :int ], :void ], + # EAPI void elm_grid_pack_get(Evas_Object *subobj, int *x, int *y, int *w, int *h); + [ :elm_grid_pack_get, [ :evas_object_p, :int_p, :int_p, :int_p, :int_p ], :void ], ] # attach_fcts fcts diff --git a/lib/efl/native/evas.rb b/lib/efl/native/evas.rb index 20103b7..bd316e0 100644 --- a/lib/efl/native/evas.rb +++ b/lib/efl/native/evas.rb @@ -8,8 +8,29 @@ module Efl module Evas # def self.method_missing m, *args, &block - sym = 'evas_'+m.to_s - raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'evas_'+m_s + 'evas_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'evas_'+m_s+'_get' + 'evas_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "#{self.name}.#{m_s} (#{m})" + end + ) self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end @@ -920,6 +941,8 @@ module Efl [ :evas_textblock_cursor_paragraph_next, [ :evas_textblock_cursor_p ], :eina_bool ], # EAPI Eina_Bool evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur); [ :evas_textblock_cursor_paragraph_prev, [ :evas_textblock_cursor_p ], :eina_bool ], + # EAPI const Eina_List *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor); + [ :evas_textblock_node_format_list_get, [ :evas_object_p, :string ], :eina_list_p ], # EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj); [ :evas_textblock_node_format_first_get, [ :evas_object_p ], :evas_object_textblock_node_format_p ], # EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj); @@ -1042,6 +1065,8 @@ module Efl [ :evas_smart_callback_description_find, [ :evas_smart_p, :string ], :evas_smart_cb_description_p ], # EAPI Eina_Bool evas_smart_class_inherit_full (Evas_Smart_Class *sc, const Evas_Smart_Class *parent_sc, unsigned int parent_sc_size); [ :evas_smart_class_inherit_full, [ :evas_smart_class_p, :evas_smart_class_p, :uint ], :eina_bool ], + # EAPI int evas_smart_usage_get(const Evas_Smart *s); + [ :evas_smart_usage_get, [ :evas_smart_p ], :int ], # EAPI Evas_Object *evas_object_smart_add (Evas *e, Evas_Smart *s); [ :evas_object_smart_add, [ :evas_p, :evas_smart_p ], :evas_object_p ], # EAPI void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj); @@ -1198,6 +1223,32 @@ module Efl [ :evas_object_table_children_get, [ :evas_object_p ], :eina_list_p ], # EAPI Evas_Object *evas_object_table_child_get (const Evas_Object *o, unsigned short col, unsigned short row); [ :evas_object_table_child_get, [ :evas_object_p, :ushort, :ushort ], :evas_object_p ], + # EAPI Evas_Object *evas_object_grid_add (Evas *evas); + [ :evas_object_grid_add, [ :evas_p ], :evas_object_p ], + # EAPI Evas_Object *evas_object_grid_add_to (Evas_Object *parent); + [ :evas_object_grid_add_to, [ :evas_object_p ], :evas_object_p ], + # EAPI void evas_object_grid_size_set (Evas_Object *o, int w, int h); + [ :evas_object_grid_size_set, [ :evas_object_p, :int, :int ], :void ], + # EAPI void evas_object_grid_size_get (const Evas_Object *o, int *w, int *h); + [ :evas_object_grid_size_get, [ :evas_object_p, :int_p, :int_p ], :void ], + # EAPI void evas_object_grid_mirrored_set (Evas_Object *o, Eina_Bool mirrored); + [ :evas_object_grid_mirrored_set, [ :evas_object_p, :eina_bool ], :void ], + # EAPI Eina_Bool evas_object_grid_mirrored_get (const Evas_Object *o); + [ :evas_object_grid_mirrored_get, [ :evas_object_p ], :eina_bool ], + # EAPI Eina_Bool evas_object_grid_pack (Evas_Object *o, Evas_Object *child, int x, int y, int w, int h); + [ :evas_object_grid_pack, [ :evas_object_p, :evas_object_p, :int, :int, :int, :int ], :eina_bool ], + # EAPI Eina_Bool evas_object_grid_unpack (Evas_Object *o, Evas_Object *child); + [ :evas_object_grid_unpack, [ :evas_object_p, :evas_object_p ], :eina_bool ], + # EAPI void evas_object_grid_clear (Evas_Object *o, Eina_Bool clear); + [ :evas_object_grid_clear, [ :evas_object_p, :eina_bool ], :void ], + # EAPI Eina_Bool evas_object_grid_pack_get (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h); + [ :evas_object_grid_pack_get, [ :evas_object_p, :evas_object_p, :int_p, :int_p, :int_p, :int_p ], :eina_bool ], + # EAPI Eina_Iterator *evas_object_grid_iterator_new (const Evas_Object *o); + [ :evas_object_grid_iterator_new, [ :evas_object_p ], :eina_iterator_p ], + # EAPI Eina_Accessor *evas_object_grid_accessor_new (const Evas_Object *o); + [ :evas_object_grid_accessor_new, [ :evas_object_p ], :eina_accessor_p ], + # EAPI Eina_List *evas_object_grid_children_get (const Evas_Object *o); + [ :evas_object_grid_children_get, [ :evas_object_p ], :eina_list_p ], # EAPI Eina_Bool evas_object_filter_mode_set (Evas_Object *o, Evas_Filter_Mode mode); [ :evas_object_filter_mode_set, [ :evas_object_p, :evas_filter_mode ], :eina_bool ], # EAPI Evas_Filter_Mode evas_object_filter_mode_get (Evas_Object *o); diff --git a/tools/genruby.rb b/tools/genruby.rb index c7fa66c..84f96d4 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -39,8 +39,29 @@ module Efl module MNAME # def self.method_missing m, *args, &block - sym = 'FCT_PREFIX_'+m.to_s - raise NameError.new "\#{self.name}.\#{sym} (\#{m})" if not Efl::Native.respond_to? sym + m_s = m.to_s + if m_s =~/^(.*)=$/ + m_s = $1+'_set' + args_s = '*args[0]' + elsif m_s =~/^(.*)\\?$/ + m_s = $1+'_get' + args_s = '*args' + else + args_s = '*args' + end + sym = ( + if Efl::Native.respond_to? 'FCT_PREFIX_'+m_s + 'FCT_PREFIX_'+m_s + elsif Efl::Native.respond_to? m_s + m_s + elsif Efl::Native.respond_to? 'FCT_PREFIX_'+m_s+'_get' + 'FCT_PREFIX_'+m_s+'_get' + elsif Efl::Native.respond_to? m_s+'_get' + m_s+'_get' + else + raise NameError.new "\#{self.name}.\#{m_s} (\#{m})" + end + ) self.module_eval "def self.\#{m} *args, █ r=Efl::Native.\#{sym}(*args); yield r if block_given?; r; end" self.send m, *args, &block end @@ -282,7 +303,7 @@ libraries.collect do |header,module_name,fct_prefix,lib, output| end.each do |lib, output, module_name, fct_prefix, enums, typedefs, callbacks, variables, functions| printf "%-60s", "generate #{output}" open(output,'w:utf-8') do |f| - f << HEADER.gsub(/MNAME/,module_name).sub(/FCT_PREFIX/,fct_prefix) + f << HEADER.gsub(/MNAME/,module_name).gsub(/FCT_PREFIX/,fct_prefix) f << "#{INDENT}#\n#{INDENT}ffi_lib '#{lib}'" f << "\n#{INDENT}#\n#{INDENT}# ENUMS" print "enums, " |