summaryrefslogtreecommitdiffstats
path: root/lib/efl/elm/elm_object.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-27 12:35:14 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-27 12:35:14 +0100
commit63df15daae7a3b86478d635128e814149918bb09 (patch)
treee76fbea0f1b0432ec17c105310d9928e420dfa06 /lib/efl/elm/elm_object.rb
parent7603f4c0902bf5845c7e7654c3745f5519347c8b (diff)
downloadffi-efl-63df15daae7a3b86478d635128e814149918bb09.zip
ffi-efl-63df15daae7a3b86478d635128e814149918bb09.tar.gz
add elementary,elementary_all,elm/elm_bg,elm/elm_label,elm/elm_object,elm/elm_win
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