From d675940f5a7b2cc8915d1dcb8e40b64c510f7196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 27 Feb 2012 16:04:35 +0100 Subject: parse elm_flip.h, generate elm_flip.rb --- lib/efl/elm/elm_flip.rb | 22 +++++++++++++++ lib/efl/native/elm/elm_flip.rb | 62 ++++++++++++++++++++++++++++++++++++++++++ tools/extract-api.sh | 1 + tools/genruby.rb | 5 ++++ 4 files changed, 90 insertions(+) create mode 100644 lib/efl/elm/elm_flip.rb create mode 100644 lib/efl/native/elm/elm_flip.rb diff --git a/lib/efl/elm/elm_flip.rb b/lib/efl/elm/elm_flip.rb new file mode 100644 index 0000000..50c5b57 --- /dev/null +++ b/lib/efl/elm/elm_flip.rb @@ -0,0 +1,22 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_object' +require 'efl/native/elm/elm_flip' +# +module Efl + # + module Elm + # + class ElmFlip < ElmObject + # + include Helper + constructor :elm_flip_add + search_prefixes 'elm_flip_' + # + end + # + end +end +# +# EOF diff --git a/lib/efl/native/elm/elm_flip.rb b/lib/efl/native/elm/elm_flip.rb new file mode 100644 index 0000000..a030330 --- /dev/null +++ b/lib/efl/native/elm/elm_flip.rb @@ -0,0 +1,62 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/elementary' +# +module Efl + # + module ElmFlip + # + FCT_PREFIX = 'elm_flip_' 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_Flip_Mode; + enum :elm_flip_mode, [ :elm_flip_rotate_y_center_axis, :elm_flip_rotate_x_center_axis, :elm_flip_rotate_xz_center_axis, + :elm_flip_rotate_yz_center_axis, :elm_flip_cube_left, :elm_flip_cube_right, :elm_flip_cube_up, :elm_flip_cube_down, :elm_flip_page_left, + :elm_flip_page_right, :elm_flip_page_up, :elm_flip_page_down ] + # typedef enum {...} Elm_Flip_Interaction; + enum :elm_flip_interaction, [ :elm_flip_interaction_none, :elm_flip_interaction_rotate, :elm_flip_interaction_cube, :elm_flip_interaction_page + ] + # typedef enum {...} Elm_Flip_Direction; + enum :elm_flip_direction, [ :elm_flip_direction_up, :elm_flip_direction_down, :elm_flip_direction_left, :elm_flip_direction_right ] + # + # FUNCTIONS + fcts = [ + # EAPI Evas_Object *elm_flip_add(Evas_Object *parent); + [ :elm_flip_add, [ :evas_object ], :evas_object ], + # EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y); + [ :elm_flip_perspective_set, [ :evas_object, :int, :int, :int ], :void ], + # EAPI void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode); + [ :elm_flip_go, [ :evas_object, :elm_flip_mode ], :void ], + # EAPI void elm_flip_interaction_set(Evas_Object *obj, Elm_Flip_Interaction mode); + [ :elm_flip_interaction_set, [ :evas_object, :elm_flip_interaction ], :void ], + # EAPI Elm_Flip_Interaction elm_flip_interaction_get(const Evas_Object *obj); + [ :elm_flip_interaction_get, [ :evas_object ], :elm_flip_interaction ], + # EAPI void elm_flip_interaction_direction_enabled_set(Evas_Object *obj, Elm_Flip_Direction dir, Eina_Bool enabled); + [ :elm_flip_interaction_direction_enabled_set, [ :evas_object, :elm_flip_direction, :bool ], :void ], + # EAPI Eina_Bool elm_flip_interaction_direction_enabled_get(Evas_Object *obj, Elm_Flip_Direction dir); + [ :elm_flip_interaction_direction_enabled_get, [ :evas_object, :elm_flip_direction ], :bool ], + # EAPI void elm_flip_interaction_direction_hitsize_set(Evas_Object *obj, Elm_Flip_Direction dir, double hitsize); + [ :elm_flip_interaction_direction_hitsize_set, [ :evas_object, :elm_flip_direction, :double ], :void ], + # EAPI double elm_flip_interaction_direction_hitsize_get(Evas_Object *obj, Elm_Flip_Direction dir); + [ :elm_flip_interaction_direction_hitsize_get, [ :evas_object, :elm_flip_direction ], :double ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/extract-api.sh b/tools/extract-api.sh index af7945b..ef99782 100755 --- a/tools/extract-api.sh +++ b/tools/extract-api.sh @@ -68,6 +68,7 @@ for header in \ "${INCLUDE}/elementary-0/elm_layout.h" \ "${INCLUDE}/elementary-0/elm_cursor.h" \ "${INCLUDE}/elementary-0/elm_notify.h" \ + "${INCLUDE}/elementary-0/elm_flip.h" \ ; do # if [ ! -e "$header" ]; then diff --git a/tools/genruby.rb b/tools/genruby.rb index f6980fb..fb402f6 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -460,6 +460,11 @@ libs << { :modname=>'ElmNotify', :prefix=>'elm_notify', :outfile=>'elm/elm_notify.rb', :requires=>["#{NATIVE}/elementary"], :constants=>[] } +libs << { + :lib=>ELM_LIB,:header=>'elm_flip.h', + :modname=>'ElmFlip', :prefix=>'elm_flip', :outfile=>'elm/elm_flip.rb', + :requires=>["#{NATIVE}/elementary"], :constants=>[] +} # Dir.mkdir lib_path unless (File.exists? lib_path) # -- cgit v1.1-2-g2b99