From b030c490265bb13ee98a650da419a033495042ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 27 Feb 2012 15:45:59 +0100 Subject: parse elm_notify.h, generate elm_notify.rb --- lib/efl/elm/elm_notify.rb | 22 ++++++++++++++++ lib/efl/native/elm/elm_notify.rb | 57 ++++++++++++++++++++++++++++++++++++++++ tools/extract-api.sh | 1 + tools/genruby.rb | 5 ++++ 4 files changed, 85 insertions(+) create mode 100644 lib/efl/elm/elm_notify.rb create mode 100644 lib/efl/native/elm/elm_notify.rb diff --git a/lib/efl/elm/elm_notify.rb b/lib/efl/elm/elm_notify.rb new file mode 100644 index 0000000..c1b3d4c --- /dev/null +++ b/lib/efl/elm/elm_notify.rb @@ -0,0 +1,22 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_object' +require 'efl/native/elm/elm_notify' +# +module Efl + # + module Elm + # + class ElmNotify < ElmObject + # + include Helper + constructor :elm_notify_add + search_prefixes 'elm_check_' + # + end + # + end +end +# +# EOF diff --git a/lib/efl/native/elm/elm_notify.rb b/lib/efl/native/elm/elm_notify.rb new file mode 100644 index 0000000..656bb28 --- /dev/null +++ b/lib/efl/native/elm/elm_notify.rb @@ -0,0 +1,57 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/elementary' +# +module Efl + # + module ElmNotify + # + FCT_PREFIX = 'elm_notify_' 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_Notify_Orient; + enum :elm_notify_orient, [ :elm_notify_orient_top, :elm_notify_orient_center, :elm_notify_orient_bottom, :elm_notify_orient_left, + :elm_notify_orient_right, :elm_notify_orient_top_left, :elm_notify_orient_top_right, :elm_notify_orient_bottom_left, :elm_notify_orient_bottom_right, + :elm_notify_orient_last ] + # + # FUNCTIONS + fcts = [ + # EAPI Evas_Object *elm_notify_add(Evas_Object *parent); + [ :elm_notify_add, [ :evas_object ], :evas_object ], + # EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent); + [ :elm_notify_parent_set, [ :evas_object, :evas_object ], :void ], + # EAPI Evas_Object *elm_notify_parent_get(const Evas_Object *obj); + [ :elm_notify_parent_get, [ :evas_object ], :evas_object ], + # EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient); + [ :elm_notify_orient_set, [ :evas_object, :elm_notify_orient ], :void ], + # EAPI Elm_Notify_Orient elm_notify_orient_get(const Evas_Object *obj); + [ :elm_notify_orient_get, [ :evas_object ], :elm_notify_orient ], + # EAPI void elm_notify_timeout_set(Evas_Object *obj, double timeout); + [ :elm_notify_timeout_set, [ :evas_object, :double ], :void ], + # EAPI double elm_notify_timeout_get(const Evas_Object *obj); + [ :elm_notify_timeout_get, [ :evas_object ], :double ], + # EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat); + [ :elm_notify_repeat_events_set, [ :evas_object, :bool ], :void ], + # EAPI Eina_Bool elm_notify_repeat_events_get(const Evas_Object *obj); + [ :elm_notify_repeat_events_get, [ :evas_object ], :bool ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/extract-api.sh b/tools/extract-api.sh index 57eae16..af7945b 100755 --- a/tools/extract-api.sh +++ b/tools/extract-api.sh @@ -67,6 +67,7 @@ for header in \ "${INCLUDE}/elementary-0/elm_bubble.h" \ "${INCLUDE}/elementary-0/elm_layout.h" \ "${INCLUDE}/elementary-0/elm_cursor.h" \ + "${INCLUDE}/elementary-0/elm_notify.h" \ ; do # if [ ! -e "$header" ]; then diff --git a/tools/genruby.rb b/tools/genruby.rb index 10f269d..f6980fb 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -455,6 +455,11 @@ libs << { :modname=>'ElmCursor', :prefix=>'elm_cursor', :outfile=>'elm/elm_cursor.rb', :requires=>["#{NATIVE}/elementary"], :constants=>[] } +libs << { + :lib=>ELM_LIB,:header=>'elm_notify.h', + :modname=>'ElmNotify', :prefix=>'elm_notify', :outfile=>'elm/elm_notify.rb', + :requires=>["#{NATIVE}/elementary"], :constants=>[] +} # Dir.mkdir lib_path unless (File.exists? lib_path) # -- cgit v1.1-2-g2b99