summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-28 15:27:49 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-28 15:27:49 +0100
commitca224d5771ab4ac5f902d5b5a6bbf4bb78e11f91 (patch)
treef453b781a1dffdb89b61f9f89cb0dcece90f3095
parentef0029be2eedf70fc7b9446e4643467e31c7b27b (diff)
downloadffi-efl-ca224d5771ab4ac5f902d5b5a6bbf4bb78e11f91.zip
ffi-efl-ca224d5771ab4ac5f902d5b5a6bbf4bb78e11f91.tar.gz
parse elm_fonts.h, generate elm_fonts.rb
-rw-r--r--lib/efl/elementary_all.rb1
-rw-r--r--lib/efl/native/elm/elm_fonts.rb65
-rwxr-xr-xtools/genruby.rb2
3 files changed, 66 insertions, 2 deletions
diff --git a/lib/efl/elementary_all.rb b/lib/efl/elementary_all.rb
index d0eaa77..337e4df 100644
--- a/lib/efl/elementary_all.rb
+++ b/lib/efl/elementary_all.rb
@@ -37,7 +37,6 @@ require 'efl/elm/elm_fileselector'
require 'efl/elm/elm_flip'
require 'efl/elm/elm_flipselector'
require 'efl/elm/elm_focus'
-#require 'efl/elm/elm_fonts'
require 'efl/elm/elm_frame'
#require 'efl/elm/elm_gengrid'
#require 'efl/elm/elm_genlist'
diff --git a/lib/efl/native/elm/elm_fonts.rb b/lib/efl/native/elm/elm_fonts.rb
new file mode 100644
index 0000000..1c5e985
--- /dev/null
+++ b/lib/efl/native/elm/elm_fonts.rb
@@ -0,0 +1,65 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/native'
+require 'efl/native/elementary'
+#
+module Efl
+ #
+ module ElmFonts
+ #
+ FCT_PREFIX = 'elm_fonts_' 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_Text_Class Elm_Text_Class;
+ typedef :pointer, :elm_text_class
+ # typedef struct _Elm_Font_Overlay Elm_Font_Overlay;
+ typedef :pointer, :elm_font_overlay
+ # typedef struct _Elm_Font_Properties Elm_Font_Properties;
+ typedef :pointer, :elm_font_properties
+ #
+ # FUNCTIONS
+ fcts = [
+ # EAPI Eina_List *elm_text_classes_list_get(void);
+ [ :elm_text_classes_list_get, [ ], :eina_list ],
+ # EAPI void elm_text_classes_list_free(Eina_List *list);
+ [ :elm_text_classes_list_free, [ :eina_list ], :void ],
+ # EAPI const Eina_List *elm_font_overlay_list_get(void);
+ [ :elm_font_overlay_list_get, [ ], :eina_list ],
+ # EAPI void elm_font_overlay_set(const char *text_class, const char *font, Evas_Font_Size size);
+ [ :elm_font_overlay_set, [ :string, :string, :int ], :void ],
+ # EAPI void elm_font_overlay_unset(const char *text_class);
+ [ :elm_font_overlay_unset, [ :string ], :void ],
+ # EAPI void elm_font_overlay_apply(void);
+ [ :elm_font_overlay_apply, [ ], :void ],
+ # EAPI Elm_Font_Properties *elm_font_properties_get(const char *font);
+ [ :elm_font_properties_get, [ :string ], :elm_font_properties ],
+ # EAPI void elm_font_properties_free(Elm_Font_Properties *efp);
+ [ :elm_font_properties_free, [ :elm_font_properties ], :void ],
+ # EAPI char *elm_font_fontconfig_name_get(const char *name, const char *style);
+ [ :elm_font_fontconfig_name_get, [ :string, :string ], :string ],
+ # EAPI void elm_font_fontconfig_name_free(char *name);
+ [ :elm_font_fontconfig_name_free, [ :string ], :void ],
+ # EAPI Eina_Hash *elm_font_available_hash_add(Eina_List *list);
+ [ :elm_font_available_hash_add, [ :eina_list ], :eina_hash ],
+ # EAPI void elm_font_available_hash_del(Eina_Hash *hash);
+ [ :elm_font_available_hash_del, [ :eina_hash ], :void ],
+ ]
+ #
+ attach_fcts fcts
+ #
+ end
+end
+#
+# EOF
diff --git a/tools/genruby.rb b/tools/genruby.rb
index 6cc8b7c..fba4746 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -397,7 +397,7 @@ libs << elm_h('elm_diskselector.h', 'ElmDiskSelector', ["#{NATIVE}/elementary","
libs << elm_h('elm_flip.h', 'ElmFlip')
libs << elm_h('elm_flipselector.h', 'ElmFlipSelector')
libs << elm_h('elm_focus.h', 'ElmFocus')
-#libs << elm_h('elm_fonts.h', 'ElmFonts')
+libs << elm_h('elm_fonts.h', 'ElmFonts')
libs << elm_h('elm_frame.h', 'ElmFrame')
#libs << elm_h('elm_gengrid.h', 'ElmGenGrid')
#libs << elm_h('elm_genlist.h', 'ElmGenList')