From ec8df9f648ddaa7dcf532f3339d2246ad7adca41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 28 Feb 2012 11:08:11 +0100 Subject: parse elm_naviframe.h, generate elm_naviframe.rb --- lib/efl/elementary_all.rb | 2 +- lib/efl/elm/elm_naviframe.rb | 42 ++++++++++++++++++++ lib/efl/native/elm/elm_naviframe.rb | 79 +++++++++++++++++++++++++++++++++++++ tools/genruby.rb | 2 +- 4 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 lib/efl/elm/elm_naviframe.rb create mode 100644 lib/efl/native/elm/elm_naviframe.rb diff --git a/lib/efl/elementary_all.rb b/lib/efl/elementary_all.rb index 1d87f6e..cfe3d5e 100644 --- a/lib/efl/elementary_all.rb +++ b/lib/efl/elementary_all.rb @@ -60,7 +60,7 @@ require 'efl/elm/elm_list' require 'efl/elm/elm_menu' #require 'efl/elm/elm_mirroring' #require 'efl/elm/elm_multibuttonentry' -#require 'efl/elm/elm_naviframe' +require 'efl/elm/elm_naviframe' #require 'efl/elm/elm_need' require 'efl/elm/elm_notify' #require 'efl/elm/elm_pager' diff --git a/lib/efl/elm/elm_naviframe.rb b/lib/efl/elm/elm_naviframe.rb new file mode 100644 index 0000000..ecb65d8 --- /dev/null +++ b/lib/efl/elm/elm_naviframe.rb @@ -0,0 +1,42 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_object' +require 'efl/elm/elm_object_item' +require 'efl/native/elm/elm_naviframe' +# +module Efl + # + module Elm + # + class ElmNaviFrame < ElmObject + # + include Helper + constructor :elm_naviframe_add + search_prefixes 'elm_naviframe_' + # + def item_push label, prev_btn, next_btn, content, style + ElmObjectItem.new Native::elm_naviframe_item_push @ptr, label, prev_btn, next_btn, content, style + end + # + def item_insert_before before, label, prev_btn, next_btn, content, style + ElmObjectItem.new Native::elm_naviframe_item_push before, label, prev_btn, next_btn, content, style + end + # + def item_insert_after after, label, prev_btn, next_btn, content, style + ElmObjectItem.new Native::elm_naviframe_item_push after, label, prev_btn, next_btn, content, style + end + # + def top_item_get + ElmObjectItem.new Native::elm_naviframe_top_item_get @ptr + end + # + def bottom_item_get + ElmObjectItem.new Native::elm_naviframe_bottom_item_get @ptr + end + end + # + end +end +# +# EOF diff --git a/lib/efl/native/elm/elm_naviframe.rb b/lib/efl/native/elm/elm_naviframe.rb new file mode 100644 index 0000000..a273b08 --- /dev/null +++ b/lib/efl/native/elm/elm_naviframe.rb @@ -0,0 +1,79 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/elementary' +# +module Efl + # + module ElmNaviFrame + # + FCT_PREFIX = 'elm_naviframe_' 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 Evas_Object *elm_naviframe_add(Evas_Object *parent); + [ :elm_naviframe_add, [ :evas_object ], :evas_object ], + # EAPI Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style); + [ :elm_naviframe_item_push, [ :evas_object, :string, :evas_object, :evas_object, :evas_object, :string ], :elm_object_item ], + # EAPI Elm_Object_Item *elm_naviframe_item_insert_before(Elm_Object_Item *before, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style); + [ :elm_naviframe_item_insert_before, [ :elm_object_item, :string, :evas_object, :evas_object, :evas_object, :string ], :elm_object_item ], + # EAPI Elm_Object_Item *elm_naviframe_item_insert_after(Elm_Object_Item *after, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style); + [ :elm_naviframe_item_insert_after, [ :elm_object_item, :string, :evas_object, :evas_object, :evas_object, :string ], :elm_object_item ], + # EAPI Evas_Object *elm_naviframe_item_pop(Evas_Object *obj); + [ :elm_naviframe_item_pop, [ :evas_object ], :evas_object ], + # EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it); + [ :elm_naviframe_item_pop_to, [ :elm_object_item ], :void ], + # EAPI void elm_naviframe_item_promote(Elm_Object_Item *it); + [ :elm_naviframe_item_promote, [ :elm_object_item ], :void ], + # EAPI void elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve); + [ :elm_naviframe_content_preserve_on_pop_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj); + [ :elm_naviframe_content_preserve_on_pop_get, [ :evas_object ], :bool ], + # EAPI Elm_Object_Item *elm_naviframe_top_item_get(const Evas_Object *obj); + [ :elm_naviframe_top_item_get, [ :evas_object ], :elm_object_item ], + # EAPI Elm_Object_Item *elm_naviframe_bottom_item_get(const Evas_Object *obj); + [ :elm_naviframe_bottom_item_get, [ :evas_object ], :elm_object_item ], + # EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style); + [ :elm_naviframe_item_style_set, [ :elm_object_item, :string ], :void ], + # EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it); + [ :elm_naviframe_item_style_get, [ :elm_object_item ], :string ], + # EAPI void elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible); + [ :elm_naviframe_item_title_visible_set, [ :elm_object_item, :bool ], :void ], + # EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it); + [ :elm_naviframe_item_title_visible_get, [ :elm_object_item ], :bool ], + # EAPI void elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed); + [ :elm_naviframe_prev_btn_auto_pushed_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj); + [ :elm_naviframe_prev_btn_auto_pushed_get, [ :evas_object ], :bool ], + # EAPI Eina_List *elm_naviframe_items_get(const Evas_Object *obj); + [ :elm_naviframe_items_get, [ :evas_object ], :eina_list ], + # EAPI void elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled); + [ :elm_naviframe_event_enabled_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_naviframe_event_enabled_get(const Evas_Object *obj); + [ :elm_naviframe_event_enabled_get, [ :evas_object ], :bool ], + # EAPI void elm_naviframe_item_style_default_set(Evas_Object *obj, const char *style); + [ :elm_naviframe_item_style_default_set, [ :evas_object, :string ], :void ], + # EAPI const char *elm_naviframe_item_style_default_get(const Evas_Object *obj); + [ :elm_naviframe_item_style_default_get, [ :evas_object ], :string ], + # EAPI void elm_naviframe_item_simple_promote(Evas_Object *obj, Evas_Object *content); + [ :elm_naviframe_item_simple_promote, [ :evas_object, :evas_object ], :void ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/genruby.rb b/tools/genruby.rb index 27b1097..7eb7efe 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -373,7 +373,7 @@ libs << elm_h('elc_fileselector_entry.h', 'ElmFileSelectorEntry') libs << elm_h('elc_fileselector.h', 'ElmFileSelector') libs << elm_h('elc_hoversel.h', 'ElmHoverSel', ["#{NATIVE}/elementary","#{NATIVE}/elm/elm_icon"]) #libs << elm_h('elc_multibuttonentry.h', 'ElmX') -#libs << elm_h('elc_naviframe.h', 'ElmX') +libs << elm_h('elc_naviframe.h', 'ElmNaviFrame') libs << elm_h('elm_actionslider.h', 'ElmActionSlider') #libs << elm_h('elm_app.h', 'ElmX') #libs << elm_h('elm_authors.h', 'ElmX') -- cgit v1.1-2-g2b99