summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-08-18 16:51:46 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-08-18 16:51:46 +0200
commitfe2367d72fcd74f52b7c8bb4790e3225f6fd0c04 (patch)
tree1d7e51f6a7be1d2e810d8f5cf6636779d78d0d17
parent03939509730e9e9518d692d206e1525f683507c4 (diff)
downloadffi-efl-fe2367d72fcd74f52b7c8bb4790e3225f6fd0c04.zip
ffi-efl-fe2367d72fcd74f52b7c8bb4790e3225f6fd0c04.tar.gz
add test/test_elementary.rb (full menu without tests)
-rw-r--r--test/test_elementary.rb243
1 files changed, 243 insertions, 0 deletions
diff --git a/test/test_elementary.rb b/test/test_elementary.rb
new file mode 100644
index 0000000..a6af9ca
--- /dev/null
+++ b/test/test_elementary.rb
@@ -0,0 +1,243 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl'
+#
+include Efl;
+#
+TESTS = [
+ [ 'Bg Plain', :test_bg_plain ],
+ [ 'Bg Image', :test_bg_image ],
+ [ 'Bg Options', :test_bg_options ],
+ [ 'Icon Transparent', :test_icon ],
+ [ 'Icon Animation', :test_icon_animated ],
+ [ 'Box Vert', :test_box_vert ],
+ [ 'Box Vert 2', :test_box_vert2 ],
+ [ 'Box Horiz', :test_box_horiz ],
+ [ 'Box Transition', :test_box_transition ],
+ [ 'Buttons', :test_button ],
+ [ 'Transit', :test_transit ],
+ [ 'Transit 2', :test_transit2 ],
+ [ 'Transit 3', :test_transit3 ],
+ [ 'Transit 4', :test_transit4 ],
+ [ 'Transit 5', :test_transit5 ],
+ [ 'Transit 6', :test_transit6 ],
+ [ 'Transit 7', :test_transit7 ],
+ [ 'Transit 8', :test_transit8 ],
+ [ 'Transit 9', :test_transit9 ],
+ [ 'File Selector Button', :test_fileselector_button ],
+ [ 'File Selector Entry', :test_fileselector_entry ],
+ [ 'Toggles', :test_toggle ],
+ [ 'Table', :test_table ],
+ [ 'Table Homogeneous', :test_table2 ],
+ [ 'Table 3', :test_table3 ],
+ [ 'Table 4', :test_table4 ],
+ [ 'Table 5', :test_table5 ],
+ [ 'Table 6', :test_table6 ],
+ [ 'Clock', :test_clock ],
+ [ 'Clock 2', :test_clock2 ],
+ [ 'Layout', :test_layout ],
+ [ 'Hover', :test_hover ],
+ [ 'Hover 2', :test_hover2 ],
+ [ 'Entry', :test_entry ],
+ [ 'Entry Scrolled', :test_entry_scrolled ],
+ [ 'Entry 3', :test_entry3 ],
+ [ 'Entry 4', :test_entry4 ],
+ [ 'Entry 5', :test_entry5 ],
+ [ 'Entry Notepad', :test_entry_notepad ],
+ [ 'Anchorview', :test_anchorview ],
+ [ 'Anchorblock', :test_anchorblock ],
+ [ 'Toolbar', :test_toolbar ],
+ [ 'Toolbar 2', :test_toolbar2 ],
+ [ 'Toolbar 3', :test_toolbar3 ],
+ [ 'Toolbar 4', :test_toolbar4 ],
+ [ 'Toolbar 5', :test_toolbar5 ],
+ [ 'Toolbar 6', :test_toolbar6 ],
+ [ 'Hoversel', :test_hoversel ],
+ [ 'List', :test_list ],
+ [ 'List - Horizontal', :test_list_horizontal ],
+ [ 'List 2', :test_list2 ],
+ [ 'List 3', :test_list3 ],
+ [ 'List 4', :test_list4 ],
+ [ 'List 5', :test_list5 ],
+ [ 'Inwin', :test_inwin ],
+ [ 'Inwin 2', :test_inwin2 ],
+ [ 'Scaling', :test_scaling ],
+ [ 'Scaling 2', :test_scaling2 ],
+ [ 'Slider', :test_slider ],
+ [ 'Actionslider', :test_actionslider ],
+ [ 'Genlist', :test_genlist ],
+ [ 'Genlist 2', :test_genlist2 ],
+ [ 'Genlist 3', :test_genlist3 ],
+ [ 'Genlist 4', :test_genlist4 ],
+ [ 'Genlist 5', :test_genlist5 ],
+ [ 'Genlist 7', :test_genlist7 ],
+ [ 'Genlist Tree', :test_genlist6 ],
+ [ 'Genlist Group', :test_genlist8 ],
+ [ 'Genlist Group Tree', :test_genlist9 ],
+ [ 'Genlist Mode', :test_genlist10 ],
+ [ 'Genlist Reorder Mode', :test_genlist11 ],
+ [ 'Genlist Eio', :test_eio ],
+ [ 'GenGrid', :test_gengrid ],
+ [ 'GenGrid 2', :test_gengrid2 ],
+ [ 'Checks', :test_check ],
+ [ 'Radios', :test_radio ],
+ [ 'Pager', :test_pager ],
+ [ 'Pager Slide', :test_pager_slide ],
+ [ 'Window States', :test_win_state ],
+ [ 'Window States 2', :test_win_state2 ],
+ [ 'Progressbar', :test_progressbar ],
+ [ 'File Selector', :test_fileselector ],
+ [ 'Separator', :test_separator ],
+ [ 'Scroller', :test_scroller ],
+ [ 'Scroller 2', :test_scroller2 ],
+ [ 'Spinner', :test_spinner ],
+ [ 'Index', :test_index ],
+ [ 'Index 2', :test_index2 ],
+ [ 'Photocam', :test_photocam ],
+ [ 'Photo', :test_photo ],
+ [ 'Thumb', :test_thumb ],
+ [ 'Icon Desktops', :test_icon_desktops ],
+ [ 'Notify', :test_notify ],
+ [ 'Slideshow', :test_slideshow ],
+ [ 'Menu', :test_menu ],
+ [ 'Panel', :test_panel ],
+ [ 'Panes', :test_panes ],
+ [ 'Map', :test_map ],
+ [ 'Weather', :test_weather ],
+ [ 'Flip', :test_flip ],
+ [ 'Flip 2', :test_flip2 ],
+ [ 'Flip 3', :test_flip3 ],
+ [ 'Flip Interactive', :test_flip4 ],
+ [ 'Flip Page', :test_flip_page ],
+ [ 'Label', :test_label ],
+ [ 'Conformant', :test_conformant ],
+ [ 'Conformant 2', :test_conformant2 ],
+ [ 'Multi Touch', :test_multi ],
+ [ 'Floating Objects', :test_floating ],
+ [ 'Launcher', :test_launcher ],
+ [ 'Launcher 2', :test_launcher2 ],
+ [ 'Launcher 3', :test_launcher3 ],
+ [ 'Animation', :test_anim ],
+ [ 'Calendar', :test_calendar ],
+ [ 'Calendar 2', :test_calendar2 ],
+ [ 'Tooltip', :test_tooltip ],
+ [ 'Tooltip2', :test_tooltip2 ],
+ [ 'Cursor', :test_cursor ],
+ [ 'Cursor 2', :test_cursor2 ],
+ [ 'Cursor 3', :test_cursor3 ],
+ [ 'Focus', :test_focus ],
+ [ 'Focus 2', :test_focus2 ],
+ [ 'Focus 3', :test_focus3 ],
+ [ 'Flip Selector', :test_flipselector ],
+ [ 'Disk Selector', :test_diskselector ],
+ [ 'Color Selector', :test_colorselector ],
+ [ 'Ctxpopup', :test_ctxpopup ],
+ [ 'Bubble', :test_bubble ],
+ [ 'Segment Control', :test_segment_control ],
+ [ 'Store', :test_store ],
+ [ 'Window Inline', :test_win_inline ],
+ [ 'Grid', :test_grid ],
+ [ 'GLViewSimple', :test_glview_simple ],
+ [ 'GLView', :test_glview ],
+ [ '3D', :test_3d ],
+ [ 'Gesture Layer', :test_gesture_layer ],
+ [ 'Naviframe', :test_naviframe ],
+ [ 'Factory', :test_factory ],
+]
+#
+class TestWin < Elm::ElmWin
+ #
+ def initialize name, title
+ super FFI::MemoryPointer::NULL, name
+ title = title
+ feed
+ smart_callback_add 'delete,request', method(:on_delete)
+ end
+ #
+ def feed
+ @bg = Elm::ElmBg.new self do |bg|
+ bg.size_hint_weight_expand
+ resize_object_add bg
+ bg.show
+ end
+ @bx0 = Elm::ElmBox.new self do |bx|
+ bx.size_hint_weight_expand
+ resize_object_add bx
+ bx.show
+ end
+ @fr = Elm::ElmFrame.new self do |fr|
+ fr.text = 'Information'
+ @bx0.pack_end fr
+ fr.show
+ end
+ Elm::ElmLabel.new self do |lb|
+ lb.text = 'Please select a test from the list below<br>by clicking the test button to show the<br>test window.'
+ @fr.content = lb
+ lb.show
+ end
+ Elm::ElmToggle.new self do |tg|
+ tg.text = 'UI-Mirroring:'
+ tg.state = Native.elm_mirrored_get
+ tg.smart_callback_add 'changed', method(:tg_changed)
+ @bx0.pack_end tg
+ tg.show
+ end
+ @li = Elm::ElmList.new self do |li|
+ li.always_select_mode = true
+ li.size_hint_weight_expand
+ li.size_hint_align_set_fill
+ @bx0.pack_end li
+ li.show
+ end
+ @idx = Elm::ElmIndex.new self do |idx|
+ idx.smart_callback_add 'delay,changed', method(:index_changed)
+ idx.size_hint_weight_expand
+ resize_object_add idx
+ idx.show
+ end
+ ch = nil
+ TESTS.each do |l,m|
+ it = @li.item_append l, nil, nil, method(:fake)
+ if l[0]!=ch
+ ch = l[0]
+ @idx.item_append ch, it
+ end
+ end
+ @idx.item_go 0
+ @li.go
+ end
+ #
+ def fake data, evas_obj, event_info
+ puts 'FAKE'
+ end
+ #
+ def tg_changed data, evas_obj, event_info
+ Native.elm_mirrored_set Native.elm_toggle_state_get evas_obj
+ end
+ #
+ def index_changed data, evas_obj, event_info
+ Native.elm_list_item_show event_info
+ end
+ #
+ def on_delete data, evas_object, event_info
+ Elm.exit
+ end
+end
+#
+def elm_main
+ win = TestWin.new 'test_elementare', 'Elementary Tests'
+ win.evas_object_resize 320, 480
+ win.show
+end
+#
+Elm.init
+#
+Native.elm_app_info_set elm_main, 'elementary', 'images/logo.png'
+Native.elm_app_compile_bin_dir_set PACKAGE_BIN_DIR
+Native.elm_app_compile_data_dir_set PACKAGE_DATA_DIR
+#
+Elm.run
+Elm.shutdown
+#
+# EOF