aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS10
-rw-r--r--COPYING165
-rw-r--r--INSTALL.txt59
-rw-r--r--TODO.txt62
-rw-r--r--efl/__init__.py0
-rw-r--r--efl/ecore/efl.ecore.pyx141
-rw-r--r--efl/ecore/efl.ecore_animator.pxi57
-rw-r--r--efl/ecore/efl.ecore_events.pxi354
-rw-r--r--efl/ecore/efl.ecore_exe.pxi534
-rw-r--r--efl/ecore/efl.ecore_fd_handler.pxi164
-rw-r--r--efl/ecore/efl.ecore_file_download.pxi109
-rw-r--r--efl/ecore/efl.ecore_idler.pxi83
-rw-r--r--efl/ecore/efl.ecore_timer.pxi91
-rw-r--r--efl/edje/efl.edje.pyx328
-rw-r--r--efl/edje/efl.edje_external.pxi488
-rw-r--r--efl/edje/efl.edje_message.pxi375
-rw-r--r--efl/edje/efl.edje_object.pxi689
-rw-r--r--efl/elementary/efl.elementary.pyx610
-rw-r--r--efl/elementary/efl.elementary_actionslider.pxi80
-rw-r--r--efl/elementary/efl.elementary_background.pxi98
-rw-r--r--efl/elementary/efl.elementary_box.pxi194
-rw-r--r--efl/elementary/efl.elementary_bubble.pxi44
-rw-r--r--efl/elementary/efl.elementary_button.pxi85
-rw-r--r--efl/elementary/efl.elementary_calendar.pxi139
-rw-r--r--efl/elementary/efl.elementary_check.pxi52
-rw-r--r--efl/elementary/efl.elementary_clock.pxi116
-rw-r--r--efl/elementary/efl.elementary_colorselector.pxi125
-rw-r--r--efl/elementary/efl.elementary_configuration.pxi311
-rw-r--r--efl/elementary/efl.elementary_conformant.pxi27
-rw-r--r--efl/elementary/efl.elementary_ctxpopup.pxi115
-rw-r--r--efl/elementary/efl.elementary_datetime.pxi143
-rw-r--r--efl/elementary/efl.elementary_dayselector.pxi61
-rw-r--r--efl/elementary/efl.elementary_diskselector.pxi169
-rw-r--r--efl/elementary/efl.elementary_entry.pxi683
-rw-r--r--efl/elementary/efl.elementary_fileselector.pxi138
-rw-r--r--efl/elementary/efl.elementary_fileselector_button.pxi130
-rw-r--r--efl/elementary/efl.elementary_fileselector_entry.pxi216
-rw-r--r--efl/elementary/efl.elementary_flip.pxi76
-rw-r--r--efl/elementary/efl.elementary_flipselector.pxi134
-rw-r--r--efl/elementary/efl.elementary_frame.pxi61
-rw-r--r--efl/elementary/efl.elementary_gengrid.pxi811
-rw-r--r--efl/elementary/efl.elementary_genlist.pxi923
-rw-r--r--efl/elementary/efl.elementary_gesture_layer.pxi79
-rw-r--r--efl/elementary/efl.elementary_grid.pxi69
-rw-r--r--efl/elementary/efl.elementary_hover.pxi72
-rw-r--r--efl/elementary/efl.elementary_hoversel.pxi141
-rw-r--r--efl/elementary/efl.elementary_icon.pxi78
-rw-r--r--efl/elementary/efl.elementary_image.pxi227
-rw-r--r--efl/elementary/efl.elementary_index.pxi199
-rw-r--r--efl/elementary/efl.elementary_innerwindow.pxi58
-rw-r--r--efl/elementary/efl.elementary_label.pxi91
-rw-r--r--efl/elementary/efl.elementary_layout.pxi45
-rw-r--r--efl/elementary/efl.elementary_layout_class.pxi139
-rw-r--r--efl/elementary/efl.elementary_list.pxi381
-rw-r--r--efl/elementary/efl.elementary_map.pxi790
-rw-r--r--efl/elementary/efl.elementary_mapbuf.pxi61
-rw-r--r--efl/elementary/efl.elementary_menu.pxi208
-rw-r--r--efl/elementary/efl.elementary_multibuttonentry.pxi260
-rw-r--r--efl/elementary/efl.elementary_naviframe.pxi191
-rw-r--r--efl/elementary/efl.elementary_need.pxi29
-rw-r--r--efl/elementary/efl.elementary_notify.pxi95
-rw-r--r--efl/elementary/efl.elementary_object.pxi603
-rw-r--r--efl/elementary/efl.elementary_object_item.pxi252
-rw-r--r--efl/elementary/efl.elementary_panel.pxi53
-rw-r--r--efl/elementary/efl.elementary_panes.pxi73
-rw-r--r--efl/elementary/efl.elementary_photo.pxi104
-rw-r--r--efl/elementary/efl.elementary_photocam.pxi188
-rw-r--r--efl/elementary/efl.elementary_plug.pxi37
-rw-r--r--efl/elementary/efl.elementary_popup.pxi104
-rw-r--r--efl/elementary/efl.elementary_progressbar.pxi120
-rw-r--r--efl/elementary/efl.elementary_radio.pxi85
-rw-r--r--efl/elementary/efl.elementary_scroller.pxi236
-rw-r--r--efl/elementary/efl.elementary_segment_control.pxi102
-rw-r--r--efl/elementary/efl.elementary_separator.pxi38
-rw-r--r--efl/elementary/efl.elementary_slider.pxi186
-rw-r--r--efl/elementary/efl.elementary_slideshow.pxi293
-rw-r--r--efl/elementary/efl.elementary_spinner.pxi159
-rw-r--r--efl/elementary/efl.elementary_table.pxi74
-rw-r--r--efl/elementary/efl.elementary_theme.pxi110
-rw-r--r--efl/elementary/efl.elementary_thumb.pxi111
-rw-r--r--efl/elementary/efl.elementary_toolbar.pxi395
-rw-r--r--efl/elementary/efl.elementary_transit.pxi155
-rw-r--r--efl/elementary/efl.elementary_video.pxi182
-rw-r--r--efl/elementary/efl.elementary_web.pxi212
-rw-r--r--efl/elementary/efl.elementary_window.pxi618
-rw-r--r--efl/emotion/efl.emotion.pyx607
-rw-r--r--efl/eo/efl.eo.pyx279
-rw-r--r--efl/evas/efl.evas.pyx304
-rw-r--r--efl/evas/efl.evas_canvas.pxi564
-rw-r--r--efl/evas/efl.evas_canvas_callbacks.pxi220
-rw-r--r--efl/evas/efl.evas_map.pxi141
-rw-r--r--efl/evas/efl.evas_object.pxi1039
-rw-r--r--efl/evas/efl.evas_object_box.pxi83
-rw-r--r--efl/evas/efl.evas_object_callbacks.pxi288
-rw-r--r--efl/evas/efl.evas_object_events.pxi926
-rw-r--r--efl/evas/efl.evas_object_image.pxi369
-rw-r--r--efl/evas/efl.evas_object_line.pxi117
-rw-r--r--efl/evas/efl.evas_object_polygon.pxi40
-rw-r--r--efl/evas/efl.evas_object_rectangle.pxi28
-rw-r--r--efl/evas/efl.evas_object_smart.pxi796
-rw-r--r--efl/evas/efl.evas_object_text.pxi243
-rw-r--r--efl/evas/efl.evas_object_textblock.pxi119
-rw-r--r--efl/evas/efl.evas_rect.pxi517
-rw-r--r--include/efl.c_eo.pxd89
-rw-r--r--include/efl.ecore.pxd338
-rw-r--r--include/efl.edje.pxd398
-rw-r--r--include/efl.elementary.pxd2079
-rw-r--r--include/efl.emotion.pxd141
-rw-r--r--include/efl.eo.pxd45
-rw-r--r--include/efl.evas.pxd1013
-rw-r--r--include/efl.pxd138
-rwxr-xr-xsetup.py110
-rw-r--r--tests/00_run_all_tests.py9
-rw-r--r--tests/ecore/00_run_all_tests.py9
-rw-r--r--tests/ecore/__init__.py0
-rw-r--r--tests/ecore/test_01_timer.py60
-rw-r--r--tests/ecore/test_02_animator.py55
-rw-r--r--tests/ecore/test_03_idler.py49
-rw-r--r--tests/ecore/test_04_idle_enterer.py66
-rw-r--r--tests/ecore/test_05_idle_exiter.py65
-rw-r--r--tests/ecore/test_06_fd_handler.py40
-rw-r--r--tests/ecore/test_07_exe.py81
-rw-r--r--tests/ecore/test_08_file_download.py34
-rw-r--r--tests/edje/00_run_all_tests.py9
-rw-r--r--tests/edje/TODO-edit/01-edje.py244
-rw-r--r--tests/edje/TODO-edit/02-group.py62
-rw-r--r--tests/edje/TODO-edit/03-parts.py95
-rw-r--r--tests/edje/TODO-edit/04-states.py72
-rw-r--r--tests/edje/TODO-edit/groups.edc44
-rw-r--r--tests/edje/TODO-edit/theme.edc151
-rw-r--r--tests/edje/__init__.py0
-rw-r--r--tests/edje/test_01_basics.py76
-rw-r--r--tests/edje/test_02_object.py123
-rw-r--r--tests/edje/theme.edc85
-rw-r--r--tests/edje/theme.edjbin0 -> 7657 bytes
-rw-r--r--tests/elementary/cursors.edjbin0 -> 7000 bytes
-rw-r--r--tests/elementary/images/clo.pngbin0 -> 120231 bytes
-rw-r--r--tests/elementary/images/icon_00.pngbin0 -> 9793 bytes
-rw-r--r--tests/elementary/images/icon_01.pngbin0 -> 11371 bytes
-rw-r--r--tests/elementary/images/icon_02.pngbin0 -> 12432 bytes
-rw-r--r--tests/elementary/images/icon_03.pngbin0 -> 15014 bytes
-rw-r--r--tests/elementary/images/icon_04.pngbin0 -> 7912 bytes
-rw-r--r--tests/elementary/images/icon_05.pngbin0 -> 1483 bytes
-rw-r--r--tests/elementary/images/icon_06.pngbin0 -> 4977 bytes
-rw-r--r--tests/elementary/images/icon_07.pngbin0 -> 2548 bytes
-rw-r--r--tests/elementary/images/icon_08.pngbin0 -> 4861 bytes
-rw-r--r--tests/elementary/images/icon_09.pngbin0 -> 7774 bytes
-rw-r--r--tests/elementary/images/icon_10.pngbin0 -> 4745 bytes
-rw-r--r--tests/elementary/images/icon_11.pngbin0 -> 8684 bytes
-rw-r--r--tests/elementary/images/icon_12.pngbin0 -> 3018 bytes
-rw-r--r--tests/elementary/images/icon_13.pngbin0 -> 5051 bytes
-rw-r--r--tests/elementary/images/icon_14.pngbin0 -> 8448 bytes
-rw-r--r--tests/elementary/images/icon_15.pngbin0 -> 8706 bytes
-rw-r--r--tests/elementary/images/icon_16.pngbin0 -> 11758 bytes
-rw-r--r--tests/elementary/images/icon_17.pngbin0 -> 13769 bytes
-rw-r--r--tests/elementary/images/icon_18.pngbin0 -> 6079 bytes
-rw-r--r--tests/elementary/images/icon_19.pngbin0 -> 11785 bytes
-rw-r--r--tests/elementary/images/icon_20.pngbin0 -> 8278 bytes
-rw-r--r--tests/elementary/images/icon_21.pngbin0 -> 14661 bytes
-rw-r--r--tests/elementary/images/icon_22.pngbin0 -> 12215 bytes
-rw-r--r--tests/elementary/images/icon_23.pngbin0 -> 10078 bytes
-rw-r--r--tests/elementary/images/icon_right_arrow.pngbin0 -> 1832 bytes
-rw-r--r--tests/elementary/images/insanely_huge_test_image.jpgbin0 -> 1260785 bytes
-rw-r--r--tests/elementary/images/logo.pngbin0 -> 81162 bytes
-rw-r--r--tests/elementary/images/logo_small.pngbin0 -> 5655 bytes
-rw-r--r--tests/elementary/images/mystrale.jpgbin0 -> 74115 bytes
-rw-r--r--tests/elementary/images/mystrale_2.jpgbin0 -> 355595 bytes
-rw-r--r--tests/elementary/images/panel_01.jpgbin0 -> 63544 bytes
-rw-r--r--tests/elementary/images/plant_01.jpgbin0 -> 165867 bytes
-rw-r--r--tests/elementary/images/rock_01.jpgbin0 -> 330094 bytes
-rw-r--r--tests/elementary/images/rock_02.jpgbin0 -> 285555 bytes
-rw-r--r--tests/elementary/images/sky.jpgbin0 -> 69378 bytes
-rw-r--r--tests/elementary/images/sky_01.jpgbin0 -> 134813 bytes
-rw-r--r--tests/elementary/images/sky_02.jpgbin0 -> 31413 bytes
-rw-r--r--tests/elementary/images/sky_03.jpgbin0 -> 73364 bytes
-rw-r--r--tests/elementary/images/sky_04.jpgbin0 -> 25078 bytes
-rw-r--r--tests/elementary/images/under.pngbin0 -> 36742 bytes
-rw-r--r--tests/elementary/images/wood_01.jpgbin0 -> 96136 bytes
-rw-r--r--tests/elementary/test.edjbin0 -> 201415 bytes
-rw-r--r--tests/elementary/test.py330
-rw-r--r--tests/elementary/test_3d.py263
-rw-r--r--tests/elementary/test_actionslider.py176
-rw-r--r--tests/elementary/test_bg.py94
-rw-r--r--tests/elementary/test_box.py330
-rw-r--r--tests/elementary/test_bubble.py151
-rw-r--r--tests/elementary/test_button.py70
-rw-r--r--tests/elementary/test_calendar.py278
-rw-r--r--tests/elementary/test_check.py107
-rw-r--r--tests/elementary/test_clock.py74
-rw-r--r--tests/elementary/test_colorselector.py134
-rw-r--r--tests/elementary/test_config.py21
-rw-r--r--tests/elementary/test_core_evas_canvas_callbacks.py84
-rw-r--r--tests/elementary/test_core_evas_object_callbacks.py168
-rw-r--r--tests/elementary/test_core_evas_objects.py59
-rw-r--r--tests/elementary/test_ctxpopup.py182
-rw-r--r--tests/elementary/test_cursor.py258
-rw-r--r--tests/elementary/test_datetime.py69
-rw-r--r--tests/elementary/test_dayselector.py84
-rw-r--r--tests/elementary/test_diskselector.py130
-rw-r--r--tests/elementary/test_entry.py228
-rw-r--r--tests/elementary/test_external.edjbin0 -> 508368 bytes
-rw-r--r--tests/elementary/test_external.py177
-rw-r--r--tests/elementary/test_fileselector.py340
-rw-r--r--tests/elementary/test_flip.py300
-rw-r--r--tests/elementary/test_flipselector.py136
-rw-r--r--tests/elementary/test_frame.py60
-rw-r--r--tests/elementary/test_gengrid.py394
-rw-r--r--tests/elementary/test_genlist.py443
-rw-r--r--tests/elementary/test_grid.py104
-rw-r--r--tests/elementary/test_hover.py217
-rw-r--r--tests/elementary/test_hoversel.py112
-rw-r--r--tests/elementary/test_icon.py179
-rw-r--r--tests/elementary/test_index.py119
-rw-r--r--tests/elementary/test_inwin.py41
-rw-r--r--tests/elementary/test_label.py169
-rw-r--r--tests/elementary/test_layout.py56
-rw-r--r--tests/elementary/test_list.py381
-rw-r--r--tests/elementary/test_map.py172
-rw-r--r--tests/elementary/test_map2.py216
-rw-r--r--tests/elementary/test_map3.py261
-rw-r--r--tests/elementary/test_mapbuf.py190
-rw-r--r--tests/elementary/test_menu.py100
-rw-r--r--tests/elementary/test_multibuttonentry.py173
-rw-r--r--tests/elementary/test_naviframe.py139
-rw-r--r--tests/elementary/test_notify.py118
-rw-r--r--tests/elementary/test_panel.py52
-rw-r--r--tests/elementary/test_panes.py66
-rw-r--r--tests/elementary/test_photo.py75
-rw-r--r--tests/elementary/test_popup.py239
-rw-r--r--tests/elementary/test_progressbar.py182
-rw-r--r--tests/elementary/test_radio.py100
-rw-r--r--tests/elementary/test_scroller.py135
-rw-r--r--tests/elementary/test_segment_control.py112
-rw-r--r--tests/elementary/test_separator.py81
-rw-r--r--tests/elementary/test_slideshow.py175
-rw-r--r--tests/elementary/test_spinner.py64
-rw-r--r--tests/elementary/test_table.py76
-rw-r--r--tests/elementary/test_thumb.py65
-rw-r--r--tests/elementary/test_toolbar.py122
-rw-r--r--tests/elementary/test_tooltip.py230
-rw-r--r--tests/elementary/test_video.py79
-rw-r--r--tests/elementary/test_web.py124
-rw-r--r--tests/elementary/test_win.py102
-rw-r--r--tests/emotion/test_emotion.py414
-rw-r--r--tests/evas/00_run_all_tests.py9
-rw-r--r--tests/evas/__init__.py0
-rw-r--r--tests/evas/icon.pngbin0 -> 4455 bytes
-rw-r--r--tests/evas/test_01_rect.py367
-rw-r--r--tests/evas/test_02_canvas.py137
-rw-r--r--tests/evas/test_03_object.py198
-rw-r--r--tests/evas/test_04_object_box.py57
-rw-r--r--tests/evas/test_05_object_image.py30
-rw-r--r--tests/evas/test_06_object_smart.py52
-rw-r--r--tests/evas/test_07_object_line.py27
-rw-r--r--tests/evas/test_08_object_polygon.py26
-rw-r--r--tests/evas/test_09_object_text.py26
-rw-r--r--tests/evas/test_10_object_textblock.py26
257 files changed, 40748 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..9f6b72d
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,10 @@
+Gustavo Sverzut Barbieri <barbieri@gmail.com>
+Ulisses Furquim <ulissesf@gmail.com>
+Davide 'DaveMDS' Andreoli <dave@gurumeditation.it>
+Fabiano Fidêncio <fidencio@profusion.mobi>
+Tiago Falcão <tiago@profusion.mobi>
+Simon Busch <morphis@gravedo.de>
+Boris 'billiob' Faure <billiob@gmail.com>
+Bruno Dilly <bdilly@profusion.mobi>
+Joost Albers <joost.albers@nomadrail.com>
+Kai Huuhko <kai.huuhko@gmail.com>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..82f30b1
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ 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 that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU 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 as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/INSTALL.txt b/INSTALL.txt
new file mode 100644
index 0000000..e9eb8bb
--- /dev/null
+++ b/INSTALL.txt
@@ -0,0 +1,59 @@
+
+1. REQUIREMENTS:
+
+1. Python 2.7 or higher (http://www.python.org/)
+ - Tested with Python 2.7 / 3.2
+2. Cython 0.17.3 or higher (http://cython.org/)
+ - Tested with Cython 0.17.3
+3. EFL core library
+ - eo, evas, ecore, edje, elementary and, optionally, emotion
+4. pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config)
+ - Windows executable (and GLib dependency) can be downloaded from
+ http://www.gtk.org/download/win32.php
+
+
+
+2. BUILDING EFL
+
+ Once EFL is built and installed in your desired destination, proceed with
+ building the wrapper.
+
+
+
+2a. BUILDING WITH GCC/G++ (Linux, OS X, etc.)
+
+ python setup.py build_ext
+
+2b. BUILDING WITH Visual Studio (Windows)
+
+ python setup.py build_ext
+
+2c. BUILDING WITH MINGW (Windows)
+
+ python setup.py build_ext -c mingw32
+
+
+
+4. INSTALLATION
+
+4a. For system-wide installation (needs administrator privileges):
+
+ python setup.py install
+
+4b. For user installation:
+
+ python setup.py install --user
+
+4c. To install for python3:
+
+ python3 setup.py install (also cython need to be installed with py3)
+
+
+
+5. DEMOS and TESTS
+
+ You can run individual tests or use the 00_run_all_tests.py in each folder or
+ even in the tests/ base dir to run all the tests at once.
+
+ The tests in elementary are not unittest and are meant to be run by the user
+ as they usually require some sort of interaction.
diff --git a/TODO.txt b/TODO.txt
new file mode 100644
index 0000000..f25151c
--- /dev/null
+++ b/TODO.txt
@@ -0,0 +1,62 @@
+
+BUGS:
+
+* Ecore/Evas: 00_run_all_test.py, lots of errors
+* Evas: smart object doesn't work
+* object_from_instance fail with EdjeExternals
+* test_map3.py is buggy
+* test_mapbuf.py line 14 should work
+* test_progressbar.py on exit cause an endless loop (Timer??)
+* test_video.py have problems
+* test_menu.py -> evas events cb
+* test_naviframe is broken (also in the python-elementary version)
+* test_core_evas_canvas_callbacks.py have 2 lines commented out
+* test_emotion.py loop on shutdown (parent issue)
+
+* edje.color_class_list() is broken in C (disabled in edje/test_01_basics.py)
+* edje.text_class_list() is broken in C (disabled out in edje/test_01_basics.py)
+
+
+TODO:
+
+* Fix all the compilation warnings!
+* ecore.Poller
+* ecore.FileMonitor
+* alert on signal and subprocess module usage (was in python-ecore/ecore/__init__.py)
+* Ecore test_08_exe.py : Use unittests
+* evas.SmartObject
+* edje.Edit
+* edje: complete the unit tests
+* elm.Web need a test
+* elm.GestureLayer need a test
+* elm.PhotoCam need a test
+* elm.Transit need a test
+* elm.Conformant need a test
+* include python-ethumb
+* include python-e_dbus (or make edbus2 ??)
+
+
+TODO FOR PYTHON 3:
+
+* ecore.Exe (use new buffer interface)
+* ecore.FdHandler (use new buffer interface)
+* edje external
+
+
+STUFF LEAVED OUT:
+
+* EcoreEvas
+* EcoreImf
+* EcoreX
+* EcoreWin32
+* python-evas/evas/utils.py
+* python-evas/evas/decorators.py
+* python-evas/evas/debug.py
+* python-evas old hack to rotate objects
+* edje decorators callbacks
+
+
+CHANGES FROM 1.7 to 1.8:
+
+* added efl container package
+* ecore.file.Download => efl.ecore.FileDownload
diff --git a/efl/__init__.py b/efl/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/efl/__init__.py
diff --git a/efl/ecore/efl.ecore.pyx b/efl/ecore/efl.ecore.pyx
new file mode 100644
index 0000000..693dd8e
--- /dev/null
+++ b/efl/ecore/efl.ecore.pyx
@@ -0,0 +1,141 @@
+######################################################################
+# Copyright (C) 2007-2013 Gustavo Sverzut Barbieri
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+######################################################################
+
+import traceback
+from efl.eo cimport Eo
+from efl.eo cimport _fruni, _cfruni
+from efl.eo cimport PY_REFCOUNT
+from cpython cimport Py_INCREF, Py_DECREF
+
+
+ECORE_CALLBACK_CANCEL = 0
+ECORE_CALLBACK_RENEW = 1
+
+# Ecore_Fd_Handler_Flags:
+ECORE_FD_READ = 1
+ECORE_FD_WRITE = 2
+ECORE_FD_ERROR = 4
+ECORE_FD_ALL = 7
+
+
+# Ecore_Exe_Flags:
+ECORE_EXE_PIPE_READ = 1
+ECORE_EXE_PIPE_WRITE = 2
+ECORE_EXE_PIPE_ERROR = 4
+ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8
+ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16
+ECORE_EXE_PIPE_AUTO = 32
+ECORE_EXE_RESPAWN = 64
+ECORE_EXE_USE_SH = 128
+ECORE_EXE_NOT_LEADER = 256
+ECORE_EXE_TERM_WITH_PARENT = 512
+
+ECORE_EXE_PRIORITY_INHERIT = 9999
+
+
+# Ecore_File_Progress_Return:
+ECORE_FILE_PROGRESS_CONTINUE = 0
+ECORE_FILE_PROGRESS_ABORT = 1
+
+
+cdef Eina_Bool _ecore_task_cb(void *data) with gil:
+ cdef Eo obj = <Eo>data
+ cdef Eina_Bool ret
+
+ try:
+ ret = bool(obj._task_exec())
+ except Exception, e:
+ traceback.print_exc()
+ ret = 0
+
+ if not ret:
+ obj.delete()
+
+ return ret
+
+
+cdef int _ecore_events_registered = 0
+
+
+def init():
+ global _ecore_events_registered
+
+ r = ecore_init()
+
+ if r > 0 and _ecore_events_registered == 0:
+ _ecore_events_registered = 1
+
+ global _event_type_mapping
+ _event_type_mapping = {
+ ECORE_EVENT_SIGNAL_USER: EventSignalUser,
+ ECORE_EVENT_SIGNAL_HUP: EventSignalHup,
+ ECORE_EVENT_SIGNAL_EXIT: EventSignalExit,
+ ECORE_EVENT_SIGNAL_POWER: EventSignalPower,
+ ECORE_EVENT_SIGNAL_REALTIME: EventSignalRealtime,
+ ECORE_EXE_EVENT_ADD: EventExeAdd,
+ ECORE_EXE_EVENT_DEL: EventExeDel,
+ ECORE_EXE_EVENT_DATA: EventExeData,
+ ECORE_EXE_EVENT_ERROR: EventExeData,
+ }
+
+ ecore_file_init()
+ return r
+
+
+def shutdown():
+ ecore_file_shutdown()
+ return ecore_shutdown()
+
+
+def main_loop_quit():
+ ecore_main_loop_quit()
+
+
+def main_loop_begin():
+ with nogil:
+ ecore_main_loop_begin()
+
+
+def main_loop_iterate():
+ with nogil:
+ ecore_main_loop_iterate()
+
+
+def main_loop_glib_integrate():
+ if not ecore_main_loop_glib_integrate():
+ raise SystemError("failed to integrate GLib main loop into ecore.")
+
+
+def time_get():
+ return ecore_time_get()
+
+
+def loop_time_get():
+ return ecore_loop_time_get()
+
+
+include "efl.ecore_animator.pxi"
+include "efl.ecore_timer.pxi"
+include "efl.ecore_idler.pxi"
+include "efl.ecore_fd_handler.pxi"
+include "efl.ecore_events.pxi"
+include "efl.ecore_exe.pxi"
+include "efl.ecore_file_download.pxi"
+
+init()
diff --git a/efl/ecore/efl.ecore_animator.pxi b/efl/ecore/efl.ecore_animator.pxi
new file mode 100644
index 0000000..ee033ee
--- /dev/null
+++ b/efl/ecore/efl.ecore_animator.pxi
@@ -0,0 +1,57 @@
+# Copyright (C) 2007-2013 Gustavo Sverzut Barbieri, Ulisses Furquim
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is included verbatim by efl.ecore.pyx
+
+
+cdef class Animator(Eo):
+ def __init__(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("Parameter 'func' must be callable")
+ self.func = func
+ self.args = args
+ self.kargs = kargs
+ self._set_obj(ecore_animator_add(_ecore_task_cb, <void *>self))
+
+ def __str__(self):
+ return "%s Animator(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
+ self.func, self.args, self.kargs)
+
+ def __repr__(self):
+ return "%s Animator(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
+ self.func, self.args, self.kargs)
+
+ cpdef object _task_exec(self):
+ return self.func(*self.args, **self.kargs)
+
+ def delete(self):
+ ecore_animator_del(self.obj)
+
+ def stop(self):
+ self.delete()
+
+
+def animator_add(func, *args, **kargs):
+ return Animator(func, *args, **kargs)
+
+
+def animator_frametime_set(double frametime):
+ ecore_animator_frametime_set(frametime)
+
+
+def animator_frametime_get():
+ return ecore_animator_frametime_get()
diff --git a/efl/ecore/efl.ecore_events.pxi b/efl/ecore/efl.ecore_events.pxi
new file mode 100644
index 0000000..b84ebab
--- /dev/null
+++ b/efl/ecore/efl.ecore_events.pxi
@@ -0,0 +1,354 @@
+# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is included verbatim by c_ecore.pyx
+
+
+cdef object _event_type_mapping = dict()
+
+def _event_mapping_register(int type, cls):
+ if type in _event_type_mapping:
+ raise ValueError("event type '%d' already registered." % type)
+ if not issubclass(cls, Event):
+ raise TypeError("cls (%s) must be subclass of Event" % cls)
+ _event_type_mapping[type] = cls
+
+
+def _event_mapping_unregister(int type):
+ _event_type_mapping.pop(type)
+
+
+cdef Eina_Bool event_handler_cb(void *data, int type, void *event) with gil:
+ cdef EventHandler handler
+ cdef Eina_Bool r
+
+ assert event != NULL
+ assert data != NULL
+ handler = <EventHandler>data
+ assert type == handler.type
+
+ try:
+ r = handler._exec(event)
+ except Exception, e:
+ traceback.print_exc()
+ r = 0
+
+ if not r:
+ handler.delete()
+ return r
+
+
+cdef class Event(object):
+ def __init__(self):
+ if type(self) is Event:
+ raise TypeError("Must not instantiate Event, but subclasses")
+
+ def __str__(self):
+ attrs = []
+ for attr in dir(self):
+ if not attr.startswith("_"):
+ attrs.append("%s=%r" % (attr, getattr(self, attr)))
+ return "%s(%s)" % (self.__class__.__name__, ", ".join(attrs))
+
+ cdef int _set_obj(self, void *obj) except 0:
+ raise NotImplementedError("Event._set_obj() not implemented.")
+
+
+cdef class EventHandler(object):
+ def __init__(self, int type, func, *args, **kargs):
+ "@parm: B{type} event type, as registered with ecore_event_type_new()."
+ if not callable(func):
+ raise TypeError("Parameter 'func' must be callable")
+ event_cls = _event_type_mapping.get(type, None)
+ if event_cls is None:
+ raise ValueError("Unknow Ecore_Event type %d" % type)
+ self.type = type
+ self.event_cls = event_cls
+ self.func = func
+ self.args = args
+ self.kargs = kargs
+ self._set_obj(ecore_event_handler_add(type, event_handler_cb,
+ <void *>self))
+
+ def __str__(self):
+ return "%s(type=%d, func=%s, args=%s, kargs=%s, event_cls=%s)" % \
+ (self.__class__.__name__, self.type,
+ self.func, self.args, self.kargs, self.event_cls)
+
+ def __repr__(self):
+ return ("%s(%#x, type=%d, func=%s, args=%s, kargs=%s, event_cls=%s, "
+ "Ecore_Event_Handler=%#x, refcount=%d)") % \
+ (self.__class__.__name__, <unsigned long><void *>self,
+ self.type, self.func, self.args, self.kargs, self.event_cls,
+ <unsigned long>self.obj, PY_REFCOUNT(self))
+
+ def __dealloc__(self):
+ if self.obj != NULL:
+ ecore_event_handler_del(self.obj)
+
+ cdef int _set_obj(self, Ecore_Event_Handler *obj) except 0:
+ assert self.obj == NULL, "Object must be clean"
+ assert obj != NULL, "Cannot set NULL as object"
+ self.obj = obj
+ Py_INCREF(self)
+ return 1
+
+ cdef int _unset_obj(self) except 0:
+ if self.obj != NULL:
+ ecore_event_handler_del(self.obj)
+ self.obj = NULL
+ self.event_cls = None
+ self.func = None
+ self.args = None
+ self.kargs = None
+ Py_DECREF(self)
+ return 1
+
+ cdef Eina_Bool _exec(self, void *event) except 2:
+ cdef Event e
+ e = self.event_cls()
+ e._set_obj(event)
+ return bool(self.func(e, *self.args, **self.kargs))
+
+ def delete(self):
+ if self.obj != NULL:
+ self._unset_obj()
+
+ def stop(self):
+ self.delete()
+
+
+def event_handler_add(int type, func, *args, **kargs):
+ return EventHandler(type, func, *args, **kargs)
+
+
+cdef class EventSignalUser(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ cdef Ecore_Event_Signal_User *obj
+ obj = <Ecore_Event_Signal_User*>o
+ self.number = obj.number
+ return 1
+
+ def __str__(self):
+ return "%s(number=%d)" % (self.__class__.__name__, self.number)
+
+ def __repr__(self):
+ return "%s(number=%d)" % (self.__class__.__name__, self.number)
+
+
+cdef class EventSignalUser1(EventSignalUser):
+ def __str__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+ def __repr__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+
+cdef class EventSignalUser2(EventSignalUser):
+ def __str__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+ def __repr__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+
+cdef class EventHandlerSignalUser(EventHandler):
+ def __init__(self, func, *args, **kargs):
+ EventHandler.__init__(self, ECORE_EVENT_SIGNAL_USER,
+ func, *args, **kargs)
+
+ cdef Eina_Bool _exec(self, void *event) except 2:
+ cdef Ecore_Event_Signal_User *obj = <Ecore_Event_Signal_User *>event
+ cdef EventSignalUser e
+ if obj.number == 1:
+ e = EventSignalUser1()
+ elif obj.number == 2:
+ e = EventSignalUser2()
+ else:
+ e = EventSignalUser()
+ e._set_obj(event)
+ return bool(self.func(e, *self.args, **self.kargs))
+
+
+def on_signal_user(func, *args, **kargs):
+ return EventHandlerSignalUser(func, *args, **kargs)
+
+
+cdef class EventSignalHup(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ return 1
+
+ def __str__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+ def __repr__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+
+def on_signal_hup(func, *args, **kargs):
+ return EventHandler(ECORE_EVENT_SIGNAL_HUP, func, *args, **kargs)
+
+
+cdef class EventSignalExit(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ cdef Ecore_Event_Signal_Exit *obj
+ obj = <Ecore_Event_Signal_Exit*>o
+ self.interrupt = bool(obj.interrupt)
+ self.quit = bool(obj.quit)
+ self.terminate = bool(obj.terminate)
+ return 1
+
+ def __str__(self):
+ return "%s(interrupt=%s, quit=%s, terminate=%s)" % \
+ (self.__class__.__name__, self.interrupt, self.quit, self.terminate)
+
+ def __repr__(self):
+ return "%s(interrupt=%s, quit=%s, terminate=%s)" % \
+ (self.__class__.__name__, self.interrupt, self.quit, self.terminate)
+
+
+cdef class EventSignalQuit(EventSignalExit):
+ def __str__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+ def __repr__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+
+cdef class EventSignalInterrupt(EventSignalExit):
+ def __str__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+ def __repr__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+
+cdef class EventSignalTerminate(EventSignalExit):
+ def __str__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+ def __repr__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+
+cdef class EventHandlerSignalExit(EventHandler):
+ def __init__(self, func, *args, **kargs):
+ EventHandler.__init__(self, ECORE_EVENT_SIGNAL_EXIT,
+ func, *args, **kargs)
+
+ cdef Eina_Bool _exec(self, void *event) except 2:
+ cdef Ecore_Event_Signal_Exit *obj = <Ecore_Event_Signal_Exit *>event
+ cdef EventSignalExit e
+ if obj.terminate:
+ e = EventSignalTerminate()
+ elif obj.interrupt:
+ e = EventSignalInterrupt()
+ elif obj.quit:
+ e = EventSignalQuit()
+ else:
+ e = EventSignalExit()
+ e._set_obj(event)
+ return bool(self.func(e, *self.args, **self.kargs))
+
+
+def on_signal_exit(func, *args, **kargs):
+ return EventHandlerSignalExit(func, *args, **kargs)
+
+
+cdef class EventSignalPower(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ return 1
+
+ def __str__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+ def __repr__(self):
+ return "%s()" % (self.__class__.__name__,)
+
+
+def on_signal_power(func, *args, **kargs):
+ return EventHandler(ECORE_EVENT_SIGNAL_POWER, func, *args, **kargs)
+
+
+cdef class EventSignalRealtime(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ cdef Ecore_Event_Signal_Realtime *obj
+ obj = <Ecore_Event_Signal_Realtime*>o
+ self.num = obj.num
+ return 1
+
+ def __str__(self):
+ return "%s(num=%d)" % (self.__class__.__name__, self.num)
+
+ def __repr__(self):
+ return "%s(num=%d)" % (self.__class__.__name__, self.num)
+
+
+def on_signal_realtime(func, *args, **kargs):
+ return EventHandler(ECORE_EVENT_SIGNAL_REALTIME, func, *args, **kargs)
+
+
+cdef class CustomEvent(Event):
+ cdef int _set_obj(self, void *obj):
+ self.obj = <object>obj
+ return 1
+
+def event_type_new(cls):
+ cdef int type
+
+ type = ecore_event_type_new()
+
+ _event_mapping_register(type, cls)
+
+ return type
+
+
+cdef void _event_free_cb(void *data, void *event) with gil:
+ cdef QueuedEvent ev
+
+ ev = <QueuedEvent>data
+ ev._free()
+
+
+cdef class QueuedEvent(object):
+ def __init__(self, int type, *args):
+ self.args = args
+ self._set_obj(ecore_event_add(type, <void *>self.args, _event_free_cb,
+ <void*>self))
+
+ cdef int _set_obj(self, Ecore_Event *ev):
+ assert self.obj == NULL, "Object must be clean"
+ assert ev != NULL, "Cannot set NULL as object"
+ self.obj = ev
+ Py_INCREF(self)
+ return 1
+
+ cdef int _unset_obj(self):
+ if self.obj != NULL:
+ self.obj = NULL
+ self.args = None
+ Py_DECREF(self)
+ return 1
+
+ def _free(self):
+ self._unset_obj()
+
+ def delete(self):
+ ecore_event_del(self.obj)
+
+def event_add(int type, *args):
+ return QueuedEvent(type, args)
diff --git a/efl/ecore/efl.ecore_exe.pxi b/efl/ecore/efl.ecore_exe.pxi
new file mode 100644
index 0000000..a52a227
--- /dev/null
+++ b/efl/ecore/efl.ecore_exe.pxi
@@ -0,0 +1,534 @@
+# Copyright (C) 2010 Gustavo Sverzut Barbieri
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is included verbatim by c_ecore.pyx
+
+
+# TODO: remove me after usage is update to new buffer api
+cdef extern from "Python.h":
+ int PyObject_AsReadBuffer(obj, void **buffer, Py_ssize_t *buffer_len) except -1
+ object PyUnicode_FromStringAndSize(char *s, Py_ssize_t len)
+
+
+cdef exe_flags2str(int value):
+ flags = []
+ if value & ECORE_EXE_PIPE_READ:
+ flags.append("PIPE_READ")
+ if value & ECORE_EXE_PIPE_WRITE:
+ flags.append("PIPE_WRITE")
+ if value & ECORE_EXE_PIPE_ERROR:
+ flags.append("PIPE_ERROR")
+ if value & ECORE_EXE_PIPE_READ_LINE_BUFFERED:
+ flags.append("PIPE_READ_LINE_BUFFERED")
+ if value & ECORE_EXE_PIPE_ERROR_LINE_BUFFERED:
+ flags.append("PIPE_ERROR_LINE_BUFFERED")
+ if value & ECORE_EXE_PIPE_AUTO:
+ flags.append("PIPE_AUTO")
+ if value & ECORE_EXE_RESPAWN:
+ flags.append("RESPAWN")
+ if value & ECORE_EXE_USE_SH:
+ flags.append("USE_SH")
+ if value & ECORE_EXE_NOT_LEADER:
+ flags.append("NOT_LEADER")
+ return ", ".join(flags)
+
+
+cdef Eina_Bool _exe_event_filter_cb(void *data, int type, void *event) with gil:
+ cdef ExeEventFilter self = <ExeEventFilter>data
+ cdef Ecore_Exe_Event_Add *e_add
+ cdef Ecore_Exe_Event_Del *e_del
+ cdef Ecore_Exe_Event_Data *e_data
+ cdef Event e
+
+ try:
+ assert self.event_type == type, "event is not what we asked? impossible"
+ if type == ECORE_EXE_EVENT_ADD:
+ e_add = <Ecore_Exe_Event_Add *>event
+ if e_add.exe != self.exe:
+ return 1
+ e = EventExeAdd()
+ elif type == ECORE_EXE_EVENT_DEL:
+ e_del = <Ecore_Exe_Event_Del *>event
+ if e_del.exe != self.exe:
+ return 1
+ e = EventExeDel()
+ elif type == ECORE_EXE_EVENT_DATA or type == ECORE_EXE_EVENT_ERROR:
+ e_data = <Ecore_Exe_Event_Data *>event
+ if e_data.exe != self.exe:
+ return 1
+ e = EventExeData()
+ else:
+ raise SystemError("unknown event type=%d" % type)
+
+ r = e._set_obj(event)
+ assert r != -1, "exe is not known?! impossible!"
+
+ cb = tuple(self.callbacks) # copy, so we can change self.callbacks
+ for func, args, kargs in cb:
+ try:
+ func(self.owner, e, *args, **kargs)
+ except:
+ traceback.print_exc()
+
+ except:
+ traceback.print_exc()
+
+ return 1 # always return true, no matter what
+
+
+cdef class ExeEventFilter:
+ def __cinit__(self, *a, **ka):
+ self.exe = NULL
+ self.handler = NULL
+ self.owner = None
+ self.event_type = -1
+ self.callbacks = []
+
+ def __dealloc__(self):
+ if self.handler != NULL:
+ ecore_event_handler_del(self.handler)
+ self.handler = NULL
+
+ self.exe = NULL
+ self.owner = None
+ self.event_type = None
+ self.callbacks = None
+
+ def __init__(self, Exe exe not None, int event_type):
+ self.exe = exe.exe
+ self.owner = exe
+ self.event_type = event_type
+ self.callbacks = []
+
+ def delete(self):
+ if self.handler != NULL:
+ ecore_event_handler_del(self.handler)
+ self.handler = NULL
+ self.callbacks = None
+
+ def callback_add(self, func, args, kargs):
+ if self.handler == NULL:
+ self.handler = ecore_event_handler_add(
+ self.event_type, _exe_event_filter_cb, <void *>self)
+ self.callbacks.append((func, args, kargs))
+
+ def callback_del(self, func, args, kargs):
+ try:
+ self.callbacks.remove((func, args, kargs))
+ except ValueError, e:
+ raise ValueError(
+ "callback is not registered: %s, args=%s, kargs=%s" %
+ (func, args, kargs))
+
+ if self.callbacks:
+ return
+
+ if self.handler != NULL:
+ ecore_event_handler_del(self.handler)
+ self.handler = NULL
+
+
+def exe_run_priority_set(int pri):
+ ecore_exe_run_priority_set(pri)
+
+
+def exe_run_priority_get():
+ return ecore_exe_run_priority_get()
+
+
+cdef object _ecore_exe_event_mapping
+_ecore_exe_event_mapping = {}
+
+
+cdef void _ecore_exe_pre_free_cb(void *data, const_Ecore_Exe *exe) with gil:
+ cdef Exe obj
+ try:
+ if data == NULL:
+ raise ValueError("data parameter is NULL")
+ else:
+ obj = <Exe>data
+ obj._unset_obj()
+ except Exception, e:
+ traceback.print_exc()
+
+
+cdef class Exe(object):
+ def __cinit__(self, *a, **ka):
+ self.exe = NULL
+ self.__data = None
+ self.__callbacks = {}
+
+ def __init__(self, exe_cmd, int flags=0, data=None):
+ if not exe_cmd:
+ raise ValueError("exe_cmd must not be empty!")
+
+ if flags is None:
+ flags = 0
+
+ self._set_obj(_fruni(exe_cmd), flags)
+ self.__data = data
+ self.__callbacks = {}
+
+ cdef int _set_obj(self, char *exe_cmd, int flags) except 0:
+ cdef Ecore_Exe *exe
+
+ assert self.exe == NULL, "Exe must be clean, not wrapping any Ecore_Exe"
+
+ exe = ecore_exe_pipe_run(exe_cmd, <Ecore_Exe_Flags>flags, <void *>self)
+ if exe == NULL:
+ raise SystemError("could not run subprocess %r, flags=%#x" %
+ (exe_cmd, flags))
+
+ Py_INCREF(self)
+ self.exe = exe
+ ecore_exe_callback_pre_free_set(exe, _ecore_exe_pre_free_cb)
+ _ecore_exe_event_mapping[<long><void *>exe] = self
+ return 1
+
+ cdef int _unset_obj(self) except 0:
+ assert self.exe != NULL, "Exe must wrap something"
+ for t, filter in self.__callbacks.iteritems():
+ filter.delete()
+ self.__callbacks = None
+
+ _ecore_exe_event_mapping.pop(<long><void *>self.exe)
+ self.exe = NULL
+ Py_DECREF(self)
+ return 1
+
+ def __str__(self):
+ if self.exe == NULL:
+ pid = None
+ cmd = None
+ flags = ""
+ data = None
+ else:
+ pid = self.pid
+ cmd = self.cmd
+ flags = exe_flags2str(self.flags)
+ data = None
+ return "%s(pid=%s, cmd=%r, flags=[%s], data=%r)" % \
+ (self.__class__.__name__, pid, cmd, flags, data)
+
+ def __repr__(self):
+ if self.exe == NULL:
+ pid = None
+ cmd = None
+ flags = ""
+ data = None
+ else:
+ pid = self.pid
+ cmd = self.cmd
+ flags = exe_flags2str(self.flags)
+ data = None
+ return ("%s(%#x, Ecore_Exe=%#x, refcount=%d, pid=%s, cmd=%r, "
+ "flags=[%s], data=%r)") % \
+ (self.__class__.__name__, <unsigned long><void *>self,
+ <unsigned long>self.exe, PY_REFCOUNT(self),
+ pid, cmd, flags, data)
+
+ def delete(self):
+ if self.exe == NULL:
+ raise ValueError("%s already deleted" % self.__class__.__name__)
+ ecore_exe_free(self.exe)
+
+ def free(self):
+ self.delete()
+
+ def send(self, buffer, long size=0):
+ cdef const_void *b_data
+ cdef Py_ssize_t b_size
+
+ # TODO: update to new buffer api
+ PyObject_AsReadBuffer(buffer, &b_data, &b_size)
+ if size <= 0:
+ size = b_size
+ elif size > b_size:
+ raise ValueError(
+ "given size (%d) is larger than buffer size (%d)." %
+ (size, b_size))
+
+ return bool(ecore_exe_send(self.exe, b_data, size))
+
+ def close_stdin(self):
+ ecore_exe_close_stdin(self.exe)
+
+ def auto_limits_set(self, int start_bytes, int end_bytes,
+ int start_lines, int end_lines):
+ ecore_exe_auto_limits_set(self.exe, start_bytes, end_bytes,
+ start_lines, end_lines)
+
+ def event_data_get(self, int flags):
+ pass
+ # TODO:
+ #Ecore_Exe_Event_Data *ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
+ #void ecore_exe_event_data_free(Ecore_Exe_Event_Data *data)
+
+ def cmd_get(self):
+ cdef const_char_ptr cmd = ecore_exe_cmd_get(self.exe)
+ if cmd != NULL:
+ return cmd
+ return None
+
+ property cmd:
+ def __get__(self):
+ return self.cmd_get()
+
+ def pid_get(self):
+ return ecore_exe_pid_get(self.exe)
+
+ property pid:
+ def __get__(self):
+ return self.pid_get()
+
+ def tag_set(self, char *tag):
+ cdef char *s
+ if tag is None:
+ s = NULL
+ else:
+ s = tag
+ ecore_exe_tag_set(self.exe, s)
+
+ def tag_get(self):
+ cdef const_char_ptr tag = ecore_exe_tag_get(self.exe)
+ if tag != NULL:
+ return tag
+ return None
+
+ property tag:
+ def __set__(self, char *tag):
+ self.tag_set(tag)
+
+ def __get__(self):
+ return self.tag_get()
+
+ def data_get(self):
+ return self.__data
+
+ property data:
+ def __get__(self):
+ return self.data_get()
+
+ def flags_get(self):
+ return ecore_exe_flags_get(self.exe)
+
+ property flags:
+ def __get__(self):
+ return self.flags_get()
+
+ def signal(self, int num):
+ if num != 1 or num != 2:
+ raise ValueError("num must be either 1 or 2. Got %d." % num)
+ ecore_exe_signal(self.exe, num)
+
+ def pause(self):
+ ecore_exe_pause(self.exe)
+
+ def stop(self):
+ self.pause()
+
+ def continue_(self):
+ ecore_exe_continue(self.exe)
+
+ def resume(self):
+ self.continue_()
+
+ def interrupt(self):
+ ecore_exe_interrupt(self.exe)
+
+ def quit(self):
+ ecore_exe_quit(self.exe)
+
+ def terminate(self):
+ ecore_exe_terminate(self.exe)
+
+ def kill(self):
+ ecore_exe_kill(self.exe)
+
+ def hup(self):
+ ecore_exe_hup(self.exe)
+
+ def on_add_event_add(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
+ if filter is None:
+ filter = ExeEventFilter(self, ECORE_EXE_EVENT_ADD)
+ self.__callbacks[ECORE_EXE_EVENT_ADD] = filter
+ filter.callback_add(func, args, kargs)
+
+ def on_add_event_del(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
+ if filter is None:
+ raise ValueError("callback not registered %s, args=%s, kargs=%s" %
+ (func, args, kargs))
+ filter.callback_del(func, args, kargs)
+
+ def on_del_event_add(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
+ if filter is None:
+ filter = ExeEventFilter(self, ECORE_EXE_EVENT_DEL)
+ self.__callbacks[ECORE_EXE_EVENT_DEL] = filter
+ filter.callback_add(func, args, kargs)
+
+ def on_del_event_del(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
+ if filter is None:
+ raise ValueError("callback not registered %s, args=%s, kargs=%s" %
+ (func, args, kargs))
+ filter.callback_del(func, args, kargs)
+
+ def on_data_event_add(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
+ if filter is None:
+ filter = ExeEventFilter(self, ECORE_EXE_EVENT_DATA)
+ self.__callbacks[ECORE_EXE_EVENT_DATA] = filter
+ filter.callback_add(func, args, kargs)
+
+ def on_data_event_del(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
+ if filter is None:
+ raise ValueError("callback not registered %s, args=%s, kargs=%s" %
+ (func, args, kargs))
+ filter.callback_del(func, args, kargs)
+
+ def on_error_event_add(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
+ if filter is None:
+ filter = ExeEventFilter(self, ECORE_EXE_EVENT_ERROR)
+ self.__callbacks[ECORE_EXE_EVENT_ERROR] = filter
+ filter.callback_add(func, args, kargs)
+
+ def on_error_event_del(self, func, *args, **kargs):
+ filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
+ if filter is None:
+ raise ValueError("callback not registered %s, args=%s, kargs=%s" %
+ (func, args, kargs))
+ filter.callback_del(func, args, kargs)
+
+
+def exe_run(char *exe_cmd, data=None):
+ return Exe(exe_cmd, data=data)
+
+
+def exe_pipe_run(char *exe_cmd, int flags=0, data=None):
+ return Exe(exe_cmd, flags, data)
+
+
+cdef class EventExeAdd(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ cdef Ecore_Exe_Event_Add *obj
+ obj = <Ecore_Exe_Event_Add*>o
+ self.exe = _ecore_exe_event_mapping.get(<long>obj.exe)
+ if self.exe is None:
+ return -1
+ return 1
+
+ def __str__(self):
+ return "%s(exe=%s)" % (self.__class__.__name__, self.exe)
+
+ def __repr__(self):
+ return "%s(exe=%r)" % (self.__class__.__name__, self.exe)
+
+
+cdef class EventExeDel(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ cdef Ecore_Exe_Event_Del *obj
+ obj = <Ecore_Exe_Event_Del*>o
+ self.exe = _ecore_exe_event_mapping.get(<long>obj.exe)
+ if self.exe is None:
+ return -1
+ self.pid = obj.pid
+ self.exit_code = obj.exit_code
+ self.exit_signal = obj.exit_signal
+ self.exited = bool(obj.exited)
+ self.signalled = bool(obj.signalled)
+ return 1
+
+ def __str__(self):
+ return ("%s(pid=%s, exit_code=%s, exit_signal=%s, exited=%s, "
+ "signalled=%s, exe=%s)") % \
+ (self.__class__.__name__, self.pid, self.exit_code,
+ self.exit_signal, self.exited, self.signalled, self.exe)
+
+ def __repr__(self):
+ return ("%s(pid=%s, exit_code=%s, exit_signal=%s, exited=%s, "
+ "signalled=%s, exe=%r)") % \
+ (self.__class__.__name__, self.pid, self.exit_code,
+ self.exit_signal, self.exited, self.signalled, self.exe)
+
+
+cdef class EventExeData(Event):
+ cdef int _set_obj(self, void *o) except 0:
+ cdef Ecore_Exe_Event_Data *obj
+ cdef int i
+ obj = <Ecore_Exe_Event_Data*>o
+ self.exe = _ecore_exe_event_mapping.get(<long>obj.exe)
+ if self.exe is None:
+ return -1
+ self.data = PyUnicode_FromStringAndSize(<char*>obj.data, obj.size)
+ self.size = obj.size
+ self.lines = []
+
+ line_append = self.lines.append
+ if obj.lines:
+ i = 0
+ while obj.lines[i].line != NULL:
+ line_append(PyUnicode_FromStringAndSize(
+ obj.lines[i].line, obj.lines[i].size))
+ i += 1
+
+ return 1
+
+ def __str__(self):
+ if self.lines is None:
+ count = None
+ else:
+ count = len(self.lines)
+ return "%s(size=%d, lines=#%d, exe=%s)" % \
+ (self.__class__.__name__, self.size, count, self.exe)
+
+ def __repr__(self):
+ if self.lines is None:
+ count = None
+ else:
+ count = len(self.lines)
+ return "%s(size=%d, lines=#%d, exe=%r)" % \
+ (self.__class__.__name__, self.size, count, self.exe)
+
+
+cdef class EventHandlerExe(EventHandler):
+ cdef Eina_Bool _exec(self, void *event) except 2:
+ cdef Event e
+ e = self.event_cls()
+ if e._set_obj(event) == -1: # no exe
+ return True
+ return bool(self.func(e, *self.args, **self.kargs))
+
+
+def on_exe_add_event_add(func, *args, **kargs):
+ return EventHandlerExe(ECORE_EXE_EVENT_ADD, func, *args, **kargs)
+
+
+def on_exe_del_event_add(func, *args, **kargs):
+ return EventHandlerExe(ECORE_EXE_EVENT_DEL, func, *args, **kargs)
+
+
+def on_exe_data_event_add(func, *args, **kargs):
+ return EventHandlerExe(ECORE_EXE_EVENT_DATA, func, *args, **kargs)
+
+
+def on_exe_error_event_add(func, *args, **kargs):
+ return EventHandlerExe(ECORE_EXE_EVENT_ERROR, func, *args, **kargs)
diff --git a/efl/ecore/efl.ecore_fd_handler.pxi b/efl/ecore/efl.ecore_fd_handler.pxi
new file mode 100644
index 0000000..d60b8a8
--- /dev/null
+++ b/efl/ecore/efl.ecore_fd_handler.pxi
@@ -0,0 +1,164 @@
+# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri, Ulisses Furquim
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is included verbatim by c_ecore.pyx
+
+
+cdef void fd_handler_prepare_cb(void *data, Ecore_Fd_Handler *fdh) with gil:
+ cdef FdHandler obj = <FdHandler>data
+ cdef int r
+
+ if obj._prepare_callback is None:
+ return
+ func, args, kargs = obj._prepare_callback
+ try:
+ func(obj, *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+
+
+cdef flags2str(int value):
+ flags = []
+ if value & <int>ECORE_FD_READ:
+ flags.append("READ")
+ if value & <int>ECORE_FD_WRITE:
+ flags.append("WRITE")
+ if value & <int>ECORE_FD_ERROR:
+ flags.append("ERROR")
+ return ", ".join(flags)
+
+
+cdef Eina_Bool fd_handler_cb(void *data, Ecore_Fd_Handler *fdh) with gil:
+ cdef FdHandler obj = <FdHandler>data
+ cdef Eina_Bool r
+
+ try:
+ r = bool(obj._exec())
+ except Exception, e:
+ traceback.print_exc()
+ r = 0
+
+ if not r:
+ obj.delete()
+ return r
+
+
+cdef class FdHandler(object):
+ def __init__(self, fd, int flags, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("Parameter 'func' must be callable")
+ self.func = func
+ self.args = args
+ self.kargs = kargs
+ self._prepare_callback = None
+ if self.obj == NULL:
+ if not isinstance(fd, (int, long)):
+ try:
+ fd = fd.fileno()
+ except AttributeError, e:
+ raise ValueError("fd must be integer or have fileno()")
+
+ self.obj = ecore_main_fd_handler_add(fd,
+ <Ecore_Fd_Handler_Flags>flags,
+ fd_handler_cb, <void *>self,
+ NULL, NULL)
+ if self.obj != NULL:
+ Py_INCREF(self)
+
+ def __str__(self):
+ if self.obj == NULL:
+ fd = None
+ flags = ""
+ else:
+ fd = self.fd_get()
+ flags = flags2str(self.active_get(7))
+ return "%s(func=%s, args=%s, kargs=%s, fd=%s, flags=[%s])" % \
+ (self.__class__.__name__, self.func, self.args, self.kargs,
+ fd, flags)
+
+ def __repr__(self):
+ if self.obj == NULL:
+ fd = None
+ flags = ""
+ else:
+ fd = self.fd_get()
+ flags = flags2str(self.active_get(7))
+ return ("%s(%#x, func=%s, args=%s, kargs=%s, fd=%s, flags=[%s], "
+ "Ecore_Fd_Handler=%#x, refcount=%d)") % \
+ (self.__class__.__name__, <unsigned long><void *>self,
+ self.func, self.args, self.kargs, fd, flags,
+ <unsigned long>self.obj, PY_REFCOUNT(self))
+
+ def __dealloc__(self):
+ if self.obj != NULL:
+ ecore_main_fd_handler_del(self.obj)
+ self.obj = NULL
+ self.func = None
+ self.args = None
+ self.kargs = None
+
+ cdef object _exec(self):
+ return self.func(self, *self.args, **self.kargs)
+
+ def delete(self):
+ if self.obj != NULL:
+ ecore_main_fd_handler_del(self.obj)
+ self.obj = NULL
+ Py_DECREF(self)
+
+ def stop(self):
+ self.delete()
+
+ def fd_get(self):
+ return ecore_main_fd_handler_fd_get(self.obj)
+
+ property fd:
+ def __get__(self):
+ return self.fd_get()
+
+ def active_get(self, int flags):
+ cdef Ecore_Fd_Handler_Flags v = <Ecore_Fd_Handler_Flags>flags
+ return bool(ecore_main_fd_handler_active_get(self.obj, v))
+
+ def active_set(self, int flags):
+ cdef Ecore_Fd_Handler_Flags v = <Ecore_Fd_Handler_Flags>flags
+ ecore_main_fd_handler_active_set(self.obj, v)
+
+ def can_read(self):
+ return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_READ))
+
+ def can_write(self):
+ return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_WRITE))
+
+ def has_error(self):
+ return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_ERROR))
+
+ def prepare_callback_set(self, func, *args, **kargs):
+ if func is None:
+ self._prepare_callback = None
+ ecore_main_fd_handler_prepare_callback_set(self.obj, NULL, NULL)
+ elif callable(func):
+ self._prepare_callback = (func, args, kargs)
+ ecore_main_fd_handler_prepare_callback_set(self.obj,
+ fd_handler_prepare_cb,
+ <void *>self)
+ else:
+ raise TypeError("Parameter 'func' must be callable")
+
+
+def fd_handler_add(fd, int flags, func, *args, **kargs):
+ return FdHandler(fd, flags, func, *args, **kargs)
diff --git a/efl/ecore/efl.ecore_file_download.pxi b/efl/ecore/efl.ecore_file_download.pxi
new file mode 100644
index 0000000..aa8219d
--- /dev/null
+++ b/efl/ecore/efl.ecore_file_download.pxi
@@ -0,0 +1,109 @@
+# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is included verbatim by c_ecore_file.pyx
+
+
+cdef void _completion_cb(void *data, const_char_ptr file, int status) with gil:
+ obj = <FileDownload>data
+ try:
+ obj._exec_completion(file, status)
+ except Exception, e:
+ traceback.print_exc()
+
+cdef int _progress_cb(void *data, const_char_ptr file, long int dltotal,
+ long int dlnow, long int ultotal, long int ulnow) with gil:
+ obj = <FileDownload>data
+ try:
+ return obj._exec_progress(file, dltotal, dlnow, ultotal, ulnow)
+ except Exception, e:
+ traceback.print_exc()
+
+
+cdef class FileDownload(object):
+ def __init__(self, url, dst, completion_cb, progress_cb, *args, **kargs):
+ cdef Ecore_File_Download_Job *job
+
+ if completion_cb is not None and not callable(completion_cb):
+ raise TypeError("Parameter 'completion_cb' must be callable, or None")
+
+ if progress_cb is not None and not callable(progress_cb):
+ raise TypeError("Parameter 'progress_cb' must be callable, or None")
+
+ self.completion_cb = completion_cb
+ self.progress_cb = progress_cb
+ self.args = args
+ self.kargs = kargs
+
+ if not ecore_file_download(_cfruni(url), _cfruni(dst),
+ _completion_cb, _progress_cb,
+ <void *>self, &job):
+ raise SystemError("could not download '%s' to %s" % (url, dst))
+
+ self.job = job
+ Py_INCREF(self)
+
+ def __str__(self):
+ return "%s(completion_cb=%s, progress_cb=%s args=%s, kargs=%s)" % \
+ (self.__class__.__name__, self.completion_cb,
+ self.progress_cb, self.args, self.kargs)
+
+ def __repr__(self):
+ return ("%s(%#x, completion_cb=%s, progress_cb=%s, args=%s, kargs=%s, "
+ "Ecore_File_Download_Job=%#x, refcount=%d)") % \
+ (self.__class__.__name__, <unsigned long><void *>self,
+ self.completion_cb, self.progress_cb, self.args, self.kargs,
+ <unsigned long>self.job, PY_REFCOUNT(self))
+
+ def __dealloc__(self):
+ if self.job != NULL:
+ ecore_file_download_abort(self.job)
+ self.job = NULL
+ self.completion_cb = None
+ self.progress_cb = None
+ self.args = None
+ self.kargs = None
+
+ cdef object _exec_completion(self, const_char_ptr file, int status):
+ if self.completion_cb:
+ self.completion_cb(file, status, *self.args, **self.kargs)
+
+ cdef object _exec_progress(self, const_char_ptr file, long int dltotal,
+ long int dlnow, long int ultotal, long int ulnow):
+ if self.progress_cb:
+ return self.progress_cb(file, dltotal, dlnow, ultotal, ulnow,
+ *self.args, **self.kargs)
+ return 0
+
+ def abort(self):
+ if self.job != NULL:
+ ecore_file_download_abort(self.job)
+ self.job = NULL
+ Py_DECREF(self)
+
+
+def file_download(url, dst, completion_cb, progress_cb, *args, **kargs):
+ return FileDownload(url, dst, completion_cb, progress_cb, *args, **kargs)
+
+def file_download_abort(instance):
+ instance.abort()
+
+def file_download_abort_all():
+ ecore_file_download_abort_all()
+
+def file_download_protocol_available(protocol):
+ return bool(ecore_file_download_protocol_available(protocol))
diff --git a/efl/ecore/efl.ecore_idler.pxi b/efl/ecore/efl.ecore_idler.pxi
new file mode 100644
index 0000000..a8a4159
--- /dev/null
+++ b/efl/ecore/efl.ecore_idler.pxi
@@ -0,0 +1,83 @@
+# Copyright (C) 2007-2013 Gustavo Sverzut Barbieri, Ulisses Furquim
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is included verbatim by efl.ecore.pyx
+
+
+cdef class Idler(Eo):
+ def __init__(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("Parameter 'func' must be callable")
+ self.func = func
+ self.args = args
+ self.kargs = kargs
+ self._set_obj(ecore_idler_add(_ecore_task_cb, <void *>self))
+
+ def __str__(self):
+ return "%s Idler(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
+ self.func, self.args, self.kargs)
+
+ def __repr__(self):
+ return "%s Idler(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
+ self.func, self.args, self.kargs)
+
+ cpdef object _task_exec(self):
+ return self.func(*self.args, **self.kargs)
+
+ def delete(self):
+ ecore_idler_del(self.obj)
+
+ def stop(self):
+ self.delete()
+
+
+cdef class IdleEnterer(Idler):
+ def __init__(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("Parameter 'func' must be callable")
+ self.func = func
+ self.args = args
+ self.kargs = kargs
+ self._set_obj(ecore_idle_enterer_add(_ecore_task_cb, <void *>self))
+
+ def delete(self):
+ ecore_idle_enterer_del(self.obj)
+
+
+cdef class IdleExiter(Idler):
+ def __init__(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("Parameter 'func' must be callable")
+ self.func = func
+ self.args = args
+ self.kargs = kargs
+ self._set_obj(ecore_idle_exiter_add(_ecore_task_cb, <void *>self))
+
+ def delete(self):
+ ecore_idle_exiter_del(self.obj)
+
+
+def idler_add(func, *args, **kargs):
+ return Idler(func, *args, **kargs)
+
+
+def idle_enterer_add(func, *args, **kargs):
+ return IdleEnterer(func, *args, **kargs)
+
+
+def idle_exiter_add(func, *args, **kargs):
+ return IdleExiter(func, *args, **kargs)
diff --git a/efl/ecore/efl.ecore_timer.pxi b/efl/ecore/efl.ecore_timer.pxi
new file mode 100644
index 0000000..5c2b701
--- /dev/null
+++ b/efl/ecore/efl.ecore_timer.pxi
@@ -0,0 +1,91 @@
+# Copyright (C) 2007-2013 Gustavo Sverzut Barbieri, Ulisses Furquim
+#
+# This file is part of Python-Ecore.
+#
+# Python-Ecore 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.1 of the License, or (at your option) any later version.
+#
+# Python-Ecore 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 Python-Ecore. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is included verbatim by efl.ecore.pyx
+
+
+cdef class Timer(Eo):
+ def __init__(self, double interval, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("Parameter 'func' must be callable")
+ self.func = func
+ self.args = args
+ self.kargs = kargs
+ self._set_obj(ecore_timer_add(interval, _ecore_task_cb, <void *>self))
+
+ def __str__(self):
+ return "%s Timer(func=%s, args=%s, kargs=%s)" % (Eo.__str__(self),
+ self.func, self.args, self.kargs)
+
+ def __repr__(self):
+ return "%s Timer(interval=%f, func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
+ self.interval if self.obj else -1.0,
+ self.func, self.args, self.kargs)
+
+ cpdef object _task_exec(self):
+ return self.func(*self.args, **self.kargs)
+
+ def delete(self):
+ ecore_timer_del(self.obj)
+
+ def stop(self):
+ self.delete()
+
+ def freeze(self):
+ ecore_timer_freeze(self.obj)
+
+ def thaw(self):
+ ecore_timer_thaw(self.obj)
+
+ def interval_set(self, double t):
+ ecore_timer_interval_set(self.obj, t)
+
+ def interval_get(self):
+ return ecore_timer_interval_get(self.obj)
+
+ property interval:
+ def __get__(self):
+ return ecore_timer_interval_get(self.obj)
+
+ def __set__(self, double t):
+ ecore_timer_interval_set(self.obj, t)
+
+ def delay(self, double add):
+ ecore_timer_delay(self.obj, add)
+
+ def reset(self):
+ ecore_timer_reset(self.obj)
+
+ def ecore_timer_pending_get(self):
+ ecore_timer_pending_get(self.obj)
+
+ property pending:
+ def __get__(self):
+ return ecore_timer_pending_get(self.obj)
+
+
+def timer_add(double t, func, *args, **kargs):
+ return Timer(t, func, *args, **kargs)
+
+
+def timer_precision_get():
+ return ecore_timer_precision_get()
+
+
+def timer_precision_set(double value):
+ ecore_timer_precision_set(value)
+
diff --git a/efl/edje/efl.edje.pyx b/efl/edje/efl.edje.pyx
new file mode 100644
index 0000000..df32588
--- /dev/null
+++ b/efl/edje/efl.edje.pyx
@@ -0,0 +1,328 @@
+# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri, Ulisses Furquim
+#
+# This file is part of Python-Edje.
+#
+# Python-Edje 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.1 of the License, or (at your option) any later version.
+#
+# Python-Edje 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 Python-Edje. If not, see <http://www.gnu.org/licenses/>.
+
+
+import traceback
+import warnings
+
+from cpython cimport PyMem_Malloc, PyMem_Free
+cimport libc.stdlib
+
+from efl.eo cimport _object_mapping_register, object_from_instance
+from efl.eo cimport _ctouni, _cfruni, _touni, _fruni, _strings_to_python
+
+
+# Edje_Message_Type:
+EDJE_MESSAGE_NONE = 0
+EDJE_MESSAGE_SIGNAL = 1
+EDJE_MESSAGE_STRING = 2
+EDJE_MESSAGE_INT = 3
+EDJE_MESSAGE_FLOAT = 4
+EDJE_MESSAGE_STRING_SET = 5
+EDJE_MESSAGE_INT_SET = 6
+EDJE_MESSAGE_FLOAT_SET = 7
+EDJE_MESSAGE_STRING_INT = 8
+EDJE_MESSAGE_STRING_FLOAT = 9
+EDJE_MESSAGE_STRING_INT_SET = 10
+EDJE_MESSAGE_STRING_FLOAT_SET = 11
+
+# Edje_Aspect_Control:
+EDJE_ASPECT_CONTROL_NONE = 0
+EDJE_ASPECT_CONTROL_NEITHER = 1
+EDJE_ASPECT_CONTROL_HORIZONTAL = 2
+EDJE_ASPECT_CONTROL_VERTICAL = 3
+EDJE_ASPECT_CONTROL_BOTH = 4
+
+# Edje_Drag_Dir:
+EDJE_DRAG_DIR_NONE = 0
+EDJE_DRAG_DIR_X = 1
+EDJE_DRAG_DIR_Y = 2
+EDJE_DRAG_DIR_XY = 3
+
+# Edje_Load_Error:
+EDJE_LOAD_ERROR_NONE = 0
+EDJE_LOAD_ERROR_GENERIC = 1
+EDJE_LOAD_ERROR_DOES_NOT_EXIST = 2
+EDJE_LOAD_ERROR_PERMISSION_DENIED = 3
+EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4
+EDJE_LOAD_ERROR_CORRUPT_FILE = 5
+EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6
+EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7
+EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8
+
+# Edje_Part_Type:
+EDJE_PART_TYPE_NONE = 0
+EDJE_PART_TYPE_RECTANGLE = 1
+EDJE_PART_TYPE_TEXT = 2
+EDJE_PART_TYPE_IMAGE = 3
+EDJE_PART_TYPE_SWALLOW = 4
+EDJE_PART_TYPE_TEXTBLOCK = 5
+EDJE_PART_TYPE_GRADIENT = 6
+EDJE_PART_TYPE_GROUP = 7
+EDJE_PART_TYPE_BOX = 8
+EDJE_PART_TYPE_TABLE = 9
+EDJE_PART_TYPE_EXTERNAL = 10
+EDJE_PART_TYPE_LAST = 11
+
+# Edje_Text_Effect:
+EDJE_TEXT_EFFECT_NONE = 0
+EDJE_TEXT_EFFECT_PLAIN = 1
+EDJE_TEXT_EFFECT_OUTLINE = 2
+EDJE_TEXT_EFFECT_SOFT_OUTLINE = 3
+EDJE_TEXT_EFFECT_SHADOW = 4
+EDJE_TEXT_EFFECT_SOFT_SHADOW = 5
+EDJE_TEXT_EFFECT_OUTLINE_SHADOW = 6
+EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW = 7
+EDJE_TEXT_EFFECT_FAR_SHADOW = 8
+EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW = 9
+EDJE_TEXT_EFFECT_GLOW = 10
+EDJE_TEXT_EFFECT_LAST = 11
+
+# Edje_Action_Type:
+EDJE_ACTION_TYPE_NONE = 0
+EDJE_ACTION_TYPE_STATE_SET = 1
+EDJE_ACTION_TYPE_ACTION_STOP = 2
+EDJE_ACTION_TYPE_SIGNAL_EMIT = 3
+EDJE_ACTION_TYPE_DRAG_VAL_SET = 4
+EDJE_ACTION_TYPE_DRAG_VAL_STEP = 5
+EDJE_ACTION_TYPE_DRAG_VAL_PAGE = 6
+EDJE_ACTION_TYPE_SCRIPT = 7
+EDJE_ACTION_TYPE_FOCUS_SET = 8
+EDJE_ACTION_TYPE_LUA_SCRIPT = 9
+EDJE_ACTION_TYPE_LAST = 10
+
+# Edje_Tween_Mode:
+EDJE_TWEEN_MODE_NONE = 0
+EDJE_TWEEN_MODE_LINEAR = 1
+EDJE_TWEEN_MODE_SINUSOIDAL = 2
+EDJE_TWEEN_MODE_ACCELERATE = 3
+EDJE_TWEEN_MODE_DECELERATE = 4
+EDJE_TWEEN_MODE_LAST = 5
+
+# Edje_External_Param_Type:
+EDJE_EXTERNAL_PARAM_TYPE_INT = 0
+EDJE_EXTERNAL_PARAM_TYPE_DOUBLE = 1
+EDJE_EXTERNAL_PARAM_TYPE_STRING = 2
+EDJE_EXTERNAL_PARAM_TYPE_BOOL = 3
+EDJE_EXTERNAL_PARAM_TYPE_CHOICE = 4
+EDJE_EXTERNAL_PARAM_TYPE_MAX = 5
+
+
+
+def init():
+ cdef int r = edje_init()
+
+ if edje_external_type_abi_version_get() != EDJE_EXTERNAL_TYPE_ABI_VERSION:
+ raise TypeError("python-edje Edje_External_Type abi_version differs "
+ "from libedje.so. Recompile python-edje!")
+ return r
+
+
+def shutdown():
+ return edje_shutdown()
+
+
+def frametime_set(double t):
+ edje_frametime_set(t)
+
+
+def frametime_get():
+ return edje_frametime_get()
+
+
+def freeze():
+ edje_freeze()
+
+
+def thaw():
+ edje_thaw()
+
+
+def fontset_append_set(fonts):
+ edje_fontset_append_set(_cfruni(fonts))
+
+
+def fontset_append_get():
+ return _ctouni(edje_fontset_append_get())
+
+
+def file_collection_list(file):
+ cdef Eina_List *lst
+ lst = edje_file_collection_list(_cfruni(file))
+ ret = _strings_to_python(lst)
+ edje_file_collection_list_free(lst)
+ return ret
+
+
+def file_group_exists(file, group):
+ return bool(edje_file_group_exists(_cfruni(file), _cfruni(group)))
+
+
+def file_data_get(file, key):
+ cdef char *s
+ return _ctouni(edje_file_data_get(_cfruni(file), _cfruni(key)))
+
+
+def file_cache_set(int count):
+ edje_file_cache_set(count)
+
+
+def file_cache_get():
+ return edje_file_cache_get()
+
+
+def file_cache_flush():
+ edje_file_cache_flush()
+
+
+def collection_cache_set(int count):
+ edje_collection_cache_set(count)
+
+
+def collection_cache_get():
+ return edje_collection_cache_get()
+
+
+def collection_cache_flush():
+ edje_collection_cache_flush()
+
+
+def color_class_set(color_class,
+ int r, int g, int b, int a,
+ int r2, int g2, int b2, int a2,
+ int r3, int g3, int b3, int a3):
+ edje_color_class_set(_cfruni(color_class),
+ r, g, b, a,
+ r2, g2, b2, a2,
+ r3, g3, b3, a3)
+
+
+def color_class_get(color_class):
+ cdef int r, g, b, a
+ cdef int r2, g2, b2, a2
+ cdef int r3, g3, b3, a3
+ edje_color_class_get(_cfruni(color_class),
+ &r, &g, &b, &a,
+ &r2, &g2, &b2, &a2,
+ &r3, &g3, &b3, &a3)
+ return (r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3)
+
+
+def color_class_del(color_class):
+ edje_color_class_del(_cfruni(color_class))
+
+
+def color_class_list():
+ cdef Eina_List *lst, *itr
+ ret = []
+ lst = edje_color_class_list()
+ itr = lst
+ while itr:
+ ret.append(<char*>itr.data)
+ libc.stdlib.free(itr.data)
+ itr = itr.next
+ eina_list_free(lst)
+ return ret
+
+
+def text_class_set(text_class, font, int size):
+ edje_text_class_set(_cfruni(text_class), _cfruni(font), size)
+
+
+def text_class_del(text_class):
+ edje_text_class_del(_cfruni(text_class))
+
+
+def text_class_list():
+ cdef Eina_List *lst, *itr
+ ret = []
+ lst = edje_text_class_list()
+ itr = lst
+ while itr:
+ ret.append(<char*>itr.data)
+ libc.stdlib.free(itr.data)
+ itr = itr.next
+ eina_list_free(lst)
+ return ret
+
+
+def message_signal_process():
+ edje_message_signal_process()
+
+
+def extern_object_min_size_set(Object obj, int w, int h):
+ edje_extern_object_min_size_set(obj.obj, w, h)
+
+
+def extern_object_max_size_set(Object obj, int w, int h):
+ edje_extern_object_max_size_set(obj.obj, w, h)
+
+
+def extern_object_aspect_set(Object obj, int aspect, int w, int h):
+ edje_extern_object_aspect_set(obj.obj, <Edje_Aspect_Control>aspect, w, h)
+
+
+def available_modules_get():
+ cdef const_Eina_List *lst
+ lst = edje_available_modules_get()
+ ret = []
+ while lst:
+ ret.append(<char*>lst.data)
+ lst = lst.next
+ return ret
+
+
+def module_load(name):
+ return bool(edje_module_load(_cfruni(name)))
+
+# class EdjeObjectMeta(evas.c_evas.EvasObjectMeta):
+# def __init__(cls, name, bases, dict_):
+# evas.c_evas.EvasObjectMeta.__init__(cls, name, bases, dict_)
+# cls._fetch_callbacks()
+#
+# def _fetch_callbacks(cls):
+# if "__edje_signal_callbacks__" in cls.__dict__:
+# return
+#
+# cls.__edje_signal_callbacks__ = []
+# cls.__edje_message_callbacks__ = []
+# cls.__edje_text_callbacks__ = []
+#
+# sig_append = cls.__edje_signal_callbacks__.append
+# msg_append = cls.__edje_message_callbacks__.append
+# txt_append = cls.__edje_text_callbacks__.append
+#
+# for name in dir(cls):
+# val = getattr(cls, name)
+# if not callable(val):
+# continue
+#
+# if hasattr(val, "edje_signal_callback"):
+# sig_data = getattr(val, "edje_signal_callback")
+# sig_append((name, sig_data))
+# elif hasattr(val, "edje_message_handler"):
+# msg_append(name)
+# elif hasattr(val, "edje_text_change_callback"):
+# txt_append(name)
+
+
+include "efl.edje_message.pxi"
+include "efl.edje_external.pxi"
+include "efl.edje_object.pxi"
+
+
+init()
diff --git a/efl/edje/efl.edje_external.pxi b/efl/edje/efl.edje_external.pxi
new file mode 100644
index 0000000..9de85c2
--- /dev/null
+++ b/efl/edje/efl.edje_external.pxi
@@ -0,0 +1,488 @@
+# Copyright (C) 2007-2009 Gustavo Sverzut Barbieri, Ulisses Furquim,
+# Ivan Briano
+#
+# This file is part of Python-Edje.
+#
+# Python-Edje 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.1 of the License, or (at your option) any later version.
+#
+# Python-Edje 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 Python-Edje. If not, see <http://www.gnu.org/licenses/>.
+
+
+cdef class ExternalParam:
+ property name:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.name
+
+ property type:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.type
+
+ property i:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.i
+
+ property d:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.d
+
+ property s:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.s != NULL:
+ return self.obj.s
+
+ property b:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return bool(self.obj.i)
+
+ property value:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_INT:
+ return self.obj.i
+ elif self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
+ return self.obj.d
+ elif self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_STRING or \
+ self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
+ if self.obj.s != NULL:
+ return self.obj.s
+ elif self.obj.type == EDJE_EXTERNAL_PARAM_TYPE_BOOL:
+ return bool(self.obj.i)
+
+
+cdef ExternalParam ExternalParam_from_ptr(Edje_External_Param *param):
+ cdef ExternalParam p
+ p = ExternalParam()
+ p.obj = param
+ return p
+
+# XXX: this should be C-only, but it would require edje_edit
+# XXX: being able to use it.
+def _ExternalParam_from_ptr(long ptr):
+ return ExternalParam_from_ptr(<Edje_External_Param *>ptr)
+
+
+cdef class ExternalParamInfo:
+ property name:
+ def __get__(self):
+ if self.obj.name:
+ return self.obj.name
+ return "(unknown)"
+
+ property translated_name:
+ def __get__(self):
+ cdef const_char_ptr t
+ if self._external_type_obj == NULL or \
+ self._external_type_obj.translate == NULL:
+ return self.name
+ t = self._external_type_obj.translate(self._external_type_obj.data,
+ self.obj.name)
+ if t == NULL:
+ return self.name
+ return t
+
+ property type:
+ def __get__(self):
+ return self.obj.type
+
+ def validate(self, value):
+ return True
+
+ cdef _set_external_type(self, t):
+ cdef ExternalType ext_type
+ self.external_type = t
+ if isinstance(t, ExternalType):
+ ext_type = t
+ self._external_type_obj = ext_type._obj
+
+
+cdef class ExternalParamInfoInt(ExternalParamInfo):
+ property default:
+ def __get__(self):
+ if self.obj.info.i.default == EDJE_EXTERNAL_INT_UNSET:
+ return None
+ return self.obj.info.i.default
+
+ property min:
+ def __get__(self):
+ if self.obj.info.i.min == EDJE_EXTERNAL_INT_UNSET:
+ return None
+ return self.obj.info.i.min
+
+ property max:
+ def __get__(self):
+ if self.obj.info.i.max == EDJE_EXTERNAL_INT_UNSET:
+ return None
+ return self.obj.info.i.max
+
+ property step:
+ def __get__(self):
+ if self.obj.info.i.step == EDJE_EXTERNAL_INT_UNSET:
+ return None
+ return self.obj.info.i.step
+
+ def validate(self, value):
+ min = self.min
+ max = self.max
+ if min is not None and value < min:
+ return False
+ if max is not None and value > max:
+ return False
+ return True
+
+
+cdef class ExternalParamInfoDouble(ExternalParamInfo):
+ property default:
+ def __get__(self):
+ if self.obj.info.d.default == EDJE_EXTERNAL_DOUBLE_UNSET:
+ return None
+ return self.obj.info.d.default
+
+ property min:
+ def __get__(self):
+ if self.obj.info.d.min == EDJE_EXTERNAL_DOUBLE_UNSET:
+ return None
+ return self.obj.info.d.min
+
+ property max:
+ def __get__(self):
+ if self.obj.info.d.max == EDJE_EXTERNAL_DOUBLE_UNSET:
+ return None
+ return self.obj.info.d.max
+
+ property step:
+ def __get__(self):
+ if self.obj.info.d.step == EDJE_EXTERNAL_DOUBLE_UNSET:
+ return None
+ return self.obj.info.d.step
+
+ def validate(self, value):
+ min = self.min
+ max = self.max
+ if min is not None and value < min:
+ return False
+ if max is not None and value > max:
+ return False
+ return True
+
+
+cdef class ExternalParamInfoString(ExternalParamInfo):
+ property default:
+ def __get__(self):
+ if self.obj.info.s.default == NULL:
+ return None
+ return self.obj.info.s.default
+
+ property translated_default:
+ def __get__(self):
+ cdef const_char_ptr t
+ if self._external_type_obj == NULL or \
+ self._external_type_obj.translate == NULL:
+ return self.default
+ t = self._external_type_obj.translate(self._external_type_obj.data,
+ self.obj.info.s.default)
+ if t == NULL:
+ return self.default
+ return t
+
+ property accept_format:
+ def __get__(self):
+ if self.obj.info.s.accept_fmt == NULL:
+ return None
+ return self.obj.info.s.accept_fmt
+
+ property deny_format:
+ def __get__(self):
+ if self.obj.info.s.deny_fmt == NULL:
+ return None
+ return self.obj.info.s.deny_fmt
+
+
+cdef class ExternalParamInfoBool(ExternalParamInfo):
+ property default:
+ def __get__(self):
+ return bool(self.obj.info.b.default)
+
+ property false_string:
+ def __get__(self):
+ if self.obj.info.b.false_str == NULL:
+ return None
+ return self.obj.info.b.false_str
+
+ property translated_false_string:
+ def __get__(self):
+ cdef const_char_ptr t
+ if self._external_type_obj == NULL or \
+ self._external_type_obj.translate == NULL:
+ return self.false_string
+ t = self._external_type_obj.translate(self._external_type_obj.data,
+ self.obj.info.b.false_str)
+ if t == NULL:
+ return self.false_string
+ return t
+
+ property true_string:
+ def __get__(self):
+ if self.obj.info.b.true_str == NULL:
+ return None
+ return self.obj.info.b.true_str
+
+ property translated_true_string:
+ def __get__(self):
+ cdef const_char_ptr t
+ if self._external_type_obj == NULL or \
+ self._external_type_obj.translate == NULL:
+ return self.true_string
+ t = self._external_type_obj.translate(self._external_type_obj.data,
+ self.obj.info.b.true_str)
+ if t == NULL:
+ return self.true_string
+ return t
+
+
+cdef class ExternalParamInfoChoice(ExternalParamInfo):
+ property default:
+ def __get__(self):
+ if self.obj.info.c.default == NULL:
+ return None
+ return self.obj.info.c.default
+
+ property translated_default:
+ def __get__(self):
+ cdef const_char_ptr t
+ if self._external_type_obj == NULL or \
+ self._external_type_obj.translate == NULL:
+ return self.default
+ t = self._external_type_obj.translate(self._external_type_obj.data,
+ self.obj.info.c.default)
+ if t == NULL:
+ return self.default
+ return t
+
+ property choices:
+ def __get__(self):
+ cdef int i
+
+ if self.obj.info.c.choices == NULL:
+ return None
+
+ i = 0
+ lst = []
+ while self.obj.info.c.choices[i] != NULL:
+ lst.append(self.obj.info.c.choices[i])
+ i += 1
+ return lst
+
+ property translated_choices:
+ def __get__(self):
+ cdef const_char_ptr t
+ if self._external_type_obj == NULL or \
+ self._external_type_obj.translate == NULL:
+ return self.choices
+
+ orig = self.choices
+ ret = []
+ for choice in orig:
+ ret.append(
+ self._external_type_obj.translate(
+ self._external_type_obj.data, choice) or choice)
+ return ret
+
+
+cdef ExternalParamInfo ExternalParamInfo_from_ptr(type, Edje_External_Param_Info *ptr):
+ cdef ExternalParamInfo p
+ if ptr.type == EDJE_EXTERNAL_PARAM_TYPE_INT:
+ p = ExternalParamInfoInt()
+ elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
+ p = ExternalParamInfoDouble()
+ elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_STRING:
+ p = ExternalParamInfoString()
+ elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_BOOL:
+ p = ExternalParamInfoBool()
+ elif ptr.type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
+ p = ExternalParamInfoChoice()
+ else:
+ msg = "Don't know how to convert parameter %s of type %s" % \
+ (ptr.name, edje_external_param_type_str(ptr.type))
+ warnings.warn(msg, Warning)
+ return None
+ p.obj = ptr
+ p._set_external_type(type)
+ return p
+
+def external_param_info_get(char *type_name):
+ cdef const_Edje_External_Type *ext_type
+ cdef ExternalType t
+
+ warnings.warn("Use ExternalType.parameters_info_get() instead!",
+ DeprecationWarning)
+
+ ext_type = edje_external_type_get(type_name)
+ if ext_type == NULL:
+ return tuple()
+
+ t = ExternalType()
+ t._name = type_name
+ t._obj = ext_type
+ return t.parameters_info_get()
+
+
+cdef class ExternalType:
+ property name:
+ def __get__(self):
+ return self._name
+
+ property module:
+ def __get__(self):
+ if self._obj.module == NULL:
+ return None
+ return self._obj.module
+
+ property module_name:
+ def __get__(self):
+ if self._obj.module_name == NULL:
+ return None
+ return self._obj.module_name
+
+ def label_get(self):
+ cdef const_char_ptr l
+ if self._obj.label_get == NULL:
+ return None
+ l = self._obj.label_get(self._obj.data)
+ if l == NULL:
+ return None
+ ret = l
+ return ret
+
+ def description_get(self):
+ cdef const_char_ptr l
+ if self._obj.description_get == NULL:
+ return None
+ l = self._obj.description_get(self._obj.data)
+ if l == NULL:
+ return None
+ ret = l
+ return ret
+
+ def translate(self, char *text):
+ """Used to translate text originated from this module.
+
+ Usually this is only required for static text, like the
+ parameters. label_get() and description_get() may not require
+ it. Note that ExternalParamInfo provides translated_* versions
+ of its worth translating strings!
+
+ It will always return a string, on errors the parameter text
+ is returned untranslated.
+ """
+ cdef const_char_ptr l
+ if self._obj.translate == NULL:
+ return text
+ l = self._obj.translate(self._obj.data, text)
+ if l == NULL:
+ return text
+ return l
+
+ def icon_add(self, Canvas canvas not None):
+ cdef Evas_Object *icon
+ if self._obj.icon_add == NULL:
+ return None
+ icon = self._obj.icon_add(self._obj.data, canvas.obj)
+ if icon == NULL:
+ return None
+ return object_from_instance(icon)
+
+ def preview_add(self, Canvas canvas not None):
+ cdef Evas_Object *preview
+ if self._obj.preview_add == NULL:
+ return None
+ preview = self._obj.preview_add(self._obj.data, canvas.obj)
+ if preview == NULL:
+ return None
+ return object_from_instance(preview)
+
+ def parameters_info_get(self):
+ cdef Edje_External_Param_Info *params
+ cdef int i
+
+ if self._parameters_info:
+ return self._parameters_info
+
+ lst = []
+ params = self._obj.parameters_info
+ if params == NULL:
+ self._parameters_info = tuple()
+
+ i = 0
+ while params[i].name != NULL:
+ lst.append(ExternalParamInfo_from_ptr(self, &params[i]))
+ i += 1
+ self._parameters_info = tuple(lst)
+ return self._parameters_info
+
+ property parameters_info:
+ def __get__(self):
+ return self.parameters_info_get()
+
+
+cdef class ExternalIterator:
+ cdef Eina_Iterator *obj
+
+ def __init__(self):
+ cdef Eina_Iterator *it
+ it = edje_external_iterator_get()
+ self._set_obj(it)
+
+ cdef _set_obj(self, Eina_Iterator *ptr):
+ self.obj = ptr
+
+ def __iter__(self):
+ return self
+
+ def __next__(self):
+ cdef const_Eina_Hash_Tuple *tuple
+ cdef ExternalType t
+ if eina_iterator_next(self.obj, <void **>&tuple):
+ t = ExternalType()
+ t._name = <char*>tuple.key
+ t._obj = <const_Edje_External_Type*>tuple.data
+ return t
+ else:
+ raise StopIteration
+
+ def __del__(self):
+ if self.obj:
+ eina_iterator_free(self.obj)
+
+def external_type_get(char *type_name):
+ "Gets the instance that represents an ExternalType of the given name."
+ cdef const_Edje_External_Type *obj = edje_external_type_get(type_name)
+ cdef ExternalType ret
+ if obj == NULL:
+ return None
+ ret = ExternalType()
+ ret._name = type_name
+ ret._obj = obj
+ return ret
+
diff --git a/efl/edje/efl.edje_message.pxi b/efl/edje/efl.edje_message.pxi
new file mode 100644
index 0000000..1f51f81
--- /dev/null
+++ b/efl/edje/efl.edje_message.pxi
@@ -0,0 +1,375 @@
+# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri
+#
+# This file is part of Python-Edje.
+#
+# Python-Edje 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.1 of the License, or (at your option) any later version.
+#
+# Python-Edje 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 Python-Edje. If not, see <http://www.gnu.org/licenses/>.
+
+
+cdef class Message:
+ """Base class to represent Edje messages.
+
+ @ivar type: message type.
+ @ivar id: message id.
+ """
+ property type:
+ def __get__(self):
+ return self._type
+
+ property id:
+ def __get__(self):
+ return self._id
+
+
+cdef class MessageString(Message):
+ """String message.
+
+ @ivar str: message contents.
+ @ivar val: same as str.
+ """
+ property str:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.str != NULL:
+ return self.obj.str
+
+ property val: # copy from 'str', to make api consistent
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.str != NULL:
+ return self.obj.str
+
+
+cdef class MessageInt(Message):
+ """Integer message.
+
+ @ivar val: message contents.
+ """
+ property val:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.val
+
+
+cdef class MessageFloat(Message):
+ """Float message.
+
+ @ivar val: message contents.
+ """
+ property val:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.val
+
+
+cdef class MessageStringSet(Message):
+ """String set message.
+
+ @ivar val: message contents.
+ """
+ property val:
+ def __get__(self):
+ cdef int i
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ lst = []
+ for i from 0 <= i < self.obj.count:
+ if self.obj.str[i] != NULL:
+ lst.append(self.obj.str[i])
+ return lst
+
+ def __len__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.count
+
+ def __getitem__(self, int index):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if index < 0 or index >= self.obj.count:
+ raise IndexError("list index out of range")
+ return self.obj.str[index]
+
+
+cdef class MessageIntSet(Message):
+ """Integer set message.
+
+ @ivar val: message contents.
+ """
+ property val:
+ def __get__(self):
+ cdef int i
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ lst = []
+ for i from 0 <= i < self.obj.count:
+ lst.append(self.obj.val[i])
+ return lst
+
+ def __len__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.count
+
+ def __getitem__(self, int index):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if index < 0 or index >= self.obj.count:
+ raise IndexError("list index out of range")
+ return self.obj.val[index]
+
+
+cdef class MessageFloatSet(Message):
+ """Float set message.
+
+ @ivar val: message contents.
+ """
+ property val:
+ def __get__(self):
+ cdef int i
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ lst = []
+ for i from 0 <= i < self.obj.count:
+ lst.append(self.obj.val[i])
+ return lst
+
+ def __len__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.count
+
+ def __getitem__(self, int index):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if index < 0 or index >= self.obj.count:
+ raise IndexError("list index out of range")
+ return self.obj.val[index]
+
+
+cdef class MessageStringInt(Message):
+ """String + Integer message.
+
+ @ivar str: string.
+ @ivar val: integer.
+ """
+ property str:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.str != NULL:
+ return self.obj.str
+
+ property val:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.val
+
+
+cdef class MessageStringFloat(Message):
+ """String + float message.
+
+ @ivar str: string.
+ @ivar val: float.
+ """
+ property str:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.str != NULL:
+ return self.obj.str
+
+ property val:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.val
+
+
+cdef class MessageStringIntSet(Message):
+ """String + Integer set message.
+
+ @ivar str: string.
+ @ivar val: integer list.
+ """
+ property str:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.str != NULL:
+ return self.obj.str
+
+ property val:
+ def __get__(self):
+ cdef int i
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ lst = []
+ for i from 0 <= i < self.obj.count:
+ lst.append(self.obj.val[i])
+ return lst
+
+ def __len__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.count
+
+ def __getitem__(self, int index):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if index < 0 or index >= self.obj.count:
+ raise IndexError("list index out of range")
+ return self.obj.val[index]
+
+
+cdef class MessageStringFloatSet(Message):
+ """String + Float set message.
+
+ @ivar str: string.
+ @ivar val: float list.
+ """
+ property str:
+ def __get__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if self.obj.str != NULL:
+ return self.obj.str
+
+ property val:
+ def __get__(self):
+ cdef int i
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ lst = []
+ for i from 0 <= i < self.obj.count:
+ lst.append(self.obj.val[i])
+ return lst
+
+ def __len__(self):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ return self.obj.count
+
+ def __getitem__(self, int index):
+ if self.obj == NULL:
+ raise ValueError("Object uninitialized")
+ if index < 0 or index >= self.obj.count:
+ raise IndexError("list index out of range")
+ return self.obj.val[index]
+
+
+cdef Message MessageString_from_ptr(void *msg):
+ cdef MessageString m
+ m = MessageString()
+ m.obj = <Edje_Message_String*>msg
+ return m
+
+
+cdef Message MessageInt_from_ptr(void *msg):
+ cdef MessageInt m
+ m = MessageInt()
+ m.obj = <Edje_Message_Int*>msg
+ return m
+
+
+cdef Message MessageFloat_from_ptr(void *msg):
+ cdef MessageFloat m
+ m = MessageFloat()
+ m.obj = <Edje_Message_Float*>msg
+ return m
+
+
+cdef Message MessageStringSet_from_ptr(void *msg):
+ cdef MessageStringSet m
+ m = MessageStringSet()
+ m.obj = <Edje_Message_String_Set*>msg
+ return m
+
+
+cdef Message MessageIntSet_from_ptr(void *msg):
+ cdef MessageIntSet m
+ m = MessageIntSet()
+ m.obj = <Edje_Message_Int_Set*>msg
+ return m
+
+
+cdef Message MessageFloatSet_from_ptr(void *msg):
+ cdef MessageFloatSet m
+ m = MessageFloatSet()
+ m.obj = <Edje_Message_Float_Set*>msg
+ return m
+
+
+cdef Message MessageStringInt_from_ptr(void *msg):
+ cdef MessageStringInt m
+ m = MessageStringInt()
+ m.obj = <Edje_Message_String_Int*>msg
+ return m
+
+
+cdef Message MessageStringFloat_from_ptr(void *msg):
+ cdef MessageStringFloat m
+ m = MessageStringFloat()
+ m.obj = <Edje_Message_String_Float*>msg
+ return m
+
+
+cdef Message MessageStringIntSet_from_ptr(void *msg):
+ cdef MessageStringIntSet m
+ m = MessageStringIntSet()
+ m.obj = <Edje_Message_String_Int_Set*>msg
+ return m
+
+
+cdef Message MessageStringFloatSet_from_ptr(void *msg):
+ cdef MessageStringFloatSet m
+ m = MessageStringFloatSet()
+ m.obj = <Edje_Message_String_Float_Set*>msg
+ return m
+
+
+cdef Message Message_from_type(Edje_Message_Type type, int id, void *msg):
+ cdef Message m
+ if type == EDJE_MESSAGE_NONE:
+ return None
+ elif type == EDJE_MESSAGE_SIGNAL:
+ m = MessageSignal()
+ elif type == EDJE_MESSAGE_STRING:
+ m = MessageString_from_ptr(msg)
+ elif type == EDJE_MESSAGE_INT:
+ m = MessageInt_from_ptr(msg)
+ elif type == EDJE_MESSAGE_FLOAT:
+ m = MessageFloat_from_ptr(msg)
+ elif type == EDJE_MESSAGE_STRING_SET:
+ m = MessageStringSet_from_ptr(msg)
+ elif type == EDJE_MESSAGE_INT_SET:
+ m = MessageIntSet_from_ptr(msg)
+ elif type == EDJE_MESSAGE_FLOAT_SET:
+ m = MessageFloatSet_from_ptr(msg)
+ elif type == EDJE_MESSAGE_STRING_INT:
+ m = MessageStringInt_from_ptr(msg)
+ elif type == EDJE_MESSAGE_STRING_FLOAT:
+ m = MessageStringFloat_from_ptr(msg)
+ elif type == EDJE_MESSAGE_STRING_INT_SET :
+ m = MessageStringIntSet_from_ptr(msg)
+ elif type == EDJE_MESSAGE_STRING_FLOAT_SET :
+ m = MessageStringFloatSet_from_ptr(msg)
+
+ m._type = type
+ m._id = id
+ return m
diff --git a/efl/edje/efl.edje_object.pxi b/efl/edje/efl.edje_object.pxi
new file mode 100644
index 0000000..816a3eb
--- /dev/null
+++ b/efl/edje/efl.edje_object.pxi
@@ -0,0 +1,689 @@
+# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri, Ulisses Furquim
+#
+# This file is part of Python-Edje.
+#
+# Python-Edje 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.1 of the License, or (at your option) any later version.
+#
+# Python-Edje 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 Python-Edje. If not, see <http://www.gnu.org/licenses/>.
+
+
+cdef void text_change_cb(void *data,
+ Evas_Object *obj,
+ const_char_ptr part) with gil:
+ cdef Edje self
+ self = <Edje>data
+ if self._text_change_cb is None:
+ return
+ func, args, kargs = self._text_change_cb
+ try:
+ func(self, _ctouni(part), *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+
+
+cdef void message_handler_cb(void *data,
+ Evas_Object *obj,
+ Edje_Message_Type type,
+ int id, void *msg) with gil:
+ cdef Edje self
+ self = <Edje>data
+ if self._message_handler_cb is None:
+ return
+ func, args, kargs = self._message_handler_cb
+ try:
+ func(self, Message_from_type(type, id, msg), *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+
+
+cdef void signal_cb(void *data, Evas_Object *obj,
+ const_char_ptr emission, const_char_ptr source) with gil:
+ cdef Edje self
+ self = object_from_instance(obj)
+ lst = tuple(<object>data)
+ for func, args, kargs in lst:
+ try:
+ func(self, _ctouni(emission), _ctouni(source), *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+
+
+class EdjeLoadError(Exception):
+ def __init__(self, int code, char *file, char *group):
+ if code == EDJE_LOAD_ERROR_NONE:
+ msg = "No error"
+ elif code == EDJE_LOAD_ERROR_GENERIC:
+ msg = "Generic error"
+ elif code == EDJE_LOAD_ERROR_DOES_NOT_EXIST:
+ msg = "Does not exist"
+ elif code == EDJE_LOAD_ERROR_PERMISSION_DENIED:
+ msg = "Permission denied"
+ elif code == EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED:
+ msg = "Resource allocation failed"
+ elif code == EDJE_LOAD_ERROR_CORRUPT_FILE:
+ msg = "Corrupt file"
+ elif code == EDJE_LOAD_ERROR_UNKNOWN_FORMAT:
+ msg = "Unknown format"
+ elif code == EDJE_LOAD_ERROR_INCOMPATIBLE_FILE:
+ msg = "Incompatible file"
+ elif code == EDJE_LOAD_ERROR_UNKNOWN_COLLECTION:
+ msg = "Unknown collection"
+
+ self.code = code
+ self.file = file
+ self.group = group
+ Exception.__init__(self, "%s (file=%r, group=%r)" % (msg, file, group))
+
+
+cdef class Edje(Object):
+ def __cinit__(self, *a, **ka):
+ self._signal_callbacks = {}
+
+ def __init__(self, Canvas canvas not None, **kargs):
+ self._set_obj(edje_object_add(canvas.obj))
+ self._set_common_params(**kargs)
+
+ def __free_wrapper_resources(self, ed):
+ self._signal_callbacks.clear()
+ self._text_change_cb = None
+ self._message_handler_cb = None
+
+ def _set_common_params(self, file=None, group=None, size=None, pos=None,
+ geometry=None, color=None, name=None):
+ if file:
+ self.file_set(file, group)
+ Object._set_common_params(self, size=size, pos=pos, geometry=geometry,
+ color=color, name=name)
+ if not size and not geometry:
+ w, h = self.size_min_get()
+ self.size_set(w, h)
+
+ def __str__(self):
+ x, y, w, h = self.geometry_get()
+ r, g, b, a = self.color_get()
+ file, group = self.file_get()
+ name = self.name_get()
+ if name:
+ name_str = "name=%r, "
+ else:
+ name_str = ""
+ clip = bool(self.clip_get() is not None)
+ return ("%s(%sfile=%r, group=%r, geometry=(%d, %d, %d, %d), "
+ "color=(%d, %d, %d, %d), layer=%s, clip=%s, visible=%s)") % \
+ (self.__class__.__name__, name_str, file, group, x, y, w, h,
+ r, g, b, a, self.layer_get(), clip, self.visible_get())
+
+ def __repr__(self):
+ x, y, w, h = self.geometry_get()
+ r, g, b, a = self.color_get()
+ file, group = self.file_get()
+ clip = bool(self.clip_get() is not None)
+ return ("%s(name=%r, file=%r, group=%r, geometry=(%d, %d, %d, %d), "
+ "color=(%d, %d, %d, %d), layer=%s, clip=%r, visible=%s)") % \
+ (self.__class__.__name__, self.name_get(), file, group,
+ x, y, w, h, r, g, b, a,
+ self.layer_get(), clip, self.visible_get())
+
+ def data_get(self, key):
+ return _ctouni(edje_object_data_get(self.obj, _cfruni(key)))
+
+ def file_set(self, file, group):
+ if edje_object_file_set(self.obj, _cfruni(file), _cfruni(group)) == 0:
+ raise EdjeLoadError(edje_object_load_error_get(self.obj),
+ _cfruni(file), _cfruni(group))
+
+ def file_get(self):
+ cdef const_char_ptr file, group
+ edje_object_file_get(self.obj, &file, &group)
+ return (_ctouni(file), _ctouni(group))
+
+ def load_error_get(self):
+ return edje_object_load_error_get(self.obj)
+
+ def play_get(self):
+ return bool(edje_object_play_get(self.obj))
+
+ def play_set(self, int value):
+ edje_object_play_set(self.obj, value)
+
+ property play:
+ def __get__(self):
+ return self.play_get()
+
+ def __set__(self, int value):
+ self.play_set(value)
+
+ def animation_get(self):
+ return bool(edje_object_animation_get(self.obj))
+
+ def animation_set(self, int value):
+ edje_object_animation_set(self.obj, value)
+
+ property animation:
+ def __get__(self):
+ return self.animation_get()
+
+ def __set__(self, int value):
+ self.animation_set(value)
+
+ def freeze(self):
+ return edje_object_freeze(self.obj)
+
+ def thaw(self):
+ return edje_object_thaw(self.obj)
+
+ def color_class_set(self, color_class,
+ int r, int g, int b, int a,
+ int r2, int g2, int b2, int a2,
+ int r3, int g3, int b3, int a3):
+ edje_object_color_class_set(self.obj, _cfruni(color_class),
+ r, g, b, a,
+ r2, g2, b2, a2,
+ r3, g3, b3, a3)
+
+ def color_class_get(self, color_class):
+ cdef int r, g, b, a
+ cdef int r2, g2, b2, a2
+ cdef int r3, g3, b3, a3
+ edje_object_color_class_get(self.obj, _cfruni(color_class),
+ &r, &g, &b, &a,
+ &r2, &g2, &b2, &a2,
+ &r3, &g3, &b3, &a3)
+ return (r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3)
+
+ def color_class_del(self, color_class):
+ edje_object_color_class_del(self.obj, _cfruni(color_class))
+
+ def text_class_set(self, text_class, font, int size):
+ edje_object_text_class_set(self.obj, _cfruni(text_class),
+ _cfruni(font), size)
+
+ def size_min_get(self):
+ cdef int w, h
+ edje_object_size_min_get(self.obj, &w, &h)
+ return (w, h)
+
+ property size_min:
+ def __get__(self):
+ return self.size_min_get()
+
+ def size_max_get(self):
+ cdef int w, h
+ edje_object_size_max_get(self.obj, &w, &h)
+ return (w, h)
+
+ property size_max:
+ def __get__(self):
+ return self.size_max_get()
+
+ def calc_force(self):
+ edje_object_calc_force(self.obj)
+
+ def size_min_calc(self):
+ cdef int w, h
+ edje_object_size_min_calc(self.obj, &w, &h)
+ return (w, h)
+
+ def parts_extends_calc(self):
+ cdef int x, y, w, h
+ edje_object_parts_extends_calc(self.obj, &x, &y, &w, &h)
+ return (x, y, w, h)
+
+ def part_exists(self, part):
+ return bool(edje_object_part_exists(self.obj, _cfruni(part)))
+
+ def part_object_get(self, part):
+ return object_from_instance(edje_object_part_object_get(self.obj,
+ _cfruni(part)))
+
+ def part_geometry_get(self, part):
+ cdef int x, y, w, h
+ edje_object_part_geometry_get(self.obj, _cfruni(part), &x, &y, &w, &h)
+ return (x, y, w, h)
+
+ def part_size_get(self, part):
+ cdef int w, h
+ edje_object_part_geometry_get(self.obj, _cfruni(part), NULL, NULL, &w, &h)
+ return (w, h)
+
+ def part_pos_get(self, part):
+ cdef int x, y
+ edje_object_part_geometry_get(self.obj, _cfruni(part), &x, &y, NULL, NULL)
+ return (x, y)
+
+ def text_change_cb_set(self, func, *args, **kargs):
+ if func is None:
+ self._text_change_cb = None
+ edje_object_text_change_cb_set(self.obj, NULL, NULL)
+ elif callable(func):
+ self._text_change_cb = (func, args, kargs)
+ edje_object_text_change_cb_set(self.obj, text_change_cb, <void*>self)
+ else:
+ raise TypeError("func must be callable or None")
+
+ def part_text_set(self, part, text):
+ edje_object_part_text_set(self.obj, _cfruni(part), _cfruni(text))
+
+ def part_text_get(self, part):
+ cdef const_char_ptr s
+ return _ctouni(edje_object_part_text_get(self.obj, _cfruni(part)))
+
+
+ def part_text_select_all(self, part):
+ edje_object_part_text_select_all(self.obj, _cfruni(part))
+
+ def part_text_select_none(self, part):
+ edje_object_part_text_select_none(self.obj, _cfruni(part))
+
+ def part_text_unescaped_set(self, part, text_to_escape):
+ edje_object_part_text_unescaped_set(self.obj, _cfruni(part),
+ _cfruni(text_to_escape))
+
+ def part_text_unescaped_get(self, part):
+ cdef char *s
+ s = edje_object_part_text_unescaped_get(self.obj, _cfruni(part))
+ if s == NULL:
+ return None
+ else:
+ str = _touni(s)
+ libc.stdlib.free(s)
+ return str
+
+ def part_swallow(self, part, Object obj):
+ edje_object_part_swallow(self.obj, _cfruni(part), obj.obj)
+
+ def part_unswallow(self, Object obj):
+ edje_object_part_unswallow(self.obj, obj.obj)
+
+ def part_swallow_get(self, part):
+ return object_from_instance(edje_object_part_swallow_get(self.obj,
+ _cfruni(part)))
+
+ def part_external_object_get(self, part):
+ return object_from_instance(edje_object_part_external_object_get(self.obj,
+ _cfruni(part)))
+
+ def part_external_param_set(self, char *part, char *param, value):
+ cdef Edje_External_Param p
+ cdef Edje_External_Param_Type t
+
+ p.name = param
+ if isinstance(value, bool): # bool is int, so keep it before!
+ p.type = EDJE_EXTERNAL_PARAM_TYPE_BOOL
+ p.i = value
+ elif isinstance(value, int):
+ p.type = EDJE_EXTERNAL_PARAM_TYPE_INT
+ p.i = value
+ elif isinstance(value, float):
+ p.type = EDJE_EXTERNAL_PARAM_TYPE_DOUBLE
+ p.d = value
+ elif isinstance(value, (str, unicode)):
+ # may be STRING or CHOICE
+ p.type = edje_object_part_external_param_type_get(
+ self.obj, part, param)
+
+ if isinstance(value, unicode):
+ value = value.encode("utf-8")
+ p.s = value
+ else:
+ raise TypeError("unsupported type %s" % type(value).__name__)
+ return bool(edje_object_part_external_param_set(self.obj, part, &p))
+
+ def part_external_param_get(self, char *part, char *param):
+ cdef Edje_External_Param p
+ cdef Edje_External_Param_Type t
+
+ t = edje_object_part_external_param_type_get(self.obj, part, param)
+ if t == EDJE_EXTERNAL_PARAM_TYPE_MAX:
+ return None
+
+ p.name = param
+ p.type = t
+ if not edje_object_part_external_param_get(self.obj, part, &p):
+ return None
+ if t == EDJE_EXTERNAL_PARAM_TYPE_BOOL:
+ return bool(p.i)
+ elif t == EDJE_EXTERNAL_PARAM_TYPE_INT:
+ return p.i
+ elif t == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
+ return p.d
+ elif t == EDJE_EXTERNAL_PARAM_TYPE_STRING:
+ if p.s == NULL:
+ return ""
+ return p.s
+ elif t == EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
+ if p.s == NULL:
+ return ""
+ return p.s
+
+ def part_box_append(self, part, Object obj):
+ return bool(edje_object_part_box_append(self.obj, _cfruni(part), obj.obj))
+
+ def part_box_prepend(self, part, Object obj):
+ return bool(edje_object_part_box_prepend(self.obj, _cfruni(part), obj.obj))
+
+ def part_box_insert_at(self, part, Object obj,
+ unsigned int pos):
+ return bool(edje_object_part_box_insert_at(self.obj, _cfruni(part),
+ obj.obj, pos))
+
+ def part_box_insert_before(self, part, Object obj, Object reference):
+ return bool(edje_object_part_box_insert_before(self.obj, _cfruni(part),
+ obj.obj, reference.obj))
+
+ def part_box_remove(self, part, Object obj):
+ return object_from_instance(edje_object_part_box_remove(self.obj,
+ _cfruni(part), obj.obj))
+
+ def part_box_remove_at(self, part, unsigned int pos):
+ return object_from_instance(edje_object_part_box_remove_at(self.obj,
+ _cfruni(part), pos))
+
+ def part_box_remove_all(self, part, int clear):
+ return bool(edje_object_part_box_remove_all(self.obj,
+ _cfruni(part), clear))
+
+ def part_table_pack(self, part, Object child, short col, short row, short colspan, short rowspan):
+ return bool(edje_object_part_table_pack(self.obj, _cfruni(part),
+ child.obj, col, row, colspan, rowspan))
+
+ def part_table_unpack(self, part, Object child):
+ return bool(edje_object_part_table_unpack(self.obj, _cfruni(part),
+ child.obj))
+
+ def part_table_col_row_size_get(self, part):
+ cdef int c, r
+ edje_object_part_table_col_row_size_get(self.obj, _cfruni(part), &c, &r)
+ return (c, r)
+
+ def part_table_clear(self, part, int clear):
+ return bool(edje_object_part_table_clear(self.obj, _cfruni(part), clear))
+
+ def part_table_child_get(self, part, int row, int column):
+ return object_from_instance(edje_object_part_table_child_get(self.obj,
+ _cfruni(part), row, column))
+
+ def part_state_get(self, part):
+ cdef double sv
+ cdef const_char_ptr sn
+ sn = edje_object_part_state_get(self.obj, _cfruni(part), &sv)
+ return (_ctouni(sn), sv)
+
+ def part_drag_dir_get(self, part):
+ return edje_object_part_drag_dir_get(self.obj, _cfruni(part))
+
+ def part_drag_value_set(self, part, double dx, double dy):
+ edje_object_part_drag_value_set(self.obj, _cfruni(part), dx, dy)
+
+ def part_drag_value_get(self, part):
+ cdef double dx, dy
+ edje_object_part_drag_value_get(self.obj, _cfruni(part), &dx, &dy)
+ return (dx, dy)
+
+ def part_drag_size_set(self, part, double dw, double dh):
+ edje_object_part_drag_size_set(self.obj, _cfruni(part), dw, dh)
+
+ def part_drag_size_get(self, part):
+ cdef double dw, dh
+ edje_object_part_drag_size_get(self.obj, _cfruni(part), &dw, &dh)
+ return (dw, dh)
+
+ def part_drag_step_set(self, part, double dx, double dy):
+ edje_object_part_drag_step_set(self.obj, _cfruni(part), dx, dy)
+
+ def part_drag_step_get(self, part):
+ cdef double dx, dy
+ edje_object_part_drag_step_get(self.obj, _cfruni(part), &dx, &dy)
+ return (dx, dy)
+
+ def part_drag_step(self, part, double dx, double dy):
+ edje_object_part_drag_step(self.obj, _cfruni(part), dx, dy)
+
+ def part_drag_page_set(self, part, double dx, double dy):
+ edje_object_part_drag_page_set(self.obj, _cfruni(part), dx, dy)
+
+ def part_drag_page_get(self, part):
+ cdef double dx, dy
+ edje_object_part_drag_page_get(self.obj, _cfruni(part), &dx, &dy)
+ return (dx, dy)
+
+ def part_drag_page(self, part, double dx, double dy):
+ edje_object_part_drag_page(self.obj, _cfruni(part), dx, dy)
+
+ cdef void message_send_int(self, int id, int data):
+ cdef Edje_Message_Int m
+ m.val = data
+ edje_object_message_send(self.obj, EDJE_MESSAGE_INT, id, <void*>&m)
+
+ cdef void message_send_float(self, int id, float data):
+ cdef Edje_Message_Float m
+ m.val = data
+ edje_object_message_send(self.obj, EDJE_MESSAGE_FLOAT, id, <void*>&m)
+
+ cdef void message_send_str(self, int id, data):
+ cdef Edje_Message_String m
+ m.str = _fruni(data)
+ edje_object_message_send(self.obj, EDJE_MESSAGE_STRING, id, <void*>&m)
+
+ cdef void message_send_str_set(self, int id, data):
+ cdef int count, i
+ cdef Edje_Message_String_Set *m
+
+ count = len(data)
+ m = <Edje_Message_String_Set*>PyMem_Malloc(
+ sizeof(Edje_Message_String_Set) + (count - 1) * sizeof(char *))
+
+ m.count = count
+ i = 0
+ for s in data:
+ m.str[i] = s
+ i = i + 1
+
+ edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_SET, id,
+ <void*>m)
+ PyMem_Free(m)
+
+ cdef void message_send_str_int(self, int id, s, int i):
+ cdef Edje_Message_String_Int m
+ m.str = _fruni(s)
+ m.val = i
+ edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_INT, id,
+ <void*>&m)
+
+ cdef void message_send_str_float(self, int id, s, float f):
+ cdef Edje_Message_String_Float m
+ m.str = _fruni(s)
+ m.val = f
+ edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_FLOAT, id,
+ <void*>&m)
+
+ cdef void message_send_str_int_set(self, int id, s, data):
+ cdef int count, i
+ cdef Edje_Message_String_Int_Set *m
+
+ count = len(data)
+ m = <Edje_Message_String_Int_Set*>PyMem_Malloc(
+ sizeof(Edje_Message_String_Int_Set) + (count - 1) * sizeof(int))
+
+ m.str = _fruni(s)
+ m.count = count
+ i = 0
+ for f in data:
+ m.val[i] = f
+ i = i + 1
+
+ edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_INT_SET, id,
+ <void*>m)
+ PyMem_Free(m)
+
+ cdef void message_send_str_float_set(self, int id, s, data):
+ cdef int count, i
+ cdef Edje_Message_String_Float_Set *m
+
+ count = len(data)
+ m = <Edje_Message_String_Float_Set*>PyMem_Malloc(
+ sizeof(Edje_Message_String_Float_Set) +
+ (count - 1) * sizeof(double))
+
+ m.str = _fruni(s)
+ m.count = count
+ i = 0
+ for f in data:
+ m.val[i] = f
+ i = i + 1
+
+ edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_FLOAT_SET, id,
+ <void*>m)
+ PyMem_Free(m)
+
+ cdef void message_send_int_set(self, int id, data):
+ cdef int count, i
+ cdef Edje_Message_Int_Set *m
+
+ count = len(data)
+ m = <Edje_Message_Int_Set*>PyMem_Malloc(
+ sizeof(Edje_Message_Int_Set) + (count - 1) * sizeof(int))
+
+ m.count = count
+ i = 0
+ for f in data:
+ m.val[i] = f
+ i = i + 1
+
+ edje_object_message_send(self.obj, EDJE_MESSAGE_INT_SET, id,
+ <void*>m)
+ PyMem_Free(m)
+
+ cdef void message_send_float_set(self, int id, data):
+ cdef int count, i
+ cdef Edje_Message_Float_Set *m
+
+ count = len(data)
+ m = <Edje_Message_Float_Set*>PyMem_Malloc(
+ sizeof(Edje_Message_Float_Set) + (count - 1) * sizeof(double))
+
+ m.count = count
+ i = 0
+ for f in data:
+ m.val[i] = f
+ i = i + 1
+
+ edje_object_message_send(self.obj, EDJE_MESSAGE_FLOAT_SET, id,
+ <void*>m)
+ PyMem_Free(m)
+
+ cdef message_send_set(self, int id, data):
+ second_item = data[1]
+ item_type = type(second_item)
+ for e in data[2:]:
+ if type(e) != item_type:
+ raise TypeError("every element of data should be the "
+ "same type '%s'" % item_type.__name__)
+ head = data[0]
+ if isinstance(head, (int, long)):
+ self.message_send_int_set(id, data)
+ elif isinstance(head, float):
+ self.message_send_float_set(id, data)
+ elif isinstance(head, str):
+ if issubclass(item_type, str):
+ self.message_send_str_set(id, data)
+ elif item_type == int or item_type == long:
+ if len(data) == 2:
+ self.message_send_str_int(id, head, second_item)
+ else:
+ self.message_send_str_int_set(id, head, data[2:])
+ elif item_type == float:
+ if len(data) == 2:
+ self.message_send_str_float(id, head, second_item)
+ else:
+ self.message_send_str_float_set(id, head, data[2:])
+
+ def message_send(self, int id, data):
+ if isinstance(data, (long, int)):
+ self.message_send_int(id, data)
+ elif isinstance(data, float):
+ self.message_send_float(id, data)
+ elif isinstance(data, str):
+ self.message_send_str(id, data)
+ elif isinstance(data, (tuple, list)):
+ if len(data) < 1:
+ return
+ if len(data) < 2:
+ self.message_send(id, data[0])
+ return
+
+ if not isinstance(data[0], (long, int, float, str)):
+ raise TypeError("invalid message list type '%s'" %
+ type(data[0]).__name__)
+
+ self.message_send_set(id, data)
+ else:
+ raise TypeError("invalid message type '%s'" % type(data).__name__)
+
+ def message_handler_set(self, func, *args, **kargs):
+ if func is None:
+ self._message_handler_cb = None
+ edje_object_message_handler_set(self.obj, NULL, NULL)
+ elif callable(func):
+ self._message_handler_cb = (func, args, kargs)
+ edje_object_message_handler_set(self.obj, message_handler_cb,
+ <void*>self)
+ else:
+ raise TypeError("func must be callable or None")
+
+ def message_signal_process(self):
+ edje_object_message_signal_process(self.obj)
+
+ def signal_callback_add(self, emission, source, func,
+ *args, **kargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ d = self._signal_callbacks.setdefault(emission, {})
+ lst = d.setdefault(source, [])
+ if not lst:
+ edje_object_signal_callback_add(self.obj, _cfruni(emission),
+ _cfruni(source), signal_cb, <void*>lst)
+ lst.append((func, args, kargs))
+
+ def signal_callback_del(self, emission, source, func):
+ try:
+ d = self._signal_callbacks[emission]
+ lst = d[source]
+ except KeyError:
+ raise ValueError(("function %s not associated with "
+ "emission %r, source %r") %
+ (func, emission, source))
+
+ i = -1
+ for i, (f, a, k) in enumerate(lst):
+ if func == f:
+ break
+ else:
+ raise ValueError(("function %s not associated with "
+ "emission %r, source %r") %
+ (func, emission, source))
+
+ lst.pop(i)
+ if lst:
+ return
+ d.pop(source)
+ if not d:
+ self._signal_callbacks.pop(emission)
+ edje_object_signal_callback_del(self.obj, _cfruni(emission),
+ _cfruni(source), signal_cb)
+
+ def signal_emit(self, emission, source):
+ edje_object_signal_emit(self.obj, _cfruni(emission), _cfruni(source))
+
+
+_object_mapping_register("edje", Edje)
diff --git a/efl/elementary/efl.elementary.pyx b/efl/elementary/efl.elementary.pyx
new file mode 100644
index 0000000..25556fe
--- /dev/null
+++ b/efl/elementary/efl.elementary.pyx
@@ -0,0 +1,610 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+from cpython cimport PyObject, Py_INCREF, Py_DECREF
+from cpython cimport PyMem_Malloc, PyMem_Free
+from cpython cimport bool
+
+from efl.eo cimport _touni, _fruni, _ctouni, _cfruni, PY_REFCOUNT
+from efl.eo cimport object_from_instance, _object_mapping_register
+from efl.eo cimport _strings_to_python, _strings_from_python
+from efl.eo cimport _object_list_to_python
+# from efl.evas cimport Evas_Coord
+
+
+#import evas.c_evas
+# from evas.c_evas import _object_mapping_register
+# from evas.c_evas import _object_mapping_unregister
+import sys
+import traceback
+import logging
+
+
+logging.basicConfig(level=logging.DEBUG)
+log = logging.getLogger("elementary")
+
+
+cdef _METHOD_DEPRECATED(self, replacement=None, message=None):
+ stack = traceback.extract_stack()
+ caller = stack[-1]
+ caller_module, caller_line, caller_name, caller_code = caller
+ if caller_code:
+ msg = "%s:%s %s (class %s) is deprecated." % \
+ (caller_module, caller_line, caller_code,
+ self.__class__.__name__ if self else 'None')
+ else:
+ msg = "%s:%s %s.%s() is deprecated." % \
+ (caller_module, caller_line,
+ self.__class__.__name__ if self else 'None', caller_name)
+ if replacement:
+ msg += " Use %s() instead." % (replacement,)
+ if message:
+ msg += " " + message
+ log.warn(msg)
+
+
+
+ELM_ACTIONSLIDER_NONE = 0
+ELM_ACTIONSLIDER_LEFT = 1 << 0
+ELM_ACTIONSLIDER_CENTER = 1 << 1
+ELM_ACTIONSLIDER_RIGHT = 1 << 2
+ELM_ACTIONSLIDER_ALL = (1 << 3) - 1
+
+ELM_BG_OPTION_CENTER = 0
+ELM_BG_OPTION_SCALE = 1
+ELM_BG_OPTION_STRETCH = 2
+ELM_BG_OPTION_TILE = 3
+ELM_BG_OPTION_LAST = 4
+
+ELM_BOX_LAYOUT_HORIZONTAL = 0
+ELM_BOX_LAYOUT_VERTICAL = 1
+ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL = 2
+ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL = 3
+ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL = 4
+ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL = 5
+ELM_BOX_LAYOUT_FLOW_HORIZONTAL = 6
+ELM_BOX_LAYOUT_FLOW_VERTICAL = 7
+ELM_BOX_LAYOUT_STACK = 8
+
+ELM_BUBBLE_POS_TOP_LEFT = 0
+ELM_BUBBLE_POS_TOP_RIGHT = 1
+ELM_BUBBLE_POS_BOTTOM_LEFT = 2
+ELM_BUBBLE_POS_BOTTOM_RIGHT = 3
+
+ELM_CALENDAR_UNIQUE = 0
+ELM_CALENDAR_DAILY = 1
+ELM_CALENDAR_WEEKLY = 2
+ELM_CALENDAR_MONTHLY = 3
+ELM_CALENDAR_ANNUALLY = 4
+ELM_CALENDAR_LAST_DAY_OF_MONTH = 5
+
+ELM_CALENDAR_SELECT_MODE_DEFAULT = 0
+ELM_CALENDAR_SELECT_MODE_ALWAYS = 1
+ELM_CALENDAR_SELECT_MODE_NONE = 2
+ELM_CALENDAR_SELECT_MODE_ONDEMAND = 3
+
+ELM_CLOCK_EDIT_DEFAULT = 0
+ELM_CLOCK_EDIT_HOUR_DECIMAL = 1 << 0
+ELM_CLOCK_EDIT_HOUR_UNIT = 1 << 1
+ELM_CLOCK_EDIT_MIN_DECIMAL = 1 << 2
+ELM_CLOCK_EDIT_MIN_UNIT = 1 << 3
+ELM_CLOCK_EDIT_SEC_DECIMAL = 1 << 4
+ELM_CLOCK_EDIT_SEC_UNIT = 1 << 5
+ELM_CLOCK_EDIT_ALL = (1 << 6) - 1
+
+ELM_CNP_MODE_MARKUP = 0
+ELM_CNP_MODE_NO_IMAGE = 1
+ELM_CNP_MODE_PLAINTEXT = 2
+
+ELM_COLORSELECTOR_PALETTE = 0
+ELM_COLORSELECTOR_COMPONENTS = 1
+ELM_COLORSELECTOR_BOTH = 2
+
+ELM_CTXPOPUP_DIRECTION_DOWN = 0
+ELM_CTXPOPUP_DIRECTION_RIGHT = 1
+ELM_CTXPOPUP_DIRECTION_LEFT = 2
+ELM_CTXPOPUP_DIRECTION_UP = 3
+ELM_CTXPOPUP_DIRECTION_UNKNOWN = 4
+
+ELM_DATETIME_YEAR = 0
+ELM_DATETIME_MONTH = 1
+ELM_DATETIME_DATE = 2
+ELM_DATETIME_HOUR = 3
+ELM_DATETIME_MINUTE = 4
+ELM_DATETIME_AMPM = 5
+
+ELM_DAY_SUNDAY = 0
+ELM_DAY_MONDAY = 1
+ELM_DAY_TUESDAY = 2
+ELM_DAY_WEDNESDAY = 3
+ELM_DAY_THURSDAY = 4
+ELM_DAY_FRIDAY = 5
+ELM_DAY_SATURDAY = 6
+ELM_DAY_LAST = 7
+
+ELM_DAYSELECTOR_SUN = 0
+ELM_DAYSELECTOR_MON = 1
+ELM_DAYSELECTOR_TUE = 2
+ELM_DAYSELECTOR_WED = 3
+ELM_DAYSELECTOR_THU = 4
+ELM_DAYSELECTOR_FRI = 5
+ELM_DAYSELECTOR_SAT = 6
+
+ELM_FILESELECTOR_LIST = 0
+ELM_FILESELECTOR_GRID = 1
+
+ELM_FLIP_DIRECTION_UP = 0
+ELM_FLIP_DIRECTION_DOWN = 1
+ELM_FLIP_DIRECTION_LEFT = 2
+ELM_FLIP_DIRECTION_RIGHT = 3
+
+ELM_FLIP_INTERACTION_NONE = 0
+ELM_FLIP_INTERACTION_ROTATE = 1
+ELM_FLIP_INTERACTION_CUBE = 2
+ELM_FLIP_INTERACTION_PAGE = 3
+
+ELM_FLIP_ROTATE_Y_CENTER_AXIS = 0
+ELM_FLIP_ROTATE_X_CENTER_AXIS = 1
+ELM_FLIP_ROTATE_XZ_CENTER_AXIS = 2
+ELM_FLIP_ROTATE_YZ_CENTER_AXIS = 3
+ELM_FLIP_CUBE_LEFT = 4
+ELM_FLIP_CUBE_RIGHT = 5
+ELM_FLIP_CUBE_UP = 6
+ELM_FLIP_CUBE_DOWN = 7
+ELM_FLIP_PAGE_LEFT = 8
+ELM_FLIP_PAGE_RIGHT = 9
+ELM_FLIP_PAGE_UP = 10
+ELM_FLIP_PAGE_DOWN = 11
+
+ELM_FOCUS_PREVIOUS = 0
+ELM_FOCUS_NEXT = 1
+
+ELM_GENLIST_ITEM_NONE = 0
+ELM_GENLIST_ITEM_TREE = 1
+ELM_GENLIST_ITEM_GROUP = 2
+ELM_GENLIST_ITEM_MAX = 3
+
+ELM_GENLIST_ITEM_FIELD_ALL = 0
+ELM_GENLIST_ITEM_FIELD_TEXT = 1
+ELM_GENLIST_ITEM_FIELD_CONTENT = 2
+ELM_GENLIST_ITEM_FIELD_STATE = 3
+
+ELM_GENLIST_ITEM_SCROLLTO_NONE = 0
+ELM_GENLIST_ITEM_SCROLLTO_IN = 1
+ELM_GENLIST_ITEM_SCROLLTO_TOP = 2
+ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = 3
+
+ELM_GESTURE_STATE_UNDEFINED = -1
+ELM_GESTURE_STATE_START = 0
+ELM_GESTURE_STATE_MOVE = 1
+ELM_GESTURE_STATE_END = 2
+ELM_GESTURE_STATE_ABORT = 3
+
+ELM_GESTURE_FIRST = 0
+ELM_GESTURE_N_TAPS = 1
+ELM_GESTURE_N_LONG_TAPS = 2
+ELM_GESTURE_N_DOUBLE_TAPS = 3
+ELM_GESTURE_N_TRIPLE_TAPS = 4
+ELM_GESTURE_MOMENTUM = 5
+ELM_GESTURE_N_LINES = 6
+ELM_GESTURE_N_FLICKS = 7
+ELM_GESTURE_ZOOM = 8
+ELM_GESTURE_ROTATE = 9
+
+ELM_HOVER_AXIS_NONE = 0
+ELM_HOVER_AXIS_HORIZONTAL = 1
+ELM_HOVER_AXIS_VERTICAL = 2
+ELM_HOVER_AXIS_BOTH = 3
+
+ELM_ICON_NONE = 0
+ELM_ICON_FILE = 1
+ELM_ICON_STANDARD = 2
+
+ELM_ILLUME_COMMAND_FOCUS_BACK = 0
+ELM_ILLUME_COMMAND_FOCUS_FORWARD = 1
+ELM_ILLUME_COMMAND_FOCUS_HOME = 2
+ELM_ILLUME_COMMAND_CLOSE = 3
+
+ELM_IMAGE_ORIENT_NONE = 0
+ELM_IMAGE_ORIENT_0 = 0
+ELM_IMAGE_ROTATE_90 = 1
+ELM_IMAGE_ROTATE_180 = 2
+ELM_IMAGE_ROTATE_270 = 3
+ELM_IMAGE_FLIP_HORIZONTAL = 4
+ELM_IMAGE_FLIP_VERTICAL = 5
+ELM_IMAGE_FLIP_TRANSPOSE = 6
+ELM_IMAGE_FLIP_TRANSVERSE = 7
+
+ELM_INPUT_PANEL_LANG_AUTOMATIC = 0
+ELM_INPUT_PANEL_LANG_ALPHABET = 1
+
+ELM_INPUT_PANEL_LAYOUT_NORMAL = 0
+ELM_INPUT_PANEL_LAYOUT_NUMBER = 1
+ELM_INPUT_PANEL_LAYOUT_EMAIL = 2
+ELM_INPUT_PANEL_LAYOUT_URL = 3
+ELM_INPUT_PANEL_LAYOUT_PHONENUMBER = 4
+ELM_INPUT_PANEL_LAYOUT_IP = 5
+ELM_INPUT_PANEL_LAYOUT_MONTH = 6
+ELM_INPUT_PANEL_LAYOUT_NUMBERONLY = 7
+ELM_INPUT_PANEL_LAYOUT_INVALID = 8
+ELM_INPUT_PANEL_LAYOUT_HEX = 9
+ELM_INPUT_PANEL_LAYOUT_TERMINAL = 10
+ELM_INPUT_PANEL_LAYOUT_PASSWORD = 11
+
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT = 0
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE = 1
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO = 2
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN = 3
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN = 4
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT = 5
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH = 6
+ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND = 7
+
+ELM_LIST_COMPRESS = 0
+ELM_LIST_SCROLL = 1
+ELM_LIST_LIMIT = 2
+
+ELM_MAP_OVERLAY_TYPE_NONE = 0
+ELM_MAP_OVERLAY_TYPE_DEFAULT = 1
+ELM_MAP_OVERLAY_TYPE_CLASS = 2
+ELM_MAP_OVERLAY_TYPE_GROUP = 3
+ELM_MAP_OVERLAY_TYPE_BUBBLE = 4
+ELM_MAP_OVERLAY_TYPE_ROUTE = 5
+ELM_MAP_OVERLAY_TYPE_LINE = 6
+ELM_MAP_OVERLAY_TYPE_POLYGON = 7
+ELM_MAP_OVERLAY_TYPE_CIRCLE = 8
+ELM_MAP_OVERLAY_TYPE_SCALE = 9
+
+ELM_MAP_ROUTE_METHOD_FASTEST = 0
+ELM_MAP_ROUTE_METHOD_SHORTEST = 1
+ELM_MAP_ROUTE_METHOD_LAST = 2
+
+ELM_MAP_ROUTE_TYPE_MOTOCAR = 0
+ELM_MAP_ROUTE_TYPE_BICYCLE = 1
+ELM_MAP_ROUTE_TYPE_FOOT = 2
+ELM_MAP_ROUTE_TYPE_LAST = 3
+
+ELM_MAP_SOURCE_TYPE_TILE = 0
+ELM_MAP_SOURCE_TYPE_ROUTE = 1
+ELM_MAP_SOURCE_TYPE_NAME = 2
+ELM_MAP_SOURCE_TYPE_LAST = 3
+
+ELM_MAP_ZOOM_MODE_MANUAL = 0
+ELM_MAP_ZOOM_MODE_AUTO_FIT = 1
+ELM_MAP_ZOOM_MODE_AUTO_FILL = 2
+ELM_MAP_ZOOM_MODE_LAST = 3
+
+ELM_NOTIFY_ORIENT_TOP = 0
+ELM_NOTIFY_ORIENT_CENTER = 1
+ELM_NOTIFY_ORIENT_BOTTOM = 2
+ELM_NOTIFY_ORIENT_LEFT = 3
+ELM_NOTIFY_ORIENT_RIGHT = 4
+ELM_NOTIFY_ORIENT_TOP_LEFT = 5
+ELM_NOTIFY_ORIENT_TOP_RIGHT = 6
+ELM_NOTIFY_ORIENT_BOTTOM_LEFT = 7
+ELM_NOTIFY_ORIENT_BOTTOM_RIGHT = 8
+
+ELM_OBJECT_SELECT_MODE_DEFAULT = 0
+ELM_OBJECT_SELECT_MODE_ALWAYS = 1
+ELM_OBJECT_SELECT_MODE_NONE = 2
+ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY = 3
+ELM_OBJECT_SELECT_MODE_MAX = 4
+
+ELM_PANEL_ORIENT_TOP = 0
+ELM_PANEL_ORIENT_BOTTOM = 1
+ELM_PANEL_ORIENT_LEFT = 2
+ELM_PANEL_ORIENT_RIGHT = 3
+
+ELM_PHOTOCAM_ZOOM_MODE_MANUAL = 0
+ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT = 1
+ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL = 2
+ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN = 3
+
+ELM_POLICY_QUIT = 0
+ELM_POLICY_LAST = 1
+
+ELM_POLICY_QUIT_NONE = 0
+ELM_POLICY_QUIT_LAST_WINDOW_CLOSED = 1
+
+ELM_POPUP_ORIENT_TOP = 0
+ELM_POPUP_ORIENT_CENTER = 1
+ELM_POPUP_ORIENT_BOTTOM = 2
+ELM_POPUP_ORIENT_LEFT = 3
+ELM_POPUP_ORIENT_RIGHT = 4
+ELM_POPUP_ORIENT_TOP_LEFT = 5
+ELM_POPUP_ORIENT_TOP_RIGHT = 6
+ELM_POPUP_ORIENT_BOTTOM_LEFT = 7
+ELM_POPUP_ORIENT_BOTTOM_RIGHT = 8
+
+ELM_SCROLLER_POLICY_AUTO = 0
+ELM_SCROLLER_POLICY_ON = 1
+ELM_SCROLLER_POLICY_OFF = 2
+
+ELM_TEXT_FORMAT_PLAIN_UTF8 = 0
+ELM_TEXT_FORMAT_MARKUP_UTF8 = 1
+
+ELM_TOOLBAR_SHRINK_NONE = 0
+ELM_TOOLBAR_SHRINK_HIDE = 1
+ELM_TOOLBAR_SHRINK_SCROLL = 2
+ELM_TOOLBAR_SHRINK_MENU = 3
+ELM_TOOLBAR_SHRINK_EXPAND = 4
+ELM_TOOLBAR_SHRINK_LAST = 5
+
+ELM_WEB_WINDOW_FEATURE_TOOLBAR = 0
+ELM_WEB_WINDOW_FEATURE_STATUSBAR = 1
+ELM_WEB_WINDOW_FEATURE_SCROLLBARS = 2
+ELM_WEB_WINDOW_FEATURE_MENUBAR = 3
+ELM_WEB_WINDOW_FEATURE_LOCATIONBAR = 4
+ELM_WEB_WINDOW_FEATURE_FULLSCREEN = 5
+
+ELM_WEB_ZOOM_MODE_MANUAL = 0
+ELM_WEB_ZOOM_MODE_AUTO_FIT = 1
+ELM_WEB_ZOOM_MODE_AUTO_FILL = 2
+
+ELM_WIN_BASIC = 0
+ELM_WIN_DIALOG_BASIC = 1
+ELM_WIN_DESKTOP = 2
+ELM_WIN_DOCK = 3
+ELM_WIN_TOOLBAR = 4
+ELM_WIN_MENU = 5
+ELM_WIN_UTILITY = 6
+ELM_WIN_SPLASH = 7
+ELM_WIN_DROPDOWN_MENU = 8
+ELM_WIN_POPUP_MENU = 9
+ELM_WIN_TOOLTIP = 10
+ELM_WIN_NOTIFICATION = 11
+ELM_WIN_COMBO = 12
+ELM_WIN_DND = 13
+ELM_WIN_INLINED_IMAGE = 14
+ELM_WIN_SOCKET_IMAGE = 15
+
+ELM_WIN_INDICATOR_UNKNOWN = 0
+ELM_WIN_INDICATOR_HIDE = 1
+ELM_WIN_INDICATOR_SHOW = 2
+
+ELM_WIN_INDICATOR_OPACITY_UNKNOWN = 0
+ELM_WIN_INDICATOR_OPAQUE = 1
+ELM_WIN_INDICATOR_TRANSLUCENT = 2
+ELM_WIN_INDICATOR_TRANSPARENT = 3
+
+ELM_WIN_KEYBOARD_UNKNOWN = 0
+ELM_WIN_KEYBOARD_OFF = 1
+ELM_WIN_KEYBOARD_ON = 2
+ELM_WIN_KEYBOARD_ALPHA = 3
+ELM_WIN_KEYBOARD_NUMERIC = 4
+ELM_WIN_KEYBOARD_PIN = 5
+ELM_WIN_KEYBOARD_PHONE_NUMBER = 6
+ELM_WIN_KEYBOARD_HEX = 7
+ELM_WIN_KEYBOARD_TERMINAL = 8
+ELM_WIN_KEYBOARD_PASSWORD = 9
+ELM_WIN_KEYBOARD_IP = 10
+ELM_WIN_KEYBOARD_HOST = 11
+ELM_WIN_KEYBOARD_FILE = 12
+ELM_WIN_KEYBOARD_URL = 13
+ELM_WIN_KEYBOARD_KEYPAD = 14
+ELM_WIN_KEYBOARD_J2ME = 15
+
+ELM_WRAP_NONE = 0
+ELM_WRAP_CHAR = 1
+ELM_WRAP_WORD = 2
+ELM_WRAP_MIXED = 3
+
+###
+
+ELM_CURSOR_X = "x"
+ELM_CURSOR_ARROW = "arrow"
+ELM_CURSOR_BASED_ARROW_DOWN = "based_arrow_down"
+ELM_CURSOR_BASED_ARROW_UP = "based_arrow_up"
+ELM_CURSOR_BOAT = "boat"
+ELM_CURSOR_BOGOSITY = "bogosity"
+ELM_CURSOR_BOTTOM_LEFT_CORNER = "bottom_left_corner"
+ELM_CURSOR_BOTTOM_RIGHT_CORNER = "bottom_right_corner"
+ELM_CURSOR_BOTTOM_SIDE = "bottom_side"
+ELM_CURSOR_BOTTOM_TEE = "bottom_tee"
+ELM_CURSOR_BOX_SPIRAL = "box_spiral"
+ELM_CURSOR_CENTER_PTR = "center_ptr"
+ELM_CURSOR_CIRCLE = "circle"
+ELM_CURSOR_CLOCK = "clock"
+ELM_CURSOR_COFFEE_MUG = "coffee_mug"
+ELM_CURSOR_CROSS = "cross"
+ELM_CURSOR_CROSS_REVERSE = "cross_reverse"
+ELM_CURSOR_CROSSHAIR = "crosshair"
+ELM_CURSOR_DIAMOND_CROSS = "diamond_cross"
+ELM_CURSOR_DOT = "dot"
+ELM_CURSOR_DOT_BOX_MASK = "dot_box_mask"
+ELM_CURSOR_DOUBLE_ARROW = "double_arrow"
+ELM_CURSOR_DRAFT_LARGE = "draft_large"
+ELM_CURSOR_DRAFT_SMALL = "draft_small"
+ELM_CURSOR_DRAPED_BOX = "draped_box"
+ELM_CURSOR_EXCHANGE = "exchange"
+ELM_CURSOR_FLEUR = "fleur"
+ELM_CURSOR_GOBBLER = "gobbler"
+ELM_CURSOR_GUMBY = "gumby"
+ELM_CURSOR_HAND1 = "hand1"
+ELM_CURSOR_HAND2 = "hand2"
+ELM_CURSOR_HEART = "heart"
+ELM_CURSOR_ICON = "icon"
+ELM_CURSOR_IRON_CROSS = "iron_cross"
+ELM_CURSOR_LEFT_PTR = "left_ptr"
+ELM_CURSOR_LEFT_SIDE = "left_side"
+ELM_CURSOR_LEFT_TEE = "left_tee"
+ELM_CURSOR_LEFTBUTTON = "leftbutton"
+ELM_CURSOR_LL_ANGLE = "ll_angle"
+ELM_CURSOR_LR_ANGLE = "lr_angle"
+ELM_CURSOR_MAN = "man"
+ELM_CURSOR_MIDDLEBUTTON = "middlebutton"
+ELM_CURSOR_MOUSE = "mouse"
+ELM_CURSOR_PENCIL = "pencil"
+ELM_CURSOR_PIRATE = "pirate"
+ELM_CURSOR_PLUS = "plus"
+ELM_CURSOR_QUESTION_ARROW = "question_arrow"
+ELM_CURSOR_RIGHT_PTR = "right_ptr"
+ELM_CURSOR_RIGHT_SIDE = "right_side"
+ELM_CURSOR_RIGHT_TEE = "right_tee"
+ELM_CURSOR_RIGHTBUTTON = "rightbutton"
+ELM_CURSOR_RTL_LOGO = "rtl_logo"
+ELM_CURSOR_SAILBOAT = "sailboat"
+ELM_CURSOR_SB_DOWN_ARROW = "sb_down_arrow"
+ELM_CURSOR_SB_H_DOUBLE_ARROW = "sb_h_double_arrow"
+ELM_CURSOR_SB_LEFT_ARROW = "sb_left_arrow"
+ELM_CURSOR_SB_RIGHT_ARROW = "sb_right_arrow"
+ELM_CURSOR_SB_UP_ARROW = "sb_up_arrow"
+ELM_CURSOR_SB_V_DOUBLE_ARROW = "sb_v_double_arrow"
+ELM_CURSOR_SHUTTLE = "shuttle"
+ELM_CURSOR_SIZING = "sizing"
+ELM_CURSOR_SPIDER = "spider"
+ELM_CURSOR_SPRAYCAN = "spraycan"
+ELM_CURSOR_STAR = "star"
+ELM_CURSOR_TARGET = "target"
+ELM_CURSOR_TCROSS = "tcross"
+ELM_CURSOR_TOP_LEFT_ARROW = "top_left_arrow"
+ELM_CURSOR_TOP_LEFT_CORNER = "top_left_corner"
+ELM_CURSOR_TOP_RIGHT_CORNER = "top_right_corner"
+ELM_CURSOR_TOP_SIDE = "top_side"
+ELM_CURSOR_TOP_TEE = "top_tee"
+ELM_CURSOR_TREK = "trek"
+ELM_CURSOR_UL_ANGLE = "ul_angle"
+ELM_CURSOR_UMBRELLA = "umbrella"
+ELM_CURSOR_UR_ANGLE = "ur_angle"
+ELM_CURSOR_WATCH = "watch"
+ELM_CURSOR_XTERM = "xterm"
+
+
+def init():
+ cdef int argc, i, arg_len
+ cdef char **argv, *arg
+ argc = len(sys.argv)
+ argv = <char **>PyMem_Malloc(argc * sizeof(char *))
+ for i from 0 <= i < argc:
+ arg = _fruni(sys.argv[i])
+ arg_len = len(arg)
+ argv[i] = <char *>PyMem_Malloc(arg_len + 1)
+ memcpy(argv[i], arg, arg_len + 1)
+
+ elm_init(argc, argv)
+
+def shutdown():
+ elm_shutdown()
+
+def run():
+ with nogil:
+ elm_run()
+
+def exit():
+ elm_exit()
+
+def policy_set(policy, value):
+ return elm_policy_set(policy, value)
+
+def policy_get(policy):
+ return elm_policy_get(policy)
+
+def coords_finger_size_adjust(times_w, w, times_h, h):
+ cdef Evas_Coord width
+ cdef Evas_Coord height
+ width = w
+ height = h
+ elm_coords_finger_size_adjust(times_w, &width, times_h, &height)
+
+# class ElementaryObjectMeta(type):
+# def __init__(cls, name, bases, dict_):
+# type.__init__(cls, name, bases, dict_)
+# cls._fetch_evt_callbacks()
+#
+# def _fetch_evt_callbacks(cls):
+# if "__evas_event_callbacks__" in cls.__dict__:
+# return
+#
+# cls.__evas_event_callbacks__ = []
+# append = cls.__evas_event_callbacks__.append
+#
+# for name in dir(cls):
+# val = getattr(cls, name)
+# if not callable(val) or not hasattr(val, "evas_event_callback"):
+# continue
+# evt = getattr(val, "evas_event_callback")
+# append((name, evt))
+
+include "efl.elementary_configuration.pxi"
+include "efl.elementary_need.pxi"
+include "efl.elementary_theme.pxi"
+include "efl.elementary_object.pxi"
+include "efl.elementary_object_item.pxi"
+include "efl.elementary_gesture_layer.pxi"
+include "efl.elementary_layout_class.pxi"
+include "efl.elementary_layout.pxi"
+include "efl.elementary_image.pxi"
+include "efl.elementary_button.pxi"
+include "efl.elementary_window.pxi"
+include "efl.elementary_innerwindow.pxi"
+include "efl.elementary_background.pxi"
+include "efl.elementary_icon.pxi"
+include "efl.elementary_box.pxi"
+include "efl.elementary_frame.pxi"
+include "efl.elementary_flip.pxi"
+include "efl.elementary_scroller.pxi"
+include "efl.elementary_label.pxi"
+include "efl.elementary_table.pxi"
+include "efl.elementary_clock.pxi"
+include "efl.elementary_hover.pxi"
+include "efl.elementary_entry.pxi"
+include "efl.elementary_bubble.pxi"
+include "efl.elementary_photo.pxi"
+include "efl.elementary_hoversel.pxi"
+include "efl.elementary_toolbar.pxi"
+include "efl.elementary_list.pxi"
+include "efl.elementary_slider.pxi"
+include "efl.elementary_naviframe.pxi"
+include "efl.elementary_radio.pxi"
+include "efl.elementary_check.pxi"
+include "efl.elementary_genlist.pxi"
+include "efl.elementary_gengrid.pxi"
+include "efl.elementary_spinner.pxi"
+include "efl.elementary_notify.pxi"
+include "efl.elementary_fileselector.pxi"
+include "efl.elementary_fileselector_entry.pxi"
+include "efl.elementary_fileselector_button.pxi"
+include "efl.elementary_separator.pxi"
+include "efl.elementary_progressbar.pxi"
+include "efl.elementary_menu.pxi"
+include "efl.elementary_panel.pxi"
+include "efl.elementary_web.pxi"
+include "efl.elementary_actionslider.pxi"
+include "efl.elementary_calendar.pxi"
+include "efl.elementary_colorselector.pxi"
+include "efl.elementary_index.pxi"
+include "efl.elementary_ctxpopup.pxi"
+include "efl.elementary_grid.pxi"
+include "efl.elementary_video.pxi"
+include "efl.elementary_conformant.pxi"
+include "efl.elementary_dayselector.pxi"
+include "efl.elementary_panes.pxi"
+include "efl.elementary_thumb.pxi"
+include "efl.elementary_diskselector.pxi"
+include "efl.elementary_datetime.pxi"
+include "efl.elementary_map.pxi"
+include "efl.elementary_mapbuf.pxi"
+include "efl.elementary_multibuttonentry.pxi"
+include "efl.elementary_transit.pxi"
+include "efl.elementary_slideshow.pxi"
+include "efl.elementary_segment_control.pxi"
+include "efl.elementary_popup.pxi"
+include "efl.elementary_plug.pxi"
+include "efl.elementary_photocam.pxi"
+include "efl.elementary_flipselector.pxi"
diff --git a/efl/elementary/efl.elementary_actionslider.pxi b/efl/elementary/efl.elementary_actionslider.pxi
new file mode 100644
index 0000000..98b196e
--- /dev/null
+++ b/efl/elementary/efl.elementary_actionslider.pxi
@@ -0,0 +1,80 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Actionslider(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_actionslider_add(parent.obj))
+
+ def selected_label_get(self):
+ return elm_actionslider_selected_label_get(self.obj)
+
+ property selected_label:
+ def __get__(self):
+ return elm_actionslider_selected_label_get(self.obj)
+
+ def indicator_pos_set(self, pos):
+ elm_actionslider_indicator_pos_set(self.obj, pos)
+
+ def indicator_pos_get(self):
+ return elm_actionslider_indicator_pos_get(self.obj)
+
+ property indicator_pos:
+ def __get__(self):
+ return elm_actionslider_indicator_pos_get(self.obj)
+ def __set__(self, pos):
+ elm_actionslider_indicator_pos_set(self.obj, pos)
+
+ def magnet_pos_set(self, pos):
+ elm_actionslider_magnet_pos_set(self.obj, pos)
+
+ def magnet_pos_get(self):
+ return elm_actionslider_magnet_pos_get(self.obj)
+
+ property magnet_pos:
+ def __get__(self):
+ return self.magnet_pos_get()
+ def __set__(self, pos):
+ self.magnet_pos_set(pos)
+
+ def enabled_pos_set(self, pos):
+ elm_actionslider_enabled_pos_set(self.obj, pos)
+
+ def enabled_pos_get(self):
+ return elm_actionslider_enabled_pos_get(self.obj)
+
+ property enabled_pos:
+ def __get__(self):
+ return elm_actionslider_enabled_pos_get(self.obj)
+ def __set__(self, pos):
+ elm_actionslider_enabled_pos_set(self.obj, pos)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_string_conv, func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_string_conv, func)
+
+ def callback_pos_changed_add(self, func, *args, **kwargs):
+ self._callback_add_full("pos_changed", _cb_string_conv, func, *args, **kwargs)
+
+ def callback_pos_changed_del(self, func):
+ self._callback_del_full("pos_changed", _cb_string_conv, func)
+
+
+_object_mapping_register("elm_actionslider", Actionslider)
diff --git a/efl/elementary/efl.elementary_background.pxi b/efl/elementary/efl.elementary_background.pxi
new file mode 100644
index 0000000..f283157
--- /dev/null
+++ b/efl/elementary/efl.elementary_background.pxi
@@ -0,0 +1,98 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Background(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_bg_add(parent.obj))
+
+ def file_set(self, filename, group = ""):
+ return bool(elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group)))
+
+ def file_get(self):
+ cdef const_char_ptr filename, group
+
+ elm_bg_file_get(self.obj, &filename, &group)
+ if filename == NULL:
+ filename = ""
+ if group == NULL:
+ group = ""
+ return (_ctouni(filename), _ctouni(group))
+
+ property file:
+ def __get__(self):
+ cdef const_char_ptr filename, group
+ elm_bg_file_get(self.obj, &filename, &group)
+ if filename == NULL:
+ filename = ""
+ if group == NULL:
+ group = ""
+ return (_ctouni(filename), _ctouni(group))
+
+ def __set__(self, value):
+ if isinstance(value, tuple) or isinstance(value, list):
+ filename, group = value
+ else:
+ filename = value
+ group = ""
+ elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ def option_set(self, option):
+ elm_bg_option_set(self.obj, option)
+
+ def option_get(self):
+ return elm_bg_option_get(self.obj)
+
+ property option:
+ def __get__(self):
+ return elm_bg_option_get(self.obj)
+
+ def __set__(self, value):
+ elm_bg_option_set(self.obj, value)
+
+ def color_set(self, r, g, b):
+ elm_bg_color_set(self.obj, r, g, b)
+
+ def color_get(self):
+ cdef int r, g, b
+
+ elm_bg_color_get(self.obj, &r, &g, &b)
+ return (r, g, b)
+
+ property color:
+ def __get__(self):
+ cdef int r, g, b
+ elm_bg_color_get(self.obj, &r, &g, &b)
+ return (r, g, b)
+
+ def __set__(self, value):
+ cdef int r, g, b
+ r, g, b = value
+ elm_bg_color_set(self.obj, r, g, b)
+
+ def load_size_set(self, w, h):
+ elm_bg_load_size_set(self.obj, w, h)
+
+ property load_size:
+ def __set__(self, value):
+ cdef Evas_Coord w, h
+ w, h = value
+ elm_bg_load_size_set(self.obj, w, h)
+
+
+_object_mapping_register("elm_bg", Background)
diff --git a/efl/elementary/efl.elementary_box.pxi b/efl/elementary/efl.elementary_box.pxi
new file mode 100644
index 0000000..d3cb96b
--- /dev/null
+++ b/efl/elementary/efl.elementary_box.pxi
@@ -0,0 +1,194 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from efl.evas cimport evas_object_box_layout_horizontal
+from efl.evas cimport evas_object_box_layout_vertical
+from efl.evas cimport evas_object_box_layout_homogeneous_vertical
+from efl.evas cimport evas_object_box_layout_homogeneous_horizontal
+from efl.evas cimport evas_object_box_layout_homogeneous_max_size_horizontal
+from efl.evas cimport evas_object_box_layout_homogeneous_max_size_vertical
+from efl.evas cimport evas_object_box_layout_flow_horizontal
+from efl.evas cimport evas_object_box_layout_flow_vertical
+from efl.evas cimport evas_object_box_layout_stack
+from efl.evas cimport elm_box_layout_transition
+
+# ctypedef enum Elm_Box_CLayout:
+# ELM_BOX_LAYOUT_HORIZONTAL
+# ELM_BOX_LAYOUT_VERTICAL
+# ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL
+# ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL
+# ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL
+# ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL
+# ELM_BOX_LAYOUT_FLOW_HORIZONTAL
+# ELM_BOX_LAYOUT_FLOW_VERTICAL
+# ELM_BOX_LAYOUT_STACK
+
+cdef Evas_Object_Box_Layout _py_elm_box_layout_resolv(int layout) with gil:
+ if layout == ELM_BOX_LAYOUT_HORIZONTAL:
+ return evas_object_box_layout_horizontal
+ elif layout == ELM_BOX_LAYOUT_VERTICAL:
+ return evas_object_box_layout_vertical
+ elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL:
+ return evas_object_box_layout_homogeneous_vertical
+ elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL:
+ return evas_object_box_layout_homogeneous_horizontal
+ elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL:
+ return evas_object_box_layout_homogeneous_max_size_horizontal
+ elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL:
+ return evas_object_box_layout_homogeneous_max_size_vertical
+ elif layout == ELM_BOX_LAYOUT_FLOW_HORIZONTAL:
+ return evas_object_box_layout_flow_horizontal
+ elif layout == ELM_BOX_LAYOUT_FLOW_VERTICAL:
+ return evas_object_box_layout_flow_vertical
+ elif layout == ELM_BOX_LAYOUT_STACK:
+ return evas_object_box_layout_stack
+ return evas_object_box_layout_vertical
+
+
+cdef class Box(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_box_add(parent.obj))
+
+ def horizontal_set(self, horizontal):
+ elm_box_horizontal_set(self.obj, horizontal)
+
+ def horizontal_get(self):
+ return elm_box_horizontal_get(self.obj)
+
+ property horizontal:
+ def __get__(self):
+ return elm_box_horizontal_get(self.obj)
+ def __set__(self, value):
+ elm_box_horizontal_set(self.obj, value)
+
+ def homogeneous_set(self, homogeneous):
+ elm_box_homogeneous_set(self.obj, homogeneous)
+
+ def homogeneous_get(self):
+ return bool(elm_box_homogeneous_get(self.obj))
+
+ property homogeneous:
+ def __get__(self):
+ return bool(elm_box_homogeneous_get(self.obj))
+
+ def __set__(self, value):
+ elm_box_homogeneous_set(self.obj, value)
+
+ def pack_start(self, evasObject obj):
+ elm_box_pack_start(self.obj, obj.obj)
+
+ def pack_end(self, evasObject obj):
+ elm_box_pack_end(self.obj, obj.obj)
+
+ def pack_before(self, evasObject obj, evasObject before):
+ elm_box_pack_before(self.obj, obj.obj, before.obj)
+
+ def pack_after(self, evasObject obj, evasObject after):
+ elm_box_pack_after(self.obj, obj.obj, after.obj)
+
+ def clear(self):
+ elm_box_clear(self.obj)
+
+ def unpack(self, evasObject obj):
+ elm_box_unpack(self.obj, obj.obj)
+
+ def unpack_all(self):
+ elm_box_unpack_all(self.obj)
+
+ def children_get(self):
+ return _object_list_to_python(elm_box_children_get(self.obj))
+
+ property children:
+ def __get__(self):
+ return _object_list_to_python(elm_box_children_get(self.obj))
+ #def __set__(self, value):
+ #TODO: unpack_all() and then get the objects from value and pack_end() them.
+ def __del__(self):
+ elm_box_clear(self.obj)
+
+ def padding_set(self, horizontal, vertical):
+ elm_box_padding_set(self.obj, horizontal, vertical)
+
+ def padding_get(self):
+ cdef int horizontal, vertical
+
+ elm_box_padding_get(self.obj, &horizontal, &vertical)
+ return (horizontal, vertical)
+
+ property padding:
+ def __get__(self):
+ cdef int horizontal, vertical
+ elm_box_padding_get(self.obj, &horizontal, &vertical)
+ return (horizontal, vertical)
+
+ def __set__(self, value):
+ cdef int horizontal, vertical
+ horizontal, vertical = value
+ elm_box_padding_set(self.obj, horizontal, vertical)
+
+ def align_set(self, horizontal, vertical):
+ elm_box_align_set(self.obj, horizontal, vertical)
+
+ def align_get(self):
+ cdef double horizontal, vertical
+
+ elm_box_align_get(self.obj, &horizontal, &vertical)
+ return (horizontal, vertical)
+
+ property align:
+ def __get__(self):
+ cdef double horizontal, vertical
+ elm_box_align_get(self.obj, &horizontal, &vertical)
+ return (horizontal, vertical)
+
+ def __set__(self, value):
+ cdef double horizontal, vertical
+ horizontal, vertical = value
+ elm_box_align_set(self.obj, horizontal, vertical)
+
+ def recalculate(self):
+ elm_box_recalculate(self.obj)
+
+ def layout_set(self, layout):
+ cdef Evas_Object_Box_Layout ly
+
+ ly = _py_elm_box_layout_resolv(layout)
+ elm_box_layout_set(self.obj, ly, NULL, NULL)
+
+ property layout:
+ def __set__(self, layout):
+ cdef Evas_Object_Box_Layout ly
+ ly = _py_elm_box_layout_resolv(layout)
+ elm_box_layout_set(self.obj, ly, NULL, NULL)
+
+ def layout_transition(self, duration, from_layout, to_layout):
+ cdef Elm_Box_Transition *t
+ cdef Evas_Object_Box_Layout ly_from, ly_to
+
+ ly_from = _py_elm_box_layout_resolv(from_layout)
+ ly_to = _py_elm_box_layout_resolv(to_layout)
+ t = elm_box_transition_new(duration,
+ ly_from, NULL, NULL,
+ ly_to, NULL, NULL,
+ NULL, NULL)
+ elm_box_layout_set(self.obj, elm_box_layout_transition, t,
+ elm_box_transition_free)
+
+
+_object_mapping_register("elm_box", Box)
diff --git a/efl/elementary/efl.elementary_bubble.pxi b/efl/elementary/efl.elementary_bubble.pxi
new file mode 100644
index 0000000..067feff
--- /dev/null
+++ b/efl/elementary/efl.elementary_bubble.pxi
@@ -0,0 +1,44 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Bubble(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_bubble_add(parent.obj))
+
+ def pos_set(self, pos):
+ elm_bubble_pos_set(self.obj, pos)
+
+ def pos_get(self):
+ return elm_bubble_pos_get(self.obj)
+
+ property pos:
+ def __get__(self):
+ return elm_bubble_pos_get(self.obj)
+
+ def __set__(self, value):
+ elm_bubble_pos_set(self.obj, value)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+
+_object_mapping_register("elm_bubble", Bubble)
diff --git a/efl/elementary/efl.elementary_button.pxi b/efl/elementary/efl.elementary_button.pxi
new file mode 100644
index 0000000..4ae41e1
--- /dev/null
+++ b/efl/elementary/efl.elementary_button.pxi
@@ -0,0 +1,85 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Button(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_button_add(parent.obj))
+
+ def autorepeat_set(self, on):
+ elm_button_autorepeat_set(self.obj, on)
+
+ def autorepeat_get(self):
+ return bool(elm_button_autorepeat_get(self.obj))
+
+ property autorepeat:
+ def __get__(self):
+ return bool(elm_button_autorepeat_get(self.obj))
+ def __set__(self, on):
+ elm_button_autorepeat_set(self.obj, on)
+
+ def autorepeat_initial_timeout_set(self, t):
+ elm_button_autorepeat_initial_timeout_set(self.obj, t)
+
+ def autorepeat_initial_timeout_get(self):
+ return elm_button_autorepeat_initial_timeout_get(self.obj)
+
+ property autorepeat_initial_timeout:
+ def __get__(self):
+ return elm_button_autorepeat_initial_timeout_get(self.obj)
+ def __set__(self, t):
+ elm_button_autorepeat_initial_timeout_set(self.obj, t)
+
+ def autorepeat_gap_timeout_set(self, t):
+ elm_button_autorepeat_gap_timeout_set(self.obj, t)
+
+ def autorepeat_gap_timeout_get(self):
+ return elm_button_autorepeat_gap_timeout_get(self.obj)
+
+ property autorepeat_gap_timeout:
+ def __get__(self):
+ return elm_button_autorepeat_gap_timeout_get(self.obj)
+ def __set__(self, t):
+ elm_button_autorepeat_gap_timeout_set(self.obj, t)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_repeated_add(self, func, *args, **kwargs):
+ self._callback_add("repeated", func, *args, **kwargs)
+
+ def callback_repeated_del(self, func):
+ self._callback_del("repeated", func)
+
+ def callback_pressed_add(self, func, *args, **kwargs):
+ self._callback_add("pressed", func, *args, **kwargs)
+
+ def callback_pressed_del(self, func):
+ self._callback_del("pressed", func)
+
+ def callback_unpressed_add(self, func, *args, **kwargs):
+ self._callback_add("unpressed", func, *args, **kwargs)
+
+ def callback_unpressed_del(self, func):
+ self._callback_del("unpressed", func)
+
+
+_object_mapping_register("elm_button", Button)
diff --git a/efl/elementary/efl.elementary_calendar.pxi b/efl/elementary/efl.elementary_calendar.pxi
new file mode 100644
index 0000000..d7df7d8
--- /dev/null
+++ b/efl/elementary/efl.elementary_calendar.pxi
@@ -0,0 +1,139 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from datetime import date
+
+cdef class CalendarMark(object):
+ cdef Elm_Calendar_Mark *obj
+
+ def __init__(self, evasObject cal, mark_type, mark_time, repeat):
+ cdef tm time
+ tmtup = mark_time.timetuple()
+ time.tm_mday = tmtup.tm_mday
+ time.tm_mon = tmtup.tm_mon - 1
+ time.tm_year = tmtup.tm_year - 1900
+ time.tm_wday = tmtup.tm_wday
+ time.tm_yday = tmtup.tm_yday
+ time.tm_isdst = tmtup.tm_isdst
+ self.obj = elm_calendar_mark_add(cal.obj, _cfruni(mark_type), &time, repeat)
+
+ def delete(self):
+ elm_calendar_mark_del(self.obj)
+
+
+cdef class Calendar(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_calendar_add(parent.obj))
+
+ property weekdays_names:
+ def __get__(self):
+ cdef const_char_ptr *lst
+ cdef const_char_ptr weekday
+ ret = []
+ lst = elm_calendar_weekdays_names_get(self.obj)
+ for i from 0 <= i < 7:
+ weekday = lst[i]
+ if weekday != NULL:
+ ret.append(_ctouni(weekday))
+ return ret
+
+ def __set__(self, weekdays):
+ cdef int i, day_len
+ cdef char **days, *weekday
+ days = <char **>PyMem_Malloc(7 * sizeof(char*))
+ for i from 0 <= i < 7:
+ weekday = _fruni(weekdays[i])
+ day_len = len(weekday)
+ days[i] = <char *>PyMem_Malloc(day_len + 1)
+ memcpy(days[i], weekday, day_len + 1)
+ elm_calendar_weekdays_names_set(self.obj, <const_char_ptr *>days)
+
+ property min_max_year:
+ def __get__(self):
+ cdef int min, max
+ elm_calendar_min_max_year_get(self.obj, &min, &max)
+ return (min, max)
+ def __set__(self, value):
+ cdef int min, max
+ min, max = value
+ elm_calendar_min_max_year_set(self.obj, min, max)
+
+ property select_mode:
+ def __get__(self):
+ return elm_calendar_select_mode_get(self.obj)
+ def __set__(self, mode):
+ elm_calendar_select_mode_set(self.obj, mode)
+
+ property selected_time:
+ def __get__(self):
+ cdef tm time
+ elm_calendar_selected_time_get(self.obj, &time)
+ ret = date( time.tm_year + 1900,
+ time.tm_mon + 1,
+ time.tm_mday)
+ return ret
+
+ def __set__(self, selected_time):
+ cdef tm time
+ tmtup = selected_time.timetuple()
+ time.tm_mday = tmtup.tm_mday
+ time.tm_mon = tmtup.tm_mon - 1
+ time.tm_year = tmtup.tm_year - 1900
+ time.tm_wday = tmtup.tm_wday
+ time.tm_yday = tmtup.tm_yday
+ time.tm_isdst = tmtup.tm_isdst
+ elm_calendar_selected_time_set(self.obj, &time)
+
+ def format_function_set(self, format_func):
+ pass
+ #elm_calendar_format_function_set(self.obj, format_func)
+
+ def mark_add(self, mark_type, mark_time, repeat):
+ return CalendarMark(self, mark_type, mark_time, repeat)
+
+ property marks:
+ #def __get__(self):
+ #const_Eina_List *elm_calendar_marks_get(self.obj)
+ #def __set__(self, value):
+ def __del__(self):
+ elm_calendar_marks_clear(self.obj)
+
+ def marks_draw(self):
+ elm_calendar_marks_draw(self.obj)
+
+ property interval:
+ def __get__(self):
+ return elm_calendar_interval_get(self.obj)
+ def __set__(self, interval):
+ elm_calendar_interval_set(self.obj, interval)
+
+ property first_day_of_week:
+ def __get__(self):
+ return elm_calendar_first_day_of_week_get(self.obj)
+ def __set__(self, day):
+ elm_calendar_first_day_of_week_set(self.obj, day)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+
+_object_mapping_register("elm_calendar", Calendar)
diff --git a/efl/elementary/efl.elementary_check.pxi b/efl/elementary/efl.elementary_check.pxi
new file mode 100644
index 0000000..4be1a6d
--- /dev/null
+++ b/efl/elementary/efl.elementary_check.pxi
@@ -0,0 +1,52 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Check(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_check_add(parent.obj))
+
+ def state_set(self, value):
+ if value:
+ elm_check_state_set(self.obj, 1)
+ else:
+ elm_check_state_set(self.obj, 0)
+
+ def state_get(self):
+ cdef Eina_Bool state
+ state = elm_check_state_get(self.obj)
+ if state == 0:
+ return False
+ else:
+ return True
+
+ property state:
+ def __get__(self):
+ return bool(elm_check_state_get(self.obj))
+
+ def __set__(self, value):
+ elm_check_state_set(self.obj, value)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+
+_object_mapping_register("elm_check", Check)
diff --git a/efl/elementary/efl.elementary_clock.pxi b/efl/elementary/efl.elementary_clock.pxi
new file mode 100644
index 0000000..f9a2f59
--- /dev/null
+++ b/efl/elementary/efl.elementary_clock.pxi
@@ -0,0 +1,116 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Clock(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_clock_add(parent.obj))
+
+ def time_set(self, hours, minutes, seconds):
+ elm_clock_time_set(self.obj, hours, minutes, seconds)
+
+ def time_get(self):
+ cdef int hrs, min, sec
+
+ elm_clock_time_get(self.obj, &hrs, &min, &sec)
+ return (hrs, min, sec)
+
+ property time:
+ def __get__(self):
+ cdef int hrs, min, sec
+ elm_clock_time_get(self.obj, &hrs, &min, &sec)
+ return (hrs, min, sec)
+
+ def __set__(self, value):
+ cdef int hrs, min, sec
+ hrs, min, sec = value
+ elm_clock_time_set(self.obj, hrs, min, sec)
+
+ def edit_set(self, edit):
+ elm_clock_edit_set(self.obj, edit)
+
+ def edit_get(self, edit):
+ return bool(elm_clock_edit_get(self.obj))
+
+ property edit:
+ def __get__(self):
+ return bool(elm_clock_edit_get(self.obj))
+
+ def __set__(self, edit):
+ elm_clock_edit_set(self.obj, edit)
+
+ def edit_mode_set(self, mode):
+ elm_clock_edit_mode_set(self.obj, mode)
+
+ def edit_mode_get(self):
+ return elm_clock_edit_mode_get(self.obj)
+
+ property edit_mode:
+ def __get__(self):
+ return elm_clock_edit_mode_get(self.obj)
+
+ def __set__(self, mode):
+ elm_clock_edit_mode_set(self.obj, mode)
+
+ def show_am_pm_set(self, am_pm):
+ elm_clock_show_am_pm_set(self.obj, am_pm)
+
+ def show_am_pm_get(self):
+ return elm_clock_show_am_pm_get(self.obj)
+
+ property show_am_pm:
+ def __get__(self):
+ return elm_clock_show_am_pm_get(self.obj)
+
+ def __set__(self, am_pm):
+ elm_clock_show_am_pm_set(self.obj, am_pm)
+
+ def show_seconds_set(self, seconds):
+ elm_clock_show_seconds_set(self.obj, seconds)
+
+ def show_seconds_get(self):
+ return elm_clock_show_seconds_get(self.obj)
+
+ property show_seconds:
+ def __get__(self):
+ return elm_clock_show_seconds_get(self.obj)
+
+ def __set__(self, seconds):
+ elm_clock_show_seconds_set(self.obj, seconds)
+
+ def first_interval_set(self, interval):
+ elm_clock_first_interval_set(self.obj, interval)
+
+ def first_interval_get(self):
+ return elm_clock_first_interval_get(self.obj)
+
+ property first_interval:
+ def __get__(self):
+ return elm_clock_first_interval_get(self.obj)
+
+ def __set__(self, interval):
+ elm_clock_first_interval_set(self.obj, interval)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+
+_object_mapping_register("elm_clock", Clock)
diff --git a/efl/elementary/efl.elementary_colorselector.pxi b/efl/elementary/efl.elementary_colorselector.pxi
new file mode 100644
index 0000000..840f4ec
--- /dev/null
+++ b/efl/elementary/efl.elementary_colorselector.pxi
@@ -0,0 +1,125 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class ColorselectorPaletteItem(ObjectItem):
+
+ def __init__(self, evasObject cs, r, g, b, a):
+ cdef Elm_Object_Item *item = elm_colorselector_palette_color_add(cs.obj, r, g, b, a)
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def color_get(self):
+ cdef int r, g, b, a
+ elm_colorselector_palette_item_color_get(self.item, &r, &g, &b, &a)
+ return (r, g, b, a)
+
+ def color_set(self, r, g, b, a):
+ elm_colorselector_palette_item_color_set(self.item, r, g, b, a)
+
+ property color:
+ def __get__(self):
+ cdef int r, g, b, a
+ elm_colorselector_palette_item_color_get(self.item, &r, &g, &b, &a)
+ return (r, g, b, a)
+ def __set__(self, value):
+ cdef int r, g, b, a
+ r, g, b, a = value
+ elm_colorselector_palette_item_color_set(self.item, r, g, b, a)
+
+
+cdef class Colorselector(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_colorselector_add(parent.obj))
+
+ def color_set(self, r, g, b, a):
+ elm_colorselector_color_set(self.obj, r, g, b, a)
+
+ def color_get(self):
+ cdef int r, g, b, a
+ elm_colorselector_color_get(self.obj, &r, &g, &b, &a)
+ return (r, g, b, a)
+
+ property color:
+ def __get__(self):
+ cdef int r, g, b, a
+ elm_colorselector_color_get(self.obj, &r, &g, &b, &a)
+ return (r, g, b, a)
+ def __set__(self, value):
+ cdef int r, g, b, a
+ r, g, b, a = value
+ elm_colorselector_color_set(self.obj, r, g, b, a)
+
+ def mode_set(self, mode):
+ elm_colorselector_mode_set(self.obj, mode)
+
+ def mode_get(self):
+ return elm_colorselector_mode_get(self.obj)
+
+ property mode:
+ def __get__(self):
+ return elm_colorselector_mode_get(self.obj)
+ def __set__(self, mode):
+ elm_colorselector_mode_set(self.obj, mode)
+
+ def palette_color_add(self, r, g, b, a):
+ return ColorselectorPaletteItem(self, r, g, b, a)
+
+ def palette_clear(self):
+ elm_colorselector_palette_clear(self.obj)
+
+ def palette_name_set(self, palette_name):
+ elm_colorselector_palette_name_set(self.obj, _cfruni(palette_name))
+
+ def palette_name_get(self):
+ return _ctouni(elm_colorselector_palette_name_get(self.obj))
+
+ property palette_name:
+ def __get__(self):
+ return _ctouni(elm_colorselector_palette_name_get(self.obj))
+ def __set__(self, palette_name):
+ elm_colorselector_palette_name_set(self.obj, _cfruni(palette_name))
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+ def callback_color_item_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("color,item,selected",
+ _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_color_item_selected_del(self, func):
+ self._callback_del_full("color,item,selected",
+ _cb_object_item_conv, func)
+
+ def callback_color_item_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add_full("color,item,longpressed",
+ _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_color_item_longpressed_del(self, func):
+ self._callback_del_full("color,item,longpressed",
+ _cb_object_item_conv, func)
+
+
+_object_mapping_register("elm_colorselector", Colorselector)
diff --git a/efl/elementary/efl.elementary_configuration.pxi b/efl/elementary/efl.elementary_configuration.pxi
new file mode 100644
index 0000000..6d3cfa3
--- /dev/null
+++ b/efl/elementary/efl.elementary_configuration.pxi
@@ -0,0 +1,311 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Configuration(object):
+
+ def save(self):
+ return bool(elm_config_save())
+
+ def reload(self):
+ elm_config_reload()
+
+ def all_flush(self):
+ elm_config_all_flush()
+
+ property profile:
+ def __get__(self):
+ return _ctouni(elm_config_profile_get())
+ def __set__(self, profile):
+ elm_config_profile_set(_cfruni(profile))
+
+ def profile_dir_get(self, profile, is_user):
+ return _ctouni(elm_config_profile_dir_get(_cfruni(profile), is_user))
+
+ property profile_list:
+ def __get__(self):
+ cdef Eina_List *lst = elm_config_profile_list_get()
+ return tuple(_strings_to_python(lst))
+
+ property scroll_bounce_enabled:
+ def __get__(self):
+ return bool(elm_config_scroll_bounce_enabled_get())
+ def __set__(self, enabled):
+ elm_config_scroll_bounce_enabled_set(enabled)
+
+ property scroll_bounce_friction:
+ def __get__(self):
+ return elm_config_scroll_bounce_friction_get()
+ def __set__(self, friction):
+ elm_config_scroll_bounce_friction_set(friction)
+
+ property scroll_page_scroll_friction:
+ def __get__(self):
+ return elm_config_scroll_page_scroll_friction_get()
+ def __set__(self, friction):
+ elm_config_scroll_page_scroll_friction_set(friction)
+
+ property scroll_bring_in_scroll_friction:
+ def __get__(self):
+ return elm_config_scroll_bring_in_scroll_friction_get()
+ def __set__(self, friction):
+ elm_config_scroll_bring_in_scroll_friction_set(friction)
+
+ property scroll_zoom_friction:
+ def __get__(self):
+ return elm_config_scroll_zoom_friction_get()
+ def __set__(self, friction):
+ elm_config_scroll_zoom_friction_set(friction)
+
+ property scroll_thumbscroll_enabled:
+ def __get__(self):
+ return bool(elm_config_scroll_thumbscroll_enabled_get())
+ def __set__(self, enabled):
+ elm_config_scroll_thumbscroll_enabled_set(enabled)
+
+ property scroll_thumbscroll_threshold:
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_threshold_get()
+ def __set__(self, threshold):
+ elm_config_scroll_thumbscroll_threshold_set(threshold)
+
+ property scroll_thumbscroll_momentum_threshold:
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_momentum_threshold_get()
+ def __set__(self, threshold):
+ elm_config_scroll_thumbscroll_momentum_threshold_set(threshold)
+
+ property scroll_thumbscroll_friction:
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_friction_get()
+ def __set__(self, friction):
+ elm_config_scroll_thumbscroll_friction_set(friction)
+
+ property scroll_thumbscroll_border_friction:
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_border_friction_get()
+ def __set__(self, friction):
+ elm_config_scroll_thumbscroll_border_friction_set(friction)
+
+ property scroll_thumbscroll_sensitivity_friction:
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_sensitivity_friction_get()
+ def __set__(self, friction):
+ elm_config_scroll_thumbscroll_sensitivity_friction_set(friction)
+
+
+ property longpress_timeout:
+ def __get__(self):
+ return elm_config_longpress_timeout_get()
+ def __set__(self, longpress_timeout):
+ elm_config_longpress_timeout_set(longpress_timeout)
+
+ property tooltip_delay:
+ def __get__(self):
+ return elm_config_tooltip_delay_get()
+ def __set__(self, delay):
+ elm_config_tooltip_delay_set(delay)
+
+ property cursor_engine_only:
+ def __get__(self):
+ return elm_config_cursor_engine_only_get()
+ def __set__(self, engine_only):
+ elm_config_cursor_engine_only_set(engine_only)
+
+ property scale:
+ def __get__(self):
+ return elm_config_scale_get()
+ def __set__(self, scale):
+ elm_config_scale_set(scale)
+
+ property password_show_last:
+ def __get__(self):
+ return elm_config_password_show_last_get()
+ def __set__(self, password_show_last):
+ elm_config_password_show_last_set(password_show_last)
+
+ property password_show_last_timeout:
+ def __get__(self):
+ return elm_config_password_show_last_timeout_get()
+ def __set__(self, password_show_last_timeout):
+ elm_config_password_show_last_timeout_set(password_show_last_timeout)
+
+ property engine:
+ def __get__(self):
+ return _ctouni(elm_config_engine_get())
+ def __set__(self, engine):
+ elm_config_engine_set(_cfruni(engine))
+
+ property preferred_engine:
+ def __get__(self):
+ return _ctouni(elm_config_preferred_engine_get())
+ def __set__(self, engine):
+ elm_config_preferred_engine_set(_cfruni(engine))
+
+ property text_classes_list:
+ def __get__(self):
+ cdef Eina_List *lst
+ cdef Elm_Text_Class *data
+ cdef const_char_ptr name, desc
+ ret = []
+ lst = elm_config_text_classes_list_get()
+ while lst:
+ data = <Elm_Text_Class *>lst.data
+ if data != NULL:
+ name = data.name
+ desc = data.desc
+ ret.append((_ctouni(name), _ctouni(desc)))
+ lst = lst.next
+ return ret
+
+ property font_overlay_list:
+ def __get__(self):
+ cdef const_Eina_List *lst
+ cdef Elm_Font_Overlay *data
+ cdef const_char_ptr text_class, font
+ cdef Evas_Font_Size size
+ ret = []
+ lst = elm_config_font_overlay_list_get()
+ while lst:
+ data = <Elm_Font_Overlay *>lst.data
+ if data != NULL:
+ text_class = data.text_class
+ font = data.font
+ size = data.size
+ ret.append((_ctouni(text_class), _ctouni(font), size))
+ lst = lst.next
+ return ret
+
+ def font_overlay_set(self, text_class, font, size):
+ elm_config_font_overlay_set(_cfruni(text_class), _cfruni(font), size)
+
+ def font_overlay_unset(self, text_class):
+ elm_config_font_overlay_unset(_cfruni(text_class))
+
+ def font_overlay_apply(self):
+ elm_config_font_overlay_apply()
+
+ property finger_size:
+ def __get__(self):
+ return elm_config_finger_size_get()
+ def __set__(self, size):
+ elm_config_finger_size_set(size)
+
+ property cache_flush_interval:
+ def __get__(self):
+ return elm_config_cache_flush_interval_get()
+ def __set__(self, size):
+ elm_config_cache_flush_interval_set(size)
+
+ property cache_flush_enabled:
+ def __get__(self):
+ return bool(elm_config_cache_flush_enabled_get())
+ def __set__(self, enabled):
+ elm_config_cache_flush_enabled_set(enabled)
+
+ property cache_font_cache_size:
+ def __get__(self):
+ return elm_config_cache_font_cache_size_get()
+ def __set__(self, size):
+ elm_config_cache_font_cache_size_set(size)
+
+ property cache_image_cache_size:
+ def __get__(self):
+ return elm_config_cache_image_cache_size_get()
+ def __set__(self, size):
+ elm_config_cache_image_cache_size_set(size)
+
+
+ property cache_edje_file_cache_size:
+ def __get__(self):
+ return elm_config_cache_edje_file_cache_size_get()
+ def __set__(self, size):
+ elm_config_cache_edje_file_cache_size_set(size)
+
+ property cache_edje_collection_cache_size:
+ def __get__(self):
+ return elm_config_cache_edje_collection_cache_size_get()
+ def __set__(self, size):
+ elm_config_cache_edje_collection_cache_size_set(size)
+
+ property focus_highlight_enabled:
+ def __get__(self):
+ return bool(elm_config_focus_highlight_enabled_get())
+ def __set__(self, enable):
+ elm_config_focus_highlight_enabled_set(enable)
+
+ property focus_highlight_animate:
+ def __get__(self):
+ return bool(elm_config_focus_highlight_animate_get())
+ def __set__(self, animate):
+ elm_config_focus_highlight_animate_set(animate)
+
+ property mirrored:
+ def __get__(self):
+ return bool(elm_config_mirrored_get())
+ def __set__(self, mirrored):
+ elm_config_mirrored_set(mirrored)
+
+
+def config_finger_size_get():
+ return elm_config_finger_size_get()
+
+def config_finger_size_set(size):
+ elm_config_finger_size_set(size)
+
+def config_tooltip_delay_get():
+ return elm_config_tooltip_delay_get()
+
+def config_tooltip_delay_set(delay):
+ elm_config_tooltip_delay_set(delay)
+
+def focus_highlight_enabled_get():
+ return elm_config_focus_highlight_enabled_get()
+
+def focus_highlight_enabled_set(enabled):
+ elm_config_focus_highlight_enabled_set(enabled)
+
+def focus_highlight_animate_get():
+ return elm_config_focus_highlight_animate_get()
+
+def focus_highlight_animate_set(animate):
+ elm_config_focus_highlight_animate_set(animate)
+
+def preferred_engine_get():
+ return _ctouni(elm_config_preferred_engine_get())
+
+def preferred_engine_set(engine):
+ elm_config_preferred_engine_set(engine)
+
+def engine_get():
+ return _ctouni(elm_config_engine_get())
+
+def engine_set(engine):
+ elm_config_engine_set(_cfruni(engine))
+
+def scale_get():
+ return elm_config_scale_get()
+
+def scale_set(scale):
+ elm_config_scale_set(scale)
+
+def cursor_engine_only_get():
+ return elm_config_cursor_engine_only_get()
+
+def cursor_engine_only_set(engine_only):
+ elm_config_cursor_engine_only_set(engine_only)
+
diff --git a/efl/elementary/efl.elementary_conformant.pxi b/efl/elementary/efl.elementary_conformant.pxi
new file mode 100644
index 0000000..5b9c616
--- /dev/null
+++ b/efl/elementary/efl.elementary_conformant.pxi
@@ -0,0 +1,27 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Conformant(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_conformant_add(parent.obj))
+
+
+_object_mapping_register("elm_conformant", Conformant)
+
diff --git a/efl/elementary/efl.elementary_ctxpopup.pxi b/efl/elementary/efl.elementary_ctxpopup.pxi
new file mode 100644
index 0000000..1ac4886
--- /dev/null
+++ b/efl/elementary/efl.elementary_ctxpopup.pxi
@@ -0,0 +1,115 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class CtxpopupItem(ObjectItem):
+ def __init__(self, evasObject ctxpopup, label = None, evasObject icon = None, callback = None, *args, **kargs):
+ cdef Elm_Object_Item *item
+ cdef Evas_Smart_Cb cb = NULL
+
+ if callback:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+ item = elm_ctxpopup_item_append(ctxpopup.obj,
+ _cfruni(label) if label is not None else NULL,
+ icon.obj if icon is not None else NULL,
+ cb,
+ <void*>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+
+cdef class Ctxpopup(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_ctxpopup_add(parent.obj))
+
+ def hover_parent_set(self, evasObject parent):
+ elm_ctxpopup_hover_parent_set(self.obj, parent.obj)
+
+ def hover_parent_get(self):
+ return object_from_instance(elm_ctxpopup_hover_parent_get(self.obj))
+
+ property parent:
+ def __get__(self):
+ return object_from_instance(elm_ctxpopup_hover_parent_get(self.obj))
+
+ def __set__(self, evasObject parent):
+ elm_ctxpopup_hover_parent_set(self.obj, parent.obj)
+
+ def clear(self):
+ elm_ctxpopup_clear(self.obj)
+
+ def horizontal_set(self, horizontal):
+ elm_ctxpopup_horizontal_set(self.obj, horizontal)
+
+ def horizontal_get(self):
+ return bool(elm_ctxpopup_horizontal_get(self.obj))
+
+ property horizontal:
+ def __get__(self):
+ return bool(elm_ctxpopup_horizontal_get(self.obj))
+
+ def __set__(self, horizontal):
+ elm_ctxpopup_horizontal_set(self.obj, horizontal)
+
+ def item_append(self, label, evasObject icon = None, func = None, *args, **kwargs):
+ return CtxpopupItem(self, label, icon, func, *args, **kwargs)
+
+ def direction_priority_set(self, first, second, third, fourth):
+ elm_ctxpopup_direction_priority_set(self.obj, first, second, third, fourth)
+
+ def direction_priority_get(self):
+ cdef Elm_Ctxpopup_Direction first, second, third, fourth
+ elm_ctxpopup_direction_priority_get(self.obj, &first, &second, &third, &fourth)
+ return (first, second, third, fourth)
+
+ property direction_priority:
+ def __get__(self):
+ cdef Elm_Ctxpopup_Direction first, second, third, fourth
+ elm_ctxpopup_direction_priority_get(self.obj, &first, &second, &third, &fourth)
+ return (first, second, third, fourth)
+
+ def __set__(self, priority):
+ cdef Elm_Ctxpopup_Direction first, second, third, fourth
+ first, second, third, fourth = priority
+ elm_ctxpopup_direction_priority_set(self.obj, first, second, third, fourth)
+
+ def direction_get(self):
+ return elm_ctxpopup_direction_get(self.obj)
+
+ property direction:
+ def __get__(self):
+ return elm_ctxpopup_direction_get(self.obj)
+
+ def dismiss(self):
+ elm_ctxpopup_dismiss(self.obj)
+
+ def callback_dismissed_add(self, func, *args, **kwargs):
+ self._callback_add("dismissed", func, *args, **kwargs)
+
+ def callback_dismissed_del(self, func):
+ self._callback_del("dismissed", func)
+
+
+_object_mapping_register("elm_ctxpopup", Ctxpopup)
diff --git a/efl/elementary/efl.elementary_datetime.pxi b/efl/elementary/efl.elementary_datetime.pxi
new file mode 100644
index 0000000..9d6e6ef
--- /dev/null
+++ b/efl/elementary/efl.elementary_datetime.pxi
@@ -0,0 +1,143 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from datetime import datetime
+
+
+cdef class Datetime(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_datetime_add(parent.obj))
+
+ property format:
+ def __get__(self):
+ return _ctouni(elm_datetime_format_get(self.obj))
+ def __set__(self, fmt):
+ elm_datetime_format_set(self.obj, _cfruni(fmt))
+
+ property value_max:
+ def __get__(self):
+ cdef tm time
+ elm_datetime_value_max_get(self.obj, &time)
+ ret = datetime( time.tm_year + 1900,
+ time.tm_mon + 1,
+ time.tm_mday,
+ time.tm_hour,
+ time.tm_min,
+ time.tm_sec)
+ return ret
+
+ def __set__(self, newtime):
+ cdef tm time
+ tmtup = newtime.timetuple()
+ time.tm_sec = tmtup.tm_sec
+ time.tm_min = tmtup.tm_min
+ time.tm_hour = tmtup.tm_hour
+ time.tm_mday = tmtup.tm_mday
+ time.tm_mon = tmtup.tm_mon - 1
+ time.tm_year = tmtup.tm_year - 1900
+ time.tm_wday = tmtup.tm_wday
+ time.tm_yday = tmtup.tm_yday
+ time.tm_isdst = tmtup.tm_isdst
+ elm_datetime_value_max_set(self.obj, &time)
+
+ property value_min:
+ def __get__(self):
+ cdef tm time
+ elm_datetime_value_min_get(self.obj, &time)
+ ret = datetime( time.tm_year + 1900,
+ time.tm_mon + 1,
+ time.tm_mday,
+ time.tm_hour,
+ time.tm_min,
+ time.tm_sec)
+ return ret
+
+ def __set__(self, newtime):
+ cdef tm time
+ tmtup = newtime.timetuple()
+ time.tm_sec = tmtup.tm_sec
+ time.tm_min = tmtup.tm_min
+ time.tm_hour = tmtup.tm_hour
+ time.tm_mday = tmtup.tm_mday
+ time.tm_mon = tmtup.tm_mon - 1
+ time.tm_year = tmtup.tm_year - 1900
+ time.tm_wday = tmtup.tm_wday
+ time.tm_yday = tmtup.tm_yday
+ time.tm_isdst = tmtup.tm_isdst
+ elm_datetime_value_min_set(self.obj, &time)
+
+ property field_limit:
+ def __get__(self):
+ cdef int min, max
+ cdef Elm_Datetime_Field_Type fieldtype = ELM_DATETIME_YEAR
+ elm_datetime_field_limit_get(self.obj, fieldtype, &min, &max)
+ return (fieldtype, min, max)
+
+ def __set__(self, value):
+ cdef int min, max
+ cdef Elm_Datetime_Field_Type fieldtype
+ min, max, fieldtype = value
+ elm_datetime_field_limit_set(self.obj, fieldtype, min, max)
+
+ property value:
+ def __get__(self):
+ cdef tm time
+ elm_datetime_value_get(self.obj, &time)
+ ret = datetime( time.tm_year + 1900,
+ time.tm_mon + 1,
+ time.tm_mday,
+ time.tm_hour,
+ time.tm_min,
+ time.tm_sec)
+ return ret
+
+ def __set__(self, newtime):
+ cdef tm time
+ tmtup = newtime.timetuple()
+ time.tm_sec = tmtup.tm_sec
+ time.tm_min = tmtup.tm_min
+ time.tm_hour = tmtup.tm_hour
+ time.tm_mday = tmtup.tm_mday
+ time.tm_mon = tmtup.tm_mon - 1
+ time.tm_year = tmtup.tm_year - 1900
+ time.tm_wday = tmtup.tm_wday
+ time.tm_yday = tmtup.tm_yday
+ time.tm_isdst = tmtup.tm_isdst
+ elm_datetime_value_set(self.obj, &time)
+
+ def field_visible_get(self, fieldtype):
+ return bool(elm_datetime_field_visible_get(self.obj, fieldtype))
+
+ def field_visible_set(self, fieldtype, visible):
+ elm_datetime_field_visible_set(self.obj, fieldtype, visible)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+ def callback_languge_changed_add(self, func, *args, **kwargs):
+ self._callback_add("language,changed", func, *args, **kwargs)
+
+ def callback_language_changed_del(self, func):
+ self._callback_del("language,changed", func)
+
+
+_object_mapping_register("elm_datetime", Datetime)
diff --git a/efl/elementary/efl.elementary_dayselector.pxi b/efl/elementary/efl.elementary_dayselector.pxi
new file mode 100644
index 0000000..d505e5a
--- /dev/null
+++ b/efl/elementary/efl.elementary_dayselector.pxi
@@ -0,0 +1,61 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Dayselector(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_dayselector_add(parent.obj))
+
+ def day_selected_set(self, day, selected):
+ elm_dayselector_day_selected_set(self.obj, day, selected)
+
+ def day_selected_get(self, day):
+ return bool(elm_dayselector_day_selected_get(self.obj, day))
+
+ property week_start:
+ def __get__(self):
+ return elm_dayselector_week_start_get(self.obj)
+ def __set__(self, day):
+ elm_dayselector_week_start_set(self.obj, day)
+
+ property weekend_start:
+ def __get__(self):
+ return elm_dayselector_weekend_start_get(self.obj)
+ def __set__(self, day):
+ elm_dayselector_weekend_start_set(self.obj, day)
+
+ property weekend_length:
+ def __get__(self):
+ return elm_dayselector_weekend_length_get(self.obj)
+ def __set__(self, length):
+ elm_dayselector_weekend_length_set(self.obj, length)
+
+ def callback_dayselector_changed_add(self, func, *args, **kwargs):
+ self._callback_add("dayselector,changed", func, *args, **kwargs)
+
+ def callback_dayselector_changed_del(self, func):
+ self._callback_del("dayselector,changed", func)
+
+ def callback_language_changed_add(self, func, *args, **kwargs):
+ self._callback_add("language,changed", func, *args, **kwargs)
+
+ def callback_language_changed_del(self, func):
+ self._callback_del("language,changed", func)
+
+
+_object_mapping_register("elm_dayselector", Dayselector)
diff --git a/efl/elementary/efl.elementary_diskselector.pxi b/efl/elementary/efl.elementary_diskselector.pxi
new file mode 100644
index 0000000..df177d4
--- /dev/null
+++ b/efl/elementary/efl.elementary_diskselector.pxi
@@ -0,0 +1,169 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class DiskselectorItem(ObjectItem):
+
+ def __init__(self, evasObject diskselector, label, evasObject icon=None, callback=None, *args, **kargs):
+ cdef Evas_Object* icon_obj = NULL
+ cdef Evas_Smart_Cb cb = NULL
+
+ if icon is not None:
+ icon_obj = icon.obj
+
+ if callback is not None:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+
+ item = elm_diskselector_item_append(diskselector.obj, _cfruni(label), icon_obj, cb, <void*>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ property selected:
+ def __set__(self, selected):
+ elm_diskselector_item_selected_set(self.item, selected)
+ def __get__(self):
+ return bool(elm_diskselector_item_selected_get(self.item))
+
+ property prev:
+ def __get__(self):
+ cdef Elm_Object_Item *it = elm_diskselector_item_prev_get(self.item)
+ return _object_item_to_python(it)
+
+ property next:
+ def __get__(self):
+ cdef Elm_Object_Item *it = elm_diskselector_item_next_get(self.item)
+ return _object_item_to_python(it)
+
+
+cdef class Diskselector(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_diskselector_add(parent.obj))
+
+ property round_enabled:
+ def __set__(self, enabled):
+ elm_diskselector_round_enabled_set(self.obj, enabled)
+ def __get__(self):
+ return bool(elm_diskselector_round_enabled_get(self.obj))
+
+ property side_text_max_length:
+ def __get__(self):
+ return elm_diskselector_side_text_max_length_get(self.obj)
+ def __set__(self, length):
+ elm_diskselector_side_text_max_length_set(self.obj, length)
+
+ property display_item_num:
+ def __set__(self, num):
+ elm_diskselector_display_item_num_set(self.obj, num)
+ def __get__(self):
+ return elm_diskselector_display_item_num_get(self.obj)
+
+ property bounce:
+ def __set__(self, bounce):
+ h_bounce, v_bounce = bounce
+ elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
+ def __get__(self):
+ cdef Eina_Bool h_bounce, v_bounce
+ elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
+ return (h_bounce, v_bounce)
+
+ property scroller_policy:
+ def __get__(self):
+ cdef Elm_Scroller_Policy h_policy, v_policy
+ elm_scroller_policy_get(self.obj, &h_policy, &v_policy)
+ return (h_policy, v_policy)
+ def __set__(self, policy):
+ h_policy, v_policy = policy
+ elm_scroller_policy_set(self.obj, h_policy, v_policy)
+
+ def clear(self):
+ elm_diskselector_clear(self.obj)
+
+ property items:
+ def __get__(self):
+ cdef Elm_Object_Item *it
+ cdef const_Eina_List *lst
+
+ lst = elm_diskselector_items_get(self.obj)
+ ret = []
+ ret_append = ret.append
+ while lst:
+ it = <Elm_Object_Item *>lst.data
+ lst = lst.next
+ o = _object_item_to_python(it)
+ if o is not None:
+ ret_append(o)
+ return ret
+
+ def item_append(self, label, evasObject icon = None, callback = None, *args, **kwargs):
+ return DiskselectorItem(self, label, icon, callback, *args, **kwargs)
+
+ property selected_item:
+ def __get__(self):
+ cdef Elm_Object_Item *it = elm_diskselector_selected_item_get(self.obj)
+ return _object_item_to_python(it)
+
+ property first_item:
+ def __get__(self):
+ cdef Elm_Object_Item *it = elm_diskselector_first_item_get(self.obj)
+ return _object_item_to_python(it)
+
+ property last_item:
+ def __get__(self):
+ cdef Elm_Object_Item *it = elm_diskselector_last_item_get(self.obj)
+ return _object_item_to_python(it)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_object_item_conv, func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_object_item_conv, func)
+
+ def callback_scroll_anim_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,start", func, *args, **kwargs)
+
+ def callback_scroll_anim_start_del(self, func):
+ self._callback_del("scroll,anim,start", func)
+
+ def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,stop", func, *args, **kwargs)
+
+ def callback_scroll_anim_stop_del(self, func):
+ self._callback_del("scroll,anim,stop", func)
+
+ def callback_scroll_drag_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,start", func, *args, **kwargs)
+
+ def callback_scroll_drag_start_del(self, func):
+ self._callback_del("scroll,drag,start", func)
+
+ def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,stop", func, *args, **kwargs)
+
+ def callback_scroll_drag_stop_del(self, func):
+ self._callback_del("scroll,drag,stop", func)
+
+
+_object_mapping_register("elm_diskselector", Diskselector)
diff --git a/efl/elementary/efl.elementary_entry.pxi b/efl/elementary/efl.elementary_entry.pxi
new file mode 100644
index 0000000..74daa0a
--- /dev/null
+++ b/efl/elementary/efl.elementary_entry.pxi
@@ -0,0 +1,683 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+def Entry_markup_to_utf8(str):
+ cdef const_char_ptr string
+ string = elm_entry_markup_to_utf8(str)
+ if string == NULL:
+ return None
+ return string
+
+def Entry_utf8_to_markup(str):
+ cdef const_char_ptr string
+ string = elm_entry_utf8_to_markup(str)
+ if string == NULL:
+ return None
+ return string
+
+class EntryAnchorInfo:
+ def __init__(self):
+ self.name = None
+ self.button = 0
+ self.x = 0
+ self.y = 0
+ self.w = 0
+ self.h = 0
+
+class EntryAnchorHoverInfo:
+ def __init__(self):
+ self.anchor_info = None
+ self.hover = None
+ self.hover_parent = (0, 0, 0, 0)
+ self.hover_left = False
+ self.hover_right = False
+ self.hover_top = False
+ self.hover_bottom = False
+
+def _entryanchor_conv(long addr):
+ cdef Elm_Entry_Anchor_Info *ei = <Elm_Entry_Anchor_Info *>addr
+ eai = EntryAnchorInfo()
+ eai.name = ei.name
+ eai.button = ei.button
+ eai.x = ei.x
+ eai.y = ei.y
+ eai.w = ei.w
+ eai.h = ei.h
+ return eai
+
+def _entryanchorhover_conv(long addr):
+ cdef Elm_Entry_Anchor_Hover_Info *ehi = <Elm_Entry_Anchor_Hover_Info *>addr
+ eahi = EntryAnchorHoverInfo()
+ eahi.anchor_info = <object>ehi.anchor_info
+ eahi.hover = Hover(None, <object>ehi.hover)
+ eahi.hover_parent = (ehi.hover_parent.x, ehi.hover_parent.y,
+ ehi.hover_parent.w, ehi.hover_parent.h)
+ eahi.hover_left = ehi.hover_left
+ eahi.hover_right = ehi.hover_right
+ eahi.hover_top = ehi.hover_top
+ eahi.hover_bottom = ehi.hover_bottom
+ return eahi
+
+cdef class Entry(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_entry_add(parent.obj))
+
+ def single_line_set(self, single_line):
+ elm_entry_single_line_set(self.obj, single_line)
+
+ def single_line_get(self):
+ return bool(elm_entry_single_line_get(self.obj))
+
+ property single_line:
+ def __get__(self):
+ return bool(elm_entry_single_line_get(self.obj))
+
+ def __set__(self, single_line):
+ elm_entry_single_line_set(self.obj, single_line)
+
+ def password_set(self, password):
+ elm_entry_password_set(self.obj, password)
+
+ def password_get(self):
+ return bool(elm_entry_password_get(self.obj))
+
+ property password:
+ def __get__(self):
+ return bool(elm_entry_password_get(self.obj))
+
+ def __set__(self, password):
+ elm_entry_password_set(self.obj, password)
+
+ def entry_set(self, entry):
+ elm_entry_entry_set(self.obj, _cfruni(entry))
+
+ def entry_get(self):
+ return _ctouni(elm_entry_entry_get(self.obj))
+
+ property entry:
+ def __get__(self):
+ return _ctouni(elm_entry_entry_get(self.obj))
+
+ def __set__(self, entry):
+ elm_entry_entry_set(self.obj, _cfruni(entry))
+
+ def entry_append(self, text):
+ elm_entry_entry_append(self.obj, _cfruni(text))
+
+ def is_empty(self):
+ return elm_entry_is_empty(self.obj)
+
+ def selection_get(self):
+ return _ctouni(elm_entry_selection_get(self.obj))
+
+ property selection:
+ def __get__(self):
+ return _ctouni(elm_entry_selection_get(self.obj))
+
+ def textblock_get(self):
+ cdef Evas_Object *o
+ o = elm_entry_textblock_get(self.obj)
+ return object_from_instance(o)
+
+ property textblock:
+ def __get__(self):
+ cdef Evas_Object *o
+ o = elm_entry_textblock_get(self.obj)
+ return object_from_instance(o)
+
+ def calc_force(self):
+ elm_entry_calc_force(self.obj)
+
+ def entry_insert(self, entry):
+ elm_entry_entry_insert(self.obj, _cfruni(entry))
+
+ def line_wrap_set(self, wrap):
+ elm_entry_line_wrap_set(self.obj, wrap)
+
+ def line_wrap_get(self):
+ return elm_entry_line_wrap_get(self.obj)
+
+ property line_wrap:
+ def __get__(self):
+ return elm_entry_line_wrap_get(self.obj)
+
+ def __set__(self, wrap):
+ elm_entry_line_wrap_set(self.obj, wrap)
+
+ def editable_set(self, editable):
+ elm_entry_editable_set(self.obj, editable)
+
+ def editable_get(self):
+ return bool(elm_entry_editable_get(self.obj))
+
+ property editable:
+ def __get__(self):
+ return bool(elm_entry_editable_get(self.obj))
+
+ def __set__(self, editable):
+ elm_entry_editable_set(self.obj, editable)
+
+ def select_none(self):
+ elm_entry_select_none(self.obj)
+
+ def select_all(self):
+ elm_entry_select_all(self.obj)
+
+ def cursor_next(self):
+
+ return bool(elm_entry_cursor_next(self.obj))
+
+ def cursor_prev(self):
+ return bool(elm_entry_cursor_prev(self.obj))
+
+ def cursor_up(self):
+ return bool(elm_entry_cursor_up(self.obj))
+
+ def cursor_down(self):
+ return bool(elm_entry_cursor_down(self.obj))
+
+ def cursor_begin_set(self):
+ elm_entry_cursor_begin_set(self.obj)
+
+ def cursor_end_set(self):
+ elm_entry_cursor_end_set(self.obj)
+
+ def cursor_line_begin_set(self):
+ elm_entry_cursor_line_begin_set(self.obj)
+
+ def cursor_line_end_set(self):
+ elm_entry_cursor_line_end_set(self.obj)
+
+ def cursor_selection_begin(self):
+ elm_entry_cursor_selection_begin(self.obj)
+
+ def cursor_selection_end(self):
+ elm_entry_cursor_selection_end(self.obj)
+
+ def cursor_is_format_get(self):
+ return bool(elm_entry_cursor_is_format_get(self.obj))
+
+ def cursor_is_visible_format_get(self):
+ return bool(elm_entry_cursor_is_visible_format_get(self.obj))
+
+ def cursor_content_get(self):
+ return elm_entry_cursor_content_get(self.obj)
+
+ def cursor_geometry_get(self):
+ cdef Evas_Coord x, y, w, h
+ #TODO: Check return status for success
+ elm_entry_cursor_geometry_get(self.obj, &x, &y, &w, &h)
+ return (x, y, w, h)
+
+ def cursor_pos_set(self, pos):
+ elm_entry_cursor_pos_set(self.obj, pos)
+
+ def cursor_pos_get(self):
+ return elm_entry_cursor_pos_get(self.obj)
+
+ property cursor_pos:
+ def __get__(self):
+ return elm_entry_cursor_pos_get(self.obj)
+
+ def __set__(self, pos):
+ elm_entry_cursor_pos_set(self.obj, pos)
+
+ def selection_cut(self):
+ elm_entry_selection_cut(self.obj)
+
+ def selection_copy(self):
+ elm_entry_selection_copy(self.obj)
+
+ def selection_paste(self):
+ elm_entry_selection_paste(self.obj)
+
+ def context_menu_clear(self):
+ elm_entry_context_menu_clear(self.obj)
+
+ # TODO XXX
+ # def context_menu_item_add(self, label, icon_file, icon_type, cb, data):
+ #elm_entry_context_menu_item_add(self.obj, label, icon_file, icon_type, func, data);
+
+ def context_menu_disabled_set(self, disabled):
+ elm_entry_context_menu_disabled_set(self.obj, disabled)
+
+ def context_menu_disabled_get(self):
+ return elm_entry_context_menu_disabled_get(self.obj)
+
+ property context_menu_disabled:
+ def __get__(self):
+ return elm_entry_context_menu_disabled_get(self.obj)
+
+ def __set__(self, disabled):
+ elm_entry_context_menu_disabled_set(self.obj, disabled)
+
+
+ # elm_entry_item_provider_append() # TODO XXX
+
+ # elm_entry_item_provider_prepend() # TODO XXX
+
+ # elm_entry_item_provider_remove() # TODO XXX
+
+ # elm_entry_markup_filter_append() # TODO XXX
+
+ # elm_entry_markup_filter_prepend() # TODO XXX
+
+ # elm_entry_markup_filter_remove() # TODO XXX
+
+ markup_to_utf8 = staticmethod(Entry_markup_to_utf8)
+
+ utf8_to_markup = staticmethod(Entry_utf8_to_markup)
+
+ def file_set(self, file, format):
+ return bool(elm_entry_file_set(self.obj, _cfruni(file), format))
+
+ def file_get(self):
+ cdef const_char_ptr file
+ cdef Elm_Text_Format format
+
+ elm_entry_file_get(self.obj, &file, &format)
+ return (_ctouni(file), format)
+
+ property file:
+ def __get__(self):
+ cdef const_char_ptr file
+ cdef Elm_Text_Format format
+ elm_entry_file_get(self.obj, &file, &format)
+ return (_ctouni(file), format)
+
+ def __set__(self, value):
+ file, format = value
+ elm_entry_file_set(self.obj, _cfruni(file), format)
+
+ def file_save(self):
+ elm_entry_file_save(self.obj)
+
+ def autosave_set(self, autosave):
+ elm_entry_autosave_set(self.obj, autosave)
+
+ def autosave_get(self):
+ return elm_entry_autosave_get(self.obj)
+
+ property autosave:
+ def __get__(self):
+ return elm_entry_autosave_get(self.obj)
+
+ def __set__(self, autosave):
+ elm_entry_autosave_set(self.obj, autosave)
+
+ def scrollable_set(self, scrollable):
+ elm_entry_scrollable_set(self.obj, scrollable)
+
+ def scrollable_get(self):
+ return bool(elm_entry_scrollable_get(self.obj))
+
+ property scrollable:
+ def __get__(self):
+ return bool(elm_entry_scrollable_get(self.obj))
+
+ def __set__(self, scrollable):
+ elm_entry_scrollable_set(self.obj, scrollable)
+
+ def icon_visible_set(self, visible):
+ elm_entry_icon_visible_set(self.obj, visible)
+
+ property icon_visible:
+ def __set__(self, visible):
+ elm_entry_icon_visible_set(self.obj, visible)
+
+ def scrollbar_policy_set(self, Elm_Scroller_Policy h, Elm_Scroller_Policy v):
+ elm_scroller_policy_set(self.obj, h, v)
+
+ property scrollbar_policy:
+ def __set__(self, value):
+ cdef Elm_Scroller_Policy h, v
+ h, v = value
+ elm_scroller_policy_set(self.obj, h, v)
+
+ def bounce_set(self, h_bounce, v_bounce):
+ elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
+
+ def bounce_get(self):
+ cdef Eina_Bool h_bounce, v_bounce
+
+ elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
+ return (h_bounce, v_bounce)
+
+ property bounce:
+ def __get__(self):
+ cdef Eina_Bool h_bounce, v_bounce
+ elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
+ return (h_bounce, v_bounce)
+
+ def __set__(self, value):
+ cdef Eina_Bool h_bounce, v_bounce
+ h_bounce, v_bounce = value
+ elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
+
+ def input_panel_layout_set(self, layout):
+ elm_entry_input_panel_layout_set(self.obj, layout)
+
+ def input_panel_layout_get(self):
+ return elm_entry_input_panel_layout_get(self.obj)
+
+ property input_panel_layout:
+ def __get__(self):
+ return elm_entry_input_panel_layout_get(self.obj)
+
+ def __set__(self, layout):
+ elm_entry_input_panel_layout_set(self.obj, layout)
+
+ def input_panel_enabled_set(self, enabled):
+ elm_entry_input_panel_enabled_set(self.obj, enabled)
+
+ def input_panel_enabled_get(self):
+ return bool(elm_entry_input_panel_enabled_get(self.obj))
+
+ property input_panel_enabled:
+ def __get__(self):
+ return bool(elm_entry_input_panel_enabled_get(self.obj))
+
+ def __set__(self, enabled):
+ elm_entry_input_panel_enabled_set(self.obj, enabled)
+
+ def input_panel_show(self):
+ elm_entry_input_panel_show(self.obj)
+
+ def input_panel_hide(self):
+ elm_entry_input_panel_hide(self.obj)
+
+ def input_panel_language_set(self, lang):
+ elm_entry_input_panel_language_set(self.obj, lang)
+
+ def input_panel_language_get(self):
+ return elm_entry_input_panel_language_get(self.obj)
+
+ property input_panel_language:
+ def __get__(self):
+ return elm_entry_input_panel_language_get(self.obj)
+
+ def __set__(self, lang):
+ elm_entry_input_panel_language_set(self.obj, lang)
+
+ # TODO XXX elm_entry_input_panel_imdata_set() ??
+
+ # TODO XXX elm_entry_input_panel_imdata_get() ??
+
+ def input_panel_return_key_type_set(self, return_key_type):
+ elm_entry_input_panel_return_key_type_set(self.obj, return_key_type)
+
+ def input_panel_return_key_type_get(self):
+ return elm_entry_input_panel_return_key_type_get(self.obj)
+
+ property input_panel_return_key_type:
+ def __get__(self):
+ return elm_entry_input_panel_return_key_type_get(self.obj)
+
+ def __set__(self, return_key_type):
+ elm_entry_input_panel_return_key_type_set(self.obj, return_key_type)
+
+ def input_panel_return_key_disabled_set(self, disabled):
+ elm_entry_input_panel_return_key_disabled_set(self.obj, disabled)
+
+ def input_panel_return_key_disabled_get(self):
+ return elm_entry_input_panel_return_key_disabled_get(self.obj)
+
+ property input_panel_return_key_disabled:
+ def __get__(self):
+ return elm_entry_input_panel_return_key_disabled_get(self.obj)
+
+ def __set__(self, disabled):
+ elm_entry_input_panel_return_key_disabled_set(self.obj, disabled)
+
+ def input_panel_return_key_autoenabled_set(self, enabled):
+ elm_entry_input_panel_return_key_autoenabled_set(self.obj, enabled)
+
+ property input_panel_return_key_autoenabled:
+ def __set__(self, enabled):
+ elm_entry_input_panel_return_key_autoenabled_set(self.obj, enabled)
+
+ def imf_context_reset(self):
+ elm_entry_imf_context_reset(self.obj)
+
+ def prediction_allow_set(self, allow):
+ elm_entry_prediction_allow_set(self.obj, allow)
+
+ def prediction_allow_get(self):
+ return elm_entry_prediction_allow_get(self.obj)
+
+ property prediction_allow:
+ def __get__(self):
+ return elm_entry_prediction_allow_get(self.obj)
+
+ def __set__(self, allow):
+ elm_entry_prediction_allow_set(self.obj, allow)
+
+ # TODO XXX elm_entry_filter_accept_set()
+ # TODO XXX elm_entry_imf_context_get() ??
+
+ def cnp_mode_set(self, mode):
+ elm_entry_cnp_mode_set(self.obj, mode)
+
+ def cnp_mode_get(self):
+ return elm_entry_cnp_mode_get(self.obj)
+
+ property cnp_mode:
+ def __get__(self):
+ return elm_entry_cnp_mode_get(self.obj)
+
+ def __set__(self, mode):
+ elm_entry_cnp_mode_set(self.obj, mode)
+
+ def anchor_hover_parent_set(self, evasObject anchor_hover_parent):
+ elm_entry_anchor_hover_parent_set(self.obj, anchor_hover_parent.obj)
+
+ def anchor_hover_parent_get(self):
+ cdef Evas_Object *anchor_hover_parent
+ anchor_hover_parent = elm_entry_anchor_hover_parent_get(self.obj)
+ return object_from_instance(anchor_hover_parent)
+
+ property anchor_hover_parent:
+ def __get__(self):
+ cdef Evas_Object *anchor_hover_parent
+ anchor_hover_parent = elm_entry_anchor_hover_parent_get(self.obj)
+ return object_from_instance(anchor_hover_parent)
+
+ def __set__(self, evasObject anchor_hover_parent):
+ elm_entry_anchor_hover_parent_set(self.obj, anchor_hover_parent.obj)
+
+ def anchor_hover_style_set(self, style):
+ elm_entry_anchor_hover_style_set(self.obj, _cfruni(style))
+
+ def anchor_hover_style_get(self):
+ return _ctouni(elm_entry_anchor_hover_style_get(self.obj))
+
+ property anchor_hover_style:
+ def __get__(self):
+ return _ctouni(elm_entry_anchor_hover_style_get(self.obj))
+
+ def __set__(self, style):
+ elm_entry_anchor_hover_style_set(self.obj, _cfruni(style))
+
+ def anchor_hover_end(self):
+ elm_entry_anchor_hover_end(self.obj)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+ def callback_changed_user_add(self, func, *args, **kwargs):
+ self._callback_add("changed,user", func, *args, **kwargs)
+
+ def callback_changed_user_del(self, func):
+ self._callback_del("changed,user", func)
+
+ def callback_activated_add(self, func, *args, **kwargs):
+ self._callback_add("activated", func, *args, **kwargs)
+
+ def callback_activated_del(self, func):
+ self._callback_del("activated", func)
+
+ def callback_press_add(self, func, *args, **kwargs):
+ self._callback_add("press", func, *args, **kwargs)
+
+ def callback_press_del(self, func):
+ self._callback_del("press", func)
+
+ def callback_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add("longpressed", func, *args, **kwargs)
+
+ def callback_longpressed_del(self, func):
+ self._callback_del("longpressed", func)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_double_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked,double", func, *args, **kwargs)
+
+ def callback_double_clicked_del(self, func):
+ self._callback_del("clicked,double", func)
+
+ def callback_triple_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked,triple", func, *args, **kwargs)
+
+ def callback_triple_clicked_del(self, func):
+ self._callback_del("clicked,triple", func)
+
+ def callback_focused_add(self, func, *args, **kwargs):
+ self._callback_add("focused", func, *args, **kwargs)
+
+ def callback_focused_del(self, func):
+ self._callback_del("focused", func)
+
+ def callback_unfocused_add(self, func, *args, **kwargs):
+ self._callback_add("unfocused", func, *args, **kwargs)
+
+ def callback_unfocused_del(self, func):
+ self._callback_del("unfocused", func)
+
+ def callback_selection_paste_add(self, func, *args, **kwargs):
+ self._callback_add("selection,paste", func, *args, **kwargs)
+
+ def callback_selection_paste_del(self, func):
+ self._callback_del("selection,paste", func)
+
+ def callback_selection_copy_add(self, func, *args, **kwargs):
+ self._callback_add("selection,copy", func, *args, **kwargs)
+
+ def callback_selection_copy_del(self, func):
+ self._callback_del("selection,copy", func)
+
+ def callback_selection_cut_add(self, func, *args, **kwargs):
+ self._callback_add("selection,cut", func, *args, **kwargs)
+
+ def callback_selection_cut_del(self, func):
+ self._callback_del("selection,cut", func)
+
+ def callback_selection_start_add(self, func, *args, **kwargs):
+ self._callback_add("selection,start", func, *args, **kwargs)
+
+ def callback_selection_start_del(self, func):
+ self._callback_del("selection,start", func)
+
+ def callback_selection_changed_add(self, func, *args, **kwargs):
+ self._callback_add("selection,changed", func, *args, **kwargs)
+
+ def callback_selection_changed_del(self, func):
+ self._callback_del("selection,changed", func)
+
+ def callback_selection_cleared_add(self, func, *args, **kwargs):
+ self._callback_add("selection,cleared", func, *args, **kwargs)
+
+ def callback_selection_cleared_del(self, func):
+ self._callback_del("selection,cleared", func)
+
+ def callback_cursor_changed_add(self, func, *args, **kwargs):
+ self._callback_add("cursor,changed", func, *args, **kwargs)
+
+ def callback_cursor_changed_del(self, func):
+ self._callback_del("cursor,changed", func)
+
+ def callback_anchor_clicked_add(self, func, *args, **kwargs):
+ self._callback_add_full("anchor,clicked", _entryanchor_conv,
+ func, *args, **kwargs)
+
+ def callback_anchor_clicked_del(self, func):
+ self._callback_del_full("anchor,clicked", _entryanchor_conv,
+ func)
+
+ def callback_anchor_in_add(self, func, *args, **kwargs):
+ self._callback_add_full("anchor,in", _entryanchor_conv,
+ func, *args, **kwargs)
+
+ def callback_anchor_in_del(self, func):
+ self._callback_del_full("anchor,in", _entryanchor_conv,
+ func)
+
+ def callback_anchor_out_add(self, func, *args, **kwargs):
+ self._callback_add_full("anchor,out", _entryanchor_conv,
+ func, *args, **kwargs)
+
+ def callback_anchor_out_del(self, func):
+ self._callback_del_full("anchor,out", _entryanchor_conv,
+ func)
+
+ def callback_anchor_up_add(self, func, *args, **kwargs):
+ self._callback_add_full("anchor,up", _entryanchor_conv,
+ func, *args, **kwargs)
+
+ def callback_anchor_up_del(self, func):
+ self._callback_del_full("anchor,up", _entryanchor_conv,
+ func)
+
+ def callback_anchor_down_add(self, func, *args, **kwargs):
+ self._callback_add_full("anchor,down", _entryanchor_conv,
+ func, *args, **kwargs)
+
+ def callback_anchor_down_del(self, func):
+ self._callback_del_full("anchor,down", _entryanchor_conv,
+ func)
+
+ def callback_anchor_hover_opened_add(self, func, *args, **kwargs):
+ self._callback_add_full("anchor,hover,opened", _entryanchorhover_conv,
+ func, *args, **kwargs)
+
+ def callback_anchor_hover_opened_del(self, func):
+ self._callback_del_full("anchor,hover,opened", _entryanchorhover_conv,
+ func)
+
+ def callback_preedit_changed_add(self, func, *args, **kwargs):
+ self._callback_add("preedit,changed", func, *args, **kwargs)
+
+ def callback_preedit_changed_del(self, func):
+ self._callback_del("preedit,changed", func)
+
+ def callback_language_changed_add(self, func, *args, **kwargs):
+ self._callback_add("language,changed", func, *args, **kwargs)
+
+ def callback_language_changed_del(self, func):
+ self._callback_del("language,changed", func)
+
+
+_object_mapping_register("elm_entry", Entry)
diff --git a/efl/elementary/efl.elementary_fileselector.pxi b/efl/elementary/efl.elementary_fileselector.pxi
new file mode 100644
index 0000000..b59844b
--- /dev/null
+++ b/efl/elementary/efl.elementary_fileselector.pxi
@@ -0,0 +1,138 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Fileselector(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_fileselector_add(parent.obj))
+
+ def is_save_set(self, is_save):
+ elm_fileselector_is_save_set(self.obj, is_save)
+
+ def is_save_get(self):
+ return elm_fileselector_is_save_get(self.obj)
+
+ property is_save:
+ def __get__(self):
+ return elm_fileselector_is_save_get(self.obj)
+
+ def __set__(self, is_save):
+ elm_fileselector_is_save_set(self.obj, is_save)
+
+ def folder_only_set(self, folder_only):
+ elm_fileselector_folder_only_set(self.obj, folder_only)
+
+ def folder_only_get(self):
+ return elm_fileselector_folder_only_get(self.obj)
+
+ property folder_only:
+ def __get__(self):
+ return elm_fileselector_folder_only_get(self.obj)
+
+ def __set__(self, folder_only):
+ elm_fileselector_folder_only_set(self.obj, folder_only)
+
+ def buttons_ok_cancel_set(self, buttons):
+ elm_fileselector_buttons_ok_cancel_set(self.obj, buttons)
+
+ def buttons_ok_cancel_get(self):
+ return elm_fileselector_buttons_ok_cancel_get(self.obj)
+
+ property buttons_ok_cancel:
+ def __get__(self):
+ return elm_fileselector_buttons_ok_cancel_get(self.obj)
+
+ def __set__(self, buttons):
+ elm_fileselector_buttons_ok_cancel_set(self.obj, buttons)
+
+ def expandable_set(self, expand):
+ elm_fileselector_expandable_set(self.obj, expand)
+
+ def expandable_get(self):
+ return elm_fileselector_expandable_get(self.obj)
+
+ property expandable:
+ def __get__(self):
+ return elm_fileselector_expandable_get(self.obj)
+
+ def __set__(self, expand):
+ elm_fileselector_expandable_set(self.obj, expand)
+
+ def path_set(self, path):
+ elm_fileselector_path_set(self.obj, _cfruni(path))
+
+ def path_get(self):
+ return _ctouni(elm_fileselector_path_get(self.obj))
+
+ property path:
+ def __get__(self):
+ return _ctouni(elm_fileselector_path_get(self.obj))
+
+ def __set__(self, path):
+ elm_fileselector_path_set(self.obj, _cfruni(path))
+
+ def selected_set(self, path):
+ return elm_fileselector_selected_set(self.obj, _cfruni(path))
+
+ def selected_get(self):
+ return _ctouni(elm_fileselector_selected_get(self.obj))
+
+ property selected:
+ def __get__(self):
+ return _ctouni(elm_fileselector_selected_get(self.obj))
+
+ def __set__(self, path):
+ #TODO: Check return value for success
+ elm_fileselector_selected_set(self.obj, _cfruni(path))
+
+ def mode_set(self, mode):
+ elm_fileselector_mode_set(self.obj, mode)
+
+ def mode_get(self):
+ return elm_fileselector_mode_get(self.obj)
+
+ property mode:
+ def __get__(self):
+ return elm_fileselector_mode_get(self.obj)
+
+ def __set__(self, mode):
+ elm_fileselector_mode_set(self.obj, mode)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_string_conv,
+ func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_string_conv, func)
+
+ def callback_directory_open_add(self, func, *args, **kwargs):
+ self._callback_add_full("directory,open", _cb_string_conv,
+ func, *args, **kwargs)
+
+ def callback_directory_open_del(self, func):
+ self._callback_del_full("directory,open", _cb_string_conv, func)
+
+ def callback_done_add(self, func, *args, **kwargs):
+ self._callback_add_full("done", _cb_string_conv,
+ func, *args, **kwargs)
+
+ def callback_done_del(self, func):
+ self._callback_del_full("done", _cb_string_conv, func)
+
+
+_object_mapping_register("elm_fileselector", Fileselector)
diff --git a/efl/elementary/efl.elementary_fileselector_button.pxi b/efl/elementary/efl.elementary_fileselector_button.pxi
new file mode 100644
index 0000000..9b7f72a
--- /dev/null
+++ b/efl/elementary/efl.elementary_fileselector_button.pxi
@@ -0,0 +1,130 @@
+# Copyright (c) 2011 Fabiano Fidêncio
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class FileselectorButton(Button):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_fileselector_button_add(parent.obj))
+
+ def window_title_set(self, title):
+ elm_fileselector_button_window_title_set(self.obj, _cfruni(title))
+
+ def window_title_get(self):
+ return _ctouni(elm_fileselector_button_window_title_get(self.obj))
+
+ property window_title:
+ def __get__(self):
+ return _ctouni(elm_fileselector_button_window_title_get(self.obj))
+
+ def __set__(self, title):
+ elm_fileselector_button_window_title_set(self.obj, _cfruni(title))
+
+ def window_size_set(self, width, height):
+ elm_fileselector_button_window_size_set(self.obj, width, height)
+
+ def window_size_get(self):
+ cdef Evas_Coord w, h
+ elm_fileselector_button_window_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ property window_size:
+ def __get__(self):
+ cdef Evas_Coord w, h
+ elm_fileselector_button_window_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ def __set__(self, value):
+ cdef Evas_Coord w, h
+ w, h = value
+ elm_fileselector_button_window_size_set(self.obj, w, h)
+
+ def path_set(self, path):
+ elm_fileselector_button_path_set(self.obj, _cfruni(path))
+
+ def path_get(self):
+ return _ctouni(elm_fileselector_button_path_get(self.obj))
+
+ property path:
+ def __get__(self):
+ return _ctouni(elm_fileselector_button_path_get(self.obj))
+
+ def __set__(self, path):
+ elm_fileselector_button_path_set(self.obj, _cfruni(path))
+
+ def expandable_set(self, expand):
+ elm_fileselector_button_expandable_set(self.obj, expand)
+
+ def expandable_get(self):
+ return bool(elm_fileselector_button_expandable_get(self.obj))
+
+ property expandable:
+ def __get__(self):
+ return bool(elm_fileselector_button_expandable_get(self.obj))
+
+ def __set__(self, expand):
+ elm_fileselector_button_expandable_set(self.obj, expand)
+
+ def folder_only_set(self, folder_only):
+ elm_fileselector_button_folder_only_set(self.obj, folder_only)
+
+ def folder_only_get(self):
+ return bool(elm_fileselector_button_folder_only_get(self.obj))
+
+ property folder_only:
+ def __get__(self):
+ return bool(elm_fileselector_button_folder_only_get(self.obj))
+
+ def __set__(self, folder_only):
+ elm_fileselector_button_folder_only_set(self.obj, folder_only)
+
+ def is_save_set(self, is_save):
+ elm_fileselector_button_is_save_set(self.obj, is_save)
+
+ def is_save_get(self):
+ return bool(elm_fileselector_button_is_save_get(self.obj))
+
+ property is_save:
+ def __get__(self):
+ return bool(elm_fileselector_button_is_save_get(self.obj))
+
+ def __set__(self, is_save):
+ elm_fileselector_button_is_save_set(self.obj, is_save)
+
+ def inwin_mode_set(self, inwin_mode):
+ elm_fileselector_button_inwin_mode_set(self.obj, inwin_mode)
+
+ def inwin_mode_get(self):
+ return bool(elm_fileselector_button_inwin_mode_get(self.obj))
+
+ property inwin_mode:
+ def __get__(self):
+ return bool(elm_fileselector_button_inwin_mode_get(self.obj))
+
+ def __set__(self, inwin_mode):
+ elm_fileselector_button_inwin_mode_set(self.obj, inwin_mode)
+
+ def callback_file_chosen_add(self, func, *args, **kwargs):
+ self._callback_add_full("file,chosen", _cb_string_conv,
+ func, *args, **kwargs)
+
+ def callback_file_chosen_del(self, func):
+ self._callback_del_full("file,chosen", _cb_string_conv, func)
+
+
+_object_mapping_register("elm_fileselector_button", FileselectorButton)
diff --git a/efl/elementary/efl.elementary_fileselector_entry.pxi b/efl/elementary/efl.elementary_fileselector_entry.pxi
new file mode 100644
index 0000000..be7bd17
--- /dev/null
+++ b/efl/elementary/efl.elementary_fileselector_entry.pxi
@@ -0,0 +1,216 @@
+# Copyright (c) 2011 Fabiano Fidêncio
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class FileselectorEntry(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_fileselector_entry_add(parent.obj))
+
+ def window_title_set(self, title):
+ elm_fileselector_entry_window_title_set(self.obj, _cfruni(title))
+
+ def window_title_get(self):
+ return _ctouni(elm_fileselector_entry_window_title_get(self.obj))
+
+ property window_title:
+ def __get__(self):
+ return _ctouni(elm_fileselector_entry_window_title_get(self.obj))
+
+ def __set__(self, title):
+ elm_fileselector_entry_window_title_set(self.obj, _cfruni(title))
+
+ def window_size_set(self, width, height):
+ elm_fileselector_entry_window_size_set(self.obj, width, height)
+
+ def window_size_get(self):
+ cdef Evas_Coord w
+ cdef Evas_Coord h
+ elm_fileselector_entry_window_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ property window_size:
+ def __get__(self):
+ cdef Evas_Coord w, h
+ elm_fileselector_entry_window_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ def __set__(self, value):
+ cdef Evas_Coord w, h
+ w, h = value
+ elm_fileselector_entry_window_size_set(self.obj, w, h)
+
+ def path_set(self, path):
+ elm_fileselector_entry_path_set(self.obj, _cfruni(path))
+
+ def path_get(self):
+ return _ctouni(elm_fileselector_entry_path_get(self.obj))
+
+ property path:
+ def __get__(self):
+ return _ctouni(elm_fileselector_entry_path_get(self.obj))
+
+ def __set__(self, path):
+ elm_fileselector_entry_path_set(self.obj, _cfruni(path))
+
+ def expandable_set(self, expand):
+ elm_fileselector_entry_expandable_set(self.obj, expand)
+
+ def expandable_get(self):
+ return bool(elm_fileselector_entry_expandable_get(self.obj))
+
+ property expandable:
+ def __get__(self):
+ return bool(elm_fileselector_entry_expandable_get(self.obj))
+
+ def __set__(self, expand):
+ elm_fileselector_entry_expandable_set(self.obj, expand)
+
+ def folder_only_set(self, folder_only):
+ elm_fileselector_entry_folder_only_set(self.obj, folder_only)
+
+ def folder_only_get(self):
+ return bool(elm_fileselector_entry_folder_only_get(self.obj))
+
+ property folder_only:
+ def __get__(self):
+ return bool(elm_fileselector_entry_folder_only_get(self.obj))
+
+ def __set__(self, folder_only):
+ elm_fileselector_entry_folder_only_set(self.obj, folder_only)
+
+ def is_save_set(self, is_save):
+ elm_fileselector_entry_is_save_set(self.obj, is_save)
+
+ def is_save_get(self):
+ return bool(elm_fileselector_entry_is_save_get(self.obj))
+
+ property is_save:
+ def __get__(self):
+ return bool(elm_fileselector_entry_is_save_get(self.obj))
+
+ def __set__(self, is_save):
+ elm_fileselector_entry_is_save_set(self.obj, is_save)
+
+ def inwin_mode_set(self, inwin_mode):
+ elm_fileselector_entry_inwin_mode_set(self.obj, inwin_mode)
+
+ def inwin_mode_get(self):
+ return bool(elm_fileselector_entry_inwin_mode_get(self.obj))
+
+ property inwin_mode:
+ def __get__(self):
+ return bool(elm_fileselector_entry_inwin_mode_get(self.obj))
+
+ def __set__(self, inwin_mode):
+ elm_fileselector_entry_inwin_mode_set(self.obj, inwin_mode)
+
+ def selected_set(self, path):
+ elm_fileselector_entry_selected_set(self.obj, _cfruni(path))
+
+ def selected_get(self):
+ return _ctouni(elm_fileselector_entry_selected_get(self.obj))
+
+ property selected:
+ def __get__(self):
+ return _ctouni(elm_fileselector_entry_selected_get(self.obj))
+
+ def __set__(self, path):
+ elm_fileselector_entry_selected_set(self.obj, _cfruni(path))
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+ def callback_activated_add(self, func, *args, **kwargs):
+ self._callback_add("activated", func, *args, **kwargs)
+
+ def callback_activated_del(self, func):
+ self._callback_del("activated", func)
+
+ def callback_press_add(self, func, *args, **kwargs):
+ self._callback_add("press", func, *args, **kwargs)
+
+ def callback_press_del(self, func):
+ self._callback_del("press", func)
+
+ def callback_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add("longpressed", func, *args, **kwargs)
+
+ def callback_longpressed_del(self, func):
+ self._callback_del("longpressed", func)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add("clicked,double", func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del("clicked,double", func)
+
+ def callback_focused_add(self, func, *args, **kwargs):
+ self._callback_add("focused", func, *args, **kwargs)
+
+ def callback_focused_del(self, func):
+ self._callback_del("focused", func)
+
+ def callback_unfocused_add(self, func, *args, **kwargs):
+ self._callback_add("unfocused", func, *args, **kwargs)
+
+ def callback_unfocused_del(self, func):
+ self._callback_del("unfocused", func)
+
+ def callback_selection_paste_add(self, func, *args, **kwargs):
+ self._callback_add("selection,paste", func, *args, **kwargs)
+
+ def callback_selection_paste_del(self, func):
+ self._callback_del("selection,paste", func)
+
+ def callback_selection_copy_add(self, func, *args, **kwargs):
+ self._callback_add("selection,copy", func, *args, **kwargs)
+
+ def callback_selection_copy_del(self, func):
+ self._callback_del("selection,copy", func)
+
+ def callback_selection_cut_add(self, func, *args, **kwargs):
+ self._callback_add("selection,cut", func, *args, **kwargs)
+
+ def callback_selection_cut_del(self, func):
+ self._callback_del("selection,cut", func)
+
+ def callback_unpressed_add(self, func, *args, **kwargs):
+ self._callback_add("unpressed", func, *args, **kwargs)
+
+ def callback_unpressed_del(self, func):
+ self._callback_del("unpressed", func)
+
+ def callback_file_chosen_add(self, func, *args, **kwargs):
+ self._callback_add_full("file,chosen", _cb_string_conv,
+ func, *args, **kwargs)
+
+ def callback_file_chosen_del(self, func):
+ self._callback_del_full("file,chosen", _cb_string_conv, func)
+
+
+_object_mapping_register("elm_fileselector_entry", FileselectorEntry)
diff --git a/efl/elementary/efl.elementary_flip.pxi b/efl/elementary/efl.elementary_flip.pxi
new file mode 100644
index 0000000..de21e99
--- /dev/null
+++ b/efl/elementary/efl.elementary_flip.pxi
@@ -0,0 +1,76 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Flip(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_flip_add(parent.obj))
+
+ def front_visible_get(self):
+ return elm_flip_front_visible_get(self.obj)
+
+ property front_visible:
+ def __get__(self):
+ return elm_flip_front_visible_get(self.obj)
+
+ def perspective_set(self, foc, x, y):
+ elm_flip_perspective_set(self.obj, foc, x, y)
+
+ def go(self, flip_mode):
+ elm_flip_go(self.obj, flip_mode)
+
+ def interaction_set(self, mode):
+ elm_flip_interaction_set(self.obj, mode)
+
+ def interaction_get(self):
+ return elm_flip_interaction_get(self.obj)
+
+ property interaction:
+ def __get__(self):
+ return elm_flip_interaction_get(self.obj)
+
+ def __set__(self, mode):
+ elm_flip_interaction_set(self.obj, mode)
+
+ def interaction_direction_enabled_set(self, direction, enable):
+ elm_flip_interaction_direction_enabled_set(self.obj, direction, enable)
+
+ def interaction_direction_enabled_get(self, direction):
+ return elm_flip_interaction_direction_enabled_get(self.obj, direction)
+
+ def interaction_direction_hitsize_set(self, direction, hitsize):
+ elm_flip_interaction_direction_hitsize_set(self.obj, direction, hitsize)
+
+ def interaction_direction_hitsize_get(self, direction):
+ return elm_flip_interaction_direction_hitsize_get(self.obj, direction)
+
+ def callback_animate_begin_add(self, func, *args, **kwargs):
+ self._callback_add("animate,begin", func, *args, **kwargs)
+
+ def callback_animate_begin_del(self, func):
+ self._callback_del("animate,begin", func)
+
+ def callback_animate_done_add(self, func, *args, **kwargs):
+ self._callback_add("animate,done", func, *args, **kwargs)
+
+ def callback_animate_done_del(self, func):
+ self._callback_del("animate,done", func)
+
+
+_object_mapping_register("elm_flip", Flip)
diff --git a/efl/elementary/efl.elementary_flipselector.pxi b/efl/elementary/efl.elementary_flipselector.pxi
new file mode 100644
index 0000000..d82e093
--- /dev/null
+++ b/efl/elementary/efl.elementary_flipselector.pxi
@@ -0,0 +1,134 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class FlipSelectorItem(ObjectItem):
+
+ property selected:
+ def __set__(self, selected):
+ elm_flipselector_item_selected_set(self.item, selected)
+
+ def __get__(self):
+ return bool(elm_flipselector_item_selected_get(self.item))
+
+ property prev:
+ def __get__(self):
+ return _object_item_to_python(elm_flipselector_item_prev_get(self.item))
+
+ property next:
+ def __get__(self):
+ return _object_item_to_python(elm_flipselector_item_next_get(self.item))
+
+
+cdef class FlipSelector(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_flipselector_add(parent.obj))
+
+ def next(self):
+ elm_flipselector_flip_next(self.obj)
+
+ def prev(self):
+ elm_flipselector_flip_prev(self.obj)
+
+ def item_append(self, label = None, callback = None, *args, **kwargs):
+ cdef Elm_Object_Item *item
+ cdef Evas_Smart_Cb cb = NULL
+ cdef FlipSelectorItem ret = FlipSelectorItem()
+
+ if callback is not None:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ ret.params = (callback, args, kwargs)
+ item = elm_flipselector_item_append(self.obj,
+ _cfruni(label),
+ cb,
+ <void *>self)
+
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return
+
+ def item_prepend(self, label = None, callback = None, *args, **kwargs):
+ cdef Elm_Object_Item *item
+ cdef Evas_Smart_Cb cb = NULL
+ cdef FlipSelectorItem ret = FlipSelectorItem()
+
+ if callback is not None:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ ret.params = (callback, args, kwargs)
+ item = elm_flipselector_item_append(self.obj,
+ _cfruni(label),
+ cb,
+ <void *>self)
+
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return
+
+ property items:
+ def __get__(self):
+ return tuple(_object_item_list_to_python(elm_flipselector_items_get(self.obj)))
+
+ property first_item:
+ def __get__(self):
+ return _object_item_to_python(elm_flipselector_first_item_get(self.obj))
+
+ property last_item:
+ def __get__(self):
+ return _object_item_to_python(elm_flipselector_last_item_get(self.obj))
+
+ property selected_item:
+ def __get__(self):
+ return _object_item_to_python(elm_flipselector_selected_item_get(self.obj))
+
+ property first_interval:
+ def __set__(self, interval):
+ elm_flipselector_first_interval_set(self.obj, interval)
+
+ def __get__(self):
+ return elm_flipselector_first_interval_get(self.obj)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add("selected", func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del("selected", func)
+
+ def callback_overflowed_add(self, func, *args, **kwargs):
+ self._callback_add("overflowed", func, *args, **kwargs)
+
+ def callback_overflowed_del(self, func):
+ self._callback_del("overflowed", func)
+
+ def callback_underflowed_add(self, func, *args, **kwargs):
+ self._callback_add("underflowed", func, *args, **kwargs)
+
+ def callback_underflowed_del(self, func):
+ self._callback_del("underflowed", func)
+
+
+_object_mapping_register("elm_flipselector", FlipSelector)
diff --git a/efl/elementary/efl.elementary_frame.pxi b/efl/elementary/efl.elementary_frame.pxi
new file mode 100644
index 0000000..91891b2
--- /dev/null
+++ b/efl/elementary/efl.elementary_frame.pxi
@@ -0,0 +1,61 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Frame(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_frame_add(parent.obj))
+
+ def autocollapse_set(self, autocollapse):
+ elm_frame_autocollapse_set(self.obj, autocollapse)
+
+ def autocollapse_get(self):
+ return elm_frame_autocollapse_get(self.obj)
+
+ property autocollapse:
+ def __get__(self):
+ return elm_frame_autocollapse_get(self.obj)
+
+ def __set__(self, autocollapse):
+ elm_frame_autocollapse_set(self.obj, autocollapse)
+
+ def collapse_set(self, autocollapse):
+ elm_frame_collapse_set(self.obj, autocollapse)
+
+ def collapse_get(self):
+ return elm_frame_collapse_get(self.obj)
+
+ property collapse:
+ def __get__(self):
+ return elm_frame_collapse_get(self.obj)
+
+ def __set__(self, autocollapse):
+ elm_frame_collapse_set(self.obj, autocollapse)
+
+ def collapse_go(self, collapse):
+ elm_frame_collapse_go(self.obj, collapse)
+
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+
+_object_mapping_register("elm_frame", Frame)
diff --git a/efl/elementary/efl.elementary_gengrid.pxi b/efl/elementary/efl.elementary_gengrid.pxi
new file mode 100644
index 0000000..d4c7690
--- /dev/null
+++ b/efl/elementary/efl.elementary_gengrid.pxi
@@ -0,0 +1,811 @@
+# Copyright (c) 2010 ProFUSION embedded systems
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import traceback
+
+cdef _py_elm_gengrid_item_call(func, Evas_Object *obj, part, data) with gil:
+ try:
+ o = object_from_instance(obj)
+ return func(o, _ctouni(part), data)
+ except Exception as e:
+ traceback.print_exc()
+ return None
+
+cdef char *_py_elm_gengrid_item_text_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
+ cdef GengridItem item = <object>data
+ cdef object params = item.params
+ cdef GengridItemClass itc = params[0]
+
+ func = itc._text_get_func
+ if func is None:
+ return NULL
+
+ ret = _py_elm_gengrid_item_call(func, obj, part, params[1])
+ if ret is not None:
+ return strdup(_fruni(ret))
+ else:
+ return NULL
+
+cdef Evas_Object *_py_elm_gengrid_item_content_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
+ cdef GengridItem item = <object>data
+ cdef object params = item.params
+ cdef evasObject icon
+ cdef GengridItemClass itc = params[0]
+
+ func = itc._content_get_func
+ if func is None:
+ return NULL
+
+ ret = _py_elm_gengrid_item_call(func, obj, part, params[1])
+ if ret is not None:
+ try:
+ icon = ret
+ return icon.obj
+ except Exception as e:
+ traceback.print_exc()
+ return NULL
+ else:
+ return NULL
+
+cdef Eina_Bool _py_elm_gengrid_item_state_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
+ cdef GengridItem item = <object>data
+ cdef object params = item.params
+ cdef GengridItemClass itc = params[0]
+
+ func = itc._state_get_func
+ if func is None:
+ return False
+
+ ret = _py_elm_gengrid_item_call(func, obj, part, params[1])
+ if ret is not None:
+ return bool(ret)
+ else:
+ return False
+
+cdef void _py_elm_gengrid_object_item_del(void *data, Evas_Object *obj) with gil:
+ cdef GengridItem item = <object>data
+ cdef object params
+ cdef GengridItemClass itc
+
+ if item is None:
+ return
+
+ params = item.params
+ itc = params[0]
+
+ func = itc._del_func
+ if func is not None:
+ try:
+ o = object_from_instance(obj)
+ func(o, params[1])
+ except Exception as e:
+ traceback.print_exc()
+ item._unset_obj()
+ Py_DECREF(item)
+
+cdef void _py_elm_gengrid_item_func(void *data, Evas_Object *obj, void *event_info) with gil:
+ cdef GengridItem item = <object>data
+ cdef object func = item.params[2]
+
+ if func is not None:
+ try:
+ o = object_from_instance(obj)
+ func(item, o, item.params[1])
+ except Exception as e:
+ traceback.print_exc()
+
+
+cdef class GengridItemClass:
+
+ cdef Elm_Gengrid_Item_Class obj
+ cdef readonly object _item_style
+ cdef readonly object _text_get_func
+ cdef readonly object _content_get_func
+ cdef readonly object _state_get_func
+ cdef readonly object _del_func
+
+ def __cinit__(self, *a, **ka):
+ self._item_style = "default"
+ self._text_get_func = None
+ self._content_get_func = None
+ self._state_get_func = None
+ self._del_func = None
+
+ self.obj.item_style = NULL
+ self.obj.func.text_get = _py_elm_gengrid_item_text_get
+ self.obj.func.content_get = _py_elm_gengrid_item_content_get
+ self.obj.func.state_get = _py_elm_gengrid_item_state_get
+ self.obj.func.del_ = _py_elm_gengrid_object_item_del
+
+ def __init__(self, item_style=None, text_get_func=None,
+ content_get_func=None, state_get_func=None, del_func=None):
+ if item_style:
+ self._item_style = item_style
+
+ if text_get_func and not callable(text_get_func):
+ raise TypeError("text_get_func is not callable!")
+ elif text_get_func:
+ self._text_get_func = text_get_func
+ else:
+ self._text_get_func = self.text_get
+
+ if content_get_func and not callable(content_get_func):
+ raise TypeError("content_get_func is not callable!")
+ elif content_get_func:
+ self._content_get_func = content_get_func
+ else:
+ self._content_get_func = self.content_get
+
+ if state_get_func and not callable(state_get_func):
+ raise TypeError("state_get_func is not callable!")
+ elif state_get_func:
+ self._state_get_func = state_get_func
+ else:
+ self._state_get_func = self.state_get
+
+ if del_func and not callable(del_func):
+ raise TypeError("del_func is not callable!")
+ elif del_func:
+ self._del_func = del_func
+ else:
+ try:
+ self._del_func = self.delete
+ except AttributeError:
+ pass
+
+ self.obj.item_style = _cfruni(self._item_style)
+
+ def __str__(self):
+ return ("%s(item_style=%r, text_get_func=%s, content_get_func=%s, "
+ "state_get_func=%s, del_func=%s)") % \
+ (self.__class__.__name__,
+ self._item_style,
+ self._text_get_func,
+ self._content_get_func,
+ self._state_get_func,
+ self._del_func)
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Gengrid_Item_Class=%#x, "
+ "item_style=%r, text_get_func=%s, content_get_func=%s, "
+ "state_get_func=%s, del_func=%s)") % \
+ (self.__class__.__name__,
+ <unsigned long><void *>self,
+ PY_REFCOUNT(self),
+ <unsigned long>&self.obj,
+ self._item_style,
+ self._text_get_func,
+ self._content_get_func,
+ self._state_get_func,
+ self._del_func)
+
+ property item_style:
+ def __get__(self):
+ return self._item_style
+
+ def text_get(self, evasObject obj, part, item_data):
+ return None
+
+ def content_get(self, evasObject obj, part, item_data):
+ return None
+
+ def state_get(self, evasObject obj, part, item_data):
+ return False
+
+
+cdef class GengridItem(ObjectItem):
+
+ cdef int _set_obj(self, Elm_Object_Item *item) except 0:
+ assert self.item == NULL, "Object must be clean"
+ self.item = item
+ Py_INCREF(self)
+ return 1
+
+ cdef void _unset_obj(self):
+ assert self.item != NULL, "Object must wrap something"
+ self.item = NULL
+
+ def __str__(self):
+ return "%s(item_class=%s, func=%s, item_data=%s)" % \
+ (self.__class__.__name__,
+ self.params[0].__class__.__name__,
+ self.params[2],
+ self.params[1])
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
+ "item_class=%s, func=%s, item_data=%r)") % \
+ (self.__class__.__name__,
+ <unsigned long><void*>self,
+ PY_REFCOUNT(self),
+ <unsigned long>self.item,
+ self.params[0].__class__.__name__,
+ self.params[2],
+ self.params[1])
+
+ def data_get(self):
+ (item_class, item_data, func) = self.params
+ return item_data
+
+ property data:
+ def __get__(self):
+ return self.data_get()
+
+ def next_get(self):
+ return _object_item_to_python(elm_gengrid_item_next_get(self.item))
+
+ property next:
+ def __get__(self):
+ return self.next_get()
+
+ def prev_get(self):
+ return _object_item_to_python(elm_gengrid_item_prev_get(self.item))
+
+ property prev:
+ def __get__(self):
+ return self.prev_get()
+
+ def gengrid_get(self):
+ return object_from_instance(elm_object_item_widget_get(self.item))
+
+ property gengrid:
+ def __get__(self):
+ return self.gengrid_get()
+
+ def index_get(self):
+ return elm_gengrid_item_index_get(self.item)
+
+ property index:
+ def __get__(self):
+ return self.index_get()
+
+ def delete(self):
+ elm_object_item_del(self.item)
+
+ def update(self):
+ elm_gengrid_item_update(self.item)
+
+ def selected_set(self, selected):
+ elm_gengrid_item_selected_set(self.item, bool(selected))
+
+ def selected_get(self):
+ return bool(elm_gengrid_item_selected_get(self.item))
+
+ property selected:
+ def __get__(self):
+ return self.selected_get()
+
+ def __set__(self, selected):
+ self.selected_set(selected)
+
+ def show(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
+ elm_gengrid_item_show(self.item, scrollto_type)
+
+ def bring_in(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
+ elm_gengrid_item_bring_in(self.item, scrollto_type)
+
+ def pos_get(self):
+ cdef unsigned int x, y
+ elm_gengrid_item_pos_get(self.item, &x, &y)
+ return (x, y)
+
+ # XXX TODO elm_gengrid_item_item_class_update
+
+ # XXX TODO elm_gengrid_item_item_class_get
+
+ def tooltip_text_set(self, text):
+ elm_gengrid_item_tooltip_text_set(self.item, _cfruni(text))
+
+ property tooltip_text:
+ def __get__(self):
+ return self.tooltip_text_get()
+
+ def tooltip_content_cb_set(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ cdef void *cbdata
+
+ data = (func, self, args, kargs)
+ Py_INCREF(data)
+ cbdata = <void *>data
+ elm_gengrid_item_tooltip_content_cb_set(self.item,
+ _tooltip_item_content_create,
+ cbdata,
+ _tooltip_item_data_del_cb)
+
+ def item_tooltip_unset(self):
+ elm_gengrid_item_tooltip_unset(self.item)
+
+ def tooltip_style_set(self, style=None):
+ if style:
+ elm_gengrid_item_tooltip_style_set(self.item, _cfruni(style))
+ else:
+ elm_gengrid_item_tooltip_style_set(self.item, NULL)
+
+ def tooltip_style_get(self):
+ return _ctouni(elm_gengrid_item_tooltip_style_get(self.item))
+
+ property tooltip_style:
+ def __get__(self):
+ return self.tooltip_style_get()
+
+ def __set__(self, value):
+ self.tooltip_style_set(value)
+
+ def tooltip_window_mode_set(self, disable):
+ elm_gengrid_item_tooltip_window_mode_set(self.item, bool(disable))
+
+ def tooltip_window_mode_get(self):
+ return bool(elm_gengrid_item_tooltip_window_mode_get(self.item))
+
+ property tooltip_window_mode:
+ def __get__(self):
+ return self.tooltip_window_mode_get()
+
+ def __set__(self, value):
+ self.tooltip_window_mode_set(value)
+
+ def cursor_set(self, char *cursor):
+ elm_gengrid_item_cursor_set(self.item, _cfruni(cursor))
+
+ def cursor_get(self):
+ return _ctouni(elm_gengrid_item_cursor_get(self.item))
+
+ property cursor:
+ def __get__(self):
+ return self.cursor_get()
+
+ def __set__(self, value):
+ self.cursor_set(value)
+
+ def cursor_unset(self):
+ elm_gengrid_item_cursor_unset(self.item)
+
+ def cursor_style_set(self, style=None):
+ if style:
+ elm_gengrid_item_cursor_style_set(self.item, _cfruni(style))
+ else:
+ elm_gengrid_item_cursor_style_set(self.item, NULL)
+
+ def cursor_style_get(self):
+ return _ctouni(elm_gengrid_item_cursor_style_get(self.item))
+
+ property cursor_style:
+ def __get__(self):
+ return self.cursor_style_get()
+
+ def __set__(self, value):
+ self.cursor_style_set(value)
+
+ def cursor_engine_only_set(self, engine_only):
+ elm_gengrid_item_cursor_engine_only_set(self.item, bool(engine_only))
+
+ def cursor_engine_only_get(self):
+ return elm_gengrid_item_cursor_engine_only_get(self.item)
+
+ property cursor_engine_only:
+ def __get__(self):
+ return self.cursor_engine_only_get()
+
+ def __set__(self, value):
+ self.cursor_engine_only_set(value)
+
+ def select_mode_set(self, mode):
+ elm_gengrid_item_select_mode_set(self.item, mode)
+
+ def select_mode_get(self):
+ return elm_gengrid_item_select_mode_get(self.item)
+
+ property select_mode:
+ def __get__(self):
+ return self.select_mode_get()
+
+ def __set__(self, value):
+ self.select_mode_set(value)
+
+
+cdef class Gengrid(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_gengrid_add(parent.obj))
+
+ def clear(self):
+ elm_gengrid_clear(self.obj)
+
+ def multi_select_set(self, multi):
+ elm_gengrid_multi_select_set(self.obj, bool(multi))
+
+ def multi_select_get(self):
+ return bool(elm_gengrid_multi_select_get(self.obj))
+
+ property multi_select:
+ def __get__(self):
+ return self.multi_select_get()
+
+ def __set__(self, value):
+ self.multi_select_set(value)
+
+ def horizontal_set(self, setting):
+ elm_gengrid_horizontal_set(self.obj, bool(setting))
+
+ def horizontal_get(self):
+ return bool(elm_gengrid_horizontal_get(self.obj))
+
+ property horizontal:
+ def __get__(self):
+ return self.horizontal_get()
+
+ def __set__(self, value):
+ self.horizontal_set(value)
+
+ def bounce_set(self, h_bounce, v_bounce):
+ elm_scroller_bounce_set(self.obj, bool(h_bounce), bool(v_bounce))
+
+ def bounce_get(self):
+ cdef Eina_Bool h_bounce, v_bounce
+ elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
+ return (h_bounce, v_bounce)
+
+ property bounce:
+ def __get__(self):
+ return self.bouce_get()
+
+ def __set__(self, value):
+ self.bouce_set(*value)
+
+ def item_append(self, GengridItemClass item_class not None,
+ item_data, func=None):
+ cdef GengridItem ret = GengridItem()
+ cdef Elm_Object_Item *item
+ cdef Evas_Smart_Cb cb
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_gengrid_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ ret.params = (item_class, item_data, func)
+ item = elm_gengrid_item_append( self.obj,
+ &item_class.obj,
+ <void*>ret,
+ cb,
+ <void*>ret)
+
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ def item_prepend(self, GengridItemClass item_class not None,
+ item_data, func=None):
+ cdef GengridItem ret = GengridItem()
+ cdef Elm_Object_Item *item
+ cdef Evas_Smart_Cb cb
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_gengrid_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ ret.params = (item_class, item_data, func)
+ item = elm_gengrid_item_prepend(self.obj,
+ &item_class.obj,
+ <void*>ret,
+ cb,
+ <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ def item_insert_before(self, GengridItemClass item_class not None,
+ item_data, GengridItem before_item=None,
+ func=None):
+ cdef GengridItem ret = GengridItem()
+ cdef Elm_Object_Item *item, *before
+ cdef Evas_Smart_Cb cb
+
+ before = _object_item_from_python(before_item)
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_gengrid_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ (item_class, item_data, func)
+ item = elm_gengrid_item_insert_before( self.obj,
+ &item_class.obj,
+ <void*>ret,
+ before,
+ cb,
+ <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ def item_insert_after(self, GengridItemClass item_class not None,
+ item_data, GengridItem after_item=None,
+ func=None):
+ cdef GengridItem ret = GengridItem()
+ cdef Elm_Object_Item *item, *after
+ cdef Evas_Smart_Cb cb
+
+ after = _object_item_from_python(after_item)
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_gengrid_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ ret.params = (item_class, item_data, func)
+ item = elm_gengrid_item_insert_after( self.obj,
+ &item_class.obj,
+ <void*>ret,
+ after,
+ cb,
+ <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ # XXX TODO elm_gengrid_item_sorted_insert()
+
+ def selected_item_get(self):
+ return _object_item_to_python(elm_gengrid_selected_item_get(self.obj))
+
+ property selected_item:
+ def __get__(self):
+ return self.selected_item_get()
+
+ def selected_items_get(self):
+ return _object_item_list_to_python(elm_gengrid_selected_items_get(self.obj))
+
+ property selected_items:
+ def __get__(self):
+ return self.selected_items_get()
+
+ def realized_items_get(self):
+ return _object_item_list_to_python(elm_gengrid_realized_items_get(self.obj))
+
+ property realized_items:
+ def __get__(self):
+ return self.realized_items_get()
+
+ def realized_items_update(self):
+ elm_gengrid_realized_items_update(self.obj)
+
+ def first_item_get(self):
+ return _object_item_to_python(elm_gengrid_first_item_get(self.obj))
+
+ property first_item:
+ def __get__(self):
+ return self.first_item_get()
+
+ def last_item_get(self):
+ return _object_item_to_python(elm_gengrid_last_item_get(self.obj))
+
+ property last_item:
+ def __get__(self):
+ return self.last_item_get()
+
+ def scroller_policy_set(self, policy_h, policy_v):
+ elm_scroller_policy_set(self.obj, policy_h, policy_v)
+
+ def scroller_policy_get(self):
+ cdef Elm_Scroller_Policy policy_h, policy_v
+ elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
+ return (policy_h, policy_v)
+
+ property scroller_policy:
+ def __get__(self):
+ return self.scroller_policy_get()
+
+ def __set__(self, value):
+ self.scroller_policy_set(*value)
+
+ def item_size_set(self, w, h):
+ elm_gengrid_item_size_set(self.obj, w, h)
+
+ def item_size_get(self):
+ cdef Evas_Coord x, y
+ elm_gengrid_item_size_get(self.obj, &x, &y)
+ return (x, y)
+
+ def items_count(self):
+ return elm_gengrid_items_count(self.obj)
+
+ property item_size:
+ def __get__(self):
+ return self.item_size_get()
+
+ def __set__(self, value):
+ self.item_size_set(value)
+
+ def group_item_size_set(self, w, h):
+ elm_gengrid_group_item_size_set(self.obj, w, h)
+
+ def group_item_size_get(self):
+ cdef Evas_Coord w, h
+ elm_gengrid_group_item_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ property group_item_size:
+ def __get__(self):
+ return self.group_item_size_get()
+
+ def __set__(self, value):
+ self.group_item_size_set(*value)
+
+ def align_set(self, align_x, align_y):
+ elm_gengrid_align_set(self.obj, align_x, align_y)
+
+ def align_get(self):
+ cdef double align_x, align_y
+ elm_gengrid_align_get(self.obj, &align_x, &align_y)
+ return (align_x, align_y)
+
+ property align:
+ def __get__(self):
+ return self.align_get()
+
+ def __set__(self, value):
+ self.align_set(*value)
+
+ def reorder_mode_set(self, mode):
+ elm_gengrid_reorder_mode_set(self.obj, bool(mode))
+
+ def reorder_mode_get(self, mode):
+ return bool(elm_gengrid_reorder_mode_get(self.obj))
+
+ property reorder_mode:
+ def __get__(self):
+ return self.reorder_mode_get()
+
+ def __set__(self, value):
+ self.reorder_mode_set(value)
+
+ def page_relative_set(self, h_pagerel, v_pagerel):
+ elm_scroller_page_relative_set(self.obj, h_pagerel, v_pagerel)
+
+ def page_relative_get(self):
+ cdef double h_pagerel, v_pagerel
+ elm_scroller_page_relative_get(self.obj, &h_pagerel, &v_pagerel)
+ return (h_pagerel, v_pagerel)
+
+ property page_relative:
+ def __get__(self):
+ return self.page_relative_get()
+
+ def __set__(self, value):
+ self.page_relative_set(*value)
+
+ def page_size_set(self, h_pagesize, v_pagesize):
+ elm_scroller_page_size_set(self.obj, h_pagesize, v_pagesize)
+
+ def current_page_get(self):
+ cdef int h_pagenum, v_pagenum
+ elm_scroller_current_page_get(self.obj, &h_pagenum, &v_pagenum)
+ return (h_pagenum, v_pagenum)
+
+ property current_page:
+ def __get__(self):
+ return self.current_page_get()
+
+ def last_page_get(self):
+ cdef int h_pagenum, v_pagenum
+ elm_scroller_last_page_get(self.obj, &h_pagenum, &v_pagenum)
+ return (h_pagenum, v_pagenum)
+
+ property last_page:
+ def __get__(self):
+ return self.last_page_get()
+
+ def page_show(self, h_pagenum, v_pagenum):
+ elm_gengrid_page_show(self.obj, h_pagenum, v_pagenum)
+
+ def page_bring_in(self, h_pagenum, v_pagenum):
+ elm_scroller_page_bring_in(self.obj, h_pagenum, v_pagenum)
+
+ def filled_set(self, fill):
+ elm_gengrid_filled_set(self.obj, bool(fill))
+
+ def filled_get(self, fill):
+ return bool(elm_gengrid_filled_get(self.obj))
+
+ property filled:
+ def __get__(self):
+ return self.filled_get()
+
+ def __set__(self, value):
+ self.filled_set(value)
+
+ def select_mode_set(self, mode):
+ elm_gengrid_select_mode_set(self.obj, mode)
+
+ def select_mode_get(self):
+ return elm_gengrid_select_mode_get(self.obj)
+
+ property select_mode:
+ def __get__(self):
+ return self.select_mode_get()
+
+ def __set__(self, value):
+ self.select_mode_set(value)
+
+ def highlight_mode_set(self, highlight):
+ elm_gengrid_highlight_mode_set(self.obj, bool(highlight))
+
+ def highlight_mode_get(self, fill):
+ return bool(elm_gengrid_highlight_mode_get(self.obj))
+
+ property highlight_mode:
+ def __get__(self):
+ return self.highlight_mode_get()
+
+ def __set__(self, value):
+ self.highlight_mode_set(value)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add_full("clicked,double", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del_full("clicked,double", _cb_object_item_conv, func)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add_full("clicked", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del_full("clicked", _cb_object_item_conv, func)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_object_item_conv, func)
+
+ def callback_unselected_add(self, func, *args, **kwargs):
+ self._callback_add_full("unselected", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_unselected_del(self, func):
+ self._callback_del_full("unselected", _cb_object_item_conv, func)
+
+
+_object_mapping_register("elm_gengrid", Gengrid)
diff --git a/efl/elementary/efl.elementary_genlist.pxi b/efl/elementary/efl.elementary_genlist.pxi
new file mode 100644
index 0000000..427e6c6
--- /dev/null
+++ b/efl/elementary/efl.elementary_genlist.pxi
@@ -0,0 +1,923 @@
+# Copyright (c) 2010 ProFUSION embedded systems
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import traceback
+
+
+cdef _py_elm_genlist_item_call(func, Evas_Object *obj, part, data) with gil:
+ try:
+ o = object_from_instance(obj)
+ return func(o, _ctouni(part), data)
+ except Exception as e:
+ traceback.print_exc()
+ return None
+
+cdef char *_py_elm_genlist_item_text_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
+ cdef GenlistItem item = <object>data
+ cdef object params = item.params
+ cdef GenlistItemClass itc = params[0]
+
+ func = itc._text_get_func
+ if func is None:
+ return NULL
+
+ ret = _py_elm_genlist_item_call(func, obj, part, params[1])
+ if ret is not None:
+ return strdup(_fruni(ret))
+ else:
+ return NULL
+
+cdef Evas_Object *_py_elm_genlist_item_content_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
+ cdef GenlistItem item = <object>data
+ cdef object params = item.params
+ cdef evasObject icon
+ cdef GenlistItemClass itc = params[0]
+
+ func = itc._content_get_func
+ if func is None:
+ return NULL
+
+ ret = _py_elm_genlist_item_call(func, obj, part, params[1])
+ if ret is not None:
+ try:
+ icon = ret
+ return icon.obj
+ except Exception as e:
+ traceback.print_exc()
+ return NULL
+ else:
+ return NULL
+
+cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
+ cdef GenlistItem item = <object>data
+ cdef object params = item.params
+ cdef GenlistItemClass itc = params[0]
+
+ func = itc._state_get_func
+ if func is None:
+ return False
+
+ ret = _py_elm_genlist_item_call(func, obj, part, params[1])
+ if ret is not None:
+ return bool(ret)
+ else:
+ return False
+
+cdef void _py_elm_genlist_object_item_del(void *data, Evas_Object *obj) with gil:
+ cdef GenlistItem item = <object>data
+ cdef object params
+ cdef GenlistItemClass itc
+
+ if item is None:
+ return
+
+ params = item.params
+ itc = params[0]
+
+ func = itc._del_func
+ if func is not None:
+ try:
+ o = object_from_instance(obj)
+ func(o, params[1])
+ except Exception as e:
+ traceback.print_exc()
+ item._unset_obj()
+ Py_DECREF(item)
+
+cdef void _py_elm_genlist_item_func(void *data, Evas_Object *obj, void *event_info) with gil:
+ cdef GenlistItem item = <object>data
+ cdef object func = item.params[2]
+
+ if func is not None:
+ try:
+ o = object_from_instance(obj)
+ func(item, o, item.params[1])
+ except Exception as e:
+ traceback.print_exc()
+
+
+cdef class GenlistItemClass:
+ cdef Elm_Genlist_Item_Class obj
+ cdef readonly object _item_style
+ cdef readonly object _text_get_func
+ cdef readonly object _content_get_func
+ cdef readonly object _state_get_func
+ cdef readonly object _del_func
+
+ def __cinit__(self, *a, **ka):
+ self._item_style = "default"
+ self._text_get_func = None
+ self._content_get_func = None
+ self._state_get_func = None
+ self._del_func = None
+
+ self.obj.item_style = NULL
+ self.obj.func.text_get = _py_elm_genlist_item_text_get
+ self.obj.func.content_get = _py_elm_genlist_item_content_get
+ self.obj.func.state_get = _py_elm_genlist_item_state_get
+ self.obj.func.del_ = _py_elm_genlist_object_item_del
+
+ def __init__(self, item_style=None, text_get_func=None,
+ content_get_func=None, state_get_func=None, del_func=None):
+ if item_style:
+ self._item_style = item_style
+
+ if text_get_func and not callable(text_get_func):
+ raise TypeError("text_get_func is not callable!")
+ elif text_get_func:
+ self._text_get_func = text_get_func
+ else:
+ self._text_get_func = self.text_get
+
+ if content_get_func and not callable(content_get_func):
+ raise TypeError("content_get_func is not callable!")
+ elif content_get_func:
+ self._content_get_func = content_get_func
+ else:
+ self._content_get_func = self.content_get
+
+ if state_get_func and not callable(state_get_func):
+ raise TypeError("state_get_func is not callable!")
+ elif state_get_func:
+ self._state_get_func = state_get_func
+ else:
+ self._state_get_func = self.state_get
+
+ if del_func and not callable(del_func):
+ raise TypeError("del_func is not callable!")
+ elif del_func:
+ self._del_func = del_func
+ else:
+ try:
+ self._del_func = self.delete
+ except AttributeError:
+ pass
+
+ self.obj.item_style = _fruni(self._item_style)
+
+ def __str__(self):
+ return ("%s(item_style=%r, text_get_func=%s, content_get_func=%s, "
+ "state_get_func=%s, del_func=%s)") % \
+ (self.__class__.__name__,
+ self._item_style,
+ self._text_get_func,
+ self._content_get_func,
+ self._state_get_func,
+ self._del_func)
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Genlist_Item_Class=%#x, "
+ "item_style=%r, text_get_func=%s, content_get_func=%s, "
+ "state_get_func=%s, del_func=%s)") % \
+ (self.__class__.__name__,
+ <unsigned long><void *>self,
+ PY_REFCOUNT(self),
+ <unsigned long>&self.obj,
+ self._item_style,
+ self._text_get_func,
+ self._content_get_func,
+ self._state_get_func,
+ self._del_func)
+
+ property item_style:
+ def __get__(self):
+ return self._item_style
+
+ def text_get(self, evasObject obj, part, item_data):
+ return None
+
+ def content_get(self, evasObject obj, part, item_data):
+ return None
+
+ def state_get(self, evasObject obj, part, item_data):
+ return False
+
+
+cdef class GenlistItem(ObjectItem):
+
+ cdef int _set_obj(self, Elm_Object_Item *item, params=None) except 0:
+ assert self.item == NULL, "Object must be clean"
+ self.item = item
+ Py_INCREF(self)
+ return 1
+
+ cdef void _unset_obj(self):
+ assert self.item != NULL, "Object must wrap something"
+ self.item = NULL
+
+ def __str__(self):
+ return "%s(item_class=%s, func=%s, item_data=%s)" % \
+ (self.__class__.__name__,
+ self.params[0].__class__.__name__,
+ self.params[2],
+ self.params[1])
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
+ "item_class=%s, func=%s, item_data=%r)") % \
+ (self.__class__.__name__,
+ <unsigned long><void*>self,
+ PY_REFCOUNT(self),
+ <unsigned long>self.item,
+ self.params[0].__class__.__name__,
+ self.params[2],
+ self.params[1])
+
+ def data_get(self):
+ return self.params[1]
+
+ property data:
+ def __get__(self):
+ return self.data_get()
+
+ def next_get(self):
+ return _object_item_to_python(elm_genlist_item_next_get(self.item))
+
+ property next:
+ def __get__(self):
+ return self.next_get()
+
+ def prev_get(self):
+ return _object_item_to_python(elm_genlist_item_prev_get(self.item))
+
+ property prev:
+ def __get__(self):
+ return self.prev_get()
+
+ def selected_set(self, selected):
+ elm_genlist_item_selected_set(self.item, bool(selected))
+
+ def selected_get(self):
+ return bool(elm_genlist_item_selected_get(self.item))
+
+ property selected:
+ def __get__(self):
+ return self.selected_get()
+
+ def __set__(self, selected):
+ self.selected_set(selected)
+
+ def show(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
+ elm_genlist_item_show(self.item, scrollto_type)
+
+ def bring_in(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
+ elm_genlist_item_bring_in(self.item, scrollto_type)
+
+ def update(self):
+ elm_genlist_item_update(self.item)
+
+ #def item_class_update(self, Elm_Genlist_Item_Class itc):
+ #elm_genlist_item_item_class_update(self.item, itc)
+
+ #def item_class_get(self):
+ #return elm_genlist_item_item_class_get(self.item)
+
+ def index_get(self):
+ return elm_genlist_item_index_get(self.item)
+
+ def tooltip_text_set(self, char *text):
+ elm_genlist_item_tooltip_text_set(self.item, _cfruni(text))
+
+ def tooltip_content_cb_set(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ cdef void *cbdata
+
+ data = (func, self, args, kargs)
+ Py_INCREF(data)
+ cbdata = <void *>data
+ elm_genlist_item_tooltip_content_cb_set(self.item,
+ _tooltip_item_content_create,
+ cbdata,
+ _tooltip_item_data_del_cb)
+
+ def tooltip_unset(self):
+ elm_genlist_item_tooltip_unset(self.item)
+
+ def tooltip_style_set(self, style=None):
+ if style:
+ elm_genlist_item_tooltip_style_set(self.item, _cfruni(style))
+ else:
+ elm_genlist_item_tooltip_style_set(self.item, NULL)
+
+ def tooltip_style_get(self):
+ return _ctouni(elm_genlist_item_tooltip_style_get(self.item))
+
+ def tooltip_window_mode_set(self, disable):
+ return bool(elm_genlist_item_tooltip_window_mode_set(self.item, disable))
+
+ def tooltip_window_mode_get(self):
+ return bool(elm_genlist_item_tooltip_window_mode_get(self.item))
+
+ def cursor_set(self, cursor):
+ elm_genlist_item_cursor_set(self.item, _cfruni(cursor))
+
+ def cursor_get(self):
+ return _ctouni(elm_genlist_item_cursor_get(self.item))
+
+ def cursor_unset(self):
+ elm_genlist_item_cursor_unset(self.item)
+
+ def cursor_style_set(self, style=None):
+ if style:
+ elm_genlist_item_cursor_style_set(self.item, _cfruni(style))
+ else:
+ elm_genlist_item_cursor_style_set(self.item, NULL)
+
+ def cursor_style_get(self):
+ return _ctouni(elm_genlist_item_cursor_style_get(self.item))
+
+ def cursor_engine_only_set(self, engine_only):
+ elm_genlist_item_cursor_engine_only_set(self.item, bool(engine_only))
+
+ def cursor_engine_only_get(self):
+ return elm_genlist_item_cursor_engine_only_get(self.item)
+
+ def parent_get(self):
+ return _object_item_to_python(elm_genlist_item_parent_get(self.item))
+
+ property parent:
+ def __get__(self):
+ return self.parent_get()
+
+ def subitems_clear(self):
+ elm_genlist_item_subitems_clear(self.item)
+
+ def expanded_set(self, expanded):
+ elm_genlist_item_expanded_set(self.item, bool(expanded))
+
+ def expanded_get(self, ):
+ return bool(elm_genlist_item_expanded_get(self.item))
+
+ property expanded:
+ def __get__(self):
+ return self.expanded_get()
+
+ def __set__(self, expanded):
+ self.expanded_set(expanded)
+
+ def expanded_depth_get(self):
+ return elm_genlist_item_expanded_depth_get(self.item)
+
+ def all_contents_unset(self):
+ cdef Eina_List *lst
+ elm_genlist_item_all_contents_unset(self.item, &lst)
+ return _object_item_list_to_python(lst)
+
+ def promote(self):
+ elm_genlist_item_promote(self.item)
+
+ def demote(self):
+ elm_genlist_item_demote(self.item)
+
+ def fields_update(self, parts, itf):
+ elm_genlist_item_fields_update(self.item, _cfruni(parts), itf)
+
+ def decorate_mode_set(self, decorate_it_type, decorate_it_set):
+ elm_genlist_item_decorate_mode_set(self.item, _cfruni(decorate_it_type), decorate_it_set)
+
+ def decorate_mode_get(self):
+ return _ctouni(elm_genlist_item_decorate_mode_get(self.item))
+
+ def type_get(self):
+ cdef Elm_Genlist_Item_Type ittype = elm_genlist_item_type_get(self.item)
+ return <Elm_Genlist_Item_Type>ittype
+
+ def flip_set(self, flip):
+ elm_genlist_item_flip_set(self.item, flip)
+
+ def flip_get(self):
+ return bool(elm_genlist_item_flip_get(self.item))
+
+ def select_mode_set(self, mode):
+ elm_genlist_item_select_mode_set(self.item, mode)
+
+ def select_mode_get(self):
+ return elm_genlist_item_select_mode_get(self.item)
+
+
+cdef class Genlist(Object):
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_genlist_add(parent.obj))
+
+ def clear(self):
+ elm_genlist_clear(self.obj)
+
+ def multi_select_set(self, multi):
+ elm_genlist_multi_select_set(self.obj, bool(multi))
+
+ def multi_select_get(self):
+ return bool(elm_genlist_multi_select_get(self.obj))
+
+ def mode_set(self, mode = ELM_LIST_COMPRESS):
+ elm_genlist_mode_set(self.obj, mode)
+
+ def mode_get(self):
+ return elm_genlist_mode_get(self.obj)
+
+ def bounce_set(self, h_bounce, v_bounce):
+ elm_scroller_bounce_set(self.obj, bool(h_bounce), bool(v_bounce))
+
+ def bounce_get(self):
+ cdef Eina_Bool h_bounce, v_bounce
+ elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
+ return (h_bounce, v_bounce)
+
+ def item_append(self,
+ GenlistItemClass item_class not None,
+ item_data,
+ GenlistItem parent_item=None,
+ int flags=ELM_GENLIST_ITEM_NONE,
+ func=None):
+ cdef GenlistItem ret = GenlistItem()
+ cdef Elm_Object_Item *item, *parent
+ cdef Evas_Smart_Cb cb
+
+ parent = _object_item_from_python(parent_item) if parent_item is not None else NULL
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_genlist_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ ret.params = (item_class, item_data, func)
+ item = elm_genlist_item_append( self.obj,
+ &item_class.obj,
+ <void*>ret,
+ parent,
+ <Elm_Genlist_Item_Type>flags,
+ cb,
+ <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ def item_prepend( self,
+ GenlistItemClass item_class not None,
+ item_data,
+ GenlistItem parent_item=None,
+ int flags=ELM_GENLIST_ITEM_NONE,
+ func=None):
+ cdef GenlistItem ret = GenlistItem()
+ cdef Elm_Object_Item *item, *parent
+ cdef Evas_Smart_Cb cb
+
+ parent = _object_item_from_python(parent_item) if parent_item is not None else NULL
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_genlist_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ ret.params = (item_class, item_data, func)
+ item = elm_genlist_item_prepend(self.obj,
+ &item_class.obj,
+ <void*>ret,
+ parent,
+ <Elm_Genlist_Item_Type>flags,
+ cb,
+ <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ def item_insert_before( self,
+ GenlistItemClass item_class not None,
+ item_data,
+ #API XXX: parent
+ GenlistItem before_item=None,
+ int flags=ELM_GENLIST_ITEM_NONE,
+ func=None
+ #API XXX: *args, **kwargs
+ ):
+ cdef GenlistItem ret = GenlistItem()
+ cdef Elm_Object_Item *item, *before
+ cdef Evas_Smart_Cb cb
+
+ before = _object_item_from_python(before_item)
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_genlist_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ ret.params = (item_class, item_data, func)
+ item = elm_genlist_item_insert_before( self.obj,
+ &item_class.obj,
+ <void*>ret,
+ NULL,
+ before,
+ <Elm_Genlist_Item_Type>flags, cb,
+ <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ def item_insert_after( self,
+ GenlistItemClass item_class not None,
+ item_data,
+ #API XXX: parent
+ GenlistItem after_item=None,
+ int flags=ELM_GENLIST_ITEM_NONE,
+ func=None
+ #API XXX: *args, **kwargs
+ ):
+ cdef GenlistItem ret = GenlistItem()
+ cdef Elm_Object_Item *item, *after
+ cdef Evas_Smart_Cb cb
+
+ after = _object_item_from_python(after_item)
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _py_elm_genlist_item_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ ret.params = (item_class, item_data, func)
+ item = elm_genlist_item_insert_after(self.obj, &item_class.obj,
+ <void*>ret,
+ NULL,
+ after,
+ <Elm_Genlist_Item_Type>flags, cb,
+ <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ Py_DECREF(ret)
+ return None
+
+ #Elm_Object_Item *elm_genlist_item_sorted_insert(self.obj, Elm_Genlist_Item_Class *itc, void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, void *func_data)
+
+ def selected_item_get(self):
+ return _object_item_to_python(elm_genlist_selected_item_get(self.obj))
+
+ property selected_item:
+ def __get__(self):
+ return self.selected_item_get()
+
+ def selected_items_get(self):
+ return _object_item_list_to_python(elm_genlist_selected_items_get(self.obj))
+
+ def realized_items_get(self):
+ return _object_item_list_to_python(elm_genlist_realized_items_get(self.obj))
+
+ def first_item_get(self):
+ return _object_item_to_python(elm_genlist_first_item_get(self.obj))
+
+ property first_item:
+ def __get__(self):
+ return _object_item_to_python(elm_genlist_first_item_get(self.obj))
+
+ def last_item_get(self):
+ return _object_item_to_python(elm_genlist_last_item_get(self.obj))
+
+ property last_item:
+ def __get__(self):
+ return _object_item_to_python(elm_genlist_last_item_get(self.obj))
+
+ def scroller_policy_set(self, policy_h, policy_v):
+ elm_scroller_policy_set(self.obj, policy_h, policy_v)
+
+ def scroller_policy_get(self):
+ cdef Elm_Scroller_Policy policy_h, policy_v
+ elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
+ return (policy_h, policy_v)
+
+ def realized_items_update(self):
+ elm_genlist_realized_items_update(self.obj)
+
+ def items_count(self):
+ return elm_genlist_items_count(self.obj)
+
+ def homogeneous_set(self, homogeneous):
+ elm_genlist_homogeneous_set(self.obj, bool(homogeneous))
+
+ def homogeneous_get(self):
+ return bool(elm_genlist_homogeneous_get(self.obj))
+
+ def block_count_set(self, int n):
+ elm_genlist_block_count_set(self.obj, n)
+
+ def block_count_get(self):
+ return elm_genlist_block_count_get(self.obj)
+
+ def longpress_timeout_set(self, timeout):
+ elm_genlist_longpress_timeout_set(self.obj, timeout)
+
+ def longpress_timeout_get(self):
+ return elm_genlist_longpress_timeout_get(self.obj)
+
+ def at_xy_item_get(self, int x, int y):
+ return _object_item_to_python(elm_genlist_at_xy_item_get(self.obj, x, y, NULL))
+
+ def decorated_item_get(self):
+ return _object_item_to_python(elm_genlist_decorated_item_get(self.obj))
+
+ def reorder_mode_set(self, reorder_mode):
+ elm_genlist_reorder_mode_set(self.obj, reorder_mode)
+
+ def reorder_mode_get(self):
+ return bool(elm_genlist_reorder_mode_get(self.obj))
+
+ def decorate_mode_set(self, decorated):
+ elm_genlist_decorate_mode_set(self.obj, decorated)
+
+ def decorate_mode_get(self):
+ return bool(elm_genlist_decorate_mode_get(self.obj))
+
+ def tree_effect_enabled_set(self, enabled):
+ elm_genlist_tree_effect_enabled_set(self.obj, enabled)
+
+ def tree_effect_enabled_get(self):
+ return bool(elm_genlist_tree_effect_enabled_get(self.obj))
+
+ def highlight_mode_set(self, highlight):
+ elm_genlist_highlight_mode_set(self.obj, highlight)
+
+ def highlight_mode_get(self):
+ return bool(elm_genlist_highlight_mode_get(self.obj))
+
+ def select_mode_set(self, mode):
+ elm_genlist_select_mode_set(self.obj, mode)
+
+ def select_mode_get(self):
+ return elm_genlist_select_mode_get(self.obj)
+
+ def callback_activated_add(self, func, *args, **kwargs):
+ self._callback_add_full("activated", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_activated_del(self, func):
+ self._callback_del_full("activated", _cb_object_item_conv, func)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add_full("clicked,double", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del_full("clicked,double", _cb_object_item_conv, func)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_object_item_conv, func)
+
+ def callback_unselected_add(self, func, *args, **kwargs):
+ self._callback_add_full("unselected", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_unselected_del(self, func):
+ self._callback_del_full("unselected", _cb_object_item_conv, func)
+
+ def callback_expanded_add(self, func, *args, **kwargs):
+ self._callback_add_full("expanded", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_expanded_del(self, func):
+ self._callback_del_full("expanded", _cb_object_item_conv, func)
+
+ def callback_contracted_add(self, func, *args, **kwargs):
+ self._callback_add_full("contracted", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_contracted_del(self, func):
+ self._callback_del_full("contracted", _cb_object_item_conv, func)
+
+ def callback_expand_request_add(self, func, *args, **kwargs):
+ self._callback_add_full("expand,request", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_expand_request_del(self, func):
+ self._callback_del_full("expand,request", _cb_object_item_conv, func)
+
+ def callback_contract_request_add(self, func, *args, **kwargs):
+ self._callback_add_full("contract,request", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_contract_request_del(self, func):
+ self._callback_del_full("contract,request", _cb_object_item_conv, func)
+
+ def callback_realized_add(self, func, *args, **kwargs):
+ self._callback_add_full("realized", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_realized_del(self, func):
+ self._callback_del_full("realized", _cb_object_item_conv, func)
+
+ def callback_unrealized_add(self, func, *args, **kwargs):
+ self._callback_add_full("unrealized", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_unrealized_del(self, func):
+ self._callback_del_full("unrealized", _cb_object_item_conv, func)
+
+ def callback_drag_start_up_add(self, func, *args, **kwargs):
+ self._callback_add_full("drag,start,up", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_drag_start_up_del(self, func):
+ self._callback_del_full("drag,start,up", _cb_object_item_conv, func)
+
+ def callback_drag_start_down_add(self, func, *args, **kwargs):
+ self._callback_add_full("drag,start,down", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_drag_start_down_del(self, func):
+ self._callback_del_full("drag,start,down", _cb_object_item_conv, func)
+
+ def callback_drag_start_left_add(self, func, *args, **kwargs):
+ self._callback_add_full("drag,start,left", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_drag_start_left_del(self, func):
+ self._callback_del_full("drag,start,left", _cb_object_item_conv, func)
+
+ def callback_drag_start_right_add(self, func, *args, **kwargs):
+ self._callback_add_full("drag,start,right", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_drag_start_right_del(self, func):
+ self._callback_del_full("drag,start,right", _cb_object_item_conv, func)
+
+ def callback_drag_stop_add(self, func, *args, **kwargs):
+ self._callback_add_full("drag,stop", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_drag_stop_del(self, func):
+ self._callback_del_full("drag,stop", _cb_object_item_conv, func)
+
+ def callback_drag_add(self, func, *args, **kwargs):
+ self._callback_add_full("drag", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_drag_del(self, func):
+ self._callback_del_full("drag", _cb_object_item_conv, func)
+
+ def callback_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add_full("longpressed", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_longpressed_del(self, func):
+ self._callback_del_full("longpressed", _cb_object_item_conv, func)
+
+ def callback_scroll_anim_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,start", func, *args, **kwargs)
+
+ def callback_scroll_anim_start_del(self, func):
+ self._callback_del("scroll,anim,start", func)
+
+ def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,stop", func, *args, **kwargs)
+
+ def callback_scroll_anim_stop_del(self, func):
+ self._callback_del("scroll,anim,stop", func)
+
+ def callback_scroll_drag_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,start", func, *args, **kwargs)
+
+ def callback_scroll_drag_start_del(self, func):
+ self._callback_del("scroll,drag,start", func)
+
+ def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,stop", func, *args, **kwargs)
+
+ def callback_scroll_drag_stop_del(self, func):
+ self._callback_del("scroll,drag,stop", func)
+
+ def callback_edge_top_add(self, func, *args, **kwargs):
+ self._callback_add("edge,top", func, *args, **kwargs)
+
+ def callback_edge_top_del(self, func):
+ self._callback_del("edge,top", func)
+
+ def callback_edge_bottom_add(self, func, *args, **kwargs):
+ self._callback_add("edge,bottom", func, *args, **kwargs)
+
+ def callback_edge_bottom_del(self, func):
+ self._callback_del("edge,bottom", func)
+
+ def callback_edge_left_add(self, func, *args, **kwargs):
+ self._callback_add("edge,left", func, *args, **kwargs)
+
+ def callback_edge_left_del(self, func):
+ self._callback_del("edge,left", func)
+
+ def callback_edge_right_add(self, func, *args, **kwargs):
+ self._callback_add("edge,right", func, *args, **kwargs)
+
+ def callback_edge_right_del(self, func):
+ self._callback_del("edge,right", func)
+
+ def callback_multi_swipe_left_add(self, func, *args, **kwargs):
+ self._callback_add("multi,swipe,left", func, *args, **kwargs)
+
+ def callback_multi_swipe_left_del(self, func):
+ self._callback_del("multi,swipe,left", func)
+
+ def callback_multi_swipe_right_add(self, func, *args, **kwargs):
+ self._callback_add("multi,swipe,right", func, *args, **kwargs)
+
+ def callback_multi_swipe_right_del(self, func):
+ self._callback_del("multi,swipe,right", func)
+
+ def callback_multi_swipe_up_add(self, func, *args, **kwargs):
+ self._callback_add("multi,swipe,up", func, *args, **kwargs)
+
+ def callback_multi_swipe_up_del(self, func):
+ self._callback_del("multi,swipe,up", func)
+
+ def callback_multi_swipe_down_add(self, func, *args, **kwargs):
+ self._callback_add("multi,swipe,down", func, *args, **kwargs)
+
+ def callback_multi_swipe_down_del(self, func):
+ self._callback_del("multi,swipe,down", func)
+
+ def callback_multi_pinch_out_add(self, func, *args, **kwargs):
+ self._callback_add("multi,pinch,out", func, *args, **kwargs)
+
+ def callback_multi_pinch_out_del(self, func):
+ self._callback_del("multi,pinch,out", func)
+
+ def callback_multi_pinch_in_add(self, func, *args, **kwargs):
+ self._callback_add("multi,pinch,in", func, *args, **kwargs)
+
+ def callback_multi_pinch_in_del(self, func):
+ self._callback_del("multi,pinch,in", func)
+
+ def callback_swipe_add(self, func, *args, **kwargs):
+ self._callback_add("swipe", func, *args, **kwargs)
+
+ def callback_swipe_del(self, func):
+ self._callback_del("swipe", func)
+
+ def callback_moved_add(self, func, *args, **kwargs):
+ self._callback_add_full("moved", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_moved_del(self, func):
+ self._callback_del_full("moved", _cb_object_item_conv, func)
+
+ def callback_moved_after_add(self, func, *args, **kwargs):
+ self._callback_add_full("moved,after", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_moved_after_del(self, func):
+ self._callback_del_full("moved,after", _cb_object_item_conv, func)
+
+ def callback_moved_before_add(self, func, *args, **kwargs):
+ self._callback_add_full("moved,before", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_moved_before_del(self, func):
+ self._callback_del_full("moved,before", _cb_object_item_conv, func)
+
+ def callback_language_changed_add(self, func, *args, **kwargs):
+ self._callback_add("language,changed", func, *args, **kwargs)
+
+ def callback_language_changed_del(self, func):
+ self._callback_del("language,changed", func)
+
+ def callback_tree_effect_finished_add(self, func, *args, **kwargs):
+ self._callback_add("tree,effect,finished", func, *args, **kwargs)
+
+ def callback_tree_effect_finished_del(self, func):
+ self._callback_del("tree,effect,finished", func)
+
+
+_object_mapping_register("elm_genlist", Genlist)
diff --git a/efl/elementary/efl.elementary_gesture_layer.pxi b/efl/elementary/efl.elementary_gesture_layer.pxi
new file mode 100644
index 0000000..04dbd64
--- /dev/null
+++ b/efl/elementary/efl.elementary_gesture_layer.pxi
@@ -0,0 +1,79 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from efl cimport evas
+
+cdef Evas_Event_Flags _gesture_layer_event_cb(void *data, void *event_info) with gil:
+ (callback, args, kwargs) = <object>data
+ try:
+ ret = callback(args, kwargs)
+ if ret is not None:
+ return <Evas_Event_Flags>ret
+ else:
+ return evas.EVAS_EVENT_FLAG_NONE
+ except Exception as e:
+ traceback.print_exc()
+
+
+cdef class GestureLayer(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_gesture_layer_add(parent.obj))
+
+ def cb_set(self, Elm_Gesture_Type idx, callback, Elm_Gesture_State cb_type, *args, **kwargs):
+ cdef Elm_Gesture_Event_Cb cb = NULL
+
+ if callback:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _gesture_layer_event_cb
+
+ data = (callback, args, kwargs)
+
+ elm_gesture_layer_cb_set( self.obj,
+ idx,
+ cb_type,
+ cb,
+ <void *>data)
+
+ property hold_events:
+ def __get__(self):
+ return bool(elm_gesture_layer_hold_events_get(self.obj))
+
+ def __set__(self, hold_events):
+ elm_gesture_layer_hold_events_set(self.obj, hold_events)
+
+ property zoom_step:
+ def __set__(self, step):
+ elm_gesture_layer_zoom_step_set(self.obj, step)
+
+ def __get__(self):
+ return elm_gesture_layer_zoom_step_get(self.obj)
+
+ property rotate_step:
+ def __set__(self, step):
+ elm_gesture_layer_rotate_step_set(self.obj, step)
+
+ def __get__(self):
+ return elm_gesture_layer_rotate_step_get(self.obj)
+
+ def attach(self, evasObject target):
+ return bool(elm_gesture_layer_attach(self.obj, target.obj))
+
+
+_object_mapping_register("elm_gesture_layer", GestureLayer)
diff --git a/efl/elementary/efl.elementary_grid.pxi b/efl/elementary/efl.elementary_grid.pxi
new file mode 100644
index 0000000..4653d7f
--- /dev/null
+++ b/efl/elementary/efl.elementary_grid.pxi
@@ -0,0 +1,69 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Grid(Object):
+
+ def __init__(self, evasObject parent):
+# Object.__init__(self, parent.evas)
+ self._set_obj(elm_grid_add(parent.obj))
+
+ def size_set(self, w, h):
+ elm_grid_size_set(self.obj, w, h)
+
+ def size_get(self):
+ cdef Evas_Coord w, h
+ elm_grid_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ property size:
+ def __set__(self, value):
+ w, h = value
+ elm_grid_size_set(self.obj, w, h)
+
+ def __get__(self):
+ cdef Evas_Coord w, h
+ elm_grid_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ def pack(self, evasObject subobj, x, y, w, h):
+ elm_grid_pack(self.obj, subobj.obj, x, y, w, h)
+
+ def unpack(self, evasObject subobj):
+ elm_grid_unpack(self.obj, subobj.obj)
+
+ def clear(self, clear):
+ elm_grid_clear(self.obj, clear)
+
+ def pack_set(self, evasObject subobj, x, y, w, h):
+ elm_grid_pack_set(subobj.obj, x, y, w, h)
+
+ def pack_get(self, evasObject subobj):
+ cdef Evas_Coord x, y, w, h
+ elm_grid_pack_get(subobj.obj, &x, &y, &w, &h)
+ return (x, y, w, h)
+
+ def children_get(self):
+ return _object_list_to_python(elm_box_children_get(self.obj))
+
+ property children:
+ def __get__(self):
+ return _object_list_to_python(elm_box_children_get(self.obj))
+
+
+_object_mapping_register("elm_grid", Grid)
diff --git a/efl/elementary/efl.elementary_hover.pxi b/efl/elementary/efl.elementary_hover.pxi
new file mode 100644
index 0000000..4b84b1a
--- /dev/null
+++ b/efl/elementary/efl.elementary_hover.pxi
@@ -0,0 +1,72 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Hover(LayoutClass):
+
+ def __init__(self, evasObject parent, obj = None):
+ # TODO is this right ??
+ if obj is None:
+ self._set_obj(elm_hover_add(parent.obj))
+ else:
+ self._set_obj(<Evas_Object*>obj)
+
+ def target_set(self, evasObject target):
+ elm_hover_target_set(self.obj, target.obj)
+
+ def target_get(self):
+ return object_from_instance(elm_hover_target_get(self.obj))
+
+ property target:
+ def __get__(self):
+ return object_from_instance(elm_hover_target_get(self.obj))
+ def __set__(self, evasObject target):
+ elm_hover_target_set(self.obj, target.obj)
+
+ def parent_set(self, evasObject parent):
+ elm_hover_parent_set(self.obj, parent.obj)
+
+ def parent_get(self):
+ return object_from_instance(elm_hover_parent_get(self.obj))
+
+ property parent:
+ def __set__(self, evasObject parent):
+ elm_hover_parent_set(self.obj, parent.obj)
+
+ def __get__(self):
+ return object_from_instance(elm_hover_parent_get(self.obj))
+
+ def best_content_location_get(self, axis):
+ return _ctouni(elm_hover_best_content_location_get(self.obj, axis))
+
+ def dismiss(self):
+ elm_hover_dismiss(self.obj)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_smart_changed_add(self, func, *args, **kwargs):
+ self._callback_add("smart,changed", func, *args, **kwargs)
+
+ def callback_smart_changed_del(self, func):
+ self._callback_del("smart,changed", func)
+
+
+_object_mapping_register("elm_hover", Hover)
diff --git a/efl/elementary/efl.elementary_hoversel.pxi b/efl/elementary/efl.elementary_hoversel.pxi
new file mode 100644
index 0000000..13c1bdc
--- /dev/null
+++ b/efl/elementary/efl.elementary_hoversel.pxi
@@ -0,0 +1,141 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class HoverselItem(ObjectItem):
+
+ def __init__(self, evasObject hoversel, label, icon_file, icon_type,
+ callback, *args, **kargs):
+ cdef Evas_Smart_Cb cb = NULL
+
+ if callback:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+ item = elm_hoversel_item_add( hoversel.obj,
+ _cfruni(label) if label is not None else NULL,
+ _cfruni(icon_file) if icon_file is not None else NULL,
+ icon_type,
+ cb,
+ <void*>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def icon_set(self, icon_file, icon_group, icon_type):
+ elm_hoversel_item_icon_set(self.item, _cfruni(icon_file), _cfruni(icon_group), icon_type)
+
+ def icon_get(self):
+ cdef const_char_ptr cicon_file, cicon_group
+ cdef Elm_Icon_Type cicon_type
+ elm_hoversel_item_icon_get(self.item, &cicon_file, &cicon_group, &cicon_type)
+ return (_ctouni(cicon_file), _ctouni(cicon_group), cicon_type)
+
+ property icon:
+ def __set__(self, value):
+ icon_file, icon_group, icon_type = value
+ elm_hoversel_item_icon_set(self.item, _cfruni(icon_file), _cfruni(icon_group), icon_type)
+
+ def __get__(self):
+ cdef const_char_ptr cicon_file, cicon_group
+ cdef Elm_Icon_Type cicon_type
+ elm_hoversel_item_icon_get(self.item, &cicon_file, &cicon_group, &cicon_type)
+ return (_ctouni(cicon_file), _ctouni(cicon_group), cicon_type)
+
+
+cdef class Hoversel(Button):
+
+ def __init__(self, evasObject parent):
+# Object.__init__(self, parent.evas)
+ self._set_obj(elm_hoversel_add(parent.obj))
+
+ def horizontal_set(self, horizontal):
+ elm_hoversel_horizontal_set(self.obj, horizontal)
+
+ def horizontal_get(self):
+ return bool(elm_hoversel_horizontal_get(self.obj))
+
+ property horizontal:
+ def __set__(self, horizontal):
+ elm_hoversel_horizontal_set(self.obj, horizontal)
+
+ def __get__(self):
+ return bool(elm_hoversel_horizontal_get(self.obj))
+
+ def hover_parent_set(self, evasObject parent):
+ elm_hoversel_hover_parent_set(self.obj, parent.obj)
+
+ def hover_parent_get(self):
+ return object_from_instance(elm_hoversel_hover_parent_get(self.obj))
+
+ property hover_parent:
+ def __set__(self, evasObject parent):
+ elm_hoversel_hover_parent_set(self.obj, parent.obj)
+
+ def __get__(self):
+ return object_from_instance(elm_hoversel_hover_parent_get(self.obj))
+
+ def hover_begin(self):
+ elm_hoversel_hover_begin(self.obj)
+
+ def hover_end(self):
+ elm_hoversel_hover_end(self.obj)
+
+ def expanded_get(self):
+ return bool(elm_hoversel_expanded_get(self.obj))
+
+ property expanded:
+ def __get__(self):
+ return bool(elm_hoversel_expanded_get(self.obj))
+
+ def clear(self):
+ elm_hoversel_clear(self.obj)
+
+ def items_get(self):
+ return _object_item_list_to_python(elm_hoversel_items_get(self.obj))
+
+ property items:
+ def __get__(self):
+ return _object_item_list_to_python(elm_hoversel_items_get(self.obj))
+
+ def item_add(self, label = None, icon_file = None, icon_type = ELM_ICON_NONE, callback = None, *args, **kwargs):
+ return HoverselItem(self, label, icon_file, icon_type, callback, *args, **kwargs)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_object_item_conv, func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_object_item_conv, func)
+
+ def callback_dismissed_add(self, func, *args, **kwargs):
+ self._callback_add("dismissed", func, *args, **kwargs)
+
+ def callback_dismissed_del(self, func):
+ self._callback_del("dismissed", func)
+
+
+_object_mapping_register("elm_hoversel", Hoversel)
diff --git a/efl/elementary/efl.elementary_icon.pxi b/efl/elementary/efl.elementary_icon.pxi
new file mode 100644
index 0000000..12f95ca
--- /dev/null
+++ b/efl/elementary/efl.elementary_icon.pxi
@@ -0,0 +1,78 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Icon(Image):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_icon_add(parent.obj))
+
+ def thumb_set(self, filename, group = None):
+ if group == None:
+ elm_icon_thumb_set(self.obj, _cfruni(filename), NULL)
+ else:
+ elm_icon_thumb_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ property thumb:
+ def __set__(self, value):
+ if isinstance(value, tuple):
+ filename, group = value
+ else:
+ filename = value
+ group = None
+ # TODO: check return value
+ elm_icon_thumb_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ def standard_set(self, name):
+ return bool(elm_icon_standard_set(self.obj, _cfruni(name)))
+
+ def standard_get(self):
+ return _ctouni(elm_icon_standard_get(self.obj))
+
+ property standard:
+ def __get__(self):
+ return _ctouni(elm_icon_standard_get(self.obj))
+ def __set__(self, name):
+ # TODO: check return value
+ elm_icon_standard_set(self.obj, _cfruni(name))
+
+ def order_lookup_set(self, order):
+ elm_icon_order_lookup_set(self.obj, order)
+
+ def order_lookup_get(self):
+ return elm_icon_order_lookup_get(self.obj)
+
+ property order_lookup:
+ def __get__(self):
+ return elm_icon_order_lookup_get(self.obj)
+ def __set__(self, order):
+ elm_icon_order_lookup_set(self.obj, order)
+
+ def callback_thumb_done_add(self, func, *args, **kwargs):
+ self._callback_add("thumb,done", func, *args, **kwargs)
+
+ def callback_thumb_done_del(self, func):
+ self._callback_del("thumb,done", func)
+
+ def callback_thumb_error_add(self, func, *args, **kwargs):
+ self._callback_add("thumb,error", func, *args, **kwargs)
+
+ def callback_thumb_error_del(self, func):
+ self._callback_del("thumb,error", func)
+
+
+_object_mapping_register("elm_icon", Icon)
diff --git a/efl/elementary/efl.elementary_image.pxi b/efl/elementary/efl.elementary_image.pxi
new file mode 100644
index 0000000..4ac80f1
--- /dev/null
+++ b/efl/elementary/efl.elementary_image.pxi
@@ -0,0 +1,227 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Image(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_image_add(parent.obj))
+
+ #def memfile_set(self, img, size, format, key):
+ #return bool(elm_image_memfile_set(self.obj, img, size, _cfruni(format), _cfruni(key)))
+
+ def file_set(self, filename, group = None):
+ if group == None:
+ elm_image_file_set(self.obj, _cfruni(filename), NULL)
+ else:
+ elm_image_file_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ def file_get(self):
+ cdef const_char_ptr filename, group
+ elm_image_file_get(self.obj, &filename, &group)
+ return (_ctouni(filename), _ctouni(group))
+
+ property file:
+ def __set__(self, value):
+ if isinstance(value, tuple):
+ filename, group = value
+ else:
+ filename = value
+ group = None
+ # TODO: check return value
+ elm_image_file_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ def __get__(self):
+ cdef const_char_ptr filename, group
+ elm_image_file_get(self.obj, &filename, &group)
+ return (_ctouni(filename), _ctouni(group))
+
+ def smooth_set(self, smooth):
+ elm_image_smooth_set(self.obj, smooth)
+
+ def smooth_get(self):
+ return bool(elm_image_smooth_get(self.obj))
+
+ property smooth:
+ def __get__(self):
+ return bool(elm_image_smooth_get(self.obj))
+
+ def __set__(self, smooth):
+ elm_image_smooth_set(self.obj, smooth)
+
+ def object_size_get(self):
+ cdef int width, height
+ elm_image_object_size_get(self.obj, &width, &height)
+ return (width, height)
+
+ property object_size:
+ def __get__(self):
+ cdef int width, height
+ elm_image_object_size_get(self.obj, &width, &height)
+ return (width, height)
+
+ def no_scale_set(self, no_scale):
+ elm_image_no_scale_set(self.obj, no_scale)
+
+ def no_scale_get(self):
+ return bool(elm_image_no_scale_get(self.obj))
+
+ property no_scale:
+ def __get__(self):
+ return bool(elm_image_no_scale_get(self.obj))
+ def __set__(self, no_scale):
+ elm_image_no_scale_set(self.obj, no_scale)
+
+ def resizable_set(self, size_up, size_down):
+ elm_image_resizable_set(self.obj, size_up, size_down)
+
+ def resizable_get(self):
+ cdef Eina_Bool size_up, size_down
+ elm_image_resizable_get(self.obj, &size_up, &size_down)
+ return (size_up, size_down)
+
+ property resizable:
+ def __get__(self):
+ cdef Eina_Bool size_up, size_down
+ elm_image_resizable_get(self.obj, &size_up, &size_down)
+ return (size_up, size_down)
+
+ def __set__(self, value):
+ size_up, size_down = value
+ elm_image_resizable_set(self.obj, size_up, size_down)
+
+ def fill_outside_set(self, fill_outside):
+ elm_image_fill_outside_set(self.obj, fill_outside)
+
+ def fill_outside_get(self):
+ return bool(elm_image_fill_outside_get(self.obj))
+
+ property fill_outside:
+ def __get__(self):
+ return bool(elm_image_fill_outside_get(self.obj))
+
+ def __set__(self, fill_outside):
+ elm_image_fill_outside_set(self.obj, fill_outside)
+
+ def preload_disabled_set(self, disabled):
+ elm_image_preload_disabled_set(self.obj, disabled)
+
+ property preload_disabled:
+ def __set__(self, disabled):
+ elm_image_preload_disabled_set(self.obj, disabled)
+
+ def prescale_set(self, size):
+ elm_image_prescale_set(self.obj, size)
+
+ def prescale_get(self):
+ return elm_image_prescale_get(self.obj)
+
+ property prescale:
+ def __get__(self):
+ return elm_image_prescale_get(self.obj)
+ def __set__(self, size):
+ elm_image_prescale_set(self.obj, size)
+
+ def orient_set(self, orientation):
+ elm_image_orient_set(self.obj, orientation)
+
+ def orient_get(self):
+ return elm_image_orient_get(self.obj)
+
+ property orient:
+ def __get__(self):
+ return elm_image_orient_get(self.obj)
+ def __set__(self, orientation):
+ elm_image_orient_set(self.obj, orientation)
+
+ def editable_set(self, editable):
+ elm_image_editable_set(self.obj, editable)
+
+ def editable_get(self):
+ return bool(elm_image_editable_get(self.obj))
+
+ property editable:
+ def __get__(self):
+ return bool(elm_image_editable_get(self.obj))
+ def __set__(self, editable):
+ elm_image_editable_set(self.obj, editable)
+
+ def object_get(self):
+ return object_from_instance(elm_image_object_get(self.obj))
+
+ property object:
+ def __get__(self):
+ return object_from_instance(elm_image_object_get(self.obj))
+
+ def aspect_fixed_set(self, fixed):
+ elm_image_aspect_fixed_set(self.obj, fixed)
+
+ def aspect_fixed_get(self):
+ return bool(elm_image_aspect_fixed_get(self.obj))
+
+ property aspect_fixed:
+ def __get__(self):
+ return bool(elm_image_aspect_fixed_get(self.obj))
+ def __set__(self, fixed):
+ elm_image_aspect_fixed_set(self.obj, fixed)
+
+ def animated_available_get(self):
+ return bool(elm_image_animated_available_get(self.obj))
+
+ property animated_available:
+ def __get__(self):
+ return bool(elm_image_animated_available_get(self.obj))
+
+ def animated_set(self, animated):
+ elm_image_animated_set(self.obj, animated)
+
+ def animated_get(self):
+ return bool(elm_image_animated_get(self.obj))
+
+ property animated:
+ def __get__(self):
+ return bool(elm_image_animated_get(self.obj))
+ def __set__(self, animated):
+ elm_image_animated_set(self.obj, animated)
+
+ def animated_play_set(self, play):
+ elm_image_animated_play_set(self.obj, play)
+
+ def animated_play_get(self):
+ return bool(elm_image_animated_play_get(self.obj))
+
+ property animated_play:
+
+ def __get__(self):
+ return bool(elm_image_animated_play_get(self.obj))
+ def __set__(self, play):
+ elm_image_animated_play_set(self.obj, play)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_drop_add(self, func, *args, **kwargs):
+ self._callback_add_full("drop", _cb_string_conv, func, *args, **kwargs)
+
+ def callback_drop_del(self, func):
+ self._callback_del_full("drop", _cb_string_conv, func)
+
+
+_object_mapping_register("elm_image", Image)
diff --git a/efl/elementary/efl.elementary_index.pxi b/efl/elementary/efl.elementary_index.pxi
new file mode 100644
index 0000000..5c50903
--- /dev/null
+++ b/efl/elementary/efl.elementary_index.pxi
@@ -0,0 +1,199 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef enum Elm_Index_Item_Insert_Kind:
+ ELM_INDEX_ITEM_INSERT_APPEND
+ ELM_INDEX_ITEM_INSERT_PREPEND
+ ELM_INDEX_ITEM_INSERT_BEFORE
+ ELM_INDEX_ITEM_INSERT_AFTER
+ ELM_INDEX_ITEM_INSERT_SORTED
+
+
+cdef class IndexItem(ObjectItem):
+ def __init__(self, kind, evasObject index, letter, IndexItem before_after = None,
+ callback = None, *args, **kargs):
+ cdef Evas_Smart_Cb cb = NULL
+
+ if callback is not None:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+
+ if kind == ELM_INDEX_ITEM_INSERT_APPEND:
+ item = elm_index_item_append(index.obj, _cfruni(letter), cb, <void*>self)
+ elif kind == ELM_INDEX_ITEM_INSERT_PREPEND:
+ item = elm_index_item_prepend(index.obj, _cfruni(letter), cb, <void*>self)
+ #elif kind == ELM_INDEX_ITEM_INSERT_SORTED:
+ #item = elm_index_item_sorted_insert(index.obj, _cfruni(letter), cb, <void*>self, cmp_f, cmp_data_f)
+ else:
+ if before_after == None:
+ raise ValueError("need a valid after object to add an item before/after another item")
+ if kind == ELM_INDEX_ITEM_INSERT_BEFORE:
+ item = elm_index_item_insert_before(index.obj, before_after.item, _cfruni(letter), cb, <void*>self)
+ else:
+ item = elm_index_item_insert_after(index.obj, before_after.item, _cfruni(letter), cb, <void*>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def selected_set(self, selected):
+ elm_index_item_selected_set(self.item, selected)
+
+ property selected:
+ def __set__(self, selected):
+ elm_index_item_selected_set(self.item, selected)
+
+ def letter_get(self):
+ return _ctouni(elm_index_item_letter_get(self.item))
+
+ property letter:
+ def __get__(self):
+ return _ctouni(elm_index_item_letter_get(self.item))
+
+cdef Elm_Object_Item *_elm_index_item_from_python(IndexItem item):
+ if item is None:
+ return NULL
+ else:
+ return item.item
+
+
+cdef class Index(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_index_add(parent.obj))
+
+ def autohide_disabled_set(self, disabled):
+ elm_index_autohide_disabled_set(self.obj, disabled)
+
+ def autohide_disabled_get(self):
+ return bool(elm_index_autohide_disabled_get(self.obj))
+
+ property autohide_disabled:
+ def __get__(self):
+ return bool(elm_index_autohide_disabled_get(self.obj))
+
+ def __set__(self, disabled):
+ elm_index_autohide_disabled_set(self.obj, disabled)
+
+ def item_level_set(self, level):
+ elm_index_item_level_set(self.obj, level)
+
+ def item_level_get(self):
+ return elm_index_item_level_get(self.obj)
+
+ property item_level:
+ def __get__(self):
+ return elm_index_item_level_get(self.obj)
+ def __set__(self, level):
+ elm_index_item_level_set(self.obj, level)
+
+ def selected_item_get(self, level):
+ return _object_item_to_python(elm_index_selected_item_get(self.obj, level))
+
+ def item_append(self, letter, callback = None, *args, **kargs):
+ return IndexItem(ELM_INDEX_ITEM_INSERT_APPEND, self, letter,
+ None, callback, *args, **kargs)
+
+ def item_prepend(self, letter, callback = None, *args, **kargs):
+ return IndexItem(ELM_INDEX_ITEM_INSERT_PREPEND, self, letter,
+ None, callback, *args, **kargs)
+
+ def item_insert_after(self, IndexItem after, letter, callback = None, *args, **kargs):
+ return IndexItem(ELM_INDEX_ITEM_INSERT_AFTER, self, letter,
+ after, callback, *args, **kargs)
+
+ def item_insert_before(self, IndexItem before, letter, callback = None, *args, **kargs):
+ return IndexItem(ELM_INDEX_ITEM_INSERT_BEFORE, self, letter,
+ before, callback, *args, **kargs)
+
+ #def item_sorted_insert(self, letter, callback = None, *args, **kargs):
+ #return IndexItem(ELM_INDEX_ITEM_INSERT_SORTED, self, letter,
+ #None, callback, *args, **kargs)
+
+ def item_find(self, data):
+ # XXX: This doesn't seem right.
+ # return _object_item_to_python(elm_index_item_find(self.obj, <void*>data))
+ pass
+
+ def item_clear(self):
+ elm_index_item_clear(self.obj)
+
+ def level_go(self, level):
+ elm_index_level_go(self.obj, level)
+
+ def indicator_disabled_set(self, disabled):
+ elm_index_indicator_disabled_set(self.obj, disabled)
+
+ def indicator_disabled_get(self):
+ return bool(elm_index_indicator_disabled_get(self.obj))
+
+ property indicator_disabled:
+ def __get__(self):
+ return bool(elm_index_indicator_disabled_get(self.obj))
+ def __set__(self, disabled):
+ elm_index_indicator_disabled_set(self.obj, disabled)
+
+ def horizontal_set(self, horizontal):
+ elm_index_horizontal_set(self.obj, horizontal)
+
+ def horizontal_get(self):
+ return bool(elm_index_horizontal_get(self.obj))
+
+ property horizontal:
+ def __get__(self):
+ return bool(elm_index_horizontal_get(self.obj))
+ def __set__(self, horizontal):
+ elm_index_horizontal_set(self.obj, horizontal)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add_full("changed", _cb_object_item_conv, func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del_full("changed", _cb_object_item_conv, func)
+
+ def callback_delay_changed_add(self, func, *args, **kwargs):
+ self._callback_add_full("delay,changed", _cb_object_item_conv, func, *args, **kwargs)
+
+ def callback_delay_changed_del(self, func):
+ self._callback_del_full("delay,changed", _cb_object_item_conv, func)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_object_item_conv, func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_object_item_conv, func)
+
+ def callback_level_up_add(self, func, *args, **kwargs):
+ self._callback_add("level,up", func, *args, **kwargs)
+
+ def callback_level_up_del(self, func):
+ self._callback_del("level,up", func)
+
+ def callback_level_down_add(self, func, *args, **kwargs):
+ self._callback_add("level,down", func, *args, **kwargs)
+
+ def callback_level_down_del(self, func):
+ self._callback_del("level,down", func)
+
+
+_object_mapping_register("elm_index", Index)
diff --git a/efl/elementary/efl.elementary_innerwindow.pxi b/efl/elementary/efl.elementary_innerwindow.pxi
new file mode 100644
index 0000000..8cdb9ef
--- /dev/null
+++ b/efl/elementary/efl.elementary_innerwindow.pxi
@@ -0,0 +1,58 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class InnerWindow(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_win_inwin_add(parent.obj))
+
+ def activate(self):
+ elm_win_inwin_activate(self.obj)
+
+ def content_set(self, evasObject content):
+ cdef Evas_Object *o
+ if content is not None:
+ o = content.obj
+ else:
+ o = NULL
+ elm_win_inwin_content_set(self.obj, o)
+
+ def content_get(self):
+ return object_from_instance(elm_win_inwin_content_get(self.obj))
+
+ def content_unset(self):
+ return object_from_instance(elm_win_inwin_content_unset(self.obj))
+
+ property content:
+ def __get__(self):
+ return object_from_instance(elm_win_inwin_content_get(self.obj))
+
+ def __set__(self, evasObject content):
+ cdef Evas_Object *o
+ if content is not None:
+ o = content.obj
+ else:
+ o = NULL
+ elm_win_inwin_content_set(self.obj, o)
+
+ def __del__(self):
+ elm_win_inwin_content_unset(self.obj)
+
+
+_object_mapping_register("elm_inwin", InnerWindow)
diff --git a/efl/elementary/efl.elementary_label.pxi b/efl/elementary/efl.elementary_label.pxi
new file mode 100644
index 0000000..1241a63
--- /dev/null
+++ b/efl/elementary/efl.elementary_label.pxi
@@ -0,0 +1,91 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Label(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_label_add(parent.obj))
+
+ def line_wrap_set(self, Elm_Wrap_Type wrap):
+ elm_label_line_wrap_set(self.obj, wrap)
+
+ def line_wrap_get(self):
+ return elm_label_line_wrap_get(self.obj)
+
+ property line_wrap:
+ def __get__(self):
+ return elm_label_line_wrap_get(self.obj)
+ def __set__(self, wrap):
+ elm_label_line_wrap_set(self.obj, wrap)
+
+ def wrap_width_set(self, int w):
+ elm_label_wrap_width_set(self.obj, w)
+
+ def wrap_width_get(self):
+ return elm_label_wrap_width_get(self.obj)
+
+ property wrap_width:
+ def __get__(self):
+ return elm_label_wrap_width_get(self.obj)
+ def __set__(self, w):
+ elm_label_wrap_width_set(self.obj, w)
+
+ def ellipsis_set(self, bool ellipsis):
+ elm_label_ellipsis_set(self.obj, ellipsis)
+
+ def ellipsis_get(self):
+ return elm_label_ellipsis_get(self.obj)
+
+ property ellipsis:
+ def __get__(self):
+ return elm_label_ellipsis_get(self.obj)
+ def __set__(self, ellipsis):
+ elm_label_ellipsis_set(self.obj, ellipsis)
+
+ def slide_set(self, bool slide):
+ elm_label_slide_set(self.obj, slide)
+
+ def slide_get(self):
+ return elm_label_slide_get(self.obj)
+
+ property slide:
+ def __get__(self):
+ return elm_label_slide_get(self.obj)
+ def __set__(self, slide):
+ elm_label_slide_set(self.obj, slide)
+
+ def slide_duration_set(self, duration):
+ elm_label_slide_duration_set(self.obj, duration)
+
+ def slide_duration_get(self):
+ return elm_label_slide_duration_get(self.obj)
+
+ property slide_duration:
+ def __get__(self):
+ return elm_label_slide_duration_get(self.obj)
+ def __set__(self, duration):
+ elm_label_slide_duration_set(self.obj, duration)
+
+ def callback_language_changed_add(self, func, *args, **kwargs):
+ self._callback_add("language,changed", func, *args, **kwargs)
+
+ def callback_language_changed_del(self, func):
+ self._callback_del("language,changed", func)
+
+
+_object_mapping_register("elm_label", Label)
diff --git a/efl/elementary/efl.elementary_layout.pxi b/efl/elementary/efl.elementary_layout.pxi
new file mode 100644
index 0000000..39ae6e0
--- /dev/null
+++ b/efl/elementary/efl.elementary_layout.pxi
@@ -0,0 +1,45 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Layout(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_layout_add(parent.obj))
+
+ def content_set(self, swallow, evasObject content):
+ cdef Evas_Object *o
+ if content is not None:
+ o = content.obj
+ else:
+ o = NULL
+ elm_layout_content_set(self.obj, _cfruni(swallow), o)
+
+ def content_get(self, swallow):
+ return object_from_instance(elm_layout_content_get(self.obj, _cfruni(swallow)))
+
+ def content_unset(self, swallow):
+ return object_from_instance(elm_layout_content_unset(self.obj, _cfruni(swallow)))
+
+ def text_set(self, part, text):
+ elm_layout_text_set(self.obj, _cfruni(part), _cfruni(text))
+
+ def text_get(self, part):
+ return _ctouni(elm_layout_text_get(self.obj, _cfruni(part)))
+
+
+_object_mapping_register("elm_layout", Layout)
diff --git a/efl/elementary/efl.elementary_layout_class.pxi b/efl/elementary/efl.elementary_layout_class.pxi
new file mode 100644
index 0000000..25d30b2
--- /dev/null
+++ b/efl/elementary/efl.elementary_layout_class.pxi
@@ -0,0 +1,139 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class LayoutClass(Object):
+
+ def file_set(self, filename, group):
+ return bool(elm_layout_file_set(self.obj, _cfruni(filename), _cfruni(group)))
+
+ property file:
+ def __set__(self, value):
+ filename, group = value
+ # TODO: check return value
+ elm_layout_file_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ def theme_set(self, clas, group, style):
+ return bool(elm_layout_theme_set(self.obj, _cfruni(clas), _cfruni(group), _cfruni(style)))
+
+ property theme:
+ def __set__(self, theme):
+ clas, group, style = theme
+ # TODO: check return value
+ elm_layout_theme_set(self.obj, _cfruni(clas), _cfruni(group), _cfruni(style))
+
+ def signal_emit(self, emission, source):
+ elm_layout_signal_emit(self.obj, _cfruni(emission), _cfruni(source))
+
+ #def signal_callback_add(self, emission, source, func, data):
+ #elm_layout_signal_callback_add(self.obj, _cfruni(emission), _cfruni(source), Edje_Signal_Cb func, voiddata)
+
+ #def signal_callback_del(self, emission, source, func):
+ #elm_layout_signal_callback_del(self.obj, _cfruni(emission), _cfruni(source), Edje_Signal_Cb func)
+
+ def box_append(self, part, evasObject child):
+ return bool(elm_layout_box_append(self.obj, _cfruni(part), child.obj))
+
+ def box_prepend(self, part, evasObject child):
+ return bool(elm_layout_box_prepend(self.obj, _cfruni(part), child.obj))
+
+ def box_insert_before(self, part, evasObject child, evasObject reference):
+ return bool(elm_layout_box_insert_before(self.obj, _cfruni(part), child.obj, reference.obj))
+
+ def box_insert_at(self, part, evasObject child, pos):
+ return bool(elm_layout_box_insert_at(self.obj, _cfruni(part), child.obj, pos))
+
+ def box_remove(self, part, evasObject child):
+ return object_from_instance(elm_layout_box_remove(self.obj, _cfruni(part), child.obj))
+
+ def box_remove_all(self, part, clear):
+ return bool(elm_layout_box_remove_all(self.obj, _cfruni(part), clear))
+
+ def table_pack(self, part, evasObject child_obj, col, row, colspan, rowspan):
+ return bool(elm_layout_table_pack(self.obj, _cfruni(part), child_obj.obj, col, row, colspan, rowspan))
+
+ def table_unpack(self, part, evasObject child_obj):
+ return object_from_instance(elm_layout_table_unpack(self.obj, _cfruni(part), child_obj.obj))
+
+ def table_clear(self, part, clear):
+ return bool(elm_layout_table_clear(self.obj, _cfruni(part), clear))
+
+ def edje_get(self):
+ return object_from_instance(elm_layout_edje_get(self.obj))
+
+ property edje:
+ def __get__(self):
+ return object_from_instance(elm_layout_edje_get(self.obj))
+
+ def data_get(self, key):
+ return _ctouni(elm_layout_data_get(self.obj, _cfruni(key)))
+
+ def sizing_eval(self):
+ elm_layout_sizing_eval(self.obj)
+
+ def part_cursor_set(self, part_name, cursor):
+ return bool(elm_layout_part_cursor_set(self.obj, _cfruni(part_name), _cfruni(cursor)))
+
+ def part_cursor_get(self, part_name):
+ return _ctouni(elm_layout_part_cursor_get(self.obj, _cfruni(part_name)))
+
+ def part_cursor_unset(self, part_name):
+ return bool(elm_layout_part_cursor_unset(self.obj, _cfruni(part_name)))
+
+ def part_cursor_style_set(self, part_name, style):
+ return bool(elm_layout_part_cursor_style_set(self.obj, _cfruni(part_name), _cfruni(style)))
+
+ def part_cursor_style_get(self, part_name):
+ return _ctouni(elm_layout_part_cursor_style_get(self.obj, _cfruni(part_name)))
+
+ def part_cursor_engine_only_set(self, part_name, engine_only):
+ return bool(elm_layout_part_cursor_engine_only_set(self.obj, _cfruni(part_name), engine_only))
+
+ def part_cursor_engine_only_get(self, part_name):
+ return bool(elm_layout_part_cursor_engine_only_get(self.obj, _cfruni(part_name)))
+
+ def icon_set(self, evasObject icon):
+ elm_layout_icon_set(self.obj, icon.obj if icon else NULL)
+
+ def icon_get(self):
+ return object_from_instance(elm_layout_icon_get(self.obj))
+
+ property icon:
+ def __get__(self):
+ return object_from_instance(elm_layout_icon_get(self.obj))
+
+ def __set__(self, evasObject icon):
+ elm_layout_icon_set(self.obj, icon.obj if icon else NULL)
+
+ def end_set(self, evasObject end):
+ elm_layout_end_set(self.obj, end.obj if end else NULL)
+
+ def end_get(self):
+ return object_from_instance(elm_layout_end_get(self.obj))
+
+ property end:
+ def __get__(self):
+ return object_from_instance(elm_layout_end_get(self.obj))
+
+ def __set__(self, evasObject end):
+ elm_layout_end_set(self.obj, end.obj if end else NULL)
+
+ def callback_theme_changed_add(self, func, *args, **kwargs):
+ self._callback_add("theme,changed", func, *args, **kwargs)
+
+ def callback_theme_changed_del(self, func):
+ self._callback_del("theme,changed", func)
diff --git a/efl/elementary/efl.elementary_list.pxi b/efl/elementary/efl.elementary_list.pxi
new file mode 100644
index 0000000..47d2a45
--- /dev/null
+++ b/efl/elementary/efl.elementary_list.pxi
@@ -0,0 +1,381 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef enum Elm_List_Item_Insert_Kind:
+ ELM_LIST_ITEM_INSERT_APPEND
+ ELM_LIST_ITEM_INSERT_PREPEND
+ ELM_LIST_ITEM_INSERT_BEFORE
+ ELM_LIST_ITEM_INSERT_AFTER
+ ELM_LIST_ITEM_INSERT_SORTED
+
+cdef class ListItem(ObjectItem):
+
+ def __init__(self, kind, evasObject list, label, evasObject icon = None,
+ evasObject end = None, ListItem before_after = None,
+ callback = None, *args, **kargs):
+
+ cdef Evas_Object* icon_obj = NULL
+ cdef Evas_Object* end_obj = NULL
+ cdef Evas_Smart_Cb cb = NULL
+
+ if icon is not None:
+ icon_obj = icon.obj
+ if end is not None:
+ end_obj = end.obj
+
+ if callback is not None:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+
+ if kind == ELM_LIST_ITEM_INSERT_APPEND:
+ item = elm_list_item_append( list.obj,
+ _cfruni(label),
+ icon_obj,
+ end_obj,
+ cb,
+ <void*>self)
+
+ elif kind == ELM_LIST_ITEM_INSERT_PREPEND:
+ item = elm_list_item_prepend( list.obj,
+ _cfruni(label),
+ icon_obj,
+ end_obj,
+ cb,
+ <void*>self)
+
+ #elif kind == ELM_LIST_ITEM_INSERT_SORTED:
+ #item = elm_list_item_sorted_insert( list.obj,
+ #_cfruni(label),
+ #icon_obj,
+ #end_obj,
+ #cb,
+ #<void*>self,
+ #cmp_f)
+
+ else:
+ if before_after == None:
+ raise ValueError("need a valid after object to add an item before/after another item")
+
+ if kind == ELM_LIST_ITEM_INSERT_BEFORE:
+ item = elm_list_item_insert_before(list.obj,
+ before_after.item,
+ _cfruni(label),
+ icon_obj,
+ end_obj,
+ cb,
+ <void*>self)
+
+ else:
+ item = elm_list_item_insert_after( list.obj,
+ before_after.item,
+ _cfruni(label),
+ icon_obj,
+ end_obj,
+ cb,
+ <void*>self)
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def __str__(self):
+ return ("%s(label=%r, icon=%s, end=%s, "
+ "callback=%r, args=%r, kargs=%s)") % \
+ (self.__class__.__name__, self.text_get(), bool(self.part_content_get("icon")),
+ bool(self.part_content_get("end")), self.params[0], self.params[1], self.params[2])
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
+ "label=%r, icon=%s, end=%s, "
+ "callback=%r, args=%r, kargs=%s)") % \
+ (self.__class__.__name__, <unsigned long><void *>self,
+ PY_REFCOUNT(self), <unsigned long><void *>self.item,
+ self.text_get(), bool(self.part_content_get("icon")),
+ bool(self.part_content_get("end")), self.params[0], self.params[1], self.params[2])
+
+ def selected_set(self, selected):
+ elm_list_item_selected_set(self.item, selected)
+
+ def selected_get(self):
+ return bool(elm_list_item_selected_get(self.item))
+
+ property selected:
+ def __get__(self):
+ return bool(elm_list_item_selected_get(self.item))
+
+ def __set__(self, selected):
+ elm_list_item_selected_set(self.item, selected)
+
+ def separator_set(self, separator):
+ elm_list_item_separator_set(self.item, separator)
+
+ def separator_get(self):
+ return bool(elm_list_item_separator_get(self.item))
+
+ property separator:
+ def __get__(self):
+ return bool(elm_list_item_separator_get(self.item))
+
+ def __set__(self, separator):
+ elm_list_item_separator_set(self.item, separator)
+
+ def show(self):
+ elm_list_item_show(self.item)
+
+ def bring_in(self):
+ elm_list_item_bring_in(self.item)
+
+ def object_get(self):
+ return object_from_instance(elm_list_item_object_get(self.item))
+
+ property object:
+ def __get__(self):
+ return object_from_instance(elm_list_item_object_get(self.item))
+
+ def prev_get(self):
+ return _object_item_to_python(elm_list_item_prev(self.item))
+
+ property prev:
+ def __get__(self):
+ return _object_item_to_python(elm_list_item_prev(self.item))
+
+ def next_get(self):
+ return _object_item_to_python(elm_list_item_next(self.item))
+
+ property next:
+ def __get__(self):
+ return _object_item_to_python(elm_list_item_next(self.item))
+
+cdef class List(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_list_add(parent.obj))
+
+ def go(self):
+ elm_list_go(self.obj)
+
+ def multi_select_set(self, multi):
+ elm_list_multi_select_set(self.obj, multi)
+
+ def multi_select_get(self):
+ return bool(elm_list_multi_select_get(self.obj))
+
+ property multi_select:
+ def __get__(self):
+ return elm_list_multi_select_get(self.obj)
+
+ def __set__(self, multi):
+ elm_list_multi_select_set(self.obj, multi)
+
+ def mode_set(self, Elm_List_Mode mode):
+ elm_list_mode_set(self.obj, mode)
+
+ def mode_get(self):
+ return elm_list_mode_get(self.obj)
+
+ property mode:
+ def __get__(self):
+ return elm_list_mode_get(self.obj)
+
+ def __set__(self, Elm_List_Mode mode):
+ elm_list_mode_set(self.obj, mode)
+
+ property horizontal:
+ def __get__(self):
+ return elm_list_horizontal_get(self.obj)
+
+ def __set__(self, horizontal):
+ elm_list_horizontal_set(self.obj, horizontal)
+
+ def select_mode_set(self, mode):
+ elm_list_select_mode_set(self.obj, mode)
+
+ def select_mode_get(self):
+ return elm_list_select_mode_get(self.obj)
+
+ property select_mode:
+ def __set__(self, mode):
+ elm_list_select_mode_set(self.obj, mode)
+
+ def __get__(self):
+ return elm_list_select_mode_get(self.obj)
+
+ def bounce_set(self, h, v):
+ elm_scroller_bounce_set(self.obj, h, v)
+
+ def bounce_get(self):
+ cdef Eina_Bool h, v
+ elm_scroller_bounce_get(self.obj, &h, &v)
+ return (h, v)
+
+ property bounce:
+ def __set__(self, value):
+ h, v = value
+ elm_scroller_bounce_set(self.obj, h, v)
+
+ def scroller_policy_set(self, policy_h, policy_v):
+ elm_scroller_policy_set(self.obj, policy_h, policy_v)
+
+ def scroller_policy_get(self):
+ cdef Elm_Scroller_Policy policy_h, policy_v
+ elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
+ return (policy_h, policy_v)
+
+ property scroller_policy:
+ def __set__(self, value):
+ policy_h, policy_v = value
+ elm_scroller_policy_set(self.obj, policy_h, policy_v)
+
+ def __get__(self):
+ cdef Elm_Scroller_Policy policy_h, policy_v
+ elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
+ return (policy_h, policy_v)
+
+ def item_append(self, label, evasObject icon = None,
+ evasObject end = None, callback = None, *args, **kargs):
+ return ListItem(ELM_LIST_ITEM_INSERT_APPEND, self, label, icon, end,
+ None, callback, *args, **kargs)
+
+ def item_prepend(self, label, evasObject icon = None,
+ evasObject end = None, callback = None, *args, **kargs):
+ return ListItem(ELM_LIST_ITEM_INSERT_PREPEND, self, label, icon, end,
+ None, callback, *args, **kargs)
+
+ def item_insert_before(self, ListItem before, label, evasObject icon = None,
+ evasObject end = None, callback = None, *args, **kargs):
+ return ListItem(ELM_LIST_ITEM_INSERT_BEFORE, self, label, icon, end,
+ before, callback, *args, **kargs)
+
+ def item_insert_after(self, ListItem after, label, evasObject icon = None,
+ evasObject end = None, callback = None, *args, **kargs):
+ return ListItem(ELM_LIST_ITEM_INSERT_AFTER, self, label, icon, end,
+ after, callback, *args, **kargs)
+
+ #def item_sorted_insert(self, label, evasObject icon = None,
+ #evasObject end = None, callback = None, cmp_func=None, *args, **kargs):
+ #return ListItem(ELM_LIST_ITEM_INSERT_SORTED, self, label, icon, end,
+ #None, callback, *args, **kargs)
+
+ def clear(self):
+ elm_list_clear(self.obj)
+
+ def items_get(self):
+ return _object_item_list_to_python(elm_list_items_get(self.obj))
+
+ property items:
+ def __get__(self):
+ return _object_item_list_to_python(elm_list_items_get(self.obj))
+
+ def selected_item_get(self):
+ return _object_item_to_python(elm_list_selected_item_get(self.obj))
+
+ property selected_item:
+ def __get__(self):
+ return _object_item_to_python(elm_list_selected_item_get(self.obj))
+
+ def selected_items_get(self):
+ return _object_item_list_to_python(elm_list_selected_items_get(self.obj))
+
+ property selected_items:
+ def __get__(self):
+ return _object_item_list_to_python(elm_list_selected_items_get(self.obj))
+
+ def first_item_get(self):
+ return _object_item_to_python(elm_list_first_item_get(self.obj))
+
+ property first_item:
+ def __get__(self):
+ return _object_item_to_python(elm_list_first_item_get(self.obj))
+
+ def last_item_get(self):
+ return _object_item_to_python(elm_list_last_item_get(self.obj))
+
+ property last_item:
+ def __get__(self):
+ return _object_item_to_python(elm_list_last_item_get(self.obj))
+
+ def callback_activated_add(self, func, *args, **kwargs):
+ self._callback_add_full("activated", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_activated_del(self, func):
+ self._callback_del_full("activated", _cb_object_item_conv, func)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add_full("clicked,double", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del_full("clicked,double", _cb_object_item_conv, func)
+
+ def callback_selected_add(self, func, *args, **kwargs):
+ self._callback_add_full("selected", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_selected_del(self, func):
+ self._callback_del_full("selected", _cb_object_item_conv, func)
+
+ def callback_unselected_add(self, func, *args, **kwargs):
+ self._callback_add_full("unselected", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_unselected_del(self, func):
+ self._callback_del_full("unselected", _cb_object_item_conv, func)
+
+ def callback_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add_full("longpressed", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_longpressed_del(self, func):
+ self._callback_del_full("longpressed", _cb_object_item_conv, func)
+
+ def callback_edge_top_add(self, func, *args, **kwargs):
+ self._callback_add("edge,top", func, *args, **kwargs)
+
+ def callback_edge_top_del(self, func):
+ self._callback_del("edge,top", func)
+
+ def callback_edge_bottom_add(self, func, *args, **kwargs):
+ self._callback_add("edge,bottom", func, *args, **kwargs)
+
+ def callback_edge_bottom_del(self, func):
+ self._callback_del("edge,bottom", func)
+
+ def callback_edge_left_add(self, func, *args, **kwargs):
+ self._callback_add("edge,left", func, *args, **kwargs)
+
+ def callback_edge_left_del(self, func):
+ self._callback_del("edge,left", func)
+
+ def callback_edge_right_add(self, func, *args, **kwargs):
+ self._callback_add("edge,right", func, *args, **kwargs)
+
+ def callback_edge_right_del(self, func):
+ self._callback_del("edge,right", func)
+
+ def callback_language_changed_add(self, func, *args, **kwargs):
+ self._callback_add("language,changed", func, *args, **kwargs)
+
+ def callback_language_changed_del(self, func):
+ self._callback_del("language,changed", func)
+
+
+_object_mapping_register("elm_list", List)
diff --git a/efl/elementary/efl.elementary_map.pxi b/efl/elementary/efl.elementary_map.pxi
new file mode 100644
index 0000000..6436326
--- /dev/null
+++ b/efl/elementary/efl.elementary_map.pxi
@@ -0,0 +1,790 @@
+# Copyright (c) 2012 Davide Andreoli <dave@gurumeditation.it>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef _elm_map_overlay_to_python(Elm_Map_Overlay *ov):
+ cdef void *data
+
+ if ov == NULL:
+ return None
+ data = elm_map_overlay_data_get(ov)
+ if data == NULL:
+ return None
+ return <object>data
+
+cdef void _map_overlay_get_callback(void *data, Evas_Object *map, Elm_Map_Overlay *overlay) with gil:
+ cdef Object obj
+
+# obj = <Object>evas_object_data_get(map, "python-evas")
+ obj = object_from_instance(map)
+ try:
+ (func, args, kwargs) = <object>data
+ func(obj, _elm_map_overlay_to_python(overlay), *args, **kwargs)
+ except Exception, e:
+ traceback.print_exc()
+
+cdef void _map_overlay_del_cb(void *data, Evas_Object *map, Elm_Map_Overlay *overlay) with gil:
+ ov = <object>data
+ ov.__del_cb()
+
+cdef void _map_route_callback(void *data, Evas_Object *map, Elm_Map_Route *route) with gil:
+ cdef Object obj
+
+# obj = <Object>evas_object_data_get(map, "python-evas")
+ obj = object_from_instance(map)
+ (proute, func, args, kwargs) = <object>data
+ try:
+ func(obj, proute, *args, **kwargs)
+ except Exception, e:
+ traceback.print_exc()
+
+ Py_DECREF(<object>data)
+
+cdef void _map_name_callback(void *data, Evas_Object *map, Elm_Map_Name *name) with gil:
+ cdef Object obj
+
+# obj = <Object>evas_object_data_get(map, "python-evas")
+ obj = object_from_instance(map)
+ (pname, func, args, kwargs) = <object>data
+ try:
+ func(obj, pname, *args, **kwargs)
+ except Exception, e:
+ traceback.print_exc()
+
+ Py_DECREF(<object>data)
+
+
+cdef class MapRoute(object):
+ cdef Elm_Map_Route *route
+
+ def __cinit__(self):
+ self.route = NULL
+
+ def __init__(self, evasObject map,
+ Elm_Map_Route_Type type, Elm_Map_Route_Method method,
+ double flon, double flat, double tlon, double tlat,
+ func, *args, **kwargs):
+
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ data = (self, func, args, kwargs)
+ self.route = elm_map_route_add(map.obj, type, method,
+ flon, flat, tlon, tlat,
+ _map_route_callback, <void *>data)
+ Py_INCREF(data)
+ Py_INCREF(self)
+
+ def delete(self):
+ elm_map_route_del(self.route)
+ self.route = NULL
+ Py_DECREF(self)
+
+ def distance_get(self):
+ return elm_map_route_distance_get(self.route)
+
+ property distance:
+ def __get__(self):
+ return self.distance_get()
+
+ def node_get(self):
+ return elm_map_route_node_get(self.route)
+
+ property node:
+ def __get__(self):
+ return self.node_get()
+
+ def waypoint_get(self):
+ return elm_map_route_waypoint_get(self.route)
+
+ property waypoint:
+ def __get__(self):
+ return self.waypoint_get()
+
+
+cdef class MapName(object):
+ cdef Elm_Map_Name *name
+
+ def __cinit__(self):
+ self.name = NULL
+
+ def __init__(self, evasObject map, address, double lon, double lat,
+ func, *args, **kwargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ data = (self, func, args, kwargs)
+ if address:
+ self.name = elm_map_name_add(map.obj, address, lon, lat,
+ _map_name_callback, <void *>data)
+ else:
+ self.name = elm_map_name_add(map.obj, NULL, lon, lat,
+ _map_name_callback, <void *>data)
+ Py_INCREF(data)
+ Py_INCREF(self)
+
+ def delete(self):
+ elm_map_name_del(self.name)
+ self.name = NULL
+ Py_DECREF(self)
+
+ def address_get(self):
+ return _ctouni(elm_map_name_address_get(self.name))
+
+ property address:
+ def __get__(self):
+ return self.address_get()
+
+ def region_get(self):
+ cdef double lon, lat
+
+ elm_map_name_region_get(self.name, &lon, &lat)
+ return (lon, lat)
+
+ property region:
+ def __get__(self):
+ return self.region_get()
+
+
+cdef class MapOverlay(object):
+ cdef Elm_Map_Overlay *overlay
+ cdef void* cb_get_data
+
+ def __cinit__(self):
+ self.overlay = NULL
+ self.cb_get_data = NULL
+
+ def __init__(self, evasObject Map, double lon, double lat):
+ self.overlay = elm_map_overlay_add(Map.obj, lon, lat)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+ def __del_cb(self):
+ self.overlay = NULL
+ Py_DECREF(self)
+
+ def delete(self):
+ if self.overlay == NULL:
+ raise ValueError("Object already deleted")
+ elm_map_overlay_del(self.overlay)
+
+ def type_get(self):
+ return elm_map_overlay_type_get(self.overlay)
+
+ property type:
+ def __get__(self):
+ return self.type_get()
+
+ def hide_set(self, hide):
+ elm_map_overlay_hide_set(self.overlay, bool(hide))
+
+ def hide_get(self):
+ return bool(elm_map_overlay_hide_get(self.overlay))
+
+ property hide:
+ def __get__(self):
+ return self.hide_get()
+ def __set__(self, value):
+ self.hide_set(value)
+
+ def displayed_zoom_min_set(self, zoom):
+ elm_map_overlay_displayed_zoom_min_set(self.overlay, zoom)
+
+ def displayed_zoom_min_get(self):
+ return elm_map_overlay_displayed_zoom_min_get(self.overlay)
+
+ property displayed_zoom_min:
+ def __get__(self):
+ return self.displayed_zoom_min_get()
+ def __set__(self, value):
+ self.displayed_zoom_min_set(value)
+
+ def paused_set(self, paused):
+ elm_map_overlay_paused_set(self.overlay, paused)
+
+ def paused_get(self):
+ return elm_map_overlay_paused_get(self.overlay)
+
+ property paused:
+ def __get__(self):
+ return self.paused_get()
+ def __set__(self, value):
+ self.paused_set(value)
+
+ def visible_get(self):
+ return bool(elm_map_overlay_visible_get(self.overlay))
+
+ property visible:
+ def __get__(self):
+ return self.visible_get()
+
+ def content_set(self, Object content):
+ elm_map_overlay_content_set(self.overlay, content.obj)
+
+ def content_get(self):
+ return object_from_instance(elm_map_overlay_content_get(self.overlay))
+
+ property content:
+ def __get__(self):
+ return self.content_get()
+ def __set__(self, value):
+ self.content_set(value)
+
+ def icon_set(self, Object icon):
+ elm_map_overlay_icon_set(self.overlay, icon.obj)
+
+ def icon_get(self):
+ return object_from_instance(elm_map_overlay_icon_get(self.overlay))
+
+ property icon:
+ def __get__(self):
+ return self.icon_get()
+ def __set__(self, value):
+ self.icon_set(value)
+
+ def region_set(self, lon, lat):
+ elm_map_overlay_region_set(self.overlay, lon, lat)
+
+ def region_get(self):
+ cdef double lon, lat
+ elm_map_overlay_region_get(self.overlay, &lon, &lat)
+ return (lon, lat)
+
+ property region:
+ def __get__(self):
+ return self.region_get()
+ def __set__(self, value):
+ self.region_set(*value)
+
+ def color_set(self, r, g, b, a):
+ elm_map_overlay_color_set(self.overlay, r, g, b, a)
+
+ def color_get(self):
+ cdef int r, g, b, a
+ elm_map_overlay_color_get(self.overlay, &r, &g, &b, &a)
+ return (r, g, b, a)
+
+ property color:
+ def __get__(self):
+ return self.color_get()
+ def __set__(self, value):
+ self.color_set(*value)
+
+ def show(self):
+ elm_map_overlay_show(self.overlay)
+
+ def callback_clicked_set(self, func, *args, **kwargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+ cb_data = (func, args, kwargs)
+ elm_map_overlay_get_cb_set(self.overlay, _map_overlay_get_callback,
+ <void *>cb_data)
+ Py_INCREF(cb_data)
+ self.cb_get_data
+
+ def callback_clicked_unset(self, func):
+ elm_map_overlay_get_cb_set(self.overlay, NULL, NULL)
+ cb_data = <object>self.cb_get_data
+ self.cb_get_data = NULL
+ Py_DECREF(cb_data)
+
+
+cdef class MapOverlayClass(MapOverlay):
+
+ def __init__(self, evasObject Map):
+ self.overlay = elm_map_overlay_class_add(Map.obj)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+ def append(self, MapOverlay overlay):
+ elm_map_overlay_class_append(self.overlay, overlay.overlay)
+
+ def remove(self, MapOverlay overlay):
+ elm_map_overlay_class_remove(self.overlay, overlay.overlay)
+
+ def zoom_max_set(self, zoom):
+ elm_map_overlay_class_zoom_max_set(self.overlay, zoom)
+
+ def zoom_max_get(self):
+ return elm_map_overlay_class_zoom_max_get(self.overlay)
+
+ property zoom_max:
+ def __get__(self):
+ return self.zoom_max_get()
+ def __set__(self, value):
+ self.zoom_max_set(value)
+
+ def members_get(self):
+ cdef Eina_List *lst
+ cdef Elm_Map_Overlay *ov
+ lst = elm_map_overlay_group_members_get(self.overlay)# TODO this is somehow wrong... group <> class
+
+ ret = []
+ ret_append = ret.append
+ while lst:
+ ov = <Elm_Map_Overlay *>lst.data
+ lst = lst.next
+ o = _elm_map_overlay_to_python(ov)
+ if o is not None:
+ ret_append(o)
+ return ret
+
+ property members:
+ def __get__(self):
+ return self.members_get()
+
+
+cdef class MapOverlayBubble(MapOverlay):
+
+ def __init__(self, evasObject Map):
+ self.overlay = elm_map_overlay_bubble_add(Map.obj)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+ def follow(self, MapOverlay overlay):
+ elm_map_overlay_bubble_follow(self.overlay, overlay.overlay)
+
+ def content_append(self, evasObject content):
+ elm_map_overlay_bubble_content_append(self.overlay, content.obj)
+
+ def content_clear(self):
+ elm_map_overlay_bubble_content_clear(self.overlay)
+
+
+cdef class MapOverlayLine(MapOverlay):
+
+ def __init__(self, evasObject Map, flon, flat, tlot, tlat):
+ self.overlay = elm_map_overlay_line_add(Map.obj, flon, flat, tlot, tlat)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+
+cdef class MapOverlayPolygon(MapOverlay):
+
+ def __init__(self, evasObject Map):
+ self.overlay = elm_map_overlay_polygon_add(Map.obj)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+ def region_add(self, lon, lat):
+ elm_map_overlay_polygon_region_add(self.overlay, lon, lat)
+
+
+cdef class MapOverlayCircle(MapOverlay):
+
+ def __init__(self, evasObject Map, lon, lat, radius):
+ self.overlay = elm_map_overlay_circle_add(Map.obj, lon, lat, radius)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+
+cdef class MapOverlayScale(MapOverlay):
+
+ def __init__(self, evasObject Map, x, y):
+ self.overlay = elm_map_overlay_scale_add(Map.obj, x, y)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+
+cdef class MapOverlayRoute(MapOverlay):
+
+ def __init__(self, evasObject Map, MapRoute route):
+ self.overlay = elm_map_overlay_route_add(Map.obj, route.route)
+ elm_map_overlay_data_set(self.overlay, <void *>self)
+ elm_map_overlay_del_cb_set(self.overlay, _map_overlay_del_cb, <void *>self)
+ Py_INCREF(self)
+
+
+cdef class Map(Object):
+
+ def __init__(self, evasObject parent):
+# Object.__init__(self, parent.evas)
+ self._set_obj(elm_map_add(parent.obj))
+
+ def zoom_set(self, zoom):
+ elm_map_zoom_set(self.obj, zoom)
+
+ def zoom_get(self):
+ return elm_map_zoom_get(self.obj)
+
+ property zoom:
+ def __get__(self):
+ return self.zoom_get()
+ def __set__(self, value):
+ self.zoom_set(value)
+
+ def zoom_mode_set(self, mode):
+ elm_map_zoom_mode_set(self.obj, mode)
+
+ def zoom_mode_get(self):
+ return elm_map_zoom_mode_get(self.obj)
+
+ property zoom_mode:
+ def __get__(self):
+ return self.zoom_mode_get()
+ def __set__(self, value):
+ self.zoom_mode_set(value)
+
+ def zoom_min_set(self, zoom):
+ elm_map_zoom_min_set(self.obj, zoom)
+
+ def zoom_min_get(self):
+ return elm_map_zoom_min_get(self.obj)
+
+ property zoom_min:
+ def __get__(self):
+ return self.zoom_min_get()
+ def __set__(self, value):
+ self.zoom_min_set(value)
+
+ def zoom_max_set(self, zoom):
+ elm_map_zoom_max_set(self.obj, zoom)
+
+ def zoom_max_get(self):
+ return elm_map_zoom_max_get(self.obj)
+
+ property zoom_max:
+ def __get__(self):
+ return self.zoom_max_get()
+ def __set__(self, value):
+ self.zoom_max_set(value)
+
+ def region_get(self):
+ cdef double lon, lat
+ elm_map_region_get(self.obj, &lon, &lat)
+ return (lon, lat)
+
+ property region:
+ def __get__(self):
+ return self.region_get()
+
+ def region_bring_in(self, lon, lat):
+ elm_map_region_bring_in(self.obj, lon, lat)
+
+ def region_show(self, lon, lat):
+ elm_map_region_show(self.obj, lon, lat)
+
+ def canvas_to_region_convert(self, x, y):
+ cdef double lon, lat
+ elm_map_canvas_to_region_convert(self.obj, x, y, &lon, &lat)
+ return (lon, lat)
+
+ def region_to_canvas_convert(self, lon, lat):
+ cdef Evas_Coord x, y
+ elm_map_region_to_canvas_convert(self.obj, lon, lat, &x, &y)
+ return (x, y)
+
+ def paused_set(self, paused):
+ elm_map_paused_set(self.obj, bool(paused))
+
+ def paused_get(self):
+ return bool(elm_map_paused_get(self.obj))
+
+ property paused:
+ def __get__(self):
+ return self.paused_get()
+ def __set__(self, value):
+ self.paused_set(value)
+
+ def rotate_set(self, degree, cx, cy):
+ elm_map_rotate_set(self.obj, degree, cx, cy)
+
+ def rotate_get(self):
+ cdef double degree
+ cdef Evas_Coord cx, cy
+ elm_map_rotate_get(self.obj, &degree, &cx, &cy)
+ return (degree, cx, cy)
+
+ property rotate:
+ def __get__(self):
+ return self.rotate_get()
+ def __set__(self, value):
+ self.rotate_set(*value)
+
+ def wheel_disabled_set(self, disabled):
+ elm_map_wheel_disabled_set(self.obj, bool(disabled))
+
+ def wheel_disabled_get(self):
+ return bool(elm_map_wheel_disabled_get(self.obj))
+
+ property wheel_disabled:
+ def __get__(self):
+ return self.wheel_disabled_get()
+ def __set__(self, value):
+ self.wheel_disabled_set(value)
+
+ def user_agent_set(self, user_agent):
+ elm_map_user_agent_set(self.obj, user_agent)
+
+ def user_agent_get(self):
+ return elm_map_user_agent_get(self.obj)
+
+ property user_agent:
+ def __get__(self):
+ return self.user_agent_get()
+ def __set__(self, value):
+ self.user_agent_set(value)
+
+ def overlay_add(self, lon, lat):
+ return MapOverlay(self, lon, lat)
+
+ def overlays_get(self):
+ cdef Eina_List *lst
+ cdef Elm_Map_Overlay *ov
+ lst = elm_map_overlays_get(self.obj)
+
+ ret = []
+ ret_append = ret.append
+ while lst:
+ ov = <Elm_Map_Overlay *>lst.data
+ lst = lst.next
+ o = _elm_map_overlay_to_python(ov)
+ if o is not None:
+ ret_append(o)
+ return ret
+
+ property overlays:
+ def __get__(self):
+ return self.overlays_get()
+
+ def overlays_show(self, overlays):
+ cdef Eina_List *lst
+
+ lst = NULL
+ for overlay in overlays:
+ ov = <MapOverlay>overlay
+ lst = eina_list_append(lst, ov.overlay)
+ elm_map_overlays_show(lst)
+ eina_list_free(lst)
+
+ def overlay_bubble_add(self):
+ return MapOverlayBubble(self)
+
+ def overlay_line_add(self, flon, flat, tlon, tlat):
+ return MapOverlayLine(self, flon, flat, tlon, tlat)
+
+ def overlay_polygon_add(self):
+ return MapOverlayPolygon(self)
+
+ def overlay_circle_add(self, lon, lat, radius):
+ return MapOverlayCircle(self, lon, lat, radius)
+
+ def overlay_scale_add(self, x, y):
+ return MapOverlayScale(self, x, y)
+
+ def overlay_class_add(self):
+ return MapOverlayClass(self)
+
+ def overlay_route_add(self, route):
+ return MapOverlayRoute(self, route)
+
+ def tile_load_status_get(self):
+ cdef int try_num, finish_num
+
+ elm_map_tile_load_status_get(self.obj, &try_num, &finish_num)
+ return (try_num, finish_num)
+
+ property tile_load_status_get:
+ def __get__(self):
+ return self.tile_load_status_get_get()
+
+ def sources_get(self, type):
+ cdef const_char_ptr *lst
+
+ i = 0
+ ret = []
+ lst = elm_map_sources_get(self.obj, type)
+ while (lst[i]):
+ ret.append(_ctouni(lst[i]))
+ i += 1
+
+ return ret
+
+ def source_set(self, type, source_name):
+ elm_map_source_set(self.obj, type, _cfruni(source_name))
+
+ def source_get(self, type):
+ return _ctouni(elm_map_source_get(self.obj, type))
+
+ def route_add(self, Elm_Map_Route_Type type, Elm_Map_Route_Method method,
+ double flon, double flat, double tlon, double tlat,
+ route_cb, *args, **kwargs):
+ return MapRoute(self, type, method, flon, flat, tlon, tlat,
+ route_cb, *args, **kwargs)
+
+ def name_add(self, address, double lon, double lat,
+ name_cb, *args, **kwargs):
+ return MapName(self, address, lon, lat, name_cb, *args, **kwargs)
+
+ # TODO elm_map_track_add
+
+ # TODO elm_map_track_remove
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add("clicked,double", func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del("clicked,double", func)
+
+ def callback_press_add(self, func, *args, **kwargs):
+ self._callback_add("press", func, *args, **kwargs)
+
+ def callback_press_del(self, func):
+ self._callback_del("press", func)
+
+ def callback_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add("longpressed", func, *args, **kwargs)
+
+ def callback_longpressed_del(self, func):
+ self._callback_del("longpressed", func)
+
+ def callback_scroll_add(self, func, *args, **kwargs):
+ self._callback_add("scroll", func, *args, **kwargs)
+
+ def callback_scroll_del(self, func):
+ self._callback_del("scroll", func)
+
+ def callback_scroll_drag_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,start", func, *args, **kwargs)
+
+ def callback_scroll_drag_start_del(self, func):
+ self._callback_del("scroll,drag,start", func)
+
+ def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,stop", func, *args, **kwargs)
+
+ def callback_scroll_drag_stop_del(self, func):
+ self._callback_del("scroll,drag,stop", func)
+
+ def callback_scroll_anim_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,start", func, *args, **kwargs)
+
+ def callback_scroll_anim_start_del(self, func):
+ self._callback_del("scroll,anim,start", func)
+
+ def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,stop", func, *args, **kwargs)
+
+ def callback_scroll_anim_stop_del(self, func):
+ self._callback_del("scroll,anim,stop", func)
+
+ def callback_zoom_start_add(self, func, *args, **kwargs):
+ self._callback_add("zoom,start", func, *args, **kwargs)
+
+ def callback_zoom_start_del(self, func):
+ self._callback_del("zoom,start", func)
+
+ def callback_zoom_stop_add(self, func, *args, **kwargs):
+ self._callback_add("zoom,stop", func, *args, **kwargs)
+
+ def callback_zoom_stop_del(self, func):
+ self._callback_del("zoom,stop", func)
+
+ def callback_zoom_change_add(self, func, *args, **kwargs):
+ self._callback_add("zoom,change", func, *args, **kwargs)
+
+ def callback_zoom_change_del(self, func):
+ self._callback_del("zoom,change", func)
+
+ def callback_tile_load_add(self, func, *args, **kwargs):
+ self._callback_add("tile,load", func, *args, **kwargs)
+
+ def callback_tile_load_del(self, func):
+ self._callback_del("tile,load", func)
+
+ def callback_tile_loaded_add(self, func, *args, **kwargs):
+ self._callback_add("tile,loaded", func, *args, **kwargs)
+
+ def callback_tile_loaded_del(self, func):
+ self._callback_del("tile,loaded", func)
+
+ def callback_tile_loaded_fail_add(self, func, *args, **kwargs):
+ self._callback_add("tile,loaded,fail", func, *args, **kwargs)
+
+ def callback_tile_loaded_fail_del(self, func):
+ self._callback_del("tile,loaded,fail", func)
+
+ def callback_route_load_add(self, func, *args, **kwargs):
+ self._callback_add("route,load", func, *args, **kwargs)
+
+ def callback_route_load_del(self, func):
+ self._callback_del("route,load", func)
+
+ def callback_route_loaded_add(self, func, *args, **kwargs):
+ self._callback_add("route,loaded", func, *args, **kwargs)
+
+ def callback_route_loaded_del(self, func):
+ self._callback_del("route,loaded", func)
+
+ def callback_route_loaded_fail_add(self, func, *args, **kwargs):
+ self._callback_add("route,loaded,fail", func, *args, **kwargs)
+
+ def callback_route_loaded_fail_del(self, func):
+ self._callback_del("route,loaded,fail", func)
+
+ def callback_name_load_add(self, func, *args, **kwargs):
+ self._callback_add("name,load", func, *args, **kwargs)
+
+ def callback_name_load_del(self, func):
+ self._callback_del("name,load", func)
+
+ def callback_name_loaded_add(self, func, *args, **kwargs):
+ self._callback_add("name,loaded", func, *args, **kwargs)
+
+ def callback_name_loaded_del(self, func):
+ self._callback_del("name,loaded", func)
+
+ def callback_name_loaded_fail_add(self, func, *args, **kwargs):
+ self._callback_add("name,loaded,fail", func, *args, **kwargs)
+
+ def callback_name_loaded_fail_del(self, func):
+ self._callback_del("name,loaded,fail", func)
+
+ def callback_overlay_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("overlay,clicked", func, *args, **kwargs)
+
+ def callback_overlay_clicked_del(self, func):
+ self._callback_del("overlay,clicked", func)
+
+ def callback_overlay_del_add(self, func, *args, **kwargs):
+ self._callback_add("overlay,del", func, *args, **kwargs)
+
+ def callback_overlay_del_del(self, func):
+ self._callback_del("overlay,del", func)
+
+ def callback_loaded_add(self, func, *args, **kwargs):
+ self._callback_add("loaded", func, *args, **kwargs)
+
+ def callback_loaded_del(self, func):
+ self._callback_del("loaded", func)
+
+
+_object_mapping_register("elm_map", Map)
diff --git a/efl/elementary/efl.elementary_mapbuf.pxi b/efl/elementary/efl.elementary_mapbuf.pxi
new file mode 100644
index 0000000..ff1200f
--- /dev/null
+++ b/efl/elementary/efl.elementary_mapbuf.pxi
@@ -0,0 +1,61 @@
+# Copyright (c) 2012 Davide Andreoli <dave@gurumeditation.it>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Mapbuf(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_mapbuf_add(parent.obj))
+
+ def enabled_set(self, enabled):
+ elm_mapbuf_enabled_set(self.obj, enabled)
+
+ def enabled_get(self):
+ return bool(elm_mapbuf_enabled_get(self.obj))
+
+ property enabled:
+ def __get__(self):
+ return bool(elm_mapbuf_enabled_get(self.obj))
+ def __set__(self, enabled):
+ elm_mapbuf_enabled_set(self.obj, enabled)
+
+ def smooth_set(self, smooth):
+ elm_mapbuf_smooth_set(self.obj, smooth)
+
+ def smooth_get(self):
+ return bool(elm_mapbuf_smooth_get(self.obj))
+
+ property smooth:
+ def __get__(self):
+ return bool(elm_mapbuf_smooth_get(self.obj))
+ def __set__(self, smooth):
+ elm_mapbuf_smooth_set(self.obj, smooth)
+
+ def alpha_set(self, alpha):
+ elm_mapbuf_alpha_set(self.obj, alpha)
+
+ def alpha_get(self):
+ return bool(elm_mapbuf_alpha_get(self.obj))
+
+ property alpha:
+ def __get__(self):
+ return bool(elm_mapbuf_alpha_get(self.obj))
+ def __set__(self, alpha):
+ elm_mapbuf_alpha_set(self.obj, alpha)
+
+
+_object_mapping_register("elm_mapbuf", Mapbuf)
diff --git a/efl/elementary/efl.elementary_menu.pxi b/efl/elementary/efl.elementary_menu.pxi
new file mode 100644
index 0000000..139bd3b
--- /dev/null
+++ b/efl/elementary/efl.elementary_menu.pxi
@@ -0,0 +1,208 @@
+# Copyright (c) 2010 Boris Faure
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class MenuItem(ObjectItem):
+
+ def __init__( self,
+ evasObject menu,
+ MenuItem parent = None,
+ label = None,
+ icon = None,
+ callback = None,
+ *args, **kargs):
+
+ cdef Elm_Object_Item *item, *parent_obj = NULL
+ cdef Evas_Smart_Cb cb = NULL
+
+ parent_obj = parent.item if parent is not None else NULL
+
+ if callback is not None:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+ item = elm_menu_item_add( menu.obj,
+ parent_obj,
+ _cfruni(icon) if icon is not None else NULL,
+ _cfruni(label) if label is not None else NULL,
+ cb,
+ <void*>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def object_get(self):
+ return object_from_instance(elm_menu_item_object_get(self.item))
+
+ def icon_name_set(self, icon):
+ elm_menu_item_icon_name_set(self.item, _cfruni(icon))
+
+ def icon_name_get(self):
+ return _ctouni(elm_menu_item_icon_name_get(self.item))
+
+ property icon_name:
+ def __get__(self):
+ return _ctouni(elm_menu_item_icon_name_get(self.item))
+ def __set__(self, icon):
+ elm_menu_item_icon_name_set(self.item, _cfruni(icon))
+
+ def selected_set(self, selected):
+ elm_menu_item_selected_set(self.item, selected)
+
+ def selected_get(self):
+ return elm_menu_item_selected_get(self.item)
+
+ property selected:
+ def __get__(self):
+ return elm_menu_item_selected_get(self.item)
+ def __set__(self, selected):
+ elm_menu_item_selected_set(self.item, selected)
+
+ def is_separator(self):
+ return False
+
+ def subitems_get(self):
+ return _object_item_list_to_python(elm_menu_item_subitems_get(self.item))
+
+ property subitems:
+ def __get__(self):
+ return _object_item_list_to_python(elm_menu_item_subitems_get(self.item))
+
+ def index_get(self):
+ return elm_menu_item_index_get(self.item)
+
+ property index:
+ def __get__(self):
+ return elm_menu_item_index_get(self.item)
+
+ def next_get(self):
+ return _object_item_to_python(elm_menu_item_next_get(self.item))
+
+ property next:
+ def __get__(self):
+ return _object_item_to_python(elm_menu_item_next_get(self.item))
+
+ def prev_get(self):
+ return _object_item_to_python(elm_menu_item_prev_get(self.item))
+
+ property prev:
+ def __get__(self):
+ return _object_item_to_python(elm_menu_item_prev_get(self.item))
+
+
+cdef class MenuSeparatorItem(ObjectItem):
+ def __init__(self, evasObject menu, MenuItem parent):
+ cdef Elm_Object_Item *parent_obj = NULL
+
+ if parent:
+ parent_obj = parent.item
+ item = elm_menu_item_separator_add(menu.obj, parent_obj)
+ if not item:
+ raise RuntimeError("Error creating separator")
+
+ self._set_obj(item)
+
+ def is_separator(self):
+ return True
+
+ def next_get(self):
+ return _object_item_to_python(elm_menu_item_next_get(self.item))
+
+ property next:
+ def __get__(self):
+ return _object_item_to_python(elm_menu_item_next_get(self.item))
+
+ def prev_get(self):
+ return _object_item_to_python(elm_menu_item_prev_get(self.item))
+
+ property prev:
+ def __get__(self):
+ return _object_item_to_python(elm_menu_item_prev_get(self.item))
+
+
+cdef class Menu(Object):
+
+ def __init__(self, evasObject parent, obj = None):
+ if obj is None:
+ self._set_obj(elm_menu_add(parent.obj))
+ else:
+ self._set_obj(<Evas_Object*>obj)
+
+ def parent_set(self, evasObject parent):
+ elm_menu_parent_set(self.obj, parent.obj)
+
+ def parent_get(self):
+ return object_from_instance(elm_menu_parent_get(self.obj))
+
+ property parent:
+ def __get__(self):
+ return object_from_instance(elm_menu_parent_get(self.obj))
+ def __set__(self, evasObject parent):
+ elm_menu_parent_set(self.obj, parent.obj)
+
+ def move(self, x, y):
+ elm_menu_move(self.obj, x, y)
+
+ def close(self):
+ elm_menu_close(self.obj)
+
+ def items_get(self):
+ return _object_item_list_to_python(elm_menu_items_get(self.obj))
+
+ property items:
+ def __get__(self):
+ return _object_item_list_to_python(elm_menu_items_get(self.obj))
+
+ def item_add(self, parent = None, label = None, icon = None, callback = None, *args, **kwargs):
+ return MenuItem(self, parent, label, icon, callback, *args, **kwargs)
+
+ def item_separator_add(self, parent = None):
+ return MenuSeparatorItem(self, parent)
+
+ def selected_item_get(self):
+ return _object_item_to_python(elm_menu_selected_item_get(self.obj))
+
+ property selected_item:
+ def __get__(self):
+ return _object_item_to_python(elm_menu_selected_item_get(self.obj))
+
+ def last_item_get(self):
+ return _object_item_to_python(elm_menu_last_item_get(self.obj))
+
+ property last_item:
+ def __get__(self):
+ return _object_item_to_python(elm_menu_last_item_get(self.obj))
+
+ def first_item_get(self):
+ return _object_item_to_python(elm_menu_first_item_get(self.obj))
+
+ property first_item:
+ def __get__(self):
+ return _object_item_to_python(elm_menu_first_item_get(self.obj))
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+
+_object_mapping_register("elm_menu", Menu)
diff --git a/efl/elementary/efl.elementary_multibuttonentry.pxi b/efl/elementary/efl.elementary_multibuttonentry.pxi
new file mode 100644
index 0000000..eb6d7a1
--- /dev/null
+++ b/efl/elementary/efl.elementary_multibuttonentry.pxi
@@ -0,0 +1,260 @@
+# Copyright (c) 2012 Davide Andreoli <dave@gurumeditation.it>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef Eina_Bool _multibuttonentry_filter_callback(Evas_Object *obj, const_char_ptr item_label, void *item_data, void *data) with gil:
+ try:
+ (mbe, callback, a, ka) = <object>data
+ ret = callback(mbe, item_label, *a, **ka)
+ if isinstance(ret, str):
+ # TODO this is BROKEN! the doc say should work, but it's a const char* :/
+ # free(<void*>item_label)
+ # item_label = strdup(ret)
+ return 1
+ elif ret:
+ return 1
+ else:
+ return 0
+ except Exception, e:
+ traceback.print_exc()
+
+cdef enum Elm_MultiButtonEntry_Item_Insert_Kind:
+ ELM_MULTIBUTTONENTRY_INSERT_APPEND
+ ELM_MULTIBUTTONENTRY_INSERT_PREPEND
+ ELM_MULTIBUTTONENTRY_INSERT_BEFORE
+ ELM_MULTIBUTTONENTRY_INSERT_AFTER
+
+
+cdef class MultiButtonEntryItem(ObjectItem):
+
+ def __init__(self, kind, evasObject mbe, label,
+ MultiButtonEntryItem before_after = None,
+ callback = None, *args, **kargs):
+ cdef Evas_Smart_Cb cb = NULL
+
+ if callback:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+
+ if kind == ELM_MULTIBUTTONENTRY_INSERT_PREPEND:
+ item = elm_multibuttonentry_item_prepend(mbe.obj,
+ _cfruni(label), cb, <void*>self)
+ elif kind == ELM_MULTIBUTTONENTRY_INSERT_APPEND:
+ item = elm_multibuttonentry_item_append(mbe.obj,
+ _cfruni(label), cb, <void*>self)
+ elif kind == ELM_MULTIBUTTONENTRY_INSERT_BEFORE:
+ item = elm_multibuttonentry_item_insert_before(mbe.obj,
+ before_after.item, _cfruni(label), cb, <void*>self)
+ elif kind == ELM_MULTIBUTTONENTRY_INSERT_AFTER:
+ item = elm_multibuttonentry_item_insert_after(mbe.obj,
+ before_after.item, _cfruni(label), cb, <void*>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def __str__(self):
+ return ("%s(label=%r, callback=%r, args=%r, kargs=%s)") % \
+ (self.__class__.__name__, self.text_get(), self.params[0], self.params[1], self.params[2])
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
+ "label=%r, callback=%r, args=%r, kargs=%s)") % \
+ (self.__class__.__name__, <unsigned long><void *>self,
+ PY_REFCOUNT(self), <unsigned long><void *>self.item,
+ self.text_get(), self.params[0], self.params[1], self.params[2])
+
+ def selected_set(self, selected):
+ elm_multibuttonentry_item_selected_set(self.item, bool(selected))
+
+ def selected_get(self):
+ return bool(elm_multibuttonentry_item_selected_get(self.item))
+
+ property selected:
+ def __get__(self):
+ return self.selected_get()
+ def __set__(self, value):
+ self.selected_set(value)
+
+ def prev_get(self):
+ return _object_item_to_python(elm_multibuttonentry_item_prev_get(self.item))
+
+ property prev:
+ def __get__(self):
+ return self.prev_get()
+
+ def next_get(self):
+ return _object_item_to_python(elm_multibuttonentry_item_next_get(self.item))
+
+ property next:
+ def __get__(self):
+ return self.next_get()
+
+
+cdef class MultiButtonEntry(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_multibuttonentry_add(parent.obj))
+
+ def entry_get(self):
+ return object_from_instance(elm_multibuttonentry_entry_get(self.obj))
+
+ property entry:
+ def __get__(self):
+ return self.entry_get()
+
+ def expanded_set(self, enabled):
+ elm_multibuttonentry_expanded_set(self.obj, bool(enabled))
+
+ def expanded_get(self):
+ return bool(elm_multibuttonentry_expanded_get(self.obj))
+
+ property expanded:
+ def __get__(self):
+ return self.expanded_get()
+ def __set__(self, value):
+ self.expanded_set(value)
+
+ def item_prepend(self, label, func = None, *args, **kwargs):
+ return MultiButtonEntryItem(ELM_MULTIBUTTONENTRY_INSERT_PREPEND,
+ self, label, None, func, *args, **kwargs)
+
+ def item_append(self, label, func = None, *args, **kwargs):
+ return MultiButtonEntryItem(ELM_MULTIBUTTONENTRY_INSERT_APPEND,
+ self, label, None, func, *args, **kwargs)
+
+ def item_insert_before(self, MultiButtonEntryItem before, label, func = None, *args, **kwargs):
+ return MultiButtonEntryItem(ELM_MULTIBUTTONENTRY_INSERT_BEFORE,
+ self, label, before, func, *args, **kwargs)
+
+ def item_insert_after(self, MultiButtonEntryItem after, label, func = None, *args, **kwargs):
+ return MultiButtonEntryItem(ELM_MULTIBUTTONENTRY_INSERT_AFTER,
+ self, label, after, func, *args, **kwargs)
+
+ def items_get(self):
+ return _object_item_list_to_python(elm_multibuttonentry_items_get(self.obj))
+
+ property items:
+ def __get__(self):
+ return self.items_get()
+
+ def first_item_get(self):
+ return _object_item_to_python(elm_multibuttonentry_first_item_get(self.obj))
+
+ property first_item:
+ def __get__(self):
+ return self.first_item_get()
+
+ def last_item_get(self):
+ return _object_item_to_python(elm_multibuttonentry_last_item_get(self.obj))
+
+ property last_item:
+ def __get__(self):
+ return self.last_item_get()
+
+ def selected_item_get(self):
+ return _object_item_to_python(elm_multibuttonentry_selected_item_get(self.obj))
+
+ property selected_item:
+ def __get__(self):
+ return self.selected_item_get()
+
+ def clear(self):
+ elm_multibuttonentry_clear(self.obj)
+
+ def filter_append(self, func, *args, **kwargs):
+ cbdata = (self, func, args, kwargs)
+ elm_multibuttonentry_item_filter_append(self.obj,
+ _multibuttonentry_filter_callback, <void *>cbdata)
+ Py_INCREF(cbdata)
+
+ def filter_prepend(self, func, *args, **kwargs):
+ cbdata = (self, func, args, kwargs)
+ elm_multibuttonentry_item_filter_prepend(self.obj,
+ _multibuttonentry_filter_callback, <void *>cbdata)
+ Py_INCREF(cbdata)
+
+ def filter_remove(self, func, *args, **kwargs):
+ #TODO
+ pass
+
+ def callback_item_selected_add(self, func, *args, **kwargs):
+ self._callback_add("item,selected", func, *args, **kwargs)
+
+ def callback_item_selected_del(self, func):
+ self._callback_del("item,selected", func)
+
+ def callback_item_added_add(self, func, *args, **kwargs):
+ self._callback_add("item,added", func, *args, **kwargs)
+
+ def callback_item_added_del(self, func):
+ self._callback_del("item,added", func)
+
+ def callback_item_deleted_add(self, func, *args, **kwargs):
+ self._callback_add("item,deleted", func, *args, **kwargs)
+
+ def callback_item_deleted_del(self, func):
+ self._callback_del("item,deleted", func)
+
+ def callback_item_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("item,clicked", func, *args, **kwargs)
+
+ def callback_item_clicked_del(self, func):
+ self._callback_del("item,clicked", func)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_focused_add(self, func, *args, **kwargs):
+ self._callback_add("focused", func, *args, **kwargs)
+
+ def callback_focused_del(self, func):
+ self._callback_del("focused", func)
+
+ def callback_unfocused_add(self, func, *args, **kwargs):
+ self._callback_add("unfocused", func, *args, **kwargs)
+
+ def callback_unfocused_del(self, func):
+ self._callback_del("unfocused", func)
+
+ def callback_expanded_add(self, func, *args, **kwargs):
+ self._callback_add("expanded", func, *args, **kwargs)
+
+ def callback_expanded_del(self, func):
+ self._callback_del("expanded", func)
+
+ def callback_contracted_add(self, func, *args, **kwargs):
+ self._callback_add("contracted", func, *args, **kwargs)
+
+ def callback_contracted_del(self, func):
+ self._callback_del("contracted", func)
+
+ def callback_expand_state_changed_add(self, func, *args, **kwargs):
+ self._callback_add("expand,state,changed", func, *args, **kwargs)
+
+ def callback_expand_state_changed_del(self, func):
+ self._callback_del("expand,state,changed", func)
+
+
+_object_mapping_register("elm_multibuttonentry", MultiButtonEntry)
diff --git a/efl/elementary/efl.elementary_naviframe.pxi b/efl/elementary/efl.elementary_naviframe.pxi
new file mode 100644
index 0000000..23b9eff
--- /dev/null
+++ b/efl/elementary/efl.elementary_naviframe.pxi
@@ -0,0 +1,191 @@
+# Copyright (c) 2008-2009 Simon Busch
+# Copyright (c) 2010-2010 ProFUSION embedded systems
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class NaviframeItem(ObjectItem):
+
+ def item_pop_to(self):
+ _METHOD_DEPRECATED(self, "pop_to")
+ elm_naviframe_item_pop_to(self.item)
+
+ def pop_to(self):
+ elm_naviframe_item_pop_to(self.item)
+
+ def item_promote(self):
+ _METHOD_DEPRECATED(self, "promote")
+ elm_naviframe_item_promote(self.item)
+
+ def promote(self):
+ elm_naviframe_item_promote(self.item)
+
+ def style_set(self, style):
+ elm_naviframe_item_style_set(self.item, _cfruni(style))
+
+ def style_get(self):
+ return _ctouni(elm_naviframe_item_style_get(self.item))
+
+ property style:
+ def __get__(self):
+ return _ctouni(elm_naviframe_item_style_get(self.item))
+ def __set__(self, style):
+ elm_naviframe_item_style_set(self.item, _cfruni(style))
+
+ def title_visible_set(self, visible):
+ elm_naviframe_item_title_visible_set(self.item, visible)
+
+ def title_visible_get(self):
+ return bool(elm_naviframe_item_title_visible_get(self.item))
+
+ property title_visible:
+ def __get__(self):
+ return bool(elm_naviframe_item_title_visible_get(self.item))
+ def __set__(self, visible):
+ elm_naviframe_item_title_visible_set(self.item, visible)
+
+
+cdef class Naviframe(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_naviframe_add(parent.obj))
+
+ def item_push(self, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
+ cdef NaviframeItem ret = NaviframeItem()
+ cdef Elm_Object_Item *item
+
+ item = elm_naviframe_item_push(self.obj, _cfruni(title_label),
+ prev_btn.obj if prev_btn else NULL,
+ next_btn.obj if next_btn else NULL,
+ content.obj if content else NULL,
+ _cfruni(item_style) if item_style else NULL)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def item_insert_before(self, NaviframeItem before, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
+ cdef NaviframeItem ret = NaviframeItem()
+ cdef Elm_Object_Item *item
+
+ item = elm_naviframe_item_insert_before(self.obj, before.item, _cfruni(title_label), prev_btn.obj, next_btn.obj, content.obj, _cfruni(item_style))
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def item_insert_after(self, NaviframeItem after, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
+ cdef NaviframeItem ret = NaviframeItem()
+ cdef Elm_Object_Item *item
+
+ item = elm_naviframe_item_insert_after(self.obj, after.item, _cfruni(title_label), prev_btn.obj, next_btn.obj, content.obj, _cfruni(item_style))
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def item_pop(self):
+ return object_from_instance(elm_naviframe_item_pop(self.obj))
+
+ def content_preserve_on_pop_set(self, preserve):
+ elm_naviframe_content_preserve_on_pop_set(self.obj, preserve)
+
+ def content_preserve_on_pop_get(self):
+ return bool(elm_naviframe_content_preserve_on_pop_get(self.obj))
+
+ property content_preserve_on_pop:
+ def __get__(self):
+ return bool(elm_naviframe_content_preserve_on_pop_get(self.obj))
+ def __set__(self, preserve):
+ elm_naviframe_content_preserve_on_pop_set(self.obj, preserve)
+
+ def top_item_get(self):
+ return _object_item_to_python(elm_naviframe_top_item_get(self.obj))
+
+ property top_item:
+ def __get__(self):
+ return _object_item_to_python(elm_naviframe_top_item_get(self.obj))
+
+ def bottom_item_get(self):
+ return _object_item_to_python(elm_naviframe_bottom_item_get(self.obj))
+
+ property bottom_item:
+ def __get__(self):
+ return _object_item_to_python(elm_naviframe_bottom_item_get(self.obj))
+
+ def prev_btn_auto_pushed_set(self, auto_pushed):
+ elm_naviframe_prev_btn_auto_pushed_set(self.obj, auto_pushed)
+
+ def prev_btn_auto_pushed_get(self):
+ return bool(elm_naviframe_prev_btn_auto_pushed_get(self.obj))
+
+ property prev_btn_auto_pushed:
+ def __get__(self):
+ return bool(elm_naviframe_prev_btn_auto_pushed_get(self.obj))
+ def __set__(self, auto_pushed):
+ elm_naviframe_prev_btn_auto_pushed_set(self.obj, auto_pushed)
+
+ def items_get(self):
+ return _object_item_list_to_python(elm_naviframe_items_get(self.obj))
+
+ property items:
+ def __get__(self):
+ return _object_item_list_to_python(elm_naviframe_items_get(self.obj))
+
+ def event_enabled_set(self, enabled):
+ elm_naviframe_event_enabled_set(self.obj, enabled)
+
+ def event_enabled_get(self):
+ return bool(elm_naviframe_event_enabled_get(self.obj))
+
+ property event_enabled:
+ def __get__(self):
+ return bool(elm_naviframe_event_enabled_get(self.obj))
+ def __set__(self, enabled):
+ elm_naviframe_event_enabled_set(self.obj, enabled)
+
+ def item_simple_push(self, evasObject content):
+ cdef NaviframeItem ret = NaviframeItem()
+ cdef Elm_Object_Item *item
+
+ item = elm_naviframe_item_simple_push(self.obj, content.obj)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def item_simple_promote(self, evasObject content):
+ elm_naviframe_item_simple_promote(self.obj, content.obj)
+
+ def callback_transition_finished_add(self, func, *args, **kwargs):
+ self._callback_add("transition,finished", func, *args, **kwargs)
+
+ def callback_transition_finished_del(self, func):
+ self._callback_del("transition,finished", func)
+
+ def callback_title_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("title,clicked", func, *args, **kwargs)
+
+ def callback_title_clicked_del(self, func):
+ self._callback_del("title,clicked", func)
+
+
+_object_mapping_register("elm_naviframe", Naviframe)
diff --git a/efl/elementary/efl.elementary_need.pxi b/efl/elementary/efl.elementary_need.pxi
new file mode 100644
index 0000000..bfc1ee1
--- /dev/null
+++ b/efl/elementary/efl.elementary_need.pxi
@@ -0,0 +1,29 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+def need_efreet():
+ return bool(elm_need_efreet())
+
+def need_e_dbus():
+ return bool(elm_need_e_dbus())
+
+def need_ethumb():
+ return bool(elm_need_ethumb())
+
+def need_web():
+ return bool(elm_need_web())
diff --git a/efl/elementary/efl.elementary_notify.pxi b/efl/elementary/efl.elementary_notify.pxi
new file mode 100644
index 0000000..d48bec8
--- /dev/null
+++ b/efl/elementary/efl.elementary_notify.pxi
@@ -0,0 +1,95 @@
+# Copyright (c) 2008-2009 ProFUSION embedded systems
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+
+
+cdef class Notify(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_notify_add(parent.obj))
+
+ def parent_set(self, evasObject parent):
+ cdef Evas_Object *o
+ if parent is not None:
+ o = parent.obj
+ else:
+ o = NULL
+ elm_notify_parent_set(self.obj, o)
+
+ def parent_get(self):
+ return object_from_instance(elm_notify_parent_get(self.obj))
+
+ property parent:
+ def __get__(self):
+ return object_from_instance(elm_notify_parent_get(self.obj))
+ def __set__(self, evasObject parent):
+ cdef Evas_Object *o
+ if parent is not None:
+ o = parent.obj
+ else:
+ o = NULL
+ elm_notify_parent_set(self.obj, o)
+
+ def orient_set(self, int orient):
+ elm_notify_orient_set(self.obj, orient)
+
+ def orient_get(self):
+ return elm_notify_orient_get(self.obj)
+
+ property orient:
+ def __get__(self):
+ return elm_notify_orient_get(self.obj)
+ def __set__(self, orient):
+ elm_notify_orient_set(self.obj, orient)
+
+ def timeout_set(self, double timeout):
+ elm_notify_timeout_set(self.obj, timeout)
+
+ def timeout_get(self):
+ return elm_notify_timeout_get(self.obj)
+
+ property timeout:
+ def __get__(self):
+ return elm_notify_timeout_get(self.obj)
+ def __set__(self, timeout):
+ elm_notify_timeout_set(self.obj, timeout)
+
+ def allow_events_set(self, repeat):
+ elm_notify_allow_events_set(self.obj, repeat)
+
+ def allow_events_get(self):
+ return bool(elm_notify_allow_events_get(self.obj))
+
+ property allow_events:
+ def __get__(self):
+ return bool(elm_notify_allow_events_get(self.obj))
+ def __set__(self, allow_events):
+ elm_notify_allow_events_set(self.obj, allow_events)
+
+ def callback_timeout_add(self, func, *args, **kwargs):
+ self._callback_add("timeout", func, *args, **kwargs)
+
+ def callback_timeout_del(self, func):
+ self._callback_del("timeout", func)
+
+ def callback_block_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("block,clicked", func, *args, **kwargs)
+
+ def callback_block_clicked_del(self, func):
+ self._callback_del("block,clicked", func)
+
+
+_object_mapping_register("elm_notify", Notify)
diff --git a/efl/elementary/efl.elementary_object.pxi b/efl/elementary/efl.elementary_object.pxi
new file mode 100644
index 0000000..31905b4
--- /dev/null
+++ b/efl/elementary/efl.elementary_object.pxi
@@ -0,0 +1,603 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+from efl.evas cimport Object as evasObject
+from efl.evas cimport EventKeyDown, EventKeyUp
+# from efl.evas cimport evas_object_data_get
+from efl.evas cimport evas_object_smart_callback_add
+from efl.evas cimport evas_object_smart_callback_del
+from efl.evas import EVAS_CALLBACK_KEY_DOWN
+from efl.evas import EVAS_CALLBACK_KEY_UP
+# from evas cimport eina_list_append
+
+# from evas.c_evas import _extended_object_mapping_register
+
+#API XXX: Callbacks!
+cdef void _object_callback(void *data,
+ Evas_Object *o, void *event_info) with gil:
+ cdef Object obj
+ cdef object event, ei
+# obj = <Object>evas_object_data_get(o, "python-evas")
+ obj = object_from_instance(o)
+ event = <object>data
+ lst = tuple(obj._elmcallbacks[event])
+ for event_conv, func, args, kargs in lst:
+ try:
+ if event_conv is None:
+ func(obj, *args, **kargs)
+ else:
+ ei = event_conv(<long>event_info)
+ func(obj, ei, *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+
+cdef Evas_Object *_tooltip_content_create(void *data, Evas_Object *o, Evas_Object *t) with gil:
+ cdef Object ret, obj, tooltip
+
+# obj = <Object>evas_object_data_get(o, "python-evas")
+# tooltip = Object_from_instance(t)
+ obj = object_from_instance(o)
+ tooltip = object_from_instance(t)
+ (func, args, kargs) = <object>data
+ ret = func(obj, tooltip, *args, **kargs)
+ if not ret:
+ return NULL
+ return ret.obj
+
+cdef void _tooltip_data_del_cb(void *data, Evas_Object *o, void *event_info) with gil:
+ Py_DECREF(<object>data)
+
+cdef Eina_Bool _event_dispatcher(o, src, Evas_Callback_Type t, event_info):
+ cdef Object obj = o
+ cdef object ret
+ for func, args, kargs in obj._elm_event_cbs:
+ try:
+ ret = func(obj, src, t, event_info, *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+ else:
+ if ret:
+ return True
+ return False
+
+#TODO: More event types
+cdef Eina_Bool _event_callback(void *data, Evas_Object *o, Evas_Object *src, Evas_Callback_Type t, void *event_info) with gil:
+ cdef Object obj = object_from_instance(o)
+ cdef Object src_obj = object_from_instance(src)
+ cdef Eina_Bool ret = False
+ cdef EventKeyDown down_event
+ cdef EventKeyUp up_event
+ if t == EVAS_CALLBACK_KEY_DOWN:
+ down_event = EventKeyDown()
+ down_event._set_obj(event_info)
+ ret = _event_dispatcher(obj, src_obj, t, down_event)
+ down_event._unset_obj()
+ elif t == EVAS_CALLBACK_KEY_UP:
+ up_event = EventKeyUp()
+ up_event._set_obj(event_info)
+ ret = _event_dispatcher(obj, src_obj, t, up_event)
+ up_event._unset_obj()
+
+
+cdef void _event_data_del_cb(void *data, Evas_Object *o, void *event_info) with gil:
+ pass
+# Py_DECREF(<object>data)
+
+# MOVED TO efl.eo.pyx
+# cdef _strings_to_python(const_Eina_List *lst):
+# cdef const_char_ptr s
+# ret = []
+# while lst:
+# s = <const_char_ptr>lst.data
+# if s != NULL:
+# ret.append(_ctouni(s))
+# lst = lst.next
+# return ret
+#
+# cdef Eina_List * _strings_from_python(strings):
+# cdef Eina_List *lst = NULL
+# for s in strings:
+# lst = eina_list_append(lst, _cfruni(s))
+# return lst
+
+def _cb_string_conv(long addr):
+ cdef const_char_ptr s = <const_char_ptr>addr
+ if s == NULL:
+ return None
+ else:
+ return s
+
+# MOVED TO efl.eo.pyx
+# cdef _object_list_to_python(const_Eina_List *lst):
+# cdef Evas_Object *o
+# ret = []
+# while lst:
+# o = <Evas_Object *>lst.data
+# obj = Object_from_instance(o)
+# ret.append(obj)
+# lst = lst.next
+# return ret
+
+# cdef class Canvas(evas.c_evas.Canvas):
+# def __init__(self):
+# pass
+
+cdef class Object(evasObject):
+
+ def part_text_set(self, part, text):
+ elm_object_part_text_set(self.obj, _cfruni(part) if part is not None else NULL, _cfruni(text))
+
+ def text_set(self, text):
+ elm_object_text_set(self.obj, _cfruni(text))
+
+ def part_text_get(self, part):
+ return _ctouni(elm_object_part_text_get(self.obj, _cfruni(part) if part is not None else NULL))
+
+ def text_get(self):
+ return _ctouni(elm_object_text_get(self.obj))
+
+ property text:
+ def __get__(self):
+ return self.text_get()
+
+ def __set__(self, value):
+ self.text_set(value)
+
+ def part_content_set(self, part, evasObject content):
+ elm_object_part_content_set(self.obj, _cfruni(part), content.obj)
+
+ def content_set(self, evasObject obj):
+ elm_object_part_content_set(self.obj, NULL, obj.obj)
+
+ def part_content_get(self, part):
+ return object_from_instance(elm_object_part_content_get(self.obj, _cfruni(part)))
+
+ def content_get(self):
+ return object_from_instance(elm_object_content_get(self.obj))
+
+ def part_content_unset(self, part):
+ return object_from_instance(elm_object_part_content_unset(self.obj, _cfruni(part)))
+
+ def content_unset(self):
+ return object_from_instance(elm_object_content_unset(self.obj))
+
+ property content:
+ def __get__(self):
+ return self.content_get()
+ def __set__(self, content):
+ self.content_set(content)
+ def __del__(self):
+ self.content_unset()
+
+ def access_info_set(self, txt):
+ elm_object_access_info_set(self.obj, _cfruni(txt))
+
+ def name_find(self, name not None, int recurse = 0):
+ return object_from_instance(elm_object_name_find(self.obj, _cfruni(name), recurse))
+
+ def style_set(self, style):
+ elm_object_style_set(self.obj, _cfruni(style))
+
+ def style_get(self):
+ return _ctouni(elm_object_style_get(self.obj))
+
+ property style:
+ def __get__(self):
+ return self.style_get()
+ def __set__(self, value):
+ self.style_set(value)
+
+ def disabled_set(self, disabled):
+ elm_object_disabled_set(self.obj, disabled)
+
+ def disabled_get(self):
+ return bool(elm_object_disabled_get(self.obj))
+
+ property disabled:
+ def __get__(self):
+ return self.disabled_get()
+ def __set__(self, disabled):
+ self.disabled_set(disabled)
+
+ def widget_check(self):
+ return bool(elm_object_widget_check(self.obj))
+
+ def parent_widget_get(self):
+ return object_from_instance(elm_object_parent_widget_get(self.obj))
+
+ property parent_widget:
+ def __get__(self):
+ return self.parent_widget_get()
+
+ def top_widget_get(self):
+ return object_from_instance(elm_object_top_widget_get(self.obj))
+
+ property top_widget:
+ def __get__(self):
+ return self.top_widget_get()
+
+ def widget_type_get(self):
+ return elm_object_widget_type_get(self.obj)
+
+ property widget_type:
+ def __get__(self):
+ return elm_object_widget_type_get(self.obj)
+
+ def signal_emit(self, emission, source):
+ elm_object_signal_emit(self.obj, _cfruni(emission), _cfruni(source))
+
+ #def signal_callback_add(self, emission, source, func, data):
+ #elm_object_signal_callback_add(self.obj, emission, source, func, data)
+
+ #def signal_callback_del(self, emission, source, func):
+ #elm_object_signal_callback_del(self.obj, emission, source, func)
+
+ # XXX: Clashes badly with evas event_callback_*
+ def elm_event_callback_add(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ if self._elm_event_cbs is None:
+ self._elm_event_cbs = []
+
+ if not self._elm_event_cbs:
+ elm_object_event_callback_add(self.obj, _event_callback, NULL)
+
+ data = (func, args, kargs)
+ self._elm_event_cbs.append(data)
+
+ def elm_event_callback_del(self, func, *args, **kargs):
+ data = (func, args, kargs)
+ self._elm_event_cbs.remove(data)
+
+ if not self._elm_event_cbs:
+ elm_object_event_callback_del(self.obj, _event_callback, NULL)
+
+ # Cursors
+ def cursor_set(self, cursor):
+ elm_object_cursor_set(self.obj, _cfruni(cursor))
+
+ def cursor_get(self):
+ return _ctouni(elm_object_cursor_get(self.obj))
+
+ def cursor_unset(self):
+ elm_object_cursor_unset(self.obj)
+
+ property cursor:
+ def __get__(self):
+ return self.cursor_get()
+ def __set__(self, value):
+ self.cursor_set(value)
+ def __del__(self):
+ self.cursor_unset()
+
+ def cursor_style_set(self, style=None):
+ elm_object_cursor_style_set(self.obj, _cfruni(style) if style is not None else NULL)
+
+ def cursor_style_get(self):
+ return _ctouni(elm_object_cursor_style_get(self.obj))
+
+ property cursor_style:
+ def __get__(self):
+ return self.cursor_style_get()
+ def __set__(self, value):
+ self.cursor_style_set(value)
+
+ def cursor_theme_search_enabled_set(self, engine_only):
+ elm_object_cursor_theme_search_enabled_set(self.obj, bool(engine_only))
+
+ def cursor_theme_search_enabled_get(self):
+ return elm_object_cursor_theme_search_enabled_get(self.obj)
+
+ property cursor_theme_search_enabled:
+ def __get__(self):
+ return self.cursor_theme_search_enabled_get()
+ def __set__(self, value):
+ self.cursor_theme_search_enabled_set(value)
+
+ # Focus
+ def focus_get(self):
+ return bool(elm_object_focus_get(self.obj))
+
+ def focus_set(self, focus):
+ elm_object_focus_set(self.obj, focus)
+
+ def focus_allow_set(self, allow):
+ elm_object_focus_allow_set(self.obj, allow)
+
+ def focus_allow_get(self):
+ return elm_object_focus_allow_get(self.obj)
+
+ property focus_allow:
+ def __get__(self):
+ return self.focus_allow_get()
+ def __set__(self, value):
+ self.focus_allow_set(value)
+
+ def focus_custom_chain_set(self, objs):
+ elm_object_focus_custom_chain_unset(self.obj)
+ cdef Object obj
+ for obj in objs:
+ elm_object_focus_custom_chain_append(self.obj, obj.obj, NULL)
+
+ def focus_custom_chain_unset(self):
+ elm_object_focus_custom_chain_unset(self.obj)
+
+ def focus_custom_chain_get(self):
+ return _object_list_to_python(elm_object_focus_custom_chain_get(self.obj))
+
+ property focus_custom_chain:
+ def __get__(self):
+ return self.focus_custom_chain_get()
+ def __set__(self, value):
+ self.focus_custom_chain_set(value)
+ def __del__(self):
+ self.focus_custom_chain_unset()
+
+ def focus_custom_chain_append(self, Object child, Object relative_child=None):
+ cdef Evas_Object *rel = NULL
+ if relative_child:
+ rel = relative_child.obj
+ elm_object_focus_custom_chain_append(self.obj, child.obj, rel)
+
+ def focus_custom_chain_prepend(self, Object child, Object relative_child=None):
+ cdef Evas_Object *rel = NULL
+ if relative_child:
+ rel = relative_child.obj
+ elm_object_focus_custom_chain_prepend(self.obj, child.obj, rel)
+
+ #def focus_next(self, direction):
+ #elm_object_focus_next(self.obj, direction)
+
+ def tree_focus_allow_set(self, focusable):
+ elm_object_tree_focus_allow_set(self.obj, focusable)
+
+ def tree_focus_allow_get(self):
+ return bool(elm_object_tree_focus_allow_get(self.obj))
+
+ property tree_focus_allow:
+ def __get__(self):
+ return self.tree_focus_allow_get()
+ def __set__(self, value):
+ self.tree_focus_allow_set(value)
+
+ # Mirroring
+ def mirrored_get(self):
+ return bool(elm_object_mirrored_get(self.obj))
+
+ def mirrored_set(self, mirrored):
+ elm_object_mirrored_set(self.obj, mirrored)
+
+ property mirrored:
+ def __get__(self):
+ return self.mirrored_get()
+ def __set__(self, value):
+ self.mirrored_set(value)
+
+ def mirrored_automatic_get(self):
+ return bool(elm_object_mirrored_automatic_get(self.obj))
+
+ def mirrored_automatic_set(self, automatic):
+ elm_object_mirrored_automatic_set(self.obj, automatic)
+
+ property mirrored_automatic:
+ def __get__(self):
+ return self.mirrored_automatic_get()
+ def __set__(self, value):
+ self.mirrored_automatic_set(value)
+
+ # Scaling
+ def scale_set(self, scale):
+ elm_object_scale_set(self.obj, scale)
+
+ def scale_get(self):
+ return elm_object_scale_get(self.obj)
+
+ property scale:
+ def __get__(self):
+ return self.scale_get()
+ def __set__(self, value):
+ self.scale_set(value)
+
+ # Scrollhints
+ def scroll_hold_push(self):
+ elm_object_scroll_hold_push(self.obj)
+
+ def scroll_hold_pop(self):
+ elm_object_scroll_hold_pop(self.obj)
+
+ def scroll_freeze_push(self):
+ elm_object_scroll_freeze_push(self.obj)
+
+ def scroll_freeze_pop(self):
+ elm_object_scroll_freeze_pop(self.obj)
+
+ def scroll_lock_x_set(self, lock):
+ elm_object_scroll_lock_x_set(self.obj, lock)
+
+ def scroll_lock_y_set(self, lock):
+ elm_object_scroll_lock_y_set(self.obj, lock)
+
+ def scroll_lock_x_get(self):
+ return bool(elm_object_scroll_lock_x_get(self.obj))
+
+ def scroll_lock_y_get(self):
+ return bool(elm_object_scroll_lock_y_get(self.obj))
+
+ property scroll_lock_x:
+ def __get__(self):
+ return self.scroll_lock_x_get()
+ def __set__(self, value):
+ self.scroll_lock_x_set(value)
+
+ property scroll_lock_y:
+ def __get__(self):
+ return self.scroll_lock_y_get()
+ def __set__(self, value):
+ self.scroll_lock_y_set(value)
+
+ # Theme
+# property theme:
+# """A theme to be used for this object and its children.
+#
+# This sets a specific theme that will be used for the given object and any
+# child objects it has. If @p th is NULL then the theme to be used is
+# cleared and the object will inherit its theme from its parent (which
+# ultimately will use the default theme if no specific themes are set).
+#
+# Use special themes with great care as this will annoy users and make
+# configuration difficult. Avoid any custom themes at all if it can be
+# helped.
+#
+# @type: L{Theme}
+#
+# """
+# def __set__(self, Theme th):
+# elm_object_theme_set(self.obj, th.th)
+# def __get__(self):
+# cdef Theme th = Theme()
+# th.th = elm_object_theme_get(self.obj)
+# return th
+
+ # Tooltips
+ def tooltip_show(self):
+ elm_object_tooltip_show(self.obj)
+
+ def tooltip_hide(self):
+ elm_object_tooltip_hide(self.obj)
+
+ def tooltip_text_set(self, text):
+ elm_object_tooltip_text_set(self.obj, _cfruni(text))
+
+ def tooltip_domain_translatable_text_set(self, domain, text):
+ elm_object_tooltip_domain_translatable_text_set(self.obj, _cfruni(domain), _cfruni(text))
+
+ def tooltip_translatable_text_set(self, text):
+ elm_object_tooltip_translatable_text_set(self.obj, _cfruni(text))
+
+ def tooltip_content_cb_set(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ cdef void *cbdata
+
+ data = (func, args, kargs)
+ Py_INCREF(data)
+ cbdata = <void *>data
+ elm_object_tooltip_content_cb_set(self.obj, _tooltip_content_create,
+ cbdata, _tooltip_data_del_cb)
+
+ def tooltip_unset(self):
+ elm_object_tooltip_unset(self.obj)
+
+ def tooltip_style_set(self, style=None):
+ elm_object_tooltip_style_set(self.obj, _cfruni(style) if style is not None else NULL)
+
+ def tooltip_style_get(self):
+ return _ctouni(elm_object_tooltip_style_get(self.obj))
+
+ property tooltip_style:
+ def __get__(self):
+ return self.tooltip_style_get()
+ def __set__(self, value):
+ self.tooltip_style_set(value)
+
+ def tooltip_window_mode_set(self, disable):
+ return bool(elm_object_tooltip_window_mode_set(self.obj, disable))
+
+ def tooltip_window_mode_get(self):
+ return bool(elm_object_tooltip_window_mode_get(self.obj))
+
+ property tooltip_window_mode:
+ def __get__(self):
+ return self.tooltip_window_mode_get()
+ def __set__(self, value):
+ self.tooltip_window_mode_set(value)
+
+ #Translatable text
+ def domain_translatable_text_part_set(self, part, domain, text):
+ elm_object_domain_translatable_text_part_set(self.obj, _cfruni(part), _cfruni(domain), _cfruni(text))
+
+ def domain_translatable_text_set(self, domain, text):
+ elm_object_domain_translatable_text_set(self.obj, _cfruni(domain), _cfruni(text))
+
+ def translatable_text_set(self, text):
+ elm_object_translatable_text_set(self.obj, _cfruni(text))
+
+ def translatable_text_part_get(self, part):
+ return _ctouni(elm_object_translatable_text_part_get(self.obj, _cfruni(part)))
+
+ def translatable_text_get(self):
+ return _ctouni(elm_object_translatable_text_get(self.obj))
+
+ property translatable_text:
+ def __get__(self):
+ return self.translatable_text_get()
+ def __set__(self, value):
+ self.translatable_text_set(value)
+
+ # Callbacks
+ def _callback_add_full(self, event, event_conv, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+ if event_conv is not None and not callable(event_conv):
+ raise TypeError("event_conv must be None or callable")
+
+ if self._elmcallbacks is None:
+ self._elmcallbacks = {}
+
+ e = intern(event)
+ lst = self._elmcallbacks.setdefault(e, [])
+ if not lst:
+ evas_object_smart_callback_add(self.obj, _fruni(event),
+ _object_callback, <void *>e)
+ lst.append((event_conv, func, args, kargs))
+
+ def _callback_del_full(self, event, event_conv, func):
+ try:
+ lst = self._elmcallbacks[event]
+ except KeyError as e:
+ raise ValueError("Unknown event %r" % event)
+
+ i = -1
+ ec = None
+ f = None
+ for i, (ec, f, a, k) in enumerate(lst):
+ if event_conv == ec and func == f:
+ break
+
+ if f != func or ec != event_conv:
+ raise ValueError("Callback %s was not registered with event %r" %
+ (func, event))
+
+ lst.pop(i)
+ if lst:
+ return
+ self._elmcallbacks.pop(event)
+ evas_object_smart_callback_del(self.obj, _fruni(event), _object_callback)
+
+ def _callback_add(self, event, func, *args, **kargs):
+ return self._callback_add_full(event, None, func, *args, **kargs)
+
+ def _callback_del(self, event, func):
+ return self._callback_del_full(event, None, func)
+
+ def _get_obj_addr(self):
+ return <long>self.obj
+
diff --git a/efl/elementary/efl.elementary_object_item.pxi b/efl/elementary/efl.elementary_object_item.pxi
new file mode 100644
index 0000000..3f76cf6
--- /dev/null
+++ b/efl/elementary/efl.elementary_object_item.pxi
@@ -0,0 +1,252 @@
+# Copyright (c) 2010 ProFUSION embedded systems
+#
+#This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef Evas_Object *_tooltip_item_content_create(void *data, Evas_Object *o, Evas_Object *t, void *it) with gil:
+ cdef Object ret, obj, tooltip
+
+# obj = <Object>evas_object_data_get(o, "python-evas")
+ obj = object_from_instance(o)
+ tooltip = object_from_instance(t)
+ (func, item, args, kargs) = <object>data
+ ret = func(obj, item, *args, **kargs)
+ if not ret:
+ return NULL
+ return ret.obj
+
+cdef void _tooltip_item_data_del_cb(void *data, Evas_Object *o, void *event_info) with gil:
+ Py_DECREF(<object>data)
+
+cdef class ObjectItem
+
+def _cb_object_item_conv(long addr):
+ cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
+ return _object_item_to_python(it)
+
+cdef Elm_Object_Item * _object_item_from_python(ObjectItem item) except NULL:
+ if item is None or item.item is NULL:
+ raise TypeError("Invalid item!")
+ return item.item
+
+cdef _object_item_to_python(Elm_Object_Item *it):
+ cdef void *data
+ cdef object item
+
+ if it == NULL:
+ return None
+
+ data = elm_object_item_data_get(it)
+ if data == NULL:
+ return None
+
+ item = <object>data
+ return item
+
+cdef _object_item_list_to_python(const_Eina_List *lst):
+ cdef Elm_Object_Item *it
+ ret = []
+ ret_append = ret.append
+ while lst:
+ it = <Elm_Object_Item *>lst.data
+ lst = lst.next
+ o = _object_item_to_python(it)
+ if o is not None:
+ ret_append(o)
+ return ret
+
+cdef void _object_item_del_cb(void *data, Evas_Object *o, void *event_info) with gil:
+ cdef ObjectItem d = <object>data
+ d.item = NULL
+ Py_DECREF(d)
+
+cdef void _object_item_callback(void *data, Evas_Object *obj, void *event_info) with gil:
+ cdef ObjectItem item = <object>data
+ (callback, a, ka) = item.params
+ try:
+ o = object_from_instance(obj)
+ callback(o, item, *a, **ka)
+ except Exception as e:
+ traceback.print_exc()
+
+cdef class ObjectItem(object):
+
+ # Notes to bindings' developers:
+ # ==============================
+ #
+ # After calling _set_obj, Elm_Object_Item's "data" contains the python item
+ # instance pointer, and the attribute "item", that you see below, contains
+ # a pointer to Elm_Object_Item.
+ #
+ # The variable params holds callback data, usually the tuple
+ # (callback, args, kwargs). Note that some of the generic object item
+ # functions expect this tuple. Use custom functions if you assign the
+ # params differently.
+ #
+ # Gen type widgets MUST set the params BEFORE adding the item as the
+ # items need their data immediately when adding them.
+
+ cdef Elm_Object_Item *item
+ cdef object params
+
+ def __dealloc__(self):
+ if self.item != NULL:
+ elm_object_item_del_cb_set(self.item, NULL)
+ elm_object_item_del(self.item)
+ self.item = NULL
+
+ cdef int _set_obj(self, Elm_Object_Item *item) except 0:
+ assert self.item == NULL, "Object must be clean"
+ self.item = item
+ elm_object_item_data_set(item, <void*>self)
+ elm_object_item_del_cb_set(item, _object_item_del_cb)
+ Py_INCREF(self)
+ return 1
+
+ def widget_get(self):
+ return object_from_instance(elm_object_item_widget_get(self.item))
+
+ def part_content_set(self, part, Object content not None):
+ elm_object_item_part_content_set(self.item, _cfruni(part), content.obj)
+
+ def content_set(self, Object content not None):
+ elm_object_item_content_set(self.item, content.obj)
+
+ def part_content_get(self, part):
+ return object_from_instance(elm_object_item_part_content_get(self.item, _cfruni(part)))
+
+ def content_get(self):
+ return object_from_instance(elm_object_item_content_get(self.item))
+
+ def part_content_unset(self, part):
+ return object_from_instance(elm_object_item_part_content_unset(self.item, _cfruni(part)))
+
+ def content_unset(self):
+ return object_from_instance(elm_object_item_content_unset(self.item))
+
+ def part_text_set(self, part, text):
+ elm_object_item_part_text_set(self.item, _cfruni(part), _cfruni(text))
+
+ def text_set(self, text):
+ elm_object_item_text_set(self.item, _cfruni(text))
+
+ def part_text_get(self, part):
+ return _ctouni(elm_object_item_part_text_get(self.item, _cfruni(part)))
+
+ def text_get(self):
+ return _ctouni(elm_object_item_text_get(self.item))
+
+ property text:
+ def __get__(self):
+ return self.text_get()
+
+ def __set__(self, value):
+ self.text_set(value)
+
+ def access_info_set(self, txt):
+ elm_object_item_access_info_set(self.item, _cfruni(txt))
+
+ def data_get(self):
+ (callback, a, ka) = self.params
+ return (a, ka)
+
+ def data_set(self, *args, **kwargs):
+ (callback, a, ka) = self.params
+ self.params = tuple(callback, *args, **kwargs)
+
+ property data:
+ def __get__(self):
+ return self.data_get()
+ #def __set__(self, data):
+ #self.data_set(data)
+
+ def signal_emit(self, emission, source):
+ elm_object_item_signal_emit(self.item, _cfruni(emission), _cfruni(source))
+
+ def disabled_set(self, disabled):
+ elm_object_item_disabled_set(self.item, disabled)
+
+ def disabled_get(self):
+ return bool(elm_object_item_disabled_get(self.item))
+
+ property disabled:
+ def __get__(self):
+ return self.disabled_get()
+ def __set__(self, disabled):
+ self.disabled_set(disabled)
+
+ #def delete_cb_set(self, del_cb):
+ #elm_object_item_del_cb_set(self.item, del_cb)
+
+ def delete(self):
+ if self.item == NULL:
+ raise ValueError("Object already deleted")
+ elm_object_item_del(self.item)
+ Py_DECREF(self)
+
+ def tooltip_text_set(self, char *text):
+ elm_object_item_tooltip_text_set(self.item, _cfruni(text))
+
+ def tooltip_window_mode_set(self, disable):
+ return bool(elm_object_item_tooltip_window_mode_set(self.item, disable))
+
+ def tooltip_window_mode_get(self):
+ return bool(elm_object_item_tooltip_window_mode_get(self.item))
+
+ def tooltip_content_cb_set(self, func, *args, **kargs):
+ if not callable(func):
+ raise TypeError("func must be callable")
+
+ cdef void *cbdata
+
+ data = (func, args, kargs)
+ Py_INCREF(data)
+ cbdata = <void *>data
+ elm_object_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create,
+ cbdata, _tooltip_item_data_del_cb)
+
+ def tooltip_unset(self):
+ elm_object_item_tooltip_unset(self.item)
+
+ def tooltip_style_set(self, style=None):
+ elm_object_item_tooltip_style_set(self.item, _cfruni(style) if style is not None else NULL)
+
+ def tooltip_style_get(self):
+ return _ctouni(elm_object_item_tooltip_style_get(self.item))
+
+ def cursor_set(self, char *cursor):
+ elm_object_item_cursor_set(self.item, _cfruni(cursor))
+
+ def cursor_get(self):
+ return _ctouni(elm_object_item_cursor_get(self.item))
+
+ def cursor_unset(self):
+ elm_object_item_cursor_unset(self.item)
+
+ def cursor_style_set(self, style=None):
+ elm_object_item_cursor_style_set(self.item, _cfruni(style) if style is not None else NULL)
+
+ def cursor_style_get(self):
+ return _ctouni(elm_object_item_cursor_style_get(self.item))
+
+ def cursor_engine_only_set(self, engine_only):
+ elm_object_item_cursor_engine_only_set(self.item, bool(engine_only))
+
+ def cursor_engine_only_get(self):
+ return elm_object_item_cursor_engine_only_get(self.item)
+
+
+_object_mapping_register("elm_object_item", ObjectItem)
diff --git a/efl/elementary/efl.elementary_panel.pxi b/efl/elementary/efl.elementary_panel.pxi
new file mode 100644
index 0000000..6f0abf2
--- /dev/null
+++ b/efl/elementary/efl.elementary_panel.pxi
@@ -0,0 +1,53 @@
+# Copyright (c) 2010 Boris Faure
+# 2010 Sebastian Krzyszkowiak
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Panel(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_panel_add(parent.obj))
+
+ def orient_set(self, orient):
+ elm_panel_orient_set(self.obj, orient)
+
+ def orient_get(self):
+ return elm_panel_orient_get(self.obj)
+
+ property orient:
+ def __set__(self, orient):
+ elm_panel_orient_set(self.obj, orient)
+ def __get__(self):
+ return elm_panel_orient_get(self.obj)
+
+ def hidden_set(self, hidden):
+ elm_panel_orient_set(self.obj, hidden)
+
+ def hidden_get(self):
+ return elm_panel_hidden_get(self.obj)
+
+ property hidden:
+ def __set__(self, hidden):
+ elm_panel_hidden_set(self.obj, hidden)
+ def __get__(self):
+ return elm_panel_hidden_get(self.obj)
+
+ def toggle(self):
+ elm_panel_toggle(self.obj)
+
+
+_object_mapping_register("elm_panel", Panel)
diff --git a/efl/elementary/efl.elementary_panes.pxi b/efl/elementary/efl.elementary_panes.pxi
new file mode 100644
index 0000000..53b554b
--- /dev/null
+++ b/efl/elementary/efl.elementary_panes.pxi
@@ -0,0 +1,73 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Panes(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_panes_add(parent.obj))
+
+ property fixed:
+ def __set__(self, fixed):
+ elm_panes_fixed_set(self.obj, fixed)
+ def __get__(self):
+ return bool(elm_panes_fixed_get(self.obj))
+
+ property content_left_size:
+ def __get__(self):
+ return elm_panes_content_left_size_get(self.obj)
+ def __set__(self, size):
+ elm_panes_content_left_size_set(self.obj, size)
+
+ property content_right_size:
+ def __get__(self):
+ return elm_panes_content_right_size_get(self.obj)
+ def __set__(self, size):
+ elm_panes_content_right_size_set(self.obj, size)
+
+ property horizontal:
+ def __set__(self, horizontal):
+ elm_panes_horizontal_set(self.obj, horizontal)
+ def __get__(self):
+ return bool(elm_panes_horizontal_get(self.obj))
+
+ def callback_press_add(self, func, *args, **kwargs):
+ self._callback_add("press", func, *args, **kwargs)
+
+ def callback_press_del(self, func):
+ self._callback_del("press", func)
+
+ def callback_unpress_add(self, func, *args, **kwargs):
+ self._callback_add("unpress", func, *args, **kwargs)
+
+ def callback_unpress_del(self, func):
+ self._callback_del("unpress", func)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add("clicked,double", func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del("clicked,double", func)
+
+
+_object_mapping_register("elm_panes", Panes)
diff --git a/efl/elementary/efl.elementary_photo.pxi b/efl/elementary/efl.elementary_photo.pxi
new file mode 100644
index 0000000..3c732f6
--- /dev/null
+++ b/efl/elementary/efl.elementary_photo.pxi
@@ -0,0 +1,104 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Photo(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_photo_add(parent.obj))
+
+ def file_set(self, filename):
+ if filename:
+ return bool(elm_photo_file_set(self.obj, _cfruni(filename)))
+ else:
+ return bool(elm_photo_file_set(self.obj, NULL))
+
+ property file:
+ def __set__(self, filename):
+ # TODO: check return status
+ if filename:
+ elm_photo_file_set(self.obj, _cfruni(filename))
+ else:
+ elm_photo_file_set(self.obj, NULL)
+
+ def thumb_set(self, filename, group = None):
+ elm_photo_thumb_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ property thumb:
+ def __set__(self, value):
+ if isinstance(value, tuple):
+ filename, group = value
+ else:
+ filename = value
+ group = None
+ elm_photo_thumb_set(self.obj, _cfruni(filename), _cfruni(group))
+
+ def size_set(self, size):
+ elm_photo_size_set(self.obj, size)
+
+ property size:
+ def __set__(self, size):
+ elm_photo_size_set(self.obj, size)
+
+ def fill_inside_set(self, fill):
+ elm_photo_fill_inside_set(self.obj, fill)
+
+ property fill_inside:
+ def __set__(self, fill):
+ elm_photo_fill_inside_set(self.obj, fill)
+
+ def editable_set(self, fill):
+ elm_photo_editable_set(self.obj, fill)
+
+ property editable:
+ def __set__(self, fill):
+ elm_photo_editable_set(self.obj, fill)
+
+ def aspect_fixed_set(self, fixed):
+ elm_photo_aspect_fixed_set(self.obj, fixed)
+
+ def aspect_fixed_get(self):
+ return elm_photo_aspect_fixed_get(self.obj)
+
+ property aspect_fixed:
+ def __get__(self):
+ return elm_photo_aspect_fixed_get(self.obj)
+
+ def __set__(self, fixed):
+ elm_photo_aspect_fixed_set(self.obj, fixed)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_drag_start_add(self, func, *args, **kwargs):
+ self._callback_add("drag,start", func, *args, **kwargs)
+
+ def callback_drag_start_del(self, func):
+ self._callback_del("drag,start", func)
+
+ def callback_drag_end_add(self, func, *args, **kwargs):
+ self._callback_add("drag,end", func, *args, **kwargs)
+
+ def callback_drag_end_del(self, func):
+ self._callback_del("drag,end", func)
+
+
+_object_mapping_register("elm_photo", Photo)
diff --git a/efl/elementary/efl.elementary_photocam.pxi b/efl/elementary/efl.elementary_photocam.pxi
new file mode 100644
index 0000000..ce56578
--- /dev/null
+++ b/efl/elementary/efl.elementary_photocam.pxi
@@ -0,0 +1,188 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from efl.evas cimport Image as evasImage
+
+cdef class Photocam(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_photocam_add(parent.obj))
+
+ property file:
+ def __set__(self, file):
+ elm_photocam_file_set(self.obj, _cfruni(file))
+ #TODO: handle errors from return status
+ def __get__(self):
+ return _ctouni(elm_photocam_file_get(self.obj))
+
+ property zoom:
+ def __set__(self, zoom):
+ elm_photocam_zoom_set(self.obj, zoom)
+ def __get__(self):
+ return elm_photocam_zoom_get(self.obj)
+
+ property zoom_mode:
+ def __set__(self, mode):
+ elm_photocam_zoom_mode_set(self.obj, mode)
+ def __get__(self):
+ return elm_photocam_zoom_mode_get(self.obj)
+
+ property image_size:
+ def __get__(self):
+ cdef int w, h
+ elm_photocam_image_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ property image_region:
+ def __get__(self):
+ cdef int x, y, w, h
+ elm_photocam_image_region_get(self.obj, &x, &y, &w, &h)
+ return (x, y, w, h)
+
+ def image_region_show(self, x, y, w, h):
+ elm_photocam_image_region_show(self.obj, x, y, w, h)
+
+ def image_region_bring_in(self, x, y, w, h):
+ elm_photocam_image_region_bring_in(self.obj, x, y, w, h)
+
+ property paused:
+ def __set__(self, paused):
+ elm_photocam_paused_set(self.obj, paused)
+ def __get__(self):
+ return bool(elm_photocam_paused_get(self.obj))
+
+ property internal_image:
+ def __get__(self):
+ cdef evasImage img = evasImage()
+ cdef Evas_Object *obj = elm_photocam_internal_image_get(self.obj)
+ img.obj = obj
+ return img
+
+ property bounce:
+ def __set__(self, value):
+ h_bounce, v_bounce = value
+ elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
+ def __get__(self):
+ cdef Eina_Bool h_bounce, v_bounce
+ elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
+ return (h_bounce, v_bounce)
+
+ property gesture_enabled:
+ def __set__(self, gesture):
+ elm_photocam_gesture_enabled_set(self.obj, gesture)
+ def __get__(self):
+ return bool(elm_photocam_gesture_enabled_get(self.obj))
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_press_add(self, func, *args, **kwargs):
+ self._callback_add("press", func, *args, **kwargs)
+
+ def callback_press_del(self, func):
+ self._callback_del("press", func)
+
+ def callback_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add("longpressed", func, *args, **kwargs)
+
+ def callback_longpressed_del(self, func):
+ self._callback_del("longpressed", func)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add("clicked,double", func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del("clicked,double", func)
+
+ def callback_load_add(self, func, *args, **kwargs):
+ self._callback_add("load", func, *args, **kwargs)
+
+ def callback_load_del(self, func):
+ self._callback_del("load", func)
+
+ def callback_loaded_add(self, func, *args, **kwargs):
+ self._callback_add("loaded", func, *args, **kwargs)
+
+ def callback_loaded_del(self, func):
+ self._callback_del("loaded", func)
+
+ def callback_load_detail_add(self, func, *args, **kwargs):
+ self._callback_add("load,detail", func, *args, **kwargs)
+
+ def callback_load_detail_del(self, func):
+ self._callback_del("load,detail", func)
+
+ def callback_loaded_detail_add(self, func, *args, **kwargs):
+ self._callback_add("loaded,detail", func, *args, **kwargs)
+
+ def callback_loaded_detail_del(self, func):
+ self._callback_del("loaded,detail", func)
+
+ def callback_zoom_start_add(self, func, *args, **kwargs):
+ self._callback_add("zoom,start", func, *args, **kwargs)
+
+ def callback_zoom_start_del(self, func):
+ self._callback_del("zoom,start", func)
+
+ def callback_zoom_stop_add(self, func, *args, **kwargs):
+ self._callback_add("zoom,stop", func, *args, **kwargs)
+
+ def callback_zoom_stop_del(self, func):
+ self._callback_del("zoom,stop", func)
+
+ def callback_zoom_change_add(self, func, *args, **kwargs):
+ self._callback_add("zoom,change", func, *args, **kwargs)
+
+ def callback_zoom_change_del(self, func):
+ self._callback_del("zoom,change", func)
+
+ def callback_scroll_add(self, func, *args, **kwargs):
+ self._callback_add("scroll", func, *args, **kwargs)
+
+ def callback_scroll_del(self, func):
+ self._callback_del("scroll", func)
+
+ def callback_scroll_anim_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,start", func, *args, **kwargs)
+
+ def callback_scroll_anim_start_del(self, func):
+ self._callback_del("scroll,anim,start", func)
+
+ def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,stop", func, *args, **kwargs)
+
+ def callback_scroll_anim_stop_del(self, func):
+ self._callback_del("scroll,anim,stop", func)
+
+ def callback_scroll_drag_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,start", func, *args, **kwargs)
+
+ def callback_scroll_drag_start_del(self, func):
+ self._callback_del("scroll,drag,start", func)
+
+ def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,stop", func, *args, **kwargs)
+
+ def callback_scroll_drag_stop_del(self, func):
+ self._callback_del("scroll,drag,stop", func)
+
+
+_object_mapping_register("elm_photocam", Photocam)
diff --git a/efl/elementary/efl.elementary_plug.pxi b/efl/elementary/efl.elementary_plug.pxi
new file mode 100644
index 0000000..3caafd0
--- /dev/null
+++ b/efl/elementary/efl.elementary_plug.pxi
@@ -0,0 +1,37 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from efl.evas cimport Image as evasImage
+
+cdef class Plug(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_plug_add(parent.obj))
+
+ def connect(self, svcname, svcnum, svcsys):
+ return bool(elm_plug_connect(self.obj, _cfruni(svcname), svcnum, svcsys))
+
+ property image_object:
+ def __get__(self):
+ cdef evasImage img = evasImage()
+ cdef Evas_Object *obj = elm_plug_image_object_get(self.obj)
+ img.obj = obj
+ return img
+
+
+_object_mapping_register("elm_plug", Plug)
diff --git a/efl/elementary/efl.elementary_popup.pxi b/efl/elementary/efl.elementary_popup.pxi
new file mode 100644
index 0000000..eec3e2a
--- /dev/null
+++ b/efl/elementary/efl.elementary_popup.pxi
@@ -0,0 +1,104 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class PopupItem(ObjectItem):
+
+ def __init__(self, evasObject popup, label = None, evasObject icon = None, func = None, *args, **kwargs):
+ cdef Elm_Object_Item *item
+ cdef Evas_Smart_Cb cb
+
+ if func is None:
+ cb = NULL
+ elif callable(func):
+ cb = _object_item_callback
+ else:
+ raise TypeError("func is not None or callable")
+
+ self.params = (func, args, kwargs)
+ item = elm_popup_item_append(popup.obj, _cfruni(label),
+ icon.obj if icon else NULL,
+ cb, <void *>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def __str__(self):
+ return "%s(func=%s, item_data=%s)" % \
+ (self.__class__.__name__,
+ self.params[0],
+ self.params[1])
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
+ "item_class=%s, func=%s, item_data=%r)") % \
+ (self.__class__.__name__,
+ <unsigned long><void*>self,
+ PY_REFCOUNT(self),
+ <unsigned long>self.item,
+ self.params[0],
+ self.params[1])
+
+
+cdef class Popup(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_popup_add(parent.obj))
+
+ def item_append(self, label = None, evasObject icon = None, func = None, *args, **kwargs):
+ return PopupItem(self, label, icon, func, *args, **kwargs)
+
+ property content_text_wrap_type:
+ def __set__(self, wrap):
+ elm_popup_content_text_wrap_type_set(self.obj, wrap)
+ def __get__(self):
+ return elm_popup_content_text_wrap_type_get(self.obj)
+
+ property orient:
+ def __set__(self, orient):
+ elm_popup_orient_set(self.obj, orient)
+ def __get__(self):
+ return elm_popup_orient_get(self.obj)
+
+ property timeout:
+ def __set__(self, timeout):
+ elm_popup_timeout_set(self.obj, timeout)
+ def __get__(self):
+ return elm_popup_timeout_get(self.obj)
+
+ property allow_events:
+ def __set__(self, allow):
+ elm_popup_allow_events_set(self.obj, allow)
+ def __get__(self):
+ return bool(elm_popup_allow_events_get(self.obj))
+
+ def callback_timeout_add(self, func, *args, **kwargs):
+ self._callback_add("timeout", func, *args, **kwargs)
+
+ def callback_timeout_del(self, func):
+ self._callback_del("timeout", func)
+
+ def callback_block_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("block,clicked", func, *args, **kwargs)
+
+ def callback_block_clicked_del(self, func):
+ self._callback_del("block,clicked", func)
+
+
+_object_mapping_register("elm_popup", Popup)
diff --git a/efl/elementary/efl.elementary_progressbar.pxi b/efl/elementary/efl.elementary_progressbar.pxi
new file mode 100644
index 0000000..8170fe7
--- /dev/null
+++ b/efl/elementary/efl.elementary_progressbar.pxi
@@ -0,0 +1,120 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Progressbar(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_progressbar_add(parent.obj))
+
+ def pulse_set(self, pulse):
+ elm_progressbar_pulse_set(self.obj, pulse)
+
+ def pulse_get(self):
+ return elm_progressbar_pulse_get(self.obj)
+
+ def pulse(self, state):
+ elm_progressbar_pulse(self.obj, state)
+
+ def value_set(self, value):
+ elm_progressbar_value_set(self.obj, value)
+
+ def value_get(self):
+ return elm_progressbar_value_get(self.obj)
+
+ property value:
+ def __get__(self):
+ return elm_progressbar_value_get(self.obj)
+
+ def __set__(self, value):
+ elm_progressbar_value_set(self.obj, value)
+
+ def span_size_set(self, size):
+ elm_progressbar_span_size_set(self.obj, size)
+
+ def span_size_get(self):
+ return elm_progressbar_span_size_get(self.obj)
+
+ property span_size:
+ def __get__(self):
+ return elm_progressbar_span_size_get(self.obj)
+
+ def __set__(self, size):
+ elm_progressbar_span_size_set(self.obj, size)
+
+ def unit_format_set(self, format):
+ if format is None:
+ elm_progressbar_unit_format_set(self.obj, NULL)
+ else:
+ elm_progressbar_unit_format_set(self.obj, _cfruni(format))
+
+ def unit_format_get(self):
+ return _ctouni(elm_progressbar_unit_format_get(self.obj))
+
+ property unit_format:
+ def __get__(self):
+ return _ctouni(elm_progressbar_unit_format_get(self.obj))
+
+ def __set__(self, format):
+ if format is None:
+ elm_progressbar_unit_format_set(self.obj, NULL)
+ else:
+ elm_progressbar_unit_format_set(self.obj, _cfruni(format))
+
+ property unit_format_function:
+ def __set__(self, func not None):
+ pass
+ #if not callable(func):
+ #raise TypeError("func is not callable")
+ #TODO: char * func(double value)
+ #elm_progressbar_unit_format_function_set(self.obj, func, NULL)
+
+ def horizontal_set(self, horizontal):
+ elm_progressbar_horizontal_set(self.obj, horizontal)
+
+ def horizontal_get(self):
+ return bool(elm_progressbar_horizontal_get(self.obj))
+
+ property horizontal:
+ def __get__(self):
+ return bool(elm_progressbar_horizontal_get(self.obj))
+
+ def __set__(self, horizontal):
+ elm_progressbar_horizontal_set(self.obj, horizontal)
+
+ def inverted_set(self, inverted):
+ elm_progressbar_inverted_set(self.obj, inverted)
+
+ def inverted_get(self):
+ return bool(elm_progressbar_inverted_get(self.obj))
+
+ property inverted:
+ def __get__(self):
+ return bool(elm_progressbar_inverted_get(self.obj))
+
+ def __set__(self, inverted):
+ elm_progressbar_inverted_set(self.obj, inverted)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+
+_object_mapping_register("elm_progressbar", Progressbar)
diff --git a/efl/elementary/efl.elementary_radio.pxi b/efl/elementary/efl.elementary_radio.pxi
new file mode 100644
index 0000000..94a90f5
--- /dev/null
+++ b/efl/elementary/efl.elementary_radio.pxi
@@ -0,0 +1,85 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Radio(LayoutClass):
+
+ def __init__(self, evasObject parent, obj=None):
+ if obj is None:
+ self._set_obj(elm_radio_add(parent.obj))
+ else:
+ self._set_obj(<Evas_Object*>obj)
+
+ def group_add(self, evasObject group):
+ elm_radio_group_add(self.obj, group.obj)
+
+ def state_value_set(self, value):
+ elm_radio_state_value_set(self.obj, value)
+
+ def state_value_get(self):
+ return elm_radio_state_value_get(self.obj)
+
+ property state_value:
+ def __get__(self):
+ return elm_radio_state_value_get(self.obj)
+ def __set__(self, value):
+ elm_radio_state_value_set(self.obj, value)
+
+ def value_set(self, value):
+ elm_radio_value_set(self.obj, value)
+
+ def value_get(self):
+ return elm_radio_value_get(self.obj)
+
+ property value:
+ def __get__(self):
+ return elm_radio_value_get(self.obj)
+ def __set__(self, value):
+ elm_radio_value_set(self.obj, value)
+
+ #TODO: Check whether this actually works
+ def value_pointer_set(self, value):
+ cdef int valuep = value
+ elm_radio_value_pointer_set(self.obj, &valuep)
+
+ def selected_object_get(self):
+ cdef Radio r = Radio()
+ cdef Evas_Object *selected = elm_radio_selected_object_get(self.obj)
+ if selected == NULL:
+ return None
+ else:
+ r.obj = selected
+ return r
+
+ property selected_object:
+ def __get__(self):
+ cdef Radio r = Radio()
+ cdef Evas_Object *selected = elm_radio_selected_object_get(self.obj)
+ if selected == NULL:
+ return None
+ else:
+ r.obj = selected
+ return r
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+
+_object_mapping_register("elm_radio", Radio)
diff --git a/efl/elementary/efl.elementary_scroller.pxi b/efl/elementary/efl.elementary_scroller.pxi
new file mode 100644
index 0000000..f45301a
--- /dev/null
+++ b/efl/elementary/efl.elementary_scroller.pxi
@@ -0,0 +1,236 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Scroller(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_scroller_add(parent.obj))
+
+ def custom_widget_base_theme_set(self, widget, base):
+ elm_scroller_custom_widget_base_theme_set(self.obj, _cfruni(widget), _cfruni(base))
+
+ def content_min_limit(self, w, h):
+ elm_scroller_content_min_limit(self.obj, w, h)
+
+ def region_show(self, x, y, w, h):
+ elm_scroller_region_show(self.obj, x, y, w, h)
+
+ def policy_set(self, policy_h, policy_v):
+ elm_scroller_policy_set(self.obj, policy_h, policy_v)
+
+ def policy_get(self):
+ cdef Elm_Scroller_Policy policy_h, policy_v
+ elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
+ return (policy_h, policy_v)
+
+ property policy:
+ def __get__(self):
+ cdef Elm_Scroller_Policy policy_h, policy_v
+ elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
+ return (policy_h, policy_v)
+
+ def __set__(self, value):
+ cdef Elm_Scroller_Policy policy_h, policy_v
+ policy_h, policy_v = value
+ elm_scroller_policy_set(self.obj, policy_h, policy_v)
+
+ def region_get(self):
+ cdef Evas_Coord x, y, w, h
+ elm_scroller_region_get(self.obj, &x, &y, &w, &h)
+ return (x, y, w, h)
+
+ property region:
+ def __get__(self):
+ cdef Evas_Coord x, y, w, h
+ elm_scroller_region_get(self.obj, &x, &y, &w, &h)
+ return (x, y, w, h)
+
+ def child_size_get(self):
+ cdef Evas_Coord w, h
+ elm_scroller_child_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ property child_size:
+ def __get__(self):
+ cdef Evas_Coord w, h
+ elm_scroller_child_size_get(self.obj, &w, &h)
+ return (w, h)
+
+ def bounce_set(self, h, v):
+ elm_scroller_bounce_set(self.obj, h, v)
+
+ def bounce_get(self):
+ cdef Eina_Bool h, v
+ elm_scroller_bounce_get(self.obj, &h, &v)
+ return (h, v)
+
+ property bounce:
+ def __get__(self):
+ cdef Eina_Bool h, v
+ elm_scroller_bounce_get(self.obj, &h, &v)
+ return (h, v)
+
+ def __set__(self, value):
+ cdef Eina_Bool h, v
+ h, v = value
+ elm_scroller_bounce_set(self.obj, h, v)
+
+ def page_relative_set(self, h_pagerel, v_pagerel):
+ elm_scroller_page_relative_set(self.obj, h_pagerel, v_pagerel)
+
+ def page_relative_get(self):
+ cdef double h_pagerel, v_pagerel
+ elm_scroller_page_relative_get(self.obj, &h_pagerel, &v_pagerel)
+ return (h_pagerel, v_pagerel)
+
+ property page_relative:
+ def __set__(self, value):
+ h_pagerel, v_pagerel = value
+ elm_scroller_page_relative_set(self.obj, h_pagerel, v_pagerel)
+
+ def __get__(self):
+ cdef double h_pagerel, v_pagerel
+ elm_scroller_page_relative_get(self.obj, &h_pagerel, &v_pagerel)
+ return (h_pagerel, v_pagerel)
+
+ def page_size_set(self, h_pagesize, v_pagesize):
+ elm_scroller_page_size_set(self.obj, h_pagesize, v_pagesize)
+
+ property page_size:
+ def __set__(self, value):
+ h_pagesize, v_pagesize = value
+ elm_scroller_page_size_set(self.obj, h_pagesize, v_pagesize)
+
+ def current_page_get(self):
+ cdef int h_pagenumber, v_pagenumber
+ elm_scroller_current_page_get(self.obj, &h_pagenumber, &v_pagenumber)
+ return (h_pagenumber, v_pagenumber)
+
+ property current_page:
+ def __get__(self):
+ cdef int h_pagenumber, v_pagenumber
+ elm_scroller_current_page_get(self.obj, &h_pagenumber, &v_pagenumber)
+ return (h_pagenumber, v_pagenumber)
+
+ def last_page_get(self):
+ cdef int h_pagenumber, v_pagenumber
+ elm_scroller_last_page_get(self.obj, &h_pagenumber, &v_pagenumber)
+ return (h_pagenumber, v_pagenumber)
+
+ property last_page:
+ def __get__(self):
+ cdef int h_pagenumber, v_pagenumber
+ elm_scroller_last_page_get(self.obj, &h_pagenumber, &v_pagenumber)
+ return (h_pagenumber, v_pagenumber)
+
+ def page_show(self, h_pagenumber, v_pagenumber):
+ elm_scroller_page_show(self.obj, h_pagenumber, v_pagenumber)
+
+ def page_bring_in(self, h_pagenumber, v_pagenumber):
+ elm_scroller_page_bring_in(self.obj, h_pagenumber, v_pagenumber)
+
+ def region_bring_in(self, x, y, w, h):
+ elm_scroller_region_bring_in(self.obj, x, y, w, h)
+
+ def propagate_events_set(self, propagation):
+ elm_scroller_propagate_events_set(self.obj, propagation)
+
+ def propagate_events_get(self):
+ return bool(elm_scroller_propagate_events_get(self.obj))
+
+ property propagate_events:
+ def __get__(self):
+ return bool(elm_scroller_propagate_events_get(self.obj))
+
+ def __set__(self, propagation):
+ elm_scroller_propagate_events_set(self.obj, propagation)
+
+ def gravity_set(self, x, y):
+ elm_scroller_gravity_set(self.obj, x, y)
+
+ def gravity_get(self):
+ cdef double x, y
+ elm_scroller_gravity_get(self.obj, &x, &y)
+ return (x, y)
+
+ property gravity:
+ def __get__(self):
+ cdef double x, y
+ elm_scroller_gravity_get(self.obj, &x, &y)
+ return (x, y)
+
+ def __set__(self, value):
+ x, y = value
+ elm_scroller_gravity_set(self.obj, x, y)
+
+ def callback_edge_left_add(self, func, *args, **kwargs):
+ self._callback_add("edge,left", func, *args, **kwargs)
+
+ def callback_edge_left_del(self, func):
+ self._callback_del("edge,left", func)
+
+ def callback_edge_right_add(self, func, *args, **kwargs):
+ self._callback_add("edge,right", func, *args, **kwargs)
+
+ def callback_edge_right_del(self, func):
+ self._callback_del("edge,right", func)
+
+ def callback_edge_top_add(self, func, *args, **kwargs):
+ self._callback_add("edge,top", func, *args, **kwargs)
+
+ def callback_edge_top_del(self, func):
+ self._callback_del("edge,top", func)
+
+ def callback_edge_bottom_add(self, func, *args, **kwargs):
+ self._callback_add("edge,bottom", func, *args, **kwargs)
+
+ def callback_edge_bottom_del(self, func):
+ self._callback_del("edge,bottom", func)
+
+ def callback_scroll_add(self, func, *args, **kwargs):
+ self._callback_add("scroll", func, *args, **kwargs)
+
+ def callback_scroll_del(self, func):
+ self._callback_del("scroll", func)
+
+ def callback_scroll_anim_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,start", func, *args, **kwargs)
+
+ def callback_scroll_anim_start_del(self, func):
+ self._callback_del("scroll,anim,start", func)
+
+ def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,anim,stop", func, *args, **kwargs)
+
+ def callback_scroll_anim_stop_del(self, func):
+ self._callback_del("scroll,anim,stop", func)
+
+ def callback_scroll_drag_start_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,start", func, *args, **kwargs)
+
+ def callback_scroll_drag_start_del(self, func):
+ self._callback_del("scroll,drag,start", func)
+
+ def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
+ self._callback_add("scroll,drag,stop", func, *args, **kwargs)
+
+ def callback_scroll_drag_stop_del(self, func):
+ self._callback_del("scroll,drag,stop", func)
+
+
+_object_mapping_register("elm_scroller", Scroller)
diff --git a/efl/elementary/efl.elementary_segment_control.pxi b/efl/elementary/efl.elementary_segment_control.pxi
new file mode 100644
index 0000000..6ac8e2a
--- /dev/null
+++ b/efl/elementary/efl.elementary_segment_control.pxi
@@ -0,0 +1,102 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class SegmentControlItem(ObjectItem):
+
+ def index_get(self):
+ return elm_segment_control_item_index_get(self.item)
+
+ property index:
+ def __get__(self):
+ return elm_segment_control_item_index_get(self.item)
+
+ def object_get(self):
+ return object_from_instance(elm_segment_control_item_object_get(self.item))
+
+ property object:
+ def __get__(self):
+ return object_from_instance(elm_segment_control_item_object_get(self.item))
+
+ def selected_set(self, select):
+ elm_segment_control_item_selected_set(self.item, select)
+
+ property selected:
+ def __set__(self, select):
+ elm_segment_control_item_selected_set(self.item, select)
+
+
+cdef class SegmentControl(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_segment_control_add(parent.obj))
+
+ def item_add(self, evasObject icon, label = None):
+ cdef SegmentControlItem ret = SegmentControlItem()
+ cdef Elm_Object_Item *item
+
+ item = elm_segment_control_item_add(self.obj,
+ icon.obj if icon else NULL,
+ _cfruni(label))
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def item_insert_at(self, evasObject icon, label = None, index = 0):
+ cdef SegmentControlItem ret = SegmentControlItem()
+ cdef Elm_Object_Item *item
+
+ item = elm_segment_control_item_insert_at(self.obj,
+ icon.obj if icon else NULL,
+ _cfruni(label), index)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def item_del_at(self, index):
+ elm_segment_control_item_del_at(self.obj, index)
+
+ property item_count:
+ def __get__(self):
+ return elm_segment_control_item_count_get(self.obj)
+
+ def item_get(self, index):
+ return _object_item_to_python(elm_segment_control_item_get(self.obj, index))
+
+ def item_label_get(self, index):
+ return _ctouni(elm_segment_control_item_label_get(self.obj, index))
+
+ def item_icon_get(self, index):
+ return object_from_instance(elm_segment_control_item_icon_get(self.obj, index))
+
+ property item_selected:
+ def __get__(self):
+ return _object_item_to_python(elm_segment_control_item_selected_get(self.obj))
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add_full("changed", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del_full("changed", _cb_object_item_conv, func)
+
+
+_object_mapping_register("elm_segment_control", SegmentControl)
diff --git a/efl/elementary/efl.elementary_separator.pxi b/efl/elementary/efl.elementary_separator.pxi
new file mode 100644
index 0000000..354bf1c
--- /dev/null
+++ b/efl/elementary/efl.elementary_separator.pxi
@@ -0,0 +1,38 @@
+# Copyright (c) 2009 Boris Faure
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Separator(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_separator_add(parent.obj))
+
+ def horizontal_set(self, b):
+ elm_separator_horizontal_set(self.obj, b)
+
+ def horizontal_get(self):
+ return elm_separator_horizontal_get(self.obj)
+
+ property horizontal:
+ def __get__(self):
+ return elm_separator_horizontal_get(self.obj)
+
+ def __set__(self, b):
+ elm_separator_horizontal_set(self.obj, b)
+
+
+_object_mapping_register("elm_separator", Separator)
diff --git a/efl/elementary/efl.elementary_slider.pxi b/efl/elementary/efl.elementary_slider.pxi
new file mode 100644
index 0000000..0e94667
--- /dev/null
+++ b/efl/elementary/efl.elementary_slider.pxi
@@ -0,0 +1,186 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Slider(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_slider_add(parent.obj))
+
+ def span_size_set(self, size):
+ elm_slider_span_size_set(self.obj, size)
+
+ def span_size_get(self):
+ return elm_slider_span_size_get(self.obj)
+
+ property span_size:
+ def __get__(self):
+ return elm_slider_span_size_get(self.obj)
+
+ def __set__(self, size):
+ elm_slider_span_size_set(self.obj, size)
+
+ def unit_format_set(self, format):
+ elm_slider_unit_format_set(self.obj, _cfruni(format))
+
+ def unit_format_get(self):
+ return _ctouni(elm_slider_unit_format_get(self.obj))
+
+ property unit_format:
+ def __get__(self):
+ return _ctouni(elm_slider_unit_format_get(self.obj))
+
+ def __set__(self, format):
+ elm_slider_unit_format_set(self.obj, _cfruni(format))
+
+ def indicator_format_set(self, format):
+ elm_slider_indicator_format_set(self.obj, _cfruni(format))
+
+ def indicator_format_get(self):
+ return _ctouni(elm_slider_indicator_format_get(self.obj))
+
+ property indicator_format:
+ def __get__(self):
+ return _ctouni(elm_slider_indicator_format_get(self.obj))
+
+ def __set__(self, format):
+ elm_slider_indicator_format_set(self.obj, _cfruni(format))
+
+ #TODO: def indicator_format_function_set(self, func, free_func)
+#~ """Set the format function pointer for the indicator label
+#~
+#~ Set the callback function to format the indicator string.
+#~
+#~ @see: L{indicator_format_set()} for more info on how this works.
+#~
+#~ @param func: The indicator format function.
+#~ @type func: function
+#~ @param free_func: The freeing function for the format string.
+#~ @type free_func: function
+#~
+#~ """
+ #elm_slider_indicator_format_function_set(self.obj, char(*func)(double val), void (*free_func)(charstr))
+
+ #TODO: def units_format_function_set(self, func, free_func)
+#~ """Set the format function pointer for the units label
+#~
+#~ Set the callback function to format the units string.
+#~
+#~ @see: L{units_format_set() for more info on how this works.
+#~
+#~ @param func: The units format function.
+#~ @type func: function
+#~ @param free_func: The freeing function for the format string.
+#~ @type free_func: function
+#~
+#~ """
+ #elm_slider_units_format_function_set(self.obj, char(*func)(double val), void (*free_func)(charstr))
+
+ def horizontal_set(self, horizontal):
+ elm_slider_horizontal_set(self.obj, horizontal)
+
+ def horizontal_get(self):
+ return bool(elm_slider_horizontal_get(self.obj))
+
+ property horizontal:
+ def __get__(self):
+ return bool(elm_slider_horizontal_get(self.obj))
+ def __set__(self, horizontal):
+ elm_slider_horizontal_set(self.obj, horizontal)
+
+ def min_max_set(self, min, max):
+ elm_slider_min_max_set(self.obj, min, max)
+
+ def min_max_get(self):
+ cdef double min, max
+ elm_slider_min_max_get(self.obj, &min, &max)
+ return (min, max)
+
+ property min_max:
+ def __get__(self):
+ cdef double min, max
+ elm_slider_min_max_get(self.obj, &min, &max)
+ return (min, max)
+
+ def __set__(self, value):
+ min, max = value
+ elm_slider_min_max_set(self.obj, min, max)
+
+ def value_set(self, value):
+ elm_slider_value_set(self.obj, value)
+
+ def value_get(self):
+ return elm_slider_value_get(self.obj)
+
+ property value:
+ def __get__(self):
+ return elm_slider_value_get(self.obj)
+ def __set__(self, value):
+ elm_slider_value_set(self.obj, value)
+
+ def inverted_set(self, inverted):
+ elm_slider_inverted_set(self.obj, inverted)
+
+ def inverted_get(self):
+ return bool(elm_slider_inverted_get(self.obj))
+
+ property inverted:
+ def __get__(self):
+ return bool(elm_slider_inverted_get(self.obj))
+
+ def __set__(self, inverted):
+ elm_slider_inverted_set(self.obj, inverted)
+
+ def indicator_show_set(self, show):
+ elm_slider_indicator_show_set(self.obj, show)
+
+ def indicator_show_get(self):
+ return bool(elm_slider_indicator_show_get(self.obj))
+
+ property indicator_show:
+ def __get__(self):
+ return bool(elm_slider_indicator_show_get(self.obj))
+
+ def __set__(self, show):
+ elm_slider_indicator_show_set(self.obj, show)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+ def callback_slider_drag_start_add(self, func, *args, **kwargs):
+ self._callback_add("slider,drag,start", func, *args, **kwargs)
+
+ def callback_slider_drag_start_del(self, func):
+ self._callback_del("slider,drag,start", func)
+
+ def callback_slider_drag_stop_add(self, func, *args, **kwargs):
+ self._callback_add("slider,drag,stop", func, *args, **kwargs)
+
+ def callback_slider_drag_stop_del(self, func):
+ self._callback_del("slider,drag,stop", func)
+
+ def callback_delay_changed_add(self, func, *args, **kwargs):
+ self._callback_add("delay,changed", func, *args, **kwargs)
+
+ def callback_delay_changed_del(self, func):
+ self._callback_del("delay,changed", func)
+
+
+_object_mapping_register("elm_slider", Slider)
diff --git a/efl/elementary/efl.elementary_slideshow.pxi b/efl/elementary/efl.elementary_slideshow.pxi
new file mode 100644
index 0000000..d107c53
--- /dev/null
+++ b/efl/elementary/efl.elementary_slideshow.pxi
@@ -0,0 +1,293 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef _py_elm_slideshow_item_call(func, Evas_Object *obj, data) with gil:
+ try:
+ o = object_from_instance(obj)
+ (args, kwargs) = data
+ return func(o, *args, **kwargs)
+ except Exception as e:
+ traceback.print_exc()
+ return None
+
+cdef Evas_Object *_py_elm_slideshow_item_get(void *data, Evas_Object *obj) with gil:
+ cdef SlideshowItem item = <object>data
+ cdef object params = item.params
+ cdef evasObject icon
+ cdef SlideshowItemClass itc = params[0]
+
+ func = itc._get_func
+ if func is None:
+ return NULL
+
+ ret = _py_elm_slideshow_item_call(func, obj, params[1])
+ if ret is not None:
+ try:
+ icon = ret
+ return icon.obj
+ except Exception as e:
+ traceback.print_exc()
+ return NULL
+ else:
+ return NULL
+
+cdef void _py_elm_slideshow_item_del(void *data, Evas_Object *obj) with gil:
+ cdef SlideshowItem item = <object>data
+ cdef object params = item.params
+ cdef SlideshowItemClass itc = params[0]
+
+ func = itc._del_func
+ if func is not None:
+ try:
+ o = object_from_instance(obj)
+ func(o, params[1])
+ except Exception as e:
+ traceback.print_exc()
+ item._unset_obj()
+ Py_DECREF(item)
+
+cdef int _py_elm_slideshow_compare_func(const_void *data1, const_void *data2) with gil:
+ cdef SlideshowItem item1 = <object>data1
+ cdef SlideshowItem item2 = <object>data2
+ cdef object params = item1.params
+ cdef object func = params[2]
+
+ if func is None:
+ return 0
+
+ ret = func(item1, item2)
+ if ret is not None:
+ try:
+ return ret
+ except Exception as e:
+ traceback.print_exc()
+ return 0
+ else:
+ return 0
+
+
+cdef class SlideshowItemClass(object):
+ cdef Elm_Slideshow_Item_Class obj
+ cdef readonly object _get_func
+ cdef readonly object _del_func
+
+ def __cinit__(self, *a, **ka):
+ self._get_func = None
+ self._del_func = None
+
+ self.obj.func.get = _py_elm_slideshow_item_get
+ self.obj.func.del_ = _py_elm_slideshow_item_del
+
+ def __init__(self, get_func=None, del_func=None):
+ if get_func and not callable(get_func):
+ raise TypeError("get_func is not callable!")
+ elif get_func:
+ self._get_func = get_func
+ else:
+ self._get_func = self.get
+
+ if del_func and not callable(del_func):
+ raise TypeError("del_func is not callable!")
+ elif del_func:
+ self._del_func = del_func
+ else:
+ try:
+ self._del_func = self.delete
+ except AttributeError:
+ pass
+
+ def __str__(self):
+ return ("%s(get_func=%s, del_func=%s)") % \
+ (self.__class__.__name__,
+ self._get_func,
+ self._del_func)
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Slideshow_Item_Class=%#x, "
+ "get_func=%s, del_func=%s)") % \
+ (self.__class__.__name__,
+ <unsigned long><void *>self,
+ PY_REFCOUNT(self),
+ <unsigned long>&self.obj,
+ self._get_func,
+ self._del_func)
+
+ def get(self, evasObject obj, item_data):
+ return None
+
+
+cdef class SlideshowItem(ObjectItem):
+
+ cdef int _set_obj(self, Elm_Object_Item *item, params=None) except 0:
+ assert self.item == NULL, "Object must be clean"
+ self.item = item
+ Py_INCREF(self)
+ return 1
+
+ cdef void _unset_obj(self):
+ assert self.item != NULL, "Object must wrap something"
+ self.item = NULL
+
+ def __str__(self):
+ return "%s(item_class=%s, func=%s, item_data=%s)" % \
+ (self.__class__.__name__,
+ self.params[0].__class__.__name__,
+ self.params[3],
+ self.params[1])
+
+ def __repr__(self):
+ return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
+ "item_class=%s, func=%s, item_data=%r)") % \
+ (self.__class__.__name__,
+ <unsigned long><void*>self,
+ PY_REFCOUNT(self),
+ <unsigned long>self.obj,
+ self.params[0].__class__.__name__,
+ self.params[3],
+ self.params[1])
+
+ property object:
+ def __get__(self):
+ return object_from_instance(elm_slideshow_item_object_get(self.item))
+
+ def show(self):
+ elm_slideshow_item_show(self.item)
+
+
+cdef class Slideshow(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_slideshow_add(parent.obj))
+
+ def item_add(self, SlideshowItemClass item_class not None, *args, **kwargs):
+ cdef SlideshowItem ret = SlideshowItem()
+ cdef Elm_Object_Item *item
+
+ item_data = (args, kwargs)
+ ret.params = (item_class, item_data)
+ item = elm_slideshow_item_add(self.obj, &item_class.obj, <void*>ret)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def item_sorted_insert(self, SlideshowItemClass item_class not None,
+ func not None, *args, **kwargs):
+ cdef SlideshowItem ret = SlideshowItem()
+ cdef Elm_Object_Item *item
+ cdef Eina_Compare_Cb compare
+
+ if callable(func):
+ compare = _py_elm_slideshow_compare_func
+ else:
+ raise TypeError("func is not None or callable")
+
+ item_data = (args, kwargs)
+ ret.params = (item_class, item_data, func)
+ item = elm_slideshow_item_sorted_insert(self.obj, &item_class.obj, <void*>ret, compare)
+ if item != NULL:
+ ret._set_obj(item)
+ return ret
+ else:
+ return None
+
+ def next(self):
+ elm_slideshow_next(self.obj)
+
+ def previous(self):
+ elm_slideshow_previous(self.obj)
+
+ property transitions:
+ def __get__(self):
+ return tuple(_strings_to_python(elm_slideshow_transitions_get(self.obj)))
+
+ property transition:
+ def __set__(self, transition):
+ elm_slideshow_transition_set(self.obj, _cfruni(transition))
+ def __get__(self):
+ return _ctouni(elm_slideshow_transition_get(self.obj))
+
+ property timeout:
+ def __set__(self, timeout):
+ elm_slideshow_timeout_set(self.obj, timeout)
+ def __get__(self):
+ return elm_slideshow_timeout_get(self.obj)
+
+ property loop:
+ def __set__(self, loop):
+ elm_slideshow_loop_set(self.obj, loop)
+ def __get__(self):
+ return bool(elm_slideshow_loop_get(self.obj))
+
+ def clear(self):
+ elm_slideshow_clear(self.obj)
+
+ property items:
+ def __get__(self):
+ return tuple(_object_item_list_to_python(elm_slideshow_items_get(self.obj)))
+
+ property current_item:
+ def __get__(self):
+ return _object_item_to_python(elm_slideshow_item_current_get(self.obj))
+
+ def nth_item_get(self, nth):
+ return _object_item_to_python(elm_slideshow_item_nth_get(self.obj, nth))
+
+ property layout:
+ def __set__(self, layout):
+ elm_slideshow_layout_set(self.obj, _cfruni(layout))
+ def __get__(self):
+ return _ctouni(elm_slideshow_layout_get(self.obj))
+
+ property layouts:
+ def __get__(self):
+ return tuple(_strings_to_python(elm_slideshow_layouts_get(self.obj)))
+
+ property cache_before:
+ def __set__(self, count):
+ elm_slideshow_cache_before_set(self.obj, count)
+ def __get__(self):
+ return elm_slideshow_cache_before_get(self.obj)
+
+ property cache_after:
+ def __set__(self, count):
+ elm_slideshow_cache_after_set(self.obj, count)
+ def __get__(self):
+ return elm_slideshow_cache_after_get(self.obj)
+
+ property count:
+ def __get__(self):
+ return elm_slideshow_count_get(self.obj)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add_full("changed", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del_full("changed", _cb_object_item_conv, func)
+
+ def callback_transition_end_add(self, func, *args, **kwargs):
+ self._callback_add_full("transition,end", _cb_object_item_conv,
+ func, *args, **kwargs)
+
+ def callback_transition_end_del(self, func):
+ self._callback_del_full("transition,end", _cb_object_item_conv, func)
+
+
+_object_mapping_register("elm_slideshow", Slideshow)
diff --git a/efl/elementary/efl.elementary_spinner.pxi b/efl/elementary/efl.elementary_spinner.pxi
new file mode 100644
index 0000000..89cef69
--- /dev/null
+++ b/efl/elementary/efl.elementary_spinner.pxi
@@ -0,0 +1,159 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Spinner(LayoutClass):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_spinner_add(parent.obj))
+
+ def label_format_set(self, format):
+ elm_spinner_label_format_set(self.obj, _cfruni(format))
+
+ def label_format_get(self):
+ return _ctouni(elm_spinner_label_format_get(self.obj))
+
+ property label_format:
+ def __get__(self):
+ return _ctouni(elm_spinner_label_format_get(self.obj))
+
+ def __set__(self, format):
+ elm_spinner_label_format_set(self.obj, _cfruni(format))
+
+ def min_max_set(self, min, max):
+ elm_spinner_min_max_set(self.obj, min, max)
+
+ def min_max_get(self):
+ cdef double min, max
+ elm_spinner_min_max_get(self.obj, &min, &max)
+ return (min, max)
+
+ property min_max:
+ def __get__(self):
+ cdef double min, max
+ elm_spinner_min_max_get(self.obj, &min, &max)
+ return (min, max)
+
+ def __set__(self, value):
+ min, max = value
+ elm_spinner_min_max_set(self.obj, min, max)
+
+ def step_set(self, step):
+ elm_spinner_step_set(self.obj, step)
+
+ def step_get(self):
+ return elm_spinner_step_get(self.obj)
+
+ property step:
+ def __get__(self):
+ return elm_spinner_step_get(self.obj)
+
+ def __set__(self, step):
+ elm_spinner_step_set(self.obj, step)
+
+ def value_set(self, value):
+ elm_spinner_value_set(self.obj, value)
+
+ def value_get(self):
+ return elm_spinner_value_get(self.obj)
+
+ property value:
+ def __get__(self):
+ return elm_spinner_value_get(self.obj)
+ def __set__(self, value):
+ elm_spinner_value_set(self.obj, value)
+
+ def wrap_set(self, wrap):
+ elm_spinner_wrap_set(self.obj, wrap)
+
+ def wrap_get(self):
+ return elm_spinner_wrap_get(self.obj)
+
+ property wrap:
+ def __get__(self):
+ return elm_spinner_wrap_get(self.obj)
+ def __set__(self, wrap):
+ elm_spinner_wrap_set(self.obj, wrap)
+
+ def editable_set(self, editable):
+ elm_spinner_editable_set(self.obj, editable)
+
+ def editable_get(self):
+ return elm_spinner_editable_get(self.obj)
+
+ property editable:
+ def __get__(self):
+ return elm_spinner_editable_get(self.obj)
+ def __set__(self, editable):
+ elm_spinner_editable_set(self.obj, editable)
+
+ def special_value_add(self, value, label):
+ elm_spinner_special_value_add(self.obj, value, _cfruni(label))
+
+ def interval_set(self, interval):
+ elm_spinner_interval_set(self.obj, interval)
+
+ def interval_get(self):
+ return elm_spinner_interval_get(self.obj)
+
+ property interval:
+ def __get__(self):
+ return elm_spinner_interval_get(self.obj)
+
+ def __set__(self, interval):
+ elm_spinner_interval_set(self.obj, interval)
+
+ def base_set(self, base):
+ elm_spinner_base_set(self.obj, base)
+
+ def base_get(self):
+ return elm_spinner_base_get(self.obj)
+
+ property base:
+ def __get__(self):
+ return elm_spinner_base_get(self.obj)
+
+ def __set__(self, base):
+ elm_spinner_base_set(self.obj, base)
+
+ def round_set(self, rnd):
+ elm_spinner_round_set(self.obj, rnd)
+
+ def round_get(self):
+ return elm_spinner_round_get(self.obj)
+
+ property round:
+ def __get__(self):
+ return elm_spinner_round_get(self.obj)
+
+ def __set__(self, rnd):
+ elm_spinner_round_set(self.obj, rnd)
+
+ def callback_changed_add(self, func, *args, **kwargs):
+ self._callback_add("changed", func, *args, **kwargs)
+
+ def callback_changed_del(self, func):
+ self._callback_del("changed", func)
+
+ def callback_delay_changed_add(self, func, *args, **kwargs):
+ self._callback_add("delay,changed", func, *args, **kwargs)
+
+ def callback_delay_changed_del(self, func):
+ self._callback_del("delay,changed", func)
+
+
+_object_mapping_register("elm_spinner", Spinner)
diff --git a/efl/elementary/efl.elementary_table.pxi b/efl/elementary/efl.elementary_table.pxi
new file mode 100644
index 0000000..138c308
--- /dev/null
+++ b/efl/elementary/efl.elementary_table.pxi
@@ -0,0 +1,74 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Table(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_table_add(parent.obj))
+
+ def homogeneous_set(self, homogeneous):
+ elm_table_homogeneous_set(self.obj, homogeneous)
+
+ def homogeneous_get(self):
+ return elm_table_homogeneous_get(self.obj)
+
+ property homogeneous:
+ def __get__(self):
+ return elm_table_homogeneous_get(self.obj)
+
+ def __set__(self, homogeneous):
+ elm_table_homogeneous_set(self.obj, homogeneous)
+
+ def padding_set(self, horizontal, vertical):
+ elm_table_padding_set(self.obj, horizontal, vertical)
+
+ def padding_get(self):
+ cdef Evas_Coord horizontal, vertical
+ elm_table_padding_get(self.obj, &horizontal, &vertical)
+ return (horizontal, vertical)
+
+ property padding:
+ def __get__(self):
+ cdef Evas_Coord horizontal, vertical
+ elm_table_padding_get(self.obj, &horizontal, &vertical)
+ return (horizontal, vertical)
+
+ def __set__(self, value):
+ horizontal, vertical = value
+ elm_table_padding_set(self.obj, horizontal, vertical)
+
+ def pack(self, evasObject subobj, x, y, w, h):
+ elm_table_pack(self.obj, subobj.obj, x, y, w, h)
+
+ def unpack(self, evasObject subobj):
+ elm_table_unpack(self.obj, subobj.obj)
+
+ def clear(self, clear):
+ elm_table_clear(self.obj, clear)
+
+ def pack_set(evasObject subobj, x, y, w, h):
+ elm_table_pack_set(subobj.obj, x, y, w, h)
+
+ def pack_get(evasObject subobj):
+ cdef int x, y, w, h
+ elm_table_pack_get(subobj.obj, &x, &y, &w, &h)
+ return (x, y, w, h)
+
+
+_object_mapping_register("elm_table", Table)
diff --git a/efl/elementary/efl.elementary_theme.pxi b/efl/elementary/efl.elementary_theme.pxi
new file mode 100644
index 0000000..454aaa1
--- /dev/null
+++ b/efl/elementary/efl.elementary_theme.pxi
@@ -0,0 +1,110 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class Theme(object):
+
+ cdef Elm_Theme *th
+
+ def __cinit__(self):
+ self.th = NULL
+
+ def __init__(self, default=False):
+ cdef Elm_Theme *th
+ if default:
+ th = elm_theme_default_get()
+ else:
+ th = elm_theme_new()
+
+ if th != NULL:
+ self.th = th
+ else:
+ Py_DECREF(self)
+
+ def __dealloc__(self):
+ if self.th != NULL:
+ elm_theme_free(self.th)
+ self.th = NULL
+
+ def copy(self, Theme thdst):
+ elm_theme_copy(self.th, thdst.th)
+
+ property reference:
+ def __set__(self, Theme thref):
+ elm_theme_ref_set(self.th, thref.th)
+
+ def __get__(self):
+ cdef Theme thref = Theme()
+ thref.th = elm_theme_ref_get(self.th)
+ return thref
+
+ def overlay_add(self, item):
+ elm_theme_overlay_add(self.th, _cfruni(item))
+
+ def overlay_del(self, item):
+ elm_theme_overlay_del(self.th, _cfruni(item))
+
+ property overlay_list:
+ def __get__(self):
+ return tuple(_strings_to_python(elm_theme_overlay_list_get(self.th)))
+
+ def extension_add(self, item):
+ elm_theme_extension_add(self.th, _cfruni(item))
+
+ def extension_del(self, item):
+ elm_theme_extension_del(self.th, _cfruni(item))
+
+ property extension_list:
+ def __get__(self):
+ return tuple(_strings_to_python(elm_theme_extension_list_get(self.th)))
+
+ property order:
+ def __set__(self, theme):
+ elm_theme_set(self.th, _cfruni(theme))
+
+ def __get__(self):
+ return _ctouni(elm_theme_get(self.th))
+
+ property elements:
+ def __get__(self):
+ return tuple(_strings_to_python(elm_theme_list_get(self.th)))
+
+ def flush(self):
+ elm_theme_flush(self.th)
+
+ def data_get(self, key):
+ return _ctouni(elm_theme_data_get(self.th, _cfruni(key)))
+
+def theme_list_item_path_get(f, in_search_path):
+ cdef Eina_Bool path = in_search_path
+ return _ctouni(elm_theme_list_item_path_get(_cfruni(f), &path))
+
+def theme_full_flush():
+ elm_theme_full_flush()
+
+def theme_name_available_list():
+ cdef Eina_List *lst = elm_theme_name_available_list_new()
+ elements = tuple(_strings_to_python(lst))
+ elm_theme_name_available_list_free(lst)
+ return elements
+
+# for compatibility
+def theme_overlay_add(item):
+ elm_theme_overlay_add(NULL, item)
+
+def theme_extension_add(item):
+ elm_theme_extension_add(NULL, item)
diff --git a/efl/elementary/efl.elementary_thumb.pxi b/efl/elementary/efl.elementary_thumb.pxi
new file mode 100644
index 0000000..3c68a88
--- /dev/null
+++ b/efl/elementary/efl.elementary_thumb.pxi
@@ -0,0 +1,111 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Thumb(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_thumb_add(parent.obj))
+
+ def reload(self):
+ elm_thumb_reload(self.obj)
+
+ property file:
+ def __set__(self, value):
+ if isinstance(value, tuple) or isinstance(value, list):
+ file, key = value
+ else:
+ file = value
+ key = None
+ elm_thumb_file_set( self.obj,
+ _cfruni(file) if file is not None else NULL,
+ _cfruni(key) if key is not None else NULL)
+ def __get__(self):
+ cdef const_char_ptr file, key
+ elm_thumb_file_get(self.obj, &file, &key)
+ return(_ctouni(file), _ctouni(key))
+
+ property path:
+ def __get__(self):
+ cdef const_char_ptr path, key
+ elm_thumb_path_get(self.obj, &path, &key)
+ return(_ctouni(path), _ctouni(key))
+
+ property animate:
+ def __set__(self, s):
+ elm_thumb_animate_set(self.obj, s)
+ def __get__(self):
+ return elm_thumb_animate_get(self.obj)
+
+ def ethumb_client_get(self):
+ return None
+ #return elm_thumb_ethumb_client_get(void)
+
+ def ethumb_client_connected_get(self):
+ return bool(elm_thumb_ethumb_client_connected_get())
+
+ property editable:
+ def __set__(self, edit):
+ elm_thumb_editable_set(self.obj, edit)
+ def __get__(self):
+ return bool(elm_thumb_editable_get(self.obj))
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_clicked_double_add(self, func, *args, **kwargs):
+ self._callback_add("clicked,double", func, *args, **kwargs)
+
+ def callback_clicked_double_del(self, func):
+ self._callback_del("clicked,double", func)
+
+ def callback_press_add(self, func, *args, **kwargs):
+ self._callback_add("press", func, *args, **kwargs)
+
+ def callback_press_del(self, func):
+ self._callback_del("press", func)
+
+ def callback_generate_start_add(self, func, *args, **kwargs):
+ self._callback_add("generate,start", func, *args, **kwargs)
+
+ def callback_generate_start_del(self, func):
+ self._callback_del("generate,start", func)
+
+ def callback_generate_stop_add(self, func, *args, **kwargs):
+ self._callback_add("generate,stop", func, *args, **kwargs)
+
+ def callback_generate_stop_del(self, func):
+ self._callback_del("generate,stop", func)
+
+ def callback_generate_error_add(self, func, *args, **kwargs):
+ self._callback_add("generate,error", func, *args, **kwargs)
+
+ def callback_generate_error_del(self, func):
+ self._callback_del("generate,error", func)
+
+ def callback_load_error_add(self, func, *args, **kwargs):
+ self._callback_add("load,error", func, *args, **kwargs)
+
+ def callback_load_error_del(self, func):
+ self._callback_del("load,error", func)
+
+
+_object_mapping_register("elm_thumb", Thumb)
diff --git a/efl/elementary/efl.elementary_toolbar.pxi b/efl/elementary/efl.elementary_toolbar.pxi
new file mode 100644
index 0000000..96ac2f7
--- /dev/null
+++ b/efl/elementary/efl.elementary_toolbar.pxi
@@ -0,0 +1,395 @@
+# Copyright (c) 2008-2009 Simon Busch
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef class ToolbarItemState(object):
+
+ cdef Elm_Toolbar_Item_State *obj
+ cdef object params
+
+ def __init__(self, ObjectItem it, icon = None, label = None, callback = None, *args, **kwargs):
+ cdef Evas_Smart_Cb cb = NULL
+
+ if callback:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kwargs)
+
+ self.obj = elm_toolbar_item_state_add(it.item, _cfruni(icon), _cfruni(label), cb, <void*>self)
+ if self.obj == NULL:
+ Py_DECREF(self)
+
+
+cdef class ToolbarItem(ObjectItem):
+
+ def __init__(self, evasObject toolbar, icon, label,
+ callback, *args, **kargs):
+ cdef Evas_Object *ic = NULL
+ cdef Evas_Smart_Cb cb = NULL
+
+ if callback:
+ if not callable(callback):
+ raise TypeError("callback is not callable")
+ cb = _object_item_callback
+
+ self.params = (callback, args, kargs)
+
+ item = elm_toolbar_item_append(toolbar.obj, icon, _cfruni(label), cb, <void*>self)
+
+ if item != NULL:
+ self._set_obj(item)
+ else:
+ Py_DECREF(self)
+
+ def next_get(self):
+ return _object_item_to_python(elm_toolbar_item_next_get(self.item))
+
+ property next:
+ def __get__(self):
+ return _object_item_to_python(elm_toolbar_item_next_get(self.item))
+
+ def prev_get(self):
+ return _object_item_to_python(elm_toolbar_item_prev_get(self.item))
+
+ property prev:
+ def __get__(self):
+ return _object_item_to_python(elm_toolbar_item_prev_get(self.item))
+
+ def priority_set(self, priority):
+ elm_toolbar_item_priority_set(self.item, priority)
+
+ def priority_get(self):
+ return elm_toolbar_item_priority_get(self.item)
+
+ property priority:
+ def __get__(self):
+ return elm_toolbar_item_priority_get(self.item)
+
+ def __set__(self, priority):
+ elm_toolbar_item_priority_set(self.item, priority)
+
+ def selected_get(self):
+ return elm_toolbar_item_selected_get(self.item)
+
+ def selected_set(self, selected):
+ elm_toolbar_item_selected_set(self.item, selected)
+
+ property selected:
+ def __set__(self, selected):
+ elm_toolbar_item_selected_set(self.item, selected)
+
+ def __get__(self):
+ return elm_toolbar_item_selected_get(self.item)
+
+ def icon_set(self, ic):
+ elm_toolbar_item_icon_set(self.item, _cfruni(ic))
+
+ def icon_get(self):
+ return _ctouni(elm_toolbar_item_icon_get(self.item))
+
+ property icon:
+ def __get__(self):
+ return _ctouni(elm_toolbar_item_icon_get(self.item))
+
+ def __set__(self, ic):
+ elm_toolbar_item_icon_set(self.item, _cfruni(ic))
+
+ def object_get(self):
+ return object_from_instance(elm_toolbar_item_object_get(self.item))
+
+ property object:
+ def __get__(self):
+ return object_from_instance(elm_toolbar_item_object_get(self.item))
+
+ def icon_object_get(self):
+ return object_from_instance(elm_toolbar_item_icon_object_get(self.item))
+
+ property icon_object:
+ def __get__(self):
+ return object_from_instance(elm_toolbar_item_icon_object_get(self.item))
+
+ def icon_memfile_set(self, img, size, format, key):
+ return False
+ #TODO: return bool(elm_toolbar_item_icon_memfile_set(self.item, img, size, format, key))
+
+ def icon_file_set(self, file, key):
+ return bool(elm_toolbar_item_icon_file_set(self.item, _cfruni(file), _cfruni(key)))
+
+ property icon_file:
+ def __set__(self, value):
+ if isinstance(value, tuple):
+ file, key = value
+ else:
+ file = value
+ key = None
+ # TODO: check return status
+ elm_toolbar_item_icon_file_set(self.item, _cfruni(file), _cfruni(key))
+
+ def separator_set(self, separator):
+ elm_toolbar_item_separator_set(self.item, separator)
+
+ def separator_get(self):
+ return elm_toolbar_item_separator_get(self.item)
+
+ property separator:
+ def __set__(self, separator):
+ elm_toolbar_item_separator_set(self.item, separator)
+
+ def __get__(self):
+ return elm_toolbar_item_separator_get(self.item)
+
+ def menu_set(self, menu):
+ elm_toolbar_item_menu_set(self.item, menu)
+
+ def menu_get(self):
+ cdef Evas_Object *menu
+ menu = elm_toolbar_item_menu_get(self.item)
+ if menu == NULL:
+ return None
+ else:
+ return Menu(None, <object>menu)
+
+ property menu:
+ def __get__(self):
+ cdef Evas_Object *menu
+ menu = elm_toolbar_item_menu_get(self.item)
+ if menu == NULL:
+ return None
+ else:
+ return Menu(None, <object>menu)
+
+ def __set__(self, menu):
+ elm_toolbar_item_menu_set(self.item, menu)
+
+ def state_add(self, icon = None, label = None, func = None, *args, **kwargs):
+ return ToolbarItemState(self, icon, label, func, *args, **kwargs)
+
+ def state_del(self, ToolbarItemState state):
+ return bool(elm_toolbar_item_state_del(self.item, state.obj))
+
+ property state:
+ def __set__(self, ToolbarItemState state):
+ # TODO: check return value bool for errors
+ elm_toolbar_item_state_set(self.item, state.obj)
+
+ def __del__(self):
+ elm_toolbar_item_state_unset(self.item)
+
+ def __get__(self):
+ return None
+ # TODO: C api doesn't have data_get() for states so we can't get
+ # the py object from there. Store it in the item instead?
+ #elm_toolbar_item_state_get(self.item)
+
+ property state_next:
+ def __get__(self):
+ return None
+ # TODO: keep a list of the states?
+ #return elm_toolbar_item_state_next(self.item)
+
+ property state_prev:
+ def __get__(self):
+ return None
+ # TODO: keep a list of the states?
+ #return elm_toolbar_item_state_prev(self.item)
+
+
+cdef class Toolbar(Object):
+
+ def __init__(self, evasObject parent):
+ self._set_obj(elm_toolbar_add(parent.obj))
+
+ def icon_size_set(self, icon_size):
+ elm_toolbar_icon_size_set(self.obj, icon_size)
+
+ def icon_size_get(self):
+ return elm_toolbar_icon_size_get(self.obj)
+
+ property icon_size:
+ def __set__(self, icon_size):
+ elm_toolbar_icon_size_set(self.obj, icon_size)
+
+ def __get__(self):
+ return elm_toolbar_icon_size_get(self.obj)
+
+ def icon_order_lookup_set(self, order):
+ elm_toolbar_icon_order_lookup_set(self.obj, order)
+
+ def icon_order_lookup_get(self):
+ return elm_toolbar_icon_order_lookup_get(self.obj)
+
+ property icon_order_lookup:
+ def __set__(self, order):
+ elm_toolbar_icon_order_lookup_set(self.obj, order)
+
+ def __get__(self):
+ return elm_toolbar_icon_order_lookup_get(self.obj)
+
+ def item_append(self, icon, label, callback = None, *args, **kargs):
+ # Everything is done in the ToolbarItem class, because of wrapping the
+ # C structures in python classes
+ return ToolbarItem(self, icon, label, callback, *args, **kargs)
+
+ #TODO: def item_prepend(self, icon, label, callback = None, *args, **kargs):
+ #return ToolbarItem(self, icon, label, callback, *args, **kargs)
+
+ #TODO: def item_insert_before(self, before, icon, label, callback = None, *args, **kargs):
+ #return ToolbarItem(self, icon, label, callback, *args, **kargs)
+
+ #TODO: def item_insert_after(self, after, icon, label, callback = None, *args, **kargs):
+ #return ToolbarItem(self, icon, label, callback, *args, **kargs)
+
+ def first_item_get(self):
+ return _object_item_to_python(elm_toolbar_first_item_get(self.obj))
+
+ property first_item:
+ def __get__(self):
+ return _object_item_to_python(elm_toolbar_first_item_get(self.obj))
+
+ def last_item_get(self):
+ return _object_item_to_python(elm_toolbar_last_item_get(self.obj))
+
+ property last_item:
+ def __get__(self):
+ return _object_item_to_python(elm_toolbar_last_item_get(self.obj))
+
+ def item_find_by_label(self, label):
+ return _object_item_to_python(elm_toolbar_item_find_by_label(self.obj, _cfruni(label)))
+
+ def selected_item_get(self):
+ return _object_item_to_python(elm_toolbar_selected_item_get(self.obj))
+
+ property selected_item:
+ def __get__(self):
+ return _object_item_to_python(elm_toolbar_selected_item_get(self.obj))
+
+ def more_item_get(self):
+ return _object_item_to_python(elm_toolbar_more_item_get(self.obj))
+
+ property more_item:
+ def __get__(self):
+ return _object_item_to_python(elm_toolbar_more_item_get(self.obj))
+
+ def shrink_mode_set(self, mode):
+ elm_toolbar_shrink_mode_set(self.obj, mode)
+
+ def shrink_mode_get(self):
+ return elm_toolbar_shrink_mode_get(self.obj)
+
+ property shrink_mode:
+ def __get__(self):
+ return elm_toolbar_shrink_mode_get(self.obj)
+
+ def __set__(self, mode):
+ elm_toolbar_shrink_mode_set(self.obj, mode)
+
+ def homogeneous_set(self, homogeneous):
+ elm_toolbar_homogeneous_set(self.obj, homogeneous)
+
+ def homogeneous_get(self):
+ return elm_toolbar_homogeneous_get(self.obj)
+
+ property homogeneous:
+ def __set__(self, homogeneous):
+ elm_toolbar_homogeneous_set(self.obj, homogeneous)
+
+ def __get__(self):
+ return elm_toolbar_homogeneous_get(self.obj)
+
+ def menu_parent_set(self, evasObject parent):
+ elm_toolbar_menu_parent_set(self.obj, parent.obj)
+
+ def menu_parent_get(self):
+ return object_from_instance(elm_toolbar_menu_parent_get(self.obj))
+
+ property menu_parent:
+ def __get__(self):
+ return object_from_instance(elm_toolbar_menu_parent_get(self.obj))
+
+ def __set__(self, evasObject parent):
+ elm_toolbar_menu_parent_set(self.obj, parent.obj)
+
+ def align_set(self, align):
+ elm_toolbar_align_set(self.obj, align)
+
+ def align_get(self):
+ return elm_toolbar_align_get(self.obj)
+
+ property align:
+ def __set__(self, align):
+ elm_toolbar_align_set(self.obj, align)
+
+ def __get__(self):
+ return elm_toolbar_align_get(self.obj)
+
+ def horizontal_set(self, horizontal):
+ elm_toolbar_horizontal_set(self.obj, horizontal)
+
+ def horizontal_get(self):
+ return elm_toolbar_horizontal_get(self.obj)
+
+ property horizontal:
+ def __set__(self, horizontal):
+ elm_toolbar_horizontal_set(self.obj, horizontal)
+
+ def __get__(self):
+ return elm_toolbar_horizontal_get(self.obj)
+
+ def items_count(self):
+ return elm_toolbar_items_count(self.obj)
+
+ property standard_priority:
+ def __set__(self, priority):
+ elm_toolbar_standard_priority_set(self.obj, priority)
+ def __get__(self):
+ return elm_toolbar_standard_priority_get(self.obj)
+
+ def select_mode_set(self, mode):
+ elm_toolbar_select_mode_set(self.obj, mode)
+
+ def select_mode_get(self):
+ return elm_toolbar_select_mode_get(self.obj)
+
+ property select_mode:
+ def __get__(self):
+ return elm_toolbar_select_mode_get(self.obj)
+
+ def __set__(self, mode):
+ elm_toolbar_select_mode_set(self.obj, mode)
+
+ def callback_clicked_add(self, func, *args, **kwargs):
+ self._callback_add("clicked", func, *args, **kwargs)
+
+ def callback_clicked_del(self, func):
+ self._callback_del("clicked", func)
+
+ def callback_longpressed_add(self, func, *args, **kwargs):
+ self._callback_add("longpressed", func, *args, **kwargs)
+
+ def callback_longpressed_del(self, func):
+ self._callback_del("longpressed", func)
+
+ def callback_language_changed_add(self, func, *args, **kwargs):
+ self._callback_add("language,changed", func, *args, **kwargs)
+
+ def callback_language_changed_del(self, func):
+ self._callback_del("language,changed", func)
+
+
+_object_mapping_register("elm_toolbar", Toolbar)
diff --git a/efl/elementary/efl.elementary_transit.pxi b/efl/elementary/efl.elementary_transit.pxi
new file mode 100644
index 0000000..05a7236
--- /dev/null
+++ b/efl/elementary/efl.elementary_transit.pxi
@@ -0,0 +1,155 @@
+# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
+#
+# This file is part of python-elementary.
+#
+# python-elementary 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 3 of the License, or
+# (at your option) any later version.
+#
+# python-elementary 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 python-elementary. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+cdef class Transit(object):
+
+ cdef Elm_Transit* obj
+
+ def __cinit__(self, *a, **ka):
+ self.obj = NULL
+
+ def __init__(self):
+ self.obj = elm_transit_add()
+
+ def delete(self):
+ elm_transit_del(self.obj)
+
+ #def effect_add(self, Elm_Transit_Effect_Transition_Cb transition_cb, effect, Elm_Transit_Effect_End_Cb end_cb):
+ #elm_transit_effect_add(self.obj, transition_cb, effect, end_cb)
+
+ #def effect_del(self, Elm_Transit_Effect_Transition_Cb transition_cb, effect):
+ #elm_transit_effect_del(self.obj, transition_cb, effect)
+
+ def object_add(self, evasObject obj):
+ elm_transit_object_add(self.obj, obj.obj)
+
+ def object_remove(self, evasObject obj):
+ elm_transit_object_remove(self.obj, obj.obj)
+
+ property objects:
+ def __get__(self):
+ return _object_list_to_python(elm_transit_objects_get(self.obj))
+
+ property objects_final_state_keep:
+ def __set__(self, state_keep):
+ elm_transit_objects_final_state_keep_set(self.obj, state_keep)
+
+ def __get__(self):
+ return bool(elm_transit_objects_final_state_keep_get(self.obj))
+
+ property event_enabled:
+ def __set__(self, enabled):
+ elm_transit_event_enabled_set(self.obj, enabled)
+ def __get__(self):
+ return bool(elm_transit_event_enabled_get(self.obj))
+
+ def del_cb_set(self, cb, *args, **kwargs):
+ pass
+ #elm_transit_del_cb_set(self.obj, cb, data)
+
+ property auto_reverse:
+ def __set__(self, reverse):
+ elm_transit_auto_reverse_set(self.obj, reverse)
+ def __get__(self):
+ return bool(elm_transit_auto_reverse_get(self.obj))
+
+ property repeat_times:
+ def __set__(self, repeat):
+ elm_transit_repeat_times_set(self.obj, repeat)
+ def __get__(self):
+ return elm_transit_repeat_times_get(self.obj)
+
+ property tween_mode:
+ def __set__(self, tween_mode):
+ elm_transit_tween_mode_set(self.obj, tween_mode)
+ def __get__(self):
+ return elm_transit_tween_mode_get(self.obj)
+
+ property duration:
+ def __set__(self, duration):
+ elm_transit_duration_set(self.obj, duration)
+ def __get__(self):
+ return elm_transit_duration_get(self.obj)
+
+ def go(self):
+ elm_transit_go(self.obj)
+
+ property paused:
+ def __set__(self, paused):
+ elm_transit_paused_set(self.obj, paused)
+ def __get__(self):
+ return bool(elm_transit_paused_get(self.obj))
+
+ property progress_value:
+ def __get__(self):
+ return elm_transit_progress_value_get(self.obj)
+
+ def chain_transit_add(self, Transit chain_transit):
+ elm_transit_chain_transit_add(self.obj, chain_transit.obj)
<