From ef0029be2eedf70fc7b9446e4643467e31c7b27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 28 Feb 2012 15:26:04 +0100 Subject: parse elm_focus.h, generate elm_focus.rb --- lib/efl/elementary_all.rb | 2 +- lib/efl/elm/elm_focus.rb | 74 +++++++++++++++++++++++++++++++++++++++++ lib/efl/native/elm/elm_focus.rb | 65 ++++++++++++++++++++++++++++++++++++ tools/genruby.rb | 2 +- 4 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 lib/efl/elm/elm_focus.rb create mode 100644 lib/efl/native/elm/elm_focus.rb diff --git a/lib/efl/elementary_all.rb b/lib/efl/elementary_all.rb index deadf6d..d0eaa77 100644 --- a/lib/efl/elementary_all.rb +++ b/lib/efl/elementary_all.rb @@ -36,7 +36,7 @@ require 'efl/elm/elm_fileselector' #require 'efl/elm/elm_finger' require 'efl/elm/elm_flip' require 'efl/elm/elm_flipselector' -#require 'efl/elm/elm_focus' +require 'efl/elm/elm_focus' #require 'efl/elm/elm_fonts' require 'efl/elm/elm_frame' #require 'efl/elm/elm_gengrid' diff --git a/lib/efl/elm/elm_focus.rb b/lib/efl/elm/elm_focus.rb new file mode 100644 index 0000000..6f424f9 --- /dev/null +++ b/lib/efl/elm/elm_focus.rb @@ -0,0 +1,74 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_object' +require 'efl/native/elm/elm_focus' +# +module Efl + # + module Elm + # + class ElmObject + # + def focus_get + Native::elm_object_focus_get @ptr + end + alias :focus :focus_get + # + def focus_set focus + Native::elm_object_focus_set @ptr, focus + end + alias :focus= :focus_set + # + def focus_allow_get + Native::elm_object_focus_allow_get @ptr + end + alias :focus :focus_allow_get + # + def focus_allow_set allow + Native::elm_object_focus_allow_set @ptr, allow + end + alias :focus_allow= :focus_allow_set + # + def focus_allow_custom_chain_set list + Native::elm_object_focus_allow_custom_chain_set @ptr, list + end + alias :focus_allow_custom_chain= :focus_allow_custom_chain_set + # + def focus_allow_custom_chain_unset + Native::elm_object_focus_allow_custom_chain_unset @ptr + end + # + def focus_allow_custom_chain_get + Native::elm_object_focus_allow_custom_chain_get @ptr + end + alias :focus_allow_custom_chain :focus_allow_custom_chain_get + # + def focus_custom_chain_append child, relative_child + Native::elm_object_focus_custom_chain_append @ptr, child, relative_child + end + # + def focus_custom_chain_prepend child, relative_child + Native::elm_object_focus_custom_chain_prepend @ptr, child, relative_child + end + # + def focus_cycle direction + Native::elm_object_focus_cycle @ptr, direction + end + # + def tree_unfocusable_set unfocusable + Native::elm_object_tree_unfocusable_set @ptr, unfocusable + end + alias :tree_unfocusable= :tree_unfocusable_set + # + def tree_unfocusable_get + Native::elm_object_tree_unfocusable_set @ptr + end + alias :tree_unfocusable :tree_unfocusable_get + # + end + # + end +end +# +# EOF diff --git a/lib/efl/native/elm/elm_focus.rb b/lib/efl/native/elm/elm_focus.rb new file mode 100644 index 0000000..df1e6c3 --- /dev/null +++ b/lib/efl/native/elm/elm_focus.rb @@ -0,0 +1,65 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/elementary' +# +module Efl + # + module ElmFocus + # + FCT_PREFIX = 'elm_focus_' 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 'elementary-ver-pre-svn-09.so.0' + # + # FUNCTIONS + fcts = [ + # EAPI Eina_Bool elm_focus_highlight_enabled_get(void); + [ :elm_focus_highlight_enabled_get, [ ], :bool ], + # EAPI void elm_focus_highlight_enabled_set(Eina_Bool enable); + [ :elm_focus_highlight_enabled_set, [ :bool ], :void ], + # EAPI Eina_Bool elm_focus_highlight_animate_get(void); + [ :elm_focus_highlight_animate_get, [ ], :bool ], + # EAPI void elm_focus_highlight_animate_set(Eina_Bool animate); + [ :elm_focus_highlight_animate_set, [ :bool ], :void ], + # EAPI Eina_Bool elm_object_focus_get(const Evas_Object *obj); + [ :elm_object_focus_get, [ :evas_object ], :bool ], + # EAPI void elm_object_focus_set(Evas_Object *obj, Eina_Bool focus); + [ :elm_object_focus_set, [ :evas_object, :bool ], :void ], + # EAPI void elm_object_focus_allow_set(Evas_Object *obj, Eina_Bool enable); + [ :elm_object_focus_allow_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_object_focus_allow_get(const Evas_Object *obj); + [ :elm_object_focus_allow_get, [ :evas_object ], :bool ], + # EAPI void elm_object_focus_custom_chain_set(Evas_Object *obj, Eina_List *objs); + [ :elm_object_focus_custom_chain_set, [ :evas_object, :eina_list ], :void ], + # EAPI void elm_object_focus_custom_chain_unset(Evas_Object *obj); + [ :elm_object_focus_custom_chain_unset, [ :evas_object ], :void ], + # EAPI const Eina_List *elm_object_focus_custom_chain_get(const Evas_Object *obj); + [ :elm_object_focus_custom_chain_get, [ :evas_object ], :eina_list ], + # EAPI void elm_object_focus_custom_chain_append(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child); + [ :elm_object_focus_custom_chain_append, [ :evas_object, :evas_object, :evas_object ], :void ], + # EAPI void elm_object_focus_custom_chain_prepend(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child); + [ :elm_object_focus_custom_chain_prepend, [ :evas_object, :evas_object, :evas_object ], :void ], + # EAPI void elm_object_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir); + [ :elm_object_focus_cycle, [ :evas_object, :elm_focus_direction ], :void ], + # EAPI void elm_object_tree_unfocusable_set(Evas_Object *obj, Eina_Bool tree_unfocusable); + [ :elm_object_tree_unfocusable_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_object_tree_unfocusable_get(const Evas_Object *obj); + [ :elm_object_tree_unfocusable_get, [ :evas_object ], :bool ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/genruby.rb b/tools/genruby.rb index 3bfa094..6cc8b7c 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -396,7 +396,7 @@ libs << elm_h('elm_diskselector.h', 'ElmDiskSelector', ["#{NATIVE}/elementary"," #libs << elm_h('elm_finger.h', 'ElmFinger') libs << elm_h('elm_flip.h', 'ElmFlip') libs << elm_h('elm_flipselector.h', 'ElmFlipSelector') -#libs << elm_h('elm_focus.h', 'ElmFocus') +libs << elm_h('elm_focus.h', 'ElmFocus') #libs << elm_h('elm_fonts.h', 'ElmFonts') libs << elm_h('elm_frame.h', 'ElmFrame') #libs << elm_h('elm_gengrid.h', 'ElmGenGrid') -- cgit v1.1-2-g2b99