diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-28 14:13:30 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-28 14:13:30 +0100 |
commit | 9317a29c12a0241c737f6ad62f55d25667aa5e95 (patch) | |
tree | da9de3069e0070384a39ab86cfaa15e28d73c82d | |
parent | ffd406e187f6f23862ddc53b2fb706969433f9c3 (diff) | |
download | ffi-efl-9317a29c12a0241c737f6ad62f55d25667aa5e95.zip ffi-efl-9317a29c12a0241c737f6ad62f55d25667aa5e95.tar.gz |
parse elm_theme.h, generate elm_theme.rb
-rw-r--r-- | lib/efl/elementary_all.rb | 2 | ||||
-rw-r--r-- | lib/efl/elm/elm_theme.rb | 42 | ||||
-rw-r--r-- | lib/efl/native/elm/elm_theme.rb | 81 | ||||
-rwxr-xr-x | tools/genruby.rb | 2 |
4 files changed, 125 insertions, 2 deletions
diff --git a/lib/efl/elementary_all.rb b/lib/efl/elementary_all.rb index 5b12bb6..ed1e1db 100644 --- a/lib/efl/elementary_all.rb +++ b/lib/efl/elementary_all.rb @@ -79,7 +79,7 @@ require 'efl/elm/elm_slideshow' require 'efl/elm/elm_spinner' #require 'efl/elm/elm_store' require 'efl/elm/elm_table' -#require 'efl/elm/elm_theme' +require 'efl/elm/elm_theme' #require 'efl/elm/elm_thumb' require 'efl/elm/elm_toolbar' #require 'efl/elm/elm_transit' diff --git a/lib/efl/elm/elm_theme.rb b/lib/efl/elm/elm_theme.rb new file mode 100644 index 0000000..27ff2fa --- /dev/null +++ b/lib/efl/elm/elm_theme.rb @@ -0,0 +1,42 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_object' +require 'efl/native/elm/elm_theme' +# +module Efl + # + module Elm + # + class ElmTheme < ElmObject + # + search_prefixes 'elm_theme_' + # + def initialize o=nil, &block + @ptr = ( + case o + when NilClass + FFI::AutoPointer.new Native.elm_theme_new, ElmTheme.method(:release) + when FFI::Pointer + o + else + raise ArgumentError.new "wrong argument #{o.class.name}" + end + ) + instance_eval &block if block + end + def self.release p + Native.elm_theme_free p + end + def free + @ptr.autorelease=false if @ptr.is_a? FFI::AutoPointer + ElmTheme.release @ptr + @ptr=nil + end + # + end + # + end +end +# +# EOF diff --git a/lib/efl/native/elm/elm_theme.rb b/lib/efl/native/elm/elm_theme.rb new file mode 100644 index 0000000..71e67c1 --- /dev/null +++ b/lib/efl/native/elm/elm_theme.rb @@ -0,0 +1,81 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/native' +require 'efl/native/elementary' +# +module Efl + # + module ElmTheme + # + FCT_PREFIX = 'elm_theme_' 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' + # + # TYPEDEFS + # typedef struct _Elm_Theme Elm_Theme; + typedef :pointer, :elm_theme + # + # FUNCTIONS + fcts = [ + # EAPI Elm_Theme *elm_theme_new(void); + [ :elm_theme_new, [ ], :elm_theme ], + # EAPI void elm_theme_free(Elm_Theme *th); + [ :elm_theme_free, [ :elm_theme ], :void ], + # EAPI void elm_theme_copy(Elm_Theme *th, Elm_Theme *thdst); + [ :elm_theme_copy, [ :elm_theme, :elm_theme ], :void ], + # EAPI void elm_theme_ref_set(Elm_Theme *th, Elm_Theme *thref); + [ :elm_theme_ref_set, [ :elm_theme, :elm_theme ], :void ], + # EAPI Elm_Theme *elm_theme_ref_get(Elm_Theme *th); + [ :elm_theme_ref_get, [ :elm_theme ], :elm_theme ], + # EAPI Elm_Theme *elm_theme_default_get(void); + [ :elm_theme_default_get, [ ], :elm_theme ], + # EAPI void elm_theme_overlay_add(Elm_Theme *th, const char *item); + [ :elm_theme_overlay_add, [ :elm_theme, :string ], :void ], + # EAPI void elm_theme_overlay_del(Elm_Theme *th, const char *item); + [ :elm_theme_overlay_del, [ :elm_theme, :string ], :void ], + # EAPI void elm_theme_extension_add(Elm_Theme *th, const char *item); + [ :elm_theme_extension_add, [ :elm_theme, :string ], :void ], + # EAPI void elm_theme_extension_del(Elm_Theme *th, const char *item); + [ :elm_theme_extension_del, [ :elm_theme, :string ], :void ], + # EAPI void elm_theme_set(Elm_Theme *th, const char *theme); + [ :elm_theme_set, [ :elm_theme, :string ], :void ], + # EAPI const char *elm_theme_get(Elm_Theme *th); + [ :elm_theme_get, [ :elm_theme ], :string ], + # EAPI const Eina_List *elm_theme_list_get(const Elm_Theme *th); + [ :elm_theme_list_get, [ :elm_theme ], :eina_list ], + # EAPI char *elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path); + [ :elm_theme_list_item_path_get, [ :string, :pointer ], :string ], + # EAPI void elm_theme_flush(Elm_Theme *th); + [ :elm_theme_flush, [ :elm_theme ], :void ], + # EAPI void elm_theme_full_flush(void); + [ :elm_theme_full_flush, [ ], :void ], + # EAPI void elm_theme_all_set(const char *theme); + [ :elm_theme_all_set, [ :string ], :void ], + # EAPI Eina_List *elm_theme_name_available_list_new(void); + [ :elm_theme_name_available_list_new, [ ], :eina_list ], + # EAPI void elm_theme_name_available_list_free(Eina_List *list); + [ :elm_theme_name_available_list_free, [ :eina_list ], :void ], + # EAPI void elm_object_theme_set(Evas_Object *obj, Elm_Theme *th); + [ :elm_object_theme_set, [ :evas_object, :elm_theme ], :void ], + # EAPI Elm_Theme *elm_object_theme_get(const Evas_Object *obj); + [ :elm_object_theme_get, [ :evas_object ], :elm_theme ], + # EAPI const char *elm_theme_data_get(Elm_Theme *th, const char *key); + [ :elm_theme_data_get, [ :elm_theme, :string ], :string ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF diff --git a/tools/genruby.rb b/tools/genruby.rb index 1ffa340..7cf96fd 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -435,7 +435,7 @@ libs << elm_h('elm_slideshow.h', 'ElmSlideshow') libs << elm_h('elm_spinner.h', 'ElmSpinner') #libs << elm_h('elm_store.h', 'ElmX') libs << elm_h('elm_table.h', 'ElmTable') -#libs << elm_h('elm_theme.h', 'ElmX') +libs << elm_h('elm_theme.h', 'ElmTheme') #libs << elm_h('elm_thumb.h', 'ElmX') libs << elm_h('elm_toolbar.h', 'ElmToolbar', ["#{NATIVE}/elementary","#{NATIVE}/elm/elm_icon"]) #libs << elm_h('elm_transit.h', 'ElmX') |