First commit. EAIL ver. 1.0.0
authorMichał Knapiński <mknapinski@mknapinski-GA-MA78GM-US2H.(none)>
Fri, 20 Sep 2013 10:56:54 +0000 (12:56 +0200)
committerMichał Knapiński <mknapinski@mknapinski-GA-MA78GM-US2H.(none)>
Fri, 20 Sep 2013 10:56:54 +0000 (12:56 +0200)
314 files changed:
eail.spec [new file with mode: 0644]
eail/.gitignore [new file with mode: 0644]
eail/AUTHORS [new file with mode: 0644]
eail/COPYING [new file with mode: 0644]
eail/ChangeLog [new file with mode: 0644]
eail/Makefile.am [new file with mode: 0644]
eail/Makefile.am.mod [new file with mode: 0644]
eail/NEWS [new file with mode: 0644]
eail/README [new file with mode: 0644]
eail/autogen.sh [new file with mode: 0755]
eail/configure.ac [new file with mode: 0644]
eail/configure.ac.mod [new file with mode: 0644]
eail/doc/Doxyfile [new file with mode: 0644]
eail/doc/Makefile.am [new file with mode: 0644]
eail/doc/images/eail_component_diagram.png [new file with mode: 0644]
eail/doc/images/eail_get_root_flow.png [new file with mode: 0644]
eail/doc/images/eail_ref_window_child_flow.png [new file with mode: 0644]
eail/eail.pc.in [new file with mode: 0644]
eail/eail/Makefile.am [new file with mode: 0644]
eail/eail/Makefile.am.mod [new file with mode: 0644]
eail/eail/eail.c [new file with mode: 0644]
eail/eail/eail.h [new file with mode: 0644]
eail/eail/eail_action_slider.c [new file with mode: 0644]
eail/eail/eail_action_slider.h [new file with mode: 0644]
eail/eail/eail_action_widget.c [new file with mode: 0644]
eail/eail/eail_action_widget.h [new file with mode: 0644]
eail/eail/eail_app.c [new file with mode: 0644]
eail/eail/eail_app.h [new file with mode: 0644]
eail/eail/eail_background.c [new file with mode: 0644]
eail/eail/eail_background.h [new file with mode: 0644]
eail/eail/eail_box.c [new file with mode: 0644]
eail/eail/eail_box.h [new file with mode: 0644]
eail/eail/eail_bubble.c [new file with mode: 0644]
eail/eail/eail_bubble.h [new file with mode: 0644]
eail/eail/eail_button.c [new file with mode: 0644]
eail/eail/eail_button.h [new file with mode: 0644]
eail/eail/eail_calendar.c [new file with mode: 0644]
eail/eail/eail_calendar.h [new file with mode: 0644]
eail/eail/eail_check.c [new file with mode: 0644]
eail/eail/eail_check.h [new file with mode: 0644]
eail/eail/eail_clipboard.c [new file with mode: 0644]
eail/eail/eail_clipboard.h [new file with mode: 0644]
eail/eail/eail_clock.c [new file with mode: 0644]
eail/eail/eail_clock.h [new file with mode: 0644]
eail/eail/eail_colorselector.c [new file with mode: 0644]
eail/eail/eail_colorselector.h [new file with mode: 0644]
eail/eail/eail_conformant.c [new file with mode: 0644]
eail/eail/eail_conformant.h [new file with mode: 0644]
eail/eail/eail_ctxpopup.c [new file with mode: 0644]
eail/eail/eail_ctxpopup.h [new file with mode: 0644]
eail/eail/eail_datetime.c [new file with mode: 0644]
eail/eail/eail_datetime.h [new file with mode: 0644]
eail/eail/eail_dayselector.c [new file with mode: 0644]
eail/eail/eail_dayselector.h [new file with mode: 0644]
eail/eail/eail_diskselector.c [new file with mode: 0644]
eail/eail/eail_diskselector.h [new file with mode: 0644]
eail/eail/eail_dynamic_content.c [new file with mode: 0644]
eail/eail/eail_dynamic_content.h [new file with mode: 0644]
eail/eail/eail_entry.c [new file with mode: 0644]
eail/eail/eail_entry.h [new file with mode: 0644]
eail/eail/eail_factory.c [new file with mode: 0644]
eail/eail/eail_factory.h [new file with mode: 0644]
eail/eail/eail_fileselector.c [new file with mode: 0644]
eail/eail/eail_fileselector.h [new file with mode: 0644]
eail/eail/eail_fileselector_entry.c [new file with mode: 0644]
eail/eail/eail_fileselector_entry.h [new file with mode: 0644]
eail/eail/eail_flip.c [new file with mode: 0644]
eail/eail/eail_flip.h [new file with mode: 0644]
eail/eail/eail_flipselector.c [new file with mode: 0644]
eail/eail/eail_flipselector.h [new file with mode: 0644]
eail/eail/eail_frame.c [new file with mode: 0644]
eail/eail/eail_frame.h [new file with mode: 0644]
eail/eail/eail_gengrid.c [new file with mode: 0644]
eail/eail/eail_gengrid.h [new file with mode: 0644]
eail/eail/eail_genlist.c [new file with mode: 0644]
eail/eail/eail_genlist.h [new file with mode: 0644]
eail/eail/eail_glview.c [new file with mode: 0644]
eail/eail/eail_glview.h [new file with mode: 0644]
eail/eail/eail_grid.c [new file with mode: 0644]
eail/eail/eail_grid.h [new file with mode: 0644]
eail/eail/eail_hover.c [new file with mode: 0644]
eail/eail/eail_hover.h [new file with mode: 0644]
eail/eail/eail_hoversel.c [new file with mode: 0644]
eail/eail/eail_hoversel.h [new file with mode: 0644]
eail/eail/eail_icon.c [new file with mode: 0644]
eail/eail/eail_icon.h [new file with mode: 0644]
eail/eail/eail_image.c [new file with mode: 0644]
eail/eail/eail_image.h [new file with mode: 0644]
eail/eail/eail_index.c [new file with mode: 0644]
eail/eail/eail_index.h [new file with mode: 0644]
eail/eail/eail_inwin.c [new file with mode: 0644]
eail/eail/eail_inwin.h [new file with mode: 0644]
eail/eail/eail_item.c [new file with mode: 0644]
eail/eail/eail_item.h [new file with mode: 0644]
eail/eail/eail_item_parent.c [new file with mode: 0644]
eail/eail/eail_item_parent.h [new file with mode: 0644]
eail/eail/eail_label.c [new file with mode: 0644]
eail/eail/eail_label.h [new file with mode: 0644]
eail/eail/eail_layout.c [new file with mode: 0644]
eail/eail/eail_layout.h [new file with mode: 0644]
eail/eail/eail_list.c [new file with mode: 0644]
eail/eail/eail_list.h [new file with mode: 0644]
eail/eail/eail_map.c [new file with mode: 0644]
eail/eail/eail_map.h [new file with mode: 0644]
eail/eail/eail_mapbuf.c [new file with mode: 0644]
eail/eail/eail_mapbuf.h [new file with mode: 0644]
eail/eail/eail_menu.c [new file with mode: 0644]
eail/eail/eail_menu.h [new file with mode: 0644]
eail/eail/eail_multibuttonentry.c [new file with mode: 0644]
eail/eail/eail_multibuttonentry.h [new file with mode: 0644]
eail/eail/eail_naviframe.c [new file with mode: 0644]
eail/eail/eail_naviframe.h [new file with mode: 0644]
eail/eail/eail_naviframe_page.c [new file with mode: 0644]
eail/eail/eail_naviframe_page.h [new file with mode: 0644]
eail/eail/eail_notify.c [new file with mode: 0644]
eail/eail/eail_notify.h [new file with mode: 0644]
eail/eail/eail_panel.c [new file with mode: 0644]
eail/eail/eail_panel.h [new file with mode: 0644]
eail/eail/eail_panes.c [new file with mode: 0644]
eail/eail/eail_panes.h [new file with mode: 0644]
eail/eail/eail_photo.c [new file with mode: 0644]
eail/eail/eail_photo.h [new file with mode: 0644]
eail/eail/eail_photocam.c [new file with mode: 0644]
eail/eail/eail_photocam.h [new file with mode: 0644]
eail/eail/eail_plug.c [new file with mode: 0644]
eail/eail/eail_plug.h [new file with mode: 0644]
eail/eail/eail_popup.c [new file with mode: 0644]
eail/eail/eail_popup.h [new file with mode: 0644]
eail/eail/eail_prefs.c [new file with mode: 0644]
eail/eail/eail_prefs.h [new file with mode: 0644]
eail/eail/eail_priv.h [new file with mode: 0644]
eail/eail/eail_progressbar.c [new file with mode: 0644]
eail/eail/eail_progressbar.h [new file with mode: 0644]
eail/eail/eail_radio_button.c [new file with mode: 0644]
eail/eail/eail_radio_button.h [new file with mode: 0644]
eail/eail/eail_route.c [new file with mode: 0644]
eail/eail/eail_route.h [new file with mode: 0644]
eail/eail/eail_scrollable_widget.c [new file with mode: 0644]
eail/eail/eail_scrollable_widget.h [new file with mode: 0644]
eail/eail/eail_scroller.c [new file with mode: 0644]
eail/eail/eail_scroller.h [new file with mode: 0644]
eail/eail/eail_segment_control.c [new file with mode: 0644]
eail/eail/eail_segment_control.h [new file with mode: 0644]
eail/eail/eail_separator.c [new file with mode: 0644]
eail/eail/eail_separator.h [new file with mode: 0644]
eail/eail/eail_slider.c [new file with mode: 0644]
eail/eail/eail_slider.h [new file with mode: 0644]
eail/eail/eail_slideshow.c [new file with mode: 0644]
eail/eail/eail_slideshow.h [new file with mode: 0644]
eail/eail/eail_spinner.c [new file with mode: 0644]
eail/eail/eail_spinner.h [new file with mode: 0644]
eail/eail/eail_table.c [new file with mode: 0644]
eail/eail/eail_table.h [new file with mode: 0644]
eail/eail/eail_text.c [new file with mode: 0644]
eail/eail/eail_text.h [new file with mode: 0644]
eail/eail/eail_thumb.c [new file with mode: 0644]
eail/eail/eail_thumb.h [new file with mode: 0644]
eail/eail/eail_toolbar.c [new file with mode: 0644]
eail/eail/eail_toolbar.h [new file with mode: 0644]
eail/eail/eail_utils.c [new file with mode: 0644]
eail/eail/eail_utils.h [new file with mode: 0644]
eail/eail/eail_video.c [new file with mode: 0644]
eail/eail/eail_video.h [new file with mode: 0644]
eail/eail/eail_web.c [new file with mode: 0644]
eail/eail/eail_web.h [new file with mode: 0644]
eail/eail/eail_widget.c [new file with mode: 0644]
eail/eail/eail_widget.h [new file with mode: 0644]
eail/eail/eail_window.c [new file with mode: 0644]
eail/eail/eail_window.h [new file with mode: 0644]
eail/tests/Makefile.am [new file with mode: 0644]
eail/tests/data/01.jpg [new file with mode: 0644]
eail/tests/data/02.jpg [new file with mode: 0644]
eail/tests/data/03.jpg [new file with mode: 0644]
eail/tests/data/04.jpg [new file with mode: 0644]
eail/tests/data/05.jpg [new file with mode: 0644]
eail/tests/data/06.jpg [new file with mode: 0644]
eail/tests/data/07.jpg [new file with mode: 0644]
eail/tests/data/08.jpg [new file with mode: 0644]
eail/tests/data/09.jpg [new file with mode: 0644]
eail/tests/data/plant_01.jpg [new file with mode: 0644]
eail/tests/data/prefs_example_02.cfg [new file with mode: 0644]
eail/tests/data/prefs_example_02.cfg.bkp [new file with mode: 0644]
eail/tests/data/prefs_example_02.epb [new file with mode: 0644]
eail/tests/data/prefs_example_02.epc [new file with mode: 0644]
eail/tests/data/pt.png [new file with mode: 0644]
eail/tests/data/small-01.jpg [new file with mode: 0644]
eail/tests/data/softboy.avi [new file with mode: 0644]
eail/tests/data/test.edj [new file with mode: 0644]
eail/tests/data/th-whiterabbit01.jpg [new file with mode: 0644]
eail/tests/data/whiterabbit01.jpg [new file with mode: 0644]
eail/tests/eail_action_slider_tc1.c [new file with mode: 0644]
eail/tests/eail_action_slider_tc2.c [new file with mode: 0644]
eail/tests/eail_background_tc1.c [new file with mode: 0644]
eail/tests/eail_background_tc2.c [new file with mode: 0644]
eail/tests/eail_bubble_tc1.c [new file with mode: 0644]
eail/tests/eail_bubble_tc2.c [new file with mode: 0644]
eail/tests/eail_button_tc1.c [new file with mode: 0644]
eail/tests/eail_button_tc2.c [new file with mode: 0644]
eail/tests/eail_button_tc3.c [new file with mode: 0644]
eail/tests/eail_button_tc4.c [new file with mode: 0644]
eail/tests/eail_calendar_tc1.c [new file with mode: 0644]
eail/tests/eail_calendar_tc2.c [new file with mode: 0644]
eail/tests/eail_calendar_test.c [new file with mode: 0644]
eail/tests/eail_check_tc1.c [new file with mode: 0644]
eail/tests/eail_check_tc2.c [new file with mode: 0644]
eail/tests/eail_clock_tc1.c [new file with mode: 0644]
eail/tests/eail_colorselector_tc1.c [new file with mode: 0644]
eail/tests/eail_colorselector_tc2.c [new file with mode: 0644]
eail/tests/eail_conformant_tc1.c [new file with mode: 0644]
eail/tests/eail_ctxpopup_tc1.c [new file with mode: 0644]
eail/tests/eail_ctxpopup_tc2.c [new file with mode: 0644]
eail/tests/eail_datetime_tc1.c [new file with mode: 0644]
eail/tests/eail_datetime_tc2.c [new file with mode: 0644]
eail/tests/eail_dayselector_tc1.c [new file with mode: 0644]
eail/tests/eail_diskselector_tc1.c [new file with mode: 0644]
eail/tests/eail_diskselector_tc2.c [new file with mode: 0644]
eail/tests/eail_diskselector_tc3.c [new file with mode: 0644]
eail/tests/eail_entry_tc1.c [new file with mode: 0644]
eail/tests/eail_entry_tc2.c [new file with mode: 0644]
eail/tests/eail_entry_tc3.c [new file with mode: 0644]
eail/tests/eail_file_selector_button_tc1.c [new file with mode: 0644]
eail/tests/eail_file_selector_entry_tc1.c [new file with mode: 0644]
eail/tests/eail_fileselector_tc1.c [new file with mode: 0644]
eail/tests/eail_flip_tc1.c [new file with mode: 0644]
eail/tests/eail_flip_tc2.c [new file with mode: 0644]
eail/tests/eail_flipselector_tc1.c [new file with mode: 0644]
eail/tests/eail_flipselector_tc2.c [new file with mode: 0644]
eail/tests/eail_flipselector_tc3.c [new file with mode: 0644]
eail/tests/eail_focus_test.c [new file with mode: 0644]
eail/tests/eail_gengrid_tc1.c [new file with mode: 0644]
eail/tests/eail_gengrid_tc2.c [new file with mode: 0644]
eail/tests/eail_gengrid_tc3.c [new file with mode: 0644]
eail/tests/eail_genlist_tc1.c [new file with mode: 0644]
eail/tests/eail_genlist_tc2.c [new file with mode: 0644]
eail/tests/eail_genlist_tc3.c [new file with mode: 0644]
eail/tests/eail_glview_tc1.c [new file with mode: 0644]
eail/tests/eail_grid_tc1.c [new file with mode: 0644]
eail/tests/eail_hover_tc1.c [new file with mode: 0644]
eail/tests/eail_hover_tc2.c [new file with mode: 0644]
eail/tests/eail_hoversel_tc1.c [new file with mode: 0644]
eail/tests/eail_hoversel_tc2.c [new file with mode: 0644]
eail/tests/eail_icon_tc1.c [new file with mode: 0644]
eail/tests/eail_icon_tc2.c [new file with mode: 0644]
eail/tests/eail_icon_tc3.c [new file with mode: 0644]
eail/tests/eail_image_tc1.c [new file with mode: 0644]
eail/tests/eail_image_tc2.c [new file with mode: 0644]
eail/tests/eail_image_tc3.c [new file with mode: 0644]
eail/tests/eail_index_tc1.c [new file with mode: 0644]
eail/tests/eail_inwin_tc1.c [new file with mode: 0644]
eail/tests/eail_label_tc1.c [new file with mode: 0644]
eail/tests/eail_label_tc2.c [new file with mode: 0644]
eail/tests/eail_layout_tc1.c [new file with mode: 0644]
eail/tests/eail_list_tc1.c [new file with mode: 0644]
eail/tests/eail_list_tc2.c [new file with mode: 0644]
eail/tests/eail_list_tc3.c [new file with mode: 0644]
eail/tests/eail_map_tc1.c [new file with mode: 0644]
eail/tests/eail_map_tc2.c [new file with mode: 0644]
eail/tests/eail_map_tc3.c [new file with mode: 0644]
eail/tests/eail_mapbuf_tc1.c [new file with mode: 0644]
eail/tests/eail_menu_tc1.c [new file with mode: 0644]
eail/tests/eail_multibuttonentry_tc1.c [new file with mode: 0644]
eail/tests/eail_multibuttonentry_tc2.c [new file with mode: 0644]
eail/tests/eail_multibuttonentry_tc3.c [new file with mode: 0644]
eail/tests/eail_multibuttonentry_tc4.c [new file with mode: 0644]
eail/tests/eail_naviframe_page_tc1.c [new file with mode: 0644]
eail/tests/eail_naviframe_tc1.c [new file with mode: 0644]
eail/tests/eail_naviframe_tc2.c [new file with mode: 0644]
eail/tests/eail_notify_tc1.c [new file with mode: 0644]
eail/tests/eail_panel_tc1.c [new file with mode: 0644]
eail/tests/eail_panel_tc2.c [new file with mode: 0644]
eail/tests/eail_panes_tc1.c [new file with mode: 0644]
eail/tests/eail_panes_tc2.c [new file with mode: 0644]
eail/tests/eail_photo_tc1.c [new file with mode: 0644]
eail/tests/eail_photo_tc2.c [new file with mode: 0644]
eail/tests/eail_photo_tc3.c [new file with mode: 0644]
eail/tests/eail_photocam_tc1.c [new file with mode: 0644]
eail/tests/eail_photocam_tc2.c [new file with mode: 0644]
eail/tests/eail_photocam_tc3.c [new file with mode: 0644]
eail/tests/eail_plug_tc1.c [new file with mode: 0644]
eail/tests/eail_plug_tc2.c [new file with mode: 0644]
eail/tests/eail_popup_tc1.c [new file with mode: 0644]
eail/tests/eail_prefs_tc1.c [new file with mode: 0644]
eail/tests/eail_progressbar_tc1.c [new file with mode: 0644]
eail/tests/eail_progressbar_tc2.c [new file with mode: 0644]
eail/tests/eail_radio_tc1.c [new file with mode: 0644]
eail/tests/eail_radio_tc2.c [new file with mode: 0644]
eail/tests/eail_route_tc1.c [new file with mode: 0644]
eail/tests/eail_route_tc2.c [new file with mode: 0644]
eail/tests/eail_scroller_tc1.c [new file with mode: 0644]
eail/tests/eail_scroller_tc2.c [new file with mode: 0644]
eail/tests/eail_segment_control_tc1.c [new file with mode: 0644]
eail/tests/eail_segment_control_tc2.c [new file with mode: 0644]
eail/tests/eail_separator_tc1.c [new file with mode: 0644]
eail/tests/eail_slider_tc1.c [new file with mode: 0644]
eail/tests/eail_slider_tc2.c [new file with mode: 0644]
eail/tests/eail_slideshow_tc1.c [new file with mode: 0644]
eail/tests/eail_slideshow_tc2.c [new file with mode: 0644]
eail/tests/eail_slideshow_tc3.c [new file with mode: 0644]
eail/tests/eail_spinner_tc1.c [new file with mode: 0644]
eail/tests/eail_spinner_tc2.c [new file with mode: 0644]
eail/tests/eail_table_tc1.c [new file with mode: 0644]
eail/tests/eail_test_utils.c [new file with mode: 0644]
eail/tests/eail_test_utils.h [new file with mode: 0644]
eail/tests/eail_thumb_tc1.c [new file with mode: 0644]
eail/tests/eail_thumb_tc2.c [new file with mode: 0644]
eail/tests/eail_thumb_tc3.c [new file with mode: 0644]
eail/tests/eail_toolbar_tc1.c [new file with mode: 0644]
eail/tests/eail_tooltip_tc1.c [new file with mode: 0644]
eail/tests/eail_video_tc1.c [new file with mode: 0644]
eail/tests/eail_video_tc2.c [new file with mode: 0644]
eail/tests/eail_video_tc3.c [new file with mode: 0644]
eail/tests/eail_web_tc1.c [new file with mode: 0644]
eail/tests/eail_win_tc1.c [new file with mode: 0644]
eail/tests/eail_win_tc2.c [new file with mode: 0644]

diff --git a/eail.spec b/eail.spec
new file mode 100644 (file)
index 0000000..19659a2
--- /dev/null
+++ b/eail.spec
@@ -0,0 +1,73 @@
+%define MODULEDIR "/usr/lib/elementary/modules/eail/linux-gnu-i686-1.7.99"
+Name: eail
+Summary: The Accessibility Toolkit for elementary
+Version: 1.0.0
+Release: 1
+License: LGPL
+Group: Development/Libraries
+Source: %{name}-%{version}.tar.xz
+URL: http://www.gtk.org
+
+Requires: glib2
+Requires: elementary
+Requires: atk
+BuildRequires: glib2-devel
+BuildRequires: elementary-devel
+BuildRequires: pkgconfig
+BuildRequires: atk-devel
+BuildRequires: at-spi2-atk-devel
+
+BuildRoot: %{buildroot}
+
+%description
+Handy library of accessibility functions. Development libs and headers
+are in eail-devel.
+
+%package devel
+Summary: Header, docs and development files to to develop applications using eail.
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header, docs and development libraries for eail.
+
+%prep
+%setup -q
+
+%build
+(if ! test -x configure; then ./autogen.sh; fi;
+ %configure --with-elementary-modules=%{MODULEDIR} $CONFIGFLAGS)
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%clean
+rm -rf %{buildroot}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-, root, root)
+%doc AUTHORS COPYING ChangeLog NEWS README
+%{_libdir}/libeail*
+%{_libdir}/elementary/modules/eail/linux-gnu-i686-1.7.99/*.so
+
+%files devel
+%defattr(-, root, root)
+%{_libdir}/lib*.so
+%{_libdir}/pkgconfig/*.pc
+%{_includedir}/eail/*.h
+
+%changelog
+* Thu Jul 11 2013 packager@comarch.com
+- Add eail as elementary module
+* Wed Apr 17 2013 packager@comarch.com
+- Fix spec file
+* Mon Mar 25 2013 packager@comarch.com
+- Initial (2.2.02.0)
+
+
diff --git a/eail/.gitignore b/eail/.gitignore
new file mode 100644 (file)
index 0000000..db79fbc
--- /dev/null
@@ -0,0 +1,36 @@
+# Object files
+*.o
+*.lo
+
+# Libraries
+*.lib
+*.a
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+
+# Files modified by autotools
+INSTALL
+Makefile.in
+aclocal.m4
+config.guess
+config.log
+config.sub
+configure
+depcomp
+eail/Makefile.in
+install-sh
+ltmain.sh
+missing
+*.m4
+
+# Files modified by git
+stamp-h1
diff --git a/eail/AUTHORS b/eail/AUTHORS
new file mode 100644 (file)
index 0000000..939c539
--- /dev/null
@@ -0,0 +1,6 @@
+Marcin Lyko <marcin.lyko@comarch.com>
+Lukasz Pawlik <lukasz.pawlik@comarch.com>
+Radoslaw Jablonski <radoslaw.jablonski@comarch.com>
+Tomasz Duszynski <tomasz.duszynski@comarch.com>
+Zbigniew Kozak <zbigniew.kozak@comarch.com>
+Karol Dudek <karol.dudek@comarch.com>
diff --git a/eail/COPYING b/eail/COPYING
new file mode 100644 (file)
index 0000000..dcd1706
--- /dev/null
@@ -0,0 +1,489 @@
+Copyright (C) 2013 Samsung Electronics Co., Ltd.
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by the
+Free Software Foundation; either version 2 of the Licence, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+details.
+
+Below is a copy of the GNU Lesser General Public License that is distributed
+along with this library. If you do not have a copy below, write to the Free
+Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
+02110-1301,  USA.
+
+                 GNU LESSER GENERAL PUBLIC LICENSE
+                      Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                 GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent modules,
+and to copy and distribute the resulting executable under terms of your
+choice, provided that you also meet, for each linked independent module,
+the terms and conditions of the license of that module. An independent
+module is a module which is not derived from or based on this library.
+If you modify this library, you may extend this exception to your version
+of the library, but you are not obliged to do so. If you do not wish to
+do so, delete this exception statement from your version.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                           NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
diff --git a/eail/ChangeLog b/eail/ChangeLog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/eail/Makefile.am b/eail/Makefile.am
new file mode 100644 (file)
index 0000000..a6111f2
--- /dev/null
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = 1.4 foreign
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in configure depcomp install-sh missing
+ACLOCAL_AMFLAGS= -I m4 ${ACLOCAL_FLAGS}
+INCLUDES = -I$(top_srcdir)
+
+SUBDIRS = . eail tests doc
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = eail.pc
diff --git a/eail/Makefile.am.mod b/eail/Makefile.am.mod
new file mode 100644 (file)
index 0000000..0e70c90
--- /dev/null
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+SUBDIRS = eail
diff --git a/eail/NEWS b/eail/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/eail/README b/eail/README
new file mode 100644 (file)
index 0000000..12e23c7
--- /dev/null
@@ -0,0 +1,32 @@
+Eail 1.0.0
+------------------------------------------------------------------------------
+Enlightenment Accessibility Implementation Library
+
+An implementation of ATK interfaces library for Elementary.
+
+------------------------------------------------------------------------------
+COMPILING AND INSTALLING:
+
+  ./autogen.sh
+(optionally use ./configure --with-elementary-modules=/usr/local/lib/elementary/modules/eail/linux-gnu-i686-1.7.99/  )
+  ./configure
+  make -j4
+(do this as root unless you are installing in your users directories):
+  make install
+
+------------------------------------------------------------------------------
+TESTING
+
+  ./autogen.sh
+(optionally use ./configure --with-elementary-modules=/usr/local/lib/elementary/modules/eail/linux-gnu-i686-1.7.99/  )
+  ./configure
+  make -j4
+(do this as root unless you are installing in your users directories):
+  make install
+  make check -j4
+
+------------------------------------------------------------------------------
+NOTE FOR TIZEN
+
+To use on Tizen 2.2 you have to set proper ELM_MODULES variable:
+export ELM_MODULES="prefs>prefs_iface:access_output>access/api:datetime_input_ctxpopup>datetime/api:eail>eail/api"
diff --git a/eail/autogen.sh b/eail/autogen.sh
new file mode 100755 (executable)
index 0000000..f3a4d37
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
+
+olddir=`pwd`
+cd "$srcdir"
+
+AUTORECONF="/usr/bin/autoreconf"
+if test -z $AUTORECONF; then
+        echo "*** No autoreconf found, please install it ***"
+        exit 1
+fi
+
+# README and INSTALL are required by automake
+if test -z README; then
+    touch README 
+fi
+if test -z INSTALL; then
+    touch INSTALL
+fi
+
+autoreconf --force --install --verbose || exit $?
+
+cd "$olddir"
+test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff --git a/eail/configure.ac b/eail/configure.ac
new file mode 100644 (file)
index 0000000..d7e3e57
--- /dev/null
@@ -0,0 +1,111 @@
+dnl Process this file with the command: autoreconf -f -i
+
+m4_define([EFL_A11Y_VERSION], [1.0.0])
+
+AC_INIT([efl-a11y], [EFL_A11Y_VERSION])
+
+AC_PREREQ([2.52])
+AC_CONFIG_SRCDIR([configure.ac])
+AC_CANONICAL_HOST
+
+AC_CONFIG_HEADERS([config.h])
+
+AM_INIT_AUTOMAKE([1.6 dist-bzip2])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CC_STDC
+AC_HEADER_STDC
+AC_C_CONST
+
+AC_LIBTOOL_WIN32_DLL
+define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
+define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
+AC_PROG_LIBTOOL
+
+LT_RELEASE_VERSION=EFL_A11Y_VERSION
+AC_SUBST([LT_RELEASE_VERSION])
+
+LT_ENABLE_AUTO_IMPORT=""
+case "$host_os" in
+   mingw*)
+      LT_ENABLE_AUTO_IMPORT="-Wl,--enable-auto-import"
+esac
+AC_SUBST([LT_ENABLE_AUTO_IMPORT])
+
+REQUIREMENT_EAIL="elementary >= 1.7.0 ecore-evas >= 1.7.0 ecore-file >= 1.7.0 ecore >= 1.7.0 evas >= 1.7.0 eina >= 1.7.0 atk >= 2.2.0 gobject-2.0 >= 2.30.0 gmodule-2.0 >= 2.30.0 gio-2.0"
+AC_SUBST([REQUIREMENT_EAIL])
+
+PKG_CHECK_MODULES([EAIL], [
+    eina >= 1.7.0
+    evas >= 1.7.0
+    ecore >= 1.7.0
+    ecore-file >= 1.7.0
+    ecore-evas >= 1.7.0
+    elementary >= 1.7.0
+    gmodule-2.0 >= 2.30.0
+    gobject-2.0 >= 2.30.0
+    atk >= 2.2.0
+    atk-bridge-2.0 >= 2.2.0
+    gio-2.0
+])
+PKG_CHECK_MODULES([TEST_DEPS], [
+                   elementary >= 1.7.0
+                   atk >= 2.2.0])
+
+dnl Strict compiler
+AC_ARG_ENABLE(strict-cc,
+        AS_HELP_STRING([--enable-strict-cc],[enable strict C compiler]),,
+        enable_strict_cc=no)
+if test "x$enable_strict_cc" = "xyes"; then
+        CFLAGS="$CFLAGS -Wall -Werror"
+else
+        CFLAGS="$CFLAGS -Wall"
+fi
+
+dnl doc
+AC_ARG_ENABLE([doc],
+              AS_HELP_STRING([--enable-doc],
+                             [Enable documentation [default=YES]]),,
+                             enable_doc=yes)
+AM_CONDITIONAL([BUILD_DOC], [test "x$enable_doc" = "xyes"])
+
+dnl Tests
+AC_ARG_ENABLE([tests],
+              AS_HELP_STRING([--enable-tests],[build tests]),,
+              enable_tests=no)
+AM_CONDITIONAL([MAKE_TESTS], [test "x$enable_tests" = "xyes"])
+
+dnl Generate coverage report
+AC_ARG_ENABLE([coverage],
+  AS_HELP_STRING([--enable-coverage],
+                 [Generate converage reports]),
+  [],
+  [enable_coverage=no])
+AM_CONDITIONAL([ENABLE_COVERAGE],[test "x$enable_coverage" != "xno"])
+AS_IF([test "x$enable_coverage" != "xno"],
+  [
+    AC_PATH_PROG([LCOV], [lcov])
+    AC_PATH_PROG([GENHTML], [genhtml])
+    AC_SUBST([COVERAGE_LIBS],["-lgcov"])
+    AC_SUBST([COVERAGE_CFLAGS],["-fprofile-arcs -ftest-coverage"])
+  ]
+)
+dnl set elementatary modules dir
+AC_ARG_WITH(elementary-modules,
+           [AS_HELP_STRING([--with-elementary-modules=<directory>],
+           [where elementary module directory is])])
+AM_CONDITIONAL(ENABLE_ELM_MODULE, false )
+if ! test -z "$with_elementary_modules" ; then
+           ELEMENTARY_MODULE_DIR="$with_elementary_modules"
+           AC_SUBST(ELEMENTARY_MODULE_DIR)
+           AM_CONDITIONAL(ENABLE_ELM_MODULE, true )
+fi
+
+AC_OUTPUT([
+    eail.pc
+    Makefile
+    eail/Makefile
+    tests/Makefile
+    doc/Makefile
+])
diff --git a/eail/configure.ac.mod b/eail/configure.ac.mod
new file mode 100644 (file)
index 0000000..f47a809
--- /dev/null
@@ -0,0 +1,50 @@
+dnl Process this file with the command: autoreconf -f -i
+
+AC_INIT([efl-a11y], [0.1.0])
+
+AC_PREREQ([2.52])
+AC_CONFIG_SRCDIR([configure.ac])
+AC_CANONICAL_HOST
+
+AC_CONFIG_HEADERS([config.h])
+
+AM_INIT_AUTOMAKE([1.6 dist-bzip2])
+
+AC_PROG_CC
+AC_PROG_CC_STDC
+AC_HEADER_STDC
+AC_C_CONST
+
+AC_LIBTOOL_WIN32_DLL
+define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
+define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
+AC_PROG_LIBTOOL
+
+LT_ENABLE_AUTO_IMPORT=""
+case "$host_os" in
+   mingw*)
+      LT_ENABLE_AUTO_IMPORT="-Wl,--enable-auto-import"
+esac
+AC_SUBST([LT_ENABLE_AUTO_IMPORT])
+
+PKG_PROG_PKG_CONFIG
+elm_version=`$PKG_CONFIG --modversion elementary | cut -d '.' -f '1-3'`
+MODULE_ARCH="$host_os-$host_cpu-$elm_version"
+AC_SUBST([MODULE_ARCH])
+
+PKG_CHECK_MODULES([EAIL], [
+    eina >= 1.1.0
+    evas >= 1.1.0
+    ecore >= 1.1.0
+    ecore-evas >= 1.1.0
+    ecore-file >= 1.1.0
+    elementary >= 0.8.0
+    gobject-2.0 >= 2.30.0
+    gmodule-2.0 >= 2.30.0
+    atk >= 2.2.0
+])
+
+AC_OUTPUT([
+    Makefile
+    eail/Makefile
+])
diff --git a/eail/doc/Doxyfile b/eail/doc/Doxyfile
new file mode 100644 (file)
index 0000000..e9830a3
--- /dev/null
@@ -0,0 +1,1869 @@
+# Doxyfile 1.8.3.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "Enlightenment Accessibility Implementation Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = ./
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip. Note that you specify absolute paths here, but also
+# relative paths, which will be relative from the directory where doxygen is
+# started.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension,
+# and language is one of the parsers supported by doxygen: IDL, Java,
+# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
+# C++. For instance to make doxygen treat .inc files as Fortran files (default
+# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
+# that for custom extensions you also need to set FILE_PATTERNS otherwise the
+# files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# When enabled doxygen tries to link words that correspond to documented classes,
+# or namespaces to their corresponding documentation. Such a link can be
+# prevented in individual cases by by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES (the
+# default) will make doxygen replace the get and set methods by a property in
+# the documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if section-label ... \endif
+# and \cond section-label ... \endcond blocks.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path. Do not use
+# file names with spaces, bibtex cannot handle them.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = ../eail
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             = images
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page (index.html).
+# This can be useful if you have a project on for instance GitHub and want reuse
+# the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If left blank doxygen will
+# generate a default style sheet. Note that it is recommended to use
+# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
+# tag will in the future become obsolete.
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
+# user-defined cascading style sheet that is included after the standard
+# style sheets created by doxygen. Using this option one can overrule
+# certain style aspects. This is preferred over using HTML_STYLESHEET
+# since it does not replace the standard style sheet and is therefor more
+# robust against future updates. Doxygen will copy the style sheet file to
+# the output directory.
+
+HTML_EXTRA_STYLESHEET  =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
+# identify the documentation publisher. This should be a reverse domain-name
+# style string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
+# SVG. The default value is HTML-CSS, which is slower, but has the best
+# compatibility.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript.
+# There are two flavours of web server based search depending on the
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
+# searching and an index file used by the script. When EXTERNAL_SEARCH is
+# enabled the indexing and searching needs to be provided by external tools.
+# See the manual for details.
+
+SERVER_BASED_SEARCH    = NO
+
+# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain
+# the search results. Doxygen ships with an example indexer (doxyindexer) and
+# search engine (doxysearch.cgi) which are based on the open source search engine
+# library Xapian. See the manual for configuration details.
+
+EXTERNAL_SEARCH        = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will returned the search results when EXTERNAL_SEARCH is enabled.
+# Doxygen ships with an example search engine (doxysearch) which is based on
+# the open source search engine library Xapian. See the manual for configuration
+# details.
+
+SEARCHENGINE_URL       =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+
+SEARCHDATA_FILE        = searchdata.xml
+
+# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+
+EXTERNAL_SEARCH_ID     =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
+# of to a relative location where the documentation can be found.
+# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+
+EXTRA_SEARCH_MAPPINGS  =
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
diff --git a/eail/doc/Makefile.am b/eail/doc/Makefile.am
new file mode 100644 (file)
index 0000000..ed3fa64
--- /dev/null
@@ -0,0 +1,19 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+if BUILD_DOC
+clean:
+       rm -rf html/
+       rm -rf latex/
+
+doc: all
+       doxygen Doxyfile
+
+clean-local: clean
+
+else
+doc:
+       @echo "Documentation not built. Run ./configure --help"
+
+endif
+
+.PHONY: all doc clean
diff --git a/eail/doc/images/eail_component_diagram.png b/eail/doc/images/eail_component_diagram.png
new file mode 100644 (file)
index 0000000..8eb3e53
Binary files /dev/null and b/eail/doc/images/eail_component_diagram.png differ
diff --git a/eail/doc/images/eail_get_root_flow.png b/eail/doc/images/eail_get_root_flow.png
new file mode 100644 (file)
index 0000000..a0bc86f
Binary files /dev/null and b/eail/doc/images/eail_get_root_flow.png differ
diff --git a/eail/doc/images/eail_ref_window_child_flow.png b/eail/doc/images/eail_ref_window_child_flow.png
new file mode 100644 (file)
index 0000000..c2f3e93
Binary files /dev/null and b/eail/doc/images/eail_ref_window_child_flow.png differ
diff --git a/eail/eail.pc.in b/eail/eail.pc.in
new file mode 100644 (file)
index 0000000..20de7c4
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: eail
+Description: Elementary Accessibility Implementation Library
+@pkgconfig_requires_private@: @REQUIREMENT_EAIL@
+Version: @VERSION@
+Libs: -L${libdir} -leail
+Cflags: -I${includedir}/eail
diff --git a/eail/eail/Makefile.am b/eail/eail/Makefile.am
new file mode 100644 (file)
index 0000000..4bb9d93
--- /dev/null
@@ -0,0 +1,244 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+if ENABLE_ELM_MODULE
+moduledir = $(ELEMENTARY_MODULE_DIR)
+module_DATA = module.la module.so
+module.la: Makefile $(LTLIBRARIES)
+       cp $(srcdir)/.libs/$(lib_LTLIBRARIES) module.la
+module.so: Makefile $(LTLIBRARIES)
+       cp $(srcdir)/.libs/libeail.so module.so
+endif
+
+lib_LTLIBRARIES = libeail.la
+libeailincludedir = $(includedir)/eail
+
+libeail_la_SOURCES  = \
+       eail.c \
+       eail.h \
+       eail_factory.c \
+       eail_factory.h \
+       eail_app.c \
+       eail_app.h \
+       eail_widget.c \
+       eail_widget.h \
+       eail_action_widget.c \
+       eail_action_widget.h \
+       eail_scrollable_widget.c \
+       eail_scrollable_widget.h \
+       eail_window.c \
+       eail_window.h \
+       eail_action_slider.c \
+       eail_action_slider.h \
+       eail_background.c \
+       eail_background.h \
+       eail_box.c \
+       eail_box.h \
+       eail_text.c \
+       eail_text.h \
+       eail_label.c \
+       eail_label.h \
+       eail_button.c \
+       eail_button.h \
+       eail_icon.c \
+       eail_icon.h \
+       eail_item.h \
+       eail_item.c \
+       eail_item_parent.h \
+       eail_item_parent.c \
+       eail_list.c \
+       eail_list.h \
+       eail_fileselector.c \
+       eail_fileselector.h \
+       eail_genlist.c \
+       eail_genlist.h \
+       eail_entry.c \
+       eail_entry.h \
+       eail_frame.c \
+       eail_frame.h \
+       eail_scroller.c \
+       eail_scroller.h \
+       eail_slider.c \
+       eail_slider.h \
+       eail_inwin.h \
+       eail_inwin.c \
+       eail_image.c \
+       eail_image.h \
+       eail_check.c \
+       eail_check.h \
+       eail_radio_button.c \
+       eail_radio_button.h \
+       eail_menu.c \
+       eail_menu.h \
+       eail_photo.c \
+       eail_photo.h \
+       eail_clock.c \
+       eail_clock.h \
+       eail_photocam.c \
+       eail_photocam.h \
+       eail_separator.c \
+       eail_separator.h \
+       eail_spinner.c \
+       eail_spinner.h \
+       eail_calendar.c \
+       eail_calendar.h \
+       eail_utils.c \
+       eail_utils.h \
+       eail_grid.c \
+       eail_grid.h \
+       eail_route.c \
+       eail_route.h \
+       eail_dayselector.c \
+       eail_dayselector.h \
+       eail_gengrid.c \
+       eail_gengrid.h \
+       eail_progressbar.c \
+       eail_progressbar.h \
+       eail_diskselector.c \
+       eail_diskselector.h \
+       eail_segment_control.c \
+       eail_segment_control.h \
+       eail_conformant.c \
+       eail_conformant.h \
+       eail_notify.c \
+       eail_notify.h \
+       eail_popup.c \
+       eail_popup.h \
+       eail_ctxpopup.c \
+       eail_ctxpopup.h \
+       eail_toolbar.c \
+       eail_toolbar.h \
+       eail_multibuttonentry.c \
+       eail_multibuttonentry.h \
+       eail_web.c \
+       eail_web.h \
+       eail_index.c \
+       eail_index.h \
+       eail_fileselector_entry.c \
+       eail_fileselector_entry.h \
+       eail_colorselector.c \
+       eail_colorselector.h \
+       eail_naviframe.c \
+       eail_naviframe.h \
+       eail_naviframe_page.c \
+       eail_naviframe_page.h \
+       eail_datetime.c \
+       eail_datetime.h \
+       eail_hover.c \
+       eail_hover.h \
+       eail_panes.c \
+       eail_panes.h \
+       eail_panel.c \
+       eail_panel.h \
+       eail_thumb.c \
+       eail_thumb.h \
+       eail_mapbuf.c \
+       eail_mapbuf.h \
+       eail_slideshow.c \
+       eail_slideshow.h \
+       eail_hoversel.c \
+       eail_hoversel.h \
+       eail_map.c \
+       eail_map.h \
+       eail_glview.c \
+       eail_glview.h \
+       eail_bubble.c \
+       eail_bubble.h \
+       eail_plug.c \
+       eail_plug.h \
+       eail_video.c \
+       eail_video.h \
+       eail_flip.c \
+       eail_flip.h \
+       eail_flipselector.c \
+       eail_flipselector.h \
+       eail_layout.c \
+       eail_layout.h \
+       eail_table.c \
+       eail_table.h \
+       eail_prefs.c \
+       eail_prefs.h \
+       eail_dynamic_content.c \
+       eail_dynamic_content.h \
+       eail_priv.h \
+       eail_clipboard.c \
+       eail_clipboard.h
+
+libeailinclude_HEADERS = \
+       eail.h \
+       eail_factory.h \
+       eail_app.h \
+       eail_widget.h \
+       eail_action_widget.h \
+       eail_scrollable_widget.h \
+       eail_window.h \
+       eail_fileselector.h \
+       eail_action_slider.h \
+       eail_background.h \
+       eail_box.h \
+       eail_text.h \
+       eail_label.h \
+       eail_button.h \
+       eail_icon.h \
+       eail_item.h \
+       eail_item_parent.h \
+       eail_list.h \
+       eail_genlist.h \
+       eail_entry.h \
+       eail_frame.h \
+       eail_scroller.h \
+       eail_slider.h \
+       eail_inwin.h \
+       eail_image.h \
+       eail_check.h \
+       eail_radio_button.h \
+       eail_menu.h \
+       eail_photocam.h \
+       eail_photo.h \
+       eail_clock.h \
+       eail_separator.h \
+       eail_spinner.h \
+       eail_calendar.h \
+       eail_utils.h \
+       eail_grid.h \
+       eail_route.h \
+       eail_gengrid.h \
+       eail_progressbar.h \
+       eail_diskselector.h \
+       eail_segment_control.h \
+       eail_notify.h \
+       eail_popup.h \
+       eail_ctxpopup.h \
+       eail_toolbar.h \
+       eail_web.h \
+       eail_index.h \
+       eail_fileselector_entry.h \
+       eail_colorselector.h \
+       eail_naviframe.h \
+       eail_naviframe_page.h \
+       eail_datetime.h \
+       eail_hover.h \
+       eail_panes.h \
+       eail_panel.h \
+       eail_thumb.h \
+       eail_mapbuf.h \
+       eail_slideshow.h \
+       eail_hoversel.h \
+       eail_map.h \
+       eail_glview.h \
+       eail_bubble.h \
+       eail_plug.h \
+       eail_video.h \
+       eail_flip.h \
+       eail_flipselector.h \
+       eail_layout.h \
+       eail_table.h \
+       eail_prefs.h \
+       eail_dynamic_content.h \
+       eail_priv.h \
+       eail_clipboard.h
+
+libeail_la_CFLAGS = @EAIL_CFLAGS@
+libeail_la_LIBADD = @EAIL_LIBS@
+libeail_la_LDFLAGS = \
+       -no-undefined @LT_ENABLE_AUTO_IMPORT@ \
+       -release @LT_RELEASE_VERSION@
diff --git a/eail/eail/Makefile.am.mod b/eail/eail/Makefile.am.mod
new file mode 100644 (file)
index 0000000..0ea0f0a
--- /dev/null
@@ -0,0 +1,17 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+module_LTLIBRARIES = module.la
+
+module_la_SOURCES  = \
+       eail.c \
+       eail.h \
+       eail_app.c \
+       eail_app.h \
+       eail_mod.c
+
+moduledir = $(libdir)/elementary/modules/eail/$(MODULE_ARCH)
+
+module_la_CFLAGS = @EAIL_CFLAGS@
+module_la_LIBADD = @EAIL_LIBS@
+module_la_LDFLAGS = -no-undefined @LT_ENABLE_AUTO_IMPORT@ -module -avoid-version
+module_la_LIBTOOLFLAGS = --tag=disable-static
diff --git a/eail/eail/eail.c b/eail/eail/eail.c
new file mode 100644 (file)
index 0000000..b7cced7
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail.c
+ * @brief Eail initialization part
+ */
+
+#include <Elementary.h>
+
+#include <gmodule.h>
+#include <atk-bridge.h>
+#include "eail.h"
+#include "eail_app.h"
+#include "eail_priv.h"
+#include "eail_clipboard.h"
+
+/** @brief Struct definition for listener info*/
+typedef struct _EailUtilListenerInfo EailUtilListenerInfo;
+/** @brief Struct definition for event info*/
+typedef struct _EailKeyEventInfo EailKeyEventInfo;
+
+/** @brief Struct definition for listener info*/
+struct _EailUtilListenerInfo
+{
+   gint key; /**< @brief key of entry */
+   guint signal_id;/**< @brief id of signal to listen on */
+   gulong hook_id;/**< @brief emit hook value returned on signal registration*/
+};
+
+/** @brief Struct definition for event info*/
+struct _EailKeyEventInfo
+{
+  AtkKeyEventStruct *key_event;/**< @brief key of event */
+  gpointer func_data;/**< @brief additional data passed to gobject event */
+};
+
+/** @brief Cache of objects used to listen and propagate signals */
+static GHashTable *listener_list = NULL;
+/** @brief Last added id of a listener */
+static gint listener_idx = 1;
+
+/**
+ * @brief Domain index that will be used as the DOMAIN parameter on EINA log macros.
+ *
+ * A negative value means a log occurred.
+ */
+int _eail_log_dom = -1;
+
+/**
+ * @brief This is used to track last focused atk object
+ */
+static AtkObject *eail_atk_last_focused_obj = NULL;
+
+/**
+ * @brief Gets toolkit name
+ * @return toolkit name
+ */
+static const gchar * eail_get_toolkit_name(void)
+{
+   return "elementary";
+}
+
+/**
+ * @brief Gets toolkit version
+ *
+ * @return toolkit version
+ */
+static const gchar * eail_get_toolkit_version(void)
+{
+   return g_strdup_printf("%i.%i.%i", elm_version->major,
+                          elm_version->minor,
+                          elm_version->micro);
+}
+
+/**
+ * @brief Gets the root accessible container for the current application
+ *
+ * @return root Accessible container
+ */
+static AtkObject * eail_get_root(void)
+{
+   static AtkObject *root = NULL;
+
+   if (!root)
+     {
+        root = g_object_new(EAIL_TYPE_APP, NULL);
+        atk_object_initialize(root, NULL);
+   }
+
+   return root;
+}
+
+/**
+ * @brief Callback to be called when an object receives focus
+ *
+ * @param current_focused_obj an AtkObject
+ */
+static void
+eail_focus_listener_cb(AtkObject *current_focused_obj)
+{
+   if (current_focused_obj == eail_atk_last_focused_obj)
+     return;
+
+   if (eail_atk_last_focused_obj)
+     {
+        atk_object_notify_state_change
+                    (eail_atk_last_focused_obj, ATK_STATE_FOCUSED, FALSE);
+        g_object_unref(eail_atk_last_focused_obj);
+     }
+
+   g_object_ref(current_focused_obj);
+
+   /* already notyfying about focus in widget implementation so do not need
+    * to notify here for new focus*/
+   eail_atk_last_focused_obj = current_focused_obj;
+}
+
+/**
+ * @brief Initializes object focus tracking
+ */
+static void
+eail_app_focus_listener_init()
+{
+   atk_add_focus_tracker(eail_focus_listener_cb);
+}
+
+/**
+ * @brief Creates and adds listener for given object type
+ * @param listener - GObject Emission Hook (a simple function pointer to get
+ * invoked when the signal is emitted)
+ * @param object_type string name of object type
+ * @param signal string name of signal to listen
+ * @param hook_data GObject 'hook' info
+ *
+ * @returns id of a newly added listener
+ */
+static guint
+add_listener (GSignalEmissionHook listener,
+              const gchar         *object_type,
+              const gchar         *signal,
+              const gchar         *hook_data)
+{
+  GType type;
+  guint signal_id;
+  gint  rc = 0;
+
+  type = g_type_from_name (object_type);
+  if (type)
+    {
+      signal_id  = g_signal_lookup (signal, type);
+      if (signal_id > 0)
+        {
+          EailUtilListenerInfo *listener_info;
+
+          rc = listener_idx;
+
+          listener_info = g_malloc(sizeof(EailUtilListenerInfo));
+          listener_info->key = listener_idx;
+          listener_info->hook_id =
+                          g_signal_add_emission_hook (signal_id, 0, listener,
+                                                      g_strdup (hook_data),
+                                                      (GDestroyNotify) g_free);
+          listener_info->signal_id = signal_id;
+
+          g_hash_table_insert(listener_list, &(listener_info->key), listener_info);
+          listener_idx++;
+        }
+      else
+        {
+           DBG("Invalid signal type %s\n", signal);
+        }
+    }
+  else
+    {
+       DBG("Invalid object type %s\n", object_type);
+    }
+  return rc;
+}
+
+/**
+ * @brief Removes listener for given object type
+ *
+ * @param remove_listener id of listener to remove
+ */
+static void
+eail_remove_global_event_listener (guint remove_listener)
+{
+  if (remove_listener > 0)
+  {
+    EailUtilListenerInfo *listener_info;
+    gint tmp_idx = remove_listener;
+
+    listener_info = (EailUtilListenerInfo *)
+                                 g_hash_table_lookup(listener_list, &tmp_idx);
+
+    if (listener_info != NULL)
+      {
+        /* Hook id of 0 and signal id of 0 are invalid */
+        if (listener_info->hook_id != 0 && listener_info->signal_id != 0)
+          {
+            /* Remove the emission hook */
+            g_signal_remove_emission_hook(listener_info->signal_id,
+                                                listener_info->hook_id);
+
+            /* Remove the element from the hash */
+            g_hash_table_remove(listener_list, &tmp_idx);
+          }
+        else
+          {
+             DBG("Invalid listener hook_id %ld or signal_id %d\n",
+                            listener_info->hook_id, listener_info->signal_id);
+          }
+      }
+    else
+      {
+         DBG("No listener with the specified listener id %d", remove_listener);
+      }
+  }
+  else
+  {
+     DBG("Invalid listener_id %d", remove_listener);
+  }
+}
+
+/**
+ * @brief initialization for global event listener
+ *
+ * @param listener an GSignalEmissionHook (GObject 'signal invocation hint')
+ * @param event_type string representation of event type
+ *
+ * @return id of added listener
+ */
+static guint
+eail_add_global_event_listener(GSignalEmissionHook listener,
+                               const gchar *event_type)
+{
+   guint rc = 0;
+   gchar **split_string;
+
+   split_string = g_strsplit(event_type, ":", 3);
+
+   if (split_string)
+     {
+       if (!strcmp("window", split_string[0]))
+         rc = add_listener /* window event handling */
+                       (listener, "AtkWindow", split_string[1], event_type);
+       else
+         rc = add_listener /* regular event handling */
+                    (listener, split_string[1], split_string[2], event_type);
+
+       g_strfreev(split_string);
+     }
+
+   return rc;
+}
+
+/**
+ * @brief destructor for listener info object
+ *
+ * @param data data to be freed
+ */
+static void
+eail_listener_info_destroy(gpointer data)
+{
+   g_free(data);
+}
+
+/**
+ * @brief AtkUtil class initialization
+ */
+static void atk_util_install(void)
+{
+   AtkUtilClass *uclass;
+
+   uclass = ATK_UTIL_CLASS(g_type_class_ref(ATK_TYPE_UTIL));
+   uclass->get_toolkit_name = eail_get_toolkit_name;
+   uclass->get_toolkit_version = eail_get_toolkit_version;
+   uclass->get_root = eail_get_root;
+
+   eail_app_focus_listener_init();
+
+   uclass->add_global_event_listener = eail_add_global_event_listener;
+   uclass->remove_global_event_listener = eail_remove_global_event_listener;
+   uclass->add_key_event_listener = NULL;
+   uclass->remove_key_event_listener = NULL;
+}
+
+/**
+ * @brief Function to be executed by Elementary when EAIL module is loaded
+ *
+ * @param m Elm_Module data
+ * @return 1 on success, otherwise 0
+ */
+int
+elm_modapi_init(void *m)
+{
+   static gboolean initialized = FALSE;
+   if (initialized) return 1;
+
+   _eail_log_dom = eina_log_domain_register("eail", EAIL_LOG_COLOR);
+   if (!_eail_log_dom)
+     {
+        EINA_LOG_ERR("could not register eail log domain.");
+        _eail_log_dom = EINA_LOG_DOMAIN_GLOBAL;
+     }
+
+   if (!ecore_main_loop_glib_integrate())
+     {
+        ERR("Cannot integrate with glib main loop");
+        return 0;
+     }
+
+   initialized = TRUE;
+
+#if !GLIB_CHECK_VERSION(2,35,0)
+   g_type_init();
+#endif
+
+   listener_list = g_hash_table_new_full
+                  (g_int_hash, g_int_equal, NULL, eail_listener_info_destroy);
+
+   atk_util_install();
+
+   atk_misc_instance = g_object_new(ATK_TYPE_MISC, NULL);
+
+   atk_bridge_adaptor_init(NULL, NULL);
+
+   return 1;
+}
+
+/**
+ * @brief Function to be executed by Elementary when EAIL module is unloaded
+ *
+ * @param m Elm_Module
+ * @return always 1' - notifying success
+ */
+int
+elm_modapi_shutdown(void *m)
+{
+   eail_clipboard_free();
+
+   if ((_eail_log_dom > -1) && (_eail_log_dom != EINA_LOG_DOMAIN_GLOBAL))
+     {
+        eina_log_domain_unregister(_eail_log_dom);
+        _eail_log_dom = -1;
+     }
+   /*always succeed*/
+   return 1;
+}
+
diff --git a/eail/eail/eail.h b/eail/eail/eail.h
new file mode 100644 (file)
index 0000000..df861f2
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail.h
+ *
+ * @brief Header for Eail initialization part
+ */
+
+/**
+ * @mainpage Manual SDK
+ *
+ * @section Description
+ * EAIL (Enlightenment Accessibility Implementation Library) is implementation
+ * of ATK (Accessibility Toolkit) - it allows to receive accessible content
+ * representation for Elementary widgets.
+ * EAIL is meant to be a bridge Elementary and ATK, thus various ATs can query for
+ * accessible information using AT-SPI2.
+ * ATK is an accessibility toolkit conforming to the Section 508 Standards.
+ * EAIL is developed as an Elementary module and loaded whenever Elementary
+ * ELM_MODULES environmental variable is set  ("eail>eail/api" is appended).
+ *
+ * @section Setup
+ * <p>In order to load properly, EAIL has to be installed in directory that is
+ * used to store the rest of Elementary modules (directory path is architecture
+ * dependent). Passing correct directory name is available via ./configure
+ * option '--with-elementary-module'.</p>
+ * <p>Below is sample configuration for x86_64
+ * architecture:
+ * @code
+ * ./configure --with-elementary-modules=/usr/local/lib/elementary/modules/eail/linux-gnu-x86_64-1.7.99/
+ * @endcode
+ * </p>
+ * <p>When EAIL module is installed, then Elementary library has to be notified
+ * about new module - it needs to load EAIL module during startup.
+ * This can be done using 'ELM_MODULES' environmental variable.</p>
+ * <p>Below is a code snippet, that shows how to set EAIL module load for current
+ * session:
+ * @code
+ * export ELM_MODULES="eail>eail/api"
+ * @endcode
+ *
+ * NOTE: ELM_MODULES can also be set for every session using elementary configuration
+ * files. Details on how to do that can be found in Elementary documentation.
+ *
+ * <p>This is all needed configuration - now elementary application can be
+ * launched and accessible content for target application should be visible
+ * when using accessibility clients (eg. ORCA, TADEK, accerciser...)</p>
+ * </p>
+ *
+ * @section Architecture
+ * <p>EAIL is implemented as module of Enlightenment (it is located in Elementary
+ * modules directory). When elementary-application is being
+ * launched and ELM_MODULES is set correctly, then EAIL module is also loaded.
+ * EAIL module registers itself to ATK bridge, so accessibility client
+ * application (eg. ORCA, TADEK) can obtain information (in form of accessible
+ * ATK object) about every visible element in application UI.</p>
+ * <p>
+ * See diagram of architecture below:
+ * @image html eail_component_diagram.png
+ * </p>
+ *
+ * @section Dataflow Data Flow
+ * <p>When accessibility client wants to get accessible content of application
+ * it needs to get 'root' ATK object for application. To do that, client has to
+ * call atk_get_root() on ATK/AT-SPI brigde. Request is propagated to EAIL which
+ * creates new instance of EailApp which is ATK representation of elementary
+ * application.</p>
+ * <p>
+ * Below is diagram that shows what is happening during that operation:
+ * @image html eail_get_root_flow.png
+ * </p>
+ *
+ * <p>When accessibility client holds reference to ATK root object (EailApp), it
+ * can use AtkObject interface to use objects accessible functionality (eg.
+ * get name, set/get description or, the most important one, get reference to
+ * children)). To get widget children, client has to call
+ * <b>atk_object_ref_accessible_child.</b>
+ * </p>
+ * <p>
+ * Below is diagram that shows how app child (EailWindow) is being created. For
+ * other kinds of object data flow is very similar:
+ * @image html eail_ref_window_child_flow.png
+ * </p>
+ *
+ * @section Events
+ * Following ATK event types are supported:
+ * -# "focus"
+ * -# "state-change"
+ * -# "visible-data-changed"
+ * -# "property-change"
+ * <p>
+ * NOTE: To receive events from EAIL widget, ATK-client application needs to
+ * hold reference to target widget (it can be achieved by eg. listing whole
+ * widget hierarchy tree). Without that event listener for widget won't be
+ * registered and ATK events won't be propagated.
+ * \n
+ * To be sure that client always
+ * has correct widget tree, it needs to refresh widget descendants every time
+ * it receives "visible-data-changed" event from ATK.
+ * </p>
+ * Example how to register for events using python pyatspi binding (
+ * as mentioned above all objects that we're interesed in have to be listed at
+ * first, below is a code spippet only for event registration for pyatspi part):
+ * @code
+ * pyatspi.Registry.registerEventListener(test_cb, "focus")
+ * pyatspi.Registry.registerEventListener(test_cb, "object:state-changed")
+ * pyatspi.Registry.registerEventListener(test_cb, "object:visible-data-changed")
+ * pyatspi.Registry.registerEventListener(test_cb, "object:property-changed")
+ *
+ * pyatspi.Registry.start()
+ *
+ * @endcode
+ *
+ * @section Examples
+ * <p>Below are some examples on how to use C API for ATK with EAIL.
+ * </p>
+ * <p>
+ * How to get root ATK object for current application:
+ * @code
+ * AtkObject *atk_obj = atk_get_root();
+ * @endcode
+ * </p>
+ *
+ * <p>
+ * How to count children of given ATK object:
+ * @code
+ * gint n = atk_object_get_n_accessible_children(atk_obj);
+ * @endcode
+ * </p>
+ *
+ * <p>
+ * How to obtain reference to first child of ATK object:
+ * @code
+ * AtkObject *atk_obj = atk_object_ref_accessible_child(atk_obj, 0);
+ * @endcode
+ * </p>
+ *
+ * <p>
+ * How to launch first action of given ATK object that supports ATK_ACTION
+ * interface:
+ * @code
+ * gboolean success = atk_action_do_action(ATK_ACTION(atk_obj), 0);
+ * @endcode
+ * </p>
+ *
+ * <p>
+ * How to get name of action with given index ('1'):
+ * @code
+ * const gchar *action_name = atk_action_get_name(ATK_ACTION(atk_obj), 1);
+ * @endcode
+ * </p>
+ *
+ * Many more ready-to-go examples can be found in EAIL test code which can
+ * be found in <b>tests/</b> directory.
+ */
+#ifndef EAIL_H
+#define EAIL_H
+
+#include "Elementary.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief ATK initializer for accessibility API */
+EAPI int elm_modapi_init(void *m);
+
+/** @brief ATK desctructor for accessibility API */
+EAPI int elm_modapi_shutdown(void *m);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_action_slider.c b/eail/eail/eail_action_slider.c
new file mode 100644 (file)
index 0000000..a47bbba
--- /dev/null
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_action_slider.c
+ * @brief EailActionSlider implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_action_slider.h"
+#include "eail_utils.h"
+
+/**
+ * @brief Initialization of AtkValue interface
+ *
+ * @param iface EailActionSlider object
+ */
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief Define EailActionSlider GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailActionSlider,
+                        eail_action_slider,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief handler for pos_changed event
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_action_slider_handle_pos_changed_event(void *data,
+                                      Evas_Object *obj,
+                                      void *event_info)
+{
+   eail_emit_atk_signal
+                  (ATK_OBJECT(data), "visible-data-changed", ATK_TYPE_OBJECT);
+}
+
+/**
+ * @brief EailActionSlider object initialization
+ *
+ * @param obj EailActionSlider object
+ * @param data user set additional initialization data
+ */
+static void
+eail_action_slider_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+
+   ATK_OBJECT_CLASS(eail_action_slider_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_SLIDER;
+
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   evas_object_smart_callback_add(nested_widget, "pos_changed",
+                            _eail_action_slider_handle_pos_changed_event, obj);
+
+}
+
+/**
+ * @brief EailActionSlider instance initialization
+ *
+ * @param action_slider EailActionSlider instance
+ */
+static void
+eail_action_slider_init(EailActionSlider *action_slider)
+{
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailActionSlider class
+ */
+static void
+eail_action_slider_class_init(EailActionSliderClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_action_slider_initialize;
+}
+
+/*
+ * Implementation of the *AtkValue* interface
+ */
+
+/**
+ * @brief Gets obj current value
+ *
+ * @param obj EailActionSlider instance
+ * @param [out] value EailActionSlider current value
+ */
+static void
+eail_action_slider_get_current_value(AtkValue *obj,
+                                     GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_UINT);
+   g_value_set_uint(value, elm_actionslider_indicator_pos_get(widget));
+}
+
+/**
+ * @brief Gets obj maxiumum value
+ *
+ * @param obj EailActionSlider instance
+ * @param [out] value EailActionSlider maxiumum value
+ */
+static void
+eail_action_slider_get_maximum_value(AtkValue *obj,
+                                     GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_UINT);
+   g_value_set_uint(value, elm_actionslider_enabled_pos_get(widget));
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * @param obj EailActionSlider instance
+ * @param [out] value EailActionSlider minimum value
+ */
+static void
+eail_action_slider_get_minimum_value(AtkValue *obj,
+                                     GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_UINT);
+   g_value_set_uint(value, ELM_ACTIONSLIDER_NONE);
+}
+
+/**
+ * @brief Sets obj value
+ *
+ * @param obj EailActionSlider instance
+ * @param value EailActionSlider new value
+ * @return TRUE if new value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_action_slider_set_current_value(AtkValue *obj,
+                                     const GValue *value)
+{
+   Evas_Object *widget;
+   guint enum_val;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   enum_val = elm_actionslider_enabled_pos_get(widget) &
+              g_value_get_uint(value);
+
+   switch (enum_val)
+     {
+        case ELM_ACTIONSLIDER_LEFT:
+        case ELM_ACTIONSLIDER_CENTER:
+        case ELM_ACTIONSLIDER_RIGHT:
+          elm_actionslider_indicator_pos_set(widget, enum_val);
+          break;
+
+        default:
+          return FALSE;
+          break;
+     }
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets obj minimum increment
+ *
+ * @param obj EailActionSlider instance
+ * @param [out] value EailActionSlider minimum increment
+ */
+static void
+eail_action_slider_get_minimum_increment(AtkValue *obj,
+                                         GValue *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_UINT);
+   g_value_set_uint(value, ELM_ACTIONSLIDER_NONE);
+}
+
+/**
+ * @brief Initialization of AtkValue interface
+ *
+ * Function called upon instance creation. It initializes AtkValue interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkObject that implements AtkValueInterface
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   iface->get_current_value     = eail_action_slider_get_current_value;
+   iface->get_maximum_value     = eail_action_slider_get_maximum_value;
+   iface->get_minimum_value     = eail_action_slider_get_minimum_value;
+   iface->set_current_value     = eail_action_slider_set_current_value;
+   iface->get_minimum_increment = eail_action_slider_get_minimum_increment;
+}
diff --git a/eail/eail/eail_action_slider.h b/eail/eail/eail_action_slider.h
new file mode 100644 (file)
index 0000000..bad8ad2
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_action_slider.h
+ *
+ * @brief Header for EailActionSlider implementation
+ */
+
+#ifndef EAIL_ACTION_SLIDER_H
+#define EAIL_ACTION_SLIDER_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailActionSlider class
+ */
+#define EAIL_TYPE_ACTION_SLIDER             (eail_action_slider_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailActionSlider
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_ACTION_SLIDER(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                             EAIL_TYPE_ACTION_SLIDER, EailActionSlider))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailActionSlider class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_ACTION_SLIDER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                             EAIL_TYPE_ACTION_SLIDER, EailActionSliderClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailActionSlider class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_ACTION_SLIDER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                             EAIL_TYPE_ACTION_SLIDER))
+/**
+ * @brief Tests whether given klass is a subclass of EailActionSlider
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_ACTION_SLIDER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                             EAIL_TYPE_ACTION_SLIDER))
+/**
+ * @brief Gets EailActionSlider class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailActionSlider class from
+ */
+#define EAIL_ACTION_SLIDER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                             EAIL_TYPE_ACTION_SLIDER, EailActionSliderClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailActionSlider*/
+typedef struct _EailActionSlider      EailActionSlider;
+/** @brief Definition of object class for Atk EailActionSlider*/
+typedef struct _EailActionSliderClass EailActionSliderClass;
+
+/** @brief Definition of object structure for Atk EailActionSlider*/
+struct _EailActionSlider
+{
+   /** @brief parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailActionSlider*/
+struct _EailActionSliderClass
+{
+   /** @brief class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailActionSlider GType
+ *
+ * @returns GType for EailActionSlider implementation*/
+GType eail_action_slider_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_action_widget.c b/eail/eail/eail_action_widget.c
new file mode 100644 (file)
index 0000000..7b15b51
--- /dev/null
@@ -0,0 +1,317 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_action_widget.c
+ * @brief Implementation of widget that can hold atk actions
+ */
+
+#include <Elementary.h>
+
+#include "eail_action_widget.h"
+#include "eail_priv.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/** @brief ActionObject structure for objects stored in actions list*/
+typedef struct _EailActionObj EailActionObj;
+
+/** @brief ActionObject structure for objects stored in actions list
+ */
+struct _EailActionObj
+{
+   const gchar * name;/*!< \brief action name */
+   const gchar * keybinding;/*!< \brief action keybinding */
+   gchar * description;/*!< \brief action description */
+   Eail_Do_Action_Cb action;/*!< \brief action callback */
+};
+
+/**
+ * @brief Definition of EailActionWidget as GObject
+ */
+G_DEFINE_TYPE_WITH_CODE(EailActionWidget,
+                        eail_action_widget,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkOject(EailActionWidget) to be initialized
+ * @param data additional initialization data (Evas_Object*)
+ */
+static void
+eail_action_widget_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_action_widget_parent_class)->initialize(obj, data);
+
+   EailActionWidget *widget = EAIL_ACTION_WIDGET(obj);
+
+   widget->action_objs = NULL;
+}
+
+/**
+ * @brief Initializer for GObject class
+ *
+ * @param action_widget an AtkOject(EailActionWidget) to be initialized
+ */
+static void
+eail_action_widget_init(EailActionWidget *action_widget)
+{
+}
+
+/**
+ * @brief Deallocates memory for EailActionObj
+ *
+ * @param action_obj an EailActionObj( to be freed
+ */
+static void
+eail_action_obj_free(EailActionObj *action_obj)
+{
+   g_return_if_fail(action_obj);
+
+   if (action_obj->description)
+     g_free(action_obj->description);
+
+   g_free(action_obj);
+}
+
+/**
+ * @brief Finalize function for GObject
+ *
+ * @param object an GObject(EailActionWidget) to be freed
+ */
+static void
+eail_action_widget_finalize(GObject *object)
+{
+   EailActionWidget *widget = NULL;
+   const Eina_List *l = NULL;
+   EailActionObj *action_obj = NULL;
+
+   widget = EAIL_ACTION_WIDGET(object);
+   if (!widget)
+     {
+        ERR("could not get action widget from gobject");
+        return;
+     }
+
+   EINA_LIST_FOREACH(widget->action_objs, l, action_obj)
+     eail_action_obj_free(action_obj);
+
+   eina_list_free(widget->action_objs);
+
+   G_OBJECT_CLASS(eail_action_widget_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Init function for GObject
+ *
+ * @param klass an EailActionWidgetClass to be filled
+ */
+static void
+eail_action_widget_class_init(EailActionWidgetClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_action_widget_initialize;
+   gobject_class->finalize = eail_action_widget_finalize;
+}
+
+/**
+ * @param action_widget ActionWidget instance that holds actions
+ * @param action_name action name
+ * @param keybinding keybinding
+ * @param action_cb callback for action, launched when action is triggered
+ */
+void
+eail_action_widget_action_append(EailActionWidget *action_widget,
+                                 const gchar *action_name,
+                                 const gchar *keybinding,
+                                 Eail_Do_Action_Cb action_cb)
+{
+   if (!action_widget)
+     {
+         ERR("action widget should NOT be NULL");
+         return;
+     }
+
+   EailActionObj *action_def_obj = g_new0(EailActionObj, 1);
+
+   action_def_obj->name = action_name;
+   action_def_obj->keybinding = keybinding;
+   action_def_obj->action = action_cb;
+
+   action_widget->action_objs = eina_list_append
+                              (action_widget->action_objs, action_def_obj);
+
+}
+
+/**
+ * @brief Returns number of implemented ATK Actions.
+ * Implementation of AtkActionIface get_n_actions callback
+ *
+ * @param action object that implements AtkAction interface
+ *
+ * @returns number of actions
+ */
+static int
+eail_action_widget_n_actions_get(AtkAction *action)
+{
+   EailActionWidget *widget =  EAIL_ACTION_WIDGET(action);
+   if (!widget)
+     {
+        ERR("Could not get action widget from action");
+        return 0;
+     }
+
+   return eina_list_count(widget->action_objs);
+}
+
+/**
+ * @brief Returns EailActionObj of action with given index
+ *
+ * @param action object that implements AtkAction interface
+ * @param i index (number) of action
+ *
+ * @returns an EailActionObj* for action with given index
+ */
+static EailActionObj *
+eail_get_action_obj_i(AtkAction *action,
+                      int i)
+{
+   EailActionWidget *widget =  EAIL_ACTION_WIDGET(action);
+   if (!widget)
+     {
+        ERR("Could not get action widget from action");
+        return NULL;
+     }
+
+
+   if (i >= eina_list_count(widget->action_objs))
+     {
+        DBG("Passed index value %d is invalid", i);
+        return NULL;
+     }
+
+   EailActionObj *actionObj = eina_list_nth(widget->action_objs, i);
+
+   return actionObj;
+}
+
+/**
+ * @brief Returns EailActionObj of action with given index
+ *
+ * @param action object that implements AtkAction interface
+ * @param i index (number) of action
+ *
+ * @returns string representation of action name
+ */
+static const gchar*
+eail_action_widget_action_name_get(AtkAction *action,
+                                   int i)
+{
+   EailActionObj *actionObj = eail_get_action_obj_i(action, i);
+   if(!actionObj) return NULL;
+
+   return actionObj->name;
+}
+
+/**
+ * \brief Launches action with given index
+ *
+ * @param action object that implements AtkAction interface
+ * @param i index (number) of action
+ *
+ * @returns TRUE if action was successfully launched, FALSE otherwise
+ */
+static gboolean
+eail_action_widget_do_action(AtkAction *action,
+                             int i)
+{
+   EailActionObj *actionObj = eail_get_action_obj_i(action, i);
+   if(!actionObj) return FALSE;
+
+   return (actionObj->action)(action, NULL);
+}
+
+/**
+ * \brief Gets description for action with given index
+ * Implementation of AtkActionIface get_description callback
+ *
+ * @param action object that implements AtkAction interface
+ * @param i index (number) of action
+ *
+ * @returns string representing description for action
+ */
+static const gchar*
+eail_action_widget_description_get(AtkAction *action,
+                                   int i)
+{
+   EailActionObj *actionObj = eail_get_action_obj_i(action, i);
+   if(!actionObj) return NULL;
+
+   return actionObj->description;
+}
+
+/**
+ * \brief Sets description for action with given index
+ * Implementation of AtkActionIface set_description callback
+ *
+ * @param action object that implements AtkAction interface
+ * @param i index (number) of action
+ * @param description description to set
+ *
+ * @returns TRUE if update operation ended with success, FALSE otherwise
+ */
+static gboolean
+eail_action_widget_description_set(AtkAction *action,
+                                   int i,
+                                   const char *description)
+{
+   EailActionObj *actionObj = eail_get_action_obj_i(action, i);
+   if(!actionObj) return FALSE;
+
+   if (actionObj->description)
+     g_free(actionObj->description);
+
+   actionObj->description = g_strdup(description);
+   return TRUE;
+}
+
+/**
+ * \brief Initializes AtkAction interface
+ *
+ * Function called upon instance creation. It initializes AtkAction interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface interface to be filled
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   if(!iface) return;
+
+   iface->do_action       = eail_action_widget_do_action;
+   iface->get_n_actions   = eail_action_widget_n_actions_get;
+   iface->get_name        = eail_action_widget_action_name_get;
+   iface->get_description = eail_action_widget_description_get;
+   iface->set_description = eail_action_widget_description_set;
+}
diff --git a/eail/eail/eail_action_widget.h b/eail/eail/eail_action_widget.h
new file mode 100644 (file)
index 0000000..44d1e54
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_action_widget.h
+ *
+ * @brief Header for EailActionWidget implementation
+ */
+
+#ifndef EAIL_ACTION_WIDGET_H
+#define EAIL_ACTION_WIDGET_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailActionWidget class
+ */
+#define EAIL_TYPE_ACTION_WIDGET             (eail_action_widget_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailActionWidget
+ * type
+ *
+ * @param obj an AtkObject
+ */
+
+#define EAIL_ACTION_WIDGET(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                             EAIL_TYPE_ACTION_WIDGET, EailActionWidget))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailActionWidget class
+ *
+ * @param klass subclass object
+ */
+
+#define EAIL_ACTION_WIDGET_CLASS(klass)     (G_TYPE_ACTION_WIDGET_CLASS_CAST((klass), \
+                                             EAIL_TYPE_ACTION_WIDGET, EailActionWidgetClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailActionWidget class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_ACTION_WIDGET(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                             EAIL_TYPE_ACTION_WIDGET))
+/**
+ * @brief Tests whether given klass is a subclass of EailActionWidget
+ *
+ * @param klass klass object
+ */
+
+#define EAIL_IS_ACTION_WIDGET_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                             EAIL_TYPE_ACTION_WIDGET))
+/**
+ * @brief Gets EailActionWidget class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailActionWidget class from
+ */
+#define EAIL_ACTION_WIDGET_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                             EAIL_TYPE_ACTION_WIDGET, EailActionWidgetClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailActionWidget*/
+typedef struct _EailActionWidget      EailActionWidget;
+/** @brief Definition of class structure for Atk EailActionWidget*/
+typedef struct _EailActionWidgetClass EailActionWidgetClass;
+
+/*! \brief Callback used for performing work-action by given ActionObject
+ */
+typedef gboolean (* Eail_Do_Action_Cb) (AtkAction *obj, void *data);
+
+/*! \brief Appends given action to action list used by EailActionWidget
+ */
+void eail_action_widget_action_append(EailActionWidget *action_widget,
+                                      const gchar *action_name,
+                                      const gchar *keybinding,
+                                      Eail_Do_Action_Cb action_cb);
+
+/** @brief Definition of object structure for Atk EailActionWidget
+ * */
+struct _EailActionWidget
+{
+   EailWidget parent;/*!< widget that is being extended */
+
+   Eina_List *action_objs;/*!< list of action objects (EailActionObj*) */
+};
+
+/** @brief Definition of class structure for Atk EailActionWidget
+ * */
+struct _EailActionWidgetClass
+{
+   EailWidgetClass parent_class;/**< class whose functionality is being extended*/
+};
+
+/** @brief Getter for EailActionWidget GType
+ * @returns GType for EailActionWidget implementation
+ * */
+GType eail_action_widget_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_app.c b/eail/eail/eail_app.c
new file mode 100644 (file)
index 0000000..88eb1f3
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_app.c
+ * @brief Implementation of elementary application
+ */
+
+#include <Elementary.h>
+
+#include "eail_app.h"
+#include "eail_factory.h"
+#include "eail_dynamic_content.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+/** @brief This is defined and filled in elementary.*/
+extern Eina_List *_elm_win_list;
+
+static void eail_dynamic_content_interface_init(EailDynamicContentIface *iface);
+
+/**
+ * @brief Definition of EailApp as GObject
+ *
+ * EailApp is extended ATK_TYPE_OBJECT with EAIL_TYPE_DYNAMIC_CONTENT iface
+ * implemented
+ */
+
+G_DEFINE_TYPE_WITH_CODE(EailApp, eail_app, ATK_TYPE_OBJECT,
+                    G_IMPLEMENT_INTERFACE(EAIL_TYPE_DYNAMIC_CONTENT,
+                                          eail_dynamic_content_interface_init));
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject to be initialized
+ * @param data additional initialization data (Evas_Object*)
+ */
+static void
+eail_app_initialize(AtkObject *obj, gpointer data)
+{
+   int argc;
+   char **argv;
+   EailApp *eail_app = NULL;
+
+   ATK_OBJECT_CLASS(eail_app_parent_class)->initialize(obj, data);
+
+   ecore_app_args_get(&argc, &argv);
+   obj->name = argv ? g_strdup((gchar *)ecore_file_file_get(argv[0])) : NULL;
+   obj->role = ATK_ROLE_APPLICATION;
+   obj->accessible_parent = NULL;
+
+   /* storing last numbers of children to be for checking if children-changed
+     * signal has to be propagated */
+   eail_app = EAIL_APP(obj);
+   eail_app->child_count_last = atk_object_get_n_accessible_children(obj);
+}
+
+/**
+ * @brief Destructor for EailApp object
+ * @param obj obj to be freed
+ */
+static void
+eail_app_class_finalize(GObject *obj)
+{
+   G_OBJECT_CLASS(eail_app_parent_class)->finalize(obj);
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject (EailApp)
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_app_get_n_children(AtkObject *obj)
+{
+   return eina_list_count(_elm_win_list);
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject (EailApp)
+ * @param i index number
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_app_ref_child(AtkObject *obj, gint i)
+{
+   AtkObject *child = NULL;
+
+   if (eina_list_count(_elm_win_list) > i)
+     {
+        Evas_Object *tmp = eina_list_nth(_elm_win_list, i);
+        child = eail_factory_get_accessible(tmp);
+        g_object_ref(child);
+     }
+
+   return child;
+}
+
+/**
+ * @brief Initializer for GObject class
+ * @param app an object to be initialized
+ */
+static void
+eail_app_init(EailApp *app)
+{
+}
+
+/**
+ * @brief Initializer for GObject EailAppClass class (defines callbacks for base
+ * AtkObject)
+ *
+ * @param klass an EailAppClass class to be filled
+ */
+static void
+eail_app_class_init(EailAppClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_app_initialize;
+   class->get_n_children = eail_app_get_n_children;
+   class->ref_child = eail_app_ref_child;
+   class->get_parent = NULL;
+
+   g_object_class->finalize = eail_app_class_finalize;
+}
+
+/**
+ * @param dynamic_content_holder an EailDynamicContent object (EailApp)
+ */
+void
+eail_app_update_descendants(EailDynamicContent *dynamic_content_holder)
+{
+   DBG(">");
+   gint n_children = 0;
+   EailApp *app = NULL;
+   if (!EAIL_IS_APP(dynamic_content_holder))
+     {
+        DBG("No EailApp found. Returning");
+        return;
+     }
+
+   app = EAIL_APP(dynamic_content_holder);
+
+   n_children = atk_object_get_n_accessible_children(ATK_OBJECT(app));
+   if (n_children && n_children > app->child_count_last)
+     {
+         DBG("emit changed add");
+        eail_emit_children_changed(TRUE, ATK_OBJECT(app), n_children - 1);
+     }
+   else if (n_children < app->child_count_last)
+     {
+         DBG("emit changed remove");
+         eail_emit_children_changed
+                     (FALSE, ATK_OBJECT(app), app->child_count_last);
+     }
+
+   app->child_count_last = n_children;
+}
+
+/**
+ * @brief Initializer for dynamic content interface, used for handling objects
+ * children hierarchy changes
+ *
+ * @param iface an EailDynamicContentIface
+ */
+static void
+eail_dynamic_content_interface_init(EailDynamicContentIface *iface)
+{
+   iface->update_hierarchy = eail_app_update_descendants;
+}
diff --git a/eail/eail/eail_app.h b/eail/eail/eail_app.h
new file mode 100644 (file)
index 0000000..f4c7b01
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_app.h
+ *
+ * @brief Header for EailApp implementation
+ */
+
+#ifndef EAIL_APP_H
+#define EAIL_APP_H
+
+#include <atk/atk.h>
+
+/**
+ * @brief Returns a value corresponding to the type of EailApp class
+ */
+#define EAIL_TYPE_APP             (eail_app_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailApp
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_APP(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                   EAIL_TYPE_APP, EailApp))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailApp class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_APP_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                   EAIL_TYPE_APP, EailAppClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailApp class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_APP(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                   EAIL_TYPE_APP))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailApp
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_APP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                   EAIL_TYPE_APP))
+
+/**
+ * @brief Gets EailApp class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailApp class from
+ */
+#define EAIL_APP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                   EAIL_TYPE_APP, EailAppClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailApp*/
+typedef struct _EailApp      EailApp;
+/** @brief Definition of class structure for Atk EailApp*/
+typedef struct _EailAppClass EailAppClass;
+
+/** @brief Definition of object structure for Atk EailBackground*/
+struct _EailApp
+{
+   /** @brief parent AtkObject that functionality is being extended */
+   AtkObject parent;
+   gint child_count_last;/**< @brief last reported count of children */
+};
+
+/** @brief Definition of class structure for Atk EailBackground*/
+struct _EailAppClass
+{
+   /** @brief parent class whose functionality is being extended */
+   AtkObjectClass parent_class;
+};
+
+/** @brief Getter for EailApp GType
+ *
+ * @returns GType for EailApp implementation*/
+GType eail_app_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_background.c b/eail/eail/eail_background.c
new file mode 100644 (file)
index 0000000..2ad8c30
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_background.c
+ * @brief EailBackground implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_background.h"
+
+static void atk_image_interface_init(AtkImageIface *iface);
+
+/**
+ * @brief EailBackground type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailBackground,
+                        eail_background,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              atk_image_interface_init));
+
+/* AtkObject */
+static void eail_background_initialize(AtkObject *obj, gpointer data);
+static void eail_background_finalize(GObject *object);
+static AtkAttributeSet *eail_background_get_attributes(AtkObject *obj);
+
+/* AtkImage */
+static void eail_background_get_image_position (AtkImage *image,
+                                                gint *x,
+                                                gint *y,
+                                                AtkCoordType coord_type);
+static const gchar *eail_background_get_image_description(AtkImage *image);
+static gboolean eail_background_set_image_description(AtkImage *image,
+                                                      const gchar *description);
+static void eail_background_get_image_size(AtkImage *image,
+                                           gint *width,
+                                           gint *height);
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief EailBackground class initializer
+ *
+ * @param klass an EailBackgroundClass
+ */
+static void
+eail_background_class_init(EailBackgroundClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_background_initialize;
+   class->get_attributes = eail_background_get_attributes;
+
+   object_class->finalize = eail_background_finalize;
+}
+
+/**
+ * @brief EailBackground initializer
+ *
+ * @param obj an AtkObject (EailBackground) to be initialized
+ * @param data additional data (Evas_Object*)
+ */
+static void
+eail_background_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_background_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_IMAGE;
+}
+
+/**
+ * @brief EailBackground finalizer
+ *
+ * Destroys object and allocated resources
+ *
+ * @param object an EailBackground object to be finalized
+ */
+static void
+eail_background_finalize(GObject *object)
+{
+   EailBackground *bg = EAIL_BACKGROUND(object);
+
+   if (bg->description) free(bg->description);
+
+   G_OBJECT_CLASS(eail_background_parent_class)->finalize(object);
+}
+
+/**
+ * @brief EailBackground instance initializer
+ *
+ * @param background an EailBackground
+ */
+static void
+eail_background_init(EailBackground *background)
+{
+   background->description = NULL;
+}
+
+/**
+ * @brief Gets obj attributes set
+ *
+ * The caller must unreference it when it is no longer needed.
+ *
+ * @param obj an AtkObject
+ * @return attributes set
+ */
+static AtkAttributeSet *
+eail_background_get_attributes(AtkObject *obj)
+{
+   AtkAttribute *attr;
+   AtkAttributeSet *attributes;
+   Evas_Object *widget;
+   int r, g, b;
+   gchar color[8];
+   const char *mode, *file;
+
+   attributes = ATK_OBJECT_CLASS(eail_background_parent_class)->get_attributes(obj);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return attributes;
+
+   elm_bg_file_get(widget, &file, NULL);
+   if (!file)
+     {
+        elm_bg_color_get(widget, &r, &g, &b);
+        sprintf(color, "#%02x%02x%02x", r, g, b);
+        attr = g_new(AtkAttribute, 1);
+        attr->name = g_strdup("color");
+        attr->value = g_strdup(color);
+        attributes = g_slist_append(attributes, attr);
+     }
+   else
+     {
+        attr = g_new(AtkAttribute, 1);
+        attr->name = g_strdup("file");
+        attr->value = g_strdup(file);
+        attributes = g_slist_append(attributes, attr);
+     }
+
+   switch (elm_bg_option_get(widget))
+     {
+       case ELM_BG_OPTION_CENTER:
+           mode = "center";
+           break;
+       case ELM_BG_OPTION_SCALE:
+           mode = "scale";
+           break;
+       case ELM_BG_OPTION_STRETCH:
+           mode = "stretch";
+           break;
+       case ELM_BG_OPTION_TILE:
+           mode = "tile";
+           break;
+       default:
+           mode = "";
+           break;
+     }
+
+   attr = g_new(AtkAttribute, 1);
+   attr->name = g_strdup("display mode");
+   attr->value = g_strdup(mode);
+   attributes = g_slist_append(attributes, attr);
+
+   return attributes;
+}
+
+
+/*
+ * AtkImage interface implementation
+ */
+
+/**
+ * @brief AtkImage interface initializer
+ *
+ * @param iface an AtkImageIface
+ */
+static void
+atk_image_interface_init(AtkImageIface *iface)
+{
+   g_return_if_fail(iface);
+
+   iface->get_image_description = eail_background_get_image_description;
+   iface->set_image_description = eail_background_set_image_description;
+   iface->get_image_size = eail_background_get_image_size;
+   iface->get_image_position = eail_background_get_image_position;
+}
+
+/**
+ * @brief Gets background image position.
+ *
+ * Position is in the form of a point specifying background top-left corner
+ *
+ * @param image an AtkImage instance
+ * @param [out] x x coordinate 
+ * @param [out] y y coordinate 
+ * @param coord_type xy coordinate interpretation
+ */
+static void
+eail_background_get_image_position(AtkImage *image,
+                                   gint *x,
+                                   gint *y,
+                                   AtkCoordType coord_type)
+{
+   atk_component_get_position(ATK_COMPONENT(image), x, y, coord_type);
+}
+
+/**
+ * @brief Gets background image description
+ *
+ * @param image an AtkImage
+ * @return description
+ */
+static const gchar *
+eail_background_get_image_description(AtkImage *image)
+{
+   EailBackground *bg;
+   const gchar *desc;
+
+   g_return_val_if_fail(EAIL_IS_BACKGROUND(image), NULL);
+
+   bg = EAIL_BACKGROUND(image);
+   if (!bg) return NULL;
+
+   desc = bg->description;
+
+   return desc;
+}
+
+/**
+ * @brief Sets background image description
+ *
+ * @param image an AtkImage
+ * @param description new image description
+ * @return TRUE if description is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_background_set_image_description(AtkImage *image,
+                                      const gchar *description)
+{
+   EailBackground *bg;
+
+   g_return_val_if_fail(EAIL_IS_BACKGROUND(image), FALSE);
+
+   bg = EAIL_BACKGROUND(image);
+   if (!bg) return FALSE;
+
+   if (bg->description)
+     free(bg->description);
+
+   bg->description = g_strdup(description);
+   if (!bg->description) return FALSE;
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets background widget size
+ *
+ * @param image an AtkImage
+ * @param [out] width background width 
+ * @param [out] height background height 
+ */
+static void
+eail_background_get_image_size(AtkImage *image,
+                               gint *width,
+                               gint *height)
+{
+   EailBackground *bg;
+   Evas_Object *widget;
+
+   bg = EAIL_BACKGROUND(image);
+   if (!bg)
+     *width = *height = -1;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     return;
+
+   evas_object_geometry_get(widget, NULL, NULL, width, height);
+}
diff --git a/eail/eail/eail_background.h b/eail/eail/eail_background.h
new file mode 100644 (file)
index 0000000..faccbc7
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_background.h
+ *
+ * @brief Header for EailBackground implementation
+ */
+
+#ifndef EAIL_BACKGROUND_H
+#define EAIL_BACKGROUND_H
+
+#include "eail_image.h"
+/**
+ * @brief Returns a value corresponding to the type of EailBackground class
+ */
+#define EAIL_TYPE_BACKGROUND             (eail_background_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailBackground
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_BACKGROUND(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                          EAIL_TYPE_BACKGROUND, EailBackground))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailBackground class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_BACKGROUND_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                          EAIL_TYPE_BACKGROUND, EailBackgroundClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailBackground class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_BACKGROUND(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                          EAIL_TYPE_BACKGROUND))
+/**
+ * @brief Tests whether given klass is a subclass of EailBackground
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_BACKGROUND_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                          EAIL_TYPE_BACKGROUND))
+/**
+ * @brief Gets EailBackground class structure from an obj (class instance)
+ *
+ * @param obj
+ */
+#define EAIL_BACKGROUND_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                          EAIL_TYPE_BACKGROUND, EailBackgroundClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailBackground*/
+typedef struct _EailBackground      EailBackground;
+/** @brief Definition of class structure for Atk EailBackground*/
+typedef struct _EailBackgroundClass EailBackgroundClass;
+
+/** @brief Definition of object structure for Atk EailBackground*/
+struct _EailBackground
+{
+   EailWidget parent;/*!< @brief widget that functionality is being extended*/
+
+   char *description;/*!< @brief background description */
+};
+
+/** @brief Definition of class structure for Atk EailBackground*/
+struct _EailBackgroundClass
+{
+   EailWidgetClass parent_class;/*!< parent class that is extended*/
+};
+
+/**
+ * @brief Getter for EailBackground GType object
+ *
+ * @returns GType for EailBackground implementation
+ */
+GType eail_background_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_box.c b/eail/eail/eail_box.c
new file mode 100644 (file)
index 0000000..e426e6a
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_box.c
+ * @brief EailBox implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_box.h"
+
+/**
+ * @brief EailBox type definition
+ */
+G_DEFINE_TYPE(EailBox, eail_box, EAIL_TYPE_WIDGET);
+
+/**
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief EailBox initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_box_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_box_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_FILLER;
+}
+
+/**
+ * @brief Gets widget children
+ *
+ * @param widget an EailWidget
+ * @return widget children list
+ */
+static Eina_List *
+eail_box_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *obj = eail_widget_get_widget(widget);
+
+   if (obj)
+     list = elm_box_children_get(obj);
+
+   return list;
+}
+
+/**
+ * @brief EailBox instance initializer
+ *
+ * @param box an EailBox
+ */
+static void
+eail_box_init(EailBox *box)
+{
+}
+
+/**
+ * @brief EailBox class initializer
+ *
+ * @param klass an EailBoxClass
+ */
+static void
+eail_box_class_init(EailBoxClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   widget_class->get_widget_children = eail_box_get_widget_children;
+
+   class->initialize = eail_box_initialize;
+}
diff --git a/eail/eail/eail_box.h b/eail/eail/eail_box.h
new file mode 100644 (file)
index 0000000..6e2bbca
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_box.h
+ *
+ * @brief Header for EailBox implementation
+ */
+
+#ifndef EAIL_BOX_H
+#define EAIL_BOX_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailBox class
+ */
+#define EAIL_TYPE_BOX              (eail_box_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailBox
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_BOX(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                    EAIL_TYPE_BOX, EailBox))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailBox class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_BOX_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                    EAIL_TYPE_BOX, EailBoxClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailBox class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_BOX(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                    EAIL_TYPE_BOX))
+/**
+ * @brief Tests whether given klass is a subclass of EailBox
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_BOX_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                    EAIL_TYPE_BOX))
+/**
+ * @brief Gets EailBox class structure from an obj (class instance)
+ *
+ * @param obj obj object instance to get EailBox class from
+ */
+#define EAIL_BOX_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                    EAIL_TYPE_BOX, EailBoxClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailBox*/
+typedef struct _EailBox      EailBox;
+/** @brief Definition of class structure for Atk EailBox*/
+typedef struct _EailBoxClass EailBoxClass;
+
+/** @brief Definition of object structure for Atk EailBox*/
+struct _EailBox
+{
+   /** @brief parent object that functionality is being extended */
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailBox*/
+struct _EailBoxClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailBox GType
+ *
+ * @returns GType for EailBox implementation
+ * */
+GType eail_box_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_bubble.c b/eail/eail/eail_bubble.c
new file mode 100644 (file)
index 0000000..938b080
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_bubble.c
+ * @brief Implementation of EailBubble
+ */
+
+#include <Elementary.h>
+
+#include "eail_bubble.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/**
+ * @brief Definition of EailBubble type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailBubble,
+                        eail_bubble,
+                        EAIL_TYPE_TEXT,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief EailBubble object initialization
+ *
+ * @param obj EailBubble object
+ * @param data user set additional initialization data
+ */
+static void
+eail_bubble_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_bubble_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_FILLER;
+}
+
+/**
+ * @brief Class destructor
+ *
+ * @param object object instance
+ */
+static void
+eail_bubble_finalize(GObject *object)
+{
+   EailBubble *bubble = EAIL_BUBBLE(object);
+
+   if (bubble->click_description) free(bubble->click_description);
+
+   G_OBJECT_CLASS(eail_bubble_parent_class)->finalize(object);
+}
+
+/**
+ * @brief EailBubble instance initialization
+ *
+ * @param bubble EailBubble instance
+ */
+static void
+eail_bubble_init(EailBubble *bubble)
+{
+   bubble->click_description = NULL;
+}
+
+/**
+ * @brief Gets list of child widget
+ *
+ * @param widget EailWidget object
+ *
+ * @return list of child, NULL if no children
+ */
+static Eina_List *
+eail_bubble_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *child, *obj;
+
+   obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+
+   if (obj)
+     {
+        child = elm_object_part_content_get(obj, "default");
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+
+        child = elm_object_part_content_get(obj, "icon");
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+     }
+
+   return list;
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailBubble class
+ */
+static void
+eail_bubble_class_init(EailBubbleClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_bubble_initialize;
+   widget_class->get_widget_children = eail_bubble_get_widget_children;
+   gobject_class->finalize = eail_bubble_finalize;
+}
+
+/*
+ * Implementation of the *AtkAction* interface
+ */
+
+/**
+ * @brief Implementation of get_n_actions from AtkAction interface
+ *
+ * @param action EailBubble instance
+ *
+ * @returns number of actions
+ */
+static int
+eail_bubble_n_actions_get(AtkAction *action)
+{
+   return 1;
+}
+
+/**
+ * @brief Implementation of get_description from AtkAction interface
+ *
+ * @param action EailBubble instance
+ * @param i action index
+ *
+ * @return action description
+ */
+static const char*
+eail_bubble_description_get(AtkAction *action,
+                            gint i)
+{
+   EailBubble *bubble;
+   const char *action_description;
+
+   bubble = EAIL_BUBBLE(action);
+   if (!bubble) return NULL;
+
+   switch (i)
+     {
+      case 0:
+         action_description = bubble->click_description;
+         break;
+      default:
+         action_description = NULL;
+         break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Implementation of set_descritpion from AtkAction interface
+ *
+ * @param action EailBubble instance
+ * @param i action index
+ * @param description action description
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_bubble_description_set(AtkAction *action,
+                            gint i,
+                            const char *description)
+{
+   EailBubble *bubble;
+   char **value;
+
+   bubble = EAIL_BUBBLE(action);
+   if (!bubble) return FALSE;
+
+   switch (i)
+     {
+      case 0:
+         value = &bubble->click_description;
+         break;
+      default:
+         value = NULL;
+         break;
+     }
+
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(description);
+        return TRUE;
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief Implementation of get_name from AtkAction interface
+ *
+ * @param action EailBubble instance
+ * @param i action index
+ *
+ * @return action name
+ */
+static const char*
+eail_bubble_action_name_get(AtkAction *action,
+                            int i)
+{
+   const char* action_name;
+
+   switch (i)
+     {
+      case 0:
+         action_name = "click";
+         break;
+      default:
+         action_name = NULL;
+         break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Implementation of do_action from AtkAction interface
+ *
+ * @param action EailBubble instance
+ * @param i action index
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_bubble_do_action(AtkAction *action,
+                      int i)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   const char *action_name = atk_action_get_name(action, i);
+   if (!action_name) return FALSE;
+
+   evas_object_smart_callback_call(widget, "clicked", NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief AtkAction interface initializer
+ *
+ * @param iface action interface to be filled
+ **/
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_n_actions   = eail_bubble_n_actions_get;
+   iface->get_description = eail_bubble_description_get;
+   iface->set_description = eail_bubble_description_set;
+   iface->get_name        = eail_bubble_action_name_get;
+   iface->do_action       = eail_bubble_do_action;
+}
diff --git a/eail/eail/eail_bubble.h b/eail/eail/eail_bubble.h
new file mode 100644 (file)
index 0000000..07c87cd
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_bubble.h
+ *
+ * @brief Header for EailBubble implementation
+ */
+
+#ifndef EAIL_BUBBLE_H
+#define EAIL_BUBBLE_H
+
+#include "eail_text.h"
+/**
+ * @brief Returns a value corresponding to the type of EailBubble class
+ */
+#define EAIL_TYPE_BUBBLE             (eail_bubble_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailBubble
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_BUBBLE(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                      EAIL_TYPE_BUBBLE, EailBubble))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailBubble class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_BUBBLE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                      EAIL_TYPE_BUBBLE, EailBubbleClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailBubble class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_BUBBLE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                      EAIL_TYPE_BUBBLE))
+/**
+ * @brief Tests whether given klass is a subclass of EailBubble
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_BUBBLE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                      EAIL_TYPE_BUBBLE))
+/**
+ * @brief Gets EailBubble class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailBubble class from
+ */
+#define EAIL_BUBBLE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                      EAIL_TYPE_BUBBLE, EailBubbleClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailBubble*/
+typedef struct _EailBubble      EailBubble;
+/** @brief Definition of class structure for Atk EailBubble*/
+typedef struct _EailBubbleClass EailBubbleClass;
+
+/** @brief Definition of object structure for Atk EailBubble*/
+struct _EailBubble
+{
+   EailText parent; /*!< parent class object*/
+   char *click_description; /*!< click action description*/
+};
+
+/** @brief Definition of class structure for Atk EailBubble*/
+struct _EailBubbleClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailTextClass parent_class;
+};
+
+/** @brief Getter for EailBubble GType
+ *
+ * @returns GType for EailBubble implementation
+ * */
+GType eail_bubble_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_button.c b/eail/eail/eail_button.c
new file mode 100644 (file)
index 0000000..e7593d1
--- /dev/null
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_button.c
+ * @brief EailButton implementation
+ */
+
+#include <Elementary.h>
+#include "eail_button.h"
+#include "eail_factory.h"
+#include "eail_priv.h"
+#include "eail_utils.h"
+
+static void atk_image_interface_init(AtkImageIface *iface);
+static void atk_text_interface_init(AtkTextIface *iface);
+
+/**
+ * @brief Define EailButton GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailButton,
+                        eail_button,
+                        EAIL_TYPE_ACTION_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              atk_image_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init));
+
+/**
+ * @brief Implementation of get_image_position from AtkImage interface
+ *
+ * @param image EailButton instance
+ * @param [out] x horizontal coordinate
+ * @param [out] y vertical coordinate
+ * @param coord_type coord type
+ */
+static void
+eail_button_get_image_position(AtkImage     *image,
+                               gint         *x,
+                               gint         *y,
+                               AtkCoordType  coord_type)
+{
+   Evas_Object *button_image;
+   Evas_Object *widget;
+   AtkObject *obj;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     {
+        *x = G_MININT;
+        *y = G_MININT;
+        return;
+     }
+
+   button_image = elm_object_part_content_get(widget, "icon");
+   if (button_image)
+     {
+        obj = eail_factory_get_accessible(button_image);
+        atk_image_get_image_position(ATK_IMAGE(obj), x, y, coord_type);
+     }
+   else
+     {
+        *x = G_MININT;
+        *y = G_MININT;
+     }
+}
+
+/**
+ * @brief Implementation of get_image_size from AtkImage interface
+ *
+ * @param image EailButton instance
+ * @param [out] width width image
+ * @param [out] height height image
+ */
+static void
+eail_button_get_image_size(AtkImage *image,
+                           gint     *width,
+                           gint     *height)
+{
+   Evas_Object *widget;
+   Evas_Object *button_image;
+   AtkObject *obj;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     {
+        *width = -1;
+        *height = -1;
+        return;
+     }
+
+   button_image = elm_object_part_content_get(widget, "icon");
+   if (button_image)
+     {
+        obj = eail_factory_get_accessible(button_image);
+        atk_image_get_image_size(ATK_IMAGE(obj), width, height);
+     }
+   else
+     {
+        *width = -1;
+        *height = -1;
+     }
+}
+
+/**
+ * @brief AtkImage iterface initializer
+ *
+ * @param iface an AtkImageIface
+ */
+static void
+atk_image_interface_init(AtkImageIface *iface)
+{
+   iface->get_image_position = eail_button_get_image_position;
+   iface->get_image_size     = eail_button_get_image_size;
+}
+
+/**
+ * @brief Gets text bounded by start_offset and end_offset
+ *
+ * Use g_free() to free the returned string
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, -1 for the end of the string
+ *
+ * @return string containing text from start_offset up to, but not including
+ * end_offset
+ */
+static gchar*
+eail_button_get_text(AtkText   *text,
+                     gint       start_offset,
+                     gint       end_offset)
+{
+   gchar *string = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     string = (gchar *)elm_object_text_get(widget);
+
+   return eail_get_substring(string, start_offset, end_offset);
+}
+
+/**
+ * @brief Gets character at offset
+ *
+ * @param text an AtkText
+ * @param offset character offset
+ * @returns character at offset
+ */
+static gunichar
+eail_button_get_character_at_offset(AtkText    *text,
+                                    gint        offset)
+{
+   gunichar character = '\0';
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     character = g_utf8_get_char(
+         g_utf8_offset_to_pointer(elm_object_text_get(widget), offset));
+
+   return character;
+}
+
+/**
+ * @brief Gets text length
+ *
+ * @param text an AtkText
+ * @returns text length
+ */
+static gint
+eail_button_get_character_count(AtkText *text)
+{
+   gint count = 0;
+   const gchar *string_text = NULL;
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (!widget) return count;
+
+   string_text = elm_object_text_get(widget);
+   if (!string_text) return count;
+
+   count = g_utf8_strlen(string_text, -1);
+
+   return count;
+}
+
+/**
+ * @brief AtkText interface initializer
+ *
+ * @param iface an AtkTextIface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+   iface->get_text = eail_button_get_text;
+   iface->get_character_at_offset = eail_button_get_character_at_offset;
+   iface->get_character_count = eail_button_get_character_count;
+}
+
+/**
+ * @brief Notifies atk about button press event
+ *
+ * @param data data that was passed to event
+ * @param obj an Evas_Object that received event
+ * @param event_info additional event info
+ */
+static void
+eail_button_atk_notify_press(void *data, Evas_Object *obj, void *event_info)
+{
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_PRESSED, TRUE);
+}
+
+/**
+ * @brief Notifies atk about button release event
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+static void
+eail_button_atk_notify_release(void *data, Evas_Object *obj, void *event_info)
+{
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_PRESSED, FALSE);
+   eail_notify_child_focus_changes();
+}
+
+/**
+ * @brief Click action callback
+ *
+ * @param action an AtkAction
+ * @param data user data passed to callback
+ *
+ * @returns TRUE if action was successfull, FALSE otherwise
+ */
+static gboolean
+eail_button_action_click_cb(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   evas_object_smart_callback_call(widget, "clicked", NULL);
+   eail_button_atk_notify_press(action, NULL, NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief Press action callback
+ *
+ * @param action an AtkAction
+ * @param data user data passed to callback
+ *
+ * @returns TRUE if action was successfull, FALSE otherwise
+ */
+static gboolean
+eail_button_action_press_cb(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   evas_object_smart_callback_call(widget, "pressed", NULL);
+   eail_button_atk_notify_press(action, NULL, NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief Release action callback
+ *
+ * @param action an AtkAction
+ * @param data user data passed to callback
+ *
+ * @returns TRUE if action was successfull, FALSE otherwise
+ */
+static gboolean
+eail_button_action_release_cb(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   evas_object_smart_callback_call(widget, "unpressed", NULL);
+   eail_button_atk_notify_release(action, NULL, NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief Sets EailButton actions
+ *
+ * @param action_widget an EailActionWidget
+ */
+static void
+eail_button_actions_init(EailActionWidget *action_widget)
+{
+   eail_action_widget_action_append(action_widget,
+                                    "click", NULL,
+                                    eail_button_action_click_cb);
+   eail_action_widget_action_append(action_widget,
+                                    "press", NULL,
+                                    eail_button_action_press_cb);
+   eail_action_widget_action_append(action_widget,
+                                    "release", NULL,
+                                    eail_button_action_release_cb);
+}
+
+/**
+ * @brief EailButton object initialization
+ *
+ * @param obj EailButton object
+ * @param data user set additional initialization data
+ */
+static void
+eail_button_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_button_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_PUSH_BUTTON;
+
+   evas_object_smart_callback_add((Evas_Object*) data, "pressed",
+                                  eail_button_atk_notify_press, obj);
+   evas_object_smart_callback_add((Evas_Object*) data, "unpressed",
+                                  eail_button_atk_notify_release, obj);
+
+   eail_button_actions_init(EAIL_ACTION_WIDGET(obj));
+}
+
+/**
+ * @brief Gets list of child widget
+ *
+ * @param widget EailWidget object
+ *
+ * @returns list of child, NULL if no children
+ */
+static Eina_List *
+eail_button_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *child, *obj;
+
+   obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+   if (obj)
+     {
+        child = elm_object_part_content_get(obj, "icon");
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+     }
+
+   return list;
+}
+
+/**
+ * @brief Gets obj accessible name
+ *
+ * @param obj an AtkObject
+ *
+ * @returns obj name
+ */
+static const gchar*
+eail_button_get_name(AtkObject *obj)
+{
+   Evas_Object *widget;
+   const char *atk_name;
+
+   g_return_val_if_fail(EAIL_IS_BUTTON(obj), NULL);
+
+   atk_name = ATK_OBJECT_CLASS(eail_button_parent_class)->get_name(obj);
+   if (atk_name)
+     return atk_name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   return elm_object_text_get(widget);
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailButton class
+ */
+static void
+eail_button_class_init(EailButtonClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   class->initialize = eail_button_initialize;
+   class->get_name = eail_button_get_name;
+   widget_class->get_widget_children = eail_button_get_widget_children;
+}
+
+/**
+ * @brief EailButton instance initializer
+ *
+ * @param button an EailButton
+ */
+static void
+eail_button_init(EailButton *button)
+{
+}
diff --git a/eail/eail/eail_button.h b/eail/eail/eail_button.h
new file mode 100644 (file)
index 0000000..ec01243
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_button.h
+ *
+ * @brief Header for EailButton implementation
+ */
+
+#ifndef EAIL_BUTTON_H
+#define EAIL_BUTTON_H
+
+#include "eail_action_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailButton class
+ */
+#define EAIL_TYPE_BUTTON             (eail_button_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailButton
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_BUTTON(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                      EAIL_TYPE_BUTTON, EailButton))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailButton class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_BUTTON_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                      EAIL_TYPE_BUTTON, EailButtonClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailButton class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_BUTTON(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                      EAIL_TYPE_BUTTON))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailButton
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_BUTTON_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                      EAIL_TYPE_BUTTON))
+/**
+ * @brief Gets EailButton class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailButton class from
+ */
+#define EAIL_BUTTON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                      EAIL_TYPE_BUTTON, EailButtonClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailButton*/
+typedef struct _EailButton      EailButton;
+
+/** @brief Definition of class structure for Atk EailButton*/
+typedef struct _EailButtonClass EailButtonClass;
+
+/** @brief Definition of object structure for Atk EailButton*/
+struct _EailButton
+{
+   /** @brief parent AtkObject that functionality is being extended */
+   EailActionWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailButton*/
+struct _EailButtonClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailActionWidgetClass parent_class;
+};
+
+/**
+ * @brief Getter for EailButton GType
+ * @return GType for EailButton implementation
+ */
+GType eail_button_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_calendar.c b/eail/eail/eail_calendar.c
new file mode 100644 (file)
index 0000000..8954861
--- /dev/null
@@ -0,0 +1,321 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_calendar.c
+ * @brief EailCalendar implementation
+ */
+
+#include <Elementary.h>
+#include "eail_calendar.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief Define EailCalendar GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailCalendar,
+                        eail_calendar,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/**
+ * @brief EailCalendar object initialization
+ *
+ * Main task is to set role for AtkObject.
+ *
+ * @param  obj an AtkObject
+ * @param  data initialization data
+ */
+static void eail_calendar_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_calendar_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_CALENDAR;
+}
+
+/**
+ * @brief EailCalendar instance initialization
+ *
+ * EailCalendar does not have any fields to initialize in struct EailCalendar
+ * thus this function is emp but still it has to be defined.
+ *
+ * @param  calendar EailCalendar instance
+ */
+static void
+eail_calendar_init(EailCalendar *calendar)
+{
+}
+
+/**
+ * @brief EailCalendar class initialization function
+ *
+ * Purpose of this function is to initialize AtkObjectClass method pointers
+ * with class's implementations.
+ *
+ * @param  klass EailCalendar class
+ */
+static void
+eail_calendar_class_init(EailCalendarClass *klass)
+{
+   AtkObjectClass *class;
+
+   class = ATK_OBJECT_CLASS(klass);
+   class->initialize = eail_calendar_initialize;
+}
+
+/**
+ * @brief Gets obj current value
+ *
+ * Gets callendar date
+ *
+ * Example:
+ * @code
+ * AtkObject *obj; // AtkObject representing EailCalendar
+ * GValue value = G_VALUE_INIT;
+ * eail_calendar_get_current_value(ATK_VALUE(obj), &value);
+ * @endcode
+ *
+ * @param obj an AtkValue
+ * @param [out] value obj current value for date
+ */
+static void
+eail_calendar_get_current_value(AtkValue *obj,
+                                GValue   *value)
+{
+   Evas_Object *widget;
+   struct tm current;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_calendar_selected_time_get(widget, &current);
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, mktime(&current));
+}
+
+/**
+ * @brief Gets obj maxiumum value
+ *
+ * Gets maximum date that can be set for callendar.
+ *
+ * Example:
+ * @code
+ * AtkObject *obj; //AtkObject representing EailCalendar
+ * GValue value = G_VALUE_INIT;
+ * eail_calendar_get_maximum_value(ATK_VALUE(obj), &value);
+ * @endcode
+ *
+ * @param  obj an AtkValue
+ * @param [out] value obj maxiumum value
+ */
+static void
+eail_calendar_get_maximum_value(AtkValue *obj,
+                                GValue   *value)
+{
+   Evas_Object *widget;
+   struct tm maximum;
+   int min, max;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_calendar_min_max_year_get(widget, &min, &max);
+
+   memset(&maximum, 0, sizeof(maximum));
+
+   if (min < max)
+     {
+        maximum.tm_year = max - 1900;
+        maximum.tm_mon = 11;
+        maximum.tm_mday = 31;
+        maximum.tm_hour = 23;
+        maximum.tm_min = 59;
+        maximum.tm_sec = 59;
+     }
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, mktime(&maximum));
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * Gets minimum date than can be set for callendar
+ *
+ * Example:
+ * @code
+ * AtkObject *obj; //AtkObject representing EailCalendar
+ * GValue value = G_VALUE_INIT;
+ * eail_calendar_get_minimum_value(ATK_VALUE(obj), &value);
+ * @endcode
+ *
+ * @param obj an AtkObject
+ * @param [out] value obj minimum value
+ */
+static void
+eail_calendar_get_minimum_value(AtkValue *obj,
+                                GValue   *value)
+{
+   Evas_Object *widget;
+   struct tm minimum;
+   int min, max;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_calendar_min_max_year_get(widget, &min, &max);
+
+   memset(&minimum, 0, sizeof(minimum));
+
+   if (min < max)
+     {
+        minimum.tm_year = min - 1900;
+        minimum.tm_mon = 0;
+        minimum.tm_mday = 1;
+        minimum.tm_hour = 0;
+        minimum.tm_min = 0;
+        minimum.tm_sec = 0;
+     }
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, mktime(&minimum));
+}
+
+/**
+ * @brief Sets obj value
+ *
+ * Sets calendar date.
+ *
+ * Example:
+ * @code
+ * AtkObject *obj; // AtkObject representing EailCalendar
+ * GValue value = G_VALUE_INIT;
+ * struct tm time;
+ *
+ * memset(&tm, 0, sizeof(time));
+ * time.tm_year = 120;  // years since 1900
+ * time.tm_mon = 2;
+ * time.tm_mday = 15;
+ * time.tm_hour = 7;
+ * time.tm_min = 21;
+ * time.tm_sec = 33;
+ *
+ * g_value_set_int(&value, mktime(&time));
+ *
+ * eail_calendar_set_current_value(ATK_VALUE(obj), &value);
+ * @endcode
+ *
+ * @param  obj an AtkValue
+ * @param  value obj new value
+ * @return TRUE if new value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_calendar_set_current_value(AtkValue     *obj,
+                                const GValue *value)
+{
+   Evas_Object *widget;
+   struct tm minimum, maximum, current_set;
+   int min, max;
+   time_t time;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   elm_calendar_min_max_year_get(widget, &min, &max);
+
+   memset(&minimum, 0, sizeof(minimum));
+   minimum.tm_year = min - 1900;
+   minimum.tm_mon = 0;
+   minimum.tm_mday = 1;
+   minimum.tm_hour = 0;
+   minimum.tm_min = 0;
+   minimum.tm_sec = 0;
+
+   memset(&maximum, 0, sizeof(maximum));
+   maximum.tm_year = max - 1900;
+   maximum.tm_mon = 11;
+   maximum.tm_mday = 31;
+   maximum.tm_hour = 23;
+   maximum.tm_min = 59;
+   maximum.tm_sec = 59;
+
+   time = g_value_get_int(value);
+
+   if ((min < max) && (mktime(&minimum) > time || mktime(&maximum) < time))
+     return FALSE;
+
+   localtime_r(&time, &current_set);
+   elm_calendar_selected_time_set(widget, &current_set);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets obj minimum increment
+ *
+ * Gets minimum calendar increment i.e one second.
+ *
+ * Example:
+ *
+ * @code
+ * AtkObject *obj;
+ * GValue value = G_VALUE_INIT;
+ * eail_calendar_get_minimum_increment(ATK_VALUE(obj), &value);
+ * @endcode
+ *
+ * @param obj an AtkValue
+ * @param [out] value obj minimum increment
+ */
+static void
+eail_calendar_get_minimum_increment(AtkValue *obj,
+                                    GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, 1);
+}
+
+/**
+ * @brief Initialization of AtkValue interface
+ *
+ * Function called upon instance creation. It initializes AtkValue interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkObject than implements AtkValueInterface
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   iface->get_current_value     = eail_calendar_get_current_value;
+   iface->get_maximum_value     = eail_calendar_get_maximum_value;
+   iface->get_minimum_value     = eail_calendar_get_minimum_value;
+   iface->set_current_value     = eail_calendar_set_current_value;
+   iface->get_minimum_increment = eail_calendar_get_minimum_increment;
+}
diff --git a/eail/eail/eail_calendar.h b/eail/eail/eail_calendar.h
new file mode 100644 (file)
index 0000000..7510156
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_calendar.h
+ *
+ * @brief Header for EailCalendar implementation
+ */
+
+#ifndef EAIL_CALENDAR_H
+#define EAIL_CALENDAR_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailCalendar class
+ */
+#define EAIL_TYPE_CALENDAR              (eail_calendar_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailCalendar
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_CALENDAR(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                         EAIL_TYPE_CALENDAR, EailCalendar))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailCalendar class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_CALENDAR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                         EAIL_TYPE_CALENDAR, EailCalendarClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailCalendar class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_CALENDAR(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                         EAIL_TYPE_CALENDAR))
+/**
+ * @brief Tests whether given klass is a subclass of EailCalendar
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_CALENDAR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                         EAIL_TYPE_CALENDAR))
+/**
+ * @brief Gets EailCalendar class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailCalendar class from
+ */
+#define EAIL_CALENDAR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                         EAIL_TYPE_CALENDAR, EailCalendarClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailCalendar*/
+typedef struct _EailCalendar      EailCalendar;
+/** @brief Definition of class structure for Atk EailCalendar*/
+typedef struct _EailCalendarClass EailCalendarClass;
+
+/** @brief Definition of object structure for Atk EailCalendar*/
+struct _EailCalendar
+{
+   EailWidget parent; /*!< @brief parent object that functionality is being extended*/
+};
+
+/** @brief Definition of class structure for Atk EailCalendar*/
+struct _EailCalendarClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailWidgetClass parent_class;
+};
+
+/**
+ * @brief Getter for EailCalendar GType
+ *
+ * @returns GType for EailCalendar implementation
+ * */
+GType eail_calendar_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_check.c b/eail/eail/eail_check.c
new file mode 100644 (file)
index 0000000..1ecdde2
--- /dev/null
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_check.c
+ * @brief EailChceck implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_check.h"
+#include "eail_utils.h"
+#include "eail_factory.h"
+
+static void atk_image_interface_init(AtkImageIface *iface);
+static void atk_text_interface_init(AtkTextIface *iface);
+
+/**
+ * @brief Define EailCheck GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailCheck,
+                        eail_check,
+                        EAIL_TYPE_ACTION_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              atk_image_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init));
+
+/**
+ * @brief Implementation of get_image_position from AtkImage interface
+ *
+ * @param image Eailcheck instance
+ * @param [out] x horizontal coordinate
+ * @param [out] y vertical coordinate
+ * @param coord_type coord type
+ */
+static void
+eail_check_get_image_position(AtkImage     *image,
+                               gint         *x,
+                               gint         *y,
+                               AtkCoordType  coord_type)
+{
+   Evas_Object *check_image;
+   Evas_Object *widget;
+   AtkObject *obj;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     {
+        *x = G_MININT;
+        *y = G_MININT;
+        return;
+     }
+
+   check_image = elm_object_part_content_get(widget, "icon");
+   if (check_image)
+     {
+        obj = eail_factory_get_accessible(check_image);
+        atk_image_get_image_position(ATK_IMAGE(obj), x, y, coord_type);
+     }
+   else
+     {
+        *x = G_MININT;
+        *y = G_MININT;
+     }
+}
+
+/**
+ * @brief Implementation of get_image_size from AtkImage interface
+ *
+ * @param image Eailcheck instance
+ * @param [out] width width image
+ * @param [out] height height image
+ */
+static void
+eail_check_get_image_size(AtkImage *image,
+                           gint     *width,
+                           gint     *height)
+{
+   Evas_Object *widget;
+   Evas_Object *check_image;
+   AtkObject *obj;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     {
+        *width = -1;
+        *height = -1;
+        return;
+     }
+
+   check_image = elm_object_part_content_get(widget, "icon");
+   if (check_image)
+     {
+        obj = eail_factory_get_accessible(check_image);
+        atk_image_get_image_size(ATK_IMAGE(obj), width, height);
+     }
+   else
+     {
+        *width = -1;
+        *height = -1;
+     }
+}
+
+/**
+ * @brief AtkImage iterface initializer
+ *
+ * @param iface an AtkImageIface
+ */
+static void
+atk_image_interface_init(AtkImageIface *iface)
+{
+   iface->get_image_position = eail_check_get_image_position;
+   iface->get_image_size     = eail_check_get_image_size;
+}
+
+/**
+ * @brief Gets text bounded by start_offset and end_offset
+ *
+ * Use g_free() to free the returned string
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, -1 for the end of the string
+ * @return string containing text from start_offset up to, but not including
+ * end_offset
+ */
+static gchar*
+eail_check_get_text(AtkText   *text,
+                     gint       start_offset,
+                     gint       end_offset)
+{
+   gchar *string = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     string = (gchar *)elm_object_text_get(widget);
+
+   return eail_get_substring(string, start_offset, end_offset);
+}
+
+/**
+ * @brief Gets character at offset
+ *
+ * @param text an AtkText
+ * @param offset character offset
+ * @return character at offset
+ */
+static gunichar
+eail_check_get_character_at_offset(AtkText    *text,
+                                    gint        offset)
+{
+   gunichar character = '\0';
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     character = g_utf8_get_char(
+         g_utf8_offset_to_pointer(elm_object_text_get(widget), offset));
+
+   return character;
+}
+
+/**
+ * @brief Gets text length
+ *
+ * @param text an AtkText
+ * @return text length
+ */
+static gint
+eail_check_get_character_count(AtkText *text)
+{
+   gint count = 0;
+   const gchar *string_text = NULL;
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (!widget) return count;
+
+   string_text = elm_object_text_get(widget);
+   if (!string_text) return count;
+
+   count = g_utf8_strlen(string_text, -1);
+
+   return count;
+}
+
+/**
+ * @brief AtkText interface initializer
+ *
+ * Function called upon instance creation. It initializes AtkText interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkTextIface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+   iface->get_text = eail_check_get_text;
+   iface->get_character_at_offset = eail_check_get_character_at_offset;
+   iface->get_character_count = eail_check_get_character_count;
+}
+
+
+/**
+ * @brief Callback for on_changed event
+ * This will be called to notify AtkObject about object state change
+ *
+ * @param data callback data
+ * @param obj object source
+ * @param event_info event info
+ */
+static void
+eail_check_atk_notify_change(void *data, Evas_Object *obj, void *event_info)
+{
+   Eina_Bool state = elm_check_state_get(obj);
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_CHECKED,
+                                  state == EINA_TRUE ? TRUE : FALSE);
+}
+
+
+/**
+ * @brief Action handler for 'click'
+ *
+ * @param action an AtkAction object (EailCheck)
+ * @param data additional data (unused here)
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_check_action_click_cb(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   Eina_Bool state;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   state = elm_check_state_get(widget);
+   elm_check_state_set(widget, !state);
+
+   evas_object_smart_callback_call(widget, "changed", NULL);
+   eail_check_atk_notify_change(action, widget, NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief Initializer for actions defined in EailCheck
+ *
+ * @param action_widget an EailActionWidget implementation to be filled
+ */
+static void
+eail_check_actions_init(EailActionWidget *action_widget)
+{
+   eail_action_widget_action_append(action_widget, "click", NULL,
+                                    eail_check_action_click_cb);
+}
+
+/**
+ * @brief Implementation of ref_state_set from AtkObject
+ *
+ * @param obj EailCheck instance
+ *
+ * @returns AtkStateSet for EailCheck instance
+ */
+static AtkStateSet*
+eail_check_ref_state_set(AtkObject *obj)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   AtkStateSet *state_set =
+       ATK_OBJECT_CLASS(eail_check_parent_class)->ref_state_set(obj);
+
+   if (NULL == widget)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_DEFUNCT);
+        return state_set;
+     }
+   if (elm_check_state_get(widget))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_CHECKED);
+     }
+
+   return state_set;
+}
+
+/**
+ * @brief Gets obj accessible name
+ *
+ * @param obj an AtkObject
+ *
+ * @returns obj name
+ */
+static const gchar*
+eail_check_get_name(AtkObject *obj)
+{
+   Evas_Object *widget;
+   const char *atk_name;
+
+   g_return_val_if_fail(EAIL_IS_CHECK(obj), NULL);
+
+   atk_name = ATK_OBJECT_CLASS(eail_check_parent_class)->get_name(obj);
+   if (atk_name)
+     return atk_name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   return elm_object_text_get(widget);
+}
+
+/**
+ * @brief Gets list of child widget
+ *
+ * @param widget EailWidget object
+ *
+ * @return list of children, NULL if no children
+ */
+static Eina_List *
+eail_check_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *child, *obj;
+
+   obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+   if (obj)
+     {
+        child = elm_object_part_content_get(obj, "icon");
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+     }
+
+   return list;
+}
+
+/**
+ * @brief EailCheck instance initialization
+ *
+ * @param check Eailheck instance
+ */
+static void
+eail_check_init(EailCheck *check)
+{
+}
+
+/**
+ * @brief EailCheck object initializiation
+ *
+ * @param obj EailCheck object
+ * @param data user set addtional initailization data
+ */
+static void
+eail_check_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_check_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_CHECK_BOX;
+
+   evas_object_smart_callback_add((Evas_Object*) data, "changed",
+                                  eail_check_atk_notify_change,
+                                  obj);
+
+   eail_check_actions_init(EAIL_ACTION_WIDGET(obj));
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailCheck class
+ */
+static void
+eail_check_class_init(EailCheckClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   class->initialize = eail_check_initialize;
+   class->ref_state_set = eail_check_ref_state_set;
+   class->get_name = eail_check_get_name;
+   widget_class->get_widget_children = eail_check_get_widget_children;
+}
diff --git a/eail/eail/eail_check.h b/eail/eail/eail_check.h
new file mode 100644 (file)
index 0000000..311c7e6
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_check.h
+ *
+ * @brief Header for EailCheck implementation
+ */
+
+#ifndef EAIL_CHECK_H
+#define EAIL_CHECK_H
+
+#include "eail_action_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailCheck class
+ */
+#define EAIL_TYPE_CHECK             (eail_check_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailCheck
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_CHECK(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_CHECK, EailCheck))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailCheck class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_CHECK_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_CHECK, EailCheckClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailCheck class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_CHECK(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_CHECK))
+/**
+ * @brief Tests whether given klass is a subclass of EailCheck
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_CHECK_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_CHECK))
+/**
+ * @brief Gets EailCheck class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailCheck class from
+ */
+#define EAIL_CHECK_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_CHECK, EailCheckClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailCheck*/
+typedef struct _EailCheck      EailCheck;
+/** @brief Definition of class structure for Atk EailCheck*/
+typedef struct _EailCheckClass EailCheckClass;
+
+/** @brief Definition of object structure for Atk EailCheck*/
+struct _EailCheck
+{
+   EailActionWidget parent; /*!< @brief parent object that functionality is being extended*/
+};
+
+/** @brief Definition of class structure for Atk EailCheck*/
+struct _EailCheckClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailActionWidgetClass parent_class;
+};
+
+/**
+ * @brief Getter for EailCheck GType
+ *
+ * @returns GType for EailCheck implementation
+ */
+GType eail_check_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_clipboard.c b/eail/eail/eail_clipboard.c
new file mode 100644 (file)
index 0000000..ec21b9a
--- /dev/null
@@ -0,0 +1,63 @@
+#include <glib.h>
+#include <glib/gprintf.h>
+#include <stdio.h>
+#include "eail_clipboard.h"
+
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_clipboard.c
+ *
+ * @brief EailClipboard implementation
+ *
+ * Widget that is being used to store clipboard data for ATK widgets
+ */
+
+/**
+ * @brief Holds copied/cut text
+ */
+static char *clipboard;
+
+/**
+ * @brief Gets clipboard text
+ * @returns clipboard text
+ */
+const char *eail_clipboard_get_text(void)
+{
+   return clipboard;
+}
+
+/**
+ * @brief Sets clipboard text
+ * @param text new clipboard text
+ */
+void eail_clipboard_set_text(const char *text)
+{
+   if (clipboard) g_free(clipboard);
+   clipboard = g_strdup(text);
+}
+
+/**
+ * @brief Frees memory allocated by clipboard
+ */
+void eail_clipboard_free(void)
+{
+   if (clipboard) g_free(clipboard);
+}
diff --git a/eail/eail/eail_clipboard.h b/eail/eail/eail_clipboard.h
new file mode 100644 (file)
index 0000000..3d1f9d8
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef EAIL_CLIPBOARD
+#define EAIL_CLIPBOARD
+
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_clipboard.h
+ *
+ * @brief Header for EailClipboard implementation
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @brief Gets clipboard text
+ */
+const char *eail_clipboard_get_text(void);
+
+/**
+ * @brief Sets clipboard text
+ */
+void eail_clipboard_set_text(const char *text);
+
+/**
+ * @brief Frees memory allocated by clipboard
+ */
+void eail_clipboard_free(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* EAIL_CLIPBOARD */
diff --git a/eail/eail/eail_clock.c b/eail/eail/eail_clock.c
new file mode 100644 (file)
index 0000000..e918668
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_clock.c
+ * @brief EailClock implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_clock.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief Define EailClock GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailClock,
+                        eail_clock,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief EailClock object initialization
+ *
+ * @param obj EailClock object
+ * @param data user set additional initialization data
+ */
+static void
+eail_clock_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_clock_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_TEXT;
+}
+
+/**
+ * @brief EailClock instance initialization
+ *
+ * @param clock EailClock instance
+ */
+static void
+eail_clock_init(EailClock *clock)
+{
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailClock class
+ */
+static void
+eail_clock_class_init(EailClockClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_clock_initialize;
+}
+
+/*
+ * Implementation of the *AtkValue* interface
+ */
+
+/**
+ * @brief Gets obj current value
+ *
+ * @param obj EailClock instance
+ * @param [out] value EailClock current value
+ */
+static void
+eail_clock_get_current_value(AtkValue *obj,
+                             GValue   *value)
+{
+   Evas_Object *widget;
+   int hour, minute, second;
+   int current_second_day;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_clock_time_get(widget, &hour, &minute, &second);
+
+   current_second_day = (3600 * hour) + (60 * minute) + second;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, current_second_day);
+}
+
+/**
+ * @brief Gets obj maxiumum value
+ *
+ * @param obj EailClock instance
+ * @param [out] value EailClock maxiumum value
+ */
+static void
+eail_clock_get_maximum_value(AtkValue *obj,
+                             GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, 24 * 60 * 60 - 1);  // 24h - 1s
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * @param obj EailClock instance
+ * @param [out] value EailClock minimum value
+ */
+static void
+eail_clock_get_minimum_value(AtkValue *obj,
+                             GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, 0);                 // 0 - seconds
+}
+
+/**
+ * @brief Sets obj value
+ *
+ * @param obj EailClock instance
+ * @param value EailClock new value
+ * @return TRUE if new value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_clock_set_current_value(AtkValue     *obj,
+                             const GValue *value)
+{
+   Evas_Object *widget;
+   int hour, minute, second;
+   int current_second_day;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   current_second_day = g_value_get_int(value);
+
+   if (0 > current_second_day)
+     return FALSE;
+
+   hour = current_second_day / 3600;
+   minute = (current_second_day % 3600) / 60;
+   second = current_second_day % 60;
+
+   if (23 < hour || 59 < minute || 59 < second)
+     return FALSE;
+
+   elm_clock_time_set(widget, hour, minute, second);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets obj minimum increment
+ *
+ * @param obj EailClock instance
+ * @param [out] value EailClock minimum increment
+ */
+static void
+eail_clock_get_minimum_increment(AtkValue *obj,
+                                 GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, 1);
+}
+
+/**
+ * @brief Initialization of AtkValue interface
+ *
+ * Function called upon instance creation. It initializes AtkValue interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkObject than implements AtkValueInterface
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_current_value     = eail_clock_get_current_value;
+   iface->get_maximum_value     = eail_clock_get_maximum_value;
+   iface->get_minimum_value     = eail_clock_get_minimum_value;
+   iface->set_current_value     = eail_clock_set_current_value;
+   iface->get_minimum_increment = eail_clock_get_minimum_increment;
+}
diff --git a/eail/eail/eail_clock.h b/eail/eail/eail_clock.h
new file mode 100644 (file)
index 0000000..58c99a4
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_clock.h
+ *
+ * @brief Header for EailClock implementation
+ */
+
+#ifndef EAIL_CLOCK_H
+#define EAIL_CLOCK_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailClock class
+ */
+#define EAIL_TYPE_CLOCK             (eail_clock_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailClock
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_CLOCK(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_CLOCK, EailClock))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailClock class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_CLOCK_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_CLOCK, EailClockClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailClock class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_CLOCK(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_CLOCK))
+/**
+ * @brief Tests whether given klass is a subclass of EailClock
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_CLOCK_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_CLOCK))
+/**
+ * @brief Gets EailClock class structure from an obj (class instance)
+ *
+ *  @param obj object instance to get EailClock class from
+ */
+#define EAIL_CLOCK_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_CLOCK, EailClockClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailClock*/
+typedef struct _EailClock      EailClock;
+/** @brief Definition of class structure for Atk EailClock*/
+typedef struct _EailClockClass EailClockClass;
+
+/** @brief Definition of object structure for Atk EailClock*/
+struct _EailClock
+{
+   EailWidget parent; /*!< parent object that functionality is being extended*/
+};
+
+/** @brief Definition of class structure for Atk EailClock*/
+struct _EailClockClass
+{
+   /** @brief parent AtkObject that functionality is being extended */
+   EailWidgetClass parent_class;
+};
+
+/**
+ * @brief Getter for EailClock GType
+ *
+ * @returns GType for EailClock implementation
+ * */
+GType eail_clock_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_colorselector.c b/eail/eail/eail_colorselector.c
new file mode 100644 (file)
index 0000000..bd6ef3d
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_colorselector.c
+ * @brief EailColorselector implementation.
+ */
+
+#include <Elementary.h>
+
+#include "eail_colorselector.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief EailColorselector type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailColorselector,
+                        eail_colorselector,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/**
+ * @brief EailColorselector initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data (Evas_Object*)
+ */
+static void
+eail_colorselector_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_colorselector_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_COLOR_CHOOSER;
+}
+
+/**
+ * @brief EailColorselector instance initializer
+ *
+ * @param selector an EailColorselector
+ */
+static void
+eail_colorselector_init(EailColorselector *selector)
+{
+}
+
+/**
+ * @brief EailColorselector class initializer
+ *
+ * @param klass an EailColorselector class
+ */
+static void
+eail_colorselector_class_init(EailColorselectorClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   class->initialize = eail_colorselector_initialize;
+}
+
+/**
+ * @brief Gets obj current value
+ *
+ * @param obj an AtkValue
+ * @param [out] value obj current value
+ */
+static void
+eail_colorselector_get_current_value(AtkValue *obj,
+                                     GValue   *value)
+{
+   gint r = 0;
+   gint g = 0;
+   gint b = 0;
+   gint a = 0;
+   gint color = 0;
+   Evas_Object *widget = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_colorselector_color_get(widget, &r, &g, &b, &a);
+   color = (a << 24) | (r << 16) | (g << 8) | b;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, color);
+}
+
+/**
+ * @brief Gets obj maxiumum value
+ *
+ * @param obj an AtkValue
+ * @param [out] value obj maximum value
+ */
+static void
+eail_colorselector_get_maximum_value(AtkValue *obj,
+                                     GValue   *value)
+{
+   gint max = 0xFFFFFFFF;
+   Evas_Object *widget = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, max);
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * @param obj an AtkValue
+ * @param [out] value obj minimum value
+ */
+static void
+eail_colorselector_get_minimum_value(AtkValue *obj,
+                                     GValue   *value)
+{
+   gint min = 0;
+   Evas_Object *widget = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, min);
+}
+
+/**
+ * @brief Sets obj current value
+ *
+ * @param obj an AtkValue
+ * @param value obj current value
+ * @return TRUE if value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_colorselector_set_current_value(AtkValue *obj,
+                                     const GValue *value)
+{
+   gint r = 0xFFFFFFFF;
+   gint g = 0xFFFFFFFF;
+   gint b = 0xFFFFFFFF;
+   gint a = 0xFFFFFFFF;
+   gint color = 0xFFFFFFFF;
+   Evas_Object *widget = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   color = g_value_get_int(value);
+   a = (0xFF000000 & (guint)color) >> 24;
+   r = (0x00FF0000 & color) >> 16;
+   g = (0x0000FF00 & color) >> 8;
+   b = 0x000000FF & color;
+   elm_colorselector_color_set(widget, r, g, b, a);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets obj minimum increment
+ *
+ * @param obj an AtkValue
+ * @param [out] value obj minimum increment
+ */
+static void
+eail_colorselector_get_minimum_increment(AtkValue *obj,
+                                         GValue *value)
+{
+   gint inc = 0x01010101;
+
+   memset(value,  0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, inc);
+}
+
+/**
+ * @brief AtkValue interface initializer
+ *
+ * @param iface AtkValueIface
+ */
+static void atk_value_interface_init(AtkValueIface *iface)
+{
+   iface->get_current_value     = eail_colorselector_get_current_value;
+   iface->get_maximum_value     = eail_colorselector_get_maximum_value;
+   iface->get_minimum_value     = eail_colorselector_get_minimum_value;
+   iface->set_current_value     = eail_colorselector_set_current_value;
+   iface->get_minimum_increment = eail_colorselector_get_minimum_increment;
+}
+
diff --git a/eail/eail/eail_colorselector.h b/eail/eail/eail_colorselector.h
new file mode 100644 (file)
index 0000000..f1d025f
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_colorselector.h
+ *
+ * @brief Header for EailColorselector implementation
+ */
+
+#ifndef EAIL_COLORSELECTOR_H
+#define EAIL_COLORSELECTOR_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailColorselector class
+ */
+#define EAIL_TYPE_COLORSELECTOR              (eail_colorselector_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailColorselector
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_COLORSELECTOR(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                              EAIL_TYPE_COLORSELECTOR, EailColorselector))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailColorselector class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_COLORSELECTOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                              EAIL_TYPE_COLORSELECTOR, EailColorselectorClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailColorselector class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_COLORSELECTOR(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                              EAIL_TYPE_COLORSELECTOR))
+/**
+ * @brief Tests whether given klass is a subclass of EailColorselector
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_COLORSELECTOR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                              EAIL_TYPE_COLORSELECTOR))
+/**
+ * @brief Gets EailColorselector class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailColorselector class from
+ */
+#define EAIL_COLORSELECTOR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                              EAIL_TYPE_COLORSELECTOR, EailColorselectorClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailColorselector*/
+typedef struct _EailColorselector      EailColorselector;
+/** @brief Definition of class structure for Atk EailColorselector*/
+typedef struct _EailColorselectorClass EailColorselectorClass;
+
+/** @brief Definition of object structure for Atk EailColorselector*/
+struct _EailColorselector
+{
+   /** @brief parent object that functionality is being extended */
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailColorselector*/
+struct _EailColorselectorClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailWidgetClass parent_class;
+};
+
+/**
+ * @brief Getter for EailColorselector GType
+ *
+ * @returns GType for EailColorselector implementation
+ * */
+GType eail_colorselector_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_conformant.c b/eail/eail/eail_conformant.c
new file mode 100644 (file)
index 0000000..493e04d
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_conformant.c
+ * @brief EailConformant implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_conformant.h"
+
+/**
+ * @brief EailConformant type definition
+ */
+G_DEFINE_TYPE(EailConformant, eail_conformant, EAIL_TYPE_LAYOUT);
+
+/**
+ * @brief EailConformant initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_conformant_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_conformant_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_FILLER;
+}
+
+/**
+ * @brief EailConformant instance initializer
+ *
+ * @param conformant an EailConformant
+ */
+static void
+eail_conformant_init(EailConformant *conformant)
+{
+}
+
+/**
+ * @brief EailConformant class initializer
+ *
+ * @param klass an EailConformantClass to be filled
+ */
+static void
+eail_conformant_class_init(EailConformantClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_conformant_initialize;
+}
diff --git a/eail/eail/eail_conformant.h b/eail/eail/eail_conformant.h
new file mode 100644 (file)
index 0000000..09da5ff
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_conformant.h
+ *
+ * @brief Header for EailConformant implementation
+ */
+
+#ifndef EAIL_CONFORMANT_H
+#define EAIL_CONFORMANT_H
+
+#include "eail_layout.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailConformant class
+ */
+#define EAIL_TYPE_CONFORMANT              (eail_conformant_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailConformant
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_CONFORMANT(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                           EAIL_TYPE_CONFORMANT, EailConformant))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailConformant class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_CONFORMANT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                           EAIL_TYPE_CONFORMANT, EailConformantClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailConformant class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_CONFORMANT(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                           EAIL_TYPE_CONFORMANT))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailConformant
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_CONFORMANT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                           EAIL_TYPE_CONFORMANT))
+
+/**
+ * @brief Gets EailConformant class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailConformant class from
+ */
+#define EAIL_CONFORMANT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                           EAIL_TYPE_CONFORMANT, EailConformantClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailConformant*/
+typedef struct _EailConformant      EailConformant;
+
+/** @brief Definition of class structure for Atk EailConformant*/
+typedef struct _EailConformantClass EailConformantClass;
+
+/** @brief Definition of object structure for Atk EailConformant*/
+struct _EailConformant
+{
+   /** @brief parent object that functionality is being extended */
+   EailLayout parent;
+};
+
+/** @brief Definition of class structure for Atk EailConformant*/
+struct _EailConformantClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailLayoutClass parent_class;
+};
+
+/** @brief Getter for EailConformant GType
+ *
+ * @returns GType for EailConfomant implementation*/
+GType eail_conformant_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_ctxpopup.c b/eail/eail/eail_ctxpopup.c
new file mode 100644 (file)
index 0000000..f317221
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_ctxpopup.c
+ * @brief Implementation of Ctxpopup widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_ctxpopup.h"
+#include "eail_factory.h"
+#include "eail_priv.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/**
+ * @brief Define EailCtxpopup GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailCtxpopup,
+                        eail_ctxpopup,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/**
+ * @brief Initializer for AtkObject
+ *
+ * @param obj an AtkObject
+ * @param data Initialization data
+ */
+static void
+eail_ctxpopup_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_ctxpopup_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_POPUP_MENU;
+}
+
+/**
+ * @brief Destructor for EailCtxpopup class
+ *
+ * @param object GObject object to be finalized
+ */
+static void
+eail_ctxpopup_finalize(GObject *object)
+{
+   EailCtxpopup *ctxpopup = EAIL_CTXPOPUP(object);
+
+   if (ctxpopup->dismiss_description) free(ctxpopup->dismiss_description);
+
+   G_OBJECT_CLASS(eail_ctxpopup_parent_class)->finalize(object);
+}
+
+/**
+ * @brief EailCtxpopup GObject instance initializer
+ *
+ * @param ctxpopup an EailCtxpopup
+ */
+static void
+eail_ctxpopup_init(EailCtxpopup *ctxpopup)
+{
+   ctxpopup->dismiss_description = NULL;
+}
+
+/**
+ * @brief Helper function for getting nested content in "elm_popup" widget
+ *
+ * @param obj an AtkObject
+ *
+ * @returns nested widget content from "elm_popup" widget
+ */
+static Evas_Object *
+_eail_get_nested_widget(AtkObject *obj)
+{
+   Evas_Object *ctxpopup_widget = NULL, *nested_widget = NULL;
+   /* getting widget of ctxpopup class */
+   ctxpopup_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!ctxpopup_widget)
+     {
+        ERR("No widget found for EailCtxpopup object!");
+     }
+
+   nested_widget = elm_object_part_content_get(ctxpopup_widget, "default");
+
+   return nested_widget;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_ctxpopup_get_n_children(AtkObject *obj)
+{
+   Evas_Object *nested_widget = NULL;
+
+   nested_widget = _eail_get_nested_widget(obj);
+   if (nested_widget)
+     return 1;
+
+   return 0;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i index of a child
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_ctxpopup_ref_child(AtkObject *obj, gint i)
+{
+   Evas_Object *nested_widget = NULL;
+   AtkObject *atk_obj;
+
+   nested_widget = _eail_get_nested_widget(obj);
+   atk_obj = eail_factory_get_accessible(nested_widget);
+
+   if (atk_obj)
+     g_object_ref(atk_obj);
+
+   return atk_obj;
+}
+
+/**
+ * @brief Initializer for EailPopup GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailCtxpopupClass
+ */
+static void
+eail_ctxpopup_class_init(EailCtxpopupClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_ctxpopup_initialize;
+   class->get_n_children = eail_ctxpopup_get_n_children;
+   class->ref_child = eail_ctxpopup_ref_child;
+   gobject_class->finalize = eail_ctxpopup_finalize;
+}
+
+/*
+ * Implementation of the *AtkAction* interface
+ */
+
+/**
+ * @brief Implementation of get_n_actions from AtkAction interface
+ *
+ * @param action EailCtxpopup instance
+ *
+ * @return number of available actions
+ */
+static int
+eail_ctxpopup_n_actions_get(AtkAction *action)
+{
+   return 1;
+}
+
+/**
+ * @brief Implementation of get_description from AtkAction interface
+ *
+ * @param action EailCtxpopup instance
+ * @param i action index
+ *
+ * @return action description
+ */
+static const char*
+eail_ctxpopup_description_get(AtkAction *action,
+                              gint i)
+{
+   EailCtxpopup *ctxpopup;
+   const char *action_description;
+
+   ctxpopup = EAIL_CTXPOPUP(action);
+   if (!ctxpopup) return NULL;
+
+   switch (i)
+     {
+      case 0:
+         action_description = ctxpopup->dismiss_description;
+         break;
+      default:
+         action_description = NULL;
+         break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Implementation of set_descritpion from AtkAction interface
+ *
+ * @param action EailCtxpopup instance
+ * @param i action index
+ * @param description action description
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_ctxpopup_description_set(AtkAction *action,
+                              gint i,
+                              const char *description)
+{
+   EailCtxpopup *ctxpopup;
+   char **value;
+
+   ctxpopup = EAIL_CTXPOPUP(action);
+   if (!ctxpopup) return FALSE;
+
+   switch (i)
+     {
+      case 0:
+         value = &ctxpopup->dismiss_description;
+         break;
+      default:
+         value = NULL;
+         break;
+     }
+
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(description);
+        return TRUE;
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief Implementation of get_name from AtkAction interface
+ *
+ * @param action EailCtxpopup instance
+ * @param i action index
+ *
+ * @return action name
+ */
+static const char*
+eail_ctxpopup_action_name_get(AtkAction *action,
+                              int i)
+{
+   const char* action_name;
+
+   switch (i)
+     {
+      case 0:
+         action_name = "dismiss";
+         break;
+      default:
+         action_name = NULL;
+         break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Implementation of do_action from AtkAction interface
+ *
+ * @param action EailCtxpopup instance
+ * @param i action index
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_ctxpopup_do_action(AtkAction *action,
+                        int i)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   const char *action_name = atk_action_get_name(action, i);
+   if (!action_name) return FALSE;
+
+   if (!g_strcmp0(action_name, "dismiss"))
+     elm_ctxpopup_dismiss(widget);
+   else
+     return FALSE;
+
+   return TRUE;
+}
+
+/**
+ * @brief AtkAction interface initializer
+ *
+ * Function called upon instance creation. It initializes AtkAction interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkActionIface
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_n_actions   = eail_ctxpopup_n_actions_get;
+   iface->get_description = eail_ctxpopup_description_get;
+   iface->set_description = eail_ctxpopup_description_set;
+   iface->get_name        = eail_ctxpopup_action_name_get;
+   iface->do_action       = eail_ctxpopup_do_action;
+}
diff --git a/eail/eail/eail_ctxpopup.h b/eail/eail/eail_ctxpopup.h
new file mode 100644 (file)
index 0000000..2e7a814
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_ctxpopup.h
+ *
+ *  @brief Header for EailCtxpopup implementation
+ */
+
+#ifndef EAIL_CTXPOPUP_H
+#define EAIL_CTXPOPUP_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailCtxpopup class
+ */
+
+#define EAIL_TYPE_CTXPOPUP             (eail_ctxpopup_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailCtxpopup
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_CTXPOPUP(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                        EAIL_TYPE_CTXPOPUP, EailCtxpopup))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailCtxpopup class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_CTXPOPUP_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                        EAIL_TYPE_CTXPOPUP, EailCtxpopupClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailCtxpopup class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_CTXPOPUP(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                        EAIL_TYPE_CTXPOPUP))
+/**
+ * @brief Tests whether given klass is a subclass of EailCtxpopup
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_CTXPOPUP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                        EAIL_TYPE_CTXPOPUP))
+/**
+ * @brief Gets EailCtxpopup class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailCtxpopup class from
+ */
+#define EAIL_CTXPOPUP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                        EAIL_TYPE_CTXPOPUP, EailCtxpopupClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailCtxpopup*/
+typedef struct _EailCtxpopup      EailCtxpopup;
+
+/** @brief Definition of class structure for Atk EailCtxpopup*/
+typedef struct _EailCtxpopupClass EailCtxpopupClass;
+
+/** @brief Definition of object structure for Atk EailCtxpopup*/
+struct _EailCtxpopup
+{
+   EailWidget parent; /*!< parent class object*/
+
+   char *dismiss_description; /*!< 'dismiss' action description*/
+};
+
+/** @brief Definition of class structure for Atk EailCtxpopup*/
+struct _EailCtxpopupClass
+{
+   /** @brief parent class whose functionality is being extended */
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailCtxpopup GType
+ *
+ * @returns GType for EailCtxpopup implementation*/
+GType eail_ctxpopup_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_datetime.c b/eail/eail/eail_datetime.c
new file mode 100644 (file)
index 0000000..0c46c9e
--- /dev/null
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_datetime.c
+ *
+ * @brief EailDatetime implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_datetime.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief Define EailDatetime GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailDatetime,
+                        eail_datetime,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/**
+ * @brief EailDatetime object initialization
+ *
+ * @param obj EailDatetime object
+ * @param data user set additional initialization data
+ */
+static void
+eail_datetime_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_datetime_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_DATE_EDITOR;
+}
+
+/**
+ * @brief EailDatetime instance initialization
+ *
+ * @param datetime EailDatetime instance
+ */
+static void
+eail_datetime_init(EailDatetime *datetime)
+{
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailDatetime class
+ */
+static void
+eail_datetime_class_init(EailDatetimeClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_datetime_initialize;
+}
+
+/**
+ * @brief Gets obj current value
+ *
+ * Example:
+ * @code
+ * GValue value;
+ * struct tm *t;
+ * time_t time;
+ *
+ * //get current datetime value
+ * atk_value_get_minimum_value(obj, &value);
+ *
+ * //get time
+ * time = g_value_get_int(&value);
+ *
+ * //convert time to time structure (struct tm)
+ * t = localtime(&time);
+ * @endcode
+ *
+ * @param obj EailDatetime instance
+ * @param [out] value EailDatetime current value
+ */
+static void
+eail_datetime_get_current_value(AtkValue *obj,
+                                GValue   *value)
+{
+   Evas_Object *widget;
+   struct tm datetime;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_datetime_value_get(widget, &datetime);
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, mktime(&datetime));
+}
+
+/**
+ * @brief Gets obj maxiumum value
+ *
+ * @param obj EailDatetime instance
+ * @param [out] value EailDatetime maximum value
+ */
+static void
+eail_datetime_get_maximum_value(AtkValue *obj,
+                                GValue   *value)
+{
+   Evas_Object *widget;
+   struct tm datetime;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_datetime_value_max_get(widget, &datetime);
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, mktime(&datetime));
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * @param obj EailDatetime instance
+ * @param [out] value EailDatetime minimum value
+ */
+static void
+eail_datetime_get_minimum_value(AtkValue *obj,
+                                GValue   *value)
+{
+   Evas_Object *widget;
+   struct tm datetime;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_datetime_value_min_get(widget, &datetime);
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, mktime(&datetime));
+}
+
+/**
+ * @brief Sets obj value
+ *
+ * Example
+ * @code
+ * struct tm t;
+ * time_t time;
+ * GValue value;
+ *
+ * //Fill time structure with desired values(struct tm)
+ * memset(&t, 0, sizeof(t));
+ * t.tm_sec = 30;
+ * t.tm_min = 20;
+ * t.tm_hour = 10;
+ *
+ * //convert to int representation
+ * time = mktime(&t);
+ *
+ * //copy time to value
+ * memset(&value, 0, sizeof(value));
+ * g_value_init(&value, G_TYPE_INT);
+ * g_value_set_int(&value, time);
+ *
+ * //set time using atk
+ * atk_value_set_current_value(obj, &value);
+ * @endcode
+ *
+ * @param obj EailDatetime instance
+ * @param value EailDatetime new value
+ * @return TRUE if new value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_datetime_set_current_value(AtkValue     *obj,
+                                const GValue *value)
+{
+   Evas_Object *widget;
+   struct tm datetime;
+   time_t time;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   time = g_value_get_int(value);
+   localtime_r(&time, &datetime);
+
+   if (EINA_TRUE == elm_datetime_value_set(widget, &datetime))
+     return TRUE;
+   else
+     return FALSE;
+}
+
+/**
+ * @brief Gets obj minimum increment
+ *
+ * @param obj EailDatetime instance
+ * @param [out] value EailDatetime minimum increment
+ */
+static void
+eail_datetime_get_minimum_increment(AtkValue *obj,
+                                    GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_INT);
+   g_value_set_int(value, 1);
+}
+
+/**
+ * @brief AtkValue interface initializer
+ *
+ * @param iface an AtkValueIface
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_current_value     = eail_datetime_get_current_value;
+   iface->get_maximum_value     = eail_datetime_get_maximum_value;
+   iface->get_minimum_value     = eail_datetime_get_minimum_value;
+   iface->set_current_value     = eail_datetime_set_current_value;
+   iface->get_minimum_increment = eail_datetime_get_minimum_increment;
+}
diff --git a/eail/eail/eail_datetime.h b/eail/eail/eail_datetime.h
new file mode 100644 (file)
index 0000000..1667964
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_datetime.h
+ *
+ * @brief Header for EailDatetime implementation
+ */
+
+#ifndef EAIL_DATETIME_H
+#define EAIL_DATETIME_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailDatetime class
+ */
+#define EAIL_TYPE_DATETIME             (eail_datetime_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailDatetime
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_DATETIME(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                        EAIL_TYPE_DATETIME, EailDatetime))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailDatetime class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_DATETIME_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                        EAIL_TYPE_DATETIME, EailDatetimeClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailDatetime class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_DATETIME(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                        EAIL_TYPE_DATETIME))
+/**
+ * @brief Tests whether given klass is a subclass of EailDatetime
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_DATETIME_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                        EAIL_TYPE_DATETIME))
+/**
+ * @brief Gets EailDatetime class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailDatetime class from
+ */
+#define EAIL_DATETIME_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                        EAIL_TYPE_DATETIME, EailDatetimeClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailDatetime*/
+typedef struct _EailDatetime      EailDatetime;
+
+/** @brief Definition of class structure for Atk EailDatetime*/
+typedef struct _EailDatetimeClass EailDatetimeClass;
+
+/** @brief Definition of object structure for Atk EailDatetime*/
+struct _EailDatetime
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailDatetime*/
+struct _EailDatetimeClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailDatetime GType
+ * @returns GType for EailDatetime implementation*/
+GType eail_datetime_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_dayselector.c b/eail/eail/eail_dayselector.c
new file mode 100644 (file)
index 0000000..d2e9598
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_dayselector.c
+ * @brief Implementation of eail representation of dayselector elementary widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_dayselector.h"
+#include "eail_check.h"
+
+/** @brief Number of days displayed in dayselector widget */
+#define EAIL_DAYSELECTOR_NUM_OF_DAYS 7
+/** @brief Content part name definition for dayselector widget */
+#define EAIL_CONTENT_PART_FORMAT "day%d"
+
+/**
+ * @brief GObject definition for EailDayselector widget
+ *
+ * It extends EAIL_TYPE_WIDGET
+ */
+G_DEFINE_TYPE(EailDayselector, eail_dayselector, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data initialization data (Evas_Object*)
+ */
+static void
+eail_dayselector_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_dayselector_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_PANEL;
+}
+
+/**
+ * @brief GObject-initializer for EailDayselector
+ *
+ * @param button an EailDayselector
+ */
+static void
+eail_dayselector_init(EailDayselector *button)
+{
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_dayselector_get_n_children(AtkObject *obj)
+{
+   return EAIL_DAYSELECTOR_NUM_OF_DAYS;
+}
+
+/**
+ * @brief Helper func for generating content string name for given day number
+ * @param day_num number of day in week
+ *
+ * @returns an Eina_Strbuf* object filled with content day-name
+ */
+static Eina_Strbuf *
+_eail_dayselector_gen_day_str(int day_num)
+{
+   Eina_Strbuf *str_buf = NULL;
+
+   str_buf = eina_strbuf_new();
+   eina_strbuf_append_printf(str_buf, EAIL_CONTENT_PART_FORMAT, day_num);
+
+   return str_buf;
+}
+
+/**
+ * @brief Helper func for creating dayselector child content
+ *
+ * @param day_check_widget check widget that represents a day in dayselector
+ * widget
+ *
+ * @returns an AtkObject representation of given day in dayselector. Unref
+ * it when it is no longer needed.
+ */
+static AtkObject *
+_eail_create_dayselector_child(Evas_Object *day_check_widget)
+{
+   AtkObject *child = NULL;
+   child = g_object_new(EAIL_TYPE_CHECK, NULL);
+   atk_object_initialize(child, day_check_widget);
+   g_object_ref(child);
+
+   return child;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_dayselector_ref_child(AtkObject *obj, gint i)
+{
+   AtkObject *child = NULL;
+   Eina_Strbuf *part_name = NULL;
+   Evas_Object *ds_widget = NULL, *day_check = NULL;
+
+   g_return_val_if_fail (EAIL_IS_WIDGET(obj), NULL);
+
+   ds_widget = eail_widget_get_widget(EAIL_WIDGET(obj) );
+   part_name = _eail_dayselector_gen_day_str(i);
+   day_check = elm_object_part_content_get
+                  (ds_widget, eina_strbuf_string_get(part_name));
+
+   /* dayselector consists of objects with type CHECK-widget */
+   child = _eail_create_dayselector_child(day_check);
+
+   eina_strbuf_free(part_name);
+   return child;
+}
+
+/**
+ * @brief Destructor for GObject Dayselector implementation
+ *
+ * @param object GObject object to be finalized
+ */
+static void
+eail_dayselector_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_dayselector_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for GObject EailDayselectorClass class (defines callbacks
+ * for base AtkObject)
+ *
+ * @param klass an EailDayselectorClass
+ */
+static void
+eail_dayselector_class_init(EailDayselectorClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_dayselector_initialize;
+   class->get_n_children = eail_dayselector_get_n_children;
+   class->ref_child = eail_dayselector_ref_child;
+   gobject_class->finalize = eail_dayselector_finalize;
+}
diff --git a/eail/eail/eail_dayselector.h b/eail/eail/eail_dayselector.h
new file mode 100644 (file)
index 0000000..1feb5c9
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_dayselector.h
+ *
+ * @brief Header for EailDayselector implementation
+ */
+
+#ifndef EAIL_DAYSELECTOR_H
+#define EAIL_DAYSELECTOR_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailDayselector class
+ */
+#define EAIL_TYPE_DAYSELECTOR             (eail_dayselector_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailDayselector
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_DAYSELECTOR(obj)             (G_TYPE_DAYSELECTOR_INSTANCE_CAST((obj), \
+                                           EAIL_TYPE_DAYSELECTOR, EailDayselector))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailDayselector class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_DAYSELECTOR_CLASS(klass)     (G_TYPE_DAYSELECTOR_CLASS_CAST((klass), \
+                                           EAIL_TYPE_DAYSELECTOR, EailDayselectorClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailDayselector class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_DAYSELECTOR(obj)          (G_TYPE_DAYSELECTOR_INSTANCE_TYPE((obj), \
+                                           EAIL_TYPE_DAYSELECTOR))
+/**
+ * @brief Tests whether given klass is a subclass of EailDayselector
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_DAYSELECTOR_CLASS(klass)  (G_TYPE_DAYSELECTOR_CLASS_TYPE((klass), \
+                                           EAIL_TYPE_DAYSELECTOR))
+/**
+ * @brief Gets EailDayselector class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailDayselector class from
+ */
+#define EAIL_DAYSELECTOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                           EAIL_TYPE_DAYSELECTOR, EailDayselectorClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailDayselector*/
+typedef struct _EailDayselector      EailDayselector;
+/** @brief Definition of class structure for Atk EailDayselector*/
+typedef struct _EailDayselectorClass EailDayselectorClass;
+
+/** @brief Definition of object structure for Atk EailDayselector*/
+struct _EailDayselector
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailDayselector*/
+struct _EailDayselectorClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailDayselector GType
+ * @returns GType for EailDayselector implementation*/
+GType eail_dayselector_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_diskselector.c b/eail/eail/eail_diskselector.c
new file mode 100644 (file)
index 0000000..80b52e8
--- /dev/null
@@ -0,0 +1,478 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_diskselector.c
+ * @brief Implementation of Diskselector widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_diskselector.h"
+#include "eail_factory.h"
+#include "eail_item_parent.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+#define EAIL_diskselector_ACTION_NEXT "next" /**< @brief 'next' action name*/
+#define EAIL_diskselector_ACTION_PREV "previous" /**< @brief 'prev' action name*/
+
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+static void eail_diskselector_actions_table_init(EailDiskselector *widget);
+/**
+ * @brief Definition of EailDiskselector as GObject
+ *
+ * EailDiskselector is extended ScrollableWidget with EAIL_TYPE_ITEM_PARENT and
+ * ATK_TYPE_SELECTION implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailDiskselector,
+                        eail_diskselector,
+                        EAIL_TYPE_SCROLLABLE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                              atk_selection_interface_init)
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init));
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data Initialization data
+ */
+static void
+eail_diskselector_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_diskselector_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_LIST;
+
+   EailDiskselector *widget = EAIL_DISKSELECTOR(obj);
+   eail_diskselector_actions_table_init(widget);
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "selected",
+                                  eail_list_item_handle_selected_event, obj);
+}
+
+/**
+ * @brief Initializer for GObject EailList instance
+ *
+ * @param diskselector an EailDiskselector
+ */
+static void
+eail_diskselector_init(EailDiskselector *diskselector)
+{
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_diskselector_get_n_children(AtkObject *obj)
+{
+   gint n_items;
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   n_items = eina_list_count(elm_diskselector_items_get(widget));
+
+   return n_items;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_diskselector_ref_child(AtkObject *obj, gint i)
+{
+   const Eina_List *items;
+   AtkObject *child = NULL;
+   Evas_Object *widget = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   items = elm_diskselector_items_get(widget);
+
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                             (eina_list_nth(items, i), ATK_ROLE_LIST_ITEM, obj);
+
+        g_object_ref(child);
+     }
+
+   return child;
+}
+
+/**
+ * @brief Destructor for EailDiskselector class
+ *
+ * @param object GObject object to be finalized
+ */
+static void
+eail_diskselector_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_diskselector_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for GObject EailDiskselectorClass class (defines callbacks
+ * for base AtkObject)
+ *
+ * @param klass an EailDiskselectorClass
+ */
+static void
+eail_diskselector_class_init(EailDiskselectorClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_diskselector_initialize;
+   class->get_n_children = eail_diskselector_get_n_children;
+   class->ref_child = eail_diskselector_ref_child;
+   gobject_class->finalize = eail_diskselector_finalize;
+}
+
+/*
+ * Implementation of the *AtkSelection* interface
+ */
+
+/**
+ * @brief Implementation of AtkSelection->add_selection callback
+ *
+ * As described in ATK doc:\n
+ * Adds the specified accessible child of the object to the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i selection index
+ *
+ * @returns TRUE if operation ended successfully, FALSE otherwise
+ */
+static gboolean
+eail_selection_add_selection(AtkSelection *selection,
+                             gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   const Eina_List *items = elm_diskselector_items_get(object);
+   Elm_Object_Item *item = eina_list_nth(items, i);
+   if (!item) return FALSE;
+   elm_diskselector_item_selected_set(item, EINA_TRUE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->clear_selection callback
+ *
+ * As described in ATK doc:\n
+ * Clears the selection in the object so that no children in the object are
+ * selected.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns always FALSE - this operation is not supported for Diskselector
+ */
+static gboolean
+eail_selection_clear_selection(AtkSelection *selection)
+{
+   return FALSE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->ref_selection callback
+ *
+ * As described in ATK doc:\n
+ * Gets a reference to the accessible object representing the specified selected
+ * child of the object. Note: callers should not rely on NULL or on a zero value
+ * for indication of whether AtkSelectionIface is implemented, they should use
+ * type checking/interface checking macros or the atk_get_accessible_value()
+ * convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i selection index
+ *
+ * @returns an AtkObject representing the selected accessible , or NULL if
+ * selection does not implement this interface
+ */
+static AtkObject *
+eail_selection_ref_selection(AtkSelection *selection,
+                             gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), NULL);
+
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   const Eina_List *items = elm_diskselector_items_get(object);
+   Elm_Object_Item *item = eina_list_nth(items, i);
+   if (!item) return NULL;
+
+   AtkObject *obj;
+   obj = g_object_new(EAIL_TYPE_DISKSELECTOR, NULL);
+   obj->role = ATK_ROLE_LIST_ITEM;
+
+   if (EAIL_IS_ITEM_PARENT(selection))
+     atk_object_set_parent(obj, (AtkObject *)selection);
+
+   atk_object_initialize(obj, item);
+   g_object_ref(obj);
+   return obj;
+}
+
+/**
+ * @brief Implementation of AtkSelection->get_selection_count callback
+ *
+ * As described in ATK doc:\n
+ * Gets the number of accessible children currently selected. Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns always '1' - in Diskselector widget something is always selected
+ */
+static gint
+eail_selection_get_selection_count(AtkSelection *selection)
+{
+   return 1;
+}
+
+/**
+ * @brief Implementation of AtkSelection->is_child_selected callback
+ *
+ * As described in ATK doc:\n
+ * Determines if the current child of this object is selected Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i child index
+ *
+ * @returns a gboolean representing the specified child is selected, or 0 if
+ * selection does not implement this interface.
+ */
+static gboolean
+eail_selection_is_child_selected(AtkSelection *selection,
+                                 gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *selected_item = elm_diskselector_selected_item_get(object);
+   Elm_Object_Item *last_item = elm_diskselector_last_item_get(object);
+   Elm_Object_Item *item = elm_diskselector_first_item_get(object);
+   gint n=0;
+   do
+     {
+        if (selected_item==item) break;
+        item = elm_diskselector_item_next_get(item);
+        n++;
+     } while (item!=last_item);
+   return i==n;
+}
+
+/**
+ * @brief Implementation of AtkSelection->remove_selection callback
+ *
+ * As described in ATK doc:\n
+ * Removes the specified child of the object from the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i selection index
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_selection_remove_selection(AtkSelection *selection,
+                                gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *selected_item = elm_diskselector_first_item_get(object);
+   elm_diskselector_item_selected_set(selected_item, TRUE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->select_all_selection callback
+ *
+ * As described in ATK doc:\n
+ * Causes every child of the object to be selected if the object supports
+ * multiple selections.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns FALSE - this operation is not supported for Diskselector widget
+ */
+static gboolean
+eail_selection_select_all_selection(AtkSelection *selection)
+{
+   return FALSE;
+}
+
+/**
+ * @brief Initialization of AtkSelectionIface interface
+ *
+ * Function called upon instance creation. It initializes AtkSelection interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkSelectionIface
+ */
+static void atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   iface->add_selection        = eail_selection_add_selection;
+   iface->clear_selection      = eail_selection_clear_selection;
+   iface->ref_selection        = eail_selection_ref_selection;
+   iface->get_selection_count  = eail_selection_get_selection_count;
+   iface->is_child_selected    = eail_selection_is_child_selected;
+   iface->remove_selection     = eail_selection_remove_selection;
+   iface->select_all_selection = eail_selection_select_all_selection;
+}
+
+/**
+ * @brief Get name of disk selector child
+ *
+ * @param parent EailDiskselector instance
+ * @param item EailDiskselector child instance
+ *
+ * @returns const gchar * representing name of the child
+ */
+static const gchar *
+eail_diskselector_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief Initialization of EailItemParentIface callbacks
+ *
+ * @param iface an EailItemParentIface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_item_name = eail_diskselector_item_name_get;
+}
+
+/**
+ * @brief Next action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_diskselector_action_next(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it_next;
+   Elm_Object_Item *it;
+
+   g_return_val_if_fail(EAIL_IS_DISKSELECTOR(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   it = elm_diskselector_selected_item_get(widget);
+   if (!it) return FALSE;
+
+   it_next = elm_diskselector_item_next_get(it);
+   if (it_next) elm_diskselector_item_selected_set(it_next, EINA_TRUE);
+
+   evas_object_smart_callback_call(widget, "selected", NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief Prev action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_diskselector_action_prev(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   Elm_Object_Item *it_prev;
+
+   g_return_val_if_fail(EAIL_IS_DISKSELECTOR(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   it = elm_diskselector_selected_item_get(widget);
+   if (!it) return FALSE;
+
+   it_prev = elm_diskselector_item_prev_get(it);
+   if (it_prev) elm_diskselector_item_selected_set(it_prev, EINA_TRUE);
+
+   evas_object_smart_callback_call(widget, "selected", NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief Adds actions for scrolling to actions table
+ * @param widget widget that implements EailScrollable interface
+ */
+static void
+eail_diskselector_actions_table_init(EailDiskselector *widget)
+{
+   g_return_if_fail(EAIL_IS_DISKSELECTOR(widget));
+
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(widget),
+                                    EAIL_diskselector_ACTION_PREV,
+                                    NULL,
+                                    _eail_diskselector_action_prev);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(widget),
+                                    EAIL_diskselector_ACTION_NEXT,
+                                    NULL,
+                                    _eail_diskselector_action_next);
+}
diff --git a/eail/eail/eail_diskselector.h b/eail/eail/eail_diskselector.h
new file mode 100644 (file)
index 0000000..5cac1c8
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_diskselector.h
+ *
+ * @brief Header for EailDiskselector implementation
+ */
+
+#ifndef EAIL_DISKSELECTOR_H
+#define EAIL_DISKSELECTOR_H
+
+#include "eail_scrollable_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailDiskselector class
+ */
+#define EAIL_TYPE_DISKSELECTOR             (eail_diskselector_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailDiskselector
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_DISKSELECTOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                           EAIL_TYPE_DISKSELECTOR, EailDiskselector))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailDiskselector class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_DISKSELECTOR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                           EAIL_TYPE_DISKSELECTOR, EailDiskselectorClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailDiskselector class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_DISKSELECTOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                           EAIL_TYPE_DISKSELECTOR))
+/**
+ * @brief Tests whether given klass is a subclass of EailDiskselector
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_DISKSELECTOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                           EAIL_TYPE_DISKSELECTOR))
+/**
+ * @brief Gets EailDiskselector class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailDiskselector class from
+ */
+#define EAIL_DISKSELECTOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                           EAIL_TYPE_DISKSELECTOR, EailDiskselectorClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailDiskselector*/
+typedef struct _EailDiskselector      EailDiskselector;
+/** @brief Definition of class structure for Atk EailDiskselector*/
+typedef struct _EailDiskselectorClass EailDiskselectorClass;
+
+/** @brief Definition of object structure for Atk EailDiskselector*/
+struct _EailDiskselector
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailScrollableWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailDiskselector*/
+struct _EailDiskselectorClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailScrollableWidgetClass parent_class;
+};
+
+/** @brief Getter for EailDiskselector GType
+ * @returns GType for EailDiskselector implementation*/
+GType eail_diskselector_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_dynamic_content.c b/eail/eail/eail_dynamic_content.c
new file mode 100644 (file)
index 0000000..6e34810
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_dynamic_content.c
+ * @brief Implementation of EailDynamicContent - interface that is being used
+ * for handling children hierarchy updates by eail components
+*/
+
+#include "eail_dynamic_content.h"
+
+/**
+ *
+ * @returns GType for initialized interface
+ */
+GType
+eail_dynamic_content_get_type(void)
+{
+   static volatile GType type_id__volatile = 0;
+
+   if (g_once_init_enter(&type_id__volatile))
+     {
+        GType type_id = g_type_register_static_simple(
+                                    G_TYPE_INTERFACE,
+                                    "EailDynamicContent",
+                                    sizeof(EailDynamicContentIface),
+                                    NULL,
+                                    0,
+                                    NULL,
+                                    0);
+
+        g_once_init_leave(&type_id__volatile, type_id);
+     }
+
+   return type_id__volatile;
+}
+
+/**
+ * @param parent object that suports EailDynamicContent interface
+ *
+ */
+void eail_dynamic_content_update_hierarchy(EailDynamicContent *parent)
+{
+   EailDynamicContentIface *iface;
+
+   g_return_if_fail(EAIL_IS_DYNAMIC_CONTENT(parent));
+
+   iface = EAIL_DYNAMIC_CONTENT_GET_IFACE(parent);
+
+   if (iface->update_hierarchy)
+     iface->update_hierarchy(parent);
+
+}
diff --git a/eail/eail/eail_dynamic_content.h b/eail/eail/eail_dynamic_content.h
new file mode 100644 (file)
index 0000000..1d770c6
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_dynamic_content.h
+ *
+ * @brief Header for EailDynamicContent implementation
+ */
+
+#ifndef EAIL_DYNAMIC_CONTENT_H
+#define EAIL_DYNAMIC_CONTENT_H
+
+#include <glib-object.h>
+
+/**
+ * @brief Returns a value corresponding to the type of EailDynamicContent interface
+ */
+#define EAIL_TYPE_DYNAMIC_CONTENT           (eail_dynamic_content_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailDynamicContent
+ * interface
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_DYNAMIC_CONTENT(obj)  (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                 EAIL_TYPE_DYNAMIC_CONTENT, EailDynamicContent))
+/**
+ * @brief Tests whether object (obj) implements EailDynamicContent interface
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_DYNAMIC_CONTENT(obj)        (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                         EAIL_TYPE_DYNAMIC_CONTENT))
+/**
+ * @brief Gets EailDynamicContent interface structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailDynamicContent interface from
+ */
+#define EAIL_DYNAMIC_CONTENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj),\
+                              EAIL_TYPE_DYNAMIC_CONTENT, EailDynamicContentIface))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailDynamicContent*/
+typedef struct _EailDynamicContent      EailDynamicContent;
+/** @brief Definition of interface structure for Atk EailDynamicContent*/
+typedef struct _EailDynamicContentIface EailDynamicContentIface;
+
+/** @brief Definition of interface structure for Atk EailDynamicContent*/
+struct _EailDynamicContentIface
+{
+   GTypeInterface parent;/**< @brief parent interface that is being extended*/
+
+   /**@brief callback definition for eail_dynamic_content_update_hierarchy func*/
+   void (*update_hierarchy)            (EailDynamicContent   *parent);
+};
+
+GType eail_dynamic_content_get_type(void);
+void eail_dynamic_content_update_hierarchy(EailDynamicContent *parent);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_entry.c b/eail/eail/eail_entry.c
new file mode 100644 (file)
index 0000000..1016364
--- /dev/null
@@ -0,0 +1,1601 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_entry.c
+ * @brief Implementation of entry widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_entry.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+#include "eail_clipboard.h"
+
+static void atk_text_interface_init(AtkTextIface *iface);
+static void atk_editable_text_interface_init(AtkEditableTextIface *iface);
+
+/**
+ * @brief Definition of EailEntry as GObject
+ *
+ * EailEntry is extended EAIL_TYPE_TEXT with ATK_TYPE_TEXT and
+ * ATK_TYPE_EDITABLE_TEXT interfaces implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailEntry,
+                        eail_entry,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_EDITABLE_TEXT,
+                                              atk_editable_text_interface_init));
+
+/**
+ * @brief handler for event which is raised when entry content is being changed
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_entry_handle_changed_event(void *data,
+                                 Evas_Object *obj,
+                                 void *event_info)
+{
+   eail_emit_atk_signal
+                  (ATK_OBJECT(data), "visible-data-changed", ATK_TYPE_OBJECT);
+}
+
+/**
+ * @brief handler for event which is raised when entry content is being pressed
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_entry_handle_pressed_event(void *data,
+                                 Evas_Object *obj,
+                                 void *event_info)
+{
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_PRESSED, TRUE);
+}
+
+/**
+ * @brief Initializer for AtkObject
+ *
+ * @param obj an AtkObject
+ * @param data Initialization data
+ */
+static void
+eail_entry_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_entry_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_ENTRY;
+
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "changed",
+                                  _eail_entry_handle_changed_event, obj);
+   evas_object_smart_callback_add(nested_widget, "cursor,changed",
+                                  _eail_entry_handle_changed_event, obj);
+   evas_object_smart_callback_add(nested_widget, "press",
+                                  _eail_entry_handle_pressed_event, obj);
+}
+
+/**
+ * @brief Class destructor
+ *
+ * @param obj object instance
+ */
+static void
+eail_entry_finalize(GObject *obj)
+{
+}
+
+/**
+ * @brief Implementation of AtkObject->ref_state_set callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the state set of the accessible; the caller must
+ * unreference it when it is no longer needed.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns a reference to an AtkStateSet which is the state set of the
+ * accessible.
+ */
+static AtkStateSet *
+eail_entry_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+   if (!widget)
+     return NULL;
+
+   state_set = ATK_OBJECT_CLASS(eail_entry_parent_class)->ref_state_set(obj);
+
+   if (elm_entry_editable_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_EDITABLE);
+
+   if (elm_entry_single_line_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_SINGLE_LINE);
+   else
+     atk_state_set_add_state(state_set, ATK_STATE_MULTI_LINE);
+
+   return state_set;
+}
+
+/**
+ * @brief Initializer for EailEntry GObject implementation
+ *
+ * @param entry an EailEntry
+ */
+static void
+eail_entry_init(EailEntry *entry)
+{
+   entry->selection_start = 0;
+   entry->selection_end = 0;
+}
+
+/**
+ * @brief Initializer for EailPopup GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailEntryClass
+ */
+static void
+eail_entry_class_init(EailEntryClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_entry_initialize;
+   class->ref_state_set = eail_entry_ref_state_set;
+   gobject_class->finalize = eail_entry_finalize;
+}
+
+/**
+ * @brief Gets caret offset
+ *
+ * @param text an AtkText
+ * @return caret offset
+ */
+static gint
+eail_entry_get_caret_offset(AtkText *text)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget)
+     return 0;
+
+   return elm_entry_cursor_pos_get(widget);
+}
+
+/**
+ * @brief Sets offset for caret
+ *
+ * Implementation of AtkTextIface->set_caret_offset callback<br>
+ * ATK doc says:
+ * Sets the caret (cursor) position to the specified offset.
+ *
+ * @param text an AtkText
+ * @param offset starting position
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_entry_set_caret_offset (AtkText *text,
+                             gint     offset)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget)
+     return FALSE;
+
+   elm_entry_cursor_pos_set(widget, offset);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets the number of selected text regions
+ *
+ * @param text an AtkText
+ * @returns number of selected text regions
+ */
+static gint
+eail_entry_get_n_selections(AtkText *text)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return 0;
+
+   if (elm_entry_selection_get(widget)) return 1;
+
+   return 0;
+}
+
+/**
+ * @brief Gets text selection from entry
+ *
+ * Implementation of AtkTextIface->get_selection callback
+ *
+ * @param text an AtkText
+ * @param selection_num The selection number. The selected regions are assigned
+ * numbers that correspond to how far the region is from the start of the text.
+ * The selected region closest to the beginning of the text region is assigned
+ * the number 0, etc. Note that adding, moving or deleting a selected region can
+ *  change the numbering.
+ * @param start_offset passes back the start position of the selected region
+ * @param end_offset passes back the end position of the selected region
+ *
+ * @returns a newly allocated string containing the selected text. Use g_free()
+ * to free the returned string.
+ */
+static gchar *
+eail_entry_get_selection(AtkText *text,
+                         gint     selection_num,
+                         gint    *start_offset,
+                         gint    *end_offset)
+{
+   const char* selection;
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget)
+     return g_strdup("");
+
+   if (0 != selection_num)
+     return g_strdup("");
+
+   selection = elm_entry_selection_get(widget);
+   if (selection)
+     {
+        *start_offset = EAIL_ENTRY(text)->selection_start;
+        *end_offset = EAIL_ENTRY(text)->selection_end;
+        return g_strdup(selection);
+     }
+
+   return g_strdup("");
+}
+
+/**
+ * @brief Adds a selection bounded by the specified offsets
+ *
+ * @param text an AtkText
+ * @param start_offset start position of the selection
+ * @param end_offset offset of the first character after selection
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_entry_add_selection(AtkText *text,
+                         gint start_offset,
+                         gint end_offset)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return FALSE;
+
+   elm_entry_cursor_pos_set(widget, start_offset);
+   elm_entry_cursor_selection_begin(widget);
+   elm_entry_cursor_pos_set(widget, end_offset);
+   elm_entry_cursor_selection_end(widget);
+
+   EAIL_ENTRY(text)->selection_start = start_offset;
+   EAIL_ENTRY(text)->selection_end = end_offset;
+
+   return TRUE;
+}
+
+/**
+ * @brief Removes text selection
+ *
+ * Only one selection is supported, so
+ * selection_number equals 0.
+ *
+ * @param text an AtkText
+ * @param selection_num selection number
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_entry_remove_selection(AtkText *text,
+                            gint selection_num)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return FALSE;
+
+   if (selection_num != 0 || !elm_entry_selection_get(widget)) return FALSE;
+
+   elm_entry_select_none(widget);
+   EAIL_ENTRY(text)->selection_start = 0;
+   EAIL_ENTRY(text)->selection_end = 0;
+
+   return TRUE;
+}
+
+/**
+ * @brief Sets text selection for entry
+ *
+ * Implementation of AtkTextIface->set_selection callback
+ *
+ * @param text an AtkText
+ * @param selection_num The selection number. The selected regions are assigned
+ * numbers that correspond to how far the region is from the start of the text.
+ * The selected region closest to the beginning of the text region is assigned
+ * the number 0, etc. Note that adding, moving or deleting a selected region can
+ *  change the numbering.
+ * @param start_pos start position of the selected region
+ * @param end_pos end position of the selected region
+ *
+ * @returns TRUE if success, FALSE otherwise
+ */
+static gboolean
+eail_entry_set_selection(AtkText *text,
+                         gint     selection_num,
+                         gint     start_pos,
+                         gint     end_pos)
+{
+   if (0 != selection_num)
+     return FALSE;
+
+   return eail_entry_add_selection(text, start_pos, end_pos);
+}
+
+/**
+ * @brief Gets text bounded by start_offset and end_offset
+ *
+ * Use g_free() to free the returned string
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, -1 for the end of the string
+ * @return string containing text from start_offset up to, but not including
+ * end_offset
+ */
+static gchar*
+eail_entry_get_text(AtkText   *text,
+                    gint       start_offset,
+                    gint       end_offset)
+{
+   const gchar *string = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     string = elm_entry_entry_get(widget);
+
+   return eail_get_substring(string, start_offset, end_offset);
+}
+
+
+
+/**
+ * @brief Returns the position that is count characters from the
+ * given offset.
+ *
+ * count may be positive or negative.
+ *
+ * @param textblock an evas textblock
+ * @param offset a character offset
+ * @param count the number of characters to move from offset
+ * @returns a new position
+ */
+static gint
+_eail_move_chars(const Evas_Object *textblock,
+                 gint offset,
+                 gint count)
+{
+   Evas_Textblock_Cursor *cur;
+   gint dir;
+   gboolean res;
+
+   dir = count > 0 ? 1 : -1;
+   cur = evas_object_textblock_cursor_new(textblock);
+   evas_textblock_cursor_pos_set(cur, offset);
+
+   while(count)
+     {
+        res = dir > 0 ? evas_textblock_cursor_char_next(cur) :
+            evas_textblock_cursor_char_prev(cur);
+        if (!res) break;
+
+        count -= dir;
+     }
+
+   offset = evas_textblock_cursor_pos_get(cur);
+   evas_textblock_cursor_free(cur);
+
+   return offset;
+}
+
+/**
+ * @brief Gets utf8 character at offset
+ *
+ * @param textblock an evas textblock
+ * @param offset a character offset
+ * @returns a utf8 character
+ */
+static gunichar
+_eail_get_unichar_at_offset(const Evas_Object *textblock,
+                            int offset)
+{
+   Evas_Textblock_Cursor *cur;
+   gchar *s;
+   gunichar c;
+
+   cur = evas_object_textblock_cursor_new(textblock);
+   evas_textblock_cursor_pos_set(cur, offset);
+   s = evas_textblock_cursor_content_get(cur);
+   c = g_utf8_get_char(s);
+
+   evas_textblock_cursor_free(cur);
+   g_free(s);
+
+   return c;
+}
+
+/**
+ * @brief Checks whether character at offset in textblock is a word start
+ *
+ * @param textblock an evas textblock
+ * @param offset a character offset
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_is_word_start(const Evas_Object *textblock,
+                    gint offset)
+{
+   /* first character in a word */
+   gunichar c1, c2;
+
+   c1 = _eail_get_unichar_at_offset(textblock, offset);
+   c2 = _eail_get_unichar_at_offset(textblock, offset - 1);
+   if (g_unichar_isalnum(c1) && g_unichar_isspace(c2)) return TRUE;
+
+   return FALSE;
+}
+
+/**
+ * @brief Checks whether character at offset in textblock is a word end
+ *
+ * @param textblock an evas textblock
+ * @param offset a character offset
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_is_word_end(const Evas_Object *textblock,
+                  gint offset)
+{
+   /* is first non-word char after a word */
+   gunichar c1, c2;
+
+   c1 = _eail_get_unichar_at_offset(textblock, offset - 1);
+   c2 = _eail_get_unichar_at_offset(textblock, offset);
+   if (g_unichar_isalnum(c1) && g_unichar_isspace(c2)) return TRUE;
+
+   return FALSE;
+}
+
+/**
+ * @brief Check whether character at offset in textblock is inside a word
+ *
+ * @param textblock an evas textblock
+ * @param offset a character offset
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_is_inside_word(const Evas_Object *textblock,
+                     gint offset)
+{
+   gunichar c1, c2, c3;
+
+   c1 = _eail_get_unichar_at_offset(textblock, offset - 1);
+   c2 = _eail_get_unichar_at_offset(textblock, offset);
+   c3 = _eail_get_unichar_at_offset(textblock, offset + 1);
+   if (g_unichar_isalnum(c1) && g_unichar_isalnum(c2) && g_unichar_isalnum(c3))
+     return TRUE;
+
+   if (g_unichar_isalnum(c1) && g_unichar_isalnum(c2) && g_unichar_isspace(c3))
+     return TRUE;
+
+   if (g_unichar_isspace(c1) && g_unichar_isalnum(c2) && g_unichar_isalnum(c3))
+     return TRUE;
+
+   if (g_unichar_isspace(c1) && g_unichar_isalnum(c2) && g_unichar_isspace(c3))
+     return TRUE;
+
+   return FALSE;
+}
+
+/**
+ * @brief Gets texblock length
+ *
+ * @param textblock an evas textblock
+ * @returns a textblock length
+ */
+static gint
+_eail_get_len(const Evas_Object *textblock)
+{
+   Evas_Textblock_Cursor *cur;
+   int ctr = 0;
+
+   cur = evas_object_textblock_cursor_new(textblock);
+   while (evas_textblock_cursor_char_next(cur))
+     ++ctr;
+
+   evas_textblock_cursor_free(cur);
+
+   return ctr;
+}
+
+/**
+ * @brief Returns the position that is count words from the given offset.
+ *
+ * count may  be positive or negative. If count is positive, the returned
+ * position will be a word end, otherwise it will be a word start.
+ *
+ * @param textblock an evas textblock
+ * @param offset a cahracter offset
+ * @param count the number of words to move from offset
+ * @returns a new position
+ */
+static gint
+_eail_move_words(const Evas_Object *textblock,
+                 gint offset,
+                 gint count)
+{
+   gint len = _eail_get_len(textblock);
+
+   while (count > 0 && offset < len)
+     {
+        do
+          offset++;
+        while (offset < len && !_eail_is_word_end(textblock, offset));
+
+        count--;
+     }
+   while (count < 0 && offset > 0)
+     {
+        do
+          offset--;
+        while (offset > 0 && !_eail_is_word_start(textblock, offset));
+
+        count++;
+     }
+
+   return offset;
+}
+
+/**
+ * @brief Gets position of first character in line
+ *
+ * @param cur an Evas_Textblock_Cursor
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gint
+_eail_get_line_start(Evas_Textblock_Cursor *cur)
+{
+   gint start = 0;
+   gint pos;
+
+   pos = evas_textblock_cursor_pos_get(cur);
+   evas_textblock_cursor_line_char_first(cur);
+   start = evas_textblock_cursor_pos_get(cur);
+   evas_textblock_cursor_pos_set(cur, pos);
+
+   return start;
+}
+
+/**
+ * @brief Gets position of last character in line
+ *
+ * @param cur an Evas_Textblock_Cursor
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gint
+_eail_get_line_end(Evas_Textblock_Cursor *cur)
+{
+   gint end = 0;
+   gint pos;
+
+   pos = evas_textblock_cursor_pos_get(cur);
+   evas_textblock_cursor_line_char_last(cur);
+   end = evas_textblock_cursor_pos_get(cur);
+   evas_textblock_cursor_pos_set(cur, pos);
+
+   return end;
+}
+
+/**
+ * @brief Moves cursor to the beginning of the next line
+ *
+ * @param cur an Evas_Textblock_Cursor
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_iter_next_line(Evas_Textblock_Cursor *cur)
+{
+   evas_textblock_cursor_line_char_last(cur);
+
+   return evas_textblock_cursor_char_next(cur);
+}
+
+/**
+ * @brief Gets length of the line shown by cursor cur
+ *
+ * @param cur an Evas_Textblock_Cursor
+ * @return line length
+ */
+static gint
+_eail_get_line_length(Evas_Textblock_Cursor *cur)
+{
+   gint start;
+   gint end;
+
+   start = _eail_get_line_start(cur);
+   end = _eail_get_line_end(cur);
+
+   return end - start + 1;
+}
+
+/**
+ * @brief Gets before at offset
+ *
+ * @param entry an Evas_Object
+ * @param boundary_type an AtkTextBoundary
+ * @param offset position
+ * @param [out] start_offset the start offset of the returned string
+ * @param [out] end_offset the offset of the first character after the
+ * returned substring
+ */
+static void
+_eail_get_line_before(Evas_Object     *entry,
+                      AtkTextBoundary  boundary_type,
+                      gint             offset,
+                      gint            *start_offset,
+                      gint            *end_offset)
+{
+   Evas_Object *textblock;
+   Evas_Textblock_Cursor *cur, *prev_cur = NULL, *prev_prev_cur = NULL;
+   gint index, start_index, end_index;
+   const gchar *text;
+   gboolean found = FALSE;
+
+   textblock = elm_entry_textblock_get(entry);
+   cur = evas_object_textblock_cursor_new(textblock);
+
+   text = evas_textblock_text_markup_to_utf8(
+       textblock, evas_object_textblock_text_markup_get(textblock));
+   index = g_utf8_offset_to_pointer (text, offset) - text;
+   do
+     {
+        start_index = _eail_get_line_start(cur);
+        end_index = start_index + _eail_get_line_length(cur);
+
+        if (index >= start_index && index <= end_index)
+          {
+             /* Found line for offset */
+             if (prev_cur)
+               {
+                  switch (boundary_type)
+                    {
+                      case ATK_TEXT_BOUNDARY_LINE_START:
+                          end_index = start_index;
+                          start_index = _eail_get_line_start(prev_cur);
+                          break;
+                      case ATK_TEXT_BOUNDARY_LINE_END:
+                          if (prev_prev_cur)
+                            start_index = _eail_get_line_start(prev_prev_cur) +
+                                _eail_get_line_length(prev_prev_cur);
+                          else
+                            start_index = 0;
+                          end_index = _eail_get_line_start(prev_cur) +
+                              _eail_get_line_length(prev_cur);
+                          break;
+                      default:
+                          g_assert_not_reached();
+                    }
+               }
+             else
+               start_index = end_index = 0;
+
+             found = TRUE;
+             break;
+          }
+
+        prev_prev_cur = prev_cur;
+        prev_cur = cur;
+     }
+   while (_eail_iter_next_line(cur));
+
+   if (!found)
+     {
+        start_index = _eail_get_line_start(prev_cur) +
+            _eail_get_line_length(prev_cur);
+        end_index = start_index;
+     }
+   evas_textblock_cursor_free(cur);
+
+   *start_offset = g_utf8_pointer_to_offset(text, text + start_index);
+   *end_offset = g_utf8_pointer_to_offset(text, text + end_index);
+}
+
+/**
+ * @brief Gets line after offset
+ *
+ * @param entry an Evas_Object
+ * @param boundary_type an AtkTextBoundary
+ * @param offset position
+ * @param [out] start_offset the start offset of the returned string
+ * @param [out] end_offset the offset of the first character after the
+ * returned substring
+ */
+static void
+_eail_get_line_after (Evas_Object     *entry,
+                      AtkTextBoundary  boundary_type,
+                      gint             offset,
+                      gint            *start_offset,
+                      gint            *end_offset)
+{
+   Evas_Object *textblock;
+   Evas_Textblock_Cursor *cur, *prev_cur = NULL;
+   gint index, start_index, end_index;
+   const gchar *text;
+   gboolean found = FALSE;
+
+   textblock = elm_entry_textblock_get(entry);
+   cur = evas_object_textblock_cursor_new(textblock);
+   text = evas_textblock_text_markup_to_utf8(
+       textblock, evas_object_textblock_text_markup_get(textblock));
+
+   index = g_utf8_offset_to_pointer (text, offset) - text;
+   do
+     {
+        start_index = _eail_get_line_start(cur);
+        end_index = start_index + _eail_get_line_length(cur);
+
+        if (index >= start_index && index <= end_index)
+          {
+             /* Found line for offset */
+             if (_eail_iter_next_line (cur))
+               {
+                  switch (boundary_type)
+                    {
+                      case ATK_TEXT_BOUNDARY_LINE_START:
+                          start_index = _eail_get_line_start(cur);
+                          if (_eail_iter_next_line (cur))
+                            end_index = _eail_get_line_start(cur);
+                          else
+                            end_index = start_index + _eail_get_line_length(cur);
+                          break;
+                      case ATK_TEXT_BOUNDARY_LINE_END:
+                          start_index = end_index;
+                          end_index = _eail_get_line_start(cur) +
+                              _eail_get_line_length(cur);
+                          break;
+                      default:
+                          g_assert_not_reached();
+                    }
+               }
+             else
+               start_index = end_index;
+
+             found = TRUE;
+             break;
+          }
+
+        prev_cur = cur;
+     }
+   while (_eail_iter_next_line (cur));
+
+   if (!found)
+     {
+        start_index = _eail_get_line_start(prev_cur) +
+            _eail_get_line_length(prev_cur);
+        end_index = start_index;
+     }
+   evas_textblock_cursor_free(cur);
+
+   *start_offset = g_utf8_pointer_to_offset (text, text + start_index);
+   *end_offset = g_utf8_pointer_to_offset (text, text + end_index);
+}
+
+/**
+ * @brief Gets line at offset
+ *
+ * @param entry an Evas_Object
+ * @param boundary_type an AtkTextBoundary
+ * @param offset position
+ * @param [out] start_offset the start offset of the returned string
+ * @param [out] end_offset the offset of the first character after the
+ * returned substring
+ */
+static void
+_eail_get_line_at (Evas_Object *entry,
+                   AtkTextBoundary  boundary_type,
+                   gint             offset,
+                   gint            *start_offset,
+                   gint            *end_offset)
+{
+   Evas_Object *textblock;
+   Evas_Textblock_Cursor *cur, *prev_cur = NULL;
+   gint index, start_index, end_index;
+   const gchar *text;
+   gboolean found = FALSE;
+
+   textblock = elm_entry_textblock_get(entry);
+   cur = evas_object_textblock_cursor_new(textblock);
+
+   text = evas_textblock_text_markup_to_utf8(
+       textblock, evas_object_textblock_text_markup_get(textblock));
+   index = g_utf8_offset_to_pointer (text, offset) - text;
+   //iter = pango_layout_get_iter (layout);
+   do
+     {
+        //line = pango_layout_iter_get_line (iter);
+        start_index = _eail_get_line_start(cur);
+        end_index = start_index + _eail_get_line_end(cur);
+
+        if (index >= start_index && index <= end_index)
+          {
+             /* Found line for offset */
+             switch (boundary_type)
+               {
+                 case ATK_TEXT_BOUNDARY_LINE_START:
+                     if (_eail_iter_next_line (cur))
+                       end_index = _eail_get_line_start(cur);
+                     break;
+                 case ATK_TEXT_BOUNDARY_LINE_END:
+                     if (prev_cur)
+                       start_index = _eail_get_line_start(prev_cur) +
+                           _eail_get_line_length(prev_cur);
+                     break;
+                 default:
+                     g_assert_not_reached();
+               }
+
+             found = TRUE;
+             break;
+          }
+
+        prev_cur = cur;
+     }
+   while (_eail_iter_next_line (cur));
+
+   if (!found)
+     {
+        start_index = _eail_get_line_start(prev_cur) +
+            _eail_get_line_length(prev_cur);
+        end_index = start_index;
+     }
+   evas_textblock_cursor_free(cur);
+
+   *start_offset = g_utf8_pointer_to_offset (text, text + start_index);
+   *end_offset = g_utf8_pointer_to_offset (text, text + end_index);
+}
+
+/**
+ * @brief Gets a slice of the text from entry after offset
+ *
+ * @param entry an entry widget
+ * @param offset a character offset
+ * @param boundary_type an AtkTextBoundary
+ * @param [out] start_offset return location for the start of the returned text
+ * @param [out] end_offset return location for the end of the returned text
+ * @returns a newly allocated string containg a slice of text from textblock.
+ * Free with g_free()
+ */
+static gchar *
+_eail_get_text_after(Evas_Object *entry,
+                     gint offset,
+                     AtkTextBoundary boundary_type,
+                     gint *start_offset,
+                     gint *end_offset)
+{
+   const gchar *text;
+   int len;
+   gint start, end;
+   Evas_Object *textblock;
+
+   if (!entry) return g_strdup("");
+
+   textblock = elm_entry_textblock_get(entry);
+
+   text = evas_textblock_text_markup_to_utf8(
+       textblock, evas_object_textblock_text_markup_get(textblock));
+   if (!text)
+     {
+        *start_offset = 0;
+        *end_offset = 0;
+        return g_strdup("");
+     }
+
+   start = offset;
+   end = offset;
+   len = _eail_get_len(textblock);
+
+   switch (boundary_type)
+     {
+       case ATK_TEXT_BOUNDARY_CHAR:
+           start = _eail_move_chars(textblock, start, 1);
+           end = start;
+           end = _eail_move_chars(textblock, end, 1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_WORD_START:
+           if (_eail_is_inside_word(textblock, end))
+             end = _eail_move_words(textblock, end, 1);
+           while (!_eail_is_word_start(textblock, end) && end < len)
+             end = _eail_move_chars(textblock, end, 1);
+           start = end;
+           if (end < len)
+             {
+                end = _eail_move_words(textblock, end, 1);
+                while (!_eail_is_word_start(textblock, end) && end < len)
+                  end = _eail_move_chars(textblock, end, 1);
+             }
+           break;
+
+       case ATK_TEXT_BOUNDARY_WORD_END:
+           end = _eail_move_words(textblock, end, 1);
+           start = end;
+           if (end < len)
+             end = _eail_move_words(textblock, end, 1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_SENTENCE_START:
+       case ATK_TEXT_BOUNDARY_SENTENCE_END:
+           break;
+
+       case ATK_TEXT_BOUNDARY_LINE_START:
+       case ATK_TEXT_BOUNDARY_LINE_END:
+           _eail_get_line_after (entry, boundary_type, offset, &start, &end);
+           break;
+     }
+
+   *start_offset = start;
+   *end_offset = end;
+   g_assert(start <= end);
+
+   return g_utf8_substring(text, start, end);
+}
+
+/**
+ * @brief Gets a slice of the text from entry at offset
+ *
+ * @param entry an entry widget
+ * @param offset a character offset in entry
+ * @param boundary_type an AtkTextBoundary
+ * @param [out] start_offset return location for the start of the returned text
+ * @param [out] end_offset return location for the end of the return text
+ * @returns a newly allocated string containing a slice of text from entry.
+ * Free with g_free().
+ */
+static gchar *
+_eail_get_text_at(Evas_Object *entry,
+                  gint offset,
+                  AtkTextBoundary boundary_type,
+                  gint *start_offset,
+                  gint *end_offset)
+{
+   const gchar *text;
+   int len;
+   gint start, end;
+   Evas_Object *textblock;
+
+   if (!entry) return g_strdup("");
+
+   textblock = elm_entry_textblock_get(entry);
+
+   text = evas_textblock_text_markup_to_utf8(
+       textblock, evas_object_textblock_text_markup_get(textblock));
+   if (!text)
+     {
+        *start_offset = 0;
+        *end_offset = 0;
+        return g_strdup("");
+     }
+
+   start = offset;
+   end = offset;
+   len = _eail_get_len(textblock);
+
+   switch (boundary_type)
+     {
+       case ATK_TEXT_BOUNDARY_CHAR:
+           end = _eail_move_chars(textblock, end, 1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_WORD_START:
+           if (!_eail_is_word_start(textblock, start))
+             start = _eail_move_words(textblock, start, -1);
+           if (_eail_is_inside_word(textblock, end))
+             end = _eail_move_words(textblock, end, 1);
+           while (!_eail_is_word_start(textblock, end) && end < len)
+             end = _eail_move_chars(textblock, end, 1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_WORD_END:
+           if (_eail_is_inside_word(textblock, start) &&
+               !_eail_is_word_start(textblock, start))
+             start = _eail_move_words(textblock, start, -1);
+           while (!_eail_is_word_end(textblock, start) && start > 0)
+             start = _eail_move_chars(textblock, start, -1);
+           end = _eail_move_words(textblock, end, 1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_SENTENCE_START:
+       case ATK_TEXT_BOUNDARY_SENTENCE_END:
+           break;
+
+       case ATK_TEXT_BOUNDARY_LINE_START:
+       case ATK_TEXT_BOUNDARY_LINE_END:
+           _eail_get_line_at (entry, boundary_type, offset, &start, &end);
+           break;
+     }
+
+   *start_offset = start;
+   *end_offset = end;
+   g_assert(start <= end);
+
+   return g_utf8_substring(text, start, end);
+}
+
+/**
+ * @brief Gets a slice of the text from entry before offset
+ *
+ * @param entry an entry widget
+ * @param offset a character offset
+ * @param boundary_type an AtkTextBoundary
+ * @param start_offset return location for the start of the returned text
+ * @param end_offset return location for the end of the returned text
+ * @returns a newly allocated string containing a slice of text from entry.
+ * Free with g_free().
+ */
+static gchar *
+_eail_get_text_before(Evas_Object *entry,
+                      gint offset,
+                      AtkTextBoundary boundary_type,
+                      gint *start_offset,
+                      gint *end_offset)
+{
+   const gchar *text;
+   gint start, end;
+   Evas_Object *textblock;
+
+   if (!entry) return g_strdup("");
+
+   textblock = elm_entry_textblock_get(entry);
+
+   text = evas_textblock_text_markup_to_utf8(
+       textblock, evas_object_textblock_text_markup_get(textblock));
+   if (!text)
+     {
+        *start_offset = 0;
+        *end_offset = 0;
+        return g_strdup("");
+     }
+
+   start = offset;
+   end = offset;
+
+   switch (boundary_type)
+     {
+       case ATK_TEXT_BOUNDARY_CHAR:
+           start = _eail_move_chars(textblock, start, -1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_WORD_START:
+           if (!_eail_is_word_start(textblock, start))
+             start = _eail_move_words(textblock, start, -1);
+           end = start;
+           start = _eail_move_words(textblock, start, -1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_WORD_END:
+           if (_eail_is_inside_word(textblock, start) &&
+               !_eail_is_word_start(textblock, start))
+             start = _eail_move_words(textblock, start, -1);
+           while (!_eail_is_word_end(textblock, start) && start > 0)
+             start = _eail_move_chars(textblock, start, -1);
+           end = start;
+           start = _eail_move_words(textblock, start, -1);
+           while (!_eail_is_word_end(textblock, start) && start > 0)
+             start = _eail_move_chars(textblock, start, -1);
+           break;
+
+       case ATK_TEXT_BOUNDARY_SENTENCE_START:
+       case ATK_TEXT_BOUNDARY_SENTENCE_END:
+           break;
+
+       case ATK_TEXT_BOUNDARY_LINE_START:
+       case ATK_TEXT_BOUNDARY_LINE_END:
+           _eail_get_line_before (entry, boundary_type, offset, &start, &end);
+           break;
+     }
+
+   *start_offset = start;
+   *end_offset = end;
+   g_assert(start <= end);
+
+   return g_utf8_substring(text, start, end);
+}
+
+/**
+ * @brief Gets the specified text
+ *
+ * @param text an AtkText
+ * @param offset position
+ * @param boundary_type an AtkTextBoundary
+ * @param [out] start_offset the start offset of the returned string
+ * @param [out] end_offset the offset of the first character after the returned
+ * substring
+ * @returns a newly allocated string containing the text after offset bounded
+ * by the specified boundary_type. Use g_free() to free the returned string.
+ */
+static gchar *
+eail_entry_get_text_after_offset(AtkText *text,
+                                 gint offset,
+                                 AtkTextBoundary boundary_type,
+                                 gint *start_offset,
+                                 gint *end_offset)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return NULL;
+
+   return _eail_get_text_after(widget, offset, boundary_type, start_offset,
+                               end_offset);
+
+}
+
+/**
+ * @brief Gets the specified text
+ *
+ * @param text an AtkText
+ * @param offset position
+ * @param boundary_type an AtkTextBoundary
+ * @param [out] start_offset the start offset of the returned string
+ * @param [out] end_offset the offset of the first character after the returned
+ * substring
+ * @returns a newly allocated string containing the text after offset bounded
+ * by the specified boundary_type. Use g_free() to free the returned string.
+ */
+static gchar *
+eail_entry_get_text_at_offset(AtkText *text,
+                              gint offset,
+                              AtkTextBoundary boundary_type,
+                              gint *start_offset,
+                              gint *end_offset)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return NULL;
+
+   return _eail_get_text_at(widget, offset, boundary_type, start_offset,
+                            end_offset);
+}
+
+/**
+ * @brief Gets the specified text
+ *
+ * @param text an AtkText
+ * @param offset position
+ * @param boundary_type an AtkTextBoundary
+ * @param [out] start_offset the start offset of the returned string
+ * @param [out] end_offset the offset of the first character after the returned
+ * substring
+ * @returns a newly allocated string containing the text after offset bounded
+ * by the specified boundary_type. Use g_free() to free the returned string.
+ */
+static gchar *
+eail_entry_get_text_before_offset(AtkText *text,
+                                  gint offset,
+                                  AtkTextBoundary boundary_type,
+                                  gint *start_offset,
+                                  gint *end_offset)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return NULL;
+
+   return _eail_get_text_before(widget, offset, boundary_type, start_offset,
+                                end_offset);
+}
+
+/**
+ * @brief Gets character at offset
+ *
+ * @param text an AtkText
+ * @param offset character offset
+ * @return character at offset
+ */
+static gunichar
+eail_entry_get_character_at_offset(AtkText    *text,
+                                   gint        offset)
+{
+   gunichar character = '\0';
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     character = g_utf8_get_char(
+         g_utf8_offset_to_pointer(elm_entry_entry_get(widget), offset));
+
+   return character;
+}
+
+/**
+ * @brief Gets text length
+ *
+ * @param text an AtkText
+ * @return text length
+ */
+static gint
+eail_entry_get_character_count(AtkText *text)
+{
+   gint count = 0;
+   const gchar *string_text = NULL;
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (!widget) return count;
+
+   string_text = elm_object_text_get(widget);
+   if (!string_text) return count;
+
+   count = g_utf8_strlen(string_text, -1);
+
+   return count;
+}
+
+/**
+ * @brief Adds attribute to attribute set
+ *
+ * @param attrib_set The AtkAttributeSet to add the attribute to
+ * @param attr The AtkTextAttrribute which identifies the attribute to be added
+ * @param value The attribute value
+ *
+ * Creates an AtkAttribute from attr and value, and adds it
+ * to attrib_set.
+ *
+ * @returns: A pointer to the new AtkAttributeSet.
+ **/
+AtkAttributeSet*
+eail_entry_add_attribute(AtkAttributeSet *attrib_set,
+                         AtkTextAttribute attr,
+                         gchar           *value)
+{
+   AtkAttributeSet *return_set;
+   AtkAttribute *at = g_malloc (sizeof (AtkAttribute));
+   at->name = g_strdup (atk_text_attribute_get_name (attr));
+   at->value = value;
+   return_set = g_slist_prepend(attrib_set, at);
+   return return_set;
+}
+
+/**
+ * @brief Creates an AtkAttributeSet which consists of the default values of
+ * attributes for the text.
+ *
+ * @param text an AtkText
+ *
+ * @returns an AtkAttributeSet which contains the default values of attributes
+ * at offset. this atkattributeset should be freed by a call to
+ * atk_attribute_set_free()
+ */
+AtkAttributeSet *
+eail_entry_get_default_attributes(AtkText *text)
+{
+   AtkAttributeSet *at_set = NULL;
+
+   at_set = eail_entry_add_attribute
+       (at_set, ATK_TEXT_ATTR_WRAP_MODE,
+        g_strdup
+        (atk_text_attribute_get_value(ATK_TEXT_ATTR_WRAP_MODE, 0)));
+
+   at_set = eail_entry_add_attribute
+       (at_set, ATK_TEXT_ATTR_EDITABLE,
+        g_strdup
+        (atk_text_attribute_get_value
+         (ATK_TEXT_ATTR_EDITABLE, TRUE)));
+
+   return at_set;
+}
+
+/**
+ * @brief Creates an AtkAttributeSet which consists of the attributes
+ * explicitly set at the position offset in the text. start_offset and
+ * end_offset are set to the start and end of the range around offset
+ * where the attributes are invariant. Note that end_offset is the offset
+ * of the first character after the range.
+ *
+ * @param text an AtkText
+ * @param offset the offset at which to get the attributes
+ * @param start_offset the address to put the start offset of the range (used to
+ * store output value)
+ * @param end_offset the address to put the end offset of the range (used to
+ * store output value)
+ *
+ * @returns an AtkAttributeSet which contains the attributes explicitly set at
+ * offset. This AtkAttributeSet should be freed by a call to
+ * atk_attribute_set_free()
+ */
+AtkAttributeSet *
+eail_entry_get_run_attributes(AtkText *text,
+                              gint offset,
+                              gint *start_offset,
+                              gint *end_offset)
+{
+   AtkAttributeSet *at_set = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (!widget || offset >= eail_entry_get_character_count(text))
+     {
+        *start_offset = -1;
+        *end_offset = -1;
+
+        return NULL;
+     }
+
+   *start_offset = 0;
+   *end_offset = eail_entry_get_character_count(text);
+
+   /* NOTE: Elm_Wrap_Type value is in 100% compatible with ATK wrap modes, so
+    * no additional conversion is needed*/
+   Elm_Wrap_Type wrap_type = elm_entry_line_wrap_get(widget);
+   at_set = eail_entry_add_attribute
+       (at_set, ATK_TEXT_ATTR_WRAP_MODE,
+        g_strdup
+        (atk_text_attribute_get_value
+         (ATK_TEXT_ATTR_WRAP_MODE, wrap_type)));
+
+   Eina_Bool editable = elm_entry_editable_get(widget);
+   at_set = eail_entry_add_attribute
+       (at_set, ATK_TEXT_ATTR_EDITABLE,
+        g_strdup
+        (atk_text_attribute_get_value
+         (ATK_TEXT_ATTR_EDITABLE, editable)));
+
+   return at_set;
+}
+
+/**
+ * @brief Initializes AtkTextIface interface
+ *
+ * @param iface an AtkTextIface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+   iface->get_caret_offset = eail_entry_get_caret_offset;
+   iface->set_caret_offset = eail_entry_set_caret_offset;
+   iface->get_selection    = eail_entry_get_selection;
+   iface->set_selection    = eail_entry_set_selection;
+   iface->get_text         = eail_entry_get_text;
+   iface->get_character_at_offset = eail_entry_get_character_at_offset;
+   iface->get_character_count = eail_entry_get_character_count;
+   iface->remove_selection = eail_entry_remove_selection;
+   iface->get_n_selections = eail_entry_get_n_selections;
+   iface->add_selection = eail_entry_add_selection;
+   iface->get_run_attributes = eail_entry_get_run_attributes;
+   iface->get_default_attributes = eail_entry_get_default_attributes;
+   iface->get_text_after_offset = eail_entry_get_text_after_offset;
+   iface->get_text_at_offset = eail_entry_get_text_at_offset;
+   iface->get_text_before_offset = eail_entry_get_text_before_offset;
+}
+
+/*
+ * Implementation of the *AtkEditableText* interface
+ */
+
+/**
+ * @brief Set text content for entry
+ * @param text an AtkEditableText
+ * @param string string to be set
+ */
+static void
+eail_entry_set_text_contents(AtkEditableText *text,
+                             const gchar     *string)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (widget && elm_entry_editable_get(widget))
+     elm_object_text_set(widget, string);
+}
+
+/**
+ * @brief Copies text content from entry to clipboard
+ *
+ * @param text an AtkEditableText
+ * @param start_pos start position of cursor
+ * @param end_pos end position of cursor
+ */
+static void
+eail_entry_copy_text(AtkEditableText *text,
+                     gint             start_pos,
+                     gint             end_pos)
+{
+   Evas_Object *widget;
+   const char *entry_text;
+   char *tmp;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return;
+
+   entry_text = elm_entry_entry_get(widget);
+   tmp = eail_get_substring(entry_text, start_pos, end_pos);
+   eail_clipboard_set_text(tmp);
+   g_free(tmp);
+}
+
+/**
+ * @brief Cuts text content from entry to clipboard
+ *
+ * @param text an AtkEditableText
+ * @param start_pos start position of cursor
+ * @param end_pos end position of cursor
+ */
+static void
+eail_entry_cut_text(AtkEditableText *text,
+                    gint             start_pos,
+                    gint             end_pos)
+{
+   Evas_Object *widget;
+   const char *entry_text;
+   char *tmp;
+   GString *s;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_entry_editable_get(widget))
+     return;
+
+   entry_text = elm_entry_entry_get(widget);
+   tmp = eail_get_substring(entry_text, start_pos, end_pos);
+   eail_clipboard_set_text(tmp);
+   g_free(tmp);
+
+   s = g_string_new(entry_text);
+   s = g_string_erase(s, start_pos, end_pos - start_pos);
+
+   elm_entry_entry_set(widget, s->str);
+   g_string_free(s, TRUE);
+}
+
+/**
+ * @brief Pastes text content from clipboard into entry
+ *
+ * @param text an AtkEditableText
+ * @param position start position of cursor
+ */
+static void
+eail_entry_paste_text(AtkEditableText *text,
+                      gint             position)
+{
+   Evas_Object *widget;
+   GString *s;
+   const char *clip;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_entry_editable_get(widget))
+     return;
+
+   clip = eail_clipboard_get_text();
+   if (!clip) return;
+
+   s = g_string_new(elm_entry_entry_get(widget));
+   s = g_string_insert(s, position, clip);
+   elm_entry_entry_set(widget, s->str);
+   g_string_free(s, TRUE);
+}
+
+/**
+ * @brief Deletes text between start_pos and end_pos but not
+ * including end_pos
+ *
+ * @param text an AtkEditableText
+ * @param start_pos start position
+ * @param end_pos end position
+ */
+static void
+eail_entry_delete_text(AtkEditableText *text,
+                       gint start_pos,
+                       gint end_pos)
+{
+   Evas_Object *widget;
+   GString *entry_text;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_entry_editable_get(widget))
+     return;
+
+   entry_text = g_string_new(elm_entry_entry_get(widget));
+   entry_text = g_string_erase(entry_text, start_pos, end_pos-start_pos);
+
+   elm_entry_entry_set(widget, entry_text->str);
+   g_string_free(entry_text, TRUE);
+}
+
+/**
+ * @brief Inserts text at given position
+ *
+ * @param text an AtkEditableText
+ * @param string string to insert
+ * @param length string length
+ * @param [out] position at witch text is inserted.
+ * After the call it points at the position after the newly inserted text.
+ */
+static void
+eail_entry_insert_text(AtkEditableText *text,
+                       const gchar *string,
+                       gint length,
+                       gint *position)
+{
+   Evas_Object *widget;
+   GString *entry_text;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_entry_editable_get(widget))
+     return;
+
+   entry_text = g_string_new(elm_entry_entry_get(widget));
+   entry_text = g_string_insert_len(entry_text, *position, string,
+                                    length);
+   elm_entry_entry_set(widget, entry_text->str);
+   *position += length;
+   g_string_free(entry_text, TRUE);
+}
+
+/**
+ * @brief Initialization for AtkEditableTextIface interface
+ *
+ * Function called upon instance creation. It initializes AtkText interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkEditableTextIface
+ */
+static void
+atk_editable_text_interface_init(AtkEditableTextIface *iface)
+{
+   iface->set_text_contents = eail_entry_set_text_contents;
+   iface->copy_text = eail_entry_copy_text;
+   iface->cut_text = eail_entry_cut_text;
+   iface->paste_text = eail_entry_paste_text;
+   iface->delete_text = eail_entry_delete_text;
+   iface->insert_text = eail_entry_insert_text;
+}
diff --git a/eail/eail/eail_entry.h b/eail/eail/eail_entry.h
new file mode 100644 (file)
index 0000000..a742bf0
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_entry.h
+ *
+ * @brief Header for EailEntry implementation
+ */
+
+#ifndef EAIL_ENTRY_H
+#define EAIL_ENTRY_H
+
+#include "eail_text.h"
+/**
+ * @brief Returns a value corresponding to the type of EailEntry class
+ */
+#define EAIL_TYPE_ENTRY              (eail_entry_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailEntry
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_ENTRY(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                      EAIL_TYPE_ENTRY, EailEntry))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailEntry class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_ENTRY_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                      EAIL_TYPE_ENTRY, EailEntryClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailEntry class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_ENTRY(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                      EAIL_TYPE_ENTRY))
+/**
+ * @brief Tests whether given klass is a subclass of EailEntry
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_ENTRY_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                      EAIL_TYPE_ENTRY))
+/**
+ * @brief Gets EailEntry class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailEntry class from
+ */
+#define EAIL_ENTRY_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                      EAIL_TYPE_ENTRY, EailEntryClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailEntry*/
+typedef struct _EailEntry      EailEntry;
+/** @brief Definition of class structure for Atk EailEntry*/
+typedef struct _EailEntryClass EailEntryClass;
+
+/** @brief Definition of object structure for Atk EailEntry*/
+struct _EailEntry
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+   /** @brief Selection region start */
+   gint selection_start;
+   /** @brief Selection regiond end */
+   gint selection_end;
+};
+
+/** @brief Definition of class structure for Atk EailEntry*/
+struct _EailEntryClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailEntry GType
+ * @returns GType for EailEntry implementation*/
+GType eail_entry_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_factory.c b/eail/eail/eail_factory.c
new file mode 100644 (file)
index 0000000..0315fa6
--- /dev/null
@@ -0,0 +1,642 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_factory.c
+ * @brief Implementation of factory of EAIL accessible widgets
+ */
+
+#include <Elementary.h>
+
+#include "eail_factory.h"
+#include "eail_widget.h"
+#include "eail_window.h"
+#include "eail_background.h"
+#include "eail_box.h"
+#include "eail_list.h"
+#include "eail_genlist.h"
+#include "eail_label.h"
+#include "eail_button.h"
+#include "eail_icon.h"
+#include "eail_entry.h"
+#include "eail_frame.h"
+#include "eail_scroller.h"
+#include "eail_slider.h"
+#include "eail_action_slider.h"
+#include "eail_inwin.h"
+#include "eail_image.h"
+#include "eail_check.h"
+#include "eail_radio_button.h"
+#include "eail_menu.h"
+#include "eail_photo.h"
+#include "eail_photocam.h"
+#include "eail_separator.h"
+#include "eail_spinner.h"
+#include "eail_clock.h"
+#include "eail_calendar.h"
+#include "eail_grid.h"
+#include "eail_route.h"
+#include "eail_dayselector.h"
+#include "eail_gengrid.h"
+#include "eail_progressbar.h"
+#include "eail_diskselector.h"
+#include "eail_segment_control.h"
+#include "eail_conformant.h"
+#include "eail_colorselector.h"
+#include "eail_notify.h"
+#include "eail_naviframe.h"
+#include "eail_datetime.h"
+#include "eail_hover.h"
+#include "eail_popup.h"
+#include "eail_ctxpopup.h"
+#include "eail_toolbar.h"
+#include "eail_multibuttonentry.h"
+#include "eail_web.h"
+#include "eail_index.h"
+#include "eail_fileselector.h"
+#include "eail_fileselector_entry.h"
+#include "eail_panes.h"
+#include "eail_panel.h"
+#include "eail_thumb.h"
+#include "eail_mapbuf.h"
+#include "eail_slideshow.h"
+#include "eail_hoversel.h"
+#include "eail_map.h"
+#include "eail_glview.h"
+#include "eail_bubble.h"
+#include "eail_plug.h"
+#include "eail_video.h"
+#include "eail_flip.h"
+#include "eail_flipselector.h"
+#include "eail_layout.h"
+#include "eail_table.h"
+#include "eail_prefs.h"
+#include "eail_item.h"
+#include "eail_item_parent.h"
+#include "eail_priv.h"
+
+/** @brief Cache of created AtkObjects for re-using by multiple ATK clients. It holds
+ * EailFactoryObj* objects inside */
+static Eina_List *eail_cached_objs = NULL;
+
+/**
+ * @brief Creates EailFactoryObj instance for given widget and adds it to cache
+ * @param atk_obj an AtkObject
+ * @param evas_obj an Evas_Object
+ */
+static void
+_eail_factory_append_wdgt_to_cache(AtkObject *atk_obj, Evas_Object *evas_obj)
+{
+   EailFactoryObj *factory_obj = g_new0(EailFactoryObj, 1);
+   factory_obj->atk_obj = atk_obj;
+   factory_obj->evas_obj = evas_obj;
+
+   eail_cached_objs = eina_list_append(eail_cached_objs, factory_obj);
+}
+
+/**
+ * @brief Tries to find AtkObject representing given Evas_Object* in cache
+ *
+ * @param widget an Evas_Object to find in cache
+ *
+ * @returns an EailFactoryObj * object or NULL if widget representation was not
+ * found
+ */
+static EailFactoryObj *
+_eail_factory_find_obj_for_widget(const Evas_Object *widget)
+{
+   const Eina_List *l = NULL;
+   EailFactoryObj *factory_obj = NULL;
+
+   EINA_LIST_FOREACH(eail_cached_objs, l, factory_obj)
+     {
+        if (widget == factory_obj->evas_obj)
+          {
+             return factory_obj;
+          }
+     }
+
+   /* no widget implementation in cache was found */
+   return NULL;
+}
+
+/**
+ * @brief Creates accessible AtkObject for Evas_Object*
+ *
+ * @param widget an Evas_Object*
+ *
+ * @returns reference to AtkObject* which is accessible representation of given
+ * Evas_Object. It should be unreferenced when no longer needed to free memory
+ */
+static AtkObject *
+_eail_factory_create_accessible(Evas_Object *widget)
+{
+   const char *type = NULL;
+   AtkObject *accessible = NULL;
+
+   type = elm_object_widget_type_get(widget);
+
+   if (!strcmp(type, "elm_win"))
+     {
+        accessible = g_object_new(EAIL_TYPE_WINDOW, NULL);
+     }
+   else if (!strcmp(type, "elm_bg"))
+     {
+        accessible = g_object_new(EAIL_TYPE_BACKGROUND, NULL);
+     }
+   else if (!strcmp(type, "elm_box"))
+     {
+        accessible = g_object_new(EAIL_TYPE_BOX, NULL);
+     }
+   else if (!strcmp(type, "elm_list"))
+     {
+        accessible = g_object_new(EAIL_TYPE_LIST, NULL);
+     }
+   else if (!strcmp(type, "elm_genlist"))
+     {
+        accessible = g_object_new(EAIL_TYPE_GENLIST, NULL);
+     }
+   else if (!strcmp(type, "elm_label"))
+     {
+        accessible = g_object_new(EAIL_TYPE_LABEL, NULL);
+     }
+   else if (!strcmp(type, "elm_button"))
+     {
+        accessible = g_object_new(EAIL_TYPE_BUTTON, NULL);
+     }
+   else if (!strcmp(type, "elm_icon"))
+     {
+        accessible = g_object_new(EAIL_TYPE_ICON, NULL);
+     }
+   else if ((!strcmp(type, "entry")) || (!strcmp(type, "elm_entry")))
+     {
+        accessible = g_object_new(EAIL_TYPE_ENTRY, NULL);
+     }
+   else if (!strcmp(type, "elm_frame"))
+     {
+        accessible = g_object_new(EAIL_TYPE_FRAME, NULL);
+     }
+   else if (!strcmp(type, "elm_scroller"))
+     {
+        accessible = g_object_new(EAIL_TYPE_SCROLLER, NULL);
+     }
+   else if (!strcmp(type, "elm_inwin"))
+     {
+        accessible = g_object_new(EAIL_TYPE_INWIN, NULL);
+     }
+   else if (!strcmp(type, "elm_slider"))
+     {
+        accessible = g_object_new(EAIL_TYPE_SLIDER, NULL);
+     }
+   else if (!strcmp(type, "elm_actionslider"))
+     {
+        accessible = g_object_new(EAIL_TYPE_ACTION_SLIDER, NULL);
+     }
+   else if (!strcmp(type, "elm_image"))
+     {
+        accessible = g_object_new(EAIL_TYPE_IMAGE, NULL);
+     }
+   else if (!strcmp(type, "elm_check"))
+     {
+        accessible = g_object_new(EAIL_TYPE_CHECK, NULL);
+     }
+   else if (!strcmp(type, "elm_radio"))
+     {
+        accessible = g_object_new(EAIL_TYPE_RADIO_BUTTON, NULL);
+     }
+   else if (!strcmp(type, "elm_menu"))
+     {
+        accessible = g_object_new(EAIL_TYPE_MENU, NULL);
+     }
+   else if (!strcmp(type, "elm_photo"))
+     {
+        accessible = g_object_new(EAIL_TYPE_PHOTO, NULL);
+     }
+   else if (!strcmp(type, "elm_photocam"))
+     {
+        accessible = g_object_new(EAIL_TYPE_PHOTOCAM, NULL);
+     }
+   else if (!strcmp(type, "elm_separator"))
+     {
+        accessible = g_object_new(EAIL_TYPE_SEPARATOR, NULL);
+     }
+   else if (!strcmp(type, "elm_spinner"))
+     {
+        accessible = g_object_new(EAIL_TYPE_SPINNER, NULL);
+     }
+   else if (!strcmp(type, "elm_clock"))
+     {
+        accessible = g_object_new(EAIL_TYPE_CLOCK, NULL);
+     }
+   else if (!strcmp(type, "elm_calendar"))
+     {
+        accessible = g_object_new(EAIL_TYPE_CALENDAR, NULL);
+     }
+   else if (!strcmp(type, "elm_grid"))
+     {
+        accessible = g_object_new(EAIL_TYPE_GRID, NULL);
+     }
+   else if (!strcmp(type, "elm_route"))
+     {
+        accessible = g_object_new(EAIL_TYPE_ROUTE, NULL);
+     }
+   else if (!strcmp(type, "elm_dayselector"))
+     {
+        accessible = g_object_new(EAIL_TYPE_DAYSELECTOR, NULL);
+     }
+   else if (!strcmp(type, "elm_gengrid"))
+     {
+        accessible = g_object_new(EAIL_TYPE_GENGRID, NULL);
+     }
+   else if (!strcmp(type, "elm_progressbar"))
+     {
+        accessible = g_object_new(EAIL_TYPE_PROGRESSBAR, NULL);
+     }
+   else if (!strcmp(type, "elm_diskselector"))
+     {
+        accessible = g_object_new(EAIL_TYPE_DISKSELECTOR, NULL);
+     }
+   else if (!strcmp(type, "elm_segment_control"))
+     {
+        accessible = g_object_new(EAIL_TYPE_SEGMENT_CONTROL, NULL);
+     }
+   else if (!strcmp(type, "elm_conformant"))
+     {
+        accessible = g_object_new(EAIL_TYPE_CONFORMANT, NULL);
+     }
+   else if (!strcmp(type, "elm_notify"))
+     {
+        accessible = g_object_new(EAIL_TYPE_NOTIFY, NULL);
+     }
+   else if ((!strcmp(type, "popup")) || (!strcmp(type, "elm_popup")))
+     {
+        accessible = g_object_new(EAIL_TYPE_POPUP, NULL);
+     }
+   else if ((!strcmp(type, "ctxpopup")) || ((!strcmp(type, "elm_ctxpopup"))))
+     {
+        accessible = g_object_new(EAIL_TYPE_CTXPOPUP, NULL);
+     }
+   else if ((!strcmp(type, "toolbar")) || (!strcmp(type, "elm_toolbar")))
+     {
+        accessible = g_object_new(EAIL_TYPE_TOOLBAR, NULL);
+     }
+   else if (!strcmp(type, "elm_multibuttonentry"))
+     {
+        accessible = g_object_new(EAIL_TYPE_MULTIBUTTONENTRY, NULL);
+     }
+   else if (!strcmp(type, "elm_web"))
+     {
+        accessible = g_object_new(EAIL_TYPE_WEB, NULL);
+     }
+   else if (!strcmp(type, "elm_index"))
+     {
+        accessible = g_object_new(EAIL_TYPE_INDEX, NULL);
+     }
+   else if (!strcmp(type, "elm_fileselector"))
+     {
+        accessible = g_object_new(EAIL_TYPE_FILESELECTOR, NULL);
+     }
+   else if ((!strcmp(type, "elm_fileselector_entry")) ||
+            (!strcmp(type, "fileselector_entry")))
+     {
+        accessible = g_object_new(EAIL_TYPE_FILESELECTOR_ENTRY, NULL);
+     }
+   else if (!strcmp(type, "elm_fileselector_button"))
+     {
+        /* NOTE: file selector button from accesibility point of view is
+         * no different in handling than regular push button */
+        accessible = g_object_new(EAIL_TYPE_BUTTON, NULL);
+     }
+   else if (!strcmp(type, "elm_colorselector"))
+     {
+        accessible = g_object_new(EAIL_TYPE_COLORSELECTOR, NULL);
+     }
+   else if (!strcmp(type, "elm_naviframe"))
+     {
+        accessible = g_object_new(EAIL_TYPE_NAVIFRAME, NULL);
+     }
+   else if (!strcmp(type, "elm_datetime"))
+     {
+        accessible = g_object_new(EAIL_TYPE_DATETIME, NULL);
+     }
+   else if (!strcmp(type, "elm_hover"))
+     {
+        accessible = g_object_new(EAIL_TYPE_HOVER, NULL);
+     }
+   else if (!strcmp(type, "elm_panes"))
+     {
+        accessible = g_object_new(EAIL_TYPE_PANES, NULL);
+     }
+   else if ((!strcmp(type, "panel")) || (!strcmp(type, "elm_panel")))
+     {
+        accessible = g_object_new(EAIL_TYPE_PANEL, NULL);
+     }
+   else if (!strcmp(type, "elm_thumb"))
+     {
+        accessible = g_object_new(EAIL_TYPE_THUMB, NULL);
+     }
+   else if (!strcmp(type, "elm_mapbuf"))
+     {
+        accessible = g_object_new(EAIL_TYPE_MAPBUF, NULL);
+     }
+   else if (!strcmp(type, "elm_slideshow"))
+     {
+        accessible = g_object_new(EAIL_TYPE_SLIDESHOW, NULL);
+     }
+   else if (!strcmp(type, "elm_hoversel"))
+     {
+        accessible = g_object_new(EAIL_TYPE_HOVERSEL, NULL);
+     }
+   else if (!strcmp(type, "elm_map"))
+     {
+        accessible = g_object_new(EAIL_TYPE_MAP, NULL);
+     }
+   else if (!strcmp(type, "elm_glview"))
+     {
+        accessible = g_object_new(EAIL_TYPE_GLVIEW, NULL);
+     }
+   else if (!strcmp(type, "elm_bubble"))
+     {
+        accessible = g_object_new(EAIL_TYPE_BUBBLE, NULL);
+     }
+   else if (!strcmp(type, "elm_plug"))
+     {
+        accessible = g_object_new(EAIL_TYPE_PLUG, NULL);
+     }
+   else if ((!strcmp(type, "elm_video")) || (!strcmp(type, "elm_player")))
+     {
+        accessible = g_object_new(EAIL_TYPE_VIDEO, NULL);
+     }
+   else if (!strcmp(type, "elm_flip"))
+     {
+        accessible = g_object_new(EAIL_TYPE_FLIP, NULL);
+     }
+   else if (!strcmp(type, "elm_flipselector"))
+     {
+        accessible = g_object_new(EAIL_TYPE_FLIPSELECTOR, NULL);
+     }
+   else if (!strcmp(type, "elm_layout"))
+     {
+        accessible = g_object_new(EAIL_TYPE_LAYOUT, NULL);
+     }
+   else if (!strcmp(type, "elm_table"))
+     {
+        accessible = g_object_new(EAIL_TYPE_TABLE, NULL);
+     }
+   else if (!strcmp(type, "elm_prefs"))
+     {
+        accessible = g_object_new(EAIL_TYPE_PREFS, NULL);
+     }
+   else
+     {
+        DBG("Unrecognized specific widget type: %s", type);
+        DBG("Creating basic widget with NULL type.");
+        accessible = g_object_new(EAIL_TYPE_WIDGET, NULL);
+     }
+
+   if (accessible)
+     {
+        atk_object_initialize(accessible, widget);
+     }
+
+   return accessible;
+}
+
+
+/**
+ * @brief Creates new EailItem instance with given ATK role
+ *
+ * @param item an Elm_Object_Item
+ * @param parent AtkObject that holds EailItem instance
+ * @param role AtkRole that will be used by EailItem
+ *
+ * @returns new EailItem instance or NULL in case of error
+ */
+static AtkObject *
+_eail_factory_create_item_atk_obj(Elm_Object_Item *item,
+                                  AtkRole role,
+                                  AtkObject *parent)
+{
+   AtkObject *obj;
+
+   obj = g_object_new(EAIL_TYPE_ITEM, NULL);
+   obj->role = role;
+   atk_object_set_parent(obj, parent);
+   atk_object_initialize(obj, item);
+
+   return obj;
+}
+
+/**
+ * @param atk_obj an AtkObject
+ * @param item an Elm_Object_Item item
+ */
+void
+eail_factory_append_item_to_cache(AtkObject *atk_obj, Elm_Object_Item *item)
+{
+   EailFactoryObj *factory_obj = g_new0(EailFactoryObj, 1);
+   factory_obj->atk_obj = atk_obj;
+   factory_obj->obj_item = item;
+
+   eail_cached_objs = eina_list_append(eail_cached_objs, factory_obj);
+}
+
+/**
+ * @param item an Elm_Object_Item* to be found
+ * @returns an EailFactoryObj * object or NULL if item representation was not
+ * found
+ */
+EailFactoryObj *
+eail_factory_find_obj_for_item(const Elm_Object_Item *item)
+{
+   const Eina_List *l = NULL;
+   EailFactoryObj *factory_obj = NULL;
+
+   EINA_LIST_FOREACH(eail_cached_objs, l, factory_obj)
+     {
+        if (item == factory_obj->obj_item)
+          {
+             return factory_obj;
+          }
+     }
+
+   /* no Atk Elm_Object_Item implementation in cache was found */
+   return NULL;
+}
+
+/**
+ *
+ * If AtkObject was already created for given item, instance will be returned
+ * from cache instead of creating new one (it is needed to allow setting and
+ * storing name/description changes by multiple clients).
+ *
+ * @param item an Elm_Object_Item that will be used as source for AtkObject
+ * representation
+ * @param role an AtkRole role for given item
+ * @param parent object that has given item inside its content (eg. for
+ * list-item this will be EailList instance)
+ *
+ * @returns AtkObject * representation or NULL in case of failure
+ */
+AtkObject *
+eail_factory_get_item_atk_obj(Elm_Object_Item *item,
+                              AtkRole role,
+                              AtkObject *parent)
+{
+   AtkObject *atk_obj;
+   EailFactoryObj *factory_obj = NULL;
+
+   if (!EAIL_IS_ITEM_PARENT(parent))
+    {
+       ERR("Parent does not implement ITEM_PARENT interface");
+       return NULL;
+    }
+
+   /* first trying to get object from cache*/
+   factory_obj = eail_factory_find_obj_for_item(item);
+   if (factory_obj)
+      {
+         /* already found implementation, not need to create new obj, returning
+          * existing one from cache */
+          if (!factory_obj->atk_obj)
+            {
+               ERR("No atk obj found in eail_factory_widget!");
+               return NULL;
+            }
+
+         return factory_obj->atk_obj;
+      }
+
+   /* if not in cache then creating and then adding to cache for future use*/
+   atk_obj = _eail_factory_create_item_atk_obj(item, role, parent);
+   eail_factory_append_item_to_cache(atk_obj, item);
+
+   return atk_obj;
+}
+
+/**
+ *
+ * @param item an Elm_Object_Item* item to be deregistered
+ */
+void
+eail_factory_unregister_item_from_cache(Elm_Object_Item *item)
+{
+   EailFactoryObj *factory_obj = NULL;
+
+   factory_obj = eail_factory_find_obj_for_item(item);
+   if (!factory_obj) return;
+
+   eail_cached_objs = eina_list_remove(eail_cached_objs, factory_obj);
+
+   g_free(factory_obj);
+}
+
+/**
+ *
+ * @param widget an Evas_Object* widget to be deregistered
+ */
+void
+eail_factory_unregister_wdgt_from_cache(Evas_Object *widget)
+{
+   EailFactoryObj *factory_obj = NULL;
+
+   factory_obj = _eail_factory_find_obj_for_widget(widget);
+   if (!factory_obj) return;
+
+   eail_cached_objs = eina_list_remove(eail_cached_objs, factory_obj);
+
+   g_free(factory_obj);
+}
+
+/**
+ * @param widget an Evas_Object*
+ *
+ * @returns reference to AtkObject* which is accessible representation of given
+ * Evas_Object. It should be unreferenced when no longer needed to free memory
+ */
+AtkObject *
+eail_factory_get_accessible(Evas_Object *widget)
+{
+   EailFactoryObj *factory_widget = NULL;
+   AtkObject *atk_obj = NULL;
+
+   if (!widget)
+     {
+        DBG("Cannot create accessible for NULL-widget");
+        return NULL;
+     }
+
+   if (!elm_object_widget_check(widget))
+     {
+        DBG("%s is NOT elementary object widget!",
+            evas_object_type_get(widget));
+        return NULL;
+     }
+
+   /* looking for object in cache*/
+   factory_widget = _eail_factory_find_obj_for_widget(widget);
+   if (factory_widget)
+     {
+        /* already found implementation, not need to create new obj, returning
+         * existing one from cache */
+         if (!factory_widget->atk_obj)
+           {
+              ERR("No atk obj found in eail_factory_widget!");
+              return NULL;
+           }
+
+         return factory_widget->atk_obj;
+     }
+
+   /* not found in cache, need to create new instance for atk obj
+    * representation*/
+   atk_obj = _eail_factory_create_accessible(widget);
+   if (!atk_obj)
+     {
+        ERR("No atk obj created in factory");
+        return NULL;
+     }
+
+   /* appending obj for future re-using*/
+   _eail_factory_append_wdgt_to_cache(atk_obj, widget);
+
+   return atk_obj;
+}
+
+/**
+ * @param role an AtkRole for objects that have to be found
+ *
+ * @returns an Eina_List filled with AtkObject * objects
+ */
+Eina_List *
+eail_factory_find_objects_with_role(AtkRole role)
+{
+   const Eina_List *l = NULL;
+   Eina_List *results_list = NULL;
+   EailFactoryObj *factory_obj = NULL;
+
+   EINA_LIST_FOREACH(eail_cached_objs, l, factory_obj)
+     {
+        AtkObject *atk_obj = factory_obj->atk_obj;
+        if (atk_obj && role == atk_obj->role)
+          results_list = eina_list_append(results_list, atk_obj);
+     }
+
+   return results_list;
+}
diff --git a/eail/eail/eail_factory.h b/eail/eail/eail_factory.h
new file mode 100644 (file)
index 0000000..1b6a3ea
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_factory.h
+ *
+ * @brief Header for EailFactory implementation
+ */
+
+#ifndef EAIL_FACTORY_H
+#define EAIL_FACTORY_H
+
+#include <atk/atk.h>
+
+#include <Evas.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for EailFactory cache entry*/
+typedef struct _EailFactoryObj EailFactoryObj;
+
+/** @brief Definition of object structure for EailFactory cache entry*/
+struct _EailFactoryObj
+{
+   AtkObject *atk_obj;/**< @brief AtkObject representation*/
+   Evas_Object *evas_obj;/**< @brief Evas_Object that needs atk representation*/
+   Elm_Object_Item *obj_item;/**< @brief Elm_Object_Item that needs atk representation*/
+};
+
+AtkObject * eail_factory_get_accessible    (Evas_Object *widget);
+AtkObject * eail_factory_get_item_atk_obj  (Elm_Object_Item *item,
+                                            AtkRole role,
+                                            AtkObject *parent);
+void eail_factory_append_item_to_cache     (AtkObject *atk_obj,
+                                            Elm_Object_Item *item);
+EailFactoryObj *eail_factory_find_obj_for_item (const Elm_Object_Item *item);
+void eail_factory_unregister_wdgt_from_cache(Evas_Object *widget);
+void eail_factory_unregister_item_from_cache(Elm_Object_Item *item);
+Eina_List * eail_factory_find_objects_with_role(AtkRole role);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_fileselector.c b/eail/eail/eail_fileselector.c
new file mode 100644 (file)
index 0000000..5f60907
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_fileselector.c
+ * @brief Fileselector implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_fileselector.h"
+#include "eail_item.h"
+#include "eail_item_parent.h"
+#include "eail_priv.h"
+
+/**
+ * @brief Definition of EailFileselector as GObject
+ *
+ * EailFileselector is extended EAIL_TYPE_LAYOUT
+ */
+G_DEFINE_TYPE(EailFileselector, eail_fileselector, EAIL_TYPE_LAYOUT);
+
+/**
+ * @brief Initializer for Fileselector AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_fileselector_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_fileselector_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_FILE_CHOOSER;
+}
+
+/**
+ * @brief Gets obj accessible name
+ *
+ * @param obj an AtkObject
+ *
+ * @returns obj name
+ */
+static const gchar*
+eail_fileselector_get_name(AtkObject *obj)
+{
+   Evas_Object *widget;
+   const char *atk_name;
+
+   g_return_val_if_fail(EAIL_IS_FILESELECTOR(obj), NULL);
+
+   atk_name = ATK_OBJECT_CLASS(eail_fileselector_parent_class)->get_name(obj);
+   if (atk_name)
+     return atk_name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   return elm_object_text_get(widget);
+}
+
+/**
+ * @brief EailFileselector GObject instance initializer
+ *
+ * @param fileselector an EailFileselector
+ */
+static void
+eail_fileselector_init(EailFileselector *fileselector)
+{
+}
+
+/**
+ * @brief Destructor for EailFileselector
+ *
+ * @param object GObject object to be finalized
+ */
+static void
+eail_fileselector_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_fileselector_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for EailFileselector GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailFileselectorClass
+ */
+static void
+eail_fileselector_class_init(EailFileselectorClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_fileselector_initialize;
+   class->get_name = eail_fileselector_get_name;
+   gobject_class->finalize = eail_fileselector_finalize;
+}
diff --git a/eail/eail/eail_fileselector.h b/eail/eail/eail_fileselector.h
new file mode 100644 (file)
index 0000000..dadee47
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_fileselector.h
+ *
+ * @brief Header for EailFileselector implementation
+ */
+
+#ifndef EAIL_FILESELECTOR_H
+#define EAIL_FILESELECTOR_H
+
+#include "eail_layout.h"
+/**
+ * @brief Returns a value corresponding to the type of EailFileselector class
+ */
+#define EAIL_TYPE_FILESELECTOR            (eail_fileselector_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailFileselector
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_FILESELECTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                           EAIL_TYPE_FILESELECTOR, EailFileselector))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailFileselector class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_FILESELECTOR_CLASS(klass)    (G_TYPE_FILESELECTOR_CLASS_CAST((klass), \
+                                           EAIL_TYPE_FILESELECTOR, EailFileselectorClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailFileselector class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_FILESELECTOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                           EAIL_TYPE_FILESELECTOR))
+/**
+ * @brief Tests whether given klass is a subclass of EailFileselector
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_FILESELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                           EAIL_TYPE_FILESELECTOR))
+/**
+ * @brief Gets EailFileselector class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailFileselector class from
+ */
+#define EAIL_FILESELECTOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                           EAIL_TYPE_FILESELECTOR, EailFileselectorClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailFileselector*/
+typedef struct _EailFileselector      EailFileselector;
+/** @brief Definition of class structure for Atk EailFileselector*/
+typedef struct _EailFileselectorClass EailFileselectorClass;
+
+/** @brief Definition of object structure for Atk EailFileselector*/
+struct _EailFileselector
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailLayout parent;
+};
+
+/** @brief Definition of class structure for Atk EailFileselector*/
+struct _EailFileselectorClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailLayoutClass parent_class;
+};
+
+/** @brief Getter for EailFileselector GType
+ * @returns GType for EailFileselector implementation*/
+GType eail_fileselector_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_fileselector_entry.c b/eail/eail/eail_fileselector_entry.c
new file mode 100644 (file)
index 0000000..2d19fcb
--- /dev/null
@@ -0,0 +1,492 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_fileselector_entry.c
+ * @brief Implementation of fileselector entry widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_fileselector_entry.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void atk_text_interface_init(AtkTextIface *iface);
+static void eail_fileselector_entry_actions_init(EailActionWidget *widget);
+
+#define ICON_CONTENT_NAME "button icon" /**< @brief content name for icon */
+#define EAIL_FSE_ACTION_CLICK "click"/**< @brief 'click' action name */
+#define EAIL_FSE_ACTION_LONGPRESS "longpress" /**< @brief 'longpress' action name */
+#define EAIL_FSE_ACTION_PRESS "press" /**< @brief 'press' action name */
+#define EAIL_FSE_ACTION_RELEASE "release" /**< @brief 'release' action name */
+
+/**
+ * @brief Definition of EailFileselectorEntry as GObject
+ *
+ * EailFileselectorEntry is extended EAIL_TYPE_ACTION_WIDGET with ATK_TYPE_TEXT
+ * interface implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailFileselectorEntry,
+                        eail_fileselector_entry,
+                        EAIL_TYPE_ACTION_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init));
+
+/**
+ * @brief Initializer for AtkObject
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_fileselector_entry_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_fileselector_entry_parent_class) ->initialize(obj, data);
+   obj->role = ATK_ROLE_GROUPING;
+
+   EailActionWidget *action_widget = EAIL_ACTION_WIDGET(obj);
+
+   /* Initializing possible widget actions table*/
+   eail_fileselector_entry_actions_init(action_widget);
+}
+
+/**
+ * @brief Initializer for EailEntry GObject implementation
+ *
+ * @param fileselector_entry an EailFileselectorEntry
+ */
+static void
+eail_fileselector_entry_init(EailFileselectorEntry *fileselector_entry)
+{
+}
+
+/**
+ * @brief Gets name of FileselectorEntry
+ *
+ * Implementation of AtkObject->get_name callback<br>
+ * Name is label-text on button
+ *
+ * ATK doc says:
+ * Gets the accessible name of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns a character string representing the accessible description of
+ * the accessible.
+ */
+static const gchar *
+eail_fileselector_entry_get_name(AtkObject *obj)
+{
+   Evas_Object *fse_widget = NULL;
+   const gchar *atk_name = NULL;
+
+   /* returning name from ATK default implementation if available */
+   atk_name = ATK_OBJECT_CLASS(eail_fileselector_entry_parent_class)->get_name(obj);
+   if (atk_name)
+     return atk_name;
+
+   fse_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!fse_widget) return NULL;
+
+   return elm_object_part_text_get(fse_widget, "default");
+}
+
+/**
+ * @brief Gets nested button from widget (file selector button)
+ *
+ * @param obj an AtkObject (EailFileselectorEntry)
+ * @returns Evas_Object for file selector button or NULL if not found
+ */
+static Evas_Object *
+_eail_fileselector_entry_get_nested_button(AtkObject *obj)
+{
+   Evas_Object *button_widget = NULL, *fse_widget = NULL;
+
+   fse_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!fse_widget) return NULL;
+
+   button_widget = elm_object_part_content_get(fse_widget, "elm.swallow.button");
+   if (!button_widget)
+     DBG("Button widget NOT found!");
+
+   return button_widget;
+}
+
+/**
+ * @brief Helper func for returning list of nested widgets in fileselector entry
+ *
+ * @param obj an AtkObject
+ *
+ * @return list of Evas_Object* objects with nested widgets
+ */
+static Eina_List *
+_eail_fileselector_entry_get_items(AtkObject *obj)
+{
+   Eina_List *items = NULL;
+   Evas_Object *icon_widget = NULL, *fse_widget = NULL;
+
+   fse_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!fse_widget) return NULL;
+
+   icon_widget = elm_object_part_content_get(fse_widget, ICON_CONTENT_NAME);
+   if (!icon_widget) return NULL;
+
+   items = eina_list_append(items, icon_widget);
+
+   return items;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_fileselector_entry_get_n_children(AtkObject *obj)
+{
+   gint n_items;
+   Eina_List *items;
+
+   items = _eail_fileselector_entry_get_items(obj);
+   n_items = eina_list_count(items);
+
+   eina_list_free(items);
+
+   return n_items;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i index of a child
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_fileselector_entry_ref_child(AtkObject *obj, gint i)
+{
+   Eina_List *items = NULL;
+   AtkObject *child = NULL;
+
+   items = _eail_fileselector_entry_get_items(obj);
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_accessible(eina_list_nth(items, i));
+        if (child)  g_object_ref(child);
+     }
+
+   eina_list_free(items);
+
+   return child;
+}
+
+/**
+ * @brief Destructor for FileselectorEntry class
+ *
+ * @param object GObject object to be finalized
+ */
+static void
+eail_fileselector_entry_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_fileselector_entry_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for EailFileselectorEntry GObject class (defines
+ * callbacks for base AtkObject)
+ *
+ * @param klass an EailFileselectorEntryClass
+ */
+static void
+eail_fileselector_entry_class_init(EailFileselectorEntryClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_fileselector_entry_initialize;
+   class->get_name = eail_fileselector_entry_get_name;
+   class->get_n_children = eail_fileselector_entry_get_n_children;
+   class->ref_child = eail_fileselector_entry_ref_child;
+   gobject_class->finalize = eail_fileselector_entry_finalize;
+}
+
+/*
+ * Implementation of the *AtkText* interface
+ */
+
+/**
+ * @brief Gets text content from item
+ *
+ * Implementation of AtkTextIface->get_text callback\n
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, or -1 for the end of the string.
+ *
+ * @returns a newly allocated string containing the text from start_offset
+ * up to, but not including end_offset. Use g_free() to free the returned
+ * string.
+ */
+static gchar*
+eail_fileselector_entry_get_text(AtkText  *text,
+                                 gint      start_offset,
+                                 gint      end_offset)
+{
+   gchar *ret_str = NULL;
+   Evas_Object *fse_widget = NULL;
+
+   fse_widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!fse_widget) return NULL;
+
+   ret_str = eail_get_substring
+                (elm_fileselector_entry_path_get(fse_widget),
+                 start_offset, end_offset);
+
+   return ret_str;
+}
+
+/**
+ * @brief Gets character from popup at given offset
+ *
+ * Implementation of AtkTextIface->get_character_at_offset callback
+ *
+ * @param text an AtkText
+ * @param offset an offset
+ *
+ * @returns the character at offset.
+ */
+static gunichar
+eail_fileselector_entry_get_character_at_offset(AtkText *text,
+                                                gint     offset)
+{
+   gunichar character = '\0';
+   gchar *entry_str = NULL;
+
+   entry_str = eail_fileselector_entry_get_text(text, 0, -1);
+   if (entry_str)
+      {
+         character = g_utf8_get_char
+                           (g_utf8_offset_to_pointer(entry_str, offset));
+         g_free(entry_str);
+      }
+
+   return character;
+}
+
+/**
+ * @brief Gets character count from text content in item
+ * Implementation of AtkTextIface->get_character_count callback
+ *
+ * @param text an AtkText
+ *
+ * @returns the character count
+ */
+static gint
+eail_fileselector_entry_get_character_count(AtkText *text)
+{
+   gint count = 0;
+   gchar *entry_str = NULL;
+   entry_str = eail_fileselector_entry_get_text(text, 0, -1);
+
+    if (entry_str)
+      {
+         count = g_utf8_strlen(entry_str, -1);
+         g_free(entry_str);
+      }
+
+    return count;
+}
+
+/**
+ * @brief Initializer for AtkTextIface interface
+ *
+ * @param iface an AtkTextIface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+    iface->get_text = eail_fileselector_entry_get_text;
+    iface->get_character_at_offset = eail_fileselector_entry_get_character_at_offset;
+    iface->get_character_count = eail_fileselector_entry_get_character_count;
+}
+
+/*
+ * Implementation of the Actions
+ */
+
+/**
+ * @brief Calls callback with given name
+ *
+ * @param action an AtkAction
+ * @param action_name action name to be called
+ *
+ * @returns TRUE if was successful, FALSE otherwise
+ */
+static gboolean
+eail_fileselector_entry_do_action(AtkAction *action,
+                                  const char *action_name)
+{
+   Evas_Object *button = NULL;
+
+   button = _eail_fileselector_entry_get_nested_button(ATK_OBJECT(action));
+   if (!button) return FALSE;
+
+   if (action_name == NULL) return FALSE;
+   /*emit signal*/
+   evas_object_smart_callback_call(button, action_name, NULL);
+   return TRUE;
+}
+
+/**
+ * @brief Handle for action click
+ *
+ * @param action an AtkAction
+ * @param data additional action data (not used here)
+ *
+ * @return TRUE if action was triggered successfully, FALSE otherwise
+ */
+static gboolean
+eail_action_click(AtkAction *action, void *data)
+{
+   return eail_fileselector_entry_do_action(action, "clicked");
+}
+
+/**
+ * @brief Calls action for with given name for actions based on x-y coordinates
+ *
+ * @param action an AtkAction
+ * @param name action name to be called
+ *
+ * @returns TRUE if was successful, FALSE otherwise
+ */
+static gboolean
+_eail_action_handle_coords_action(AtkAction *action, gchar *name)
+{
+   Evas_Object *button = NULL;
+   int x, y;
+
+   if (name == NULL) return FALSE;
+
+   button = _eail_fileselector_entry_get_nested_button(ATK_OBJECT(action));
+   if (!button) return FALSE;
+
+   /* getting coordinates of center of the widget to make sure, that
+    * click will be performed on active widget area */
+   eail_get_coords_widget_center(button, &x, &y);
+
+   if (0 == g_strcmp0(name, EAIL_FSE_ACTION_PRESS))
+        {
+          DBG("Calling 'press' on button");
+          eail_mouse_press_on_coords(button, x, y);
+        }
+   else if (0 == g_strcmp0(name, EAIL_FSE_ACTION_RELEASE))
+      {
+         DBG("Calling 'release' on button");
+         eail_mouse_release_on_coords(button, x, y);
+      }
+   else
+      {
+         DBG("No action by given name %s", name);
+         return FALSE;
+      }
+
+   return TRUE;
+}
+/**
+ * @brief Handle for action longpress
+ *
+ * @param action an AtkAction
+ * @param data additional action data (not used here)
+ *
+ * @return TRUE if action was triggered successfully, FALSE otherwise
+ */
+static gboolean
+eail_action_longpress(AtkAction *action, void *data)
+{
+   return eail_fileselector_entry_do_action(action, "longpressed");
+}
+
+/**
+ * @brief Handle for action press
+ *
+ * @param action an AtkAction
+ * @param data additional action data (not used here)
+ *
+ * @return TRUE if action was triggered successfully, FALSE otherwise
+ */
+static gboolean
+eail_action_press(AtkAction *action, void *data)
+{
+   /* this is being done to action press/release raise properly click event.
+    * Without that for standard behavior of fileselector entry, nothing will
+    * happen (that why not launching event but emulating mouse press)*/
+   return _eail_action_handle_coords_action(action, EAIL_FSE_ACTION_PRESS);
+}
+
+/**
+ * @brief Handle for action release
+ *
+ * @param action an AtkAction
+ * @param data additional action data (not used here)
+ *
+ * @return TRUE if action was triggered successfully, FALSE otherwise
+ */
+static gboolean
+eail_action_release(AtkAction *action, void *data)
+{
+   /* this is being done to action press/release raise properly click event.
+    * Without that for standard behavior of fileselector entry, nothing will
+    * happen (that why not launching event but emulating mouse release)*/
+   return _eail_action_handle_coords_action(action, EAIL_FSE_ACTION_RELEASE);
+}
+
+/**
+ * @brief Adds fileselector actions to actions table
+ *
+ * @param action_widget widget that implements EailActionWidget interface
+ */
+static void
+eail_fileselector_entry_actions_init(EailActionWidget *action_widget)
+{
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_FSE_ACTION_CLICK, NULL,
+                                    eail_action_click);
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_FSE_ACTION_LONGPRESS, NULL,
+                                    eail_action_longpress);
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_FSE_ACTION_PRESS, NULL,
+                                    eail_action_press);
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_FSE_ACTION_RELEASE, NULL,
+                                    eail_action_release);
+}
diff --git a/eail/eail/eail_fileselector_entry.h b/eail/eail/eail_fileselector_entry.h
new file mode 100644 (file)
index 0000000..555bf16
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_fileselector_entry.h
+ *
+ * @brief Header for EailEntry implementation
+ */
+
+#ifndef EAIL_FILESELECTOR_ENTRY_H
+#define EAIL_FILESELECTOR_ENTRY_H
+
+#include "eail_action_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailFileselectorentry class
+ */
+#define EAIL_TYPE_FILESELECTOR_ENTRY             (eail_fileselector_entry_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailFileselectorentry
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_FILESELECTOR_ENTRY(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                                  EAIL_TYPE_FILESELECTOR_ENTRY, EailFileselectorEntry))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailFileselectorentry class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_FILESELECTOR_ENTRY_CLASS(klass)     (G_TYPE_FILESELECTOR_ENTRY_CLASS_CAST((klass), \
+                                                  EAIL_TYPE_FILESELECTOR_ENTRY, EailFileselectorEntryClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailFileselectorentry class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_FILESELECTOR_ENTRY(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                                  EAIL_TYPE_FILESELECTOR_ENTRY))
+/**
+ * @brief Tests whether given klass is a subclass of EailFileselectorentry
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_FILESELECTOR_ENTRY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                                  EAIL_TYPE_FILESELECTOR_ENTRY))
+/**
+ * @brief Gets EailFileselectorentry class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailEntry class from
+ */
+#define EAIL_FILESELECTOR_ENTRY_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                                  EAIL_TYPE_FILESELECTOR_ENTRY, EailFileselectorEntryClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailEntry*/
+typedef struct _EailFileselectorEntry      EailFileselectorEntry;
+/** @brief Definition of class structure for Atk EailEntry*/
+typedef struct _EailFileselectorEntryClass EailFileselectorEntryClass;
+
+/** @brief Definition of object structure for Atk EailEntry*/
+struct _EailFileselectorEntry
+{
+   EailActionWidget parent;/**< @brief parent widget that is being extended */
+
+};
+
+/** @brief Definition of object structure for Atk EailEntry*/
+struct _EailFileselectorEntryClass
+{
+   EailActionWidgetClass parent_class;/**< @brief parent class that is being extended*/
+};
+
+/**
+ * \brief Getter for fileselector GType
+ * @returns GType for EailFileselector implementation
+ */
+GType eail_fileselector_entry_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_flip.c b/eail/eail/eail_flip.c
new file mode 100644 (file)
index 0000000..8c79d31
--- /dev/null
@@ -0,0 +1,317 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_flip.c
+ *
+ * @brief EailFlip implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_flip.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/**
+ * @brief Define EailFlip GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailFlip,
+                        eail_flip,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/**
+ * @brief handler for event which is raised when flips visible data is changed
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_flip_handle_changed_event(void *data,
+                                Evas_Object *obj,
+                                void *event_info)
+{
+   eail_emit_atk_signal
+                  (ATK_OBJECT(data), "visible-data-changed", ATK_TYPE_OBJECT);
+}
+
+/**
+ * @brief EailFlip object initialization
+ *
+ * @param obj EailFlip object
+ * @param data user set additional initialization data
+ */
+static void
+eail_flip_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_flip_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_PAGE_TAB_LIST;
+
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "animate,done",
+                                  _eail_flip_handle_changed_event, obj);
+}
+
+/**
+ * @brief Class destructor
+ *
+ * @param object object instance
+ */
+static void
+eail_flip_finalize(GObject *object)
+{
+   EailFlip *flip = EAIL_FLIP(object);
+
+   if (flip->flip_description) free(flip->flip_description);
+
+   G_OBJECT_CLASS(eail_flip_parent_class)->finalize(object);
+}
+
+/**
+ * @brief EailFlip instance initialization
+ *
+ * @param flip EailFlip instance
+ */
+static void
+eail_flip_init(EailFlip *flip)
+{
+   flip->flip_description = NULL;
+}
+
+/**
+ * @brief Gets widget children
+ *
+ * @param widget EailWidget object
+ *
+ * @return list of children, NULL if no children
+ */
+static Eina_List *
+eail_flip_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *child, *obj;
+
+   obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+
+   if (obj)
+     {
+        if (EINA_TRUE == elm_flip_front_visible_get(obj))
+          child = elm_object_part_content_get(obj, "front");
+        else
+          child = elm_object_part_content_get(obj, "back");
+
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+     }
+
+   return list;
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailFlip class
+ */
+static void
+eail_flip_class_init(EailFlipClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_flip_initialize;
+   widget_class->get_widget_children = eail_flip_get_widget_children;
+   gobject_class->finalize = eail_flip_finalize;
+}
+
+/*
+ * Implementation of the *AtkAction* interface
+ */
+
+/**
+ * @brief Implementation of get_n_actions from AtkAction interface
+ *
+ * @param action EailFlip instance
+ * @returns number of implemented actions
+ */
+static int
+eail_flip_n_actions_get(AtkAction *action)
+{
+   return 1;
+}
+
+/**
+ * @brief Implementation of get_description from AtkAction interface
+ *
+ * @param action EailFlip instance
+ * @param i action index
+ *
+ * @return action description
+ */
+static const char*
+eail_flip_description_get(AtkAction *action,
+                          gint i)
+{
+   EailFlip *flip;
+   const char *action_description;
+
+   flip = EAIL_FLIP(action);
+   if (!flip) return NULL;
+
+   switch (i)
+     {
+      case 0:
+         action_description = flip->flip_description;
+         break;
+      default:
+         action_description = NULL;
+         break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Implementation of set_descritpion from AtkAction interface
+ *
+ * @param action EailFlip instance
+ * @param i action index
+ * @param description action description
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_flip_description_set(AtkAction *action,
+                          gint i,
+                          const char *description)
+{
+   EailFlip *flip;
+   char **value;
+
+   flip = EAIL_FLIP(action);
+   if (!flip) return FALSE;
+
+   switch (i)
+     {
+      case 0:
+         value = &flip->flip_description;
+         break;
+      default:
+         value = NULL;
+         break;
+     }
+
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(description);
+        return TRUE;
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief Implementation of get_name from AtkAction interface
+ *
+ * @param action EailFlip instance
+ * @param i action index
+ *
+ * @return action name
+ */
+static const char*
+eail_flip_action_name_get(AtkAction *action,
+                         int i)
+{
+   const char* action_name;
+
+   switch (i)
+     {
+      case 0:
+         action_name = "flip";
+         break;
+      default:
+         action_name = NULL;
+         break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Implementation of do_action from AtkAction interface
+ *
+ * @param action EailFlip instance
+ * @param i action index
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_flip_do_action(AtkAction *action,
+                    int i)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   const char *action_name = atk_action_get_name(action, i);
+   if (!action_name) return FALSE;
+
+   if (EINA_TRUE == elm_flip_front_visible_get(widget))
+     elm_flip_go_to(widget, EINA_FALSE, ELM_FLIP_CUBE_DOWN);  // turn down
+   else
+     elm_flip_go_to(widget, EINA_TRUE, ELM_FLIP_CUBE_UP);     // turn up
+
+   return TRUE;
+}
+
+/**
+ * @brief AtkAction interface initializer
+ *
+ * @param iface an AtkActionIface
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_n_actions   = eail_flip_n_actions_get;
+   iface->get_description = eail_flip_description_get;
+   iface->set_description = eail_flip_description_set;
+   iface->get_name        = eail_flip_action_name_get;
+   iface->do_action       = eail_flip_do_action;
+}
diff --git a/eail/eail/eail_flip.h b/eail/eail/eail_flip.h
new file mode 100644 (file)
index 0000000..f7fd7b2
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_flip.h
+ *
+ * @brief Header for EailFlip implementation
+ */
+
+#ifndef EAIL_FLIP_H
+#define EAIL_FLIP_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailFlip class
+ */
+
+#define EAIL_TYPE_FLIP             (eail_flip_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailFlip
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_FLIP(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                    EAIL_TYPE_FLIP, EailFlip))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailFlip class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_FLIP_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                    EAIL_TYPE_FLIP, EailFlipClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailFlip class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_FLIP(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                    EAIL_TYPE_FLIP))
+/**
+ * @brief Tests whether given klass is a subclass of EailFlip
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_FLIP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                    EAIL_TYPE_FLIP))
+/**
+ * @brief Gets EailFlip class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailFlip class from
+ */
+#define EAIL_FLIP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                    EAIL_TYPE_FLIP, EailFlipClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailFlip*/
+typedef struct _EailFlip      EailFlip;
+/** @brief Definition of class structure for Atk EailFlip*/
+typedef struct _EailFlipClass EailFlipClass;
+
+/** @brief Definition of object structure for Atk EailFlip*/
+struct _EailFlip
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+
+   char *flip_description; /*!< @brief 'flip' action description*/
+};
+
+/** @brief Definition of class structure for Atk EailFlip*/
+struct _EailFlipClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailFlip GType
+ * @returns GType for EailFlip implementation*/
+GType eail_flip_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_flipselector.c b/eail/eail/eail_flipselector.c
new file mode 100644 (file)
index 0000000..470c61a
--- /dev/null
@@ -0,0 +1,586 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_flipselector.c
+ * @brief EailFlipselector implementation.
+ */
+
+#include <Elementary.h>
+
+#include "eail_flipselector.h"
+#include "eail_factory.h"
+#include "eail_item_parent.h"
+#include "eail_priv.h"
+
+/**
+ * @brief Number of max selections
+ */
+#define FLIPSELECTOR_MAX_SELECTIONS 1
+
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+static void atk_action_interface_init(AtkActionIface *iface);
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+
+/**
+ * @brief EailFlipselector type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailFlipselector,
+                        eail_flipselector,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                              atk_selection_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/**
+ * @brief Function executed on selected event
+ *
+ * @param data user data passed to callback
+ * @param obj source object
+ * @param event_info event info
+ */
+static void
+_on_selected(void *data,
+             Evas_Object *obj,
+             void *event_info)
+{
+    EailFlipselector *flip = EAIL_FLIPSELECTOR(data);
+    atk_object_notify_state_change(ATK_OBJECT(flip), ATK_STATE_SELECTED, TRUE);
+}
+
+/**
+ * @brief EailFlipselector initializer.
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_flipselector_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *widget;
+
+   ATK_OBJECT_CLASS(eail_flipselector_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_LIST;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+   evas_object_smart_callback_add(widget, "selected", _on_selected, obj);
+   evas_object_smart_callback_add(widget, "selected", _on_selected, obj);
+}
+
+/**
+ * @brief EailFlipselector finalizer.
+ * Frees memory assigned to object.
+ *
+ * @param object GObject instance
+ */
+static void
+eail_flipselector_finalize(GObject *object)
+{
+   EailFlipselector *flipselector = EAIL_FLIPSELECTOR(object);
+
+   if (flipselector->next_description) free(flipselector->next_description);
+   if (flipselector->prev_description) free(flipselector->prev_description);
+
+   G_OBJECT_CLASS(eail_flipselector_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Gets obj items list.
+ *
+ * @param obj an EailFlipselector
+ * @return list with obj items
+ */
+static const Eina_List *
+eail_flipselector_items_get(EailFlipselector *obj)
+{
+   Evas_Object *widget;
+   const Eina_List *items = NULL;
+
+   g_return_val_if_fail(EAIL_FLIPSELECTOR(obj), NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   items = elm_flipselector_items_get(widget);
+   if (!items) return NULL;
+
+   return items;
+}
+
+/**
+ * @brief Gets reference to i-th child
+ *
+ * The caller must unreference it when it is no longer needed
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ * @return child reference
+ */
+static AtkObject *
+eail_flipselector_ref_child(AtkObject *obj,
+                            gint i)
+{
+   const Eina_List *items;
+   AtkObject *child = NULL;
+
+   g_return_val_if_fail(EAIL_IS_FLIPSELECTOR(obj), NULL);
+
+   items = eail_flipselector_items_get(EAIL_FLIPSELECTOR(obj));
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                           (eina_list_nth(items, i), ATK_ROLE_LABEL, obj);
+
+        g_object_ref(child);
+     }
+   else
+     ERR("Tried to ref child with index %d out of bounds!", i);
+
+   return child;
+}
+
+/**
+ * @brief Gets number of obj children
+ *
+ * @param obj an AtkObject
+ * @return obj children number
+ */
+static gint
+eail_flipselector_get_n_children(AtkObject *obj)
+{
+   const Eina_List *list;
+
+   g_return_val_if_fail(EAIL_IS_FLIPSELECTOR(obj), 0);
+
+   list = eail_flipselector_items_get(EAIL_FLIPSELECTOR(obj));
+
+   return eina_list_count(list);
+}
+
+/**
+ * @brief EailFlipselector interface initializer.
+ *
+ * @param flipselector EailFlipselector instance
+ */
+static void
+eail_flipselector_init(EailFlipselector *flipselector)
+{
+   flipselector->next_description = NULL;
+   flipselector->prev_description = NULL;
+}
+
+
+
+/**
+ * @brief Get name of flipselector child
+ *
+ * @param parent instance
+ * @param item child instance
+ *
+ * @returns const gchar * representing name of the child
+ */
+static const gchar *
+eail_flipselector_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief Implementation of EailItemParent->is_content_get_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItemParent
+ * @returns FALSE as there is no content support
+ */
+gboolean
+eail_flipselector_content_get_support(EailItemParent   *parent,
+                                          EailItem         *item)
+{
+   return FALSE;
+}
+
+/**
+ * @brief EailItemParent interface initializer
+ *
+ * @param iface an EailItemParentIface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_item_name = eail_flipselector_item_name_get;
+   iface->is_content_get_supported = eail_flipselector_content_get_support;
+}
+
+/**
+ * @brief EailFlipselector class initializer
+ *
+ * @param klass EailFlipselector class
+ */
+static void
+eail_flipselector_class_init(EailFlipselectorClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_flipselector_initialize;
+   class->get_n_children = eail_flipselector_get_n_children;
+   class->ref_child = eail_flipselector_ref_child;
+   gobject_class->finalize = eail_flipselector_finalize;
+}
+
+/**
+ * @brief Selects i-th item.
+ *
+ * @param selection an AtkSelection
+ * @param i item index
+ * @return TRUE if item is selected, FALSE otherwise
+ */
+static gboolean
+eail_flipselector_add_selection(AtkSelection *selection,
+                                gint i)
+{
+   Elm_Object_Item *it;
+   const Eina_List *list;
+
+   g_return_val_if_fail(EAIL_IS_FLIPSELECTOR(selection), FALSE);
+
+   list = eail_flipselector_items_get(EAIL_FLIPSELECTOR(selection));
+
+   if (eina_list_count(list) > i)
+     {
+        it = eina_list_nth(list, i);
+        if (!it) return FALSE;
+
+        elm_flipselector_item_selected_set(it, EINA_TRUE);
+     }
+
+   return TRUE;
+}
+
+/**
+ * @brief Clears selections.
+ *
+ * @param selection an AtkSelection
+ * @return FALSE
+ */
+static gboolean
+eail_flipselector_clear_selection(AtkSelection *selection)
+{
+   return FALSE;
+}
+
+/**
+ * @brief Gets the number of currently selected children.
+ *
+ * @param selection AtkSelection
+ * @return number of selected children
+ */
+static gint
+eail_flipselector_get_selection_count(AtkSelection *selection)
+{
+   return FLIPSELECTOR_MAX_SELECTIONS;
+}
+
+/**
+ * @brief Determines if i-th child is selected.
+ *
+ * @param selection an AtkSelection
+ * @param i child index
+ * @return TRUE if child is selected, FALSE otherwise
+ */
+static gboolean
+eail_flipselector_is_child_selected(AtkSelection *selection,
+                                    gint i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *sel_it = NULL;
+   Elm_Object_Item *it = NULL;
+   const Eina_List *list;
+
+   g_return_val_if_fail(EAIL_IS_FLIPSELECTOR(selection), FALSE);
+
+   list = eail_flipselector_items_get(EAIL_FLIPSELECTOR(selection));
+
+   if (eina_list_count(list) > i)
+     {
+        widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+        if (!widget) return FALSE;
+
+        sel_it = elm_flipselector_selected_item_get(widget);
+        if (!sel_it) return FALSE;
+
+        it = eina_list_nth(list, i);
+     }
+
+   return sel_it == it;
+}
+
+/**
+ * @brief Removes i-th selection.
+ *
+ * @param selection an AtkSelection
+ * @param i selection index
+ * @return TRUE if selection is removed, FALSE otherwise
+ */
+static gboolean
+eail_flipselector_remove_selection(AtkSelection *selection,
+                                   gint i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *sel_it;
+   Elm_Object_Item *it;
+   const Eina_List *list;
+
+   g_return_val_if_fail(EAIL_IS_FLIPSELECTOR(selection), FALSE);
+
+   list = eail_flipselector_items_get(EAIL_FLIPSELECTOR(selection));
+
+   if (eina_list_count(list) > i)
+     {
+        widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+        if (!widget) return FALSE;
+
+        sel_it = elm_flipselector_selected_item_get(widget);
+        if (!sel_it) return FALSE;
+
+        it = eina_list_nth(list, i);
+        if (it == sel_it)
+          {
+             elm_flipselector_item_selected_set(sel_it, EINA_FALSE);
+
+             return TRUE;
+          }
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief Selects all children.
+ *
+ * @param selection an AtkSelection
+ * @returns FALSE
+ */
+static gboolean
+eail_flipselector_select_all_selection(AtkSelection *selection)
+{
+   return FALSE;
+}
+
+/**
+ * @brief AtkSelection interface initializer.
+ *
+ * @param iface an AtkSelectionIface
+ */
+static void atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   iface->add_selection        = eail_flipselector_add_selection;
+   iface->clear_selection      = eail_flipselector_clear_selection;
+   iface->get_selection_count  = eail_flipselector_get_selection_count;
+   iface->is_child_selected    = eail_flipselector_is_child_selected;
+   iface->remove_selection     = eail_flipselector_remove_selection;
+   iface->select_all_selection = eail_flipselector_select_all_selection;
+}
+
+/*
+ * Implementation of the *AtkAction* interface
+ */
+
+/**
+ * @brief Performs i-th action.
+ *
+ * @param action an AtkAction
+ * @param i action index
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_flipselector_action_do_action(AtkAction *action,
+                                   gint i)
+{
+   Evas_Object *widget;
+   const char *action_name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   action_name = atk_action_get_name(action, i);
+   if (!action_name) return FALSE;
+
+   if (!g_strcmp0("next", action_name))
+     elm_flipselector_flip_next(widget);
+   else if (!g_strcmp0("previous", action_name))
+     elm_flipselector_flip_prev(widget);
+   else
+     return FALSE;
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets number of actions available on the object.
+ *
+ * @param action an AtkAction
+ * @return number of implemented actions
+ */
+static gint
+eail_flipselector_action_get_n_actions(AtkAction *action)
+{
+   return 2;
+}
+
+/**
+ * @brief Gets description for action with given index
+ * @param action an AtkAction (EailFlipselector) object
+ * @param i index of action
+ *
+ * @returns string representing action name or NULL if not found
+ */
+static const gchar *
+eail_flipselector_action_get_description(AtkAction *action,
+                                         gint i)
+{
+   const char *action_description = NULL;
+   EailFlipselector *flipselector;
+
+   flipselector = EAIL_FLIPSELECTOR(action);
+   if (!flipselector) return NULL;
+
+   switch (i)
+     {
+       case 0:
+           action_description = flipselector->next_description;
+           break;
+
+       case 1:
+           action_description = flipselector->prev_description;
+           break;
+
+       default:
+           action_description = NULL;
+           break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Gets i-th action name.
+ *
+ * @param action an AtkAction
+ * @param i action index
+ * @return action description
+ */
+static const gchar *
+eail_flipselector_action_get_name(AtkAction *action,
+                                  gint i)
+{
+   const char* action_name = NULL;
+
+   switch (i)
+     {
+       case 0:
+           /* user selects next item */
+           action_name = "next";
+           break;
+
+       case 1:
+           /* user selects previous item */
+           action_name = "previous";
+           break;
+
+       default:
+           action_name = NULL;
+           break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Sets i-th action description.
+ *
+ * @param action an AtkAction
+ * @param i action number
+ * @param desc action description
+ * @return TRUE if description is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_flipselector_action_set_description(AtkAction *action,
+                                         gint i,
+                                         const gchar *desc)
+{
+   EailFlipselector *flipselector;
+   char **value;
+
+   flipselector = EAIL_FLIPSELECTOR(action);
+   if (!flipselector) return FALSE;
+
+   switch (i)
+     {
+       case 0:
+           value = &flipselector->next_description;
+           break;
+
+       case 1:
+           value = &flipselector->prev_description;
+           break;
+
+       default:
+           value = NULL;
+           break;
+     }
+
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(desc);
+
+        return TRUE;
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief AtkAction interface initializer.
+ *
+ * @param iface an AtkActionIface
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->do_action          = eail_flipselector_action_do_action;
+   iface->get_n_actions      = eail_flipselector_action_get_n_actions;
+   iface->get_description    = eail_flipselector_action_get_description;
+   iface->get_name           = eail_flipselector_action_get_name;
+   iface->set_description    = eail_flipselector_action_set_description;
+}
+
diff --git a/eail/eail/eail_flipselector.h b/eail/eail/eail_flipselector.h
new file mode 100644 (file)
index 0000000..722a959
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_flipselector.h
+ *
+ * @brief Header for EailFlipselector implementation
+ */
+
+#ifndef EAIL_FLIPSELECTOR_H
+#define EAIL_FLIPSELECTOR_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailFlipselector class
+ */
+#define EAIL_TYPE_FLIPSELECTOR              (eail_flipselector_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailFlipselector
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_FLIPSELECTOR(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                             EAIL_TYPE_FLIPSELECTOR, EailFlipselector))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailFlipselector class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_FLIPSELECTOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                             EAIL_TYPE_FLIPSELECTOR, EailFlipselectorClass));
+/**
+ * @brief Tests whether object (obj) is an instance of EailFlipselector class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_FLIPSELECTOR(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                             EAIL_TYPE_FLIPSELECTOR))
+/**
+ * @brief Tests whether given klass is a subclass of EailFlipselector
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_FLIPSELECTOR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                             EAIL_TYPE_FLIPSELECTOR))
+/**
+ * @brief Gets EailFlipselector class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailFlipselector class from
+ */
+#define EAIL_FLIPSELECTOR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                             EAIL_TYPE_FLIPSELECTOR, EailFlipselectorClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailFlipselector*/
+typedef struct _EailFlipselector      EailFlipselector;
+/** @brief Definition of class structure for Atk EailFlipselector*/
+typedef struct _EailFlipselectorClass EailFlipselectorClass;
+
+/** @brief Definition of object structure for Atk EailFlipselector*/
+struct _EailFlipselector
+{
+   EailWidget parent;/**< @brief widget that functionality is being extended*/
+
+   char *next_description;/**< @brief 'next' action description string */
+   char *prev_description;/**< @brief 'prev' action description string */
+};
+
+/** @brief Definition of class structure for Atk EailFlipselector*/
+struct _EailFlipselectorClass
+{
+   EailWidgetClass parent_class;/**< @brief class that is being extended*/
+};
+
+/**
+ * @brief Getter for EailFlipselector GType
+ * @returns GType for EailFlipselector implementation
+ */
+GType eail_flipselector_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_frame.c b/eail/eail/eail_frame.c
new file mode 100644 (file)
index 0000000..a9e1d32
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_frame.c
+ * @brief EailFrame implementation
+ */
+
+#include <Elementary.h>
+#include "eail_frame.h"
+
+/**
+ * @brief EailFrame type definition
+ */
+G_DEFINE_TYPE(EailFrame, eail_frame, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief EailFrame initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_frame_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_frame_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_FRAME;
+}
+
+/**
+ * @brief Gets widget children
+ *
+ * @param widget an EailWidget
+ * @return widget children list
+ */
+static Eina_List *
+eail_frame_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *content;
+   Evas_Object *obj;
+
+   obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+   if (obj)
+     {
+        content = elm_object_part_content_get(obj, "default");
+        if (content)
+          list = eina_list_append(list, content);
+     }
+
+   return list;
+}
+
+/**
+ * @brief Gest obj name
+ *
+ *
+ *
+ * @param obj an AtkObject
+ * @return obj name
+ */
+static const gchar*
+eail_frame_get_name(AtkObject *obj)
+{
+   const gchar *name;
+   Evas_Object *widget = NULL;
+
+   name = ATK_OBJECT_CLASS(eail_frame_parent_class)->get_name(obj);
+   if (NULL != name)
+     return name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (widget)
+     name = (const gchar*)elm_object_text_get(widget);
+
+   return name;
+}
+
+/**
+ * @brief EailFrame instance initializer
+ *
+ * @param frame an EailFrame
+ */
+static void
+eail_frame_init(EailFrame *frame)
+{
+}
+
+/**
+ * @brief EailFrame class initializer
+ *
+ * @param klass an EailFrame class
+ */
+static void
+eail_frame_class_init(EailFrameClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   widget_class->get_widget_children = eail_frame_get_widget_children;
+
+   class->initialize = eail_frame_initialize;
+   class->get_name = eail_frame_get_name;
+}
diff --git a/eail/eail/eail_frame.h b/eail/eail/eail_frame.h
new file mode 100644 (file)
index 0000000..dd96d30
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file eail_frame.h
+ *
+ * @brief Header for EailFrame implementation
+ */
+
+#ifndef EAIL_FRAME_H
+#define EAIL_FRAME_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailFrame class
+ */
+#define EAIL_TYPE_FRAME              (eail_frame_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailFrame
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_FRAME(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                      EAIL_TYPE_FRAME, EailFrame))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailFrame class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_FRAME_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                      EAIL_TYPE_FRAME, EailFrameClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailFrame class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_FRAME(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                      EAIL_TYPE_FRAME))
+/**
+ * @brief Tests whether given klass is a subclass of EailFrame
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_FRAME_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                      EAIL_TYPE_FRAME))
+/**
+ * @brief Gets EailFrame class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailFrame class from
+ */
+#define EAIL_FRAME_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                      EAIL_TYPE_FRAME, EailFrameClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailFrame*/
+typedef struct _EailFrame      EailFrame;
+/** @brief Definition of class structure for Atk EailFrame*/
+typedef struct _EailFrameClass EailFrameClass;
+
+/** @brief Definition of object structure for Atk EailFrame*/
+struct _EailFrame
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailFrame*/
+struct _EailFrameClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailFrame GType
+ * @returns GType for EailFrame implementation*/
+GType eail_frame_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_gengrid.c b/eail/eail/eail_gengrid.c
new file mode 100644 (file)
index 0000000..d790014
--- /dev/null
@@ -0,0 +1,1243 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_gengrid.c
+ * @brief Implementation of gengrid widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_gengrid.h"
+#include "eail_item_parent.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+static void atk_table_interface_init(AtkTableIface *iface);
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+
+/** @brief GObject definition for EailGengrid implementation*/
+G_DEFINE_TYPE_WITH_CODE(EailGengrid,
+                        eail_gengrid,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TABLE,
+                                              atk_table_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                              atk_selection_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief Handler for realized event, used to notify about gengrid content
+ * changes
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info (item is passed here)
+ */
+void
+eail_gengrid_item_handle_realized_event(void *data,
+                                        Evas_Object *obj,
+                                        void *event_info)
+{
+   Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+   AtkObject *atk_item = NULL, *atk_parent = NULL;
+
+   atk_parent = ATK_OBJECT(data);
+   if (!atk_parent) return;
+
+   atk_item = eail_factory_get_item_atk_obj
+                                         (item, ATK_ROLE_LIST_ITEM, atk_parent);
+
+   if (!atk_item) return;
+
+   eail_emit_children_changed_obj(TRUE, atk_parent, atk_item);
+}
+
+/**
+ * @brief Handler for unrealized event, used to notify about gengrid content
+ * changes
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info (item is passed here)
+ */
+void
+eail_gengrid_item_handle_unrealized_event(void *data,
+                                          Evas_Object *obj,
+                                          void *event_info)
+{
+   Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+   AtkObject *atk_item = NULL, *atk_parent = NULL;
+
+   atk_parent = ATK_OBJECT(data);
+   if (!atk_parent) return;
+
+   atk_item = eail_factory_get_item_atk_obj
+                                         (item, ATK_ROLE_LIST_ITEM, atk_parent);
+
+   if (!atk_item) return;
+
+   eail_emit_children_changed_obj(FALSE, atk_parent, atk_item);
+   atk_object_notify_state_change(atk_item, ATK_STATE_DEFUNCT, TRUE);
+
+   DBG("Unregistering item from cache...");
+   eail_factory_unregister_item_from_cache(item);
+}
+
+/**
+ * @brief Initialize EailGengrid object
+ *
+ * @param obj EailGengrid instance
+ * @param data user data passed to initialization
+ */
+static void
+eail_gengrid_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_gengrid_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_TABLE;
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "selected",
+                                eail_list_item_handle_selected_event, obj);
+   evas_object_smart_callback_add(nested_widget, "unselected",
+                                eail_list_item_handle_unselected_event, obj);
+   evas_object_smart_callback_add(nested_widget, "realized",
+                                eail_gengrid_item_handle_realized_event, obj);
+   evas_object_smart_callback_add(nested_widget, "unrealized",
+                                eail_gengrid_item_handle_unrealized_event, obj);
+}
+
+/**
+ * @brief Get list of created widgets
+ *
+ * @param gengrid EailGengrid instance
+ *
+ * @returns list of widgets elm_gengrid holds
+ */
+static Eina_List *
+eail_gengrid_items_get(EailGengrid *gengrid)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(gengrid), NULL);
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(gengrid));
+
+   return elm_gengrid_realized_items_get(widget);
+}
+
+/**
+ * @brief Get number of created widgets
+ *
+ * @param obj EailGengrid instance
+ *
+ * @returns number of created widgets
+ */
+static gint
+eail_gengrid_n_items_get(AtkObject *obj)
+{
+   gint n_items;
+   Eina_List *items = eail_gengrid_items_get(EAIL_GENGRID(obj));
+   n_items  = eina_list_count(items);
+   eina_list_free(items);
+
+   return n_items;
+}
+
+/**
+ * @brief Get reference to elm_gengrid child as AtkObject
+ *
+ * @param obj EailGengrid instance
+ * @param i child index
+ *
+ * @returns reference to AtkObject
+ */
+static AtkObject *
+eail_gengrid_ref_child(AtkObject *obj, gint i)
+{
+   g_return_val_if_fail(EAIL_IS_GENGRID(obj), NULL);
+
+   AtkObject *child = NULL;
+
+   Eina_List *list = eail_gengrid_items_get(EAIL_GENGRID(obj));
+   if (eina_list_count(list) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                             (eina_list_nth(list, i), ATK_ROLE_LIST_ITEM, obj);
+
+        g_object_ref(child);
+     }
+
+   return child;
+}
+
+/**
+ * @brief Implementation of ref_state_set from AtkObject
+ *
+ * @param obj EailGengrid instance
+ *
+ * @returns reference to an state set of accessible
+ */
+static AtkStateSet *
+eail_gengrid_ref_state_set(AtkObject *obj)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   AtkStateSet *state_set =
+      ATK_OBJECT_CLASS(eail_gengrid_parent_class)->ref_state_set(obj);
+
+   if (!widget) return state_set;
+
+   if (elm_gengrid_multi_select_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_MULTISELECTABLE);
+
+   return state_set;
+}
+
+/**
+ * @brief Init EailGengrid object
+ *
+ * @param gengrid EailGengrid instance
+ */
+static void
+eail_gengrid_init(EailGengrid *gengrid)
+{
+}
+
+/**
+ * @brief Init EailGengrid class
+ *
+ * @param klass EailGengrid class
+ */
+static void
+eail_gengrid_class_init(EailGengridClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_gengrid_initialize;
+   class->get_n_children = eail_gengrid_n_items_get;
+   class->ref_child = eail_gengrid_ref_child;
+   class->ref_state_set = eail_gengrid_ref_state_set;
+}
+
+/**
+ * @brief Get name of elm_gengrid child
+ *
+ * @param parent EailGengrid instance
+ * @param item EailGengrid child instance
+ *
+ * @returns string representing item name
+ */
+static const gchar *
+eail_gengrid_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   /*that will work only for default theme*/
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, "elm.text");
+}
+
+/**
+ * @brief Get item index in parent object
+ *
+ * @param parent EailGengrid instance
+ * @param item EailGengrid child
+ *
+ * @returns child index in parent object
+ */
+static int
+eail_gengrid_item_index_in_parent_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!it) return -1;
+
+   return elm_gengrid_item_index_get(it);
+}
+
+/**
+ * @brief Get state set of EailGengrid item
+ *
+ * @param parent EailGengrid instance
+ * @param item EailGengrid child instance
+ * @param state_set AtkStateSet to fill
+ *
+ * @returns state set of EailGengrid child
+ */
+static AtkStateSet *
+eail_gengrid_ref_item_state_set(EailItemParent *parent,
+                                EailItem *item,
+                                AtkStateSet *state_set)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!widget || !it) return state_set;
+
+   Evas_Object *cell = elm_object_item_widget_get(it);
+
+   if ((elm_gengrid_select_mode_get(widget) != ELM_OBJECT_SELECT_MODE_NONE) &&
+       (elm_gengrid_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_NONE))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_SELECTABLE);
+        if (elm_gengrid_selected_item_get(cell))
+          atk_state_set_add_state(state_set, ATK_STATE_SELECTED);
+     }
+
+   if (evas_object_visible_get(cell))
+     atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
+
+   atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
+
+   return state_set;
+}
+
+/**
+ * @brief Grabs focus on EailGengrid item
+ *
+ * @param parent EailGengrid instance
+ * @param item EailGengrid child instance
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_grab_item_focus(EailItemParent *parent,
+                             EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   if (!it) return FALSE;
+
+   Evas_Object *obj = elm_object_item_widget_get(it);
+   if (!elm_object_focus_allow_get(obj)) return FALSE;
+
+   elm_object_focus_set(obj, EINA_TRUE);
+
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of get_extents from AtkComponent for EailGengrid child
+ *
+ * @param parent EailGengrid instance
+ * @param item EailGengrid child instance
+ * @param x address to store x coordinate
+ * @param y address to store y coordinate
+ * @param width address to store width
+ * @param height address to store height
+ * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window
+ */
+static void
+eail_gengrid_item_extents_get(EailItemParent *parent,
+                              EailItem *item,
+                              gint *x,
+                              gint *y,
+                              gint *width,
+                              gint *height,
+                              AtkCoordType coord_type)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if ((!widget) || (!it)) return;
+
+   Evas_Object *it_widget = elm_object_item_widget_get(it);
+   evas_object_geometry_get(it_widget, x, y, width, height);
+
+   if (coord_type == ATK_XY_SCREEN) {
+        int ee_x, ee_y;
+        Ecore_Evas *ee =
+           ecore_evas_ecore_evas_get(evas_object_evas_get(it_widget));
+
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        *x += ee_x;
+        *y += ee_y;
+   }
+}
+
+/**
+ * @brief Implementation of EailItemParent->get_actions_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns enum representing supported actions
+ */
+static gint
+eail_gengrid_get_actions_supported(EailItemParent   *parent,
+                                   EailItem         *item)
+{
+   return EAIL_ACTION_SUPPORTED_CLICK | EAIL_ACTION_SUPPORTED_PRESS |
+            EAIL_ACTION_SUPPORTED_RELEASE;
+}
+
+/**
+ * @brief EailItemParent iterface initialization
+ *
+ * @param iface EailItemParentIface iterface instace
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   if (!iface) return;
+
+   iface->get_item_name            = eail_gengrid_item_name_get;
+   iface->get_item_index_in_parent = eail_gengrid_item_index_in_parent_get;
+   iface->ref_item_state_set       = eail_gengrid_ref_item_state_set;
+   iface->grab_item_focus          = eail_gengrid_grab_item_focus;
+   iface->get_item_extents         = eail_gengrid_item_extents_get;
+   iface->get_actions_supported    = eail_gengrid_get_actions_supported;
+}
+
+/**
+ * @brief Helper function to get rows and columns count
+ *
+ * @param object elm_gengrid instance
+ * @param rows address to store rows count
+ * @param columns address to store columns count
+ */
+static void
+_get_n_rows_columns(const Evas_Object *object,
+                    int *rows, int *columns)
+{
+   Elm_Object_Item *it;
+   Eina_List *l, *list = elm_gengrid_realized_items_get(object);
+   int row, column;
+
+   if (list == NULL)
+     {
+        *rows = 0;
+        *columns = 0;
+        return;
+     }
+
+   row = column = 0;
+   EINA_LIST_FOREACH(list, l, it)
+     {
+        unsigned int item_row, item_col;
+        elm_gengrid_item_pos_get(it, &item_col, &item_row);
+        if (item_row > row) row++;
+        if (item_col > column) column++;
+     }
+
+   eina_list_free(list);
+   *rows = row + 1;
+   *columns = column + 1;
+}
+
+
+/**
+ * @brief Implementation of get_n_rows from AtkTable
+ *
+ * @param table EailGengrid instance
+ *
+ * @returns number of rows
+ */
+static gint
+eail_gengrid_n_rows_get(AtkTable *table)
+{
+   Evas_Object *widget;
+   int rows, columns;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), -1);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   if (!widget) return -1;
+
+   /*_get_last_coords(widget, &rows, &columns);*/
+   _get_n_rows_columns(widget, &rows, &columns);
+   return rows;
+}
+
+/**
+ * @brief Implementation of get_n_columns from AtkTable
+ *
+ * @param table EailGengrid instance
+ *
+ * @returns number of columns
+ */
+static gint
+eail_gengrid_n_columns_get(AtkTable *table)
+{
+   Evas_Object *widget;
+   int rows, columns;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), -1);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+
+   /*_get_last_coords(widget, &rows, &columns);*/
+   _get_n_rows_columns(widget, &rows, &columns);
+
+   return columns;
+}
+
+/**
+ * @brief Implementation of get_index_at from AtkTable
+ *
+ * @param table EailGengrid instance
+ * @param row number of row in table
+ * @param column number of column in table
+ *
+ * @returns index at specified position
+ */
+static gint
+eail_gengrid_index_at_get(AtkTable *table, gint row, gint column)
+{
+   Evas_Object *widget;
+   gint n_rows, n_columns;
+   gint ret_val = -1;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), -1);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   if (!widget) return -1;
+
+   _get_n_rows_columns(widget, &n_rows, &n_columns);
+
+   if ((row >= n_rows) || (column >= n_columns)) return -1;
+
+   if (elm_gengrid_horizontal_get(widget))
+     ret_val = ((n_columns) * column) + row;
+   else
+     ret_val = ((n_columns) * row) + column;
+
+   /* testing if result is within bounds */
+   if (ret_val >= eail_gengrid_n_items_get(ATK_OBJECT(table)))
+     return -1;
+
+   return ret_val;
+}
+
+/**
+ * @brief Implementation of ref_at from AtkTable
+ *
+ * @param table EailGengrid instance
+ * @param row number of row in table
+ * @param column number of column in table
+ *
+ * @returns referred child object
+ */
+static AtkObject *
+eail_gengrid_ref_at(AtkTable *table, gint row, gint column)
+{
+   gint index;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), NULL);
+
+   index = eail_gengrid_index_at_get(table, row, column);
+   if (index == -1) return NULL;
+
+   return eail_gengrid_ref_child(ATK_OBJECT(table), index);
+}
+
+/**
+ * @brief Helper function to get object position in table at given index
+ *
+ * @param widget elm_gengrid widget
+ * @param row address to store row number
+ * @param column address to store column number
+ * @param index index of child item
+ */
+static void
+_get_item_pos(const Evas_Object *widget, gint *row, gint *column, gint index)
+{
+   Elm_Object_Item *it;
+   Eina_List *list;
+
+   if (!widget)
+     {
+        *row = -1;
+        *column = -1;
+        return;
+     }
+
+   list = elm_gengrid_realized_items_get(widget);
+   it = eina_list_nth(list, index);
+   elm_gengrid_item_pos_get(it, (unsigned int *)column, (unsigned int *)row);
+
+   eina_list_free(list);
+}
+
+/**
+ * @brief Implementation of get_column_at_index from AtkTable
+ *
+ * @param table EailGengrid instance
+ * @param index number of child index
+ *
+ * @returns column number in table
+ */
+static gint
+eail_gengrid_column_at_index_get(AtkTable *table, gint index)
+{
+   Evas_Object *widget;
+   int row, column;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), -1);
+   if (index >= eail_gengrid_n_items_get(ATK_OBJECT(table)))
+     return -1;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   _get_item_pos(widget, &row, &column, index);
+
+   return column;
+}
+
+/**
+ * @brief Implementation of get_row_at_index from AtkTable
+ *
+ * @param table EailGengrid instance
+ * @param index index of child
+ *
+ * @returns row number in table
+ */
+static gint
+eail_gengrid_row_at_index_get(AtkTable *table, gint index)
+{
+   Evas_Object *widget;
+   int row, column;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), -1);
+   if (index >= eail_gengrid_n_items_get(ATK_OBJECT(table)))
+     return -1;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   _get_item_pos(widget, &row, &column, index);
+
+   return row;
+}
+
+/**
+ * @brief Implementation of is_selected from AtkTable
+ *
+ * @param table EailGengrid instance
+ * @param row row number
+ * @param column column number
+ *
+ * @returns TRUE if selected FALSE otherwise
+ */
+static gboolean
+eail_gengrid_is_selected(AtkTable *table, gint row, gint column)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   int index;
+   Eina_List *list;
+   gboolean result;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   index = eail_gengrid_index_at_get(table, row, column);
+   if (index == -1) return FALSE;
+
+   list = elm_gengrid_realized_items_get(widget);
+   it = eina_list_nth(list, index);
+   result = elm_gengrid_item_selected_get(it);
+
+   eina_list_free(list);
+   return result;
+}
+
+/**
+ * @brief Implementation of is_row_selected from AtkTable interface
+ *
+ * @param table EailGengrid instance
+ * @param row number of row in table
+ *
+ * @returns TRUE if selected, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_is_row_selected(AtkTable *table, gint row)
+{
+   Evas_Object *widget;
+   Eina_List *list;
+   const Eina_List *selected;
+   gboolean result;
+   int list_count, n_rows;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   /*it is possible to select row only in multiselct mode*/
+   if (!elm_gengrid_multi_select_get(widget))
+     return FALSE;
+
+   selected = elm_gengrid_selected_items_get(widget);
+   if (!selected) return FALSE;
+
+   n_rows = eail_gengrid_n_rows_get(table);
+   if (row > n_rows) return FALSE;
+
+   list = elm_gengrid_realized_items_get(widget);
+   list_count = eina_list_count(list);
+
+   result = TRUE;
+   for (int i = 0; i < list_count; i++)
+     {
+        Elm_Object_Item *it = eina_list_nth(list, i);
+        unsigned int x, y;
+        elm_gengrid_item_pos_get(it, &x, &y);
+        if((row == x) && (!elm_gengrid_item_selected_get(it)))
+          {
+             /*row is considered selected if all items in row are selected*/
+             result = FALSE;
+             break;
+          }
+     }
+   eina_list_free(list);
+   return result;
+}
+
+/**
+ * @brief Implementation of get_selected_rows from AtkTable interface
+ *
+ * @param table EailGengrid instace
+ * @param selected address to gint* for store selected rows number
+ *
+ * @returns selected rows count
+ */
+static gint
+eail_gengrid_selected_rows_get(AtkTable *table, gint **selected)
+{
+   GArray *array;
+   Evas_Object *widget;
+   int n_rows, n_selected;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), 0);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+
+   if (!widget) return 0;
+   if (!elm_gengrid_multi_select_get(widget)) return 0;
+
+   n_rows = eail_gengrid_n_rows_get(table);
+   array = g_array_new(FALSE, FALSE, sizeof(gint));
+   for (int i = 0; i < n_rows; i++)
+     {
+        gboolean success = eail_gengrid_is_row_selected(table, i);
+        if (success) g_array_append_val(array, i);
+     }
+   n_selected = array->len;
+   *selected = (gint *) g_array_free(array, FALSE);
+   return n_selected;
+}
+
+/**
+ * @brief Helper function to set row selection
+ *
+ * @param table EailGengrid instance
+ * @param row row number
+ * @param selection EINA_TRUE on selection, EINA_FALSE on remove selection
+ */
+static void
+_set_row_selection(AtkTable *table, int row, Eina_Bool selection)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   Eina_List *list = elm_gengrid_realized_items_get(widget);
+   int list_count = eina_list_count(list);
+
+   for (int i = 0; i < list_count; i++)
+     {
+        unsigned int x, y;
+        Elm_Object_Item *it = eina_list_nth(list, i);
+        elm_gengrid_item_pos_get(it, &x, &y);
+        if (x == row)
+          {
+             elm_gengrid_item_selected_set(it, selection);
+          }
+     }
+
+   eina_list_free(list);
+}
+
+/**
+ * @brief Implementation of add_row_selection from AtkTable
+ *
+ * @param table EailGengrid instance
+ * @param row row number in table
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_add_row_selection(AtkTable *table, gint row)
+{
+   Evas_Object *widget;
+   int n_rows;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+
+   if (!widget) return FALSE;
+   if (!elm_gengrid_multi_select_get(widget)) return FALSE;
+   n_rows = eail_gengrid_n_rows_get(table);
+   if (row > n_rows) return FALSE;
+
+   _set_row_selection(table, row, EINA_TRUE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of remove_row_selection from AtkTable interface
+ *
+ * @param table EailGengrid instance
+ * @param row number of row in table
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_remove_row_selection(AtkTable *table, gint row)
+{
+   Evas_Object *widget;
+   int n_rows;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   if (!widget) return FALSE;
+   if (!elm_gengrid_multi_select_get(widget)) return FALSE;
+   n_rows = eail_gengrid_n_rows_get(table);
+   if (row > n_rows) return FALSE;
+
+   _set_row_selection(table, row, EINA_FALSE);
+   return TRUE;
+
+}
+
+/**
+ * @brief Implementation of is_column_selected from AtkTable interface
+ *
+ * @param table EailGengrid implementation
+ * @param column number of column in table
+ *
+ * @returns TRUE on selection, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_is_column_selected(AtkTable *table, gint column)
+{
+   Evas_Object *widget;
+   Eina_List *list;
+   const Eina_List *selected;
+   int n_columns, list_count;
+   gboolean result;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   if (!elm_gengrid_multi_select_get(widget)) return FALSE;
+   n_columns = eail_gengrid_n_columns_get(table);
+   if (column > n_columns) return FALSE;
+   selected = elm_gengrid_selected_items_get(widget);
+   if (!selected) return FALSE;
+
+   list = elm_gengrid_realized_items_get(widget);
+   list_count = eina_list_count(list);
+   result = TRUE;
+   for (int i = 0; i < list_count; i++)
+     {
+        Elm_Object_Item *it = eina_list_nth(list, i);
+        unsigned int x, y;
+        elm_gengrid_item_pos_get(it, &x, &y);
+        if ((y == column) && (!elm_gengrid_item_selected_get(it)))
+          {
+             result = FALSE;
+             break;
+          }
+     }
+
+   eina_list_free(list);
+   return result;
+}
+
+/**
+ * @brief Helper function to set column selection in elm_gengrid
+ *
+ * @param table EailGengrid instance
+ * @param column number of column in table
+ * @param selection EINA_TRUE on selection, EINA_FALSE otherwise
+ */
+static void
+_set_column_selection(AtkTable *table, int column, Eina_Bool selection)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   Eina_List *list = elm_gengrid_realized_items_get(widget);
+   int list_count = eina_list_count(list);
+
+   for (int i = 0; i < list_count; i++)
+     {
+        unsigned int x, y;
+        Elm_Object_Item *it = eina_list_nth(list, i);
+        elm_gengrid_item_pos_get(it, &x, &y);
+        if (y == column)
+          {
+             elm_gengrid_item_selected_set(it, selection);
+          }
+     }
+
+   eina_list_free(list);
+}
+
+/**
+ * @brief Implementation of add_column_selection from AtkTable interface
+ *
+ * @param table EailGengrid instance
+ * @param column number of column in table
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_add_column_selection(AtkTable *table, gint column)
+{
+   Evas_Object *widget;
+   int n_columns;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   if (!widget) return FALSE;
+   if (!elm_gengrid_multi_select_get(widget)) return FALSE;
+   n_columns = eail_gengrid_n_columns_get(table);
+   if (column > n_columns) return FALSE;
+
+   _set_column_selection(table, column, EINA_TRUE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation remove_column_selection from AtkTable
+ *
+ * @param table EailGengrid instance
+ * @param column column number in table
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_remove_column_selection(AtkTable *table, gint column)
+{
+   Evas_Object *widget;
+   int n_columns;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(table), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(table));
+   if (!widget) return FALSE;
+   if (!elm_gengrid_multi_select_get(widget)) return FALSE;
+   n_columns = eail_gengrid_n_columns_get(table);
+   if (column > n_columns) return FALSE;
+
+   _set_column_selection(table, column, EINA_FALSE);
+   return TRUE;
+
+}
+
+/**
+ * @brief AtkTable interface initialization
+ *
+ * @param iface EailGengrid instance
+ */
+static void
+atk_table_interface_init(AtkTableIface *iface)
+{
+   if (!iface) return;
+
+   iface->ref_at = eail_gengrid_ref_at;
+   iface->get_n_rows = eail_gengrid_n_rows_get;
+   iface->get_n_columns = eail_gengrid_n_columns_get;
+   iface->get_index_at = eail_gengrid_index_at_get;
+   iface->get_column_at_index = eail_gengrid_column_at_index_get;
+   iface->get_row_at_index = eail_gengrid_row_at_index_get;
+   iface->is_row_selected = eail_gengrid_is_row_selected;
+   iface->is_selected = eail_gengrid_is_selected;
+   iface->get_selected_rows = eail_gengrid_selected_rows_get;
+   iface->add_row_selection = eail_gengrid_add_row_selection;
+   iface->remove_row_selection = eail_gengrid_remove_row_selection;
+   iface->is_column_selected = eail_gengrid_is_column_selected;
+   iface->add_column_selection = eail_gengrid_add_column_selection;
+   iface->remove_column_selection = eail_gengrid_remove_column_selection;
+
+   /*unsupported*/
+   iface->get_column_extent_at = NULL;
+   iface->get_row_extent_at = NULL;
+   iface->get_column_header = NULL;
+   iface->get_column_description = NULL;
+}
+
+/**
+ * @brief Implementation of add_selection from AtkSelection interface
+ *
+ * @param selection EailGengrid instance
+ * @param i index of child to select
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_selection_add(AtkSelection *selection, gint i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   Eina_List *list;
+   gboolean result;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(selection), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   list = elm_gengrid_realized_items_get(widget);
+
+   if (i > eina_list_count(list)) return FALSE;
+   it = eina_list_nth(list, i);
+
+   if (elm_gengrid_item_selected_get(it))
+     result = FALSE;
+   else
+     {
+        elm_gengrid_item_selected_set(it, EINA_TRUE);
+        result = TRUE;
+     }
+
+   eina_list_free(list);
+   return result;
+}
+
+/**
+ * @brief Implementation of clear_selection from AtkSelection
+ *
+ * @param selection EailGengrid instance
+ *
+ * @returns TRUE on success FALSE otherwise
+ */
+static gboolean
+eail_gengrid_selection_clear(AtkSelection *selection)
+{
+   const Eina_List *l, *list;
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(selection), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+
+   if (elm_gengrid_multi_select_get(widget))
+     {
+        list = elm_gengrid_selected_items_get(widget);
+        EINA_LIST_FOREACH(list, l, it)
+          {
+             elm_gengrid_item_selected_set(it, EINA_FALSE);
+          }
+     }
+   else
+     {
+        it = elm_gengrid_selected_item_get(widget);
+        elm_gengrid_item_selected_set(it, EINA_FALSE);
+     }
+
+   return TRUE;
+}
+
+
+/**
+ * @brief Implementation of ref_selection from AtkSelection interface
+ *
+ * @param selection EailGengrid instance
+ * @param i index of selected child
+ *
+ * @returns reffered selected object
+ */
+static AtkObject *
+eail_gengrid_selection_ref(AtkSelection *selection, gint i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   const Eina_List *list;
+   Eina_Bool multiselect;
+   AtkObject *child;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(selection), NULL);
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   multiselect = elm_gengrid_multi_select_get(widget);
+
+   if ((!multiselect) && (i != 0)) return FALSE;
+
+   if (multiselect)
+     {
+        list = elm_gengrid_selected_items_get(widget);
+        if (i > eina_list_count(list)) return NULL;
+        it = eina_list_nth(list, i);
+     }
+   else
+     {
+        it = elm_gengrid_selected_item_get(widget);
+     }
+
+   if (!it) return NULL;
+
+   child = eail_factory_get_item_atk_obj
+                              (it, ATK_ROLE_LIST_ITEM, ATK_OBJECT(selection));
+
+   g_object_ref(child);
+
+   return child;
+}
+
+/**
+ * @brief Implementation of get_selection_count from AtkSelection interface
+ *
+ * @param selection EailGengrid instance
+ *
+ * @returns number of selected items
+ */
+static gint
+eail_gengrid_selection_count_get(AtkSelection *selection)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   const Eina_List *list;
+   int n_selections;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(selection), -1);
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   if (!elm_gengrid_multi_select_get(widget))
+     {
+        it = elm_gengrid_selected_item_get(widget);
+        n_selections = (it ? 1 : 0);
+     }
+   else
+     {
+        list = elm_gengrid_selected_items_get(widget);
+        n_selections = eina_list_count(list);
+     }
+
+   return n_selections;
+}
+
+/**
+ * @brief Implementation of is_child_selected from AtkSelection interface
+ *
+ * @param selection EailGengrid instance
+ * @param i index of child
+ *
+ * @returns TRUE on selction, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_selection_is_child_selected(AtkSelection *selection, int i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   Eina_List *list;
+   gboolean selected;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(selection), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   list = elm_gengrid_realized_items_get(widget);
+
+   if (i > eina_list_count(list))
+     {
+        eina_list_free(list);
+        return FALSE;
+     }
+
+   it = eina_list_nth(list, i);
+   selected = (elm_gengrid_item_selected_get(it) ? TRUE : FALSE);
+   eina_list_free(list);
+
+   return selected;
+}
+
+/**
+ * @brief Implementation of remove_selection from AtkSelection
+ *
+ * @param selection  EailGengrid instance
+ * @param i index of selected child
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_selection_remove(AtkSelection *selection, gint i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   const Eina_List *list;
+   Eina_Bool multiselect;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(selection), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   multiselect = elm_gengrid_multi_select_get(widget);
+   if ((!multiselect) && (i != 0)) return FALSE;
+
+   if (!multiselect)
+     {
+        it = elm_gengrid_selected_item_get(widget);
+        elm_gengrid_item_selected_set(it, FALSE);
+     }
+   else
+     {
+        list = elm_gengrid_selected_items_get(widget);
+        if (i > eina_list_count(list)) return FALSE;
+
+        it = eina_list_nth(list, i);
+        elm_gengrid_item_selected_set(it, EINA_FALSE);
+    }
+
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of select_all from AtkSelection interface
+ *
+ * @param selection EailGengrid instance
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_gengrid_selection_select_all(AtkSelection *selection)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+   Eina_List *l, *list;
+
+   g_return_val_if_fail(EAIL_IS_GENGRID(selection), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   if (!elm_gengrid_multi_select_get(widget)) return FALSE;
+
+   list = elm_gengrid_realized_items_get(widget);
+   EINA_LIST_FOREACH(list, l, it)
+     {
+        elm_gengrid_item_selected_set(it, EINA_TRUE);
+     }
+   return TRUE;
+}
+
+/**
+ * @brief AtkSelection interface initialization
+ *
+ * @param iface EailGengrid instance
+ */
+static void
+atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->add_selection = eail_gengrid_selection_add;
+   iface->clear_selection = eail_gengrid_selection_clear;
+   iface->ref_selection = eail_gengrid_selection_ref;
+   iface->get_selection_count = eail_gengrid_selection_count_get;
+   iface->is_child_selected = eail_gengrid_selection_is_child_selected;
+   iface->remove_selection = eail_gengrid_selection_remove;
+   iface->select_all_selection = eail_gengrid_selection_select_all;
+}
diff --git a/eail/eail/eail_gengrid.h b/eail/eail/eail_gengrid.h
new file mode 100644 (file)
index 0000000..fa06e72
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_gengrid.h
+ *
+ * @brief Header for EailGengrid implementation
+ */
+
+#ifndef EAIL_GENGRID_H
+#define EAIL_GENGRID_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailGengrid class
+ */
+#define EAIL_TYPE_GENGRID            (eail_gengrid_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailGengrid
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_GENGRID(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                      EAIL_TYPE_GENGRID, EailGengrid))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailGengrid class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_GENGRID_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                      EAIL_TYPE_GENGRID, EailGengridClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailGengrid class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_GENGRID(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                      EAIL_TYPE_GENGRID))
+/**
+ * @brief Tests whether given klass is a subclass of EailGengrid
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_GENGRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                      EAIL_TYPE_GENGRID))
+/**
+ * @brief Gets EailGengrid class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailGengrid class from
+ */
+#define EAIL_GENGRID_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                      EAIL_TYPE_GENGRID, EailGengridClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailGengrid*/
+typedef struct _EailGengrid      EailGengrid;
+/** @brief Definition of class structure for Atk EailGengrid*/
+typedef struct _EailGengridClass EailGengridClass;
+
+/** @brief Definition of object structure for Atk EailGengrid*/
+struct _EailGengrid
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailGengrid*/
+struct _EailGengridClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailGengrid GType
+ * @returns GType for EailGengrid implementation*/
+GType eail_gengrid_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_genlist.c b/eail/eail/eail_genlist.c
new file mode 100644 (file)
index 0000000..2e5db2f
--- /dev/null
@@ -0,0 +1,719 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_genlist.c
+ * @brief Implementation of genlist widget
+ */
+
+#include <Eina.h>
+#include <Evas.h>
+#include <Elementary.h>
+
+#include "eail_genlist.h"
+#include "eail_item_parent.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void eail_item_parent_interface_init   (EailItemParentIface *iface);
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+
+/**
+ * @brief Definition of EailGenlist as GObject
+ *
+ * EailList is extended ScrollableWidget with EAIL_TYPE_ITEM_PARENT and
+ * ATK_TYPE_SELECTION implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailGenlist, eail_genlist, EAIL_TYPE_SCROLLABLE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                                 atk_selection_interface_init));
+
+/**
+ * @brief Genlist text part name
+ */
+#define EAIL_GENLIST_TEXT "elm.text"
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief Handler for realized event, used to notify about genlist content
+ * changes
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info (item is passed here)
+ */
+void
+eail_list_item_handle_realized_event(void *data,
+                                     Evas_Object *obj,
+                                     void *event_info)
+{
+   Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+   AtkObject *atk_item = NULL, *atk_parent = NULL;
+
+   atk_parent = ATK_OBJECT(data);
+   if (!atk_parent) return;
+
+   atk_item = eail_factory_get_item_atk_obj
+                                         (item, ATK_ROLE_LIST_ITEM, atk_parent);
+
+   if (!atk_item) return;
+
+   eail_emit_children_changed_obj(TRUE, atk_parent, atk_item);
+}
+
+/**
+ * @brief Handler for unrealized event, used to notify about genlist content
+ * changes
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info (item is passed here)
+ */
+void
+eail_list_item_handle_unrealized_event(void *data,
+                                     Evas_Object *obj,
+                                     void *event_info)
+{
+   Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+   AtkObject *atk_item = NULL, *atk_parent = NULL;
+
+   atk_parent = ATK_OBJECT(data);
+   if (!atk_parent) return;
+
+   atk_item = eail_factory_get_item_atk_obj
+                                         (item, ATK_ROLE_LIST_ITEM, atk_parent);
+
+   if (!atk_item) return;
+
+   eail_emit_children_changed_obj(FALSE, atk_parent, atk_item);
+   atk_object_notify_state_change(atk_item, ATK_STATE_DEFUNCT, TRUE);
+
+   DBG("Unregistering item from cache...");
+   eail_factory_unregister_item_from_cache(item);
+}
+
+/**
+ * @brief Initializer for AtkObjectClass
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_genlist_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_genlist_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_LIST;
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "selected",
+                                  eail_list_item_handle_selected_event, obj);
+   evas_object_smart_callback_add(nested_widget, "unselected",
+                                  eail_list_item_handle_unselected_event, obj);
+   evas_object_smart_callback_add(nested_widget, "realized",
+                                  eail_list_item_handle_realized_event, obj);
+   evas_object_smart_callback_add(nested_widget, "unrealized",
+                                  eail_list_item_handle_unrealized_event, obj);
+}
+
+/**
+ * @brief Prepares Eina_List filled with Elm_Object_Item* objects
+ * representing items in the list
+ *
+ * @param genlist an EailGenlist
+ *
+ * @return filled list with list items. Call eina_list_free on that list when
+ * results processing has been finished
+ */
+static Eina_List *
+eail_genlist_get_items(EailGenlist *genlist)
+{
+    Eina_List *items = NULL;
+    Elm_Object_Item *item;
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(genlist));
+
+    item = elm_genlist_first_item_get(widget);
+    while (item) {
+        items = eina_list_append(items, item);
+        item = elm_genlist_item_next_get(item);
+    }
+
+    return items;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_genlist_get_n_children(AtkObject *obj)
+{
+    gint n_items;
+    Eina_List *items;
+
+    items = eail_genlist_get_items(EAIL_GENLIST(obj));
+    n_items = eina_list_count(items);
+
+    eina_list_free(items);
+
+    return n_items;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_genlist_ref_child(AtkObject *obj, gint i)
+{
+    Eina_List *items;
+    AtkObject *child = NULL;
+
+    items = eail_genlist_get_items(EAIL_GENLIST(obj));
+    if (eina_list_count(items) > i) {
+       child = eail_factory_get_item_atk_obj
+                             (eina_list_nth(items, i), ATK_ROLE_LIST_ITEM, obj);
+
+       g_object_ref(child);
+    }
+
+    eina_list_free(items);
+
+    return child;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_state_set callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the state set of the accessible; the caller must
+ * unreference it when it is no longer needed.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns reference to an AtkStateSet which is the state set of the
+ * accessible
+ */
+static AtkStateSet *
+eail_genlist_ref_state_set(AtkObject *obj)
+{
+    AtkStateSet *state_set;
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+    state_set = ATK_OBJECT_CLASS(eail_genlist_parent_class)->ref_state_set(obj);
+
+    if (!widget) {
+        return state_set;
+    }
+
+    if (elm_genlist_multi_select_get(widget)) {
+        atk_state_set_add_state(state_set, ATK_STATE_MULTISELECTABLE);
+    }
+
+    return state_set;
+}
+
+/**
+ * @brief Initializer for GObject EailList instance
+ *
+ * @param genlist an EailGenlist
+ */
+static void
+eail_genlist_init(EailGenlist *genlist)
+{
+}
+
+/**
+ * @brief Initializer for GObject class (defines callbacks for base AtkObject)
+ *
+ * @param klass an EailGenlistClass
+ */
+static void
+eail_genlist_class_init(EailGenlistClass *klass)
+{
+    AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+    class->initialize = eail_genlist_initialize;
+    class->get_n_children = eail_genlist_get_n_children;
+    class->ref_child = eail_genlist_ref_child;
+    class->ref_state_set = eail_genlist_ref_state_set;
+}
+
+/*
+ * Implementation of the *EailItemParent* interface
+ */
+
+/**
+ * @brief Gets name of EailItem
+ *
+ * Implementation of EailItemParent->get_name callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ *
+ * @returns a character string representing the accessible description of
+ * the item.
+ */
+static const gchar *
+eail_genlist_get_item_name(EailItemParent   *parent,
+                           EailItem         *item)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!widget || !it) return NULL;
+
+   return elm_object_item_part_text_get(it, EAIL_GENLIST_TEXT);
+}
+
+/**
+ * @brief Gets index of element in parent object
+ *
+ * Implementation of EailItemParent->get_item_index_in_parent
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ *
+ * @returns an integer which is the index of the accessible in its parent
+ */
+static gint
+eail_genlist_get_item_index_in_parent(EailItemParent    *parent,
+                                      EailItem          *item)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+    Elm_Object_Item *it = eail_item_get_item(item);
+
+    if (!widget || !it) {
+        return -1;
+    }
+
+    return elm_genlist_item_index_get(it);
+}
+
+/**
+ * @brief Implementation EailItemParent->ref_state_set callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the state set of the accessible; the caller must
+ * unreference it when it is no longer needed.
+ *
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ * @param state_set current AtkStateSet with some values
+ *
+ * @returns reference to an AtkStateSet for given EailItem
+ */
+static AtkStateSet *
+eail_genlist_ref_item_state_set(EailItemParent  *parent,
+                                EailItem        *item,
+                                AtkStateSet       *state_set)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+    Elm_Object_Item *it = eail_item_get_item(item);
+    Eina_List *list;
+
+    if (!widget || !it) {
+        return state_set;
+    }
+
+    if (elm_genlist_select_mode_get(widget) != ELM_OBJECT_SELECT_MODE_NONE &&
+        elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_NONE) {
+        atk_state_set_add_state(state_set, ATK_STATE_SELECTABLE);
+
+        if (elm_genlist_item_selected_get(it)) {
+            atk_state_set_add_state(state_set, ATK_STATE_SELECTED);
+        }
+    }
+
+    if (elm_genlist_item_type_get(it) == ELM_GENLIST_ITEM_TREE) {
+        atk_state_set_add_state(state_set, ATK_STATE_EXPANDABLE);
+
+        if (elm_genlist_item_expanded_get(it)) {
+            atk_state_set_add_state(state_set, ATK_STATE_EXPANDED);
+        }
+    }
+
+    atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
+
+    list = elm_genlist_realized_items_get(widget);
+    if (eina_list_data_find(list, it)) {
+        atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
+    }
+    eina_list_free(list);
+
+    return state_set;
+}
+
+/**
+ * @brief Implementation of EailItemParent->grab_item_focus callback
+ *
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns TRUE if operation was successfull, FALSE otherwise
+ */
+static gboolean
+eail_genlist_grab_item_focus(EailItemParent *parent,
+                             EailItem       *item)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+    Elm_Object_Item *it = eail_item_get_item(item);
+
+    if (!widget || !it) {
+        return FALSE;
+    }
+
+    return FALSE;
+}
+
+/**
+ * @brief Gets the rectangle which gives the extent of the component.
+ *
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ * @param x address of gint to put x coordinate
+ * @param y address of gint to put y coordinate
+ * @param width ddress of gint to put width
+ * @param height address of gint to put height
+ * @param coord_type specifies whether the coordinates are relative to the
+ * screen or to the components top level window
+ */
+static void
+eail_genlist_get_item_extents(EailItemParent    *parent,
+                              EailItem          *item,
+                              gint                *x,
+                              gint                *y,
+                              gint                *width,
+                              gint                *height,
+                              AtkCoordType         coord_type)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+    Elm_Object_Item *it = eail_item_get_item(item);
+
+    if (!widget || !it) {
+        return;
+    }
+}
+
+/**
+ * @brief Implementation of EailItemParent->get_actions_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns enum representing supported actions
+ */
+static gint
+eail_genlist_get_actions_supported(EailItemParent   *parent,
+                                   EailItem         *item)
+{
+   return EAIL_ACTION_SUPPORTED_CLICK | EAIL_ACTION_SUPPORTED_PRESS |
+            EAIL_ACTION_SUPPORTED_RELEASE;
+}
+
+/**
+ * @brief Initialization of EailItemParentIface callbacks
+ *
+ * @param iface an EailItemParentIface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+    iface->get_item_name = eail_genlist_get_item_name;
+    iface->get_item_index_in_parent = eail_genlist_get_item_index_in_parent;
+    iface->ref_item_state_set = eail_genlist_ref_item_state_set;
+    iface->grab_item_focus = eail_genlist_grab_item_focus;
+    iface->get_item_extents = eail_genlist_get_item_extents;
+    iface->get_actions_supported = eail_genlist_get_actions_supported;
+}
+
+/*
+ * AtkSelection
+ */
+
+/**
+ * @brief Implementation of AtkSelection->add_selection callback
+ *
+ * As described in ATK doc:\n
+ * Adds the specified accessible child of the object to the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i selection index
+ *
+ * @returns TRUE if operation ended successfully, FALSE otherwise
+ */
+static gboolean
+eail_genlist_add_selection(AtkSelection *selection,
+                           gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Eina_List *items = eail_genlist_get_items(EAIL_GENLIST(selection));
+   Elm_Object_Item *item = eina_list_nth(items, i);
+
+   if (!item) return FALSE;
+
+   elm_genlist_item_selected_set(item, EINA_TRUE);
+
+   eina_list_free(items);
+
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->ref_selection callback
+ *
+ * As described in ATK doc:\n
+ * Gets a reference to the accessible object representing the specified selected
+ * child of the object. Note: callers should not rely on NULL or on a zero value
+ * for indication of whether AtkSelectionIface is implemented, they should use
+ * type checking/interface checking macros or the atk_get_accessible_value()
+ * convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i selection index
+ *
+ * @returns an AtkObject representing the selected accessible , or NULL if
+ * selection does not implement this interface
+ */
+static AtkObject *
+eail_genlist_ref_selection(AtkSelection *selection,
+                        gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), NULL);
+
+   return eail_genlist_ref_child(ATK_OBJECT(selection), i);
+}
+
+/**
+ * @brief Implementation of AtkSelection->get_selection_count callback
+ *
+ * As described in ATK doc:\n
+ * Gets the number of accessible children currently selected. Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns gint representing number of selected elements
+ */
+static gint
+eail_genlist_get_selection_count(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   const Eina_List *sel_objs = elm_genlist_selected_items_get(object);
+
+   if (!sel_objs) return 0;
+
+   return eina_list_count(sel_objs);
+}
+
+/**
+ * @brief Implementation of AtkSelection->is_child_selected callback
+ *
+ * As described in ATK doc:\n
+ * Determines if the current child of this object is selected Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i index of child
+ *
+ * @returns a gboolean representing the specified child is selected, or 0 if
+ * selection does not implement this interface.
+ */
+static gboolean
+eail_genlist_is_child_selected(AtkSelection *selection,
+                               gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *selected_item = elm_genlist_selected_item_get(object);
+   Elm_Object_Item *last_item = elm_genlist_last_item_get(object);
+   Elm_Object_Item *item = elm_genlist_first_item_get(object);
+   gint n = 0;
+
+   /* of course if there is no selected object, that naturally means that none
+    * of children is selected */
+   if (!selected_item) return FALSE;
+
+   do
+     {
+        if (selected_item == item) break;
+
+        item = elm_genlist_item_next_get(item);
+        n++;
+     } while (item != last_item);
+
+   return i == n;
+}
+
+/**
+ * @brief Implementation of AtkSelection->remove_selection callback
+ *
+ * As described in ATK doc:\n
+ * Removes the specified child of the object from the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i index of child
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_genlist_remove_selection(AtkSelection *selection,
+                              gint i)
+{
+   Eina_List *items = NULL;
+   Evas_Object *object = NULL;
+   Elm_Object_Item *item = NULL;
+
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   g_return_val_if_fail(object, FALSE);
+
+   items = eail_genlist_get_items(EAIL_GENLIST(selection));
+   g_return_val_if_fail((eina_list_count(items) > i), FALSE);
+
+   item = eina_list_nth(items, i);
+   elm_genlist_item_selected_set(item, EINA_FALSE);
+
+   eina_list_free(items);
+
+   /* if change was successful, then selected item now should be different */
+   return (elm_genlist_selected_item_get(object) != item);
+}
+
+/**
+ * @brief Helper function that selects/unselects all items in the list depending
+ * on "selected" param value
+ *
+ * @param selection an AtkSelection
+ * @param selected selected state (TRUE means selected)
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_genlist_mark_all_selected_state(AtkSelection *selection,
+                                     Eina_Bool selected)
+{
+   Eina_List *items = NULL;
+   int i = 0;
+
+   items = eail_genlist_get_items(EAIL_GENLIST(selection));
+   for (i = 0; i < eina_list_count(items); ++i)
+     {
+        Elm_Object_Item *item = eina_list_nth(items, i);
+        if (!item) return FALSE;
+
+        elm_genlist_item_selected_set(item, selected);
+     }
+
+   eina_list_free(items);
+
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->select_all_selection callback
+ *
+ * As described in ATK doc:\n
+ * Causes every child of the object to be selected if the object supports
+ * multiple selections.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_genlist_select_all_selection(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+
+   /* can select all only when multiselect is enabled */
+   if (!elm_genlist_multi_select_get(object)) return FALSE;
+
+   return eail_genlist_mark_all_selected_state(selection, EINA_TRUE);
+}
+
+/**
+ * @brief Implementation of AtkSelection->clear_selection callback
+ *
+ * As described in ATK doc:\n
+ * Clears the selection in the object so that no children in the object are
+ * selected.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_genlist_clear_selection(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+
+   return eail_genlist_mark_all_selected_state(selection, EINA_FALSE);
+}
+
+/**
+ * @brief Initializer of AtkSelectionIface interface
+ *
+ * @param iface an AtkSelectionIface
+ */
+static void atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   iface->add_selection        = eail_genlist_add_selection;
+   iface->clear_selection      = eail_genlist_clear_selection;
+   iface->ref_selection        = eail_genlist_ref_selection;
+   iface->get_selection_count  = eail_genlist_get_selection_count;
+   iface->is_child_selected    = eail_genlist_is_child_selected;
+   iface->remove_selection     = eail_genlist_remove_selection;
+   iface->select_all_selection = eail_genlist_select_all_selection;
+}
diff --git a/eail/eail/eail_genlist.h b/eail/eail/eail_genlist.h
new file mode 100644 (file)
index 0000000..e8611a5
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_genlist.h
+ *
+ * @brief Header for EailGenlist implementation
+ */
+
+#ifndef EAIL_GENLIST_H
+#define EAIL_GENLIST_H
+
+#include "eail_scrollable_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailGenlist class
+ */
+#define EAIL_TYPE_GENLIST             (eail_genlist_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailGenlist
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_GENLIST(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                       EAIL_TYPE_GENLIST, EailGenlist))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailGenlist class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_GENLIST_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                       EAIL_TYPE_GENLIST, EailGenlistClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailGenlist class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_GENLIST(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                       EAIL_TYPE_GENLIST))
+/**
+ * @brief Tests whether given klass is a subclass of EailGenlist
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_GENLIST_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                       EAIL_TYPE_GENLIST))
+/**
+ * @brief Gets EailGenlist class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailGenlist class from
+ */
+#define EAIL_GENLIST_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                       EAIL_TYPE_GENLIST, EailGenlistClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailGenlist*/
+typedef struct _EailGenlist      EailGenlist;
+/** @brief Definition of class structure for Atk EailGenlist*/
+typedef struct _EailGenlistClass EailGenlistClass;
+
+/** @brief Definition of object structure for Atk EailGenlist*/
+struct _EailGenlist
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailScrollableWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailGenlist*/
+struct _EailGenlistClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailScrollableWidgetClass parent_class;
+};
+
+/** @brief Getter for EailGenlist GType
+ * @returns GType for EailGenlist implementation*/
+GType eail_genlist_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_glview.c b/eail/eail/eail_glview.c
new file mode 100644 (file)
index 0000000..308e99d
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_glview.c
+ * @brief EailGlview implementation
+ */
+
+#include <Elementary.h>
+#include "eail_glview.h"
+
+/**
+ * @brief EailGlview type definition
+ */
+G_DEFINE_TYPE(EailGlview, eail_glview, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief EailGlview initializer.
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_glview_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_glview_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_ANIMATION;
+}
+
+/**
+ * @brief EailGlview interface initializer.
+ *
+ * @param glview an EailGlview
+ * */
+static void
+eail_glview_init(EailGlview *glview)
+{
+}
+
+/**
+ * @brief EailGlview class initializer.
+ *
+ * @param klass EailGlview class
+ */
+static void
+eail_glview_class_init(EailGlviewClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   class->initialize = eail_glview_initialize;
+}
diff --git a/eail/eail/eail_glview.h b/eail/eail/eail_glview.h
new file mode 100644 (file)
index 0000000..865dc6a
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_glview.h
+ *
+ * @brief Header for EailGlview implementation
+ */
+
+#ifndef EAIL_GLVIEW_H
+#define EAIL_GLVIEW_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailGlview class
+ */
+
+#define EAIL_TYPE_GLVIEW            (eail_glview_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailGlview
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_GLVIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_GLVIEW, EailGlview))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailGlview class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_GLVIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_GLVIEW, EailGlviewClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailGlview class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_GLVIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_GLVIEW))
+/**
+ * @brief Tests whether given klass is a subclass of EailGlview
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_GLVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_GLVIEW))
+/**
+ * @brief Gets EailGlview class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailGlview class from
+ */
+#define EAIL_GLVIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_GLVIEW, EailGlviewClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailGlview*/
+typedef struct _EailGlview      EailGlview;
+/** @brief Definition of class structure for Atk EailGlview*/
+typedef struct _EailGlviewClass EailGlviewClass;
+
+/** @brief Definition of object structure for Atk EailGlview*/
+struct _EailGlview
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailGlview*/
+struct _EailGlviewClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailGlview GType
+ * @returns GType for EailGlview implementation*/
+GType eail_glview_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_grid.c b/eail/eail/eail_grid.c
new file mode 100644 (file)
index 0000000..59c6d5d
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_grid.c
+ * @brief Implementation of grid widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_grid.h"
+
+/**
+ * @brief Definition of EailGrid as GObject
+ *
+ * EailGrid is extended EAIL_TYPE_WIDGET
+ */
+G_DEFINE_TYPE(EailGrid, eail_grid, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief Implementation of eail_widget_get_widget_children callback from
+ * EailWidget
+ *
+ * @param widget an EailWidget
+ *
+ * @returns Eina_List filled with Evas_Object* objects contained in grid widget
+ */
+static Eina_List*
+eail_grid_children_get(EailWidget *widget)
+{
+   Evas_Object *obj;
+   Eina_List *list = NULL;
+
+   obj = eail_widget_get_widget(widget);
+   if (obj)
+     list = elm_grid_children_get(obj);
+
+   return list;
+}
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_grid_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_grid_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_FILLER;
+}
+
+/**
+ * @brief Initializer for GObject class
+ *
+ * @param grid an EailGrid
+ */
+static void
+eail_grid_init(EailGrid *grid)
+{
+}
+
+/**
+ * @brief Initializer for GObject grid class (defines callbacks for base
+ * AtkObject)
+ *
+ * @param klass an EailGridClass
+ */
+static void
+eail_grid_class_init(EailGridClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   widget_class->get_widget_children = eail_grid_children_get;
+
+   class->initialize = eail_grid_initialize;
+}
diff --git a/eail/eail/eail_grid.h b/eail/eail/eail_grid.h
new file mode 100644 (file)
index 0000000..27c1d77
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_GRID_H
+#define EAIL_GRID_H
+
+/**
+ * @file eail_grid.h
+ *
+ * @brief Header for EailGrid implementation
+ */
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailGrid class
+ */
+#define EAIL_TYPE_GRID              (eail_grid_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailGrid
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_GRID(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_GRID, EailGrid))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailGrid class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_GRID_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_GRID, EailGridClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailGrid class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_GRID(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_GRID))
+/**
+ * @brief Tests whether given klass is a subclass of EailGrid
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_GRID_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_GRID))
+/**
+ * @brief Gets EailGrid class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailGrid class from
+ */
+#define EAIL_GRID_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_GRID, EailGridClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailGrid*/
+typedef struct _EailGrid      EailGrid;
+/** @brief Definition of class structure for Atk EailGrid*/
+typedef struct _EailGridClass EailGridClass;
+
+/** @brief Definition of object structure for Atk EailGrid*/
+struct _EailGrid
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailGrid*/
+struct _EailGridClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailGrid GType
+ * @returns GType for EailGrid implementation*/
+GType eail_grid_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_hover.c b/eail/eail/eail_hover.c
new file mode 100644 (file)
index 0000000..faeb91d
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_hover.c
+ * @brief EailHover implementation.
+ */
+
+#include <Elementary.h>
+
+#include "eail_hover.h"
+#include "eail_factory.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/**
+ * @brief EailHover type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailHover,
+                        eail_hover,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/**
+ * @brief EailHover initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_hover_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_hover_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_GLASS_PANE;
+}
+
+/**
+ * @brief EailHover finalizer.
+ *
+ * Destroys object and allocated resources.
+ *
+ * @param obj a GObject
+ */
+static void
+eail_hover_finalize(GObject *obj)
+{
+    EailHover *hover = EAIL_HOVER(obj);
+
+    if (hover->click_description) free(hover->click_description);
+
+    G_OBJECT_CLASS(eail_hover_parent_class)->finalize(obj);
+}
+
+/**
+ * @brief EailHover instance initializer
+ *
+ * @param hover an EailHover
+ */
+static void
+eail_hover_init(EailHover *hover)
+{
+   hover->click_description = NULL;
+}
+
+/**
+ * @brief EailHover class initializer.
+ *
+ * @param klass an EailHoverClass
+ */
+static void
+eail_hover_class_init(EailHoverClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_hover_initialize;
+
+   gobject_class->finalize = eail_hover_finalize;
+}
+
+/**
+ * @brief Performs i-th action.
+ *
+ * @param action an AtkAction
+ * @param i the action index corresponding to the action to be performed
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_hover_action_do_action(AtkAction *action,
+                            gint i)
+{
+   Evas_Object *widget = NULL;
+   const char *action_name = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   action_name = atk_action_get_name(action, i);
+   if (!action_name) return FALSE;
+
+   evas_object_smart_callback_call(widget, "clicked", NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets number of actions available on the object.
+ *
+ * @param action an AtkAction
+ * @return actions number
+ */
+static gint
+eail_hover_action_get_n_actions(AtkAction *action)
+{
+   return 1;
+}
+
+/**
+ * @brief Gets i-th action description.
+ *
+ * @param action an AtkAction
+ * @param i action number
+ * @return action description string
+ */
+static const gchar *
+eail_hover_action_get_description(AtkAction *action,
+                                  gint i)
+{
+   const char *action_description = NULL;
+   EailHover *hover;
+
+   hover = EAIL_HOVER(action);
+   if (!hover) return NULL;
+
+   switch (i)
+     {
+      case 0:
+         action_description = hover->click_description;
+         break;
+
+      default:
+         action_description = NULL;
+         break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Gets i-th action name.
+ *
+ * @param action an AtkAction
+ * @param i action number
+ * @return action description string
+ */
+static const gchar *
+eail_hover_action_get_name(AtkAction *action,
+                           gint i)
+{
+   const char* action_name = NULL;
+
+   switch (i)
+     {
+      case 0:
+         action_name = "click";
+         break;
+
+      default:
+         action_name = NULL;
+         break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Sets i-th action description.
+ *
+ * @param action an AtkAction
+ * @param i action number
+ * @param desc action description
+ * @return TRUE if description is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_hover_action_set_description(AtkAction *action,
+                                  gint i,
+                                  const gchar *desc)
+{
+   EailHover *hover = NULL;
+   char **value = NULL;
+
+   hover = EAIL_HOVER(action);
+   if (!hover) return FALSE;
+
+   switch (i)
+     {
+      case 0:
+         value = &hover->click_description;
+         break;
+
+      default:
+         value = NULL;
+         break;
+     }
+
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(desc);
+
+        return TRUE;
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief AtkAction interface initializer
+ *
+ * @param iface an AtkActionIface
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->do_action          = eail_hover_action_do_action;
+   iface->get_n_actions      = eail_hover_action_get_n_actions;
+   iface->get_description    = eail_hover_action_get_description;
+   iface->get_name           = eail_hover_action_get_name;
+   iface->set_description    = eail_hover_action_set_description;
+}
diff --git a/eail/eail/eail_hover.h b/eail/eail/eail_hover.h
new file mode 100644 (file)
index 0000000..649d0d3
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_hover.h
+ *
+ * @brief Header for EailHoverimplementation
+ */
+
+#ifndef EAIL_HOVER_H
+#define EAIL_HOVER_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailHover class
+ */
+#define EAIL_TYPE_HOVER            (eail_hover_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailHover
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_HOVER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                    EAIL_TYPE_HOVER, EailHover))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailHover class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_HOVER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                    EAIL_TYPE_HOVER, EailHoverClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailHover class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_HOVER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                    EAIL_TYPE_HOVER))
+/**
+ * @brief Tests whether given klass is a subclass of EailHover
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_HOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                    EAIL_TYPE_HOVER))
+/**
+ * @brief Gets EailHover class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailHover class from
+ */
+#define EAIL_HOVER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                    EAIL_TYPE_HOVER, EailHoverClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailHover*/
+typedef struct _EailHover      EailHover;
+/** @brief Definition of class structure for Atk EailHover*/
+typedef struct _EailHoverClass EailHoverClass;
+
+/** @brief Definition of object structure for Atk EailHover*/
+struct _EailHover
+{
+   EailWidget parent;/**< @brief widget that functionality is being extended*/
+
+   char *click_description;/**< @brief 'click' action description string */
+};
+
+/** @brief Definition of class structure for Atk EailHover*/
+struct _EailHoverClass
+{
+   EailWidgetClass parent_class;/**< @brief class that is being extended*/
+};
+
+/**
+ * @brief Getter for EailHover GType
+ * @returns GType for EailHover implementation
+ */
+GType eail_hover_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_hoversel.c b/eail/eail/eail_hoversel.c
new file mode 100644 (file)
index 0000000..3c865c2
--- /dev/null
@@ -0,0 +1,484 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_hoversel.c
+ * @brief EailHoversel implementation.
+ */
+
+#include <Elementary.h>
+
+#include "eail_hoversel.h"
+#include "eail_factory.h"
+#include "eail_item_parent.h"
+#include "eail_priv.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+
+/**
+ * @brief EailHoversel type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailHoversel,
+                        eail_hoversel,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/* AtkObject */
+static AtkStateSet *eail_hoversel_ref_state_set(AtkObject *obj);
+static gint eail_hoversel_get_n_children(AtkObject *obj);
+static AtkObject *eail_hoversel_ref_child(AtkObject *obj,
+                                          gint i);
+static void eail_hoversel_initialize(AtkObject *obj,
+                                     gpointer data);
+static void eail_hoversel_finalize(GObject *obj);
+
+/* AtkAction */
+static const char *eail_hoversel_description_get(AtkAction *action,
+                                                 gint i);
+static gboolean eail_hoversel_description_set(AtkAction *action,
+                                              gint i,
+                                              const char *description);
+static const char *eail_hoversel_action_name_get(AtkAction *action,
+                                                 int i);
+static int eail_hoversel_n_actions_get(AtkAction *action);
+static gboolean eail_hoversel_do_action(AtkAction *action,
+                                        int i);
+
+/* EailItemParent */
+
+/* Helper functions */
+static const Eina_List *eail_hoversel_items_get(EailHoversel *obj);
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief EailHoverser initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_hoversel_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_hoversel_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_GLASS_PANE;
+}
+
+/**
+ * @brief EailHoversel finalizer.
+ *
+ * Destroys object and allocated resources.
+ *
+ * @param obj object that needs to be finalized
+ */
+static void
+eail_hoversel_finalize(GObject *obj)
+{
+    EailHoversel *hoversel = EAIL_HOVERSEL(obj);
+
+    if (hoversel->shrink_description) free(hoversel->shrink_description);
+    if (hoversel->expand_description) free(hoversel->expand_description);
+
+    G_OBJECT_CLASS(eail_hoversel_parent_class)->finalize(obj);
+}
+
+/**
+ * @brief EailHoversel instance initializer.
+ *
+ * @param hoversel EailHoversel instance
+ */
+static void
+eail_hoversel_init(EailHoversel *hoversel)
+{
+   hoversel->shrink_description = NULL;
+   hoversel->expand_description = NULL;
+}
+
+/**
+ * @brief Gets state set of the accessible.
+ *
+ * The caller must unreference it when it is no longer needed.
+ *
+ * @param accessible EailHoversel instance
+ * @return EailHoversel state set
+ */
+static AtkStateSet*
+eail_hoversel_ref_state_set(AtkObject *accessible)
+{
+   AtkStateSet *state_set = NULL;
+   Evas_Object *widget = NULL;
+
+   state_set =
+       ATK_OBJECT_CLASS(eail_hoversel_parent_class)->ref_state_set(accessible);
+   if (!state_set)
+     {
+        printf("NULL STATE SET");
+     }
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(accessible));
+   if (!widget)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_DEFUNCT);
+        return state_set;
+     }
+
+   if (elm_hoversel_expanded_get(widget))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_EXPANDED);
+
+        if (elm_hoversel_horizontal_get(widget))
+          atk_state_set_add_state(state_set, ATK_STATE_HORIZONTAL);
+        else
+          atk_state_set_add_state(state_set, ATK_STATE_VERTICAL);
+     }
+   else
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_DEFAULT);
+     }
+
+   return state_set;
+}
+
+/**
+ * @brief Gets number of obj children
+ *
+ * @param obj an AtkObject
+ * @return obj children number
+ */
+static gint
+eail_hoversel_get_n_children(AtkObject *obj)
+{
+   const Eina_List *list;
+
+   g_return_val_if_fail(EAIL_IS_HOVERSEL(obj), 0);
+
+   list = eail_hoversel_items_get(EAIL_HOVERSEL(obj));
+
+   return eina_list_count(list);
+}
+
+/**
+ * @brief Gets reference to i-th child
+ *
+ * The caller must unreference it when it is no longer needed
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ * @return child reference
+ */
+static AtkObject *
+eail_hoversel_ref_child(AtkObject *obj,
+                            gint i)
+{
+   const Eina_List *items;
+   AtkObject *child = NULL;
+
+   g_return_val_if_fail(EAIL_IS_HOVERSEL(obj), NULL);
+
+   items = eail_hoversel_items_get(EAIL_HOVERSEL(obj));
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                          (eina_list_nth(items, i), ATK_ROLE_LABEL, obj);
+
+        g_object_ref(child);
+     }
+   else
+     ERR("Tried to ref child with index %d out of bounds!", i);
+
+   return child;
+}
+
+/**
+ * @brief EailHoversel class initializer.
+ *
+ * @param klass EailHoversel class
+ */
+static void
+eail_hoversel_class_init(EailHoverselClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_hoversel_initialize;
+   class->ref_state_set = eail_hoversel_ref_state_set;
+   class->get_n_children = eail_hoversel_get_n_children;
+   class->ref_child = eail_hoversel_ref_child;
+
+   object_class->finalize = eail_hoversel_finalize;
+}
+
+/*
+ * Implementation of the *AtkAction* interface
+ */
+
+/**
+ * @brief AtkAction interface initializer.
+ *
+ * @param iface EailHoversel object
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->do_action          = eail_hoversel_do_action;
+   iface->get_n_actions      = eail_hoversel_n_actions_get;
+   iface->get_description    = eail_hoversel_description_get;
+   iface->get_name           = eail_hoversel_action_name_get;
+   iface->set_description    = eail_hoversel_description_set;
+}
+
+/**
+ * @brief Gets i-th action description.
+ *
+ * @param action EailHoversel instance
+ * @param i action index
+ * @return action description
+ */
+static const char*
+eail_hoversel_description_get(AtkAction *action,
+                              gint i)
+{
+   EailHoversel *hoversel;
+   const char *action_description;
+
+   hoversel = EAIL_HOVERSEL(action);
+   if (!hoversel) return NULL;
+
+   switch (i)
+     {
+       case 0:
+           action_description = hoversel->shrink_description;
+           break;
+       case 1:
+           action_description = hoversel->expand_description;
+           break;
+       default:
+           action_description = NULL;
+           break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Sets i-th action description.
+ *
+ * @param action an AtkAction
+ * @param i the action index corresponding to the action to be performed
+ * @param description action desciption
+ * @return TRUE if description was set successfully, FALSE otherwise
+ */
+static gboolean
+eail_hoversel_description_set(AtkAction *action,
+                              gint i,
+                              const char *description)
+{
+   EailHoversel *hoversel;
+   char **value;
+
+   hoversel = EAIL_HOVERSEL(action);
+   if (!hoversel) return FALSE;
+
+   switch (i)
+     {
+       case 0:
+           value = &hoversel->shrink_description;
+           break;
+       case 1:
+           value = &hoversel->expand_description;
+           break;
+       default:
+           value = NULL;
+           break;
+     }
+
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(description);
+        return TRUE;
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief Gets i-th action name.
+ *
+ * @param action an AtkAction
+ * @param i the action index corresponding to the action to be performed
+ * @return action description string
+ */
+static const char*
+eail_hoversel_action_name_get(AtkAction *action,
+                              int i)
+{
+   const char* action_name;
+
+   switch (i)
+     {
+       case 0:
+           action_name = "shrink";
+           break;
+       case 1:
+           action_name = "expand";
+           break;
+       default:
+           action_name = NULL;
+           break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Gets number of actions available on the object.
+ *
+ * @param action AtkAction instance
+ * @return number of implemented actions
+ */
+static int
+eail_hoversel_n_actions_get(AtkAction *action)
+{
+   return 2;
+}
+
+/**
+ * @brief Performs i-th action.
+ *
+ * @param action an AtkAction instance
+ * @param i action index
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_hoversel_do_action(AtkAction *action,
+                        int i)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   const char *action_name = atk_action_get_name(action, i);
+   if (!action_name) return FALSE;
+
+   if (!g_strcmp0(action_name, "expand"))
+     {
+        if (elm_hoversel_expanded_get(widget))
+          return FALSE;
+
+        elm_hoversel_hover_begin(widget);
+        atk_object_notify_state_change(ATK_OBJECT(action), ATK_STATE_EXPANDED, TRUE);
+     }
+   else if (!g_strcmp0(action_name, "shrink"))
+     {
+        if (!elm_hoversel_expanded_get(widget))
+          return FALSE;
+
+        elm_hoversel_hover_end(widget);
+        atk_object_notify_state_change(ATK_OBJECT(action), ATK_STATE_EXPANDED, FALSE);
+     }
+
+   return TRUE;
+}
+
+/*
+ * Implementation of the *EailItemParent* interface
+ */
+
+/**
+ * @brief Gets name of hoversel child
+ *
+ * @param parent instance
+ * @param item child instance
+ *
+ * @returns const gchar * representing name of the child
+ */
+static const gchar *
+eail_hoversel_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief Implementation of EailItemParent->is_content_get_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns FALSE as there is no content support
+ */
+gboolean
+eail_hoversel_content_get_support(EailItemParent   *parent,
+                                  EailItem         *item)
+{
+   return FALSE;
+}
+
+/**
+ * @brief EailItemParent interface initializer
+ *
+ * @param iface an EailItemParentIface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_item_name = eail_hoversel_item_name_get;
+   iface->is_content_get_supported = eail_hoversel_content_get_support;
+}
+
+/*
+ * Helper functions
+ */
+
+/**
+ * @brief Gets obj items list.
+ *
+ * @param obj an EailHoversel
+ * @return list with obj items
+ */
+static const Eina_List *
+eail_hoversel_items_get(EailHoversel *obj)
+{
+   Evas_Object *widget;
+   const Eina_List *items = NULL;
+
+   g_return_val_if_fail(EAIL_HOVERSEL(obj), NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   items = elm_hoversel_items_get(widget);
+   if (!items) return NULL;
+
+   return items;
+}
diff --git a/eail/eail/eail_hoversel.h b/eail/eail/eail_hoversel.h
new file mode 100644 (file)
index 0000000..35aa369
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_hoversel.h
+ *
+ * @brief Header for EailHoversel implementation
+ */
+
+#ifndef EAIL_HOVERSEL_H
+#define EAIL_HOVERSEL_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailHoversel class
+ */
+#define EAIL_TYPE_HOVERSEL            (eail_hoversel_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailHoversel
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_HOVERSEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                       EAIL_TYPE_HOVERSEL, EailHoversel))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailHoversel class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_HOVERSEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                       EAIL_TYPE_HOVERSEL, EailHoverselClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailHoversel class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_HOVERSEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                       EAIL_TYPE_HOVERSEL))
+/**
+ * @brief Tests whether given klass is a subclass of EailHoversel
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_HOVERSEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                       EAIL_TYPE_HOVERSEL))
+/**
+ * @brief Gets EailHoversel class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailHoversel class from
+ */
+#define EAIL_HOVERSEL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                       EAIL_TYPE_HOVERSEL, EailHoverselClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailHoversel*/
+typedef struct _EailHoversel      EailHoversel;
+/** @brief Definition of class structure for Atk EailHoversel*/
+typedef struct _EailHoverselClass EailHoverselClass;
+
+/** @brief Definition of object structure for Atk EailHoversel*/
+struct _EailHoversel
+{
+   EailWidget parent;/**< @brief widget that functionality is being extended*/
+
+   char *shrink_description;/**< @brief 'shrink' action description string */
+   char *expand_description;/**< @brief 'expand' action description string */
+};
+
+/** @brief Definition of class structure for Atk EailHoversel*/
+struct _EailHoverselClass
+{
+   EailWidgetClass parent_class;/**< @brief class that is being extended*/
+};
+
+/**
+ * @brief Getter for EailHoversel GType
+ * @returns GType for EailHoversel implementation
+ */
+GType eail_hoversel_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_icon.c b/eail/eail/eail_icon.c
new file mode 100644 (file)
index 0000000..a9053e1
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_icon.c
+ * @brief EailIcon implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_icon.h"
+
+/**
+ * @brief EailIcon type definition
+ */
+G_DEFINE_TYPE(EailIcon, eail_icon, EAIL_TYPE_IMAGE);
+
+/**
+ * @brief EailIcon initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_icon_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_icon_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_ICON;
+}
+
+/**
+ * @brief Gets obj name
+ *
+ * Returns obj name or obj icon file path if obj has no assigned name
+ * or null if none of the previous applies
+ *
+ * @param obj an AtkObject
+ * @returns obj name or obj icon file path
+ */
+static const gchar*
+eail_icon_get_name(AtkObject *obj)
+{
+   const gchar *name;
+   Evas_Object *widget = NULL;
+
+   name = ATK_OBJECT_CLASS(eail_icon_parent_class)->get_name(obj);
+   if (name != NULL) return name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (widget)
+     {
+        name = (const gchar*)elm_icon_standard_get(widget);
+        if (!name) elm_image_file_get(widget, &name, NULL);
+     }
+
+   return name;
+}
+
+/**
+ * @brief EailIcon instance initializer
+ *
+ * @param icon an EailIcon
+ */
+static void
+eail_icon_init(EailIcon *icon)
+{
+}
+
+/**
+ * @brief EailItem class initializer
+ * @param klass an EailIcon class
+ */
+static void
+eail_icon_class_init(EailIconClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_icon_initialize;
+   class->get_name = eail_icon_get_name;
+}
diff --git a/eail/eail/eail_icon.h b/eail/eail/eail_icon.h
new file mode 100644 (file)
index 0000000..60f2f7e
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_icon.h
+ *
+ * @brief Header for EailIcon implementation
+ */
+
+#ifndef EAIL_ICON_H
+#define EAIL_ICON_H
+
+#include "eail_image.h"
+/**
+ * @brief Returns a value corresponding to the type of EailIcon class
+ */
+#define EAIL_TYPE_ICON             (eail_icon_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailIcon
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_ICON(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                    EAIL_TYPE_ICON, EailIcon))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailIcon class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_ICON_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                    EAIL_TYPE_ICON, EailIconClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailIcon class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_ICON(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                    EAIL_TYPE_ICON))
+/**
+ * @brief Tests whether given klass is a subclass of EailIcon
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_ICON_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                    EAIL_TYPE_ICON))
+/**
+ * @brief Gets EailIcon class structure from an obj (class instance)
+ *
+ * @brief Header for EailIcon implementation
+ */
+#define EAIL_ICON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                    EAIL_TYPE_ICON, EailIconClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailIcon*/
+typedef struct _EailIcon      EailIcon;
+/** @brief Definition of class structure for Atk EailIcon*/
+typedef struct _EailIconClass EailIconClass;
+
+/** @brief Definition of object structure for Atk EailIcon*/
+struct _EailIcon
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailImage parent;
+};
+
+/** @brief Definition of class structure for Atk EailIcon*/
+struct _EailIconClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailImageClass parent_class;
+};
+
+/** @brief Getter for EailIcon GType
+ * @returns GType for EailIcon implementation*/
+GType eail_icon_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_image.c b/eail/eail/eail_image.c
new file mode 100644 (file)
index 0000000..ddb1836
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_image.c
+ * @brief EailImage implementation
+ */
+
+#include <Elementary.h>
+#include "eail_image.h"
+
+/**
+ * @brief click action name
+ */
+#define EAIL_IMAGE_ACTION_CLICK "click"
+
+static void atk_image_interface_init(AtkImageIface *iface);
+
+/**
+ * @brief EailImage type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailImage,
+                        eail_image,
+                        EAIL_TYPE_ACTION_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              atk_image_interface_init));
+
+/**
+ * @brief Callback for "click" action on elm_image object
+ *
+ * @param action EailImage instance
+ * @param data user data passed to callback
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_image_action_click(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_IMAGE(action), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+    evas_object_smart_callback_call(widget, "clicked", NULL);
+
+    return TRUE;
+}
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ *
+ * @brief Initialize EailImage instance
+ *
+ * @param obj EailImage instance
+ * @param data user data passed to initialization
+ */
+static void
+eail_image_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_image_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_IMAGE;
+
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_IMAGE_ACTION_CLICK,
+                                    NULL,
+                                    _eail_image_action_click);
+}
+
+/**
+ * @brief Finalize EailImage instance
+ *
+ * @param object EailImage instance
+ */
+static void
+eail_image_finalize(GObject *object)
+{
+   EailImage *obj;
+
+   obj = EAIL_IMAGE(object);
+   if (obj->description) free(obj->description);
+
+   G_OBJECT_CLASS(eail_image_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Init EailImage instance
+ *
+ * @param image EalImage instance
+ */
+static void
+eail_image_init(EailImage *image)
+{
+   image->description = NULL;
+}
+
+/**
+ * @brief Implementation on ref_state_set from AtkObject
+ *
+ * @param obj EailImage instance
+ *
+ * @returns referred state set object
+ */
+static AtkStateSet *
+eail_image_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   Eina_Bool resizable_up, resizable_down;
+
+   if (!widget)
+     {
+        return NULL;
+     }
+
+   state_set = ATK_OBJECT_CLASS(eail_image_parent_class)->ref_state_set(obj);
+   if (!evas_object_smart_type_check(widget, "elm_image"))
+     return state_set;
+
+   if (elm_image_animated_get(widget))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_ANIMATED);
+     }
+
+   elm_image_resizable_get(widget, &resizable_up, &resizable_down);
+   if ((resizable_up) || (resizable_down))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_RESIZABLE);
+     }
+
+   return state_set;
+}
+
+/**
+ * @brief EailImage class initialization
+ *
+ * @param klass EailImageClass object
+ */
+static void
+eail_image_class_init(EailImageClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_image_initialize;
+   class->ref_state_set = eail_image_ref_state_set;
+
+   g_object_class->finalize = eail_image_finalize;
+}
+
+/*
+ * Implementation of the *AtkImage* interface
+ */
+
+/**
+ * @brief Implementation of get_image_postition from AtkImage interface
+ *
+ * @param image EailImage instance
+ * @param x address of int to store x coordinate
+ * @param y address of int to store y coordinate
+ * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window
+ */
+static void
+eail_image_position_get(AtkImage *image,
+                        gint *x,
+                        gint *y,
+                        AtkCoordType coord_type)
+{
+   atk_component_get_position(ATK_COMPONENT(image), x, y, coord_type);
+}
+
+/**
+ * @brief Implementation of get_image_size from AtkImage interface
+ *
+ * @param image EailImage instance
+ * @param width address of int to store width
+ * @param height address of int to store height
+ */
+static void
+eail_image_size_get(AtkImage *image, gint *width, gint *height)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     {
+        *width = -1;
+        *height = -1;
+        return;
+     }
+
+   elm_image_object_size_get(widget, width, height);
+}
+
+/**
+ * @brief Implementation of get_image_description from AtkImage interface
+ *
+ * @param image EailImage instance
+ *
+ * @returns image description
+ */
+static const gchar *
+eail_image_description_get(AtkImage *image)
+{
+   EailImage *obj = EAIL_IMAGE(image);
+   return obj->description;
+}
+
+/**
+ * @brief Implementation of set_image_description from AtkImage interface
+ *
+ * @param image EailImage instance
+ * @param description image description to set
+ *
+ * @returns TRUE on success
+ */
+static gboolean
+eail_image_description_set(AtkImage *image, const gchar *description)
+{
+   EailImage *obj = EAIL_IMAGE(image);
+
+   if (obj->description)
+     free(obj->description);
+
+   obj->description = strdup(description);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets image locale (LC_MESSAGES variable)
+ *
+ * @param image an AtkImage
+ * @return NULL if LC_MESSAGES not set, locale string otherwise
+ */
+const gchar *
+eail_image_get_image_locale(AtkImage *image)
+{
+    return setlocale(LC_MESSAGES, NULL);
+}
+
+/**
+ * @brief Initialize AtkImage interface
+ *
+ * @param iface EailImage object
+ */
+static void
+atk_image_interface_init(AtkImageIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_image_position    = eail_image_position_get;
+   iface->get_image_size        = eail_image_size_get;
+   iface->get_image_description = eail_image_description_get;
+   iface->set_image_description = eail_image_description_set;
+   iface->get_image_locale      = eail_image_get_image_locale;
+}
diff --git a/eail/eail/eail_image.h b/eail/eail/eail_image.h
new file mode 100644 (file)
index 0000000..eed6971
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_image.h
+ *
+ * @brief Header for EailImage implementation
+ */
+
+#ifndef EAIL_IMAGE_H
+#define EAIL_IMAGE_H
+
+#include "eail_action_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailImage class
+ */
+#define EAIL_TYPE_IMAGE             (eail_image_get_type ())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailImage
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IMAGE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                     EAIL_TYPE_IMAGE, EailImage))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailImage class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_IMAGE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                     EAIL_TYPE_IMAGE, EailImageClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailImage class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_IMAGE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                     EAIL_TYPE_IMAGE))
+/**
+ * @brief Tests whether given klass is a subclass of EailImage
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_IMAGE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                     EAIL_TYPE_IMAGE))
+/**
+ * @brief Gets EailImage class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailImage class from
+ */
+#define EAIL_IMAGE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                     EAIL_TYPE_IMAGE, EailImageClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailImage*/
+typedef struct _EailImage       EailImage;
+/** @brief Definition of class structure for Atk EailImage*/
+typedef struct _EailImageClass  EailImageClass;
+
+/** @brief Definition of object structure for Atk EailImage*/
+struct _EailImage
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailActionWidget parent;
+
+   char *description; /*!< @brief image description*/
+};
+
+/** @brief Definition of class structure for Atk EailImage*/
+struct _EailImageClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailActionWidgetClass parent_class;
+};
+
+/** @brief Getter for EailImage GType
+ * @returns GType for EailImage implementation*/
+GType eail_image_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_index.c b/eail/eail/eail_index.c
new file mode 100644 (file)
index 0000000..8d2e225
--- /dev/null
@@ -0,0 +1,415 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_index.c
+ * @brief Implementation of Index widget
+ */
+
+/* enabling beta API support for Eo parts*/
+#define EFL_BETA_API_SUPPORT
+
+#include <Elementary.h>
+
+#include "eail_index.h"
+#include "eail_factory.h"
+#include "eail_item_parent.h"
+#include "eail_utils.h"
+/* internal elm_widget api for listening internal index parts */
+#define ELM_INTERNAL_API_ARGESFSDFEFC
+#include <elm_widget.h>
+#include <elm_widget_index.h>
+
+#ifndef ELM_OBJ_INDEX_CLASS
+#ifndef ELM_INDEX_CLASS
+#include <elm_index_eo.h>
+#endif
+#endif
+
+#include "eail_priv.h"
+
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+
+/**
+ * @brief EailIndex GObject definition
+ *
+ * It extends EAIL_TYPE_WIDGET class and implements EAIL_TYPE_ITEM_PARENT and
+ * ATK_TYPE_SELECTION interfaces
+ */
+G_DEFINE_TYPE_WITH_CODE(EailIndex,
+                        eail_index,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                              atk_selection_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief Initializer for AtkObject
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_index_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_index_parent_class) ->initialize(obj, data);
+   obj->role = ATK_ROLE_LIST;
+}
+
+/**
+ * @brief EailIndex GObject instance initializer
+ *
+ * @param button an EailIndex
+ */
+static void
+eail_index_init(EailIndex *button)
+{
+}
+
+/**
+ * @brief Gets list of Elm_Object_Item* that is contained in index widget
+ *
+ * @param obj and EailIndex AtkObject
+ *
+ * @returns const Eina_List * with Elm_Object_Item* for every index
+ */
+static const Eina_List *
+eail_index_get_index_items(AtkObject *obj) {
+   Evas_Object *index_widget = NULL;
+
+   index_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   g_return_val_if_fail(index_widget, NULL);
+
+   ELM_INDEX_DATA_GET(index_widget, index_sd);
+   g_return_val_if_fail(index_sd, NULL);
+
+   return index_sd->items;
+}
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_index_get_n_children(AtkObject *obj)
+{
+   return eina_list_count(eail_index_get_index_items(obj));
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i index of a child
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_index_ref_child(AtkObject *obj, gint i)
+{
+   const Eina_List *items;
+   AtkObject *child = NULL;
+
+   items = eail_index_get_index_items(obj);
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                          (eina_list_nth(items, i), ATK_ROLE_LIST_ITEM, obj);
+
+        g_object_ref(child);
+     }
+
+   return child;
+}
+
+/**
+ * @brief Gets name of EailIndex
+ *
+ * Implementation of AtkObject->get_name callback
+ *
+ * ATK doc says:
+ * Gets the accessible name of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns a character string representing the accessible description of
+ * the accessible.
+ */
+static const gchar *
+eail_index_get_name(AtkObject *obj)
+{
+   Evas_Object *widget;
+   const char *atk_name;
+
+   g_return_val_if_fail(EAIL_IS_INDEX(obj), NULL);
+
+   atk_name = ATK_OBJECT_CLASS(eail_index_parent_class)->get_name(obj);
+   if (atk_name)
+     return atk_name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   return elm_object_text_get(widget);
+}
+
+/**
+ * @brief Destructor of EailIndex object
+ * @param object GObject object to be finalized
+ */
+static void
+eail_index_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_index_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for EailIndex GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailIndex class
+ */
+static void
+eail_index_class_init(EailIndexClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_index_initialize;
+   class->get_n_children = eail_index_get_n_children;
+   class->ref_child = eail_index_ref_child;
+   class->get_name = eail_index_get_name;
+   gobject_class->finalize = eail_index_finalize;
+}
+
+/**
+ * @brief Implementation of EailItemParent->is_content_get_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns FALSE
+ */
+gboolean
+eail_index_content_get_support(EailItemParent   *parent,
+                               EailItem         *item)
+{
+   return FALSE;
+}
+
+/**
+ * @brief Gets item's name
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @return item's name
+ */
+const gchar *
+eail_index_get_item_name(EailItemParent   *parent,
+                         EailItem         *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   return elm_index_item_letter_get(it);
+}
+
+/**
+ * @brief Initialization of EailItemParentIface callbacks
+ *
+ * @param iface an EailItemParentIface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_item_name = eail_index_get_item_name;
+   iface->is_content_get_supported = eail_index_content_get_support;
+}
+
+/**
+ * @brief Implementation of AtkSelection->add_selection callback
+ *
+ * As described in ATK doc:\n
+ * Adds the specified accessible child of the object to the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns TRUE if operation ended successfully, FALSE otherwise
+ */
+static gboolean
+eail_index_add_selection(AtkSelection *selection,
+                         gint i)
+{
+   const Eina_List *items = eail_index_get_index_items(ATK_OBJECT(selection));
+   if (!items) return FALSE;
+   Elm_Object_Item *item = eina_list_nth(items, i);
+
+   if (!item) return FALSE;
+
+   elm_index_item_selected_set(item, EINA_TRUE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->ref_selection callback
+ *
+ * As described in ATK doc:\n
+ * Gets a reference to the accessible object representing the specified selected
+ * child of the object. Note: callers should not rely on NULL or on a zero value
+ * for indication of whether AtkSelectionIface is implemented, they should use
+ * type checking/interface checking macros or the atk_get_accessible_value()
+ * convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns an AtkObject representing the selected accessible , or NULL if
+ * selection does not implement this interface
+ */
+static AtkObject *
+eail_index_ref_selection(AtkSelection *selection,
+                         gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), NULL);
+
+   return eail_index_ref_child(ATK_OBJECT(selection), i);
+}
+
+/**
+ * @brief Implementation of AtkSelection->clear_selection callback
+ *
+ * As described in ATK doc:\n
+ * Clears the selection in the object so that no children in the object are
+ * selected.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_index_clear_selection(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   g_return_val_if_fail(object, FALSE);
+
+   Elm_Object_Item *selected_item = elm_index_selected_item_get(object, 0);
+
+   /* no selected item found so selection is already clear, doing nothing and
+    * returning TRUE to mark success*/
+   if (!selected_item) return TRUE;
+
+   elm_index_item_selected_set(selected_item, EINA_FALSE);
+
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->get_selection_count callback
+ *
+ * As described in ATK doc:\n
+ * Gets the number of accessible children currently selected. Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+
+ * @param selection an AtkSelection
+ *
+ * @returns gint representing number of selected elements
+ */
+static gint
+eail_index_get_selection_count(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+
+   if (elm_index_selected_item_get(object, 0))
+     return 1;
+   else
+     return 0;
+}
+
+/**
+ * @brief Implementation of AtkSelection->is_child_selected callback
+ *
+ * As described in ATK doc:\n
+ * Determines if the current child of this object is selected Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns a gboolean representing if the specified child is selected, or
+ * FALSE if selection does not implement this interface.
+ */
+static gboolean
+eail_index_is_child_selected(AtkSelection *selection,
+                             gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *selected_item = elm_index_selected_item_get(object, 0);
+   const Eina_List *items = eail_index_get_index_items(ATK_OBJECT(selection));
+   Elm_Object_Item *item_witn_n_index = NULL;
+
+   /* if no item is selected, then we are sure that none of the child is
+    * selected*/
+   if (!selected_item) return FALSE;
+
+   /* no items on list so no child is selected*/
+   if (!items) return FALSE;
+
+   item_witn_n_index =  eina_list_nth(items, i);
+
+   if (item_witn_n_index == selected_item)
+     return TRUE;
+   else
+     return FALSE;
+}
+
+/**
+ * @brief Initializer of AtkSelectionIface interface
+ *
+ * @param iface an AtkSelectionIface
+ */
+static void atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   iface->add_selection        = eail_index_add_selection;
+   iface->clear_selection      = eail_index_clear_selection;
+   iface->ref_selection        = eail_index_ref_selection;
+   iface->get_selection_count  = eail_index_get_selection_count;
+   iface->is_child_selected    = eail_index_is_child_selected;
+}
diff --git a/eail/eail/eail_index.h b/eail/eail/eail_index.h
new file mode 100644 (file)
index 0000000..e056e52
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_index.h
+ *
+ * @brief Header for EailIndex implementation
+ */
+
+#ifndef EAIL_INDEX_H
+#define EAIL_INDEX_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailIndex class
+ */
+#define EAIL_TYPE_INDEX              (eail_index_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailIndex
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_INDEX(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                      EAIL_TYPE_INDEX, EailIndex))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailIndex class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_INDEX_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                      EAIL_TYPE_INDEX, EailIndexClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailIndex class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_INDEX(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                      EAIL_TYPE_INDEX))
+/**
+ * @brief Tests whether given klass is a subclass of EailIndex
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_INDEX_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                      EAIL_TYPE_INDEX))
+/**
+ * @brief Gets EailIndex class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailIndex class from
+ */
+#define EAIL_INDEX_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                      EAIL_TYPE_INDEX, EailIndexClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailIndex*/
+typedef struct _EailIndex      EailIndex;
+/** @brief Definition of class structure for Atk EailIndex*/
+typedef struct _EailIndexClass EailIndexClass;
+
+/** @brief Definition of object structure for Atk EailIndex*/
+struct _EailIndex
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailIndex*/
+struct _EailIndexClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailIndex GType
+ * @returns GType for EailIndex implementation*/
+GType eail_index_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_inwin.c b/eail/eail/eail_inwin.c
new file mode 100644 (file)
index 0000000..78329ad
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_inwin.c
+ * @brief EailInwin implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_inwin.h"
+#include "eail_priv.h"
+
+/**
+ * @brief Define EailInwin GObject type
+ */
+G_DEFINE_TYPE(EailInwin, eail_inwin, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief EailInwin object initialization
+ *
+ * @param obj EailInwin object
+ * @param data user set additional initialization data
+ */
+static void
+eail_inwin_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_inwin_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_GLASS_PANE;
+}
+
+/**
+ * @brief Implementation of get_widget_children from EailWidget
+ *
+ * @param widget EailInwin instance
+ *
+ * @return list of widgets, NULL if no children
+ */
+static Eina_List *
+eail_inwin_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *obj = eail_widget_get_widget(widget);
+
+   if (obj)
+     list = eina_list_append(list, elm_win_inwin_content_get(obj));
+
+   return list;
+}
+
+/**
+ * @brief EailInwin instance initialization
+ *
+ * @param inwin EailInwin instance
+ */
+static void
+eail_inwin_init(EailInwin *inwin)
+{
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailInwin class
+ */
+static void
+eail_inwin_class_init(EailInwinClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   widget_class->get_widget_children = eail_inwin_get_widget_children;
+   class->initialize = eail_inwin_initialize;
+}
diff --git a/eail/eail/eail_inwin.h b/eail/eail/eail_inwin.h
new file mode 100644 (file)
index 0000000..5dffb52
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_inwin.h
+ *
+ * @brief Header for EailInwin implementation
+ */
+
+#ifndef EAIL_INWIN_H
+#define EAIL_INWIN_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailInwin class
+ */
+#define EAIL_TYPE_INWIN             (eail_inwin_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailInwin
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_INWIN(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_INWIN, EailInwin))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailInwin class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_INWIN_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_INWIN, EailInwinClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailInwin class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_INWIN(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_INWIN))
+/**
+ * @brief Tests whether given klass is a subclass of EailInwin
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_INWIN_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_INWIN))
+/**
+ * @brief Gets EailInwin class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailInwin class from
+ */
+#define EAIL_INWIN_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_WINDOW, EailInwinClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailInwin*/
+typedef struct _EailInwin      EailInwin;
+/** @brief Definition of class structure for Atk EailInwin*/
+typedef struct _EailInwinClass EailInwinClass;
+
+/** @brief Definition of object structure for Atk EailInwin*/
+struct _EailInwin
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailInwin*/
+struct _EailInwinClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailInwin GType
+ * @returns GType for EailInwin implementation*/
+GType eail_inwin_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_item.c b/eail/eail/eail_item.c
new file mode 100644 (file)
index 0000000..de3358c
--- /dev/null
@@ -0,0 +1,883 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_item.c
+ * @brief Implementation of widget that is being used to represent
+ * list/toolbar/menu items/genlist items/genlist items...
+ *
+ * In general - this object represents all kinds of objects that have form of
+ * a Elm_Obj_Item* and need ATK accessible representation. It stores
+ * Elm_Obj_Item* inside - unlike Evas_Object like those components that are
+ * extending EailWidget.
+*/
+
+#include "eail_item.h"
+#include "eail_item_parent.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void atk_component_interface_init(AtkComponentIface *iface);
+static void atk_action_interface_init(AtkActionIface *iface);
+static void atk_text_interface_init(AtkTextIface *iface);
+
+#define EAIL_ITEM_CLICK_NAME "click" /**< @brief 'click' action name*/
+#define EAIL_ITEM_PRESS_NAME "press" /**< @brief 'press' action name*/
+#define EAIL_ITEM_RELEASE_NAME "release" /**< @brief 'release' action name*/
+#define EAIL_ITEM_PART_FIRST "start" /**< @brief 'start' action name*/
+#define EAIL_ITEM_PART_SECOND "end" /**< @brief 'end' action name*/
+#define EAIL_ITEM_PART_ICON "elm.swallow.icon" /**< @brief icon item part*/
+#define EAIL_ITEM_PART_END "elm.swallow.end" /**< @brief end item part*/
+#define EAIL_TXT_SEPARATOR " " /**< @brief separator for text content*/
+
+/**
+ * @brief EailItem GObject definition
+ *
+ * It extends ATK_TYPE_OBJECT class and implements ATK_TYPE_COMPONENT,
+ * ATK_TYPE_TEXT and ATK_TYPE_ACTION interfaces
+ */
+G_DEFINE_TYPE_WITH_CODE(EailItem,
+                        eail_item,
+                        ATK_TYPE_OBJECT,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
+                                              atk_component_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init));
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject for EailItem
+ * @param data additional initialization data (Elm_Object_Item *)
+ */
+static void
+eail_item_initialize(AtkObject *obj, gpointer data)
+{
+   EailItem *item = EAIL_ITEM(obj);
+
+   ATK_OBJECT_CLASS(eail_item_parent_class)->initialize(obj, data);
+
+   item->item = (Elm_Object_Item *)data;
+
+   /* NOTE: initializing role is being done only in eail_item_new(..) */
+}
+
+/**
+ *
+ * @param item EailItem to take nested Elm_Object_Item from
+ *
+ * @returns nested Elm_Object_Item * object or NULL in case of error
+ */
+Elm_Object_Item *
+eail_item_get_item(EailItem *item)
+{
+   g_return_val_if_fail(EAIL_IS_ITEM(item), NULL);
+
+   return item->item;
+}
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief Gets name of EailItem
+ *
+ * Implementation of AtkObject->get_name callback
+ *
+ * ATK doc says:
+ * Gets the accessible name of the accessible.
+ *
+ * @param obj an AtkObject for EailItem
+ * @returns a character string representing the accessible description of
+ * the accessible.
+ */
+static const gchar *
+eail_item_get_name(AtkObject *obj)
+{
+   const gchar *atk_name_default = NULL;
+   AtkObject *parent = atk_object_get_parent(obj);
+
+   if (!parent) return NULL;
+
+   /* returning name from default atk implementation when it available (it
+    * means that it was set by user)*/
+   atk_name_default = ATK_OBJECT_CLASS(eail_item_parent_class)->get_name(obj);
+   if (atk_name_default) return atk_name_default;
+
+   return eail_item_parent_get_item_name(EAIL_ITEM_PARENT(parent),
+                                         EAIL_ITEM(obj));
+}
+
+/**
+ * @brief Implementation of AtkObject->get_role callback
+ *
+ * @param obj an AtkObject for EailItem
+ * @returns ATK role of target item in the list
+ */
+static AtkRole
+eail_item_get_role(AtkObject *obj)
+{
+   AtkObject *parent = atk_object_get_parent(obj);
+
+   if (!parent) return ATK_ROLE_INVALID;
+
+   return eail_item_parent_get_item_role(EAIL_ITEM_PARENT(parent),
+                                         EAIL_ITEM(obj));
+}
+
+/**
+ * @brief Implementation of AtkObject->get_index_in_parent callback
+ *
+ * ATK doc says:
+ * Gets the 0-based index of this accessible in its parent; returns -1 if the
+ * accessible does not have an accessible parent.
+ * @param obj an AtkObject for EailItem
+ * @returns an integer which is the index of the accessible in its parent
+ */
+static gint
+eail_item_get_index_in_parent(AtkObject *obj)
+{
+   AtkObject *parent = atk_object_get_parent(obj);
+
+   if (!parent) return -1;
+
+   return eail_item_parent_get_item_index_in_parent(EAIL_ITEM_PARENT(parent),
+                                                    EAIL_ITEM(obj));
+}
+
+/**
+ * @brief Implementation of AtkObject->ref_state_set callback
+ *
+ * ATK doc says:
+ * Gets a reference to the state set of the accessible; the caller must
+ * unreference it when it is no longer needed.
+ *
+ * @param obj an AtkObject for EailItem
+ * @returns a reference to an AtkStateSet which is the state set of the
+ * accessible.
+ */
+static AtkStateSet *
+eail_item_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+   AtkObject *parent = atk_object_get_parent(obj);
+   EailItem *item = EAIL_ITEM(obj);
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   state_set = ATK_OBJECT_CLASS(eail_item_parent_class)->ref_state_set(obj);
+
+   if (!parent || !it)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_DEFUNCT);
+        return state_set;
+     }
+
+   if (!elm_object_item_disabled_get(it))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_SENSITIVE);
+        atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
+     }
+
+   return eail_item_parent_ref_item_state_set(EAIL_ITEM_PARENT(parent),
+                                              item, state_set);
+}
+
+
+/**
+ * @brief Initializer for GObject class
+ * @param item an EailItem object
+ */
+static void
+eail_item_init(EailItem *item)
+{
+}
+
+/**
+ * @brief Finalize implementation for GObject class
+ * @param obj an AtkObject for EailItem that needs to be finalized
+ */
+static void
+eail_item_class_finalize(GObject *obj)
+{
+   EailItem *eail_item = EAIL_ITEM(obj);
+   Elm_Object_Item *obj_item = eail_item_get_item(eail_item);
+
+   if (obj_item)
+     eail_factory_unregister_item_from_cache(obj_item);
+
+   G_OBJECT_CLASS(eail_item_parent_class)->finalize(obj);
+}
+
+/**
+ * @brief Helper function used for adding content Evas_Object* part if part
+ * with given name is available
+ *
+ * @param eail_obj_item item used for lookup for given content part
+ * @param items list of items that will be extended by found part
+ * @param part_str name of part to be found
+ *
+ * @returns filled list with Evas_Object* objects
+ */
+static Eina_List *
+_eail_item_append_part_if_exist(Elm_Object_Item *eail_obj_item,
+                                Eina_List *items,
+                                gchar *part_str)
+{
+   Evas_Object *content = NULL;
+
+   content = elm_object_item_part_content_get
+                                         (eail_obj_item, part_str);
+   if (content)
+     items = eina_list_append(items, content);
+
+   return items;
+}
+
+/**
+ * @brief Checks if content_get is supported by given EailItem object
+ *
+ * @param atk_object an AtkObject
+ *
+ * @returns TRUE if content_get is supported, FALSE otherwise
+ */
+static gboolean
+_eail_item_is_content_get_supported(AtkObject *atk_object)
+{
+   AtkObject *parent = NULL;
+
+
+   parent = atk_object_get_parent(atk_object);
+   g_return_val_if_fail(parent, FALSE);
+
+   return eail_item_parent_is_is_content_get_supported
+                              (EAIL_ITEM_PARENT(parent),EAIL_ITEM(atk_object));
+}
+
+/**
+ * @brief Gets list of item content parts with well documented content strings
+ *
+ * @param eail_item item to get content from
+ *
+ * @returns list filled with Evas_Object* that has been found
+ */
+static Eina_List *
+_eail_item_get_basic_parts(EailItem *eail_item)
+{
+   Eina_List *items = NULL;
+   Elm_Object_Item *obj_item = NULL;
+
+   /* if content_get is not supported then content from basic parts will be
+    * always empty. This checking is being done, because elementary library
+    * don't want to ask for some widget usign content_get API */
+   if (!_eail_item_is_content_get_supported(ATK_OBJECT(eail_item)))
+     return items;
+
+   obj_item = eail_item_get_item(EAIL_ITEM(eail_item));
+   items = _eail_item_append_part_if_exist
+                                       (obj_item, items, EAIL_ITEM_PART_FIRST);
+   items = _eail_item_append_part_if_exist
+                                       (obj_item, items, EAIL_ITEM_PART_SECOND);
+   items = _eail_item_append_part_if_exist
+                                       (obj_item, items, EAIL_ITEM_PART_ICON);
+   items = _eail_item_append_part_if_exist
+                                       (obj_item, items, EAIL_ITEM_PART_END);
+
+   return items;
+}
+
+/**
+ * @brief Helper function that adds unique entries from one list to another
+ *
+ * @param item_list source list, unique items will be appended here
+ * @param additional_items list with potential items to add
+ *
+ * @returns result list filled with unique entries from both lists
+ */
+static Eina_List *
+_eail_add_unique_listsparts(Eina_List *item_list,
+                            Eina_List *additional_items)
+{
+   Eina_List *l = NULL;
+   Elm_Object_Item *item_edj;
+
+   EINA_LIST_FOREACH(additional_items, l, item_edj)
+    {
+      if (!eina_list_data_find(item_list, item_edj))
+        item_list = eina_list_append(item_list, item_edj);
+    }
+
+   return item_list;
+}
+
+/**
+ * @brief Gets content part items from given EailItem object
+ *
+ * @param eail_item EailItem object used to get content from
+ *
+ * @returns content parts (Evas_Object *) for given item. List should be freed
+ * when results will be processed.
+ */
+static Eina_List *
+_eail_item_get_part_items(EailItem *eail_item)
+{
+   Eina_List *items = NULL, *edje_items = NULL;
+   Elm_Object_Item *obj_item = NULL;
+
+   obj_item = eail_item_get_item(eail_item);
+   g_return_val_if_fail(obj_item, NULL);
+
+   /* parts from well documented default content parts - there are being used
+    * mostly by desktop applications. Some of these parts are not listed in
+    * edje objects (used below), so results from both list need to be merged
+    * to list full item content */
+   items = _eail_item_get_basic_parts(eail_item);
+
+   /* content parts from taken from edje object*/
+   edje_items = eail_get_edje_parts_for_item(obj_item);
+
+   /* adding unique edje items to content list*/
+   items = _eail_add_unique_listsparts(items, edje_items);
+
+   eina_list_free(edje_items);
+
+   return items;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject (EailItem)
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_item_get_n_children(AtkObject *obj)
+{
+   gint n_items, parent_n_items;
+   Eina_List *items;
+   AtkObject *parent = atk_object_get_parent(obj);
+
+   if (!parent) return 0;
+   parent_n_items = eail_item_parent_get_n_children(EAIL_ITEM_PARENT(parent),
+                                                    EAIL_ITEM(obj));
+   /* if there is item parent impl, then returning item count
+    * from it*/
+   if (parent_n_items != -1) return parent_n_items;
+
+   items = _eail_item_get_part_items(EAIL_ITEM(obj));
+   n_items = eina_list_count(items);
+
+   eina_list_free(items);
+
+   return n_items;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject for EailItem
+ * @param i index of item to ref
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_item_ref_child(AtkObject *obj, gint i)
+{
+   Eina_List *items;
+   AtkObject *child = NULL;
+   AtkObject *parent = atk_object_get_parent(obj);
+   AtkObject *ref_child_from_parent = NULL;
+
+   if (!parent) return NULL;
+
+   ref_child_from_parent = eail_item_parent_ref_n_child
+                              (EAIL_ITEM_PARENT(parent), EAIL_ITEM(obj), i);
+
+   /* if there is item parent implementation for ref child, then returning
+    * object using that parent implementation*/
+   if (ref_child_from_parent)
+      {
+        g_object_ref(ref_child_from_parent);
+        return ref_child_from_parent;
+      }
+
+   items = _eail_item_get_part_items(EAIL_ITEM(obj));
+   if (eina_list_count(items) > i)
+     child = eail_factory_get_accessible(eina_list_nth(items, i));
+   else
+      ERR("Tried to ref child with index %d out of bounds!", i);
+
+   eina_list_free(items);
+
+   if (child)
+     g_object_ref(child);
+   else
+     DBG("Child could not created in factory");
+
+   return child;
+}
+
+/**
+ * @brief Initializer for GObject class (defines callbacks for base AtkObject)
+ * @param klass an EailItemClass
+ */
+static void
+eail_item_class_init(EailItemClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_item_initialize;
+   class->get_name = eail_item_get_name;
+   class->get_role = eail_item_get_role;
+   class->get_index_in_parent = eail_item_get_index_in_parent;
+   class->ref_state_set = eail_item_ref_state_set;
+   class->get_n_children = eail_item_get_n_children;
+   class->ref_child = eail_item_ref_child;
+
+   g_object_class->finalize = eail_item_class_finalize;
+}
+
+/*
+ * Implementation of the *AtkComponent* interface
+ */
+
+/**
+ * @brief Implementation of AtkComponent->grab_focus callback
+ *
+ * ATK doc says:
+ * Grabs focus for this component.
+ *
+ * @param component an AtkComponent (EailItem)
+ * @returns TRUE if successful, FALSE otherwise.
+ */
+static gboolean
+eail_item_grab_focus(AtkComponent *component)
+{
+   AtkObject *obj = ATK_OBJECT(component);
+   AtkObject *parent = atk_object_get_parent(obj);
+
+   if (!parent) return FALSE;
+
+   return eail_item_parent_grab_item_focus(EAIL_ITEM_PARENT(parent),
+                                           EAIL_ITEM(obj));
+}
+
+/**
+ * @brief Implementation of AtkComponent->get_extents callback
+ *
+ * ATK doc says:
+ * Gets the rectangle which gives the extent of the component.
+ *
+ * @param component an AtkComponent
+ * @param x address of gint to put x coordinate
+ * @param y address of gint to put y coordinate
+ * @param width ddress of gint to put width
+ * @param height address of gint to put height
+ * @param coord_type specifies whether the coordinates are relative to the
+ * screen or to the components top level window
+ */
+static void
+eail_item_get_extents(AtkComponent    *component,
+                      gint            *x,
+                      gint            *y,
+                      gint            *width,
+                      gint            *height,
+                      AtkCoordType     coord_type)
+{
+   AtkObject *obj = ATK_OBJECT(component);
+   AtkObject *parent = atk_object_get_parent(obj);
+
+   *x = *y = G_MININT;
+   *width = *height = -1;
+
+   if (!parent) return;
+
+   eail_item_parent_get_item_extents(EAIL_ITEM_PARENT(parent),
+                                     EAIL_ITEM(obj),
+                                     x, y, width, height, coord_type);
+}
+
+/**
+ * @brief AtkComponetn interface initialization
+ *
+ * @param iface EailNaviframPage object
+ */
+static void
+atk_component_interface_init(AtkComponentIface *iface)
+{
+   iface->grab_focus  = eail_item_grab_focus;
+   iface->get_extents = eail_item_get_extents;
+}
+
+/*
+ * AtkAction interface init
+ */
+
+/**
+ * @brief Gets actions supported by given EailItem object
+ *
+ * @param action an AtkAction
+ *
+ * @returns EailActionSupported enum entry that shows what kind of actions are
+ * supported
+ */
+static gint
+_eail_item_get_actions_supported(AtkAction *action)
+{
+   AtkObject *parent = NULL;
+
+   parent = atk_object_get_parent(ATK_OBJECT(action));
+   g_return_val_if_fail(parent, FALSE);
+
+   return eail_item_parent_get_actions_supported
+                                 (EAIL_ITEM_PARENT(parent),EAIL_ITEM(action));
+
+}
+
+/**
+ * @brief Returns number of implemented ATK Actions.
+ * Implementation of AtkActionIface get_n_actions callback
+ *
+ * @param action object that implements AtkAction interface
+ * @returns number of implemented actions
+ */
+static int
+eail_item_n_actions_get(AtkAction *action)
+{
+   int actions_num = 0;
+   /* if parent item does not support click action, then return no action */
+   if (_eail_item_get_actions_supported(action) == EAIL_ACTION_SUPPORTED_NONE)
+     return 0;
+
+   if (_eail_item_get_actions_supported(action) & EAIL_ACTION_SUPPORTED_CLICK)
+     actions_num++;
+
+   if (_eail_item_get_actions_supported(action) & EAIL_ACTION_SUPPORTED_PRESS)
+     actions_num++;
+
+   if (_eail_item_get_actions_supported(action) & EAIL_ACTION_SUPPORTED_RELEASE)
+     actions_num++;
+
+   return actions_num;
+}
+
+/**
+ * @brief Returns EailActionObj of action with given index
+ *
+ * @param action object that implements AtkAction interface
+ * @param i index (number) of action
+ * @returns i-th action name
+ */
+static const char*
+eail_item_action_name_get(AtkAction *action, int i)
+{
+   const char* action_name;
+
+   /* if parent item does not support click action, then return no action */
+   if (_eail_item_get_actions_supported(action) == EAIL_ACTION_SUPPORTED_NONE)
+     return NULL;
+
+   switch (i)
+     {
+      case 0:
+         /*"click": the user clicked the item*/
+         action_name = EAIL_ITEM_CLICK_NAME;
+         break;
+      case 1:
+         /*"press": the user pressed the item*/
+         action_name = EAIL_ITEM_PRESS_NAME;
+         break;
+      case 2:
+         /*"release": the user pressed the item*/
+         action_name = EAIL_ITEM_RELEASE_NAME;
+         break;
+      default:
+         action_name = NULL;
+         break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Gets clickable Evas_Object for given EailItem
+ *
+ * @param atk_item an EailItem object
+ *
+ * @returns Evas_Object * to click on or NULL of no clickable content was found
+ */
+static Evas_Object *
+_eail_item_get_clickable_evas_obj(AtkObject *atk_item)
+{
+   AtkObject *parent = NULL;
+   Evas_Object *widget = NULL;
+   Eina_List *parts = NULL;
+
+   parent = atk_object_get_parent(atk_item);
+   g_return_val_if_fail(parent, FALSE);
+
+   widget = eail_item_parent_get_evas_obj
+                           (EAIL_ITEM_PARENT(parent), EAIL_ITEM(atk_item));
+   if (widget) return widget;
+
+   /* if not supported from parent, then trying to get content widget nested
+    * in item */
+   parts = _eail_item_get_part_items(EAIL_ITEM(atk_item));
+   if (parts && eina_list_count(parts) > 0)
+     {
+        /* getting first widget from content */
+        widget = eina_list_nth(parts, 0);
+     }
+   eina_list_free(parts);
+   if (widget) return widget;
+
+   /* if no nested widget, then getting evas clickable area */
+   parts = eail_get_raw_evas_obj_list_from_item
+                                    (eail_item_get_item(EAIL_ITEM(atk_item)));
+
+   if (parts && eina_list_count(parts) > 0)
+     {
+        /* getting first widget from content */
+        widget = eina_list_nth(parts, 0);
+     }
+
+   return widget;
+}
+
+
+/**
+ * @brief Performs action with name on given item
+ *
+ * @param atk_item item object to do action on
+ * @param action_name name of action (eg. 'click', 'press'...)
+ *
+ * @returns TRUE if operation was successful, FALSE otherwise
+ */
+static gboolean
+_eail_item_perform_action(AtkObject *atk_item, const gchar *action_name)
+{
+   AtkObject *parent = NULL;
+   Evas_Object *widget = NULL;
+   int x, y;
+
+   parent = atk_object_get_parent(atk_item);
+   g_return_val_if_fail(parent, FALSE);
+
+   widget =_eail_item_get_clickable_evas_obj(atk_item);
+
+   if (!widget)
+     {
+        ERR("No widget for click found");
+        return FALSE;
+     }
+
+   /* getting coordinates of center of the widget to make sure, that
+    * click will be performed on active widget area */
+   eail_get_coords_widget_center(widget, &x, &y);
+
+   if (0 == g_strcmp0(action_name, EAIL_ITEM_CLICK_NAME))
+     {
+       DBG("Calling 'click' on item");
+       eail_mouse_click_on_coords(widget, x, y);
+     }
+   else if (0 == g_strcmp0(action_name, EAIL_ITEM_PRESS_NAME))
+     {
+        DBG("Calling 'press' on item");
+        eail_mouse_press_on_coords(widget, x, y);
+     }
+   else if (0 == g_strcmp0(action_name, EAIL_ITEM_RELEASE_NAME))
+     {
+        DBG("Calling 'release' on item");
+        eail_mouse_release_on_coords(widget, x, y);
+     }
+   else
+     {
+        DBG("Action name not found: %s", action_name);
+        return FALSE;
+     }
+
+   return TRUE;
+}
+
+/**
+ * \brief Launches action with given index
+ *
+ * @param action object that implements AtkAction interface
+ * @param i index (number) of action
+ *
+ * @returns TRUE if action was successfully launched, FALSE otherwise
+ */
+static gboolean
+eail_item_do_action(AtkAction *action, int i)
+{
+   const char *action_name = atk_action_get_name(action, i);
+
+   /* if parent item does not support click action, then return immediately */
+   if (_eail_item_get_actions_supported(action) == EAIL_ACTION_SUPPORTED_NONE)
+     return FALSE;
+
+   if (action_name == NULL) return FALSE;
+
+   return _eail_item_perform_action(ATK_OBJECT(action), action_name);;
+}
+
+/**
+ * @brief Initializer for AtkActionIface
+ * @param iface an AtkActionIface to fill
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->do_action     = eail_item_do_action;
+   iface->get_n_actions = eail_item_n_actions_get;
+   iface->get_name      = eail_item_action_name_get;
+}
+
+/**
+ * @brief Gets text content from item
+ *
+ * Implementation of AtkTextIface->get_text callback\n
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, or -1 for the end of the string.
+ *
+ * @returns a newly allocated string containing the text from start_offset
+ * up to, but not including end_offset. Use g_free() to free the returned
+ * string.
+ */
+static gchar*
+eail_item_get_text(AtkText   *text,
+                   gint       start_offset,
+                   gint       end_offset)
+{
+   Eina_Strbuf *buf = NULL;
+   Elm_Object_Item *obj_item = NULL;
+   Eina_List *string_parts = NULL, *l = NULL;
+   gchar *string_part = NULL;
+   gchar *ret_str = NULL;
+   gboolean first_part = TRUE;
+
+   obj_item = eail_item_get_item(EAIL_ITEM(text));
+   g_return_val_if_fail(obj_item, NULL);
+
+   string_parts = eail_item_get_content_strings(obj_item);
+   if (!string_parts) return NULL;
+
+   buf = eina_strbuf_new();
+   EINA_LIST_FOREACH(string_parts, l, string_part)
+    {
+      if (!first_part)
+        eina_strbuf_append(buf, EAIL_TXT_SEPARATOR);
+
+      eina_strbuf_append(buf, string_part);
+      first_part = FALSE;
+    }
+
+   /* ret_str is newly allocated */
+   ret_str = eail_get_substring
+                     (eina_strbuf_string_get(buf), start_offset, end_offset);
+
+   eina_list_free(string_parts);
+   eina_strbuf_free(buf);
+
+   return ret_str;
+}
+
+/**
+ * @brief Gets character from item at given offset
+ *
+ * Implementation of AtkTextIface->get_character_at_offset callback
+ *
+ * @param text an AtkText
+ * @param offset an offset
+ *
+ * @returns the character at offset.
+ */
+static gunichar
+eail_item_get_character_at_offset(AtkText *text, gint offset)
+{
+   gunichar character = '\0';
+   gchar* time_str = NULL;
+
+   time_str = eail_item_get_text(text, 0, -1);
+
+   if (time_str)
+     {
+         character = g_utf8_get_char
+                              (g_utf8_offset_to_pointer(time_str, offset));
+         g_free(time_str);
+     }
+
+   return character;
+}
+
+/**
+ * @brief Gets character count from text content in item
+ * Implementation of AtkTextIface->get_character_count callback
+ *
+ * @param text an AtkText
+ *
+ * @returns the character count
+ */
+static gint
+eail_item_get_character_count(AtkText *text)
+{
+   gint count = 0;
+   gchar* str = NULL;
+
+   str = eail_item_get_text(text, 0, -1);
+
+   if (str)
+      {
+         count = g_utf8_strlen(str, -1);
+         g_free(str);
+      }
+
+   return count;
+}
+
+/**
+ * @brief Initializer for AtkTextinterface
+ * @param iface an AtkTextIface to fill
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+   iface->get_text = eail_item_get_text;
+   iface->get_character_at_offset = eail_item_get_character_at_offset;
+   iface->get_character_count = eail_item_get_character_count;
+}
diff --git a/eail/eail/eail_item.h b/eail/eail/eail_item.h
new file mode 100644 (file)
index 0000000..780a92f
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_item.h
+ *
+ * @brief Header for EailItem implementation
+ */
+
+#ifndef EAIL_ITEM_H
+#define EAIL_ITEM_H
+
+#include <atk/atk.h>
+#include <Elementary.h>
+/**
+ * @brief Returns a value corresponding to the type of EailItem class
+ */
+#define EAIL_TYPE_ITEM            (eail_item_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailItem
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_ITEM(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                   EAIL_TYPE_ITEM, EailItem))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailItem class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_ITEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                   EAIL_TYPE_ITEM, EailItemClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailItem class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_ITEM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                   EAIL_TYPE_ITEM))
+/**
+ * @brief Tests whether given klass is a subclass of EailItem
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                   EAIL_TYPE_ITEM))
+/**
+ * @brief Gets EailItem class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailItem class from
+ */
+#define EAIL_ITEM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                   EAIL_TYPE_ITEM, EailItemClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailItem*/
+typedef struct _EailItem      EailItem;
+/** @brief Definition of class structure for Atk EailItem*/
+typedef struct _EailItemClass EailItemClass;
+
+/** @brief Definition of object structure for Atk EailItem*/
+struct _EailItem
+{
+   /** @brief Parent object that functionality is being extended*/
+   AtkObject parent;
+
+   /** @brief Elementary item that is being represented by EailItem accessible
+    * object*/
+   Elm_Object_Item *item;
+};
+
+/** @brief Definition of class structure for Atk EailItem*/
+struct _EailItemClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   AtkObjectClass parent_class;
+};
+
+/** @brief Getter for EailItem GType
+ *
+ * @returns GType for EailItem implementation*/
+GType eail_item_get_type(void);
+
+/** @brief Gets nested Elm_Object_Item * object*/
+Elm_Object_Item *eail_item_get_item(EailItem *item);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_item_parent.c b/eail/eail/eail_item_parent.c
new file mode 100644 (file)
index 0000000..3747053
--- /dev/null
@@ -0,0 +1,310 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_item_parent.c
+ * @brief Implementation of interface that is used by EailItem implementation
+ * to allow special behavior of wide range item-objects
+*/
+
+#include "eail_item_parent.h"
+
+/**
+ *
+ * @returns GType for initialized interface
+ */
+GType
+eail_item_parent_get_type(void)
+{
+   static volatile GType type_id__volatile = 0;
+
+   if (g_once_init_enter(&type_id__volatile))
+     {
+        GType type_id = g_type_register_static_simple(
+                                    G_TYPE_INTERFACE,
+                                    "EailItemParent",
+                                    sizeof(EailItemParentIface),
+                                    NULL,
+                                    0,
+                                    NULL,
+                                    0);
+
+        g_once_init_leave(&type_id__volatile, type_id);
+     }
+
+   return type_id__volatile;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @return gchar* representing name of item or NULL if not available
+ */
+const gchar *
+eail_item_parent_get_item_name(EailItemParent   *parent,
+                               EailItem         *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), NULL);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->get_item_name)
+     return iface->get_item_name(parent, item);
+
+   return NULL;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns ATK role for given EailItem
+ */
+AtkRole
+eail_item_parent_get_item_role(EailItemParent   *parent,
+                               EailItem         *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), ATK_ROLE_INVALID);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->get_item_role)
+     return iface->get_item_role(parent, item);
+
+   return ATK_OBJECT(item)->role;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns gint representing index of item in parent object
+ */
+gint
+eail_item_parent_get_item_index_in_parent(EailItemParent    *parent,
+                                          EailItem          *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), -1);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->get_item_index_in_parent)
+     return iface->get_item_index_in_parent(parent, item);
+
+   return -1;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns gint representing index of item in parent object or -1 if
+ * not implemented
+ */
+gint
+eail_item_parent_get_n_children(EailItemParent    *parent,
+                                EailItem          *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), -1);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->get_n_children)
+     return iface->get_n_children(parent, item);
+
+   return -1;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ * @param index gint representing index of child to ref
+ *
+ * @returns AtkObject * for given index or NULL if not implemented
+ */
+AtkObject *
+eail_item_parent_ref_n_child(EailItemParent    *parent,
+                             EailItem          *item,
+                             gint index)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), NULL);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->ref_n_child)
+     return iface->ref_n_child(parent, item, index);
+
+   return NULL;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ * @param state_set current state_set
+ *
+ * @returns AtkStateSet representing state set of given EailItem
+ */
+AtkStateSet *
+eail_item_parent_ref_item_state_set(EailItemParent  *parent,
+                                    EailItem        *item,
+                                    AtkStateSet     *state_set)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), NULL);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->ref_item_state_set)
+     return iface->ref_item_state_set(parent, item, state_set);
+
+   return state_set;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns TRUE if operation was successfull, FALSE otherwise
+ */
+gboolean
+eail_item_parent_grab_item_focus(EailItemParent *parent,
+                                 EailItem       *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), FALSE);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->grab_item_focus)
+     return iface->grab_item_focus(parent, item);
+
+   return FALSE;
+}
+
+/**
+ * ATK doc says:
+ * Gets the rectangle which gives the extent of the component.
+ *
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ * @param x address of gint to put x coordinate
+ * @param y address of gint to put y coordinate
+ * @param width addrress of gint to put width
+ * @param height address of gint to put height
+ * @param coord_type specifies whether the coordinates are relative to the
+ * screen or to the components top level window
+ */
+void
+eail_item_parent_get_item_extents(EailItemParent    *parent,
+                                  EailItem          *item,
+                                  gint                *x,
+                                  gint                *y,
+                                  gint                *width,
+                                  gint                *height,
+                                  AtkCoordType         coord_type)
+{
+   EailItemParentIface *iface;
+
+   g_return_if_fail(EAIL_IS_ITEM_PARENT(parent));
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->get_item_extents)
+     iface->get_item_extents(parent, item, x, y, width, height, coord_type);
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns nested Evas_Object for given EailItem
+ */
+Evas_Object * eail_item_parent_get_evas_obj(EailItemParent   *parent,
+                                            EailItem         *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), NULL);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->get_evas_obj)
+     return iface->get_evas_obj(parent, item);
+
+   return NULL;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns filled gint representing supported actions
+ */
+gint
+eail_item_parent_get_actions_supported(EailItemParent *parent,
+                                       EailItem       *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), FALSE);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->get_actions_supported)
+     return iface->get_actions_supported(parent, item);
+
+   return EAIL_ACTION_SUPPORTED_NONE;
+}
+
+/**
+ * @param parent object that holds EailItem in its content
+ * @param item an EailItem object
+ *
+ * @returns TRUE if content get is supported, FALSE otherwise. Default
+ * implementation returns TRUE (used if no redefinition in EailItemParent
+ * interface implementation is defined)
+ */
+gboolean
+eail_item_parent_is_is_content_get_supported(EailItemParent *parent,
+                                             EailItem       *item)
+{
+   EailItemParentIface *iface;
+
+   g_return_val_if_fail(EAIL_IS_ITEM_PARENT(parent), FALSE);
+
+   iface = EAIL_ITEM_PARENT_GET_IFACE(parent);
+
+   if (iface->is_content_get_supported)
+     return iface->is_content_get_supported(parent, item);
+
+   return TRUE;
+}
diff --git a/eail/eail/eail_item_parent.h b/eail/eail/eail_item_parent.h
new file mode 100644 (file)
index 0000000..6ab313f
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_item_parent.h
+ *
+ * @brief Header for EailItemParent implementation
+ */
+
+#ifndef EAIL_ITEM_PARENT_H
+#define EAIL_ITEM_PARENT_H
+
+#include "eail_item.h"
+/**
+ * @brief Returns a value corresponding to the type of EailItemParent interface
+ */
+#define EAIL_TYPE_ITEM_PARENT           (eail_item_parent_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailItemParent
+ * interface
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_ITEM_PARENT(obj)           (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                         EAIL_TYPE_ITEM_PARENT, EailItemParent))
+/**
+ * @brief Tests whether object (obj) implements EailItemParent interface
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_ITEM_PARENT(obj)        (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                         EAIL_TYPE_ITEM_PARENT))
+/**
+ * @brief Gets EailItemParent interface structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailItemParent interface from
+ */
+#define EAIL_ITEM_PARENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj),\
+                                         EAIL_TYPE_ITEM_PARENT, EailItemParentIface))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailItemParent*/
+typedef struct _EailItemParent      EailItemParent;
+/** @brief Definition of interface structure for Atk EailItemParent*/
+typedef struct _EailItemParentIface EailItemParentIface;
+
+/** @brief Definition of interface structure for Atk EailItemParent*/
+struct _EailItemParentIface
+{
+   GTypeInterface parent;/**< @brief parent interface that is being extended*/
+
+   /**@brief callback definition for eail_item_parent_get_item_name func*/
+   const gchar *(*get_item_name)            (EailItemParent   *parent,
+                                            EailItem         *item);
+
+   /**@brief callback definition for eail_item_parent_get_item_role func*/
+   AtkRole      (*get_item_role)            (EailItemParent   *parent,
+                                            EailItem         *item);
+
+   /**@brief callback definition for eail_item_parent_get_index_in_parent func*/
+   gint         (*get_item_index_in_parent) (EailItemParent   *parent,
+                                            EailItem         *item);
+
+   /**@brief callback definition for eail_item_parent_get_n_children func*/
+   gint         (*get_n_children)           (EailItemParent   *parent,
+                                            EailItem         *item);
+
+   /**@brief callback definition for eail_item_parent_ref_n_child func*/
+   AtkObject *  (*ref_n_child)              (EailItemParent   *parent,
+                                            EailItem         *item,
+                                            gint             index);
+
+   /**@brief callback definition for eail_item_parent_ref_item_state_set func*/
+   AtkStateSet *
+                (*ref_item_state_set)       (EailItemParent   *parent,
+                                            EailItem         *item,
+                                            AtkStateSet      *state_set);
+
+   /* AtkComponent interface */
+   /**@brief callback definition for eail_item_parent_grab_item_focus func*/
+   gboolean    (*grab_item_focus)          (EailItemParent   *parent,
+                                            EailItem         *item);
+
+   /**@brief callback definition for eail_item_parent_get_item_extents func*/
+   void        (*get_item_extents)         (EailItemParent   *parent,
+                                            EailItem         *item,
+                                            gint             *x,
+                                            gint             *y,
+                                            gint             *width,
+                                            gint             *height,
+                                            AtkCoordType      coord_type);
+
+   /**@brief callback definition for eail_item_parent_get_evas_obj func*/
+   Evas_Object * (*get_evas_obj)           (EailItemParent   *parent,
+                                            EailItem         *item);
+
+   /**@brief callback definition for eail_item_parent_get_actions_supported
+    * func*/
+   gboolean    (*get_actions_supported)       (EailItemParent   *parent,
+                                               EailItem         *item);
+
+   /**@brief callback definition for eail_item_parent_is_content_get_supported
+    * func*/
+   gboolean    (*is_content_get_supported) (EailItemParent   *parent,
+                                            EailItem         *item);
+};
+
+/** @brief Enum that is used to represent supported actions by item*/
+enum EailActionSupported
+{
+    EAIL_ACTION_SUPPORTED_NONE = 1 << 0,
+    EAIL_ACTION_SUPPORTED_CLICK = 1 << 1,
+    EAIL_ACTION_SUPPORTED_PRESS = 1 << 2,
+    EAIL_ACTION_SUPPORTED_RELEASE = 1 << 3
+};
+
+
+GType eail_item_parent_get_type(void);
+const gchar * eail_item_parent_get_item_name(EailItemParent *parent,
+                                             EailItem *item);
+AtkRole eail_item_parent_get_item_role(EailItemParent *parent,
+                                       EailItem *item);
+gint eail_item_parent_get_n_children(EailItemParent *parent,
+                                     EailItem *item);
+AtkObject * eail_item_parent_ref_n_child(EailItemParent *parent,
+                                         EailItem *item,
+                                         gint index);
+gint eail_item_parent_get_item_index_in_parent(EailItemParent *parent,
+                                               EailItem *item);
+AtkStateSet * eail_item_parent_ref_item_state_set(EailItemParent *parent,
+                                                  EailItem *item,
+                                                  AtkStateSet *state_set);
+gboolean eail_item_parent_grab_item_focus(EailItemParent *parent,
+                                          EailItem *item);
+void eail_item_parent_get_item_extents(EailItemParent *parent,
+                                       EailItem *item,
+                                       gint *x,
+                                       gint *y,
+                                       gint *width,
+                                       gint *height,
+                                       AtkCoordType coord_type);
+gboolean eail_item_parent_get_actions_supported(EailItemParent *parent,
+                                                EailItem *item);
+gboolean eail_item_parent_is_is_content_get_supported(EailItemParent *parent,
+                                                      EailItem *item);
+Evas_Object * eail_item_parent_get_evas_obj(EailItemParent *parent,
+                                            EailItem *item);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_label.c b/eail/eail/eail_label.c
new file mode 100644 (file)
index 0000000..a99212c
--- /dev/null
@@ -0,0 +1,327 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_label.c
+ * @brief EailLabel implementation.
+ */
+
+#include <Elementary.h>
+
+#include "eail_label.h"
+#include "eail_utils.h"
+
+static void atk_text_interface_init(AtkTextIface *iface);
+
+/**
+ * @brief EailLabel type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailLabel,
+                        eail_label,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init));
+
+/**
+ * @brief EailLabel initializer.
+ *
+ * @param obj EailLabel instance
+ * @param data initialization data
+ */
+static void
+eail_label_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_label_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_LABEL;
+}
+
+/**
+ * @brief EailLabel interface intializer.
+ *
+ * @param label EailLabel instance
+ */
+static void
+eail_label_init(EailLabel *label)
+{
+}
+
+/**
+ * @brief Gets state set of the accessible.
+ *
+ * The caller must unreference it when it is no longer needed.
+ *
+ * @param accessible AtkObject instance
+ * @return accessible state set
+ */
+static AtkStateSet*
+eail_label_ref_state_set(AtkObject *accessible)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget;
+
+   state_set =
+       ATK_OBJECT_CLASS(eail_label_parent_class)->ref_state_set(accessible);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(accessible));
+   if (!widget) return state_set;
+
+   atk_state_set_add_state(state_set, ATK_STATE_MULTI_LINE);
+
+   return state_set;
+}
+
+/**
+ * @brief Gets obj name
+ *
+ * Returns obj accessible name if assigned, obj text content otherwise
+ *
+ * @param obj an AtkObject
+ * @returns accessible obj name if assigned, obj text content otherwise
+ */
+static const gchar*
+eail_label_get_name(AtkObject *obj)
+{
+   const gchar *name;
+   Evas_Object *widget;
+
+   name = ATK_OBJECT_CLASS(eail_label_parent_class)->get_name(obj);
+   if (NULL != name)
+     return name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   name = (const gchar*)elm_object_text_get(widget);
+   if (!name) return NULL;
+
+   return name;
+}
+
+/**
+ * @brief EailLabel class initializer.
+ *
+ * @param klass EailLabel class
+ */
+static void
+eail_label_class_init(EailLabelClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_label_initialize;
+   class->ref_state_set = eail_label_ref_state_set;
+   class->get_name = eail_label_get_name;
+}
+
+/**
+ * @brief Gets text bounded by start_offset and end_offset
+ *
+ * Use g_free() to free the returned string
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, -1 for the end of the string
+ * @return string containing text from start_offset up to, but not including
+ * end_offset
+ */
+static gchar*
+eail_label_get_text(AtkText   *text,
+                    gint       start_offset,
+                    gint       end_offset)
+{
+   gchar *string = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     string = (gchar *)elm_object_text_get(widget);
+
+   if (!string)
+     return NULL;
+
+   return eail_get_substring(string, start_offset, end_offset);
+}
+
+/**
+ * @brief Gets character at offset
+ *
+ * @param text an AtkText
+ * @param offset character offset
+ * @return character at offset
+ */
+static gunichar
+eail_label_get_character_at_offset(AtkText    *text,
+                                   gint        offset)
+{
+   gunichar character = '\0';
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     character = g_utf8_get_char(
+         g_utf8_offset_to_pointer(elm_object_text_get(widget), offset));
+
+   return character;
+}
+
+/**
+ * @brief Gets text length
+ *
+ * @param text an AtkText
+ * @return text length
+ */
+static gint
+eail_label_get_character_count(AtkText *text)
+{
+   Evas_Object *widget;
+   const char *str;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget)
+     return 0;
+
+   str = elm_object_text_get(widget);
+   if (!str)
+     return 0;
+   return g_utf8_strlen(str, -1);
+}
+
+/**
+ * @brief Adds attribute to attribute set
+ *
+ * @param attrib_set The AtkAttributeSet to add the attribute to
+ * @param attr The AtkTextAttrribute which identifies the attribute to be added
+ * @param value The attribute value
+ *
+ * Creates an AtkAttribute from attr and value, and adds it
+ * to attrib_set.
+ *
+ * @returns: A pointer to the new AtkAttributeSet.
+ **/
+AtkAttributeSet*
+_eail_label_add_attribute(AtkAttributeSet *attrib_set,
+                          AtkTextAttribute attr,
+                          gchar           *value)
+{
+   AtkAttributeSet *return_set;
+   AtkAttribute *at = g_malloc (sizeof (AtkAttribute));
+   at->name = g_strdup (atk_text_attribute_get_name (attr));
+   at->value = value;
+   return_set = g_slist_prepend(attrib_set, at);
+   return return_set;
+}
+
+/**
+ * @brief Creates an AtkAttributeSet which consists of the default values of
+ * attributes for the text.
+ *
+ * @param text an AtkText
+ *
+ * @returns an AtkAttributeSet which contains the default values of attributes
+ * at offset. this atkattributeset should be freed by a call to
+ * atk_attribute_set_free()
+ */
+AtkAttributeSet *
+eail_label_get_default_attributes(AtkText *text)
+{
+   AtkAttributeSet *at_set = NULL;
+
+   at_set = _eail_label_add_attribute
+       (at_set, ATK_TEXT_ATTR_WRAP_MODE,
+        g_strdup
+        (atk_text_attribute_get_value(ATK_TEXT_ATTR_WRAP_MODE, 0)));
+
+   at_set = _eail_label_add_attribute
+       (at_set, ATK_TEXT_ATTR_EDITABLE,
+        g_strdup
+        (atk_text_attribute_get_value
+         (ATK_TEXT_ATTR_EDITABLE, FALSE)));
+
+   return at_set;
+}
+
+/**
+ * @brief Creates an AtkAttributeSet which consists of the attributes
+ * explicitly set at the position offset in the text. start_offset and
+ * end_offset are set to the start and end of the range around offset
+ * where the attributes are invariant. Note that end_offset is the offset
+ * of the first character after the range.
+ *
+ * @param text an AtkText
+ * @param offset the offset at which to get the attributes
+ * @param start_offset the address to put the start offset of the range (used to
+ * store output value)
+ * @param end_offset the address to put the end offset of the range (used to
+ * store output value)
+ *
+ * @returns an AtkAttributeSet which contains the attributes explicitly set at
+ * offset. This AtkAttributeSet should be freed by a call to
+ * atk_attribute_set_free()
+ */
+AtkAttributeSet *
+eail_label_get_run_attributes(AtkText *text,
+                              gint offset,
+                              gint *start_offset,
+                              gint *end_offset)
+{
+   AtkAttributeSet *at_set = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   gint len = eail_label_get_character_count(ATK_TEXT(text));
+
+   if (!widget || offset >= len)
+     {
+        *start_offset = -1;
+        *end_offset = -1;
+
+        return NULL;
+     }
+
+   *start_offset = 0;
+   *end_offset = len;
+
+   /* NOTE: Elm_Wrap_Type value is in 100% compatible with ATK wrap modes, so
+    * no additional conversion is needed*/
+   Elm_Wrap_Type wrap_type = elm_label_line_wrap_get(widget);
+   at_set = _eail_label_add_attribute
+       (at_set, ATK_TEXT_ATTR_WRAP_MODE,
+        g_strdup
+        (atk_text_attribute_get_value
+         (ATK_TEXT_ATTR_WRAP_MODE, wrap_type)));
+
+   at_set = _eail_label_add_attribute
+       (at_set, ATK_TEXT_ATTR_EDITABLE,
+        g_strdup
+        (atk_text_attribute_get_value
+         (ATK_TEXT_ATTR_EDITABLE, FALSE)));
+
+   return at_set;
+}
+
+/**
+ * @brief Initializes AtkTextIface interface
+ *
+ * @param iface an AtkTextIface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+   iface->get_character_count = eail_label_get_character_count;
+   iface->get_character_at_offset = eail_label_get_character_at_offset;
+   iface->get_text = eail_label_get_text;
+   iface->get_run_attributes = eail_label_get_run_attributes;
+   iface->get_default_attributes = eail_label_get_default_attributes;
+}
+
diff --git a/eail/eail/eail_label.h b/eail/eail/eail_label.h
new file mode 100644 (file)
index 0000000..6c36c88
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_label.h
+ *
+ * @brief Header for EailLabel implementation
+ */
+
+#ifndef EAIL_LABEL_H
+#define EAIL_LABEL_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailLabel class
+ */
+#define EAIL_TYPE_LABEL              (eail_label_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailLabel
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_LABEL(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                      EAIL_TYPE_LABEL, EailLabel))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailLabel class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_LABEL_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                      EAIL_TYPE_LABEL, EailLabelClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailLabel class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_LABEL(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                      EAIL_TYPE_LABEL))
+/**
+ * @brief Tests whether given klass is a subclass of EailLabel
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_LABEL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                      EAIL_TYPE_LABEL))
+/**
+ * @brief Gets EailLabel class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailLabel class from
+ */
+#define EAIL_LABEL_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                      EAIL_TYPE_LABEL, EailLabelClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailLabel*/
+typedef struct _EailLabel      EailLabel;
+/** @brief Definition of class structure for Atk EailLabel*/
+typedef struct _EailLabelClass EailLabelClass;
+
+/** @brief Definition of object structure for Atk EailLabel*/
+struct _EailLabel
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of class structure for Atk EailLabel*/
+struct _EailLabelClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailLabel GType
+ * @returns GType for EailLabel implementation*/
+GType eail_label_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_layout.c b/eail/eail/eail_layout.c
new file mode 100644 (file)
index 0000000..1d9639c
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_layout.c
+ *
+ * @brief Implementation of Layout widget
+*/
+
+#include <Elementary.h>
+
+#include "eail_layout.h"
+#include "eail_dynamic_content.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void eail_dynamic_content_interface_init(EailDynamicContentIface *iface);
+
+/**
+ * @brief Define EailLayout GObject type
+ *
+ * It extends EAIL_TYPE_WIDGET
+ */
+G_DEFINE_TYPE_WITH_CODE(EailLayout, eail_layout, EAIL_TYPE_WIDGET,
+                    G_IMPLEMENT_INTERFACE(EAIL_TYPE_DYNAMIC_CONTENT,
+                                          eail_dynamic_content_interface_init));
+
+/**
+ * @brief Gets elementary widgets from layout edje object
+ * Iterates over edje smart objects and if object is elementary widget
+ * then it is append to the list
+ *
+ * @param edje layout edje object
+ *
+ * @returns list of Elementary widgets
+ */
+static Eina_List *
+_get_widgets_from_edje(const Evas_Object *edje)
+{
+   Evas_Object *o;
+   Eina_List *widgets, *l, *list = evas_object_smart_members_get(edje);
+
+   widgets = NULL;
+   EINA_LIST_FOREACH(list, l, o)
+     {
+        if (elm_object_widget_check(o))
+          widgets = eina_list_append(widgets, o);
+     }
+
+   return widgets;
+}
+
+/**
+ * @brief Implementations of get_widget_children from EailWidget
+ *
+ * @param object EailLayout instance
+ *
+ * @returns list of Evas_Objects
+ */
+static Eina_List*
+eail_layout_widget_children_get(EailWidget *object)
+{
+   Evas_Object *edje;
+   Evas_Object *widget = eail_widget_get_widget(object);
+
+   if (!widget) return NULL;
+   edje = elm_layout_edje_get(widget);
+
+   return _get_widgets_from_edje(edje);
+}
+
+/**
+ * @brief Initialize EailLayout object
+ *
+ * @param object EailLayout instance
+ * @param data user data passed to initialization
+ */
+static void
+eail_layout_initialize(AtkObject *object, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_layout_parent_class)->initialize(object, data);
+   EailLayout *eail_layout = NULL;
+   object->role = ATK_ROLE_FILLER;
+
+   if (!EAIL_IS_LAYOUT(object))
+     {
+        DBG("Not EAIL_LAYOUT!. Returning");
+        return;
+     }
+
+   /* storing last numbers of children to be for checking if children-changed
+    * signal has to be propagated */
+   eail_layout = EAIL_LAYOUT(object);
+   eail_layout->child_count_last = atk_object_get_n_accessible_children(object);
+}
+
+/**
+ * @brief Init EailLayout instance
+ *
+ * @param layout EailLayout instance
+ */
+static void
+eail_layout_init(EailLayout *layout)
+{
+}
+
+/**
+ * @brief Init EailLayout class
+ *
+ * @param klass EailLayoutClass object
+ */
+static void
+eail_layout_class_init(EailLayoutClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   class->initialize = eail_layout_initialize;
+   widget_class->get_widget_children = eail_layout_widget_children_get;
+}
+
+/**
+ * @param dynamic_content_holder an EailDynamicContent object (EailLayout)
+ */
+void
+eail_layout_update_descendants(EailDynamicContent *dynamic_content_holder)
+{
+   gint n_children = 0;
+   EailLayout *layout = NULL;
+   if (!EAIL_IS_LAYOUT(dynamic_content_holder))
+     {
+        DBG("No EailLayout found. Returning");
+        return;
+     }
+
+   layout = EAIL_LAYOUT(dynamic_content_holder);
+
+   n_children = atk_object_get_n_accessible_children(ATK_OBJECT(layout));
+   if (n_children && n_children > layout->child_count_last)
+     {
+        eail_emit_children_changed(TRUE, ATK_OBJECT(layout), n_children - 1);
+     }
+   else if (n_children < layout->child_count_last)
+     {
+         eail_emit_children_changed
+                     (FALSE, ATK_OBJECT(layout), layout->child_count_last);
+     }
+
+   layout->child_count_last = n_children;
+}
+
+/**
+ * @brief Initializer for dynamic content interface, used for handling objects
+ * children hierarchy changes
+ *
+ * @param iface an EailDynamicContentIface
+ */
+static void
+eail_dynamic_content_interface_init(EailDynamicContentIface *iface)
+{
+   iface->update_hierarchy = eail_layout_update_descendants;
+}
diff --git a/eail/eail/eail_layout.h b/eail/eail/eail_layout.h
new file mode 100644 (file)
index 0000000..5d4e5f5
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_layout.h
+ *
+ * @brief Header for EailLayout implementation
+ */
+
+#ifndef EAIL_LAYOUT_H
+#define EAIL_LAYOUT_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailLayout class
+ */
+#define EAIL_TYPE_LAYOUT              (eail_layout_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailLayout
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_LAYOUT(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                       EAIL_TYPE_LAYOUT, EailLayout))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailLayout class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_LAYOUT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                       EAIL_TYPE_LAYOUT, EailLayoutClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailLayout class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_LAYOUT(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                       EAIL_TYPE_LAYOUT))
+/**
+ * @brief Tests whether given klass is a subclass of EailLayout
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_LAYOUT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                       EAIL_TYPE_LAYOUT))
+/**
+ * @brief Gets EailLayout class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailLayout class from
+ */
+#define EAIL_LAYOUT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                       EAIL_TYPE_LAYOUT, EailLayoutClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailLayout*/
+typedef struct _EailLayout      EailLayout;
+/** @brief Definition of object class for Atk EailLayout*/
+typedef struct _EailLayoutClass EailLayoutClass;
+
+/** @brief Definition of object structure for Atk EailLayout*/
+struct _EailLayout
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+   gint child_count_last;/**< @brief last reported count of children */
+};
+
+/** @brief Definition of object class for Atk EailLayout*/
+struct _EailLayoutClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailLayout GType
+ * @returns GType for EailLayout implementation*/
+GType eail_layout_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_list.c b/eail/eail/eail_list.c
new file mode 100644 (file)
index 0000000..19ce164
--- /dev/null
@@ -0,0 +1,599 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_list.c
+ * @brief Implementation of list widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_list.h"
+#include "eail_item_parent.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+
+/**
+ * @brief Definition of EailList as GObject
+ *
+ * EailList is extended ScrollableWidget with EAIL_TYPE_ITEM_PARENT and
+ * ATK_TYPE_SELECTION implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailList,
+                        eail_list,
+                        EAIL_TYPE_SCROLLABLE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                              atk_selection_interface_init));
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data Initialization data
+ */
+static void
+eail_list_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_list_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_LIST;
+
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "selected",
+                                  eail_list_item_handle_selected_event, obj);
+   evas_object_smart_callback_add(nested_widget, "unselected",
+                                  eail_list_item_handle_unselected_event, obj);
+}
+
+/**
+ * @brief Prepares Eina_List filled with Elm_Object_Item* objects
+ * representing items in the list
+ *
+ * @param list an EailList
+ *
+ * @return filled list with list items. Call eina_list_free on that list when
+ * results processing has been finished
+ */
+static Eina_List *
+eail_list_get_items(EailList *list)
+{
+   Eina_List *items = NULL;
+   Elm_Object_Item *item;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(list));
+
+   item = elm_list_first_item_get(widget);
+   while (item)
+     {
+        items = eina_list_append(items, item);
+        item = elm_list_item_next(item);
+     }
+
+   return items;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_list_get_n_children(AtkObject *obj)
+{
+   gint n_items;
+   Eina_List *items;
+
+   items = eail_list_get_items(EAIL_LIST(obj));
+   n_items = eina_list_count(items);
+
+   eina_list_free(items);
+
+   return n_items;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_list_ref_child(AtkObject *obj, gint i)
+{
+   Eina_List *items;
+   AtkObject *child = NULL;
+
+   items = eail_list_get_items(EAIL_LIST(obj));
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                          (eina_list_nth(items, i), ATK_ROLE_LIST_ITEM, obj);
+
+        g_object_ref(child);
+     }
+
+   eina_list_free(items);
+
+   return child;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_state_set callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the state set of the accessible; the caller must
+ * unreference it when it is no longer needed.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns reference to an AtkStateSet which is the state set of the
+ * accessible
+ */
+static AtkStateSet *
+eail_list_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+   state_set = ATK_OBJECT_CLASS(eail_list_parent_class)->ref_state_set(obj);
+
+   if (!widget) return state_set;
+
+   if (elm_list_multi_select_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_MULTISELECTABLE);
+
+   return state_set;
+}
+
+/**
+ * @brief Initializer for GObject EailList instance
+ *
+ * @param list an EailList
+ */
+static void
+eail_list_init(EailList *list)
+{
+}
+
+/**
+ * @brief Initializer for GObject class (defines callbacks for base AtkObject)
+ *
+ * @param klass an EailList class
+ */
+static void
+eail_list_class_init(EailListClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_list_initialize;
+   class->get_n_children = eail_list_get_n_children;
+   class->ref_child = eail_list_ref_child;
+   class->ref_state_set = eail_list_ref_state_set;
+}
+
+/*
+ * Functions for *EailItemParent* interface
+ */
+
+/**
+ * @brief Implementation of EailItemParent->get_item_role callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ *
+ * @returns role of target item in the list
+ */
+static AtkRole
+eail_list_get_item_role(EailItemParent  *parent,
+                        EailItem        *item)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!widget || !it) return ATK_ROLE_INVALID;
+
+   if (elm_list_item_separator_get(it))
+     return ATK_ROLE_SEPARATOR;
+
+   return ATK_ROLE_LIST_ITEM;
+}
+
+/**
+ * @brief Implementation of EailItemParent->ref_item_state_set callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @param state_set an AtkStateSet
+ * @returns items state set
+ */
+static AtkStateSet *
+eail_list_ref_item_state_set(EailItemParent *parent,
+                             EailItem       *item,
+                             AtkStateSet    *state_set)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(parent));
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!widget || !it) return state_set;
+
+   if (elm_list_select_mode_get(widget) != ELM_OBJECT_SELECT_MODE_NONE)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_SELECTABLE);
+
+        if (elm_list_item_selected_get(it))
+          atk_state_set_add_state(state_set, ATK_STATE_SELECTED);
+     }
+
+   atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
+   atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
+
+   return state_set;
+}
+
+/**
+ * @brief Implementation of EailItemParent->ref_item_state_set callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_list_grab_item_focus(EailItemParent    *parent,
+                          EailItem          *item)
+{
+   /* it is not possible to focus entire list object */
+   return FALSE;
+}
+
+/**
+ * @brief Implementation of EailItemParent->get_evas_obj callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns item object
+ */
+static Evas_Object *
+eail_list_get_evas_obj(EailItemParent   *parent,
+                       EailItem         *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!it)
+     {
+        ERR("Error. Could not get Elm_Object_item from EailItem");
+        return NULL;
+     }
+
+   return elm_list_item_object_get(it);
+}
+
+/**
+ * @brief Implementation of EailItemParent->get_actions_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns enum representing supported actions
+ */
+static gint
+eail_list_get_actions_supported(EailItemParent   *parent,
+                                EailItem         *item)
+{
+   return EAIL_ACTION_SUPPORTED_CLICK;
+}
+
+/**
+ * @brief Get name of list child
+ *
+ * @param parent EailList instance
+ * @param item EailList child instance
+ *
+ * @returns const gchar * representing name of the child
+ */
+static const gchar *
+eail_list_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   /*that will work only for default theme*/
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief Initialization of EailItemParentIface callbacks
+ *
+ * @param iface an EailItemParent interface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_item_name            = eail_list_item_name_get;
+   iface->get_item_role            = eail_list_get_item_role;
+   iface->ref_item_state_set       = eail_list_ref_item_state_set;
+   iface->grab_item_focus          = eail_list_grab_item_focus;
+   iface->get_evas_obj             = eail_list_get_evas_obj;
+   iface->get_actions_supported    = eail_list_get_actions_supported;
+}
+
+/*
+ * Functions for the *AtkSelection* interface
+ */
+
+/**
+ * @brief Implementation of AtkSelection->add_selection callback
+ *
+ * As described in ATK doc:\n
+ * Adds the specified accessible child of the object to the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns TRUE if operation ended successfully, FALSE otherwise
+ */
+static gboolean
+eail_list_add_selection(AtkSelection *selection,
+                        gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   const Eina_List *items = elm_list_items_get(object);
+   Elm_Object_Item *item = eina_list_nth(items, i);
+
+   if (!item) return FALSE;
+
+   elm_list_item_selected_set(item, EINA_TRUE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->ref_selection callback
+ *
+ * As described in ATK doc:\n
+ * Gets a reference to the accessible object representing the specified selected
+ * child of the object. Note: callers should not rely on NULL or on a zero value
+ * for indication of whether AtkSelectionIface is implemented, they should use
+ * type checking/interface checking macros or the atk_get_accessible_value()
+ * convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns an AtkObject representing the selected accessible , or NULL if
+ * selection does not implement this interface
+ */
+static AtkObject *
+eail_list_ref_selection(AtkSelection *selection,
+                        gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), NULL);
+
+   return eail_list_ref_child(ATK_OBJECT(selection), i);
+}
+
+/**
+ * @brief Implementation of AtkSelection->get_selection_count callback
+ *
+ * As described in ATK doc:\n
+ * Gets the number of accessible children currently selected. Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+
+ * @param selection an AtkSelection
+ *
+ * @returns gint representing number of selected elements
+ */
+static gint
+eail_list_get_selection_count(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   const Eina_List *sel_objs = elm_list_selected_items_get(object);
+
+   if (!sel_objs) return 0;
+
+   return eina_list_count(sel_objs);
+}
+
+/**
+ * @brief Implementation of AtkSelection->is_child_selected callback
+ *
+ * As described in ATK doc:\n
+ * Determines if the current child of this object is selected Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns a gboolean representing if the specified child is selected, or
+ * FALSE if selection does not implement this interface.
+ */
+static gboolean
+eail_list_is_child_selected(AtkSelection *selection,
+                            gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *selected_item = elm_list_selected_item_get(object);
+   Elm_Object_Item *last_item = elm_list_last_item_get(object);
+   Elm_Object_Item *item = elm_list_first_item_get(object);
+   gint n = 0;
+
+   /* if there is no selected object, that naturally means that none
+    * of children is selected */
+   if (!selected_item) return FALSE;
+
+   do
+     {
+        if (selected_item == item) break;
+
+        item = elm_list_item_next(item);
+        n++;
+     } while (item != last_item);
+
+   return i == n;
+}
+
+/**
+ * @brief Implementation of AtkSelection->remove_selection callback
+ *
+ * As described in ATK doc:\n
+ * Removes the specified child of the object from the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i slection index
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_list_remove_selection(AtkSelection *selection,
+                           gint i)
+{
+   const Eina_List *items = NULL;
+   Evas_Object *object = NULL;
+   Elm_Object_Item *item = NULL;
+
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   g_return_val_if_fail(object, FALSE);
+
+   items = elm_list_items_get(object);
+   g_return_val_if_fail((eina_list_count(items) > i), FALSE);
+
+   item = eina_list_nth(items, i);
+   elm_list_item_selected_set(item, EINA_FALSE);
+
+   /* if change was successful, then selected item now should be different */
+   return (elm_list_selected_item_get(object) != item);
+}
+
+/**
+ * @brief Helper function that selects/unselects all items in the list depending
+ * on "selected" param value
+ *
+ * @param object an Evas_Object
+ * @param selected selected state (TRUE means selected)
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_list_mark_all_selected_state(const Evas_Object *object, Eina_Bool selected)
+{
+   const Eina_List *items = NULL;
+   int i = 0;
+
+   items = elm_list_items_get(object);
+   for (i = 0; i < eina_list_count(items); ++i)
+     {
+        Elm_Object_Item *item = eina_list_nth(items, i);
+        if (!item) return FALSE;
+
+        elm_list_item_selected_set(item, selected);
+     }
+
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->select_all_selection callback
+ *
+ * As described in ATK doc:\n
+ * Causes every child of the object to be selected if the object supports
+ * multiple selections.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_list_select_all_selection(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+
+   /* can select all only when multiselect is enabled */
+   if (!elm_list_multi_select_get(object)) return FALSE;
+
+   return eail_list_mark_all_selected_state(object, EINA_TRUE);
+}
+
+/**
+ * @brief Implementation of AtkSelection->clear_selection callback
+ *
+ * As described in ATK doc:\n
+ * Clears the selection in the object so that no children in the object are
+ * selected.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_list_clear_selection(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+
+   return eail_list_mark_all_selected_state(object, EINA_FALSE);
+}
+
+/**
+ * @brief Initializer of AtkSelectionIface interface
+ *
+ * @param iface an AtkSelection interface
+ */
+static void atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   iface->add_selection        = eail_list_add_selection;
+   iface->clear_selection      = eail_list_clear_selection;
+   iface->ref_selection        = eail_list_ref_selection;
+   iface->get_selection_count  = eail_list_get_selection_count;
+   iface->is_child_selected    = eail_list_is_child_selected;
+   iface->remove_selection     = eail_list_remove_selection;
+   iface->select_all_selection = eail_list_select_all_selection;
+}
diff --git a/eail/eail/eail_list.h b/eail/eail/eail_list.h
new file mode 100644 (file)
index 0000000..b83b75b
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_list.h
+ *
+ * @brief Header for EailList implementation
+ */
+
+#ifndef EAIL_LIST_H
+#define EAIL_LIST_H
+
+#include "eail_scrollable_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailList class
+ */
+
+#define EAIL_TYPE_LIST            (eail_list_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailList
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_LIST(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                   EAIL_TYPE_LIST, EailList))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailList class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_LIST_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                   EAIL_TYPE_LIST, EailListClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailList class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_LIST(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                   EAIL_TYPE_LIST))
+/**
+ * @brief Tests whether given klass is a subclass of EailList
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                   EAIL_TYPE_LIST))
+/**
+ * @brief Gets EailList class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailList class from
+ */
+#define EAIL_LIST_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                   EAIL_TYPE_LIST, EailListClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailList*/
+typedef struct _EailList      EailList;
+/** @brief Definition of object class for Atk EailList*/
+typedef struct _EailListClass EailListClass;
+
+/** @brief Definition of object structure for Atk EailList*/
+struct _EailList
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailScrollableWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailList*/
+struct _EailListClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+  EailScrollableWidgetClass parent_class;
+};
+
+/** @brief Getter for EailList GType
+ * @returns GType for EailList implementation*/
+GType eail_list_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_map.c b/eail/eail/eail_map.c
new file mode 100644 (file)
index 0000000..a2ebf81
--- /dev/null
@@ -0,0 +1,382 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_map.c
+ * @brief EailMap implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_map.h"
+#include "eail_utils.h"
+
+/**
+ * @brief Press action name
+ */
+#define EAIL_MAP_ACTION_PRESS "press"
+
+/**
+ * @brief ScrollUp action name
+ */
+#define EAIL_MAP_ACTION_SCROLL_UP "scroll_up"
+
+/**
+ * @brief ScrollDown action name
+ */
+#define EAIL_MAP_ACTION_SCROLL_DOWN "scroll_down"
+
+/**
+ * @brief ScrollLeft action name
+ */
+#define EAIL_MAP_ACTION_SCROLL_LEFT "scroll_left"
+
+/**
+ * @brief ScrollRight action name
+ */
+#define EAIL_MAP_ACTION_SCROLL_RIGHT "scroll_right"
+
+/**
+ * @brief ZoomIn action name
+ */
+#define EAIL_MAP_ACTION_ZOOM_IN "zoom_in"
+
+/**
+ * @brief ZoomOut action name
+ */
+#define EAIL_MAP_ACTION_ZOOM_OUT "zoom_out"
+
+/**
+ * @brief Zoom increment
+ */
+#define EAIL_MAP_ZOOM_STEP 1
+
+static void akt_image_interface_init(AtkImageIface *iface);
+
+/**
+ * @brief EailMap type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailMap,
+                        eail_map,
+                        EAIL_TYPE_IMAGE,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              akt_image_interface_init)) ;
+
+static void eail_map_set_actions(AtkObject *obj);
+
+/**
+ * @brief EailMap initializer
+ *
+ * @param object an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_map_initialize(AtkObject *object, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_map_parent_class)->initialize(object, data);
+   object->role = ATK_ROLE_IMAGE_MAP;
+
+   eail_map_set_actions(object);
+}
+
+/**
+ * @brief EailMap finalizer
+ *
+ * @param object a GObject
+ */
+static void
+eail_map_finalize(GObject *object)
+{
+   EailMap *map = EAIL_MAP(object);
+   eina_stringshare_del(map->name);
+
+   G_OBJECT_CLASS(eail_map_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Gets object name
+ *
+ * @param object an AtkObject
+ * @return EailMap name if name is assigned, map path otherwise
+ */
+static const gchar*
+eail_map_name_get(AtkObject *object)
+{
+   Evas_Object *widget;
+   EailMap *map;
+   const gchar *atk_name = NULL;
+
+   /* returning name from ATK default implementation if available */
+   atk_name = ATK_OBJECT_CLASS(eail_map_parent_class)->get_name(object);
+   if (atk_name)
+     return atk_name;
+
+   g_return_val_if_fail(EAIL_IS_MAP(object), NULL);
+
+   map = EAIL_MAP(object);
+   if (map->name) return map->name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(map));
+   if (!widget) return NULL;
+
+   map->name =
+           eina_stringshare_printf("Map(%s)",
+                                   elm_map_source_get(widget,
+                                                      ELM_MAP_SOURCE_TYPE_NAME));
+   return map->name;
+}
+
+/**
+ * @brief EailMap instance initializer
+ *
+ * @param map an EailMap
+ */
+static void
+eail_map_init(EailMap *map)
+{
+   map->name = NULL;
+}
+
+/**
+ * @brief EailMap class initializer
+ *
+ * @param klass an EailMapClass
+ */
+static void
+eail_map_class_init(EailMapClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_map_initialize;
+   class->get_name = eail_map_name_get;
+
+   g_object_class->finalize = eail_map_finalize;
+}
+
+/**
+ * @brief Gets image size
+ *
+ * Image size is the same as window size
+ *
+ * @param image an AtkImage
+ * @param [out] width image width
+ * @param [out] height image height
+ */
+static void
+eail_map_image_size_get(AtkImage *image, gint *width, gint *height)
+{
+   atk_component_get_size(ATK_COMPONENT(image), width, height);
+}
+
+/**
+ * @brief AtkImage interface initializer
+ *
+ * @param iface an AtkImage interface
+ */
+static void
+akt_image_interface_init(AtkImageIface *iface)
+{
+   if (!iface) return;
+
+   iface->get_image_size = eail_map_image_size_get;
+}
+
+/*
+ * AtkAction implementation
+ */
+
+/**
+ * @brief ScrollUp action callback
+ *
+ * @param action an AtkAction
+ * @param data callback data
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_map_action_scroll_up(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_MAP(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   return eail_action_scroll_up(widget, NULL);
+}
+
+/**
+ * @brief ScrollDown action callback
+ *
+ * @param action an AtkAction
+ * @param data callback data
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_map_action_scroll_down(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_MAP(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   return eail_action_scroll_down(widget, NULL);
+}
+
+/**
+ * @brief ScrollLeft action callback
+ *
+ * @param action an AtkAction
+ * @param data callback data
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_map_action_scroll_left(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_MAP(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   return eail_action_scroll_left(widget, NULL);
+}
+
+/**
+ * @brief ScrollRight action callback
+ *
+ * @param action an AtkAction
+ * @param data callback data
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_map_action_scroll_right(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_MAP(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   return eail_action_scroll_right(widget, NULL);
+}
+
+/**
+ * @brief ZoomIn action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_map_action_zoom_in(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   int new_zoom;
+
+   g_return_val_if_fail(EAIL_IS_MAP(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   new_zoom = elm_map_zoom_get(widget) + EAIL_MAP_ZOOM_STEP;
+   elm_map_zoom_set(widget, new_zoom);
+
+   return TRUE;
+}
+
+/**
+ * @brief ZoomOut action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_map_action_zoom_out(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   int new_zoom;
+
+   g_return_val_if_fail(EAIL_IS_MAP(action), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   new_zoom = elm_map_zoom_get(widget) - EAIL_MAP_ZOOM_STEP;
+
+   elm_map_zoom_set(widget, new_zoom);
+
+   return TRUE;
+}
+
+/**
+ * @brief Press action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_map_action_press(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_MAP(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   evas_object_smart_callback_call(widget, "press", NULL);
+   return TRUE;
+}
+
+/**
+ * @brief Sets EailMap actions
+ *
+ * @param obj an AtkObject
+ */
+static void
+eail_map_set_actions(AtkObject *obj)
+{
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_MAP_ACTION_PRESS,
+                                    NULL,
+                                    _eail_map_action_press);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_MAP_ACTION_SCROLL_UP,
+                                    NULL,
+                                    _eail_map_action_scroll_up);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_MAP_ACTION_SCROLL_DOWN,
+                                    NULL,
+                                    _eail_map_action_scroll_down);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_MAP_ACTION_SCROLL_LEFT,
+                                    NULL,
+                                    _eail_map_action_scroll_left);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_MAP_ACTION_SCROLL_RIGHT,
+                                    NULL,
+                                    _eail_map_action_scroll_right);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_MAP_ACTION_ZOOM_IN,
+                                    NULL,
+                                    _eail_map_action_zoom_in);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_MAP_ACTION_ZOOM_OUT,
+                                    NULL,
+                                    _eail_map_action_zoom_out);
+}
diff --git a/eail/eail/eail_map.h b/eail/eail/eail_map.h
new file mode 100644 (file)
index 0000000..63edaf0
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_map.h
+ *
+ * @brief Header for EailMap implementation
+ */
+#ifndef EAIL_MAP_H
+#define EAIL_MAP_H
+
+#include "eail_image.h"
+/**
+ * @brief Returns a value corresponding to the type of EailMap class
+ */
+#define EAIL_TYPE_MAP             (eail_map_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailMap
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_MAP(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                   EAIL_TYPE_MAP, EailMap))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailMap class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_MAP_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                   EAIL_TYPE_MAP, EailMapClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailMap class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_MAP(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                   EAIL_TYPE_MAP))
+/**
+ * @brief Tests whether given klass is a subclass of EailMap
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_MAP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                   EAIL_TYPE_MAP))
+/**
+ * @brief Gets EailMap class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailMap class from
+ */
+#define EAIL_MAP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                   EAIL_TYPE_MAP, EailMapClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailMap*/
+typedef struct _EailMap       EailMap;
+/** @brief Definition of object class for Atk EailMap*/
+typedef struct _EailMapClass  EailMapClass;
+
+/** @brief Definition of object structure for Atk EailMap*/
+struct _EailMap
+{
+   EailImage parent;/**< @brief widget that functionality is being extended*/
+   const char *name;/**< @brief name string property for map*/
+};
+
+/** @brief Definition of object class for Atk EailMap*/
+struct _EailMapClass
+{
+   EailImageClass parent_class;/**< @brief class that is being extended*/
+};
+
+/**
+ * @brief Getter for EailMap GType
+ * @returns GType for EailMap implementation
+ */
+GType eail_map_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_mapbuf.c b/eail/eail/eail_mapbuf.c
new file mode 100644 (file)
index 0000000..2876ce8
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_mapbuf.c
+ * @brief EailMapbuf implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_mapbuf.h"
+
+/**
+ * @brief EailMapbuf type definition
+ */
+G_DEFINE_TYPE(EailMapbuf, eail_mapbuf, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief EailMapbuf initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_mapbuf_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_mapbuf_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_IMAGE_MAP;
+}
+/**
+ * @brief Gets widget children
+ *
+ * @param widget an EailWidget
+ * @return widget children list
+ */
+static Eina_List*
+eail_mapbuf_children_get(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *o, *object;
+
+   g_return_val_if_fail(EAIL_IS_WIDGET(widget), NULL);
+
+   object = eail_widget_get_widget(widget);
+
+   o = elm_object_part_content_get(object, "default");
+   if (!o) return NULL;
+
+   list = eina_list_append(list, o);
+   return list;
+}
+
+/**
+ * @brief Gets object state set
+ *
+ * The caller must unreference it when it is no longed needed
+ *
+ * @param object an AtkObject
+ * @return object state set
+ */
+static AtkStateSet*
+eail_mapbuf_ref_state_set(AtkObject *object)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_MAPBUF(object), NULL);
+   widget = eail_widget_get_widget(EAIL_WIDGET(object));
+   if (!widget) return NULL;
+
+   state_set =
+      ATK_OBJECT_CLASS(eail_mapbuf_parent_class)->ref_state_set(object);
+   if (elm_mapbuf_enabled_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
+
+   return state_set;
+}
+
+/**
+ * @brief EailMapbuf instance initializer
+ *
+ * @param mapbuf an EailMapbuf
+ */
+static void
+eail_mapbuf_init(EailMapbuf *mapbuf)
+{
+}
+
+/**
+ * @brief EailMapbuf class initializer
+ *
+ * @param klass an EailMapbuf class
+ */
+static void
+eail_mapbuf_class_init(EailMapbufClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   class->initialize = eail_mapbuf_initialize;
+   class->ref_state_set = eail_mapbuf_ref_state_set;
+
+   widget_class->get_widget_children = eail_mapbuf_children_get;
+}
diff --git a/eail/eail/eail_mapbuf.h b/eail/eail/eail_mapbuf.h
new file mode 100644 (file)
index 0000000..b47b8cd
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_mapbuf.h
+ *
+ * @brief Header for EailMapbuf implementation
+ */
+
+#ifndef EAIL_MAPBUF_H
+#define EAIL_MAPBUF_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailMapbuf class
+ */
+#define EAIL_TYPE_MAPBUF            (eail_mapbuf_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailMapbuf
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_MAPBUF(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_MAPBUF, EailMapbuf))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailMapbuf class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_MAPBUF_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_MAPBUF, EailMapbufClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailMapbuf class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_MAPBUF(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_MAPBUF))
+/**
+ * @brief Tests whether given klass is a subclass of EailMapbuf
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_MAPBUF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_MAPBUF))
+/**
+ * @brief Gets EailMapbuf class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailMapbuf class from
+ */
+#define EAIL_MAPBUF_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_MAPBUF, EailMapbufClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailMapbuf*/
+typedef struct _EailMapbuf      EailMapbuf;
+/** @brief Definition of object class for Atk EailMapbuf*/
+typedef struct _EailMapbufClass EailMapbufClass;
+
+/** @brief Definition of object structure for Atk EailMapbuf*/
+struct _EailMapbuf
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailMapbuf*/
+struct _EailMapbufClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/**@brief Getter for EailMapbuf GType
+ * @returns GType for EailMapbuf implementation */
+GType eail_mapbuf_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_menu.c b/eail/eail/eail_menu.c
new file mode 100644 (file)
index 0000000..5e076c5
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_menu.c
+ * @brief Implementation of menu widget
+ */
+
+#include <Elementary.h>
+
+#include "eail_menu.h"
+#include "eail_item_parent.h"
+#include "eail_factory.h"
+#include "eail_priv.h"
+
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+
+/**
+ * @brief Definition of EailMenu as GObject
+ *
+ * EailList is extended Widget with EAIL_TYPE_ITEM_PARENT implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailMenu,
+                        eail_menu,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief Initializer for AtkObjectClass
+ */
+static void
+eail_menu_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_menu_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_MENU;
+}
+
+/**
+ * @brief Prepares Eina_List filled with Elm_Object_Item* objects
+ * representing items in menu
+ *
+ * @param list an EailMenu
+ *
+ * @return filled list with list items. Call eina_list_free on that list when
+ * results processing has been finished
+ */
+static Eina_List *
+eail_menu_get_items(EailMenu *list)
+{
+   Eina_List *items = NULL;
+   Elm_Object_Item *item;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(list));
+
+   item = elm_menu_first_item_get(widget);
+   while (item)
+     {
+        items = eina_list_append(items, item);
+        item = elm_menu_item_next_get(item);
+     }
+
+   return items;
+}
+
+/**
+ * @brief Implementation of AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_menu_get_n_children(AtkObject *obj)
+{
+   gint n_items;
+   Eina_List *items;
+
+   items = eail_menu_get_items(EAIL_MENU(obj));
+   n_items = eina_list_count(items);
+
+   eina_list_free(items);
+
+   return n_items;
+}
+
+/**
+ * @brief Implementation of AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_menu_ref_child(AtkObject *obj, gint i)
+{
+   Eina_List *items;
+   AtkObject *child = NULL;
+
+   items = eail_menu_get_items(EAIL_MENU(obj));
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                 (eina_list_nth(items, i), ATK_ROLE_LIST_ITEM, obj);
+
+        g_object_ref(child);
+     }
+
+   eina_list_free(items);
+
+   return child;
+}
+
+
+/**
+ * @brief Gets name of EailItem
+ *
+ * Implementation of AtkObject->get_name callback
+ *
+ * ATK doc says:
+ * Gets the accessible name of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns a character string representing the accessible description of
+ * the accessible.
+ */
+static const gchar *
+eail_menu_get_name(AtkObject *obj)
+{
+   AtkObject *parent = NULL;
+   const gchar *atk_name = NULL;
+
+   /* returning name from ATK default implementation if available */
+   atk_name = ATK_OBJECT_CLASS(eail_menu_parent_class)->get_name(obj);
+   if (atk_name)
+     return atk_name;
+
+   parent = atk_object_get_parent(obj);
+   if (!parent) return NULL;
+
+   return parent->name;
+}
+
+/**
+ * @brief Initializer for GObject EailMenu instance
+ * @param menu an EailMenu
+ */
+static void
+eail_menu_init(EailMenu *menu)
+{
+}
+
+/**
+ * @brief Initializer for GObject class (defines callbacks for base AtkObject)
+ * @param klass an EailMenuClass
+ */
+static void
+eail_menu_class_init(EailMenuClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_menu_initialize;
+   class->get_n_children = eail_menu_get_n_children;
+   class->ref_child = eail_menu_ref_child;
+   class->get_name = eail_menu_get_name;
+}
+
+/* Child MenuItem handling  - implementation of EailItemParent interface*/
+
+/**
+ * @brief Get name of list child
+ *
+ * @param parent EailList instance
+ * @param item EailList child instance
+ *
+ * @returns const gchar * representing name of the child
+ */
+static const gchar *
+eail_menu_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief Implementation of EailItemParent->get_evas_obj callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns menu item
+ */
+Evas_Object *
+eail_menu_item_get_evas_obj(EailItemParent   *parent,
+                       EailItem         *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!it)
+     {
+        ERR("Error. Could not get Elm_Object_item from EailItem");
+        return NULL;
+     }
+
+   return elm_menu_item_object_get(it);
+}
+
+/**
+ * @brief Implementation of EailItemParent->get_actions_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns enum representing supported actions
+ */
+static gint
+eail_menu_get_actions_supported(EailItemParent   *parent,
+                                   EailItem         *item)
+{
+   return EAIL_ACTION_SUPPORTED_CLICK;
+}
+
+/**
+ * @brief Prepares Eina_List filled with Elm_Object_Item* objects
+ * representing items in the list
+ * @param menu_item_obj child of menu widget
+ *
+ * @return filled list with menu items. Call eina_list_free on that list when
+ * results processing has been finished
+ */
+static const Eina_List *
+eail_menu_item_get_items(EailItem *menu_item_obj)
+{
+   const Eina_List *items = NULL;
+   EailItem *eail_item = EAIL_ITEM(menu_item_obj);
+   Elm_Object_Item *it = eail_item_get_item(eail_item);
+
+   items = elm_menu_item_subitems_get(it);
+
+   return items;
+}
+
+/**
+ * @brief Implementation of AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param parent EAIL representation of menu widget
+ * @param eail_item child of menu widget
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_menu_item_get_n_children(EailItemParent *parent, EailItem *eail_item)
+{
+   gint n_items;
+   const Eina_List *items;
+   Evas_Object *inside_widget = NULL;
+
+   items = eail_menu_item_get_items(eail_item);
+   n_items = eina_list_count(items);
+
+   /* increasing child items count for widgets that are stored inside
+    * menu item (eg. icon or button). They will be appended at the end
+    * of the children list in eail_menu_item_ref_child func*/
+   inside_widget = elm_object_item_content_get(eail_item_get_item(eail_item));
+   if (inside_widget)
+     n_items++;
+
+   return n_items;
+}
+
+/**
+ * @brief Creates content widgets from given menu_item AtkObject
+ *
+ * @param menu_item_obj an AtkObject menu item
+ * @returns AtkObject representing nested content in menu item
+ */
+static AtkObject *
+_eail_menu_item_create_content_atk_obj(AtkObject *menu_item_obj)
+{
+   EailItem *eail_item = EAIL_ITEM(menu_item_obj);
+   Evas_Object *content_widget = NULL;
+   AtkObject *content_atk_obj = NULL;
+
+   content_widget = elm_object_item_content_get(eail_item_get_item(eail_item));
+
+   if (!content_widget)
+     {
+        ERR("Content widget could not be found in menu_item.");
+        return NULL;
+     }
+
+   content_atk_obj = eail_factory_get_accessible(content_widget);
+
+   return content_atk_obj;
+}
+
+/**
+ * @brief Implementation of AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_menu_item_ref_child(EailItemParent   *parent,
+                         EailItem         *item,
+                         gint             i)
+{
+   const Eina_List *items;
+   AtkObject *child = NULL;
+   Elm_Object_Item *elm_obj_item = NULL;
+
+   items = eail_menu_item_get_items(item);
+   if (eina_list_count(items) > i)
+     {
+        elm_obj_item = eina_list_nth(items, i);
+
+        /* creating new menu item from Elm_Object_Item */
+        child = eail_factory_get_item_atk_obj
+                         (elm_obj_item, ATK_ROLE_LIST_ITEM, ATK_OBJECT(parent));
+     }
+   else if (eina_list_count(items) == i)
+     {
+        /* ref to widget inside menu item has to be referenced */
+        child = _eail_menu_item_create_content_atk_obj(ATK_OBJECT(item));
+     }
+
+   if (child)
+     g_object_ref(child);
+   else
+     ERR("Could not ref menu item child for index %d", i);
+
+   return child;
+}
+
+/**
+ * @brief Implementation of EailItemParent->is_content_get_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns FALSE
+ */
+gboolean
+eail_menu_item_content_get_support(EailItemParent   *parent,
+                                   EailItem         *item)
+{
+   return FALSE;
+}
+
+/**
+ * @brief Initializes EailItemParentIface callbacks
+ *
+ * @param iface an EailItemParent interface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_evas_obj = eail_menu_item_get_evas_obj;
+   iface->get_item_name = eail_menu_item_name_get;
+   iface->get_n_children = eail_menu_item_get_n_children;
+   iface->ref_n_child = eail_menu_item_ref_child;
+   iface->get_actions_supported = eail_menu_get_actions_supported;
+   iface->is_content_get_supported = eail_menu_item_content_get_support;
+}
diff --git a/eail/eail/eail_menu.h b/eail/eail/eail_menu.h
new file mode 100644 (file)
index 0000000..ae3f56f
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_MENU_H
+#define EAIL_MENU_H
+
+/**
+ * @file eail_menu.h
+ *
+ * @brief Header for EailMenu implementation
+ */
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailMenu class
+ */
+#define EAIL_TYPE_MENU             (eail_menu_get_type ())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailMenu
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_MENU(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                    EAIL_TYPE_MENU, EailMenu))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailMenu class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_MENU_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                    EAIL_TYPE_MENU, EailMenuClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailMenu class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_MENU(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                    EAIL_TYPE_MENU))
+/**
+ * @brief Tests whether given klass is a subclass of EailMenu
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_MENU_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                    EAIL_TYPE_MENU))
+/**
+ * @brief Gets EailMenu class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailMenu class from
+ */
+#define EAIL_MENU_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                    EAIL_TYPE_MENU, EailMenuClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailMenu*/
+typedef struct _EailMenu      EailMenu;
+/** @brief Definition of object class for Atk EailMenu*/
+typedef struct _EailMenuClass EailMenuClass;
+
+/** @brief Definition of object structure for Atk EailMenu*/
+struct _EailMenu
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailMenu*/
+struct _EailMenuClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailMenu GType
+ * @returns GType for EailMenu implementation*/
+GType eail_menu_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_multibuttonentry.c b/eail/eail/eail_multibuttonentry.c
new file mode 100644 (file)
index 0000000..5a883bd
--- /dev/null
@@ -0,0 +1,670 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_multibuttonentry.c
+ * @brief EailMultibuttonentry implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_multibuttonentry.h"
+#include "eail_factory.h"
+#include "eail_item_parent.h"
+#include "eail_priv.h"
+#include "eail_utils.h"
+#include "eail_clipboard.h"
+
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+static void atk_editable_text_interface_init(AtkEditableTextIface *iface);
+static void atk_text_interface_init(AtkTextIface *iface);
+
+/**
+ * @brief EailMultibuttonentry type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailMultibuttonentry,
+                        eail_multibuttonentry,
+                        EAIL_TYPE_ACTION_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_EDITABLE_TEXT,
+                                              atk_editable_text_interface_init)
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init));
+
+/**
+ * @brief Implementation of EailItemParent->is_content_get_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns FALSE
+ */
+gboolean
+eail_multibuttonentry_content_get_support(EailItemParent   *parent,
+                                          EailItem         *item)
+{
+   return FALSE;
+}
+
+/**
+ * @brief Get name of Multibuttonentry child
+ *
+ * Implementation of get_item_name callback of EailItemParent interface
+ *
+ * @param parent Multibuttonentry instance
+ * @param item Multibuttonentry child instance
+ *
+ * @returns const gchar * representing name of the child
+ */
+static const gchar *
+eail_multibuttonentry_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   /*that will work only for default theme*/
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief EailItemParent interface initializer
+ *
+ * Initialization of callbacks used by EailItemParent interface.
+ *
+ * @param iface an EailItemParentIface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->is_content_get_supported = eail_multibuttonentry_content_get_support;
+   iface->get_item_name = eail_multibuttonentry_item_name_get;
+}
+
+/**
+ * @brief Helper function for getting multibuttonentry text
+ *
+ * @param text an AtkText (EailMultibutton object)
+ *
+ * @return string representation of multibutton entry text
+ */
+static const gchar*
+_eail_multibuttonentry_get_entry_string(AtkText *text)
+{
+   const gchar *string = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   Evas_Object *entry = elm_multibuttonentry_entry_get(widget);
+
+   if (entry)
+     string = elm_entry_entry_get(entry);
+
+   /* if entry string is empty then trying to return "guide" part*/
+   if (!string || 0 == g_strcmp0(string, ""))
+     {
+        /* If there are some children of widget, then it means that guide
+         * is not visible. So returning guide as text only if no children
+         * exist */
+        if (!elm_multibuttonentry_items_get(widget))
+          string = elm_object_part_text_get(widget, "guide");
+     }
+
+   return string;
+}
+
+/**
+ * @brief Gets text bounded by start_offset and end_offset
+ *
+ * Use g_free() to free the returned string
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, -1 for the end of the string
+ * @return string containing text from start_offset up to, but not including
+ * end_offset
+ */
+static gchar*
+eail_multibuttonentry_get_text(AtkText   *text,
+                   gint       start_offset,
+                   gint       end_offset)
+{
+   const gchar *string = NULL;
+
+   string = _eail_multibuttonentry_get_entry_string(text);
+
+   return eail_get_substring(string, start_offset, end_offset);
+}
+
+/**
+ * @brief Gets character at offset
+ *
+ * @param text an AtkText
+ * @param offset
+ * @return character at offset
+ */
+static gunichar
+eail_multibuttonentry_get_character_at_offset(AtkText    *text,
+                                              gint        offset)
+{
+   gunichar character = '\0';
+
+   character = g_utf8_get_char(
+         g_utf8_offset_to_pointer
+                     (_eail_multibuttonentry_get_entry_string(text), offset));
+
+   return character;
+}
+
+/**
+ * @brief Gets text length
+ *
+ * @param text an AtkText
+ * @return text length
+ */
+static gint
+eail_multibuttonentry_get_character_count(AtkText *text)
+{
+   gint count = 0;
+   const gchar *string_text = NULL;
+
+   string_text = _eail_multibuttonentry_get_entry_string(text);
+   if (!string_text) return count;
+
+   count = g_utf8_strlen(string_text, -1);
+
+   return count;
+}
+
+/**
+ * @brief AktText initialization function
+ *
+ * @param iface an AtkTextIface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+   iface->get_text = eail_multibuttonentry_get_text;
+   iface->get_character_at_offset = eail_multibuttonentry_get_character_at_offset;
+   iface->get_character_count = eail_multibuttonentry_get_character_count;
+}
+
+/**
+ * @brief Sets text contents of text
+ *
+ * @param text an AtkEditableText
+ * @param string new text to be set
+ */
+static void
+eail_multibuttonentry_set_text_contents(AtkEditableText *text,
+                                        const gchar *string)
+{
+   Evas_Object *entry;
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return;
+
+   entry = elm_multibuttonentry_entry_get(widget);
+   if (!entry) return;
+
+   if (elm_multibuttonentry_editable_get(widget))
+     elm_entry_entry_set(entry, string);
+}
+
+/**
+ * @brief Copies text content from entry to clipboard
+ *
+ * @param text an AtkEditableText
+ * @param start_pos start position of cursor
+ * @param end_pos end position of cursor
+ */
+static void
+eail_multibuttonentry_copy_text(AtkEditableText *text,
+                     gint             start_pos,
+                     gint             end_pos)
+{
+   Evas_Object *widget;
+   Evas_Object *entry;
+   const char *entry_text;
+   char *tmp;
+
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget) return;
+
+   entry = elm_multibuttonentry_entry_get(widget);
+   entry_text = elm_entry_entry_get(entry);
+   tmp = eail_get_substring(entry_text, start_pos, end_pos);
+   eail_clipboard_set_text(tmp);
+   g_free(tmp);
+}
+
+/**
+ * @brief Cuts text content from entry to clipboard
+ *
+ * @param text an AtkEditableText
+ * @param start_pos start position of cursor
+ * @param end_pos end position of cursor
+ */
+static void
+eail_multibuttonentry_cut_text(AtkEditableText *text,
+                    gint             start_pos,
+                    gint             end_pos)
+{
+   Evas_Object *widget;
+   Evas_Object *entry;
+   const char *entry_text;
+   char *tmp;
+   GString *s;
+
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_multibuttonentry_editable_get(widget)) return;
+
+   entry = elm_multibuttonentry_entry_get(widget);
+   entry_text = elm_entry_entry_get(entry);
+   tmp = eail_get_substring(entry_text, start_pos, end_pos);
+   eail_clipboard_set_text(tmp);
+   g_free(tmp);
+
+   s = g_string_new(entry_text);
+   s = g_string_erase(s, start_pos, end_pos - start_pos);
+
+   elm_entry_entry_set(entry, s->str);
+   g_string_free(s, TRUE);
+}
+
+/**
+ * @brief Pastes text content from clipboard into entry
+ *
+ * @param text an AtkEditableText
+ * @param position start position of cursor
+ */
+static void
+eail_multibuttonentry_paste_text(AtkEditableText *text,
+                                 gint position)
+{
+   Evas_Object *widget;
+   Evas_Object *entry = NULL;
+   GString *s;
+   const char *tmp;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_multibuttonentry_editable_get(entry))
+     return;
+
+   entry = elm_multibuttonentry_entry_get(widget);
+   s = g_string_new(elm_entry_entry_get(entry));
+   tmp = eail_clipboard_get_text();
+   s = g_string_insert(s, position, tmp);
+   elm_entry_entry_set(entry, s->str);
+   g_string_free(s, TRUE);
+}
+
+/**
+ * @brief Deletes text between start_pos and end_pos but not
+ * including end_pos
+ *
+ * @param text an AtkEditableText
+ * @param start_pos start position
+ * @param end_pos end position
+ */
+static void
+eail_multibuttonentry_delete_text(AtkEditableText *text,
+                       gint start_pos,
+                       gint end_pos)
+{
+   Evas_Object *widget;
+   Evas_Object *entry;
+   GString *s;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_multibuttonentry_editable_get(widget)) return;
+
+   entry = elm_multibuttonentry_entry_get(widget);
+   s = g_string_new(elm_entry_entry_get(entry));
+   s = g_string_erase(s, start_pos, end_pos-start_pos);
+   elm_entry_entry_set(entry, s->str);
+   g_string_free(s, TRUE);
+}
+
+/**
+ * @brief Inserts text at given position
+ *
+ * @param text an AtkEditableText
+ * @param string string to insert
+ * @param length string length
+ * @param [out] position at witch text is inserted.
+ * After the call it points at the position after the newly inserted text.
+ */
+static void
+eail_multibuttonentry_insert_text(AtkEditableText *text,
+                       const gchar *string,
+                       gint length,
+                       gint *position)
+{
+   Evas_Object *widget;
+   Evas_Object *entry;
+   GString *s;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(text));
+   if (!widget || !elm_multibuttonentry_editable_get(widget))
+     return;
+
+   entry = elm_multibuttonentry_entry_get(widget);
+   s = g_string_new(elm_entry_entry_get(entry));
+   s = g_string_insert_len(s, *position, string, length);
+   elm_entry_entry_set(entry, s->str);
+   g_string_free(s, TRUE);
+   *position += length;
+}
+
+/**
+ * @brief Initialization for AtkEditableTextIface interface
+ *
+ * Function called upon instance creation. It initializes AtkText interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkEditableTextIface
+ */
+static void
+atk_editable_text_interface_init(AtkEditableTextIface *iface)
+{
+   iface->set_text_contents = eail_multibuttonentry_set_text_contents;
+   iface->copy_text = eail_multibuttonentry_copy_text;
+   iface->cut_text = eail_multibuttonentry_cut_text;
+   iface->paste_text = eail_multibuttonentry_paste_text;
+   iface->delete_text = eail_multibuttonentry_delete_text;
+   iface->insert_text = eail_multibuttonentry_insert_text;
+}
+
+/**
+ * @brief Expand action callback
+ *
+ * @param action an AtkAction
+ * @param data user data passed to callback
+ *
+ * @returns TRUE on action success, FALSE otherwise
+ */
+static gboolean
+eail_multibuttonentry_action_expand_cb(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   if (elm_multibuttonentry_expanded_get(widget)) return FALSE;
+
+   elm_multibuttonentry_expanded_set(widget, EINA_TRUE);
+   atk_object_notify_state_change(ATK_OBJECT(action), ATK_STATE_EXPANDED, TRUE);
+
+   return TRUE;
+}
+
+/**
+ * @brief Shrink action callback
+ *
+ * @param action an AtkAction
+ * @param data user data passed to callback
+ *
+ * @returns TRUE on action success, FALSE otherwise
+ */
+static gboolean
+eail_multibuttonentry_action_shrink_cb(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   if (!elm_multibuttonentry_expanded_get(widget)) return FALSE;
+
+   elm_multibuttonentry_expanded_set(widget, EINA_FALSE);
+   atk_object_notify_state_change(ATK_OBJECT(action), ATK_STATE_EXPANDED, FALSE);
+
+   return TRUE;
+}
+
+/**
+ * @brief Registers multibuttonentry actions
+ *
+ * @param action_widget an EailActionWidget
+ */
+static void eail_multibuttonentry_actions_init(EailActionWidget *action_widget)
+{
+   eail_action_widget_action_append(action_widget, "expand", NULL,
+                                    eail_multibuttonentry_action_expand_cb);
+   eail_action_widget_action_append(action_widget, "shrink", NULL,
+                                    eail_multibuttonentry_action_shrink_cb);
+}
+
+/**
+ * @brief Handler for "item,added" event, used to notify about multibuttonentry
+ * content changes
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info (item is passed here)
+ */
+static void
+eail_multibuttonentry_item_handle_added_event(void *data,
+                                              Evas_Object *obj,
+                                              void *event_info)
+{
+   Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+   AtkObject *atk_item = NULL, *atk_parent = NULL;
+
+   atk_parent = ATK_OBJECT(data);
+   if (!atk_parent) return;
+
+   atk_item = eail_factory_get_item_atk_obj
+                                         (item, ATK_ROLE_LABEL, atk_parent);
+
+   if (!atk_item) return;
+
+   eail_emit_children_changed_obj(TRUE, atk_parent, atk_item);
+}
+
+/**
+ * @brief Handler for "item,deleted" event, used to notify about
+ * multibuttonentry content changes
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info (item is passed here)
+ */
+static void
+eail_multibuttonentry_item_handle_removed_event(void *data,
+                                                Evas_Object *obj,
+                                                void *event_info)
+{
+   Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+   AtkObject *atk_item = NULL, *atk_parent = NULL;
+
+   atk_parent = ATK_OBJECT(data);
+   if (!atk_parent) return;
+
+   atk_item = eail_factory_get_item_atk_obj
+                                         (item, ATK_ROLE_LABEL, atk_parent);
+
+   if (!atk_item) return;
+
+   eail_emit_children_changed_obj(FALSE, atk_parent, atk_item);
+   atk_object_notify_state_change(atk_item, ATK_STATE_DEFUNCT, TRUE);
+
+   DBG("Unregistering item from cache...");
+   eail_factory_unregister_item_from_cache(item);
+}
+
+/**
+ * @brief EailMultibuttonentry type initializer
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+void
+eail_multibuttonentry_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_multibuttonentry_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_ENTRY;
+
+   eail_multibuttonentry_actions_init(EAIL_ACTION_WIDGET(obj));
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "item,added",
+                          eail_multibuttonentry_item_handle_added_event, obj);
+   evas_object_smart_callback_add(nested_widget, "item,deleted",
+                          eail_multibuttonentry_item_handle_removed_event, obj);
+}
+
+/**
+ * @brief EailMultibuttonentry instance initializer
+ *
+ * @param multibuttonentry an EailMultibuttonentry
+ */
+static void
+eail_multibuttonentry_init(EailMultibuttonentry *multibuttonentry)
+{
+}
+
+/**
+ * @brief Gets obj state set
+ *
+ * The caller must unreference it when it is no longer needed
+ *
+ * @param obj an AtkObject
+ * @return obj state set
+ */
+static AtkStateSet *
+eail_multibuttonentry_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_MULTIBUTTONENTRY(obj), NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   state_set = ATK_OBJECT_CLASS(eail_multibuttonentry_parent_class)->ref_state_set(obj);
+
+   if (!widget) return state_set;
+
+   if (elm_multibuttonentry_expanded_get(widget))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_EXPANDED);
+
+        if (elm_multibuttonentry_editable_get(widget))
+            atk_state_set_add_state(state_set, ATK_STATE_EDITABLE);
+     }
+   else
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_DEFAULT);
+     }
+
+   return state_set;
+}
+
+/**
+ * @brief Gets multibuttonentry items list
+ *
+ * @param multibuttonentry an EailMultibuttonentry
+ * @return multibuttonentry items list
+ * */
+static const Eina_List *
+eail_multibuttonentry_get_items(EailMultibuttonentry *multibuttonentry)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(multibuttonentry));
+   if (!widget) return NULL;
+
+   return elm_multibuttonentry_items_get(widget);
+}
+
+/**
+ * @brief Gets obj children number
+ *
+ * @param obj an AtkObject
+ * @return children number
+ */
+static gint
+eail_multibuttonentry_get_n_children(AtkObject *obj)
+{
+   gint n_items;
+   const Eina_List *items;
+
+   items = eail_multibuttonentry_get_items(EAIL_MULTIBUTTONENTRY(obj));
+   n_items = eina_list_count(items);
+
+   return n_items;
+}
+
+/**
+ * @brief Gets reference to i-th obj child
+ *
+ * The caller must unreference it when it is no longer needed
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ * @return child reference
+ */
+static AtkObject *
+eail_multibuttonentry_ref_child(AtkObject *obj, gint i)
+{
+   const Eina_List *items;
+   AtkObject *child = NULL;
+
+   items = eail_multibuttonentry_get_items(EAIL_MULTIBUTTONENTRY(obj));
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+            (eina_list_nth(items, i), ATK_ROLE_LABEL, obj);
+
+        g_object_ref(child);
+     }
+   else
+     ERR("Tried to ref child with index %d out of bounds!", i);
+
+   return child;
+}
+
+/**
+ * @brief EailMultibuttonentry class initializer
+ *
+ * @param klass an EailMultibuttonentry class
+ */
+static void
+eail_multibuttonentry_class_init(EailMultibuttonentryClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_multibuttonentry_initialize;
+   class->get_n_children = eail_multibuttonentry_get_n_children;
+   class->ref_child = eail_multibuttonentry_ref_child;
+   class->ref_state_set = eail_multibuttonentry_ref_state_set;
+}
diff --git a/eail/eail/eail_multibuttonentry.h b/eail/eail/eail_multibuttonentry.h
new file mode 100644 (file)
index 0000000..67a5812
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_multibuttonentry.h
+ *
+ * @brief Header for EailMultibuttonentry implementation
+ */
+
+#ifndef EAIL_MULTIBUTTONENTRY_H
+#define EAIL_MULTIBUTTONENTRY_H
+
+#include "eail_action_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailMultibuttonentry class
+ */
+#define EAIL_TYPE_MULTIBUTTONENTRY             (eail_multibuttonentry_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailMultibuttonentry
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_MULTIBUTTONENTRY(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                                EAIL_TYPE_MULTIBUTTONENTRY, EailMultibuttonentry))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailMultibuttonentry class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_MULTIBUTTONENTRY_CLASS(klass)     (G_TYPE_MULTIBUTTONENTRY_CLASS_CAST((klass), \
+                                                EAIL_TYPE_MULTIBUTTONENTRY, EailMultibuttonentryClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailMultibuttonentry class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_MULTIBUTTONENTRY(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                                EAIL_TYPE_MULTIBUTTONENTRY))
+/**
+ * @brief Tests whether given klass is a subclass of EailMultibuttonentry
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_MULTIBUTTONENTRY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                                EAIL_TYPE_MULTIBUTTONENTRY))
+/**
+ * @brief Gets EailMultibuttonentry class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailMultibuttonentry class from
+ */
+#define EAIL_MULTIBUTTONENTRY_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                                EAIL_TYPE_MULTIBUTTONENTRY, EailMultibuttonentryClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailMultibuttonentry*/
+typedef struct _EailMultibuttonentry      EailMultibuttonentry;
+/** @brief Definition of object class for Atk EailMultibuttonentry*/
+typedef struct _EailMultibuttonentryClass EailMultibuttonentryClass;
+
+/** @brief Definition of object structure for Atk EailMultibuttonentry*/
+struct _EailMultibuttonentry
+{
+   /** @brief widget that functionality is being extended*/
+   EailActionWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailMultibuttonentry*/
+struct _EailMultibuttonentryClass
+{
+   /** @brief class that is being extended*/
+   EailActionWidgetClass parent_class;
+};
+
+/**
+ * @brief Getter for EailMultibuttonentry GType
+ * @returns GType for EailMultibuttonentry implementation
+ */
+GType eail_multibuttonentry_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_naviframe.c b/eail/eail/eail_naviframe.c
new file mode 100644 (file)
index 0000000..343f0a3
--- /dev/null
@@ -0,0 +1,350 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_naviframe.c
+ * @brief Implementation of Naviframe widget
+ */
+
+#include "eail_naviframe.h"
+#include "eail_naviframe_page.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+#define EAIL_NAVIFRAME_CLICK_ACTION "click" /**< @brief 'click' action name*/
+
+/**
+ * @brief Define EailNaviframe GObject type
+ *
+ * It extends EAIL_TYPE_WIDGET and implements ATK_TYPE_SELECTION and
+ * ATK_TYPE_ACTION interfaces
+ */
+G_DEFINE_TYPE(EailNaviframe, eail_naviframe, EAIL_TYPE_ACTION_WIDGET);
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_naviframe_n_children_get(AtkObject *obj)
+{
+   EailNaviframe *naviframe;
+   Evas_Object *widget;
+   Eina_List *list;
+   int list_count;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME(obj), -1);
+
+   naviframe = EAIL_NAVIFRAME(obj);
+   widget = eail_widget_get_widget(EAIL_WIDGET(naviframe));
+   list = elm_naviframe_items_get(widget);
+   list_count = eina_list_count(list);
+   eina_list_free(list);
+
+   return list_count;
+}
+
+/**
+ * @brief click action callback
+ *
+ * @param action an AtkAction
+ * @param data user data
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_naviframe_action_click(AtkAction *action, void *data)
+{
+   EailNaviframe *naviframe;
+   Evas_Object *widget, *target;
+   Elm_Object_Item *it;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME(action), FALSE);
+
+   naviframe = EAIL_NAVIFRAME(action);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(naviframe));
+   it = elm_naviframe_top_item_get(widget);
+   if (!elm_naviframe_item_title_visible_get(it)) return FALSE;
+
+   target = elm_object_item_widget_get(it);
+   if (!target) return FALSE;
+
+   evas_object_smart_callback_call(target, "title,clicked", it);
+
+   return TRUE;
+}
+
+/**
+ * @brief Inits Action interface for Naviframe
+ *
+ * @param action_widget an EailActionWidget
+ */
+static void eail_naviframe_actions_init(EailActionWidget *action_widget)
+{
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_NAVIFRAME_CLICK_ACTION, NULL,
+                                    eail_naviframe_action_click);
+}
+
+/**
+ * @brief Initializer for GObject EailNaviframe instance
+ *
+ * @param naviframe an EailNaviframe
+ */
+static void
+eail_naviframe_init(EailNaviframe *naviframe)
+{
+}
+
+/**
+ * @brief Returns naviframe-page implementation for given object item
+ *
+ * @param naviframe an naviframe AtkObject
+ * @param item an Elm_Object_Item for naviframe-page
+ *
+ * @returns an AtkObject* representation for naviframe-page
+ */
+static AtkObject *
+_eail_naviframe_get_naviframe_page_for_item(AtkObject *naviframe,
+                                            Elm_Object_Item *item)
+{
+   EailFactoryObj *factory_obj = NULL;
+   AtkObject *naviframe_page = NULL;
+
+   factory_obj = eail_factory_find_obj_for_item(item);
+   if (factory_obj)
+     {
+        if (!factory_obj->atk_obj)
+          ERR("No atk obj created for factory item object");
+
+        return factory_obj->atk_obj;
+     }
+
+   naviframe_page = eail_naviframe_page_new(naviframe, item);
+   atk_object_initialize(naviframe_page, item);
+   eail_factory_append_item_to_cache(ATK_OBJECT(naviframe_page), item);
+
+   return naviframe_page;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_naviframe_ref_child(AtkObject *obj, gint i)
+{
+   Eina_List *list;
+   EailNaviframe *naviframe;
+   EailWidget *widget;
+   Evas_Object *e_object;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME(obj), NULL);
+
+   naviframe = EAIL_NAVIFRAME(obj);
+   widget = EAIL_WIDGET(naviframe);
+
+   e_object = eail_widget_get_widget(widget);
+
+   list = elm_naviframe_items_get(e_object);
+   int list_count = eina_list_count(list);
+   if (i >= list_count)
+     {
+        eina_list_free(list);
+        return NULL;
+     }
+
+   AtkObject *child = _eail_naviframe_get_naviframe_page_for_item
+                                                (obj, eina_list_nth(list, i));
+   g_object_ref(child);
+   eina_list_free(list);
+
+   return child;
+}
+
+/**
+ * @brief Destructor for naviframe object
+ */
+static void
+eail_naviframe_finalize(GObject *obj)
+{
+   EailNaviframe *naviframe = EAIL_NAVIFRAME(obj);
+
+   if (naviframe->click_description)
+     free(naviframe->click_description);
+
+   G_OBJECT_CLASS(eail_naviframe_parent_class)->finalize(obj);
+}
+
+/**
+ * @brief Emits state-changed signals for naviframe child page if needed
+ *
+ * @param naviframe_page an AtkObject for naviframe page
+ */
+static void
+_eail_naviframe_page_emit_changed_signals(AtkObject *naviframe_page)
+{
+   AtkStateSet *state_set = NULL;
+   gboolean visible = FALSE;
+
+   state_set = atk_object_ref_state_set(naviframe_page);
+   visible = atk_state_set_contains_state(state_set, ATK_STATE_VISIBLE);
+
+   atk_object_notify_state_change(naviframe_page, ATK_STATE_VISIBLE, visible);
+   atk_object_notify_state_change(naviframe_page, ATK_STATE_SHOWING, visible);
+   DBG("Emiting state_changed visible/showing: %d", visible);
+}
+
+/**
+ * @brief Handles signals changes for naviframe and its children pages
+ *
+ * @param naviframe an AtkObject for naviframe
+ */
+static void
+_eail_naviframe_emit_signals_changed(AtkObject *naviframe)
+{
+   gint n_children = 0, i = 0;
+   AtkObject *navipage = NULL;
+
+   n_children = eail_naviframe_n_children_get(naviframe);
+
+   for (i = 0; i < n_children; ++i)
+     {
+        navipage = eail_naviframe_ref_child(naviframe, i);
+        if (navipage)
+          {
+              DBG("Emitting state-changed for child %d", i);
+
+              _eail_naviframe_page_emit_changed_signals(navipage);
+              g_object_unref(navipage);
+          }
+     }
+}
+
+/**
+ * @brief handler for event which is raised when naviframe page is changed
+ * ("transition,finished" event)
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_naviframe_handle_page_changed_event(void *data,
+                                          Evas_Object *obj,
+                                          void *event_info)
+{
+   EailNaviframe *naviframe_obj = NULL;
+   g_return_if_fail(EAIL_IS_NAVIFRAME(data));
+   gint n_children = 0;
+
+   eail_emit_atk_signal
+                  (ATK_OBJECT(data), "visible-data-changed", ATK_TYPE_OBJECT);
+
+   naviframe_obj = EAIL_NAVIFRAME(data);
+   if (!naviframe_obj) return;
+
+   _eail_naviframe_emit_signals_changed(ATK_OBJECT(naviframe_obj));
+
+   n_children = eail_naviframe_n_children_get(ATK_OBJECT(naviframe_obj));
+   DBG("N_CHILDREN: %d", n_children);
+
+   if (n_children && n_children > naviframe_obj->child_count_last)
+     {
+         eail_emit_children_changed(TRUE, ATK_OBJECT(data), n_children - 1);
+     }
+   else if(n_children < naviframe_obj->child_count_last)
+    {
+         eail_emit_children_changed(FALSE, ATK_OBJECT(data), n_children);
+    }
+
+   naviframe_obj->child_count_last = n_children;
+}
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_naviframe_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   EailNaviframe *naviframe_obj = NULL;
+   ATK_OBJECT_CLASS(eail_naviframe_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_PAGE_TAB_LIST;
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "transition,finished",
+                                _eail_naviframe_handle_page_changed_event, obj);
+
+   eail_naviframe_actions_init(EAIL_ACTION_WIDGET(obj));
+
+   naviframe_obj = EAIL_NAVIFRAME(obj);
+   /* storing last numbers of children to be for checking if children-changed
+    * signal has to be propagated */
+   naviframe_obj->child_count_last = eail_naviframe_n_children_get(obj);
+}
+
+/**
+ * @brief Initializer for GObject naviframe class (defines callbacks for base
+ * AtkObject)
+ *
+ * @param klass an EailNaviframeClass
+ */
+static void
+eail_naviframe_class_init(EailNaviframeClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_naviframe_initialize;
+   class->get_n_children = eail_naviframe_n_children_get;
+   class->ref_child = eail_naviframe_ref_child;
+
+   gobject_class->finalize = eail_naviframe_finalize;
+}
+
diff --git a/eail/eail/eail_naviframe.h b/eail/eail/eail_naviframe.h
new file mode 100644 (file)
index 0000000..2045d3e
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_NAVIFRAME_H
+#define EAIL_NAVIFRAME_H
+
+/**
+ * @file eail_naviframe.h
+ *
+ * @brief Header for EailNaviframe implementation
+ */
+
+#include "eail_action_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailNaviframe class
+ */
+#define EAIL_TYPE_NAVIFRAME             (eail_naviframe_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailNaviframe
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_NAVIFRAME(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                         EAIL_TYPE_NAVIFRAME, EailNaviframe))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailNaviframe class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_NAVIFRAME_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                         EAIL_TYPE_NAVIFRAME, EailNaviframeClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailNaviframe class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_NAVIFRAME(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                         EAIL_TYPE_NAVIFRAME))
+/**
+ * @brief Tests whether given klass is a subclass of EailNaviframe
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_NAVIFRAME_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                         EAIL_TYPE_NAVIFRAME))
+/**
+ * @brief Gets EailNaviframe class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailNaviframe class from
+ */
+#define EAIL_NAVIFRAME_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                         EAIL_TYPE_NAVIFRAME, EailNaviframeClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailNaviframe*/
+typedef struct _EailNaviframe      EailNaviframe;
+/** @brief Definition of object class for Atk EailNaviframe*/
+typedef struct _EailNaviframeClass EailNaviframeClass;
+
+/** @brief Definition of object structure for Atk EailNaviframe*/
+struct _EailNaviframe
+{
+   EailActionWidget parent;/**< @brief widget that functionality is being extended*/
+   char *click_description;/**< @brief string description for 'click' action*/
+   int child_count_last;/**< @brief last reported cound of children */
+};
+
+/** @brief Definition of object class for Atk EailNaviframe*/
+struct _EailNaviframeClass
+{
+   EailActionWidgetClass parent_class;/**< @brief class that is being extended*/
+};
+
+/**
+ * @brief Getter for EailNaviframe GType
+ *
+ * @returns GType for EailNaviframe implementation
+ */
+GType eail_naviframe_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_naviframe_page.c b/eail/eail/eail_naviframe_page.c
new file mode 100644 (file)
index 0000000..976e1c4
--- /dev/null
@@ -0,0 +1,371 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file eail_naviframe_page.c
+ * @brief naviframe content page as AtkObject implementation
+ */
+
+#include "eail_naviframe_page.h"
+#include "eail_naviframe.h"
+#include "eail_factory.h"
+#include "eail_widget.h"
+#include "eail_priv.h"
+
+static void atk_component_interface_init(AtkComponentIface *iface);
+
+/**
+ * Defines EailNaviframPage type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailNaviframePage,
+                        eail_naviframe_page,
+                        ATK_TYPE_OBJECT,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
+                                              atk_component_interface_init));
+
+/**
+ * @brief
+ *
+ * @param naviframe an AtkObject
+ * @param navi_tab_item an Elm_Object_Item item
+ * @returns accessible naviframe page
+ */
+AtkObject *
+eail_naviframe_page_new(AtkObject *naviframe, Elm_Object_Item *navi_tab_item)
+{
+   AtkObject *atk_object;
+   EailNaviframePage *page;
+   Evas_Object *o, *widget;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME(naviframe), NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(naviframe));
+
+   g_return_val_if_fail(widget != NULL, NULL);
+
+   atk_object = g_object_new(EAIL_TYPE_NAVIFRAME_PAGE, NULL);
+   page = EAIL_NAVIFRAME_PAGE(atk_object);
+
+   page->naviframe = widget;
+
+   page->page = navi_tab_item;
+
+   page->child_count = 0;
+
+   o = elm_object_item_part_content_get(page->page, "prev_btn");
+   if (o && elm_object_widget_check(o))
+     page->content[page->child_count++] = o;
+
+   o = elm_object_item_part_content_get(page->page, "icon");
+   if (o && elm_object_widget_check(o))
+     page->content[page->child_count++] = o;
+
+   o = elm_object_item_part_content_get(page->page, "next_btn");
+   if (o && elm_object_widget_check(o))
+     page->content[page->child_count++] = o;
+
+   o = elm_object_item_part_content_get(page->page, "default");
+   if (o && elm_object_widget_check(o))
+     page->content[page->child_count++] = o;
+
+   page->parent_naviframe = naviframe;
+
+   atk_object->layer = ATK_LAYER_WIDGET;
+
+   return atk_object;
+}
+
+/**
+ * @brief Implementation atk_object_get_name
+ * Returns accessible name if assigned, title or subtitle otherwise
+ *
+ * @param obj EailNaviframePage instance
+ * @returns obj accessible name if assigned, title or subtitle otherwise
+ */
+static const char *
+eail_naviframe_page_name_get(AtkObject *obj)
+{
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), NULL);
+
+   EailNaviframePage *page = EAIL_NAVIFRAME_PAGE(obj);
+   if (page->name != NULL) return page->name;
+
+   const char *title = elm_object_item_part_text_get(page->page, "default");
+   const char *subtitle = elm_object_item_part_text_get(page->page, "subtitle");
+
+   if (subtitle != NULL)
+     page->name = eina_stringshare_printf("%s\n%s", title, subtitle);
+   else
+     page->name = eina_stringshare_add(title);
+
+   return page->name;
+}
+
+/**
+ * @brief Init EailNaviframePage
+ *
+ * @param naviframe_page object instance
+ */
+static void
+eail_naviframe_page_init(EailNaviframePage *naviframe_page)
+{
+}
+
+/**
+ * @brief Initialize EailNaviframPage
+ *
+ * @param obj object instance
+ * @param data user data
+ */
+static void
+eail_naviframe_page_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_naviframe_page_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_PAGE_TAB;
+   obj->layer = ATK_LAYER_WIDGET;
+}
+
+/**
+ * @brief Finalize object
+ *
+ * @param obj object instance
+ */
+static void
+eail_naviframe_page_finalize(GObject *obj)
+{
+   EailNaviframePage *page = EAIL_NAVIFRAME_PAGE(obj);
+
+   eina_stringshare_del(page->name);
+
+   if (page->page)
+     eail_factory_unregister_item_from_cache(page->page);
+
+   G_OBJECT_CLASS(eail_naviframe_page_parent_class)->finalize(obj);
+}
+
+/**
+ * @brief Gets object children number
+ *
+ * @param obj object instance
+ *
+ * @returns number of children
+ */
+static gint
+eail_naviframe_page_n_children_get(AtkObject *obj)
+{
+   EailNaviframePage *page;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), 0);
+   page = EAIL_NAVIFRAME_PAGE(obj);
+
+   return page->child_count;
+}
+
+/**
+ * @brief Get object parent
+ *
+ * @param obj object instance
+ *
+ * @returns object parent
+ */
+static AtkObject *
+eail_naviframe_page_parent_get(AtkObject *obj)
+{
+   EailNaviframePage *page;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), NULL);
+
+   page = EAIL_NAVIFRAME_PAGE(obj);
+
+   return ATK_OBJECT(page->parent_naviframe);
+}
+
+/**
+ * @brief Get referred child object
+ *
+ * @param obj object instance
+ * @param i child index
+ *
+ * @returns referred child object
+ */
+static AtkObject *
+eail_naviframe_page_ref_child(AtkObject *obj, gint i)
+{
+   EailNaviframePage *page;
+   AtkObject *atk_obj_child = NULL;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), NULL);
+
+   page = EAIL_NAVIFRAME_PAGE(obj);
+   if (i >= page->child_count) return NULL;
+
+   atk_obj_child = eail_factory_get_accessible(page->content[i]);
+
+   g_object_ref(atk_obj_child);
+   return atk_obj_child;
+}
+
+/**
+ * @brief Get index of object in parent object
+ *
+ * @param obj object instance
+ *
+ * @returns object index
+ */
+static gint
+eail_naviframe_page_index_in_parent_get(AtkObject *obj)
+{
+   EailNaviframePage *page = NULL;
+   Eina_List *list = NULL;
+   gint pos = -1, i = 0;
+
+   if (!EAIL_IS_NAVIFRAME_PAGE(obj))
+     {
+        ERR("Not a naviframe page");
+        return pos;
+     }
+
+   page = EAIL_NAVIFRAME_PAGE(obj);
+   if (!page->naviframe) return pos;
+
+   list = elm_naviframe_items_get(page->naviframe);
+   for (i = 0; i < eina_list_count(list); ++i)
+     {
+        if (page->page == eina_list_nth(list, i))
+          {
+             pos = i;
+             break;
+          }
+     }
+
+   eina_list_free(list);
+   return pos;
+}
+
+/**
+ * @brief Get state set of accessible object
+ *
+ * @param obj object instance
+ *
+ * @returns referred AtkStateSet object
+ */
+static AtkStateSet *
+eail_naviframe_page_ref_state_set(AtkObject *obj)
+{
+   EailNaviframePage *page;
+   AtkStateSet *state_set;
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), NULL);
+
+   page = EAIL_NAVIFRAME_PAGE(obj);
+   if (!page->naviframe) return NULL;
+
+   widget = elm_object_part_content_get(page->naviframe, "default");
+
+   state_set = atk_state_set_new();
+
+   /* only item-page on top is visible*/
+   if (elm_naviframe_top_item_get(page->naviframe) == page->page)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
+        atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
+     }
+
+   if (!elm_object_disabled_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
+
+   return state_set;
+}
+
+/**
+ * @brief EailNaviframePage class initializer
+ *
+ * @param klass EailNaviframePage class
+ */
+static void
+eail_naviframe_page_class_init(EailNaviframePageClass *klass)
+{
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_naviframe_page_initialize;
+   class->get_name = eail_naviframe_page_name_get;
+   class->get_parent = eail_naviframe_page_parent_get;
+   class->get_n_children = eail_naviframe_page_n_children_get;
+   class->ref_child = eail_naviframe_page_ref_child;
+   class->ref_state_set = eail_naviframe_page_ref_state_set;
+   class->get_index_in_parent = eail_naviframe_page_index_in_parent_get;
+
+   g_object_class->finalize = eail_naviframe_page_finalize;
+}
+
+/**
+ * @brief Implementation of get_extents from AtkComponetnt interface
+ *
+ * @param component object instance
+ * @param x address of gint to store x coordinate
+ * @param y address of gint to store y coordinate
+ * @param width address of gint to store width
+ * @param height address of gint to store height
+ * @param coord_type  coordinates type as ATK defines
+ */
+static void
+eail_naviframe_page_get_extents(AtkComponent *component,
+                                gint *x,
+                                gint *y,
+                                gint *width,
+                                gint *height,
+                                AtkCoordType coord_type)
+{
+   EailNaviframePage *page;
+   Evas_Object *widget;
+   g_return_if_fail(EAIL_IS_NAVIFRAME_PAGE(component));
+
+   page = EAIL_NAVIFRAME_PAGE(component);
+   *x = *y = *width = *height = G_MININT;
+   if (!page->naviframe) return;
+
+   widget = page->naviframe;
+
+   evas_object_geometry_get(widget, x, y, width, height);
+   if (coord_type == ATK_XY_SCREEN)
+     {
+        int ee_x, ee_y;
+
+        Ecore_Evas *ee = ecore_evas_ecore_evas_get(
+           evas_object_evas_get(widget));
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        *x += ee_x;
+        *y += ee_y;
+     }
+}
+
+/**
+ * @brief AtkComponetn interface initialization
+ *
+ * @param iface EailNaviframPage object
+ */
+static void atk_component_interface_init(AtkComponentIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_extents = eail_naviframe_page_get_extents;
+}
diff --git a/eail/eail/eail_naviframe_page.h b/eail/eail/eail_naviframe_page.h
new file mode 100644 (file)
index 0000000..5cae41e
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file eail_naviframe_page.h
+ *
+ * @brief Header for EailnaviframePage implementation
+ */
+
+#ifndef EAIL_NAVIFRAME_PAGE_H
+#define EAIL_NAVIFRAME_PAGE_H
+
+#include <Elementary.h>
+#include <atk/atk.h>
+/**
+ * @brief Returns a value corresponding to the type of EailNaviframePage class
+ */
+#define EAIL_TYPE_NAVIFRAME_PAGE            (eail_naviframe_page_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailNaviframePage
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_NAVIFRAME_PAGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                             EAIL_TYPE_NAVIFRAME_PAGE, EailNaviframePage))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailNaviframePage class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_NAVIFRAME_PAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                             EAIL_TYPE_NAVIFRAME_PAGE, EailNaviframePageClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailNaviframePage class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_NAVIFRAME_PAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                             EAIL_TYPE_NAVIFRAME_PAGE))
+/**
+ * @brief Tests whether given klass is a subclass of EailNaviframePage
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_NAVIFRAME_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                             EAIL_TYPE_NAVIFRAME_PAGE))
+/**
+ * @brief Gets EailNaviframePage class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailNaviframePage class from
+ */
+#define EAIL_NAVIFRAME_PAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                             EAIL_TYPE_NAVIFRAME_PAGE, EailNaviframePageClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailNaviframePage*/
+typedef struct _EailNaviframePage      EailNaviframePage;
+/** @brief Definition of object class for Atk EailNaviframePage*/
+typedef struct _EailNaviframePageClass EailNaviframePageClass;
+
+/** @brief Definition of object structure for Atk EailNaviframePage*/
+struct _EailNaviframePage
+{
+   AtkObject parent; /*!< EailNaviframePage parent*/
+
+   AtkObject *parent_naviframe; /*!< EailNaviframe to which page belongs to*/
+   Evas_Object *naviframe; /*!< elm_naviframe instance*/
+   Elm_Object_Item *page; /*!< elm_naviframe item instance*/
+
+   Evas_Object *content[4]; /*!< holds content of page*/
+
+   gint child_count; /*!< number of children*/
+   const char *name; /*!< title of page*/
+};
+
+/** @brief Definition of object class for Atk EailNaviframePage*/
+struct _EailNaviframePageClass
+{
+   AtkObjectClass parent_class; /*!< EailNaviframPage parent class*/
+};
+
+/**
+ * @brief Getter for EailNaviframePage GType
+ * @returns GType for EailNaviframePage implementation
+ */
+GType eail_naviframe_page_get_type(void);
+
+/**
+ * @brief Creates new EailNaviframPage object
+ *
+ * @param naviframe EailNaviframe parent
+ * @param navi_tab_item item in parent naviframe object
+ *
+ * @returns new EailNaviframePage object
+ */
+AtkObject *eail_naviframe_page_new(AtkObject *naviframe,
+                                   Elm_Object_Item *navi_tab_item);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_notify.c b/eail/eail/eail_notify.c
new file mode 100644 (file)
index 0000000..120776b
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_notify.c
+ * @brief Implementation of notify widget
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#include "eail_notify.h"
+#include "eail_factory.h"
+#include "eail_priv.h"
+
+/**
+ * @brief Definition of EailPopup as GObject
+ *
+ * EailNotify is extended EAIL_TYPE_WIDGET
+ */
+G_DEFINE_TYPE(EailNotify, eail_notify, EAIL_TYPE_WIDGET);
+
+
+/**
+ * @brief Initializer for AtkObject
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_notify_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_notify_parent_class) ->initialize(obj, data);
+   obj->role = ATK_ROLE_NOTIFICATION;
+}
+
+/**
+ * @brief Initializer for GObject EailNotify instance
+ *
+ * @param button an EailNotify
+ */
+static void
+eail_notify_init(EailNotify *button)
+{
+
+}
+
+/**
+ * @brief Helper function for getting nested content in notify widget
+ *
+ * @param obj an AtkObject
+ *
+ * @returns nested widget content from notify widget
+ */
+static Evas_Object *
+_eail_get_nested_widget(AtkObject *obj)
+{
+   Evas_Object *notify_widget = NULL, *nested_widget = NULL;
+   /* getting widget of notify class */
+   notify_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!notify_widget)
+     {
+        ERR("No widget found for notification object!");
+     }
+
+   nested_widget = elm_object_part_content_get(notify_widget, "default");
+
+   return nested_widget;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_notify_get_n_children(AtkObject *obj)
+{
+   Evas_Object *nested_widget = NULL;
+
+   nested_widget = _eail_get_nested_widget(obj);
+   if (nested_widget)
+     return 1;
+
+   return 0;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i index of child to ref
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_notify_ref_child(AtkObject *obj, gint i)
+{
+   Evas_Object *nested_widget = NULL;
+   AtkObject *atk_obj;
+
+   nested_widget = _eail_get_nested_widget(obj);
+   atk_obj = eail_factory_get_accessible(nested_widget);
+
+   if (atk_obj)
+     g_object_ref(atk_obj);
+
+   return atk_obj;
+}
+
+/**
+ * @brief Destructor for EailNotify object
+ *
+ * @param object GObject instance to be finalized
+ */
+static void
+eail_notify_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_notify_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for EailNotify GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailNotify class
+ */
+static void
+eail_notify_class_init(EailNotifyClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_notify_initialize;
+   class->get_n_children = eail_notify_get_n_children;
+   class->ref_child = eail_notify_ref_child;
+   gobject_class->finalize = eail_notify_finalize;
+
+
+}
diff --git a/eail/eail/eail_notify.h b/eail/eail/eail_notify.h
new file mode 100644 (file)
index 0000000..5ed5743
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_NOTIFY_H
+#define EAIL_NOTIFY_H
+
+/**
+ * @file eail_notify.h
+ *
+ * @brief Header for EailNotify implementation
+ */
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailNotify class
+ */
+#define EAIL_TYPE_NOTIFY             (eail_notify_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailNotify
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_NOTIFY(obj)             (G_TYPE_NOTIFY_INSTANCE_CAST((obj), \
+                                            EAIL_TYPE_NOTIFY, EailNotify))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailNotify class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_NOTIFY_CLASS(klass)     (G_TYPE_NOTIFY_CLASS_CAST((klass), \
+                                            EAIL_TYPE_NOTIFY, EailNotifyClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailNotify class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_NOTIFY(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                            EAIL_TYPE_NOTIFY))
+/**
+ * @brief Tests whether given klass is a subclass of EailNotify
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_NOTIFY_CLASS(klass)  (G_TYPE_NOTIFY_CLASS_TYPE((klass), \
+                                            EAIL_TYPE_NOTIFY))
+/**
+ * @brief Gets EailNotify class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailNotify class from
+ */
+#define EAIL_NOTIFY_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                            EAIL_TYPE_NOTIFY, EailNotifyClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailNotify*/
+typedef struct _EailNotify EailNotify;
+/** @brief Definition of object class for Atk EailNotify*/
+typedef struct _EailNotifyClass EailNotifyClass;
+
+/** @brief Definition of object structure for Atk EailNotify*/
+struct _EailNotify
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailNotify*/
+struct _EailNotifyClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailNotify GType
+ *
+ * @returns GType for EailNotify implementation*/
+GType eail_notify_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/eail/eail/eail_panel.c b/eail/eail/eail_panel.c
new file mode 100644 (file)
index 0000000..5dfd68c
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_panel.c
+ * @brief Implementation of panel widget
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+#include "eail_panel.h"
+
+/**
+ * @brief EailPanel toogle action name
+ */
+#define EAIL_PANEL_TOGGLE_ACTION "toggle"
+
+/**
+ * @brief Definition of EailPanel as GObject
+ *
+ * EailFileselectorEntry is extended EAIL_TYPE_WIDGET with ATK_TYPE_ACTION
+ * interface implemented
+ */
+G_DEFINE_TYPE(EailPanel, eail_panel, EAIL_TYPE_ACTION_WIDGET);
+
+/**
+ * @brief Implementation of AtkObject->ref_state_set callback
+ *
+ * ATK doc says:
+ * Gets a reference to the state set of the accessible; the caller must
+ * unreference it when it is no longer needed.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns a reference to an AtkStateSet which is the state set of the
+ * accessible.
+ */
+static AtkStateSet*
+eail_panel_ref_state_set(AtkObject *obj)
+{
+   Evas_Object *widget;
+   Eina_Bool hidden;
+   AtkStateSet *state_set;
+
+   g_return_val_if_fail(EAIL_IS_PANEL(obj), NULL);
+
+   state_set = ATK_OBJECT_CLASS(eail_panel_parent_class)->ref_state_set(obj);
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   hidden = elm_panel_hidden_get(widget);
+   if (!hidden)
+     atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
+
+   return state_set;
+}
+
+/**
+ * @brief Implementation of eail_widget_get_widget_children callback from
+ * EailWidget
+ *
+ * @param widget an EailWidget
+ *
+ * @returns Eina_List filled with Evas_Object* objects contained in Panel widget
+ */
+static Eina_List*
+eail_panel_children_get(EailWidget *widget)
+{
+   Evas_Object *obj, *child;
+   Eina_List *list;
+
+   g_return_val_if_fail(EAIL_IS_PANEL(widget), NULL);
+
+   obj = eail_widget_get_widget(widget);
+   if (obj == NULL) return NULL;
+   child = elm_object_part_content_get(obj, "default");
+   if (child == NULL) return NULL;
+
+   list = NULL;
+   list = eina_list_append(list, child);
+
+   return list;
+}
+
+/**
+ * @brief Inits Action interface for PANEL
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_panel_action_toggle(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_PANEL(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   elm_panel_toggle(widget);
+
+   return TRUE;
+}
+
+/**
+ * @brief Hooks EailPanel actions callbacks
+ *
+ * @param action_widget an EailActionWidget
+ */
+static void
+eail_panel_actions_init(EailActionWidget *action_widget)
+{
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_PANEL_TOGGLE_ACTION, NULL,
+                                    eail_panel_action_toggle);
+}
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_panel_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_panel_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_PANEL;
+
+   eail_panel_actions_init(EAIL_ACTION_WIDGET(obj));
+}
+
+/**
+ * @brief Initializer for GObject class
+ *
+ * @param panel an EailPanel
+ */
+static void
+eail_panel_init(EailPanel *panel)
+{
+   panel->toggle_description = NULL;
+}
+
+/**
+ * @brief Destructor for panel object
+ *
+ * @param g_object GObject instance to be finalized
+ */
+static void eail_panel_finalize(GObject *g_object)
+{
+   EailPanel *panel = EAIL_PANEL(g_object);
+   if (panel->toggle_description)
+     {
+        free(panel->toggle_description);
+        panel->toggle_description = NULL;
+     }
+   G_OBJECT_CLASS(g_object)->finalize(g_object);
+}
+
+/**
+ * @brief Initializer for GObject panel class (defines callbacks for base
+ * AtkObject)
+ *
+ * @param klass an EailPanel class
+ */
+static void
+eail_panel_class_init(EailPanelClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   g_object_class->finalize = eail_panel_finalize;
+
+   widget_class->get_widget_children = eail_panel_children_get;
+
+   class->initialize = eail_panel_initialize;
+   class->ref_state_set = eail_panel_ref_state_set;
+}
diff --git a/eail/eail/eail_panel.h b/eail/eail/eail_panel.h
new file mode 100644 (file)
index 0000000..fd8b3ae
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_PANEL_H
+#define EAIL_PANEL_H
+
+/**
+ * @file eail_panel.h
+ *
+ * @brief Header for EailPanel implementation
+ */
+
+#include "eail_action_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailPanel class
+ */
+#define EAIL_TYPE_PANEL             (eail_panel_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailPanel
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_PANEL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_PANEL, EailPanel))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailPanel class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_PANEL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_PANEL, EailPanelClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailPanel class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_PANEL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_PANEL))
+/**
+ * @brief Tests whether given klass is a subclass of EailPanel
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_PANEL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_PANEL))
+/**
+ * @brief Gets EailPanel class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailPanel class from
+ */
+#define EAIL_PANEL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_PANEL, EailPanelClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailPanel*/
+typedef struct _EailPanel EailPanel;
+/** @brief Definition of object class for Atk EailPanel*/
+typedef struct _EailPanelClass EailPanelClass;
+
+/** @brief Definition of object structure for Atk EailPanel*/
+struct _EailPanel
+{
+   EailActionWidget parent;/**< @brief widget that is being extended*/
+   char *toggle_description;/**< @brief description for 'toggle' action */
+};
+
+/** @brief Definition of object class for Atk EailPanel*/
+struct _EailPanelClass
+{
+   EailActionWidgetClass parent_class;/**< @brief class that is being extended*/
+};
+
+/**
+ * @brief Getter for panel GType
+ *
+ * @returns GType for EailPanel implementation
+ */
+GType eail_panel_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_panes.c b/eail/eail/eail_panes.c
new file mode 100644 (file)
index 0000000..35bfe01
--- /dev/null
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_panes.c
+ * @brief EailPanes implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_panes.h"
+#include "eail_factory.h"
+#include "eail_priv.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief EailPanes type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailPanes,
+                        eail_panes,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/**
+ * @brief EailPanes initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_panes_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_panes_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_SPLIT_PANE;
+}
+
+/**
+ * @brief EailPanes instance initializer
+ *
+ * @param panes an EailPanes
+ */
+static void
+eail_panes_init(EailPanes *panes)
+{
+}
+
+/**
+ * @brief Gets obj children number
+ *
+ * @param obj an AtkObject
+ * @returns children number
+ */
+static gint
+eail_panes_n_children_get(AtkObject *obj)
+{
+   g_return_val_if_fail(EAIL_IS_PANES(obj), 0);
+
+   return 2;
+}
+
+/**
+ * @brief Gets obj state set
+ *
+ * @param obj an AtkObject
+ * @return obj state set
+ */
+static AtkStateSet*
+eail_panes_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget;
+
+   state_set = ATK_OBJECT_CLASS(eail_panes_parent_class)->ref_state_set(obj);
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+   if (widget == NULL) return state_set;
+
+   if (elm_panes_horizontal_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_HORIZONTAL);
+   else
+     atk_state_set_add_state(state_set, ATK_STATE_VERTICAL);
+
+   return state_set;
+}
+
+/**
+ * @brief Gets obj i-th child reference
+ *
+ * The caller must unreference it when it is no longer needed
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ * @return child reference
+ */
+static AtkObject*
+eail_panes_ref_child(AtkObject *obj, int i)
+{
+   Evas_Object *e_object, *widget;
+   AtkObject *child;
+
+   g_return_val_if_fail(EAIL_IS_PANES(obj), NULL);
+   g_return_val_if_fail((i < 2), NULL);
+
+   e_object = eail_widget_get_widget(EAIL_WIDGET(obj));
+   switch (i)
+     {
+      case 0:
+         widget = elm_object_part_content_get(e_object, "left");
+         child = eail_factory_get_accessible(widget);
+         break;
+      case 1:
+         widget = elm_object_part_content_get(e_object, "right");
+         child = eail_factory_get_accessible(widget);
+         break;
+      default:
+         child = NULL;
+         break;
+     }
+
+   if (child)
+     g_object_ref(child);
+
+   return child;
+}
+
+/**
+ * @brief an EailPanes class initializer
+ *
+ * @param klass an EailPanes class
+ */
+static void
+eail_panes_class_init(EailPanesClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_panes_initialize;
+   class->get_n_children = eail_panes_n_children_get;
+   class->ref_child = eail_panes_ref_child;
+   class->ref_state_set = eail_panes_ref_state_set;
+}
+
+/**
+ * @brief Gets obj maximum value
+ *
+ * @param obj an AtkValue
+ * @param value obj maxiumum value
+ */
+static void
+eail_panes_maximum_value_get(AtkValue *obj, GValue *value)
+{
+   g_return_if_fail(EAIL_IS_PANES(obj));
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, 1.0);
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * @param obj an AtkValue
+ * @param value obj minimum value
+ */
+static void
+eail_panes_minimum_value_get(AtkValue *obj, GValue *value)
+{
+   g_return_if_fail(EAIL_IS_PANES(obj));
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, 0.0);
+}
+
+/**
+ * @brief Sets obj current value
+ *
+ * @param obj an AtkValue
+ * @param value obj new value
+ * @return TRUE if value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_panes_current_value_set(AtkValue *obj, const GValue *value)
+{
+   Evas_Object *widget;
+   gdouble new_value;
+
+   g_return_val_if_fail(EAIL_IS_PANES(obj), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   if (G_VALUE_HOLDS_DOUBLE(value))
+        new_value = g_value_get_double(value);
+   else
+     return FALSE;
+
+   if ((new_value >= 0.0) && (new_value <= 1.0))
+     {
+        elm_panes_content_left_size_set(widget, new_value);
+        return TRUE;
+     }
+   else
+     return FALSE;
+}
+
+/**
+ * @brief Gets obj current value
+ *
+ * @param obj an AtkValue
+ * @param value obj current value
+ */
+static void
+eail_panes_current_value_get(AtkValue *obj, GValue *value)
+{
+   Evas_Object *widget;
+   gdouble current_value;
+
+   g_return_if_fail(EAIL_IS_PANES(obj));
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   current_value = elm_panes_content_left_size_get(widget);
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, current_value);
+}
+
+/**
+ * @brief AtkValue interface initializer
+ *
+ * @param iface an AtkValueIface
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_current_value = eail_panes_current_value_get;
+   iface->set_current_value = eail_panes_current_value_set;
+   iface->get_maximum_value = eail_panes_maximum_value_get;
+   iface->get_minimum_value = eail_panes_minimum_value_get;
+}
diff --git a/eail/eail/eail_panes.h b/eail/eail/eail_panes.h
new file mode 100644 (file)
index 0000000..1d6b763
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_panes.h
+ *
+ * @brief Header for EailPanes implementation
+ */
+
+#ifndef EAIL_PANES_H
+#define EAIL_PANES_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailPanes class
+ */
+#define EAIL_TYPE_PANES             (eail_panes_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailPanes
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_PANES(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_PANES, EailPanes))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailPanes class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_PANES_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_PANES, EailPanesClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailPanes class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_PANES(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_PANES))
+/**
+ * @brief Tests whether given klass is a subclass of EailPanes
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_PANES_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_PANES))
+/**
+ * @brief Gets EailPanes class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailPanes class from
+ */
+#define EAIL_PANES_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_PANES, EailPanesClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailPanes*/
+typedef struct _EailPanes      EailPanes;
+/** @brief Definition of object class for Atk EailPanes*/
+typedef struct _EailPanesClass EailPanesClass;
+
+/** @brief Definition of object structure for Atk EailPanes*/
+struct _EailPanes
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailPanes*/
+struct _EailPanesClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Parent object whose functionality is being extended
+ *
+ * @returns GType for EailPanes implementation*/
+GType eail_panes_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_photo.c b/eail/eail/eail_photo.c
new file mode 100644 (file)
index 0000000..06be1dc
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_photo.c
+ * @brief EailPhoto implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_photo.h"
+#include "eail_priv.h"
+
+static void atk_image_iface_init(AtkImageIface *iface);
+
+/**
+ * @brief EailPhoto type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailPhoto, eail_photo, EAIL_TYPE_IMAGE,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              atk_image_iface_init));
+
+
+/**
+ * @brief Gets image size
+ *
+ * @param image an AtkImage
+ * @param width photo width
+ * @param height photo height
+ */
+static void
+eail_photo_size_get(AtkImage *image, gint *width, gint *height)
+{
+   g_return_if_fail(ATK_IS_IMAGE(image));
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     {
+        *width = -1;
+        *height = -1;
+        return;
+     }
+   evas_object_geometry_get(widget, NULL, NULL, width, height);
+}
+
+/**
+ * @brief EailPhoto initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_photo_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_photo_parent_class)->initialize(obj, data);
+}
+
+/**
+ * @brief EailPhoto class initializer
+ *
+ * @param klass an EailPhotoClass
+ */
+static void
+eail_photo_class_init(EailPhotoClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   class->initialize = eail_photo_initialize;
+}
+
+/**
+ * @brief EailPhoto instance initializer
+ *
+ * @param photo an EailPhoto
+ */
+static void
+eail_photo_init(EailPhoto *photo)
+{
+}
+
+/**
+ * @brief AtkImage interface initializer
+ *
+ * @param iface an AtkImage interface
+ */
+static void
+atk_image_iface_init(AtkImageIface* iface)
+{
+   if (!iface) return;
+
+   iface->get_image_size = eail_photo_size_get;
+}
+
diff --git a/eail/eail/eail_photo.h b/eail/eail/eail_photo.h
new file mode 100644 (file)
index 0000000..5fe042e
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_photo.h
+ *
+ * @brief Header for EailPhoto implementation
+ */
+
+#ifndef EAIL_PHOTO_H
+#define EAIL_PHOTO_H
+
+#include "eail_image.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**
+ * @brief Returns a value corresponding to the type of EailPhoto class
+ */
+#define EAIL_TYPE_PHOTO             (eail_photo_get_type ())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailPhoto
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_PHOTO(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                    EAIL_TYPE_PHOTO, EailPhoto))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailPhoto class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_PHOTO_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                    EAIL_TYPE_PHOTO, EailPhotoClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailPhoto class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_PHOTO(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                    EAIL_TYPE_PHOTO))
+/**
+ * @brief Tests whether given klass is a subclass of EailPhoto
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_PHOTO_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                    EAIL_TYPE_PHOTO))
+/**
+ * @brief Gets EailPhoto class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailPhoto class from
+ */
+#define EAIL_PHOTO_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                    EAIL_TYPE_PHOTO, EailPhotoClass))
+
+/** @brief Definition of object structure for Atk EailPhoto*/
+typedef struct _EailPhoto       EailPhoto;
+/** @brief Definition of object class for Atk EailPhoto*/
+typedef struct _EailPhotoClass  EailPhotoClass;
+
+/** @brief Definition of object structure for Atk EailPhoto*/
+struct _EailPhoto
+{
+   /** @brief Parent object that functionality is being extended*/
+    EailImage parent;
+};
+
+/** @brief Definition of object class for Atk EailPhoto*/
+struct _EailPhotoClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+    EailImageClass parent_class;
+};
+
+/**
+ * @brief Getter for EailPhoto GType
+ *
+ * @returns GType for EailPhoto implementation
+ */
+GType eail_photo_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_photocam.c b/eail/eail/eail_photocam.c
new file mode 100644 (file)
index 0000000..5867636
--- /dev/null
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_photocam.c
+ * @brief EailPhotocam implementation
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_photocam.h"
+
+/**
+ * @brief ZoomIn action name
+ */
+#define EAIL_PHOTOCAM_ACTION_ZOOM_IN "zoom_in"
+
+/**
+ * @brief ZoomOut action name
+ */
+#define EAIL_PHOTOCAM_ACTION_ZOOM_OUT "zoom_out"
+
+/**
+ * @brief Click action name
+ */
+#define EAIL_PHOTOCAM_ACTION_CLICK "click"
+
+/**
+ * @brief Zoom increment
+ */
+#define EAIL_PHOTOCAM_ZOOM_STEP 0.0625
+
+static void atk_image_iface_init(AtkImageIface *iface);
+
+/**
+ * @brief EailPhotocam type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailPhotocam, eail_photocam,
+                        EAIL_TYPE_SCROLLABLE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              atk_image_iface_init));
+
+/**
+ * @brief ZoomIn action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_photocam_action_zoom_in(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   double zoom_level, set_zoom;
+
+   g_return_val_if_fail(EAIL_IS_PHOTOCAM(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   zoom_level = elm_photocam_zoom_get(widget);
+   set_zoom = zoom_level - EAIL_PHOTOCAM_ZOOM_STEP;
+   if (set_zoom < 0.0) return FALSE;
+
+   elm_photocam_zoom_set(widget, set_zoom);
+   return TRUE;
+}
+
+/**
+ * @brief ZoomOut action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_photocam_action_zoom_out(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   double zoom_level;
+
+   g_return_val_if_fail(EAIL_IS_PHOTOCAM(action), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   zoom_level = elm_photocam_zoom_get(widget) + EAIL_PHOTOCAM_ZOOM_STEP;
+   elm_photocam_zoom_set(widget, zoom_level);
+
+   return TRUE;
+}
+
+/**
+ * @brief Click action callback
+ *
+ * @param action an AtkAction
+ * @param data data passed to callback
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+_eail_photocam_action_click(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_PHOTOCAM(action), FALSE);
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   evas_object_smart_callback_call(widget, "clicked", NULL);
+   return TRUE;
+}
+
+/**
+ * @brief EailPhotocam initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_photocam_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_photocam_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_IMAGE;
+
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_PHOTOCAM_ACTION_ZOOM_IN,
+                                    NULL,
+                                    _eail_photocam_action_zoom_in);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_PHOTOCAM_ACTION_ZOOM_OUT,
+                                    NULL,
+                                    _eail_photocam_action_zoom_out);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(obj),
+                                    EAIL_PHOTOCAM_ACTION_CLICK,
+                                    NULL,
+                                    _eail_photocam_action_click);
+}
+
+/**
+ * @brief Gets obj state set
+ *
+ * The caller must unreference it when it is no longer needed
+ *
+ * @param obj an AtkObject
+ * @return obj state set
+ */
+static AtkStateSet*
+eail_photocam_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+
+   state_set = ATK_OBJECT_CLASS(eail_photocam_parent_class)->ref_state_set(obj);
+   return state_set;
+}
+
+/**
+ * @brief EailPhotocam finalizer
+ *
+ * Frees allocated resources
+ *
+ * @param object a GObject
+ */
+static void
+eail_photocam_finalize(GObject *object)
+{
+   EailPhotocam *photocam = EAIL_PHOTOCAM(object);
+   if (photocam->description)
+     free(photocam->description);
+
+   G_OBJECT_CLASS(eail_photocam_parent_class)->finalize(object);
+}
+
+/**
+ * @brief EailPhotocam class initializer
+ *
+ * @param klass an EailPhotocamClass
+ */
+static void
+eail_photocam_class_init(EailPhotocamClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_photocam_initialize;
+   class->ref_state_set = eail_photocam_ref_state_set;
+
+   g_object_class->finalize = eail_photocam_finalize;
+}
+
+/**
+ * @brief EailPhotocam instance intializer
+ *
+ * @param photocam an EailPhotocam
+ */
+static void eail_photocam_init(EailPhotocam *photocam)
+{
+   photocam->description = NULL;
+}
+
+/**
+ * @brief Gets image size
+ *
+ * @param image an AtkImage
+ * @param [out] width image width
+ * @param [out] height image height
+ */
+static void
+eail_photocam_image_size_get(AtkImage *image, gint *width, gint *height)
+{
+   g_return_if_fail(ATK_IS_IMAGE(image));
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(image));
+   if (!widget)
+     {
+        *width = -1;
+        *height = -1;
+        return;
+     }
+   elm_photocam_image_size_get(widget, width, height);
+}
+
+/**
+ * @brief Gets image description
+ *
+ * @param image an AtkImage
+ * @return description
+ */
+static const char*
+eail_photocam_image_description_get(AtkImage* image)
+{
+   EailPhotocam *photocam;
+
+   g_return_val_if_fail(EAIL_IS_PHOTOCAM(image), NULL);
+   photocam = EAIL_PHOTOCAM(image);
+
+   return photocam->description;
+}
+
+/**
+ * @brief Sets image description
+ *
+ * @param image an AtkImage
+ * @param description new image description
+ * @return TRUE if description is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_photocam_image_description_set(AtkImage *image, const char *description)
+{
+   EailPhotocam *photocam;
+
+   g_return_val_if_fail(EAIL_IS_PHOTOCAM(image), FALSE);
+   photocam = EAIL_PHOTOCAM(image);
+
+   if (photocam->description) free(photocam->description);
+   photocam->description = g_strdup(description);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets image position
+ *
+ * Position is in the form of a point specifying background top-left corner
+ *
+ * @param image an AtkImage
+ * @param [out] x x coordinate
+ * @param [out] y y coordinate
+ * @param coord_type xy coordinate interpretation
+ */
+static void
+eail_photocam_image_position_get(AtkImage *image,
+                                 gint *x,
+                                 gint *y,
+                                 AtkCoordType coord_type)
+{
+   atk_component_get_position(ATK_COMPONENT(image), x, y, coord_type);
+}
+
+/**
+ * @brief AktImage interface initializer
+ *
+ * @param iface an AtkImage interface
+ */
+static void
+atk_image_iface_init(AtkImageIface *iface)
+{
+   if (!iface) return;
+
+   iface->get_image_size = eail_photocam_image_size_get;
+   iface->get_image_description = eail_photocam_image_description_get;
+   iface->set_image_description = eail_photocam_image_description_set;
+   iface->get_image_position = eail_photocam_image_position_get;
+}
diff --git a/eail/eail/eail_photocam.h b/eail/eail/eail_photocam.h
new file mode 100644 (file)
index 0000000..6826815
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_photocam.h
+ *
+ * @brief Header for EailPhotocam implementation
+ */
+
+#ifndef EAIL_PHOTOCAM_H
+#define EAIL_PHOTOCAM_H
+
+#include "eail_scrollable_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailPhotocam class
+ */
+#define EAIL_TYPE_PHOTOCAM              (eail_photocam_get_type ())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailPhotocam
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_PHOTOCAM(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                         EAIL_TYPE_PHOTOCAM, EailPhotocam))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailPhotocam class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_PHOTOCAM_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                         EAIL_TYPE_PHOTOCAM, EailPhotocamClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailPhotocam class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_PHOTOCAM(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                         EAIL_TYPE_PHOTOCAM))
+/**
+ * @brief Tests whether given klass is a subclass of EailPhotocam
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_PHOTOCAM_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                         EAIL_TYPE_PHOTOCAM))
+/**
+ * @brief Gets EailPhotocam class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailPhotocam class from
+ */
+#define EAIL_PHOTOCAM_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                         EAIL_TYPE_PHOTOCAM, EailPhotocamClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailPhotocam*/
+typedef struct _EailPhotocam       EailPhotocam;
+/** @brief Definition of object class for Atk EailPhotocam*/
+typedef struct _EailPhotocamClass  EailPhotocamClass;
+
+/** @brief Definition of object structure for Atk EailPhotocam*/
+struct _EailPhotocam
+{
+   EailScrollableWidget parent;/**< @brief widget that is being extended*/
+   char *description;/**< @brief 'description' string property*/
+};
+
+/** @brief Definition of object class for Atk EailPhotocam*/
+struct _EailPhotocamClass
+{
+   EailScrollableWidgetClass parent_class;/**< @brief class that is being extended*/
+};
+
+/**
+ * @brief Getter for EailPhotocam GType
+ *
+ * @returns GType for EailPhotocam object
+ */
+GType eail_photocam_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_plug.c b/eail/eail/eail_plug.c
new file mode 100644 (file)
index 0000000..d70415d
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_plug.c
+ * @brief EailPlug implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_plug.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/**
+ * @brief Definition of EailPlug as GObject
+ *
+ * EailPlug is extended EailWidget with AtkAction interface implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailPlug,
+                        eail_plug,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief EailPlug object initialization
+ *
+ * @param obj EailPlug object
+ * @param data user set additional initialization data
+ */
+static void
+eail_plug_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_plug_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_IMAGE;
+}
+
+/**
+ * @brief Class destructor
+ *
+ * @param object object instance
+ */
+static void
+eail_plug_finalize(GObject *object)
+{
+   EailPlug *plug = EAIL_PLUG(object);
+
+   if (plug->click_description) free(plug->click_description);
+
+   G_OBJECT_CLASS(eail_plug_parent_class)->finalize(object);
+}
+
+/**
+ * @brief EailPlug instance initialization
+ *
+ * @param plug EailPlug instance
+ */
+static void
+eail_plug_init(EailPlug *plug)
+{
+   plug->click_description = NULL;
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailPlug class
+ */
+static void
+eail_plug_class_init(EailPlugClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_plug_initialize;
+   gobject_class->finalize = eail_plug_finalize;
+}
+
+/*
+ * Implementation of the *AtkAction* interface
+ */
+
+/**
+ * @brief Implementation of get_n_actions from AtkAction interface
+ *
+ * @param action EailPlug instance
+ *
+ * @returns number of actions supported by EailPlug
+ */
+static int
+eail_plug_n_actions_get(AtkAction *action)
+{
+   return 1;
+}
+
+/**
+ * @brief Implementation of get_description from AtkAction interface
+ *
+ * @param action EailPlug instance
+ * @param i action index
+ *
+ * @return action description
+ */
+static const char*
+eail_plug_description_get(AtkAction *action,
+                            gint i)
+{
+   const char *action_description;
+   EailPlug *plug = EAIL_PLUG(action);
+
+   switch (i)
+     {
+      case 0:
+         action_description = plug->click_description;
+         break;
+      default:
+         action_description = NULL;
+         break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Implementation of set_description from AtkAction interface
+ *
+ * @param action EailPlug instance
+ * @param i action index
+ * @param description action description
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_plug_description_set(AtkAction *action,
+                            gint i,
+                            const char *description)
+{
+   EailPlug *plug = EAIL_PLUG(action);
+   char **value;
+
+   switch (i)
+     {
+      case 0:
+         value = &plug->click_description;
+         break;
+      default:
+         value = NULL;
+         break;
+     }
+
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(description);
+        return TRUE;
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief Implementation of get_name from AtkAction interface
+ *
+ * @param action EailPlug instance
+ * @param i action index
+ *
+ * @return action name
+ */
+static const char*
+eail_plug_action_name_get(AtkAction *action,
+                            int i)
+{
+   const char* action_name;
+
+   switch (i)
+     {
+      case 0:
+         action_name = "click";
+         break;
+      default:
+         action_name = NULL;
+         break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Implementation of do_action from AtkAction interface
+ *
+ * @param action EailPlug instance
+ * @param i action index
+ *
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_plug_do_action(AtkAction *action,
+                      int i)
+{
+   const char *action_name;
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   action_name = atk_action_get_name(action, i);
+   if (!action_name) return FALSE;
+
+   if (!g_strcmp0(action_name, "click"))
+     evas_object_smart_callback_call(widget, "clicked", NULL);
+   else
+     return FALSE;
+
+   return TRUE;
+}
+
+/**
+ * @brief AtkAction interface initializer
+ *
+ * @param iface an AtkAction interface
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_n_actions   = eail_plug_n_actions_get;
+   iface->get_description = eail_plug_description_get;
+   iface->set_description = eail_plug_description_set;
+   iface->get_name        = eail_plug_action_name_get;
+   iface->do_action       = eail_plug_do_action;
+}
diff --git a/eail/eail/eail_plug.h b/eail/eail/eail_plug.h
new file mode 100644 (file)
index 0000000..7a0c105
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_plug.h
+ *
+ * @brief Header for EailPlug implementation
+ */
+
+#ifndef EAIL_PLUG_H
+#define EAIL_PLUG_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailPlug class
+ */
+#define EAIL_TYPE_PLUG             (eail_plug_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailPlug
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_PLUG(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                    EAIL_TYPE_PLUG, EailPlug))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailPlug class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_PLUG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                    EAIL_TYPE_PLUG, EailPlugClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailPlug class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_PLUG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                    EAIL_TYPE_PLUG))
+/**
+ * @brief Tests whether given klass is a subclass of EailPlug
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_PLUG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                    EAIL_TYPE_PLUG))
+/**
+ * @brief Gets EailPlug class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailPlug class from
+ */
+#define EAIL_PLUG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                    EAIL_TYPE_PLUG, EailPlugClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailPlug*/
+typedef struct _EailPlug      EailPlug;
+/** @brief Definition of object class for Atk EailPlug*/
+typedef struct _EailPlugClass EailPlugClass;
+
+/** @brief Definition of object structure for Atk EailPlug*/
+struct _EailPlug
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+
+   char *click_description; /*!< @brief 'click' action description*/
+};
+
+/** @brief Definition of object class for Atk EailPlug*/
+struct _EailPlugClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailPlug GType
+ *
+ * @returns GType for EailPlug implementation*/
+GType eail_plug_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_popup.c b/eail/eail/eail_popup.c
new file mode 100644 (file)
index 0000000..46fc4b0
--- /dev/null
@@ -0,0 +1,428 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_popup.c
+ * @brief Implementation of popup widget
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#include "eail_popup.h"
+#include "eail_notify.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void atk_text_interface_init(AtkTextIface *iface);
+
+/**
+ * @brief Definition of EailPopup as GObject
+ *
+ * EailPopup is extended EAIL_TYPE_NOTIFY with ATK_TYPE_TEXT interface
+ * implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailPopup, eail_popup, EAIL_TYPE_NOTIFY,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                             atk_text_interface_init));
+
+/**
+ * @brief Part format
+ */
+#define EAIL_POPUP_BUTTON_FORMAT "button%d"
+/**
+ * @brief number of popup buttons
+ */
+#define EAIL_POPUP_NUM_BUTTONS 3
+/**
+ * @brief Part name buffer size
+ */
+#define EAIL_POPUP_CHAR_BUF_SIZE 30
+
+/**
+ * @brief Initializer for AtkObject
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_popup_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_popup_parent_class) ->initialize(obj, data);
+   obj->role = ATK_ROLE_POPUP_MENU;
+}
+
+/**
+ * @brief EailPopup GObject instance initializer
+ * @param button an EailPopup
+ */
+static void
+eail_popup_init(EailPopup *button)
+{
+}
+
+/**
+ * @brief Helper function to getting "elm_popup" Evas_Object* from Atk EailPopup
+ *
+ * @param obj an AtkObject
+ *
+ * @returns nested "elm_popup" widget
+ */
+static Evas_Object *
+_eail_get_popup_widget_from_atkobj(AtkObject *obj)
+{
+   Evas_Object *popup_widget = NULL;
+   popup_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!popup_widget)
+     {
+        ERR("No widget found for notification object!");
+        return NULL;
+     }
+
+   return popup_widget;
+}
+
+/**
+ * @brief Helper function to getting nested content in "elm_popup" widget
+ *
+ * @param obj an AtkObject
+ *
+ * @returns nested widget content from "elm_popup" widget
+ */
+static Evas_Object *
+_eail_get_nested_widget(AtkObject *obj)
+{
+   Evas_Object *popup_widget = NULL, *nested_widget = NULL;
+
+   /* getting widget of popup class */
+   popup_widget = _eail_get_popup_widget_from_atkobj(obj);
+   if (!popup_widget) return NULL;
+
+   nested_widget = elm_object_part_content_get(popup_widget, "default");
+
+   return nested_widget;
+}
+
+/**
+ * @brief Helper function to getting nested button content in "elm_popup" widget
+ *
+ * @param obj an AtkObject
+ * @param index index of button in popup widget
+ *
+ * @returns nested button widget from "elm_popup" widget or NULL if failed
+ */
+static Evas_Object *
+_eail_get_nested_popup_button(AtkObject *obj, gint index)
+{
+   gchar buf[EAIL_POPUP_CHAR_BUF_SIZE];
+   Evas_Object *ret_button = NULL, *popup_widget = NULL;
+
+   if (index >= EAIL_POPUP_NUM_BUTTONS)
+     {
+        ERR("Index of popup button cannot be >= %d", EAIL_POPUP_NUM_BUTTONS);
+        return NULL;
+     }
+
+   popup_widget = _eail_get_popup_widget_from_atkobj(obj);
+   if (!popup_widget) return NULL;
+
+   snprintf(buf, sizeof(buf), EAIL_POPUP_BUTTON_FORMAT, (index + 1));
+   ret_button = elm_object_part_content_get(popup_widget, buf);
+
+   return ret_button;
+}
+
+/**
+ * @brief Prepares Eina_List filled with Evas_Object * objects
+ * representing nested content in elm_popup widget
+ *
+ * @param obj an AtkObject
+ *
+ * @return filled list with Evas_Object* objects. Call eina_list_free on that
+ * list when results processing has been finished
+ */
+static Eina_List *
+_eail_popup_get_items(AtkObject *obj)
+{
+   Eina_List *items = NULL;
+   Evas_Object *widget = NULL;
+   gint i = 0;
+
+   /* nested widget */
+   widget = _eail_get_nested_widget(obj);
+   if (widget)
+     items = eina_list_append(items, widget);
+
+   /* action buttons below popup content */
+   for (i = 0; i < EAIL_POPUP_NUM_BUTTONS; ++i)
+     {
+        widget = _eail_get_nested_popup_button(obj, i);
+        if (widget)
+          items = eina_list_append(items, widget);
+     }
+
+   return items;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_popup_get_n_children(AtkObject *obj)
+{
+   Eina_List *items = NULL;
+   gint num_of_children = 0;
+
+   items = _eail_popup_get_items(obj);
+   num_of_children = eina_list_count(items);
+
+   return num_of_children;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i index of a child
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_popup_ref_child(AtkObject *obj, gint i)
+{
+   Eina_List *items = NULL;
+   AtkObject *atk_obj = NULL;
+
+   items = _eail_popup_get_items(obj);
+   if (eina_list_count(items) > i)
+     atk_obj = eail_factory_get_accessible(eina_list_nth(items, i));
+
+   if (atk_obj)
+     g_object_ref(atk_obj);
+
+   return atk_obj;
+}
+
+/**
+ * @brief Gets name of EailItem
+ *
+ * Implementation of AtkObject->get_name callback
+ *
+ * ATK doc says:\n
+ * Gets the accessible name of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns a character string representing the accessible description of
+ * the accessible.
+ */
+static const gchar *
+eail_popup_get_name(AtkObject *obj)
+{
+   Evas_Object *popup_widget = NULL;
+   const char *atk_name;
+
+   atk_name = ATK_OBJECT_CLASS(eail_popup_parent_class)->get_name(obj);
+   if (atk_name) return atk_name;
+
+   popup_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!popup_widget)
+     {
+        ERR("No widget found for notification object!");
+        return NULL;
+     }
+
+   return elm_object_part_text_get(popup_widget, "title,text");
+}
+
+/**
+ * @brief Destructor for EailPopup class
+ */
+static void
+eail_popup_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_popup_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for EailPopup GObject class (defines callbacks for
+ * base AtkObject)
+ */
+static void
+eail_popup_class_init(EailPopupClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_popup_initialize;
+   class->get_n_children = eail_popup_get_n_children;
+   class->ref_child = eail_popup_ref_child;
+   class->get_name = eail_popup_get_name;
+   gobject_class->finalize = eail_popup_finalize;
+}
+
+/*
+ * AtkText interface functions
+ */
+
+/**
+ * @brief Helper function that gets text from popup as Eina_Strbuf*
+ *
+ * @param popup an EailPopup instance
+ *
+ * @returns Eina_Strbuf* object with filled text content of a popup
+ */
+static Eina_Strbuf *
+_eail_popup_get_strbuf(AtkText *popup)
+{
+   Evas_Object *popup_widget = NULL;
+   Eina_Strbuf* str_buf = NULL;
+   const gchar *text_part = NULL;
+
+   g_return_val_if_fail (ATK_IS_OBJECT(popup), NULL);
+
+   /* getting widget of popup class */
+   popup_widget = _eail_get_popup_widget_from_atkobj(ATK_OBJECT(popup));
+   if (!popup_widget) return NULL;
+
+   text_part = elm_object_part_text_get(popup_widget, "default");
+   if (!text_part) return NULL;
+
+   str_buf = eina_strbuf_new();
+   eina_strbuf_append(str_buf, text_part);
+
+   return str_buf;
+}
+
+/**
+ * @brief Gets text content from popup
+ *
+ * Implementation of AtkTextIface->get_text callback\n
+ *
+ * @param popup an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, or -1 for the end of the string.
+ *
+ * @returns a newly allocated string containing the text from start_offset
+ * up to, but not including end_offset. Use g_free() to free the returned
+ * string.
+ */
+static gchar*
+eail_popup_get_text(AtkText          *popup,
+                    gint              start_offset,
+                    gint              end_offset)
+{
+   Eina_Strbuf* str_buf = NULL;
+   gchar *ret_str = NULL;
+
+   g_return_val_if_fail(EAIL_IS_POPUP(popup), NULL);
+
+   str_buf = _eail_popup_get_strbuf(popup);
+   if (!str_buf) return NULL;
+
+   ret_str = eail_get_substring
+               (eina_strbuf_string_get(str_buf), start_offset, end_offset);
+
+   eina_strbuf_free(str_buf);
+
+   return ret_str;
+}
+
+/**
+ * @brief Gets character from popup at given offset
+ *
+ * Implementation of AtkTextIface->get_character_at_offset callback
+ *
+ * @param popup an AtkText
+ * @param offset an offset
+ *
+ * @returns the character at offset.
+ */
+static gunichar
+eail_popup_get_character_at_offset(AtkText *popup, gint offset)
+{
+   gunichar character = '\0';
+   gchar* time_str = NULL;
+
+   g_return_val_if_fail(EAIL_IS_POPUP(popup), character);
+
+   time_str = eail_popup_get_text(popup, 0, -1);
+
+   if (time_str)
+     {
+         character = g_utf8_get_char
+                  (g_utf8_offset_to_pointer(time_str, offset));
+         g_free(time_str);
+     }
+
+   return character;
+}
+
+/**
+ * @brief Gets character count from text content in popup<br>
+ * Implementation of AtkTextIface->get_character_count callback
+ *
+ * @param popup an AtkText
+ *
+ * @returns the character count
+ */
+static gint
+eail_popup_get_character_count(AtkText *popup)
+{
+   gint count = 0;
+   gchar* time_str = NULL;
+
+   g_return_val_if_fail(EAIL_IS_POPUP(popup), 0);
+
+   time_str = eail_popup_get_text(popup, 0, -1);
+
+   if (time_str)
+     {
+         count = g_utf8_strlen(time_str, -1);
+         g_free(time_str);
+     }
+
+   return count;
+}
+
+/**
+ * @brief Initializer for AtkTextIface interface class (defines callbacks for
+ * AtkTextIface)
+ *
+ * @param iface an AtkText interface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+    iface->get_text = eail_popup_get_text;
+    iface->get_character_at_offset = eail_popup_get_character_at_offset;
+    iface->get_character_count = eail_popup_get_character_count;
+}
diff --git a/eail/eail/eail_popup.h b/eail/eail/eail_popup.h
new file mode 100644 (file)
index 0000000..50af29c
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_POPUP_H
+#define EAIL_POPUP_H
+
+/**
+ * @file eail_popup.h
+ *
+ * @brief Header for EailPopup implementation
+ */
+
+#include "eail_notify.h"
+/**
+ * @brief Returns a value corresponding to the type of EailPopup class
+ */
+#define EAIL_TYPE_POPUP             (eail_popup_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailPopup
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_POPUP(obj)             (G_TYPE_POPUP_INSTANCE_CAST((obj), \
+                                            EAIL_TYPE_POPUP, \
+                                            EailPopup))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailPopup class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_POPUP_CLASS(klass)     (G_TYPE_POPUP_CLASS_CAST((klass), \
+                                            EAIL_TYPE_POPUP, \
+                                            EailPopupClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailPopup class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_POPUP(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                            EAIL_TYPE_POPUP))
+/**
+ * @brief Tests whether given klass is a subclass of EailPopup
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_POPUP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                            EAIL_TYPE_POPUP))
+/**
+ * @brief Gets EailPopup class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailPopup class from
+ */
+#define EAIL_POPUP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                            EAIL_TYPE_POPUP, \
+                                            EailPopupClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailPopup*/
+typedef struct _EailPopup EailPopup;
+/** @brief Definition of object class for Atk EailPopup*/
+typedef struct _EailPopupClass EailPopupClass;
+
+/** @brief Definition of object structure for Atk EailPopup*/
+struct _EailPopup
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailNotify parent;
+};
+
+/** @brief Definition of object class for Atk EailPopup*/
+struct _EailPopupClass
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailNotifyClass parent_class;
+};
+
+/** @brief Getter for EailPopup GType
+ *
+ * @returns GType for EailPopup implementation*/
+GType eail_popup_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/eail/eail/eail_prefs.c b/eail/eail/eail_prefs.c
new file mode 100644 (file)
index 0000000..d0e914c
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_prefs.c
+ * @brief EailPrefs widget implementation.
+ */
+
+#include <Elementary.h>
+
+#include "eail_prefs.h"
+#include "eail_factory.h"
+#include "eail_priv.h"
+
+/**
+ * @brief EailPrefs GObject type definition
+ *
+ * EailPrefs is extended EAIL_TYPE_WIDGET
+ */
+G_DEFINE_TYPE(EailPrefs, eail_prefs, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief EailPrefs initializer.
+ *
+ * @param obj EailPrefs instance
+ * @param data initialization data
+ */
+static void
+eail_prefs_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_prefs_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_REDUNDANT_OBJECT;
+}
+
+/**
+ * @brief EailPrefs instance initializer
+ *
+ * @param prefs EailPrefs instance
+ */
+static void
+eail_prefs_init(EailPrefs *prefs)
+{
+}
+
+/**
+ * @brief Gets children for prefs object
+ *
+ * @param parent parent widget
+ * @param items empty list (used as output value)
+ */
+static void eail_prefs_children_get(Evas_Object *parent,
+                                    Eina_List **items)
+{
+   Eina_List *list;
+   Evas_Object *w;
+   int n;
+
+   list = evas_object_smart_members_get(parent);
+   if (!list) return;
+
+   for (n = 0; n < eina_list_count(list); ++n)
+     {
+        w = eina_list_nth(list, n);
+        if (elm_object_widget_check(w))
+          {
+             *items = eina_list_append(*items, w);
+          }
+
+        eail_prefs_children_get(w, items);
+     }
+
+   eina_list_free(list);
+}
+
+/**
+ * @brief Gets list of children for given widget
+ *
+ * @param widget an EailWidget (EailPrefs) to take children from
+ *
+ * @returns filled Eina_List with widget children or NULL if no children found
+ */
+static Eina_List *
+eail_prefs_get_widget_children(EailWidget *widget)
+{
+    Evas_Object *w;
+    Eina_List *list = NULL;
+
+    g_return_val_if_fail(EAIL_IS_PREFS(widget), NULL);
+
+    w = eail_widget_get_widget(widget);
+    if (!widget) return NULL;
+
+    eail_prefs_children_get(w, &list);
+
+    return list;
+}
+
+/**
+ * @brief EailPrefs class initializer.
+ *
+ * Here basic callbacks for AtkObject are defined
+ *
+ * @param klass EailPrefs class
+ */
+static void
+eail_prefs_class_init(EailPrefsClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   class->initialize = eail_prefs_initialize;
+   widget_class->get_widget_children = eail_prefs_get_widget_children;
+}
+
diff --git a/eail/eail/eail_prefs.h b/eail/eail/eail_prefs.h
new file mode 100644 (file)
index 0000000..d50503d
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_prefs.h
+ *
+ * @brief Header for EailPrefs implementation
+ */
+
+#ifndef EAIL_PREFS_H
+#define EAIL_PREFS_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailPrefs class
+ */
+#define EAIL_TYPE_PREFS             (eail_prefs_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailPrefs
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_PREFS(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                    EAIL_TYPE_PREFS, EailPrefs))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailPrefs class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_PREFS_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                    EAIL_TYPE_PREFS, EailPrefsClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailPrefs class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_PREFS(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                    EAIL_TYPE_PREFS))
+/**
+ * @brief Tests whether given klass is a subclass of EailPrefs
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_PREFS_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                    EAIL_TYPE_PREFS))
+/**
+ * @brief Gets EailPrefs class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailPrefs class from
+ */
+#define EAIL_PREFS_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                    EAIL_TYPE_PREFS, EailPrefsClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailPrefs*/
+typedef struct _EailPrefs      EailPrefs;
+/** @brief Definition of object class for Atk EailPrefs*/
+typedef struct _EailPrefsClass EailPrefsClass;
+
+/** @brief Definition of object structure for Atk EailPrefs*/
+struct _EailPrefs
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailPrefs*/
+struct _EailPrefsClass
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailPrefs GType
+ *
+ * @returns GType for EailPrefs implementation*/
+GType eail_prefs_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_priv.h b/eail/eail/eail_priv.h
new file mode 100644 (file)
index 0000000..e254dd6
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_priv.h
+ *
+ * @brief Header for private EAIL data (mostly debugging helper definitions)
+ */
+
+#ifndef EAIL_PRIV_H
+#define EAIL_PRIV_H
+
+/** @brief Color used to log EAIL debug logs*/
+#define EAIL_LOG_COLOR EINA_COLOR_GREEN
+
+#ifdef CRITICAL
+#undef CRITICAL
+#endif
+/** @brief Macro used to report 'critical'-level logs*/
+#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eail_log_dom, __VA_ARGS__)
+#ifdef ERR
+#undef ERR
+#endif
+/** @brief Macro used to report 'error'-level logs*/
+#define ERR(...)      EINA_LOG_DOM_ERR(_eail_log_dom, __VA_ARGS__)
+#ifdef WRN
+#undef WRN
+#endif
+/** @brief Macro used to report 'warning'-level logs*/
+#define WRN(...)      EINA_LOG_DOM_WARN(_eail_log_dom, __VA_ARGS__)
+#ifdef INF
+#undef INF
+#endif
+/** @brief Macro used to report 'info'-level logs*/
+#define INF(...)      EINA_LOG_DOM_INFO(_eail_log_dom, __VA_ARGS__)
+#ifdef DBG
+#undef DBG
+#endif
+/** @brief Macro used to report 'debug'-level logs*/
+#define DBG(...)      EINA_LOG_DOM_DBG(_eail_log_dom, __VA_ARGS__)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int _eail_log_dom;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_progressbar.c b/eail/eail/eail_progressbar.c
new file mode 100644 (file)
index 0000000..25a9311
--- /dev/null
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_progressbar.c
+ * @brief EailProgressbar implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_progressbar.h"
+#include "eail_utils.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief Define EailProgressbar GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailProgressbar,
+                        eail_progressbar,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief handler for changed event
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_progressbar_handle_changed_event(void *data,
+                                       Evas_Object *obj,
+                                       void *event_info)
+{
+   eail_emit_atk_signal
+                  (ATK_OBJECT(data), "visible-data-changed", ATK_TYPE_OBJECT);
+}
+
+/**
+ * @brief EailProgressbar object initialization
+ *
+ * @param obj EailProgressbar object
+ * @param data user set additional initialization data
+ */
+static void
+eail_progressbar_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+
+   ATK_OBJECT_CLASS(eail_progressbar_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_PROGRESS_BAR;
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   evas_object_smart_callback_add(nested_widget, "changed",
+                                  _eail_progressbar_handle_changed_event, obj);
+
+}
+
+/**
+ * @brief Gets list of child widget
+ *
+ * @param widget EailWidget object
+ *
+ * @return list of child, NULL if no children
+ */
+static Eina_List *
+eail_progressbar_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *child, *obj;
+
+   obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+   if (obj)
+     {
+        child = elm_object_part_content_get(obj, "icon");
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+     }
+
+   return list;
+}
+
+/**
+ * @brief Gets slider name
+ *
+ * @param obj EailSlider instance
+ * @returns accessible name
+ */
+static const gchar*
+eail_progressbar_get_name(AtkObject *obj)
+{
+   const gchar *name;
+   Evas_Object *widget;
+
+   name = ATK_OBJECT_CLASS(eail_progressbar_parent_class)->get_name(obj);
+   if (name) return name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (widget)
+     name = (const gchar*)elm_object_text_get(widget);
+
+   return name;
+}
+
+/**
+ * @brief EailProgressbar instance initialization
+ *
+ * @param progressbar EailProgressbar instance
+ */
+static void
+eail_progressbar_init(EailProgressbar *progressbar)
+{
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailProgressbar class
+ */
+static void
+eail_progressbar_class_init(EailProgressbarClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   class->initialize = eail_progressbar_initialize;
+   class->get_name = eail_progressbar_get_name;
+   widget_class->get_widget_children = eail_progressbar_get_widget_children;
+}
+
+/*
+ * Implementation of the *AtkValue* interface
+ */
+
+/**
+ * @brief Gets obj current value
+ *
+ * @param obj EailProgressbar instance
+ * @param value EailProgressbar current value
+ */
+static void
+eail_progressbar_get_current_value(AtkValue *obj,
+                                   GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, elm_progressbar_value_get(widget));
+}
+
+/**
+ * @brief Gets obj maxiumum value
+ *
+ * @param obj EailProgressbar instance
+ * @param value EailProgressbar maxiumum value
+ */
+static void
+eail_progressbar_get_maximum_value(AtkValue *obj,
+                                   GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, 1.0);
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * @param obj EailProgressbar instance
+ * @param value EailProgressbar minimum value
+ */
+static void
+eail_progressbar_get_minimum_value(AtkValue *obj,
+                                   GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, 0.0);
+}
+
+/**
+ * @brief Sets obj value
+ *
+ * @param obj EailProgressbar instance
+ * @param value EailProgressbar new value
+ * @return TRUE if new value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_progressbar_set_current_value(AtkValue *obj,
+                                   const GValue *value)
+{
+   Evas_Object *widget;
+   double val;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   val = g_value_get_double(value);
+
+   if (0.0 > val || 1.0 < val)
+     return FALSE;
+
+   elm_progressbar_value_set(widget, val);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets obj minimum increment
+ *
+ * @param obj EailProgressbar instance
+ * @param value EailProgressbar minimum increment
+ */
+static void
+eail_progressbar_get_minimum_increment(AtkValue *obj,
+                                       GValue *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, G_MINDOUBLE);
+}
+
+/**
+ * @brief AtkValue interface initializer
+ *
+ * @param iface an AtkValue interface
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_current_value     = eail_progressbar_get_current_value;
+   iface->get_maximum_value     = eail_progressbar_get_maximum_value;
+   iface->get_minimum_value     = eail_progressbar_get_minimum_value;
+   iface->set_current_value     = eail_progressbar_set_current_value;
+   iface->get_minimum_increment = eail_progressbar_get_minimum_increment;
+}
diff --git a/eail/eail/eail_progressbar.h b/eail/eail/eail_progressbar.h
new file mode 100644 (file)
index 0000000..319c282
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_progressbar.h
+ *
+ * @brief Header for EailProgressbar implementation
+ */
+
+#ifndef EAIL_PROGRESSBAR_H
+#define EAIL_PROGRESSBAR_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailProgressbar class
+ */
+
+#define EAIL_TYPE_PROGRESSBAR             (eail_progressbar_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailProgressbar
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_PROGRESSBAR(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                           EAIL_TYPE_PROGRESSBAR, EailProgressbar))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailProgressbar class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_PROGRESSBAR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                           EAIL_TYPE_PROGRESSBAR, EailProgressbarClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailProgressbar class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_PROGRESSBAR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                           EAIL_TYPE_PROGRESSBAR))
+/**
+ * @brief Tests whether given klass is a subclass of EailProgressbar
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_PROGRESSBAR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                           EAIL_TYPE_PROGRESSBAR))
+/**
+ * @brief Gets EailProgressbar class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailProgressbar class from
+ */
+#define EAIL_PROGRESSBAR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                           EAIL_TYPE_PROGRESSBAR, EailProgressbarClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailProgressbar*/
+typedef struct _EailProgressbar      EailProgressbar;
+/** @brief Definition of object class for Atk EailProgressbar*/
+typedef struct _EailProgressbarClass EailProgressbarClass;
+
+/** @brief Definition of object structure for Atk EailProgressbar*/
+struct _EailProgressbar
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailProgressbar*/
+struct _EailProgressbarClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailProgressbar GType
+ *
+ * @returns GType for EailProgressbar implementation*/
+GType eail_progressbar_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_radio_button.c b/eail/eail/eail_radio_button.c
new file mode 100644 (file)
index 0000000..49d0b25
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_radio_button.c
+ * @brief Implementation of EailRadioButton object
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#include "eail_radio_button.h"
+#include "eail_priv.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/**
+ * @brief Definition of EailRadioButton type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailRadioButton,
+                        eail_radio_button,
+                        EAIL_TYPE_BUTTON,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/**
+ * @brief Callback for on_change event
+ * We be called to notify AtkObject about state change
+ *
+ * @param data user data passed to callback
+ * @param obj source object
+ * @param event_info event info
+ */
+static void
+_on_change(void *data, Evas_Object *obj, void *event_info)
+{
+   EailRadioButton *button = EAIL_RADIO_BUTTON(data);
+   button->state = elm_radio_state_value_get(obj) ? EINA_TRUE : EINA_FALSE;
+
+   atk_object_notify_state_change(ATK_OBJECT(button), ATK_STATE_CHECKED,
+                                  button->state == EINA_TRUE ? TRUE : FALSE);
+}
+
+/**
+ * @brief Implementation of ref_state_set from AtkObject interface
+ *
+ * @param obj EailRadioButton instance
+ *
+ * @returns state of AtkObject
+ */
+static AtkStateSet*
+eail_radio_button_ref_state_set(AtkObject *obj)
+{
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   AtkStateSet *state_set =
+      ATK_OBJECT_CLASS(eail_radio_button_parent_class)->ref_state_set(obj);
+   if (widget==NULL)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_DEFUNCT);
+        return state_set;
+     }
+
+   /* get group value*/
+   int selected_value  = elm_radio_value_get(widget);
+   int widget_value = elm_radio_state_value_get(widget);
+
+   if (selected_value == widget_value)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_CHECKED);
+     }
+
+   return state_set;
+}
+
+/**
+ * @brief Initialize EailRadionButton as AtkObject
+ *
+ * @param obj EailRadioButton instance
+ * @param data user data passed to initialization
+ */
+static void
+eail_radio_button_initialize(AtkObject *obj, gpointer data)
+{
+    ATK_OBJECT_CLASS(eail_radio_button_parent_class)->initialize(obj, data);
+    Evas_Object *widget = (Evas_Object *) data;
+    EailRadioButton *radio = EAIL_RADIO_BUTTON(obj);
+    int value = elm_radio_state_value_get(widget);
+    int selected = elm_radio_value_get(widget);
+    if (selected == value)
+      {
+        radio->state = EINA_TRUE;
+      }
+    evas_object_smart_callback_add(widget, "changed", _on_change, obj);
+
+    obj->role = ATK_ROLE_RADIO_BUTTON;
+}
+
+/**
+ * @brief Initialize EailRadioButton object
+ *
+ * @param radio_button EailRadioButton instance
+ */
+static void
+eail_radio_button_init(EailRadioButton *radio_button)
+{
+   radio_button->click_description = NULL;
+   radio_button->state = EINA_FALSE;
+}
+
+/**
+ * @brief EailRadioButton finalize function
+ *
+ * @param object EailRadioButton instance
+ */
+static void
+eail_radio_button_finalize(GObject *object)
+{
+   EailRadioButton *button = EAIL_RADIO_BUTTON(object);
+   if (button->click_description) free(button->click_description);
+   G_OBJECT_CLASS(eail_radio_button_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Object class initialization
+ *
+ * @param klass EailRadioButton class
+ */
+static void
+eail_radio_button_class_init(EailRadioButtonClass *klass)
+{
+    AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+    class->initialize = eail_radio_button_initialize;
+    class->ref_state_set = eail_radio_button_ref_state_set;
+    gobject_class->finalize = eail_radio_button_finalize;
+}
+
+/**
+ * @brief Implementation of get_n_actions from AtkAction interface
+ *
+ * @param action EailRadioButton instance
+ *
+ * @returns number of actions
+ */
+static int
+eail_radio_button_n_action_get(AtkAction *action)
+{
+   return 1;
+}
+
+/**
+ * @brief Implementation of get_action_name from AtkAction interface
+ *
+ * @param action EailRadioButton instance
+ * @param i index of action
+ *
+ * @returns action name
+ */
+static const char*
+eail_radio_button_action_name_get(AtkAction *action, int i)
+{
+   const char *action_name;
+   switch (i)
+     {
+      case 0:
+         /*click - This is called whenever the user changes the state of one of*/
+         /*the radio objects within the group of radio objects that work together. */
+         action_name = "click";
+         break;
+      default:
+         action_name = NULL;
+         break;
+     }
+   return action_name;
+}
+
+/**
+ * @brief Implementation of set_description from AtkAction
+ *
+ * @param action EailRadioButton instance
+ * @param i action index
+ * @param description action description to set
+ *
+ * @returns TRUE on success FALSE otherwise
+ */
+static gboolean
+eail_radio_button_description_set(AtkAction *action, gint i, const char *description)
+{
+   if (i != 0) return FALSE;
+
+   EailRadioButton *button = EAIL_RADIO_BUTTON(action);
+   if (button->click_description) free(button->click_description);
+   button->click_description = g_strdup(description);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of get_description from AtkAction interface
+ *
+ * @param action EailRadioButton instance
+ * @param i index of action
+ *
+ * @returns action descritpion
+ */
+static const char*
+eail_radio_button_description_get(AtkAction *action, gint i)
+{
+   if (i != 0) return NULL;
+
+   EailRadioButton *button = EAIL_RADIO_BUTTON(action);
+   return button->click_description;
+}
+
+/**
+ * @brief Implementation of set_description from AtkAction interface
+ *
+ * @param action EailRadioButton instance
+ * @param i action index
+ *
+ * @returns TRUE on success FALSE otherwise
+ */
+static gboolean
+eail_radio_button_do_action(AtkAction *action, int i)
+{
+   Evas_Object *obj = eail_widget_get_widget(EAIL_WIDGET(action));
+   EailRadioButton *button = EAIL_RADIO_BUTTON(action);
+   if (button->state == EINA_TRUE) return FALSE;
+   if ((elm_object_disabled_get(obj)) || (!evas_object_visible_get(obj)))
+     return FALSE;
+   const char *action_name = atk_action_get_name(action, i);
+   if (action_name == NULL) return FALSE;
+   int state_value = elm_radio_state_value_get(obj);
+   elm_radio_value_set(obj, state_value);
+   button->state = EINA_TRUE;
+
+   if (!g_strcmp0(action_name, "click"))
+        evas_object_smart_callback_call(obj, "changed", NULL);
+
+   return TRUE;
+}
+
+/**
+ * @brief AtkAction interface initialization
+ *
+ * @param iface EailRadioButton object
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->do_action = eail_radio_button_do_action;
+   iface->get_n_actions = eail_radio_button_n_action_get;
+   iface->get_description = eail_radio_button_description_get;
+   iface->get_name = eail_radio_button_action_name_get;
+   iface->set_description = eail_radio_button_description_set;
+}
diff --git a/eail/eail/eail_radio_button.h b/eail/eail/eail_radio_button.h
new file mode 100644 (file)
index 0000000..c78132b
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_RADIO_BUTTON_H
+#define EAIL_RADIO_BUTTON_H
+
+/**
+ * @file eail_radio_button.h
+ *
+ * @brief Header for EailRadioButton implementation
+ */
+
+#include "eail_button.h"
+/**
+ * @brief Returns a value corresponding to the type of EailRadiobutton class
+ */
+#define EAIL_TYPE_RADIO_BUTTON              (eail_radio_button_get_type ())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailRadiobutton
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_RADIO_BUTTON(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                             EAIL_TYPE_RADIO_BUTTON, \
+                                             EailRadioButton))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailRadiobutton class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_RADIO_BUTTON_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                             EAIL_TYPE_RADIO_BUTTON, \
+                                             EailRadioButtonClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailRadiobutton class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_RADIO_BUTTON(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                             EAIL_TYPE_RADIO_BUTTON))
+/**
+ * @brief Tests whether given klass is a subclass of EailRadiobutton
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_RADIO_BUTTON_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                             EAIL_TYPE_RADIO_BUTTON))
+/**
+ * @brief Gets EailRadiobutton class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailRadiobutton class from
+ */
+#define EAIL_RADIO_BUTTON_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                             EAIL_TYPE_RADIO_BUTTON, \
+                                             EailRadioButtonClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailRadiobutton*/
+typedef struct _EailRadioButton EailRadioButton;
+/** @brief Definition of object class for Atk EailRadiobutton*/
+typedef struct _EailRadioButtonClass EailRadioButtonClass;
+
+/** @brief Definition of object structure for Atk EailRadiobutton*/
+struct _EailRadioButton
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailButton parent;
+   char *click_description; /*!< @brief 'click' action description*/
+   Eina_Bool state; /*!< @brief state of object (selected/unselected)*/
+};
+
+/** @brief Definition of object class for Atk EailRadiobutton*/
+struct _EailRadioButtonClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailButtonClass parent_class;
+};
+
+/** @brief Getter for EailRadioButton GType
+ *
+ * @returns GType for EailRadiobutton implementation*/
+GType eail_radio_button_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_route.c b/eail/eail/eail_route.c
new file mode 100644 (file)
index 0000000..3444f55
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_route.c
+ * @brief EailRoute implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_route.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief Define EailRoute GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailRoute,
+                        eail_route,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/**
+ * @brief EailRoute object initialization
+ *
+ * @param obj EailRoute object
+ * @param data user set additional initialization data
+ */
+static void
+eail_route_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_route_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_IMAGE_MAP;
+}
+
+/**
+ * @brief EailRoute instance initialization
+ *
+ * @param route EailRoute instance
+ */
+static void
+eail_route_init(EailRoute *route)
+{
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailRoute class
+ */
+static void
+eail_route_class_init(EailRouteClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_route_initialize;
+}
+
+/*
+ * Implementation of the *AtkValue* interface
+ */
+
+/**
+ * @brief Gets obj current value
+ *
+ * @param obj EailRoute instance
+ * @param value EailRoute current value
+ */
+static void
+eail_route_get_current_value(AtkValue *obj,
+                             GValue   *value)
+{
+   double longitude_min, longitude_max;
+   double latitude_min, latitude_max;
+   Evas_Object *widget;
+   gchar buf[200];
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   elm_route_longitude_min_max_get(widget, &longitude_min, &longitude_max);
+   elm_route_latitude_min_max_get(widget, &latitude_min, &latitude_max);
+
+   g_snprintf(buf, sizeof(buf), "<longitude><min>%0.6f</min><max>%0.6f</max></longitude>\n"
+                                "<latitude><min>%0.6f</min><max>%0.6f</max></latitude>",
+                                 longitude_min, longitude_max, latitude_min, latitude_max);
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_STRING);
+   g_value_set_string(value, buf);
+}
+
+/**
+ * @brief AtkValue interface initialization
+ *
+ * @param iface an AtkValue interface
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_current_value = eail_route_get_current_value;
+}
diff --git a/eail/eail/eail_route.h b/eail/eail/eail_route.h
new file mode 100644 (file)
index 0000000..9d3a51d
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_route.h
+ *
+ * @brief Header for EailRoute implementation
+ */
+
+#ifndef EAIL_ROUTE_H
+#define EAIL_ROUTE_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailRoute class
+ */
+
+#define EAIL_TYPE_ROUTE             (eail_route_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailRoute
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_ROUTE(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_ROUTE, EailRoute))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailRoute class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_ROUTE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_ROUTE, EailRouteClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailRoute class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_ROUTE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_ROUTE))
+/**
+ * @brief Tests whether given klass is a subclass of EailRoute
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_ROUTE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_ROUTE))
+/**
+ * @brief Gets EailRoute class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailRoute class from
+ */
+#define EAIL_ROUTE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_ROUTE, EailRouteClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailRoute*/
+typedef struct _EailRoute      EailRoute;
+/** @brief Definition of object class for Atk EailRoute*/
+typedef struct _EailRouteClass EailRouteClass;
+
+/** @brief Definition of object structure for Atk EailRoute*/
+struct _EailRoute
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailRoute*/
+struct _EailRouteClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailRoute GType*/
+GType eail_route_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_scrollable_widget.c b/eail/eail/eail_scrollable_widget.c
new file mode 100644 (file)
index 0000000..2aaec62
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_scrollable_widget.c
+ * @brief Implementation of widget that can scroll its content
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#include "eail_scrollable_widget.h"
+#include "eail_priv.h"
+#include "eail_utils.h"
+
+#define EAIL_STR_SCROLL_UP "scroll_up" /**< 'scroll_up' action name */
+#define EAIL_STR_SCROLL_DOWN "scroll_down" /**< 'scroll_down' action name */
+#define EAIL_STR_SCROLL_LEFT "scroll_left"/**< 'scroll_left' action name */
+#define EAIL_STR_SCROLL_RIGHT "scroll_right"/**< 'scroll_right' action name */
+
+/**
+ * @brief Definition of EailScrollableWidget as GObject
+ *
+ * NOTE: this class extends EAIL_TYPE_ACTION_WIDGET, which implements
+ * all needed functions for ATK_ACTION interface so additional implementing
+ * ATK_ACTION interface here is not needed.
+ * Only what is really needed, is to call:
+ * eail_action_widget_action_append(...) to register all needed additional
+ * actions
+ */
+G_DEFINE_TYPE(EailScrollableWidget, eail_scrollable_widget,
+              EAIL_TYPE_ACTION_WIDGET);
+
+/**
+ * @brief Handler for scroll event
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+static void
+_eail_scrollable_handle_scroll_event(void *data,
+                                     Evas_Object *obj,
+                                     void *event_info)
+{
+   eail_emit_atk_signal
+                  (ATK_OBJECT(data), "visible-data-changed", ATK_TYPE_OBJECT);
+}
+
+/**
+ * @brief Initializer for GObject class
+ *
+ * @param scrollable_widget an EailScrollableWidget
+ */
+static void
+eail_scrollable_widget_init(EailScrollableWidget *scrollable_widget)
+{
+}
+
+/**
+ * @brief Finalize function for GObject
+ *
+ * @param object GObject object instance to finalize
+ */
+static void
+eail_scrollable_widget_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_scrollable_widget_parent_class)->finalize(object);
+}
+
+
+
+/**
+ * @brief Scrollup action callback
+ *
+ * @param action an AtkAction
+ * @param data additional callback data
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_action_scroll_up(AtkAction *action,
+                  void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_SCROLLABLE_WIDGET(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   _eail_scrollable_handle_scroll_event(action, widget, NULL);
+   return eail_action_scroll_up(widget, NULL);
+}
+
+/**
+ * @brief Scrolldown action callback
+ *
+ * @param action an AtkAction
+ * @param data additional callback data
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_action_scroll_down(AtkAction *action,
+                    void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_SCROLLABLE_WIDGET(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   _eail_scrollable_handle_scroll_event(action, widget, NULL);
+   return eail_action_scroll_down(widget, NULL);
+}
+
+/**
+ * @brief Scrollleft action callback
+ *
+ * @param action an AtkAction
+ * @param data additional callback data
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_action_scroll_left(AtkAction *action,
+                    void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_SCROLLABLE_WIDGET(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   _eail_scrollable_handle_scroll_event(action, widget, NULL);
+   return eail_action_scroll_left(widget, NULL);
+}
+
+/**
+ * @brief Scrollright action callback
+ *
+ * @param action an AtkAction
+ * @param data additional callback data
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+_action_scroll_right(AtkAction *action,
+                     void *data)
+{
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_SCROLLABLE_WIDGET(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   _eail_scrollable_handle_scroll_event(action, widget, NULL);
+   return eail_action_scroll_right(widget, NULL);
+}
+
+/**
+ * @brief Adds actions for scrolling to actions table
+ * @param widget widget that implements EailScrollable interface
+ */
+static void
+eail_scrollable_widget_actions_table_init(EailScrollableWidget *widget)
+{
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(widget),
+                                    EAIL_STR_SCROLL_UP, NULL,
+                                    _action_scroll_up);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(widget),
+                                    EAIL_STR_SCROLL_DOWN, NULL,
+                                    _action_scroll_down);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(widget),
+                                    EAIL_STR_SCROLL_LEFT, NULL,
+                                    _action_scroll_left);
+   eail_action_widget_action_append(EAIL_ACTION_WIDGET(widget),
+                                    EAIL_STR_SCROLL_RIGHT, NULL,
+                                    _action_scroll_right);
+}
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_scrollable_widget_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_scrollable_widget_parent_class)->initialize(obj, data);
+   Evas_Object *evas_obj = NULL;
+   EailScrollableWidget *widget = EAIL_SCROLLABLE_WIDGET(obj);
+
+   /* Initializing possible widget actions table*/
+   eail_scrollable_widget_actions_table_init(widget);
+
+   evas_obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+   if (!evas_obj)
+     {
+         ERR("No evas object for ScrollableWidget");
+         return;
+     }
+
+   evas_object_smart_callback_add
+       (evas_obj, "scroll", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add
+       (evas_obj, "scroll,left", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add
+       (evas_obj, "scroll,right", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add
+        (evas_obj, "scroll,up", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add
+        (evas_obj, "scroll,down", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add(evas_obj,
+         "scroll,page,changed", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add(evas_obj,
+              "scroll,anim,stop", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add(evas_obj,
+                        "swipe", _eail_scrollable_handle_scroll_event, widget);
+   evas_object_smart_callback_add(evas_obj,
+             "scroll,drag,stop", _eail_scrollable_handle_scroll_event, widget);
+}
+
+/**
+ * @brief Init function for GObject
+ *
+ * @param klass an EailScrollableWidget class
+ */
+static void
+eail_scrollable_widget_class_init(EailScrollableWidgetClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_scrollable_widget_initialize;
+   gobject_class->finalize = eail_scrollable_widget_finalize;
+}
diff --git a/eail/eail/eail_scrollable_widget.h b/eail/eail/eail_scrollable_widget.h
new file mode 100644 (file)
index 0000000..e66cde3
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_scrollable_widget.h
+ *
+ * @brief Header for EailScrollableWidget implementation
+ */
+
+#ifndef EAIL_SCROLLABLE_WIDGET_H
+#define EAIL_SCROLLABLE_WIDGET_H
+
+#include "eail_action_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailScrollableWidget class
+ */
+#define EAIL_TYPE_SCROLLABLE_WIDGET      (eail_scrollable_widget_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailScrollableWidget
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_SCROLLABLE_WIDGET(obj)      (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                         EAIL_TYPE_SCROLLABLE_WIDGET, \
+                                         EailScrollableWidget))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailScrollableWidget class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_SCROLLABLE_WIDGET_CLASS(klass) \
+                              (G_TYPE_SCROLLABLE_WIDGET_CLASS_CAST((klass), \
+                                            EAIL_TYPE_SCROLLABLE_WIDGET, \
+                                            EailScrollableWidgetClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailScrollableWidget class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_SCROLLABLE_WIDGET(obj) \
+                                       (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                        EAIL_TYPE_SCROLLABLE_WIDGET))
+/**
+ * @brief Tests whether given klass is a subclass of EailScrollableWidget
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_SCROLLABLE_WIDGET_CLASS(klass)(G_TYPE_CHECK_CLASS_TYPE((klass),\
+                                               EAIL_TYPE_SCROLLABLE_WIDGET))
+/**
+ * @brief Gets EailScrollableWidget class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailScrollableWidget class from
+ */
+#define EAIL_SCROLLABLE_WIDGET_GET_CLASS(obj) \
+                                            (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                            EAIL_TYPE_SCROLLABLE_WIDGET, \
+                                            EailScrollableWidgetClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailScrollableWidget*/
+typedef struct _EailScrollableWidget EailScrollableWidget;
+/** @brief Definition of object class for Atk EailScrollableWidget*/
+typedef struct _EailScrollableWidgetClass EailScrollableWidgetClass;
+
+/** @brief Definition of object structure for Atk EailScrollableWidget*/
+struct _EailScrollableWidget
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailActionWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailScrollableWidget*/
+struct _EailScrollableWidgetClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailActionWidgetClass parent_class;
+};
+
+/** @brief Getter for EailScrollable GType
+ *
+ * @returns GType for EailScrollable implementation*/
+GType eail_scrollable_widget_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/eail/eail/eail_scroller.c b/eail/eail/eail_scroller.c
new file mode 100644 (file)
index 0000000..afcf2d1
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_scroller.c
+ * @brief Scroller implementation
+ */
+
+#include <Eina.h>
+#include <Evas.h>
+#include <Elementary.h>
+#include "eail_scroller.h"
+
+/**
+ * @brief Definition of EailScroller as GObject
+ *
+ * EailScroller is extended EAIL_TYPE_SCROLLABLE_WIDGET
+ */
+G_DEFINE_TYPE(EailScroller, eail_scroller, EAIL_TYPE_SCROLLABLE_WIDGET);
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_scroller_initialize(AtkObject *obj, gpointer data)
+{
+    ATK_OBJECT_CLASS(eail_scroller_parent_class)->initialize(obj, data);
+
+    obj->role = ATK_ROLE_SCROLL_PANE;
+}
+
+/**
+ * @brief Prepares Eina_List filled with Evas_Object* objects
+ * representing content of the widget
+ *
+ * @param widget an EailWidget
+ *
+ * @return filled list with list items. Call eina_list_free on that list when
+ * results processing has been finished
+ */
+static Eina_List *
+eail_scroller_get_widget_children(EailWidget *widget)
+{
+    Eina_List *list = NULL;
+    Evas_Object *content;
+    Evas_Object *obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+
+    if(obj) {
+        content = elm_object_part_content_get(obj, "default");
+        if(content)
+            list = eina_list_append(list, content);
+    }
+
+    return list;
+}
+
+/**
+ * @brief Gets name of EailItem
+ *
+ * Implementation of AtkObject->get_name callback
+ *
+ * ATK doc says:\n
+ * Gets the accessible name of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns a character string representing the accessible description of
+ * the accessible.
+ */
+static const gchar*
+eail_scroller_get_name(AtkObject *obj)
+{
+    const gchar *name;
+    Evas_Object *widget = NULL;
+
+    name = ATK_OBJECT_CLASS(eail_scroller_parent_class)->get_name(obj);
+    if(name != NULL)
+        return name;
+
+    widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+    if(widget)
+        name = (const gchar*)elm_object_text_get(widget);
+
+    return name;
+}
+
+/**
+ * @brief EailFileselector GObject instance initializer
+ *
+ * @param scroller an EailScroller
+ */
+static void
+eail_scroller_init(EailScroller *scroller)
+{
+}
+
+/**
+ * @brief Initializer for EailScroller GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailScroller class
+ */
+static void
+eail_scroller_class_init(EailScrollerClass *klass)
+{
+    AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+    EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+    widget_class->get_widget_children = eail_scroller_get_widget_children;
+
+    class->initialize = eail_scroller_initialize;
+    class->get_name = eail_scroller_get_name;
+}
diff --git a/eail/eail/eail_scroller.h b/eail/eail/eail_scroller.h
new file mode 100644 (file)
index 0000000..8eac214
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_SCROLLER_H
+#define EAIL_SCROLLER_H
+
+/**
+ * @file eail_scroller.h
+ *
+ * @brief Header for EailScrollableWidget implementation
+ */
+
+#include "eail_scrollable_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailScroller class
+ */
+#define EAIL_TYPE_SCROLLER              (eail_scroller_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailScroller
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_SCROLLER(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                         EAIL_TYPE_SCROLLER, EailScroller))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailScroller class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_SCROLLER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                         EAIL_TYPE_SCROLLER, EailScrollerClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailScroller class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_SCROLLER(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                         EAIL_TYPE_SCROLLER))
+/**
+ * @brief Tests whether given klass is a subclass of EailScroller
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_SCROLLER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                         EAIL_TYPE_SCROLLER))
+/**
+ * @brief Gets EailScroller class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailScroller class from
+ */
+#define EAIL_SCROLLER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                         EAIL_TYPE_SCROLLER, EailScrollerClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailScroller*/
+typedef struct _EailScroller      EailScroller;
+/** @brief Definition of object class for Atk EailScroller*/
+typedef struct _EailScrollerClass EailScrollerClass;
+
+/** @brief Definition of object structure for Atk EailScroller*/
+struct _EailScroller
+{
+   /** @brief Parent object that functionality is being extended*/
+    EailScrollableWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailScroller*/
+struct _EailScrollerClass
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailScrollableWidgetClass parent_class;
+};
+
+/** @brief Getter for EailScroller GType
+ *
+ * @returns GType for EailScroller implementation*/
+GType   eail_scroller_get_type  (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_segment_control.c b/eail/eail/eail_segment_control.c
new file mode 100644 (file)
index 0000000..334c3e2
--- /dev/null
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_segment_control.c
+ * @brief Implementation of Segment Control widget
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#include "eail_segment_control.h"
+#include "eail_factory.h"
+#include "eail_item_parent.h"
+
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+
+/**
+ * @brief Definition of EailSegmentControl as GObject
+ *
+ * EailSegmentControl is extended EAIL_TYPE_WIDGET with ATK_TYPE_SELECTION and
+ * EAIL_TYPE_ITEM_PARENT interfaces implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailSegmentControl, eail_segment_control, EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                              atk_selection_interface_init)
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                            eail_item_parent_interface_init));
+
+/**
+ * @brief Initializer for AtkObjectClass
+ *
+ * @param obj an AtkObject
+ * @param data additional initialization data
+ */
+static void
+eail_segment_control_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_segment_control_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_LIST;
+}
+
+/**
+ * @brief Initializer for GObject class
+ *
+ * @param segment_control an EailSegmentControl
+ */
+static void
+eail_segment_control_init(EailSegmentControl *segment_control)
+{
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ *
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_segment_control_get_n_children(AtkObject *obj)
+{
+   gint n_items;
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   n_items = elm_segment_control_item_count_get(widget);
+
+   return n_items;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_segment_control_ref_child(AtkObject *obj, gint i)
+{
+   AtkObject *child = NULL;
+   Evas_Object *widget = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   if (elm_segment_control_item_count_get(widget) > i)
+     {
+         child = eail_factory_get_item_atk_obj
+             (elm_segment_control_item_get(widget, i), ATK_ROLE_LIST_ITEM, obj);
+
+        g_object_ref(child);
+     }
+
+   return child;
+}
+
+/**
+ * @brief Destructor for Segment Control object
+ * @param object a GObject
+ */
+static void
+eail_segment_control_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_segment_control_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for GObject EailSegmentControl class (defines callbacks
+ * for base AtkObject)
+ *
+ * @param klass an EailSegmentControl class
+ */
+static void
+eail_segment_control_class_init(EailSegmentControlClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_segment_control_initialize;
+   class->get_n_children = eail_segment_control_get_n_children;
+   class->ref_child = eail_segment_control_ref_child;
+   gobject_class->finalize = eail_segment_control_finalize;
+}
+
+/**
+ * @brief Implementation of AtkSelection->add_selection callback
+ *
+ * As described in ATK doc:\n
+ * Adds the specified accessible child of the object to the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns TRUE if operation ended successfully, FALSE otherwise
+ */
+static gboolean
+eail_selection_add_selection(AtkSelection *selection,
+                             gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *item = elm_segment_control_item_get(object, i);
+   if (!item) return FALSE;
+   elm_segment_control_item_selected_set(item, EINA_TRUE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->clear_selection callback
+ *
+ * As described in ATK doc:\n
+ * Clears the selection in the object so that no children in the object are
+ * selected.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_selection_clear_selection(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *item = elm_segment_control_item_selected_get(object);
+   elm_segment_control_item_selected_set(item, EINA_FALSE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->ref_selection callback
+ *
+ * As described in ATK doc:\n
+ * Gets a reference to the accessible object representing the specified selected
+ * child of the object. Note: callers should not rely on NULL or on a zero value
+ * for indication of whether AtkSelectionIface is implemented, they should use
+ * type checking/interface checking macros or the atk_get_accessible_value()
+ * convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns an AtkObject representing the selected accessible , or NULL if
+ * selection does not implement this interface
+ */
+static AtkObject *
+eail_selection_ref_selection(AtkSelection *selection,
+                             gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), NULL);
+
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *item = elm_segment_control_item_get(object, i);
+   if (!item) return NULL;
+
+   return eail_segment_control_ref_child(ATK_OBJECT(selection), i);
+}
+
+/**
+ * @brief Implementation of AtkSelection->get_selection_count callback
+ *
+ * As described in ATK doc:\n
+ * Gets the number of accessible children currently selected. Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+
+ * @param selection an AtkSelection
+ *
+ * @returns gint representing number of selected elements
+ */
+static gint
+eail_selection_get_selection_count(AtkSelection *selection)
+{
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *item = elm_segment_control_item_selected_get(object);
+   if (item) return 1;
+   return 0;
+}
+
+/**
+ * @brief Implementation of AtkSelection->is_child_selected callback
+ *
+ * As described in ATK doc:\n
+ * Determines if the current child of this object is selected Note: callers
+ * should not rely on NULL or on a zero value for indication of whether
+ * AtkSelectionIface is implemented, they should use type checking/interface
+ * checking macros or the atk_get_accessible_value() convenience method.
+ *
+ * @param selection an AtkSelection
+ * @param i index of object
+ *
+ * @returns a gboolean representing if the specified child is selected, or
+ * FALSE if selection does not implement this interface.
+ */
+static gboolean
+eail_selection_is_child_selected(AtkSelection *selection,
+                                 gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *selected_item = elm_segment_control_item_selected_get(object);
+   Elm_Object_Item *item = elm_segment_control_item_get(object, i);
+   return (selected_item == item);
+}
+
+/**
+ * @brief Implementation of AtkSelection->remove_selection callback
+ *
+ * As described in ATK doc:\n
+ * Removes the specified child of the object from the object's selection.
+ *
+ * @param selection an AtkSelection
+ * @param i selection index
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_selection_remove_selection(AtkSelection *selection,
+                                gint i)
+{
+   g_return_val_if_fail(EAIL_IS_WIDGET(selection), FALSE);
+   Evas_Object *object = eail_widget_get_widget(EAIL_WIDGET(selection));
+   Elm_Object_Item *item = elm_segment_control_item_get(object, i);
+   if (!item) return FALSE;
+   elm_segment_control_item_selected_set(item, EINA_FALSE);
+   return TRUE;
+}
+
+/**
+ * @brief Implementation of AtkSelection->select_all_selection callback
+ *
+ * As described in ATK doc:\n
+ * Causes every child of the object to be selected if the object supports
+ * multiple selections.
+ *
+ * @param selection an AtkSelection
+ *
+ * @returns TRUE if success, FALSE otherwise.
+ */
+static gboolean
+eail_selection_select_all_selection(AtkSelection *selection)
+{
+   return FALSE;
+}
+
+/**
+ * @brief Initializer of AtkSelectionIface interface
+ *
+ * @param iface an AtkSelection interface
+ */
+static void atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   iface->add_selection = eail_selection_add_selection;
+   iface->clear_selection = eail_selection_clear_selection;
+   iface->ref_selection = eail_selection_ref_selection;
+   iface->get_selection_count = eail_selection_get_selection_count;
+   iface->is_child_selected = eail_selection_is_child_selected;
+   iface->remove_selection = eail_selection_remove_selection;
+   iface->select_all_selection = eail_selection_select_all_selection;
+}
+
+/**
+ * @brief Get name of segment control child
+ *
+ * @param parent instance
+ * @param item child instance
+ *
+ * @returns const gchar * representing name of the child
+ */
+static const gchar *
+eail_segment_control_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief Initialization for EailItemParentIface interface
+ *
+ * @param iface an EailItemParent interface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_item_name = eail_segment_control_item_name_get;
+}
diff --git a/eail/eail/eail_segment_control.h b/eail/eail/eail_segment_control.h
new file mode 100644 (file)
index 0000000..0b5e3fa
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EAIL_SEGMENT_CONTROL_H
+#define EAIL_SEGMENT_CONTROL_H
+
+/**
+ * @file eail_segment_control.h
+ *
+ * @brief Header for EailSegmentControl implementation
+ */
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailSegmentControl class
+ */
+#define EAIL_TYPE_SEGMENT_CONTROL               (eail_segment_control_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailSegmentControl
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_SEGMENT_CONTROL(obj)               (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                                EAIL_TYPE_SEGMENT_CONTROL, \
+                                                EailSegmentControl))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailSegmentControl class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_SEGMENT_CONTROL_CLASS(klass)       (G_TYPE_SEGMENT_CONTROL_CLASS_CAST((klass), \
+                                                EAIL_TYPE_SECTOR_CONTROL, \
+                                                EailSegmentControlClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailSegmentControl class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_SEGMENT_CONTROL(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                                EAIL_TYPE_SEGMENT_CONTROL))
+/**
+ * @brief Tests whether given klass is a subclass of EailSegmentControl
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_SEGMENT_CONTROL_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                                EAIL_TYPE_SEGMENT_CONTROL))
+/**
+ * @brief Gets EailSegmentControl class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailSegmentControl class from
+ */
+#define EAIL_SEGMENT_CONTROL_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                                EAIL_TYPE_SEGMENT_CONTROL, \
+                                                EailSegmentControlClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailSegmentControl*/
+typedef struct _EailSegmentControl EailSegmentControl;
+/** @brief Definition of object class for Atk EailSegmentControl*/
+typedef struct _EailSegmentControlClass EailSegmentControlClass;
+
+/** @brief Definition of object structure for Atk EailSegmentControl*/
+struct _EailSegmentControl
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailSegmentControl*/
+struct _EailSegmentControlClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailSegmentControl GType
+ *
+ * @returns GType for EailSegmentControl implementation*/
+GType eail_segment_control_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/eail/eail/eail_separator.c b/eail/eail/eail_separator.c
new file mode 100644 (file)
index 0000000..397096c
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_separator.c
+ * @brief EailSeparator implementation.
+ */
+
+#include <Elementary.h>
+#include "eail_separator.h"
+
+/**
+ * @brief EailSeparator type definition
+ */
+G_DEFINE_TYPE(EailSeparator, eail_separator, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief Gets state set reference of the accessible.
+ *
+ * The caller must unreference it when it is no longer needed.
+ *
+ * @param accessible an AtkObject instance
+ * @return accessible state set
+ */
+static AtkStateSet*
+eail_separator_ref_state_set(AtkObject *accessible)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(accessible));
+   if (!widget) return NULL;
+
+   state_set = ATK_OBJECT_CLASS(eail_separator_parent_class)->ref_state_set(accessible);
+
+   if (elm_separator_horizontal_get(widget))
+     atk_state_set_add_state(state_set, ATK_STATE_HORIZONTAL);
+   else
+     atk_state_set_add_state(state_set, ATK_STATE_VERTICAL);
+
+   return state_set;
+}
+
+/**
+ * @brief EailSeparator initializer.
+ *
+ * @param obj an AtkObject instance
+ * @param data initialize data
+ */
+static void
+eail_separator_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_separator_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_SEPARATOR;
+}
+
+/**
+ * @brief EailSeparator interface initializer.
+ *
+ * @param separator EailSeparator instance
+ */
+static void
+eail_separator_init(EailSeparator *separator)
+{
+}
+
+/**
+ * @brief EailSeparator class initializer.
+ *
+ * @param klass EailSeparator class
+ */
+static void
+eail_separator_class_init(EailSeparatorClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   class->initialize = eail_separator_initialize;
+   class->ref_state_set = eail_separator_ref_state_set;
+}
diff --git a/eail/eail/eail_separator.h b/eail/eail/eail_separator.h
new file mode 100644 (file)
index 0000000..b176174
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_separator.h
+ *
+ * @brief Header for EailSeparator implementation
+ */
+
+#ifndef EAIL_SEPARATOR_H
+#define EAIL_SEPARATOR_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailSeparator class
+ */
+#define EAIL_TYPE_SEPARATOR            (eail_separator_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailSeparator
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_SEPARATOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                        EAIL_TYPE_SEPARATOR, EailSeparator))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailSeparator class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_SEPARATOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                        EAIL_TYPE_SEPARATOR, EailSeparatorClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailSeparator class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_SEPARATOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                        EAIL_TYPE_SEPARATOR))
+/**
+ * @brief Tests whether given klass is a subclass of EailSeparator
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_SEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                        EAIL_TYPE_SEPARATOR))
+/**
+ * @brief Gets EailSeparator class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailActionSlider class from
+ */
+#define EAIL_SEPARATOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                        EAIL_TYPE_SEPARATOR, EailSeparatorClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailActionSlider*/
+typedef struct _EailSeparator      EailSeparator;
+/** @brief Definition of object class for Atk EailActionSlider*/
+typedef struct _EailSeparatorClass EailSeparatorClass;
+
+/** @brief Definition of object structure for Atk EailActionSlider*/
+struct _EailSeparator
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailActionSlider*/
+struct _EailSeparatorClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailSeparator GType
+ *
+ * @returns GType for EailSeparator implementation
+ * */
+GType eail_separator_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_slider.c b/eail/eail/eail_slider.c
new file mode 100644 (file)
index 0000000..f975042
--- /dev/null
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_slider.c
+ * @brief EailSlider implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_slider.h"
+#include "eail_utils.h"
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+/**
+ * @brief Initialization of AtkValue interface
+ *
+ * @param iface EailSlider object
+ */
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief Define EailSlider GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailSlider,
+                        eail_slider,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/**
+ * @brief handler for changed event
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_slider_handle_changed_event(void *data,
+                                      Evas_Object *obj,
+                                      void *event_info)
+{
+   eail_emit_atk_signal
+                  (ATK_OBJECT(data), "visible-data-changed", ATK_TYPE_OBJECT);
+}
+
+/**
+ * @brief EailSlider object initialization
+ *
+ * @param obj EailSlider object
+ * @param data user set additional initialization data
+ */
+static void
+eail_slider_initialize(AtkObject *obj, gpointer data)
+{
+   Evas_Object *nested_widget = NULL;
+   ATK_OBJECT_CLASS(eail_slider_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_SLIDER;
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   evas_object_smart_callback_add(nested_widget, "changed",
+                                  _eail_slider_handle_changed_event, obj);
+}
+
+/**
+ * @brief Gets list of children widgets
+ *
+ * @param widget EailWidget object
+ *
+ * @return list of children, NULL otherwise
+ */
+static Eina_List *
+eail_slider_get_widget_children(EailWidget *widget)
+{
+   Eina_List *list = NULL;
+   Evas_Object *child, *obj;
+
+   obj = eail_widget_get_widget(EAIL_WIDGET(widget));
+   if (obj)
+     {
+        child = elm_object_part_content_get(obj, "icon");
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+
+        child = elm_object_part_content_get(obj, "end");
+        if (child && elm_object_widget_check(child))
+          list = eina_list_append(list, child);
+     }
+
+   return list;
+}
+
+/**
+ * @brief Gets slider name
+ *
+ * @param obj EailSlider instance
+ *
+ * @returns string representing slider name
+ */
+static const gchar*
+eail_slider_get_name(AtkObject *obj)
+{
+   const gchar *name;
+   Evas_Object *widget;
+
+   name = ATK_OBJECT_CLASS(eail_slider_parent_class)->get_name(obj);
+   if (name) return name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (widget)
+     name = (const gchar*)elm_object_text_get(widget);
+
+   return name;
+}
+
+/**
+ * @brief EailSlider instance initialization
+ *
+ * @param slider EailSlider instance
+ */
+static void
+eail_slider_init(EailSlider *slider)
+{
+}
+
+/**
+ * @brief GObject type initialization function
+ *
+ * @param klass EailSlider class
+ */
+static void
+eail_slider_class_init(EailSliderClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   widget_class->get_widget_children = eail_slider_get_widget_children;
+   class->initialize = eail_slider_initialize;
+   class->get_name = eail_slider_get_name;
+}
+
+/*
+ * Implementation of the *AtkValue* interface
+ */
+
+/**
+ * @brief Gets obj current value
+ *
+ * @param obj EailSlider instance
+ * @param [out] value EailSlider current value
+ */
+static void
+eail_slider_get_current_value(AtkValue *obj,
+                              GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, elm_slider_value_get(widget));
+}
+
+/**
+ * @brief Gets obj maxiumum value
+ *
+ * @param obj EailSlider instance
+ * @param [out] value EailSlider maxiumum value
+ */
+static void
+eail_slider_get_maximum_value(AtkValue *obj,
+                              GValue   *value)
+{
+   Evas_Object *widget;
+   double max;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   elm_slider_min_max_get(widget, NULL, &max);
+   g_value_set_double(value, max);
+}
+
+/**
+ * @brief Gets obj minimum value
+ *
+ * @param obj EailSlider instance
+ * @param [out] value EailSlider minimum value
+ */
+static void
+eail_slider_get_minimum_value(AtkValue *obj,
+                              GValue   *value)
+{
+   Evas_Object *widget;
+   double min;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   elm_slider_min_max_get(widget, &min, NULL);
+   g_value_set_double(value, min);
+}
+
+/**
+ * @brief Sets obj value
+ *
+ * @param obj EailSlider instance
+ * @param value EailSlider new value
+ * @return TRUE if new value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_slider_set_current_value(AtkValue     *obj,
+                              const GValue *value)
+{
+   Evas_Object *widget;
+   double min, max, val;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   val = g_value_get_double(value);
+   elm_slider_min_max_get(widget, &min, &max);
+
+   if (min > val || max < val)
+     return FALSE;
+
+   elm_slider_value_set(widget, val);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets obj minimum increment
+ *
+ * @param obj EailSlider instance
+ * @param [out] value EailSlider minimum increment
+ */
+static void
+eail_slider_get_minimum_increment(AtkValue *obj,
+                                  GValue *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, 0);
+}
+
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_current_value     = eail_slider_get_current_value;
+   iface->get_maximum_value     = eail_slider_get_maximum_value;
+   iface->get_minimum_value     = eail_slider_get_minimum_value;
+   iface->set_current_value     = eail_slider_set_current_value;
+   iface->get_minimum_increment = eail_slider_get_minimum_increment;
+}
diff --git a/eail/eail/eail_slider.h b/eail/eail/eail_slider.h
new file mode 100644 (file)
index 0000000..cb7136f
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_slider.h
+ *
+ * @brief Header for EailSlider implementation
+ */
+
+#ifndef EAIL_SLIDER_H
+#define EAIL_SLIDER_H
+
+#include "eail_widget.h"
+/**
+ * @brief Returns a value corresponding to the type of EailSlider class
+ */
+#define EAIL_TYPE_SLIDER              (eail_slider_get_type())
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailSlider
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_SLIDER(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                       EAIL_TYPE_SLIDER, EailSlider))
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailSlider class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_SLIDER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                       EAIL_TYPE_SLIDER, EailSliderClass))
+/**
+ * @brief Tests whether object (obj) is an instance of EailSlider class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_SLIDER(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                       EAIL_TYPE_SLIDER))
+/**
+ * @brief Tests whether given klass is a subclass of EailSlider
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_SLIDER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                       EAIL_TYPE_SLIDER))
+/**
+ * @brief Gets EailSlider class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailSlider class from
+ */
+#define EAIL_SLIDER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                       EAIL_TYPE_SLIDER, EailSliderClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailSlider*/
+typedef struct _EailSlider      EailSlider;
+/** @brief Definition of object class for Atk EailSlider*/
+typedef struct _EailSliderClass EailSliderClass;
+
+/** @brief Definition of object structure for Atk EailSlider*/
+struct _EailSlider
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailSlider*/
+struct _EailSliderClass
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailSlider GType
+ *
+ * @returns GType for EailSlider implementation*/
+GType eail_slider_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_slideshow.c b/eail/eail/eail_slideshow.c
new file mode 100644 (file)
index 0000000..6b532b2
--- /dev/null
@@ -0,0 +1,518 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_slideshow.c
+ * @brief EailSlideshow implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_slideshow.h"
+#include "eail_factory.h"
+#include "eail_priv.h"
+
+/**
+ * @brief Default timeout in seconds
+ */
+#define SLIDESHOW_DEFAULT_TIMEOUT 3.0
+
+static void atk_selection_interface_init(AtkSelectionIface *iface);
+static void atk_action_interface_init(AtkActionIface *iface);
+
+/**
+ * @brief Define GObject type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailSlideshow, eail_slideshow, EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION,
+                                              atk_selection_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init));
+
+/**
+ * @brief Implementation of ref_child from AtkObject interface
+ *
+ * @param obj EailSlideshow instance
+ * @param i index of a child object
+ *
+ * @returns child object
+ */
+static AtkObject*
+eail_slideshow_ref_child(AtkObject *obj, gint i)
+{
+   Evas_Object *widget, *child_widget;
+   Elm_Object_Item *it;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(obj), NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return NULL;
+
+   it = elm_slideshow_item_nth_get(widget, i);
+   if (!it) return NULL;
+
+   child_widget = elm_slideshow_item_object_get(it);
+   if (!child_widget)
+     {
+        WRN("Given index %d is beyond realized (cached) views. Returning NULL",
+            i);
+        return NULL;
+     }
+
+   return eail_factory_get_accessible(child_widget);
+}
+
+/**
+ * @brief Implementation of get_n_children from AtkObject interface
+ *
+ * @param obj EailSlideshow instance
+ * @returns number of widget childs
+ */
+static gint
+eail_slideshow_n_children_get(AtkObject *obj)
+{
+   Evas_Object *widget;
+   gint items_count;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(obj), 0);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return 0;
+   /*the real number of items stored in slideshow widget is returned by
+     elm_slideshow_count_get. However we will not be able to return all items
+     widget since only those stored in cache are created.*/
+   items_count = elm_slideshow_count_get(widget);
+   return items_count;
+}
+
+/**
+ * @brief Initialize EailSlideshow as a AtkObject
+ *
+ * @param obj EailSlideshow instance
+ * @param data user data passed to initialization
+ */
+static void
+eail_slideshow_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_slideshow_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_DOCUMENT_PRESENTATION;
+}
+
+/**
+ * @brief EailSlideshow object initialization
+ *
+ * @param slideshow EailSlideshow instance
+ */
+static void
+eail_slideshow_init(EailSlideshow *slideshow)
+{
+   slideshow->next_description = NULL;
+   slideshow->previous_description = NULL;
+   slideshow->stop_description = NULL;
+   slideshow->start_description = NULL;
+}
+
+/**
+ * @brief Destructor of EailSlideshow object
+ *
+ * @param object EailSlideshow instance
+ */
+static void
+eail_slideshow_finalize(GObject *object)
+{
+   EailSlideshow *slideshow = EAIL_SLIDESHOW(object);
+   if (slideshow->next_description) free(slideshow->next_description);
+   if (slideshow->previous_description) free(slideshow->previous_description);
+   if (slideshow->stop_description) free(slideshow->stop_description);
+   if (slideshow->start_description) free(slideshow->start_description);
+
+   G_OBJECT_CLASS(eail_slideshow_parent_class)->finalize(object);
+
+}
+
+/**
+ * @brief EailSlideshow class initialization
+ *
+ * @param klass EailSlideshowClass object
+ */
+static void
+eail_slideshow_class_init(EailSlideshowClass *klass)
+{
+   AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   atk_class->initialize = eail_slideshow_initialize;
+   atk_class->get_n_children = eail_slideshow_n_children_get;
+   atk_class->ref_child = eail_slideshow_ref_child;
+
+   g_object_class->finalize = eail_slideshow_finalize;
+}
+
+/**
+ * @brief Implementation of selection_count from AtkSelection interface
+ *
+ * @param selection EailSlideshow instance
+ *
+ * @returns number of actions
+ */
+static gint
+eail_slideshow_selection_count(AtkSelection *selection)
+{
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(selection), 0);
+
+   return 1;
+}
+
+/**
+ * @brief Implementation of add_selection from AtkSelection interface
+ *
+ * @param selection EailSlideshow instance
+ * @param i index of object to select
+ *
+ * @returns TRUE on success FALSE otherwise
+ */
+static gboolean
+eail_slideshow_add_selection(AtkSelection *selection, gint i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(selection), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   if (!widget) return FALSE;
+
+   it = elm_slideshow_item_nth_get(widget, i);
+   if (!it) return FALSE;
+
+   elm_slideshow_item_show(it);
+
+   return TRUE;
+}
+
+/**
+ * @brief Implementation ref_selecton from AtkSelection
+ *
+ * @param selection EailSlideshow instance
+ * @param i index of selection
+ *
+ * @returns selected AtkObject
+ */
+static AtkObject*
+eail_slideshow_ref_selection(AtkSelection *selection, gint i)
+{
+   Evas_Object *widget, *it_widget;
+   Elm_Object_Item *it;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(selection), NULL);
+   g_return_val_if_fail(i == 0, NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   it = elm_slideshow_item_current_get(widget);
+
+   it_widget = elm_slideshow_item_object_get(it);
+
+   return eail_factory_get_accessible(it_widget);
+}
+
+/**
+ * @brief Implementation of is_child_selected from AtkSelection
+ *
+ * @param selection EailSlideshow instace
+ * @param i index of selection
+ *
+ * @return TRUE if object is selected FALSE otherwise
+ */
+static gboolean
+eail_slideshow_is_child_selected(AtkSelection *selection, gint i)
+{
+   Evas_Object *widget;
+   Elm_Object_Item *it, *current;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(selection), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
+   if (!widget) return FALSE;
+
+   current = elm_slideshow_item_current_get(widget);
+   it = elm_slideshow_item_nth_get(widget, i);
+
+   return (it == current);
+}
+
+/**
+ * @brief Initialization of AtkSelection interface
+ *
+ * Function called upon instance creation. It initializes AtkValue interface
+ * implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkObject than implements AtkSelectionInterface
+ */
+static void atk_selection_interface_init(AtkSelectionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->add_selection = eail_slideshow_add_selection;
+   iface->ref_selection = eail_slideshow_ref_selection;
+   iface->get_selection_count = eail_slideshow_selection_count;
+   iface->is_child_selected = eail_slideshow_is_child_selected;
+}
+
+/**
+ * @brief Implementation of get_n_action from AtkAction interface
+ *
+ * @param action EailSlideshow instance
+ * @returns number of implemented actions
+ */
+static gint
+eail_slideshow_n_actions_get(AtkAction *action)
+{
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(action), 0);
+
+   return 4;
+}
+
+/**
+ * @brief Implementation of get_action_name from AtkAction interface
+ *
+ * @param action EailSlideshow instance
+ * @param i action index
+ *
+ * @returns acton name
+ */
+static const gchar*
+eail_slideshow_action_name_get(AtkAction *action, int i)
+{
+   const gchar *action_name;
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(action), NULL);
+   switch (i)
+     {
+      case 0:
+         /*advance to next image*/
+         action_name = "next";
+         break;
+      case 1:
+         /*advance to previous image*/
+         action_name = "previous";
+         break;
+      case 2:
+         /*stop the slideshow*/
+         action_name = "stop";
+         break;
+      case 3:
+         /*start the slideshow*/
+         action_name = "start";
+         break;
+      default:
+         action_name = NULL;
+         break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Compares two doubles
+ * @param A first number
+ * @param B second number
+ * @param max_ulps number of doubles between A and B
+ * @returns TRUE if A == B, FALSE otherwise
+ */
+static gboolean
+_double_cmp(double A, double B, gint max_ulps)
+{
+   union {
+        double d;
+        gint64 i;
+   }f1, f2;
+   gint64 diff;
+
+   f1.d = A;
+   f2.d = B;
+
+   g_assert(max_ulps > 0 && max_ulps < 4*1024*1024);
+
+   if (f1.i < 0) f1.i = 0x80000000 - f1.i;
+   if (f2.i < 0) f1.i = 0x80000000 - f2.i;
+
+   diff = abs(f1.i - f2.i);
+   if (diff <= max_ulps)
+     return TRUE;
+
+   return FALSE;
+}
+
+/**
+ * @brief Implementation of do action from AtkAction interface
+ *
+ * @param action EailSlideshow instance
+ * @param i action index
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_slideshow_do_action(AtkAction *action, gint i)
+{
+   Evas_Object *widget;
+   gboolean result;
+   double slideshow_timeout;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!widget) return FALSE;
+
+   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
+     return FALSE;
+
+   switch (i)
+     {
+       case 0:
+           elm_slideshow_next(widget);
+           result = TRUE;
+           break;
+       case 1:
+           elm_slideshow_previous(widget);
+           result = TRUE;
+           break;
+       case 2:
+           elm_slideshow_timeout_set(widget, 0.0);
+           result = TRUE;
+           break;
+       case 3:
+           slideshow_timeout = elm_slideshow_timeout_get(widget);
+           if (_double_cmp(slideshow_timeout, 0.0, 1))
+             {
+                result = TRUE;
+                elm_slideshow_timeout_set(widget, SLIDESHOW_DEFAULT_TIMEOUT);
+                break;
+             }
+           result = FALSE;
+           break;
+       default:
+           result = FALSE;
+           break;
+     }
+
+   return result;
+}
+
+/**
+ * @brief Implementation of get_description from AtkAction interface
+ *
+ * @param action EailSlideshow instance
+ * @param i action index
+ *
+ * @returns action description
+ */
+static const gchar *
+eail_slidshow_description_get(AtkAction *action, gint i)
+{
+   const gchar *action_description;
+   EailSlideshow *slideshow;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(action), NULL);
+
+   slideshow = EAIL_SLIDESHOW(action);
+   switch (i)
+     {
+       case 0:
+           action_description = slideshow->next_description;
+           break;
+       case 1:
+           action_description = slideshow->previous_description;
+           break;
+       case 2:
+           action_description = slideshow->stop_description;
+           break;
+       case 3:
+           action_description = slideshow->start_description;
+           break;
+       default:
+           action_description = NULL;
+           break;
+     }
+   return action_description;
+}
+
+/**
+ * @brief Implementation of set_description from AtkAction interface
+ *
+ * @param action EailSlideshow instance
+ * @param i action index
+ * @param description action description to set
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_slideshow_description_set(AtkAction *action, gint i,
+                               const char *description)
+{
+   EailSlideshow *slideshow;
+   gchar **value;
+
+   g_return_val_if_fail(EAIL_IS_SLIDESHOW(action), FALSE);
+
+   slideshow = EAIL_SLIDESHOW(action);
+   switch (i)
+     {
+       case 0:
+           value = &slideshow->next_description;
+           break;
+       case 1:
+           value = &slideshow->previous_description;
+           break;
+       case 2:
+           value = &slideshow->stop_description;
+           break;
+       case 3:
+           value = &slideshow->start_description;
+           break;
+       default:
+           value = NULL;
+           break;
+     }
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(description);
+        return TRUE;
+     }
+   return FALSE;
+}
+
+/**
+ * @brief AtkAction interface initialization
+ *
+ * @param iface EailSlideshow object
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+   iface->do_action = eail_slideshow_do_action;
+   iface->get_n_actions = eail_slideshow_n_actions_get;
+   iface->get_description = eail_slidshow_description_get;
+   iface->set_description = eail_slideshow_description_set;
+   iface->get_name = eail_slideshow_action_name_get;
+   /*unsupported*/
+   /*iface->get_localized_name;*/
+   /*iface->get_keybinding;*/
+}
diff --git a/eail/eail/eail_slideshow.h b/eail/eail/eail_slideshow.h
new file mode 100644 (file)
index 0000000..aeb5d8d
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_slideshow.h
+ *
+ * @brief Header for EailSlideshow implementation
+ */
+
+#ifndef EAIL_SLIDESHOW_H
+#define EAIL_SLIDESHOW_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailSlideshow class
+ */
+#define EAIL_TYPE_SLIDESHOW             (eail_slideshow_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailSlideshow
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_SLIDESHOW(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                         EAIL_TYPE_SLIDESHOW, EailSlideshow))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailSlideshow class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_SLIDESHOW_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                         EAIL_TYPE_SLIDESHOW, \
+                                         EailSlideshowClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailSlideshow class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_SLIDESHOW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                         EAIL_TYPE_SLIDESHOW))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailSlideshow
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_SLIDESHOW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                         EAIL_TYPE_SLIDESHOW))
+
+/**
+ * @brief Gets EailSlideshow class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailSlideshow class from
+ */
+#define EAIL_SLIDESHOW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                         EAIL_TYPE_SLIDESHOW, \
+                                         EailSlideshowClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailSlideshow*/
+typedef struct _EailSlideshow EailSlideshow;
+/** @brief Definition of object class for Atk EailSlideshow*/
+typedef struct _EailSlideshowClass EailSlideshowClass;
+
+/** @brief Definition of object structure for Atk EailSlideshow*/
+struct _EailSlideshow
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+   gchar *next_description;/*!< @brief 'next' action description*/
+   gchar *previous_description;/*!< @brief 'previous' action description*/
+   gchar *stop_description;/*!< @brief 'stop' action description*/
+   gchar *start_description;/*!< @brief 'start' action description*/
+};
+
+/** @brief Definition of object class for Atk EailSlideshow*/
+struct _EailSlideshowClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailSlideshow GType
+ *
+ * @returns GType for EailSlideshow implementation*/
+GType eail_slideshow_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_spinner.c b/eail/eail/eail_spinner.c
new file mode 100644 (file)
index 0000000..17688e1
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_spinner.c
+ * @brief EailSpinner implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_spinner.h"
+
+static void atk_value_interface_init(AtkValueIface *iface);
+
+/**
+ * @brief EailSpinner type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailSpinner,
+                        eail_spinner,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
+                                              atk_value_interface_init));
+
+/**
+ * @brief EailSpinner interface initializer.
+ *
+ * @param spinner EailSpinner instance
+ */
+static void
+eail_spinner_init(EailSpinner *spinner)
+{
+}
+
+/**
+ * @brief EailSpinner initializer.
+ *
+ * @param obj an AtkObject instance
+ * @param data initialization data
+ */
+void
+eail_spinner_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_spinner_parent_class)->initialize(obj, data);
+   obj->role = ATK_ROLE_SPIN_BUTTON;
+}
+
+/**
+ * @brief Gets accessible name of accessible.
+ *
+ * @param accessible an AtkObject instance
+ * @return accessible name
+ */
+const gchar*
+eail_spinner_get_name(AtkObject *accessible)
+{
+   Evas_Object *widget;
+   const gchar *name;
+
+   name = ATK_OBJECT_CLASS(eail_spinner_parent_class)->get_name(accessible);
+   if (name) return name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(accessible));
+   if (widget)
+     name = (const gchar*)elm_object_text_get(widget);
+
+   return name;
+}
+
+/**
+ * @brief EailSpinner class initializer.
+ *
+ * @param klass EailSpinner class
+ */
+static void
+eail_spinner_class_init(EailSpinnerClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_spinner_initialize;
+   class->get_name = eail_spinner_get_name;
+}
+
+/**
+ * @brief Gets obj current value.
+ *
+ * @param obj an AtkValue instance
+ * @param [out] value obj current value
+ */
+static void
+eail_spinner_get_current_value(AtkValue *obj,
+                               GValue   *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, elm_spinner_value_get(widget));
+}
+
+/**
+ * @brief Gets obj maxiumum value.
+ *
+ * @param obj an AtkValue instance
+ * @param [out] value obj maxiumum value
+ */
+static void
+eail_spinner_get_maximum_value(AtkValue *obj,
+                               GValue   *value)
+{
+   Evas_Object *widget;
+   double max;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   elm_spinner_min_max_get(widget, NULL, &max);
+   g_value_set_double(value, max);
+}
+
+/**
+ * @brief Gets obj minimum value.
+ *
+ * @param obj an AtkValue instance
+ * @param [out] value obj minimum value
+ */
+static void
+eail_spinner_get_minimum_value(AtkValue *obj,
+                               GValue   *value)
+{
+   Evas_Object *widget;
+   double min;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   elm_spinner_min_max_get(widget, &min, NULL);
+   g_value_set_double(value, min);
+}
+
+/**
+ * @brief Sets obj value.
+ *
+ * @param obj an AtkValue instance
+ * @param value obj new value
+ * @return TRUE if new value is set successfully, FALSE otherwise
+ */
+static gboolean
+eail_spinner_set_current_value(AtkValue     *obj,
+                               const GValue *value)
+{
+   Evas_Object *widget;
+   double min, max, val;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return FALSE;
+
+   val = g_value_get_double(value);
+   elm_spinner_min_max_get(widget, &min, &max);
+
+   if (min > val || max < val)
+     return FALSE;
+
+   elm_spinner_value_set(widget, val);
+
+   return TRUE;
+}
+
+/**
+ * @brief Gets obj minimum increment.
+ *
+ * @param obj an AtkValue instance
+ * @param [out] value obj minimum increment
+ */
+static void
+eail_spinner_get_minimum_increment(AtkValue *obj,
+                                   GValue *value)
+{
+   Evas_Object *widget;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!widget) return;
+
+   memset(value, 0, sizeof(GValue));
+   g_value_init(value, G_TYPE_DOUBLE);
+   g_value_set_double(value, elm_spinner_step_get(widget));
+}
+
+/**
+ * @brief AtkValue interface initializer.
+ *
+ * @param iface an AtkValueIface instance
+ */
+static void
+atk_value_interface_init(AtkValueIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_current_value = eail_spinner_get_current_value;
+   iface->get_maximum_value = eail_spinner_get_maximum_value;
+   iface->get_minimum_value = eail_spinner_get_minimum_value;
+   iface->set_current_value = eail_spinner_set_current_value;
+   iface->get_minimum_increment = eail_spinner_get_minimum_increment;
+}
diff --git a/eail/eail/eail_spinner.h b/eail/eail/eail_spinner.h
new file mode 100644 (file)
index 0000000..0d4f371
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_spinner.h
+ *
+ * @brief Header for EailSpinner implementation
+ */
+
+#ifndef EAIL_SPINNER_H
+#define EAIL_SPINNER_H
+
+#include "eail_widget.h"
+
+
+/**
+ * @brief Returns a value corresponding to the type of EailSpinner class
+ */
+#define EAIL_TYPE_SPINNER             (eail_spinner_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailSpinner
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_SPINNER(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                       EAIL_TYPE_SPINNER, EailSpinner))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailSpinner class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_SPINNER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                       EAIL_TYPE_SPINNER, EailSpinnerClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailSpinner class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_SPINNER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                       EAIL_TYPE_SPINNER))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailSpinner
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_SPINNER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                       EAIL_TYPE_SPINNER))
+
+
+/**
+ * @brief Gets EailSpinner class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailSpinner class from
+ */
+#define EAIL_SPINNER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                       EAIL_TYPE_SPINNER, EailSpinnerClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailSpinner*/
+typedef struct _EailSpinner      EailSpinner;
+/** @brief Definition of object class for Atk EailSpinner*/
+typedef struct _EailSpinnerClass EailSpinnerClass;
+
+/** @brief Definition of object structure for Atk EailSpinner*/
+struct _EailSpinner
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailSpinner*/
+struct _EailSpinnerClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailSpinner GType
+ *
+ * @returns GType for EailSpinner implementation*/
+GType eail_spinner_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_table.c b/eail/eail/eail_table.c
new file mode 100644 (file)
index 0000000..ff3864b
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file eail_table.c
+ * @brief Implementation of elm_table as AtkObject
+ */
+#include <Elementary.h>
+
+#include "eail_table.h"
+
+/**
+ * @brief Smart type used by elm_table to get internal content of widget
+ */
+#define TABLE_SMART_TYPE "Evas_Object_Table"
+
+/**
+ * @brief GObject definition of EailTable
+ *
+ * EailTable is extended EailWidget
+ * */
+G_DEFINE_TYPE(EailTable, eail_table, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief EailTable initialize
+ *
+ * Initialization of parent object, role etc.
+ *
+ * @param object EailTable instance
+ * @param data user data passed to initialize
+ */
+static void
+eail_table_initialize(AtkObject *object, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_table_parent_class)->initialize(object, data);
+
+   object->role = ATK_ROLE_FILLER;
+}
+
+/**
+ * @brief EailTable init
+ *
+ * @param table EailTable instance
+ */
+static void
+eail_table_init(EailTable *table)
+{
+}
+
+/**
+ * @brief Implementation of get_widget_children from EailWidget
+ *
+ * @param widget EailTable instance
+ *
+ * @returns list of widgets
+ */
+static Eina_List *
+eail_table_children_get(EailWidget *widget)
+{
+   Evas_Object *table, *object;
+   Eina_List *smart_members;
+
+   g_return_val_if_fail(EAIL_IS_TABLE(widget), NULL);
+
+   object = eail_widget_get_widget(widget);
+
+   if (!object) return NULL;
+
+   smart_members = evas_object_smart_members_get(object);
+   /*table has one smart member it is Evas_Object_Table*/
+   table = eina_list_nth(smart_members, 0);
+   eina_list_free(smart_members);
+
+   if (evas_object_smart_type_check(table, TABLE_SMART_TYPE))
+     {
+        return evas_object_table_children_get(table);
+     }
+
+   return NULL;
+}
+
+/**
+ * @brief EailTable class initialize
+ *
+ * @param klass EailTable class
+ */
+static void
+eail_table_class_init(EailTableClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   widget_class->get_widget_children = eail_table_children_get;
+
+   class->initialize = eail_table_initialize;
+}
+
diff --git a/eail/eail/eail_table.h b/eail/eail/eail_table.h
new file mode 100644 (file)
index 0000000..03f4eeb
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef EAIL_TABLE_H
+#define EAIL_TABLE_H
+
+/**
+ * @file eail_table.h
+ *
+ * @brief Header for EailTable implementation
+ */
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailTable class
+ */
+#define EAIL_TYPE_TABLE             (eail_table_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailTable
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_TABLE(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                     EAIL_TYPE_TABLE, EailTable))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailTable class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_TABLE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                     EAIL_TYPE_TABLE, EailTableClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailTable class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_TABLE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                     EAIL_TYPE_TABLE))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailTable
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_TABLE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                     EAIL_TYPE_TABLE))
+
+/**
+ * @brief Gets EailTable class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailTable class from
+ */
+#define EAIL_TABLE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                     EAIL_TYPE_TABLE, EailTableClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailTable*/
+typedef struct _EailTable      EailTable;
+/** @brief Definition of object class for Atk EailTable*/
+typedef struct _EailTableClass EailTableClass;
+
+/** @brief Definition of object structure for Atk EailTable*/
+struct _EailTable
+{
+   /** @brief Parent object that functionality is being extended*/
+    EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailTable*/
+struct _EailTableClass
+{
+   /** @brief Parent object that functionality is being extended*/
+    EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailTable GType
+ *
+ * @returns GType for EailTable implementation*/
+GType eail_table_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_text.c b/eail/eail/eail_text.c
new file mode 100644 (file)
index 0000000..b42d618
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_text.c
+ * @brief EailText implementation
+ */
+
+#include <Elementary.h>
+
+#include "eail_text.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+
+/*
+ * Implementation of the *AtkObject* interface
+ */
+
+static void atk_text_interface_init(AtkTextIface *iface);
+
+/**
+ * @brief EailText type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailText,
+                        eail_text,
+                        EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
+                                              atk_text_interface_init));
+
+/**
+ * @brief EailText initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_text_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_text_parent_class)->initialize(obj, data);
+
+   obj->role = ATK_ROLE_TEXT;
+}
+
+/**
+ * @brief Gets obj name
+ *
+ * Returns obj accessible name if assigned, obj text content otherwise
+ *
+ * @param obj an AtkObject
+ * @returns accessible obj name if assigned, obj text content otherwise
+ */
+static const gchar*
+eail_text_get_name(AtkObject *obj)
+{
+   const gchar *name;
+   Evas_Object *widget;
+
+   name = ATK_OBJECT_CLASS(eail_text_parent_class)->get_name(obj);
+   if (NULL != name)
+     return name;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (widget)
+     name = (const gchar*)elm_object_text_get(widget);
+
+   return name;
+}
+
+/**
+ * @brief EailText instance initializer
+ *
+ * @param text an EailText
+ */
+static void
+eail_text_init(EailText *text)
+{
+}
+
+/**
+ * @brief EailText class initializer
+ *
+ * @param klass an EailTextClass
+ */
+static void
+eail_text_class_init(EailTextClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+
+   class->initialize = eail_text_initialize;
+   class->get_name = eail_text_get_name;
+}
+
+/*
+ * Implementation of the *AtkText* interface
+ */
+
+/**
+ * @brief Gets text bounded by start_offset and end_offset
+ *
+ * Use g_free() to free the returned string
+ *
+ * @param text an AtkText
+ * @param start_offset start position
+ * @param end_offset end position, -1 for the end of the string
+ * @return string containing text from start_offset up to, but not including
+ * end_offset
+ */
+static gchar*
+eail_text_get_text(AtkText   *text,
+                   gint       start_offset,
+                   gint       end_offset)
+{
+   gchar *string = NULL;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     string = (gchar *)elm_object_text_get(widget);
+
+   return eail_get_substring(string, start_offset, end_offset);
+}
+
+/**
+ * @brief Gets character at offset
+ *
+ * @param text an AtkText
+ * @param offset character offset
+ * @return character at offset
+ */
+static gunichar
+eail_text_get_character_at_offset(AtkText    *text,
+                                  gint        offset)
+{
+   gunichar character = '\0';
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (widget)
+     character = g_utf8_get_char(
+         g_utf8_offset_to_pointer(elm_object_text_get(widget), offset));
+
+   return character;
+}
+
+/**
+ * @brief Gets text length
+ *
+ * @param text an AtkText
+ * @return text length
+ */
+static gint
+eail_text_get_character_count(AtkText *text)
+{
+   gint count = 0;
+   const gchar *string_text = NULL;
+
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
+
+   if (!widget) return count;
+
+   string_text = elm_object_text_get(widget);
+   if (!string_text) return count;
+
+   count = g_utf8_strlen(string_text, -1);
+
+   return count;
+}
+
+/**
+ * @brief AtkText interface initializer
+ *
+ * @param iface an AtkTextIface
+ */
+static void
+atk_text_interface_init(AtkTextIface *iface)
+{
+   iface->get_text = eail_text_get_text;
+   iface->get_character_at_offset = eail_text_get_character_at_offset;
+   iface->get_character_count = eail_text_get_character_count;
+}
diff --git a/eail/eail/eail_text.h b/eail/eail/eail_text.h
new file mode 100644 (file)
index 0000000..949dc54
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_text.h
+ *
+ * @brief Header for EailText implementation
+ */
+
+#ifndef EAIL_TEXT_H
+#define EAIL_TEXT_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailText class
+ */
+#define EAIL_TYPE_TEXT             (eail_text_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailText
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_TEXT(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                    EAIL_TYPE_TEXT, EailText))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailText class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_TEXT_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                    EAIL_TYPE_TEXT, EailTextClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailText class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_TEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                    EAIL_TYPE_TEXT))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailText
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_TEXT_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                    EAIL_TYPE_TEXT))
+
+/**
+ * @brief Gets EailText class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailText class from
+ */
+#define EAIL_TEXT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                    EAIL_TYPE_TEXT, EailTextClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/** @brief Definition of object structure for Atk EailActionSlider*/
+typedef struct _EailText      EailText;
+/** @brief Definition of object class for Atk EailActionSlider*/
+typedef struct _EailTextClass EailTextClass;
+
+/** @brief Definition of object structure for Atk EailActionSlider*/
+struct _EailText
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailActionSlider*/
+struct _EailTextClass
+{
+   EailWidgetClass parent_class;/*!< @brief parent class that is being extended*/
+};
+
+/** @brief Getter for EailText GType
+ * @returns GType for EailText implementation*/
+GType eail_text_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_thumb.c b/eail/eail/eail_thumb.c
new file mode 100644 (file)
index 0000000..1f42f82
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_thumb.c
+ * @brief EailThumb Implementation
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_thumb.h"
+#include "eail_widget.h"
+
+static void atk_image_iface_init(AtkImageIface *iface);
+
+/**
+ * @brief EailThumb type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailThumb,
+                        eail_thumb,
+                        EAIL_TYPE_IMAGE,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
+                                              atk_image_iface_init));
+
+/**
+ * @brief EailThumb initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_thumb_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_thumb_parent_class)->initialize(obj, data);
+}
+
+/**
+ * @brief EailThumb instance initializer
+ *
+ * @param thumb an EailThumb
+ */
+static void
+eail_thumb_init(EailThumb *thumb)
+{
+}
+
+/**
+ * @brief Gets obj state set
+ *
+ * @param obj an AtkObject
+ * @return obj state set
+ */
+static AtkStateSet*
+eail_thumb_ref_state_set(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+
+   g_return_val_if_fail(EAIL_IS_THUMB(obj), NULL);
+
+   state_set = ATK_OBJECT_CLASS(eail_thumb_parent_class)->ref_state_set(obj);
+   if (!state_set)
+     atk_state_set_add_state(state_set, ATK_STATE_ANIMATED);
+
+   return state_set;
+}
+
+/**
+ * @brief EailThumb class initializer
+ *
+ * @param klass an EailThumbClass
+ */
+static void
+eail_thumb_class_init(EailThumbClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   class->initialize = eail_thumb_initialize;
+   class->ref_state_set = eail_thumb_ref_state_set;
+}
+
+/**
+ * @brief Gets thumb current size
+ *
+ * @param image an AtkImage
+ * @param [out] width thumb current width
+ * @param [out] height thumb current height
+ */
+static void
+eail_thumb_size_get(AtkImage *image, gint *width, gint *height)
+{
+#ifdef ELM_ETHUMB
+   Ethumb_Client *client;
+#endif
+   Evas_Object *widget;
+
+   g_return_if_fail(EAIL_IS_THUMB(image));
+#ifdef ELM_ETHUMB
+   client = elm_thumb_ethumb_client_get();
+   ethumb_client_size_get(client, width, height);
+   return;
+#endif
+   widget = eail_widget_get_widget(EAIL_WIDGET(image));
+
+   if (!widget)
+     {
+        *width = -1;
+        *height = -1;
+        return;
+     }
+
+   evas_object_geometry_get(widget, NULL, NULL, width, height);
+}
+
+/**
+ * @brief AtkImage interface initializer
+ *
+ * @param iface an AtkImageIface
+ */
+static void
+atk_image_iface_init(AtkImageIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_image_size = eail_thumb_size_get;
+}
diff --git a/eail/eail/eail_thumb.h b/eail/eail/eail_thumb.h
new file mode 100644 (file)
index 0000000..773588c
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_thumb.h
+ *
+ * @brief Header for EailThumb implementation
+ */
+
+#ifndef EAIL_THUMB_H
+#define EAIL_THUMB_H
+
+#include "eail_image.h"
+
+
+/**
+ * @brief Returns a value corresponding to the type of EailThumb class
+ */
+#define EAIL_TYPE_THUMB             (eail_thumb_get_type ())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailThumb
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_THUMB(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                     EAIL_TYPE_THUMB, EailThumb))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailThumb class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_THUMB_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                     EAIL_TYPE_THUMB, EailThumbClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailThumb class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_THUMB(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                     EAIL_TYPE_THUMB))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailThumb
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_THUMB_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                     EAIL_TYPE_THUMB))
+
+/**
+ * @brief Gets EailThumb class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailThumb class from
+ */
+#define EAIL_THUMB_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                     EAIL_TYPE_THUMB, EailThumbClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailThumb*/
+typedef struct _EailThumb      EailThumb;
+/** @brief Definition of object class for Atk EailThumb*/
+typedef struct _EailThumbClass EailThumbClass;
+
+/** @brief Definition of object structure for Atk EailThumb*/
+struct _EailThumb
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailImage parent;
+};
+
+/** @brief Definition of object class for Atk EailThumb*/
+struct _EailThumbClass
+{
+   EailImageClass parent_class;/*!< @brief class whose functionality is being extended*/
+};
+
+/** @brief Getter for EailThumb GType
+ *
+ * @returns GType for EailThumb implementation*/
+GType eail_thumb_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_toolbar.c b/eail/eail/eail_toolbar.c
new file mode 100644 (file)
index 0000000..ed22b91
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_toolbar.c
+ * @brief Implementation of toolbar widget
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#include "eail_toolbar.h"
+#include "eail_factory.h"
+#include "eail_item_parent.h"
+#include "eail_priv.h"
+
+static void eail_item_parent_interface_init(EailItemParentIface *iface);
+
+/**
+ * @brief Definition of EailToolbar as GObject
+ *
+ * EailToolbar is extended EAIL_TYPE_WIDGET with EAIL_TYPE_ITEM_PARENT interface
+ * implemented
+ */
+G_DEFINE_TYPE_WITH_CODE(EailToolbar, eail_toolbar, EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_ITEM_PARENT,
+                                              eail_item_parent_interface_init)
+);
+
+/**
+ * @brief Implementation of the *AtkObject* interface
+ *
+ * Basic initialization for AtkObject (parent initialization, role definition
+ * etc.)
+ *
+ * @param obj an AtkObject
+ * @param data additional data passed to initialization
+ */
+static void
+eail_toolbar_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_toolbar_parent_class) ->initialize(obj, data);
+   obj->role = ATK_ROLE_TOOL_BAR;
+}
+
+/**
+ * @brief EailToolbar instance initializer
+ *
+ * @param toolbar an EailToolbar
+ */
+static void
+eail_toolbar_init(EailToolbar *toolbar)
+{
+
+}
+
+/**
+ * @brief Gets toolbar items
+ *
+ * @param toolbar an EailToolbar
+ * @return list of Elm_Object_Item* objects
+ * */
+static Eina_List *
+eail_toolbar_get_items(EailToolbar *toolbar)
+{
+   Eina_List *items = NULL;
+   Elm_Object_Item *item;
+   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(toolbar));
+
+   item = elm_toolbar_first_item_get(widget);
+   while (item)
+     {
+        items = eina_list_append(items, item);
+        item = elm_toolbar_item_next_get(item);
+     }
+
+   return items;
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_toolbar_get_n_children(AtkObject *obj)
+{
+   gint n_items;
+   Eina_List *items;
+
+   items = eail_toolbar_get_items(EAIL_TOOLBAR(obj));
+   n_items = eina_list_count(items);
+
+   eina_list_free(items);
+
+   return n_items;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i index of a child
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_toolbar_ref_child(AtkObject *obj, gint i)
+{
+   Eina_List *items;
+   AtkObject *child = NULL;
+
+   items = eail_toolbar_get_items(EAIL_TOOLBAR(obj) );
+   if (eina_list_count(items) > i)
+     {
+        child = eail_factory_get_item_atk_obj
+                             (eina_list_nth(items, i), ATK_ROLE_LIST_ITEM, obj);
+
+        g_object_ref(child);
+     }
+   else
+     ERR("Tried to ref child with index %d out of bounds!", i);
+
+   eina_list_free(items);
+
+   return child;
+}
+
+/**
+ * @brief Destructor for EailToolbar object
+ *
+ * @param object GObject corresponding to EailToolbar
+ */
+static void
+eail_toolbar_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_toolbar_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initializer for EailToolbar GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailToolbar class
+ */
+static void
+eail_toolbar_class_init(EailToolbarClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_toolbar_initialize;
+   class->get_n_children = eail_toolbar_get_n_children;
+   class->ref_child = eail_toolbar_ref_child;
+   gobject_class->finalize = eail_toolbar_finalize;
+}
+
+/**
+ * @brief Gets the object of item
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns item object
+ */
+static Evas_Object *
+eail_toolbar_get_evas_obj(EailItemParent   *parent,
+                          EailItem         *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+
+   if (!it)
+     {
+        ERR("Error. Could not get Elm_Object_item from EailItem");
+        return NULL;
+     }
+
+   return elm_toolbar_item_object_get(it);
+}
+
+/**
+ * @brief Implementation of EailItemParent->get_actions_supported callback
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ * @returns enum representing supported actions
+ */
+static gint
+eail_toolbar_get_actions_supported(EailItemParent   *parent,
+                                   EailItem         *item)
+{
+   return EAIL_ACTION_SUPPORTED_CLICK;
+}
+
+/**
+ * @brief Gets item accessible name
+ *
+ * @param parent an EailItemParent
+ * @param item an EailItem
+ *
+ * @returns item accessible name
+ */
+static const gchar *
+eail_toolbar_item_name_get(EailItemParent *parent, EailItem *item)
+{
+   Elm_Object_Item *it = eail_item_get_item(item);
+   if (!it) return NULL;
+
+   return elm_object_item_part_text_get(it, NULL);
+}
+
+/**
+ * @brief Initialization of EailItemParentIface interface callbacks
+ *
+ * Function called upon instance creation. It initializes EailItemParent
+ * interface implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an EailItemParent interface
+ */
+static void
+eail_item_parent_interface_init(EailItemParentIface *iface)
+{
+   iface->get_item_name            = eail_toolbar_item_name_get;
+   iface->get_evas_obj             = eail_toolbar_get_evas_obj;
+   iface->get_actions_supported    = eail_toolbar_get_actions_supported;
+}
diff --git a/eail/eail/eail_toolbar.h b/eail/eail/eail_toolbar.h
new file mode 100644 (file)
index 0000000..4425e33
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_toolbar.h
+ *
+ * @brief Header for EailToolbar implementation
+ */
+
+#ifndef EAIL_TOOLBAR_H
+#define EAIL_TOOLBAR_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailToolbar class
+ */
+#define EAIL_TYPE_TOOLBAR             (eail_toolbar_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailToolbar
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_TOOLBAR(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                            EAIL_TYPE_TOOLBAR, \
+                                            EailToolbar))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailToolbar class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_TOOLBAR_CLASS(klass)     (G_TYPE_TOOLBAR_CLASS_CAST((klass), \
+                                            EAIL_TYPE_TOOLBAR, \
+                                            EailToolbarClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailToolbar class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_TOOLBAR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                            EAIL_TYPE_TOOLBAR))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailToolbar
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_TOOLBAR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                            EAIL_TYPE_TOOLBAR))
+
+/**
+ * @brief Gets EailToolbar class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailToolbar class from
+ */
+#define EAIL_TOOLBAR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                            EAIL_TYPE_TOOLBAR, \
+                                            EailToolbarClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailToolbar*/
+typedef struct _EailToolbar EailToolbar;
+
+/** @brief Definition of object class for Atk EailToolbar*/
+typedef struct _EailToolbarClass EailToolbarClass;
+
+/** @brief Definition of object structure for Atk EailToolbar*/
+struct _EailToolbar
+{
+   /** @brief Parent object that functionality is being extended*/
+   EailWidget parent;
+};
+
+/** @brief Definition of object class for Atk EailToolbar*/
+struct _EailToolbarClass
+{
+   /** @brief Parent class whose functionality is being extended*/
+   EailWidgetClass parent_class;
+};
+
+/** @brief Getter for EailToolbar GType
+ *
+ * @returns GType for EailToolbar implementation*/
+GType eail_toolbar_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/eail/eail/eail_utils.c b/eail/eail/eail_utils.c
new file mode 100644 (file)
index 0000000..2a5a59e
--- /dev/null
@@ -0,0 +1,588 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_utils.c
+ * @brief Implementation of utility functions used in various places in EAIL
+ * code
+ */
+
+/* enabling beta API support for Eo parts*/
+#define EFL_BETA_API_SUPPORT
+
+#include <atk/atk.h>
+#include <Elementary.h>
+#include <Eina.h>
+#include <Evas.h>
+
+/* internal elm_widget api for listening EDJE parts */
+
+#define ELM_INTERNAL_API_ARGESFSDFEFC
+#include <elm_widget.h>
+
+#include "eail_utils.h"
+#include "eail_factory.h"
+#include "eail_dynamic_content.h"
+#include "eail_priv.h"
+
+/**
+ * @param string base string to get substring from
+ * @param start_offset beginning offset
+ * @param end_offset end offset
+ *
+ * @returns newly allocated substring
+ */
+gchar *
+eail_get_substring(const gchar *string,
+                   gint         start_offset,
+                   gint         end_offset)
+{
+   gchar *substring = NULL;
+   gint len = 0;
+   gint sub_len = 0;
+
+   if (!string) return NULL;
+
+   len = g_utf8_strlen(string, -1);
+
+   if ((start_offset <  0) ||
+      (start_offset > len - 1) ||
+      (end_offset   <  -1))
+    return NULL;
+   else if (end_offset == -1 ||
+           end_offset >= len - 1)
+     sub_len = len - start_offset + 1;
+   else
+     sub_len = end_offset - start_offset;
+
+   substring = g_malloc0(sub_len + 1);
+
+   return g_utf8_strncpy(substring, &string[start_offset], sub_len);
+}
+
+/**
+ * @param widget Evas_Object for getting state_set
+ * @param state_set current state_set taken from objects parent
+ *
+ * @returns filled AtkStateSet for given EvasObject
+ */
+AtkStateSet *
+eail_evas_obj_ref_state_set(Evas_Object *widget, AtkStateSet *state_set)
+{
+   if (!widget) {
+       atk_state_set_add_state(state_set, ATK_STATE_DEFUNCT);
+       return state_set;
+   }
+
+   if (!elm_object_disabled_get(widget)) {
+       atk_state_set_add_state(state_set, ATK_STATE_SENSITIVE);
+       atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
+   }
+
+   if (evas_object_visible_get(widget)) {
+       int x, y, width, height;
+       int vp_x, vp_y, vp_width, vp_height;
+
+       atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
+
+       evas_object_geometry_get(widget, &x, &y, &width, &height);
+       evas_output_viewport_get(evas_object_evas_get(widget),
+                                &vp_x, &vp_y, &vp_width, &vp_height);
+
+       if ((x + width) >= vp_x && (y + height) >= vp_y &&
+           (vp_x + vp_width) >= x && (vp_y + vp_height) >= y) {
+           atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
+       }
+   }
+
+   if (elm_object_focus_allow_get(widget)) {
+       atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE);
+
+       if (elm_object_focus_get(widget)) {
+           atk_state_set_add_state(state_set, ATK_STATE_FOCUSED);
+       }
+   }
+
+   return state_set;
+}
+
+/**
+ * @param widget an Evas_Object
+ * @return TRUE if grabbing focus was successfull, FALSE otherwise
+ */
+gboolean
+eail_evas_obj_grab_focus(Evas_Object *widget)
+{
+   Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(widget));
+
+   if (!widget || !elm_object_focus_allow_get(widget)) {
+         return FALSE;
+   }
+
+   ecore_evas_activate(ee);
+   elm_object_focus_set(widget, EINA_TRUE);
+
+   return TRUE;
+}
+
+/**
+ * @param widget an Evas_Object to press on
+ * @param x X coord
+ * @param y y coord
+ */
+void
+eail_mouse_press_on_coords(Evas_Object *widget, int x, int y)
+{
+   Evas* evas = NULL;
+   evas =  evas_object_evas_get(widget);
+
+   evas_event_feed_mouse_move(evas, x, y, 0, NULL);
+   evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
+}
+
+/**
+ * @param widget an Evas_Object to press on
+ * @param x X coord
+ * @param y y coord
+ */
+void
+eail_mouse_release_on_coords(Evas_Object *widget, int x, int y)
+{
+   Evas* evas = NULL;
+   evas =  evas_object_evas_get(widget);
+
+   evas_event_feed_mouse_move(evas, x, y, 0, NULL);
+   evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
+}
+
+/**
+ * @param widget an Evas_Object to click on
+ * @param x X coord
+ * @param y y coord
+ */
+void
+eail_mouse_click_on_coords(Evas_Object *widget, int x, int y)
+{
+   Evas* evas = NULL;
+   evas =  evas_object_evas_get(widget);
+
+   evas_event_feed_mouse_move(evas, x, y, 0, NULL);
+   evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
+   evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
+}
+
+/**
+ * @param widget an Evas_Object to get values for
+ * @param x address of int to put X coord in
+ * @param y address of int to put Y coord in
+ */
+void
+eail_get_coords_widget_center(Evas_Object *widget, int *x, int *y)
+{
+   int w, h;
+   evas_object_geometry_get(widget, x, y, &w, &h);
+
+   *x = *x + (w / 2);
+   *y = *y + (h / 2);
+}
+
+/**
+ * @param item an Elm_Object_Item*
+ *
+ * @returns Eina_List * filled with raw Evas_Object* (not every returned
+ * Evas_Object is widget - widget-only content is returned by
+ * eail_get_edje_parts_for_item function)
+ */
+Eina_List *
+eail_get_raw_evas_obj_list_from_item(Elm_Object_Item *item)
+{
+   Evas_Object *edje = NULL;
+
+   edje = VIEW(item);
+   if (!edje)
+     {
+        DBG("Edje object for item not found. Returning empty list");\
+        return NULL;
+     }
+
+    return evas_object_smart_members_get(edje);
+}
+
+/**
+ * @param item Elm_Object_Item * to get strings from
+ * @returns EinaList filled with const gchar* that are representing text
+ * content of item. List have to be freed when no longer needed but DO NOT
+ * FREE CONTENT STRINGS.
+ */
+Eina_List *
+eail_item_get_content_strings(Elm_Object_Item *item)
+{
+   Eina_List *strings_list = NULL;
+   Eina_List *edje_parts = NULL;
+   Evas_Object *part = NULL;
+   Eina_List *l;
+
+
+   edje_parts = eail_get_raw_evas_obj_list_from_item(item);
+   EINA_LIST_FOREACH(edje_parts, l, part)
+     {
+      const gchar *type_name = evas_object_type_get(part);
+
+      if (0 == strcmp(type_name, "text"))
+        {
+           const gchar *text = evas_object_text_text_get(part);
+
+           if (text)
+             strings_list = eina_list_append(strings_list, text);
+        }
+     }
+
+   return strings_list;
+}
+
+/**
+ * It does filtering inside and returs only parts that can be used later in
+ * eail factory (only widgets will be returned)
+ *
+ * @param item Elm_Object_Item * to get objects from
+ *
+ * @returns Eina_List* filled with Evas_Object* objects representing content
+ * found inside item
+ */
+Eina_List *
+eail_get_edje_parts_for_item(Elm_Object_Item *item)
+{
+   Eina_List *edje_parts = NULL;
+   Eina_List *usable_parts = NULL;
+   int i = 0;
+
+   edje_parts = eail_get_raw_evas_obj_list_from_item(item);
+   for (i = 0; i < eina_list_count(edje_parts); ++i)
+     {
+        Evas_Object *obj = eina_list_nth(edje_parts, i);
+
+        /* adding only parts that can be used by eail_factory later */
+        if (elm_object_widget_check(obj))
+          usable_parts = eina_list_append(usable_parts, obj);
+     }
+
+   eina_list_free(edje_parts);
+
+   return usable_parts;
+}
+
+/**
+ *
+ * @param widget am Evas_Object
+ * @param type type of scroll action
+ *
+ * @returns TRUE if scroll action was successful, FALSE otherwise
+ */
+gboolean
+eail_handle_scroll(Evas_Object *widget,
+                   enum EAIL_SCROLL_TYPE type)
+{
+   int x, y, w, h;
+
+   elm_scroller_region_get(widget, &x, &y, &w, &h);
+
+   if (EAIL_SCROLL_TYPE_UP == type)
+      y = y - h;
+   else if (EAIL_SCROLL_TYPE_DOWN == type)
+      y = y + h;
+   else if (EAIL_SCROLL_TYPE_RIGHT == type)
+      x = x + w;
+   else if (EAIL_SCROLL_TYPE_LEFT == type)
+      x = x - w;
+
+   elm_scroller_region_bring_in(widget, x, y, w, h);
+
+   return TRUE;
+}
+
+/**
+ *
+ * @param widget an Evas_Object*
+ * @param data additional action data
+ * @returns TRUE if scroll action was successful, FALSE otherwise
+ */
+gboolean
+eail_action_scroll_up(Evas_Object *widget,
+                      void *data)
+{
+   return eail_handle_scroll(widget, EAIL_SCROLL_TYPE_UP);
+}
+
+/**
+ *
+ * @param widget an Evas_Object*
+ * @param data additional action data
+ *
+ * @returns TRUE if scroll action was successful, FALSE otherwise
+ */
+gboolean
+eail_action_scroll_down(Evas_Object *widget,
+                        void *data)
+{
+   return eail_handle_scroll(widget, EAIL_SCROLL_TYPE_DOWN);
+}
+
+/**
+ *
+ * @param widget an Evas_Object*
+ * @param data additional action data
+ *
+ * @returns TRUE if scroll action was successful, FALSE otherwise
+ */
+gboolean
+eail_action_scroll_left(Evas_Object *widget,
+                        void *data)
+{
+   return eail_handle_scroll(widget, EAIL_SCROLL_TYPE_LEFT);
+}
+
+/**
+ *
+ * @param widget an Evas_Object*
+ * @param data additional action data
+ *
+ * @returns TRUE if scroll action was successful, FALSE otherwise
+ */
+gboolean
+eail_action_scroll_right(Evas_Object *widget,
+                         void *data)
+{
+   return eail_handle_scroll(widget, EAIL_SCROLL_TYPE_RIGHT);
+}
+
+/**
+ * @param atk_obj an AtkObject that emits the signal
+ * @param signal_name name of signal
+ * @param object_type an GType of object
+ */
+void
+eail_emit_atk_signal(AtkObject *atk_obj, const gchar *signal_name,
+                     GType object_type)
+{
+   guint signal = g_signal_lookup (signal_name,object_type);
+   if (!signal)
+     {
+        ERR("No signal with name %s was found", signal_name);
+        return;
+     }
+
+   DBG("Raising %s signal", signal_name);
+   g_signal_emit (atk_obj, signal, 0);
+}
+
+/**
+ * @param added boolean used for marking if child is added. TRUE if child was
+ * added, FALSE when child was removed
+ * @param atk_obj an AtkObject that emits the signal
+ * @param child_number index number of changed child
+ */
+void
+eail_emit_children_changed(gboolean added, AtkObject *atk_obj, gint child_number)
+{
+
+   DBG("Emitting child-changed for index %d. ADDED: %d", child_number, added);
+
+   if (added)
+     g_signal_emit_by_name
+                 (atk_obj, "children_changed::add", child_number, NULL, NULL);
+   else
+     g_signal_emit_by_name
+               (atk_obj, "children_changed::remove", child_number, NULL, NULL);
+
+}
+
+/**
+ * @param added boolean used for marking if child is added. TRUE if child was
+ * added, FALSE when child was removed
+ * @param atk_obj an AtkObject that emits the signal
+ * @param changed_obj pointer to object that has been added/removed
+ */
+void
+eail_emit_children_changed_obj(gboolean added,
+                               AtkObject *atk_obj,
+                               AtkObject *changed_obj)
+{
+
+   DBG("Emitting child-changed for obj. ADDED: %d", added);
+
+   if (added)
+     g_signal_emit_by_name
+                 (atk_obj, "children_changed::add", NULL, changed_obj, NULL);
+   else
+     g_signal_emit_by_name
+               (atk_obj, "children_changed::remove", NULL, changed_obj, NULL);
+
+}
+/**
+ * @brief handles 'selected' state changes for item
+ *
+ * @param item an Elm_Object* item
+ * @param selected value of 'selected' state
+ * @param parent an AtkObject* that holds item inside
+ * @param role an AtkRole for item
+ */
+static void
+_eail_handle_selected_for_item(Elm_Object_Item *item,
+                               gboolean selected,
+                               AtkObject *parent,
+                               AtkRole role)
+{
+   AtkObject *atk_item_obj = NULL;
+   if (!item && !parent)
+     {
+        ERR("Wrong parameters passed. Ignoring event");
+        return;
+     }
+
+   atk_item_obj = eail_factory_get_item_atk_obj(item, role, parent);
+   if (!atk_item_obj)
+     {
+        DBG("Couldn't find factory obj for item. Ignoring 'selected' event");
+        return;
+     }
+
+   atk_object_notify_state_change(atk_item_obj, ATK_STATE_SELECTED, selected);
+}
+
+/**
+ * @brief Function that calls apropriate handling for selected event
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ * @param selected selected state
+ */
+static void
+_eail_list_item_do_handle_selected_event(void *data,
+                                         Evas_Object *obj,
+                                         void *event_info,
+                                         gboolean selected)
+{
+   Elm_Object_Item *obj_item = (Elm_Object_Item*)event_info;
+   if (!obj_item)
+     {
+        DBG("obj_item not found in event_info. Ignoring event..");
+        return;
+     }
+
+   eail_notify_child_focus_changes();
+   _eail_handle_selected_for_item
+                     (obj_item, selected, ATK_OBJECT(data), ATK_ROLE_LIST_ITEM);
+}
+
+/**
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+eail_list_item_handle_selected_event(void *data,
+                                      Evas_Object *obj,
+                                      void *event_info)
+{
+   _eail_list_item_do_handle_selected_event(data, obj, event_info, TRUE);
+}
+
+/**
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+eail_list_item_handle_unselected_event(void *data,
+                                       Evas_Object *obj,
+                                       void *event_info)
+{
+   _eail_list_item_do_handle_selected_event(data, obj, event_info, FALSE);
+}
+
+/**
+ * @brief Notifies objects with given role about possible hierarchy changes
+ *
+ * @param data an AtkRole
+ *
+ * @returns always FALSE
+ */
+static gboolean
+_notifiy_content_holders_by_type(gpointer data)
+{
+   Eina_List *objs = NULL, *l = NULL;
+   AtkObject *atk_obj = NULL;
+   AtkRole role = ATK_ROLE_INVALID;
+
+   role = (AtkRole)data;
+
+   if (ATK_ROLE_APPLICATION == role)
+     {
+         atk_obj = atk_get_root();
+         if (atk_obj && EAIL_IS_DYNAMIC_CONTENT(atk_obj))
+            eail_dynamic_content_update_hierarchy(EAIL_DYNAMIC_CONTENT(atk_obj));
+
+         return FALSE;
+     }
+   else
+     {
+        objs = eail_factory_find_objects_with_role(role);
+        EINA_LIST_FOREACH(objs, l, atk_obj)
+          {
+            if (EAIL_IS_DYNAMIC_CONTENT(atk_obj))
+              {
+                   eail_dynamic_content_update_hierarchy
+                                               (EAIL_DYNAMIC_CONTENT(atk_obj));
+              }
+          }
+        eina_list_free(objs);
+     }
+
+   return FALSE;
+}
+
+/**
+ * @brief Sends notification about possible hierarchy changes to objects
+ * with dynamic content interface
+ *
+ * @param delay value in miliseconds, objects will be notified after this
+ * timeout
+ */
+static void
+_eail_notify_focus_listeners_delayed(guint delay)
+{
+   g_timeout_add
+      (delay, _notifiy_content_holders_by_type, (gpointer)ATK_ROLE_APPLICATION);
+   g_timeout_add
+      (delay, _notifiy_content_holders_by_type, (gpointer)ATK_ROLE_WINDOW);
+   g_timeout_add
+      (delay, _notifiy_content_holders_by_type, (gpointer)ATK_ROLE_FILLER);
+}
+
+void
+eail_notify_child_focus_changes(void)
+{
+   _eail_notify_focus_listeners_delayed(0);
+   /* sending delayed notifications to objects after hierarchy has
+    * been fully established*/
+   _eail_notify_focus_listeners_delayed(1600);
+}
diff --git a/eail/eail/eail_utils.h b/eail/eail/eail_utils.h
new file mode 100644 (file)
index 0000000..f1b615e
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_utils.h
+ *
+ * @brief Header for Eail Utility functions
+ */
+
+#ifndef EAIL_UTILS_H
+#define EAIL_UTILS_H
+
+#include <glib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EAIL_STR_SCROLL_UP "scroll_up" /**< @brief String for scroll up*/
+#define EAIL_STR_SCROLL_DOWN "scroll_down" /**< @brief String for scroll down*/
+#define EAIL_STR_SCROLL_LEFT "scroll_left" /**< @brief String for scroll left*/
+#define EAIL_STR_SCROLL_RIGHT "scroll_right" /**< @brief String for scroll right*/
+
+/**
+ * @enum EAIL_SCROLL_TYPE Type of scroll direction
+ */
+enum EAIL_SCROLL_TYPE
+{
+   EAIL_SCROLL_TYPE_UP,/**< scroll 'up' direction */
+   EAIL_SCROLL_TYPE_DOWN,/**< scroll 'down' direction */
+   EAIL_SCROLL_TYPE_LEFT,/**< scroll 'left' direction */
+   EAIL_SCROLL_TYPE_RIGHT/**< scroll 'right' direction */
+};
+
+/**
+ * @brief Helper function gets substring from string
+ */
+gchar *eail_get_substring(const gchar* string, gint start_offset, gint end_offset);
+
+/**
+ * @brief Generic function for generating ref_state for Evas_Objects stored in
+ * ATK objects
+ *
+ */
+AtkStateSet *eail_evas_obj_ref_state_set(Evas_Object *widget,
+                                         AtkStateSet *state_set);
+
+/**
+ * @brief Generic function for grabbing focus on Evas_Object stored in ATK object
+ */
+gboolean eail_evas_obj_grab_focus(Evas_Object *widget);
+
+/**
+ * @brief Emulates mouse 'press' event at given coordinates
+ */
+void eail_mouse_press_on_coords(Evas_Object *widget, int x, int y);
+
+/**
+ * @brief Emulates mouse 'release' event at given coordinates
+ */
+void eail_mouse_release_on_coords(Evas_Object *widget, int x, int y);
+
+/**
+ * @brief Emulates mouse 'click' event at given coordinates
+ */
+void eail_mouse_click_on_coords(Evas_Object *widget, int x, int y);
+
+/**
+ * @brief Gets coordinates of center of given widget
+ */
+void eail_get_coords_widget_center(Evas_Object *widget, int *x, int *y);
+
+/**
+ * @brief Gets edje parts list for item
+ *
+ */
+Eina_List *eail_get_edje_parts_for_item(Elm_Object_Item *item);
+
+/**
+ * @brief Gets text content from item (each text is put into field in Eina_List
+ * as const gchar*)
+ */
+Eina_List *eail_item_get_content_strings(Elm_Object_Item *item);
+
+/**
+ * @brief scrolls screen to given direction
+ */
+gboolean eail_handle_scroll(Evas_Object *widget,
+                            enum EAIL_SCROLL_TYPE type);
+
+/**
+ * @brief scrolls screen up
+ */
+gboolean eail_action_scroll_up(Evas_Object *widget,
+                               void *data);
+
+/**
+ * @brief scrolls screen down
+ */
+gboolean eail_action_scroll_down(Evas_Object *widget,
+                                 void *data);
+
+/**
+ * @brief scrolls screen left
+ */
+gboolean eail_action_scroll_left(Evas_Object *widget,
+                                 void *data);
+
+/**
+ * @brief scrolls screen right
+ */
+gboolean eail_action_scroll_right(Evas_Object *widget,
+                                  void *data);
+
+/**
+ * @brief emits signal for ATK Object
+ */
+void eail_emit_atk_signal(AtkObject * atk_obj,
+                          const gchar *signal_name,
+                          GType object_type);
+
+/**
+ * @brief handler for selected event in for list-based content
+ */
+void eail_list_item_handle_selected_event(void *data,
+                                          Evas_Object *obj,
+                                          void *event_info);
+
+/**
+ * @brief handler for unselected event for list-based content
+ */
+void eail_list_item_handle_unselected_event(void *data,
+                                            Evas_Object *obj,
+                                            void *event_info);
+
+
+/**
+ * @brief gets raw evas object list for eail item
+ */
+Eina_List *eail_get_raw_evas_obj_list_from_item(Elm_Object_Item *item);
+
+/**
+ * @brief Helper function for emit children changed signal when needed
+ */
+void eail_emit_children_changed(gboolean added,
+                                AtkObject *atk_obj,
+                                gint child_number);
+
+/**
+ * @brief Helper function for emit children changed signal when needed (func
+ * version that takes object instead of index-number)
+ */
+void eail_emit_children_changed_obj(gboolean added,
+                                    AtkObject *atk_obj,
+                                    AtkObject *changed_obj);
+
+/**
+ * @brief Helper function to notify windows about focus changes of its children
+ */
+void eail_notify_child_focus_changes(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_video.c b/eail/eail/eail_video.c
new file mode 100644 (file)
index 0000000..90a806c
--- /dev/null
@@ -0,0 +1,686 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+/**
+ * @file eail_video.c
+ * @brief Implementation of elm_video as AtkObject
+ */
+#include <Elementary.h>
+#include <Emotion.h>
+#include <gio/gio.h>
+
+#include "eail_video.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void atk_action_interface_init(AtkActionIface *iface);
+static void atk_stremable_content_iface_init(AtkStreamableContentIface *iface);
+
+/**
+ * @brief define EailVideo type
+ */
+G_DEFINE_TYPE_WITH_CODE(EailVideo, eail_video, EAIL_TYPE_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
+                                              atk_action_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_STREAMABLE_CONTENT,
+                                              atk_stremable_content_iface_init)
+);
+
+/**
+ * @brief Implementation of ref_state_set from AtkObject
+ *
+ * @param object EailVideo instance
+ *
+ * @returns referred AtkStateSet object with accessible state set
+ */
+static AtkStateSet*
+eail_video_ref_state_set(AtkObject *object)
+{
+   AtkStateSet *state_set;
+   Evas_Object *widget;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(object), NULL);
+   widget = eail_widget_get_widget(EAIL_WIDGET(object));
+   if (!widget) return NULL;
+
+   state_set = ATK_OBJECT_CLASS(eail_video_parent_class)->ref_state_set(object);
+   atk_state_set_add_state(state_set, ATK_STATE_ANIMATED);
+
+   return state_set;
+}
+
+/**
+ * @brief Implementation of get_name from AtkObject
+ *
+ * @param object EailVideo instance
+ *
+ * @returns played video file title or NULL if not set
+ */
+static const gchar*
+eail_video_name_get(AtkObject *object)
+{
+   Evas_Object *video;
+   const gchar *atk_name;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(object), NULL);
+
+   atk_name = ATK_OBJECT_CLASS(eail_video_parent_class)->get_name(object);
+   if (atk_name) return atk_name;
+
+   video = eail_widget_get_widget(EAIL_WIDGET(object));
+   if (!video) return NULL;
+
+   return elm_video_title_get(video);
+}
+
+/**
+ * @brief Initialize EailVideo object
+ *
+ * @param object EailVideo instance
+ * @param data passed user data
+ */
+static void
+eail_video_initialize(AtkObject *object, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_video_parent_class)->initialize(object, data);
+
+   object->role = ATK_ROLE_ANIMATION;
+}
+
+/**
+ * @brief Init EailVideo object
+ *
+ * @param video EailVideo instance
+ */
+static void
+eail_video_init(EailVideo *video)
+{
+   video->forward_desc = NULL;
+   video->next_desc = NULL;
+   video->pause_desc = NULL;
+   video->play_desc = NULL;
+   video->prev_desc = NULL;
+   video->rewind_desc = NULL;
+   video->stop_desc = NULL;
+   video->uri = NULL;
+}
+
+/**
+ * @brief Finalize EailVideo object
+ *
+ * @param object EailVideo instance
+ */
+static void
+eail_video_finalize(GObject *object)
+{
+   EailVideo *video = EAIL_VIDEO(object);
+
+   if (video->forward_desc) free(video->forward_desc);
+   if (video->next_desc) free(video->next_desc);
+   if (video->pause_desc) free(video->pause_desc);
+   if (video->play_desc) free(video->play_desc);
+   if (video->rewind_desc) free(video->rewind_desc);
+   if (video->stop_desc) free(video->stop_desc);
+   if (video->uri) free(video->uri);
+
+   G_OBJECT_CLASS(eail_video_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Initialize EailVideo class
+ *
+ * @param klass EailVideoClass object
+ */
+static void
+eail_video_class_init(EailVideoClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+   class->initialize = eail_video_initialize;
+   class->get_name = eail_video_name_get;
+   class->ref_state_set = eail_video_ref_state_set;
+
+   g_object_class->finalize = eail_video_finalize;
+}
+
+/**
+ * @brief Implementation of get_action_name from AtkAction interface
+ *
+ * @param action EailVideo instance
+ * @param i action index
+ *
+ * @returns action name
+ */
+static const gchar*
+eail_video_action_name_get(AtkAction *action, gint i)
+{
+   const gchar *action_name;
+   g_return_val_if_fail(EAIL_IS_VIDEO(action), NULL);
+
+   switch (i)
+     {
+       case 0:
+           /*"forward,clicked" - the user clicked the forward button.*/
+           action_name = "forward";
+           break;
+       case 1:
+           /*"next,clicked" - the user clicked the next button.*/
+           action_name = "next";
+           break;
+       case 2:
+           /*"pause,clicked" - the user clicked the pause button.*/
+           action_name = "pause";
+           break;
+       case 3:
+           /*"play,clicked" - the user clicked the play button.*/
+           action_name = "play";
+           break;
+       case 4:
+           /*"prev,clicked" - the user clicked the prev button*/
+           action_name = "prev";
+           break;
+       case 5:
+           /*"rewind,clicked" - the user clicked the rewind button.*/
+           action_name = "rewind";
+           break;
+       case 6:
+           /*"stop,clicked" - the user clicked the stop button.*/
+           action_name = "stop";
+           break;
+       default:
+           action_name = NULL;
+           break;
+     }
+
+   return action_name;
+}
+
+/**
+ * @brief Implementation of get_n_actions from AtkAction interface
+ *
+ * @param action EailVideo instance
+ *
+ * @returns number of actions supported by EailVideo object
+ */
+static gint
+eail_video_n_actions_get(AtkAction *action)
+{
+   return 7;
+}
+
+/**
+ * @brief Implementation of do_action from AtkAction interface
+ *
+ * @param action EailVideo instance
+ * @param i action index
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_video_do_action(AtkAction *action, gint i)
+{
+   Evas_Object *video;
+   gboolean result, playing, seekable;
+   double position, length;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(action), FALSE);
+
+   video = eail_widget_get_widget(EAIL_WIDGET(action));
+   if (!video) return FALSE;
+   if ((elm_object_disabled_get(video)) || (!evas_object_visible_get(video)))
+     return FALSE;
+
+   playing = elm_video_is_playing_get(video);
+   seekable = elm_video_is_seekable_get(video);
+   length = elm_video_play_length_get(video);
+   position = elm_video_play_position_get(video);
+
+   switch (i)
+     {
+       case 0:
+           if (!seekable)
+             {
+                result = FALSE;
+                break;
+             }
+           position += length * 0.3;
+           elm_video_play_position_set(video, position);
+           eail_emit_atk_signal
+               (ATK_OBJECT(action), "visible-data-changed", ATK_TYPE_OBJECT);
+           result = TRUE;
+           break;
+       case 1:
+           if (!seekable)
+             {
+                result = FALSE;
+                break;
+             }
+           position += length * 0.1;
+           elm_video_play_position_set(video, position);
+           eail_emit_atk_signal
+               (ATK_OBJECT(action), "visible-data-changed", ATK_TYPE_OBJECT);
+           result = TRUE;
+           break;
+       case 2:
+           if (!playing)
+             {
+                result = FALSE;
+                break;
+             }
+           elm_video_pause(video);
+           result = TRUE;
+           break;
+       case 3:
+           if (playing)
+             {
+                result = FALSE;
+                break;
+             }
+           elm_video_play(video);
+           eail_emit_atk_signal
+               (ATK_OBJECT(action), "visible-data-changed", ATK_TYPE_OBJECT);
+           result = TRUE;
+           break;
+       case 4:
+           if (!seekable)
+             {
+                result = FALSE;
+                break;
+             }
+           position -= length * 0.1;
+           elm_video_play_position_set(video, position);
+           eail_emit_atk_signal
+               (ATK_OBJECT(action), "visible-data-changed", ATK_TYPE_OBJECT);
+           result = TRUE;
+           break;
+       case 5:
+           if (!seekable)
+             {
+                result = FALSE;
+                break;
+             }
+           elm_video_play_position_set(video, 0);
+           eail_emit_atk_signal
+               (ATK_OBJECT(action), "visible-data-changed", ATK_TYPE_OBJECT);
+           result = TRUE;
+           break;
+       case 6:
+           elm_video_stop(video);
+           elm_video_play_position_set(video, 0);
+           eail_emit_atk_signal
+               (ATK_OBJECT(action), "visible-data-changed", ATK_TYPE_OBJECT);
+           result = TRUE;
+           break;
+       default:
+           result = FALSE;
+           break;
+
+     }
+
+   return result;
+}
+
+/**
+ * @brief Implementation of get_description from AtkAction interface
+ *
+ * @param action EailVideo instance
+ * @param i action index
+ *
+ * @returns action description
+ */
+static const gchar*
+eail_video_description_get(AtkAction *action, gint i)
+{
+   const gchar *action_description;
+   EailVideo *video;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(action), NULL);
+   video = EAIL_VIDEO(action);
+
+   switch (i)
+     {
+       case 0:
+           action_description = video->forward_desc;
+           break;
+       case 1:
+           action_description = video->next_desc;
+           break;
+       case 2:
+           action_description = video->pause_desc;
+           break;
+       case 3:
+           action_description = video->play_desc;
+           break;
+       case 4:
+           action_description = video->prev_desc;
+           break;
+       case 5:
+           action_description = video->rewind_desc;
+           break;
+       case 6:
+           action_description = video->stop_desc;
+           break;
+       default:
+           action_description = NULL;
+           break;
+     }
+
+   return action_description;
+}
+
+/**
+ * @brief Implementation of set_description from AtkAction interface
+ *
+ * @param action EailVideo instance
+ * @param i action index
+ * @param description action descritpion
+ *
+ * @returns TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_video_description_set(AtkAction *action, gint i, const char *description)
+{
+   EailVideo *video;
+   gchar **value;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(action), FALSE);
+   video = EAIL_VIDEO(action);
+   switch (i)
+     {
+       case 0:
+           value = &video->forward_desc;
+           break;
+       case 1:
+           value = &video->next_desc;
+           break;
+       case 2:
+           value = &video->pause_desc;
+           break;
+       case 3:
+           value = &video->play_desc;
+           break;
+       case 4:
+           value = &video->prev_desc;
+           break;
+       case 5:
+           value = &video->rewind_desc;
+           break;
+       case 6:
+           value = &video->stop_desc;
+           break;
+       default:
+           value = NULL;
+           break;
+     }
+   if (value)
+     {
+        free(*value);
+        *value = g_strdup(description);
+        return TRUE;
+     }
+   return FALSE;
+}
+
+/**
+ * @brief AtkAction interface initializer.
+ *
+ * Function called upon instance creation. It initializes AtkAction
+ * interface implementation i.e hooks method pointers in the interface structure
+ * to the implementing class's implementation.
+ *
+ * @param iface an AtkActionIface
+ */
+static void
+atk_action_interface_init(AtkActionIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->do_action = eail_video_do_action;
+   iface->get_n_actions = eail_video_n_actions_get;
+   iface->get_name = eail_video_action_name_get;
+   iface->get_description = eail_video_description_get;
+   iface->set_description = eail_video_description_set;
+}
+
+/**
+ * @brief Helper function for matching file extension with mime type
+ *
+ * @param ext file extension
+ *
+ * @returns mime type
+ */
+static const char *
+_match_mime_type(const char *ext)
+{
+   if (!strcmp(ext, ".264"))
+     return "video/h261";
+   if (!strcmp(ext, ".3g2"))
+     return "video/3gpp2";
+   if (!strcmp(ext, ".3gp"))
+     return "video/3gpp";
+   if (!strcmp(ext, ".asf"))
+     return "video/x-ms-asf";
+   if (!strcmp(ext, ".avi"))
+     return "video/x-msvideo";
+   if (!strcmp(ext, ".clp"))
+     return "application/x-msclip";
+   if (!strcmp(ext, "flv"))
+     return "video/x-flv";
+   if (!strcmp(ext, ".m4v"))
+     return "video/x-m4v";
+   if (!strcmp(ext, ".mkv"))
+     return "video/x-matroska";
+   if (!strcmp(ext, ".mov"))
+     return "video/quicktime";
+   if (!strcmp(ext, ".mp2"))
+     return "audio/mpeg";
+   if (!strcmp(ext, ".mp4"))
+     return "video/mp4";
+   if (!strcmp(ext, ".mpe"))
+     return "video/mpeg";
+   if (!strcmp(ext, ".mpeg"))
+     return "video/mpeg";
+   if (!strcmp(ext, ".mpg"))
+     return "video/mpeg";
+   if (!strcmp(ext, ".mts"))
+     return "model/vnd.mts";
+   if (!strcmp(ext, ".mxf"))
+     return "application/mxf";
+   if (!strcmp(ext, ".ogg"))
+     return "audio/ogg";
+   if (!strcmp(ext, ".ogv"))
+     return "video/ogg";
+   if (!strcmp(ext, ".rm"))
+     return "audio/x-pn-realaudio";
+   if (!strcmp(ext, ".swf"))
+     return "application/x-shockwave-flash";
+   if (!strcmp(ext, ".ts"))
+     return "video/MP2T";
+   if (!strcmp(ext, ".weba"))
+     return "audio/webm";
+   if (!strcmp(ext, ".webm"))
+     return "video/webm";
+   if (!strcmp(ext, ".wmv"))
+     return "video/x-ms-wmv";
+
+   return NULL;
+}
+
+/**
+ * @brief Helper function for getting extension from filename
+ *
+ * @param filename target filename
+ *
+ * @returns pointer to string with extension
+ */
+static const char *
+_get_file_ext(const char *filename) {
+     const char *ext = strrchr(filename, '.');
+
+     if(!ext) return "";
+     return ext;
+}
+
+/**
+ * @brief Helper function for getting video file path
+ *
+ * @param widget elm_video instance
+ *
+ * @returns path to video file
+ */
+static const char *
+_get_video_path(const Evas_Object *widget)
+{
+   Evas_Object *emotion;
+
+   emotion = elm_video_emotion_get(widget);
+
+   return emotion_object_file_get(emotion);
+}
+
+/**
+ * @brief Implementation of get_mime_type from AtkStreamableContent interface
+ *
+ * @param streamable EailVideo instance
+ * @param i index of supported mime type
+ *
+ * @returns mime type
+ */
+static const gchar*
+eail_video_mime_type_get(AtkStreamableContent *streamable, gint i)
+{
+   Evas_Object *widget;
+   const char *path, *ext;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(streamable), NULL);
+   if (i != 0) return NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(streamable));
+   path = _get_video_path(widget);
+   ext = _get_file_ext(path);
+
+   return _match_mime_type(ext);
+}
+
+/**
+ * @brief Implementation of get_n_mime_types from AtkStreamableContent interface
+ *
+ * For Video widget implementation by ATK-EAIL, there always be maximum one
+ * content type at time supported for given file.
+ * So this function always will return 1 or 0.
+ *
+ * @param streamable EailVideo instance
+ *
+ * @returns number of mime_types for given streamable content ('0' in case when
+ * no mime-type was matched for content file)
+ */
+static gint
+eail_video_n_mime_types_get(AtkStreamableContent *streamable)
+{
+   const gchar *mime_type = NULL;
+
+   mime_type = eail_video_mime_type_get(streamable, 0);
+   if (mime_type) return 1;
+
+   /* no mime type for content*/
+   return 0;
+}
+
+/**
+ * @brief Implementation of get_uri from AtkStreamableContent
+ *
+ * @param streamable EailVideo instance
+ * @param mime_type requested mime type
+ *
+ * @returns video file URI
+ */
+static const char *
+eail_video_get_uri(AtkStreamableContent *streamable, const gchar *mime_type)
+{
+   Evas_Object *widget;
+   EailVideo *video;
+   const char *mime, *path;
+   GFile *file;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(streamable), NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(streamable));
+   video = EAIL_VIDEO(streamable);
+   mime =  eail_video_mime_type_get(streamable, 0);
+   if ((mime) && (mime_type) && (strcmp(mime, mime_type))) return NULL;
+
+   path = _get_video_path(widget);
+   file = g_file_new_for_path(path);
+   if (video->uri) free(video->uri);
+   video->uri = g_file_get_uri(file);
+   g_object_unref(file);
+
+   return video->uri;
+}
+
+/**
+ * @brief Implementation of get_stream from AtkStreamableContent
+ *
+ * @param streamable EailVideo instance
+ * @param mime_type requested mime_type
+ *
+ * @returns GIOChannel to video file
+ */
+static GIOChannel *
+eail_video_get_stream(AtkStreamableContent *streamable,
+                      const gchar *mime_type)
+{
+   Evas_Object *widget;
+   GError *error;
+   GIOChannel *channel;
+   const char *path, *mime;
+
+   g_return_val_if_fail(EAIL_IS_VIDEO(streamable), NULL);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(streamable));
+   mime = eail_video_mime_type_get(streamable, 0);
+   if ((mime) && (strcmp(mime, mime_type))) return NULL;
+   path = _get_video_path(widget);
+
+   error = NULL;
+   channel = g_io_channel_new_file(path, "r", &error);
+   if (error)
+     {
+        WRN("cannot open GIOChannel %s", error->message);
+        g_error_free(error);
+     }
+   return channel;
+}
+
+/**
+ * @brief Initialize AtkStreamableContent interface
+ *
+ * @param iface EailVideo object
+ */
+static void
+atk_stremable_content_iface_init(AtkStreamableContentIface *iface)
+{
+   g_return_if_fail(iface != NULL);
+
+   iface->get_n_mime_types = eail_video_n_mime_types_get;
+   iface->get_mime_type = eail_video_mime_type_get;
+   iface->get_stream = eail_video_get_stream;
+   iface->get_uri = eail_video_get_uri;
+}
+
diff --git a/eail/eail/eail_video.h b/eail/eail/eail_video.h
new file mode 100644 (file)
index 0000000..1c7029b
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_video.h
+ *
+ * @brief Header for EailVideo implementation
+ */
+#ifndef EAIL_VIDEO_H
+#define EAIL_VIDEO_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailVideo class
+ */
+#define EAIL_TYPE_VIDEO             (eail_video_get_type ())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailVideo
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_VIDEO(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                     EAIL_TYPE_VIDEO, EailVideo))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailVideo class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_VIDEO_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                     EAIL_TYPE_VIDEO, EailVideoClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailVideo class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_VIDEO(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                     EAIL_TYPE_VIDEO))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailVideo
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_VIDEO_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                     EAIL_TYPE_VIDEO))
+
+/**
+ * @brief Gets EailVideo class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailVideo class from
+ */
+#define EAIL_VIDEO_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                     EAIL_TYPE_VIDEO, EailVideoClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailVideo*/
+typedef struct _EailVideo       EailVideo;
+
+/** @brief Definition of object structure for Atk EailVideo*/
+typedef struct _EailVideoClass  EailVideoClass;
+
+/** @brief Definition of object structure for Atk EailVideo*/
+struct _EailVideo
+{
+    EailWidget parent; /*!< EailVideo parent that functionality is being extended*/
+    char *forward_desc; /*!< forward action description*/
+    char *next_desc; /*!< next action descritpion*/
+    char *pause_desc; /*!< pause action descirption*/
+    char *play_desc; /*!< play action description*/
+    char *prev_desc; /*!< prev action description*/
+    char *rewind_desc; /*!< rewind action description*/
+    char *stop_desc; /*!< stop action description*/
+    char *uri; /*!< video file URI*/
+};
+
+/** @brief Definition of object structure for Atk EailVideo*/
+struct _EailVideoClass
+{
+    EailWidgetClass parent_class;/*!< class that is being extended*/
+};
+
+/** @brief Getter for EailVideo GType
+ *
+ * @returns GType for EailVideo implementation*/
+GType eail_video_get_type (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_web.c b/eail/eail/eail_web.c
new file mode 100644 (file)
index 0000000..80cd972
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_web.c
+ * @brief Implementation of web widget
+ */
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#include "eail_web.h"
+#include "eail_priv.h"
+
+/**
+ * @brief EailWeb GObject definition
+ *
+ * It extends EAIL_TYPE_WIDGET class
+ */
+G_DEFINE_TYPE(EailWeb, eail_web, EAIL_TYPE_WIDGET);
+
+/**
+ * @brief Initializer for AtkObject
+ *
+ * @param obj an AtkObject
+ * @param data initializer data
+ */
+static void
+eail_web_initialize(AtkObject *obj, gpointer data)
+{
+   ATK_OBJECT_CLASS(eail_web_parent_class) ->initialize(obj, data);
+   obj->role = ATK_ROLE_HTML_CONTAINER;
+}
+
+/**
+ * @brief EailWeb instance initializer
+ *
+ * @param web an EailWeb
+ */
+static void
+eail_web_init(EailWeb *web)
+{
+
+}
+
+/**
+ * @brief Implementation AtkObject->get_n_children callback
+ *
+ * ATK doc says:\n
+ * Gets the number of accessible children of the accessible.
+ * @param obj an AtkObject
+ *
+ * @returns an integer representing the number of accessible children of
+ * the accessible
+ */
+static gint
+eail_web_get_n_children(AtkObject *obj)
+{
+   /* impossible to get content so returning 0 */
+   return 0;
+}
+
+/**
+ * @brief Implementation AtkObject->ref_child callback
+ *
+ * ATK doc says:\n
+ * Gets a reference to the specified accessible child of the object. The
+ * accessible children are 0-based so the first accessible child is at index 0,
+ * the second at index 1 and so on.
+ *
+ * @param obj an AtkObject
+ * @param i index of a child
+ *
+ * @returns an AtkObject representing the specified accessible child of the
+ * accessible.
+ */
+static AtkObject *
+eail_web_ref_child(AtkObject *obj, gint i)
+{
+   /* impossible to get content so returning NULL */
+   return NULL;
+}
+
+/**
+ * @brief Destructor of EailWeb object
+ * @param object a GObject
+ */
+static void
+eail_web_finalize(GObject *object)
+{
+   G_OBJECT_CLASS(eail_web_parent_class)->finalize(object);
+}
+
+/**
+ * @brief Implementation of get_name from AtkObject
+ *
+ * @param object EailWeb instance
+ * @returns first name from the following list which is not null:
+ * accessible name, uri, title, or NULL if all strings were NULL
+ */
+static const gchar*
+eail_web_get_name(AtkObject *object)
+{
+   Evas_Object *web;
+   const gchar *atk_name = NULL;
+
+   g_return_val_if_fail(EAIL_IS_WEB(object), NULL);
+
+   atk_name = ATK_OBJECT_CLASS(eail_web_parent_class)->get_name(object);
+   if (atk_name) return atk_name;
+
+   web = eail_widget_get_widget(EAIL_WIDGET(object));
+   if (!web) return NULL;
+
+   atk_name = elm_web_uri_get(web);
+   if (atk_name) return atk_name;
+
+   atk_name = elm_web_title_get(web);
+   if (atk_name) return atk_name;
+
+   return atk_name;
+}
+
+/**
+ * @brief Initializer for EailWeb GObject class (defines callbacks for
+ * base AtkObject)
+ *
+ * @param klass an EailWebClass
+ */
+static void
+eail_web_class_init(EailWebClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+   class->initialize = eail_web_initialize;
+   class->get_name = eail_web_get_name;
+   class->get_n_children = eail_web_get_n_children;
+   class->ref_child = eail_web_ref_child;
+   gobject_class->finalize = eail_web_finalize;
+}
diff --git a/eail/eail/eail_web.h b/eail/eail/eail_web.h
new file mode 100644 (file)
index 0000000..db271c0
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_web.h
+ *
+ * @brief Header for EailWeb implementation
+ */
+
+#ifndef EAIL_WEB_H
+#define EAIL_WEB_H
+
+#include "eail_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailWeb class
+ */
+#define EAIL_TYPE_WEB             (eail_web_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailWeb
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_WEB(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                            EAIL_TYPE_WEB, \
+                                            EailWeb))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailWeb class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_WEB_CLASS(klass)     (G_TYPE_WEB_CLASS_CAST((klass), \
+                                            EAIL_TYPE_WEB, \
+                                            EailWebClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailWeb class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_WEB(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                            EAIL_TYPE_WEB))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailWeb
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_WEB_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                            EAIL_TYPE_WEB))
+
+/**
+ * @brief Gets EailWeb class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailWeb class from
+ */
+#define EAIL_WEB_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                            EAIL_TYPE_WEB, \
+                                            EailWebClass))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailWeb*/
+typedef struct _EailWeb EailWeb;
+
+/** @brief Definition of object class for Atk EailWeb*/
+typedef struct _EailWebClass EailWebClass;
+
+/** @brief Definition of object structure for Atk EailWeb*/
+struct _EailWeb
+{
+   EailWidget parent;/**< @brief object that functionality is being extended*/
+};
+
+/** @brief Definition of object class for Atk EailWeb*/
+struct _EailWebClass
+{
+   EailWidgetClass parent_class;/**< @brief class whose functionality is being extended*/
+};
+
+/** @brief Getter for EailWeb GType
+ *
+ * @returns GType for EailWeb implementation*/
+GType eail_web_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/eail/eail/eail_widget.c b/eail/eail/eail_widget.c
new file mode 100644 (file)
index 0000000..fc8642e
--- /dev/null
@@ -0,0 +1,669 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_widget.c
+ * @brief EailWidget implementation
+ */
+
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <Elementary.h>
+
+#include "eail_widget.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_priv.h"
+
+static void atk_component_interface_init(AtkComponentIface *iface);
+
+/**
+ * @brief EailWidget type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailWidget, eail_widget, ATK_TYPE_OBJECT,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
+                                              atk_component_interface_init));
+
+/**
+ * @brief Gets EvasObject from EailWidget
+ *
+ * @param widget an EailWidget
+ * @return Evas_Object widget
+ */
+Evas_Object *
+eail_widget_get_widget(EailWidget *widget)
+{
+    g_return_val_if_fail(EAIL_IS_WIDGET(widget), NULL);
+
+    return widget->widget;
+}
+
+/**
+ * @brief Gets EailWidget children
+ *
+ * @param widget an EailWidget
+ * @return children list
+ */
+Eina_List *
+eail_widget_get_widget_children(EailWidget *widget)
+{
+    EailWidgetClass *klass;
+
+    g_return_val_if_fail(EAIL_IS_WIDGET(widget), NULL);
+
+    klass = EAIL_WIDGET_GET_CLASS(widget);
+    return klass->get_widget_children(widget);
+}
+
+/**
+ * @brief Callback used to tracking focus-in changes for widgets
+ *
+ * @param data data passed to callback
+ * @param e an Evas that has been focused in
+ * @param obj an Evas_Object that has been focused in
+ * @param event_info additional event info
+ */
+void
+eail_widget_on_focused_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   g_return_if_fail(ATK_IS_OBJECT(data));
+
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_FOCUSED, TRUE);
+   atk_focus_tracker_notify(ATK_OBJECT(data));
+}
+
+/**
+ * @brief Callback used to tracking "show"-changes for widgets
+ *
+ * @param data data passed to callback
+ * @param e an Evas that has been shown
+ * @param obj an Evas_Object that has been shown
+ * @param event_info additional event info
+ */
+void
+eail_widget_on_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   g_return_if_fail(ATK_IS_OBJECT(data));
+
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_SHOWING, TRUE);
+}
+
+/**
+ * @brief Callback used to tracking "hide"-changes for widgets
+ *
+ * @param data data passed to callback
+ * @param e an Evas that has been shown
+ * @param obj an Evas_Object that has been shown
+ * @param event_info additional event info
+ */
+void
+eail_widget_on_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   g_return_if_fail(ATK_IS_OBJECT(data));
+
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_SHOWING, FALSE);
+}
+
+/**
+ * @brief Callback used to tracking focus-out changes for widgets
+ *
+ * @param data data passed to callback
+ * @param e an Evas that has been focused out
+ * @param obj an Evas_Object that has been focused out
+ * @param event_info additional event info
+ */
+void
+eail_widget_on_focused_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   g_return_if_fail(ATK_IS_OBJECT(data));
+
+   DBG("><");
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_FOCUSED, FALSE);
+   atk_focus_tracker_notify(ATK_OBJECT(data));
+   eail_notify_child_focus_changes();
+}
+
+/**
+ * @brief on_focused default callback used to tracking focus changes of
+ * smart widgets
+ *
+ * @param data data passed to callback
+ * @param obj an Evas_Object that has been shown
+ * @param event_info additional event info
+ */
+void eail_widget_on_focused_smart(void *data,
+                                  Evas_Object *obj,
+                                  void *event_info)
+{
+   g_return_if_fail(ATK_IS_OBJECT(data));
+
+   DBG("><");
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_FOCUSED, TRUE);
+   atk_focus_tracker_notify(ATK_OBJECT(data));
+   eail_notify_child_focus_changes();
+}
+
+/**
+ * @brief on_focused default callback used to tracking focus changes of
+ * smart widgets
+ *
+ * @param data data passed to callback
+ * @param obj an Evas_Object that has been shown
+ * @param event_info additional event info
+ */
+void eail_widget_on_focused_out_smart(void *data,
+                                      Evas_Object *obj,
+                                      void *event_info)
+{
+   g_return_if_fail(ATK_IS_OBJECT(data));
+
+   DBG("><");
+   /* Not propagating further, using only for internal eail focus changes*/
+   eail_notify_child_focus_changes();
+}
+
+/**
+ * @brief EailWidget initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_widget_initialize(AtkObject *obj, gpointer data)
+{
+    EailWidget *widget = EAIL_WIDGET(obj);
+
+    ATK_OBJECT_CLASS(eail_widget_parent_class)->initialize(obj, data);
+
+    widget->widget = (Evas_Object *)data;
+    widget->layer = ATK_LAYER_WIDGET;
+
+    obj->name = g_strdup(evas_object_name_get(widget->widget));
+    obj->role = ATK_ROLE_UNKNOWN;
+
+    if (!widget->widget) {
+        ERR("No evas object inside EailWidget was found");
+        return;
+    }
+
+    evas_object_event_callback_add(widget->widget, EVAS_CALLBACK_FOCUS_IN,
+                                       eail_widget_on_focused_in, widget);
+    evas_object_event_callback_add(widget->widget, EVAS_CALLBACK_FOCUS_OUT,
+                                   eail_widget_on_focused_out, widget);
+
+    evas_object_event_callback_add(widget->widget, EVAS_CALLBACK_SHOW,
+                                   eail_widget_on_show, widget);
+    evas_object_event_callback_add(widget->widget, EVAS_CALLBACK_HIDE,
+                                   eail_widget_on_hide, widget);
+
+    /* for window don't need that event, it would result double generating
+     * focus-in event*/
+    if (!ATK_IS_WINDOW(obj))
+      evas_object_smart_callback_add
+            (widget->widget, "focused", eail_widget_on_focused_smart, widget);
+
+    evas_object_smart_callback_add
+          (widget->widget, "unfocused", eail_widget_on_focused_out_smart, widget);
+
+}
+
+/**
+ * @brief Default get_widget_children callback
+ *
+ * @param widget an EailWidget
+ * @return NULL
+ */
+static Eina_List *
+eail_widget_get_real_widget_children(EailWidget *widget)
+{
+    return NULL;
+}
+
+/**
+ * @brief Gets obj children count
+ *
+ * @param obj an AtkObject
+ *
+ * @returns number of widget children
+ */
+static gint
+eail_widget_get_n_children(AtkObject *obj)
+{
+    gint n_children;
+    Eina_List *children;
+
+    children = eail_widget_get_widget_children(EAIL_WIDGET(obj));
+    n_children = eina_list_count(children);
+
+    eina_list_free(children);
+
+    return n_children;
+}
+
+/**
+ * @brief Gets reference to obj i-th child
+ *
+ * The caller must unreference it when it is no longer needed
+ *
+ * @param obj an AtkObject
+ * @param i child index
+ * @return child reference
+ */
+static AtkObject *
+eail_widget_ref_child(AtkObject *obj, gint i)
+{
+    Eina_List *children;
+    AtkObject *child = NULL;
+
+    children = eail_widget_get_widget_children(EAIL_WIDGET(obj));
+    if (eina_list_count(children) > i) {
+        child = eail_factory_get_accessible(eina_list_nth(children, i));
+        g_object_ref(child);
+    }
+
+    eina_list_free(children);
+
+    return child;
+}
+
+/**
+ * @brief Gets obj parent
+ *
+ * @param obj an AtkObject
+ * @return obj parent
+ */
+static AtkObject *
+eail_widget_get_parent(AtkObject *obj)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+    if (!widget) {
+        return NULL;
+    }
+
+    if (obj->accessible_parent) {
+        return obj->accessible_parent;
+    }
+
+    return eail_factory_get_accessible(elm_object_parent_widget_get(widget));
+}
+
+/**
+ * @brief Gets the 0-based index of this accessible in its parent
+ *
+ * Returns -1 if the accessible does not have an accessible parent
+ *
+ * @param obj an AtkObject
+ * @return obj index in its parent
+ */
+static gint
+eail_widget_get_index_in_parent(AtkObject *obj)
+{
+    gint index;
+    Eina_List *l, *children;
+    AtkObject *parent;
+    Evas_Object *child;
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+    if (!widget) {
+        return -1;
+    }
+
+    if (obj->accessible_parent)
+    {
+        parent = obj->accessible_parent;
+    } else {
+        parent = atk_object_get_parent(obj);
+    }
+
+    if (!parent) {
+        return -1;
+    }
+
+    index = -1;
+    children = eail_widget_get_widget_children(EAIL_WIDGET(parent));
+    EINA_LIST_FOREACH(children, l, child) {
+        ++index;
+        if (child == widget) {
+            break;
+        }
+    }
+
+    eina_list_free(children);
+
+    return index;
+}
+
+/**
+ * @brief Gets obj state set
+ *
+ * @param obj an AtkObject
+ * @return obj state set
+ */
+static AtkStateSet *
+eail_widget_ref_state_set(AtkObject *obj)
+{
+    AtkStateSet *state_set;
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+    state_set= ATK_OBJECT_CLASS(eail_widget_parent_class)->ref_state_set(obj);
+
+    return eail_evas_obj_ref_state_set(widget, state_set);
+}
+
+/**
+ * @brief Gets obj attribute set
+ *
+ * @param obj an AtkObject
+ * @return obj attribute set
+ */
+static AtkAttributeSet *
+eail_widget_get_attributes(AtkObject *obj)
+{
+    AtkAttribute *attr;
+    AtkAttributeSet *attributes;
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+    if (!widget) {
+        return NULL;
+    }
+
+    attr = g_new(AtkAttribute, 1);
+    attr->name = g_strdup("type");
+    attr->value = g_strdup(elm_object_widget_type_get(widget));
+
+    attributes = g_slist_append(NULL, attr);
+
+    return attributes;
+}
+
+/**
+ * @brief EailWidget instance initializer
+ *
+ * @param widget an EailWidget
+ */
+static void
+eail_widget_init(EailWidget *widget)
+{
+}
+
+/**
+ * @brief EailWidget finalizer
+ *
+ * Frees memory assigned to object
+ *
+ * @param obj a GObject
+ */
+static void
+eail_widget_class_finalize(GObject *obj)
+{
+   EailWidget *eail_widget = EAIL_WIDGET(obj);
+   Evas_Object *evas_widget = eail_widget_get_widget(eail_widget);
+
+   if (evas_widget)
+     eail_factory_unregister_wdgt_from_cache(evas_widget);
+
+   G_OBJECT_CLASS(eail_widget_parent_class)->finalize(obj);
+}
+
+/**
+ * @brief EailWidget class initializer
+ *
+ * Function called upon instance creation. It initializes AtkObject class
+ * callbacks for EailWidget.
+ *
+ * @param klass an EailWidgetClass
+ */
+static void
+eail_widget_class_init(EailWidgetClass *klass)
+{
+    AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+    GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+
+    klass->get_widget_children = eail_widget_get_real_widget_children;
+
+    class->initialize = eail_widget_initialize;
+    class->get_n_children = eail_widget_get_n_children;
+    class->ref_child = eail_widget_ref_child;
+    class->get_parent = eail_widget_get_parent;
+    class->get_index_in_parent = eail_widget_get_index_in_parent;
+    class->ref_state_set = eail_widget_ref_state_set;
+    class->get_attributes = eail_widget_get_attributes;
+
+    g_object_class->finalize = eail_widget_class_finalize;
+}
+
+/**
+ * @brief Grabs focus for component
+ *
+ * @param component an AtkComponent
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_widget_grab_focus(AtkComponent *component)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(component));
+
+    return eail_evas_obj_grab_focus(widget);
+}
+
+/**
+ * @brief Gets component layer
+ *
+ * @param component an AtkComponent
+ * @return component layer
+ */
+static AtkLayer
+eail_widget_get_layer(AtkComponent *component)
+{
+    return EAIL_WIDGET(component)->layer;
+}
+
+/**
+ * @brief Gets the rectangle which gives the extent of the component
+ *
+ * @param component an AtkComponent
+ * @param [out] x rectangle upper left x coordinate
+ * @param [out] y rectangle upper left y coordinate
+ * @param [out] width component width
+ * @param [out] height component height
+ * @param coord_type coordinates type
+ */
+static void
+eail_widget_get_extents(AtkComponent  *component,
+                        gint          *x,
+                        gint          *y,
+                        gint          *width,
+                        gint          *height,
+                        AtkCoordType   coord_type)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(component));
+
+    *x = *y = G_MININT;
+    *width = *height = -1;
+    if (!widget) {
+        return;
+    }
+
+    evas_object_geometry_get(widget, x, y, width, height);
+
+    if (coord_type == ATK_XY_SCREEN) {
+        int ee_x, ee_y;
+        Ecore_Evas *ee= ecore_evas_ecore_evas_get(evas_object_evas_get(widget));
+
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        *x += ee_x;
+        *y += ee_y;
+    }
+}
+
+/**
+ * @brief Sets component position
+ *
+ * @param component an AtkComponent
+ * @param x upper left x coordinate
+ * @param y upper left y coordinate
+ * @param coord_type coordinates type
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_widget_set_position(AtkComponent *component,
+                         gint         x,
+                         gint         y,
+                         AtkCoordType coord_type)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(component));
+
+    if (!widget) return FALSE;
+
+    if (x < 0 || y < 0) return FALSE;
+
+    if (coord_type == ATK_XY_SCREEN) {
+        int ee_x, ee_y;
+        Ecore_Evas *ee= ecore_evas_ecore_evas_get(evas_object_evas_get(widget));
+
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        x -= ee_x;
+        y -= ee_y;
+    }
+
+    evas_object_move(widget, x, y);
+
+    return TRUE;
+}
+
+/**
+ * @brief Sets component size
+ *
+ * @param component an AtkComponent
+ * @param width new width
+ * @param height new height
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_widget_set_size(AtkComponent *component,
+                     gint          width,
+                     gint          height)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(component));
+
+    if (!widget) return FALSE;
+
+    if (width <= 0 || height <= 0) return FALSE;
+
+    evas_object_resize(widget, width, height);
+
+    return TRUE;
+}
+
+/**
+ * @brief Sets component extents
+ *
+ * @param component an AtkComponent
+ * @param x upper left x coordinate
+ * @param y upper left y coordinate
+ * @param width new width
+ * @param height new height
+ * @param coord_type coordinates type
+ * @return TRUE on success, FALSE otherwise
+ */
+static gboolean
+eail_widget_set_extents(AtkComponent  *component,
+                        gint           x,
+                        gint           y,
+                        gint           width,
+                        gint           height,
+                        AtkCoordType   coord_type)
+{
+    Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(component));
+
+    if (!widget) {
+        return FALSE;
+    }
+
+    if (coord_type == ATK_XY_SCREEN) {
+        int ee_x, ee_y;
+        Ecore_Evas *ee= ecore_evas_ecore_evas_get(evas_object_evas_get(widget));
+
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        x -= ee_x;
+        y -= ee_y;
+    }
+
+    if (x < 0 || y < 0) {
+        return FALSE;
+    }
+
+    evas_object_move(widget, x, y);
+    evas_object_resize(widget, width, height);
+
+    return TRUE;
+}
+
+/**
+ * @brief Sets function to execute whenever component gets focus
+ *
+ * @param component an AtkComponent
+ * @param handler an AtkFocusHandler
+ * @returns handler id
+ */
+static guint
+eail_widget_add_focus_handler(AtkComponent *component,
+                              AtkFocusHandler handler)
+{
+   GSignalMatchType match_type;
+   gulong ret;
+   guint signal_id;
+
+   match_type = G_SIGNAL_MATCH_ID;
+   signal_id = g_signal_lookup("focus-event", ATK_TYPE_OBJECT);
+
+   ret = g_signal_handler_find(component, match_type, signal_id, 0, NULL,
+                               (gpointer)handler, NULL);
+   if (!ret)
+     {
+        return g_signal_connect_closure_by_id(component,
+                                              signal_id, 0,
+                                              g_cclosure_new(
+                                                  G_CALLBACK(handler), NULL,
+                                                  (GClosureNotify)NULL),
+                                              FALSE);
+     }
+   else
+     {
+        return 0;
+     }
+}
+
+/**
+ * @brief AtkComponent interface initialization
+ *
+ * @param iface EailNaviframPage object
+ */
+static void
+atk_component_interface_init(AtkComponentIface *iface)
+{
+   iface->grab_focus = eail_widget_grab_focus;
+   iface->get_layer = eail_widget_get_layer;
+   iface->get_extents = eail_widget_get_extents;
+   iface->set_position = eail_widget_set_position;
+   iface->set_size = eail_widget_set_size;
+   iface->set_extents = eail_widget_set_extents;
+   iface->add_focus_handler = eail_widget_add_focus_handler;
+}
diff --git a/eail/eail/eail_widget.h b/eail/eail/eail_widget.h
new file mode 100644 (file)
index 0000000..550892c
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_widget.h
+ *
+ * @brief Header for EailWindow implementation
+ */
+
+#ifndef EAIL_WIDGET_H
+#define EAIL_WIDGET_H
+
+#include <atk/atk.h>
+
+#include <Eina.h>
+#include <Evas.h>
+
+/**
+ * @brief Returns a value corresponding to the type of EailWidget class
+ */
+#define EAIL_TYPE_WIDGET              (eail_widget_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailWidget
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_WIDGET(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                       EAIL_TYPE_WIDGET, EailWidget))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailWidget class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_WIDGET_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                       EAIL_TYPE_WIDGET, EailWidgetClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailWidget class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_WIDGET(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                       EAIL_TYPE_WIDGET))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailWidget
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_WIDGET_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                       EAIL_TYPE_WIDGET))
+
+/**
+ * @brief Gets EailWidget class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailWidget class from
+ */
+#define EAIL_WIDGET_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                       EAIL_TYPE_WIDGET, EailWidgetClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailWidget*/
+typedef struct _EailWidget      EailWidget;
+
+/** @brief Definition of object class for Atk EailWidget*/
+typedef struct _EailWidgetClass EailWidgetClass;
+
+/** @brief Definition of object structure for Atk EailWidget*/
+struct _EailWidget
+{
+   AtkObject parent;/**< @brief AtkObject that is being extended*/
+
+   Evas_Object *widget;/**< @brief internal widget that is represented by EailWidget */
+   AtkLayer layer;/**< @brief describes layer of a component (eg. ATK_LAYER_WIDGET) */
+};
+
+/** @brief Definition of object class for Atk EailWidget*/
+struct _EailWidgetClass
+{
+   AtkObjectClass parent_class;/**< @brief class that is being extended*/
+
+   /** @brief callback definition for eail_widget_get_widget_children func*/
+   Eina_List * (*get_widget_children)  (EailWidget *widget);
+};
+
+/**
+ * @brief Getter for widget GType
+ *
+ * @returns GType for EailWidget implementation
+ */
+GType           eail_widget_get_type              (void);
+Evas_Object *   eail_widget_get_widget            (EailWidget *widget);
+Eina_List *     eail_widget_get_widget_children   (EailWidget *widget);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/eail/eail_window.c b/eail/eail/eail_window.c
new file mode 100644 (file)
index 0000000..124dae8
--- /dev/null
@@ -0,0 +1,618 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_window.c
+ * @brief EailWindow Implementation
+ */
+
+#include <Elementary.h>
+#include "eail_window.h"
+#include "eail_factory.h"
+#include "eail_utils.h"
+#include "eail_dynamic_content.h"
+#include "eail_priv.h"
+
+static void eail_window_actions_init(EailActionWidget *widget);
+static void atk_window_interface_init (AtkWindowIface *iface);
+static void atk_component_interface_init(AtkComponentIface *iface);
+static void eail_dynamic_content_interface_init(EailDynamicContentIface *iface);
+
+/**
+ * @brief Focus signal name
+ */
+#define EAIL_WINDOW_FOCUS_NAME "focus,in"
+
+#define EAIL_WIN_ACTION_MAXIMALIZE "maximalize" /**< 'maximalize' action name */
+#define EAIL_WIN_ACTION_MINIMALIZE "minimalize" /**< 'minimalize' action name */
+
+/**
+ * @brief EailWindow type definition
+ */
+G_DEFINE_TYPE_WITH_CODE(EailWindow,
+                        eail_window,
+                        EAIL_TYPE_ACTION_WIDGET,
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_WINDOW,
+                                              atk_window_interface_init)
+                        G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
+                                            atk_component_interface_init)
+                        G_IMPLEMENT_INTERFACE(EAIL_TYPE_DYNAMIC_CONTENT,
+                                          eail_dynamic_content_interface_init));
+
+/**
+ * @brief Maximize event handler
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_window_handle_maximize_event(void *data,
+                                   Evas_Object *obj,
+                                   void *event_info)
+{
+   eail_emit_atk_signal(ATK_OBJECT(data), "maximize", EAIL_TYPE_WINDOW);
+}
+
+/**
+ * @brief Minimize event handler
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_window_handle_minimize_event(void *data,
+                                   Evas_Object *obj,
+                                   void *event_info)
+{
+   eail_emit_atk_signal(ATK_OBJECT(data), "minimize", EAIL_TYPE_WINDOW);
+}
+
+/**
+ * @brief Move event handler
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_window_handle_move_event(void *data,
+                               Evas_Object *obj,
+                               void *event_info)
+{
+   eail_emit_atk_signal(ATK_OBJECT(data), "move", EAIL_TYPE_WINDOW);
+}
+
+/**
+ * @brief Callback used to tracking "resize"-changes for window
+ *
+ * @param data data passed to callback
+ * @param e an Evas that has been shown
+ * @param obj an Evas_Object that has been shown
+ * @param event_info additional event info
+ */
+void
+eail_window_on_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   g_return_if_fail(ATK_IS_OBJECT(data));
+
+   eail_emit_atk_signal(ATK_OBJECT(data), "resize", EAIL_TYPE_WINDOW);
+}
+
+/**
+ * @brief Destroyed event handler for window
+ *
+ * @param data passed to callback
+ * @param obj object that raised event
+ * @param event_info additional event info
+ */
+void
+_eail_window_handle_delete_event(void *data,
+                               Evas_Object *obj,
+                               void *event_info)
+{
+   atk_object_notify_state_change(ATK_OBJECT(data), ATK_STATE_DEFUNCT, TRUE);
+   eail_emit_atk_signal(ATK_OBJECT(data), "destroy", EAIL_TYPE_WINDOW);
+   eail_factory_unregister_wdgt_from_cache(obj);
+}
+
+/**
+ * @brief Initialize window focus handler
+ *
+ * @param obj an AtkObject
+ */
+static void
+eail_window_init_focus_handler(AtkObject *obj)
+{
+   Evas_Object *nested_widget = NULL;
+   g_return_if_fail(EAIL_IS_WIDGET(obj));
+
+   nested_widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+   if (!nested_widget)
+     {
+        ERR("No evas object inside EailWidget was found");
+        return;
+     }
+
+   evas_object_smart_callback_add(nested_widget, "maximized",
+                                  _eail_window_handle_maximize_event, obj);
+   evas_object_smart_callback_add(nested_widget, "iconified",
+                                  _eail_window_handle_minimize_event, obj);
+   evas_object_smart_callback_add(nested_widget, "moved",
+                                  _eail_window_handle_move_event, obj);
+   evas_object_smart_callback_add(nested_widget, "delete,request",
+                                  _eail_window_handle_delete_event, obj);
+
+   /* evas object events (not smart callbacks) */
+   evas_object_event_callback_add(nested_widget, EVAS_CALLBACK_RESIZE,
+                                  eail_window_on_resize, obj);
+}
+
+/**
+ * @brief EailWindow initializer
+ *
+ * @param obj an AtkObject
+ * @param data initialization data
+ */
+static void
+eail_window_initialize(AtkObject *obj, gpointer data)
+{
+   EailWindow *eail_win = NULL;
+   ATK_OBJECT_CLASS(eail_window_parent_class)->initialize(obj, data);
+   EAIL_WIDGET(obj)->layer = ATK_LAYER_WINDOW;
+
+   if (!elm_object_widget_check((Evas_Object *) data)) return;
+
+   obj->name = g_strdup(elm_win_title_get((Evas_Object *)data));
+   obj->role = ATK_ROLE_WINDOW;
+
+   eail_window_init_focus_handler(obj);
+   eail_window_actions_init(EAIL_ACTION_WIDGET(obj));
+
+   eail_win = EAIL_WINDOW(obj);
+   /* storing last numbers of children to be for checking if children-changed
+    * signal has to be propagated */
+   eail_win->child_count_last = atk_object_get_n_accessible_children(obj);
+}
+
+/**
+ * @brief Gets children list from given edje
+ *
+ * @param edje lowest (stacked) Evas object
+ * @return children list
+ */
+static Eina_List *
+_parse_edje(const Evas_Object *edje)
+{
+   const Evas_Object *content_part = NULL;
+   const Evas_Object *menu_part = NULL;
+   Eina_List *list = NULL;
+
+   if (edje_object_part_exists(edje, "elm.swallow.menu"))
+     menu_part = edje_object_part_swallow_get(edje, "elm.swallow.menu");
+   if (edje_object_part_exists(edje, "elm.swallow.contents"))
+     content_part = edje_object_part_swallow_get(edje, "elm.swallow.contents");
+   if ((menu_part) &&
+       (!strcmp(evas_object_type_get(menu_part), "Evas_Object_Box")))
+        list = evas_object_box_children_get(menu_part);
+   if ((content_part) &&
+       (!strcmp(evas_object_type_get(content_part), "Evas_Object_Box")))
+     {
+        if (list)
+          list = eina_list_merge(list,
+                                 evas_object_box_children_get(content_part));
+        else
+          list = evas_object_box_children_get(content_part);
+     }
+
+   return list;
+}
+
+/**
+ * @brief Gets widget children
+ *
+ * @param widget an EailWidget
+ * @return widget list
+ */
+static Eina_List *
+eail_window_get_widget_children(EailWidget *widget)
+{
+   Evas_Object *o, *obj = eail_widget_get_widget(widget);
+   Eina_List *win_childs = NULL;
+   Eina_List *widgets = NULL;
+   Evas *e;
+
+   /*in elementary >= 1.7.99 we get edje object if object are stacked
+     in containers like box, grid etc we need to get children from this
+     edje*/
+
+   e = evas_object_evas_get(obj);
+   o = evas_object_bottom_get(e);
+   if (!g_strcmp0(evas_object_type_get(o), "edje"))
+     {
+        widgets = _parse_edje(o);
+     }
+   /* Sometimes we have a mix of widgets grouped in containters with
+    * those directly on elm_win objct. So list evas objects laying on
+    * window to be sure we get everything */
+   o = obj;
+   while ((o = evas_object_below_get(o)))
+     {
+        if (elm_object_widget_check(o))
+          {
+             /*be sure that object belongs to window and not to other
+              * container*/
+             if (obj == elm_object_parent_widget_get(o))
+               win_childs = eina_list_append(win_childs, o);
+          }
+     }
+
+   if (win_childs)
+     {
+        /*reverse list to get correct order of widgets tree*/
+        win_childs = eina_list_reverse(win_childs);
+        /*merge window childs together with containers*/
+        if (widgets)
+          widgets = eina_list_merge(widgets, win_childs);
+        else
+          widgets = win_childs;
+     }
+
+   return widgets;
+}
+
+/**
+ * @brief Gets obj state set
+ *
+ * @param obj an AtkObject
+ * @return obj state set
+ */
+static AtkStateSet *
+eail_window_ref_state_set(AtkObject *obj)
+{
+   double x, y;
+   AtkStateSet *state_set;
+   Eina_List *l, *children;
+   Eina_Bool resizable = EINA_TRUE;
+   Evas_Object *child, *widget = eail_widget_get_widget(EAIL_WIDGET(obj));
+
+   if (!widget) return NULL;
+
+   state_set= ATK_OBJECT_CLASS(eail_window_parent_class)->ref_state_set(obj);
+
+   if (elm_win_focus_get(widget))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_ACTIVE);
+     }
+
+   if (elm_win_iconified_get(widget))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_ICONIFIED);
+     }
+
+   if (elm_win_modal_get(widget))
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_MODAL);
+     }
+
+   children = eail_widget_get_widget_children(EAIL_WIDGET(obj));
+   EINA_LIST_FOREACH(children, l, child)
+     {
+        evas_object_size_hint_weight_get(child, &x, &y);
+        if (x != EVAS_HINT_EXPAND || y != EVAS_HINT_EXPAND)
+          {
+             resizable = EINA_FALSE;
+             break;
+          }
+     }
+   eina_list_free(children);
+
+   if (resizable)
+     {
+        atk_state_set_add_state(state_set, ATK_STATE_RESIZABLE);
+     }
+
+   return state_set;
+}
+
+/**
+ * @brief EailWindow instance initializer
+ *
+ * @param window an EailWindow
+ */
+static void
+eail_window_init(EailWindow *window)
+{
+}
+
+/**
+ * @brief EailWindow class initializer
+ *
+ * @param klass an EailWindowClass
+ */
+static void
+eail_window_class_init(EailWindowClass *klass)
+{
+   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
+   EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
+
+   widget_class->get_widget_children = eail_window_get_widget_children;
+
+   class->initialize = eail_window_initialize;
+   class->ref_state_set = eail_window_ref_state_set;
+}
+
+/**
+ * @brief Handle for action minimize
+ *
+ * @param action an AtkAction
+ * @param data additional action data (not used here)
+ *
+ * @return TRUE if action was triggered successfully, FALSE otherwise
+ */
+static gboolean
+eail_action_minimize(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   AtkObject *obj;
+
+   g_return_val_if_fail(EAIL_IS_WINDOW(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+
+   elm_win_iconified_set(widget, EINA_TRUE);
+
+   obj = ATK_OBJECT(action);
+
+   eail_emit_atk_signal(obj, "minimize", EAIL_TYPE_WINDOW);
+
+   return TRUE;
+}
+
+/**
+ * @brief Handle for action maximize
+ *
+ * @param action an AtkAction
+ * @param data additional action data (not used here)
+ *
+ * @return TRUE if action was triggered successfully, FALSE otherwise
+ */
+static gboolean
+eail_action_maximize(AtkAction *action, void *data)
+{
+   Evas_Object *widget;
+   AtkObject *obj;
+
+   g_return_val_if_fail(EAIL_IS_WINDOW(action), FALSE);
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(action));
+
+   elm_win_maximized_set(widget, EINA_TRUE);
+
+   obj = ATK_OBJECT(action);
+
+   eail_emit_atk_signal(obj, "maximize", EAIL_TYPE_WINDOW);
+   return TRUE;
+}
+
+/**
+ * @brief Adds window actions to actions table
+ *
+ * @param action_widget widget that implements EailActionWidget interface
+ */
+static void
+eail_window_actions_init(EailActionWidget *action_widget)
+{
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_WIN_ACTION_MAXIMALIZE, NULL,
+                                    eail_action_maximize);
+   eail_action_widget_action_append(action_widget,
+                                    EAIL_WIN_ACTION_MINIMALIZE, NULL,
+                                    eail_action_minimize);
+}
+
+/**
+ * @brief AtkWindow interface initializer
+ *
+ * It is empty because at the moment
+ * AtkWindow is just about signals
+ *
+ * @param iface an AtkWindowIface
+ */
+static void
+atk_window_interface_init(AtkWindowIface *iface)
+{
+}
+
+/**
+ * @brief Returns first found widget from EvasObjectBox
+ *
+ * @param evas_obj an EvasObjectBox to search in
+ *
+ * @returns Evas_Object* widget or NULL if none has been found
+ */
+static Evas_Object*
+_eail_get_first_widget_from_evas_box(Evas_Object *evas_obj)
+{
+   Eina_List *children = NULL, *l;
+   Evas_Object *it_evas_obj = NULL;
+
+   children = evas_object_box_children_get(evas_obj);
+
+   EINA_LIST_FOREACH(children, l, it_evas_obj)
+     {
+      if (elm_object_widget_check (it_evas_obj))
+         {
+            DBG("Widget has been found %s", evas_object_type_get(it_evas_obj));
+            return it_evas_obj;
+         }
+     }
+
+   return NULL;
+}
+
+/**
+ * @brief Returns first found widget from given edje object
+ *
+ * @param evas_obj edje object to search in
+ *
+ * @returns Evas_Object* widget or NULL if none has been found
+ */
+static Evas_Object *
+_eail_get_first_widget_from_edje(Evas_Object *evas_obj)
+{
+   Eina_List *members = NULL, *l;
+   Evas_Object *it_evas_obj = NULL;
+
+   members = evas_object_smart_members_get(evas_obj);
+   EINA_LIST_FOREACH(members, l, it_evas_obj)
+   {
+      const char *type_name = evas_object_type_get(it_evas_obj);
+
+      /* if widget found, then returning immediately. If not widget, then
+       * looking for nested box*/
+      if (elm_object_widget_check (it_evas_obj))
+        return it_evas_obj;
+      else if (0 == g_strcmp0(type_name, "Evas_Object_Box") )
+        {
+            Evas_Object *widget_from_box = _eail_get_first_widget_from_evas_box(it_evas_obj);
+            if (widget_from_box)
+              return widget_from_box;
+        }
+   }
+
+   return NULL;
+}
+
+/**
+ * @brief Gets a reference to the accessible child, if one exists, at the
+ * coordinate point specified by x and y.
+ *
+ * @param component the AtkComponent
+ * @param x x coordinate
+ * @param y y coordinate
+ * @param coord_type specifies whether the coordinates are relative to the
+ * screen or to the components top level window
+ *
+ * @returns a reference to the accessible child, if one exists.
+ */
+static AtkObject *
+eail_window_ref_accessible_at_point(AtkComponent *component,
+                                    gint x,
+                                    gint y,
+                                    AtkCoordType coord_type)
+{
+   Evas_Object *widget = NULL, *evas_obj_at_coords = NULL;
+   Evas *wdgt_evas = NULL;
+   const char * found_obj_type = NULL;
+
+   widget = eail_widget_get_widget(EAIL_WIDGET(component));
+
+   if (!widget) return NULL;
+
+   if (coord_type == ATK_XY_SCREEN) {
+           int ee_x, ee_y;
+           Ecore_Evas *ee= ecore_evas_ecore_evas_get(evas_object_evas_get(widget));
+
+           ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+           x -= ee_x;
+           y -= ee_y;
+       }
+
+   /* NOTE: it is crucial to get object from evas, NOT Evas_Object*/
+   wdgt_evas = evas_object_evas_get(widget);
+
+   evas_obj_at_coords = evas_object_top_at_xy_get
+                              (wdgt_evas, x, y, EINA_FALSE, EINA_FALSE);
+   if (!evas_obj_at_coords)
+     {
+       DBG("Not found any object at coords %d,%d", x, y);
+       return NULL;
+     }
+
+   /* if edje object, then we have to parse that and extract widget from it*/
+   found_obj_type = evas_object_type_get(evas_obj_at_coords);
+   if (0 == g_strcmp0(found_obj_type, "edje"))
+     {
+         DBG("Edje object found...");
+         evas_obj_at_coords = _eail_get_first_widget_from_edje(evas_obj_at_coords);
+     }
+
+   return eail_factory_get_accessible(evas_obj_at_coords);
+}
+
+/**
+ * @brief AtkComponent interface initialization
+ *
+ * Initialization for ref_accessible_at_point callback used by clients to
+ * reference object at given coordinates. Rest of implementation is default
+ * so no overriding-callbacks is needed.
+ *
+ * @param iface EailWindow object
+ */
+static void
+atk_component_interface_init(AtkComponentIface *iface)
+{
+   iface->ref_accessible_at_point = eail_window_ref_accessible_at_point;
+}
+
+/**
+ * @param dynamic_content_holder an EailDynamicContent object (EailWindow)
+ */
+void
+eail_window_update_descendants(EailDynamicContent *dynamic_content_holder)
+{
+   gint n_children = 0;
+   EailWindow *window = NULL;
+
+   if (!EAIL_IS_WINDOW(dynamic_content_holder))
+     {
+        DBG("No EailWindow found. Returning");
+        return;
+     }
+
+   window = EAIL_WINDOW(dynamic_content_holder);
+
+   n_children = atk_object_get_n_accessible_children(ATK_OBJECT(window));
+   if (n_children && n_children > window->child_count_last)
+     {
+        eail_emit_children_changed(TRUE, ATK_OBJECT(window), n_children - 1);
+
+     }
+   else if (n_children < window->child_count_last)
+     {
+         eail_emit_children_changed
+                     (FALSE, ATK_OBJECT(window), window->child_count_last);
+     }
+
+   window->child_count_last = n_children;
+}
+
+/**
+ * @brief Initializer for dynamic content interface, used for handling objects
+ * children hierarchy changes
+ *
+ * @param iface an EailDynamicContentIface
+ */
+static void
+eail_dynamic_content_interface_init(EailDynamicContentIface *iface)
+{
+   iface->update_hierarchy = eail_window_update_descendants;
+}
diff --git a/eail/eail/eail_window.h b/eail/eail/eail_window.h
new file mode 100644 (file)
index 0000000..9dc7717
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * @file eail_window.h
+ *
+ * @brief Header for EailWindow implementation
+ */
+
+#ifndef EAIL_WINDOW_H
+#define EAIL_WINDOW_H
+
+#include "eail_action_widget.h"
+
+/**
+ * @brief Returns a value corresponding to the type of EailWindow class
+ */
+#define EAIL_TYPE_WINDOW              (eail_window_get_type())
+
+/**
+ * @brief Macro upcasts an instance (obj) of a subclass to the EailWindow
+ * type
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_WINDOW(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+                                       EAIL_TYPE_WINDOW, EailWindow))
+
+/**
+ * @brief Macro upcasts a subclass (klass) to the EailWindow class
+ *
+ * @param klass subclass object
+ */
+#define EAIL_WINDOW_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
+                                       EAIL_TYPE_WINDOW, EailWindowClass))
+
+/**
+ * @brief Tests whether object (obj) is an instance of EailWindow class
+ *
+ * @param obj an AtkObject
+ */
+#define EAIL_IS_WINDOW(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+                                       EAIL_TYPE_WINDOW))
+
+/**
+ * @brief Tests whether given klass is a subclass of EailWindow
+ *
+ * @param klass klass object
+ */
+#define EAIL_IS_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
+                                       EAIL_TYPE_WINDOW))
+
+/**
+ * @brief Gets EailWindow class structure from an obj (class instance)
+ *
+ * @param obj object instance to get EailWindow class from
+ */
+#define EAIL_WINDOW_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
+                                       EAIL_TYPE_WINDOW, EailWindowClass))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Definition of object structure for Atk EailWindow*/
+typedef struct _EailWindow      EailWindow;
+
+/** @brief Definition of object class for Atk EailWindow*/
+typedef struct _EailWindowClass EailWindowClass;
+
+/** @brief Definition of object structure for Atk EailWindow*/
+struct _EailWindow
+{
+    EailActionWidget parent;/*!< @brief object that functionality is being extended*/
+    gint child_count_last;/**< @brief last reported count of children */
+};
+
+/** @brief Definition of object class for Atk EailWindow*/
+struct _EailWindowClass
+{
+    EailActionWidgetClass parent_class;/*!< @brief class that is being extended*/
+};
+
+/** @brief Getter for EailWindow GType
+ * @returns GType for EailWindow implementation*/
+GType   eail_window_get_type  (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/eail/tests/Makefile.am b/eail/tests/Makefile.am
new file mode 100644 (file)
index 0000000..271cea4
--- /dev/null
@@ -0,0 +1,637 @@
+check_PROGRAMS = eail_image_tc1 \
+                eail_image_tc2 \
+                eail_image_tc3 \
+                eail_action_slider_tc1 \
+                eail_action_slider_tc2 \
+                eail_check_tc1 \
+                eail_check_tc2 \
+                eail_radio_tc1 \
+                eail_radio_tc2 \
+                eail_menu_tc1 \
+                eail_scroller_tc1 \
+                eail_scroller_tc2 \
+                eail_list_tc1 \
+                eail_list_tc2 \
+                eail_list_tc3 \
+                eail_genlist_tc1 \
+                eail_genlist_tc2 \
+                eail_genlist_tc3 \
+                eail_button_tc1 \
+                eail_button_tc2 \
+                eail_button_tc3 \
+                eail_button_tc4 \
+                eail_tooltip_tc1 \
+                eail_separator_tc1 \
+                eail_progressbar_tc1 \
+                eail_progressbar_tc2 \
+                eail_clock_tc1 \
+                eail_spinner_tc1 \
+                eail_spinner_tc2 \
+                eail_calendar_tc1 \
+                eail_calendar_tc2 \
+                eail_grid_tc1 \
+                eail_route_tc1 \
+                eail_route_tc2 \
+                eail_gengrid_tc1 \
+                eail_gengrid_tc2 \
+                eail_gengrid_tc3 \
+                eail_dayselector_tc1 \
+                eail_fileselector_tc1 \
+                eail_diskselector_tc1 \
+                eail_diskselector_tc2 \
+                eail_diskselector_tc3 \
+                eail_conformant_tc1 \
+                eail_notify_tc1 \
+                eail_popup_tc1 \
+                eail_web_tc1 \
+                eail_win_tc1 \
+                eail_win_tc2 \
+                eail_toolbar_tc1 \
+                eail_index_tc1 \
+                eail_ctxpopup_tc1 \
+                eail_ctxpopup_tc2 \
+                eail_focus_test \
+                eail_multibuttonentry_tc1 \
+                eail_multibuttonentry_tc2 \
+                eail_multibuttonentry_tc3 \
+                eail_multibuttonentry_tc4 \
+                eail_segment_control_tc1 \
+                eail_segment_control_tc2 \
+                eail_file_selector_button_tc1 \
+                eail_file_selector_entry_tc1 \
+                eail_naviframe_tc1 \
+                eail_naviframe_tc2 \
+                eail_naviframe_page_tc1 \
+                eail_colorselector_tc1 \
+                eail_colorselector_tc2 \
+                eail_hover_tc1 \
+                eail_hover_tc2 \
+                eail_panes_tc1 \
+                eail_panes_tc2 \
+                eail_datetime_tc1 \
+                eail_datetime_tc2 \
+                eail_panel_tc1 \
+                eail_panel_tc2 \
+                eail_hoversel_tc1 \
+                eail_hoversel_tc2 \
+                eail_slideshow_tc1 \
+                eail_slideshow_tc2 \
+                eail_slideshow_tc3 \
+                eail_map_tc1 \
+                eail_map_tc2 \
+                eail_map_tc3 \
+                eail_glview_tc1 \
+                eail_flipselector_tc1 \
+                eail_flipselector_tc2 \
+                eail_flipselector_tc3 \
+                eail_mapbuf_tc1 \
+                eail_video_tc1 \
+                eail_video_tc2 \
+                eail_video_tc3 \
+                eail_layout_tc1 \
+                eail_flip_tc1 \
+                eail_flip_tc2 \
+                eail_bubble_tc1 \
+                eail_bubble_tc2 \
+                eail_plug_tc1 \
+                eail_plug_tc2 \
+                eail_label_tc1 \
+                eail_label_tc2 \
+                eail_slider_tc1 \
+                eail_slider_tc2 \
+                eail_prefs_tc1 \
+                eail_background_tc1 \
+                eail_background_tc2 \
+                eail_table_tc1 \
+                eail_thumb_tc1 \
+                eail_thumb_tc2 \
+                eail_thumb_tc3 \
+                eail_icon_tc1 \
+                eail_icon_tc2 \
+                eail_icon_tc3 \
+                eail_inwin_tc1 \
+                eail_entry_tc1 \
+                eail_entry_tc2 \
+                eail_entry_tc3 \
+                eail_photo_tc1 \
+                eail_photo_tc2 \
+                eail_photo_tc3 \
+                eail_photocam_tc1 \
+                eail_photocam_tc2 \
+                eail_photocam_tc3
+
+TESTS = $(check_PROGRAMS)
+
+if MAKE_TESTS
+noinst_LTLIBRARIES = libeail_test_utils.la
+endif
+
+test_cflags = $(TEST_DEPS_CFLAGS)
+test_libs = $(TEST_DEPS_LIBS) \
+           $(COVERAGE_LIBS) \
+           libeail_test_utils.la
+
+eail_action_slider_tc1_SOURCES = eail_action_slider_tc1.c
+eail_action_slider_tc1_CFLAGS = $(test_cflags)
+eail_action_slider_tc1_LDADD = $(test_libs)
+
+eail_action_slider_tc2_SOURCES = eail_action_slider_tc2.c
+eail_action_slider_tc2_CFLAGS = $(test_cflags)
+eail_action_slider_tc2_LDADD = $(test_libs)
+
+eail_image_tc1_SOURCES = eail_image_tc1.c
+eail_image_tc1_CFLAGS = $(test_cflags)
+eail_image_tc1_LDADD = $(test_libs)
+
+eail_image_tc2_SOURCES = eail_image_tc2.c
+eail_image_tc2_CFLAGS = $(test_cflags)
+eail_image_tc2_LDADD = $(test_libs)
+
+eail_image_tc3_SOURCES = eail_image_tc3.c
+eail_image_tc3_CFLAGS = $(test_cflags)
+eail_image_tc3_LDADD = $(test_libs)
+
+eail_check_tc1_SOURCES = eail_check_tc1.c
+eail_check_tc1_CFLAGS = $(test_cflags)
+eail_check_tc1_LDADD = $(test_libs)
+
+eail_check_tc2_SOURCES = eail_check_tc2.c
+eail_check_tc2_CFLAGS = $(test_cflags)
+eail_check_tc2_LDADD = $(test_libs)
+
+eail_radio_tc1_SOURCES = eail_radio_tc1.c
+eail_radio_tc1_CFLAGS = $(test_cflags)
+eail_radio_tc1_LDADD = $(test_libs)
+
+eail_radio_tc2_SOURCES = eail_radio_tc2.c
+eail_radio_tc2_CFLAGS = $(test_cflags)
+eail_radio_tc2_LDADD = $(test_libs)
+
+eail_menu_tc1_SOURCES = eail_menu_tc1.c
+eail_menu_tc1_CFLAGS = $(test_cflags)
+eail_menu_tc1_LDADD = $(test_libs)
+
+eail_scroller_tc1_SOURCES = eail_scroller_tc1.c
+eail_scroller_tc1_CFLAGS = $(test_cflags)
+eail_scroller_tc1_LDADD = $(test_libs)
+
+eail_scroller_tc2_SOURCES = eail_scroller_tc2.c
+eail_scroller_tc2_CFLAGS = $(test_cflags)
+eail_scroller_tc2_LDADD = $(test_libs)
+
+eail_list_tc1_SOURCES = eail_list_tc1.c
+eail_list_tc1_CFLAGS = $(test_cflags)
+eail_list_tc1_LDADD = $(test_libs)
+
+eail_list_tc2_SOURCES = eail_list_tc2.c
+eail_list_tc2_CFLAGS = $(test_cflags)
+eail_list_tc2_LDADD = $(test_libs)
+
+eail_list_tc3_SOURCES = eail_list_tc3.c
+eail_list_tc3_CFLAGS = $(test_cflags)
+eail_list_tc3_LDADD = $(test_libs)
+
+eail_genlist_tc1_SOURCES = eail_genlist_tc1.c
+eail_genlist_tc1_CFLAGS = $(test_cflags)
+eail_genlist_tc1_LDADD = $(test_libs)
+
+eail_genlist_tc2_SOURCES = eail_genlist_tc2.c
+eail_genlist_tc2_CFLAGS = $(test_cflags)
+eail_genlist_tc2_LDADD = $(test_libs)
+
+eail_genlist_tc3_SOURCES = eail_genlist_tc3.c
+eail_genlist_tc3_CFLAGS = $(test_cflags)
+eail_genlist_tc3_LDADD = $(test_libs)
+
+eail_button_tc1_SOURCES = eail_button_tc1.c
+eail_button_tc1_CFLAGS = $(test_cflags)
+eail_button_tc1_LDADD = $(test_libs)
+
+eail_button_tc2_SOURCES = eail_button_tc2.c
+eail_button_tc2_CFLAGS = $(test_cflags)
+eail_button_tc2_LDADD = $(test_libs)
+
+eail_button_tc3_SOURCES = eail_button_tc3.c
+eail_button_tc3_CFLAGS = $(test_cflags)
+eail_button_tc3_LDADD = $(test_libs)
+
+eail_button_tc4_SOURCES = eail_button_tc4.c
+eail_button_tc4_CFLAGS = $(test_cflags)
+eail_button_tc4_LDADD = $(test_libs)
+
+eail_tooltip_tc1_SOURCES = eail_tooltip_tc1.c
+eail_tooltip_tc1_CFLAGS = $(test_cflags)
+eail_tooltip_tc1_LDADD = $(test_libs)
+
+eail_clock_tc1_SOURCES = eail_clock_tc1.c
+eail_clock_tc1_CFLAGS = $(test_cflags)
+eail_clock_tc1_LDADD = $(test_libs)
+
+eail_separator_tc1_SOURCES = eail_separator_tc1.c
+eail_separator_tc1_CFLAGS = $(test_cflags)
+eail_separator_tc1_LDADD = $(test_libs)
+
+eail_progressbar_tc1_SOURCES = eail_progressbar_tc1.c
+eail_progressbar_tc1_CFLAGS = $(test_cflags)
+eail_progressbar_tc1_LDADD = $(test_libs)
+
+eail_progressbar_tc2_SOURCES = eail_progressbar_tc2.c
+eail_progressbar_tc2_CFLAGS = $(test_cflags)
+eail_progressbar_tc2_LDADD = $(test_libs)
+
+eail_spinner_tc1_SOURCES = eail_spinner_tc1.c
+eail_spinner_tc1_CFLAGS = $(test_cflags)
+eail_spinner_tc1_LDADD = $(test_libs)
+
+eail_spinner_tc2_SOURCES = eail_spinner_tc2.c
+eail_spinner_tc2_CFLAGS = $(test_cflags)
+eail_spinner_tc2_LDADD = $(test_libs)
+
+eail_calendar_tc1_SOURCES = eail_calendar_tc1.c
+eail_calendar_tc1_CFLAGS = $(test_cflags)
+eail_calendar_tc1_LDADD = $(test_libs)
+
+eail_calendar_tc2_SOURCES = eail_calendar_tc2.c
+eail_calendar_tc2_CFLAGS = $(test_cflags)
+eail_calendar_tc2_LDADD = $(test_libs)
+
+eail_grid_tc1_SOURCES = eail_grid_tc1.c
+eail_grid_tc1_CFLAGS = $(test_cflags)
+eail_grid_tc1_LDADD = $(test_libs)
+
+eail_route_tc1_SOURCES = eail_route_tc1.c
+eail_route_tc1_CFLAGS = $(test_cflags)
+eail_route_tc1_LDADD = $(test_libs)
+
+eail_route_tc2_SOURCES = eail_route_tc2.c
+eail_route_tc2_CFLAGS = $(test_cflags)
+eail_route_tc2_LDADD = $(test_libs)
+
+eail_gengrid_tc1_SOURCES = eail_gengrid_tc1.c
+eail_gengrid_tc1_CFLAGS = $(test_cflags)
+eail_gengrid_tc1_LDADD = $(test_libs)
+
+eail_gengrid_tc2_SOURCES = eail_gengrid_tc2.c
+eail_gengrid_tc2_CFLAGS = $(test_cflags)
+eail_gengrid_tc2_LDADD = $(test_libs)
+
+eail_gengrid_tc3_SOURCES = eail_gengrid_tc3.c
+eail_gengrid_tc3_CFLAGS = $(test_cflags)
+eail_gengrid_tc3_LDADD = $(test_libs)
+
+eail_dayselector_tc1_SOURCES = eail_dayselector_tc1.c
+eail_dayselector_tc1_CFLAGS = $(test_cflags)
+eail_dayselector_tc1_LDADD = $(test_libs)
+
+eail_diskselector_tc1_SOURCES = eail_diskselector_tc1.c
+eail_diskselector_tc1_CFLAGS = $(test_cflags)
+eail_diskselector_tc1_LDADD = $(test_libs)
+
+eail_diskselector_tc2_SOURCES = eail_diskselector_tc2.c
+eail_diskselector_tc2_CFLAGS = $(test_cflags)
+eail_diskselector_tc2_LDADD = $(test_libs)
+
+eail_diskselector_tc3_SOURCES = eail_diskselector_tc3.c
+eail_diskselector_tc3_CFLAGS = $(test_cflags)
+eail_diskselector_tc3_LDADD = $(test_libs)
+
+eail_fileselector_tc1_SOURCES = eail_fileselector_tc1.c
+eail_fileselector_tc1_CFLAGS = $(test_cflags)
+eail_fileselector_tc1_LDADD = $(test_libs)
+
+eail_conformant_tc1_SOURCES = eail_conformant_tc1.c
+eail_conformant_tc1_CFLAGS = $(test_cflags)
+eail_conformant_tc1_LDADD = $(test_libs)
+
+eail_notify_tc1_SOURCES = eail_notify_tc1.c
+eail_notify_tc1_CFLAGS = $(test_cflags)
+eail_notify_tc1_LDADD = $(test_libs)
+
+eail_popup_tc1_SOURCES = eail_popup_tc1.c
+eail_popup_tc1_CFLAGS = $(test_cflags)
+eail_popup_tc1_LDADD = $(test_libs)
+
+eail_toolbar_tc1_SOURCES = eail_toolbar_tc1.c
+eail_toolbar_tc1_CFLAGS = $(test_cflags)
+eail_toolbar_tc1_LDADD = $(test_libs)
+
+eail_index_tc1_SOURCES = eail_index_tc1.c
+eail_index_tc1_CFLAGS = $(test_cflags)
+eail_index_tc1_LDADD = $(test_libs)
+
+eail_multibuttonentry_tc1_SOURCES = eail_multibuttonentry_tc1.c
+eail_multibuttonentry_tc1_CFLAGS = $(test_cflags)
+eail_multibuttonentry_tc1_LDADD = $(test_libs)
+
+eail_multibuttonentry_tc2_SOURCES = eail_multibuttonentry_tc2.c
+eail_multibuttonentry_tc2_CFLAGS = $(test_cflags)
+eail_multibuttonentry_tc2_LDADD = $(test_libs)
+
+eail_multibuttonentry_tc3_SOURCES = eail_multibuttonentry_tc3.c
+eail_multibuttonentry_tc3_CFLAGS = $(test_cflags)
+eail_multibuttonentry_tc3_LDADD = $(test_libs)
+
+eail_multibuttonentry_tc4_SOURCES = eail_multibuttonentry_tc4.c
+eail_multibuttonentry_tc4_CFLAGS = $(test_cflags)
+eail_multibuttonentry_tc4_LDADD = $(test_libs)
+
+eail_ctxpopup_tc1_SOURCES = eail_ctxpopup_tc1.c
+eail_ctxpopup_tc1_CFLAGS = $(test_cflags)
+eail_ctxpopup_tc1_LDADD = $(test_libs)
+
+eail_ctxpopup_tc2_SOURCES = eail_ctxpopup_tc2.c
+eail_ctxpopup_tc2_CFLAGS = $(test_cflags)
+eail_ctxpopup_tc2_LDADD = $(test_libs)
+
+eail_focus_test_SOURCES = eail_focus_test.c
+eail_focus_test_CFLAGS = $(test_cflags)
+eail_focus_test_LDADD = $(test_libs)
+
+eail_segment_control_tc1_SOURCES = eail_segment_control_tc1.c
+eail_segment_control_tc1_CFLAGS = $(test_cflags)
+eail_segment_control_tc1_LDADD = $(test_libs)
+
+eail_segment_control_tc2_SOURCES = eail_segment_control_tc2.c
+eail_segment_control_tc2_CFLAGS = $(test_cflags)
+eail_segment_control_tc2_LDADD = $(test_libs)
+
+eail_file_selector_button_tc1_SOURCES = eail_file_selector_button_tc1.c
+eail_file_selector_button_tc1_CFLAGS = $(test_cflags)
+eail_file_selector_button_tc1_LDADD = $(test_libs)
+
+eail_file_selector_entry_tc1_SOURCES = eail_file_selector_entry_tc1.c
+eail_file_selector_entry_tc1_CFLAGS = $(test_cflags)
+eail_file_selector_entry_tc1_LDADD = $(test_libs)
+
+eail_naviframe_tc1_SOURCES = eail_naviframe_tc1.c
+eail_naviframe_tc1_CFLAGS = $(test_cflags)
+eail_naviframe_tc1_LDADD = $(test_libs)
+
+eail_naviframe_tc2_SOURCES = eail_naviframe_tc2.c
+eail_naviframe_tc2_CFLAGS = $(test_cflags)
+eail_naviframe_tc2_LDADD = $(test_libs)
+
+eail_naviframe_page_tc1_SOURCES = eail_naviframe_page_tc1.c
+eail_naviframe_page_tc1_CFLAGS = $(test_cflags)
+eail_naviframe_page_tc1_LDADD = $(test_libs)
+
+eail_hover_tc1_SOURCES = eail_hover_tc1.c
+eail_hover_tc1_CFLAGS = $(test_cflags)
+eail_hover_tc1_LDADD = $(test_libs)
+
+eail_hover_tc2_SOURCES = eail_hover_tc2.c
+eail_hover_tc2_CFLAGS = $(test_cflags)
+eail_hover_tc2_LDADD = $(test_libs)
+
+eail_colorselector_tc1_SOURCES = eail_colorselector_tc1.c
+eail_colorselector_tc1_CFLAGS = $(test_cflags)
+eail_colorselector_tc1_LDADD = $(test_libs)
+
+eail_colorselector_tc2_SOURCES = eail_colorselector_tc2.c
+eail_colorselector_tc2_CFLAGS = $(test_cflags)
+eail_colorselector_tc2_LDADD = $(test_libs)
+
+eail_panes_tc1_SOURCES = eail_panes_tc1.c
+eail_panes_tc1_CFLAGS = $(test_cflags)
+eail_panes_tc1_LDADD = $(test_libs)
+
+eail_panes_tc2_SOURCES = eail_panes_tc2.c
+eail_panes_tc2_CFLAGS = $(test_cflags)
+eail_panes_tc2_LDADD = $(test_libs)
+
+eail_datetime_tc1_SOURCES = eail_datetime_tc1.c
+eail_datetime_tc1_CFLAGS = $(test_cflags)
+eail_datetime_tc1_LDADD = $(test_libs)
+
+eail_datetime_tc2_SOURCES = eail_datetime_tc2.c
+eail_datetime_tc2_CFLAGS = $(test_cflags)
+eail_datetime_tc2_LDADD = $(test_libs)
+
+
+eail_panel_tc1_SOURCES = eail_panel_tc1.c
+eail_panel_tc1_CFLAGS = $(test_cflags)
+eail_panel_tc1_LDADD = $(test_libs)
+
+eail_panel_tc2_SOURCES = eail_panel_tc2.c
+eail_panel_tc2_CFLAGS = $(test_cflags)
+eail_panel_tc2_LDADD = $(test_libs)
+
+eail_web_tc1_SOURCES = eail_web_tc1.c
+eail_web_tc1_CFLAGS = $(test_cflags)
+eail_web_tc1_LDADD = $(test_libs)
+
+eail_mapbuf_tc1_SOURCES = eail_mapbuf_tc1.c
+eail_mapbuf_tc1_CFLAGS = $(test_cflags)
+eail_mapbuf_tc1_LDADD = $(test_libs)
+
+eail_hoversel_tc1_SOURCES = eail_hoversel_tc1.c
+eail_hoversel_tc1_CFLAGS = $(test_cflags)
+eail_hoversel_tc1_LDADD = $(test_libs)
+
+eail_hoversel_tc2_SOURCES = eail_hoversel_tc2.c
+eail_hoversel_tc2_CFLAGS = $(test_cflags)
+eail_hoversel_tc2_LDADD = $(test_libs)
+
+eail_slideshow_tc1_SOURCES = eail_slideshow_tc1.c
+eail_slideshow_tc1_CFLAGS = $(test_cflags)
+eail_slideshow_tc1_LDADD = $(test_libs)
+
+eail_slideshow_tc2_SOURCES = eail_slideshow_tc2.c
+eail_slideshow_tc2_CFLAGS = $(test_cflags)
+eail_slideshow_tc2_LDADD = $(test_libs)
+
+eail_slideshow_tc3_SOURCES = eail_slideshow_tc3.c
+eail_slideshow_tc3_CFLAGS = $(test_cflags)
+eail_slideshow_tc3_LDADD = $(test_libs)
+
+eail_map_tc1_SOURCES = eail_map_tc1.c
+eail_map_tc1_CFLAGS = $(test_cflags)
+eail_map_tc1_LDADD = $(test_libs)
+
+eail_map_tc2_SOURCES = eail_map_tc2.c
+eail_map_tc2_CFLAGS = $(test_cflags)
+eail_map_tc2_LDADD = $(test_libs)
+
+eail_map_tc3_SOURCES = eail_map_tc3.c
+eail_map_tc3_CFLAGS = $(test_cflags)
+eail_map_tc3_LDADD = $(test_libs)
+
+eail_win_tc1_SOURCES = eail_win_tc1.c
+eail_win_tc1_CFLAGS = $(test_cflags)
+eail_win_tc1_LDADD = $(test_libs)
+
+eail_win_tc2_SOURCES = eail_win_tc2.c
+eail_win_tc2_CFLAGS = $(test_cflags)
+eail_win_tc2_LDADD = $(test_libs)
+
+eail_glview_tc1_SOURCES = eail_glview_tc1.c
+eail_glview_tc1_CFLAGS = $(test_cflags)
+eail_glview_tc1_LDADD = $(test_libs)
+
+eail_flipselector_tc1_SOURCES = eail_flipselector_tc1.c
+eail_flipselector_tc1_CFLAGS = $(test_cflags)
+eail_flipselector_tc1_LDADD = $(test_libs)
+
+eail_flipselector_tc2_SOURCES = eail_flipselector_tc2.c
+eail_flipselector_tc2_CFLAGS = $(test_cflags)
+eail_flipselector_tc2_LDADD = $(test_libs)
+
+eail_flipselector_tc3_SOURCES = eail_flipselector_tc3.c
+eail_flipselector_tc3_CFLAGS = $(test_cflags)
+eail_flipselector_tc3_LDADD = $(test_libs)
+
+eail_video_tc1_SOURCES = eail_video_tc1.c
+eail_video_tc1_CFLAGS = $(test_cflags)
+eail_video_tc1_LDADD = $(test_libs)
+
+eail_video_tc2_SOURCES = eail_video_tc2.c
+eail_video_tc2_CFLAGS = $(test_cflags)
+eail_video_tc2_LDADD = $(test_libs)
+
+eail_video_tc3_SOURCES = eail_video_tc3.c
+eail_video_tc3_CFLAGS = $(test_cflags)
+eail_video_tc3_LDADD = $(test_libs)
+
+eail_layout_tc1_SOURCES = eail_layout_tc1.c
+eail_layout_tc1_CFLAGS = $(test_cflags)
+eail_layout_tc1_LDADD = $(test_libs)
+
+eail_flip_tc1_SOURCES = eail_flip_tc1.c
+eail_flip_tc1_CFLAGS = $(test_cflags)
+eail_flip_tc1_LDADD = $(test_libs)
+
+eail_flip_tc2_SOURCES = eail_flip_tc2.c
+eail_flip_tc2_CFLAGS = $(test_cflags)
+eail_flip_tc2_LDADD = $(test_libs)
+
+eail_bubble_tc1_SOURCES = eail_bubble_tc1.c
+eail_bubble_tc1_CFLAGS = $(test_cflags)
+eail_bubble_tc1_LDADD = $(test_libs)
+
+eail_bubble_tc2_SOURCES = eail_bubble_tc2.c
+eail_bubble_tc2_CFLAGS = $(test_cflags)
+eail_bubble_tc2_LDADD = $(test_libs)
+
+eail_plug_tc1_SOURCES = eail_plug_tc1.c
+eail_plug_tc1_CFLAGS = $(test_cflags)
+eail_plug_tc1_LDADD = $(test_libs)
+
+eail_plug_tc2_SOURCES = eail_plug_tc2.c
+eail_plug_tc2_CFLAGS = $(test_cflags)
+eail_plug_tc2_LDADD = $(test_libs)
+
+eail_slider_tc1_SOURCES = eail_slider_tc1.c
+eail_slider_tc1_CFLAGS = $(test_cflags)
+eail_slider_tc1_LDADD = $(test_libs)
+
+eail_slider_tc2_SOURCES = eail_slider_tc2.c
+eail_slider_tc2_CFLAGS = $(test_cflags)
+eail_slider_tc2_LDADD = $(test_libs)
+
+eail_label_tc1_SOURCES = eail_label_tc1.c
+eail_label_tc1_CFLAGS = $(test_cflags)
+eail_label_tc1_LDADD = $(test_libs)
+
+eail_label_tc2_SOURCES = eail_label_tc2.c
+eail_label_tc2_CFLAGS = $(test_cflags)
+eail_label_tc2_LDADD = $(test_libs)
+
+eail_prefs_tc1_SOURCES = eail_prefs_tc1.c
+eail_prefs_tc1_CFLAGS = $(test_cflags)
+eail_prefs_tc1_LDADD = $(test_libs)
+
+eail_background_tc1_SOURCES = eail_background_tc1.c
+eail_background_tc1_CFLAGS = $(test_cflags)
+eail_background_tc1_LDADD = $(test_libs)
+
+eail_background_tc2_SOURCES = eail_background_tc2.c
+eail_background_tc2_CFLAGS = $(test_cflags)
+eail_background_tc2_LDADD = $(test_libs)
+
+eail_table_tc1_SOURCES = eail_table_tc1.c
+eail_table_tc1_CFLAGS = $(test_cflags)
+eail_table_tc1_LDADD = $(test_libs)
+
+eail_thumb_tc1_SOURCES = eail_thumb_tc1.c
+eail_thumb_tc1_CFLAGS = $(test_cflags)
+eail_thumb_tc1_LDADD = $(test_libs)
+
+eail_thumb_tc2_SOURCES = eail_thumb_tc2.c
+eail_thumb_tc2_CFLAGS = $(test_cflags)
+eail_thumb_tc2_LDADD = $(test_libs)
+
+eail_thumb_tc3_SOURCES = eail_thumb_tc3.c
+eail_thumb_tc3_CFLAGS = $(test_cflags)
+eail_thumb_tc3_LDADD = $(test_libs)
+
+eail_icon_tc1_SOURCES = eail_icon_tc1.c
+eail_icon_tc1_CFLAGS = $(test_cflags)
+eail_icon_tc1_LDADD = $(test_libs)
+
+eail_icon_tc2_SOURCES = eail_icon_tc2.c
+eail_icon_tc2_CFLAGS = $(test_cflags)
+eail_icon_tc2_LDADD = $(test_libs)
+
+eail_icon_tc3_SOURCES = eail_icon_tc3.c
+eail_icon_tc3_CFLAGS = $(test_cflags)
+eail_icon_tc3_LDADD = $(test_libs)
+
+eail_inwin_tc1_SOURCES = eail_inwin_tc1.c
+eail_inwin_tc1_CFLAGS = $(test_cflags)
+eail_inwin_tc1_LDADD = $(test_libs)
+
+eail_entry_tc1_SOURCES = eail_entry_tc1.c
+eail_entry_tc1_CFLAGS = $(test_cflags)
+eail_entry_tc1_LDADD = $(test_libs)
+
+eail_entry_tc2_SOURCES = eail_entry_tc2.c
+eail_entry_tc2_CFLAGS = $(test_cflags)
+eail_entry_tc2_LDADD = $(test_libs)
+
+eail_entry_tc3_SOURCES = eail_entry_tc3.c
+eail_entry_tc3_CFLAGS = $(test_cflags)
+eail_entry_tc3_LDADD = $(test_libs)
+
+eail_photo_tc1_SOURCES = eail_photo_tc1.c
+eail_photo_tc1_CFLAGS = $(test_cflags)
+eail_photo_tc1_LDADD = $(test_libs)
+
+eail_photo_tc2_SOURCES = eail_photo_tc2.c
+eail_photo_tc2_CFLAGS = $(test_cflags)
+eail_photo_tc2_LDADD = $(test_libs)
+
+eail_photo_tc3_SOURCES = eail_photo_tc3.c
+eail_photo_tc3_CFLAGS = $(test_cflags)
+eail_photo_tc3_LDADD = $(test_libs)
+
+eail_photocam_tc1_SOURCES = eail_photocam_tc1.c
+eail_photocam_tc1_CFLAGS = $(test_cflags)
+eail_photocam_tc1_LDADD = $(test_libs)
+
+eail_photocam_tc2_SOURCES = eail_photocam_tc2.c
+eail_photocam_tc2_CFLAGS = $(test_cflags)
+eail_photocam_tc2_LDADD = $(test_libs)
+
+eail_photocam_tc3_SOURCES = eail_photocam_tc3.c
+eail_photocam_tc3_CFLAGS = $(test_cflags)
+eail_photocam_tc3_LDADD = $(test_libs)
+
+libeail_test_utils_la_SOURCES = eail_test_utils.c eail_test_utils.h
+libeail_test_utils_la_CFLAGS = $(TEST_DEPS_CFLAGS)
+libeail_test_utils_la_LIBADD = $(TEST_DEPS_LIBS)
+
+if MAKE_TESTS
+all-local: check
+endif
+
+if ENABLE_COVERAGE
+coverage: check
+       $(LCOV) --directory $(srcdir) --capture \
+                --output-file $(top_builddir)/eail.info
+       $(LCOV) --directory $(srcdir) --output-file $(top_builddir)/eail.info \
+                --remove $(top_builddir)/eail.info "*.c" "*.h"
+       rm -rf $(top_builddir)/coverage
+       $(mkdir_p) $(top_builddir)/coverage
+       $(GENHTML) --output-directory $(top_builddir)/coverage \
+                $(top_builddir)/eail.info
+endif
diff --git a/eail/tests/data/01.jpg b/eail/tests/data/01.jpg
new file mode 100644 (file)
index 0000000..a162963
Binary files /dev/null and b/eail/tests/data/01.jpg differ
diff --git a/eail/tests/data/02.jpg b/eail/tests/data/02.jpg
new file mode 100644 (file)
index 0000000..9809d7a
Binary files /dev/null and b/eail/tests/data/02.jpg differ
diff --git a/eail/tests/data/03.jpg b/eail/tests/data/03.jpg
new file mode 100644 (file)
index 0000000..4e39da2
Binary files /dev/null and b/eail/tests/data/03.jpg differ
diff --git a/eail/tests/data/04.jpg b/eail/tests/data/04.jpg
new file mode 100644 (file)
index 0000000..8a0c73e
Binary files /dev/null and b/eail/tests/data/04.jpg differ
diff --git a/eail/tests/data/05.jpg b/eail/tests/data/05.jpg
new file mode 100644 (file)
index 0000000..bbc29d3
Binary files /dev/null and b/eail/tests/data/05.jpg differ
diff --git a/eail/tests/data/06.jpg b/eail/tests/data/06.jpg
new file mode 100644 (file)
index 0000000..66d52a4
Binary files /dev/null and b/eail/tests/data/06.jpg differ
diff --git a/eail/tests/data/07.jpg b/eail/tests/data/07.jpg
new file mode 100644 (file)
index 0000000..74f46c0
Binary files /dev/null and b/eail/tests/data/07.jpg differ
diff --git a/eail/tests/data/08.jpg b/eail/tests/data/08.jpg
new file mode 100644 (file)
index 0000000..aa348df
Binary files /dev/null and b/eail/tests/data/08.jpg differ
diff --git a/eail/tests/data/09.jpg b/eail/tests/data/09.jpg
new file mode 100644 (file)
index 0000000..7511eec
Binary files /dev/null and b/eail/tests/data/09.jpg differ
diff --git a/eail/tests/data/plant_01.jpg b/eail/tests/data/plant_01.jpg
new file mode 100644 (file)
index 0000000..1ff445b
Binary files /dev/null and b/eail/tests/data/plant_01.jpg differ
diff --git a/eail/tests/data/prefs_example_02.cfg b/eail/tests/data/prefs_example_02.cfg
new file mode 100644 (file)
index 0000000..ed01735
Binary files /dev/null and b/eail/tests/data/prefs_example_02.cfg differ
diff --git a/eail/tests/data/prefs_example_02.cfg.bkp b/eail/tests/data/prefs_example_02.cfg.bkp
new file mode 100644 (file)
index 0000000..ed01735
Binary files /dev/null and b/eail/tests/data/prefs_example_02.cfg.bkp differ
diff --git a/eail/tests/data/prefs_example_02.epb b/eail/tests/data/prefs_example_02.epb
new file mode 100644 (file)
index 0000000..9243e6c
Binary files /dev/null and b/eail/tests/data/prefs_example_02.epb differ
diff --git a/eail/tests/data/prefs_example_02.epc b/eail/tests/data/prefs_example_02.epc
new file mode 100644 (file)
index 0000000..a7961fd
--- /dev/null
@@ -0,0 +1,65 @@
+collection
+{
+   page
+   {
+      name: "main";
+      version: 1;
+      title: "Preferences Widget";
+      subtitle: "Example 02";
+      widget: "elm/vertical_frame";
+
+      items {
+         item {
+            name: "text";
+            type: TEXTAREA;
+            editable: 1;
+
+            textarea {
+               placeholder: "This is a editable text entry";
+               default: "This is DEFAULT!";
+               accept: "^[a-zA-Z ]*$";
+            }
+         }
+
+         item {
+            name: "floatsp";
+            type: FLOAT;
+            editable: 1;
+            label: "Floating...";
+
+            float {
+               default: 0.7;
+               min: 0;
+               max: 1;
+            }
+         }
+
+         item {
+            name: "checkb";
+            type: BOOL;
+            label: "Checkbox";
+
+            bool {
+               default: true;
+            }
+         }
+
+         item {
+            name: "sep";
+            type: SEPARATOR;
+         }
+
+         item {
+            name: "save";
+            type: SAVE;
+            label: "Save";
+         }
+
+         item {
+            name: "action";
+            type: ACTION;
+            label: "Action!";
+         }
+      }
+   }
+}
diff --git a/eail/tests/data/pt.png b/eail/tests/data/pt.png
new file mode 100644 (file)
index 0000000..062a517
Binary files /dev/null and b/eail/tests/data/pt.png differ
diff --git a/eail/tests/data/small-01.jpg b/eail/tests/data/small-01.jpg
new file mode 100644 (file)
index 0000000..dd096b8
Binary files /dev/null and b/eail/tests/data/small-01.jpg differ
diff --git a/eail/tests/data/softboy.avi b/eail/tests/data/softboy.avi
new file mode 100644 (file)
index 0000000..3739bda
Binary files /dev/null and b/eail/tests/data/softboy.avi differ
diff --git a/eail/tests/data/test.edj b/eail/tests/data/test.edj
new file mode 100644 (file)
index 0000000..b4ea41a
Binary files /dev/null and b/eail/tests/data/test.edj differ
diff --git a/eail/tests/data/th-whiterabbit01.jpg b/eail/tests/data/th-whiterabbit01.jpg
new file mode 100644 (file)
index 0000000..d72de80
Binary files /dev/null and b/eail/tests/data/th-whiterabbit01.jpg differ
diff --git a/eail/tests/data/whiterabbit01.jpg b/eail/tests/data/whiterabbit01.jpg
new file mode 100644 (file)
index 0000000..02d4231
Binary files /dev/null and b/eail/tests/data/whiterabbit01.jpg differ
diff --git a/eail/tests/eail_action_slider_tc1.c b/eail/tests/eail_action_slider_tc1.c
new file mode 100644 (file)
index 0000000..535beed
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailActionSlider
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailActionSlider
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailActionSlider")
+
+static void
+_init_action_slider(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *as;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, 0);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   as = elm_actionslider_add(win);
+   evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
+   evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
+   elm_object_part_text_set(as, "left", "left1");
+   elm_object_part_text_set(as, "center", "center1");
+   elm_object_part_text_set(as, "right", "right1");
+   elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
+   evas_object_show(as);
+   elm_box_pack_end(bx, as);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_SLIDER);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_action_slider(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_action_slider_tc2.c b/eail/tests/eail_action_slider_tc2.c
new file mode 100644 (file)
index 0000000..86e7dbc
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailActionSlider
+ *
+ * Description: Test AtkAction interface
+ * Test input: accessible object representing EailActionSlider
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailActionSlider")
+
+static void
+_init_action_slider(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *as;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, 0);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   as = elm_actionslider_add(win);
+   evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
+   evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
+   elm_object_part_text_set(as, "left", "left1");
+   elm_object_part_text_set(as, "center", "center1");
+   elm_object_part_text_set(as, "right", "right1");
+   elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
+   evas_object_show(as);
+   elm_box_pack_end(bx, as);
+
+   as = elm_actionslider_add(win);
+   evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
+   evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
+   elm_object_part_text_set(as, "center", "center2");
+   elm_object_part_text_set(as, "right", "right2");
+   elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT);
+   elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_RIGHT);
+   evas_object_show(as);
+   elm_box_pack_end(bx, as);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   guint minimum, maximum, current, minimum_increment;
+   Elm_Actionslider_Pos pos_test_set = ELM_ACTIONSLIDER_CENTER;
+   static int test_count, test_1_count, test_2_count;
+
+   test_count++;
+
+   g_assert(ATK_IS_VALUE(obj));
+
+   GValue value = G_VALUE_INIT;
+   g_value_init(&value, G_TYPE_UINT);
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   minimum = g_value_get_uint(&value);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   maximum = g_value_get_uint(&value);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_uint(&value);
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   minimum_increment = g_value_get_uint(&value);
+
+   g_assert(ELM_ACTIONSLIDER_NONE == minimum);
+   g_assert(ELM_ACTIONSLIDER_NONE == minimum_increment);
+
+   if (ELM_ACTIONSLIDER_LEFT == current)
+     {
+        test_1_count++;
+
+        g_assert(ELM_ACTIONSLIDER_ALL == maximum);
+
+        g_value_set_uint(&value, ELM_ACTIONSLIDER_ALL);
+        g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+     }
+   else if (ELM_ACTIONSLIDER_RIGHT == current)
+     {
+        test_2_count++;
+
+        g_assert((ELM_ACTIONSLIDER_RIGHT | ELM_ACTIONSLIDER_CENTER) == maximum);
+
+        g_value_set_uint(&value, ELM_ACTIONSLIDER_LEFT);
+        g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+     }
+   else
+     {
+        _printf("initialized values ​​are different from returned by ATK");
+        g_assert(FALSE);
+     }
+
+   g_value_set_uint(&value, pos_test_set);
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_uint(&value);
+   g_assert(pos_test_set == current);
+
+   g_assert((test_1_count + test_2_count) == test_count);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_action_slider(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_background_tc1.c b/eail/tests/eail_background_tc1.c
new file mode 100644 (file)
index 0000000..f238984
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailBackground
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailBackground
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define TEST_STR "bg-test"
+#define IMG_PATH "./data/08.jpg"
+#define X 50
+#define Y 60
+#define WIDTH 320
+#define HEIGHT 280
+
+INIT_TEST("EailBackground")
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkAttributeSet *attr_set, *node;
+   AtkAttribute *p;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   attr_set = atk_object_get_attributes(obj);
+   g_assert(g_slist_length(attr_set) == 3);
+
+   node = g_slist_nth(attr_set, 0);
+   p = (AtkAttribute *)node->data;
+   g_assert_cmpstr(p->name, ==, "type");
+   g_assert_cmpstr(p->value, ==, "elm_bg");
+
+   node = g_slist_next(node);
+   p = (AtkAttribute *)node->data;
+   g_assert_cmpstr(p->name, ==, "file");
+   g_assert_cmpstr(p->value, ==, IMG_PATH);
+
+   node = g_slist_next(node);
+   p = (AtkAttribute *)node->data;
+   g_assert_cmpstr(p->name, ==, "display mode");
+   g_assert_cmpstr(p->value, ==, "stretch");
+
+   g_slist_free(attr_set);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_background(Evas_Object *win)
+{
+   Evas_Object *bg;
+   char buf[PATH_MAX];
+
+   bg = elm_bg_add(win);
+   elm_bg_load_size_set(bg, 20, 20);
+   elm_bg_option_set(bg, ELM_BG_OPTION_STRETCH);
+   snprintf(buf, sizeof(buf), IMG_PATH);
+   elm_bg_file_set(bg, buf, NULL);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+   evas_object_resize(win, WIDTH, HEIGHT);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_background(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_background_tc2.c b/eail/tests/eail_background_tc2.c
new file mode 100644 (file)
index 0000000..0faaee9
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Tested interface: AtkImage
+ *
+ * Tested AtkObject: EailBackground
+ *
+ * Description: Test AtkImage interface
+ *
+ * Test input: accessible object representing EailBackground
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define DEBUG
+
+#define TEST_STR "bg-test"
+#define IMG_PATH "./data/08.jpg"
+#define X 50
+#define Y 60
+#define WIDTH 320
+#define HEIGHT 280
+
+INIT_TEST("EailBackground")
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *desc;
+   int w, h;
+
+   g_assert(ATK_IS_IMAGE(obj));
+
+   g_assert(atk_image_set_image_description(ATK_IMAGE(obj), TEST_STR));
+   desc = atk_image_get_image_description(ATK_IMAGE(obj));
+   g_assert(!g_strcmp0(desc, TEST_STR));
+
+   atk_image_get_image_size(ATK_IMAGE(obj), &w, &h);
+   g_assert(w == WIDTH);
+   g_assert(h == HEIGHT);
+
+   atk_image_get_image_position(ATK_IMAGE(obj), &w, &h, ATK_XY_WINDOW);
+   g_assert(w == 0);
+   g_assert(h == 0);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_background(Evas_Object *win)
+{
+   Evas_Object *bg;
+   char buf[PATH_MAX];
+
+   bg = elm_bg_add(win);
+   elm_bg_load_size_set(bg, 20, 20);
+   elm_bg_option_set(bg, ELM_BG_OPTION_STRETCH);
+   snprintf(buf, sizeof(buf), IMG_PATH);
+   elm_bg_file_set(bg, buf, NULL);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+   evas_object_resize(win, WIDTH, HEIGHT);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_background(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_bubble_tc1.c b/eail/tests/eail_bubble_tc1.c
new file mode 100644 (file)
index 0000000..f1d9677
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailBubble
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailBubble
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailBubble")
+
+static void
+_init_bubble(Evas_Object *win)
+{
+   Evas_Object *bg, *label, *icon, *bubble;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   label = elm_label_add(win);
+   elm_object_text_set(label, "This is the CONTENT of our bubble");
+   evas_object_show(label);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   evas_object_show(icon);
+
+   bubble = elm_bubble_add(win);
+   elm_object_part_content_set(bubble, "icon", icon);
+   elm_object_part_text_set(bubble, "info", "INFO");
+   elm_object_text_set(bubble, "LABEL");
+   elm_object_content_set(bubble, label);
+   evas_object_resize(bubble, 300, 100);
+   evas_object_show(bubble);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+   const char *type_name_child;
+   AtkObject *xobj;
+
+   g_assert(ATK_IS_OBJECT(obj));
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_FILLER);
+
+   g_assert_cmpstr(type_name, ==, "EailBubble");
+
+   // test children
+   g_assert(2 == atk_object_get_n_accessible_children(obj));
+
+   for (int count = 0; 2 > count; count++)
+     {
+        xobj = atk_object_ref_accessible_child(obj, count);
+        g_assert(xobj);
+        type_name_child = g_type_name(G_TYPE_FROM_INSTANCE(xobj));
+        _printf(" child num: %d, type_name: %s\n", count, type_name_child);
+        g_assert(!strcmp(type_name_child, "EailIcon") || !strcmp(type_name_child, "EailLabel"));
+     }
+
+   /* bubble object does not support focus */
+   eailu_test_atk_focus(obj, FALSE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_bubble(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_bubble_tc2.c b/eail/tests/eail_bubble_tc2.c
new file mode 100644 (file)
index 0000000..099758d
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailBubble
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailBubble
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailBubble")
+
+static void
+_bubble_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+   static unsigned char counter = 0;
+
+   if (3 < counter)
+     counter = 0;
+
+   elm_bubble_pos_set(obj, counter);
+
+   counter++;
+}
+
+static void
+_init_bubble(Evas_Object *win)
+{
+   Evas_Object *bg, *label, *icon, *bubble;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   label = elm_label_add(win);
+   elm_object_text_set(label, "This is the CONTENT of our bubble");
+   evas_object_show(label);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   evas_object_show(icon);
+
+   bubble = elm_bubble_add(win);
+   elm_object_part_content_set(bubble, "icon", icon);
+   elm_object_part_text_set(bubble, "info", "INFO");
+   elm_object_text_set(bubble, "LABEL");
+   elm_object_content_set(bubble, label);
+   evas_object_smart_callback_add(bubble, "clicked", _bubble_clicked, NULL);
+   evas_object_resize(bubble, 300, 100);
+   evas_object_show(bubble);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert(-1 == (eailu_get_action_number(ATK_ACTION(obj), "typo")));
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_bubble(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_button_tc1.c b/eail/tests/eail_button_tc1.c
new file mode 100644 (file)
index 0000000..3f9d212
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailButton
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailButton
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define BUTTON_TEXT1 "Button1"
+
+INIT_TEST("EailButton")
+
+void button_focus_cb(AtkObject *obj, gboolean b)
+{
+   printf("aaa");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, BUTTON_TEXT1"1");
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int handler_id;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_PUSH_BUTTON);
+   g_assert_cmpstr(atk_object_get_name(obj), ==, BUTTON_TEXT1);
+   atk_object_set_name(obj, BUTTON_TEXT1"test");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, BUTTON_TEXT1"test");
+
+   handler_id = atk_component_add_focus_handler(ATK_COMPONENT(obj),
+                                                button_focus_cb);
+   g_assert(handler_id != 0);
+
+   handler_id = atk_component_add_focus_handler(ATK_COMPONENT(obj),
+                                                button_focus_cb);
+   g_assert(handler_id == 0);
+
+   g_assert(atk_component_grab_focus(ATK_COMPONENT(obj)));
+   atk_component_remove_focus_handler(ATK_COMPONENT(obj), handler_id);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_button(Evas_Object *win)
+{
+   Evas_Object *bg, *button1;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   button1 = elm_button_add(win);
+   elm_object_text_set(button1, BUTTON_TEXT1);
+
+   evas_object_resize(button1, 140, 60);
+   evas_object_move(button1, 50, 20);
+   evas_object_show(button1);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_button(win);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_button_tc2.c b/eail/tests/eail_button_tc2.c
new file mode 100644 (file)
index 0000000..53d62d3
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailButton
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailButton
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define DEBUG
+
+#define ACTIONS_NUMBER 3
+#define BUTTON_TEXT1   "Button1"
+#define BUTTON_TEXT2   "button2"
+
+static int action_test_passed;
+
+INIT_TEST("EailButton")
+
+static void
+_on_click(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("button click\n");
+   ++action_test_passed;
+}
+
+static void
+_on_press(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("button press\n");
+   ++action_test_passed;
+}
+
+static void
+_on_release(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("button release\n");
+   ++action_test_passed;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+   eailu_test_action_activate(ATK_ACTION(obj), "press");
+   eailu_test_action_activate(ATK_ACTION(obj), "release");
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   g_assert(action_test_passed == 3);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_button(Evas_Object *win)
+{
+   Evas_Object *bg, *icon, *button1;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   evas_object_show(icon);
+
+   button1 = elm_button_add(win);
+   elm_object_text_set(button1, BUTTON_TEXT1);
+   evas_object_smart_callback_add(button1, "clicked", _on_click, "button1");
+   evas_object_smart_callback_add(button1, "pressed", _on_press, "button1");
+   evas_object_smart_callback_add(button1, "unpressed", _on_release, "button1");
+
+   evas_object_resize(button1, 140, 60);
+   evas_object_move(button1, 50, 20);
+   evas_object_show(button1);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_button(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_button_tc3.c b/eail/tests/eail_button_tc3.c
new file mode 100644 (file)
index 0000000..a865642
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Tested interface: AtkImage
+ *
+ * Tested AtkObject: EailButton
+ *
+ * Description: Test AtkImage interface
+ *
+ * Test input: accessible object representing EailButton
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define BUTTON_TEXT2   "button2"
+
+#define ICON_SIZE 56
+
+INIT_TEST("EailButton")
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name_child;
+   int height = 0, width = 0;
+   int x = -1, y = -1;
+   AtkObject *xobj;
+
+   g_assert(ATK_IS_IMAGE(obj));
+
+   _printf("Button test: %s\n", BUTTON_TEXT2);
+   // test children
+   g_assert(1 == atk_object_get_n_accessible_children(obj));
+
+   xobj = atk_object_ref_accessible_child(obj, 0);
+   g_assert(NULL != xobj);
+   type_name_child = g_type_name(G_TYPE_FROM_INSTANCE(xobj));
+   _printf("type_name_child: %s\n", type_name_child);
+   g_assert_cmpstr(type_name_child, ==, "EailIcon");
+
+   // test AtkImage
+   atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
+   _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
+
+   atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
+   _printf("atk_image_get_image_size: height %d width %d\n", height, width);
+   g_assert(ICON_SIZE == height && ICON_SIZE == width);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_button(Evas_Object *win)
+{
+   Evas_Object *bg, *icon, *button2;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   evas_object_show(icon);
+
+   button2 = elm_button_add(win);
+   elm_object_text_set(button2, BUTTON_TEXT2);
+   elm_object_part_content_set(button2, "icon", icon);
+   evas_object_resize(button2, 140, 60);
+   evas_object_show(button2);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_button(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_button_tc4.c b/eail/tests/eail_button_tc4.c
new file mode 100644 (file)
index 0000000..6f7a578
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Tested interface: AtkText
+ *
+ * Tested AtkObject: EailButton
+ *
+ * Description: Test AtkText interface
+ *
+ * Test input: accessible object representing EailButton
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define BUTTON_TEXT2   "button2"
+
+#define ICON_SIZE 56
+
+INIT_TEST("EailButton")
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_TEXT(obj));
+   g_assert(atk_text_get_character_at_offset(ATK_TEXT(obj), 1) == 'u');
+   g_assert(atk_text_get_character_count(ATK_TEXT(obj)) == 7);
+   g_assert_cmpstr(atk_text_get_text(ATK_TEXT(obj), 1, 4), ==, "utt");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_button(Evas_Object *win)
+{
+   Evas_Object *bg, *button2;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   button2 = elm_button_add(win);
+   elm_object_text_set(button2, BUTTON_TEXT2);
+   evas_object_resize(button2, 140, 60);
+   evas_object_show(button2);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_button(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_calendar_tc1.c b/eail/tests/eail_calendar_tc1.c
new file mode 100644 (file)
index 0000000..54d83fc
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailCalendar
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailCalendar
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+#include "eail_test_utils.h"
+
+INIT_TEST("EailCalendar")
+
+static int year_limit_min = 2000;
+static int year_limit_max = 2030;
+
+static void
+_init_calendar(Evas_Object *win)
+{
+   Evas_Object *bg, *cal;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   cal = elm_calendar_add(win);
+   elm_calendar_min_max_year_set(cal, year_limit_min, year_limit_max);
+   elm_win_resize_object_add(win, cal);
+   evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(cal);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_CALENDAR);
+
+   atk_object_set_name(obj, "cal");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "cal");
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   /* calendar object to support focus */
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_calendar(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_calendar_tc2.c b/eail/tests/eail_calendar_tc2.c
new file mode 100644 (file)
index 0000000..e1c984a
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailCalendar
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailCalendar
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailCalendar")
+
+static int year_limit_min = 2000;
+static int year_limit_max = 2030;
+
+static void
+_printf_calendar_int(const char *str, time_t atime)
+{
+   struct tm tmp;
+
+   localtime_r(&atime, &tmp);
+
+   _printf("[%04d-%02d-%02d] (%s)\n",
+           tmp.tm_year + 1900, tmp.tm_mon + 1, tmp.tm_mday, str);
+}
+
+static time_t
+_val_min(int year)
+{
+   struct tm minimum;
+
+   memset(&minimum, 0, sizeof(minimum));
+
+   minimum.tm_year = year - 1900;
+   minimum.tm_mon = 0;
+   minimum.tm_mday = 1;
+   minimum.tm_hour = 0;
+   minimum.tm_min = 0;
+   minimum.tm_sec = 0;
+
+   return mktime(&minimum);
+}
+
+static int
+_val_date_cmp(time_t time1, time_t time2)
+{
+   struct tm tmp1, tmp2;
+
+   localtime_r(&time1, &tmp1);
+   localtime_r(&time2, &tmp2);
+
+   if (tmp1.tm_year == tmp2.tm_year &&
+       tmp1.tm_mon == tmp2.tm_mon &&
+       tmp1.tm_mday == tmp2.tm_mday)
+     {
+        return TRUE;
+     }
+     else
+     {
+        return FALSE;
+     }
+}
+
+static time_t
+_val_max(int year)
+{
+   struct tm maximum;
+
+   memset(&maximum, 0, sizeof(maximum));
+
+   maximum.tm_year = year - 1900;
+   maximum.tm_mon = 11;
+   maximum.tm_mday = 31;
+   maximum.tm_hour = 23;
+   maximum.tm_min = 59;
+   maximum.tm_sec = 59;
+
+   return mktime(&maximum);
+}
+
+static void
+_init_calendar(Evas_Object *win)
+{
+   Evas_Object *bg, *cal;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   cal = elm_calendar_add(win);
+   elm_calendar_min_max_year_set(cal, year_limit_min, year_limit_max);
+   elm_win_resize_object_add(win, cal);
+   evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(cal);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int minimum, maximum, current, minimum_increment;
+   struct tm val_test_set;
+
+   g_assert(ATK_IS_VALUE(obj));
+
+   GValue value = G_VALUE_INIT;
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   minimum = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_minimum_value", minimum);
+   g_assert(_val_min(year_limit_min) == minimum);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   maximum = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_maximum_value", maximum);
+   g_assert(_val_max(year_limit_max) == maximum);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_current_value", current);
+   g_assert(_val_date_cmp(time(NULL), current));
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   minimum_increment = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_minimum_increment", minimum_increment);
+   g_assert(1 == minimum_increment);
+
+   memset(&val_test_set, 0, sizeof(val_test_set));
+   val_test_set.tm_year = 120;  // 120 + 1900 = 2020 years
+   val_test_set.tm_mon = 2;
+   val_test_set.tm_mday = 15;
+   val_test_set.tm_hour = 7;
+   val_test_set.tm_min = 21;
+   val_test_set.tm_sec = 33;
+
+   g_value_set_int(&value, mktime(&val_test_set));
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+   _printf_calendar_int("atk_value_set_current_value", mktime(&val_test_set));
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_current_value", current);
+   g_assert(_val_date_cmp(mktime(&val_test_set), current));
+
+   val_test_set.tm_year = 99;  // 99 + 1900 = 1999 years
+   g_value_set_int(&value, mktime(&val_test_set));
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   val_test_set.tm_year = 131;  // 131 + 1900 = 2031 years
+   g_value_set_int(&value, mktime(&val_test_set));
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_calendar(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_calendar_test.c b/eail/tests/eail_calendar_test.c
new file mode 100644 (file)
index 0000000..7c4d78f
--- /dev/null
@@ -0,0 +1,186 @@
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+static int year_limit_min = 2000;
+static int year_limit_max = 2030;
+
+static void
+_printf_calendar_int(const char *str, time_t atime)
+{
+   struct tm tmp;
+
+   localtime_r(&atime, &tmp);
+
+   _printf("[%04d-%02d-%02d] (%s)\n",
+           tmp.tm_year + 1900, tmp.tm_mon + 1, tmp.tm_mday, str);
+}
+
+static time_t
+_val_min(int year)
+{
+   struct tm minimum;
+
+   memset(&minimum, 0, sizeof(minimum));
+
+   minimum.tm_year = year - 1900;
+   minimum.tm_mon = 0;
+   minimum.tm_mday = 1;
+   minimum.tm_hour = 0;
+   minimum.tm_min = 0;
+   minimum.tm_sec = 0;
+
+   return mktime(&minimum);
+}
+
+static int
+_val_date_cmp(time_t time1, time_t time2)
+{
+   struct tm tmp1, tmp2;
+
+   localtime_r(&time1, &tmp1);
+   localtime_r(&time2, &tmp2);
+
+   if (tmp1.tm_year == tmp2.tm_year &&
+       tmp1.tm_mon == tmp2.tm_mon &&
+       tmp1.tm_mday == tmp2.tm_mday)
+     {
+        return TRUE;
+     }
+     else
+     {
+        return FALSE;
+     }
+}
+
+static time_t
+_val_max(int year)
+{
+   struct tm maximum;
+
+   memset(&maximum, 0, sizeof(maximum));
+
+   maximum.tm_year = year - 1900;
+   maximum.tm_mon = 11;
+   maximum.tm_mday = 31;
+   maximum.tm_hour = 23;
+   maximum.tm_min = 59;
+   maximum.tm_sec = 59;
+
+   return mktime(&maximum);
+}
+
+static void
+_init_calendar(Evas_Object *win)
+{
+   Evas_Object *bg, *cal;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   cal = elm_calendar_add(win);
+   elm_calendar_min_max_year_set(cal, year_limit_min, year_limit_max);
+   elm_win_resize_object_add(win, cal);
+   evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(cal);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+   int minimum, maximum, current, minimum_increment;
+   struct tm val_test_set;
+
+   _printf("type_name: %s\n", type_name ? type_name : "NULL");
+
+   g_assert_cmpstr(type_name, ==, "EailCalendar");
+
+   GValue value = G_VALUE_INIT;
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   minimum = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_minimum_value", minimum);
+   g_assert(_val_min(year_limit_min) == minimum);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   maximum = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_maximum_value", maximum);
+   g_assert(_val_max(year_limit_max) == maximum);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_current_value", current);
+   g_assert(_val_date_cmp(time(NULL), current));
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   minimum_increment = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_minimum_increment", minimum_increment);
+   g_assert(1 == minimum_increment);
+
+   memset(&val_test_set, 0, sizeof(val_test_set));
+   val_test_set.tm_year = 120;  // 120 + 1900 = 2020 years
+   val_test_set.tm_mon = 2;
+   val_test_set.tm_mday = 15;
+   val_test_set.tm_hour = 7;
+   val_test_set.tm_min = 21;
+   val_test_set.tm_sec = 33;
+
+   g_value_set_int(&value, mktime(&val_test_set));
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+   _printf_calendar_int("atk_value_set_current_value", mktime(&val_test_set));
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_int(&value);
+   _printf_calendar_int("atk_value_get_current_value", current);
+   g_assert(_val_date_cmp(mktime(&val_test_set), current));
+
+   val_test_set.tm_year = 99;  // 99 + 1900 = 1999 years
+   g_value_set_int(&value, mktime(&val_test_set));
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   val_test_set.tm_year = 131;  // 131 + 1900 = 2031 years
+   g_value_set_int(&value, mktime(&val_test_set));
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   /* calendar object to support focus */
+   eailu_test_atk_focus(obj, TRUE);
+}
+
+static void
+_on_done(void *data, Evas_Object *obj, void *event_info)
+{
+   elm_exit();
+}
+
+static void
+_on_focus_in(void *data, Evas_Object *obj, void *event_info)
+{
+   AtkObject *aobj = atk_get_root();
+   g_assert(aobj);
+
+   eailu_traverse_children_for_role_call_cb(aobj, ATK_ROLE_CALENDAR, _do_test);
+
+   _on_done(NULL, obj, NULL);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_calendar(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_check_tc1.c b/eail/tests/eail_check_tc1.c
new file mode 100644 (file)
index 0000000..3ade4f1
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailCheck
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailCheck
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+#define CHECK_TEXT1 "checkbox1"
+#define CHECK_TEXT2 "checkbox2"
+
+static int action_test_passed;
+
+INIT_TEST("EailCheck")
+
+static void
+_print(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("\tcheck %s - %smarked\n", elm_object_part_text_get(obj, "default"),
+           *((Eina_Bool*)data) ? "" : "un");
+
+   action_test_passed = 1;
+}
+
+static void
+_init_check(Evas_Object *win)
+{
+   Evas_Object *bg, *cb1;
+   Eina_Bool value1;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   cb1 = elm_check_add(win);
+   elm_object_text_set(cb1, CHECK_TEXT1);
+   elm_check_state_pointer_set(cb1, &value1);
+   elm_check_state_set(cb1, EINA_TRUE);
+   evas_object_smart_callback_add(cb1, "changed", _print, &value1);
+   evas_object_move(cb1, 10, 10);
+   evas_object_resize(cb1, 200, 30);
+   evas_object_show(cb1);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(action_test_passed);
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_check(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_check_tc2.c b/eail/tests/eail_check_tc2.c
new file mode 100644 (file)
index 0000000..20fae1d
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailCheck
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailCheck
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define CHECK_TEXT2 "checkbox2"
+
+INIT_TEST("EailCheck")
+
+static void
+_init_check(Evas_Object *win)
+{
+   Evas_Object *bg, *cb2, *icon;
+   Eina_Bool value2;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   evas_object_show(icon);
+
+   cb2 = elm_check_add(win);
+   elm_object_text_set(cb2, CHECK_TEXT2);
+   elm_check_state_pointer_set(cb2, &value2);
+   elm_check_state_set(cb2, EINA_TRUE);
+   elm_object_part_content_set(cb2, "icon", icon);
+   evas_object_move(cb2, 10, 50);
+   evas_object_resize(cb2, 200, 30);
+   evas_object_show(cb2);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *name = atk_object_get_name(ATK_OBJECT(obj));
+   const char *type_name_child;
+   AtkStateSet *state_set;
+   AtkObject *xobj;
+
+   g_assert(ATK_IS_OBJECT(obj));
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_CHECK_BOX);
+   g_assert_cmpstr(name, ==, CHECK_TEXT2);
+
+   state_set = atk_object_ref_state_set(obj);
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_CHECKED));
+   g_object_unref(state_set);
+
+   atk_object_set_name(obj, CHECK_TEXT2"test");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, CHECK_TEXT2"test");
+
+   // test children
+   g_assert(1 == atk_object_get_n_accessible_children(obj));
+
+   xobj = atk_object_ref_accessible_child(obj, 0);
+   g_assert(NULL != xobj);
+   type_name_child = g_type_name(G_TYPE_FROM_INSTANCE(xobj));
+   _printf("type_name_child: %s\n", type_name_child);
+   g_assert_cmpstr(type_name_child, ==, "EailIcon");
+   g_object_unref(xobj);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_check(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_clock_tc1.c b/eail/tests/eail_clock_tc1.c
new file mode 100644 (file)
index 0000000..24e447a
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailClock
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailClock
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailClock")
+
+static void
+_printf_clock_int(const char *str, int current_second_day)
+{
+   int hour, minute, second;
+
+   hour = current_second_day / 3600;
+   minute = (current_second_day % 3600) / 60;
+   second = current_second_day % 60;
+
+   _printf("[%02d:%02d:%02d] (%s)\n", hour, minute, second, str);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int minimum, maximum, current, minimum_increment;
+   const int lambda = 5; /*tolerance for get time in case that test will take
+   longer than expected on very slow machine*/
+   const int val_test_init = 4 * 3600 + 44 * 60 + 22; // 04:44:22
+   const int val_test_set = 12 * 3600 + 4 * 60 + 7;   // 12:04:07
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_TEXT);
+
+   GValue value = G_VALUE_INIT;
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   minimum = g_value_get_int(&value);
+   _printf_clock_int("atk_value_get_minimum_value", minimum);
+   g_assert(0 == minimum);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   maximum = g_value_get_int(&value);
+   _printf_clock_int("atk_value_get_maximum_value", maximum);
+   g_assert((24 * 3600 - 1) == maximum);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_int(&value);
+   _printf_clock_int("atk_value_get_current_value", current);
+   g_assert(abs(current - val_test_init) < lambda);
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   minimum_increment = g_value_get_int(&value);
+   _printf_clock_int("atk_value_get_minimum_increment", minimum_increment);
+   g_assert(1 == minimum_increment);
+
+   g_value_set_int(&value, val_test_set);
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+   _printf_clock_int("atk_value_set_current_value", val_test_set);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_int(&value);
+   _printf_clock_int("atk_value_get_current_value", current);
+   g_assert(abs(current - val_test_set) < lambda);
+
+   g_value_set_int(&value, 24 * 3600);
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   eailu_test_code_called = 1;
+}
+
+void
+_init_clock(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *cl;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   cl = elm_clock_add(win);
+   elm_clock_show_seconds_set(cl, EINA_TRUE);
+   elm_box_pack_end(bx, cl);
+   elm_clock_time_set(cl, 4, 44, 22);
+   evas_object_show(cl);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_clock(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_colorselector_tc1.c b/eail/tests/eail_colorselector_tc1.c
new file mode 100644 (file)
index 0000000..dcbfc55
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailColorselector
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailColorselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailColorselector")
+
+static void
+_init_colorselector(Evas_Object *obj)
+{
+   Evas_Object *bx = NULL;
+   Evas_Object *cs = NULL;
+   Evas_Object *fr = NULL;
+
+   bx = elm_box_add(obj);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(obj, bx);
+   evas_object_show(bx);
+
+   fr = elm_frame_add(obj);
+   evas_object_size_hint_weight_set(fr, 1.0, 0.5);
+   evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_text_set(fr, "Color Selector");
+   elm_box_pack_end(bx, fr);
+   evas_object_show(fr);
+
+   cs = elm_colorselector_add(obj);
+   elm_colorselector_palette_name_set(cs, "painting");
+   evas_object_size_hint_weight_set(cs, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(cs, EVAS_HINT_FILL, 0.0);
+   elm_colorselector_color_set(cs, 100, 100, 100, 133);
+   evas_object_show(cs);
+   elm_object_content_set(fr, cs);
+
+   evas_object_resize(obj, 320, 480);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_COLOR_CHOOSER);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   eailu_test_code_called = 1;
+}
+
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
+   _init_colorselector(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
diff --git a/eail/tests/eail_colorselector_tc2.c b/eail/tests/eail_colorselector_tc2.c
new file mode 100644 (file)
index 0000000..66d49c6
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailColorselector
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailColorselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailColorselector")
+
+static void
+_init_colorselector(Evas_Object *obj)
+{
+   Evas_Object *bx = NULL;
+   Evas_Object *cs = NULL;
+   Evas_Object *fr = NULL;
+
+   bx = elm_box_add(obj);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(obj, bx);
+   evas_object_show(bx);
+
+   fr = elm_frame_add(obj);
+   evas_object_size_hint_weight_set(fr, 1.0, 0.5);
+   evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_text_set(fr, "Color Selector");
+   elm_box_pack_end(bx, fr);
+   evas_object_show(fr);
+
+   cs = elm_colorselector_add(obj);
+   elm_colorselector_palette_name_set(cs, "painting");
+   evas_object_size_hint_weight_set(cs, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(cs, EVAS_HINT_FILL, 0.0);
+   elm_colorselector_color_set(cs, 100, 100, 100, 133);
+   evas_object_show(cs);
+   elm_object_content_set(fr, cs);
+
+   evas_object_resize(obj, 320, 480);
+}
+
+static void
+_get_rgba(const GValue *color, int *r, int *g, int *b, int *a)
+{
+   int col = g_value_get_int(color);
+   *a = (0xFF000000 & (guint)col) >> 24;
+   *r = (0x00FF0000 & col) >> 16;
+   *g = (0x0000FF00 & col) >> 8;
+   *b = 0x000000FF & col;
+}
+
+static void
+_set_rgba(GValue *color, int r, int g, int b, int a)
+{
+   int col = (a << 24) | (r << 16) | (g << 8) | b;
+   g_value_set_int(color, col);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   gint r = 0;
+   gint g = 0;
+   gint b = 0;
+   gint a = 0;
+   GValue value = G_VALUE_INIT;
+
+   g_assert(ATK_IS_VALUE(obj));
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   _get_rgba(&value, &r, &g, &b, &a);
+   g_assert(r == 100 && g == 100 && b == 100 && a == 133);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   _get_rgba(&value, &r, &g, &b, &a);
+   g_assert(r == 255 && g == 255 && b == 255 && a == 255);
+
+   _set_rgba(&value, 77, 88, 10, 180);
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   _get_rgba(&value, &r, &g, &b, &a);
+   g_assert(r == 77 && g == 88 && b == 10 && a == 180);
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   _get_rgba(&value, &r, &g, &b, &a);
+   g_assert(r == 0 && g == 0 && b == 0 && a == 0);
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   _get_rgba(&value, &r, &g, &b, &a);
+   g_assert(r == 1 && g == 1 && b == 1 && a == 1);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
+   _init_colorselector(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
diff --git a/eail/tests/eail_conformant_tc1.c b/eail/tests/eail_conformant_tc1.c
new file mode 100644 (file)
index 0000000..06f8f38
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailConformant
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailConformant
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailConformant")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+   AtkRole role = atk_object_get_role(obj);
+   g_assert(role == ATK_ROLE_FILLER);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 1);
+
+   for (int i = 0; i < child_count; i++)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(obj, i);
+        g_assert(ATK_IS_OBJECT(child));
+        role = atk_object_get_role(child);
+        g_assert(role == ATK_ROLE_FILLER);
+        g_object_unref(child);
+     }
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win, *bg, *conform, *btn, *bx, *en;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   elm_win_conformant_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   conform = elm_conformant_add(win);
+   elm_win_resize_object_add(win, conform);
+   evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(conform);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   btn = elm_button_add(win);
+   elm_object_text_set(btn, "Test Conformant");
+   evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
+   evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
+   elm_box_pack_end(bx, btn);
+   evas_object_show(btn);
+
+   en = elm_entry_add(win);
+   elm_entry_scrollable_set(en, EINA_TRUE);
+   elm_object_text_set(en,
+                       "This is a multi-line entry at the bottom<br>"
+                       "This can contain more than 1 line of text and be "
+                       "scrolled around to allow for entering of lots of "
+                       "content. It is also to test to see that autoscroll "
+                       "moves to the right part of a larger multi-line "
+                       "text entry that is inside of a scroller than can be "
+                       "scrolled around, thus changing the expected position "
+                       "as well as cursor changes updating auto-scroll when "
+                       "it is enabled.");
+
+   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(en);
+   elm_box_pack_end(bx, en);
+
+   btn = elm_button_add(win);
+   elm_object_text_set(btn, "Test Conformant");
+   evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
+   evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
+   elm_box_pack_end(bx, btn);
+   evas_object_show(btn);
+
+   elm_object_content_set(conform, bx);
+   evas_object_show(bx);
+
+   evas_object_resize(win, 240, 480);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_ctxpopup_tc1.c b/eail/tests/eail_ctxpopup_tc1.c
new file mode 100644 (file)
index 0000000..0237b06
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailCtxpopup
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailCtxpopup
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailCtxpopup")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_amount = 0;
+   AtkObject *nested_obj;
+   AtkStateSet *state_set = NULL;
+
+   _printf("Testing ctxpopup instance....\n");
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   child_amount = atk_object_get_n_accessible_children(obj);
+   /* we have to check if there is nested label in Notify */
+   g_assert(1 == child_amount);
+
+   /* test if ctxpopup child  is list-type*/
+   nested_obj = atk_object_ref_accessible_child(obj, 0);
+   g_assert(eailu_is_object_with_type(nested_obj, "EailList"));
+
+   /* check if atk sees proper amount of list items in ctxpopup */
+   child_amount = atk_object_get_n_accessible_children(nested_obj);
+   g_assert(6 == child_amount);
+
+   /* NOTE: in ctxpopup object focus automatically goes to nested
+    * label */
+   atk_component_grab_focus(ATK_COMPONENT(obj));
+   state_set = atk_object_ref_state_set(nested_obj);
+   /* checking if nested label is now focused... */
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_FOCUSED));
+
+   _printf("Tests passed successfully\n");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_ctxpopup_item_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("ctxpopup item selected: %s\n", elm_object_item_text_get(event_info));
+}
+
+Elm_Object_Item *item_new(Evas_Object *ctxpopup, const char * label, const char *icon)
+{
+   Evas_Object *ic = elm_icon_add(ctxpopup);
+   elm_icon_standard_set(ic, icon);
+   elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
+   return elm_ctxpopup_item_append(ctxpopup, label, ic, _ctxpopup_item_cb, NULL);
+}
+
+static void
+_init_ctxpopup(Evas_Object *win)
+{
+   Evas_Object *ctxpopup, *box;
+   Elm_Object_Item *object_it;
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   ctxpopup = elm_ctxpopup_add(win);
+   item_new(ctxpopup, "Go to home folder", "home");
+   item_new(ctxpopup, "Save file", "file");
+   item_new(ctxpopup, "Delete file", "delete");
+   object_it = item_new(ctxpopup, "Navigate to folder", "folder");
+   elm_object_item_disabled_set(object_it, EINA_TRUE);
+   item_new(ctxpopup, "Edit entry", "edit");
+   object_it = item_new(ctxpopup, "Set date and time", "clock");
+
+   evas_object_size_hint_weight_set(ctxpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(ctxpopup);
+   elm_box_pack_end(box, ctxpopup);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_ctxpopup(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_ctxpopup_tc2.c b/eail/tests/eail_ctxpopup_tc2.c
new file mode 100644 (file)
index 0000000..6827993
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailCtxpopup
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailCtxpopup
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailCtxpopup")
+
+static void
+_do_test(AtkObject *obj)
+{
+   _printf("Testing ctxpopup instance....\n");
+
+   g_assert(ATK_IS_ACTION(obj));
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+   eailu_test_action_activate(ATK_ACTION(obj), "dismiss");
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   _printf("Tests passed successfully\n");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_ctxpopup_item_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("ctxpopup item selected: %s\n", elm_object_item_text_get(event_info));
+}
+
+Elm_Object_Item *item_new(Evas_Object *ctxpopup, const char * label, const char *icon)
+{
+   Evas_Object *ic = elm_icon_add(ctxpopup);
+   elm_icon_standard_set(ic, icon);
+   elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
+   return elm_ctxpopup_item_append(ctxpopup, label, ic, _ctxpopup_item_cb, NULL);
+}
+
+static void
+_init_ctxpopup(Evas_Object *win)
+{
+   Evas_Object *ctxpopup, *box;
+   Elm_Object_Item *object_it;
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   ctxpopup = elm_ctxpopup_add(win);
+   item_new(ctxpopup, "Go to home folder", "home");
+   item_new(ctxpopup, "Save file", "file");
+   item_new(ctxpopup, "Delete file", "delete");
+   object_it = item_new(ctxpopup, "Navigate to folder", "folder");
+   elm_object_item_disabled_set(object_it, EINA_TRUE);
+   item_new(ctxpopup, "Edit entry", "edit");
+   object_it = item_new(ctxpopup, "Set date and time", "clock");
+
+   evas_object_size_hint_weight_set(ctxpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(ctxpopup);
+   elm_box_pack_end(box, ctxpopup);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_ctxpopup(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_datetime_tc1.c b/eail/tests/eail_datetime_tc1.c
new file mode 100644 (file)
index 0000000..97a7d11
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailDatetime
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailDatetime
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+static time_t time_min, time_max, time_current;
+
+INIT_TEST("EailDatetime")
+
+static void
+_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("action: changed\n");
+}
+
+static void
+_printf_datetime_int(time_t atime, const char *str)
+{
+   struct tm tmp;
+
+   localtime_r(&atime, &tmp);
+
+   _printf("[%04d-%02d-%02d] [%02d:%02d:%02d] (%s)\n",
+           tmp.tm_year + 1900, tmp.tm_mon + 1, tmp.tm_mday,
+           tmp.tm_hour, tmp.tm_min, tmp.tm_sec, str);
+}
+
+static void
+_init_datetime(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *dt;
+   struct tm tmp;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   elm_box_horizontal_set(bx, EINA_FALSE);
+   evas_object_show(bx);
+
+   dt = elm_datetime_add(bx);
+   evas_object_size_hint_weight_set(dt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(dt, EVAS_HINT_FILL, 0.5);
+   evas_object_smart_callback_add(dt, "changed", _changed_cb, NULL);
+
+   time_min = time(NULL) - 3600;
+   localtime_r(&time_min, &tmp);
+   elm_datetime_value_min_set(dt, &tmp);
+   _printf_datetime_int(time_min, "time_min");
+
+   time_max = time(NULL) + 3600;
+   localtime_r(&time_max, &tmp);
+   elm_datetime_value_max_set(dt, &tmp);
+   _printf_datetime_int(time_max, "time_max");
+
+   time_current = time(NULL);
+   localtime_r(&time_current, &tmp);
+   elm_datetime_value_set(dt, &tmp);
+   _printf_datetime_int(time_current, "time_current");
+
+   elm_box_pack_end(bx, dt);
+   evas_object_show(dt);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_DATE_EDITOR);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
+   g_assert(win);
+   _init_datetime(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_datetime_tc2.c b/eail/tests/eail_datetime_tc2.c
new file mode 100644 (file)
index 0000000..9462f66
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailDatetime
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailDatetime
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+static time_t time_min, time_max, time_current;
+
+INIT_TEST("EailDatetime")
+
+static void
+_init_datetime(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *dt;
+   struct tm tmp;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   elm_box_horizontal_set(bx, EINA_FALSE);
+   evas_object_show(bx);
+
+   dt = elm_datetime_add(bx);
+   evas_object_size_hint_weight_set(dt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(dt, EVAS_HINT_FILL, 0.5);
+
+   time_min = time(NULL) - 3600;
+   localtime_r(&time_min, &tmp);
+   elm_datetime_value_min_set(dt, &tmp);
+
+   time_max = time(NULL) + 3600;
+   localtime_r(&time_max, &tmp);
+   elm_datetime_value_max_set(dt, &tmp);
+
+   time_current = time(NULL);
+   localtime_r(&time_current, &tmp);
+   elm_datetime_value_set(dt, &tmp);
+
+   elm_box_pack_end(bx, dt);
+   evas_object_show(dt);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   time_t time_set;
+
+   g_assert(ATK_IS_VALUE(obj));
+
+   GValue value = G_VALUE_INIT;
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   g_assert(g_value_get_int(&value) == time_min);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   g_assert(g_value_get_int(&value) == time_max);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   g_assert(g_value_get_int(&value) == time_current);
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   g_assert(g_value_get_int(&value) == 1);
+
+   time_set = time_current + 60;
+
+   g_value_set_int(&value, time_set);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   g_assert(g_value_get_int(&value) != time_set);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_datetime(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_dayselector_tc1.c b/eail/tests/eail_dayselector_tc1.c
new file mode 100644 (file)
index 0000000..02f2467
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailDayselector
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailDayselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_DAY_SELECTOR "EailDayselector"
+#define EAIL_TYPE_FOR_CHECK "EailCheck"
+
+INIT_TEST("EailDayselector")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+   int i;
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   child_count =  atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 7);
+
+   /* all fields have to be CHECK type*/
+   for (i = 0; i < child_count; i++)
+    {
+       AtkObject *child = atk_object_ref_accessible_child(obj, i);
+       g_assert(ATK_IS_OBJECT(child));
+       g_assert(eailu_is_object_with_type(child, EAIL_TYPE_FOR_CHECK));
+
+       g_object_unref(child);
+     }
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_dayselector(Evas_Object *win)
+{
+   Evas_Object *dayselector, *box;
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   dayselector = elm_dayselector_add(win);
+   evas_object_size_hint_weight_set(dayselector, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(dayselector, EVAS_HINT_FILL, 0.5);
+
+   elm_box_pack_end(box, dayselector);
+   evas_object_show(dayselector);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_dayselector(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_diskselector_tc1.c b/eail/tests/eail_diskselector_tc1.c
new file mode 100644 (file)
index 0000000..e9ae730
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailDiskselector
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailDiskselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailDiskselector")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(7 == child_count);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_LIST);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_diskselector(Evas_Object *win)
+{
+   Evas_Object  *bx, *ds, *bg;
+   unsigned int i;
+   static const char *lbl[] =
+     {
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+     };
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   /* default */
+   ds = elm_diskselector_add(win);
+   evas_object_size_hint_weight_set(ds, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(ds, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   elm_box_pack_end(bx, ds);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
+   evas_object_show(ds);
+   evas_object_resize(win, 800, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_diskselector(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_diskselector_tc2.c b/eail/tests/eail_diskselector_tc2.c
new file mode 100644 (file)
index 0000000..73d84ad
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailDiskselector
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailDiskselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailDiskselector")
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_left");
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_right");
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_up");
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_down");
+   eailu_test_action_activate(ATK_ACTION(obj), "next");
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), 1));
+   eailu_test_action_activate(ATK_ACTION(obj), "next");
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), 2));
+   eailu_test_action_activate(ATK_ACTION(obj), "next");
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), 3));
+   eailu_test_action_activate(ATK_ACTION(obj), "previous");
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), 2));
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_diskselector(Evas_Object *win)
+{
+   Evas_Object  *bx, *ds, *bg;
+   unsigned int i;
+   static const char *lbl[] =
+     {
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+     };
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   /* default */
+   ds = elm_diskselector_add(win);
+   evas_object_size_hint_weight_set(ds, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(ds, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   elm_box_pack_end(bx, ds);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
+   evas_object_show(ds);
+   evas_object_resize(win, 800, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_diskselector(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_diskselector_tc3.c b/eail/tests/eail_diskselector_tc3.c
new file mode 100644 (file)
index 0000000..a96a834
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Tested interface: AtkSelection
+ *
+ * Tested AtkObject: EailDiskselector
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailDiskselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailDiskselector")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int i = 0;
+
+   g_assert(ATK_IS_SELECTION(obj));
+
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), 0));
+
+   for (i = 1; i < 7; ++i)
+      g_assert(FALSE == atk_selection_is_child_selected(ATK_SELECTION(obj), i));
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_diskselector(Evas_Object *win)
+{
+   Evas_Object  *bx, *ds, *bg;
+   unsigned int i;
+   static const char *lbl[] =
+     {
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+     };
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   /* default */
+   ds = elm_diskselector_add(win);
+   evas_object_size_hint_weight_set(ds, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(ds, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   elm_box_pack_end(bx, ds);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
+   evas_object_show(ds);
+   evas_object_resize(win, 800, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_diskselector(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_entry_tc1.c b/eail/tests/eail_entry_tc1.c
new file mode 100644 (file)
index 0000000..5fbf70a
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailEntry
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailEntry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailEntry")
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkRole role;
+   AtkStateSet *state_set;
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert_cmpstr(type_name, ==, "EailEntry");
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   role = atk_object_get_role(obj);
+   g_assert(role == ATK_ROLE_ENTRY);
+   state_set = atk_object_ref_state_set(obj);
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_MULTI_LINE));
+   g_object_unref(state_set);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_entry(Evas_Object *win)
+{
+   Evas_Object *box, *tb, *bg, *en;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   tb = elm_box_add(win);
+   elm_box_horizontal_set(tb, EINA_TRUE);
+   evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_weight_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, tb);
+   evas_object_show(tb);
+
+   en = elm_entry_add(win);
+   elm_entry_line_wrap_set(en, ELM_WRAP_WORD);
+   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, en);
+   evas_object_show(en);
+
+   evas_object_resize(win, 200, 300);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char *argv[])
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_entry(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_entry_tc2.c b/eail/tests/eail_entry_tc2.c
new file mode 100644 (file)
index 0000000..aca31ec
--- /dev/null
@@ -0,0 +1,250 @@
+/*
+ * Tested interface: AtkText
+ *
+ * Tested AtkObject: EailEntry
+ *
+ * Description: Test AtkText interface
+ *
+ * Test input: accessible object representing EailEntry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define TEXT_LEN 475
+
+INIT_TEST("EailEntry")
+
+static void
+_do_test(AtkObject *obj)
+{
+   gchar *text;
+   int start_offset, end_offset;
+   AtkAttributeSet *elem = NULL, *at_set = NULL;
+   AtkAttribute *attr = NULL;
+   gboolean wrap_exist = FALSE, editable_exist = FALSE;
+
+   g_assert(ATK_IS_TEXT(obj));
+
+   text = atk_text_get_text(ATK_TEXT(obj), 6, 11);
+   g_assert_cmpstr(text, ==, "ipsum");
+   g_free(text);
+
+   g_assert(atk_text_get_character_at_offset(ATK_TEXT(obj), 12) == 'd');
+   g_assert(atk_text_get_character_count(ATK_TEXT(obj)) == TEXT_LEN);
+   g_assert(atk_text_set_caret_offset(ATK_TEXT(obj), 13));
+   g_assert(atk_text_get_caret_offset(ATK_TEXT(obj)) == 13);
+
+   start_offset = 0;
+   end_offset = 5;
+   g_assert(atk_text_get_n_selections(ATK_TEXT(obj)) == 0);
+   g_assert(atk_text_set_selection(ATK_TEXT(obj), 0, start_offset, end_offset));
+   text = atk_text_get_selection(ATK_TEXT(obj), 0, &start_offset,  &end_offset);
+   g_assert_cmpstr(text, ==, "Lorem");
+   g_assert(start_offset == 0);
+   g_assert(end_offset == 5);
+
+   g_assert(atk_text_get_n_selections(ATK_TEXT(obj)) == 1);
+   g_assert(atk_text_remove_selection(ATK_TEXT(obj), 0) == TRUE);
+   g_assert(atk_text_get_n_selections(ATK_TEXT(obj)) == 0);
+   g_assert(atk_text_add_selection(ATK_TEXT(obj), start_offset, end_offset));
+   g_assert(atk_text_get_n_selections(ATK_TEXT(obj)) == 1);
+   g_free(text);
+
+   at_set = atk_text_get_run_attributes
+       (ATK_TEXT(obj), 0, &start_offset, &end_offset);
+   g_assert(at_set);
+
+   for (elem = at_set; elem; elem = elem->next)
+     {
+        attr = (AtkAttribute *)elem->data;
+        if (0 == g_strcmp0(attr->name, atk_text_attribute_get_name
+                           (ATK_TEXT_ATTR_WRAP_MODE)))
+          wrap_exist = TRUE;
+        else if (0 == g_strcmp0(attr->name, atk_text_attribute_get_name
+                                (ATK_TEXT_ATTR_EDITABLE)))
+          editable_exist = TRUE;
+     }
+
+   g_assert(0 == start_offset);
+   g_assert(atk_text_get_character_count(ATK_TEXT(obj)) == end_offset);
+
+   g_assert(wrap_exist);
+   g_assert(editable_exist);
+
+   /* out of bounds offset in run attributes test*/
+   at_set = atk_text_get_run_attributes
+       (ATK_TEXT(obj), atk_text_get_character_count
+        (ATK_TEXT(obj)), &start_offset, &end_offset);
+   g_assert(NULL == at_set);
+   g_assert(-1 == start_offset);
+   g_assert(-1 == end_offset);
+
+   text = atk_text_get_text_at_offset(ATK_TEXT(obj), 6,
+                                      ATK_TEXT_BOUNDARY_CHAR,
+                                      &start_offset,
+                                      &end_offset);
+   g_assert_cmpstr(text, ==, "i");
+   g_free(text);
+   g_assert(start_offset == 6);
+   g_assert(end_offset == 7);
+
+   text = atk_text_get_text_at_offset(ATK_TEXT(obj), 2,
+                                      ATK_TEXT_BOUNDARY_WORD_START,
+                                      &start_offset,
+                                      &end_offset);
+   g_assert_cmpstr(text, ==, "Lorem ");
+   g_free(text);
+
+   text = atk_text_get_text_at_offset(ATK_TEXT(obj), 11,
+                                      ATK_TEXT_BOUNDARY_WORD_START,
+                                      &start_offset,
+                                      &end_offset);
+   g_assert_cmpstr(text, ==, "ipsum ");
+   g_free(text);
+
+   text = atk_text_get_text_at_offset(ATK_TEXT(obj), 11,
+                                      ATK_TEXT_BOUNDARY_WORD_END,
+                                      &start_offset,
+                                      &end_offset);
+   g_assert_cmpstr(text, ==, " dolor");
+   g_free(text);
+
+   text = atk_text_get_text_at_offset(ATK_TEXT(obj), 10,
+                                      ATK_TEXT_BOUNDARY_WORD_END,
+                                      &start_offset,
+                                      &end_offset);
+   g_assert_cmpstr(text, ==, " ipsum");
+   g_free(text);
+
+   text = atk_text_get_text_after_offset(ATK_TEXT(obj), 6,
+                                         ATK_TEXT_BOUNDARY_CHAR,
+                                         &start_offset,
+                                         &end_offset);
+   g_assert_cmpstr(text, ==, "p");
+   g_free(text);
+   g_assert(start_offset == 7);
+   g_assert(end_offset == 8);
+
+   text = atk_text_get_text_after_offset(ATK_TEXT(obj), 12,
+                                         ATK_TEXT_BOUNDARY_WORD_START,
+                                         &start_offset,
+                                         &end_offset);
+   g_assert_cmpstr(text, ==, "sit ");
+   g_free(text);
+
+   text = atk_text_get_text_after_offset(ATK_TEXT(obj), 10,
+                                         ATK_TEXT_BOUNDARY_WORD_END,
+                                         &start_offset,
+                                         &end_offset);
+   g_assert_cmpstr(text, ==, " dolor");
+   g_free(text);
+
+   text = atk_text_get_text_before_offset(ATK_TEXT(obj), 5,
+                                         ATK_TEXT_BOUNDARY_CHAR,
+                                         &start_offset,
+                                         &end_offset);
+   g_assert_cmpstr(text, ==, "m");
+   g_free(text);
+   g_assert(start_offset == 4);
+   g_assert(end_offset == 5);
+
+   text = atk_text_get_text_at_offset(ATK_TEXT(obj), 12,
+                                         ATK_TEXT_BOUNDARY_LINE_START,
+                                         &start_offset,
+                                         &end_offset);
+   g_assert_cmpstr(text, ==,
+                   "Lorem ipsum dolor sit amet, consectetur adipisicing elit,\n");
+   g_free(text);
+
+   text = atk_text_get_text_at_offset(ATK_TEXT(obj), 129,
+                                         ATK_TEXT_BOUNDARY_LINE_END,
+                                         &start_offset,
+                                         &end_offset);
+   g_assert_cmpstr(
+       text, ==, "Ut enim ad minim veniam, quis nostrud exercitation ullamc");
+   g_free(text);
+
+   text = atk_text_get_text_after_offset(ATK_TEXT(obj), 2,
+                                      ATK_TEXT_BOUNDARY_LINE_START,
+                                      &start_offset,
+                                      &end_offset);
+   g_assert_cmpstr(
+       text, ==,
+       "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n");
+   g_free(text);
+
+   text = atk_text_get_text_after_offset(ATK_TEXT(obj), 70,
+                                         ATK_TEXT_BOUNDARY_LINE_END,
+                                         &start_offset,
+                                         &end_offset);
+   g_assert_cmpstr(
+       text, ==,
+       "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n");
+   g_free(text);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_entry(Evas_Object *win)
+{
+   Evas_Object *box, *tb, *bg, *en;
+   const char *text1 = "Lorem ipsum dolor sit amet, consectetur adipisicing elit,<br>"
+       "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br>"
+       "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris<br>"
+       "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in<br>"
+       "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla<br>"
+       "pariatur. Excepteur sint occaecat cupidatat non proident, sunt<br>"
+       "in culpa qui officia deserunt mollit anim id est laborum.<br>";
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   tb = elm_box_add(win);
+   elm_box_horizontal_set(tb, EINA_TRUE);
+   evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_weight_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, tb);
+   evas_object_show(tb);
+
+   en = elm_entry_add(win);
+   elm_entry_autosave_set(en, EINA_FALSE);
+   elm_entry_line_wrap_set(en, ELM_WRAP_NONE);
+   elm_entry_entry_set(en, text1);
+   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, en);
+   evas_object_show(en);
+
+   evas_object_resize(win, 200, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char *argv[])
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_entry(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_entry_tc3.c b/eail/tests/eail_entry_tc3.c
new file mode 100644 (file)
index 0000000..b4845f8
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * Tested interface: AtkEditableText
+ *
+ * Tested AtkObject: EailEntry
+ *
+ * Description: Test AtkEditableText interface
+ *
+ * Test input: accessible object representing EailEntry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ENTRY_TEXT "Trololo lololololo olololo"
+#define ENTRY_FIRST "first"
+#define ENTRY_SECOND "second"
+
+INIT_TEST("EailEntry")
+
+void
+_test_state(AtkObject *obj, AtkStateType state_type)
+{
+   AtkStateSet *state_set;
+
+   state_set = atk_object_ref_state_set(obj);
+   g_assert(atk_state_set_contains_state(state_set, state_type));
+   g_object_unref(state_set);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   gchar *text;
+   int start_offset, end_offset;
+
+   g_assert(ATK_IS_EDITABLE_TEXT(obj));
+
+   text = atk_text_get_text(ATK_TEXT(obj), 0, -1);
+   if (!g_strcmp0(text, ENTRY_FIRST))
+     {
+        g_free(text);
+
+        text = g_strdup(ENTRY_TEXT);
+        atk_editable_text_set_text_contents(ATK_EDITABLE_TEXT(obj), text);
+        g_free(text);
+
+        start_offset = 0;
+        end_offset = -1;
+        text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+        g_assert_cmpstr(text, ==, ENTRY_TEXT);
+        g_free(text);
+
+        start_offset = 0;
+        end_offset = 7;
+        atk_editable_text_delete_text(ATK_EDITABLE_TEXT(obj), start_offset, end_offset);
+        text = atk_text_get_text(ATK_TEXT(obj), 0, -1);
+        g_assert_cmpstr(text, ==, " lololololo olololo");
+        g_free(text);
+
+        atk_editable_text_insert_text(ATK_EDITABLE_TEXT(obj), "Trololo", 7,
+                                      &start_offset);
+        text = atk_text_get_text(ATK_TEXT(obj), 0, -1);
+        g_assert(start_offset == 7);
+        g_assert_cmpstr(text, ==, ENTRY_TEXT);
+        g_free(text);
+
+        start_offset = 8;
+        end_offset = 18;
+        atk_editable_text_copy_text(ATK_EDITABLE_TEXT(obj), start_offset, end_offset);
+        atk_editable_text_set_text_contents(ATK_EDITABLE_TEXT(obj), "123");
+        atk_editable_text_paste_text(ATK_EDITABLE_TEXT(obj), 3);
+
+        start_offset = 0;
+        end_offset = -1;
+        text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+        g_assert_cmpstr(text, ==, "123lololololo");
+        g_free(text);
+
+        start_offset = 0;
+        end_offset = 3;
+        atk_editable_text_cut_text(ATK_EDITABLE_TEXT(obj), start_offset, end_offset);
+        text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+        g_assert_cmpstr(text, ==, "lol");
+        g_free(text);
+
+        start_offset = 0;
+        end_offset = -1;
+        atk_editable_text_paste_text(ATK_EDITABLE_TEXT(obj), 3);
+        text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+        g_assert_cmpstr(text, ==, "lol123olololo");
+        g_free(text);
+
+        atk_editable_text_cut_text(ATK_EDITABLE_TEXT(obj), 3, 6);
+        text = atk_text_get_text(ATK_TEXT(obj), 0, -1);
+        g_assert_cmpstr(text, ==, "lololololo");
+        g_free(text);
+     }
+   else if (!g_strcmp0(text, ENTRY_SECOND))
+     {
+        g_free(text);
+        atk_editable_text_paste_text(ATK_EDITABLE_TEXT(obj), 0);
+        text = atk_text_get_text(ATK_TEXT(obj), 0, -1);
+        g_assert_cmpstr(text, ==, "123second");
+        g_free(text);
+
+        eailu_test_code_called = 1;
+     }
+}
+
+static void
+_init_entry(Evas_Object *win)
+{
+   Evas_Object *box, *tb, *bg, *en, *en2;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   tb = elm_box_add(win);
+   elm_box_horizontal_set(tb, EINA_TRUE);
+   evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_weight_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, tb);
+   evas_object_show(tb);
+
+   en = elm_entry_add(win);
+   elm_entry_autosave_set(en, EINA_FALSE);
+   elm_entry_line_wrap_set(en, ELM_WRAP_WORD);
+   elm_entry_entry_set(en, ENTRY_FIRST);
+   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, en);
+   evas_object_show(en);
+
+   en2 = elm_entry_add(win);
+   elm_entry_autosave_set(en2, EINA_FALSE);
+   elm_entry_line_wrap_set(en2, ELM_WRAP_WORD);
+   elm_entry_entry_set(en2, ENTRY_SECOND);
+   evas_object_size_hint_weight_set(en2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(en2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, en2);
+   evas_object_show(en2);
+
+   evas_object_resize(win, 200, 300);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char *argv[])
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_entry(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_file_selector_button_tc1.c b/eail/tests/eail_file_selector_button_tc1.c
new file mode 100644 (file)
index 0000000..b75b9c8
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailFileselector
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailFileselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 3
+#define EAIL_LABEL_FOR_FSB "File selector button"
+
+static int action_test_passed;
+
+INIT_TEST("EailButton")
+
+static void
+_on_click(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("fileselector button click\n");
+   action_test_passed++;
+}
+
+static void
+_on_press(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("fileselector button press\n");
+   action_test_passed++;
+}
+
+static void
+_on_release(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("fileselector button release\n");
+   action_test_passed++;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   _printf("Testing FileSelectorButton instance....\n");
+
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+   eailu_test_action_activate(ATK_ACTION(obj), "press");
+   eailu_test_action_activate(ATK_ACTION(obj), "release");
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   _printf("DONE. All FileSelectorButton test passed successfully \n");
+
+   g_assert(action_test_passed == 3);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_file_selector_button(Evas_Object *win)
+{
+   Evas_Object *fs_button, *vbox, *icon;
+
+   vbox = elm_box_add(win);
+   elm_win_resize_object_add(win, vbox);
+   evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(vbox);
+
+   icon = elm_icon_add(win);
+   elm_icon_standard_set(icon, "file");
+   evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+   /* file selector button */
+   fs_button = elm_fileselector_button_add(win);
+   elm_fileselector_button_path_set(fs_button, "/tmp");
+   elm_object_text_set(fs_button, EAIL_LABEL_FOR_FSB);
+   elm_object_part_content_set(fs_button, "icon", icon);
+   evas_object_smart_callback_add(fs_button, "clicked", _on_click, NULL);
+   evas_object_smart_callback_add(fs_button, "pressed", _on_press, NULL);
+   evas_object_smart_callback_add(fs_button, "unpressed", _on_release, NULL);
+
+   elm_box_pack_end(vbox, fs_button);
+   evas_object_show(fs_button);
+   evas_object_resize(win, 300, 300);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_file_selector_button(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_file_selector_entry_tc1.c b/eail/tests/eail_file_selector_entry_tc1.c
new file mode 100644 (file)
index 0000000..abf8a9b
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailFileselectorEntry
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailFileselectorEntry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define EAIL_LABEL_FOR_FSE "Select a file"
+
+INIT_TEST("EailFileselectorEntry")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int actions_num = -1;
+
+   _printf("Testing FileselectorEntry instance....\n");
+
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(ATK_IS_ACTION(obj));
+
+   actions_num = atk_action_get_n_actions(ATK_ACTION(obj) );
+   g_assert(4 == actions_num);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   /* checking if all needed actions are implemented */
+   /* pressed */
+   eailu_test_action_activate(ATK_ACTION(obj), "press");
+
+   /* repeated */
+   eailu_test_action_activate(ATK_ACTION(obj), "longpress");
+
+   /* unpressed */
+   eailu_test_action_activate(ATK_ACTION(obj), "release");
+
+   /* clicked */
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   /* test for non-existing action */
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   /* test set/get action description */
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   _printf("DONE. All FileselectorEntry test passed successfully \n");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_file_selector_button(Evas_Object *win)
+{
+   Evas_Object *fs_entry, *vbox, *icon;
+
+   vbox = elm_box_add(win);
+   elm_win_resize_object_add(win, vbox);
+   evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(vbox);
+
+   icon = elm_icon_add(win);
+   elm_icon_standard_set(icon, "file");
+   evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+   /* file selector entry */
+   fs_entry = elm_fileselector_entry_add(win);
+   evas_object_size_hint_align_set(fs_entry, EVAS_HINT_FILL, 0);
+   elm_fileselector_entry_path_set(fs_entry, "/tmp");
+   elm_object_text_set(fs_entry, EAIL_LABEL_FOR_FSE);
+   elm_object_part_content_set(fs_entry, "button icon", icon);
+
+   elm_box_pack_end(vbox, fs_entry);
+   evas_object_show(fs_entry);
+   evas_object_resize(win, 300, 300);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_file_selector_button(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_fileselector_tc1.c b/eail/tests/eail_fileselector_tc1.c
new file mode 100644 (file)
index 0000000..b13d61a
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailFileselector
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailFileselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define FILESELECTOR_NAME "fileselector name"
+
+INIT_TEST("EailFileselector")
+
+static void
+_test_atk_focus(AtkObject *obj)
+{
+   AtkStateSet *state_set = NULL;
+   state_set = atk_object_ref_state_set(obj);
+
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_FOCUSABLE));
+   /* in fileselector focus always gets to one of internal children after
+    * marking as focused*/
+   g_assert(atk_component_grab_focus(ATK_COMPONENT(obj)));
+   g_assert(!atk_state_set_contains_state(state_set, ATK_STATE_FOCUSED));
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_amount = 0;
+
+   g_assert(ATK_IS_OBJECT(obj));
+
+   atk_object_set_name(obj, FILESELECTOR_NAME"test");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, FILESELECTOR_NAME"test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(eailu_is_object_with_role(obj, ATK_ROLE_FILE_CHOOSER));
+   child_amount = atk_object_get_n_accessible_children(obj);
+
+   /*
+    * up button, home button, list, ok button, cancel button, entry and list -
+    * overall 7 child objects
+    */
+   g_assert(7 == child_amount);
+
+   _test_atk_focus(obj);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_fileselector(Evas_Object *win)
+{
+   Evas_Object *fileselector, *box;
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   fileselector = elm_fileselector_add(win);
+   elm_fileselector_path_set(fileselector, "/tmp");
+   elm_fileselector_expandable_set(fileselector, EINA_FALSE);
+
+   evas_object_size_hint_weight_set(fileselector, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(fileselector, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(fileselector);
+
+   elm_box_pack_end(box, fileselector);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_fileselector(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_flip_tc1.c b/eail/tests/eail_flip_tc1.c
new file mode 100644 (file)
index 0000000..86812e5
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailFlip
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailFlip
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailFlip")
+
+static void
+_init_flip(Evas_Object *win)
+{
+   Evas_Object *bg, *image, *icon, *flip;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   image = elm_image_add(win);
+   g_assert(elm_image_file_set(image, "./data/07.jpg", NULL));
+   evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, image);
+   evas_object_show(image);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   elm_win_resize_object_add(win, icon);
+   evas_object_show(icon);
+
+   flip = elm_flip_add(win);
+   elm_object_part_content_set(flip, "front", image);
+   elm_object_part_content_set(flip, "back", icon);
+   evas_object_show(flip);
+
+   elm_flip_interaction_set(flip, ELM_FLIP_INTERACTION_PAGE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_UP, EINA_TRUE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_DOWN, EINA_TRUE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_LEFT, EINA_TRUE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_RIGHT, EINA_TRUE);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_UP, 1);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_DOWN, 1);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_LEFT, 1);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_RIGHT, 1);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name_child;
+   AtkObject *xobj;
+   static int count = 0;
+
+   g_assert(ATK_IS_OBJECT(obj));
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_PAGE_TAB_LIST);
+
+   g_assert(1 == atk_object_get_n_accessible_children(obj));
+
+   xobj = atk_object_ref_accessible_child(obj, 0);
+   g_assert(NULL != xobj);
+   type_name_child = g_type_name(G_TYPE_FROM_INSTANCE(xobj));
+
+   if (count % 2)
+     g_assert_cmpstr(type_name_child, ==, "EailIcon");
+   else
+     g_assert_cmpstr(type_name_child, ==, "EailImage");
+
+   count++;
+
+   /* flip object does not support focus */
+   eailu_test_atk_focus(obj, FALSE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_flip(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_flip_tc2.c b/eail/tests/eail_flip_tc2.c
new file mode 100644 (file)
index 0000000..151f3f0
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailFlip
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailFlip
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailFlip")
+
+static void
+_init_flip(Evas_Object *win)
+{
+   Evas_Object *bg, *image, *icon, *flip;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   image = elm_image_add(win);
+   g_assert(elm_image_file_set(image, "./data/07.jpg", NULL));
+   evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, image);
+   evas_object_show(image);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   elm_win_resize_object_add(win, icon);
+   evas_object_show(icon);
+
+   flip = elm_flip_add(win);
+   elm_object_part_content_set(flip, "front", image);
+   elm_object_part_content_set(flip, "back", icon);
+   evas_object_show(flip);
+
+   elm_flip_interaction_set(flip, ELM_FLIP_INTERACTION_PAGE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_UP, EINA_TRUE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_DOWN, EINA_TRUE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_LEFT, EINA_TRUE);
+   elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_RIGHT, EINA_TRUE);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_UP, 1);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_DOWN, 1);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_LEFT, 1);
+   elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_RIGHT, 1);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "flip");
+
+   g_assert(-1 == (eailu_get_action_number(ATK_ACTION(obj), "typo")));
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_flip(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_flipselector_tc1.c b/eail/tests/eail_flipselector_tc1.c
new file mode 100644 (file)
index 0000000..11f4dab
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailFlipselector
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailFlipselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+
+#include "atk/atk.h"
+#include "eail_test_utils.h"
+
+#define ITEMS_COUNT 8
+
+INIT_TEST("EailFlipselector")
+
+void
+_init_flipselector(Evas_Object *win)
+{
+   unsigned int i;
+   Evas_Object *bg, *bx, *fp;
+   static const char *lbl[] =
+     {
+        "Elementary",
+        "Evas",
+        "Eina",
+        "Edje",
+        "Eet",
+        "Ecore",
+        "Efreet",
+        "Edbus"
+     };
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   fp = elm_flipselector_add(win);
+   evas_object_size_hint_weight_set(fp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_flipselector_item_append(fp, lbl[i], NULL, NULL);
+
+   elm_box_pack_end(bx, fp);
+   evas_object_show(fp);
+}
+
+void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_n_accessible_children(obj) == ITEMS_COUNT);
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_LIST);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_flipselector(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
diff --git a/eail/tests/eail_flipselector_tc2.c b/eail/tests/eail_flipselector_tc2.c
new file mode 100644 (file)
index 0000000..d546717
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Tested interface: AtkSelection
+ *
+ * Tested AtkObject: EailFlipselector
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailFlipselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+
+#include <Elementary.h>
+
+#include "atk/atk.h"
+#include "eail_test_utils.h"
+
+#define ITEM_SEL_EINA 2
+#define ITEM_SEL_EDJE 3
+#define ITEM_SEL_ELM 0
+#define MAX_SELECTIONS 1
+
+INIT_TEST("EailFlipselector")
+
+void
+_init_flipselector(Evas_Object *win)
+{
+   unsigned int i;
+   Evas_Object *bg, *bx, *fp;
+   static const char *lbl[] =
+     {
+        "Elementary",
+        "Evas",
+        "Eina",
+        "Edje",
+        "Eet",
+        "Ecore",
+        "Efreet",
+        "Edbus"
+     };
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   fp = elm_flipselector_add(win);
+   evas_object_size_hint_weight_set(fp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_flipselector_item_append(fp, lbl[i], NULL, NULL);
+
+   elm_box_pack_end(bx, fp);
+   evas_object_show(fp);
+}
+
+void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_SELECTION(obj));
+
+   g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
+
+   g_assert(atk_selection_clear_selection(ATK_SELECTION(obj)) == FALSE);
+
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
+
+   g_assert(atk_selection_get_selection_count(ATK_SELECTION(obj)) == MAX_SELECTIONS);
+
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
+
+   g_assert(atk_selection_remove_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_ELM));
+
+   g_assert(atk_selection_select_all_selection(ATK_SELECTION(obj)) == FALSE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_flipselector(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
diff --git a/eail/tests/eail_flipselector_tc3.c b/eail/tests/eail_flipselector_tc3.c
new file mode 100644 (file)
index 0000000..4667f44
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailFlipselector
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailFlipselector
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+
+#include "atk/atk.h"
+#include "eail_test_utils.h"
+
+#define ITEM_SEL_EINA 2
+#define ITEM_SEL_EDJE 3
+#define ITEM_SEL_ELM 0
+#define ACTIONS_COUNT 2
+
+INIT_TEST("EailFlipselector")
+
+void
+_init_flipselector(Evas_Object *win)
+{
+   unsigned int i;
+   Evas_Object *bg, *bx, *fp;
+   static const char *lbl[] =
+     {
+        "Elementary",
+        "Evas",
+        "Eina",
+        "Edje",
+        "Eet",
+        "Ecore",
+        "Efreet",
+        "Edbus"
+     };
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   fp = elm_flipselector_add(win);
+   evas_object_size_hint_weight_set(fp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_flipselector_item_append(fp, lbl[i], NULL, NULL);
+
+   elm_box_pack_end(bx, fp);
+   evas_object_show(fp);
+}
+
+void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == ACTIONS_COUNT);
+
+   g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
+   eailu_test_action_activate(ATK_ACTION(obj), "next");
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EDJE));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "previous");
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_flipselector(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
+
diff --git a/eail/tests/eail_focus_test.c b/eail/tests/eail_focus_test.c
new file mode 100644 (file)
index 0000000..edca8ae
--- /dev/null
@@ -0,0 +1,89 @@
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define EAIL_TEST_ENTRY_NAME "entry text"
+
+/* used to determine if test code has been successfully called
+ * (sometimes may happen that ATK object to test in hierarchy cannot be found)*/
+static gboolean eail_test_code_called = FALSE;
+
+static void
+_on_done(void *data, Evas_Object *obj, void *event_info)
+{
+   elm_exit();
+}
+
+static void
+_test_focus_on_entry(AtkObject *obj)
+{
+   AtkObject *focused_obj = NULL;
+   gboolean success = FALSE;
+
+   _printf("Testing focus....\n");
+
+   /* changing focus */
+   g_assert(ATK_IS_COMPONENT(obj));
+   success = atk_component_grab_focus(ATK_COMPONENT(obj));
+   g_assert(success);
+
+   /* now focus should point to our button*/
+   focused_obj = atk_get_focus_object();
+   g_assert(focused_obj);
+
+   g_assert(focused_obj == obj);
+
+   _printf("DONE. All focus test passed successfully \n");
+   eail_test_code_called = TRUE;
+}
+
+static void
+_on_focus_in(void *data, Evas_Object *obj, void *event_info)
+{
+   AtkObject *aobj = atk_get_root();
+   g_assert(aobj);
+
+   eailu_traverse_children_for_type_call_cb
+                                 (aobj, "EailEntry", _test_focus_on_entry);
+
+   g_assert(eail_test_code_called);
+   elm_exit();
+}
+
+static void
+_initialize_and_show_buttons(Evas_Object *win)
+{
+   Evas_Object *bg  = NULL, *entry = NULL;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   entry = elm_entry_add(win);
+   elm_entry_entry_set(entry, EAIL_TEST_ENTRY_NAME);
+   evas_object_resize(entry, 100, 60);
+   evas_object_move(entry, 50, 20);
+   evas_object_show(entry);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _initialize_and_show_buttons(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_gengrid_tc1.c b/eail/tests/eail_gengrid_tc1.c
new file mode 100644 (file)
index 0000000..3c5c71f
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailGengrid
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailGengrid
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGengrid")
+
+typedef struct _Example_Item
+{
+   const char *path;
+} Example_Item;
+
+static Elm_Gengrid_Item_Class *gic = NULL;
+static Evas_Object *grid;
+
+static const char *imgs[9] =
+{
+   "./data/01.jpg",
+   "./data/02.jpg",
+   "./data/03.jpg",
+   "./data/04.jpg",
+   "./data/05.jpg",
+   "./data/06.jpg",
+   "./data/07.jpg",
+   "./data/08.jpg",
+   "./data/09.jpg"
+};
+
+static char *
+_grid_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   const Example_Item *it = data;
+   char buf[256];
+   snprintf(buf, sizeof(buf), "Photo %s", it->path);
+   return strdup(buf);
+}
+
+static Evas_Object *
+_grid_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   const Example_Item *it = data;
+   if (!strcmp(part, "elm.swallow.icon"))
+     {
+        Evas_Object *icon = elm_bg_add(obj);
+        char buf[256];
+        snprintf(buf, sizeof(buf),"%s", it->path);
+        elm_bg_file_set(icon, buf, NULL);
+        evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+        evas_object_show(icon);
+        return icon;
+     }
+   return NULL;
+
+}
+
+static Eina_Bool
+_grid_state_get(void *data, Evas_Object *obj, const char *part)
+{
+   return EINA_FALSE;
+}
+
+static void
+_grid_del(void *data, Evas_Object *obj)
+{
+   Example_Item *it = data;
+   eina_stringshare_del(it->path);
+   free(it);
+}
+
+static Example_Item *
+_item_new(unsigned int index)
+{
+   Example_Item *it = malloc(sizeof(*it));
+   if (index <= 8)
+     it->path = eina_stringshare_add(imgs[index]);
+   else
+     it->path = eina_stringshare_add(imgs[0]);
+   return it;
+}
+
+void _on_selected(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("selected item with handle: %p\n", event_info);
+}
+
+static void
+_print_object_info(AtkObject *obj)
+{
+   AtkRole atk_role = atk_object_get_role(obj);
+   const char *name = atk_object_get_name(obj);
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+   const char *role_name = atk_role_get_name(atk_role);
+
+   _printf("atk_object_get_name: %s\n", name ? name : "NULL");
+   _printf("atk_object_get_role: %s\n", role_name ? role_name : "NULL");
+   _printf("atk_object_get_type_name: %s\n", type_name ? type_name : "NULL");
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = atk_object_get_n_accessible_children(obj);
+
+   g_assert(ATK_IS_OBJECT(obj));
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_TABLE);
+
+   for (int i = 0; i < child_count; i++)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(obj, i);
+        _print_object_info(child);
+        g_assert(child);
+        g_object_unref(child);
+     }
+
+   eailu_test_code_called = 1;
+}
+static Ecore_Timer *timer_delay;
+
+static Eina_Bool delay_test_run(void *data)
+{
+   Eina_List *l, *list = elm_gengrid_realized_items_get(data);
+   Elm_Object_Item *it;
+   int i = 0;
+   Evas_Object *win = elm_object_parent_widget_get(data);
+   EINA_LIST_FOREACH(list, l, it)
+     {
+        unsigned int x, y;
+        elm_gengrid_item_pos_get(it, &x, &y);
+        i++;
+     }
+   _on_focus_in(NULL, win, NULL);
+   return EINA_FALSE;
+}
+
+static void
+_init_gengrid(Evas_Object *win)
+{
+   Evas_Object *bg;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+   grid = elm_gengrid_add(win);
+
+   elm_gengrid_item_size_set(grid, 200, 200);
+   evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, grid);
+   evas_object_smart_callback_add(grid, "selected", _on_selected, NULL);
+   elm_gengrid_horizontal_set(grid, EINA_FALSE);
+   elm_gengrid_multi_select_set(grid, EINA_TRUE);
+   evas_object_show(grid);
+
+   if (!gic)
+     {
+        gic = elm_gengrid_item_class_new();
+        gic->item_style = "default";
+        gic->func.text_get = _grid_label_get;
+        gic->func.content_get = _grid_content_get;
+        gic->func.state_get = _grid_state_get;
+        gic->func.del = _grid_del;
+     } // we only create the first time its needed. we dont unref/free
+
+   elm_gengrid_item_append(grid, gic, _item_new(0), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(1), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(2), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(3), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(4), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(5), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(6), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(7), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(8), NULL, NULL);
+   evas_object_resize(win, 800, 600);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, NULL);
+   _init_gengrid(win);
+   evas_object_show(win);
+
+   timer_delay = ecore_timer_add(1, delay_test_run, grid);
+
+   elm_run();
+   elm_shutdown();
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_gengrid_tc2.c b/eail/tests/eail_gengrid_tc2.c
new file mode 100644 (file)
index 0000000..732d5b8
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * Tested interface: AtkTable
+ *
+ * Tested AtkObject: EailGengrid
+ *
+ * Description: Test AtkTable interface
+ *
+ * Test input: accessible object representing EailGengrid
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGengrid")
+
+typedef struct _Example_Item
+{
+   const char *path;
+} Example_Item;
+
+static Elm_Gengrid_Item_Class *gic = NULL;
+static Evas_Object *grid;
+
+static const char *imgs[9] =
+{
+   "./data/01.jpg",
+   "./data/02.jpg",
+   "./data/03.jpg",
+   "./data/04.jpg",
+   "./data/05.jpg",
+   "./data/06.jpg",
+   "./data/07.jpg",
+   "./data/08.jpg",
+   "./data/09.jpg"
+};
+
+static char *
+_grid_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   const Example_Item *it = data;
+   char buf[256];
+   snprintf(buf, sizeof(buf), "Photo %s", it->path);
+   return strdup(buf);
+}
+
+static Evas_Object *
+_grid_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   const Example_Item *it = data;
+   if (!strcmp(part, "elm.swallow.icon"))
+     {
+        Evas_Object *icon = elm_bg_add(obj);
+        char buf[256];
+        snprintf(buf, sizeof(buf),"%s", it->path);
+        elm_bg_file_set(icon, buf, NULL);
+        evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+        evas_object_show(icon);
+        return icon;
+     }
+   return NULL;
+
+}
+
+static Eina_Bool
+_grid_state_get(void *data, Evas_Object *obj, const char *part)
+{
+   return EINA_FALSE;
+}
+
+static void
+_grid_del(void *data, Evas_Object *obj)
+{
+   Example_Item *it = data;
+   eina_stringshare_del(it->path);
+   free(it);
+}
+
+static Example_Item *
+_item_new(unsigned int index)
+{
+   Example_Item *it = malloc(sizeof(*it));
+   if (index <= 8)
+     it->path = eina_stringshare_add(imgs[index]);
+   else
+     it->path = eina_stringshare_add(imgs[0]);
+   return it;
+}
+
+void _on_selected(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("selected item with handle: %p\n", event_info);
+}
+
+static void
+_print_object_info(AtkObject *obj)
+{
+   AtkRole atk_role = atk_object_get_role(obj);
+   const char *name = atk_object_get_name(obj);
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+   const char *role_name = atk_role_get_name(atk_role);
+
+   _printf("atk_object_get_name: %s\n", name ? name : "NULL");
+   _printf("atk_object_get_role: %s\n", role_name ? role_name : "NULL");
+   _printf("atk_object_get_type_name: %s\n", type_name ? type_name : "NULL");
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int rows, cols, row_at_index, column_at_index, index_at;
+   gboolean success;
+   AtkTable *table;
+   AtkObject *table_child;
+
+   g_assert(ATK_IS_TABLE(obj));
+   table = ATK_TABLE(obj);
+   rows = atk_table_get_n_rows(table);
+   g_assert(rows == 3);
+   cols = atk_table_get_n_columns(table);
+   g_assert(cols == 3);
+   row_at_index = atk_table_get_row_at_index(table, 4);
+   g_assert(row_at_index == 1);
+   column_at_index = atk_table_get_column_at_index(table, 2);
+   g_assert(column_at_index == 2);
+   index_at = atk_table_get_index_at(table, 2, 2);
+   g_assert(index_at == 8);
+   table_child = atk_table_ref_at(table, 1, 1);
+   g_assert(ATK_IS_OBJECT(table_child));
+   _print_object_info(table_child);
+   success = atk_table_add_column_selection(table, 1);
+   g_assert(success);
+   success =  atk_table_is_column_selected(table, 1);
+   g_assert(success);
+   success = atk_table_remove_column_selection(table, 1);
+   g_assert(success);
+   success = atk_table_add_row_selection(table, 1);
+   g_assert(success);
+   success = atk_table_is_row_selected(table, 1);
+   g_assert(success);
+   success = atk_table_remove_row_selection(table, 0);
+   g_assert(success);
+
+   eailu_test_code_called = 1;
+}
+static Ecore_Timer *timer_delay;
+
+static Eina_Bool delay_test_run(void *data)
+{
+   Eina_List *l, *list = elm_gengrid_realized_items_get(data);
+   Elm_Object_Item *it;
+   int i = 0;
+   Evas_Object *win = elm_object_parent_widget_get(data);
+   EINA_LIST_FOREACH(list, l, it)
+     {
+        unsigned int x, y;
+        elm_gengrid_item_pos_get(it, &x, &y);
+        i++;
+     }
+   _on_focus_in(NULL, win, NULL);
+   return EINA_FALSE;
+}
+
+static void
+_init_gengrid(Evas_Object *win)
+{
+   Evas_Object *bg;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+   grid = elm_gengrid_add(win);
+
+   elm_gengrid_item_size_set(grid, 200, 200);
+   evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, grid);
+   evas_object_smart_callback_add(grid, "selected", _on_selected, NULL);
+   elm_gengrid_horizontal_set(grid, EINA_FALSE);
+   elm_gengrid_multi_select_set(grid, EINA_TRUE);
+   evas_object_show(grid);
+
+   if (!gic)
+     {
+        gic = elm_gengrid_item_class_new();
+        gic->item_style = "default";
+        gic->func.text_get = _grid_label_get;
+        gic->func.content_get = _grid_content_get;
+        gic->func.state_get = _grid_state_get;
+        gic->func.del = _grid_del;
+     } // we only create the first time its needed. we dont unref/free
+
+   elm_gengrid_item_append(grid, gic, _item_new(0), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(1), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(2), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(3), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(4), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(5), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(6), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(7), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(8), NULL, NULL);
+   evas_object_resize(win, 800, 600);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, NULL);
+   _init_gengrid(win);
+   evas_object_show(win);
+
+   timer_delay = ecore_timer_add(1, delay_test_run, grid);
+
+   elm_run();
+   elm_shutdown();
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_gengrid_tc3.c b/eail/tests/eail_gengrid_tc3.c
new file mode 100644 (file)
index 0000000..7427499
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailGengrid
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailGengrid
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGengrid")
+
+typedef struct _Example_Item
+{
+   const char *path;
+} Example_Item;
+
+static Elm_Gengrid_Item_Class *gic = NULL;
+static Evas_Object *grid;
+
+static const char *imgs[9] =
+{
+   "./data/01.jpg",
+   "./data/02.jpg",
+   "./data/03.jpg",
+   "./data/04.jpg",
+   "./data/05.jpg",
+   "./data/06.jpg",
+   "./data/07.jpg",
+   "./data/08.jpg",
+   "./data/09.jpg"
+};
+
+static char *
+_grid_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   const Example_Item *it = data;
+   char buf[256];
+   snprintf(buf, sizeof(buf), "Photo %s", it->path);
+   return strdup(buf);
+}
+
+static Evas_Object *
+_grid_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   const Example_Item *it = data;
+   if (!strcmp(part, "elm.swallow.icon"))
+     {
+        Evas_Object *icon = elm_bg_add(obj);
+        char buf[256];
+        snprintf(buf, sizeof(buf),"%s", it->path);
+        elm_bg_file_set(icon, buf, NULL);
+        evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+        evas_object_show(icon);
+        return icon;
+     }
+   return NULL;
+
+}
+
+static Eina_Bool
+_grid_state_get(void *data, Evas_Object *obj, const char *part)
+{
+   return EINA_FALSE;
+}
+
+static void
+_grid_del(void *data, Evas_Object *obj)
+{
+   Example_Item *it = data;
+   eina_stringshare_del(it->path);
+   free(it);
+}
+
+static Example_Item *
+_item_new(unsigned int index)
+{
+   Example_Item *it = malloc(sizeof(*it));
+   if (index <= 8)
+     it->path = eina_stringshare_add(imgs[index]);
+   else
+     it->path = eina_stringshare_add(imgs[0]);
+   return it;
+}
+
+void _on_selected(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("selected item with handle: %p\n", event_info);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   gint index = -1, column = -1, row = -1;
+   AtkObject *two_two_child = NULL, *zero_zero_child = NULL,
+               *zero_four_child = NULL, *zero_three_child = NULL;
+
+   /* 2-2 coords should NOT have any match*/
+   index = atk_table_get_index_at(ATK_TABLE(obj), 2, 2);
+   g_assert(-1 == index);
+   two_two_child = atk_table_ref_at(ATK_TABLE(obj), 2, 2);
+   g_assert(NULL == two_two_child);
+
+   /* 0-0 coords should be found*/
+   index = atk_table_get_index_at(ATK_TABLE(obj), 0, 0);
+   g_assert(-1 != index);
+   zero_zero_child = atk_table_ref_at(ATK_TABLE(obj), 0, 0);
+   g_assert(zero_zero_child);
+
+   /* 0-4 coords should NOT be found*/
+   index = atk_table_get_index_at(ATK_TABLE(obj), 0, 4);
+   g_assert(-1 == index);
+   zero_four_child = atk_table_ref_at(ATK_TABLE(obj), 0, 4);
+   g_assert(NULL == zero_four_child);
+
+   /*...but  0-3 coords should be found*/
+   index = atk_table_get_index_at(ATK_TABLE(obj), 0, 3);
+   g_assert(-1 != index);
+   zero_three_child = atk_table_ref_at(ATK_TABLE(obj), 0, 3);
+   g_assert(zero_three_child);
+
+   /* table - columns checks*/
+   /*...index-9 obj should not be found (slightly out of bounds)*/
+   column = atk_table_get_column_at_index(ATK_TABLE(obj), 9);
+   g_assert(-1 == column);
+
+   /*...index-8 obj should be found, and should be '0' */
+   column = atk_table_get_column_at_index(ATK_TABLE(obj), 8);
+   g_assert(0 == column);
+
+   /*...index-7 obj should be found, and column be '3' */
+   column = atk_table_get_column_at_index(ATK_TABLE(obj), 7);
+   g_assert(3 == column);
+
+   /*... index-2 obj should be found, and column be 2' */
+   column = atk_table_get_column_at_index(ATK_TABLE(obj), 2);
+   g_assert(2 == column);
+
+   /*... index-6 obj should be found, and column be 2' */
+   column = atk_table_get_column_at_index(ATK_TABLE(obj), 6);
+   g_assert(2 == column);
+
+   /* table -rows checks*/
+   /* index 9- should not be found in any row */
+   row = atk_table_get_row_at_index(ATK_TABLE(obj), 9);
+   g_assert(-1 == row);
+
+   /*...index-8 obj should be found, and row should be '2' */
+   row = atk_table_get_row_at_index(ATK_TABLE(obj), 8);
+   g_assert(2 == row);
+
+   /*...index-7 obj should be found, and row should be '1' */
+   row = atk_table_get_row_at_index(ATK_TABLE(obj), 7);
+   g_assert(1 == row);
+
+   /*...index-2 obj should be found, and row should be '0' */
+   row = atk_table_get_row_at_index(ATK_TABLE(obj), 2);
+   g_assert(0 == row);
+
+   /*...index-6 obj should be found, and row should be '1' */
+   row = atk_table_get_row_at_index(ATK_TABLE(obj), 6);
+   g_assert(1 == row);
+
+   /*...index-0 obj should be found, and row should be '0' */
+   row = atk_table_get_row_at_index(ATK_TABLE(obj), 0);
+   g_assert(0 == row);
+
+   eailu_test_code_called = 1;
+}
+
+static Ecore_Timer *timer_delay;
+
+static Eina_Bool delay_test_run(void *data)
+{
+   Eina_List *l, *list = elm_gengrid_realized_items_get(data);
+   Elm_Object_Item *it;
+   int i = 0;
+   Evas_Object *win = elm_object_parent_widget_get(data);
+   EINA_LIST_FOREACH(list, l, it)
+     {
+        unsigned int x, y;
+        elm_gengrid_item_pos_get(it, &x, &y);
+        i++;
+     }
+   _on_focus_in(NULL, win, NULL);
+   return EINA_FALSE;
+}
+
+static void
+_init_gengrid(Evas_Object *win)
+{
+   Evas_Object *bg;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+   grid = elm_gengrid_add(win);
+
+   elm_gengrid_item_size_set(grid, 200, 200);
+   evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, grid);
+   evas_object_smart_callback_add(grid, "selected", _on_selected, NULL);
+   elm_gengrid_horizontal_set(grid, EINA_FALSE);
+   elm_gengrid_multi_select_set(grid, EINA_TRUE);
+   evas_object_show(grid);
+
+   if (!gic)
+     {
+        gic = elm_gengrid_item_class_new();
+        gic->item_style = "default";
+        gic->func.text_get = _grid_label_get;
+        gic->func.content_get = _grid_content_get;
+        gic->func.state_get = _grid_state_get;
+        gic->func.del = _grid_del;
+     } // we only create the first time its needed. we dont unref/free
+
+   elm_gengrid_item_append(grid, gic, _item_new(0), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(1), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(2), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(3), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(4), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(5), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(6), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(7), NULL, NULL);
+   elm_gengrid_item_append(grid, gic, _item_new(8), NULL, NULL);
+   evas_object_resize(win, 1000, 300);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, NULL);
+   _init_gengrid(win);
+   evas_object_show(win);
+
+   timer_delay = ecore_timer_add(1, delay_test_run, grid);
+
+   elm_run();
+   elm_shutdown();
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_genlist_tc1.c b/eail/tests/eail_genlist_tc1.c
new file mode 100644 (file)
index 0000000..5ce2146
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailGenlist
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree. Test
+ *    accessible children availability.
+ *
+ * Test input: accessible object representing EailGenlist
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGenlist")
+
+#define EAIL_TYPE_FOR_LIST_ITEM "EailItem"
+#define N_ITEMS 18
+
+static Evas_Object *glob_genlist = NULL;
+static Elm_Genlist_Item_Class *_itc_group = NULL;
+static int nitems = 0;
+
+Elm_Object_Item *glob_test_item = NULL;
+
+static void
+_do_test(AtkObject *aobj)
+{
+   int child_amount = 0;
+
+   g_assert(ATK_IS_OBJECT(aobj));
+
+   g_assert(atk_object_get_role(aobj) == ATK_ROLE_LIST);
+
+   child_amount = atk_object_get_n_accessible_children(aobj);
+   g_assert(N_ITEMS == child_amount);
+
+   eailu_test_atk_focus(aobj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+static char *
+_item_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   time_t t = (time_t)ecore_time_unix_get();
+   char buf[256];
+   int i = (int)(long)data;
+
+   if (!strcmp(part, "elm.text"))
+     snprintf(buf, sizeof(buf), "Item # %i", i);
+   else
+     {
+        int n;
+        snprintf(buf, sizeof(buf), "realized at %s", ctime(&t));
+        n = strlen(buf);
+        buf[n - 1] = '\0';
+     }
+
+   return strdup(buf);
+}
+
+static Evas_Object *
+_item_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   Evas_Object *ic = elm_icon_add(obj);
+
+   if (!strcmp(part, "elm.swallow.icon"))
+     elm_icon_standard_set(ic, "clock");
+
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   return ic;
+}
+
+static char *
+_group_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   char buf[256];
+   int i = (int)(long)data;
+
+   snprintf(buf, sizeof(buf), "Group %d (item #%d)", i / 7, i);
+
+   return strdup(buf);
+}
+
+static Evas_Object *
+_group_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   Evas_Object *ic = elm_icon_add(obj);
+
+   if (!strcmp(part, "elm.swallow.icon"))
+     elm_icon_standard_set(ic, "home");
+
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   return ic;
+}
+
+static void
+_item_sel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   //   printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n",
+   //          data, obj, event_info);
+}
+
+void
+_init_genlist(Evas_Object *win)
+{
+   Evas_Object *box, *entry;
+   static Elm_Genlist_Item_Class *_itc = NULL;
+   int i = 0;
+
+   if (!_itc)
+     {
+        _itc = elm_genlist_item_class_new();
+        _itc->item_style = "default";
+        _itc->func.text_get = _item_label_get;
+        _itc->func.content_get = _item_content_get;
+        _itc->func.state_get = NULL;
+        _itc->func.del = NULL;
+     }
+
+   if (!_itc_group)
+     {
+        _itc_group = elm_genlist_item_class_new();
+        _itc_group->item_style = "group_index";
+        _itc_group->func.text_get = _group_label_get;
+        _itc_group->func.content_get = _group_content_get;
+        _itc_group->func.state_get = NULL;
+        _itc_group->func.del = NULL;
+     }
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   glob_genlist = elm_genlist_add(win);
+
+   evas_object_size_hint_weight_set
+       (glob_genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set
+       (glob_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, glob_genlist);
+   evas_object_show(glob_genlist);
+
+   entry = elm_entry_add(win);
+   elm_entry_single_line_set(entry, EINA_TRUE);
+   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(entry);
+
+
+   /* filling genlist */
+   for (i = 0; i < N_ITEMS; i++)
+     {
+        Elm_Object_Item *gli = NULL, *glg = NULL;
+
+        if (i % 7 == 0)
+          {
+             glg = gli = elm_genlist_item_append(glob_genlist, _itc_group,
+                                                 (void *) (long) nitems++,
+                                                 NULL, ELM_GENLIST_ITEM_GROUP,
+                                                 _item_sel_cb, NULL );
+             elm_genlist_item_select_mode_set(
+                 gli, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+          }
+        else
+          {
+             gli = elm_genlist_item_append(glob_genlist, _itc,
+                                           (void *) (long) nitems++, glg,
+                                           ELM_GENLIST_ITEM_NONE,
+                                           _item_sel_cb, NULL );
+          }
+
+        if (i == 1)
+          glob_test_item = gli;
+     }
+
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_genlist(win);
+
+   /* and show the window */
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_genlist_tc2.c b/eail/tests/eail_genlist_tc2.c
new file mode 100644 (file)
index 0000000..07ff347
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailGenlist
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailGenlist
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGenlist")
+
+#define N_ITEMS 18
+
+static Evas_Object *glob_genlist = NULL;
+static Elm_Genlist_Item_Class *_itc_group = NULL;
+static int nitems = 0;
+
+Elm_Object_Item *glob_test_item = NULL;
+
+static void
+_do_test(AtkObject *aobj)
+{
+   int n_actions = 0;
+   const gchar *test_desc = "test description for scroll up";
+   const gchar *result_desc;
+
+   g_assert(ATK_IS_ACTION(aobj));
+   n_actions = atk_action_get_n_actions(ATK_ACTION(aobj));
+   g_assert(4 == n_actions);
+
+   /* scroll up*/
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_up");
+
+   /* scroll_down */
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_down");
+
+   /* scroll_left */
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_left");
+
+   /* scroll_right*/
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_right");
+
+   /* description test */
+   g_assert(!atk_action_get_description(ATK_ACTION(aobj), 0));
+   g_assert(atk_action_set_description(ATK_ACTION(aobj), 0, test_desc));
+
+   result_desc = atk_action_get_description(ATK_ACTION(aobj), 0);
+   g_assert(0 == g_strcmp0(result_desc, test_desc));
+   eailu_test_code_called = 1;
+}
+
+static char *
+_item_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   time_t t = (time_t)ecore_time_unix_get();
+   char buf[256];
+   int i = (int)(long)data;
+
+   if (!strcmp(part, "elm.text"))
+     snprintf(buf, sizeof(buf), "Item # %i", i);
+   else
+     {
+        int n;
+        snprintf(buf, sizeof(buf), "realized at %s", ctime(&t));
+        n = strlen(buf);
+        buf[n - 1] = '\0';
+     }
+
+   return strdup(buf);
+}
+
+static Evas_Object *
+_item_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   Evas_Object *ic = elm_icon_add(obj);
+
+   if (!strcmp(part, "elm.swallow.icon"))
+     elm_icon_standard_set(ic, "clock");
+
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   return ic;
+}
+
+static char *
+_group_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   char buf[256];
+   int i = (int)(long)data;
+
+   snprintf(buf, sizeof(buf), "Group %d (item #%d)", i / 7, i);
+
+   return strdup(buf);
+}
+
+static Evas_Object *
+_group_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   Evas_Object *ic = elm_icon_add(obj);
+
+   if (!strcmp(part, "elm.swallow.icon"))
+     elm_icon_standard_set(ic, "home");
+
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   return ic;
+}
+
+static void
+_item_sel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   //   printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n",
+   //          data, obj, event_info);
+}
+
+void
+_init_genlist(Evas_Object *win)
+{
+   Evas_Object *box, *entry;
+   static Elm_Genlist_Item_Class *_itc = NULL;
+   int i = 0;
+
+   if (!_itc)
+     {
+        _itc = elm_genlist_item_class_new();
+        _itc->item_style = "default";
+        _itc->func.text_get = _item_label_get;
+        _itc->func.content_get = _item_content_get;
+        _itc->func.state_get = NULL;
+        _itc->func.del = NULL;
+     }
+
+   if (!_itc_group)
+     {
+        _itc_group = elm_genlist_item_class_new();
+        _itc_group->item_style = "group_index";
+        _itc_group->func.text_get = _group_label_get;
+        _itc_group->func.content_get = _group_content_get;
+        _itc_group->func.state_get = NULL;
+        _itc_group->func.del = NULL;
+     }
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   glob_genlist = elm_genlist_add(win);
+
+   evas_object_size_hint_weight_set
+       (glob_genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set
+       (glob_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, glob_genlist);
+   evas_object_show(glob_genlist);
+
+   entry = elm_entry_add(win);
+   elm_entry_single_line_set(entry, EINA_TRUE);
+   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(entry);
+
+
+   /* filling genlist */
+   for (i = 0; i < N_ITEMS; i++)
+     {
+        Elm_Object_Item *gli = NULL, *glg = NULL;
+
+        if (i % 7 == 0)
+          {
+             glg = gli = elm_genlist_item_append(glob_genlist, _itc_group,
+                                                 (void *) (long) nitems++,
+                                                 NULL, ELM_GENLIST_ITEM_GROUP,
+                                                 _item_sel_cb, NULL );
+             elm_genlist_item_select_mode_set(
+                 gli, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+          }
+        else
+          {
+             gli = elm_genlist_item_append(glob_genlist, _itc,
+                                           (void *) (long) nitems++, glg,
+                                           ELM_GENLIST_ITEM_NONE,
+                                           _item_sel_cb, NULL );
+          }
+
+        if (i == 1)
+          glob_test_item = gli;
+     }
+
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_genlist(win);
+
+   /* and show the window */
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_genlist_tc3.c b/eail/tests/eail_genlist_tc3.c
new file mode 100644 (file)
index 0000000..9eff541
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * Tested interface: AtkSelection
+ *
+ * Tested AtkObject: EailGenlist
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailGenlist
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGenlist")
+
+#define EAIL_TYPE_FOR_LIST_ITEM "EailItem"
+#define N_ITEMS 18
+
+static Evas_Object *glob_genlist = NULL;
+static Elm_Genlist_Item_Class *_itc_group = NULL;
+static int nitems = 0;
+
+Elm_Object_Item *glob_test_item = NULL;
+
+static void
+_test_list_item_interfaces(AtkObject *item_object)
+{
+   g_assert(ATK_IS_OBJECT(item_object));
+   g_assert(eailu_is_object_with_type(item_object, EAIL_TYPE_FOR_LIST_ITEM));
+
+   /**
+    * for single list items focusing does NOT work
+    */
+   eailu_test_atk_focus(item_object, FALSE);
+
+   g_assert(ATK_IS_ACTION(item_object));
+}
+
+static void
+_test_item_selection_single(AtkObject *parent, AtkObject *child, int index)
+{
+   g_assert(ATK_IS_SELECTION(parent));
+   /* in single selection mode it should return FALSE */
+   g_assert(!atk_selection_select_all_selection(ATK_SELECTION(parent)));
+   g_assert
+      (FALSE == atk_selection_is_child_selected(ATK_SELECTION(parent), index));
+
+   g_assert(atk_selection_add_selection(ATK_SELECTION(parent), index));
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(parent), index));
+   g_assert(1 == atk_selection_get_selection_count(ATK_SELECTION(parent)));
+
+   /* now removing selection using atk_selection interface */
+   g_assert(atk_selection_remove_selection(ATK_SELECTION(parent),index));
+   g_assert
+     (FALSE == atk_selection_is_child_selected(ATK_SELECTION(parent), index));
+   g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(parent)));
+}
+
+static void
+_test_multiselection_list(AtkObject *atk_list)
+{
+   elm_genlist_multi_select_set(glob_genlist, EINA_TRUE);
+   g_assert(atk_selection_select_all_selection(ATK_SELECTION(atk_list)));
+
+   /* all children should be now selected */
+   g_assert
+      (N_ITEMS == atk_selection_get_selection_count(ATK_SELECTION(atk_list)));
+
+   /* now clearing selection */
+   g_assert(atk_selection_clear_selection(ATK_SELECTION(atk_list)));
+   g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(atk_list)));
+}
+
+static void
+_do_test(AtkObject *aobj)
+{
+   int child_amount = 0, i = 0;
+
+   child_amount = atk_object_get_n_accessible_children(aobj);
+   g_assert(N_ITEMS == child_amount);
+
+   /* checking list items implementation */
+   for (i = 0; i < child_amount; i++)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(aobj, i);
+        /* each list item has inside 2 text entry objects */
+
+        _test_list_item_interfaces(child);
+        _test_item_selection_single(aobj, child, i);
+
+        g_object_unref(child);
+     }
+
+   /* now quick check if multiselection on list works properly*/
+   _test_multiselection_list(aobj);
+   eailu_test_code_called = 1;
+}
+
+static char *
+_item_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   time_t t = (time_t)ecore_time_unix_get();
+   char buf[256];
+   int i = (int)(long)data;
+
+   if (!strcmp(part, "elm.text"))
+     snprintf(buf, sizeof(buf), "Item # %i", i);
+   else
+     {
+        int n;
+        snprintf(buf, sizeof(buf), "realized at %s", ctime(&t));
+        n = strlen(buf);
+        buf[n - 1] = '\0';
+     }
+
+   return strdup(buf);
+}
+
+static Evas_Object *
+_item_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   Evas_Object *ic = elm_icon_add(obj);
+
+   if (!strcmp(part, "elm.swallow.icon"))
+     elm_icon_standard_set(ic, "clock");
+
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   return ic;
+}
+
+static char *
+_group_label_get(void *data, Evas_Object *obj, const char *part)
+{
+   char buf[256];
+   int i = (int)(long)data;
+
+   snprintf(buf, sizeof(buf), "Group %d (item #%d)", i / 7, i);
+
+   return strdup(buf);
+}
+
+static Evas_Object *
+_group_content_get(void *data, Evas_Object *obj, const char *part)
+{
+   Evas_Object *ic = elm_icon_add(obj);
+
+   if (!strcmp(part, "elm.swallow.icon"))
+     elm_icon_standard_set(ic, "home");
+
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   return ic;
+}
+
+static void
+_item_sel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+//   printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n",
+//          data, obj, event_info);
+}
+
+void
+_init_genlist(Evas_Object *win)
+{
+   Evas_Object *box, *entry;
+   static Elm_Genlist_Item_Class *_itc = NULL;
+   int i = 0;
+
+   if (!_itc)
+     {
+        _itc = elm_genlist_item_class_new();
+        _itc->item_style = "default";
+        _itc->func.text_get = _item_label_get;
+        _itc->func.content_get = _item_content_get;
+        _itc->func.state_get = NULL;
+        _itc->func.del = NULL;
+     }
+
+   if (!_itc_group)
+     {
+        _itc_group = elm_genlist_item_class_new();
+        _itc_group->item_style = "group_index";
+        _itc_group->func.text_get = _group_label_get;
+        _itc_group->func.content_get = _group_content_get;
+        _itc_group->func.state_get = NULL;
+        _itc_group->func.del = NULL;
+     }
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   glob_genlist = elm_genlist_add(win);
+
+   evas_object_size_hint_weight_set
+                           (glob_genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set
+                                (glob_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, glob_genlist);
+   evas_object_show(glob_genlist);
+
+   entry = elm_entry_add(win);
+   elm_entry_single_line_set(entry, EINA_TRUE);
+   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(entry);
+
+
+   /* filling genlist */
+   for (i = 0; i < N_ITEMS; i++)
+     {
+        Elm_Object_Item *gli = NULL, *glg = NULL;
+
+         if (i % 7 == 0)
+           {
+               glg = gli = elm_genlist_item_append(glob_genlist, _itc_group,
+                                                   (void *) (long) nitems++,
+                                                   NULL, ELM_GENLIST_ITEM_GROUP,
+                                                   _item_sel_cb, NULL );
+               elm_genlist_item_select_mode_set(
+                        gli, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+           }
+         else
+           {
+               gli = elm_genlist_item_append(glob_genlist, _itc,
+                                             (void *) (long) nitems++, glg,
+                                             ELM_GENLIST_ITEM_NONE,
+                                             _item_sel_cb, NULL );
+           }
+
+         if (i == 1)
+           glob_test_item = gli;
+     }
+
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_genlist(win);
+
+   /* and show the window */
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_glview_tc1.c b/eail/tests/eail_glview_tc1.c
new file mode 100644 (file)
index 0000000..00f8974
--- /dev/null
@@ -0,0 +1,348 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailGlview
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailGlview
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGlview")
+
+typedef struct _GLData GLData;
+
+// GL related data here..
+struct _GLData
+{
+   Evas_GL_API *glapi;
+   GLuint       program;
+   GLuint       vtx_shader;
+   GLuint       fgmt_shader;
+   GLuint       vbo;
+   int          initialized : 1;
+};
+
+static float red = 1.0;
+
+// a helper function to load shaders from a shader source
+static GLuint
+load_shader(GLData *gld, GLenum type, const char *shader_src)
+{
+   Evas_GL_API *gl = gld->glapi;
+   GLuint shader;
+   GLint compiled;
+
+   // Create the shader object
+   shader = gl->glCreateShader(type);
+   if (0 == shader)
+     return 0;
+
+   // Load/Compile shader source
+   gl->glShaderSource(shader, 1, &shader_src, NULL);
+   gl->glCompileShader(shader);
+   gl->glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+
+   if (!compiled)
+     {
+        GLint info_len = 0;
+        gl->glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &info_len);
+        if (1 < info_len)
+          {
+             char* info_log = malloc(sizeof(char) * info_len);
+
+             gl->glGetShaderInfoLog(shader, info_len, NULL, info_log);
+             _printf("Error compiling shader:\n%s\n======\n%s\n======\n", info_log, shader_src);
+             free(info_log);
+             g_assert(FALSE);
+          }
+        gl->glDeleteShader(shader);
+        return 0;
+     }
+
+   return shader;
+}
+
+// Initialize the shader and program object
+static int
+init_shaders(GLData *gld)
+{
+   Evas_GL_API *gl = gld->glapi;
+   GLbyte vShaderStr[] =
+      "attribute vec4 vPosition;    \n"
+      "void main()                  \n"
+      "{                            \n"
+      "   gl_Position = vPosition;  \n"
+      "}                            \n";
+
+   GLbyte fShaderStr[] =
+      "#ifdef GL_ES                                 \n"
+      "precision mediump float;                     \n"
+      "#endif                                       \n"
+      "void main()                                  \n"
+      "{                                            \n"
+      "  gl_FragColor = vec4 ( 1.0, 0.0, 0.0, 1.0 );\n"
+      "}                                            \n";
+
+   GLint linked;
+
+   // Load the vertex/fragment shaders
+   gld->vtx_shader  = load_shader(gld, GL_VERTEX_SHADER, (const char*)vShaderStr);
+   gld->fgmt_shader = load_shader(gld, GL_FRAGMENT_SHADER, (const char*)fShaderStr);
+
+   // Create the program object
+   gld->program = gl->glCreateProgram( );
+   if (0 == gld->program)
+     return 0;
+
+   gl->glAttachShader(gld->program, gld->vtx_shader);
+   gl->glAttachShader(gld->program, gld->fgmt_shader);
+
+   gl->glBindAttribLocation(gld->program, 0, "vPosition");
+   gl->glLinkProgram(gld->program);
+   gl->glGetProgramiv(gld->program, GL_LINK_STATUS, &linked);
+
+   if (!linked)
+     {
+        GLint info_len = 0;
+        gl->glGetProgramiv(gld->program, GL_INFO_LOG_LENGTH, &info_len);
+        if (1 < info_len)
+          {
+             char* info_log = malloc(sizeof(char) * info_len);
+
+             gl->glGetProgramInfoLog(gld->program, info_len, NULL, info_log);
+             _printf("Error linking program:\n%s\n", info_log);
+             free(info_log);
+             g_assert(FALSE);
+          }
+        gl->glDeleteProgram(gld->program);
+        return 0;
+     }
+   return 1;
+}
+
+// intialize callback that gets called once for intialization
+static void
+_init_gl(Evas_Object *obj)
+{
+   GLData *gld = evas_object_data_get(obj, "gld");
+   Evas_GL_API *gl = gld->glapi;
+   GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f,
+                          -0.5f, -0.5f, 0.0f,
+                           0.5f, -0.5f, 0.0f };
+
+   if (!init_shaders(gld))
+     {
+        _printf("Error Initializing Shaders\n");
+        g_assert(FALSE);
+     }
+
+   gl->glGenBuffers(1, &gld->vbo);
+   gl->glBindBuffer(GL_ARRAY_BUFFER, gld->vbo);
+   gl->glBufferData(GL_ARRAY_BUFFER, 3 * 3 * 4, vVertices, GL_STATIC_DRAW);
+}
+
+// delete callback gets called when glview is deleted
+static void
+_del_gl(Evas_Object *obj)
+{
+   GLData *gld = evas_object_data_get(obj, "gld");
+   if (!gld)
+     {
+        printf("Unable to get GLData. \n");
+        g_assert(FALSE);
+     }
+   Evas_GL_API *gl = gld->glapi;
+
+   gl->glDeleteShader(gld->vtx_shader);
+   gl->glDeleteShader(gld->fgmt_shader);
+   gl->glDeleteProgram(gld->program);
+   gl->glDeleteBuffers(1, &gld->vbo);
+
+   evas_object_data_del((Evas_Object*)obj, "..gld");
+   free(gld);
+}
+
+// resize callback gets called every time object is resized
+static void
+_resize_gl(Evas_Object *obj)
+{
+   int w, h;
+   GLData *gld = evas_object_data_get(obj, "gld");
+   Evas_GL_API *gl = gld->glapi;
+
+   elm_glview_size_get(obj, &w, &h);
+
+   // GL Viewport stuff. you can avoid doing this if viewport is all the
+   // same as last frame if you want
+   gl->glViewport(0, 0, w, h);
+}
+
+
+// draw callback is where all the main GL rendering happens
+static void
+_draw_gl(Evas_Object *obj)
+{
+   Evas_GL_API *gl = elm_glview_gl_api_get(obj);
+   GLData *gld = evas_object_data_get(obj, "gld");
+
+   if (!gld) return;
+   int w, h;
+
+   elm_glview_size_get(obj, &w, &h);
+
+   gl->glViewport(0, 0, w, h);
+   gl->glClearColor(red, 0.8, 0.3, 1);
+   gl->glClear(GL_COLOR_BUFFER_BIT);
+
+   // Draw a Triangle
+   gl->glEnable(GL_BLEND);
+
+   gl->glUseProgram(gld->program);
+
+   gl->glBindBuffer(GL_ARRAY_BUFFER, gld->vbo);
+   gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
+   gl->glEnableVertexAttribArray(0);
+
+   gl->glDrawArrays(GL_TRIANGLES, 0, 3);
+
+   // Optional - Flush the GL pipeline
+   gl->glFinish();
+
+   red -= 0.1;
+   if (0.0 > red) red = 1.0;
+}
+
+// just need to notify that glview has changed so it can render
+static Eina_Bool
+_anim(void *data)
+{
+   elm_glview_changed_set(data);
+   return EINA_TRUE;
+}
+
+static void
+_del(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+   Ecore_Animator *ani = evas_object_data_get(obj, "ani");
+   ecore_animator_del(ani);
+}
+
+static void
+_init_glview(Evas_Object *win, GLData *gld)
+{
+   Evas_Object *bg, *bx, *bt, *gl;
+   Ecore_Animator *ani;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   //-//-//-// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)
+   //-//
+   // create a new glview object
+   gl = elm_glview_add(win);
+   gld->glapi = elm_glview_gl_api_get(gl);
+   evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   // mode is simply for supporting alpha, depth buffering, and stencil
+   // buffering.
+   elm_glview_mode_set(gl, ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH);
+   // resize policy tells glview what to do with the surface when it
+   // resizes.  ELM_GLVIEW_RESIZE_POLICY_RECREATE will tell it to
+   // destroy the current surface and recreate it to the new size
+   elm_glview_resize_policy_set(gl, ELM_GLVIEW_RESIZE_POLICY_RECREATE);
+   // render policy tells glview how it would like glview to render
+   // gl code. ELM_GLVIEW_RENDER_POLICY_ON_DEMAND will have the gl
+   // calls called in the pixel_get callback, which only gets called
+   // if the object is visible, hence ON_DEMAND.  ALWAYS mode renders
+   // it despite the visibility of the object.
+   elm_glview_render_policy_set(gl, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);
+   // initialize callback function gets registered here
+   elm_glview_init_func_set(gl, _init_gl);
+   // delete callback function gets registered here
+   elm_glview_del_func_set(gl, _del_gl);
+   elm_glview_resize_func_set(gl, _resize_gl);
+   elm_glview_render_func_set(gl, _draw_gl);
+   //-//
+   //-//-//-// END GL INIT BLOB
+
+   elm_box_pack_end(bx, gl);
+   evas_object_show(gl);
+
+   elm_object_focus_set(gl, EINA_TRUE);
+
+   // animating - just a demo. as long as you trigger an update on the image
+   // object via elm_glview_changed_set() it will be updated.
+   //
+   // NOTE: if you delete gl, this animator will keep running trying to access
+   // gl so you'd better delete this animator with ecore_animator_del().
+   ani = ecore_animator_add(_anim, gl);
+
+   evas_object_data_set(gl, "ani", ani);
+   evas_object_data_set(gl, "gld", gld);
+   evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);
+
+   // add an 'OK' button to end the program
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "OK");
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+   elm_box_pack_end(bx, bt);
+   evas_object_show(bt);
+   evas_object_smart_callback_add(bt, "clicked", _on_done, win);
+
+   evas_object_resize(win, 320, 480);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_ANIMATION);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+   GLData *gld = calloc(1, sizeof(GLData));
+
+   g_assert(gld);
+
+   // set the preferred engine to opengl_x11. if it isnt' available it
+   // may use another transparently
+   elm_config_preferred_engine_set("opengl_x11");
+
+   win = (Evas_Object *)eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_glview(win, gld);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_grid_tc1.c b/eail/tests/eail_grid_tc1.c
new file mode 100644 (file)
index 0000000..467b81e
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailGrid
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailGrid
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailGrid")
+
+enum _slide_style
+{
+   SLIDE_SHORT,
+   SLIDE_LONG,
+   SLIDE_BOUNCE,
+   SLIDE_STYLE_LAST
+};
+
+static void
+_change_radio_cb(void *data, Evas_Object *obj, void *event)
+{
+   Evas_Object *lb = (Evas_Object *)data;
+   int style = elm_radio_value_get((Evas_Object *)obj);
+
+   switch (style)
+     {
+      case SLIDE_SHORT:
+         _printf("change_radio: slide_short\n");
+         elm_object_style_set(lb, "slide_short");
+         break;
+
+      case SLIDE_LONG:
+         _printf("change_radio: slide_long\n");
+         elm_object_style_set(lb, "slide_long");
+         break;
+
+      case SLIDE_BOUNCE:
+         _printf("change_radio: slide_bounce\n");
+         elm_object_style_set(lb, "slide_bounce");
+         break;
+
+      default:
+         return;
+     }
+}
+
+static void
+_change_slider_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   Evas_Object *lb = (Evas_Object *)data;
+   double val = elm_slider_value_get(obj);
+   elm_label_slide_duration_set(lb, val);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_FILLER);
+   // test children
+   g_assert(8 == atk_object_get_n_accessible_children(obj));
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_grid(Evas_Object *win)
+{
+   Evas_Object *bg, *gd, *lb, *rd, *rdg, *sl;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   gd = elm_grid_add(win);
+   elm_grid_size_set(gd, 100, 100);
+   evas_object_size_hint_weight_set(gd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, gd);
+   evas_object_show(gd);
+
+   lb = elm_label_add(win);
+   elm_object_text_set(lb, "Test Label Ellipsis:");
+   elm_grid_pack(gd, lb, 5, 5, 90, 10);
+   evas_object_show(lb);
+
+   lb = elm_label_add(win);
+   elm_object_text_set(lb,
+                       "This is a label set to ellipsis. "
+                       "If set ellipsis to true and the text doesn't fit "
+                       "in the label an ellipsis(\"...\") will be shown "
+                       "at the end of the widget."
+                      );
+
+   elm_label_ellipsis_set(lb, EINA_TRUE);
+   elm_grid_pack(gd, lb, 5, 15, 90, 10);
+   evas_object_show(lb);
+
+   lb = elm_label_add(win);
+   elm_object_text_set(lb, "Test Label Slide:");
+   elm_grid_pack(gd, lb, 5, 30, 90, 10);
+   evas_object_show(lb);
+
+   lb = elm_label_add(win);
+   elm_object_style_set(lb, "slide_short");
+   elm_object_text_set(lb,
+                       "This is a label set to slide. "
+                       "If set slide to true the text of the label "
+                       "will slide/scroll through the length of label."
+                       "This only works with the themes \"slide_short\", "
+                       "\"slide_long\" and \"slide_bounce\"."
+                      );
+   elm_grid_pack(gd, lb, 5, 40, 90, 10);
+   evas_object_show(lb);
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, SLIDE_SHORT);
+   elm_object_text_set(rd, "slide_short");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _change_radio_cb, lb);
+   elm_grid_pack(gd, rd, 5, 50, 30, 10);
+   evas_object_show(rd);
+   rdg = rd;
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, SLIDE_LONG);
+   elm_radio_group_add(rd, rdg);
+   elm_object_text_set(rd, "slide_long");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _change_radio_cb, lb);
+   elm_grid_pack(gd, rd, 35, 50, 30, 10);
+   evas_object_show(rd);
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, SLIDE_BOUNCE);
+   elm_radio_group_add(rd, rdg);
+   elm_object_text_set(rd, "slide_bounce");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _change_radio_cb, lb);
+   elm_grid_pack(gd, rd, 65, 50, 30, 10);
+   evas_object_show(rd);
+
+   sl = elm_slider_add(win);
+   elm_object_text_set(sl, "Slide Duration");
+   elm_slider_unit_format_set(sl, "%1.1f units");
+   elm_slider_min_max_set(sl, 1, 20);
+   elm_slider_value_set(sl, 10);
+   evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_smart_callback_add(sl, "changed", _change_slider_cb, lb);
+   elm_grid_pack(gd, sl, 5, 60, 90, 10);
+   evas_object_show(sl);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_grid(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_hover_tc1.c b/eail/tests/eail_hover_tc1.c
new file mode 100644 (file)
index 0000000..fdf14a4
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailHover
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailHover
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailHover")
+
+void
+_init_hover(Evas_Object *win)
+{
+   Evas_Object *bt, *bt2, *rect, *rect2, *rect3, *hover, *bg;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   rect = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect, 25, 25);
+   evas_object_color_set(rect, 255, 0, 0, 255);
+   evas_object_show(rect);
+
+   rect2 = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect2, 25, 25);
+   evas_object_color_set(rect2, 0, 255, 0, 255);
+   evas_object_show(rect2);
+
+   rect3 = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect3, 25, 25);
+   evas_object_color_set(rect3, 0, 0, 255, 255);
+   evas_object_show(rect3);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Show hover");
+   evas_object_move(bt, 60, 90);
+   evas_object_resize(bt, 80, 20);
+   evas_object_show(bt);
+
+   bt2 = elm_button_add(win);
+   elm_object_text_set(bt2, "Hide hover");
+   evas_object_show(bt2);
+
+   hover = elm_hover_add(win);
+   elm_hover_parent_set(hover, win);
+   elm_hover_target_set(hover, bt);
+   elm_object_style_set(hover, "popout");
+   elm_object_part_content_set(hover, "left", rect);
+   elm_object_part_content_set(hover, "top", rect2);
+   elm_object_part_content_set(hover, "right", rect3);
+   elm_object_part_content_set(hover, "middle", bt2);
+   evas_object_show(hover);
+
+   evas_object_resize(win, 200, 200);
+   evas_object_show(win);
+}
+
+void
+_do_test(AtkObject *obj)
+{
+   AtkObject *parent = atk_object_get_parent(obj);
+   const char *parent_name = g_type_name(G_TYPE_FROM_INSTANCE(parent));
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert_cmpstr(parent_name, ==, "EailWindow");
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_GLASS_PANE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   if (!win) return 1;
+
+   _init_hover(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
diff --git a/eail/tests/eail_hover_tc2.c b/eail/tests/eail_hover_tc2.c
new file mode 100644 (file)
index 0000000..04703cb
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailHover
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailHover
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailHover")
+
+#define ACTIONS_COUNT 1
+
+static int action_test_passed;
+
+static void
+_hide_hover(void *data, Evas_Object *obj, void *event_info)
+{
+   evas_object_hide(data);
+   ++action_test_passed;
+}
+
+void
+_init_hover(Evas_Object *win)
+{
+   Evas_Object *bg, *bt, *bt2, *rect, *rect2, *rect3, *hover;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   rect = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect, 25, 25);
+   evas_object_color_set(rect, 255, 0, 0, 255);
+   evas_object_show(rect);
+
+   rect2 = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect2, 25, 25);
+   evas_object_color_set(rect2, 0, 255, 0, 255);
+   evas_object_show(rect2);
+
+   rect3 = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect3, 25, 25);
+   evas_object_color_set(rect3, 0, 0, 255, 255);
+   evas_object_show(rect3);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Show hover");
+   evas_object_move(bt, 60, 90);
+   evas_object_resize(bt, 80, 20);
+   evas_object_show(bt);
+
+   bt2 = elm_button_add(win);
+   elm_object_text_set(bt2, "Hide hover");
+   evas_object_show(bt2);
+
+   hover = elm_hover_add(win);
+   elm_hover_parent_set(hover, win);
+   elm_hover_target_set(hover, bt);
+   evas_object_smart_callback_add(hover, "clicked", _hide_hover, hover);
+   evas_object_show(hover);
+
+   elm_object_style_set(hover, "popout");
+
+   elm_object_part_content_set(hover, "left", rect);
+   elm_object_part_content_set(hover, "top", rect2);
+   elm_object_part_content_set(hover, "right", rect3);
+   elm_object_part_content_set(hover, "middle", bt2);
+
+   evas_object_resize(win, 200, 200);
+   evas_object_show(win);
+}
+
+void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == ACTIONS_COUNT);
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   g_assert(action_test_passed == 1);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   if (!win) return 1;
+
+   _init_hover(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
diff --git a/eail/tests/eail_hoversel_tc1.c b/eail/tests/eail_hoversel_tc1.c
new file mode 100644 (file)
index 0000000..8b52856
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailHoversel
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailHoversel
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_COUNT 2
+#define ACTION_SHRINK 0
+#define ACTION_EXPAND 1
+#define ITEMS_COUNT 3
+#define ITEM1_NAME "Print items"
+#define ITEM2_NAME "Option 2"
+#define ITEM3_NAME "Clear all items"
+
+INIT_TEST("EailHoversel")
+
+static void
+_init_hoversel(Evas_Object *win)
+{
+   Evas_Object *bg, *rect, *hoversel;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   rect = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_color_set(rect, 255, 0, 0, 255);
+   evas_object_show(rect);
+
+   hoversel = elm_hoversel_add(win);
+   elm_hoversel_hover_parent_set(hoversel, win);
+   elm_hoversel_horizontal_set(hoversel, EINA_FALSE);
+   elm_object_text_set(hoversel, "Hoversel");
+   elm_object_part_content_set(hoversel, "icon", rect);
+
+   elm_hoversel_item_add(hoversel, ITEM1_NAME, NULL, ELM_ICON_NONE,
+                         NULL, NULL);
+   elm_hoversel_item_add(hoversel, ITEM2_NAME, "home", ELM_ICON_STANDARD, NULL,
+                         NULL);
+   elm_hoversel_item_add(hoversel, ITEM3_NAME, "close",
+                         ELM_ICON_STANDARD, NULL, NULL);
+
+   evas_object_resize(hoversel, 180, 30);
+   evas_object_resize(win, 200, 180);
+   evas_object_move(hoversel, 10, 10);
+   evas_object_show(hoversel);
+   elm_hoversel_hover_begin(hoversel);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+   AtkObject *child;
+   char *item_names[] = {ITEM1_NAME, ITEM2_NAME, ITEM3_NAME};
+   int n;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert_cmpstr(type_name, ==, "EailHoversel");
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_n_accessible_children(obj) == ITEMS_COUNT);
+
+   n = ITEMS_COUNT;
+   while (n--)
+     {
+        child = eailu_find_child_with_name(obj, item_names[n]);
+        g_assert(child);
+        g_object_unref(child);
+     }
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_hoversel(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_hoversel_tc2.c b/eail/tests/eail_hoversel_tc2.c
new file mode 100644 (file)
index 0000000..f98530a
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailHoversel
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailHoversel
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_COUNT 2
+#define ACTION_SHRINK 0
+#define ACTION_EXPAND 1
+#define ITEMS_COUNT 3
+#define ITEM1_NAME "Print items"
+#define ITEM2_NAME "Option 2"
+#define ITEM3_NAME "Clear all items"
+
+INIT_TEST("EailHoversel")
+
+static void
+_init_hoversel(Evas_Object *win)
+{
+   Evas_Object *bg, *rect, *hoversel;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   rect = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_color_set(rect, 255, 0, 0, 255);
+   evas_object_show(rect);
+
+   hoversel = elm_hoversel_add(win);
+   elm_hoversel_hover_parent_set(hoversel, win);
+   elm_hoversel_horizontal_set(hoversel, EINA_FALSE);
+   elm_object_text_set(hoversel, "Hoversel");
+   elm_object_part_content_set(hoversel, "icon", rect);
+
+   elm_hoversel_item_add(hoversel, ITEM1_NAME, NULL, ELM_ICON_NONE,
+                         NULL, NULL);
+   elm_hoversel_item_add(hoversel, ITEM2_NAME, "home", ELM_ICON_STANDARD, NULL,
+                         NULL);
+   elm_hoversel_item_add(hoversel, ITEM3_NAME, "close",
+                         ELM_ICON_STANDARD, NULL, NULL);
+
+   evas_object_resize(hoversel, 180, 30);
+   evas_object_resize(win, 200, 180);
+   evas_object_move(hoversel, 10, 10);
+   evas_object_show(hoversel);
+   elm_hoversel_hover_begin(hoversel);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == ACTIONS_COUNT);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   g_assert(atk_action_do_action(ATK_ACTION(obj), ACTION_SHRINK));
+   state_set = atk_object_ref_state_set(obj);
+   atk_state_set_contains_state(state_set, ATK_STATE_DEFAULT);
+   g_object_unref(state_set);
+
+   g_assert(atk_action_do_action(ATK_ACTION(obj), ACTION_EXPAND));
+   state_set = atk_object_ref_state_set(obj);
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_EXPANDED));
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_VERTICAL));
+   g_object_unref(state_set);
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win = NULL;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_hoversel(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_icon_tc1.c b/eail/tests/eail_icon_tc1.c
new file mode 100644 (file)
index 0000000..eb9a24a
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailIcon
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailIcon
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define ICON_NAME "home"
+#define ICON_SIZE 32
+
+INIT_TEST("EailIcon")
+
+static void
+_init_icon(Evas_Object *win)
+{
+   Evas_Object *bg, *icon;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, ICON_NAME);
+   evas_object_resize(icon, ICON_SIZE, ICON_SIZE);
+   evas_object_show(icon);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+   const char *name = atk_object_get_name(obj);
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert_cmpstr(type_name, ==, "EailIcon");
+
+   g_assert_cmpstr(name, ==, ICON_NAME);
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_ICON);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_icon(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_icon_tc2.c b/eail/tests/eail_icon_tc2.c
new file mode 100644 (file)
index 0000000..6ed3dc0
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailIcon
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailIcon
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+#define ICON_NAME "home"
+#define ICON_SIZE 32
+
+INIT_TEST("EailIcon")
+
+static void
+_init_icon(Evas_Object *win)
+{
+   Evas_Object *bg, *icon;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, ICON_NAME);
+   evas_object_resize(icon, ICON_SIZE, ICON_SIZE);
+   evas_object_show(icon);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert(-1 == (eailu_get_action_number(ATK_ACTION(obj), "typo")));
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_icon(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_icon_tc3.c b/eail/tests/eail_icon_tc3.c
new file mode 100644 (file)
index 0000000..7c8a5ca
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Tested interface: AtkImage
+ *
+ * Tested AtkObject: EailIcon
+ *
+ * Description: Test AtkImage interface
+ *
+ * Test input: accessible object representing EailIcon
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+#define ICON_NAME "home"
+#define ICON_SIZE 32
+
+INIT_TEST("EailIcon")
+
+static void
+_init_icon(Evas_Object *win)
+{
+   Evas_Object *bg, *icon;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, ICON_NAME);
+   evas_object_resize(icon, ICON_SIZE, ICON_SIZE);
+   evas_object_show(icon);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *desc;
+   const char *desc_test = "top secret";
+   int height = 0, width = 0;
+   int x = -1, y = -1;
+
+   atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
+   _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
+
+   g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
+   g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
+   desc = atk_image_get_image_description(ATK_IMAGE(obj));
+   g_assert_cmpstr(desc_test, ==, desc);
+
+   atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
+   g_assert(ICON_SIZE == height && ICON_SIZE == width);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_icon(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_image_tc1.c b/eail/tests/eail_image_tc1.c
new file mode 100644 (file)
index 0000000..0d39938
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailImage
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailImage
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailImage")
+
+static void
+_do_test(AtkObject *obj)
+{
+
+   const char *desc_test = "top secret";
+
+   g_assert(ATK_IS_OBJECT(obj));
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
+
+   atk_object_set_description(obj, desc_test);
+   g_assert_cmpstr(atk_object_get_description(obj), ==, desc_test);
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+   AtkStateType state_types[] = {ATK_STATE_ANIMATED, ATK_STATE_RESIZABLE};
+   if (atk_state_set_contains_states(state_set, state_types, 2))
+     _printf("atk_ref_state_set: animated and resizable set\n");
+   g_object_unref(state_set);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_image(Evas_Object *win)
+{
+   Evas_Object *bg, *image;
+   const char * const filename = "./data/whiterabbit01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_color_set(bg, 255, 255, 255);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   image = elm_image_add(win);
+   g_assert(elm_image_file_set(image, filename, NULL));
+   elm_image_no_scale_set(image, EINA_TRUE);
+   elm_image_resizable_set(image, EINA_FALSE, EINA_TRUE);
+   elm_image_smooth_set(image, EINA_FALSE);
+   elm_image_orient_set(image, ELM_IMAGE_FLIP_HORIZONTAL);
+   elm_image_aspect_fixed_set(image, EINA_TRUE);
+   elm_image_fill_outside_set(image, EINA_TRUE);
+   elm_image_editable_set(image, EINA_TRUE);
+   evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, image);
+   evas_object_show(image);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_image(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_image_tc2.c b/eail/tests/eail_image_tc2.c
new file mode 100644 (file)
index 0000000..6d3a1b0
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailImage
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailImage
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+static int action_test_passed;
+
+INIT_TEST("EailImage")
+
+static void
+_on_image_clicked(void *data, Evas_Object *obj, void *ev)
+{
+   _printf("photo clicked called\n");
+   ++action_test_passed;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   g_assert(action_test_passed);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_image(Evas_Object *win)
+{
+   Evas_Object *bg, *image;
+   const char * const filename = "./data/whiterabbit01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_color_set(bg, 255, 255, 255);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   image = elm_image_add(win);
+   g_assert(elm_image_file_set(image, filename, NULL));
+   elm_image_no_scale_set(image, EINA_TRUE);
+   elm_image_resizable_set(image, EINA_FALSE, EINA_TRUE);
+   elm_image_smooth_set(image, EINA_FALSE);
+   elm_image_orient_set(image, ELM_IMAGE_FLIP_HORIZONTAL);
+   elm_image_aspect_fixed_set(image, EINA_TRUE);
+   elm_image_fill_outside_set(image, EINA_TRUE);
+   elm_image_editable_set(image, EINA_TRUE);
+   evas_object_smart_callback_add(image, "clicked", _on_image_clicked, NULL);
+   evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, image);
+   evas_object_show(image);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_image(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_image_tc3.c b/eail/tests/eail_image_tc3.c
new file mode 100644 (file)
index 0000000..608299f
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Tested interface: AtkImage
+ *
+ * Tested AtkObject: EailImage
+ *
+ * Description: Test AtkImage interface implementation
+ *
+ * Test input: accessible object representing EailImage
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailImage")
+
+static void
+_on_image_clicked(void *data, Evas_Object *obj, void *ev)
+{
+   _printf("photo clicked called\n");
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *desc_test = "top secret";
+   const char *desc;
+   int height = 0, width  = 0;
+   int x = -1, y = -1;
+
+   g_assert(ATK_IS_IMAGE(obj));
+
+   atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
+   _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
+
+   g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
+   g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
+   desc = atk_image_get_image_description(ATK_IMAGE(obj));
+   _printf("atk_image_get_image_description: %s\n", desc ? desc : "NULL");
+   g_assert(NULL != desc);
+   g_assert_cmpstr(desc_test, ==, desc);
+
+   atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
+   _printf("atk_image_get_image_size: height %d width %d\n", height, width);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_image(Evas_Object *win)
+{
+   Evas_Object *bg, *image;
+   const char * const filename = "./data/whiterabbit01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_color_set(bg, 255, 255, 255);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   image = elm_image_add(win);
+   g_assert(elm_image_file_set(image, filename, NULL));
+   elm_image_no_scale_set(image, EINA_TRUE);
+   elm_image_resizable_set(image, EINA_FALSE, EINA_TRUE);
+   elm_image_smooth_set(image, EINA_FALSE);
+   elm_image_orient_set(image, ELM_IMAGE_FLIP_HORIZONTAL);
+   elm_image_aspect_fixed_set(image, EINA_TRUE);
+   elm_image_fill_outside_set(image, EINA_TRUE);
+   elm_image_editable_set(image, EINA_TRUE);
+   evas_object_smart_callback_add(image, "clicked", _on_image_clicked, NULL);
+   evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, image);
+   evas_object_show(image);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_image(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_index_tc1.c b/eail/tests/eail_index_tc1.c
new file mode 100644 (file)
index 0000000..98732eb
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailIndex
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailIndex
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define INDEX_NAME "index"
+
+INIT_TEST("EailIndex")
+
+static void
+_test_index_child_for_object(AtkObject *obj, int index)
+{
+   g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(obj)));
+   g_assert(atk_selection_add_selection(ATK_SELECTION(obj), index));
+
+   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), index));
+   g_assert(1 == atk_selection_get_selection_count(ATK_SELECTION(obj)));
+
+   g_assert(atk_selection_clear_selection(ATK_SELECTION(obj)));
+   g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(obj)));
+}
+static void
+_do_test(AtkObject *obj)
+{
+   int n_children = 0, i = 0;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_name(obj, INDEX_NAME"test");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, INDEX_NAME"test");
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_LIST);
+
+   eailu_test_atk_focus(obj, FALSE);
+   n_children = atk_object_get_n_accessible_children(obj);
+   /* there should be 13 index entries */
+   g_assert(13 == n_children);
+   for (i = 0; i < n_children; ++i)
+     {
+        _test_index_child_for_object(obj, i);
+     }
+
+   eailu_test_code_called = 1;
+}
+
+struct _Idx_Data_Type
+{
+   Evas_Object *id;  /* Pointer to Index */
+   Elm_Object_Item *item; /* Item we use for search */
+};
+typedef struct _Idx_Data_Type Idx_Data_Type;
+
+struct _api_data
+{
+   unsigned int state;  /* What state we are testing       */
+   Idx_Data_Type dt;
+};
+typedef struct _api_data api_data;
+
+enum _api_state
+{
+   INDEX_LEVEL_SET,
+   INDEX_ACTIVE_SET,
+   INDEX_APPEND_RELATIVE,
+   INDEX_PREPEND,
+   INDEX_ITEM_DEL,
+   INDEX_ITEM_FIND,
+   INDEX_HORIZONTAL,
+   INDEX_INDICATOR_DISABLED,
+   INDEX_CLEAR,
+   API_STATE_LAST
+};
+typedef enum _api_state api_state;
+
+static Elm_Genlist_Item_Class itci;
+char *gli_text_get(void *data, Evas_Object *obj, const char *part )
+{
+   char buf[256];
+   int j = (uintptr_t)data;
+   snprintf(buf, sizeof(buf), "%c%c",
+            'A' + ((j >> 4) & 0xf),
+            'a' + ((j     ) & 0xf)
+            );
+   return strdup(buf);
+}
+
+void
+_index_delay_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   // called on a change but delayed in case multiple changes happen in a
+   // short timespan
+   elm_genlist_item_bring_in(elm_object_item_data_get(event_info),
+                              ELM_GENLIST_ITEM_SCROLLTO_TOP);
+}
+
+void
+_index_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   // this is called on every change, no matter how often
+   // elm_genlist_item_bring_in(event_info);
+}
+
+void
+_index_selected_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   // called on final select
+   const Elm_Object_Item *item = elm_index_selected_item_get(obj, 0);
+   _printf("Index selected %s\n", elm_index_item_letter_get(item));
+   elm_genlist_item_bring_in(elm_object_item_data_get(event_info),
+                              ELM_GENLIST_ITEM_SCROLLTO_TOP);
+}
+
+static void
+_cleanup_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   free(data);
+}
+
+static void
+id_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   printf("Current Index : %s\n", elm_index_item_letter_get((const Elm_Object_Item *)event_info));
+}
+
+static void
+_init_index(Evas_Object *win)
+{
+   Evas_Object *bxx, *gl, *id;
+   Elm_Object_Item *glit;
+   int i, j;
+   api_data *api = calloc(1, sizeof(api_data));
+
+   evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
+
+   bxx = elm_box_add(win);
+   elm_win_resize_object_add(win, bxx);
+   evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bxx);
+
+   gl = elm_genlist_add(win);
+   evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(gl);
+
+   api->dt.id = id = elm_index_add(win);
+   evas_object_size_hint_weight_set(id, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(id, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(win, id);
+
+   evas_object_show(id);
+
+   itci.item_style     = "default";
+   itci.func.text_get = gli_text_get;
+   itci.func.content_get  = NULL;
+   itci.func.state_get = NULL;
+   itci.func.del       = NULL;
+
+   j = 0;
+   for (i = 0; i < 100; i++)
+     {
+        glit = elm_genlist_item_append(gl, &itci,
+                                       (void *)(uintptr_t)j/* item data */,
+                                       NULL/* parent */,
+                                       ELM_GENLIST_ITEM_NONE,
+                                       NULL/* func */, NULL/* func data */);
+        if (!(j & 0xf))
+          {
+             char buf[32];
+
+             snprintf(buf, sizeof(buf), "%c", 'A' + ((j >> 4) & 0xf));
+             elm_index_item_append(id, buf, id_cb, glit);
+             if (*buf == 'G')  /* Just init dt->item later used in API test */
+               api->dt.item = glit;
+          }
+        j += 2;
+     }
+   evas_object_smart_callback_add(id, "delay,changed", _index_delay_changed_cb, NULL);
+   evas_object_smart_callback_add(id, "changed", _index_changed_cb, NULL);
+   evas_object_smart_callback_add(id, "selected", _index_selected_cb, NULL);
+   elm_index_level_go(id, 0);
+
+   elm_box_pack_end(bxx, gl);
+
+   evas_object_show(id);
+
+   evas_object_resize(win, 320, 250);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_index(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_inwin_tc1.c b/eail/tests/eail_inwin_tc1.c
new file mode 100644 (file)
index 0000000..4b5dce7
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailInwin
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailInwin
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define CHILDREN_COUNT 1
+
+INIT_TEST("EailInwin")
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkObject *child;
+   const char *child_name;
+
+   g_assert(ATK_IS_OBJECT(obj));
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_GLASS_PANE);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_n_accessible_children(obj) == CHILDREN_COUNT);
+
+   child = atk_object_ref_accessible_child(obj, 0);
+   g_assert(child);
+   child_name = g_type_name(G_TYPE_FROM_INSTANCE(child));
+   g_assert_cmpstr(child_name, ==, "EailButton");
+   g_object_unref(child);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_inwin(Evas_Object *win)
+{
+   Evas_Object *o, *bg, *parent, *inwin;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   parent = win;
+   inwin = elm_win_inwin_add(parent);
+   elm_object_style_set(inwin, "default");
+   evas_object_show(inwin);
+   elm_win_inwin_activate(inwin);
+
+   o = elm_button_add(parent);
+   elm_object_text_set(o, "Test");
+   evas_object_show(o);
+
+   elm_win_inwin_content_set(inwin, o);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char *argv[])
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_inwin(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_label_tc1.c b/eail/tests/eail_label_tc1.c
new file mode 100644 (file)
index 0000000..ef44fab
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailLabel
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailLabel
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailLabel")
+
+static void
+_init_label(Evas_Object *win)
+{
+   Evas_Object *bg, *label;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   label = elm_label_add(win);
+   elm_object_text_set(label, "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"
+                       "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
+                       "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris"
+                       "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in"
+                       "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla"
+                       "pariatur. Excepteur sint occaecat cupidatat non proident, sunt"
+                       "in culpa qui officia deserunt mollit anim id est laborum.");
+   elm_label_line_wrap_set(label, ELM_WRAP_WORD);
+   evas_object_resize(label, 200, 170);
+   evas_object_move(label, 0, 0);
+   evas_object_show(label);
+
+   evas_object_resize(win, 200, 320);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_LABEL);
+
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_MULTI_LINE));
+   g_object_unref(state_set);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_label(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
+
diff --git a/eail/tests/eail_label_tc2.c b/eail/tests/eail_label_tc2.c
new file mode 100644 (file)
index 0000000..c96328f
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Tested interface: AtkText
+ *
+ * Tested AtkObject: EailLabel
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailLabel
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailLabel")
+
+static void
+_init_label(Evas_Object *win)
+{
+   Evas_Object *bg, *label;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   label = elm_label_add(win);
+   elm_object_text_set(label, "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"
+                       "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
+                       "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris"
+                       "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in"
+                       "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla"
+                       "pariatur. Excepteur sint occaecat cupidatat non proident, sunt"
+                       "in culpa qui officia deserunt mollit anim id est laborum.");
+   elm_label_line_wrap_set(label, ELM_WRAP_WORD);
+   evas_object_resize(label, 200, 170);
+   evas_object_move(label, 0, 0);
+   evas_object_show(label);
+
+   evas_object_resize(win, 200, 320);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int start_offset, end_offset;
+   AtkAttributeSet *elem = NULL, *at_set = NULL;
+   AtkAttribute *attr = NULL;
+   gboolean wrap_exist = FALSE, editable_exist = FALSE;
+
+   g_assert(ATK_IS_TEXT(obj));
+
+   gchar *text = atk_text_get_text(ATK_TEXT(obj), 6, 11);
+   g_assert_cmpstr(text, ==, "ipsum");
+   g_free(text);
+
+   g_assert(atk_text_get_character_at_offset(ATK_TEXT(obj), 12) == 'd');
+
+   g_assert(atk_text_get_character_count(ATK_TEXT(obj)) == 440);
+
+   at_set = atk_text_get_run_attributes
+       (ATK_TEXT(obj), 0, &start_offset, &end_offset);
+   g_assert(at_set);
+
+   for (elem = at_set; elem; elem = elem->next)
+     {
+        attr = (AtkAttribute *)elem->data;
+        if (0 == g_strcmp0(attr->name, atk_text_attribute_get_name
+                           (ATK_TEXT_ATTR_WRAP_MODE)))
+          wrap_exist = TRUE;
+        else if (0 == g_strcmp0(attr->name, atk_text_attribute_get_name
+                                (ATK_TEXT_ATTR_EDITABLE)))
+          editable_exist = TRUE;
+     }
+
+   g_assert(0 == start_offset);
+   g_assert(atk_text_get_character_count(ATK_TEXT(obj)) == end_offset);
+
+   g_assert(wrap_exist);
+   g_assert(editable_exist);
+
+   /* out of bounds offset in run attributes test*/
+   at_set = atk_text_get_run_attributes
+       (ATK_TEXT(obj), atk_text_get_character_count
+        (ATK_TEXT(obj)), &start_offset, &end_offset);
+   g_assert(NULL == at_set);
+   g_assert(-1 == start_offset);
+   g_assert(-1 == end_offset);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_label(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
+
diff --git a/eail/tests/eail_layout_tc1.c b/eail/tests/eail_layout_tc1.c
new file mode 100644 (file)
index 0000000..5876006
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailLayout
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailLayout
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailLayout")
+
+static void
+_do_test(AtkObject *object)
+{
+   int child_count;
+
+   atk_object_set_description(object, "test");
+   g_assert_cmpstr(atk_object_get_description(object), ==, "test");
+
+   atk_object_set_name(object, "test name");
+   g_assert_cmpstr(atk_object_get_name(object), ==, "test name");
+
+   eailu_test_code_called++;
+   child_count = atk_object_get_n_accessible_children(object);
+   if (eailu_test_code_called == 1)
+     g_assert(2 == child_count);
+   else
+     g_assert(3 == child_count);
+
+   for(int i =0; i < child_count; i++)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(object, i);
+        gboolean success = FALSE;
+        if (eailu_test_code_called == 1)
+          success = eailu_is_object_with_role(child, ATK_ROLE_ICON);
+        else
+          success = eailu_is_object_with_role(child, ATK_ROLE_PUSH_BUTTON);
+        g_object_unref(child);
+        g_assert(success);
+     }
+
+   g_assert(eailu_is_object_with_role(object, ATK_ROLE_FILLER));
+   g_assert(2 >= eailu_test_code_called);
+}
+
+
+static void
+_init_layout(Evas_Object *win)
+{
+   Evas_Object *box, *ly, *bt;
+   char buf[PATH_MAX];
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   ly = elm_layout_add(win);
+
+   if (!elm_layout_theme_set(
+           ly, "layout", "application", "titlebar"))
+     fprintf(stderr, "Failed to set layout");
+
+   elm_object_part_text_set(ly, "elm.text", "Some title");
+   evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, ly);
+   evas_object_show(ly);
+
+   bt = elm_icon_add(win);
+   elm_icon_standard_set(bt, "chat");
+   evas_object_size_hint_min_set(bt, 20, 20);
+   elm_layout_icon_set(ly, bt);
+
+   bt = elm_icon_add(win);
+   elm_icon_standard_set(bt, "close");
+   evas_object_size_hint_min_set(bt, 20, 20);
+   elm_layout_end_set(ly, bt);
+
+   ly = elm_layout_add(win);
+   snprintf(buf, sizeof(buf), "%s/test.edj","./data/");
+   elm_layout_file_set(ly, buf, "layout");
+   evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(box, ly);
+   //elm_win_resize_object_add(win, ly);
+   evas_object_show(ly);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Button 1");
+   elm_object_part_content_set(ly, "element1", bt);
+   evas_object_show(bt);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Button 2");
+   elm_object_part_content_set(ly, "element2", bt);
+   evas_object_show(bt);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Button 3");
+   elm_object_part_content_set(ly, "element3", bt);
+   evas_object_show(bt);
+
+   evas_object_show(win);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_layout(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
+
diff --git a/eail/tests/eail_list_tc1.c b/eail/tests/eail_list_tc1.c
new file mode 100644 (file)
index 0000000..14fe87b
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailList
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree. Test
+ *    accessible children availability. Test focus.
+ *
+ * Test input: accessible object representing EailList
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailList")
+
+static Evas_Object *glob_elm_list = NULL;
+
+void
+_do_test(AtkObject *aobj)
+{
+   int child_amount = 0, i = 0;
+
+   g_assert(ATK_IS_OBJECT(aobj));
+
+   g_assert(atk_object_get_role(aobj) == ATK_ROLE_LIST);
+
+   child_amount = atk_object_get_n_accessible_children(aobj);
+   g_assert(7 == child_amount);
+
+   /* For list widget focusing work */
+   eailu_test_atk_focus(aobj, TRUE);
+
+   /* checking list items implementation */
+     for (i = 0; i < child_amount; i++)
+      {
+         AtkObject *child = atk_object_ref_accessible_child(aobj, i);
+         _printf("Child amount %d\n", atk_object_get_n_accessible_children(child));
+         g_assert(2 == atk_object_get_n_accessible_children(child));
+
+         g_object_unref(child);
+       }
+
+   eailu_test_code_called = 1;
+}
+
+void
+_init_list(Evas_Object *win)
+{
+   Evas_Object *box, *entry;
+   int i = 0;
+
+   static const char *lbl[] =
+      {
+         "Sunday",
+         "Monday",
+         "Tuesday",
+         "Wednesday",
+         "Thursday",
+         "Friday",
+         "Saturday"
+      };
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   glob_elm_list = elm_list_add(win);
+   evas_object_size_hint_weight_set(glob_elm_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(glob_elm_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_tree_focus_allow_set(win, EINA_TRUE);
+
+   entry = elm_entry_add(win);
+   elm_entry_single_line_set(entry, EINA_TRUE);
+   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(entry);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_list_item_append(glob_elm_list, lbl[i], entry, entry, NULL, NULL);
+
+   elm_box_pack_end(box, glob_elm_list);
+
+   elm_list_go(glob_elm_list);
+   evas_object_show(glob_elm_list);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_list(win);
+
+   /* and show the window */
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_list_tc2.c b/eail/tests/eail_list_tc2.c
new file mode 100644 (file)
index 0000000..e4c20fc
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailList
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailList
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailList")
+
+static Evas_Object *glob_elm_list = NULL;
+
+void
+_do_test(AtkObject *aobj)
+{
+   int n_actions = 0;
+
+   g_assert(ATK_IS_ACTION(aobj));
+   n_actions = atk_action_get_n_actions(ATK_ACTION(aobj));
+   g_assert(4 == n_actions);
+
+   /* scroll up*/
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_up");
+
+   /* scroll_down */
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_down");
+
+   /* scroll_left */
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_left");
+
+   /* scroll_right*/
+   eailu_test_action_activate(ATK_ACTION(aobj), "scroll_right");
+
+   /* description test */
+   eailu_test_action_description_all(ATK_ACTION(aobj));
+
+   eailu_test_code_called = 1;
+}
+
+void
+_init_list(Evas_Object *win)
+{
+   Evas_Object *box, *entry;
+   int i = 0;
+
+   static const char *lbl[] =
+     {
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+     };
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   glob_elm_list = elm_list_add(win);
+   evas_object_size_hint_weight_set(glob_elm_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(glob_elm_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_tree_focus_allow_set(win, EINA_TRUE);
+
+   entry = elm_entry_add(win);
+   elm_entry_single_line_set(entry, EINA_TRUE);
+   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(entry);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_list_item_append(glob_elm_list, lbl[i], entry, entry, NULL, NULL);
+
+   elm_box_pack_end(box, glob_elm_list);
+
+   elm_list_go(glob_elm_list);
+   evas_object_show(glob_elm_list);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_list(win);
+
+   /* and show the window */
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_list_tc3.c b/eail/tests/eail_list_tc3.c
new file mode 100644 (file)
index 0000000..09d9077
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Tested interface: AtkSelection
+ *
+ * Tested AtkObject: EailList
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailList
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_LIST "EailList"
+#define EAIL_TYPE_FOR_LIST_ITEM "EailItem"
+
+static Evas_Object *glob_elm_list = NULL;
+
+INIT_TEST("EailList")
+
+void
+_test_list_item_interfaces(AtkObject *item_object)
+{
+   g_assert(ATK_IS_OBJECT(item_object));
+   g_assert(eailu_is_object_with_type(item_object, EAIL_TYPE_FOR_LIST_ITEM));
+
+   /**
+    * for single list items focusing does NOT work
+    */
+   eailu_test_atk_focus(item_object, FALSE);
+
+   g_assert(ATK_IS_ACTION(item_object));
+}
+
+void
+_test_item_selection_single(AtkObject *parent, AtkObject *child, int index)
+{
+   g_assert(ATK_IS_SELECTION(parent));
+   /* in single selection mode it should return FALSE */
+   g_assert(!atk_selection_select_all_selection(ATK_SELECTION(parent)));
+   g_assert
+      (FALSE == atk_selection_is_child_selected(ATK_SELECTION(parent), index));
+
+   /* NOTE: calling click action to select child*/
+  eailu_test_action_activate(ATK_ACTION(child), "click");
+  g_assert(atk_selection_is_child_selected(ATK_SELECTION(parent), index));
+  g_assert(1 == atk_selection_get_selection_count(ATK_SELECTION(parent)));
+
+  /* now removing selection using atk_selection interface */
+  g_assert(atk_selection_remove_selection(ATK_SELECTION(parent),index));
+  g_assert
+     (FALSE == atk_selection_is_child_selected(ATK_SELECTION(parent), index));
+  g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(parent)));
+}
+
+void
+_test_multiselection_list(AtkObject *atk_list)
+{
+   elm_list_multi_select_set(glob_elm_list, EINA_TRUE);
+   g_assert(atk_selection_select_all_selection(ATK_SELECTION(atk_list)));
+
+   /* all children should be now selected */
+   g_assert(7 == atk_selection_get_selection_count(ATK_SELECTION(atk_list)));
+
+   /* now clearing selection */
+   g_assert(atk_selection_clear_selection(ATK_SELECTION(atk_list)));
+   g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(atk_list)));
+}
+
+void
+_do_test(AtkObject *aobj)
+{
+   int child_amount = 0, i = 0;
+
+   /* checking list items implementation */
+     for (i = 0; i < child_amount; i++)
+      {
+         AtkObject *child = atk_object_ref_accessible_child(aobj, i);
+         _test_list_item_interfaces(child);
+         _test_item_selection_single(aobj, child, i);
+         /* each list item has inside 2 text entry objects */
+         printf("Child amount %d\n", atk_object_get_n_accessible_children(child));
+         g_assert(2 == atk_object_get_n_accessible_children(child));
+         g_object_unref(child);
+       }
+
+   /* now quick check if multiselection on list works properly*/
+   _test_multiselection_list(aobj);
+
+   eailu_test_code_called = 1;
+}
+
+void
+_init_list(Evas_Object *win)
+{
+   Evas_Object *box, *entry;
+   int i = 0;
+
+   static const char *lbl[] =
+      {
+         "Sunday",
+         "Monday",
+         "Tuesday",
+         "Wednesday",
+         "Thursday",
+         "Friday",
+         "Saturday"
+      };
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   glob_elm_list = elm_list_add(win);
+   evas_object_size_hint_weight_set(glob_elm_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(glob_elm_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_tree_focus_allow_set(win, EINA_TRUE);
+
+   entry = elm_entry_add(win);
+   elm_entry_single_line_set(entry, EINA_TRUE);
+   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(entry);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     elm_list_item_append(glob_elm_list, lbl[i], entry, entry, NULL, NULL);
+
+   elm_box_pack_end(box, glob_elm_list);
+
+   elm_list_go(glob_elm_list);
+   evas_object_show(glob_elm_list);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_list(win);
+
+   /* and show the window */
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_map_tc1.c b/eail/tests/eail_map_tc1.c
new file mode 100644 (file)
index 0000000..ca02023
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailMap
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailMap
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailMap")
+
+static void
+_do_test(AtkObject *object)
+{
+   g_assert(ATK_IS_OBJECT(object));
+   atk_object_set_description(object, "test");
+   g_assert_cmpstr(atk_object_get_description(object), ==, "test");
+
+   atk_object_set_name(object, "test name");
+   g_assert_cmpstr(atk_object_get_name(object), ==, "test name");
+
+   g_assert(eailu_is_object_with_role(object, ATK_ROLE_IMAGE_MAP));
+
+   g_assert(atk_object_get_name(object) != NULL);
+
+   eailu_test_atk_focus(object, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_map(Evas_Object *win)
+{
+   Evas_Object *bg, *map;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   map = elm_map_add(win);
+   elm_win_resize_object_add(win, map);
+   evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(map);
+
+   //evas_object_smart_callback_add(map, "loaded", _on_map_loaded, NULL);
+   elm_map_zoom_set(map, 6);
+   elm_map_region_show(map, 19.45, 51.75);
+   evas_object_resize(win, 512, 512);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_map(win);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_map_tc2.c b/eail/tests/eail_map_tc2.c
new file mode 100644 (file)
index 0000000..1aa60fa
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailMap
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailMap
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+static int test_passed;
+
+static void
+_on_done(void *data, Evas_Object *object, void *event_info)
+{
+   elm_exit();
+}
+
+static void
+_do_test(AtkObject *object)
+{
+   int w,h;
+   gboolean result;
+   const gchar *description;
+
+   g_assert(eailu_is_object_with_role(object, ATK_ROLE_IMAGE_MAP));
+   g_assert(atk_object_get_name(object) != NULL);
+   atk_image_get_image_size(ATK_IMAGE(object), &w, &h);
+   g_assert(w == 512);
+   g_assert(h == 512);
+   result = atk_image_set_image_description(ATK_IMAGE(object),
+                                            "This is a map");
+   g_assert(result);
+   description = atk_image_get_image_description(ATK_IMAGE(object));
+   g_assert(!strcmp(description, "This is a map"));
+
+   test_passed++;
+}
+
+static void
+_on_map_loaded(void *data, Evas_Object *obj, void *event_info)
+{
+   AtkObject *aobj = atk_get_root();
+   if (aobj)
+     eailu_traverse_children_for_type_call_cb(aobj, "EailMap", _do_test);
+
+   g_assert(test_passed);
+
+   _on_done(NULL, obj, NULL);
+}
+
+static void
+_init_map(Evas_Object *win)
+{
+   Evas_Object *bg, *map;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   map = elm_map_add(win);
+   elm_win_resize_object_add(win, map);
+   evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(map);
+
+   evas_object_smart_callback_add(map, "loaded", _on_map_loaded, NULL);
+   elm_map_zoom_set(map, 6);
+   elm_map_region_show(map, 19.45, 51.75);
+   evas_object_resize(win, 512, 512);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(NULL, NULL);
+   _init_map(win);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_map_tc3.c b/eail/tests/eail_map_tc3.c
new file mode 100644 (file)
index 0000000..1118e69
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailMap
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailMap
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailMap")
+
+static void
+_do_test(AtkObject *object)
+{
+   int n;
+   int i;
+
+   g_assert(ATK_IS_ACTION(object));
+
+   eailu_test_action_description_all(ATK_ACTION(object));
+
+   n = atk_action_get_n_actions(ATK_ACTION(object));
+   g_assert(n == 8);
+
+   for (i = 0; i < n; ++i)
+     {
+        const char *name = atk_action_get_name(ATK_ACTION(object), i);
+        eailu_test_action_activate(ATK_ACTION(object), name);
+     }
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_map(Evas_Object *win)
+{
+   Evas_Object *bg, *map;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   map = elm_map_add(win);
+   elm_win_resize_object_add(win, map);
+   evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(map);
+
+   elm_map_zoom_set(map, 6);
+   elm_map_region_show(map, 19.45, 51.75);
+   evas_object_resize(win, 512, 512);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_map(win);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_mapbuf_tc1.c b/eail/tests/eail_mapbuf_tc1.c
new file mode 100644 (file)
index 0000000..3d17715
--- /dev/null
@@ -0,0 +1 @@
+/*\r * Tested interface: AtkObject\r *\r * Tested AtkObject: EailMapbuf\r *\r * Description: Test AtkObject interface\r *\r * Test input: accessible object representing EailMapbuf\r *\r * Expected test result: test should return 0 (success)\r */\r\r#include <Elementary.h>\r#include <atk/atk.h>\r\r#include "eail_test_utils.h"\r\rINIT_TEST("EailMapbuf")\r\rstatic void\r_do_test(AtkObject *object)\r{\r   int child_count = atk_object_get_n_accessible_children(object);\r   g_assert(child_count == 1);\r   atk_object_set_description(object, "test");\r   g_assert_cmpstr(atk_object_get_description(object), ==, "test");\r\r   atk_object_set_name(object, "test name");\r   g_assert_cmpstr(atk_object_get_name(object), ==, "test name");\r\r   AtkStateSet *state_set = atk_object_ref_state_set(object);\r   gboolean enabled = atk_state_set_contains_state(state_set,\r                                                   ATK_STATE_ENABLED);\r   g_object_unref(state_set);\r   g_assert(enabled);\r\r   AtkObject *child = atk_object_ref_accessible_child(object, 0);\r   g_assert(ATK_IS_OBJECT(child));\r   child_count = atk_object_get_n_accessible_children(child);\r   for (int i = 0; i < child_count; i++)\r     {\r        AtkObject *image = atk_object_ref_accessible_child(child, i);\r        gboolean is_image = ATK_IS_IMAGE(image);\r        g_object_unref(image);\r        g_assert(is_image);\r     }\r   g_object_unref(child);\r   g_assert(child_count == 25);\r\r   eailu_test_atk_focus(object, FALSE);\r\r   eailu_test_code_called = 1;\r}\r\rstatic void\r_init_mapbuf(Evas_Object *win)\r{\r   Evas_Object *bg, *bx, *mb, *grid, *ic;\r   unsigned int i, j;\r\r   bg = elm_bg_add(win);\r   elm_win_resize_object_add(win, bg);\r   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r   evas_object_show(bg);\r\r   bx = elm_box_add(win);\r   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);\r   elm_win_resize_object_add(win, bx);\r   evas_object_show(bx);\r\r   mb = elm_mapbuf_add(win);\r   evas_object_size_hint_weight_set(mb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r   evas_object_size_hint_align_set(mb, EVAS_HINT_FILL, EVAS_HINT_FILL);\r   elm_box_pack_end(bx, mb);\r\r   grid = elm_grid_add(win);\r   elm_grid_size_set(grid, 200, 200);\r   evas_object_show(grid);\r   for (i = 0; i < 5; i++)\r     {\r        for (j = 0; j < 5; j++)\r          {\r             int w, h;\r             ic = elm_icon_add(win);\r             elm_icon_standard_set(ic, "home");\r             elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);\r             evas_object_show(ic);\r             elm_image_object_size_get(ic, &w, &h);\r             elm_grid_pack(grid, ic, 5 + (w * i),  5 + (h * j) , w, h);\r          }\r     }\r\r   elm_object_content_set(mb, grid);\r   elm_mapbuf_enabled_set(mb, EINA_TRUE);\r   elm_mapbuf_alpha_set(mb, EINA_TRUE);\r   elm_mapbuf_smooth_set(mb, EINA_TRUE);\r   evas_object_show(mb);\r}\r\rEAPI_MAIN int\relm_main(int argc, char **argv)\r{\r   Evas_Object *win;\r\r   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);\r   _init_mapbuf(win);\r   evas_object_resize(win, 700, 500);\r   evas_object_show(win);\r\r   elm_run();\r   elm_shutdown();\r\r   return 0;\r}\rELM_MAIN()\r
\ No newline at end of file
diff --git a/eail/tests/eail_menu_tc1.c b/eail/tests/eail_menu_tc1.c
new file mode 100644 (file)
index 0000000..f15ca4f
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailMenu
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree. Test
+ *    accessible children availability.
+ *
+ * Test input: accessible object representing EailMenu
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_MENU "EailMenu"
+#define EAIL_TYPE_FOR_MENU_ITEM "EailMenuItem"
+#define T_MENU_ITEM_WITH_NO_CHILD_NAME "first item"
+#define T_SUBM_WITH_ICON_NAME "RJ Menu 1 with icon"
+#define T_NESTED_BUTTON_NAME "button - delete items (2nd level)"
+#define T_MENU_WITH_SUB_AND_ICON_NAME "second item"
+#define T_CUSTOM_NAME_FOR_ITEM "Custom name set to nested button"
+#define T_CUSTOM_DESCRIPTION "Description for testing"
+
+INIT_TEST("EailMenu")
+
+static void
+_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   Evas_Event_Mouse_Down *ev = event_info;
+   elm_menu_move(data, ev->canvas.x, ev->canvas.y);
+   evas_object_show(data);
+}
+
+static void
+_do_test(AtkObject *aobj)
+{
+   AtkObject *found_obj = NULL;
+   int child_amount = 0;
+
+   found_obj = eailu_find_child_with_name(aobj, T_SUBM_WITH_ICON_NAME);
+   atk_object_set_description(aobj, "test");
+   g_assert_cmpstr(atk_object_get_description(aobj), ==, "test");
+
+   g_assert(found_obj);
+
+   /* checking if nested button can be found */
+   found_obj = eailu_find_child_with_name(aobj, T_NESTED_BUTTON_NAME);
+   g_assert(found_obj);
+
+   /* checking if menu with submenus AND nested icon can be found */
+   found_obj = eailu_find_child_with_name(aobj, T_MENU_WITH_SUB_AND_ICON_NAME);
+   g_assert(found_obj);
+   eailu_test_atk_focus(found_obj, FALSE);
+
+   /* cheking if name/description change can be done for item */
+   atk_object_set_name(found_obj, T_CUSTOM_NAME_FOR_ITEM);
+   g_assert(0 == g_strcmp0
+                    (T_CUSTOM_NAME_FOR_ITEM, atk_object_get_name(found_obj)));
+   atk_object_set_description(found_obj, T_CUSTOM_DESCRIPTION);
+   g_assert(0 == g_strcmp0
+               (T_CUSTOM_DESCRIPTION, atk_object_get_description(found_obj)));
+
+   /* submenu with icons should have 7 children - one for each of 5 submenus,
+    * plus 1 for separator, which is shown as MENU ITEM with empty name
+    * plus 1 for nested ICON */
+   child_amount = atk_object_get_n_accessible_children(found_obj);
+   g_assert(7 == child_amount);
+
+   eailu_test_code_called = TRUE;
+}
+
+
+static void
+_init_menu(Evas_Object *win)
+{
+   Evas_Object *menu, *button;
+   Elm_Object_Item *menu_it, *menu_it1;
+
+   menu = elm_menu_add(win);
+   elm_object_tree_focus_allow_set(win, EINA_TRUE);
+
+   elm_menu_item_add
+            (menu, NULL, NULL, T_MENU_ITEM_WITH_NO_CHILD_NAME, NULL, NULL);
+   menu_it = elm_menu_item_add
+               (menu, NULL, "mail-reply-all", T_MENU_WITH_SUB_AND_ICON_NAME,
+                NULL, NULL );
+   elm_menu_item_add
+      (menu, menu_it, "object-rotate-left", T_SUBM_WITH_ICON_NAME, NULL, NULL);
+
+   button = elm_button_add(win);
+   elm_object_text_set(button, T_NESTED_BUTTON_NAME);
+   menu_it1 = elm_menu_item_add(menu, menu_it, NULL, NULL, NULL, NULL );
+   elm_object_item_content_set(menu_it1, button);
+
+   /* separator by atk is treated as empty MENU ITEM */
+   elm_menu_item_separator_add(menu, menu_it);
+   elm_menu_item_add(menu, menu_it, NULL, "third item (2nd lev)", NULL, NULL);
+   elm_menu_item_add(menu, menu_it, NULL, "fourth item (2nd lev)", NULL, NULL);
+   elm_menu_item_add
+         (menu, menu_it, "window-new", "sub menu (2nd lev)", NULL, NULL );
+
+   menu_it = elm_menu_item_add(menu, NULL, NULL, "third item", NULL, NULL );
+   elm_object_item_disabled_set(menu_it, EINA_TRUE );
+
+   evas_object_event_callback_add(win, EVAS_CALLBACK_MOUSE_DOWN, _show, menu);
+   evas_object_show(menu);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_menu(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_multibuttonentry_tc1.c b/eail/tests/eail_multibuttonentry_tc1.c
new file mode 100644 (file)
index 0000000..43fc291
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Tested interface: AtkAobject
+ *
+ * Tested AtkObject: EailMultibuttonEntry
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailMultibuttonEntry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_MBE "EailMultibuttonentry"
+#define EAIL_TEST_INPUT_TEXT "Input text"
+
+INIT_TEST("EailMultibuttonentry")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_amount = 0, i =0;
+   AtkObject *nested_obj;
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+   /* standard tests, types, child num etc.*/
+   child_amount = atk_object_get_n_accessible_children(obj);
+   g_assert(4 == child_amount);
+   for (i = 0; i < child_amount; ++i)
+     {
+        nested_obj = atk_object_ref_accessible_child(obj, i);
+        g_assert(nested_obj);
+        eailu_is_object_with_role(nested_obj, ATK_ROLE_LABEL);
+        eailu_is_object_with_type(nested_obj, "EailItem");
+
+        g_object_unref(nested_obj);
+     }
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_multibuttonentry(Evas_Object *win)
+{
+   Evas_Object *scroller, *bg, *box, *mb_entry;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   scroller = elm_scroller_add(win);
+   elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+   elm_scroller_policy_set
+       (scroller, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);
+   evas_object_show(scroller);
+
+   mb_entry = elm_multibuttonentry_add(win);
+   elm_object_part_text_set(mb_entry, "guide", "Tap to add recipient");
+   elm_object_text_set(mb_entry, EAIL_TEST_INPUT_TEXT);
+   evas_object_size_hint_weight_set(mb_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(mb_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_content_set(scroller, mb_entry);
+   evas_object_show(mb_entry);
+
+   elm_multibuttonentry_item_append(mb_entry, "first", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "second", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "third", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "fourth", NULL, NULL);
+
+   elm_object_focus_set(mb_entry, EINA_TRUE);
+   elm_box_pack_end(box, mb_entry);
+
+   evas_object_resize(win, 130, 180);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_multibuttonentry(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_multibuttonentry_tc2.c b/eail/tests/eail_multibuttonentry_tc2.c
new file mode 100644 (file)
index 0000000..53357eb
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailMultibuttonentry
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailMultibuttonentry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_MBE "EailMultibuttonentry"
+#define EAIL_TEST_INPUT_TEXT "Input text"
+#define EAIL_TEST_CHANGED_TEXT "custom text"
+
+INIT_TEST("EailMultibuttonentry")
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkStateSet *state_set;
+
+   g_assert(ATK_IS_ACTION(obj));
+
+   /* atk_action_get_n_actions test */
+   g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == 2);
+
+   eailu_test_action_activate(ATK_ACTION(obj), "shrink");
+   state_set = atk_object_ref_state_set(obj);
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_DEFAULT));
+   g_object_unref(state_set);
+
+   eailu_test_action_activate(ATK_ACTION(obj), "expand");
+   state_set = atk_object_ref_state_set(obj);
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_EXPANDED));
+   g_object_unref(state_set);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+   _printf("DONE. All multibutton_entry tests passed successfully \n");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_multibutton_entry(Evas_Object *win)
+{
+   Evas_Object *scroller, *bg, *box, *mb_entry;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   scroller = elm_scroller_add(win);
+   elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+   elm_scroller_policy_set
+       (scroller, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);
+   evas_object_show(scroller);
+
+   mb_entry = elm_multibuttonentry_add(win);
+   elm_object_part_text_set(mb_entry, "guide", "Tap to add recipient");
+   elm_object_text_set(mb_entry, EAIL_TEST_INPUT_TEXT);
+   evas_object_size_hint_weight_set(mb_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(mb_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_content_set(scroller, mb_entry);
+   evas_object_show(mb_entry);
+
+   elm_multibuttonentry_item_append(mb_entry, "first", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "second", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "third", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "fourth", NULL, NULL);
+
+   elm_object_focus_set(mb_entry, EINA_TRUE);
+   elm_box_pack_end(box, mb_entry);
+
+   evas_object_resize(win, 130, 180);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_multibutton_entry(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_multibuttonentry_tc3.c b/eail/tests/eail_multibuttonentry_tc3.c
new file mode 100644 (file)
index 0000000..b538d31
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Tested interface: AtkText
+ *
+ * Tested AtkObject: EailMultibuttonentry
+ *
+ * Description: Test AtkText interface
+ *
+ * Test input: accessible object representing EailMultibuttonentry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_MBE "EailMultibuttonentry"
+#define EAIL_TEST_INPUT_TEXT "Input text"
+#define EAIL_TEST_CHANGED_TEXT "custom text"
+
+INIT_TEST("EailMultibuttonentry")
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_TEXT(obj));
+
+   atk_editable_text_set_text_contents(ATK_EDITABLE_TEXT(obj),
+                                       EAIL_TEST_INPUT_TEXT);
+   g_assert(atk_text_get_character_count(ATK_TEXT(obj)) == 10);
+   g_assert(atk_text_get_character_at_offset(ATK_TEXT(obj), 3) == 'u');
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_multibutton_entry(Evas_Object *win)
+{
+   Evas_Object *scroller, *bg, *box, *mb_entry;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   scroller = elm_scroller_add(win);
+   elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+   elm_scroller_policy_set
+       (scroller, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);
+   evas_object_show(scroller);
+
+   mb_entry = elm_multibuttonentry_add(win);
+   elm_object_part_text_set(mb_entry, "guide", "Tap to add recipient");
+   elm_object_text_set(mb_entry, EAIL_TEST_INPUT_TEXT);
+   evas_object_size_hint_weight_set(mb_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(mb_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_content_set(scroller, mb_entry);
+   evas_object_show(mb_entry);
+
+   elm_multibuttonentry_item_append(mb_entry, "first", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "second", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "third", NULL, NULL);
+   elm_multibuttonentry_item_append(mb_entry, "fourth", NULL, NULL);
+
+   elm_object_focus_set(mb_entry, EINA_TRUE);
+   elm_box_pack_end(box, mb_entry);
+
+   evas_object_resize(win, 130, 180);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_multibutton_entry(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_multibuttonentry_tc4.c b/eail/tests/eail_multibuttonentry_tc4.c
new file mode 100644 (file)
index 0000000..c5a5037
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Tested interface: AtkEditableText
+ *
+ * Tested AtkObject: EailMultibuttonentry
+ *
+ * Description: Test AtkEditableText interface
+ *
+ * Test input: accessible object representing EailMultibuttonentry
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ENTRY_TEXT "Trololo lololololo olololo"
+
+INIT_TEST("EailMultibuttonentry")
+
+static void
+_do_test(AtkObject *obj)
+{
+   gchar *text = NULL;
+   gint start_offset;
+   gint end_offset;
+
+   g_assert(ATK_IS_EDITABLE_TEXT(obj));
+
+   atk_editable_text_set_text_contents(ATK_EDITABLE_TEXT(obj), ENTRY_TEXT);
+
+   start_offset = 0;
+   end_offset = -1;
+   text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+   g_assert_cmpstr(text, ==, ENTRY_TEXT);
+   g_free(text);
+
+   start_offset = 0;
+   end_offset = 7;
+   atk_editable_text_delete_text(ATK_EDITABLE_TEXT(obj), start_offset, end_offset);
+   text = atk_text_get_text(ATK_TEXT(obj), 0, -1);
+   g_assert_cmpstr(text, ==, " lololololo olololo");
+   g_free(text);
+
+   atk_editable_text_insert_text(ATK_EDITABLE_TEXT(obj), "Trololo", 7,
+                                 &start_offset);
+   text = atk_text_get_text(ATK_TEXT(obj), 0, -1);
+   g_assert(start_offset == 7);
+   g_assert_cmpstr(text, ==, ENTRY_TEXT);
+   g_free(text);
+
+   start_offset = 8;
+   end_offset = 18;
+   atk_editable_text_copy_text(ATK_EDITABLE_TEXT(obj), start_offset, end_offset);
+   atk_editable_text_set_text_contents(ATK_EDITABLE_TEXT(obj), "123");
+   atk_editable_text_paste_text(ATK_EDITABLE_TEXT(obj), 3);
+
+   start_offset = 0;
+   end_offset = -1;
+   text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+   g_assert_cmpstr(text, ==, "123lololololo");
+   g_free(text);
+
+   start_offset = 0;
+   end_offset = 3;
+   atk_editable_text_cut_text(ATK_EDITABLE_TEXT(obj), start_offset, end_offset);
+   text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+   g_assert_cmpstr(text, ==, "lol");
+   g_free(text);
+
+   start_offset = 0;
+   end_offset = -1;
+   atk_editable_text_paste_text(ATK_EDITABLE_TEXT(obj), 3);
+   text = atk_text_get_text(ATK_TEXT(obj), start_offset, end_offset);
+   g_assert_cmpstr(text, ==, "lol123olololo");
+   g_free(text);
+
+   eailu_test_code_called = 1;
+
+}
+
+static void
+_init_multibutton_entry(Evas_Object *win)
+{
+   Evas_Object *scroller, *bg, *box, *mb_entry;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   scroller = elm_scroller_add(win);
+   elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+   elm_scroller_policy_set
+       (scroller, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);
+   evas_object_show(scroller);
+
+   mb_entry = elm_multibuttonentry_add(win);
+   evas_object_size_hint_weight_set(mb_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(mb_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_content_set(scroller, mb_entry);
+   elm_multibuttonentry_editable_set(mb_entry, EINA_TRUE);
+   evas_object_show(mb_entry);
+
+   evas_object_resize(win, 130, 180);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_multibutton_entry(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_naviframe_page_tc1.c b/eail/tests/eail_naviframe_page_tc1.c
new file mode 100644 (file)
index 0000000..d752a23
--- /dev/null
@@ -0,0 +1,285 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailNaviframePage
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailNaviframePage
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailNaviframe")
+
+#define BUTTON_TEXT_SET(BT, TEXT) \
+   elm_object_text_set((BT), (TEXT)); \
+   elm_object_tooltip_text_set((BT), (TEXT)); \
+   elm_object_tooltip_window_mode_set((BT), EINA_TRUE)
+
+#define PACKAGE_DATA_DIR "./data"
+
+static const char *img1 = PACKAGE_DATA_DIR "/whiterabbit01.jpg";
+static const char *img2 = PACKAGE_DATA_DIR "/01.jpg";
+static const char *img3 = PACKAGE_DATA_DIR "/02.jpg";
+static const char *img4 = PACKAGE_DATA_DIR "/03.jpg";
+static const char *img5 = PACKAGE_DATA_DIR "/04.jpg";
+static const char *img8 = PACKAGE_DATA_DIR "/small-01.jpg";
+
+Evas_Object *
+_content_new(Evas_Object *parent, const char *img)
+{
+   Evas_Object *photo = elm_photo_add(parent);
+   elm_photo_file_set(photo, img);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   elm_object_style_set(photo, "shadow");
+   return photo;
+}
+
+static void
+_page5(Evas_Object *nf)
+{
+   Evas_Object *bt, *bt2, *content;
+   Elm_Object_Item *it;
+
+   bt = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(bt, "Page 4");
+
+   bt2 = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(bt2, "Page 1");
+
+   content = _content_new(nf, img5);
+   it = elm_naviframe_item_insert_after(nf,
+                                        elm_naviframe_top_item_get(nf),
+                                        "Page 5",
+                                        bt,
+                                        bt2,
+                                        content,
+                                        NULL);
+   elm_object_item_part_text_set(it, "subtitle",
+                                 "This page is inserted without transition");
+
+   evas_object_data_set(nf, "page5", it);
+   elm_naviframe_item_promote(it);
+}
+
+static void
+_page4(Evas_Object *nf)
+{
+   Evas_Object *bt, *ic, *content;
+   char buf[PATH_MAX];
+   Elm_Object_Item *it;
+
+   ic = elm_icon_add(nf);
+   elm_icon_standard_set(ic, "arrow_right");
+
+   bt = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_layout_content_set(bt, "icon", ic);
+
+   content = _content_new(nf, img4);
+
+   it = elm_naviframe_item_push(nf,
+                                "Page 4",
+                                NULL,
+                                bt,
+                                content,
+                                NULL);
+   elm_object_item_part_text_set(it, "subtitle", "Title area visibility test");
+
+   ic = elm_icon_add(nf);
+   snprintf(buf, sizeof(buf), "%s",
+            img8);
+   elm_image_file_set(ic, buf, NULL);
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   elm_object_item_part_content_set(it, "icon", ic);
+   elm_naviframe_item_title_visible_set(it, EINA_FALSE);
+
+   evas_object_data_set(nf, "page4", it);
+}
+
+static void
+_page3(Evas_Object *nf)
+{
+   Evas_Object *bt2, *ic, *content;
+   char buf[PATH_MAX];
+   Elm_Object_Item *it;
+
+   bt2 = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(bt2, "Next");
+
+   content = _content_new(nf, img3);
+
+   it = elm_naviframe_item_push(nf,
+                                "Page 3",
+                                NULL,
+                                bt2,
+                                content,
+                                NULL);
+   ic = elm_icon_add(nf);
+   snprintf(buf, sizeof(buf), "%s", img8);
+   elm_image_file_set(ic, buf, NULL);
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+   elm_object_item_part_content_set(it, "icon", ic);
+
+   evas_object_data_set(nf, "page3", it);
+}
+
+static void
+_page2(Evas_Object *nf)
+{
+   Evas_Object *bt, *content, *ic;
+   Elm_Object_Item *it;
+
+   bt = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   ic = elm_icon_add(nf);
+   elm_icon_standard_set(ic, "arrow_right");
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   elm_layout_content_set(bt, "icon", ic);
+
+   content = _content_new(nf, img2);
+
+   it = elm_naviframe_item_push(nf, "Page 2 - Long Title Here",
+                                NULL, bt, content,  NULL);
+   elm_object_item_part_text_set(it, "subtitle", "Here is sub-title part!");
+   evas_object_data_set(nf, "page2", it);
+
+}
+
+static void
+_page1(Evas_Object *nf)
+{
+   Evas_Object *btn, *content;
+   Elm_Object_Item *it;
+
+   btn = elm_button_add(nf);
+   evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(btn, "Next");
+   evas_object_show(btn);
+
+   content = _content_new(nf, img1);
+   it = elm_naviframe_item_push(nf, "Page 1", NULL, btn, content, NULL);
+   evas_object_data_set(nf, "page1", it);
+}
+
+
+static void
+_test_naviframe_page(AtkObject *obj, int index)
+{
+   int child_count = atk_object_get_n_accessible_children(obj);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   g_assert(child_count > 0);
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+   /*g_assert(atk_state_set_is_empty == TRUE);*/
+   if (index == 4)
+     {
+        AtkStateType states[3] = {ATK_STATE_SHOWING, ATK_STATE_VISIBLE,
+             ATK_STATE_ENABLED};
+        /*we are showing last page*/
+        gboolean contains = atk_state_set_contains_states(state_set, states, 3);
+        g_assert(contains);
+     }
+   g_object_unref(state_set);
+
+   int index_in_parent = atk_object_get_index_in_parent(obj);
+   g_assert(index_in_parent == index);
+
+   /*check if last child is naviframe page content*/
+   AtkObject *child = atk_object_ref_accessible_child(obj, child_count - 1);
+   g_assert(eailu_is_object_with_type(child, "EailPhoto"));
+   g_object_unref(child);
+
+   AtkObject *parent = atk_object_get_parent(obj);
+   g_object_ref(parent);
+   g_assert(ATK_IS_OBJECT(parent));
+   g_assert(eailu_is_object_with_type(parent, "EailNaviframe"));
+   g_object_unref(parent);
+
+   int x = -1;
+   int y = -1;
+   int width = -1;
+   int height = -1;
+
+   atk_component_get_extents(ATK_COMPONENT(obj),
+                             &x, &y,
+                             &width, &height,
+                             ATK_XY_SCREEN);
+   g_assert(x > 0);
+   g_assert(y > 0);
+   g_assert(height > 0);
+   g_assert(width > 0);
+
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+
+   g_object_ref(obj);
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 5);
+
+   for (int i = 0; i < child_count; i++)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(obj, i);
+        g_assert(ATK_IS_OBJECT(child));
+        g_assert(eailu_is_object_with_type(child, "EailNaviframePage"));
+        g_assert(ATK_ROLE_PAGE_TAB == atk_object_get_role(child));
+        _test_naviframe_page(child, i);
+        g_object_unref(child);
+     }
+   g_object_unref(obj);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_naviframe(Evas_Object *win)
+{
+    Evas_Object *nf;
+
+   nf = elm_naviframe_add(win);
+   evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, nf);
+   evas_object_show(nf);
+
+   _page1(nf);
+   _page2(nf);
+   _page3(nf);
+   _page4(nf);
+   _page5(nf);
+
+   evas_object_resize(win, 800, 600);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_naviframe(win);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_naviframe_tc1.c b/eail/tests/eail_naviframe_tc1.c
new file mode 100644 (file)
index 0000000..447bafe
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailNaviframe
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailNaviframe
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailNaviframe")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   g_object_ref(obj);
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 0);
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_PAGE_TAB_LIST);
+   g_object_unref(obj);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_naviframe(Evas_Object *win)
+{
+   Evas_Object *nf;
+
+   nf = elm_naviframe_add(win);
+   evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, nf);
+   evas_object_show(nf);
+   evas_object_resize(win, 800, 600);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_naviframe(win);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_naviframe_tc2.c b/eail/tests/eail_naviframe_tc2.c
new file mode 100644 (file)
index 0000000..b600b28
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailNaviframe
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailNaviframe
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailNaviframe")
+
+#include "eail_test_utils.h"
+
+#define BUTTON_TEXT_SET(BT, TEXT) \
+   elm_object_text_set((BT), (TEXT)); \
+   elm_object_tooltip_text_set((BT), (TEXT)); \
+   elm_object_tooltip_window_mode_set((BT), EINA_TRUE)
+
+#define PACKAGE_DATA_DIR "./data"
+
+static const char *img1 = PACKAGE_DATA_DIR "/whiterabbit01.jpg";
+static const char *img2 = PACKAGE_DATA_DIR "/01.jpg";
+static const char *img3 = PACKAGE_DATA_DIR "/02.jpg";
+static const char *img4 = PACKAGE_DATA_DIR "/03.jpg";
+static const char *img5 = PACKAGE_DATA_DIR "/04.jpg";
+static const char *img8 = PACKAGE_DATA_DIR "/small-01.jpg";
+
+static int action_test_passed;
+
+Evas_Object *
+_content_new(Evas_Object *parent, const char *img)
+{
+   Evas_Object *photo = elm_photo_add(parent);
+   elm_photo_file_set(photo, img);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   elm_object_style_set(photo, "shadow");
+   return photo;
+}
+
+static void
+_page5(Evas_Object *nf)
+{
+   Evas_Object *bt, *bt2, *content;
+   Elm_Object_Item *it;
+
+   bt = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(bt, "Page 4");
+
+   bt2 = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(bt2, "Page 1");
+
+   content = _content_new(nf, img5);
+   it = elm_naviframe_item_insert_after(nf,
+                                        elm_naviframe_top_item_get(nf),
+                                        "Page 5",
+                                        bt,
+                                        bt2,
+                                        content,
+                                        NULL);
+   elm_object_item_part_text_set(it, "subtitle",
+                                 "This page is inserted without transition");
+
+   evas_object_data_set(nf, "page5", it);
+   elm_naviframe_item_promote(it);
+}
+
+static void
+_page4(Evas_Object *nf)
+{
+   Evas_Object *bt, *ic, *content;
+   char buf[PATH_MAX];
+   Elm_Object_Item *it;
+
+   ic = elm_icon_add(nf);
+   elm_icon_standard_set(ic, "arrow_right");
+
+   bt = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_layout_content_set(bt, "icon", ic);
+
+   content = _content_new(nf, img4);
+
+   it = elm_naviframe_item_push(nf,
+                                "Page 4",
+                                NULL,
+                                bt,
+                                content,
+                                NULL);
+   elm_object_item_part_text_set(it, "subtitle", "Title area visibility test");
+
+   ic = elm_icon_add(nf);
+   snprintf(buf, sizeof(buf), "%s",
+            img8);
+   elm_image_file_set(ic, buf, NULL);
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   elm_object_item_part_content_set(it, "icon", ic);
+   elm_naviframe_item_title_visible_set(it, EINA_FALSE);
+
+   evas_object_data_set(nf, "page4", it);
+}
+
+static void
+_page3(Evas_Object *nf)
+{
+   Evas_Object *bt2, *ic, *content;
+   char buf[PATH_MAX];
+   Elm_Object_Item *it;
+
+   bt2 = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(bt2, "Next");
+
+   content = _content_new(nf, img3);
+
+   it = elm_naviframe_item_push(nf,
+                                "Page 3",
+                                NULL,
+                                bt2,
+                                content,
+                                NULL);
+   ic = elm_icon_add(nf);
+   snprintf(buf, sizeof(buf), "%s", img8);
+   elm_image_file_set(ic, buf, NULL);
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+   elm_object_item_part_content_set(it, "icon", ic);
+
+   evas_object_data_set(nf, "page3", it);
+}
+
+static void
+_page2(Evas_Object *nf)
+{
+   Evas_Object *bt, *content, *ic;
+   Elm_Object_Item *it;
+
+   bt = elm_button_add(nf);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   ic = elm_icon_add(nf);
+   elm_icon_standard_set(ic, "arrow_right");
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+   elm_layout_content_set(bt, "icon", ic);
+
+   content = _content_new(nf, img2);
+
+   it = elm_naviframe_item_push(nf, "Page 2 - Long Title Here",
+                                NULL, bt, content,  NULL);
+   elm_object_item_part_text_set(it, "subtitle", "Here is sub-title part!");
+   evas_object_data_set(nf, "page2", it);
+
+}
+
+static void
+_page1(Evas_Object *nf)
+{
+   Evas_Object *btn, *content;
+   Elm_Object_Item *it;
+
+   btn = elm_button_add(nf);
+   evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   BUTTON_TEXT_SET(btn, "Next");
+   evas_object_show(btn);
+
+   content = _content_new(nf, img1);
+   it = elm_naviframe_item_push(nf, "Page 1", NULL, btn, content, NULL);
+   evas_object_data_set(nf, "page1", it);
+}
+
+static void
+_title_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("Title Clicked!\n");
+   ++action_test_passed;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkAction *action;
+   const char *action_name, *desc;
+   gboolean result;
+   int actions_n;
+
+   g_assert(ATK_IS_ACTION(obj));
+   action = ATK_ACTION(obj);
+   actions_n = atk_action_get_n_actions(action);
+   _printf("action count %d\n", atk_action_get_n_actions(action));
+   g_assert(actions_n == 1);
+   action_name = atk_action_get_name(action, 0);
+   //printf("%s\n", action_name);
+   g_assert(!strcmp("click", action_name));
+   result = atk_action_set_description(action, 0, "click_title description");
+   g_assert(result);
+   desc = atk_action_get_description(action, 0);
+   g_assert(!strcmp(desc, "click_title description"));
+   result = atk_action_do_action(action, 0);
+   g_assert(result);
+
+   g_object_unref(obj);
+   g_assert(action_test_passed);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_naviframe(Evas_Object *win)
+{
+    Evas_Object *nf;
+
+   nf = elm_naviframe_add(win);
+   evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, nf);
+   evas_object_show(nf);
+   evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
+
+   _page1(nf);
+   _page2(nf);
+   _page3(nf);
+   _page4(nf);
+   _page5(nf);
+
+   evas_object_resize(win, 800, 600);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_naviframe(win);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_notify_tc1.c b/eail/tests/eail_notify_tc1.c
new file mode 100644 (file)
index 0000000..a16bd2c
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailNotify
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailNotify
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_CHECK "EailNotify"
+#define EAIL_TEST_LABEL_TITTLE "test label"
+
+INIT_TEST("EailNotify")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_amount = 0;
+   AtkObject *nested_obj;
+
+   _printf("Testing notify instance....\n");
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   child_amount = atk_object_get_n_accessible_children(obj);
+   /* we have to check if there is nested label in Notify */
+   g_assert(1 == child_amount);
+
+   /* test if notify child  is label-type*/
+   nested_obj = atk_object_ref_accessible_child(obj, 0);
+   g_assert(eailu_is_object_with_type(nested_obj, "EailLabel"));
+   g_assert(eailu_is_object_with_name(nested_obj, EAIL_TEST_LABEL_TITTLE));
+
+   /* For notify widget focusing doesn't work */
+   eailu_test_atk_focus(obj, FALSE);
+
+   _printf("Tests passed successfully\n");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_notify(Evas_Object *win)
+{
+   Evas_Object *notify, *box, *label;
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   label = elm_label_add(win);
+   elm_object_text_set(label, EAIL_TEST_LABEL_TITTLE);
+   evas_object_show(label);
+
+   notify = elm_notify_add(win);
+   elm_notify_allow_events_set(notify, EINA_FALSE);
+   //elm_notify_timeout_set(notify, 5);
+   elm_object_content_set(notify, label);
+   evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(notify);
+   elm_box_pack_end(box, notify);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_notify(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_panel_tc1.c b/eail/tests/eail_panel_tc1.c
new file mode 100644 (file)
index 0000000..d0bc246
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailPanel
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailPanel
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPanel")
+
+static void
+_do_test(AtkObject *object)
+{
+   AtkRole role = atk_object_get_role(object);
+   g_assert(role == ATK_ROLE_PANEL);
+   int child_count = atk_object_get_n_accessible_children(object);
+   g_assert(child_count == 1);
+   atk_object_set_description(object, "test");
+   g_assert_cmpstr(atk_object_get_description(object), ==, "test");
+
+   atk_object_set_name(object, "test name");
+   g_assert_cmpstr(atk_object_get_name(object), ==, "test name");
+
+   AtkStateSet *state_set = atk_object_ref_state_set(object);
+   gboolean contains = atk_state_set_contains_state(state_set,
+                                                    ATK_STATE_VISIBLE);
+   g_assert(contains);
+   g_object_unref(state_set);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_panel(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *panel, *content;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   elm_box_horizontal_set(bx, EINA_FALSE);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   panel = elm_panel_add(win);
+   elm_panel_orient_set(panel, ELM_PANEL_ORIENT_TOP);
+   elm_panel_toggle(panel);
+   evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panel);
+   elm_box_pack_end(bx, panel);
+
+   content = elm_label_add(win);
+   elm_object_text_set(content, "content");
+   evas_object_show(content);
+   elm_object_content_set(panel, content);
+
+   panel = elm_panel_add(win);
+   elm_panel_orient_set(panel, ELM_PANEL_ORIENT_RIGHT);
+   elm_panel_hidden_set(panel, EINA_TRUE);
+   evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panel);
+   elm_box_pack_end(bx, panel);
+
+   content = elm_label_add(win);
+   elm_object_text_set(content, "content2");
+   evas_object_show(content);
+   elm_object_content_set(panel, content);
+
+   panel = elm_panel_add(win);
+   evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panel);
+   elm_box_pack_end(bx, panel);
+
+   content = elm_label_add(win);
+   elm_object_text_set(content, "content3");
+   evas_object_show(content);
+   elm_object_content_set(panel, content);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
+   _init_panel(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_panel_tc2.c b/eail/tests/eail_panel_tc2.c
new file mode 100644 (file)
index 0000000..51ce0a9
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailPanel
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailPanel
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPanel")
+
+static void
+_do_test(AtkObject *object)
+{
+   gboolean result;
+
+   g_assert(ATK_IS_ACTION(object));
+
+   AtkAction *action = ATK_ACTION(object);
+   int actions_num = atk_action_get_n_actions(action);
+   g_assert(actions_num == 1);
+   const gchar *action_name = atk_action_get_name(action, 0);
+   g_assert(!strcmp("toggle", action_name));
+   result = atk_action_do_action(action, 0);
+   eailu_test_action_description_all(ATK_ACTION(object));
+   g_assert(result);
+
+   AtkStateSet *state_set = atk_object_ref_state_set(object);
+   gboolean contains = atk_state_set_contains_state(state_set,
+                                                    ATK_STATE_VISIBLE);
+   g_assert(contains);
+   g_object_unref(state_set);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_panel(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *panel, *content;
+
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   elm_box_horizontal_set(bx, EINA_FALSE);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   panel = elm_panel_add(win);
+   elm_panel_orient_set(panel, ELM_PANEL_ORIENT_TOP);
+   elm_panel_toggle(panel);
+   evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panel);
+   elm_box_pack_end(bx, panel);
+
+   content = elm_label_add(win);
+   elm_object_text_set(content, "content");
+   evas_object_show(content);
+   elm_object_content_set(panel, content);
+
+   panel = elm_panel_add(win);
+   elm_panel_orient_set(panel, ELM_PANEL_ORIENT_RIGHT);
+   elm_panel_hidden_set(panel, EINA_TRUE);
+   evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panel);
+   elm_box_pack_end(bx, panel);
+
+   content = elm_label_add(win);
+   elm_object_text_set(content, "content2");
+   evas_object_show(content);
+   elm_object_content_set(panel, content);
+
+   panel = elm_panel_add(win);
+   evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panel);
+   elm_box_pack_end(bx, panel);
+
+   content = elm_label_add(win);
+   elm_object_text_set(content, "content3");
+   evas_object_show(content);
+   elm_object_content_set(panel, content);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_panel(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_panes_tc1.c b/eail/tests/eail_panes_tc1.c
new file mode 100644 (file)
index 0000000..3145342
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailPanes
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailPanes
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPanes")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 2);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+   gboolean v_contains = atk_state_set_contains_state(state_set,
+                                                      ATK_STATE_VERTICAL);
+   gboolean h_contains = atk_state_set_contains_state(state_set,
+                                                      ATK_STATE_HORIZONTAL);
+   g_object_unref(state_set);
+   g_assert(v_contains || h_contains);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_panes(Evas_Object *win)
+{
+   Evas_Object *bg, *panes, *panes_h, *bt;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+   evas_object_show(bg);
+
+   panes = elm_panes_add(win);
+   elm_win_resize_object_add(win, panes);
+   evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panes, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panes);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Left");
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(bt);
+   elm_object_part_content_set(panes, "left", bt);
+
+   panes_h = elm_panes_add(win);
+   elm_panes_horizontal_set(panes_h, EINA_TRUE);
+   evas_object_size_hint_weight_set(panes_h, EVAS_HINT_EXPAND,
+                                    EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panes_h, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panes_h);
+   elm_object_part_content_set(panes, "right", panes_h);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Up");
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(bt);
+   elm_object_part_content_set(panes_h, "left", bt);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Down");
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(bt);
+   elm_object_part_content_set(panes_h, "right", bt);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_panes(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_panes_tc2.c b/eail/tests/eail_panes_tc2.c
new file mode 100644 (file)
index 0000000..6f4110d
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailPanes
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailPanes
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPanes")
+
+static void
+_do_test(AtkObject *obj)
+{
+   /*AtkValue iface tests*/
+   g_assert(ATK_IS_VALUE(obj));
+   GValue value = G_VALUE_INIT;
+   double d_value;
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   d_value = g_value_get_double(&value);
+   g_assert(d_value == 1.0);
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   d_value = g_value_get_double(&value);
+   g_assert(d_value == 0.0);
+   g_value_set_double(&value, 0.3);
+   gboolean success = atk_value_set_current_value(ATK_VALUE(obj), &value);
+   g_assert(success);
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   g_assert(G_VALUE_HOLDS_DOUBLE(&value));
+   d_value = g_value_get_double(&value);
+   g_assert(d_value == 0.3);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_panes(Evas_Object *win)
+{
+   Evas_Object *bg, *panes, *panes_h, *bt;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+   evas_object_show(bg);
+
+   panes = elm_panes_add(win);
+   elm_win_resize_object_add(win, panes);
+   evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panes, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panes);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Left");
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(bt);
+   elm_object_part_content_set(panes, "left", bt);
+
+   panes_h = elm_panes_add(win);
+   elm_panes_horizontal_set(panes_h, EINA_TRUE);
+   evas_object_size_hint_weight_set(panes_h, EVAS_HINT_EXPAND,
+                                    EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(panes_h, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(panes_h);
+   elm_object_part_content_set(panes, "right", panes_h);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Up");
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(bt);
+   elm_object_part_content_set(panes_h, "left", bt);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Down");
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(bt);
+   elm_object_part_content_set(panes_h, "right", bt);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_panes(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_photo_tc1.c b/eail/tests/eail_photo_tc1.c
new file mode 100644 (file)
index 0000000..d087070
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailPhoto
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailPhoto
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define DEBUG 1
+
+INIT_TEST("EailPhoto")
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+   g_assert(!atk_state_set_is_empty(state_set));
+   g_object_unref(state_set);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_photo(Evas_Object *win)
+{
+   Evas_Object *bx, *photo;
+   const char * const filename = "data/th-whiterabbit01.jpg";
+
+   bx = elm_box_add(win);
+   elm_box_horizontal_set(bx, EINA_TRUE);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_homogeneous_set(bx, EINA_TRUE);
+   elm_win_resize_object_add(win, bx);
+
+   photo = elm_photo_add(win);
+   g_assert(elm_photo_file_set(photo, filename));
+   elm_photo_size_set(photo, 100);
+   elm_photo_aspect_fixed_set(photo, EINA_FALSE);
+   evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(bx, photo);
+   evas_object_show(photo);
+
+   evas_object_show(bx);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
+   g_assert(win);
+   _init_photo(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_photo_tc2.c b/eail/tests/eail_photo_tc2.c
new file mode 100644 (file)
index 0000000..5df3992
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailPhoto
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailPhoto
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+/* used for checking if photo was really clicked*/
+static gboolean glob_test_photo_clicked = FALSE;
+
+INIT_TEST("EailPhoto")
+
+static void
+_clicked_cb(void *data , Evas_Object *obj,
+            void *event_info)
+{
+   glob_test_photo_clicked = TRUE;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   g_assert(glob_test_photo_clicked);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_photo(Evas_Object *win)
+{
+   Evas_Object *bx, *photo;
+   const char * const filename = "data/th-whiterabbit01.jpg";
+
+   bx = elm_box_add(win);
+   elm_box_horizontal_set(bx, EINA_TRUE);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_homogeneous_set(bx, EINA_TRUE);
+   elm_win_resize_object_add(win, bx);
+
+   photo = elm_photo_add(win);
+   evas_object_smart_callback_add(photo, "clicked", _clicked_cb, NULL);
+   g_assert(elm_photo_file_set(photo, filename));
+   elm_photo_size_set(photo, 100);
+   elm_photo_aspect_fixed_set(photo, EINA_FALSE);
+   evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(bx, photo);
+   evas_object_show(photo);
+
+   evas_object_show(bx);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_photo(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_photo_tc3.c b/eail/tests/eail_photo_tc3.c
new file mode 100644 (file)
index 0000000..606c291
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Tested interface: AtkImage
+ *
+ * Tested AtkObject: EailPhoto
+ *
+ * Description: Test AtkImage interface
+ *
+ * Test input: accessible object representing EailPhoto
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPhoto")
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char * const desc_test = "top secret";
+   const char *desc;
+   int height = 0, width  = 0;
+   int x = -1, y = -1;
+
+   g_assert(ATK_IS_IMAGE(obj));
+
+   atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
+   _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
+
+   g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
+   g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
+   desc = atk_image_get_image_description(ATK_IMAGE(obj));
+   _printf("atk_image_get_image_description: %s\n", desc ? desc : "NULL");
+   g_assert(NULL != desc);
+   g_assert_cmpstr(desc_test, ==, desc);
+
+   atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
+   _printf("atk_image_get_image_size: height %d width %d\n", height, width);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_photo(Evas_Object *win)
+{
+   Evas_Object *bx, *photo;
+   const char * const filename = "data/th-whiterabbit01.jpg";
+
+   bx = elm_box_add(win);
+   elm_box_horizontal_set(bx, EINA_TRUE);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_homogeneous_set(bx, EINA_TRUE);
+   elm_win_resize_object_add(win, bx);
+
+   photo = elm_photo_add(win);
+   g_assert(elm_photo_file_set(photo, filename));
+   elm_photo_size_set(photo, 100);
+   elm_photo_aspect_fixed_set(photo, EINA_FALSE);
+   evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(bx, photo);
+   evas_object_show(photo);
+
+   evas_object_show(bx);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
+   g_assert(win);
+   _init_photo(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_photocam_tc1.c b/eail/tests/eail_photocam_tc1.c
new file mode 100644 (file)
index 0000000..7785029
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailPhotocam
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailPhotocam
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPhotocam");
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+
+   g_assert(!atk_state_set_is_empty(state_set));
+
+   g_object_unref(state_set);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_photocam(Evas_Object *win)
+{
+   Evas_Object *bg, *photocam;
+   const char * const filename = "./data/whiterabbit01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_color_set(bg, 255, 255, 255);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   photocam = elm_photocam_add(win);
+   g_assert(EVAS_LOAD_ERROR_NONE == elm_photocam_file_set(photocam, filename));
+   elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE);
+   evas_object_resize(photocam, 300, 300);
+   evas_object_show(photocam);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_photocam(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_photocam_tc2.c b/eail/tests/eail_photocam_tc2.c
new file mode 100644 (file)
index 0000000..bb43609
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailPhotocam
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailPhotocam
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 7
+
+static int action_test_passed;
+
+INIT_TEST("EailPhotocam")
+
+static void
+_on_photocam_clicked(void *data, Evas_Object *obj, void *ev)
+{
+   action_test_passed = 1;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   for (int count = 0; ACTIONS_NUMBER > count; count++)
+     g_assert(atk_action_do_action(ATK_ACTION(obj), count));
+
+   g_assert(action_test_passed);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_photocam(Evas_Object *win)
+{
+   Evas_Object *bg, *photocam;
+   const char * const filename = "./data/whiterabbit01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_color_set(bg, 255, 255, 255);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   photocam = elm_photocam_add(win);
+   g_assert(EVAS_LOAD_ERROR_NONE == elm_photocam_file_set(photocam, filename));
+   elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE);
+   evas_object_resize(photocam, 300, 300);
+   evas_object_show(photocam);
+   evas_object_smart_callback_add(photocam, "clicked", _on_photocam_clicked, NULL);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_photocam(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_photocam_tc3.c b/eail/tests/eail_photocam_tc3.c
new file mode 100644 (file)
index 0000000..9d26e33
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Tested interface: AtkImage
+ *
+ * Tested AtkObject: EailPhotocam
+ *
+ * Description: Test AtkImage interface
+ *
+ * Test input: accessible object representing EailPhotocam
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPhotocam")
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char * const desc_test = "top secret";
+   const char *desc;
+   int height = 0, width  = 0;
+   int x = -1, y = -1;
+
+   g_assert(ATK_IS_IMAGE(obj));
+
+   atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
+   _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
+
+   g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
+   g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
+   desc = atk_image_get_image_description(ATK_IMAGE(obj));
+   _printf("atk_image_get_image_description: %s\n", desc ? desc : "NULL");
+   g_assert(NULL != desc);
+   g_assert_cmpstr(desc_test, ==, desc);
+
+   atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
+   _printf("atk_image_get_image_size: height %d width %d\n", height, width);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_photocam(Evas_Object *win)
+{
+   Evas_Object *bg, *photocam;
+   const char * const filename = "./data/whiterabbit01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_color_set(bg, 255, 255, 255);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   photocam = elm_photocam_add(win);
+   g_assert(EVAS_LOAD_ERROR_NONE == elm_photocam_file_set(photocam, filename));
+   elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE);
+   evas_object_resize(photocam, 300, 300);
+   evas_object_show(photocam);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_photocam(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_plug_tc1.c b/eail/tests/eail_plug_tc1.c
new file mode 100644 (file)
index 0000000..cfa57da
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailPlug
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailPlug
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailPlug")
+
+static void
+_init_plug(Evas_Object *win)
+{
+   Evas_Object *bg, *plug;
+   const char *filename = "data/plant_01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_file_set(bg, filename, NULL);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   plug = elm_plug_add(win);
+   evas_object_resize(plug, 380, 500);
+   evas_object_move(plug, 10, 10);
+   evas_object_show(plug);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+   g_assert_cmpstr(type_name, ==, "EailPlug");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_plug(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_plug_tc2.c b/eail/tests/eail_plug_tc2.c
new file mode 100644 (file)
index 0000000..a36b11f
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailPlug
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailPlug
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailPlug")
+
+static void
+_init_plug(Evas_Object *win)
+{
+   Evas_Object *bg, *plug;
+   const char *filename = "data/plant_01.jpg";
+
+   bg = elm_bg_add(win);
+   elm_bg_file_set(bg, filename, NULL);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   plug = elm_plug_add(win);
+   evas_object_resize(plug, 380, 500);
+   evas_object_move(plug, 10, 10);
+   evas_object_show(plug);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_plug(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_popup_tc1.c b/eail/tests/eail_popup_tc1.c
new file mode 100644 (file)
index 0000000..b11923d
--- /dev/null
@@ -0,0 +1,196 @@
+/*
+ * Tested interface: AtkText
+ *
+ * Tested AtkObject: EailPopup
+ *
+ * Description: Test AtkPopup interface
+ *
+ * Test input: accessible object representing EailPopup
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define EAIL_TYPE_FOR_POPUP "EailPopup"
+#define EAIL_TEST_LABEL_TITTLE "Test popup obj"
+#define EAIL_TEST_CONTENT_LABEL_TEXT "Test content label text"
+#define EAIL_TEST_CONTENT_TEXT "seseeseese"
+
+/* used to determine if test code has been successfully called
+ * (sometimes may happen that ATK object to test in hierarchy cannot be found)*/
+static gboolean eail_test_code_called = FALSE;
+
+static void
+_test_popup_object_with_text(AtkObject *obj);
+
+static void
+_test_popup_object_with_label(AtkObject *obj);
+
+static Evas_Object *popup = NULL;
+
+static void
+_on_done(void *data, Evas_Object *obj, void *event_info)
+{
+   elm_exit();
+}
+
+static void
+_set_label_content_on_popup(Evas_Object *popup)
+{
+   Evas_Object *label_content;
+
+   label_content = elm_label_add(popup);
+   elm_object_text_set(label_content, EAIL_TEST_CONTENT_LABEL_TEXT);
+
+   elm_object_content_set(popup, label_content);
+}
+
+static void
+on_focus_in(void *data, Evas_Object *obj, void *event_info)
+{
+   AtkObject *aobj = atk_get_root();
+   g_assert(aobj);
+
+   /* testing popup with text content */
+   eailu_traverse_children_for_type_call_cb
+                  (aobj, EAIL_TYPE_FOR_POPUP, _test_popup_object_with_text);
+
+   _set_label_content_on_popup(popup);
+   /* testing popup with label content */
+   eailu_traverse_children_for_type_call_cb
+                  (aobj, EAIL_TYPE_FOR_POPUP, _test_popup_object_with_label);
+
+   g_assert(eail_test_code_called);
+   _on_done(NULL, obj, NULL);
+}
+
+static void
+_test_popup_object_with_text(AtkObject *obj)
+{
+   AtkText *text_obj = NULL;
+   char *text = NULL;
+   int child_amount = 0;
+
+   atk_object_set_name(obj, EAIL_TEST_CONTENT_TEXT);
+   g_assert_cmpstr(atk_object_get_name(obj), ==, EAIL_TEST_CONTENT_TEXT);
+   _printf("Testing popup instance with text....\n");
+   g_assert(ATK_IS_TEXT(obj));
+   text_obj =  ATK_TEXT(obj);
+   text = atk_text_get_text(text_obj, 0, -1);
+   g_assert(text);
+   g_assert(strcmp(text, EAIL_TEST_CONTENT_TEXT) == 0);
+   g_assert((atk_text_get_character_count(text_obj)) ==
+                                 (g_utf8_strlen(EAIL_TEST_CONTENT_TEXT, -1)));
+
+   /* only 2 buttons should be listed as children when text content is set */
+   child_amount = atk_object_get_n_accessible_children(obj);
+   g_assert(1 == child_amount);
+
+   _printf("Tests passed successfully\n");
+   eail_test_code_called = TRUE;
+}
+
+static void
+_test_popup_object_with_label(AtkObject *obj)
+{
+   AtkText *text_obj = NULL;
+   char *text = NULL;
+   int child_amount = 0;
+   AtkObject *nested_obj;
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   _printf("Testing popup instance with label....\n");
+   g_assert(ATK_IS_TEXT(obj));
+   text_obj =  ATK_TEXT(obj);
+   text = atk_text_get_text(text_obj, 0, -1);
+   g_assert(NULL == text);
+   g_assert((atk_text_get_character_count(text_obj)) == 0);
+
+   /* only 2 buttons + one widget with content should be listed as childrens */
+   child_amount = atk_object_get_n_accessible_children(obj);
+   g_assert(2 == child_amount);
+
+   nested_obj = atk_object_ref_accessible_child(obj, 0);
+   g_assert(eailu_is_object_with_type(nested_obj, "EailLabel"));
+   g_assert(eailu_is_object_with_name
+            (nested_obj, EAIL_TEST_CONTENT_LABEL_TEXT));
+
+   _printf("Tests passed successfully\n");
+}
+
+static void
+_response_cb(void *data, Evas_Object *obj,
+             void *event_info)
+{
+   evas_object_hide(data);
+}
+
+static void
+_initialize_and_show_popup(Evas_Object *win)
+{
+   Evas_Object *btn1, *btn2, *icon1;
+   char buf[256];
+
+   popup = elm_popup_add(win);
+
+   icon1 = elm_icon_add(popup);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
+            elm_app_data_dir_get());
+   elm_image_file_set(icon1, buf, NULL );
+
+   /* Seting popup title-text */
+   elm_object_part_text_set(popup, "title,text", EAIL_TEST_LABEL_TITTLE);
+
+   elm_object_text_set(popup,EAIL_TEST_CONTENT_TEXT);
+   /* NOTE: RJ,list content of popup is not supported,
+    * so not adding list items. It is because there is no possibility to
+    * fetch those values from popup via popup API */
+
+   /* Creating the first action button */
+   btn1 = elm_button_add(popup);
+   elm_object_text_set(btn1, "OK");
+
+   /* NOTE: cannot add due to bug with popup inserting content for button3 */
+   /*elm_object_part_content_set(popup, "button3", btn1);
+     evas_object_smart_callback_add(btn1, "clicked", _response_cb, popup);
+     */
+
+   /* Creating the second action button */
+   btn2 = elm_button_add(popup);
+   elm_object_text_set(btn2, "Cancel");
+   evas_object_smart_callback_add(btn2, "clicked", _response_cb, popup);
+
+   /* Appending the second action button */
+   elm_object_part_content_set(popup, "button1", btn2);
+
+   /* Display the popup object */
+   evas_object_show(popup);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, on_focus_in);
+   _initialize_and_show_popup(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_prefs_tc1.c b/eail/tests/eail_prefs_tc1.c
new file mode 100644 (file)
index 0000000..0f757b0
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailPrefs
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailPrefs
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+
+#include "eail_test_utils.h"
+
+#define CHILDREN_COUNT 9
+
+Elm_Prefs_Data *prefs_data;
+
+INIT_TEST("EailPrefs")
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkObject *child;
+   int i;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_REDUNDANT_OBJECT);
+
+   g_assert(atk_object_get_n_accessible_children(obj) == CHILDREN_COUNT);
+
+   for (i = 0; i < atk_object_get_n_accessible_children(obj); ++i)
+     {
+        child = atk_object_ref_accessible_child(obj, i);
+        g_assert(child);
+        g_object_unref(child);
+     }
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_prefs(Evas_Object *win)
+{
+   Evas_Object *bg, *prefs;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   prefs = elm_prefs_add(win);
+   evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, prefs);
+   evas_object_show(prefs);
+   elm_prefs_autosave_set(prefs, EINA_TRUE);
+   prefs_data = elm_prefs_data_new("./data/prefs_example_02.cfg", NULL,
+                                   EET_FILE_MODE_READ_WRITE);
+   elm_prefs_file_set(prefs, "./data/prefs_example_02.epb", NULL);
+   elm_prefs_data_set(prefs, prefs_data);
+
+   evas_object_resize(win, 320, 320);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_prefs(win);
+   evas_object_show(win);
+   elm_run();
+   elm_prefs_data_unref(prefs_data);
+   elm_shutdown();
+
+   return 0;
+}
+
+ELM_MAIN()
diff --git a/eail/tests/eail_progressbar_tc1.c b/eail/tests/eail_progressbar_tc1.c
new file mode 100644 (file)
index 0000000..be9722f
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailProgressbar
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailProgressbar
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailProgressbar")
+
+const char * const progressbar_name = "progress-bar-name";
+const double progressbar_set = 0.2;
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_PROGRESS_BAR);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_progressbar(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *pb;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   elm_win_resize_object_add(win, bx);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bx);
+
+   pb = elm_progressbar_add(win);
+   elm_object_text_set(pb, progressbar_name);
+   elm_progressbar_span_size_set(pb, 260);
+   elm_progressbar_value_set(pb, progressbar_set);
+   evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, 0.5);
+   elm_box_pack_end(bx, pb);
+   evas_object_show(pb);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_progressbar(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_progressbar_tc2.c b/eail/tests/eail_progressbar_tc2.c
new file mode 100644 (file)
index 0000000..56381ab
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailProgressbar
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailProgressbar
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailProgressbar")
+
+const double progressbar_min = 0.0;
+const double progressbar_max = 1.0;
+const double progressbar_set = 0.2;
+
+static void
+_do_test(AtkObject *obj)
+{
+   double minimum, maximum, current, minimum_increment;
+   const double val_test_set = 0.47;
+
+   GValue value = G_VALUE_INIT;
+   g_value_init(&value, G_TYPE_DOUBLE);
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   minimum = g_value_get_double(&value);
+   _printf("atk_value_get_minimum_value: %0.2f\n", minimum);
+   g_assert((float)progressbar_min == (float)minimum);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   maximum = g_value_get_double(&value);
+   _printf("atk_value_get_maximum_value: %0.2f\n", maximum);
+   g_assert((float)progressbar_max == (float)maximum);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_double(&value);
+   _printf("atk_value_get_current_value: %0.2f\n", current);
+   g_assert((float)progressbar_set == (float)current);
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   minimum_increment = g_value_get_double(&value);
+   _printf("atk_value_get_minimum_increment: %0.2f\n", minimum_increment);
+   g_assert((float)G_MINDOUBLE == (float)minimum_increment);
+
+   g_value_set_double(&value, val_test_set);
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+   _printf("atk_value_set_current_value: %0.2f\n", val_test_set);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_double(&value);
+   _printf("atk_value_get_current_value: %0.2f\n", current);
+
+   g_assert((float)val_test_set == (float)current);
+
+   g_value_set_double(&value, minimum - 0.01);
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   g_value_set_double(&value, maximum + 0.01);
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_progressbar(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *pb;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   elm_win_resize_object_add(win, bx);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bx);
+
+   pb = elm_progressbar_add(win);
+   elm_progressbar_span_size_set(pb, 260);
+   elm_progressbar_value_set(pb, progressbar_set);
+   evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, 0.5);
+   elm_box_pack_end(bx, pb);
+   evas_object_show(pb);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_progressbar(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_radio_tc1.c b/eail/tests/eail_radio_tc1.c
new file mode 100644 (file)
index 0000000..6f0bcbd
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailRadio
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailRadio
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_COUNT 1
+#define DEFAULT_ACTION 0
+#define RADIO1_SEL 1
+#define RADIO2_SEL 2
+#define RADIO3_SEL 3
+#define RADIO1 "Radio 1"
+#define RADIO2 "Radio 2"
+#define RADIO3 "Radio 3"
+
+int val = 1;
+
+INIT_TEST("EailRadioButton")
+
+static void
+_init_radio(Evas_Object *win)
+{
+   Evas_Object *bg, *radio, *group, *bx, *ic;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   elm_box_horizontal_set(bx, EINA_TRUE);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   group = radio = elm_radio_add(win);
+   elm_object_text_set(radio, RADIO1);
+   elm_radio_state_value_set(radio, 1);
+   elm_radio_value_pointer_set(radio, &val);
+   ic = elm_icon_add(win);
+   elm_icon_standard_set(ic, "home");
+   elm_object_part_content_set(radio, "icon", ic);
+   elm_box_pack_end(bx, radio);
+   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(radio);
+
+   radio = elm_radio_add(win);
+   elm_object_text_set(radio, RADIO2);
+   elm_radio_state_value_set(radio, 2);
+   elm_radio_value_pointer_set(radio, &val);
+   elm_radio_group_add(radio, group);
+   ic = elm_icon_add(win);
+   elm_icon_standard_set(ic, "file");
+   elm_object_part_content_set(radio, "icon", ic);
+   elm_box_pack_end(bx, radio);
+   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(radio);
+
+   radio = elm_radio_add(win);
+   elm_object_text_set(radio, RADIO3);
+   elm_radio_state_value_set(radio, 3);
+   elm_radio_value_pointer_set(radio, &val);
+   elm_radio_group_add(radio, group);
+   elm_box_pack_end(bx, radio);
+   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(radio);
+
+   elm_radio_value_set(radio, RADIO2_SEL);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == ACTIONS_COUNT);
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   g_assert(atk_action_do_action(ATK_ACTION(obj), DEFAULT_ACTION));
+   state_set = atk_object_ref_state_set(obj);
+   g_assert(atk_state_set_contains_state(state_set, ATK_STATE_CHECKED));
+   g_object_unref(state_set);
+
+   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_radio(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
diff --git a/eail/tests/eail_radio_tc2.c b/eail/tests/eail_radio_tc2.c
new file mode 100644 (file)
index 0000000..19cbf8b
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailRadio
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailRadio
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define RADIO1_SEL 1
+#define RADIO2_SEL 2
+#define RADIO3_SEL 3
+#define RADIO1 "Radio 1"
+#define RADIO2 "Radio 2"
+#define RADIO3 "Radio 3"
+#define TEST_NAME "Test Name"
+
+int val = 1;
+int name_test_passed;
+
+static void _init_radio(Evas_Object *win);
+
+INIT_TEST("EailRadioButton")
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_radio(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
+
+static void
+_init_radio(Evas_Object *win)
+{
+   Evas_Object *bg, *radio, *group, *bx, *ic;
+
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   elm_box_horizontal_set(bx, EINA_TRUE);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   group = radio = elm_radio_add(win);
+   elm_object_text_set(radio, RADIO1);
+   elm_radio_state_value_set(radio, 1);
+   elm_radio_value_pointer_set(radio, &val);
+   ic = elm_icon_add(win);
+   elm_icon_standard_set(ic, "home");
+   elm_object_part_content_set(radio, "icon", ic);
+   elm_box_pack_end(bx, radio);
+   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(radio);
+
+   radio = elm_radio_add(win);
+   elm_object_text_set(radio, RADIO2);
+   elm_radio_state_value_set(radio, 2);
+   elm_radio_value_pointer_set(radio, &val);
+   elm_radio_group_add(radio, group);
+   ic = elm_icon_add(win);
+   elm_icon_standard_set(ic, "file");
+   elm_object_part_content_set(radio, "icon", ic);
+   elm_box_pack_end(bx, radio);
+   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(radio);
+
+   radio = elm_radio_add(win);
+   elm_object_text_set(radio, RADIO3);
+   elm_radio_state_value_set(radio, 3);
+   elm_radio_value_pointer_set(radio, &val);
+   elm_radio_group_add(radio, group);
+   elm_box_pack_end(bx, radio);
+   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(radio);
+
+   elm_radio_value_set(radio, RADIO2_SEL);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+   const char *name;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_RADIO_BUTTON);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   name = atk_object_get_name(obj);
+
+   if (!strcmp(name, RADIO1))
+     {
+        state_set = atk_object_ref_state_set(obj);
+        g_assert(!atk_state_set_contains_state(state_set, ATK_STATE_CHECKED));
+        g_object_unref(state_set);
+        ++name_test_passed;
+
+        atk_object_set_name(obj, TEST_NAME);
+        g_assert_cmpstr(atk_object_get_name(obj), ==, TEST_NAME);
+     }
+   else if (!strcmp(name, RADIO2))
+     {
+        state_set = atk_object_ref_state_set(obj);
+        g_assert(atk_state_set_contains_state(state_set, ATK_STATE_CHECKED));
+        g_object_unref(state_set);
+        ++name_test_passed;
+        g_assert(name_test_passed == 2);
+
+        atk_object_set_name(obj, TEST_NAME);
+        g_assert_cmpstr(atk_object_get_name(obj), ==, TEST_NAME);
+     }
+   else if (!strcmp(name, RADIO3))
+     {
+        state_set = atk_object_ref_state_set(obj);
+        g_assert(!atk_state_set_contains_state(state_set, ATK_STATE_CHECKED));
+        g_object_unref(state_set);
+        ++name_test_passed;
+        g_assert(name_test_passed == 3);
+
+        atk_object_set_name(obj, TEST_NAME);
+        g_assert_cmpstr(atk_object_get_name(obj), ==, TEST_NAME);
+     }
+   else
+     {
+        g_assert(0);
+     }
+
+   eailu_test_code_called = 1;
+}
diff --git a/eail/tests/eail_route_tc1.c b/eail/tests/eail_route_tc1.c
new file mode 100644 (file)
index 0000000..35b64ec
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailRoute
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailRoute
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailRoute")
+
+static void
+_init_route(Evas_Object *win)
+{
+   Evas_Object *bg;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   elm_route_add(win);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+   const char *role_name = atk_role_get_name(atk_object_get_role(obj));
+
+   _printf("atk_object_get_role: %s\n", role_name ? role_name : "NULL");
+   _printf("atk_object_get_type_name: %s\n", type_name ? type_name : "NULL");
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE_MAP);
+
+   /* NOTE: route widget does not support focus */
+   eailu_test_atk_focus(obj, FALSE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_route(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_route_tc2.c b/eail/tests/eail_route_tc2.c
new file mode 100644 (file)
index 0000000..bb972d0
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailRoute
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailRoute
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailRoute")
+
+static void
+_init_route(Evas_Object *win)
+{
+   Evas_Object *bg;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   elm_route_add(win);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_VALUE(obj));
+
+   GValue value = G_VALUE_INIT;
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   _printf("atk_value_get_current_value:\n%s\n", g_value_get_string(&value));
+
+   g_assert_cmpstr(g_value_get_string(&value), ==,
+                   "<longitude><min>0.000000</min><max>0.000000</max></longitude>\n"
+                   "<latitude><min>0.000000</min><max>0.000000</max></latitude>");
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   _printf("atk_value_get_maximum_value:\n%s\n", g_value_get_string(&value));
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   _printf("atk_value_get_minimum_value:\n%s\n", g_value_get_string(&value));
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   _printf("atk_value_get_minimum_increment:\n%s\n", g_value_get_string(&value));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_route(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_scroller_tc1.c b/eail/tests/eail_scroller_tc1.c
new file mode 100644 (file)
index 0000000..ff32ca5
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailScroller
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree. Test
+ *    accessible children availability.
+ *
+ * Test input: accessible object representing EailScroller
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailScroller")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_SCROLL_PANE);
+
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(1 == child_count);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   eailu_test_code_called = TRUE;
+}
+
+static void
+_init_scroller(Evas_Object *win)
+{
+   Evas_Object  *label, *scroller;
+
+   /* default */
+   label = elm_label_add(win);
+   elm_object_text_set(label, "");
+   evas_object_show(label);
+
+   scroller = elm_scroller_add(win);
+   evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, scroller);
+   evas_object_show(scroller);
+   elm_object_content_set(scroller, label);
+   elm_scroller_bounce_set(scroller, EINA_TRUE, EINA_FALSE);
+   elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
+   elm_scroller_propagate_events_set(scroller, EINA_TRUE);
+   elm_scroller_page_relative_set(scroller, 0, 1);
+   elm_scroller_region_show(scroller, 50, 50, 200, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_scroller(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_scroller_tc2.c b/eail/tests/eail_scroller_tc2.c
new file mode 100644 (file)
index 0000000..8941095
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailScroller
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailScroller
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+static const char *text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse bibendum, nibh eget vehicula tempus, libero dui aliquam dui, eget pellentesque nulla est id mi. Sed orci nisl, mattis vitae dignissim scelerisque, imperdiet vel arcu. Integer ut libero id massa commodo dignissim sed at orci. Quisque sollicitudin eleifend malesuada. Donec orci orci, mollis quis euismod vel, tincidunt nec ipsum. Sed ut nulla ligula, ut commodo tellus. Duis non felis in odio fringilla venenatis eget in metus. Mauris molestie ipsum tortor. Suspendisse potenti. Curabitur facilisis ultricies cursus. In euismod viverra risus sit amet pharetra. Sed mauris lorem, volutpat a vehicula quis, interdum nec erat. Suspendisse auctor bibendum fringilla. Curabitur tincidunt sem risus.\
+<br>\
+Vestibulum laoreet, leo ut sollicitudin viverra, odio enim tempor est, at ullamcorper augue massa sit amet lacus. Phasellus eget orci sit amet sem condimentum semper. Quisque imperdiet purus vitae lacus bibendum ultricies sollicitudin metus interdum. Phasellus aliquam sem vitae mi imperdiet eu cursus ipsum euismod. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam sed tellus non ligula commodo porta sagittis id augue. Vestibulum faucibus vehicula purus, sit amet porttitor ligula lacinia ac. Morbi ipsum libero, rhoncus id dapibus tincidunt, sagittis eget tellus. Proin vehicula accumsan velit cursus pharetra. Nullam pellentesque erat fringilla diam elementum fringilla. Nam lobortis ultricies suscipit. Pellentesque ut ipsum a nisi placerat rutrum id vitae justo. Fusce blandit ligula mollis est auctor scelerisque. Suspendisse luctus nibh vitae nibh congue rutrum. Nunc vulputate diam vel est lacinia a imperdiet purus scelerisque. Maecenas et nisl mauris. Aenean molestie dolor nec lacus laoreet ac dictum sem condimentum. Integer sit amet enim lorem, vitae tincidunt justo. Ut vulputate ullamcorper tortor, eu pharetra nulla aliquet in. Vestibulum ultrices sapien a ligula venenatis eu gravida lacus fermentum.\
+<br>\
+Etiam dignissim libero sed velit rhoncus ultricies. Aenean porta erat sit amet orci auctor auctor. Suspendisse aliquet arcu ut est ultrices ut venenatis dui scelerisque. Nulla vitae leo massa. Nullam scelerisque felis lectus, sed faucibus mi. Pellentesque hendrerit libero nec metus viverra lobortis. Nulla facilisi. Sed fermentum aliquet velit non imperdiet. Vestibulum nec ante imperdiet dolor convallis ornare sit amet interdum mi. In tellus lorem, lobortis vitae consectetur ac, mattis sed enim. Vivamus nibh enim, convallis sed rutrum sit amet, scelerisque ullamcorper ipsum. Mauris dignissim posuere sagittis. Fusce volutpat hendrerit augue ut dapibus. Aenean eu hendrerit lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;\
+<br>\
+Nullam orci eros, mattis at gravida sed, iaculis et dolor. Pellentesque sagittis sollicitudin malesuada. Sed tincidunt, sapien in mollis semper, quam enim gravida neque, eu blandit lacus ligula sit amet nisl. Aenean quam nulla, dapibus at venenatis vel, accumsan id dolor. Nam varius urna id nisi tempus ut dignissim nunc ultricies. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer lacus tortor, pellentesque auctor venenatis sed, laoreet eget erat. Nunc erat est, pharetra vestibulum luctus et, commodo eu quam. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Nam posuere diam vel felis scelerisque iaculis. Maecenas laoreet ipsum ac orci tempus lobortis.\
+<br>\
+Sed id massa metus, lobortis porta ipsum. Nullam pellentesque augue sit amet neque hendrerit vehicula eu quis elit. In nec ante massa. Praesent at pulvinar tortor. In laoreet molestie lectus, ut interdum lorem lobortis vitae. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum ligula sem, interdum eget gravida in, fringilla in sem. Phasellus orci felis, semper rhoncus pharetra a, pellentesque egestas elit. Ut bibendum, est vel gravida tincidunt, enim massa consectetur arcu, vitae pretium sem erat ac nisi. Ut eget erat nisl, eget laoreet arcu. Vivamus risus ipsum, aliquam non ornare et, ornare vel libero. Cras vel ipsum ut magna sagittis interdum at id risus. Morbi justo nulla, volutpat at molestie vel, mollis vitae nisl. Curabitur non erat elit, eu vehicula turpis. Sed eget feugiat neque.\
+<br>\
+Nulla facilisi. Donec sit amet ante sed lacus adipiscing hendrerit. Vivamus enim nibh, mollis eget elementum vitae, congue non sapien. Maecenas interdum magna vel velit faucibus tempus. Nullam nec nunc risus, lobortis imperdiet magna. Suspendisse potenti. Duis fringilla sodales massa eget egestas. Ut tincidunt adipiscing ante, quis consequat mauris venenatis vitae. Suspendisse mattis sollicitudin accumsan. Duis varius ornare dui ac interdum. Sed molestie elit sit amet dolor varius vel congue nibh varius. Donec semper risus placerat dolor blandit tempus. Etiam id leo sit amet nulla gravida suscipit ut ut metus. Curabitur non elit sit amet sem dapibus interdum ut dictum nunc. Integer ultrices tincidunt faucibus. Nam mollis turpis vitae nulla pulvinar in sodales purus lobortis. Cras nisl lectus, tincidunt a suscipit id, sodales nec nulla. Nulla faucibus pretium feugiat. Nam ullamcorper, ante nec ullamcorper eleifend, nisl est dictum magna, ac rhoncus quam lacus eu neque.\
+<br>\
+Cras sodales eros eget ligula porttitor tincidunt. Vivamus ac justo non nulla placerat tempor. Quisque ullamcorper venenatis lacus id mollis. Fusce tempor dui ut justo pretium at volutpat velit malesuada. In tellus diam, mattis sit amet viverra eu, porta sit amet metus. Pellentesque ante risus, dictum a rhoncus ut, hendrerit sed nisi. Donec congue dolor eu orci imperdiet id vulputate nulla eleifend. In vel risus urna, sit amet laoreet augue. Donec fringilla massa nec augue scelerisque eget fermentum augue mollis. Maecenas eu eros nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam lobortis, dui id sagittis vestibulum, magna ipsum venenatis sem, vel dapibus leo enim a elit.\
+<br>\
+Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin lectus felis, aliquet id euismod ac, vestibulum vel leo. Donec venenatis, nunc ornare dictum aliquet, dui purus ullamcorper massa, nec vehicula odio orci nec tortor. Cras sapien ante, laoreet ut placerat nec, mattis in velit. In hac habitasse platea dictumst. Vivamus viverra consectetur augue lobortis dignissim. Ut est nibh, varius at fringilla vitae, viverra at massa. Vivamus mattis bibendum lacus, at dignissim sapien auctor ac. Donec quis mauris lacus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus vel turpis quis ipsum mattis congue. Integer gravida semper eros vitae tempus. Maecenas volutpat mi vitae purus feugiat volutpat. Praesent ut diam lorem. Maecenas ultrices, felis a vestibulum auctor, neque dui tristique enim, id mollis nunc arcu eget dui. Sed rhoncus, ligula non elementum aliquet, ligula nisi lacinia sapien, sed mattis ipsum nibh et felis.\
+<br>\
+Nam libero diam, aliquam vel pharetra eu, fringilla sit amet lacus. Nullam varius eros vitae arcu porta ut accumsan massa ultrices. Donec at convallis magna. Proin sit amet dolor et enim fermentum blandit. In urna ligula, molestie lobortis varius eget, aliquam id justo. Maecenas ac viverra lacus. Quisque eros nisl, varius a sollicitudin at, auctor sit amet ligula. Nam in erat non leo volutpat pulvinar. Nulla quis turpis sit amet augue pharetra placerat non vel nunc. In at justo felis, ultrices congue lacus. Etiam sed est velit. Sed elementum, justo sit amet placerat porttitor, elit urna consectetur neque, eget scelerisque dui nisi quis magna. Donec condimentum sollicitudin augue eu volutpat. Etiam vel tempus mauris. Donec et leo eu nisl tempus malesuada sit amet in massa.\
+<br>\
+In in nulla eu justo venenatis hendrerit a ac ante. Mauris sollicitudin metus at eros volutpat eu tincidunt justo pharetra. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Nunc purus velit, ornare sit amet pretium eu, congue tincidunt nunc. Maecenas sollicitudin augue sed magna tempor non rhoncus lorem pulvinar. Mauris scelerisque fringilla accumsan. Aliquam et ligula nec lectus dapibus hendrerit. Etiam cursus metus eget odio consectetur sit amet egestas turpis pulvinar. Aenean nec risus vel ante condimentum condimentum. Quisque convallis nunc porta mauris vulputate imperdiet. Etiam varius, nunc sit amet hendrerit convallis, est purus cursus libero, et varius eros leo eget est. Vestibulum a augue nulla, a convallis lacus. Mauris gravida metus ac enim mattis tempor. Etiam accumsan tempor mattis. Fusce dignissim urna at leo pellentesque a blandit nisl faucibus. Fusce consequat auctor nisi ut sodales. Etiam imperdiet velit quis magna consequat placerat. Sed nisl purus, condimentum ac adipiscing vitae, consectetur placerat neque. Morbi molestie sapien sed ante sagittis ullamcorper vel sed erat.\
+<br>\
+Nunc at risus nec dui viverra imperdiet vitae quis velit. Mauris ornare consectetur lorem, vel blandit risus lacinia vitae. Integer gravida, neque porta malesuada malesuada, leo urna egestas urna, at elementum ligula ipsum non diam. Maecenas lobortis, est eget interdum eleifend, tellus leo suscipit orci, sed fringilla eros nisl at erat. Proin bibendum dictum varius. Sed lectus leo, feugiat quis sollicitudin sit amet, egestas quis lacus. Donec vel est nec leo porttitor sagittis non quis lectus. Nunc in ullamcorper urna. Mauris sit amet porttitor dolor. Praesent eu dui nisi, quis aliquet tortor.\
+<br>\
+Duis auctor ornare nibh, non mollis augue cursus vitae. Suspendisse accumsan commodo felis, vitae convallis eros volutpat a. Fusce tincidunt, purus laoreet bibendum dignissim, justo felis iaculis velit, ac feugiat tortor turpis non velit. Integer tristique ultricies dolor, at condimentum nunc rutrum vel. Nam a velit nisl, quis hendrerit erat. Nulla sit amet metus pellentesque nulla consectetur venenatis. Nunc auctor, dolor eu ultricies adipiscing, augue dui sollicitudin arcu, ut dictum nisi felis ac leo. Donec tempor erat at nisi aliquam pulvinar. Etiam rutrum massa vitae libero gravida ac ornare justo molestie. Pellentesque non nisl varius nisl laoreet convallis sed porta sem. Donec rhoncus sapien tempus ligula placerat interdum.\
+<br>\
+Donec varius posuere lorem, a fermentum est molestie eu. Maecenas metus ligula, faucibus ac pharetra vel, accumsan quis mauris. Nulla ultrices, nunc ut tincidunt suscipit, elit dolor bibendum ante, at gravida nisl mi dictum purus. Integer vulputate facilisis nisi, quis porttitor mi iaculis sed. Aenean semper facilisis quam, ut dictum mauris vehicula sed. Sed non sem quis magna ornare egestas ut quis velit. Suspendisse ut quam est, euismod facilisis magna. Etiam mattis pulvinar augue, eget tristique purus porttitor non. Sed egestas dui ac odio auctor convallis. Sed posuere ornare iaculis. Aenean ac nulla ipsum, molestie facilisis eros. Phasellus tincidunt nunc diam. Aliquam malesuada, velit et tincidunt interdum, dolor mi hendrerit velit, quis facilisis ligula dui ac elit. In viverra pretium enim vel tempus.\
+<br>\
+Morbi at adipiscing nisi. Fusce vel turpis vel libero commodo mollis id iaculis urna. Nullam et elit non lectus egestas semper. Curabitur sodales turpis sit amet metus fringilla quis fermentum orci lacinia. Aenean lacinia feugiat hendrerit. Vivamus nec nisi nec neque lacinia rhoncus ut id erat. Suspendisse luctus tortor sed arcu interdum sit amet aliquet neque vehicula. Curabitur eget nunc vitae libero vulputate dictum. Etiam volutpat fermentum felis fringilla euismod. In scelerisque gravida dolor id molestie. Nam faucibus sapien id neque vehicula semper. Nulla egestas urna vitae sem scelerisque rhoncus. In hac habitasse platea dictumst. Nulla vitae lacus in diam aliquet sollicitudin vel nec leo. Sed ornare pellentesque nibh, a malesuada erat imperdiet et.\
+<br>\
+Maecenas adipiscing diam a urna interdum pharetra. Phasellus vitae turpis urna, ac consectetur sem. Sed porttitor nulla in nulla mattis tincidunt non eu lacus. Aliquam quis metus turpis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque at sapien quis purus bibendum lobortis. Donec in tincidunt nisl. Phasellus interdum tellus non leo aliquet ut vulputate nisl aliquam. Aliquam faucibus lorem ut lorem convallis non lobortis felis consequat. Phasellus nec leo ac turpis egestas laoreet. Cras venenatis odio et diam faucibus pellentesque. Quisque eu orci magna, quis lacinia tellus.\
+<br>\
+Aliquam nisl purus, aliquam quis tristique nec, varius eget risus. Nam sed ipsum leo. Proin congue sapien quis libero porta ornare. Mauris vel orci odio. Nam nec felis nibh, non congue odio. Duis vel mattis enim. Maecenas at dui eget ipsum pharetra consequat ac in massa. Proin fringilla arcu non enim feugiat accumsan. Proin tincidunt ligula mattis risus hendrerit in scelerisque risus aliquam. Vivamus libero sapien, ornare ut fringilla ullamcorper, sodales mattis purus. Quisque mauris sem, fermentum vitae adipiscing non, ultricies id mauris. Donec tincidunt, odio vel luctus hendrerit, dui mauris posuere erat, at interdum arcu nunc tincidunt dui. Pellentesque diam orci, malesuada a pellentesque nec, rhoncus at tellus.\
+<br>\
+Morbi in lacus nunc. Proin congue nisi at nunc gravida imperdiet. Duis et elementum arcu. Cras pretium, tortor in ultrices pharetra, sem ante condimentum elit, at dapibus augue lectus ac est. Pellentesque gravida rutrum pulvinar. Nulla nunc odio, dictum id tempus sit amet, faucibus volutpat nunc. Vestibulum ut ultricies tellus. Donec eget tortor metus, pellentesque placerat eros. Suspendisse ut lacus ipsum, sed fermentum est. Sed interdum ornare augue, sit amet bibendum ligula molestie eget. Aenean ac elit diam, eget ultricies nunc. Nullam quis nibh vitae diam pellentesque viverra. Aliquam ultricies elementum enim tristique malesuada. Vivamus rhoncus faucibus nunc, a pharetra enim sollicitudin ac. Suspendisse ultricies sodales metus vel rhoncus. Integer feugiat euismod molestie. Phasellus iaculis magna imperdiet erat consequat et pretium orci tincidunt.\
+<br>\
+Morbi tristique cursus consequat. Morbi posuere lacinia odio quis auctor. Nulla dui nisi, tincidunt condimentum aliquam sed, adipiscing cursus sem. Nullam eleifend lacus tempor nisl semper quis cursus velit vehicula. Morbi aliquam, sem at sollicitudin laoreet, nibh erat congue nisi, a pulvinar nulla orci vulputate orci. Morbi eu orci enim, quis aliquam ante. Nam ultricies laoreet varius. Proin vehicula sem vitae dolor ullamcorper et rhoncus lacus cursus. Nullam sit amet mauris sapien, vitae condimentum justo. Cras eu arcu magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus vulputate erat ac diam sagittis dignissim non nec tellus. Vivamus tristique quam vel velit mollis in congue nulla malesuada. Phasellus hendrerit egestas urna vitae egestas. Morbi vitae enim magna. Proin quam tellus, tincidunt ut mollis ut, semper a mi. Vivamus nec pharetra purus. Aenean at lorem mauris, sed facilisis quam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\
+<br>\
+Cras tempor, enim in ullamcorper dignissim, elit eros sodales augue, vel molestie velit tellus sed risus. Suspendisse fermentum, augue id facilisis hendrerit, magna dolor euismod lectus, gravida consequat neque turpis lacinia nisi. Etiam id mi nulla, nec ultrices leo. Aliquam et mi tortor. Duis ullamcorper enim a tellus gravida ornare. Sed interdum, felis eu consequat sagittis, lectus neque ultricies velit, eget egestas ligula quam et mauris. Nunc eu quam enim. Duis tempus, arcu at tristique tristique, justo est gravida orci, vitae hendrerit risus tellus eu urna. Nunc vitae nunc vitae augue malesuada viverra. Etiam nec diam sit amet augue commodo pharetra. Fusce lectus urna, aliquam eget rhoncus tempor, ultrices et lacus.\
+<br>\
+Phasellus tincidunt, diam et ultricies ornare, ante tortor pretium elit, vitae viverra urna ipsum vel ipsum. Duis semper magna ac mauris rutrum facilisis. Suspendisse mi velit, auctor at rutrum sit amet, lacinia at orci. Phasellus diam magna, vulputate ac accumsan non, ultricies et lorem. Etiam nisi purus, tempor vel aliquet in, egestas sit amet massa. Quisque auctor, dui quis aliquet condimentum, ligula urna rhoncus mi, non vehicula velit sapien eu libero. Nam et elit elit, nec semper enim. Sed quis nulla ut ipsum consequat placerat. Nullam eros risus, congue et tincidunt et, ornare ac nibh. Aliquam vitae neque ac orci tincidunt pharetra. Quisque ac augue iaculis nisi lacinia laoreet. Etiam dolor magna, convallis eu bibendum vel, pellentesque non mi. Etiam eget nibh in metus venenatis hendrerit sit amet ac ligula. Nullam laoreet lobortis fringilla.\
+<br>\
+Donec non nunc sit amet sem consectetur sodales. Donec nisi ipsum, imperdiet sed commodo nec, placerat ac eros. Sed ac orci sit amet nisl molestie vestibulum. Nam sollicitudin mauris ac eros consequat iaculis. Nam aliquet lobortis ligula, at tempor libero hendrerit id. Vivamus at nisl eget sem dapibus dapibus quis at enim. Nam eget nisi urna. Nam ultrices, nibh ac vehicula dapibus, ante odio vestibulum ante, ut volutpat orci lectus in mi. Aliquam venenatis fermentum condimentum. Aliquam ac lacus elementum nisl molestie auctor ullamcorper sed orci. Nullam tristique metus sit amet purus commodo vulputate. Ut ante turpis, congue non lobortis non, vehicula non diam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris lobortis magna ac est facilisis in congue orci semper. Etiam et lacus eget elit viverra dictum eu ut neque. Vestibulum diam erat, posuere ut sagittis at, ultrices sed turpis. Cras justo risus, tempus eu facilisis vel, tempus scelerisque est. Vestibulum sagittis mauris ac turpis malesuada tincidunt. Proin et eros eget augue pellentesque tristique non in justo. Integer in leo sit amet lectus convallis rhoncus vitae eu quam.\
+<br>\
+Nulla eleifend hendrerit sem, vel feugiat mauris pellentesque vel. Vivamus ut lectus enim. Vestibulum nulla lacus, vestibulum et viverra sed, malesuada vitae urna. Integer consectetur, ante eget cursus tristique, lectus felis dignissim ipsum, non mollis arcu dui eu lacus. Integer sed ante ut magna euismod molestie sit amet ut leo. Quisque nec leo dui. Nunc sit amet ligula mi. Etiam sagittis scelerisque neque, ac lobortis lacus feugiat pellentesque. Donec ultricies est vel est tempus non volutpat turpis feugiat. Suspendisse potenti. Vestibulum et velit vitae nisi eleifend tincidunt quis eu odio. Nunc a massa arcu, ut ultrices sem. In eu tempor enim. Praesent aliquam arcu eleifend metus accumsan non pharetra dui ornare. Cras lorem leo, scelerisque sed suscipit at, semper porta magna. Vestibulum pellentesque, erat congue euismod fermentum, mauris purus blandit ligula, at luctus nisl magna in metus. Sed pulvinar, ipsum eget hendrerit egestas, lacus odio posuere tortor, in euismod libero purus id orci. In hac habitasse platea dictumst. Curabitur feugiat semper varius. Aliquam mauris metus, rhoncus in rhoncus non, blandit eget magna.\
+<br>\
+Cras sapien odio, facilisis id accumsan ut, laoreet sit amet felis. Duis et velit sed tellus volutpat porttitor. Praesent sagittis hendrerit sapien sit amet scelerisque. Vivamus vitae justo at mi venenatis cursus. Nulla est purus, lobortis vel rutrum vel, aliquam in ligula. Sed tortor mauris, pulvinar eget luctus id, faucibus at justo. Phasellus massa quam, tincidunt vel condimentum a, varius vitae tortor. Cras gravida ullamcorper mauris, vel condimentum neque sollicitudin sit amet. Nullam quis justo elit, facilisis dapibus orci. Ut ullamcorper, velit a fermentum elementum, erat erat posuere lacus, egestas iaculis nulla ante eget nibh. Nam ullamcorper leo at diam consectetur molestie. Suspendisse porttitor, eros ac euismod vulputate, tortor libero tempor urna, non pharetra nisl nunc quis sapien. Mauris commodo venenatis risus, eu commodo neque ultricies adipiscing. Nullam ac nunc tortor. Sed consectetur placerat luctus. Curabitur non risus lacus, tristique fermentum quam. Pellentesque viverra, nulla in imperdiet accumsan, eros erat ultrices enim, at adipiscing massa sapien vitae elit. Praesent libero tellus, pharetra et placerat sed, facilisis ut mauris. Phasellus nisl justo, consectetur quis eleifend eget, pulvinar eget erat.\
+<br>\
+Integer placerat tellus vitae leo luctus ac cursus velit varius. Fusce pulvinar iaculis purus, placerat blandit est imperdiet sit amet. Nulla tincidunt pellentesque tortor ac consequat. Morbi hendrerit, elit non sollicitudin lobortis, massa nunc rhoncus eros, vel egestas felis dolor non nunc. Praesent vel sagittis elit. Mauris pretium leo molestie purus ornare at volutpat risus suscipit. Integer quis orci et magna dapibus gravida. Maecenas metus est, egestas eu interdum nec, suscipit et turpis. Pellentesque eu sagittis ligula. Aenean interdum sem purus. Maecenas interdum nibh aliquam libero aliquam laoreet. Morbi mollis, ligula id vehicula malesuada, velit ipsum euismod nisi, quis mattis turpis neque eu odio. Praesent ultrices vestibulum nisl, non eleifend dui convallis vitae. Pellentesque id sem enim. Morbi eu turpis massa, non fringilla erat. Mauris at metus ut urna luctus rutrum vel in lorem. Donec vel facilisis nisi.\
+<br>\
+Phasellus sed facilisis mi. Suspendisse mollis sapien vitae lectus tincidunt a molestie nisl feugiat. Etiam sagittis lectus ut risus tempus consectetur. Phasellus non dolor massa, ac consequat mauris. In suscipit, purus sed pretium lacinia, odio tortor vestibulum leo, ac facilisis libero est eget neque. Nullam vel sem sem, vel egestas purus. Etiam tempus sem sit amet purus tempus hendrerit. Sed bibendum lacinia dapibus. In magna ipsum, molestie id mattis ut, posuere semper velit. Fusce ut lectus felis. Vivamus sagittis aliquam leo, ut facilisis tortor iaculis vel. Praesent egestas placerat est, ut congue justo vestibulum sed. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut id pellentesque nisi. Fusce bibendum urna eget leo porttitor tincidunt. Nunc blandit condimentum hendrerit. Nullam placerat, risus sed condimentum rhoncus, nisl neque imperdiet metus, condimentum lacinia ipsum elit non felis. Donec sit amet felis et diam adipiscing mattis.\
+<br>\
+Nulla et nisi ante. Duis ac nisi ut nibh mattis fringilla. Duis sapien lectus, consequat ut feugiat a, feugiat ut nisi. Aenean enim leo, gravida non bibendum id, vulputate eu magna. Suspendisse sed tortor faucibus eros sollicitudin fermentum. Ut cursus tellus ut dolor fermentum et iaculis mauris egestas. Donec sit amet massa leo, eget dignissim ante. Nam dignissim massa a risus lacinia at varius ligula tempus. Vivamus dignissim sem in enim consectetur sagittis. Aenean aliquam hendrerit urna eu aliquet. Donec luctus suscipit odio, ut accumsan neque suscipit vitae. Integer hendrerit facilisis orci feugiat commodo. Praesent vestibulum orci et turpis vehicula vulputate. Sed in purus sit amet tortor sagittis lacinia. Nam nibh justo, rhoncus et ultrices non, venenatis nec ligula. Suspendisse eget lacus sapien, et consequat erat. Ut auctor condimentum magna, ac condimentum magna laoreet volutpat. Sed urna urna, ultricies eget venenatis nec, adipiscing nec tellus.\
+<br>\
+Praesent viverra dui eget nisl lobortis in malesuada nunc sollicitudin. Aenean bibendum scelerisque metus ac facilisis. Donec est neque, egestas eu aliquet commodo, dictum eu metus. Quisque vel purus in sapien tristique euismod vitae nec eros. Aliquam tincidunt viverra odio. Aenean euismod lectus rutrum eros tempus ut lacinia eros pharetra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras at sapien augue. Sed posuere, dolor nec ullamcorper venenatis, est est pulvinar urna, vel placerat nulla ligula sed eros. Pellentesque nec enim magna. Ut pharetra quam a lectus dapibus eu tristique ante porta. Aliquam vel augue eu risus mollis blandit sit amet vel arcu. Donec lobortis lacinia magna nec aliquet. Suspendisse fermentum magna eget est posuere nec pellentesque enim accumsan.\
+<br>\
+Vivamus commodo urna sit amet enim iaculis vel accumsan odio interdum. Etiam est lectus, fringilla in fermentum nec, imperdiet sit amet sapien. Suspendisse vitae lacus vel elit convallis iaculis non eu tellus. In nec dolor diam. Mauris sed tortor id ligula vestibulum mollis sit amet a neque. In hac habitasse platea dictumst. Donec a velit vel nunc ornare euismod sit amet vitae risus. Sed ultrices semper nibh, quis gravida magna dapibus ac. Fusce ut ligula velit. Aenean non mollis augue. Proin ut ligula nisi. Duis nec consequat dui. Praesent vel mauris orci. Nullam est nunc, ultrices ultricies suscipit et, adipiscing in augue. Sed porttitor mi in nunc euismod tincidunt.\
+<br>\
+Quisque laoreet congue augue quis cursus. Donec sed nisl odio. Etiam rhoncus fermentum lacus, quis pharetra urna semper vitae. Quisque non nisi at nunc volutpat porttitor. Donec ligula massa, suscipit non facilisis vitae, lacinia sit amet lacus. Fusce vel turpis orci. Etiam quis ligula eu nibh tincidunt posuere. Mauris sit amet quam leo, porta interdum diam. Nullam purus metus, facilisis quis ullamcorper vitae, mattis ultrices ante. Sed tincidunt lorem aliquet magna ultrices eleifend. In non nisi orci. In imperdiet, tellus eget fringilla elementum, lorem magna faucibus libero, id placerat turpis enim eget erat. Ut eros justo, ullamcorper ut sagittis eu, condimentum in arcu. Proin vel nisi ligula, vitae hendrerit purus. Vestibulum dignissim pulvinar consectetur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse ac eros risus.\
+<br>\
+Cras at massa quam. Cras eget dolor tortor. Mauris non nisl sapien. Maecenas dictum tincidunt erat nec tincidunt. Maecenas vestibulum lobortis varius. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin adipiscing tincidunt mauris quis fringilla. Maecenas sit amet ligula vitae neque tincidunt pulvinar quis id orci. Pellentesque sagittis tellus eget leo dapibus tempor. Duis eu diam non justo tincidunt gravida. Cras eros dolor, sodales eget elementum et, adipiscing in enim. Suspendisse at elit elit, id dignissim nisl. Donec imperdiet, quam vitae mattis hendrerit, leo arcu sagittis massa, a placerat urna sapien viverra tortor. Integer auctor, felis non condimentum ultrices, lectus ligula vestibulum eros, non pharetra libero purus eu purus. Duis ornare lacinia erat vitae sagittis. Sed fringilla volutpat magna, id auctor nisi elementum ut. Nulla facilisi. Quisque ut quam elit, ac consequat ligula.\
+<br>\
+Etiam fringilla lobortis mauris, in ullamcorper elit vestibulum eu. Ut dolor nisi, egestas vel consequat sit amet, faucibus vel nulla. Etiam vitae nibh ut dui imperdiet accumsan vel quis arcu. Suspendisse potenti. Ut vitae tellus risus, eu imperdiet eros. Nam vitae lacus a leo pulvinar feugiat. Donec augue mauris, suscipit porta euismod at, viverra vel magna. Cras luctus viverra neque, sit amet venenatis mi consequat id. Nulla consequat consequat nunc, eget mattis nisl tempor id. Praesent mattis sagittis tortor sed feugiat. Nunc vitae nisl est, a feugiat orci. Fusce in ipsum mauris. Etiam mattis sollicitudin nisi eu imperdiet. Duis in laoreet libero. Aenean eleifend est sit amet purus ultricies pretium. Morbi id nisl ut purus tempus sollicitudin quis non tellus. Donec sed quam ac nisl cursus euismod eu euismod eros.\
+<br>\
+Suspendisse mattis elementum sapien. Aliquam erat volutpat. Sed a tortor vitae nisi ornare vehicula. Praesent id faucibus sem. Mauris luctus ornare ipsum, id euismod lorem fermentum id. Maecenas egestas, mi sit amet porta facilisis, erat elit pretium nunc, ut mollis ipsum metus iaculis ligula. Duis semper ligula rhoncus nibh vehicula in scelerisque diam rhoncus. Vivamus quam magna, ultricies et posuere sed, mollis tristique est. Vivamus consectetur cursus diam, vitae pharetra nisi aliquam et. Nulla tortor sem, molestie quis pellentesque nec, tincidunt a libero. Proin tincidunt purus ut purus ornare dictum. Proin vehicula orci eu eros aliquam eu posuere turpis lobortis. Vivamus dapibus bibendum tristique. Donec facilisis fringilla mauris nec consequat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse ac nunc nec lacus interdum adipiscing eget vel quam. Duis rhoncus urna quis nisl elementum laoreet. Integer euismod tincidunt pulvinar.\
+<br>\
+Sed congue scelerisque blandit. Nam pharetra, nisi at auctor elementum, dolor elit bibendum mauris, congue feugiat arcu turpis non tortor. Cras tincidunt tellus sit amet nulla fermentum adipiscing. Mauris imperdiet purus vel nulla tempor vel elementum metus tempor. Aliquam eu dolor ut risus scelerisque commodo. Ut adipiscing nisl eget nisl mollis semper. Vestibulum arcu augue, sodales convallis venenatis ac, egestas euismod metus. Cras luctus elit sed nisl faucibus at accumsan lectus pharetra. Nunc rhoncus turpis est, vitae luctus turpis. Mauris tempus, velit sit amet feugiat consequat, tortor diam scelerisque urna, sit amet convallis est nisi quis dolor. Vivamus facilisis tellus quis sapien dapibus at sodales elit feugiat. Cras varius laoreet urna, eu tincidunt orci iaculis in. Sed quis lacus ac ligula aliquam egestas. Nam mattis massa sed magna lacinia pharetra. Sed semper faucibus mauris, ut consectetur libero tristique nec.\
+<br>\
+Proin vel elit id ante lacinia molestie quis in lectus. Nunc in ante nulla. Nam nec sem sed felis placerat rutrum. Sed pharetra molestie metus facilisis ornare. In sed nunc vel tellus volutpat dictum. Nunc risus enim, congue vel fermentum sed, varius eget elit. Proin vitae mi tortor. Pellentesque ut justo ligula. Nunc nibh elit, mattis at iaculis ac, pretium fermentum dui. Praesent in quam turpis. Quisque id velit eros. Nulla facilisi. Maecenas commodo dignissim libero nec pharetra. Praesent eget augue nec odio scelerisque sagittis. Donec nec dui dolor. Donec est nisi, faucibus vitae ultricies quis, cursus vel lorem. Nulla suscipit ultricies dui, vitae volutpat risus fermentum sit amet.\
+<br>\
+Morbi eu libero urna. Aliquam et nunc nec risus varius aliquet. Aenean semper sem sed purus ornare aliquam. Maecenas lobortis tristique nibh, id fermentum est egestas vel. Nam ut tortor pharetra augue rhoncus vulputate et et nisl. Donec scelerisque aliquet convallis. Quisque felis tellus, aliquet eu fermentum sed, mollis et lorem. Vivamus imperdiet, mauris at imperdiet tempor, elit justo aliquet purus, vitae vulputate dui elit euismod nulla. Nam nisl sem, laoreet at fermentum eu, eleifend vel quam. Duis venenatis hendrerit felis eget viverra. Aenean tincidunt ultrices pulvinar. Duis at risus tellus, sed euismod ipsum. Donec sit amet dui quam. Praesent at nunc a turpis sollicitudin faucibus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt accumsan lacinia. Nunc blandit gravida urna, quis venenatis metus mollis vel. Cras a nunc ac tortor aliquam fermentum ac sed purus. Etiam porttitor tincidunt risus, et scelerisque velit egestas vitae. Nulla at arcu sed sapien vehicula laoreet.\
+<br>\
+Pellentesque rhoncus odio id ante porttitor mollis. Nullam non mi vel erat suscipit lobortis. Vivamus urna neque, gravida ac interdum eget, commodo sit amet nunc. Maecenas libero nisl, bibendum eget tristique eget, laoreet vitae arcu. Maecenas porta diam vel libero tempus fermentum. Aenean molestie fringilla magna, tincidunt condimentum nunc aliquam nec. Mauris congue commodo lacus, in condimentum orci posuere id. Maecenas in ultrices ipsum. Nam sit amet orci nisi, ac lacinia nibh. Nullam molestie lorem eget felis interdum nec semper neque ultrices. Nunc et leo eu leo faucibus euismod. Suspendisse potenti. Vivamus id enim sed augue rutrum volutpat.\
+<br>\
+Curabitur facilisis placerat mi nec consectetur. Sed sed ante orci. Aliquam dapibus egestas dapibus. Aliquam feugiat urna ut libero adipiscing sed consectetur nulla mollis. Donec lacinia condimentum libero a egestas. Vivamus vestibulum ipsum ante, vitae fermentum libero. In hac habitasse platea dictumst. Ut sed quam libero. Aliquam bibendum sollicitudin faucibus. Nam elit felis, pulvinar vitae convallis id, fermentum sed leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec dolor neque, vehicula commodo vulputate et, faucibus id nisi.\
+<br>\
+Vestibulum id metus in lectus iaculis aliquet rhoncus sit amet justo. Phasellus ac arcu ac felis auctor volutpat vitae nec mauris. Integer convallis, eros vel molestie tempor, odio enim posuere libero, quis iaculis elit ipsum eu eros. Sed metus diam, elementum ut scelerisque eu, scelerisque suscipit tellus. Aliquam congue fringilla sapien, vitae viverra arcu egestas sed. Donec quis lacus ipsum, ac faucibus eros. Suspendisse potenti. Cras non ipsum et dui tristique interdum. Vivamus ultrices vestibulum augue. Donec ac lacus quam, nec commodo eros. Quisque ac lacus lorem, vitae pellentesque nisl. Aliquam nec justo augue, quis porta tortor. Cras sit amet egestas eros. Duis neque ante, vulputate vel faucibus eu, sodales nec justo. Sed sagittis egestas orci sed lobortis. Donec eget consectetur nulla.\
+<br>\
+Vivamus mollis sodales ligula non imperdiet. Duis eget volutpat velit. Nunc eu dolor felis. Vestibulum massa augue, convallis in facilisis eget, vestibulum in mi. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis non ante enim, non volutpat massa. Mauris nunc turpis, dignissim non egestas vel, tristique id sem. Phasellus magna purus, scelerisque eget varius in, convallis id enim. Sed eu dolor neque, nec porta odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam pharetra diam id pharetra. Nulla lectus orci, condimentum sed malesuada vulputate, dictum quis purus.\
+<br>\
+Pellentesque quis lorem orci, commodo faucibus lectus. Nullam cursus, purus in porttitor tincidunt, enim ligula sagittis urna, eu fermentum velit eros a sapien. Maecenas ornare, mi eget faucibus malesuada, leo justo lobortis erat, et lobortis massa dolor ac augue. Nulla pulvinar malesuada lorem, id venenatis nulla pulvinar non. Praesent ac augue tortor, a feugiat risus. Vestibulum molestie ultrices felis vel fermentum. Maecenas feugiat eros non libero tempus condimentum sed sed metus. Sed sagittis metus et dui facilisis vitae vehicula massa convallis. Morbi sed ante nulla, nec posuere lorem. Donec euismod fringilla diam, in suscipit libero eleifend nec. Donec tristique scelerisque nibh sed euismod. Ut sed felis erat, ullamcorper vehicula sapien. Nunc pharetra interdum pretium. Nunc a mauris orci. Cras eu quam justo.\
+<br>\
+Proin ultricies dolor sit amet eros sollicitudin nec pulvinar tortor luctus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin imperdiet turpis sit amet libero placerat in mattis quam molestie. Quisque luctus sem libero, vel venenatis purus. Ut vehicula egestas risus in pulvinar. Etiam ut vehicula est. Quisque commodo erat id est mattis pretium. Ut lobortis mauris a magna eleifend ultrices. Donec lacinia pharetra nisi, nec laoreet lacus varius et. Morbi risus diam, pulvinar a convallis id, blandit in lorem. Mauris quis tempor mi. Integer at nisi sapien. Integer dignissim consectetur tellus id rutrum. Nulla odio augue, sagittis in vestibulum ac, viverra convallis purus. Aliquam commodo mi id nibh bibendum vel viverra arcu consequat. Proin ipsum velit, ultrices id egestas nec, gravida eu dolor. Duis facilisis orci eu turpis feugiat ullamcorper. Integer venenatis metus non erat facilisis vel consectetur lectus varius. Nunc ac leo magna, a aliquet felis. Curabitur malesuada, arcu quis interdum lacinia, sapien sem condimentum ante, ac lacinia purus metus at orci.\
+<br>\
+Sed venenatis neque eu arcu bibendum imperdiet. Maecenas eget augue quis enim pretium cursus vitae venenatis dolor. Maecenas sit amet mauris mi. Aliquam luctus, dolor varius rhoncus rhoncus, diam turpis bibendum dui, eu hendrerit arcu nibh nec orci. Praesent condimentum, leo et commodo vulputate, purus odio interdum est, sed aliquam tellus lectus ut justo. Aenean pulvinar luctus dapibus. Nulla tempus, ante vel dictum ultricies, massa urna tincidunt libero, ut rhoncus risus turpis eget arcu. Morbi auctor commodo libero, in pretium quam vestibulum nec. Aenean ac tincidunt nulla. Cras vel orci enim. Praesent non metus ipsum.\
+<br>\
+Praesent ligula nulla, aliquam in tincidunt eu, lacinia eget neque. Integer tincidunt neque in risus malesuada gravida. Nullam ornare viverra nisl vel interdum. Nullam eget lectus a ipsum condimentum aliquam sit amet eu felis. Nam eu nisl enim. In pulvinar tincidunt ultrices. Morbi mi ipsum, placerat sit amet mollis vel, tincidunt vel nisi. In sed eros non magna sodales convallis pulvinar non turpis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce volutpat egestas elit, in lobortis urna egestas vitae. Nulla non tincidunt massa. Praesent ut convallis nunc. Morbi quis massa non lacus lobortis tempor non id libero. Proin turpis ante, porta et ullamcorper sit amet, malesuada vitae nisl. Suspendisse faucibus, ipsum quis varius porta, tellus augue porta arcu, nec posuere massa libero sed enim. Sed id suscipit ante. Ut fringilla sagittis orci porta tincidunt. Proin non massa sem. Nullam sollicitudin mauris et lorem euismod ut eleifend neque tempus.\
+<br>\
+Duis est est, rhoncus vel feugiat sed, iaculis id arcu. Donec ultrices lacinia dapibus. Fusce accumsan malesuada dolor, vitae viverra quam condimentum et. Sed id tellus lacus, ut sollicitudin turpis. Donec egestas ante et nunc consequat dapibus. Duis rutrum scelerisque orci, sollicitudin congue lectus condimentum non. In quis lacus et justo pellentesque vehicula. Nulla accumsan hendrerit lectus, non ornare nibh vehicula vitae. Sed iaculis dapibus laoreet. Nunc rutrum eleifend mi, ac interdum augue egestas nec. Morbi feugiat tincidunt eros, sit amet congue nisl ultricies sed. Nulla id est non dolor mattis lacinia. Mauris quis faucibus libero. Phasellus facilisis, massa a dapibus elementum, augue magna auctor tellus, nec placerat lorem lacus in purus. Morbi congue ipsum in dui euismod eleifend auctor eros eleifend. Pellentesque porttitor tincidunt pharetra. Maecenas quis tellus sed arcu convallis ultrices mollis ut neque.\
+<br>\
+Duis non sem ut mi facilisis pretium sit amet a erat. Suspendisse dignissim nisl nec risus tincidunt vitae ultrices arcu bibendum. Donec condimentum ullamcorper ipsum at vehicula. Donec interdum, odio vel blandit aliquet, nisi urna iaculis ligula, a ullamcorper mi ligula nec ligula. Curabitur pellentesque, augue id volutpat aliquet, lorem enim auctor sem, at tempus nibh augue ac diam. Etiam interdum lorem non nisi tempus vestibulum ut convallis elit. Cras cursus facilisis velit eget consectetur. Duis faucibus nulla sed leo accumsan et pharetra turpis aliquet. Curabitur ullamcorper tincidunt sapien lacinia suscipit. Curabitur consectetur, urna nec tempor lobortis, massa lectus accumsan turpis, vitae semper erat leo at dui. Sed ut facilisis velit. Ut vestibulum dapibus gravida. Quisque pellentesque auctor tortor eu malesuada. Vestibulum mauris dolor, tristique sit amet varius sit amet, varius eget neque. Curabitur in urna sit amet mi cursus pharetra sit amet at odio. Vivamus enim neque, tincidunt id adipiscing ac, volutpat non massa. Quisque gravida malesuada felis, eu aliquam nulla vestibulum id. Nullam eleifend ultricies cursus.\
+<br>\
+Pellentesque rutrum elementum orci, nec feugiat nisl vehicula nec. Suspendisse quis turpis ipsum. Maecenas eleifend nibh sit amet nisi auctor at auctor libero auctor. Suspendisse potenti. Morbi nec orci quis quam porttitor malesuada. Curabitur blandit luctus lacinia. Cras id turpis neque, a luctus justo. Morbi nec turpis risus. Fusce posuere urna sed nisl scelerisque mattis. Cras leo neque, dignissim ut vestibulum at, viverra in magna. Proin tellus leo, cursus eu porta id, eleifend in purus. Integer ut sapien leo, sed aliquet diam. Proin hendrerit imperdiet tincidunt.\
+<br>\
+Quisque rutrum urna non mi commodo vitae vestibulum velit tincidunt. Pellentesque vitae dolor et leo porta consectetur. Fusce semper eleifend tincidunt. In hac habitasse platea dictumst. Nulla mollis, dui in malesuada feugiat, sapien sapien porttitor nulla, at congue metus turpis vel arcu. Phasellus quis enim eu quam varius interdum quis lobortis magna. Quisque augue orci, suscipit eu malesuada ac, convallis id tortor. Fusce et tortor a mi fringilla congue. Praesent iaculis justo vel leo fringilla sodales. Nullam egestas, orci scelerisque placerat sagittis, diam tellus semper libero, in imperdiet neque sapien eget magna. Etiam eget massa orci, at interdum neque. Integer molestie enim eu sapien pellentesque lobortis a ac urna. Donec eu elit sit amet nunc bibendum faucibus et vel orci. Sed fringilla tristique sollicitudin. Donec rutrum pellentesque velit luctus suscipit. Aliquam lobortis sollicitudin ante at consectetur. Praesent nulla sapien, condimentum quis ornare quis, consequat sit amet arcu. Suspendisse potenti.\
+<br>\
+Ut volutpat lorem in lorem malesuada ultricies. Nunc nec eros lorem, ac iaculis velit. Donec vel metus lorem, a suscipit odio. Aliquam tincidunt nulla sit amet urna porttitor pulvinar. Cras adipiscing venenatis nibh a viverra. Etiam a metus nibh. Praesent sodales feugiat dolor, in scelerisque purus dapibus commodo. Mauris non mi metus. Fusce a aliquet ante. Aliquam erat volutpat. Praesent nec condimentum elit. Sed posuere orci et tortor volutpat sollicitudin. Vestibulum bibendum convallis dolor, non hendrerit velit consectetur eu. Aenean pharetra neque ac felis sollicitudin a ornare nunc accumsan. Aenean luctus dolor non purus lobortis sodales eget eget libero. Vivamus risus quam, vestibulum in ullamcorper et, vestibulum sit amet nunc. Ut odio felis, condimentum eget venenatis ut, suscipit ac sem. Nulla sit amet leo a metus hendrerit vehicula at vitae ante.\
+<br>\
+Aliquam diam leo, ultrices a sodales sed, laoreet id purus. Nullam eleifend leo vitae nisi euismod ac posuere elit tempus. Phasellus sed tellus est, eget fringilla diam. Aenean tempor enim quis nisi congue vitae placerat turpis vehicula. Proin congue, risus in pretium euismod, lacus tellus porttitor nulla, eget egestas lacus orci id orci. Proin nulla mauris, feugiat imperdiet consectetur id, condimentum ac libero. Donec consectetur leo a elit tincidunt vitae luctus nisl porta. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sit amet orci quis dolor molestie commodo. Integer placerat risus neque. Phasellus non laoreet tellus. Nam pulvinar pellentesque nibh, egestas suscipit nisl gravida ac. Quisque sodales lorem imperdiet orci consequat ultricies. Phasellus fringilla diam id neque facilisis pharetra.\
+<br>\
+Nam scelerisque nulla ut neque tempor blandit volutpat nisl vehicula. Nam orci enim, luctus ut venenatis et, egestas id nunc. Phasellus risus sem, scelerisque sed vestibulum a, aliquam at sem. Sed venenatis tristique nisi id eleifend. Morbi urna tellus, cursus ac porttitor rhoncus, commodo at mi. Mauris ac magna nisi. Maecenas rutrum lobortis sapien, sed dapibus neque hendrerit a. Aliquam fringilla lectus nec arcu tempor et molestie dui suscipit. Proin et felis velit, vel pellentesque ligula. Donec tempus, mi at mollis porttitor, mauris urna congue elit, at varius nisi elit et est. Quisque eu libero lorem, eget tincidunt velit. Nullam hendrerit metus quis urna adipiscing quis tristique tortor condimentum. Integer iaculis scelerisque sem, vitae consectetur lorem facilisis eu. Phasellus consectetur blandit auctor. Morbi eleifend mollis ipsum, id facilisis leo euismod ut. Nunc id est tellus.";
+
+INIT_TEST("EailScroller")
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_left");
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_right");
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_up");
+   eailu_test_action_activate(ATK_ACTION(obj), "scroll_down");
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_scroller(Evas_Object *win)
+{
+   Evas_Object  *label, *scroller;
+
+   /* default */
+   label = elm_label_add(win);
+   elm_object_text_set(label, text);
+   evas_object_show(label);
+
+   scroller = elm_scroller_add(win);
+   evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, scroller);
+   evas_object_show(scroller);
+   elm_object_content_set(scroller, label);
+   elm_scroller_bounce_set(scroller, EINA_TRUE, EINA_FALSE);
+   elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
+   elm_scroller_propagate_events_set(scroller, EINA_TRUE);
+   elm_scroller_page_relative_set(scroller, 0, 1);
+   elm_scroller_region_show(scroller, 50, 50, 200, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_scroller(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_segment_control_tc1.c b/eail/tests/eail_segment_control_tc1.c
new file mode 100644 (file)
index 0000000..2e1588c
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailSegmentControl
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailSegmentControl
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define EAIL_TEST_SELECTED_INDEX 3
+
+INIT_TEST("EailSegmentControl")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0, i = 0;
+
+   _printf("Testing SegmentControl instance....\n");
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(7 == child_count);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+
+   /* testing child refs*/
+   for (i = 0; i < 7; ++i)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(obj, i);
+        g_assert(child);
+
+        g_object_unref(child);
+     }
+
+   /* NOTE: segment control widget does not support focus */
+   eailu_test_atk_focus(obj, FALSE);
+
+   _printf("DONE. All SegmentControl tests passed successfully \n");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_diskselector(Evas_Object *win)
+{
+   Evas_Object *sgm_ctrl = NULL, *vbox;
+   Elm_Object_Item *obj_item = NULL;
+   unsigned int i;
+   static const char *lbl[] =
+     {
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+     };
+
+   vbox = elm_box_add(win);
+   elm_win_resize_object_add(win, vbox);
+   evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(vbox);
+
+   /* default */
+   sgm_ctrl = elm_segment_control_add(win);
+   evas_object_size_hint_weight_set
+       (sgm_ctrl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set
+       (sgm_ctrl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   elm_box_pack_end(vbox, sgm_ctrl);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     {
+        obj_item = elm_segment_control_item_add(sgm_ctrl, NULL , lbl[i]);
+
+        /* marking element as selected */
+        if (EAIL_TEST_SELECTED_INDEX == i)
+          elm_segment_control_item_selected_set(obj_item, EINA_TRUE);
+     }
+
+
+   evas_object_show(sgm_ctrl);
+   evas_object_resize(win, 800, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_diskselector(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_segment_control_tc2.c b/eail/tests/eail_segment_control_tc2.c
new file mode 100644 (file)
index 0000000..f1b6780
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Tested interface: AtkSelection
+ *
+ * Tested AtkObject: EailSegmentControl
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailSegmentControl
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_TEST_SELECTED_INDEX 3
+
+INIT_TEST("EailSegmentControl")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int i = 0;
+
+   g_assert(ATK_IS_SELECTION(obj));
+
+   /* only one objec can be selected at time, if '0' is selected then
+    * rest of them should be unselected*/
+   for (i = 0; i < 7; ++i)
+     {
+         Eina_Bool state;
+
+         state =  atk_selection_is_child_selected(ATK_SELECTION(obj), i);
+         /* only item with index EAIL_TEST_SELECTED_INDEX should be selected */
+         if (i == EAIL_TEST_SELECTED_INDEX)
+            g_assert(TRUE == state);
+         else
+            g_assert(FALSE == state);
+
+     }
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_diskselector(Evas_Object *win)
+{
+   Evas_Object *sgm_ctrl = NULL, *vbox;
+   Elm_Object_Item *obj_item = NULL;
+   unsigned int i;
+   static const char *lbl[] =
+     {
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+     };
+
+   vbox = elm_box_add(win);
+   elm_win_resize_object_add(win, vbox);
+   evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(vbox);
+
+   /* default */
+   sgm_ctrl = elm_segment_control_add(win);
+   evas_object_size_hint_weight_set
+                                 (sgm_ctrl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set
+                                 (sgm_ctrl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   elm_box_pack_end(vbox, sgm_ctrl);
+
+   for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
+     {
+         obj_item = elm_segment_control_item_add(sgm_ctrl, NULL , lbl[i]);
+
+         /* marking element as selected */
+         if (EAIL_TEST_SELECTED_INDEX == i)
+            elm_segment_control_item_selected_set(obj_item, EINA_TRUE);
+     }
+
+
+   evas_object_show(sgm_ctrl);
+   evas_object_resize(win, 800, 200);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_diskselector(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_separator_tc1.c b/eail/tests/eail_separator_tc1.c
new file mode 100644 (file)
index 0000000..97e4a25
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailSeparator
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailSeparator
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSeparator")
+
+static void
+_init_separator(Evas_Object *win)
+{
+   Evas_Object *bg, *bxh, *bxv, *spv, *sph, *bt;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bxh = elm_box_add(win);
+   evas_object_size_hint_weight_set(bxh, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_horizontal_set(bxh, EINA_TRUE);
+   elm_win_resize_object_add(win, bxh);
+   evas_object_show(bxh);
+
+   bxv = elm_box_add(win);
+   evas_object_size_hint_weight_set(bxv, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bxh, bxv);
+   evas_object_show(bxv);
+
+   // horizontal separator
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Top button");
+   elm_box_pack_end(bxv, bt);
+   evas_object_show(bt);
+
+   sph = elm_separator_add(win);
+   elm_separator_horizontal_set(sph, EINA_TRUE);
+   elm_box_pack_end(bxv, sph);
+   evas_object_show(sph);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Bottom button");
+   elm_box_pack_end(bxv, bt);
+   evas_object_show(bt);
+
+   // vertical separator
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Left button");
+   elm_box_pack_end(bxh, bt);
+   evas_object_show(bt);
+
+   spv = elm_separator_add(win);
+   elm_box_pack_end(bxh, spv);
+   evas_object_show(spv);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Right button");
+   elm_box_pack_end(bxh, bt);
+   evas_object_show(bt);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkStateSet *state_set = atk_object_ref_state_set(obj);
+   static int test_count, test_vertical_count, test_horizontal_count;
+
+   test_count++;
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_SEPARATOR);
+   g_assert(!atk_state_set_is_empty(state_set));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   if (atk_state_set_contains_state(state_set, ATK_STATE_VERTICAL))
+     {
+        test_vertical_count++;
+        _printf("atk_object_ref_state_set: vertical\n");
+     }
+
+   if (atk_state_set_contains_state(state_set, ATK_STATE_HORIZONTAL))
+     {
+        test_horizontal_count++;
+        _printf("atk_object_ref_state_set: horizontal\n");
+     }
+
+   g_assert((test_vertical_count + test_horizontal_count) == test_count);
+
+   if (2 == test_count)
+     g_assert(1 == test_vertical_count && 1 == test_horizontal_count);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_separator(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_slider_tc1.c b/eail/tests/eail_slider_tc1.c
new file mode 100644 (file)
index 0000000..c981751
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailSlider
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailSlider
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSlider")
+
+const char * const slider_name = "slider-name";
+const double slider_min = -50;
+const double slider_max = 50;
+const double slider_set = 20;
+
+static void
+_init_slider(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *sl;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   sl = elm_slider_add(win);
+   elm_object_text_set(sl, slider_name);
+   elm_slider_min_max_set(sl, slider_min, slider_max);
+   elm_slider_value_set(sl, slider_set);
+   elm_slider_unit_format_set(sl, "%2.1f");
+   elm_slider_span_size_set(sl, 120);
+   evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sl);
+   evas_object_show(sl);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *name = atk_object_get_name(obj);
+
+   g_assert(ATK_IS_OBJECT(obj));
+   g_assert_cmpstr(name, ==, slider_name);
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_SLIDER);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_slider(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_slider_tc2.c b/eail/tests/eail_slider_tc2.c
new file mode 100644 (file)
index 0000000..bd5dbc1
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailSlider
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailSlider
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSlider")
+
+const char * const slider_name = "slider-name";
+const double slider_min = -50;
+const double slider_max = 50;
+const double slider_set = 20;
+
+static void
+_init_slider(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *sl;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   sl = elm_slider_add(win);
+   elm_object_text_set(sl, slider_name);
+   elm_slider_min_max_set(sl, slider_min, slider_max);
+   elm_slider_value_set(sl, slider_set);
+   elm_slider_unit_format_set(sl, "%2.1f");
+   elm_slider_span_size_set(sl, 120);
+   evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sl);
+   evas_object_show(sl);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   double minimum, maximum, current, minimum_increment;
+   const double val_test_set = 12.3;
+
+   g_assert(ATK_IS_VALUE(obj));
+
+   GValue value = G_VALUE_INIT;
+   g_value_init(&value, G_TYPE_DOUBLE);
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   minimum = g_value_get_double(&value);
+   g_assert((float)slider_min == (float)minimum);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   maximum = g_value_get_double(&value);
+   g_assert((float)slider_max == (float)maximum);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_double(&value);
+   g_assert((float)slider_set == (float)current);
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   minimum_increment = g_value_get_double(&value);
+   g_assert((float)G_MINDOUBLE == (float)minimum_increment);
+
+   g_value_set_double(&value, val_test_set);
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_double(&value);
+
+   g_assert((float)val_test_set == (float)current);
+
+   g_value_set_double(&value, minimum - 1);
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   g_value_set_double(&value, maximum + 1);
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   g_assert(g_value_get_double(&value) == 0);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_slider(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_slideshow_tc1.c b/eail/tests/eail_slideshow_tc1.c
new file mode 100644 (file)
index 0000000..b26ae7a
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailSlideshow
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailSlideshow
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSlideshow")
+
+static Evas_Object *slideshow;
+static Elm_Slideshow_Item_Class itc;
+
+static char img1[256], img2[256], img3[256], img4[256], img5[256], img6[256],
+            img7[256], img8[256], img9[256];
+
+/* get our images to make slideshow items */
+static Evas_Object *
+_get(void        *data,
+     Evas_Object *obj)
+{
+   Evas_Object *photo = elm_photo_add(obj);
+   elm_photo_file_set(photo, data);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   elm_object_style_set(photo, "shadow");
+
+   return photo;
+}
+
+/* ordering alphabetically */
+static int
+_cmp_func(const void *data1,
+          const void *data2)
+{
+   const char *img_path1, *img_path2;
+
+   const Elm_Object_Item *slide_it1 = data1;
+   const Elm_Object_Item *slide_it2 = data2;
+
+   img_path1 = elm_object_item_data_get(slide_it1);
+   img_path2 = elm_object_item_data_get(slide_it2);
+
+   return strcasecmp(img_path1, img_path2);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count;
+   AtkObject *child;
+   /*sometimes this is called several times*/
+   static int tested = 0;
+   if (tested > 0) return;
+   tested++;
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_object_ref(obj);
+
+   g_assert(eailu_is_object_with_role(obj, ATK_ROLE_DOCUMENT_PRESENTATION));
+
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 9);
+
+   for (int i = 0; i < child_count; i++)
+     {
+        child = atk_object_ref_accessible_child(obj, i);
+        g_assert(eailu_is_object_with_role(child, ATK_ROLE_IMAGE));
+        g_object_unref(child);
+     }
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   g_object_unref(obj);
+   eailu_test_code_called = 1;
+}
+
+
+static void
+_init_slideshow(Evas_Object *win)
+{
+   Evas_Object *bg;
+   Elm_Object_Item *it;
+   const char *data_dir;
+
+   data_dir = "./data";
+   snprintf(img1, sizeof(img1), "%s/01.jpg", data_dir);
+   snprintf(img2, sizeof(img2), "%s/02.jpg", data_dir);
+   snprintf(img3, sizeof(img3), "%s/03.jpg", data_dir);
+   snprintf(img4, sizeof(img4), "%s/04.jpg", data_dir);
+   snprintf(img5, sizeof(img5), "%s/05.jpg", data_dir);
+   snprintf(img6, sizeof(img6), "%s/06.jpg", data_dir);
+   snprintf(img7, sizeof(img7), "%s/07.jpg", data_dir);
+   snprintf(img8, sizeof(img8), "%s/08.jpg", data_dir);
+   snprintf(img9, sizeof(img9), "%s/09.jpg", data_dir);
+
+   evas_object_resize(win, 600, 400);
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   slideshow = elm_slideshow_add(win);
+   elm_slideshow_loop_set(slideshow, EINA_TRUE);
+   elm_slideshow_cache_before_set(slideshow, 8);
+   elm_slideshow_cache_after_set(slideshow, 8);
+   evas_object_size_hint_weight_set(slideshow,
+                                    EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, slideshow);
+   evas_object_show(slideshow);
+
+   itc.func.get = _get;
+   itc.func.del = NULL;
+
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img1, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img2, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img3, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img4, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img5, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img6, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img7, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img8, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img9, _cmp_func);
+
+   /*show last item, otherwise tests fail*/
+   it = elm_slideshow_item_nth_get(slideshow, 8);
+   elm_slideshow_item_show(it);
+}
+
+EAPI_MAIN int
+elm_main(int    argc,
+         char **argv)
+{
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_slideshow(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_slideshow_tc2.c b/eail/tests/eail_slideshow_tc2.c
new file mode 100644 (file)
index 0000000..3375000
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Tested interface: AtkSelection
+ *
+ * Tested AtkObject: EailSlideshow
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailSlideshow
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSlideshow")
+
+static Evas_Object *slideshow;
+static Elm_Slideshow_Item_Class itc;
+
+static char img1[256], img2[256], img3[256], img4[256], img5[256], img6[256],
+            img7[256], img8[256], img9[256];
+
+/* get our images to make slideshow items */
+static Evas_Object *
+_get(void        *data,
+     Evas_Object *obj)
+{
+   Evas_Object *photo = elm_photo_add(obj);
+   elm_photo_file_set(photo, data);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   elm_object_style_set(photo, "shadow");
+
+   return photo;
+}
+
+/* ordering alphabetically */
+static int
+_cmp_func(const void *data1,
+          const void *data2)
+{
+   const char *img_path1, *img_path2;
+
+   const Elm_Object_Item *slide_it1 = data1;
+   const Elm_Object_Item *slide_it2 = data2;
+
+   img_path1 = elm_object_item_data_get(slide_it1);
+   img_path2 = elm_object_item_data_get(slide_it2);
+
+   return strcasecmp(img_path1, img_path2);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int selection_count;
+   AtkObject *selection;
+   gboolean result;
+   /*sometimes this is called several times*/
+   static int tested = 0;
+   if (tested > 0) return;
+   tested++;
+
+   /*test AtkSelectionIface*/
+   g_assert(ATK_IS_SELECTION(obj));
+   selection = atk_selection_ref_selection(ATK_SELECTION(obj), 0);
+   /*this may fail due to a problem with  slideshow cache*/
+   g_assert(ATK_IS_OBJECT(selection));
+   g_assert(eailu_is_object_with_role(selection, ATK_ROLE_IMAGE));
+   g_object_unref(selection);
+   selection_count = atk_selection_get_selection_count(ATK_SELECTION(obj));
+   g_assert(selection_count == 1);
+   result = atk_selection_add_selection(ATK_SELECTION(obj), 5);
+   g_assert(result);
+   result = atk_selection_is_child_selected(ATK_SELECTION(obj), 5);
+   g_assert(result);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_slideshow(Evas_Object *win)
+{
+   Evas_Object *bg;
+   Elm_Object_Item *it;
+   const char *data_dir;
+
+   data_dir = "./data";
+   snprintf(img1, sizeof(img1), "%s/01.jpg", data_dir);
+   snprintf(img2, sizeof(img2), "%s/02.jpg", data_dir);
+   snprintf(img3, sizeof(img3), "%s/03.jpg", data_dir);
+   snprintf(img4, sizeof(img4), "%s/04.jpg", data_dir);
+   snprintf(img5, sizeof(img5), "%s/05.jpg", data_dir);
+   snprintf(img6, sizeof(img6), "%s/06.jpg", data_dir);
+   snprintf(img7, sizeof(img7), "%s/07.jpg", data_dir);
+   snprintf(img8, sizeof(img8), "%s/08.jpg", data_dir);
+   snprintf(img9, sizeof(img9), "%s/09.jpg", data_dir);
+
+   evas_object_resize(win, 600, 400);
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   slideshow = elm_slideshow_add(win);
+   elm_slideshow_loop_set(slideshow, EINA_TRUE);
+   elm_slideshow_cache_before_set(slideshow, 8);
+   elm_slideshow_cache_after_set(slideshow, 8);
+   evas_object_size_hint_weight_set(slideshow,
+                                    EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, slideshow);
+   evas_object_show(slideshow);
+
+   itc.func.get = _get;
+   itc.func.del = NULL;
+
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img1, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img2, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img3, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img4, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img5, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img6, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img7, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img8, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img9, _cmp_func);
+
+   /*show last item, otherwise tests fail*/
+   it = elm_slideshow_item_nth_get(slideshow, 8);
+   elm_slideshow_item_show(it);
+}
+
+EAPI_MAIN int
+elm_main(int    argc,
+         char **argv)
+{
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_slideshow(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_slideshow_tc3.c b/eail/tests/eail_slideshow_tc3.c
new file mode 100644 (file)
index 0000000..ae0defe
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailSlideshow
+ *
+ * Description: Test AtkSelection interface
+ *
+ * Test input: accessible object representing EailSlideshow
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSlideshow")
+
+static Evas_Object *slideshow;
+static Elm_Slideshow_Item_Class itc;
+
+static char img1[256], img2[256], img3[256], img4[256], img5[256], img6[256],
+            img7[256], img8[256], img9[256];
+
+/* get our images to make slideshow items */
+static Evas_Object *
+_get(void        *data,
+     Evas_Object *obj)
+{
+   Evas_Object *photo = elm_photo_add(obj);
+   elm_photo_file_set(photo, data);
+   elm_photo_fill_inside_set(photo, EINA_TRUE);
+   elm_object_style_set(photo, "shadow");
+
+   return photo;
+}
+
+/* ordering alphabetically */
+static int
+_cmp_func(const void *data1,
+          const void *data2)
+{
+   const char *img_path1, *img_path2;
+
+   const Elm_Object_Item *slide_it1 = data1;
+   const Elm_Object_Item *slide_it2 = data2;
+
+   img_path1 = elm_object_item_data_get(slide_it1);
+   img_path2 = elm_object_item_data_get(slide_it2);
+
+   return strcasecmp(img_path1, img_path2);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count, selection_count, action_count;
+   AtkObject *child, *selection;
+   gboolean result;
+   const gchar *action_name, *action_description;
+   /*sometimes this is called several times*/
+   static int tested = 0;
+   if (tested > 0) return;
+   tested++;
+
+   g_object_ref(obj);
+
+   g_assert(eailu_is_object_with_role(obj, ATK_ROLE_DOCUMENT_PRESENTATION));
+
+   child_count = atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 9);
+
+   for (int i = 0; i < child_count; i++)
+     {
+        child = atk_object_ref_accessible_child(obj, i);
+        g_assert(eailu_is_object_with_role(child, ATK_ROLE_IMAGE));
+        g_object_unref(child);
+     }
+
+   /*test AtkSelectionIface*/
+   g_assert(ATK_IS_SELECTION(obj));
+   selection = atk_selection_ref_selection(ATK_SELECTION(obj), 0);
+   /*this may fail due to a problem with  slideshow cache*/
+   g_assert(ATK_IS_OBJECT(selection));
+   g_assert(eailu_is_object_with_role(selection, ATK_ROLE_IMAGE));
+   g_object_unref(selection);
+   selection_count = atk_selection_get_selection_count(ATK_SELECTION(obj));
+   g_assert(selection_count == 1);
+   result = atk_selection_add_selection(ATK_SELECTION(obj), 5);
+   g_assert(result);
+   result = atk_selection_is_child_selected(ATK_SELECTION(obj), 5);
+   g_assert(result);
+
+   /*test AtkActionIface*/
+   g_assert(ATK_IS_ACTION(obj));
+   /* test set/get action description */
+   eailu_test_action_description_all(ATK_ACTION(obj));
+   action_count = atk_action_get_n_actions(ATK_ACTION(obj));
+   g_assert(4 == action_count);
+   action_name = atk_action_get_name(ATK_ACTION(obj), 0);
+   g_assert(!strcmp("next", action_name));
+   action_name = atk_action_get_name(ATK_ACTION(obj), 1);
+   g_assert(!strcmp("previous", action_name));
+   result = atk_action_set_description(ATK_ACTION(obj), 2,
+                                       "start the slideshow");
+   g_assert(result);
+   action_description = atk_action_get_description(ATK_ACTION(obj), 2);
+   g_assert(!strcmp("start the slideshow", action_description));
+   result = atk_action_do_action(ATK_ACTION(obj), 0);
+   g_assert(result);
+   result = atk_selection_is_child_selected(ATK_SELECTION(obj), 6);
+   g_assert(result);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   g_object_unref(obj);
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_slideshow(Evas_Object *win)
+{
+   Evas_Object *bg;
+   Elm_Object_Item *it;
+   const char *data_dir;
+
+   data_dir = "./data";
+   snprintf(img1, sizeof(img1), "%s/01.jpg", data_dir);
+   snprintf(img2, sizeof(img2), "%s/02.jpg", data_dir);
+   snprintf(img3, sizeof(img3), "%s/03.jpg", data_dir);
+   snprintf(img4, sizeof(img4), "%s/04.jpg", data_dir);
+   snprintf(img5, sizeof(img5), "%s/05.jpg", data_dir);
+   snprintf(img6, sizeof(img6), "%s/06.jpg", data_dir);
+   snprintf(img7, sizeof(img7), "%s/07.jpg", data_dir);
+   snprintf(img8, sizeof(img8), "%s/08.jpg", data_dir);
+   snprintf(img9, sizeof(img9), "%s/09.jpg", data_dir);
+
+   evas_object_resize(win, 600, 400);
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   slideshow = elm_slideshow_add(win);
+   elm_slideshow_loop_set(slideshow, EINA_TRUE);
+   elm_slideshow_cache_before_set(slideshow, 8);
+   elm_slideshow_cache_after_set(slideshow, 8);
+   evas_object_size_hint_weight_set(slideshow,
+                                    EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, slideshow);
+   evas_object_show(slideshow);
+
+   itc.func.get = _get;
+   itc.func.del = NULL;
+
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img1, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img2, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img3, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img4, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img5, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img6, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img7, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img8, _cmp_func);
+   elm_slideshow_item_sorted_insert(slideshow, &itc, img9, _cmp_func);
+
+   /*show last item, otherwise tests fail*/
+   it = elm_slideshow_item_nth_get(slideshow, 8);
+   elm_slideshow_item_show(it);
+}
+
+EAPI_MAIN int
+elm_main(int    argc,
+         char **argv)
+{
+
+   Evas_Object *win;
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_slideshow(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_spinner_tc1.c b/eail/tests/eail_spinner_tc1.c
new file mode 100644 (file)
index 0000000..fc14d9e
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailSpinner
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailSpinner
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSpinner")
+
+struct
+{
+   double min, max, set, step;
+}
+static sp[4] = { { 0,   100, 80,  1   },
+                 { 0,   100, 2.2, 1   },
+                 { -50, 250, 100, 1.5 },
+                 { 0,   100, 13,  1   } };
+
+static void
+_init_spinner(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *sp1, *sp2, *sp3, *sp4;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   // default
+   sp1 = elm_spinner_add(win);
+   elm_spinner_value_set(sp1, sp[0].set);
+   evas_object_size_hint_align_set(sp1, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp1);
+   evas_object_show(sp1);
+
+   // format
+   sp2 = elm_spinner_add(win);
+   elm_spinner_label_format_set(sp2, "Percentage %%%1.2f something");
+   elm_spinner_value_set(sp2, sp[1].set);
+   evas_object_size_hint_align_set(sp2, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp2);
+   evas_object_show(sp2);
+
+   // min max, step and wrap
+   sp3 = elm_spinner_add(win);
+   elm_spinner_label_format_set(sp3, "%1.1f units");
+   elm_spinner_step_set(sp3, sp[2].step);
+   elm_spinner_wrap_set(sp3, EINA_TRUE);
+   elm_spinner_min_max_set(sp3, sp[2].min, sp[2].max);
+   elm_spinner_value_set(sp3, sp[2].set);
+   evas_object_size_hint_align_set(sp3, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp3);
+   evas_object_show(sp3);
+
+   sp4 = elm_spinner_add(win);
+   elm_spinner_value_set(sp4, sp[3].set);
+   evas_object_size_hint_align_set(sp4, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp4, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp4);
+   evas_object_show(sp4);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+
+   g_assert(ATK_IS_OBJECT(obj));
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert_cmpstr(type_name, ==, "EailSpinner");
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_SPIN_BUTTON);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_spinner(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_spinner_tc2.c b/eail/tests/eail_spinner_tc2.c
new file mode 100644 (file)
index 0000000..2c72354
--- /dev/null
@@ -0,0 +1,170 @@
+/*
+ * Tested interface: AtkValue
+ *
+ * Tested AtkObject: EailSpinner
+ *
+ * Description: Test AtkValue interface
+ *
+ * Test input: accessible object representing EailSpinner
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailSpinner")
+
+struct
+{
+   double min, max, set, step;
+}
+static sp[4] = { { 0,   100, 80,  1   },
+                 { 0,   100, 2.2, 1   },
+                 { -50, 250, 100, 1.5 },
+                 { 0,   100, 13,  1   } };
+
+static void
+_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   _printf("Value changed to %0.f\n", elm_spinner_value_get(obj));
+}
+
+static void
+_init_spinner(Evas_Object *win)
+{
+   Evas_Object *bg, *bx, *sp1, *sp2, *sp3, *sp4;
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   // default
+   sp1 = elm_spinner_add(win);
+   elm_spinner_value_set(sp1, sp[0].set);
+   evas_object_size_hint_align_set(sp1, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp1);
+   evas_object_show(sp1);
+
+   // format
+   sp2 = elm_spinner_add(win);
+   elm_spinner_label_format_set(sp2, "Percentage %%%1.2f something");
+   elm_spinner_value_set(sp2, sp[1].set);
+   evas_object_size_hint_align_set(sp2, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp2);
+   evas_object_show(sp2);
+
+   // min max, step and wrap
+   sp3 = elm_spinner_add(win);
+   elm_spinner_label_format_set(sp3, "%1.1f units");
+   elm_spinner_step_set(sp3, sp[2].step);
+   elm_spinner_wrap_set(sp3, EINA_TRUE);
+   elm_spinner_min_max_set(sp3, sp[2].min, sp[2].max);
+   elm_spinner_value_set(sp3, sp[2].set);
+   evas_object_size_hint_align_set(sp3, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp3);
+   evas_object_show(sp3);
+
+   sp4 = elm_spinner_add(win);
+   elm_spinner_value_set(sp4, sp[3].set);
+   evas_object_size_hint_align_set(sp4, EVAS_HINT_FILL, 0.5);
+   evas_object_size_hint_weight_set(sp4, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_box_pack_end(bx, sp4);
+   evas_object_show(sp4);
+   evas_object_smart_callback_add(sp4, "changed", _changed_cb, NULL);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   double minimum, maximum, current, minimum_increment;
+   const double val_test_set = 33.3;
+
+   GValue value = G_VALUE_INIT;
+   g_value_init(&value, G_TYPE_DOUBLE);
+
+   atk_value_get_minimum_value(ATK_VALUE(obj), &value);
+   minimum = g_value_get_double(&value);
+
+   atk_value_get_maximum_value(ATK_VALUE(obj), &value);
+   maximum = g_value_get_double(&value);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_double(&value);
+
+   atk_value_get_minimum_increment(ATK_VALUE(obj), &value);
+   minimum_increment = g_value_get_double(&value);
+
+   if ((float)sp[0].set == (float)current && (float)sp[0].min == (float)minimum &&
+       (float)sp[0].max == (float)maximum && (float)sp[0].step == (float)minimum_increment)
+     {
+        _printf("spinner 1: initialized values - correctly\n");
+     }
+   else if ((float)sp[1].set == (float)current && (float)sp[1].min == (float)minimum &&
+            (float)sp[1].max == (float)maximum && (float)sp[1].step == (float)minimum_increment)
+     {
+        _printf("spinner 2: initialized values - correctly\n");
+     }
+   else if ((float)sp[2].set == (float)current && (float)sp[2].min == (float)minimum &&
+            (float)sp[2].max == (float)maximum && (float)sp[2].step == (float)minimum_increment)
+     {
+        _printf("spinner 3: initialized values - correctly\n");
+     }
+   else if ((float)sp[3].set == (float)current && (float)sp[3].min == (float)minimum &&
+            (float)sp[3].max == (float)maximum && (float)sp[3].step == (float)minimum_increment)
+     {
+        _printf("spinner 4: initialized values - correctly\n");
+     }
+   else
+     {
+        _printf("initialized values ​​are different from returned by ATK");
+        g_assert(FALSE);
+     }
+
+   g_value_set_double(&value, val_test_set);
+   g_assert(atk_value_set_current_value(ATK_VALUE(obj), &value));
+   _printf("atk_value_set_current_value: %0.2f\n", val_test_set);
+
+   atk_value_get_current_value(ATK_VALUE(obj), &value);
+   current = g_value_get_double(&value);
+   _printf("atk_value_get_current_value: %0.2f\n", current);
+
+   g_assert((float)val_test_set == (float)current);
+
+   g_value_set_double(&value, minimum - 1);
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+
+   g_value_set_double(&value, maximum + 1);
+   g_assert(!atk_value_set_current_value(ATK_VALUE(obj), &value));
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_spinner(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_table_tc1.c b/eail/tests/eail_table_tc1.c
new file mode 100644 (file)
index 0000000..5b3638c
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailTable
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailTable
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailTable")
+
+static void
+_init_table(Evas_Object *win)
+{
+   Evas_Object *bg, *label, *table, *hover, *rect, *rect2, *rect3, *bt,
+               *spinner, *slider, *check, *icon, *en, *image, *video,
+               *global_gui_list;
+   const char * const filename = "./data/whiterabbit01.jpg";
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   table = elm_table_add(win);
+   elm_win_resize_object_add(win, table);
+   elm_table_padding_set(table, 0,0 );
+   elm_table_homogeneous_set(table, EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE);
+   evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(table);
+
+   label = elm_label_add(win);
+   elm_object_text_set(label, "label 0");
+   evas_object_show(label);
+   elm_table_pack(table, label, 0, 0, 1, 1);
+
+   rect = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect, 25, 25);
+   evas_object_color_set(rect, 255, 0, 0, 255);
+   evas_object_show(rect);
+
+   rect2 = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect2, 25, 25);
+   evas_object_color_set(rect2, 0, 255, 0, 255);
+   evas_object_show(rect2);
+
+   rect3 = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_size_hint_min_set(rect3, 25, 25);
+   evas_object_color_set(rect3, 0, 0, 255, 255);
+   evas_object_show(rect3);
+
+   bt = elm_button_add(win);
+   elm_object_text_set(bt, "Show hover");
+   evas_object_move(bt, 60, 90);
+   evas_object_resize(bt, 80, 20);
+   evas_object_show(bt);
+   elm_table_pack(table, bt, 1, 0, 1, 1);
+
+   hover = elm_hover_add(win);
+   elm_hover_parent_set(hover, win);
+   elm_hover_target_set(hover, bt);
+   elm_object_style_set(hover, "popout");
+   elm_object_part_content_set(hover, "left", rect);
+   elm_object_part_content_set(hover, "top", rect2);
+   elm_object_part_content_set(hover, "right", rect3);
+
+   elm_table_pack(table, hover, 2, 0, 1, 1);
+   evas_object_move(win, 500, 300);
+
+   spinner = elm_spinner_add(win);
+   elm_spinner_label_format_set(spinner, "%1.1f units");
+   evas_object_show(spinner);
+   elm_table_pack(table, spinner, 3, 0, 1, 1);
+
+   slider = elm_slider_add(win);
+   elm_slider_min_max_set(slider, 0, 20);
+   elm_slider_unit_format_set(slider, "%2.1f");
+   evas_object_show(slider);
+   elm_table_pack(table, slider, 4, 0, 1, 1);
+
+   check = elm_check_add(win);
+   evas_object_show(check);
+   elm_table_pack(table, check, 5, 0, 1, 1);
+
+   en = elm_entry_add(win);
+   elm_entry_autosave_set(en, EINA_FALSE);
+   elm_entry_line_wrap_set(en, ELM_WRAP_WORD);
+   evas_object_show(en);
+   elm_table_pack(table, en, 6, 0, 1, 1);
+
+   icon = elm_icon_add(win);
+   elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
+   elm_icon_standard_set(icon, "home");
+   evas_object_resize(icon, 32, 32);
+   evas_object_show(icon);
+   elm_table_pack(table, icon, 7, 0, 1, 1);
+
+   image = elm_image_add(win);
+   g_assert(elm_image_file_set(image, filename, NULL));
+   elm_image_no_scale_set(image, EINA_TRUE);
+   elm_image_resizable_set(image, EINA_FALSE, EINA_TRUE);
+   elm_image_smooth_set(image, EINA_FALSE);
+   elm_image_orient_set(image, ELM_IMAGE_FLIP_HORIZONTAL);
+   elm_image_aspect_fixed_set(image, EINA_TRUE);
+   elm_image_fill_outside_set(image, EINA_TRUE);
+   elm_image_editable_set(image, EINA_TRUE);
+   evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(image);
+   elm_table_pack(table, image, 8, 0, 1, 1);
+
+   video = elm_video_add(win);
+   evas_object_size_hint_align_set(video, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_table_pack(table, video, 9, 0, 1, 1);
+   evas_object_show(video);
+   evas_object_resize(video, 200, 200);
+   elm_video_file_set(video, "./data/softboy.avi");
+   elm_video_play(video);
+
+   global_gui_list = elm_list_add(win);
+   elm_list_multi_select_set(global_gui_list, EINA_TRUE);
+   evas_object_size_hint_weight_set(global_gui_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(global_gui_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(global_gui_list);
+
+   elm_list_item_append(global_gui_list, "List Label1", NULL, NULL, NULL, NULL);
+   elm_list_item_append(global_gui_list, "List Label2", NULL, NULL, NULL, NULL);
+   elm_list_item_append(global_gui_list, "List Label3", NULL, NULL, NULL, NULL);
+   elm_list_item_append(global_gui_list, "List Label4", NULL, NULL, NULL, NULL);
+
+   elm_table_pack(table, global_gui_list, 0, 1, 6, 1);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   AtkObject *child;
+   int index = 0;
+   int i;
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   for (i = 0; i < atk_object_get_n_accessible_children(obj); ++i)
+     {
+        child = atk_object_ref_accessible_child(obj, i);
+        g_assert(child);
+
+        index = atk_object_get_index_in_parent(child);
+        g_assert(index == i);
+
+        g_object_unref(child);
+     }
+
+   g_assert(ATK_IS_COMPONENT(obj));
+   g_assert(atk_component_set_position(ATK_COMPONENT(obj), -10, -10,
+                                       ATK_XY_SCREEN) == FALSE);
+   g_assert(atk_component_set_size(ATK_COMPONENT(obj), -5, -5) == FALSE);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_table(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_test_utils.c b/eail/tests/eail_test_utils.c
new file mode 100644 (file)
index 0000000..b8eff3f
--- /dev/null
@@ -0,0 +1,270 @@
+#include <atk/atk.h>
+#include <Elementary.h>
+#include <string.h>
+
+#include "eail_test_utils.h"
+
+#define EAILU_WINDOW_TEST_TITLE "Eail test window"
+#define EAILU_TEST_WINDOW_WIDTH 420
+#define EAILU_TEST_WINDOW_HEIGHT 420
+
+gboolean
+eailu_is_object_with_type(AtkObject *obj, gchar *type_name)
+{
+   const char *obj_type = g_type_name(G_TYPE_FROM_INSTANCE(obj));
+
+   if ((!type_name) || (!obj)) return FALSE;
+
+   return !(strcmp(obj_type, type_name));
+}
+
+gboolean
+eailu_is_object_with_name(AtkObject *obj, gchar *name)
+{
+   const char *obj_name = NULL;
+
+   if (!ATK_IS_OBJECT(obj))
+     return FALSE;
+
+   obj_name = atk_object_get_name(obj);
+   if ((!obj_name) || (!name))
+     return FALSE;
+
+   return !(strcmp(obj_name, name));
+}
+
+gboolean
+eailu_is_object_with_role(AtkObject *obj, AtkRole role)
+{
+   AtkRole obj_role = ATK_ROLE_INVALID;
+
+   if (!ATK_IS_OBJECT(obj))
+     return FALSE;
+
+   obj_role = atk_object_get_role(obj);
+
+   return (obj_role == role);
+}
+
+AtkObject *
+eailu_find_child_with_name(AtkObject *obj, gchar *name)
+{
+   int child_count = 0, i = 0;
+
+   if (eailu_is_object_with_name(obj, name))
+     return obj;
+
+   child_count = atk_object_get_n_accessible_children(obj);
+   for (i = 0; i < child_count; i++)
+     {
+        AtkObject *found_obj = NULL;
+        AtkObject *child = atk_object_ref_accessible_child(obj, i);
+
+        found_obj = eailu_find_child_with_name(child, name);
+        if (found_obj != NULL)
+          return found_obj;
+
+        g_object_unref(child);
+     }
+
+   return NULL;
+}
+
+void
+eailu_traverse_children_for_type_call_cb(AtkObject *obj,
+                                         gchar *type_name,
+                                         Eailu_Test_Func_Cb test_cb)
+{
+   int child_count = atk_object_get_n_accessible_children(obj);
+   int i;
+   for (i = 0; i < child_count; i++)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(obj, i);
+        if (ATK_IS_OBJECT(child))
+          {
+             if (type_name == NULL ||
+                      eailu_is_object_with_type(child, type_name))
+               test_cb(child);
+          }
+
+        eailu_traverse_children_for_type_call_cb(child, type_name, test_cb);
+
+        g_object_unref(child);
+     }
+}
+
+void
+eailu_traverse_children_for_role_call_cb(AtkObject *obj,
+                                         AtkRole role,
+                                         Eailu_Test_Func_Cb test_cb)
+{
+   gint number_of_children = atk_object_get_n_accessible_children(obj);
+   gint children_count;
+
+   for (children_count = 0; number_of_children > children_count; children_count++)
+     {
+        AtkObject *child = atk_object_ref_accessible_child(obj, children_count);
+
+        if (eailu_is_object_with_role(child, role))
+          test_cb(child);
+
+        eailu_traverse_children_for_role_call_cb(child, role, test_cb);
+        g_object_unref(child);
+     }
+}
+
+Evas_Object *
+eailu_create_test_window_with_glib_init(Evas_Smart_Cb on_done,
+                                        Evas_Smart_Cb on_focus_in)
+{
+   Evas_Object *win;
+
+   if (!ecore_main_loop_glib_integrate())
+     {
+        fprintf(stderr, "Cannot integrate with glib main loop");
+        return NULL;
+     }
+
+#if !GLIB_CHECK_VERSION(2,35,0)
+   g_type_init();
+#endif
+
+   win = elm_win_add(NULL, EAILU_WINDOW_TEST_TITLE, ELM_WIN_BASIC);
+   elm_win_title_set(win, EAILU_WINDOW_TEST_TITLE);
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   evas_object_smart_callback_add(win, "delete,request", on_done, NULL);
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   evas_object_smart_callback_add(win, "focus,in", on_focus_in, NULL);
+   evas_object_resize(win, EAILU_TEST_WINDOW_WIDTH, EAILU_TEST_WINDOW_HEIGHT);
+
+   return win;
+}
+
+void
+eailu_test_atk_focus(AtkObject *obj, gboolean focusable)
+{
+   AtkStateSet *state_set = NULL;
+
+   if (focusable)
+     {
+        /* checking is setting focus works properly */
+        state_set = atk_object_ref_state_set(obj);
+
+        g_assert(atk_state_set_contains_state(state_set, ATK_STATE_FOCUSABLE));
+        g_assert(!atk_state_set_contains_state(state_set, ATK_STATE_FOCUSED));
+
+        /* grabbing focus */
+        g_assert(ATK_IS_COMPONENT(obj));
+
+        atk_component_grab_focus(ATK_COMPONENT(obj));
+        state_set = atk_object_ref_state_set(obj);
+        g_assert(
+            atk_state_set_contains_state(state_set, ATK_STATE_FOCUSED));
+     }
+    else
+     {
+        state_set = atk_object_ref_state_set(obj);
+        g_assert(
+             !atk_state_set_contains_state(state_set, ATK_STATE_FOCUSABLE));
+        g_assert(
+             !atk_state_set_contains_state(state_set, ATK_STATE_FOCUSED));
+     }
+}
+
+void
+_eailu_print_atk_text_obj(AtkText *atk_text)
+{
+   int count = 0, i = 0;
+   char *text = atk_text_get_text(atk_text, 0, -1);
+
+   printf("ATK TEXT:\n");
+   printf("atk_text_get_text: %s\n", text ? text : "NULL");
+   count = atk_text_get_character_count(atk_text);
+   printf("atk_text_get_character_count: %d\n", count);
+
+   printf("Text from offset single chars: ");
+   for (i = 0; i < count; ++i)
+     {
+        printf("%c", atk_text_get_character_at_offset(atk_text, i));
+     }
+   printf("\n");
+}
+
+void
+eailu_print_atk_object_info(AtkObject *obj)
+{
+   const char *name = NULL;
+   const char *type_name = NULL;
+   const char *role_name = NULL;
+   AtkRole atk_role = ATK_ROLE_INVALID;
+
+   name = atk_object_get_name(ATK_OBJECT(obj));
+   type_name = g_type_name(G_TYPE_FROM_INSTANCE(ATK_OBJECT(obj)));
+   atk_role = atk_object_get_role(ATK_OBJECT(obj));
+   role_name = atk_role_get_name(atk_role);
+
+   printf("atk_object_get_name: %s\n", name ? name : "NULL");
+   printf("atk_object_get_role: %s\n", role_name ? role_name : "NULL");
+   printf("atk_object_get_type_name: %s\n", type_name ? type_name : "NULL");
+
+   if (ATK_IS_TEXT(obj))
+     {
+        _eailu_print_atk_text_obj(ATK_TEXT(obj));
+     }
+
+   printf("\n");
+}
+
+/**
+ * @return returns action index number or -1 if action with given name has
+ * not been found
+ */
+int
+eailu_get_action_number(AtkAction *action_obj, const gchar *action_name)
+{
+   int i = 0;
+   int action_index = -1;
+   const int actions_num = atk_action_get_n_actions(action_obj);
+
+   for (i = 0; i < actions_num; i++)
+     {
+        const char *local_name = atk_action_get_name(action_obj, i);
+        if ((strcmp(action_name, local_name)) == 0)
+          return i;
+     }
+
+   return action_index;
+}
+
+void
+eailu_test_action_activate(AtkAction *action_obj, const gchar *action_name)
+{
+   int action_index = -1;
+
+   action_index = eailu_get_action_number(action_obj, action_name);
+   g_assert(-1 != action_index);
+   g_assert(TRUE == atk_action_do_action(action_obj, action_index));
+}
+
+void
+eailu_test_action_description_all(AtkAction *action_obj)
+{
+   int actions_num = atk_action_get_n_actions(action_obj);
+   const char *desc_set = "description test";
+   const char *desc_get;
+
+   int count;
+   for (count = 0; count < actions_num; ++count)
+     {
+        g_assert(atk_action_get_name(action_obj, count));
+        g_assert(atk_action_set_description(action_obj, count, desc_set));
+        desc_get = atk_action_get_description(action_obj, count);
+        g_assert(desc_get);
+        g_assert(!strcmp(desc_set, desc_get));
+     }
+
+   g_assert(NULL == atk_action_get_name(action_obj, actions_num));
+   g_assert(FALSE == atk_action_set_description(action_obj, actions_num, desc_set));
+   g_assert(NULL == atk_action_get_description(action_obj, actions_num));
+}
diff --git a/eail/tests/eail_test_utils.h b/eail/tests/eail_test_utils.h
new file mode 100644 (file)
index 0000000..35a961d
--- /dev/null
@@ -0,0 +1,128 @@
+#ifndef EAIL_TEST_UTILS_H_
+#define EAIL_TEST_UTILS_H_
+
+#include <atk/atk.h>
+#include <Elementary.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define INIT_TEST(type_name) \
+    static int eailu_test_code_called; \
+    static void _on_done(void *data, Evas_Object *obj, void *event_info) \
+       { \
+          elm_exit(); \
+       } \
+     static void _do_test(AtkObject *obj); \
+     static void _on_focus_in(void *data, Evas_Object *obj, void *event_info) \
+       { \
+            AtkObject *aobj = atk_get_root(); \
+            g_assert(aobj); \
+            eailu_traverse_children_for_type_call_cb( \
+                aobj, type_name, _do_test); \
+            g_assert(eailu_test_code_called); \
+            _on_done(NULL, NULL, NULL); \
+       }
+
+typedef void(* Eailu_Test_Func_Cb)(AtkObject *obj);
+
+/**
+ * Checks is AktObject has given type name
+ */
+gboolean eailu_is_object_with_type(AtkObject *obj, gchar *type_name);
+
+/**
+ * Checks if AtkObject has given object name
+ */
+gboolean eailu_is_object_with_name(AtkObject *obj, gchar *name);
+
+/**
+ * Checks if AtkObject has given atk role (AtkRole enum)
+ */
+gboolean eailu_is_object_with_role(AtkObject *obj, AtkRole role);
+
+/**
+ * Goes for every child in objects hierarchy looking for given type_name.
+ * If given type has been found, then test_cb callback is called on it.
+ *
+ * @param obj Object to iterate on
+ * @param type_Name string representing type or NULL if all objects should
+ * be processed
+ * @param test_cb Callback to test function which will be performed on every
+ * matched object
+ */
+void eailu_traverse_children_for_type_call_cb(AtkObject *obj,
+                                              gchar *type_name,
+                                              Eailu_Test_Func_Cb test_cb);
+
+/**
+ * Goes for every child in objects hierarchy looking for given atk role.
+ * If given type has been found, then test_cb callback is called on it.
+ *
+ * @param obj Object to iterate on
+ * @param role representing atk role (AtkRole enum)
+ * @param test_cb Callback to test function which will be performed on every
+ * matched object
+ */
+void eailu_traverse_children_for_role_call_cb(AtkObject *obj,
+                                              AtkRole role,
+                                              Eailu_Test_Func_Cb test_cb);
+
+/**
+ * Gets object with given name from child hierarchy or NULL if not found
+ */
+AtkObject * eailu_find_child_with_name(AtkObject *obj, gchar *name);
+
+/**
+ * Initializes glib, gobject and creates EFL test window
+ *
+ */
+Evas_Object * eailu_create_test_window_with_glib_init(Evas_Smart_Cb on_done,
+                                                      Evas_Smart_Cb on_focus_in);
+
+void eailu_print_atk_object_info(AtkObject *obj);
+
+/**
+ * Gets action number for given action name in AtkAction object
+ *
+ * @return returns action index number or -1 if action with given name has
+ * not been found
+ */
+int eailu_get_action_number(AtkAction *action_obj,const gchar *action_name);
+
+/* Executes test routing for action with given name. If something will be wrong
+ * with given action, then assertion will fail */
+void eailu_test_action_activate(AtkAction *action_obj,
+                                    const gchar *action_name);
+
+void eailu_test_action_description_all(AtkAction *action_obj);
+
+/**
+ * Tests "focus" functionality
+ * @oaram obj: object to test
+ * @param focusable: TRUE if focusable shoulbe be handled by component or
+ * false otherwise
+ */
+void eailu_test_atk_focus(AtkObject *obj, gboolean focusable);
+
+/**
+ * Printf for debug
+ */
+inline static void _printf(const char *format, ...)
+{
+#if DEBUG
+   va_list args;
+
+   va_start(args, format);
+   vfprintf(stdout, format, args);
+   va_end(args);
+#endif
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TEST_UTILS_H_ */
diff --git a/eail/tests/eail_thumb_tc1.c b/eail/tests/eail_thumb_tc1.c
new file mode 100644 (file)
index 0000000..46829d3
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailThumb
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailThumb
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailThumb")
+
+static void
+_init_thumb(Evas_Object *win)
+{
+   const char *filename = "./data/06.jpg";
+   Evas_Object *bg, *thumb;
+
+   elm_need_ethumb();
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   thumb = elm_thumb_add(win);
+   elm_thumb_editable_set(thumb, EINA_FALSE);
+   elm_thumb_file_set(thumb, filename, NULL);
+   elm_thumb_reload(thumb);
+   evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, thumb);
+   evas_object_show(thumb);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   g_assert(NULL != atk_object_ref_state_set(obj));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_thumb(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_thumb_tc2.c b/eail/tests/eail_thumb_tc2.c
new file mode 100644 (file)
index 0000000..f2ebc3d
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailThumb
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailThumb
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailThumb")
+
+static void
+_init_thumb(Evas_Object *win)
+{
+   const char *filename = "./data/06.jpg";
+   Evas_Object *bg, *thumb;
+
+   elm_need_ethumb();
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   thumb = elm_thumb_add(win);
+   elm_thumb_editable_set(thumb, EINA_FALSE);
+   elm_thumb_file_set(thumb, filename, NULL);
+   elm_thumb_reload(thumb);
+   evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, thumb);
+   evas_object_show(thumb);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_ACTION(obj));
+
+   g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), "click");
+
+   g_assert(-1 == (eailu_get_action_number(ATK_ACTION(obj), "typo")));
+
+   eailu_test_action_description_all(ATK_ACTION(obj));
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_thumb(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_thumb_tc3.c b/eail/tests/eail_thumb_tc3.c
new file mode 100644 (file)
index 0000000..4f839fc
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Tested interface: AtkImage
+ *
+ * Tested AtkObject: EailThumb
+ *
+ * Description: Test AtkImage interface
+ *
+ * Test input: accessible object representing EailThumb
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define ACTIONS_NUMBER 1
+
+INIT_TEST("EailThumb")
+
+static void
+_init_thumb(Evas_Object *win)
+{
+   const char *filename = "./data/06.jpg";
+   Evas_Object *bg, *thumb;
+
+   elm_need_ethumb();
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   thumb = elm_thumb_add(win);
+   elm_thumb_editable_set(thumb, EINA_FALSE);
+   elm_thumb_file_set(thumb, filename, NULL);
+   elm_thumb_reload(thumb);
+   evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, thumb);
+   evas_object_show(thumb);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   const char * const desc_test = "top secret";
+   const char *desc;
+   int height = 0, width = 0;
+   int x = -1, y = -1;
+
+   g_assert(ATK_IS_IMAGE(obj));
+
+   atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
+
+   g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
+   g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
+   desc = atk_image_get_image_description(ATK_IMAGE(obj));
+   g_assert(NULL != desc);
+   g_assert_cmpstr(desc_test, ==, desc);
+
+   atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
+   g_assert(height == 128 && width == 128);
+
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   g_assert(win);
+   _init_thumb(win);
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_toolbar_tc1.c b/eail/tests/eail_toolbar_tc1.c
new file mode 100644 (file)
index 0000000..c65bd52
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailToolbar
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailToolbar
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_FIRST_TOOLBAR_ITEM_NAME "Print"
+#define EAIL_TEST_SUBITEM_TYPE "EailItem"
+
+INIT_TEST("EailToolbar")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_amount = 0;
+   AtkObject *nested_obj;
+
+   g_assert(eailu_is_object_with_role(obj, ATK_ROLE_TOOL_BAR));
+   child_amount = atk_object_get_n_accessible_children(obj);
+   g_assert(3 == child_amount);
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   /* test if toolbar child is EailToolbarItem type*/
+   nested_obj = atk_object_ref_accessible_child(obj, 0);
+   g_assert(eailu_is_object_with_type(nested_obj, EAIL_TEST_SUBITEM_TYPE));
+   g_assert(
+          eailu_is_object_with_name(nested_obj, EAIL_FIRST_TOOLBAR_ITEM_NAME));
+
+   g_assert(eailu_is_object_with_role(nested_obj, ATK_ROLE_LIST_ITEM));
+
+   eailu_test_atk_focus(obj, TRUE);
+   eailu_test_action_activate(ATK_ACTION(nested_obj), "click");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_toolbar(Evas_Object *win)
+{
+   Evas_Object *toolbar, *box, *menu;
+   Elm_Object_Item *toolbar_item;
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   toolbar = elm_toolbar_add(win);
+   elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_SCROLL);
+   evas_object_size_hint_weight_set(toolbar, 0.0, 0.0);
+   evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, 0.0);
+   evas_object_show(toolbar);
+
+   elm_toolbar_item_append
+         (toolbar, "document-print", EAIL_FIRST_TOOLBAR_ITEM_NAME, NULL, NULL);
+   elm_toolbar_item_append(toolbar, "folder-new", "New Folder", NULL, NULL);
+   toolbar_item = elm_toolbar_item_append
+                  (toolbar, NULL, "Nested menu", NULL, NULL);
+   elm_toolbar_item_menu_set(toolbar_item, EINA_TRUE);
+   menu = elm_toolbar_item_menu_get(toolbar_item);
+
+   elm_menu_item_add
+                  (menu, NULL, "emptytrash", "first menu item", NULL, NULL);
+   elm_menu_item_add
+               (menu, NULL, "trashcan_full", "second menu item", NULL, NULL);
+
+   elm_box_pack_end(box, toolbar);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_toolbar(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_tooltip_tc1.c b/eail/tests/eail_tooltip_tc1.c
new file mode 100644 (file)
index 0000000..6576aeb
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailTooltip
+ *
+ * Description: Test whether accessible object is successfully registered
+ *    in GObject type system and is visible in AtkObject tree.
+ *
+ * Test input: accessible object representing EailTooltip
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+INIT_TEST("EailWindow")
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(ATK_IS_OBJECT(obj));
+
+   g_assert(atk_object_get_role(obj) == ATK_ROLE_WINDOW);
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_tooltip(Evas_Object *win)
+{
+   const char *text = "test text";
+   elm_object_tooltip_text_set(win, text);
+   elm_object_tooltip_show(win);
+
+   evas_object_resize(win, 320, 320);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_tooltip(win);
+
+   evas_object_show(win);
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_video_tc1.c b/eail/tests/eail_video_tc1.c
new file mode 100644 (file)
index 0000000..c96e56f
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailVideo
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailVideo
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define VIDEO_FILE "./data/softboy.avi"
+
+INIT_TEST("EailVideo")
+
+static void
+_do_test(AtkObject *object)
+{
+   AtkStateSet *state_set;
+   gboolean contains;
+
+   g_assert(ATK_IS_OBJECT(object));
+   atk_object_set_description(object, "test");
+   g_assert_cmpstr(atk_object_get_description(object), ==, "test");
+
+   g_assert(atk_object_get_role(object) == ATK_ROLE_ANIMATION);
+   atk_object_set_name(object, VIDEO_FILE);
+   g_assert_cmpstr(atk_object_get_name(object), ==, VIDEO_FILE);
+
+   state_set = atk_object_ref_state_set(object);
+   contains = atk_state_set_contains_state(state_set, ATK_STATE_ANIMATED);
+   g_object_unref(state_set);
+   g_assert(contains);
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_init_video(Evas_Object *win)
+{
+   Evas_Object *bg, *video;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   video = elm_video_add(win);
+   evas_object_size_hint_weight_set(video, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, video);
+   evas_object_show(video);
+
+   evas_object_resize(win, 800, 800);
+   evas_object_show(win);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_video(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_video_tc2.c b/eail/tests/eail_video_tc2.c
new file mode 100644 (file)
index 0000000..321f87c
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailVideo
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailVideo
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+#include "eail_test_utils.h"
+
+#define VIDEO_FILE "./data/softboy.avi"
+
+INIT_TEST("EailVideo")
+
+static void
+_do_test(AtkObject *object)
+{
+   AtkAction *action;
+   gboolean success;
+   const gchar *name, *action_name;
+   int action_num;
+
+   g_assert(ATK_IS_ACTION(object));
+   action = ATK_ACTION(object);
+   action_num =  atk_action_get_n_actions(action);
+   g_assert(action_num == 7);
+   action_name = atk_action_get_name(action, 2);
+   g_assert(!strcmp(action_name, "pause"));
+   success =  atk_action_set_description(action, 2, "pause action desc");
+   g_assert(success);
+   name = atk_action_get_description(action, 2);
+   g_assert(!strcmp(name, "pause action desc"));
+   success = atk_action_do_action(action, 2);
+
+   /* test set/get action description */
+   eailu_test_action_description_all(ATK_ACTION(object));
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_playback_started(void *data, Evas_Object *obj, void *ev)
+{
+   _on_focus_in(NULL, data, NULL);
+}
+
+static void
+_init_video(Evas_Object *win)
+{
+   Evas_Object *bg, *video, *emotion;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   video = elm_video_add(win);
+   evas_object_size_hint_weight_set(video, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, video);
+   evas_object_show(video);
+
+
+   elm_video_file_set(video, VIDEO_FILE);
+   elm_video_play(video);
+   emotion = elm_video_emotion_get(video);
+   evas_object_smart_callback_add(emotion,
+                                  "playback_started",
+                                  _playback_started,
+                                  win);
+
+   evas_object_resize(win, 800, 800);
+   evas_object_show(win);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   _init_video(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_video_tc3.c b/eail/tests/eail_video_tc3.c
new file mode 100644 (file)
index 0000000..2907db4
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Tested interface: AtkStreamableContent
+ *
+ * Tested AtkObject: EailVideo
+ *
+ * Description: Test AtkStreamableContent interface
+ *
+ * Test input: accessible object representing EailVideo
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+#define VIDEO_FILE "./data/softboy.avi"
+
+INIT_TEST("EailVideo")
+
+static void
+_do_test(AtkObject *object)
+{
+   AtkStreamableContent *streamable;
+   const gchar *mime, *uri;
+   int n_mimes;
+   GIOChannel *gio;
+
+   /*AtkStreamableContent test*/
+   g_assert(ATK_IS_STREAMABLE_CONTENT(object));
+   streamable = ATK_STREAMABLE_CONTENT(object);
+   n_mimes = atk_streamable_content_get_n_mime_types(streamable);
+   g_assert(n_mimes == 1);
+   mime = atk_streamable_content_get_mime_type(streamable, 0);
+   g_assert(!strcmp(mime, "video/x-msvideo"));
+   uri = atk_streamable_content_get_uri(streamable, "video/x-msvideo");
+   _printf("file uri %s\n", uri);
+   char *res = g_strrstr(uri, "softboy.avi");
+   g_assert(res);
+   gio = NULL;
+   gio = atk_streamable_content_get_stream(streamable, "video/x-msvideo");
+   g_assert(gio);
+   if (gio)
+     {
+        g_io_channel_shutdown(gio, TRUE, NULL);
+        g_io_channel_unref(gio);
+     }
+
+   eailu_test_code_called = 1;
+}
+
+static void
+_playback_started(void *data, Evas_Object *obj, void *ev)
+{
+   _on_focus_in(NULL, data, NULL);
+}
+
+static void
+_init_video(Evas_Object *win)
+{
+   Evas_Object *bg, *video, *emotion;
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+
+   video = elm_video_add(win);
+   evas_object_size_hint_weight_set(video, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, video);
+   evas_object_show(video);
+
+   elm_video_file_set(video, VIDEO_FILE);
+   elm_video_play(video);
+   emotion = elm_video_emotion_get(video);
+   evas_object_smart_callback_add(emotion,
+                                  "playback_started",
+                                  _playback_started,
+                                  win);
+
+   evas_object_resize(win, 800, 800);
+   evas_object_show(win);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(0,0);
+   _init_video(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_web_tc1.c b/eail/tests/eail_web_tc1.c
new file mode 100644 (file)
index 0000000..1395142
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Tested interface: AtkObject
+ *
+ * Tested AtkObject: EailWeb
+ *
+ * Description: Test AtkObject interface
+ *
+ * Test input: accessible object representing EailWeb
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+//#define DEBUG 1
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailWeb")
+
+static void
+_do_test(AtkObject *obj)
+{
+   int child_count = 0;
+
+   atk_object_set_description(obj, "test");
+   g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
+
+   atk_object_set_name(obj, "test name");
+   g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
+
+   child_count =  atk_object_get_n_accessible_children(obj);
+   g_assert(child_count == 0);
+
+   eailu_test_atk_focus(obj, TRUE);
+
+   _printf("DONE. All WEB tests passed successfully \n");
+   eailu_test_code_called = 1;
+}
+
+static void
+_default_web_content_set(Evas_Object *web)
+{
+#ifdef HAVE_ELEMENTARY_WEB
+   Evas_Object *view, *frame;
+   const char contents[] = ""
+       "<html>\n"
+       "  <head>\n"
+       "    <title>Nothing to see here, move along</title>\n"
+       "  </head>\n"
+       "  <body>\n"
+       "    <a href=\"http://www.enlightenment.org\" target=\"_blank\">E</a>\n"
+       "    <br />\n"
+       "    <a href=\"http://www.google.com\" target=\"_blank\">Google</a>\n"
+       "    <br />\n"
+       "  </body>\n"
+       "</html>\n";
+
+   view = elm_web_webkit_view_get(web);
+   frame = ewk_view_frame_main_get(view);
+   ewk_frame_contents_set(frame, contents, sizeof(contents) - 1, "text/html",
+                          "UTF-8", NULL);
+#else
+   _printf("Webview could not be initialized - NO WEBKIT SUPPORT ON PLATFORM\n");
+   _printf("However still raw web widget implementation CAN be tested \n");
+   (void) web;
+#endif
+}
+
+static void
+_init_webview(Evas_Object *win)
+{
+   Evas_Object *web;//, *box;
+
+   //   box = elm_box_add(win);
+   //   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   //   elm_win_resize_object_add(win, box);
+   //   evas_object_show(box);
+
+   web = elm_web_add(win);
+   evas_object_size_hint_weight_set(web, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(web, EVAS_HINT_FILL, 0.5);
+   _default_web_content_set(web);
+
+   //elm_box_pack_end(box, web);
+
+   evas_object_show(web);
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
+   _init_webview(win);
+
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_win_tc1.c b/eail/tests/eail_win_tc1.c
new file mode 100644 (file)
index 0000000..c0f2b4c
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailWindow
+ *
+ * Description: Test AtkAction interface
+ *
+ * Test input: accessible object representing EailWindow
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+#define EAIL_ACTION_FOR_MAXIMALIZE "maximalize"
+#define EAIL_ACTION_FOR_MINIMALIZE "minimalize"
+
+INIT_TEST("EailWindow")
+
+static int maximalize_test_passed = 0;
+static int minimalize_test_passed = 0;
+static int resize_test_passed = 0;
+
+static Evas_Object *global_win = NULL;
+
+void maximalize_callback()
+{
+   maximalize_test_passed = 1;
+}
+
+void minimalize_callback()
+{
+   minimalize_test_passed = 1;
+}
+
+void resize_callback()
+{
+   resize_test_passed = 1;
+}
+
+static void
+_setup_signals(AtkObject *obj)
+{
+   g_signal_connect(G_OBJECT(obj), "maximize",
+                    G_CALLBACK(maximalize_callback), NULL);
+   g_signal_connect(G_OBJECT(obj), "minimize",
+                    G_CALLBACK(minimalize_callback), NULL);
+   g_signal_connect(G_OBJECT(obj), "resize",
+                    G_CALLBACK(resize_callback), NULL);
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   _setup_signals(obj);
+
+   g_assert(ATK_IS_ACTION(obj));
+   g_assert(2 == atk_action_get_n_actions(ATK_ACTION(obj)));
+
+   eailu_test_action_activate(ATK_ACTION(obj), EAIL_ACTION_FOR_MAXIMALIZE);
+   eailu_test_action_activate(ATK_ACTION(obj), EAIL_ACTION_FOR_MINIMALIZE);
+
+   g_assert(maximalize_test_passed);
+   g_assert(minimalize_test_passed);
+
+   evas_object_resize(global_win, 450, 450);
+   g_assert(resize_test_passed);
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
+   global_win = win;
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()
diff --git a/eail/tests/eail_win_tc2.c b/eail/tests/eail_win_tc2.c
new file mode 100644 (file)
index 0000000..b7cd279
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Tested interface: AtkAction
+ *
+ * Tested AtkObject: EailWindow
+ *
+ * Description: Test "moved" signal emit by EailWindow
+ *
+ * Test input: accessible object representing EailWindow
+ *
+ * Expected test result: test should return 0 (success)
+ */
+
+#include <Elementary.h>
+#include <atk/atk.h>
+
+#include "eail_test_utils.h"
+
+INIT_TEST("EailWindow")
+
+static int move_test_passed = 0;
+
+static Evas_Object *global_win = NULL;
+static Ecore_Timer *init_delay = NULL, *test_delay = NULL;
+
+void move_callback()
+{
+   move_test_passed = 1;
+}
+
+static void
+_setup_signals(AtkObject *obj)
+{
+   g_signal_connect(G_OBJECT(obj), "move",
+                    G_CALLBACK(move_callback), NULL);
+}
+
+static Eina_Bool
+delayed_test_body(void *data)
+{
+   _on_focus_in(NULL, NULL, NULL);
+
+   return EINA_FALSE;
+}
+
+static Eina_Bool
+delayed_test_init(void *data)
+{
+   AtkObject *root = atk_get_root();
+   AtkObject *atk_window = atk_object_ref_accessible_child(root, 0);
+
+   g_assert(atk_window);
+   _setup_signals(atk_window);
+
+   elm_win_center(global_win, EINA_TRUE, EINA_TRUE);
+
+   evas_object_move(global_win, 1, 1);
+
+   test_delay = ecore_timer_add(2, delayed_test_body, NULL);
+
+   return EINA_FALSE;
+}
+
+static void
+_do_test(AtkObject *obj)
+{
+   g_assert(move_test_passed);
+   eailu_test_code_called = 1;
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win;
+
+   win = eailu_create_test_window_with_glib_init(NULL, NULL);
+
+   init_delay = ecore_timer_add(1, delayed_test_init, NULL);
+   global_win = win;
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   /* exit code */
+   return 0;
+}
+ELM_MAIN()