From 742806e336e6984e4ffa8d87ec6fdde61cbfeaef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 27 Feb 2012 10:16:29 +0100 Subject: parse elm_list.h and generate elm_list.rb --- lib/efl/native/elm/elm_list.rb | 105 +++++++++++++++++++++++++++++++++++++++++ tools/extract-api.sh | 1 + tools/genruby.rb | 4 ++ 3 files changed, 110 insertions(+) create mode 100644 lib/efl/native/elm/elm_list.rb diff --git a/lib/efl/native/elm/elm_list.rb b/lib/efl/native/elm/elm_list.rb new file mode 100644 index 0000000..8fcbecd --- /dev/null +++ b/lib/efl/native/elm/elm_list.rb @@ -0,0 +1,105 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/elementary' +require 'efl/native/elm/elm_scroller' +# +module Efl + # + module ElmList + # + FCT_PREFIX = 'elm_list_' 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' + # + # ENUMS + # typedef enum {...} Elm_List_Mode; + enum :elm_list_mode, [ :elm_list_compress, 0, :elm_list_scroll, 1, :elm_list_limit, 2, :elm_list_expand, 3, :elm_list_last, 4 ] + # + # FUNCTIONS + fcts = [ + # EAPI Evas_Object *elm_list_add(Evas_Object *parent); + [ :elm_list_add, [ :evas_object ], :evas_object ], + # EAPI void elm_list_go(Evas_Object *obj); + [ :elm_list_go, [ :evas_object ], :void ], + # EAPI void elm_list_multi_select_set(Evas_Object *obj, Eina_Bool multi); + [ :elm_list_multi_select_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_list_multi_select_get(const Evas_Object *obj); + [ :elm_list_multi_select_get, [ :evas_object ], :bool ], + # EAPI void elm_list_mode_set(Evas_Object *obj, Elm_List_Mode mode); + [ :elm_list_mode_set, [ :evas_object, :elm_list_mode ], :void ], + # EAPI Elm_List_Mode elm_list_mode_get(const Evas_Object *obj); + [ :elm_list_mode_get, [ :evas_object ], :elm_list_mode ], + # EAPI void elm_list_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + [ :elm_list_horizontal_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_list_horizontal_get(const Evas_Object *obj); + [ :elm_list_horizontal_get, [ :evas_object ], :bool ], + # EAPI void elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select); + [ :elm_list_always_select_mode_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_list_always_select_mode_get(const Evas_Object *obj); + [ :elm_list_always_select_mode_get, [ :evas_object ], :bool ], + # EAPI void elm_list_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + [ :elm_list_bounce_set, [ :evas_object, :bool, :bool ], :void ], + # EAPI void elm_list_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce); + [ :elm_list_bounce_get, [ :evas_object, :pointer, :pointer ], :void ], + # EAPI void elm_list_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v); + [ :elm_list_scroller_policy_set, [ :evas_object, :elm_scroller_policy, :elm_scroller_policy ], :void ], + # EAPI void elm_list_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v); + [ :elm_list_scroller_policy_get, [ :evas_object, :pointer, :pointer ], :void ], + # EAPI Elm_Object_Item *elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + [ :elm_list_item_append, [ :evas_object, :string, :evas_object, :evas_object, :evas_smart_cb, :pointer ], :elm_object_item ], + # EAPI Elm_Object_Item *elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + [ :elm_list_item_prepend, [ :evas_object, :string, :evas_object, :evas_object, :evas_smart_cb, :pointer ], :elm_object_item ], + # EAPI Elm_Object_Item *elm_list_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + [ :elm_list_item_insert_before, [ :evas_object, :elm_object_item, :string, :evas_object, :evas_object, :evas_smart_cb, :pointer ], + :elm_object_item ], + # EAPI Elm_Object_Item *elm_list_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + [ :elm_list_item_insert_after, [ :evas_object, :elm_object_item, :string, :evas_object, :evas_object, :evas_smart_cb, :pointer ], + :elm_object_item ], + # EAPI Elm_Object_Item *elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); + [ :elm_list_item_sorted_insert, [ :evas_object, :string, :evas_object, :evas_object, :evas_smart_cb, :pointer, :eina_compare_cb ], + :elm_object_item ], + # EAPI void elm_list_clear(Evas_Object *obj); + [ :elm_list_clear, [ :evas_object ], :void ], + # EAPI const Eina_List *elm_list_items_get(const Evas_Object *obj); + [ :elm_list_items_get, [ :evas_object ], :eina_list ], + # EAPI Elm_Object_Item *elm_list_selected_item_get(const Evas_Object *obj); + [ :elm_list_selected_item_get, [ :evas_object ], :elm_object_item ], + # EAPI const Eina_List *elm_list_selected_items_get(const Evas_Object *obj); + [ :elm_list_selected_items_get, [ :evas_object ], :eina_list ], + # EAPI void elm_list_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); + [ :elm_list_item_selected_set, [ :elm_object_item, :bool ], :void ], + # EAPI Eina_Bool elm_list_item_selected_get(const Elm_Object_Item *it); + [ :elm_list_item_selected_get, [ :elm_object_item ], :bool ], + # EAPI void elm_list_item_separator_set(Elm_Object_Item *it, Eina_Bool setting); + [ :elm_list_item_separator_set, [ :elm_object_item, :bool ], :void ], + # EAPI Eina_Bool elm_list_item_separator_get(const Elm_Object_Item *it); + [ :elm_list_item_separator_get, [ :elm_object_item ], :bool ], + # EAPI void elm_list_item_show(Elm_Object_Item *it); + [ :elm_list_item_show, [ :elm_object_item ], :void ], + # EAPI void elm_list_item_bring_in(Elm_Object_Item *it); + [ :elm_list_item_bring_in, [ :elm_object_item ], :void ], + # EAPI Evas_Object *elm_list_item_object_get(const Elm_Object_Item *it); + [ :elm_list_item_object_get, [ :elm_object_item ], :evas_object ], + # EAPI Elm_Object_Item *elm_list_item_prev(const Elm_Object_Item *it); + [ :elm_list_item_prev, [ :elm_object_item ], :elm_object_item ], + # EAPI Elm_Object_Item *elm_list_item_next(const Elm_Object_Item *it); + [ :elm_list_item_next, [ :elm_object_item ], :elm_object_item ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/extract-api.sh b/tools/extract-api.sh index a763dfe..6b0b8e7 100755 --- a/tools/extract-api.sh +++ b/tools/extract-api.sh @@ -49,6 +49,7 @@ for header in \ "${INCLUDE}/elementary-0/elm_icon.h" \ "${INCLUDE}/elementary-0/elm_scroller.h" \ "${INCLUDE}/elementary-0/elm_entry.h" \ + "${INCLUDE}/elementary-0/elm_list.h" \ ; do # if [ ! -e "$header" ]; then diff --git a/tools/genruby.rb b/tools/genruby.rb index ab78aec..c547bc6 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -365,6 +365,10 @@ libs << { :modname=>'ElmEntry', :prefix=>'elm_entry', :outfile=>'elm/elm_entry.rb', :requires=>["#{NATIVE}/edje","#{NATIVE}/elementary","#{NATIVE}/elm/elm_icon","#{NATIVE}/elm/elm_scroller"], :constants=>[] } +libs << { + :lib=>ELM_LIB,:header=>'elm_list.h', + :modname=>'ElmList', :prefix=>'elm_list', :outfile=>'elm/elm_list.rb', + :requires=>["#{NATIVE}/elementary","#{NATIVE}/elm/elm_scroller"], :constants=>[] } Dir.mkdir lib_path unless (File.exists? lib_path) # -- cgit v1.1-2-g2b99