diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-08-19 15:20:16 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-08-19 15:20:16 +0200 |
commit | 0112867934acf482154e8ac315e68ed3afbde5b7 (patch) | |
tree | 0e7f9711316ffaa9ffbf2ac6289228a5434150aa | |
parent | b1ee2a9864ac9dd37b9bfb291ceb761133ba5a5c (diff) | |
download | ffi-efl-0112867934acf482154e8ac315e68ed3afbde5b7.zip ffi-efl-0112867934acf482154e8ac315e68ed3afbde5b7.tar.gz |
elementary : add ElmRadio, ElmCheck, ElmSpinner classes, add ElmObject#parent_widget_get
-rw-r--r-- | lib/efl/elementary.rb | 266 |
1 files changed, 148 insertions, 118 deletions
diff --git a/lib/efl/elementary.rb b/lib/efl/elementary.rb index 817eb09..7cd1abf 100644 --- a/lib/efl/elementary.rb +++ b/lib/efl/elementary.rb @@ -86,42 +86,13 @@ module Efl Native.elm_object_content_part_unset @ptr, nil end # - end - # - class ElmWin < ElmObject - # - search_prefixes 'elm_win_' - # - def initialize parent, title, type=:elm_win_basic, &block - super Native.method(:elm_win_add), parent, title, type, &block - end - def inwin_add - ElmInWin.new @ptr - end - def screen_position_get - x = FFI::MemoryPointer.new :int - y = FFI::MemoryPointer.new :int - Native.elm_win_screen_position_get @ptr, x, y - [ x.read_int, y.read_int ] - end - alias :screen_position :screen_position_get - end - # - class ElmInWin < ElmObject - # - search_prefixes 'elm_win_inwin_', 'elm_win_' - # - def initialize parent, &block - super Native.method(:elm_win_inwin_add), parent, &block + def parent_widget_get + ElmObject.new Native.elm_object_parent_widget_get @ptr end + alias :parent_widget :parent_widget_get end # - class ElmFrame < ElmObject - # - include Helper - search_prefixes 'elm_frame_' - constructor :elm_frame_add - end + #################################################################################### # class ElmBg < ElmObject # @@ -146,18 +117,6 @@ module Efl alias :color :color_get end # - class ElmLayout < ElmObject - # - include Helper - constructor :elm_layout_add - search_prefixes 'elm_layout_' - # - def edje_get &block - Efl::Edje::REdje.new Native.method(:elm_layout_edje_get), @ptr, &block - end - alias :edje :edje_get - end - # class ElmBox < ElmObject # include Helper @@ -186,178 +145,249 @@ module Efl alias :children :children_get end # - class ElmToggle < ElmObject + class ElmButton < ElmObject # include Helper - constructor :elm_toggle_add - search_prefixes 'elm_toggle_' + constructor :elm_button_add + search_prefixes 'elm_button_' # end # - class ElmIndex < ElmObject + class ElmCheck < ElmObject # include Helper - constructor :elm_index_add - search_prefixes 'elm_index_' + constructor :elm_check_add + search_prefixes 'elm_check_' # end # - class ElmList < ElmObject + class ElmDiskSelector < ElmObject # include Helper - constructor :elm_list_add - search_prefixes 'elm_list_' + constructor :elm_diskselector_add + search_prefixes 'elm_diskselector_' # - def item_append label, left_icon=nil, right_icon=nil, cb=nil, data=nil - ElmListItem.new Native::elm_list_item_append @ptr, label, left_icon, right_icon, cb, data + def item_selected_set it, b + Native::elm_diskselector_item_selected_set it, b end + alias :item_selected= :item_selected_set end # - class ElmListItem < ElmObject + class ElmDiskSelectorItem < ElmObject # - search_prefixes 'elm_list_item_' + search_prefixes 'elm_diskselector_item_' # def data_get - Native::elm_list_item_data_get @ptr + Native::elm_diskselector_item_data_get @ptr end alias :data :data_get end # - class ElmIcon < ElmObject + class ElmEntry < ElmObject # include Helper - constructor :elm_icon_add - search_prefixes 'elm_icon_' + constructor :elm_entry_add + search_prefixes 'elm_entry_' # - def scale_set args - Native.elm_icon_scale_set @ptr, *args + end + # + class ElmFlipSelector < ElmObject + # + include Helper + constructor :elm_flipselector_add + search_prefixes 'elm_flipselector_' + # + def item_append label, cb, data + ElmFlipSelectorItem.new Native::elm_flipselector_item_append @ptr, label, cb, data end - alias :scale= :scale_set + # + def selected_item_get + ElmFlipSelectorItem.new Native::elm_flipselector_selected_item_get @ptr + end + alias :selected_item :selected_item_get end # - class ElmLabel < ElmObject + class ElmFlipSelectorItem < ElmObject + # + search_prefixes 'elm_flipselector_item_' + # + end + # + class ElmFrame < ElmObject # include Helper - constructor :elm_label_add - search_prefixes 'elm_label_' + search_prefixes 'elm_frame_' + constructor :elm_frame_add + end + # + class ElmGenlist < ElmObject + # + include Helper + constructor :elm_genlist_add + search_prefixes 'elm_genlist_' # end # - class ElmPager < ElmObject + class ElmHover < ElmObject # include Helper - constructor :elm_pager_add - search_prefixes 'elm_pager_' + constructor :elm_hover_add + search_prefixes 'elm_hover_' # end # - class ElmPanel < ElmObject + class ElmHoversel < ElmObject # include Helper - constructor :elm_panel_add - search_prefixes 'elm_panel_' + constructor :elm_hoversel_add + search_prefixes 'elm_hoversel_' # + def item_add label, icon_file=nil, icon_type=:elm_icon_none, cb=nil, data=nil + ElmHoverselItem.new Native::elm_hoversel_item_add @ptr, label, icon_file, icon_type, cb, data + end end # - class ElmDiskSelector < ElmObject + class ElmHoverselItem < ElmObject + # + search_prefixes 'elm_hoversel_item_' + # + end + # + class ElmIcon < ElmObject # include Helper - constructor :elm_diskselector_add - search_prefixes 'elm_diskselector_' + constructor :elm_icon_add + search_prefixes 'elm_icon_' # - def item_selected_set it, b - Native::elm_diskselector_item_selected_set it, b + def scale_set args + Native.elm_icon_scale_set @ptr, *args end - alias :item_selected= :item_selected_set + alias :scale= :scale_set end # - class ElmDiskSelectorItem < ElmObject + class ElmIndex < ElmObject # - search_prefixes 'elm_diskselector_item_' + include Helper + constructor :elm_index_add + search_prefixes 'elm_index_' # - def data_get - Native::elm_diskselector_item_data_get @ptr + end + # + class ElmInWin < ElmObject + # + search_prefixes 'elm_win_inwin_', 'elm_win_' + # + def initialize parent, &block + super Native.method(:elm_win_inwin_add), parent, &block end - alias :data :data_get end # - class ElmNotify < ElmObject + class ElmLabel < ElmObject # include Helper - constructor :elm_notify_add - search_prefixes 'elm_notify_' + constructor :elm_label_add + search_prefixes 'elm_label_' # end # - class ElmEntry < ElmObject + class ElmLayout < ElmObject # include Helper - constructor :elm_entry_add - search_prefixes 'elm_entry_' + constructor :elm_layout_add + search_prefixes 'elm_layout_' # + def edje_get &block + Efl::Edje::REdje.new Native.method(:elm_layout_edje_get), @ptr, &block + end + alias :edje :edje_get end # - class ElmFlipSelector < ElmObject + class ElmList < ElmObject # include Helper - constructor :elm_flipselector_add - search_prefixes 'elm_flipselector_' + constructor :elm_list_add + search_prefixes 'elm_list_' # - def item_append label, cb, data - ElmFlipSelectorItem.new Native::elm_flipselector_item_append @ptr, label, cb, data + def item_append label, left_icon=nil, right_icon=nil, cb=nil, data=nil + ElmListItem.new Native::elm_list_item_append @ptr, label, left_icon, right_icon, cb, data end + end + # + class ElmListItem < ElmObject # - def selected_item_get - ElmFlipSelectorItem.new Native::elm_flipselector_selected_item_get @ptr + search_prefixes 'elm_list_item_' + # + def data_get + Native::elm_list_item_data_get @ptr end - alias :selected_item :selected_item_get + alias :data :data_get end # - class ElmFlipSelectorItem < ElmObject + class ElmNotify < ElmObject # - search_prefixes 'elm_flipselector_item_' + include Helper + constructor :elm_notify_add + search_prefixes 'elm_notify_' # end # - class ElmHoversel < ElmObject + class ElmPager < ElmObject # include Helper - constructor :elm_hoversel_add - search_prefixes 'elm_hoversel_' + constructor :elm_pager_add + search_prefixes 'elm_pager_' # - def item_add label, icon_file=nil, icon_type=:elm_icon_none, cb=nil, data=nil - ElmHoverselItem.new Native::elm_hoversel_item_add @ptr, label, icon_file, icon_type, cb, data - end end # - class ElmHoverselItem < ElmObject + class ElmPanel < ElmObject # - search_prefixes 'elm_hoversel_item_' + include Helper + constructor :elm_panel_add + search_prefixes 'elm_panel_' # end # - class ElmHover < ElmObject + class ElmRadio < ElmObject # include Helper - constructor :elm_hover_add - search_prefixes 'elm_hover_' + constructor :elm_radio_add + search_prefixes 'elm_radio_' # end # - class ElmButton < ElmObject + class ElmSpinner < ElmObject # include Helper - constructor :elm_button_add - search_prefixes 'elm_button_' + constructor :elm_spinner_add + search_prefixes 'elm_spinner_' # end # - class ElmGenlist < ElmObject + class ElmToggle < ElmObject # include Helper - constructor :elm_genlist_add - search_prefixes 'elm_genlist_' + constructor :elm_toggle_add + search_prefixes 'elm_toggle_' + # + end + # + class ElmWin < ElmObject # + search_prefixes 'elm_win_' + # + def initialize parent, title, type=:elm_win_basic, &block + super Native.method(:elm_win_add), parent, title, type, &block + end + def inwin_add + ElmInWin.new @ptr + end + def screen_position_get + x = FFI::MemoryPointer.new :int + y = FFI::MemoryPointer.new :int + Native.elm_win_screen_position_get @ptr, x, y + [ x.read_int, y.read_int ] + end + alias :screen_position :screen_position_get end # end |