From 05c5bc859f299c50f281fd39accb852e6ed3ad47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 7 Mar 2012 09:37:05 +0100 Subject: add elm_popup --- lib/efl/elm/elm_popup.rb | 26 ++++++++++++++++++ lib/efl/native/elm/elm_popup.rb | 59 +++++++++++++++++++++++++++++++++++++++++ tools/extract-api.sh | 1 + tools/genruby.rb | 1 + 4 files changed, 87 insertions(+) create mode 100644 lib/efl/elm/elm_popup.rb create mode 100644 lib/efl/native/elm/elm_popup.rb diff --git a/lib/efl/elm/elm_popup.rb b/lib/efl/elm/elm_popup.rb new file mode 100644 index 0000000..339789f --- /dev/null +++ b/lib/efl/elm/elm_popup.rb @@ -0,0 +1,26 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_object' +require 'efl/elm/elm_object_item' +require 'efl/native/elm/elm_popup' +# +module Efl + # + module Elm + # + class ElmPopup < ElmObject + # + include Helper + constructor :elm_popup_add + search_prefixes 'elm_popup_' + # + def item_append label, icon, func, data=nil + ElmObjectItem.new Native.elm_popup_item_append @ptr, label, icon, func, data + end + end + # + end +end +# +# EOF diff --git a/lib/efl/native/elm/elm_popup.rb b/lib/efl/native/elm/elm_popup.rb new file mode 100644 index 0000000..39bd621 --- /dev/null +++ b/lib/efl/native/elm/elm_popup.rb @@ -0,0 +1,59 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/elementary' +# +module Efl + # + module ElmPopup + # + FCT_PREFIX = 'elm_popup_' 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_Popup_Orient; + enum :elm_popup_orient, [ :elm_popup_orient_top, 0, :elm_popup_orient_center, 1, :elm_popup_orient_bottom, 2, :elm_popup_orient_left, 3, + :elm_popup_orient_right, 4, :elm_popup_orient_top_left, 5, :elm_popup_orient_top_right, 6, :elm_popup_orient_bottom_left, 7, + :elm_popup_orient_bottom_right, 8, :elm_popup_orient_last, 9 ] + # + # FUNCTIONS + fcts = [ + # EAPI Evas_Object *elm_popup_add(Evas_Object *parent); + [ :elm_popup_add, [ :evas_object ], :evas_object ], + # EAPI Elm_Object_Item *elm_popup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data); + [ :elm_popup_item_append, [ :evas_object, :string, :evas_object, :evas_smart_cb, :pointer ], :elm_object_item ], + # EAPI void elm_popup_content_text_wrap_type_set(Evas_Object *obj, Elm_Wrap_Type wrap); + [ :elm_popup_content_text_wrap_type_set, [ :evas_object, :elm_wrap_type ], :void ], + # EAPI Elm_Wrap_Type elm_popup_content_text_wrap_type_get(Evas_Object *obj); + [ :elm_popup_content_text_wrap_type_get, [ :evas_object ], :elm_wrap_type ], + # EAPI void elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient); + [ :elm_popup_orient_set, [ :evas_object, :elm_popup_orient ], :void ], + # EAPI Elm_Popup_Orient elm_popup_orient_get(Evas_Object *obj); + [ :elm_popup_orient_get, [ :evas_object ], :elm_popup_orient ], + # EAPI void elm_popup_timeout_set(Evas_Object *obj, double timeout); + [ :elm_popup_timeout_set, [ :evas_object, :double ], :void ], + # EAPI double elm_popup_timeout_get(Evas_Object *obj); + [ :elm_popup_timeout_get, [ :evas_object ], :double ], + # EAPI void elm_popup_allow_events_set(Evas_Object *obj, Eina_Bool allow); + [ :elm_popup_allow_events_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_popup_allow_events_get(Evas_Object *obj); + [ :elm_popup_allow_events_get, [ :evas_object ], :bool ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/extract-api.sh b/tools/extract-api.sh index 895011a..294c600 100755 --- a/tools/extract-api.sh +++ b/tools/extract-api.sh @@ -55,6 +55,7 @@ for header in \ "${INCLUDE}/elementary-0/elc_hoversel.h" \ "${INCLUDE}/elementary-0/elc_multibuttonentry.h" \ "${INCLUDE}/elementary-0/elc_naviframe.h" \ + "${INCLUDE}/elementary-0/elc_popup.h" \ "${INCLUDE}/elementary-0/elm_actionslider.h" \ "${INCLUDE}/elementary-0/elm_app.h" \ "${INCLUDE}/elementary-0/elm_authors.h" \ diff --git a/tools/genruby.rb b/tools/genruby.rb index 938eef9..2be069b 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -373,6 +373,7 @@ 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', 'ElmMultiButtonEntry') libs << elm_h('elc_naviframe.h', 'ElmNaviFrame') +libs << elm_h('elc_popup.h', 'ElmPopup') libs << elm_h('elm_actionslider.h', 'ElmActionSlider') libs << elm_h('elm_app.h', 'ElmApp') libs << elm_h('elm_bg.h', 'ElmBg') -- cgit v1.1-2-g2b99