summaryrefslogtreecommitdiffstats
path: root/lib/efl/elm/elm_store.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-29 17:57:38 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-29 17:57:38 +0100
commitd13fa37a9b82920febb80805cd29f91e22684bc4 (patch)
treeb324714de21070344f62e773af92d669d0f1e169 /lib/efl/elm/elm_store.rb
parentb306e3f4a2352246eb8baf7d17a54a89bfd02893 (diff)
downloadffi-efl-d13fa37a9b82920febb80805cd29f91e22684bc4.zip
ffi-efl-d13fa37a9b82920febb80805cd29f91e22684bc4.tar.gz
parse elm_store.h, generate elm_store.rb
Diffstat (limited to 'lib/efl/elm/elm_store.rb')
-rw-r--r--lib/efl/elm/elm_store.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/efl/elm/elm_store.rb b/lib/efl/elm/elm_store.rb
new file mode 100644
index 0000000..625232a
--- /dev/null
+++ b/lib/efl/elm/elm_store.rb
@@ -0,0 +1,43 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl'
+require 'efl/native/elm/elm_store'
+#
+module Efl
+ #
+ module Elm
+ #
+ class ElmStore
+ #
+ include Efl::ClassHelper
+ search_prefixes 'elm_store_'
+ #
+ def initialize o=nil, &block
+ @ptr = (
+ case o
+ when NilClass
+ FFI::AutoPointer.new Native.elm_store_filesystem_new, ElmStore.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_store_free p
+ end
+ def free
+ @ptr.autorelease=false if @ptr.is_a? FFI::AutoPointer
+ ElmStore.release @ptr
+ @ptr=nil
+ end
+ #
+ end
+ #
+ end
+end
+#
+# EOF