summaryrefslogtreecommitdiffstats
path: root/lib/efl/elm/elm_object.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-27 15:48:45 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-27 15:48:45 +0100
commitef44077310b4ebf8d3cb31ccb57d15b96a94c9d3 (patch)
treec2bb690ccc1be37c03f6dcdcf892fbf3e17f5067 /lib/efl/elm/elm_object.rb
parentdbb2c5713e11489dfaeb318a82785017f1794dde (diff)
parentb030c490265bb13ee98a650da419a033495042ed (diff)
downloadffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.zip
ffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.tar.gz
Merge branch 'wip'
Conflicts: tools/genruby.rb
Diffstat (limited to 'lib/efl/elm/elm_object.rb')
-rw-r--r--lib/efl/elm/elm_object.rb68
1 files changed, 68 insertions, 0 deletions
diff --git a/lib/efl/elm/elm_object.rb b/lib/efl/elm/elm_object.rb
new file mode 100644
index 0000000..f640da5
--- /dev/null
+++ b/lib/efl/elm/elm_object.rb
@@ -0,0 +1,68 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/elementary'
+require 'efl/native/elm/elm_object'
+#
+module Efl
+ #
+ module Elm
+ #
+ module Helper
+ def self.included kls
+ def kls.constructor meth
+ self.class_eval <<-EOF
+ def initialize ptr, &block
+ if ptr.is_a? FFI::Pointer
+ super ptr, &block
+ else
+ super Native.method(:#{meth}), ptr, &block
+ end
+ end
+ EOF
+ end
+ end
+ end
+ #
+ class ElmObject < Efl::Evas::REvasObject
+ #
+ search_prefixes 'elm_object_'
+ #
+ def smart_callback_add event_str, cb, data=FFI::MemoryPointer::NULL
+ Native.evas_object_smart_callback_add @ptr, event_str, cb, data
+ end
+ #
+ def text_set label
+ Native.elm_object_part_text_set @ptr, nil, label
+ end
+ alias :text= :text_set
+ #
+ def text_get
+ Native.elm_object_part_text_get @ptr, nil
+ end
+ alias :text :text_get
+ #
+ def content_set content
+ Native.elm_object_part_content_set @ptr, nil, content
+ end
+ alias :content= :content_set
+ #
+ def content_get
+ Native.elm_object_part_content_get @ptr, nil
+ end
+ alias :content :content_get
+ #
+ def content_unset
+ Native.elm_object_part_content_unset @ptr, nil
+ end
+ #
+ def parent_widget_get
+ ElmObject.new Native.elm_object_parent_widget_get @ptr
+ end
+ alias :parent_widget :parent_widget_get
+ end
+ #
+ end
+end
+#
+# EOF