From d3569bf1f188aed6c0610035370d8f0f09663bf3 Mon Sep 17 00:00:00 2001 From: Kai Huuhko Date: Sat, 18 Apr 2015 04:45:11 +0300 Subject: [PATCH] Elm: Unify modules into a monolithic module --- doc/elementary/actionslider.rst | 83 +- doc/elementary/background.rst | 56 +- doc/elementary/box.rst | 116 ++- doc/elementary/bubble.rst | 84 +++ doc/elementary/button.rst | 62 +- doc/elementary/calendar.rst | 160 +++- doc/elementary/check.rst | 47 +- doc/elementary/clock.rst | 92 ++- doc/elementary/colorselector.rst | 62 +- doc/elementary/configuration.rst | 161 +++- doc/elementary/conformant.rst | 41 +- doc/elementary/ctxpopup.rst | 82 +- doc/elementary/datetime.rst | 218 +++++- doc/elementary/dayselector.rst | 97 ++- doc/elementary/diskselector.rst | 68 +- doc/elementary/elementary.rst | 34 + doc/elementary/entry.rst | 590 ++++++++++++++- doc/elementary/fileselector.rst | 135 +++- doc/elementary/fileselector_button.rst | 73 +- doc/elementary/fileselector_entry.rst | 88 ++- doc/elementary/flip.rst | 162 +++- doc/elementary/flipselector.rst | 48 +- doc/elementary/frame.rst | 52 +- doc/elementary/general.rst | 2 - doc/elementary/gengrid.rst | 324 +++++++- doc/elementary/genlist.rst | 512 ++++++++++++- doc/elementary/gesture_layer.rst | 150 +++- doc/elementary/grid.rst | 29 +- doc/elementary/hover.rst | 109 ++- doc/elementary/hoversel.rst | 73 +- doc/elementary/icon.rst | 181 ++++- doc/elementary/image.rst | 93 ++- doc/elementary/index.rst | 59 +- doc/elementary/innerwindow.rst | 40 +- doc/elementary/label.rst | 98 ++- doc/elementary/layout.rst | 163 +++- doc/elementary/layout_class.rst | 2 - doc/elementary/list.rst | 160 +++- doc/elementary/map.rst | 200 ++++- doc/elementary/mapbuf.rst | 31 +- doc/elementary/menu.rst | 44 +- doc/elementary/multibuttonentry.rst | 58 +- doc/elementary/naviframe.rst | 92 ++- doc/elementary/need.rst | 18 +- doc/elementary/notify.rst | 52 +- doc/elementary/object.rst | 254 ++++++- doc/elementary/object_item.rst | 11 +- doc/elementary/panel.rst | 60 +- doc/elementary/panes.rst | 44 +- doc/elementary/photo.rst | 37 +- doc/elementary/photocam.rst | 93 ++- doc/elementary/plug.rst | 36 +- doc/elementary/popup.rst | 170 ++++- doc/elementary/progressbar.rst | 66 +- doc/elementary/radio.rst | 61 +- doc/elementary/scroller.rst | 134 +++- doc/elementary/segment_control.rst | 48 +- doc/elementary/separator.rst | 22 +- doc/elementary/slider.rst | 68 +- doc/elementary/slideshow.rst | 72 +- doc/elementary/spinner.rst | 51 +- doc/elementary/systray.rst | 52 +- doc/elementary/table.rst | 34 +- doc/elementary/theme.rst | 79 +- doc/elementary/thumb.rst | 170 ++++- doc/elementary/toolbar.rst | 167 ++++- doc/elementary/transit.rst | 164 +++- doc/elementary/video.rst | 28 +- doc/elementary/web.rst | 139 +++- doc/elementary/window.rst | 354 ++++++++- efl/elementary/__init__.py | 4 - efl/elementary/{general.pyx => __init__.pyx} | 114 ++- .../{actionslider.pyx => actionslider.pxi} | 98 +-- efl/elementary/actionslider.py | 7 + ...actionslider.pxd => actionslider_cdef.pxi} | 3 - .../{background.pyx => background.pxi} | 64 +- efl/elementary/background.py | 6 + .../{background.pxd => background_cdef.pxi} | 3 - efl/elementary/{box.pyx => box.pxi} | 126 +--- efl/elementary/box.py | 11 + efl/elementary/{box.pxd => box_cdef.pxi} | 2 - efl/elementary/{bubble.pyx => bubble.pxi} | 94 +-- efl/elementary/bubble.py | 6 + .../{bubble.pxd => bubble_cdef.pxi} | 3 - efl/elementary/{button.pyx => button.pxi} | 69 +- efl/elementary/button.py | 1 + .../{button.pxd => button_cdef.pxi} | 7 - .../{calendar_elm.pyx => calendar.pxi} | 173 +---- .../{calendar_elm.pxd => calendar_cdef.pxi} | 9 - efl/elementary/calendar_elm.py | 27 + efl/elementary/{check.pyx => check.pxi} | 54 +- efl/elementary/check.py | 1 + efl/elementary/{check.pxd => check_cdef.pxi} | 2 - efl/elementary/{clock.pyx => clock.pxi} | 99 +-- efl/elementary/clock.py | 10 + efl/elementary/{clock.pxd => clock_cdef.pxi} | 3 - efl/elementary/cnp_callbacks.pxi | 2 - .../{colorselector.pyx => colorselector.pxi} | 77 +- efl/elementary/colorselector.py | 5 + ...lorselector.pxd => colorselector_cdef.pxi} | 4 - .../{configuration.pyx => configuration.pxi} | 170 +---- efl/elementary/configuration.py | 55 ++ ...nfiguration.pxd => configuration_cdef.pxi} | 7 +- .../{conformant.pyx => conformant.pxi} | 47 +- efl/elementary/conformant.py | 1 + .../{conformant.pxd => conformant_cdef.pxi} | 3 - efl/elementary/{ctxpopup.pyx => ctxpopup.pxi} | 93 +-- efl/elementary/ctxpopup.py | 7 + .../{ctxpopup.pxd => ctxpopup_cdef.pxi} | 5 - .../{datetime_elm.pyx => datetime.pxi} | 232 +----- .../{datetime_elm.pxd => datetime_cdef.pxi} | 4 - efl/elementary/datetime_elm.py | 8 + .../{dayselector.pyx => dayselector.pxi} | 107 +-- efl/elementary/dayselector.py | 10 + .../{dayselector.pxd => dayselector_cdef.pxi} | 5 +- .../{diskselector.pyx => diskselector.pxi} | 90 +-- efl/elementary/diskselector.py | 1 + ...diskselector.pxd => diskselector_cdef.pxi} | 4 - .../{general.pxd => elementary_cdef.pxi} | 32 +- efl/elementary/{entry.pyx => entry.pxi} | 609 +-------------- efl/elementary/entry.py | 71 ++ efl/elementary/{entry.pxd => entry_cdef.pxi} | 7 - .../{fileselector.pyx => fileselector.pxi} | 153 +--- efl/elementary/fileselector.py | 14 + ...tor_button.pyx => fileselector_button.pxi} | 97 +-- efl/elementary/fileselector_button.py | 1 + ...utton.pxd => fileselector_button_cdef.pxi} | 2 - ...fileselector.pxd => fileselector_cdef.pxi} | 4 - ...ector_entry.pyx => fileselector_entry.pxi} | 111 +-- efl/elementary/fileselector_entry.py | 1 + ..._entry.pxd => fileselector_entry_cdef.pxi} | 2 - efl/elementary/{flip.pyx => flip.pxi} | 170 +---- efl/elementary/flip.py | 24 + efl/elementary/{flip.pxd => flip_cdef.pxi} | 3 - .../{flipselector.pyx => flipselector.pxi} | 62 +- efl/elementary/flipselector.py | 1 + ...flipselector.pxd => flipselector_cdef.pxi} | 4 - efl/elementary/{frame.pyx => frame.pxi} | 59 +- efl/elementary/frame.py | 1 + efl/elementary/{frame.pxd => frame_cdef.pxi} | 2 - efl/elementary/general.py | 56 ++ efl/elementary/gengrid.pxi | 142 ++++ efl/elementary/gengrid.py | 19 + efl/elementary/gengrid.pyx | 488 ------------ .../{gengrid.pxd => gengrid_cdef.pxi} | 27 +- efl/elementary/genlist.pxi | 167 +++++ efl/elementary/genlist.py | 40 + efl/elementary/genlist.pyx | 707 ------------------ .../{genlist.pxd => genlist_cdef.pxi} | 17 - efl/elementary/genlist_item_class.pxi | 14 +- .../{gesture_layer.pyx => gesture_layer.pxi} | 173 +---- efl/elementary/gesture_layer.py | 19 + ...sture_layer.pxd => gesture_layer_cdef.pxi} | 3 - efl/elementary/{grid.pyx => grid.pxi} | 37 +- efl/elementary/grid.py | 1 + efl/elementary/{grid.pxd => grid_cdef.pxi} | 3 - efl/elementary/{hover.pyx => hover.pxi} | 116 +-- efl/elementary/hover.py | 6 + efl/elementary/{hover.pxd => hover_cdef.pxi} | 7 - efl/elementary/{hoversel.pyx => hoversel.pxi} | 89 +-- efl/elementary/hoversel.py | 5 + .../{hoversel.pxd => hoversel_cdef.pxi} | 4 - efl/elementary/{icon.pyx => icon.pxi} | 191 +---- efl/elementary/icon.py | 10 + efl/elementary/{icon.pxd => icon_cdef.pxi} | 3 - efl/elementary/{image.pyx => image.pxi} | 110 +-- efl/elementary/image.py | 11 + efl/elementary/{image.pxd => image_cdef.pxi} | 11 +- efl/elementary/{index.pyx => index.pxi} | 80 +- efl/elementary/index.py | 1 + efl/elementary/{index.pxd => index_cdef.pxi} | 3 - .../{innerwindow.pyx => innerwindow.pxi} | 47 +- efl/elementary/innerwindow.py | 1 + .../{innerwindow.pxd => innerwindow_cdef.pxi} | 2 - efl/elementary/{label.pyx => label.pxi} | 106 +-- efl/elementary/label.py | 10 + efl/elementary/{label.pxd => label_cdef.pxi} | 3 - efl/elementary/layout.pxd | 4 - .../{layout_class.pyx => layout.pxi} | 78 +- efl/elementary/layout.py | 1 + efl/elementary/layout.pyx | 178 ----- .../{layout_class.pxd => layout_cdef.pxi} | 23 +- efl/elementary/{list.pyx => list.pxi} | 179 +---- efl/elementary/list.py | 16 + efl/elementary/{list.pxd => list_cdef.pxi} | 5 - efl/elementary/{map.pyx => map.pxi} | 218 +----- efl/elementary/map.py | 29 + efl/elementary/{map.pxd => map_cdef.pxi} | 3 - efl/elementary/{mapbuf.pyx => mapbuf.pxi} | 39 +- efl/elementary/mapbuf.py | 1 + .../{mapbuf.pxd => mapbuf_cdef.pxi} | 2 - efl/elementary/{menu.pyx => menu.pxi} | 54 +- efl/elementary/menu.py | 1 + efl/elementary/{menu.pxd => menu_cdef.pxi} | 8 - ...tibuttonentry.pyx => multibuttonentry.pxi} | 79 +- efl/elementary/multibuttonentry.py | 1 + ...tonentry.pxd => multibuttonentry_cdef.pxi} | 3 - .../{naviframe.pyx => naviframe.pxi} | 111 +-- efl/elementary/naviframe.py | 1 + .../{naviframe.pxd => naviframe_cdef.pxi} | 3 - efl/elementary/{need.pyx => need.pxi} | 16 +- efl/elementary/need.py | 7 + efl/elementary/{need.pxd => need_cdef.pxi} | 2 - efl/elementary/{notify.pyx => notify.pxi} | 61 +- efl/elementary/notify.py | 14 + .../{notify.pxd => notify_cdef.pxi} | 2 - efl/elementary/{object.pyx => object.pxi} | 295 +------- efl/elementary/object.py | 35 + .../{object.pxd => object_cdef.pxi} | 11 - .../{object_item.pyx => object_item.pxi} | 53 +- .../{object_item.pxd => object_item_cdef.pxi} | 22 - efl/elementary/{panel.pyx => panel.pxi} | 67 +- efl/elementary/panel.py | 6 + efl/elementary/{panel.pxd => panel_cdef.pxi} | 3 - efl/elementary/{panes.pyx => panes.pxi} | 50 +- efl/elementary/panes.py | 1 + efl/elementary/{panes.pxd => panes_cdef.pxi} | 2 - efl/elementary/{photo.pyx => photo.pxi} | 45 +- efl/elementary/photo.py | 1 + efl/elementary/{photo.pxd => photo_cdef.pxi} | 2 - efl/elementary/{photocam.pyx => photocam.pxi} | 109 +-- efl/elementary/photocam.py | 7 + .../{photocam.pxd => photocam_cdef.pxi} | 3 - efl/elementary/{plug.pyx => plug.pxi} | 44 +- efl/elementary/plug.py | 1 + efl/elementary/{plug.pxd => plug_cdef.pxi} | 2 - efl/elementary/{popup.pyx => popup.pxi} | 186 +---- efl/elementary/popup.py | 17 + efl/elementary/{popup.pxd => popup_cdef.pxi} | 4 - .../{progressbar.pyx => progressbar.pxi} | 75 +- efl/elementary/progressbar.py | 1 + .../{progressbar.pxd => progressbar_cdef.pxi} | 2 - efl/elementary/{radio.pyx => radio.pxi} | 68 +- efl/elementary/radio.py | 1 + efl/elementary/{radio.pxd => radio_cdef.pxi} | 3 - efl/elementary/{scroller.pyx => scroller.pxi} | 146 +--- efl/elementary/scroller.py | 14 + .../{scroller.pxd => scroller_cdef.pxi} | 7 - ...egment_control.pyx => segment_control.pxi} | 65 +- efl/elementary/segment_control.py | 1 + ...t_control.pxd => segment_control_cdef.pxi} | 3 - .../{separator.pyx => separator.pxi} | 28 +- efl/elementary/separator.py | 1 + .../{separator.pxd => separator_cdef.pxi} | 2 - efl/elementary/{slider.pyx => slider.pxi} | 77 +- efl/elementary/slider.py | 6 + .../{slider.pxd => slider_cdef.pxi} | 2 - .../{slideshow.pyx => slideshow.pxi} | 93 +-- efl/elementary/slideshow.py | 1 + .../{slideshow.pxd => slideshow_cdef.pxi} | 3 - efl/elementary/{spinner.pyx => spinner.pxi} | 60 +- efl/elementary/spinner.py | 1 + .../{spinner.pxd => spinner_cdef.pxi} | 2 - efl/elementary/{systray.pyx => systray.pxi} | 69 +- efl/elementary/systray.py | 13 + .../{systray.pxd => systray_cdef.pxi} | 10 +- efl/elementary/{table.pyx => table.pxi} | 40 +- efl/elementary/table.py | 1 + efl/elementary/{table.pxd => table_cdef.pxi} | 2 - efl/elementary/{theme.pyx => theme.pxi} | 90 +-- efl/elementary/theme.py | 2 + efl/elementary/{theme.pxd => theme_cdef.pxi} | 23 - efl/elementary/{thumb.pyx => thumb.pxi} | 180 +---- efl/elementary/thumb.py | 26 + efl/elementary/{thumb.pxd => thumb_cdef.pxi} | 3 - efl/elementary/{toolbar.pyx => toolbar.pxi} | 190 +---- efl/elementary/toolbar.py | 25 + .../{toolbar.pxd => toolbar_cdef.pxi} | 4 - efl/elementary/tooltips.pxi | 52 -- efl/elementary/{transit.pyx => transit.pxi} | 178 +---- efl/elementary/transit.py | 21 + .../{transit.pxd => transit_cdef.pxi} | 3 - efl/elementary/{video.pyx => video.pxi} | 37 +- efl/elementary/video.py | 1 + efl/elementary/{video.pxd => video_cdef.pxi} | 3 - efl/elementary/{web.pyx => web.pxi} | 165 +--- efl/elementary/web.py | 12 + efl/elementary/{web.pxd => web_cdef.pxi} | 5 - efl/elementary/{window.pyx => window.pxi} | 372 +-------- efl/elementary/window.py | 50 ++ .../{window.pxd => window_cdef.pxi} | 3 - include/efl.elementary.pxd | 20 + setup.py | 96 +-- 283 files changed, 8834 insertions(+), 9236 deletions(-) delete mode 100644 doc/elementary/general.rst delete mode 100644 doc/elementary/layout_class.rst rename efl/elementary/{general.pyx => __init__.pyx} (91%) rename efl/elementary/{actionslider.pyx => actionslider.pxi} (69%) create mode 100644 efl/elementary/actionslider.py rename efl/elementary/{actionslider.pxd => actionslider_cdef.pxi} (96%) rename efl/elementary/{background.pyx => background.pxi} (86%) create mode 100644 efl/elementary/background.py rename efl/elementary/{background.pxd => background_cdef.pxi} (94%) rename efl/elementary/{box.pyx => box.pxi} (75%) create mode 100644 efl/elementary/box.py rename efl/elementary/{box.pxd => box_cdef.pxi} (98%) rename efl/elementary/{bubble.pyx => bubble.pxi} (58%) create mode 100644 efl/elementary/bubble.py rename efl/elementary/{bubble.pxd => bubble_cdef.pxi} (92%) rename efl/elementary/{button.pyx => button.pxi} (76%) create mode 100644 efl/elementary/button.py rename efl/elementary/{button.pxd => button_cdef.pxi} (83%) rename efl/elementary/{calendar_elm.pyx => calendar.pxi} (80%) rename efl/elementary/{calendar_elm.pxd => calendar_cdef.pxi} (95%) create mode 100644 efl/elementary/calendar_elm.py rename efl/elementary/{check.pyx => check.pxi} (71%) create mode 100644 efl/elementary/check.py rename efl/elementary/{check.pxd => check_cdef.pxi} (84%) rename efl/elementary/{clock.pyx => clock.pxi} (77%) create mode 100644 efl/elementary/clock.py rename efl/elementary/{clock.pxd => clock_cdef.pxi} (97%) rename efl/elementary/{colorselector.pyx => colorselector.pxi} (83%) create mode 100644 efl/elementary/colorselector.py rename efl/elementary/{colorselector.pxd => colorselector_cdef.pxi} (94%) rename efl/elementary/{configuration.pyx => configuration.pxi} (91%) create mode 100644 efl/elementary/configuration.py rename efl/elementary/{configuration.pxd => configuration_cdef.pxi} (98%) rename efl/elementary/{conformant.pyx => conformant.pxi} (70%) create mode 100644 efl/elementary/conformant.py rename efl/elementary/{conformant.pxd => conformant_cdef.pxi} (73%) rename efl/elementary/{ctxpopup.pyx => ctxpopup.pxi} (86%) create mode 100644 efl/elementary/ctxpopup.py rename efl/elementary/{ctxpopup.pxd => ctxpopup_cdef.pxi} (95%) rename efl/elementary/{datetime_elm.pyx => datetime.pxi} (65%) rename efl/elementary/{datetime_elm.pxd => datetime_cdef.pxi} (95%) create mode 100644 efl/elementary/datetime_elm.py rename efl/elementary/{dayselector.pyx => dayselector.pxi} (65%) create mode 100644 efl/elementary/dayselector.py rename efl/elementary/{dayselector.pxd => dayselector_cdef.pxi} (95%) rename efl/elementary/{diskselector.pyx => diskselector.pxi} (86%) create mode 100644 efl/elementary/diskselector.py rename efl/elementary/{diskselector.pxd => diskselector_cdef.pxi} (92%) rename efl/elementary/{general.pxd => elementary_cdef.pxi} (88%) rename efl/elementary/{entry.pyx => entry.pxi} (80%) create mode 100644 efl/elementary/entry.py rename efl/elementary/{entry.pxd => entry_cdef.pxi} (97%) rename efl/elementary/{fileselector.pyx => fileselector.pxi} (82%) create mode 100644 efl/elementary/fileselector.py rename efl/elementary/{fileselector_button.pyx => fileselector_button.pxi} (76%) create mode 100644 efl/elementary/fileselector_button.py rename efl/elementary/{fileselector_button.pxd => fileselector_button_cdef.pxi} (92%) rename efl/elementary/{fileselector.pxd => fileselector_cdef.pxi} (97%) rename efl/elementary/{fileselector_entry.pyx => fileselector_entry.pxi} (77%) create mode 100644 efl/elementary/fileselector_entry.py rename efl/elementary/{fileselector_entry.pxd => fileselector_entry_cdef.pxi} (92%) rename efl/elementary/{flip.pyx => flip.pxi} (63%) create mode 100644 efl/elementary/flip.py rename efl/elementary/{flip.pxd => flip_cdef.pxi} (97%) rename efl/elementary/{flipselector.pyx => flipselector.pxi} (87%) create mode 100644 efl/elementary/flipselector.py rename efl/elementary/{flipselector.pxd => flipselector_cdef.pxi} (91%) rename efl/elementary/{frame.pyx => frame.pxi} (78%) create mode 100644 efl/elementary/frame.py rename efl/elementary/{frame.pxd => frame_cdef.pxi} (92%) create mode 100644 efl/elementary/general.py create mode 100644 efl/elementary/gengrid.pxi create mode 100644 efl/elementary/gengrid.py delete mode 100644 efl/elementary/gengrid.pyx rename efl/elementary/{gengrid.pxd => gengrid_cdef.pxi} (90%) create mode 100644 efl/elementary/genlist.pxi create mode 100644 efl/elementary/genlist.py delete mode 100644 efl/elementary/genlist.pyx rename efl/elementary/{genlist.pxd => genlist_cdef.pxi} (95%) rename efl/elementary/{gesture_layer.pyx => gesture_layer.pxi} (82%) create mode 100644 efl/elementary/gesture_layer.py rename efl/elementary/{gesture_layer.pxd => gesture_layer_cdef.pxi} (98%) rename efl/elementary/{grid.pyx => grid.pxi} (83%) create mode 100644 efl/elementary/grid.py rename efl/elementary/{grid.pxd => grid_cdef.pxi} (92%) rename efl/elementary/{hover.pyx => hover.pxi} (66%) create mode 100644 efl/elementary/hover.py rename efl/elementary/{hover.pxd => hover_cdef.pxi} (87%) rename efl/elementary/{hoversel.pyx => hoversel.pxi} (86%) create mode 100644 efl/elementary/hoversel.py rename efl/elementary/{hoversel.pxd => hoversel_cdef.pxi} (92%) rename efl/elementary/{icon.pyx => icon.pxi} (57%) create mode 100644 efl/elementary/icon.py rename efl/elementary/{icon.pxd => icon_cdef.pxi} (95%) rename efl/elementary/{image.pyx => image.pxi} (88%) create mode 100644 efl/elementary/image.py rename efl/elementary/{image.pxd => image_cdef.pxi} (96%) rename efl/elementary/{index.pyx => index.pxi} (88%) create mode 100644 efl/elementary/index.py rename efl/elementary/{index.pxd => index_cdef.pxi} (95%) rename efl/elementary/{innerwindow.pyx => innerwindow.pxi} (68%) create mode 100644 efl/elementary/innerwindow.py rename efl/elementary/{innerwindow.pxd => innerwindow_cdef.pxi} (92%) rename efl/elementary/{label.pyx => label.pxi} (75%) create mode 100644 efl/elementary/label.py rename efl/elementary/{label.pxd => label_cdef.pxi} (96%) delete mode 100644 efl/elementary/layout.pxd rename efl/elementary/{layout_class.pyx => layout.pxi} (95%) create mode 100644 efl/elementary/layout.py delete mode 100644 efl/elementary/layout.pyx rename efl/elementary/{layout_class.pxd => layout_cdef.pxi} (81%) rename efl/elementary/{list.pyx => list.pxi} (86%) create mode 100644 efl/elementary/list.py rename efl/elementary/{list.pxd => list_cdef.pxi} (96%) rename efl/elementary/{map.pyx => map.pxi} (91%) create mode 100644 efl/elementary/map.py rename efl/elementary/{map.pxd => map_cdef.pxi} (99%) rename efl/elementary/{mapbuf.pyx => mapbuf.pxi} (86%) create mode 100644 efl/elementary/mapbuf.py rename efl/elementary/{mapbuf.pxd => mapbuf_cdef.pxi} (95%) rename efl/elementary/{menu.pyx => menu.pxi} (91%) create mode 100644 efl/elementary/menu.py rename efl/elementary/{menu.pxd => menu_cdef.pxi} (90%) rename efl/elementary/{multibuttonentry.pyx => multibuttonentry.pxi} (86%) create mode 100644 efl/elementary/multibuttonentry.py rename efl/elementary/{multibuttonentry.pxd => multibuttonentry_cdef.pxi} (96%) rename efl/elementary/{naviframe.pyx => naviframe.pxi} (84%) create mode 100644 efl/elementary/naviframe.py rename efl/elementary/{naviframe.pxd => naviframe_cdef.pxi} (96%) rename efl/elementary/{need.pyx => need.pxi} (95%) create mode 100644 efl/elementary/need.py rename efl/elementary/{need.pxd => need_cdef.pxi} (91%) rename efl/elementary/{notify.pyx => notify.pxi} (83%) create mode 100644 efl/elementary/notify.py rename efl/elementary/{notify.pxd => notify_cdef.pxi} (96%) rename efl/elementary/{object.pyx => object.pxi} (91%) create mode 100644 efl/elementary/object.py rename efl/elementary/{object.pxd => object_cdef.pxi} (97%) rename efl/elementary/{object_item.pyx => object_item.pxi} (97%) rename efl/elementary/{object_item.pxd => object_item_cdef.pxi} (84%) rename efl/elementary/{panel.pyx => panel.pxi} (77%) create mode 100644 efl/elementary/panel.py rename efl/elementary/{panel.pxd => panel_cdef.pxi} (95%) rename efl/elementary/{panes.pyx => panes.pxi} (85%) create mode 100644 efl/elementary/panes.py rename efl/elementary/{panes.pxd => panes_cdef.pxi} (96%) rename efl/elementary/{photo.pyx => photo.pxi} (85%) create mode 100644 efl/elementary/photo.py rename efl/elementary/{photo.pxd => photo_cdef.pxi} (93%) rename efl/elementary/{photocam.pyx => photocam.pxi} (84%) create mode 100644 efl/elementary/photocam.py rename efl/elementary/{photocam.pxd => photocam_cdef.pxi} (96%) rename efl/elementary/{plug.pyx => plug.pxi} (77%) create mode 100644 efl/elementary/plug.py rename efl/elementary/{plug.pxd => plug_cdef.pxi} (86%) rename efl/elementary/{popup.pyx => popup.pxi} (60%) create mode 100644 efl/elementary/popup.py rename efl/elementary/{popup.pxd => popup_cdef.pxi} (93%) rename efl/elementary/{progressbar.pyx => progressbar.pxi} (79%) create mode 100644 efl/elementary/progressbar.py rename efl/elementary/{progressbar.pxd => progressbar_cdef.pxi} (96%) rename efl/elementary/{radio.pyx => radio.pxi} (71%) create mode 100644 efl/elementary/radio.py rename efl/elementary/{radio.pxd => radio_cdef.pxi} (94%) rename efl/elementary/{scroller.pyx => scroller.pxi} (87%) create mode 100644 efl/elementary/scroller.py rename efl/elementary/{scroller.pxd => scroller_cdef.pxi} (97%) rename efl/elementary/{segment_control.pyx => segment_control.pxi} (90%) create mode 100644 efl/elementary/segment_control.py rename efl/elementary/{segment_control.pxd => segment_control_cdef.pxi} (93%) rename efl/elementary/{separator.pyx => separator.pxi} (79%) create mode 100644 efl/elementary/separator.py rename efl/elementary/{separator.pxd => separator_cdef.pxi} (85%) rename efl/elementary/{slider.pyx => slider.pxi} (85%) create mode 100644 efl/elementary/slider.py rename efl/elementary/{slider.pxd => slider_cdef.pxi} (97%) rename efl/elementary/{slideshow.pyx => slideshow.pxi} (89%) create mode 100644 efl/elementary/slideshow.py rename efl/elementary/{slideshow.pxd => slideshow_cdef.pxi} (95%) rename efl/elementary/{spinner.pyx => spinner.pxi} (89%) create mode 100644 efl/elementary/spinner.py rename efl/elementary/{spinner.pxd => spinner_cdef.pxi} (97%) rename efl/elementary/{systray.pyx => systray.pxi} (88%) create mode 100644 efl/elementary/systray.py rename efl/elementary/{systray.pxd => systray_cdef.pxi} (85%) rename efl/elementary/{table.pyx => table.pxi} (85%) create mode 100644 efl/elementary/table.py rename efl/elementary/{table.pxd => table_cdef.pxi} (95%) rename efl/elementary/{theme.pyx => theme.pxi} (78%) create mode 100644 efl/elementary/theme.py rename efl/elementary/{theme.pxd => theme_cdef.pxi} (65%) rename efl/elementary/{thumb.pyx => thumb.pxi} (76%) create mode 100644 efl/elementary/thumb.py rename efl/elementary/{thumb.pxd => thumb_cdef.pxi} (98%) rename efl/elementary/{toolbar.pyx => toolbar.pxi} (89%) create mode 100644 efl/elementary/toolbar.py rename efl/elementary/{toolbar.pxd => toolbar_cdef.pxi} (98%) delete mode 100644 efl/elementary/tooltips.pxi rename efl/elementary/{transit.pyx => transit.pxi} (88%) create mode 100644 efl/elementary/transit.py rename efl/elementary/{transit.pxd => transit_cdef.pxi} (98%) rename efl/elementary/{video.pyx => video.pxi} (92%) create mode 100644 efl/elementary/video.py rename efl/elementary/{video.pxd => video_cdef.pxi} (97%) rename efl/elementary/{web.pyx => web.pxi} (87%) create mode 100644 efl/elementary/web.py rename efl/elementary/{web.pxd => web_cdef.pxi} (98%) rename efl/elementary/{window.pyx => window.pxi} (83%) create mode 100644 efl/elementary/window.py rename efl/elementary/{window.pxd => window_cdef.pxi} (99%) create mode 100644 include/efl.elementary.pxd diff --git a/doc/elementary/actionslider.rst b/doc/elementary/actionslider.rst index df745d4..4619a9e 100644 --- a/doc/elementary/actionslider.rst +++ b/doc/elementary/actionslider.rst @@ -1,2 +1,83 @@ +Actionslider +############ -.. automodule:: efl.elementary.actionslider +.. image:: /images/actionslider-preview.png + + +Widget description +================== + +An actionslider is a switcher for two or three labels with +customizable magnet properties. + +The user drags and releases the indicator, to choose a label. + +Labels can occupy the following positions. + +- Left +- Right +- Center + +Positions can be enabled or disabled. + +Magnets can be set on the above positions. + +When the indicator is released, it will move to its nearest "enabled and +magnetized" position. + + +Emitted signals +=============== + +- ``selected`` - when user selects an enabled position (the label is + passed as event info)". +- ``pos_changed`` - when the indicator reaches any of the + positions("left", "right" or "center"). + + +Layout text parts +================= + +- ``indicator`` - An indicator label of the actionslider +- ``left`` - A left label of the actionslider +- ``right`` - A right label of the actionslider +- ``center`` - A center label of the actionslider + + +Enumerations +============ + +.. _Elm_Actionslider_Pos: + +Actionslider positions +---------------------- + +.. data:: ELM_ACTIONSLIDER_NONE + + No position + +.. data:: ELM_ACTIONSLIDER_LEFT + + Left position + +.. data:: ELM_ACTIONSLIDER_CENTER + + Center position + +.. data:: ELM_ACTIONSLIDER_RIGHT + + Right position + +.. data:: ELM_ACTIONSLIDER_ALL + + All positions + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Actionslider + :parts: 2 + + +.. autoclass:: efl.elementary.Actionslider diff --git a/doc/elementary/background.rst b/doc/elementary/background.rst index ddac36a..a6b1803 100644 --- a/doc/elementary/background.rst +++ b/doc/elementary/background.rst @@ -1,2 +1,56 @@ +Background +########## -.. automodule:: efl.elementary.background +.. image:: /images/background-preview.png + + +Widget description +================== + +The background widget is used for setting a solid color, image or Edje group +as a background to a window (unless it has transparency enabled) or any +container object. + +It works just like an image, but has some properties useful to a +background, like setting it to tiled, centered, scaled or stretched. + + +Layout content parts +==================== + +- ``overlay`` - overlay of the bg + + +Enumerations +============ + +.. _Elm_Bg_Option: + +Background display modes +------------------------ + +.. data:: ELM_BG_OPTION_CENTER + + Center + +.. data:: ELM_BG_OPTION_SCALE + + Scale + +.. data:: ELM_BG_OPTION_STRETCH + + Stretch + +.. data:: ELM_BG_OPTION_TILE + + Tile + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Background + :parts: 2 + + +.. autoclass:: efl.elementary.Background diff --git a/doc/elementary/box.rst b/doc/elementary/box.rst index 0661cf1..dd58ad3 100644 --- a/doc/elementary/box.rst +++ b/doc/elementary/box.rst @@ -1,2 +1,116 @@ +Box +### -.. automodule:: efl.elementary.box +.. image:: /images/box-preview.png + + +Widget description +================== + +A box arranges objects in a linear fashion, governed by a layout function +that defines the details of this arrangement. + +By default, the box will use an internal function to set the layout to +a single row, either vertical or horizontal. This layout is affected +by a number of parameters, such as the homogeneous flag set by +:py:attr:`~Box.homogeneous`, the values given by :py:attr:`~Box.padding` and +:py:attr:`~Box.align` and the hints set to each object in the box. + +For this default layout, it's possible to change the orientation with +:py:attr:`~Box.horizontal`. The box will start in the vertical orientation, +placing its elements ordered from top to bottom. When horizontal is set, +the order will go from left to right. If the box is set to be +homogeneous, every object in it will be assigned the same space, that +of the largest object. Padding can be used to set some spacing between +the cell given to each object. The alignment of the box, set with +:py:attr:`~Box.align`, determines how the bounding box of all the elements +will be placed within the space given to the box widget itself. + +The size hints of each object also affect how they are placed and sized +within the box. :py:attr:`~efl.evas.Object.size_hint_min` will give the minimum +size the object can have, and the box will use it as the basis for all +latter calculations. Elementary widgets set their own minimum size as +needed, so there's rarely any need to use it manually. + +:py:attr:`~efl.evas.Object.size_hint_weight`, when not in homogeneous mode, is +used to tell whether the object will be allocated the minimum size it +needs or if the space given to it should be expanded. It's important +to realize that expanding the size given to the object is not the same +thing as resizing the object. It could very well end being a small +widget floating in a much larger empty space. If not set, the weight +for objects will normally be 0.0 for both axis, meaning the widget will +not be expanded. To take as much space possible, set the weight to +``EVAS_HINT_EXPAND`` (defined to 1.0) for the desired axis to expand. + +Besides how much space each object is allocated, it's possible to control +how the widget will be placed within that space using +:py:attr:`~efl.evas.Object.size_hint_align`. By default, this value will be 0.5 +for both axis, meaning the object will be centered, but any value from +0.0 (left or top, for the ``x`` and ``y`` axis, respectively) to 1.0 +(right or bottom) can be used. The special value *EVAS_HINT_FILL*, which +is -1.0, means the object will be resized to fill the entire space it +was allocated. + +In addition, customized functions to define the layout can be set, which +allow the application developer to organize the objects within the box +in any number of ways. + +The special :py:meth:`Box.layout_transition` function can be used +to switch from one layout to another, animating the motion of the +children of the box. + +.. note:: Objects should not be added to box objects using _add() calls. + + +Enumerations +============ + +.. _Evas_Object_Box_Layout: + +Box layout modes +---------------- + +.. data:: ELM_BOX_LAYOUT_HORIZONTAL + + Horizontal layout + +.. data:: ELM_BOX_LAYOUT_VERTICAL + + Vertical layout + +.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL + + Homogeneous vertical layout + +.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL + + Homogeneous horizontal layout + +.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL + + Homogeneous layout, maximum size on the horizontal axis + +.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL + + Homogeneous layout, maximum size on the horizontal axis + +.. data:: ELM_BOX_LAYOUT_FLOW_HORIZONTAL + + Horizontally flowing layout + +.. data:: ELM_BOX_LAYOUT_FLOW_VERTICAL + + Vertically flowing layout + +.. data:: ELM_BOX_LAYOUT_STACK + + Stacking layout + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Box + :parts: 2 + +.. autoclass:: efl.elementary.Box diff --git a/doc/elementary/bubble.rst b/doc/elementary/bubble.rst index 3f0c1a9..62c4cc0 100644 --- a/doc/elementary/bubble.rst +++ b/doc/elementary/bubble.rst @@ -1,2 +1,86 @@ +Bubble +###### + +.. image:: /images/bubble-preview.png + + +Widget description +================== + +The Bubble is a widget to show text similar to how speech is +represented in comics. + +The bubble widget contains 5 important visual elements: + +- The frame is a rectangle with rounded edjes and an "arrow". +- The ``icon`` is an image to which the frame's arrow points to. +- The ``label`` is a text which appears to the right of the icon if the + corner is **top_left** or **bottom_left** and is right aligned to + the frame otherwise. +- The ``info`` is a text which appears to the right of the label. Info's + font is of a lighter color than label. +- The ``content`` is an evas object that is shown inside the frame. + +The position of the arrow, icon, label and info depends on which corner is +selected. The four available corners are: + +- ``top_left`` - Default +- ``top_right`` +- ``bottom_left`` +- ``bottom_right`` + + +Layout content parts +==================== + +- ``default`` - A content of the bubble +- ``icon`` - An icon of the bubble + + +Layout text parts +================= + +- ``default`` - Label of the bubble +- ``info`` - info of the bubble + + +Emitted signals +=============== + +- ``clicked`` - This is called when a user has clicked the bubble. +- ``focused`` - When the bubble has received focus. (since 1.8) +- ``unfocused`` - When the bubble has lost focus. (since 1.8) + + +Enumerations +============ + +.. _Elm_Bubble_Pos: + +Bubble arrow positions +---------------------- + +.. data:: ELM_BUBBLE_POS_TOP_LEFT + + Top left position + +.. data:: ELM_BUBBLE_POS_TOP_RIGHT + + Top right position + +.. data:: ELM_BUBBLE_POS_BOTTOM_LEFT + + Bottom left position + +.. data:: ELM_BUBBLE_POS_BOTTOM_RIGHT + + Bottom right position + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.bubble + :parts: 2 .. automodule:: efl.elementary.bubble diff --git a/doc/elementary/button.rst b/doc/elementary/button.rst index d138ba2..680266f 100644 --- a/doc/elementary/button.rst +++ b/doc/elementary/button.rst @@ -1,3 +1,63 @@ +Button +###### -.. automodule:: efl.elementary.button +.. image:: /images/button-preview.png + + +Widget description +================== + +This is a push-button. Press it and run some function. It can contain +a simple label and icon object and it also has an autorepeat feature. + + +Available styles +================ + +- ``default`` a normal button. +- ``anchor`` Like default, but the button fades away when the mouse is not + over it, leaving only the text or icon. +- ``hoversel_vertical`` Internally used by + :py:class:`~efl.elementary.hoversel.Hoversel` to give a continuous look + across its options. +- ``hoversel_vertical_entry`` Another internal for + :py:class:`~efl.elementary.hoversel.Hoversel`. +- ``naviframe`` Internally used by + :py:class:`~efl.elementary.naviframe.Naviframe` for its back button. +- ``colorselector`` Internally used by + :py:class:`~efl.elementary.colorselector.Colorselector` for its left and + right buttons. + + +Layout content parts +==================== + +- ``icon`` - An icon of the button + + +Layout text parts +================= + +- ``default`` - Label of the button + + +Emitted signals +=============== + +- ``clicked``: the user clicked the button (press/release). +- ``repeated``: the user pressed the button without releasing it. +- ``pressed``: button was pressed. +- ``unpressed``: button was released after being pressed. +- ``focused`` : When the button has received focus. (since 1.8) +- ``unfocused`` : When the button has lost focus. (since 1.8) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Button + :parts: 2 + + +.. autoclass:: efl.elementary.Button diff --git a/doc/elementary/calendar.rst b/doc/elementary/calendar.rst index c3fd57a..10026b7 100644 --- a/doc/elementary/calendar.rst +++ b/doc/elementary/calendar.rst @@ -1,2 +1,160 @@ +Calendar +######## -.. automodule:: efl.elementary.calendar_elm +.. image:: /images/calendar-preview.png + + +Widget description +================== + +This is a calendar widget. + +It helps applications to flexibly display a calender with day of the week, +date, year and month. Applications are able to set specific dates to be +reported back, when selected, in the smart callbacks of the calendar widget. +The API of this widget lets the applications perform other functions, like: + +- placing marks on specific dates +- setting the bounds for the calendar (minimum and maximum years) +- setting the day names of the week (e.g. "Thu" or "Thursday") +- setting the year and month format. + + +Emitted signals +=============== + +- ``changed`` - emitted when the date in the calendar is changed. +- ``display,changed`` - emitted when the current month displayed in the + calendar is changed. +- ``focused`` - When the calendar has received focus. (since 1.8) +- ``unfocused`` - When the calendar has lost focus. (since 1.8) + + +Enumerations +============ + +.. _Elm_Calendar_Mark_Repeat_Type: + +Calendar mark repeat types +-------------------------- + +.. data:: ELM_CALENDAR_UNIQUE + + Default value. + + Marks will be displayed only on event day. + +.. data:: ELM_CALENDAR_DAILY + + Marks will be displayed every day after event day (inclusive). + +.. data:: ELM_CALENDAR_WEEKLY + + Marks will be displayed every week after event day (inclusive) - i.e. + each seven days. + +.. data:: ELM_CALENDAR_MONTHLY + + Marks will be displayed every month day that coincides to event day. + + E.g.: if an event is set to 30th Jan, no marks will be displayed on Feb, + but will be displayed on 30th Mar + +.. data:: ELM_CALENDAR_ANNUALLY + + Marks will be displayed every year that coincides to event day (and month). + + E.g. an event added to 30th Jan 2012 will be repeated on 30th Jan 2013. + +.. data:: ELM_CALENDAR_LAST_DAY_OF_MONTH + + Marks will be displayed every last day of month after event day + (inclusive). + + +.. _Elm_Calendar_Select_Mode: + +Calendar selection modes +------------------------ + +.. data:: ELM_CALENDAR_SELECT_MODE_DEFAULT + + Default mode + +.. data:: ELM_CALENDAR_SELECT_MODE_ALWAYS + + Select always + +.. data:: ELM_CALENDAR_SELECT_MODE_NONE + + Don't select + +.. data:: ELM_CALENDAR_SELECT_MODE_ONDEMAND + + Select on demand + + +.. _Elm_Calendar_Selectable: + +Selectable +---------- + +.. data:: ELM_CALENDAR_SELECTABLE_NONE + + None selectable + +.. data:: ELM_CALENDAR_SELECTABLE_YEAR + + Year is selectable + +.. data:: ELM_CALENDAR_SELECTABLE_MONTH + + Month is selectable + +.. data:: ELM_CALENDAR_SELECTABLE_DAY + + Day is selectable + + +.. _Elm_Calendar_Weekday: + +Days +---- + +.. data:: ELM_DAY_SUNDAY + + Sunday + +.. data:: ELM_DAY_MONDAY + + Monday + +.. data:: ELM_DAY_TUESDAY + + Tuesday + +.. data:: ELM_DAY_WEDNESDAY + + Wednesday + +.. data:: ELM_DAY_THURSDAY + + Thursday + +.. data:: ELM_DAY_FRIDAY + + Friday + +.. data:: ELM_DAY_SATURDAY + + Saturday + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Calendar + :parts: 2 + + +.. autoclass:: efl.elementary.Calendar diff --git a/doc/elementary/check.rst b/doc/elementary/check.rst index 7da1ef8..5b37007 100644 --- a/doc/elementary/check.rst +++ b/doc/elementary/check.rst @@ -1,2 +1,47 @@ +Check +##### -.. automodule:: efl.elementary.check +.. image:: /images/check-preview.png + + +Widget description +================== + +The check widget allows for toggling a value between true and false. + +Check objects are a lot like radio objects in layout and functionality, +except they do not work as a group, but independently, and only toggle +the value of a boolean :py:attr:`~Check.state` between false and true. + + +Emitted signals +=============== + +- ``changed`` - This is called whenever the user changes the state of + the check objects. +- ``focused`` - When the check has received focus. (since 1.8) +- ``unfocused`` - When the check has lost focus. (since 1.8) + + +Layout content parts +==================== + +- ``icon`` - An icon of the check + + +Layout text parts +================= + +- ``default`` - A label of the check +- ``on`` - On state label of the check +- ``off`` - Off state label of the check + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Check + :parts: 2 + + +.. autoclass:: efl.elementary.Check diff --git a/doc/elementary/clock.rst b/doc/elementary/clock.rst index 519a6e2..010fa61 100644 --- a/doc/elementary/clock.rst +++ b/doc/elementary/clock.rst @@ -1,2 +1,92 @@ +Clock +##### -.. automodule:: efl.elementary.clock +.. image:: /images/clock-preview.png + + +Widget description +================== + +This is a digital clock widget. + +In its default theme, it has a vintage "flipping numbers clock" appearance, +which will animate sheets of individual algarisms individually as time goes +by. + +A newly created clock will fetch system's time (already considering +local time adjustments) to start with, and will tick accordingly. It may +or may not show seconds. + +Clocks have an **edition** mode. When in it, the sheets will display +extra arrow indications on the top and bottom and the user may click on +them to raise or lower the time values. After it's told to exit edition +mode, it will keep ticking with that new time set (it keeps the +difference from local time). + +Also, when under edition mode, user clicks on the cited arrows which are +**held** for some time will make the clock to flip the sheet, thus +editing the time, continuously and automatically for the user. The +interval between sheet flips will keep growing in time, so that it helps +the user to reach a time which is distant from the one set. + +The time display is, by default, in military mode (24h), but an am/pm +indicator may be optionally shown, too, when it will switch to 12h. + + +Emitted signals +=============== + +- ``changed`` - the clock's user changed the time +- ``focused`` - When the clock has received focus. (since 1.8) +- ``unfocused`` - When the clock has lost focus. (since 1.8) + + +Enumerations +============ + +.. _Elm_Clock_Edit_Mode: + +Clock edit modes +---------------- + +.. data:: ELM_CLOCK_EDIT_DEFAULT + + Default edit + +.. data:: ELM_CLOCK_EDIT_HOUR_DECIMAL + + Edit hours' decimal + +.. data:: ELM_CLOCK_EDIT_HOUR_UNIT + + Edit hours' unit + +.. data:: ELM_CLOCK_EDIT_MIN_DECIMAL + + Edit minutes' decimal + +.. data:: ELM_CLOCK_EDIT_MIN_UNIT + + Edit minutes' unit + +.. data:: ELM_CLOCK_EDIT_SEC_DECIMAL + + Edit seconds' decimal + +.. data:: ELM_CLOCK_EDIT_SEC_UNIT + + Edit seconds' unit + +.. data:: ELM_CLOCK_EDIT_ALL + + Edit all + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Clock + :parts: 2 + + +.. autoclass:: efl.elementary.Clock diff --git a/doc/elementary/colorselector.rst b/doc/elementary/colorselector.rst index 21b8103..ab27f70 100644 --- a/doc/elementary/colorselector.rst +++ b/doc/elementary/colorselector.rst @@ -1,2 +1,62 @@ +Colorselector +############# -.. automodule:: efl.elementary.colorselector +.. image:: /images/colorselector-preview.png + + +Widget description +================== + +A Colorselector is a color selection widget. + +It allows application to set a series of colors. It also allows to +load/save colors from/to config with a unique identifier, by default, +the colors are loaded/saved from/to config using "default" identifier. +The colors can be picked by user from the color set by clicking on +individual color item on the palette or by selecting it from selector. + + +Emitted signals +=============== + +- ``"changed"`` - When the color value changes on selector +- ``"color,item,selected"`` - When user clicks on color item. + The event_info parameter of the callback will be the selected + color item. +- ``"color,item,longpressed"`` - When user long presses on color item. + The event_info parameter of the callback will be the selected + color item. +- ``focused`` - When the colorselector has received focus. (since 1.8) +- ``unfocused`` - When the colorselector has lost focus. (since 1.8) + + +Enumerations +============ + +.. _Elm_Colorselector_Mode: + +Colorselector modes +------------------- + +.. data:: ELM_COLORSELECTOR_PALETTE + + Show palette + +.. data:: ELM_COLORSELECTOR_COMPONENTS + + Show components + +.. data:: ELM_COLORSELECTOR_BOTH + + Show palette and components + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.colorselector + :parts: 2 + + +.. autoclass:: efl.elementary.Colorselector +.. autoclass:: efl.elementary.ColorselectorPaletteItem diff --git a/doc/elementary/configuration.rst b/doc/elementary/configuration.rst index 3c992da..d5fa4b7 100644 --- a/doc/elementary/configuration.rst +++ b/doc/elementary/configuration.rst @@ -1,2 +1,161 @@ +Configuration +############# -.. automodule:: efl.elementary.configuration +Description +=========== + +Elementary configuration is formed by a set options bounded to a +given profile, like theme, "finger size", etc. + +These are functions with which one synchronizes changes made to those +values to the configuration storing files, de facto. You most probably +don't want to use the functions in this group unless you're writing an +elementary configuration manager. + +Profiles +======== + +Profiles are pre-set options that affect the whole look-and-feel of +Elementary-based applications. There are, for example, profiles +aimed at desktop computer applications and others aimed at mobile, +touchscreen-based ones. You most probably don't want to use the +functions in this group unless you're writing an elementary +configuration manager. + +Elementary Scrolling +==================== + +These set how scrollable views in Elementary widgets should behave on +user interaction. + +Password show last +================== + +Show last feature of password mode enables user to view the last input +entered for few seconds before masking it. These functions allow to set +this feature in password mode of entry widget and also allow to +manipulate the duration for which the input has to be visible. + +Elementary Engine +================= + +These are functions setting and querying which rendering engine +Elementary will use for drawing its windows' pixels. + +The following are the available engines: + +- "software_x11" +- "fb" +- "directfb" +- "software_16_x11" +- "software_8_x11" +- "xrender_x11" +- "opengl_x11" +- "software_gdi" +- "software_16_wince_gdi" +- "sdl" +- "software_16_sdl" +- "opengl_sdl" +- "buffer" +- "ews" +- "opengl_cocoa" +- "psl1ght" + + +ATSPI AT-SPI2 Accessibility +=========================== + +Elementary widgets support Linux Accessibility standard. For more +information please visit: +http://www.linuxfoundation.org/collaborate/workgroups/accessibility/atk/at-spi/at-spi_on_d-bus + + +Enumerations +============ + +.. _Elm_Softcursor_Mode: + +Elm_Softcursor_Mode +------------------- + +.. data:: ELM_SOFTCURSOR_MODE_AUTO + + Auto-detect if a software cursor should be used (default) + +.. data:: ELM_SOFTCURSOR_MODE_ON + + Always use a softcursor + +.. data:: ELM_SOFTCURSOR_MODE_OFF + + Never use a softcursor + + +.. _Elm_Slider_Indicator_Visible_Mode: + +Elm_Slider_Indicator_Visible_Mode +--------------------------------- + +.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT + + show indicator on mouse down or change in slider value + +.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS + + Always show the indicator + +.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS + + Show the indicator on focus + +.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE + + Never show the indicator + + +.. _Edje_Channel: + +Audio Channels +-------------- + +.. data:: EDJE_CHANNEL_EFFECT + + Standard audio effects + +.. data:: EDJE_CHANNEL_BACKGROUND + + Background audio sounds + +.. data:: EDJE_CHANNEL_MUSIC + + Music audio + +.. data:: EDJE_CHANNEL_FOREGROUND + + Foreground audio sounds + +.. data:: EDJE_CHANNEL_INTERFACE + + Sounds related to the interface + +.. data:: EDJE_CHANNEL_INPUT + + Sounds related to regular input + +.. data:: EDJE_CHANNEL_ALERT + + Sounds for major alerts + +.. data:: EDJE_CHANNEL_ALL + + All audio channels (convenience) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Configuration + :parts: 2 + + +.. autoclass:: efl.elementary.Configuration diff --git a/doc/elementary/conformant.rst b/doc/elementary/conformant.rst index b13449c..a428e8c 100644 --- a/doc/elementary/conformant.rst +++ b/doc/elementary/conformant.rst @@ -1,2 +1,41 @@ +Conformant +########## -.. automodule:: efl.elementary.conformant +.. image:: /images/conformant-preview.png + + +Widget description +================== + +The aim is to provide a widget that can be used in elementary apps to +account for space taken up by the indicator, virtual keypad & softkey +windows when running the illume2 module of E17. + +So conformant content will be sized and positioned considering the +space required for such stuff, and when they popup, as a keyboard +shows when an entry is selected, conformant content won't change. + + +Emitted signals +=============== + +- ``virtualkeypad,state,on``: if virtualkeypad state is switched to ``on``. +- ``virtualkeypad,state,off``: if virtualkeypad state is switched to ``off``. +- ``clipboard,state,on``: if clipboard state is switched to ``on``. +- ``clipboard,state,off``: if clipboard state is switched to ``off``. + + +Layout content parts +==================== + +- ``default`` - A content of the conformant + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Conformant + :parts: 2 + + +.. autoclass:: efl.elementary.Conformant diff --git a/doc/elementary/ctxpopup.rst b/doc/elementary/ctxpopup.rst index 95151ac..bfad5bc 100644 --- a/doc/elementary/ctxpopup.rst +++ b/doc/elementary/ctxpopup.rst @@ -1,2 +1,82 @@ +Ctxpopup +######## -.. automodule:: efl.elementary.ctxpopup +.. image:: /images/ctxpopup-preview.png + + +Widget description +================== + +A ctxpopup is a widget that, when shown, pops up a list of items. It +automatically chooses an area inside its parent object's view to +optimally fit into it. In the default theme, it will also point an arrow +to it's top left position at the time one shows it. Ctxpopup items have +a label and/or an icon. It is intended for a small number of items +(hence the use of list, not genlist). + +.. note:: + + Ctxpopup is a specialization of :py:class:`~efl.elementary.hover.Hover`. + +Emitted signals +=============== + +- ``dismissed`` - This is called when 1. the outside of ctxpopup was clicked + or 2. its parent area is changed or 3. the language is changed and also when + 4. the parent object is resized due to the window rotation. Then ctxpopup is + dismissed. +- ``language,changed`` - This is called when the program's language is + changed. +- ``focused`` - When the ctxpopup has received focus. (since 1.8) +- ``unfocused`` - When the ctxpopup has lost focus. (since 1.8) + +Layout content parts +==================== + +- ``default`` - A content of the ctxpopup +- ``icon`` - An icon in the title area + +Layout text parts +================= + +- ``default`` - Title label in the title area + + +Enumerations +============ + +.. _Elm_Ctxpopup_Direction: + +Ctxpopup arrow directions +------------------------- + +.. data:: ELM_CTXPOPUP_DIRECTION_DOWN + + Arrow is pointing down + +.. data:: ELM_CTXPOPUP_DIRECTION_RIGHT + + Arrow is pointing right + +.. data:: ELM_CTXPOPUP_DIRECTION_LEFT + + Arrow is pointing left + +.. data:: ELM_CTXPOPUP_DIRECTION_UP + + Arrow is pointing up + +.. data:: ELM_CTXPOPUP_DIRECTION_UNKNOWN + + Arrow direction is unknown + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Ctxpopup + :parts: 2 + + +.. autoclass:: efl.elementary.Ctxpopup +.. autoclass:: efl.elementary.CtxpopupItem diff --git a/doc/elementary/datetime.rst b/doc/elementary/datetime.rst index cf98d10..145d704 100644 --- a/doc/elementary/datetime.rst +++ b/doc/elementary/datetime.rst @@ -1,2 +1,218 @@ +Datetime +######## -.. automodule:: efl.elementary.datetime_elm +Widget description +================== + +Datetime widget is used to display and input date & time values. + +This widget displays date and time as per the **system's locale** settings +(Date includes Day, Month & Year along with the defined separators and Time +includes Hour, Minute & AM/PM fields). Separator for AM/PM field is ignored. + +The corresponding Month, AM/PM strings are displayed according to the +system’s language settings. + +Datetime format is a combination of LIBC standard characters like "%%d %%b +%%Y %%I : %%M %%p" which, as a whole represents both Date as well as Time +format. + +Elm_datetime supports only the following sub set of libc date format specifiers: + +**%%Y** The year as a decimal number including the century (example: 2011). + +**%%y** The year as a decimal number without a century (range 00 to 99) + +**%%m** The month as a decimal number (range 01 to 12). + +**%%b** The abbreviated month name according to the current locale. + +**%%B** The full month name according to the current locale. + +**%%h** The abbreviated month name according to the current locale(same as %%b). + +**%%d** The day of the month as a decimal number (range 01 to 31). + +**%%e** The day of the month as a decimal number (range 1 to 31). single + digits are preceded by a blank. + +**%%I** The hour as a decimal number using a 12-hour clock (range 01 to 12). + +**%%H** The hour as a decimal number using a 24-hour clock (range 00 to 23). + +**%%k** The hour (24-hour clock) as a decimal number (range 0 to 23). single + digits are preceded by a blank. + +**%%l** The hour (12-hour clock) as a decimal number (range 1 to 12); single + digits are preceded by a blank. + +**%%M** The minute as a decimal number (range 00 to 59). + +**%%p** Either 'AM' or 'PM' according to the given time value, or the + corresponding strings for the current locale. Noon is treated as 'PM' + and midnight as 'AM' + +**%%P** Like %p but in lower case: 'am' or 'pm' or a corresponding string for + the current locale. + +**%%c** The preferred date and time representation for the current locale. + +**%%x** The preferred date representation for the current locale without the time. + +**%%X** The preferred time representation for the current locale without the date. + +**%%r** The complete calendar time using the AM/PM format of the current locale. + +**%%R** The hour and minute in decimal numbers using the format %H:%M. + +**%%T** The time of day in decimal numbers using the format %H:%M:%S. + +**%%D** The date using the format %%m/%%d/%%y. + +**%%F** The date using the format %%Y-%%m-%%d. + + +(For more reference on the available **LIBC date format specifiers**, +please visit the link: +http://www.gnu.org/s/hello/manual/libc.html#Formatting-Calendar-Time ) + +Datetime widget can provide Unicode **separators** in between its fields +except for AM/PM field. A separator can be any **Unicode character** +other than the LIBC standard date format specifiers. + +Example: In the format:: + + %%b %%d **,** %%y %%H **:** %%M + +comma(,) is separator for date field %%d and colon(:) is separator for +hour field %%H. + +The default format is a predefined one, based on the system Locale. + +Hour format 12hr(1-12) or 24hr(0-23) display can be selected by setting +the corresponding user format. + +Datetime supports six fields: Year, Month, Date, Hour, Minute, AM/PM. +Depending on the Datetime module that is loaded, the user can see +different UI to select the individual field values. + +The individual fields of Datetime can be arranged in any order according +to the format set by application. + +There is a provision to set the visibility of a particular field as TRUE/ +FALSE so that **only time/ only date / only required fields** will be +displayed. + +Each field is having a default minimum and maximum values just like the +daily calendar information. These min/max values can be modified as per +the application usage. + +User can enter the values only in between the range of maximum and +minimum. Apart from these APIs, there is a provision to display only a +limited set of values out of the possible values. APIs to select the +individual field limits are intended for this purpose. + +The whole widget is left aligned and its size grows horizontally +depending on the current format and each field's visible/disabled state. + +Datetime individual field selection is implemented in a modular style. +Module can be implemented as a Ctxpopup based selection or an ISE based +selection or even a spinner like selection etc. + +Datetime Module design +====================== + +The following functions are expected to be implemented in a Datetime module: + +**Field creation**:: + + __________ __________ + | |----- obj_hook() ---------------------->>>| | + | |<<<----------------returns Mod_data ------| | + | Datetime |_______ | | + | widget | |Assign module call backs | Module | + | base |<<<____| | | + | | | | + | |----- field_create() ------------------>>>| | + |__________|<<<----------------returns field_obj -----|__________| + +**Field value setting**:: + + __________ __________ + | | | | + | Datetime |<<<----------elm_datetime_value_set()---| | + | widget | | Module | + | base |----display_field_value()------------>>>| | + |__________| |__________| + +**del_hook**:: + + __________ __________ + | | | | + | Datetime |----obj_unhook()-------------------->>>>| | + | widget | | Module | + | base | <<<-----frees mod_data---------| | + |__________| |__________| + +Any module can use the following shared functions that are implemented in +elm_datetime.c: + +**field_format_get()** - gives the field format. + +**field_limit_get()** - gives the field minimum, maximum limits. + +To enable a module, set the ELM_MODULES environment variable as shown: + +**export ELM_MODULES="datetime_input_ctxpopup>datetime/api"** + + +Emitted signals +=============== + +- ``changed`` - whenever Datetime field value is changed, this signal is sent. +- ``language,changed`` - whenever system locale changes, this signal is sent. +- ``focused`` - When the datetime has received focus. (since 1.8) +- ``unfocused`` - When the datetime has lost focus. (since 1.8) + + +Enumerations +============ + +.. _Elm_Datetime_Field_Type: + +Datetime fields +--------------- + +.. data:: ELM_DATETIME_YEAR + + Year + +.. data:: ELM_DATETIME_MONTH + + Month + +.. data:: ELM_DATETIME_DATE + + Date + +.. data:: ELM_DATETIME_HOUR + + Hour + +.. data:: ELM_DATETIME_MINUTE + + Minute + +.. data:: ELM_DATETIME_AMPM + + Am/Pm + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Datetime + :parts: 2 + + +.. autoclass:: efl.elementary.Datetime diff --git a/doc/elementary/dayselector.rst b/doc/elementary/dayselector.rst index 4540b10..4a2d523 100644 --- a/doc/elementary/dayselector.rst +++ b/doc/elementary/dayselector.rst @@ -1,2 +1,97 @@ +Dayselector +########### -.. automodule:: efl.elementary.dayselector +.. image:: /images/dayselector-preview.png + + +Widget description +================== + +Dayselector displays all seven days of the week and allows the user to +select multiple days. + +The selection can be toggle by just clicking on the day. + +Dayselector also provides the functionality to check whether a day is +selected or not. + +First day of the week is taken from config settings by default. It can be +altered by using the API :py:attr:`~Dayselector.week_start` API. + +APIs are provided for setting the duration of weekend +:py:attr:`~Dayselector.weekend_start` and :py:attr:`~Dayselector.weekend_length` +does this job. + +Two styles of weekdays and weekends are supported in Dayselector. +Application can emit signals on individual check objects for setting the +weekday, weekend styles. + +Once the weekend start day or weekend length changes, all the weekday & +weekend styles will be reset to default style. It's the application's +responsibility to set the styles again by sending corresponding signals. + +"day0" indicates Sunday, "day1" indicates Monday etc. continues and so, +"day6" indicates the Saturday part name. + +Application can change individual day display string by using the API +:py:meth:`~efl.elementary.object.Object.part_text_set`. + +:py:meth:`~efl.elementary.object.Object.part_content_set` API sets the +individual day object only if the passed one is a Check widget. + +Check object representing a day can be set/get by the application by using +the elm_object_part_content_set/get APIs thus providing a way to handle +the different check styles for individual days. + + +Emitted signals +=============== + +- ``dayselector,changed`` - when the user changes the state of a day. +- ``language,changed`` - the program's language changed + + +Enumerations +============ + +.. _Elm_Dayselector_Day: + +Dayselector days +---------------- + +.. data:: ELM_DAYSELECTOR_SUN + + Sunday + +.. data:: ELM_DAYSELECTOR_MON + + Monday + +.. data:: ELM_DAYSELECTOR_TUE + + Tuesday + +.. data:: ELM_DAYSELECTOR_WED + + Wednesday + +.. data:: ELM_DAYSELECTOR_THU + + Thursday + +.. data:: ELM_DAYSELECTOR_FRI + + Friday + +.. data:: ELM_DAYSELECTOR_SAT + + Saturday + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Dayselector + :parts: 2 + +.. autoclass:: efl.elementary.Dayselector diff --git a/doc/elementary/diskselector.rst b/doc/elementary/diskselector.rst index 10879bd..2b4581d 100644 --- a/doc/elementary/diskselector.rst +++ b/doc/elementary/diskselector.rst @@ -1,2 +1,68 @@ +Diskselector +############ -.. automodule:: efl.elementary.diskselector +.. image:: /images/diskselector-preview.png + + +Widget description +================== + +A diskselector is a kind of list widget. It scrolls horizontally, +and can contain label and icon objects. Three items are displayed +with the selected one in the middle. + +It can act like a circular list with round mode and labels can be +reduced for a defined length for side items. + + +Emitted signals +=============== + +- ``selected`` - when item is selected, i.e. scroller stops. +- ``clicked`` - This is called when a user clicks an item +- ``scroll,anim,start`` - scrolling animation has started +- ``scroll,anim,stop`` - scrolling animation has stopped +- ``scroll,drag,start`` - dragging the diskselector has started +- ``scroll,drag,stop`` - dragging the diskselector has stopped +- ``focused`` - When the diskselector has received focus. (since 1.8) +- ``unfocused`` - When the diskselector has lost focus. (since 1.8) + +.. note:: The ``scroll,anim,*`` and ``scroll,drag,*`` signals are only emitted + by user intervention. + +Layout content parts +==================== + +- ``icon`` - An icon in the diskselector item + + +Layout text parts +================= + +- ``default`` - Label of the diskselector item + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scrolling behaviour using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.scroller.Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Diskselector + :parts: 2 + + +.. autoclass:: efl.elementary.Diskselector +.. autoclass:: efl.elementary.DiskselectorItem diff --git a/doc/elementary/elementary.rst b/doc/elementary/elementary.rst index 657598f..c4030ac 100644 --- a/doc/elementary/elementary.rst +++ b/doc/elementary/elementary.rst @@ -1,3 +1,4 @@ +.. module:: efl.elementary Elementary ########## @@ -51,11 +52,44 @@ A sample Python Elementary program API Reference ============= +.. autofunction:: init +.. autofunction:: shutdown +.. autofunction:: run +.. autofunction:: exit + +.. autofunction:: on_ethumb_connect +.. autofunction:: on_config_all_changed +.. autofunction:: on_policy_changed + +.. autofunction:: on_process_background +.. autofunction:: on_process_background + +.. autofunction:: on_sys_notify_notification_closed +.. autofunction:: on_sys_notify_action_invoked + +.. autofunction:: policy_set +.. autofunction:: policy_get +.. autofunction:: process_state_get +.. autofunction:: coords_finger_size_adjust + +.. autofunction:: language_set +.. autofunction:: cache_all_flush +.. autofunction:: font_properties_get +.. autofunction:: font_properties_free + +.. autofunction:: font_fontconfig_name_get +.. autofunction:: object_tree_dump +.. autofunction:: object_tree_dot_dump + +.. autofunction:: sys_notify_close +.. autofunction:: sys_notify_send + .. toctree:: * :glob: :maxdepth: 1 + Inheritance diagram =================== diff --git a/doc/elementary/entry.rst b/doc/elementary/entry.rst index bd5ba13..b279d00 100644 --- a/doc/elementary/entry.rst +++ b/doc/elementary/entry.rst @@ -1,2 +1,590 @@ +Entry +##### -.. automodule:: efl.elementary.entry +.. image:: /images/entry-preview.png + + +Widget description +================== + +An entry is a convenience widget which shows a box that the user can +enter text into. + +Entries by default don't scroll, so they grow to accommodate the entire text, +resizing the parent window as needed. This can be changed with the property +:py:attr:`~efl.elementary.entry.Entry.scrollable`. + +They can also be single line or multi line (the default) and when set +to multi line mode they support text wrapping in any of the modes +indicated by :ref:`Elm_Entry_Wrap_Type`. + +Other features include password mode, filtering of inserted text with +:py:meth:`~efl.elementary.entry.Entry.markup_filter_append` and related +functions, inline "items" and formatted markup text. + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scolling behaviour using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.scroller.Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Formatted text +============== + +The markup tags supported by the Entry are defined by the theme, but +even when writing new themes or extensions it's a good idea to stick to +a sane default, to maintain coherency and avoid application breakages. +Currently defined by the default theme are the following tags: + +``
`` + Inserts a line break. +```` + Inserts a paragraph separator. This is preferred over line + breaks. +```` + Inserts a tab. +``...`` + Emphasis. Sets the *oblique* style for the + enclosed text. +``...`` + Sets the **bold** style for the enclosed text. +``...`` + Underlines the enclosed text. +``...`` + Highlights the enclosed text. + + +Special markups +=============== + +Besides those used to format text, entries support two special markup +tags used to insert click-able portions of text or items inlined within +the text. + + +Anchors +------- + +Anchors are similar to HTML anchors. Text can be surrounded by and + tags and an event will be generated when this text is clicked, +like this:: + + This text is outside but this one is an anchor + +The ``href`` attribute in the opening tag gives the name that will be +used to identify the anchor and it can be any valid utf8 string. + +When an anchor is clicked, an ``"anchor,clicked"`` signal is emitted with +an :py:class:`EntryAnchorInfo` in the ``event_info`` parameter for the +callback function. The same applies for ``anchor,in`` (mouse in), +``anchor,out`` (mouse out), ``anchor,down`` (mouse down), and ``anchor,up`` +(mouse up) events on an anchor. + + +Items +----- + +Inlined in the text, any other :py:class:`~efl.elementary.object.Object` can +be inserted by using ```` tags this way:: + + + +Just like with anchors, the ``href`` identifies each item, but these need, +in addition, to indicate their size, which is done using any one of +``size``, ``absize`` or ``relsize`` attributes. These attributes take their +value in the WxH format, where W is the width and H the height of the +item. + +- absize: Absolute pixel size for the item. Whatever value is set will + be the item's size regardless of any scale value the object may have + been set to. The final line height will be adjusted to fit larger items. +- size: Similar to *absize*, but it's adjusted to the scale value set + for the object. +- relsize: Size is adjusted for the item to fit within the current + line height. + +Besides their size, items are specified a ``vsize`` value that affects +how their final size and position are calculated. The possible values +are: + +- ``ascent``: Item will be placed within the line's baseline and its + ascent. That is, the height between the line where all characters are + positioned and the highest point in the line. For ``size`` and + ``absize`` items, the descent value will be added to the total line + height to make them fit. ``relsize`` items will be adjusted to fit + within this space. +- ``full``: Items will be placed between the descent and ascent, or the + lowest point in the line and its highest. + +After the size for an item is calculated, the entry will request an object to +place in its space. For this, the functions set with +:py:meth:`~efl.elementary.entry.Entry.item_provider_append` and related +functions will be called in order until one of them returns a non-*None* value. +If no providers are available, or all of them return *None*, then the entry +falls back to one of the internal defaults, provided the name matches with one +of them. + +All of the following are currently supported: + +- emoticon/angry +- emoticon/angry-shout +- emoticon/crazy-laugh +- emoticon/evil-laugh +- emoticon/evil +- emoticon/goggle-smile +- emoticon/grumpy +- emoticon/grumpy-smile +- emoticon/guilty +- emoticon/guilty-smile +- emoticon/haha +- emoticon/half-smile +- emoticon/happy-panting +- emoticon/happy +- emoticon/indifferent +- emoticon/kiss +- emoticon/knowing-grin +- emoticon/laugh +- emoticon/little-bit-sorry +- emoticon/love-lots +- emoticon/love +- emoticon/minimal-smile +- emoticon/not-happy +- emoticon/not-impressed +- emoticon/omg +- emoticon/opensmile +- emoticon/smile +- emoticon/sorry +- emoticon/squint-laugh +- emoticon/surprised +- emoticon/suspicious +- emoticon/tongue-dangling +- emoticon/tongue-poke +- emoticon/uh +- emoticon/unhappy +- emoticon/very-sorry +- emoticon/what +- emoticon/wink +- emoticon/worried +- emoticon/wtf + +Alternatively, an item may reference an image by its path, using +the URI form ``file:///path/to/an/image.png`` and the entry will then +use that image for the item. + + +Setting entry's style +===================== + +There are 2 major ways to change the entry's style: + +- Theme - set the "base" field to the desired style. +- User style - Pushing overrides to the theme style to the textblock object + by using :py:meth:`~efl.elementary.entry.Entry.text_style_user_push`. + +You should modify the theme when you would like to change the style for +aesthetic reasons. While the user style should be changed when you would +like to change the style to something specific defined at run-time, e.g, +setting font or font size in a text editor. + + +Loading and saving files +======================== + +Entries have convenience functions to load text from a file and save changes +back to it after a short delay. The automatic saving is enabled by default, but +can be disabled with :py:attr:`~efl.elementary.entry.Entry.autosave` and files +can be loaded directly as plain text or have any markup in them recognized. See +:py:attr:`~efl.elementary.entry.Entry.file` for more details. + + +Emitted signals +=============== + +- ``changed``: The text within the entry was changed. +- ``changed,user``: The text within the entry was changed because of user + interaction. +- ``activated``: The enter key was pressed on a single line entry. +- ``aborted``: The escape key was pressed on a single line entry. (since 1.7) +- ``press``: A mouse button has been pressed on the entry. +- ``longpressed``: A mouse button has been pressed and held for a couple + seconds. +- ``clicked``: The entry has been clicked (mouse press and release). +- ``clicked,double``: The entry has been double clicked. +- ``clicked,triple``: The entry has been triple clicked. +- ``focused``: The entry has received focus. +- ``unfocused``: The entry has lost focus. +- ``selection,paste``: A paste of the clipboard contents was requested. +- ``selection,copy``: A copy of the selected text into the clipboard was + requested. +- ``selection,cut``: A cut of the selected text into the clipboard was + requested. +- ``selection,start``: A selection has begun and no previous selection + existed. +- ``selection,changed``: The current selection has changed. +- ``selection,cleared``: The current selection has been cleared. +- ``cursor,changed``: The cursor has changed position. +- ``anchor,clicked``: An anchor has been clicked. The event_info + parameter for the callback will be an :py:class:`EntryAnchorInfo`. +- ``anchor,in``: Mouse cursor has moved into an anchor. The event_info + parameter for the callback will be an :py:class:`EntryAnchorInfo`. +- ``anchor,out``: Mouse cursor has moved out of an anchor. The event_info + parameter for the callback will be an :py:class:`EntryAnchorInfo`. +- ``anchor,up``: Mouse button has been unpressed on an anchor. The event_info + parameter for the callback will be an :py:class:`EntryAnchorInfo`. +- ``anchor,down``: Mouse button has been pressed on an anchor. The event_info + parameter for the callback will be an :py:class:`EntryAnchorInfo`. +- ``preedit,changed``: The preedit string has changed. +- ``language,changed``: Program language changed. +- ``text,set,done``: Whole text has been set to the entry. +- ``rejected``: .Called when some of inputs are rejected by the filter. (since 1.9) + + +Layout content parts +==================== + +- ``icon`` - An icon in the entry +- ``end`` - A content in the end of the entry + + +Layout text parts +================= + +- ``default`` - text of the entry +- ``guide`` - placeholder of the entry + + +Enumerations +============ + +.. _Elm_Entry_Autocapital_Type: + +Autocapitalization types +------------------------ + +.. data:: ELM_AUTOCAPITAL_TYPE_NONE + + No auto-capitalization when typing + +.. data:: ELM_AUTOCAPITAL_TYPE_WORD + + Autocapitalize each word typed + +.. data:: ELM_AUTOCAPITAL_TYPE_SENTENCE + + Autocapitalize the start of each sentence + +.. data:: ELM_AUTOCAPITAL_TYPE_ALLCHARACTER + + Autocapitalize all letters + + +.. _Elm_Entry_Cnp_Mode: + +Copy & paste modes +------------------ + +.. data:: ELM_CNP_MODE_MARKUP + + Copy & paste text with markup tags + +.. data:: ELM_CNP_MODE_NO_IMAGE + + Copy & paste text without item (image) tags + +.. data:: ELM_CNP_MODE_PLAINTEXT + + Copy & paste text without markup tags + + +.. _Elm_Input_Hints: + +Input Hints +----------- + +.. data:: ELM_INPUT_HINT_NONE + + No active hints + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_HINT_AUTO_COMPLETE + + Suggest word auto completion + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_HINT_SENSITIVE_DATA + + typed text should not be stored + + .. versionadded:: 1.12 + + +.. _Elm_Entry_Input_Panel_Lang: + +Input panel language sort order +------------------------------- + +.. data:: ELM_INPUT_PANEL_LANG_AUTOMATIC + + Automatic + +.. data:: ELM_INPUT_PANEL_LANG_ALPHABET + + Alphabetic + + +.. _Elm_Entry_Input_Panel_Layout: + +Input panel layouts +------------------- + +.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL + + Default layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBER + + Number layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_EMAIL + + Email layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_URL + + URL layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_PHONENUMBER + + Phone number layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_IP + + IP layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_MONTH + + Month layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY + + Number only layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_INVALID + + Never use this + +.. data:: ELM_INPUT_PANEL_LAYOUT_HEX + + Hexadecimal layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_TERMINAL + + Command-line terminal layout + +.. data:: ELM_INPUT_PANEL_LAYOUT_PASSWORD + + Like normal, but no auto-correct, no auto-capitalization etc. + +.. data:: ELM_INPUT_PANEL_LAYOUT_DATETIME + + Date and time layout + + .. versionadded:: 1.10 + +.. data:: ELM_INPUT_PANEL_LAYOUT_EMOTICON + + Emoticon layout + + .. versionadded:: 1.10 + + +.. _Elm_Input_Panel_Layout_Normal_Variation: + +Input panel normal layout variation +----------------------------------- + +.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL + + The plain normal layout + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME + + Filename layout. Symbols such as '/' should be disabled + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME + + The name of a person + + .. versionadded:: 1.12 + + +.. _Elm_Input_Panel_Layout_Numberonly_Variation: + +Input panel numberonly layout variation +--------------------------------------- + +.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL + + The numberonly normal layout + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED + + The signed number layout + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL + + The decimal number layout + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL + + The signed and decimal number layout + + .. versionadded:: 1.12 + + +.. _Elm_Input_Panel_Layout_Password_Variation: + +Input panel password layout variation +------------------------------------- + +.. data:: ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL + + The normal password layout + + .. versionadded:: 1.12 + +.. data:: ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY + + The password layout to allow only number + + .. versionadded:: 1.12 + + +.. _Elm_Entry_Input_Panel_Return_Key_Type: + +Input panel return key modes +---------------------------- + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT + + Default + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE + + Done + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO + + Go + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN + + Join + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN + + Login + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT + + Next + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH + + Search + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND + + Send + +.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN + + Sign-in + + .. versionadded:: 1.10 + + +.. _Elm_Entry_Text_Format: + +Text format +----------- + +.. data:: ELM_TEXT_FORMAT_PLAIN_UTF8 + + Plain UTF-8 type + +.. data:: ELM_TEXT_FORMAT_MARKUP_UTF8 + + UTF-8 with markup + + +.. _Elm_Entry_Wrap_Type: + +Wrap mode +--------- + +.. data:: ELM_WRAP_NONE + + No wrap + +.. data:: ELM_WRAP_CHAR + + Wrap between characters + +.. data:: ELM_WRAP_WORD + + Wrap in allowed wrapping points (as defined in the unicode standard) + +.. data:: ELM_WRAP_MIXED + + Word wrap, and if that fails, char wrap + + +.. _Elm_Entry_Icon_Type: + +Icon types +---------- + +.. data:: ELM_ICON_NONE + + No icon + +.. data:: ELM_ICON_FILE + + Icon is a file + +.. data:: ELM_ICON_STANDARD + + Icon is set with standards names + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Entry + :parts: 2 + + +.. autoclass:: efl.elementary.Entry diff --git a/doc/elementary/fileselector.rst b/doc/elementary/fileselector.rst index 00ddcf4..bf3d2e9 100644 --- a/doc/elementary/fileselector.rst +++ b/doc/elementary/fileselector.rst @@ -1,2 +1,135 @@ +Fileselector +############ -.. automodule:: efl.elementary.fileselector +.. image:: /images/fileselector-preview.png + + +Widget description +================== + +A file selector is a widget that allows a user to navigate through a +file system, reporting file selections back via its API. + +It contains shortcut buttons for home directory (*~*) and to jump one +directory upwards (..), as well as cancel/ok buttons to confirm/cancel a +given selection. After either one of those two former actions, the file +selector will issue its ``"done"`` smart callback. + +There's a text entry on it, too, showing the name of the current +selection. There's the possibility of making it editable, so it is +useful on file saving dialogs on applications, where one gives a file +name to save contents to, in a given directory in the system. This +custom file name will be reported on the ``"done"`` smart callback +(explained in sequence). + +Finally, it has a view to display file system items into in two possible +forms: + +- list +- grid + +If Elementary is built with support of the Ethumb thumbnailing library, +the second form of view will display preview thumbnails of files which +it supports. + + +Emitted signals +=============== + +- ``activated`` - the user activated a file. This can happen by + double-clicking or pressing Enter key. (**event_info** is a string with the + activated file path) +- ``selected`` - the user has clicked on a file (when not in folders-only + mode) or directory (when in folders-only mode) +- ``directory,open`` - the list has been populated with new content + (*event_info* is the directory's path) +- ``done`` - the user has clicked on the "ok" or "cancel" + buttons (*event_info* is the selection's path) + + +Layout text parts +================= + +- ``ok`` - OK button label if the ok button is set. (since 1.8) +- ``cancel`` - Cancel button label if the cancel button is set. (since 1.8) + + +Enumerations +============ + +.. _Elm_Fileselector_Mode: + +Fileselector modes +------------------ + +.. data:: ELM_FILESELECTOR_LIST + + Layout as a list + +.. data:: ELM_FILESELECTOR_GRID + + Layout as a grid + + +.. _Elm_Fileselector_Sort: + +Fileselector sort method +------------------------ + +.. data:: ELM_FILESELECTOR_SORT_BY_FILENAME_ASC + + Sort by filename in ascending order + + .. versionadded:: 1.9 + +.. data:: ELM_FILESELECTOR_SORT_BY_FILENAME_DESC + + Sort by filename in descending order + + .. versionadded:: 1.9 + +.. data:: ELM_FILESELECTOR_SORT_BY_TYPE_ASC + + Sort by file type in ascending order + + .. versionadded:: 1.9 + +.. data:: ELM_FILESELECTOR_SORT_BY_TYPE_DESC + + Sort by file type in descending order + + .. versionadded:: 1.9 + +.. data:: ELM_FILESELECTOR_SORT_BY_SIZE_ASC + + Sort by file size in ascending order + + .. versionadded:: 1.9 + +.. data:: ELM_FILESELECTOR_SORT_BY_SIZE_DESC + + Sort by file size in descending order + + .. versionadded:: 1.9 + +.. data:: ELM_FILESELECTOR_SORT_BY_MODIFIED_ASC + + Sort by file modification date in ascending order + + .. versionadded:: 1.9 + +.. data:: ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC + + Sort by file modification date in descending order + + .. versionadded:: 1.9 + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Fileselector + :parts: 2 + + +.. autoclass:: efl.elementary.Fileselector diff --git a/doc/elementary/fileselector_button.rst b/doc/elementary/fileselector_button.rst index b2566b7..179ee66 100644 --- a/doc/elementary/fileselector_button.rst +++ b/doc/elementary/fileselector_button.rst @@ -1,2 +1,73 @@ +Fileselector Button +################### -.. automodule:: efl.elementary.fileselector_button +.. image:: /images/fileselector-button-preview.png + + +Widget description +================== + +This is a button that, when clicked, creates an Elementary window (or +inner window) with a :py:class:`~efl.elementary.fileselector.Fileselector` +within. + +When a file is chosen, the (inner) window is closed and the button emits +a signal having the selected file as it's ``event_info``. + +This widget encapsulates operations on its internal file selector on its +own API. There is less control over its file selector than that one +would have instantiating one directly. + + +Available styles +================ + +- ``default`` +- ``anchor`` +- ``hoversel_vertical`` +- ``hoversel_vertical_entry`` + + +Emitted signals +=============== + +- ``file,chosen`` - the user has selected a path which comes as the + ``event_info`` data +- ``language,changed`` - the program's language changed + + +Layout text parts +================= + +- ``default`` - Label of the fileselector_button + + +Layout content parts +==================== + +- ``icon`` - Icon of the fileselector_button + + +Fileselector Interface +====================== + +This widget supports the fileselector interface. + +If you wish to control the fileselector part using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.fileselector.Fileselector` class +using multiple inheritance, for example:: + + class CustomFileselectorButton(Fileselector, FileselectorButton): + def __init__(self, canvas, *args, **kwargs): + FileselectorButton.__init__(self, canvas) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.FileselectorButton + :parts: 2 + + +.. autoclass:: efl.elementary.FileselectorButton diff --git a/doc/elementary/fileselector_entry.rst b/doc/elementary/fileselector_entry.rst index 8479474..14344b1 100644 --- a/doc/elementary/fileselector_entry.rst +++ b/doc/elementary/fileselector_entry.rst @@ -1,2 +1,88 @@ +Fileselector Entry +################## -.. automodule:: efl.elementary.fileselector_entry +.. image:: /images/fileselector-entry-preview.png + + +Widget description +================== + +This is an entry made to be filled with or display a file +system path string. + +Besides the entry itself, the widget has a +:py:class:`~efl.elementary.fileselector_button.FileselectorButton` on its side, +which will raise an internal +:py:class:`~efl.elementary.fileselector.Fileselector`, when clicked, for path +selection aided by file system navigation. + +This file selector may appear in an Elementary window or in an +inner window. When a file is chosen from it, the (inner) window +is closed and the selected file's path string is exposed both as +a smart event and as the new text on the entry. + +This widget encapsulates operations on its internal file +selector on its own API. There is less control over its file +selector than that one would have instantiating one directly. + + +Emitted signals +=============== + +- ``changed`` - The text within the entry was changed +- ``activated`` - The entry has had editing finished and + changes are to be "committed" +- ``press`` - The entry has been clicked +- ``longpressed`` - The entry has been clicked (and held) for a + couple seconds +- ``clicked`` - The entry has been clicked +- ``clicked,double`` - The entry has been double clicked +- ``focused`` - The entry has received focus +- ``unfocused`` - The entry has lost focus +- ``selection,paste`` - A paste action has occurred on the + entry +- ``selection,copy`` - A copy action has occurred on the entry +- ``selection,cut`` - A cut action has occurred on the entry +- ``unpressed`` - The file selector entry's button was released + after being pressed. +- ``file,chosen`` - The user has selected a path via the file + selector entry's internal file selector, whose string + comes as the ``event_info`` data. +- ``language,changed`` - the program's language changed + + +Layout text parts +================= + +- ``default`` - Label of the fileselector_button + + +Layout content parts +==================== + +- ``button icon`` - Button icon of the fileselector_entry + + +Fileselector Interface +====================== + +This widget supports the fileselector interface. + +If you wish to control the fileselector part using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.fileselector.Fileselector` class +using multiple inheritance, for example:: + + class CustomFileselectorButton(Fileselector, FileselectorButton): + def __init__(self, canvas, *args, **kwargs): + FileselectorButton.__init__(self, canvas) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.FileselectorEntry + :parts: 2 + + +.. autoclass:: efl.elementary.FileselectorEntry diff --git a/doc/elementary/flip.rst b/doc/elementary/flip.rst index 0644602..08c87a4 100644 --- a/doc/elementary/flip.rst +++ b/doc/elementary/flip.rst @@ -1,2 +1,162 @@ +Flip +#### -.. automodule:: efl.elementary.flip +.. image:: /images/flip-preview.png + + +Widget description +================== + +This widget holds two content :py:class:`efl.evas.Object`: one on +the front and one on the back. It allows you to flip from front to back +and vice-versa using various animations. + +If either the front or back contents are not set the flip will treat that +as transparent. So if you were to set the front content but not the back, +and then call :py:meth:`Flip.go` you would see whatever is below the flip. + +For a list of supported animations see :py:meth:`Flip.go`. + + +Emitted signals +=============== + +- ``animate,begin`` - when a flip animation was started +- ``animate,done`` - when a flip animation is finished + + +Layout content parts +==================== + +- ``front`` - A front content of the flip +- ``back`` - A back content of the flip + + +Enumerations +============ + +.. _Elm_Flip_Direction: + +Flip directions +--------------- + +.. data:: ELM_FLIP_DIRECTION_UP + + Allows interaction with the top of the widget. + +.. data:: ELM_FLIP_DIRECTION_DOWN + + Allows interaction with the bottom of the widget. + +.. data:: ELM_FLIP_DIRECTION_LEFT + + Allows interaction with the left portion of + + the widget. +.. data:: ELM_FLIP_DIRECTION_RIGHT + + Allows interaction with the right portion of + + the widget. + + +.. _Elm_Flip_Interaction: + +Flip interaction modes +---------------------- + +.. data:: ELM_FLIP_INTERACTION_NONE + + No interaction is allowed + +.. data:: ELM_FLIP_INTERACTION_ROTATE + + Interaction will cause rotate animation + +.. data:: ELM_FLIP_INTERACTION_CUBE + + Interaction will cause cube animation + +.. data:: ELM_FLIP_INTERACTION_PAGE + + Interaction will cause page animation + + +.. _Elm_Flip_Mode: + +Flip types +---------- + +.. data:: ELM_FLIP_ROTATE_Y_CENTER_AXIS + + Rotate the currently visible content around a vertical axis in the + middle of its width, the other content is shown as the other side of the + flip. + +.. data:: ELM_FLIP_ROTATE_X_CENTER_AXIS + + Rotate the currently visible content around a horizontal axis in the + middle of its height, the other content is shown as the other side of + the flip. + +.. data:: ELM_FLIP_ROTATE_XZ_CENTER_AXIS + + Rotate the currently visible content around a diagonal axis in the + middle of its width, the other content is shown as the other side of the + flip. + +.. data:: ELM_FLIP_ROTATE_YZ_CENTER_AXIS + + Rotate the currently visible content around a diagonal axis in the + middle of its height, the other content is shown as the other side of + the flip. + +.. data:: ELM_FLIP_CUBE_LEFT + + Rotate the currently visible content to the left as if the flip was a + cube, the other content is show as the right face of the cube. + +.. data:: ELM_FLIP_CUBE_RIGHT + + Rotate the currently visible content to the right as if the flip was a + cube, the other content is show as the left face of the cube. + +.. data:: ELM_FLIP_CUBE_UP + + Rotate the currently visible content up as if the flip was a cube, the + other content is show as the bottom face of the cube. + +.. data:: ELM_FLIP_CUBE_DOWN + + Rotate the currently visible content down as if the flip was a cube, the + other content is show as the upper face of the cube. + +.. data:: ELM_FLIP_PAGE_LEFT + + Move the currently visible content to the left as if the flip was a + book, the other content is shown as the page below that. + +.. data:: ELM_FLIP_PAGE_RIGHT + + Move the currently visible content to the right as if the flip was a + book, the other content is shown as the page below that. + +.. data:: ELM_FLIP_PAGE_UP + + Move the currently visible content up as if the flip was a book, the + other content is shown as the page below that. + +.. data:: ELM_FLIP_PAGE_DOWN + + Move the currently visible content down as if the flip was a book, the + other content is shown as the page below that. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Flip + :parts: 2 + + +.. autoclass:: efl.elementary.Flip diff --git a/doc/elementary/flipselector.rst b/doc/elementary/flipselector.rst index 0bf5cf1..1288595 100644 --- a/doc/elementary/flipselector.rst +++ b/doc/elementary/flipselector.rst @@ -1,2 +1,48 @@ +Flipselector +############ -.. automodule:: efl.elementary.flipselector +.. image:: /images/flipselector-preview.png + + +Widget description +================== + +A flip selector is a widget to show a set of *text* items, one at a time, with +the same sheet switching style as the :py:class:`~efl.elementary.clock.Clock` +widget, when one changes the current displaying sheet (thus, the "flip" in the +name). + +User clicks to flip sheets which are *held* for some time will +make the flip selector to flip continuously and automatically for +the user. The interval between flips will keep growing in time, +so that it helps the user to reach an item which is distant from +the current selection. + + +Emitted signals +=============== + +- ``selected`` - when the widget's selected text item is changed +- ``overflowed`` - when the widget's current selection is changed + from the first item in its list to the last +- ``underflowed`` - when the widget's current selection is changed + from the last item in its list to the first +- ``focused`` - When the flipselector has received focus. (since 1.8) +- ``unfocused`` - When the flipselector has lost focus. (since 1.8) + + +Layout text parts +================= + +- ``default`` - label of the flipselector item + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Flipselector + :parts: 2 + + +.. autoclass:: efl.elementary.FlipSelector +.. autoclass:: efl.elementary.FlipSelectorItem diff --git a/doc/elementary/frame.rst b/doc/elementary/frame.rst index c87a2d2..72ae8e2 100644 --- a/doc/elementary/frame.rst +++ b/doc/elementary/frame.rst @@ -1,2 +1,52 @@ +Frame +##### -.. automodule:: efl.elementary.frame +.. image:: /images/frame-preview.png + + +Widget description +================== + +Frame is a widget that holds some content and has a title. + + +Available styles +================ + +- default +- pad_small +- pad_medium +- pad_large +- pad_huge +- outdent_top +- outdent_bottom + +Out of all these styles only default shows the title. + + +Emitted signals +=============== + +- ``clicked`` - The user has clicked the frame's label + + +Layout content parts +==================== + +- ``default`` - A content of the frame + + +Layout text parts +================= + +- ``default`` - Label of the frame + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Frame + :parts: 2 + + +.. autoclass:: efl.elementary.Frame diff --git a/doc/elementary/general.rst b/doc/elementary/general.rst deleted file mode 100644 index 949970f..0000000 --- a/doc/elementary/general.rst +++ /dev/null @@ -1,2 +0,0 @@ - -.. automodule:: efl.elementary.general diff --git a/doc/elementary/gengrid.rst b/doc/elementary/gengrid.rst index d2e5c2e..b14bdce 100644 --- a/doc/elementary/gengrid.rst +++ b/doc/elementary/gengrid.rst @@ -1,2 +1,324 @@ +Gengrid +####### -.. automodule:: efl.elementary.gengrid +.. image:: /images/gengrid-preview.png + + +Widget description +================== + +This widget aims to position objects in a grid layout while actually +creating and rendering only the visible ones, using the same idea as the +:py:class:`~efl.elementary.genlist.Genlist`: the user defines a **class** for +each item, specifying functions that will be called at object creation, +deletion, etc. When those items are selected by the user, a callback +function is issued. Users may interact with a gengrid via the mouse (by +clicking on items to select them and clicking on the grid's viewport and +swiping to pan the whole view) or via the keyboard, navigating through +item with the arrow keys. + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scolling behaviour using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.scroller.Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Gengrid layouts +=============== + +Gengrid may layout its items in one of two possible layouts: + +- horizontal or +- vertical. + +When in "horizontal mode", items will be placed in **columns**, from top +to bottom and, when the space for a column is filled, another one is +started on the right, thus expanding the grid horizontally, making for +horizontal scrolling. When in "vertical mode" , though, items will be +placed in **rows**, from left to right and, when the space for a row is +filled, another one is started below, thus expanding the grid vertically +(and making for vertical scrolling). + + +Gengrid items +============= + +An item in a gengrid can have 0 or more texts (they can be regular text +or textblock Evas objects - that's up to the style to determine), 0 or +more contents (which are simply objects swallowed into the gengrid +item's theming Edje object) and 0 or more **boolean states**, which +have the behavior left to the user to define. The Edje part names for +each of these properties will be looked up, in the theme file for the +gengrid, under the Edje (string) data items named ``"texts"``, +``"contents"`` and ``"states"``, respectively. For each of those +properties, if more than one part is provided, they must have names +listed separated by spaces in the data fields. For the default gengrid +item theme, we have **one** text part (``"elm.text"``), **two** content +parts (``"elm.swalllow.icon"`` and ``"elm.swallow.end"``) and **no** +state parts. + +A gengrid item may be at one of several styles. Elementary provides one +by default - "default", but this can be extended by system or +application custom themes/overlays/extensions (see +:py:class:`~efl.elementary.theme.Theme` for more details). + + +Gengrid item classes +==================== + +In order to have the ability to add and delete items on the fly, gengrid +implements a class (callback) system where the application provides a +structure with information about that type of item (gengrid may contain +multiple different items with different classes, states and styles). +Gengrid will call the functions in this struct (methods) when an item is +"realized" (i.e., created dynamically, while the user is scrolling the +grid). All objects will simply be deleted when no longer needed with +:meth:`~efl.eo.Eo.delete`. The :class:`GengridItemClass` class contains the +following attributes and methods: + +- ``item_style`` - This is a constant string and simply defines the name + of the item style. It **must** be specified and the default should be + ``default``. +- ``func.text_get`` - This function is called when an item object is + actually created. The ``data`` parameter will point to the same data + passed to :meth:`~Gengrid.item_append` and related item creation + functions. The ``obj`` parameter is the gengrid object itself, while + the ``part`` one is the name string of one of the existing text parts + in the Edje group implementing the item's theme. + See :py:meth:`GengridItemClass.text_get`. +- ``func.content_get`` - This function is called when an item object is + actually created. The ``data`` parameter will point to the same data + passed to :py:meth:`GengridItem.append_to` and related item creation + functions. The ``obj`` parameter is the gengrid object itself, while + the ``part`` one is the name string of one of the existing (content) + swallow parts in the Edje group implementing the item's theme. It must + return ``None,`` when no content is desired, or a valid object handle, + otherwise. The object will be deleted by the gengrid on its deletion + or when the item is "unrealized". See :py:meth:`GengridItemClass.content_get`. +- ``func.state_get`` - This function is called when an item object is + actually created. The ``data`` parameter will point to the same data + passed to :py:meth:`GengridItem.append_to` and related item creation + functions. The ``obj`` parameter is the gengrid object itself, while + the ``part`` one is the name string of one of the state parts in the + Edje group implementing the item's theme. Return ``False`` for + false/off or ``True`` for true/on. Gengrids will emit a signal to + its theming Edje object with ``"elm,state,xxx,active"`` and ``"elm"`` + as "emission" and "source" arguments, respectively, when the state is + true (the default is false), where ``xxx`` is the name of the (state) + part. See :py:meth:`GengridItemClass.state_get`. +- ``func.del`` - This is called when + :meth:`efl.elementary.object_item.ObjectItem.delete` is called on + an item or :meth:`~Gengrid.clear` is called on the gengrid. This is + intended for use when gengrid items are deleted, so any data attached + to the item (e.g. its data parameter on creation) can be deleted. See + :py:meth:`GengridItemClass.delete`. + + +Usage hints +=========== + +If the user wants to have multiple items selected at the same time, +:attr:`~Gengrid.multi_select` will permit it. If the gengrid is +single-selection only (the default), then :attr:`~Gengrid.selected_item` +will return the selected item or ``None``, if none is selected. If the +gengrid is under multi-selection, then :attr:`~Gengrid.selected_items` +will return a list (that is only valid as long as no items are modified +(added, deleted, selected or unselected) of child items on a gengrid. + +If an item changes (internal (boolean) state, text or content changes), +then use :meth:`~GengridItem.update` to have gengrid update the item with +the new state. A gengrid will re-"realize" the item, thus calling the +functions in the :class:`GengridItemClass` set for that item. + +To programmatically (un)select an item or get the selected state, use +:attr:`GengridItem.selected`. To make an item disabled (unable to be +selected and appear differently) or get the disabled state +use :attr:`GengridItem.disabled`. + +Grid cells will only have their selection smart callbacks called when +firstly getting selected. Any further clicks will do nothing, unless you +enable the "always select mode", with :attr:`~Gengrid.select_mode` as +:attr:`ELM_OBJECT_SELECT_MODE_ALWAYS`, thus making every click to issue +selection callbacks. :attr:`~Gengrid.select_mode` as +:attr:`ELM_OBJECT_SELECT_MODE_NONE` will turn off the ability to select items +entirely in the widget and they will neither appear selected nor call +the selection smart callbacks. + +Remember that you can create new styles and add your own theme +augmentation per application with +:meth:`Theme.extension_add`. If you +absolutely must have a specific style that overrides any theme the user +or system sets up you can use +:meth:`Theme.extension_add` to add such +a file. + + +Emitted signals +=============== + +- ``activated`` - The user has double-clicked or pressed + (enter|return|spacebar) on an item. The ``event_info`` parameter + is the gengrid item that was activated. +- ``clicked,double`` - The user has double-clicked an item. + The ``event_info`` parameter is the gengrid item that was double-clicked. +- ``clicked,right`` - The user has right-clicked an item. The + ``event_info`` parameter is the item that was right-clicked. (since: 1.13) +- ``longpressed`` - This is called when the item is pressed for a certain + amount of time. By default it's 1 second. +- ``selected`` - The user has made an item selected. The + ``event_info`` parameter is the gengrid item that was selected. +- ``unselected`` - The user has made an item unselected. The + ``event_info`` parameter is the gengrid item that was unselected. +- ``realized`` - This is called when the item in the gengrid + has its implementing Evas object instantiated, de facto. + ``event_info`` is the gengrid item that was created. +- ``unrealized`` - This is called when the implementing Evas + object for this item is deleted. ``event_info`` is the gengrid + item that was deleted. +- ``changed`` - Called when an item is added, removed, resized + or moved and when the gengrid is resized or gets "horizontal" + property changes. +- ``scroll,anim,start`` - This is called when scrolling animation has + started. +- ``scroll,anim,stop`` - This is called when scrolling animation has + stopped. +- ``drag,start,up`` - Called when the item in the gengrid has + been dragged (not scrolled) up. +- ``drag,start,down`` - Called when the item in the gengrid has + been dragged (not scrolled) down. +- ``drag,start,left`` - Called when the item in the gengrid has + been dragged (not scrolled) left. +- ``drag,start,right`` - Called when the item in the gengrid has + been dragged (not scrolled) right. +- ``drag,stop`` - Called when the item in the gengrid has + stopped being dragged. +- ``drag`` - Called when the item in the gengrid is being + dragged. +- ``scroll`` - called when the content has been scrolled + (moved). +- ``scroll,drag,start`` - called when dragging the content has + started. +- ``scroll,drag,stop`` - called when dragging the content has + stopped. +- ``edge,top`` - This is called when the gengrid is scrolled until + the top edge. +- ``edge,bottom`` - This is called when the gengrid is scrolled + until the bottom edge. +- ``edge,left`` - This is called when the gengrid is scrolled + until the left edge. +- ``edge,right`` - This is called when the gengrid is scrolled + until the right edge. +- ``moved`` - This is called when a gengrid item is moved by a user + interaction in a reorder mode. The ``event_info`` parameter is the item that + was moved. +- ``index,update`` - This is called when a gengrid item index is changed. + Note that this callback is called while each item is being realized. +- ``highlighted`` - an item in the list is highlighted. This is called when + the user presses an item or keyboard selection is done so the item is + physically highlighted. The ``event_info`` parameter is the item that was + highlighted. +- ``unhighlighted`` - an item in the list is unhighlighted. This is called + when the user releases an item or keyboard selection is moved so the item + is physically unhighlighted. The ``event_info`` parameter is the item that + was unhighlighted. +- ``language,changed`` - This is called when the program's language is + changed. Call :meth:`~Gengrid.realized_items_update` if items text should + be translated. +- ``focused`` - When the gengrid has received focus. (since 1.8) +- ``unfocused`` - When the gengrid has lost focus. (since 1.8) +- ``item,focused`` - When the gengrid item has received focus. (since 1.10) +- ``item,unfocused`` - When the gengrid item has lost focus. (since 1.10) +- ``item,reorder,anim,start`` - This is called when a gengrid item movement + has just started by keys in reorder mode. The parameter is the item that + is going to move. (since 1.10) +- ``item,reorder,anim,stop`` - This is called when a gengrid item movement just + stopped in reorder mode. The parameter is the item that was moved. (since 1.10) + + +Enumerations +============ + +.. _Elm_Gengrid_Item_Scrollto_Type: + +Items' scroll to types +---------------------- + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_NONE + + No scroll to + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_IN + + Scroll to the nearest viewport + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_TOP + + Scroll to the top of viewport + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_MIDDLE + + Scroll to the middle of viewport + + +.. _Elm_Gengrid_Object_Multi_Select_Mode: + +Multi-select mode +----------------- + +.. data:: ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT + + Default multiple select mode + + .. versionadded:: 1.10 + +.. data:: ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL + + Disallow mutiple selection when clicked without control key pressed + + .. versionadded:: 1.10 + +.. data:: ELM_OBJECT_MULTI_SELECT_MODE_MAX + + Value unknown + + .. versionadded:: 1.10 + + +.. _Elm_Gengrid_Reorder_Type: + +Reorder type +------------ + +.. data:: ELM_GENGRID_REORDER_TYPE_NORMAL + + Normal reorder mode + + .. versionadded:: 1.11 + +.. data:: ELM_GENGRID_REORDER_TYPE_SWAP + + Swap reorder mode + + .. versionadded:: 1.11 + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Gengrid + :parts: 2 + + +.. autoclass:: efl.elementary.Gengrid +.. autoclass:: efl.elementary.GengridItem +.. autoclass:: efl.elementary.GengridItemClass diff --git a/doc/elementary/genlist.rst b/doc/elementary/genlist.rst index a2a583c..1034009 100644 --- a/doc/elementary/genlist.rst +++ b/doc/elementary/genlist.rst @@ -1,2 +1,512 @@ +Genlist +####### -.. automodule:: efl.elementary.genlist +.. image:: /images/genlist-preview.png + + +Widget description +================== + +This widget aims to have more expansive list than the simple list in +Elementary that could have more flexible items and allow many more +entries while still being fast and low on memory usage. At the same time +it was also made to be able to do tree structures. But the price to pay +is more complexity when it comes to usage. If all you want is a simple +list with icons and a single text, use the normal +:py:class:`~efl.elementary.list.List` object. + +Genlist has a fairly large API, mostly because it's relatively complex, +trying to be both expansive, powerful and efficient. First we will begin +an overview on the theory behind genlist. + + +Genlist item classes - creating items +===================================== + +In order to have the ability to add and delete items on the fly, genlist +implements a class (callback) system where the application provides a +structure with information about that type of item (genlist may contain +multiple different items with different classes, states and styles). +Genlist will call the functions in this struct (methods) when an item is +"realized" (i.e., created dynamically, while the user is scrolling the +grid). All objects will simply be deleted when no longer needed with +:py:meth:`~efl.evas.Object.delete`. :py:class:`GenlistItemClass` contains the +following members: + +- ``item_style`` - This is a constant string and simply defines the name + of the item style. It **must** be specified and the default should be + ``"default".`` +- ``decorate_item_style`` - This is a constant string and simply defines + the name of the decorate mode item style. It is used to specify + decorate mode item style. It can be used when you call + :py:attr:`GenlistItem.decorate_mode`. +- ``decorate_all_item_style`` - This is a constant string and simply + defines the name of the decorate all item style. It is used to specify + decorate all item style. It can be used to set selection, checking and + deletion mode. This is used when you call + :py:attr:`Genlist.decorate_mode`. +- ``func`` - A struct with pointers to functions that will be called when + an item is going to be actually created. All of them receive a ``data`` + parameter that will point to the same data passed to + :py:meth:`GenlistItem.append_to` and related item creation functions, and an + ``obj`` parameter that points to the genlist object itself. + +The function pointers inside ``func`` are ``text_get``, ``content_get``, +``state_get`` and ``del``. The 3 first functions also receive a ``part`` +parameter described below. A brief description of these functions follows: + +- ``text_get`` - The ``part`` parameter is the name string of one of the + existing text parts in the Edje group implementing the item's theme. + See :py:meth:`GenlistItemClass.text_get`. +- ``content_get`` - The ``part`` parameter is the name string of one of the + existing (content) swallow parts in the Edje group implementing the + item's theme. It must return ``None``, when no content is desired, or + a valid object handle, otherwise. The object will be deleted by the + genlist on its deletion or when the item is "unrealized". See + :py:meth:`GenlistItemClass.content_get`. +- ``func.state_get`` - The ``part`` parameter is the name string of one of + the state parts in the Edje group implementing the item's theme. Return + ``False`` for false/off or ``True`` for true/on. Genlists will + emit a signal to its theming Edje object with ``"elm,state,xxx,active"`` + and ``"elm"`` as "emission" and "source" arguments, respectively, when + the state is true (the default is false), where ``xxx`` is the name of + the (state) part. See :py:meth:`GenlistItemClass.state_get`. +- ``func.del`` - This is intended for use when genlist items are deleted, + so any data attached to the item (e.g. its data parameter on creation) + can be deleted. See :py:meth:`GenlistItemClass.delete`. + + +Available item styles +===================== + +- ``default`` +- ``default_style`` The text part is a textblock +- ``double_label`` Two different text parts +- ``icon_top_text_bottom`` +- ``group_index`` +- ``one_icon`` Only 1 icon (left) (since: 1.1) +- ``end_icon`` Only 1 icon (at end/right) (since: 1.1) +- ``no_icon`` No icon (since: 1.1) +- ``full`` Only one object, elm.swallow.content, which consumes whole area of + the genlist item (since: 1.7) + + +Structure of items +================== + +An item in a genlist can have 0 or more texts (they can be regular text +or textblock Evas objects - that's up to the style to determine), 0 or +more contents (which are simply objects swallowed into the genlist item's +theming Edje object) and 0 or more **boolean states**, which have the +behavior left to the user to define. The Edje part names for each of +these properties will be looked up, in the theme file for the genlist, +under the Edje (string) data items named ``labels``, ``contents`` +and ``states``, respectively. For each of those properties, if more +than one part is provided, they must have names listed separated by +spaces in the data fields. For the default genlist item theme, we have +**one** text part (``elm.text``), **two** content parts +(``elm.swallow.icon`` and ``elm.swallow.end``) and **no** state parts. + +A genlist item may be at one of several styles. Elementary provides one +by default - "default", but this can be extended by system or application +custom themes/overlays/extensions (see :py:mod:`themes`) +for more details). + + +Editing and Navigating +====================== + +Items can be added by several calls. All of them return a +:py:class:`GenlistItem` handle that is an internal member inside the genlist. +They all take a data parameter that is meant to be used for a handle to the +applications internal data (eg. the struct with the original item data). The +parent parameter is the parent genlist item this belongs to if it is a tree or +an indexed group, and None if there is no parent. The flags can be a bitmask of +:attr:`ELM_GENLIST_ITEM_NONE`, :attr:`ELM_GENLIST_ITEM_TREE` and +:attr:`ELM_GENLIST_ITEM_GROUP`. If :attr:`ELM_GENLIST_ITEM_TREE` is set then +this item is displayed as an item that is able to expand and have child items. +If :attr:`ELM_GENLIST_ITEM_GROUP` is set then this item is group index item +that is displayed at the top until the next group comes. The func parameter is +a convenience callback that is called when the item is selected and the data +parameter will be the func_data parameter, ``obj`` be the genlist object and +event_info will be the genlist item. + +:py:meth:`GenlistItem.append_to` adds an item to the end of the list, or if +there is a parent, to the end of all the child items of the parent. +:py:meth:`GenlistItem.prepend_to` is the same but adds to the beginning of +the list or children list. :py:meth:`GenlistItem.insert_before` inserts at +item before another item and :py:meth:`GenlistItem.insert_after` inserts after +the indicated item. + +The application can clear the list with :py:meth:`Genlist.clear` which deletes +all the items in the list and +:py:meth:`~efl.elementary.object_item.ObjectItem.delete` will delete a specific +item. :py:meth:`GenlistItem.subitems_clear` will clear all items that are +children of the indicated parent item. + +To help inspect list items you can jump to the item at the top of the list +with :py:attr:`Genlist.first_item` which will return the item pointer, and +similarly :py:attr:`Genlist.last_item` gets the item at the end of the list. +:py:attr:`GenlistItem.next` and :py:attr:`GenlistItem.prev` get the next +and previous items respectively relative to the indicated item. Using +these calls you can walk the entire item list/tree. Note that as a tree +the items are flattened in the list, so :py:attr:`GenlistItem.parent` will +let you know which item is the parent (and thus know how to skip them if +wanted). + + +Multi-selection +=============== + +If the application wants multiple items to be able to be selected, +:py:attr:`Genlist.multi_select` can enable this. If the list is +single-selection only (the default), then :py:attr:`Genlist.selected_item` +will return the selected item, if any, or None if none is selected. If the +list is multi-select then :py:attr:`Genlist.selected_items` will return a +list (that is only valid as long as no items are modified (added, deleted, +selected or unselected)). + + +Usage hints +=========== + +There are also convenience functions. +:py:attr:`efl.elementary.object_item.ObjectItem.widget` will return the genlist +object the item belongs to. :py:meth:`GenlistItem.show` will make the scroller +scroll to show that specific item so its visible. +:py:attr:`efl.elementary.object_item.ObjectItem.data` returns the data pointer +set by the item creation functions. + +If an item changes (state of boolean changes, text or contents change), +then use :py:meth:`GenlistItem.update` to have genlist update the item with +the new state. Genlist will re-realize the item and thus call the functions +in the _Elm_Genlist_Item_Class for that item. + +Use :py:attr:`GenlistItem.selected` to programmatically (un)select an item or +get its selected state. Similarly to expand/contract an item and get its +expanded state, use :py:attr:`GenlistItem.expanded`. And again to make an item +disabled (unable to be selected and appear differently) use +:py:attr:`GenlistItem.disabled` to set this and get the disabled state. + +In general to indicate how the genlist should expand items horizontally to +fill the list area, use :py:attr:`Genlist.mode`. Valid modes are +ELM_LIST_LIMIT, ELM_LIST_COMPRESS and ELM_LIST_SCROLL. The default is +ELM_LIST_SCROLL. This mode means that if items are too wide to fit, the +scroller will scroll horizontally. Otherwise items are expanded to +fill the width of the viewport of the scroller. If it is +ELM_LIST_LIMIT, items will be expanded to the viewport width +if larger than the item, but genlist widget with is +limited to the largest item. D not use ELM_LIST_LIMIT mode with homogeneous +mode turned on. ELM_LIST_COMPRESS can be combined with a different style +that uses Edje's ellipsis feature (cutting text off like this: "tex..."). + +Items will only call their selection func and callback when first becoming +selected. Any further clicks will do nothing, unless you enable always +select with :py:attr:`Genlist.select_mode` as ELM_OBJECT_SELECT_MODE_ALWAYS. +This means even if selected, every click will make the selected callbacks +be called. :py:attr:`Genlist.select_mode` as ELM_OBJECT_SELECT_MODE_NONE will +turn off the ability to select items entirely and they will neither +appear selected nor call selected callback functions. + +Remember that you can create new styles and add your own theme augmentation per +application with :py:meth:`efl.elementary.theme.Theme.extension_add`. If you +absolutely must have a specific style that overrides any theme the user or +system sets up you can use :py:meth:`efl.elementary.theme.Theme.overlay_add` to +add such a file. + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scrolling behaviour using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.scroller.Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Implementation +============== + +Evas tracks every object you create. Every time it processes an event +(mouse move, down, up etc.) it needs to walk through objects and find out +what event that affects. Even worse every time it renders display updates, +in order to just calculate what to re-draw, it needs to walk through many +many many objects. Thus, the more objects you keep active, the more +overhead Evas has in just doing its work. It is advisable to keep your +active objects to the minimum working set you need. Also remember that +object creation and deletion carries an overhead, so there is a +middle-ground, which is not easily determined. But don't keep massive lists +of objects you can't see or use. Genlist does this with list objects. It +creates and destroys them dynamically as you scroll around. It groups them +into blocks so it can determine the visibility etc. of a whole block at +once as opposed to having to walk the whole list. This 2-level list allows +for very large numbers of items to be in the list (tests have used up to +2,000,000 items). Also genlist employs a queue for adding items. As items +may be different sizes, every item added needs to be calculated as to its +size and thus this presents a lot of overhead on populating the list, this +genlist employs a queue. Any item added is queued and spooled off over +time, actually appearing some time later, so if your list has many members +you may find it takes a while for them to all appear, with your process +consuming a lot of CPU while it is busy spooling. + +Genlist also implements a tree structure, but it does so with callbacks to +the application, with the application filling in tree structures when +requested (allowing for efficient building of a very deep tree that could +even be used for file-management). See the above smart signal callbacks for +details. + + +Emitted signals +=============== + +- ``activated`` - The user has double-clicked or pressed + (enter|return|spacebar) on an item. The ``event_info`` parameter is the + item that was activated. +- ``clicked,double`` - The user has double-clicked an item. The + ``event_info`` parameter is the item that was double-clicked. +- ``clicked,right`` - The user has right-clicked an item. The + ``event_info`` parameter is the item that was right-clicked. (since: 1.13) +- ``selected`` - This is called when a user has made an item selected. + The event_info parameter is the genlist item that was selected. +- ``unselected`` - This is called when a user has made an item + unselected. The event_info parameter is the genlist item that was + unselected. +- ``expanded`` - This is called when :py:attr:`GenlistItem.expanded` is + called and the item is now meant to be expanded. The event_info + parameter is the genlist item that was indicated to expand. It is the + job of this callback to then fill in the child items. +- ``contracted`` - This is called when :py:attr:`GenlistItem.expanded` is + called and the item is now meant to be contracted. The event_info + parameter is the genlist item that was indicated to contract. It is the + job of this callback to then delete the child items. +- ``expand,request`` - This is called when a user has indicated they want + to expand a tree branch item. The callback should decide if the item can + expand (has any children) and then call :py:attr:`GenlistItem.expanded` + appropriately to set the state. The event_info parameter is the genlist + item that was indicated to expand. +- ``contract,request`` - This is called when a user has indicated they + want to contract a tree branch item. The callback should decide if the + item can contract (has any children) and then call + :py:attr:`GenlistItem.expanded` appropriately to set the state. The + event_info parameter is the genlist item that was indicated to contract. +- ``realized`` - This is called when the item in the list is created as a + real evas object. event_info parameter is the genlist item that was + created. +- ``unrealized`` - This is called just before an item is unrealized. + After this call content objects provided will be deleted and the item + object itself delete or be put into a floating cache. +- ``drag,start,up`` - This is called when the item in the list has been + dragged (not scrolled) up. +- ``drag,start,down`` - This is called when the item in the list has been + dragged (not scrolled) down. +- ``drag,start,left`` - This is called when the item in the list has been + dragged (not scrolled) left. +- ``drag,start,right`` - This is called when the item in the list has + been dragged (not scrolled) right. +- ``drag,stop`` - This is called when the item in the list has stopped + being dragged. +- ``drag`` - This is called when the item in the list is being dragged. +- ``longpressed`` - This is called when the item is pressed for a certain + amount of time. By default it's 1 second. The event_info parameter is the + longpressed genlist item. +- ``scroll,anim,start`` - This is called when scrolling animation has + started. +- ``scroll,anim,stop`` - This is called when scrolling animation has + stopped. +- ``scroll,drag,start`` - This is called when dragging the content has + started. +- ``scroll,drag,stop`` - This is called when dragging the content has + stopped. +- ``edge,top`` - This is called when the genlist is scrolled until + the top edge. +- ``edge,bottom`` - This is called when the genlist is scrolled + until the bottom edge. +- ``edge,left`` - This is called when the genlist is scrolled + until the left edge. +- ``edge,right`` - This is called when the genlist is scrolled + until the right edge. +- ``multi,swipe,left`` - This is called when the genlist is multi-touch + swiped left. +- ``multi,swipe,right`` - This is called when the genlist is multi-touch + swiped right. +- ``multi,swipe,up`` - This is called when the genlist is multi-touch + swiped up. +- ``multi,swipe,down`` - This is called when the genlist is multi-touch + swiped down. +- ``multi,pinch,out`` - This is called when the genlist is multi-touch + pinched out. +- ``multi,pinch,in`` - This is called when the genlist is multi-touch + pinched in. +- ``swipe`` - This is called when the genlist is swiped. +- ``moved`` - This is called when a genlist item is moved in reorder mode. +- ``moved,after`` - This is called when a genlist item is moved after + another item in reorder mode. The event_info parameter is the reordered + item. To get the relative previous item, use :py:attr:`GenlistItem.prev`. + This signal is called along with "moved" signal. +- ``moved,before`` - This is called when a genlist item is moved before + another item in reorder mode. The event_info parameter is the reordered + item. To get the relative previous item, use :py:attr:`GenlistItem.next`. + This signal is called along with "moved" signal. +- ``language,changed`` - This is called when the program's language is + changed. +- ``tree,effect,finished`` - This is called when a genlist tree effect + is finished. +- ``highlighted`` - an item in the list is highlighted. This is called when + the user presses an item or keyboard selection is done so the item is + physically highlighted. The ``event_info`` parameter is the item that was + highlighted. +- ``unhighlighted`` - an item in the list is unhighlighted. This is called + when the user releases an item or keyboard selection is moved so the item + is physically unhighlighted. The ``event_info`` parameter is the item that + was unhighlighted. +- ``focused`` - When the genlist has received focus. (since 1.8) +- ``unfocused`` - When the genlist has lost focus. (since 1.8) +- ``item,focused`` - When the genlist item has received focus. (since 1.10) +- ``item,unfocused`` - When the genlist item has lost focus. (since 1.10) + + +Enumerations +============ + +.. _Elm_Genlist_Item_Type: + +Genlist item types +------------------ + +.. data:: ELM_GENLIST_ITEM_NONE + + Simple item + +.. data:: ELM_GENLIST_ITEM_TREE + + The item may be expanded and have child items + +.. data:: ELM_GENLIST_ITEM_GROUP + + An index item of a group of items + + +.. _Elm_Genlist_Item_Field_Type: + +Genlist items' field types +-------------------------- + +.. data:: ELM_GENLIST_ITEM_FIELD_ALL + + Match all fields + +.. data:: ELM_GENLIST_ITEM_FIELD_TEXT + + Match text fields + +.. data:: ELM_GENLIST_ITEM_FIELD_CONTENT + + Match content fields + +.. data:: ELM_GENLIST_ITEM_FIELD_STATE + + Match state fields + + +.. _Elm_Genlist_Item_Scrollto_Type: + +Genlist items' scroll-to types +------------------------------ + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_NONE + + No scroll to + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_IN + + Scroll to the nearest viewport + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_TOP + + Scroll to the top of viewport + +.. data:: ELM_GENLIST_ITEM_SCROLLTO_MIDDLE + + Scroll to the middle of viewport + + +.. _Elm_Genlist_List_Mode: + +List sizing +----------- + +.. data:: ELM_LIST_COMPRESS + + The list won't set any of its size hints to inform how a possible container + should resize it. + + Then, if it's not created as a "resize object", it might end with zeroed + dimensions. The list will respect the container's geometry and, if any of + its items won't fit into its transverse axis, one won't be able to scroll it + in that direction. + +.. data:: ELM_LIST_SCROLL + + Default value. + + This is the same as ELM_LIST_COMPRESS, with the exception that if any of + its items won't fit into its transverse axis, one will be able to scroll + it in that direction. + +.. data:: ELM_LIST_LIMIT + + Sets a minimum size hint on the list object, so that containers may + respect it (and resize itself to fit the child properly). + + More specifically, a minimum size hint will be set for its transverse + axis, so that the largest item in that direction fits well. This is + naturally bound by the list object's maximum size hints, set externally. + +.. data:: ELM_LIST_EXPAND + + Besides setting a minimum size on the transverse axis, just like on + ELM_LIST_LIMIT, the list will set a minimum size on the longitudinal + axis, trying to reserve space to all its children to be visible at a time. + + This is naturally bound by the list object's maximum size hints, set + externally. + + +.. _Elm_Genlist_Object_Select_Mode: + +Selection modes +--------------- + +.. data:: ELM_OBJECT_SELECT_MODE_DEFAULT + + Default select mode + +.. data:: ELM_OBJECT_SELECT_MODE_ALWAYS + + Always select mode + +.. data:: ELM_OBJECT_SELECT_MODE_NONE + + No select mode + +.. data:: ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY + + No select mode with no finger size rule + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Genlist + :parts: 2 + + +.. autoclass:: efl.elementary.Genlist +.. autoclass:: efl.elementary.GenlistItem +.. autoclass:: efl.elementary.GenlistItemClass diff --git a/doc/elementary/gesture_layer.rst b/doc/elementary/gesture_layer.rst index 3ec4ffb..97e6568 100644 --- a/doc/elementary/gesture_layer.rst +++ b/doc/elementary/gesture_layer.rst @@ -1,2 +1,150 @@ +Gesture Layer +############# -.. automodule:: efl.elementary.gesture_layer +.. image:: /images/gesturelayer-preview.png + + +Widget description +================== + +Use the GestureLayer to detect gestures. The advantage is that you don't +have to implement gesture detection, just set callbacks for gesture states. + +In order to use Gesture Layer you start with instantiating this class +with a parent object parameter. Next 'activate' gesture layer with a +:py:meth:`~GestureLayer.attach` call. Usually with same object as target (2nd +parameter). + +Now you need to tell gesture layer what gestures you follow. This is done with +:py:meth:`~GestureLayer.cb_set` call. By setting the callback you actually +saying to gesture layer: I would like to know when the gesture +:ref:`Elm_Gesture_Type` switches to state :ref:`Elm_Gesture_State`. + +Next, you need to implement the actual action that follows the input in +your callback. + +Note that if you like to stop being reported about a gesture, just set +all callbacks referring this gesture to None. (again with +:py:meth:`~GestureLayer.cb_set`) + +The information reported by gesture layer to your callback is depending +on :ref:`Elm_Gesture_Type`: + +- :class:`GestureTapsInfo` is the info reported for tap gestures: + + - :attr:`ELM_GESTURE_N_TAPS` + - :attr:`ELM_GESTURE_N_LONG_TAPS` + - :attr:`ELM_GESTURE_N_DOUBLE_TAPS` + - :attr:`ELM_GESTURE_N_TRIPLE_TAPS` + +- :class:`GestureMomentumInfo` is info reported for momentum gestures: + + - :attr:`ELM_GESTURE_MOMENTUM` + +- :class:`GestureLineInfo` is the info reported for line gestures + (this also contains :class:`GestureMomentumInfo` internal structure): + + - :attr:`ELM_GESTURE_N_LINES` + - :attr:`ELM_GESTURE_N_FLICKS` + +Note that we consider a flick as a line-gesture that should be completed +in flick-time-limit as defined in +:py:class:`~efl.elementary.configuration.Configuration`. + +:class:`GestureZoomInfo` is the info reported for :attr:`ELM_GESTURE_ZOOM` +gesture. + +:class:`GestureRotateInfo` is the info reported for +:attr:`ELM_GESTURE_ROTATE` gesture. + +Gesture Layer Tweaks: + +Note that line, flick, gestures can start without the need to remove +fingers from surface. When user fingers rests on same-spot gesture is +ended and starts again when fingers moved. + +Setting glayer_continues_enable to false in +:py:class:`~efl.elementary.configuration.Configuration` will change this +behavior so gesture starts when user touches (a *DOWN* event) +touch-surface and ends when no fingers touches surface (a *UP* event). + + +Enumerations +============ + +.. _Elm_Gesture_State: + +Gesture states +-------------- + +.. data:: ELM_GESTURE_STATE_UNDEFINED + + Gesture not started + +.. data:: ELM_GESTURE_STATE_START + + Gesture started + +.. data:: ELM_GESTURE_STATE_MOVE + + Gesture is ongoing + +.. data:: ELM_GESTURE_STATE_END + + Gesture completed + +.. data:: ELM_GESTURE_STATE_ABORT + + Ongoing gesture was aborted + + +.. _Elm_Gesture_Type: + +Gesture types +------------- + +.. data:: ELM_GESTURE_N_TAPS + + N fingers single taps + +.. data:: ELM_GESTURE_N_LONG_TAPS + + N fingers single long-taps + +.. data:: ELM_GESTURE_N_DOUBLE_TAPS + + N fingers double-single taps + +.. data:: ELM_GESTURE_N_TRIPLE_TAPS + + N fingers triple-single taps + +.. data:: ELM_GESTURE_MOMENTUM + + Reports momentum in the direction of move + +.. data:: ELM_GESTURE_N_LINES + + N fingers line gesture + +.. data:: ELM_GESTURE_N_FLICKS + + N fingers flick gesture + +.. data:: ELM_GESTURE_ZOOM + + Zoom + +.. data:: ELM_GESTURE_ROTATE + + Rotate + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.GestureLayer + :parts: 2 + + +.. autoclass:: efl.elementary.GestureLayer diff --git a/doc/elementary/grid.rst b/doc/elementary/grid.rst index 956c3b8..fd8dfa7 100644 --- a/doc/elementary/grid.rst +++ b/doc/elementary/grid.rst @@ -1,2 +1,29 @@ +Grid +#### -.. automodule:: efl.elementary.grid +.. image:: /images/grid-preview.png + + +Widget description +================== + +A grid layout widget. + +The grid is a grid layout widget that lays out a series of children as a +fixed "grid" of widgets using a given percentage of the grid width and +height each using the child object. + +The Grid uses a "Virtual resolution" that is stretched to fill the grid +widgets size itself. The default is 100 x 100, so that means the +position and sizes of children will effectively be percentages (0 to 100) +of the width or height of the grid widget. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Grid + :parts: 2 + + +.. autoclass:: efl.elementary.Grid diff --git a/doc/elementary/hover.rst b/doc/elementary/hover.rst index 50206b0..5f8e3bf 100644 --- a/doc/elementary/hover.rst +++ b/doc/elementary/hover.rst @@ -1,2 +1,109 @@ +Hover +##### -.. automodule:: efl.elementary.hover +.. image:: /images/hover-preview.png + + +Widget description +================== + +A Hover object will hover over its ``parent`` object at the ``target`` +location. + +Anything in the background will be given a darker coloring to indicate +that the hover object is on top (at the default theme). When the hover +is clicked it is dismissed(hidden), if the contents of the hover are +clicked that **doesn't** cause the hover to be dismissed. + +A Hover object has two parents. One parent that owns it during creation +and the other parent being the one over which the hover object spans. + + +Available styles +================ + +- default +- popout +- menu +- hoversel_vertical + + +Emitted signals +=============== + +- ``clicked`` - the user clicked the empty space in the hover to + dismiss. +- ``dismissed`` - the user clicked the empty space in the hover to dismiss. + (since 1.8) +- ``smart,changed`` - a content object placed under the "smart" + policy was replaced to a new slot direction. +- ``focused`` - When the hover has received focus. (since 1.8) +- ``unfocused`` - When the hover has lost focus. (since 1.8) + + +Layout content parts +==================== + +- ``left`` +- ``top-left`` +- ``top`` +- ``top-right`` +- ``right`` +- ``bottom-right`` +- ``bottom`` +- ``bottom-left`` +- ``middle`` +- ``smart`` + +All directions may have contents at the same time, except for "smart". +This is a special placement hint and its use case depends of the +calculations coming from :py:meth:`~Hover.best_content_location_get`. Its use +is for cases when one desires only one hover content, but with a dynamic +special placement within the hover area. The content's geometry, +whenever it changes, will be used to decide on a best location, not +extrapolating the hover's parent object view to show it in (still being +the hover's target determinant of its medium part -- move and resize it +to simulate finger sizes, for example). If one of the directions other +than "smart" are used, a previously content set using it will be +deleted, and vice-versa. + +.. note:: The hover object will take up the entire space of ``target`` + object. + +.. note:: The content parts listed indicate the direction that the content + will be displayed + + +Enumerations +============ + +.. _Elm_Hover_Axis: + +Hover axis +---------- + +.. data:: ELM_HOVER_AXIS_NONE + + No preferred orientation + +.. data:: ELM_HOVER_AXIS_HORIZONTAL + + Horizontal orientation + +.. data:: ELM_HOVER_AXIS_VERTICAL + + Vertical orientation + +.. data:: ELM_HOVER_AXIS_BOTH + + Both + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Hover + :parts: 2 + + +.. autoclass:: efl.elementary.Hover diff --git a/doc/elementary/hoversel.rst b/doc/elementary/hoversel.rst index 530016a..a10123d 100644 --- a/doc/elementary/hoversel.rst +++ b/doc/elementary/hoversel.rst @@ -1,2 +1,73 @@ +Hoversel +######## -.. automodule:: efl.elementary.hoversel +.. image:: /images/hoversel-preview.png + + +Widget description +================== + +A hoversel is a button that pops up a list of items (automatically +choosing the direction to display) that have a label and, optionally, an +icon to select from. + +It is a convenience widget to avoid the need to do all the piecing +together yourself. It is intended for a small number of items in the +hoversel menu (no more than 8), though is capable of many more. + + +Emitted signals +=============== + +- ``clicked`` - the user clicked the hoversel button and popped up + the sel +- ``selected`` - an item in the hoversel list is selected. event_info + is the item +- ``dismissed`` - the hover is dismissed +- ``expanded`` - the hover is expanded (since 1.9) +- ``item,focused`` - the hoversel item has received focus. (since 1.10) +- ``item,unfocused`` - the hoversel item has lost focus. (since 1.10) + + +Layout content parts +==================== + +- ``icon`` - An icon of the hoversel + + +Layout text parts +================= + +- ``default`` - Label of the hoversel + + +Enumerations +============ + +.. _Elm_Hoversel_Icon_Type: + +Icon types +---------- + +.. data:: ELM_ICON_NONE + + No icon + +.. data:: ELM_ICON_FILE + + Icon is a file + +.. data:: ELM_ICON_STANDARD + + Icon is set with standards names + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Hoversel + :parts: 2 + + +.. autoclass:: efl.elementary.Hoversel +.. autoclass:: efl.elementary.HoverselItem diff --git a/doc/elementary/icon.rst b/doc/elementary/icon.rst index 51723ab..f05ebb0 100644 --- a/doc/elementary/icon.rst +++ b/doc/elementary/icon.rst @@ -1,2 +1,181 @@ +Icon +#### -.. automodule:: efl.elementary.icon +.. image:: /images/icon-preview.png + + +Widget description +================== + +An icon object is used to display standard icon images ("delete", +"edit", "arrows", etc.) or images coming from a custom file (PNG, JPG, +EDJE, etc.), on icon contexts. + +The icon image requested can be in the Elementary theme in use, or in +the ``freedesktop.org`` theme paths. It's possible to set the order of +preference from where an image will be fetched. + +This widget inherits from the :py:class:`~efl.elementary.image.Image` one, so +that all the functions acting on it also work for icon objects. + +You should be using an icon, instead of an image, whenever one of the +following apply: + +- you need a **thumbnail** version of an original image +- you need freedesktop.org provided icon images +- you need theme provided icon images (Edje groups) + +Default images provided by Elementary's default theme are described below. + +These are names that follow (more or less) the **Freedesktop** icon naming +specification. Use of these names are **preferred**, at least if you want to +give your user the ability to use other themes. All these icons can be +seen in the elementary_test application, the test is called "Icon Standard". + +- ``folder`` (since 1.13) +- ``user-home`` (since 1.13) +- ``user-trash`` (since 1.13) + +- ``view-close`` (since 1.13) +- ``view-refresh`` (since 1.13) + +- ``window-close`` 1.13) + +- ``document-close`` (since 1.13) +- ``document-edit`` (since 1.13) + +- ``dialog-info`` (since 1.13) +- ``dialog-close`` (since 1.13) + +- ``arrow-up`` (since 1.13) +- ``arrow-down`` (since 1.13) +- ``arrow-left`` (since 1.13) +- ``arrow-right`` (since 1.13) +- ``arrow-up-left`` (since 1.13) +- ``arrow-up-right`` (since 1.13) +- ``arrow-down-left`` (since 1.13) +- ``arrow-down-right`` (since 1.13) + +- ``edit-delete`` (since 1.13) + +- ``application-chat`` (since 1.13) +- ``application-clock`` (since 1.13) + +- ``media-seek-forward`` 1.13) +- ``media-seek-backward`` (since 1.13) +- ``media-skip-forward`` (since 1.13) +- ``media-skip-backward`` (since 1.13) +- ``media-playback-pause`` (since 1.13) +- ``media-playback-start`` (since 1.13) +- ``media-playback-stop`` (since 1.13) +- ``media-eject`` (since 1.13) + +- ``audio-volume`` (since 1.13) +- ``audio-volume-muted`` (since 1.13) + +These are names for icons that were first intended to be used in +toolbars, but can be used in many other places too: + +- ``home`` +- ``close`` +- ``apps`` +- ``arrow_up`` +- ``arrow_down`` +- ``arrow_left`` +- ``arrow_right`` +- ``chat`` +- ``clock`` +- ``delete`` +- ``edit`` +- ``refresh`` +- ``folder`` +- ``file`` + +These are names for icons that were designed to be used in menus +(but again, you can use them anywhere else): + +- ``menu/home`` +- ``menu/close`` +- ``menu/apps`` +- ``menu/arrow_up`` +- ``menu/arrow_down`` +- ``menu/arrow_left`` +- ``menu/arrow_right`` +- ``menu/chat`` +- ``menu/clock`` +- ``menu/delete`` +- ``menu/edit`` +- ``menu/refresh`` +- ``menu/folder`` +- ``menu/file`` + +And these are names for some media player specific icons: + +- ``media_player/forward`` +- ``media_player/info`` +- ``media_player/next`` +- ``media_player/pause`` +- ``media_player/play`` +- ``media_player/prev`` +- ``media_player/rewind`` +- ``media_player/stop`` + + +Emitted signals +=============== + +- ``thumb,done`` - Setting :py:attr:`~Icon.thumb` has completed with success +- ``thumb,error`` - Setting :py:attr:`~Icon.thumb` has failed + + +Enumerations +============ + +.. _Elm_Icon_Lookup_Order: + +Icon lookup modes +----------------- + +.. data:: ELM_ICON_LOOKUP_FDO_THEME + + freedesktop, theme + +.. data:: ELM_ICON_LOOKUP_THEME_FDO + + theme, freedesktop + +.. data:: ELM_ICON_LOOKUP_FDO + + freedesktop + +.. data:: ELM_ICON_LOOKUP_THEME + + theme + + +.. _Elm_Icon_Type: + +Icon type +--------- + +.. data:: ELM_ICON_NONE + + No icon + +.. data:: ELM_ICON_FILE + + Icon is a file + +.. data:: ELM_ICON_STANDARD + + Icon is set with standards name + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Icon + :parts: 2 + + +.. autoclass:: efl.elementary.Icon diff --git a/doc/elementary/image.rst b/doc/elementary/image.rst index 0590ed9..e3ab353 100644 --- a/doc/elementary/image.rst +++ b/doc/elementary/image.rst @@ -1,2 +1,93 @@ +Image +##### -.. automodule:: efl.elementary.image +.. image:: /images/image-preview.png + + +Widget description +================== + +An Elementary image object allows one to load and display an image +file on it, be it from a disk file or from a memory region. + +Exceptionally, one may also load an Edje group as the contents of the +image. In this case, though, most of the functions of the image API will +act as a no-op. + +One can tune various properties of the image, like: + +- pre-scaling, +- smooth scaling, +- orientation, +- aspect ratio during resizes, etc. + +An image object may also be made valid source and destination for drag +and drop actions by setting :py:attr:`~Image.editable`. + + +Emitted signals +=============== + +- ``drop`` - This is called when a user has dropped an image + typed object onto the object in question -- the + event info argument is the path to that image file +- ``clicked`` - This is called when a user has clicked the image +- ``download,start`` - remote url download has started +- ``download,progress`` - url download in progress +- ``download,end`` - remote url download has finished +- ``download,error`` - remote url download has finished with errors + + +Enumerations +============ + +.. _Elm_Image_Orient: + +Image manipulation types +------------------------ + +.. data:: ELM_IMAGE_ORIENT_NONE + + No orientation change + +.. data:: ELM_IMAGE_ORIENT_0 + + No orientation change + +.. data:: ELM_IMAGE_ROTATE_90 + + Rotate 90 degrees clockwise + +.. data:: ELM_IMAGE_ROTATE_180 + + Rotate 180 degrees clockwise + +.. data:: ELM_IMAGE_ROTATE_270 + + Rotate 270 degrees clockwise + +.. data:: ELM_IMAGE_FLIP_HORIZONTAL + + Flip the image horizontally + +.. data:: ELM_IMAGE_FLIP_VERTICAL + + Flip the image vertically + +.. data:: ELM_IMAGE_FLIP_TRANSPOSE + + Flip the image along the y = (width - x) line (bottom-left to top-right) + +.. data:: ELM_IMAGE_FLIP_TRANSVERSE + + Flip the image along the y = x line (top-left to bottom-right) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Image + :parts: 2 + + +.. autoclass:: efl.elementary.Image diff --git a/doc/elementary/index.rst b/doc/elementary/index.rst index fea21e2..3985b5a 100644 --- a/doc/elementary/index.rst +++ b/doc/elementary/index.rst @@ -1,2 +1,59 @@ +Index +##### -.. automodule:: efl.elementary.index +.. image:: /images/index-preview.png + + +Widget description +================== + +An index widget gives you an index for fast access to whichever +group of other UI items one might have. + +It's a list of text items (usually letters, for alphabetically ordered +access). + +Index widgets are by default hidden and just appear when the +user clicks over it's reserved area in the canvas. In its +default theme, it's an area one ``finger`` wide on +the right side of the index widget's container. + +When items on the index are selected, smart callbacks get called, so that its +user can make other container objects to show a given area or child object +depending on the index item selected. You'd probably be using an index together +with :py:class:`~efl.elementary.list.List`, +:py:class:`~efl.elementary.genlist.Genlist` or +:py:class:`~efl.elementary.gengrid.Gengrid`. + + +Emitted signals +=============== + +- ``changed`` - When the selected index item changes. ``event_info`` + is the selected item's data. +- ``delay,changed`` - When the selected index item changes, but + after a small idling period. ``event_info`` is the selected + item's data. +- ``selected`` - When the user releases a mouse button and + selects an item. ``event_info`` is the selected item's data. +- ``level,up`` - when the user moves a finger from the first + level to the second level +- ``level,down`` - when the user moves a finger from the second + level to the first level +- ``language,changed`` - the program's language changed +- ``focused`` - When the index has received focus. (since 1.8) +- ``unfocused`` - When the index has lost focus. (since 1.8) + +The ``delay,changed`` event has a delay on change before the event is actually +reported and moreover just the last event happening on those time frames will +actually be reported. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Index + :parts: 2 + + +.. autoclass:: efl.elementary.Index diff --git a/doc/elementary/innerwindow.rst b/doc/elementary/innerwindow.rst index 77e867b..5e70c6f 100644 --- a/doc/elementary/innerwindow.rst +++ b/doc/elementary/innerwindow.rst @@ -1,2 +1,40 @@ +Innerwindow +########### -.. automodule:: efl.elementary.innerwindow +.. image:: /images/innerwindow-preview.png + + +Widget description +================== + +An inwin is a window inside a window that is useful for a quick popup. +It does not hover. + +It works by creating an object that will occupy the entire window, so it must be +created using an :py:class:`~efl.elementary.window.Window` as parent only. The +inwin object can be hidden or restacked below every other object if it's needed +to show what's behind it without destroying it. If this is done, the +:py:meth:`~InnerWindow.activate` function can be used to bring it back to full +visibility again. + + +Available styles +================ + +- ``default`` The inwin is sized to take over most of the window it's + placed in. +- ``minimal`` The size of the inwin will be the minimum necessary to show + its contents. +- ``minimal_vertical`` Horizontally, the inwin takes as much space as + possible, but it's sized vertically the most it needs to fit its + contents. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.InnerWindow + :parts: 2 + + +.. autoclass:: efl.elementary.InnerWindow diff --git a/doc/elementary/label.rst b/doc/elementary/label.rst index ba32422..820c446 100644 --- a/doc/elementary/label.rst +++ b/doc/elementary/label.rst @@ -1,2 +1,98 @@ +Label +##### -.. automodule:: efl.elementary.label +.. image:: /images/label-preview.png + + +Widget description +================== + +Widget to display text, with simple html-like markup. + +The Label widget **doesn't** allow text to overflow its boundaries, if the +text doesn't fit the geometry of the label it will be ellipsized or be +cut. + + +Available styles +================ + +``default`` + No animation +``marker`` + Centers the text in the label and makes it bold by default +``slide_long`` + The entire text appears from the right of the screen and + slides until it disappears in the left of the screen(reappearing on + the right again). +``slide_short`` + The text appears in the left of the label and slides to + the right to show the overflow. When all of the text has been shown + the position is reset. +``slide_bounce`` + The text appears in the left of the label and slides to + the right to show the overflow. When all of the text has been shown + the animation reverses, moving the text to the left. + +Custom themes can of course invent new markup tags and style them any way +they like. + + +Emitted signals +=============== + +- ``language,changed`` - The program's language changed. +- ``slide,end`` - The slide is end. + + +Enumerations +============ + +.. _Elm_Label_Wrap_Type: + +Wrap modes +---------- + +.. data:: ELM_WRAP_NONE + + No wrap + +.. data:: ELM_WRAP_CHAR + + Wrap between characters + +.. data:: ELM_WRAP_WORD + + Wrap in allowed wrapping points (as defined in the unicode standard) + +.. data:: ELM_WRAP_MIXED + + Word wrap, and if that fails, char wrap. + + +.. _Elm_Label_Slide_Mode: + +Slide modes +----------- + +.. data:: ELM_LABEL_SLIDE_MODE_NONE + + The label will never slide. + +.. data:: ELM_LABEL_SLIDE_MODE_AUTO + + The label slide if the content is bigger than it's container. + +.. data:: ELM_LABEL_SLIDE_MODE_ALWAYS + + The label will always slide. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Label + :parts: 2 + + +.. autoclass:: efl.elementary.Label diff --git a/doc/elementary/layout.rst b/doc/elementary/layout.rst index 4cff326..10ebeb8 100644 --- a/doc/elementary/layout.rst +++ b/doc/elementary/layout.rst @@ -1,2 +1,163 @@ +Layout +###### -.. automodule:: efl.elementary.layout +.. image:: /images/layout-preview.png + + +Widget description +================== + +This is a container widget that takes a standard Edje design file and +wraps it very thinly in a widget. + +An Edje design (theme) file has a very wide range of possibilities to +describe the behavior of elements added to the Layout. Check out the Edje +documentation and the EDC reference to get more information about what can +be done with Edje. + +Just like :py:class:`~efl.elementary.list.List`, +:py:class:`~efl.elementary.box.Box`, and other container +widgets, any object added to the Layout will become its child, meaning +that it will be deleted if the Layout is deleted, move if the Layout is +moved, and so on. + +The Layout widget can contain as many Contents, Boxes or Tables as +described in its theme file. For instance, objects can be added to +different Tables by specifying the respective Table part names. The same +is valid for Content and Box. + +The objects added as child of the Layout will behave as described in the +part description where they were added. There are 3 possible types of +parts where a child can be added: + +Content (SWALLOW part) + Only one object can be added to the ``SWALLOW`` part (but you still can + have many ``SWALLOW`` parts and one object on each of them). Use the + ``Object.content_set/get/unset`` functions to set, retrieve and unset + objects as content of the *SWALLOW*. After being set to this part, + the object size, position, visibility, clipping and other description + properties will be totally controlled by the description of the + given part (inside the Edje theme file). + + One can use ``size_hint_`` functions on the child to have some kind of + control over its behavior, but the resulting behavior will still + depend heavily on the ``SWALLOW`` part description. + + The Edje theme also can change the part description, based on + signals or scripts running inside the theme. This change can also be + animated. All of this will affect the child object set as content + accordingly. The object size will be changed if the part size is + changed, it will animate move if the part is moving, and so on. + +Box (BOX part) + An Edje ``BOX`` part is very similar to the Elementary + :py:class:`~efl.elementary.box.Box` widget. It allows one to add objects to + the box and have them distributed along its area, accordingly to the + specified ``layout`` property (now by ``layout`` we mean the chosen + layouting design of the Box, not the Layout widget itself). + + A similar effect for having a box with its position, size and other things + controlled by the Layout theme would be to create an Elementary + :py:class:`~efl.elementary.box.Box` widget and add it as a Content in the + ``SWALLOW`` part. + + The main difference of using the Layout Box is that its behavior, the box + properties like layouting format, padding, align, etc. will be all + controlled by the theme. This means, for example, that a signal could be + sent to the Layout theme (with + :py:meth:`~efl.elementary.object.Object.signal_emit`) and the theme handled + the signal by changing the box padding, or align, or both. Using the + Elementary :py:class:`~efl.elementary.box.Box` widget is not necessarily + harder or easier, it just depends on the circumstances and requirements. + + The Layout Box can be used through the ``box_`` set of functions. + +Table (TABLE part) + Just like the *Box*, the Layout Table is very similar to the Elementary + :py:class:`~efl.elementary.table.Table` widget. It allows one to add objects + to the Table specifying the row and column where the object should be added, + and any column or row span if necessary. + + Again, we could have this design by adding a + :py:class:`~efl.elementary.table.Table` widget to the ``SWALLOW`` part using + :py:func:`~efl.elementary.object.Object.part_content_set`. The same + difference happens here when choosing to use the Layout Table (a ``TABLE`` + part) instead of the :py:class:`~efl.elementary.table.Table` plus + ``SWALLOW`` part. It's just a matter of convenience. + + The Layout Table can be used through the ``table_`` set of functions. + +Another interesting thing about the Layout widget is that it offers some +predefined themes that come with the default Elementary theme. These themes can +be set by :py:attr:`~efl.elementary.layout_class.LayoutClass.theme`, and provide +some basic functionality depending on the theme used. + +Most of them already send some signals, some already provide a toolbar or +back and next buttons. + + +Layout Class +============ + +Elementary, besides having the :py:class:`~efl.elementary.layout.Layout` +widget, exposes its foundation -- the Elementary Layout Class -- in +order to create other widgets which are, basically, a certain layout +with some more logic on top. + +The idea is to make the creation of that widgets as easy as possible, +factorizing code on this common base. For example, a button is a layout +(that looks like push button) that happens to react on clicks and keyboard +events in a special manner, calling its user back on those events. That's no +surprise, then, that the :py:class:`~efl.elementary.button.Button` +implementation relies on LayoutClass, if you go to check it. + +Container parts, here, map directly to Edje parts from the layout's Edje +group. Besides that, there's a whole infrastructure around Edje files: + +- interfacing by signals, +- setting/retrieving text part values, +- dealing with table and box parts directly, +- etc. + +Finally, layout objects will do **part aliasing** for you, if you set +it up properly. For that, take a look at +Elm_Layout_Part_Alias_Description, where it's explained in detail. + + +Available styles +================ + +These are available predefined theme layouts. All of them have class = +*layout*, group = *application*, and style = one of the following options: + +- ``toolbar-content`` - application with toolbar and main content area +- ``toolbar-content-back`` - application with toolbar and main content + area with a back button and title area +- ``toolbar-content-back-next`` - application with toolbar and main + content area with a back and next buttons and title area +- ``content-back`` - application with a main content area with a back + button and title area +- ``content-back-next`` - application with a main content area with a + back and next buttons and title area +- ``toolbar-vbox`` - application with toolbar and main content area as a + vertical box +- ``toolbar-table`` - application with toolbar and main content area as a + table + + +Emitted signals +=============== + +- ``theme,changed`` - The theme was changed. +- ``language,changed`` - the program's language changed + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Layout + :parts: 2 + + +.. autoclass:: efl.elementary.Layout +.. autoclass:: efl.elementary.LayoutClass diff --git a/doc/elementary/layout_class.rst b/doc/elementary/layout_class.rst deleted file mode 100644 index 75f9673..0000000 --- a/doc/elementary/layout_class.rst +++ /dev/null @@ -1,2 +0,0 @@ - -.. automodule:: efl.elementary.layout_class diff --git a/doc/elementary/list.rst b/doc/elementary/list.rst index 4f3d17f..9cf38b1 100644 --- a/doc/elementary/list.rst +++ b/doc/elementary/list.rst @@ -1,2 +1,160 @@ +List +#### -.. automodule:: efl.elementary.list +.. image:: /images/list-preview.png + + +Widget description +================== + +A list widget is a container whose children are displayed vertically or +horizontally, in order, and can be selected. +The list can accept only one or multiple items selection. Also has many +modes of items displaying. + +A list is a very simple type of list widget. For more robust +lists, :py:class:`~efl.elementary.genlist.Genlist` should probably be used. + + +Emitted signals +=============== + +- ``activated`` - The user has double-clicked or pressed + (enter|return|spacebar) on an item. +- ``clicked,double`` - The user has double-clicked an item. +- ``clicked,right`` - The user has right-clicked an item. (since: 1.13) +- ``selected`` - when the user selected an item +- ``unselected`` - when the user unselected an item +- ``longpressed`` - an item in the list is long-pressed +- ``edge,top`` - the list is scrolled until the top edge +- ``edge,bottom`` - the list is scrolled until the bottom edge +- ``edge,left`` - the list is scrolled until the left edge +- ``edge,right`` - the list is scrolled until the right edge +- ``highlighted`` - an item in the list is highlighted. This is called when + the user presses an item or keyboard selection is done so the item is + physically highlighted. +- ``unhighlighted`` - an item in the list is unhighlighted. This is called + when the user releases an item or keyboard selection is moved so the item + is physically unhighlighted. +- ``language,changed`` - the program's language changed +- ``focused`` - When the list has received focus. (since 1.8) +- ``unfocused`` - When the list has lost focus. (since 1.8) +- ``item,focused`` - When the list item has received focus. (since 1.10) +- ``item,unfocused`` - When the list item has lost focus. (since 1.10) + + +Available styles +================ + +- ``default`` + + +Layout content parts +==================== + +- ``start`` - A start position object in the list item +- ``end`` - A end position object in the list item + + +Layout text parts +================= + +- ``default`` - label in the list item + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scolling behaviour using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.scroller.Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Enumerations +============ + +.. _Elm_List_Mode: + +List sizing modes +----------------- + +.. data:: ELM_LIST_COMPRESS + + The list won't set any of its size hints to inform how a possible container + should resize it. + + Then, if it's not created as a "resize object", it might end with zeroed + dimensions. The list will respect the container's geometry and, if any of + its items won't fit into its transverse axis, one won't be able to scroll it + in that direction. + +.. data:: ELM_LIST_SCROLL + + Default value. + + This is the same as ELM_LIST_COMPRESS, with the exception that if any of + its items won't fit into its transverse axis, one will be able to scroll + it in that direction. + +.. data:: ELM_LIST_LIMIT + + Sets a minimum size hint on the list object, so that containers may + respect it (and resize itself to fit the child properly). + + More specifically, a minimum size hint will be set for its transverse + axis, so that the largest item in that direction fits well. This is + naturally bound by the list object's maximum size hints, set externally. + +.. data:: ELM_LIST_EXPAND + + Besides setting a minimum size on the transverse axis, just like on + ELM_LIST_LIMIT, the list will set a minimum size on the longitudinal + axis, trying to reserve space to all its children to be visible at a time. + + This is naturally bound by the list object's maximum size hints, set + externally. + + +.. _Elm_List_Object_Select_Mode: + +Selection modes +--------------- + +.. data:: ELM_OBJECT_SELECT_MODE_DEFAULT + + Items will only call their selection func and callback when + first becoming selected. Any further clicks will do nothing, + unless you set always select mode. + +.. data:: ELM_OBJECT_SELECT_MODE_ALWAYS + + This means that, even if selected, every click will make the + selected callbacks be called. + +.. data:: ELM_OBJECT_SELECT_MODE_NONE + + This will turn off the ability to select items entirely and + they will neither appear selected nor call selected callback + functions. + +.. data:: ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY + + No select mode with no finger size rule + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.List + :parts: 2 + + +.. autoclass:: efl.elementary.List +.. autoclass:: efl.elementary.ListItem diff --git a/doc/elementary/map.rst b/doc/elementary/map.rst index 5a87dd9..b9bd72e 100644 --- a/doc/elementary/map.rst +++ b/doc/elementary/map.rst @@ -1,2 +1,200 @@ +Map +### -.. automodule:: efl.elementary.map +.. image:: /images/map-preview.png + :width: 100% + + +Widget description +================== + +The *Map* is a widget specifically for displaying a geographic map. +It uses `OpenStreetMap `_ as map tile provider, +`YOURS `_ for routing calculation and +`Nominatim `_ to convert geographic +coordinates to/from address names. But custom providers can be added. + +It supports some basic but yet nice features: + +- zooming and scrolling +- markers with content to be displayed when user clicks over them +- automatic grouping of markers based on zoom level +- routes calculation +- names/coordinates conversion (and viceversa) + + +Emitted signals +=============== + +- ``clicked`` - Called when a user has clicked the map without dragging around. +- ``clicked,double`` - Called when a user has double-clicked the map. +- ``press`` - This is called when a user has pressed down on the map. +- ``longpressed`` - This is called when a user has pressed down on the map + for a long time without dragging around. +- ``scroll`` - the content has been scrolled (moved). +- ``scroll,drag,start`` - dragging the contents around has started. +- ``scroll,drag,stop`` - dragging the contents around has stopped. +- ``scroll,anim,start`` - scrolling animation has started. +- ``scroll,anim,stop`` - scrolling animation has stopped. +- ``zoom,start`` - Zoom animation started. +- ``zoom,stop`` - Zoom animation stopped. +- ``zoom,change`` - Zoom changed when using an auto zoom mode. +- ``tile,load`` - A map tile image load begins. +- ``tile,loaded`` - A map tile image load ends. +- ``tile,loaded,fail`` - A map tile image load fails. +- ``route,load`` - Route request begins. +- ``route,loaded`` - Route request ends. +- ``route,loaded,fail`` - Route request fails. +- ``name,load`` - Name request begins. +- ``name,loaded`` - Name request ends. +- ``name,loaded,fail`` - Name request fails. +- ``overlay,clicked`` - A overlay is clicked. +- ``loaded`` - when a map is finally loaded. +- ``language,changed`` - the program's language changed +- ``focused`` - When the map has received focus. (since 1.8) +- ``unfocused`` - When the map has lost focus. (since 1.8) + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scolling behaviour using these functions, +inherit both the widget class and the +:py:class:`Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Enumerations +============ + +.. _Elm_Map_Overlay_Type: + +Map overlay types +----------------- + +.. data:: ELM_MAP_OVERLAY_TYPE_NONE + + None + +.. data:: ELM_MAP_OVERLAY_TYPE_DEFAULT + + The default overlay type. + +.. data:: ELM_MAP_OVERLAY_TYPE_CLASS + + The Class overlay is used to group marker together. + +.. data:: ELM_MAP_OVERLAY_TYPE_GROUP + + A group of overlays. + +.. data:: ELM_MAP_OVERLAY_TYPE_BUBBLE + + This class can *follow* another overlay. + +.. data:: ELM_MAP_OVERLAY_TYPE_ROUTE + + This is used to draw a route result on the map. + +.. data:: ELM_MAP_OVERLAY_TYPE_LINE + + Simply draw a line on the map. + +.. data:: ELM_MAP_OVERLAY_TYPE_POLYGON + + Simply draw a polygon on the map. + +.. data:: ELM_MAP_OVERLAY_TYPE_CIRCLE + + Simply draw a circle on the map. + +.. data:: ELM_MAP_OVERLAY_TYPE_SCALE + + This will draw a dinamic scale on the map. + + +.. _Elm_Map_Route_Method: + +Map route methods +----------------- + +.. data:: ELM_MAP_ROUTE_METHOD_FASTEST + + Route should prioritize time + +.. data:: ELM_MAP_ROUTE_METHOD_SHORTEST + + Route should prioritize distance + + +.. _Elm_Map_Route_Type: + +Map route types +--------------- + +.. data:: ELM_MAP_ROUTE_TYPE_MOTOCAR + + Route should consider an automobile will be used. + +.. data:: ELM_MAP_ROUTE_TYPE_BICYCLE + + Route should consider a bicycle will be used by the user. + +.. data:: ELM_MAP_ROUTE_TYPE_FOOT + + Route should consider user will be walking. + + +.. _Elm_Map_Source_Type: + +Map source types +---------------- + +.. data:: ELM_MAP_SOURCE_TYPE_TILE + + Map tile provider + +.. data:: ELM_MAP_SOURCE_TYPE_ROUTE + + Route service provider + +.. data:: ELM_MAP_SOURCE_TYPE_NAME + + Name service provider + + +.. _Elm_Map_Zoom_Mode: + +Map zoom modes +-------------- + +.. data:: ELM_MAP_ZOOM_MODE_MANUAL + + Zoom controlled manually by :py:attr:`~Map.zoom` + + It's set by default. + +.. data:: ELM_MAP_ZOOM_MODE_AUTO_FIT + + Zoom until map fits inside the scroll frame with no pixels outside this + area. + +.. data:: ELM_MAP_ZOOM_MODE_AUTO_FILL + + Zoom until map fills scroll, ensuring no pixels are left unfilled. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Map + :parts: 2 + + +.. autoclass:: efl.elementary.Map diff --git a/doc/elementary/mapbuf.rst b/doc/elementary/mapbuf.rst index cb60020..1930e0e 100644 --- a/doc/elementary/mapbuf.rst +++ b/doc/elementary/mapbuf.rst @@ -1,2 +1,31 @@ +Mapbuf +###### -.. automodule:: efl.elementary.mapbuf +.. image:: /images/mapbuf-preview.png + + +Widget description +================== + +This holds one content object and uses an Evas Map of transformation +points to be later used with this content. So the content will be +moved, resized, etc as a single image. So it will improve performance +when you have a complex interface, with a lot of elements, and will +need to resize or move it frequently (the content object and its +children). + + +Layout content parts +==================== + +- ``default`` - The main content of the mapbuf + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Mapbuf + :parts: 2 + + +.. autoclass:: efl.elementary.Mapbuf diff --git a/doc/elementary/menu.rst b/doc/elementary/menu.rst index 97b8d8e..183ad4d 100644 --- a/doc/elementary/menu.rst +++ b/doc/elementary/menu.rst @@ -1,2 +1,44 @@ +Menu +#### -.. automodule:: efl.elementary.menu +.. image:: /images/menu-preview.png + + +Widget description +================== + +A menu is a list of items displayed above its parent. + +When the menu is showing its parent is darkened. Each item can have a +sub-menu. The menu object can be used to display a menu on a right click +event, in a toolbar, anywhere. + + +Emitted signals +=============== + +- ``clicked`` - the user clicked the empty space in the menu to dismiss. +- ``dismissed`` - the user clicked the empty space in the menu to dismiss (since 1.8) + + +Layout content parts +==================== + +- ``default`` - A main content of the menu item + + +Layout text parts +================= + +- ``default`` - label in the menu item + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Menu + :parts: 2 + + +.. autoclass:: efl.elementary.Menu +.. autoclass:: efl.elementary.MenuItem diff --git a/doc/elementary/multibuttonentry.rst b/doc/elementary/multibuttonentry.rst index d3d1070..1384856 100644 --- a/doc/elementary/multibuttonentry.rst +++ b/doc/elementary/multibuttonentry.rst @@ -1,2 +1,58 @@ +MultiButtonEntry +################ -.. automodule:: efl.elementary.multibuttonentry +.. image:: /images/multibuttonentry-preview.png + + +Widget description +================== + +A Multibuttonentry is a widget to allow a user enter text and manage +it as a number of buttons. Each text button is inserted by pressing the +"return" key. If there is no space in the current row, a new button is +added to the next row. When a text button is pressed, it will become +focused. Backspace removes the focus. When the Multibuttonentry loses +focus items longer than one line are shrunk to one line. + +Typical use case of multibuttonentry is, composing emails/messages to a +group of addresses, each of which is an item that can be clicked for +further actions. + + +Emitted signals +=============== + +- ``item,selected`` - this is called when an item is selected by + api, user interaction, and etc. this is also called when a + user press back space while cursor is on the first field of + entry. event_info contains the item. +- ``item,added`` - when a new multi-button entry item is added. + event_info contains the item. +- ``item,deleted`` - when a multi-button entry item is deleted. + event_info contains the item. +- ``item,clicked`` - this is called when an item is clicked by user + interaction. Both "item,selected" and "item,clicked" are needed. + event_info contains the item. +- ``clicked`` - when multi-button entry is clicked. +- ``focused`` - when multi-button entry is focused. +- ``unfocused`` - when multi-button entry is unfocused. +- ``expanded`` - when multi-button entry is expanded. +- ``contracted`` - when multi-button entry is contracted. +- ``expand,state,changed`` - when shrink mode state of + multi-button entry is changed. + +Layout text parts +================= + +- ``default`` - A label of the multibuttonentry +- ``default`` - A label of the multibuttonentry item + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.MultiButtonEntry + :parts: 2 + + +.. autoclass:: efl.elementary.MultiButtonEntry diff --git a/doc/elementary/naviframe.rst b/doc/elementary/naviframe.rst index c8377b7..32233fe 100644 --- a/doc/elementary/naviframe.rst +++ b/doc/elementary/naviframe.rst @@ -1,2 +1,92 @@ +Naviframe +######### -.. automodule:: efl.elementary.naviframe +.. image:: /images/naviframe-preview.png + + +Widget description +================== + +Naviframe stands for navigation frame. It's a views manager +for applications. + +A naviframe holds views (or pages) as its items. Those items are +organized in a stack, so that new items get pushed on top of the +old, and only the topmost view is displayed at one time. The +transition between views is animated, depending on the theme +applied to the widget. + +Naviframe views hold spaces to various elements, which are: + +- back button, used to navigate to previous views, +- next button, used to navigate to next views in the stack, +- title label, +- sub-title label, +- title icon and +- content area. + + +Layout content parts +==================== + +- ``default`` - The main content of the current page +- ``icon`` - An icon in the title area of the current page +- ``prev_btn`` - A button of the current page to go to the previous page +- ``next_btn`` - A button of the current page to go to the next page + + +Layout text parts +================= + +- ``default`` - Title label in the title area of the current page +- ``subtitle`` - Sub-title label in the title area of the current page + +Most of those content objects can be passed at the time of an item +creation (see :py:meth:`~NaviframeItem.push_to`). + + +Available styles +================ + +Naviframe items can have different styles, which affect the +transition between views, for example. On the default theme, two of +them are supported: + +- ``basic`` - views are switched sliding horizontally, one after the other +- ``overlap`` - like the previous one, but the previous view stays at its place + and is overlapped by the new + + +Emitted signals +=============== + +- ``transition,finished`` - When the transition is finished in changing the item +- ``title,transition,finished`` - When the title area's transition is finished +- ``title,clicked`` - User clicked title area +- ``focused`` - When the naviframe has received focus. (since 1.8) +- ``unfocused`` - When the naviframe has lost focus. (since 1.8) + +All the parts, for content and text, described here will also be +reachable by naviframe **items** direct calls: + +- :py:meth:`~efl.elementary.object_item.ObjectItem.delete` +- :py:meth:`~efl.elementary.object_item.ObjectItem.part_text_set` +- :py:meth:`~efl.elementary.object_item.ObjectItem.part_text_get` +- :py:meth:`~efl.elementary.object_item.ObjectItem.part_content_set` +- :py:meth:`~efl.elementary.object_item.ObjectItem.part_content_get` +- :py:meth:`~efl.elementary.object_item.ObjectItem.part_content_unset` +- :py:meth:`~efl.elementary.object_item.ObjectItem.signal_emit` + +What happens is that the topmost item of a naviframe will be the +widget's target layout, when accessed directly. Items lying below +the top one can be interacted with this way. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Naviframe + :parts: 2 + + +.. autoclass:: efl.elementary.Naviframe diff --git a/doc/elementary/need.rst b/doc/elementary/need.rst index 31dc046..c9e2371 100644 --- a/doc/elementary/need.rst +++ b/doc/elementary/need.rst @@ -1,2 +1,18 @@ +Need +#### -.. automodule:: efl.elementary.need +Description +=========== + +These functions are used for requesting use of optional Elementary modules. +Check their return value for whether the feature is actually supported. + + +.. autofunction:: efl.elementary.need_efreet +.. autofunction:: efl.elementary.need_systray +.. autofunction:: efl.elementary.need_sys_notify +.. autofunction:: efl.elementary.need_e_dbus +.. autofunction:: efl.elementary.need_eldbus +.. autofunction:: efl.elementary.need_elocation +.. autofunction:: efl.elementary.need_ethumb +.. autofunction:: efl.elementary.need_web diff --git a/doc/elementary/notify.rst b/doc/elementary/notify.rst index bb7648e..97ec6f9 100644 --- a/doc/elementary/notify.rst +++ b/doc/elementary/notify.rst @@ -1,2 +1,52 @@ +Notify +###### -.. automodule:: efl.elementary.notify +.. image:: /images/notify-preview.png + + +Widget description +================== + +Display a container in a particular region of the parent. + +A timeout can be set to automatically hide the notify. This is so that, after +an :py:meth:`~efl.evas.Object.show` on a notify object, if a timeout was set on +it, it will **automatically** get hidden after that time. + + +Emitted signals +=============== + +- ``timeout`` - when timeout happens on notify and it's hidden +- ``block,clicked`` - when a click outside of the notify happens + + +Layout content parts +==================== + +- ``default`` - The main content of the notify + + +Enumerations +============ + +.. _ELM_NOTIFY_ALIGN_FILL: + +ELM_NOTIFY_ALIGN_FILL +--------------------- + +.. data:: ELM_NOTIFY_ALIGN_FILL + + Use with :py:attr:`Notify.align` + + .. versionadded:: 1.8 + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Notify + :parts: 2 + + +.. autoclass:: efl.elementary.Notify diff --git a/doc/elementary/object.rst b/doc/elementary/object.rst index abc1e67..8b73309 100644 --- a/doc/elementary/object.rst +++ b/doc/elementary/object.rst @@ -1,2 +1,254 @@ +Object +###### -.. automodule:: efl.elementary.object + +Copy and Paste +============== + +Implements the following functionality + +a. select, copy/cut and paste +b. clipboard +c. drag and drop + +in order to share data across application windows. + +Contains functions to select text or a portion of data, +send it to a buffer, and paste the data into a target. + +elm_cnp provides a generic copy and paste facility based on its windowing +system. +It is not necessary to know the details of each windowing system, +but some terms and behavior are common. +Currently the X11 window system is widely used, and only X11 functionality is +implemented. + +In X11R6 window system, CopyPaste works like a peer-to-peer communication. +Copying is an operation on an object in an X server. +X11 calls those objects 'selections' which have names. +Generally, two selection types are needed for copy and paste: +The Primary selection and the Clipboard selection. +Primary selection is for selecting text (that means highlighted text). +Clipboard selection is for explicit copying behavior +(such as ctrl+c, or 'copy' in a menu). +Thus, in applications most cases only use the clipboard selection. +As stated before, taking ownership of a selection doesn't move any actual data. +Copying and Pasting is described as follows: + +1. Copy text in Program A : Program A takes ownership of the selection +2. Paste text in Program B : Program B notes that Program A owns the selection +3. Program B asks A for the text +4. Program A responds and sends the text to program B +5. Program B pastes the response + +More information is on + - http://www.jwz.org/doc/x-cut-and-paste.html + - X11R6 Inter-Client Communication Conventions Manual, section 2 + + +Enumerations +============ + +.. _Elm_Object_Focus_Direction: + +Focus direction +--------------- + +.. data:: ELM_FOCUS_PREVIOUS + + Focus previous + +.. data:: ELM_FOCUS_NEXT + + Focus next + +.. data:: ELM_FOCUS_UP + + Focus up + + .. versionadded:: 1.8.1 + +.. data:: ELM_FOCUS_DOWN + + Focus down + + .. versionadded:: 1.8.1 + +.. data:: ELM_FOCUS_RIGHT + + Focus right + + .. versionadded:: 1.8.1 + +.. data:: ELM_FOCUS_LEFT + + Focus left + + .. versionadded:: 1.8.1 + + +.. _Elm_Focus_Move_Policy: + +Focus move policy +----------------- + +.. data:: ELM_FOCUS_MOVE_POLICY_CLICK + + Give focus to object when they are clicked + + .. versionadded:: 1.10 + +.. data:: ELM_FOCUS_MOVE_POLICY_IN + + Give focus to object on mouse-in + + .. versionadded:: 1.10 + + +.. _Elm_Focus_Autoscroll_Mode: + +Focus autoscroll mode +--------------------- + +.. data:: ELM_FOCUS_AUTOSCROLL_MODE_SHOW + + Directly show the focused region or item automatically. + + .. versionadded:: 1.10 + +.. data:: ELM_FOCUS_AUTOSCROLL_MODE_NONE + + Do not show the focused region or item automatically. + + .. versionadded:: 1.10 + +.. data:: ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN + + Bring_in the focused region or item automatically which might + invole the scrolling + + .. versionadded:: 1.10 + + +.. _Elm_Input_Event_Type: + +Input event types +----------------- + +.. data:: EVAS_CALLBACK_KEY_DOWN +.. data:: EVAS_CALLBACK_KEY_UP +.. data:: EVAS_CALLBACK_MOUSE_WHEEL + + +.. _Elm_Object_Sel_Type: + +Selection type +-------------- + +Defines the types of selection property names. + +:see: http://www.x.org/docs/X11/xlib.pdf for more details. + +.. data:: ELM_SEL_TYPE_PRIMARY + + Primary text selection (highlighted or selected text) + +.. data:: ELM_SEL_TYPE_SECONDARY + + Used when primary selection is in use + +.. data:: ELM_SEL_TYPE_XDND + + Drag 'n' Drop + +.. data:: ELM_SEL_TYPE_CLIPBOARD + + Clipboard selection (ctrl+C) + + +.. _Elm_Object_Sel_Format: + +Selection format +---------------- + +Defines the types of content. + +.. data:: ELM_SEL_FORMAT_TARGETS + + For matching every possible atom + +.. data:: ELM_SEL_FORMAT_NONE + + Content is from outside of Elementary + +.. data:: ELM_SEL_FORMAT_TEXT + + Plain unformatted text: Used for things that don't want rich markup + +.. data:: ELM_SEL_FORMAT_MARKUP + + Edje textblock markup, including inline images + +.. data:: ELM_SEL_FORMAT_IMAGE + + Images + +.. data:: ELM_SEL_FORMAT_VCARD + + Vcards + +.. data:: ELM_SEL_FORMAT_HTML + + Raw HTML-like data (eg. webkit) + + +.. _Elm_Object_Xdnd_Action: + +XDND action +----------- + +Defines the kind of action associated with the drop data if for XDND + +.. versionadded:: 1.8 + +.. data:: ELM_XDND_ACTION_UNKNOWN + + Action type is unknown + +.. data:: ELM_XDND_ACTION_COPY + + Copy the data + +.. data:: ELM_XDND_ACTION_MOVE + + Move the data + +.. data:: ELM_XDND_ACTION_PRIVATE + + Private action type + +.. data:: ELM_XDND_ACTION_ASK + + Ask the user what to do + +.. data:: ELM_XDND_ACTION_LIST + + List the data + +.. data:: ELM_XDND_ACTION_LINK + + Link the data + +.. data:: ELM_XDND_ACTION_DESCRIPTION + + Describe the data + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Object + :parts: 2 + + +.. autoclass:: efl.elementary.Object diff --git a/doc/elementary/object_item.rst b/doc/elementary/object_item.rst index 173cd05..806370e 100644 --- a/doc/elementary/object_item.rst +++ b/doc/elementary/object_item.rst @@ -1,2 +1,11 @@ +Object Item +######################### -.. automodule:: efl.elementary.object_item +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.ObjectItem + :parts: 2 + + +.. autoclass:: efl.elementary.ObjectItem diff --git a/doc/elementary/panel.rst b/doc/elementary/panel.rst index 540ba86..8583edf 100644 --- a/doc/elementary/panel.rst +++ b/doc/elementary/panel.rst @@ -1,2 +1,60 @@ +Panel +##### -.. automodule:: efl.elementary.panel +.. image:: /images/panel-preview.png + + +Widget description +================== + +A panel is a type of animated container that contains subobjects. + +It can be expanded or contracted by clicking the button on it's edge. + + +Emitted signals +=============== + +- ``focused`` - When the panel has received focus. (since 1.8) +- ``unfocused`` - When the panel has lost focus. (since 1.8) + + +Layout content parts +==================== + +- ``default`` - A content of the panel + + +Enumerations +============ + +.. _Elm_Panel_Orient: + +Panel orientation types +----------------------- + +.. data:: ELM_PANEL_ORIENT_TOP + + Panel (dis)appears from the top + +.. data:: ELM_PANEL_ORIENT_BOTTOM + + Panel (dis)appears from the bottom + +.. data:: ELM_PANEL_ORIENT_LEFT + + Panel (dis)appears from the left + +.. data:: ELM_PANEL_ORIENT_RIGHT + + Panel (dis)appears from the right + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Panel + :parts: 2 + + +.. autoclass:: efl.elementary.Panel diff --git a/doc/elementary/panes.rst b/doc/elementary/panes.rst index 00b9fb5..fdf9bfa 100644 --- a/doc/elementary/panes.rst +++ b/doc/elementary/panes.rst @@ -1,2 +1,44 @@ +Panes +##### -.. automodule:: efl.elementary.panes +.. image:: /images/panes-preview.png + + +Widget description +================== + +The panes widget adds a draggable bar between two contents. When +dragged this bar will resize contents' size. + +Panes can be displayed vertically or horizontally, and contents size +proportion can be customized (homogeneous by default). + + +Emitted signals +=============== + +- ``press`` - The panes has been pressed (button wasn't released yet). +- ``unpressed`` - The panes was released after being pressed. +- ``clicked`` - The panes has been clicked. +- ``clicked,double`` - The panes has been double clicked. + + +Layout content parts +==================== + +- ``left`` - A leftside content of the panes +- ``right`` - A rightside content of the panes +- ``top`` - A top content of the vertical panes +- ``bottom`` - A bottom content of the vertical panes + +If panes are displayed vertically, left content will be displayed on top. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Panes + :parts: 2 + + +.. autoclass:: efl.elementary.Panes diff --git a/doc/elementary/photo.rst b/doc/elementary/photo.rst index 936c88a..324eb31 100644 --- a/doc/elementary/photo.rst +++ b/doc/elementary/photo.rst @@ -1,2 +1,37 @@ +Photo +##### -.. automodule:: efl.elementary.photo +.. image:: /images/photo-preview.png + + +Widget description +================== + +An Elementary photo widget is intended for displaying a photo, for +ex., a person's image (contact). + +Simple, yet with a very specific purpose. It has a decorative frame +around the inner image itself, on the default theme. + +This widget relies on an internal :py:class:`~efl.elementary.icon.Icon`, so +that the APIs of these two widgets are similar (drag and drop is also possible +here, for example). + + +Emitted signals +=============== + +- ``clicked`` - This is called when a user has clicked the photo +- ``drag,start`` - One has started dragging the inner image out of the photo's + frame +- ``drag,end`` - One has dropped the dragged image somewhere + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Photo + :parts: 2 + + +.. autoclass:: efl.elementary.Photo diff --git a/doc/elementary/photocam.rst b/doc/elementary/photocam.rst index c38aebf..baef766 100644 --- a/doc/elementary/photocam.rst +++ b/doc/elementary/photocam.rst @@ -1,2 +1,93 @@ +Photocam +######## -.. automodule:: efl.elementary.photocam +Widget description +================== + +This is a widget specifically for displaying high-resolution digital +camera photos giving speedy feedback (fast load), low memory footprint +and zooming and panning as well as fitting logic. It is entirely focused +on jpeg images, and takes advantage of properties of the jpeg format (via +evas loader features in the jpeg loader). + + +Emitted signals +=============== + +- ``clicked`` - This is called when a user has clicked the photo without + dragging around. +- ``press`` - This is called when a user has pressed down on the photo. +- ``longpressed`` - This is called when a user has pressed down on the + photo for a long time without dragging around. +- ``clicked,double`` - This is called when a user has double-clicked the + photo. +- ``load`` - Photo load begins. +- ``loaded`` - This is called when the image file load is complete for + the first view (low resolution blurry version). +- ``load,detail`` - Photo detailed data load begins. +- ``loaded,detail`` - This is called when the image file load is + complete for the detailed image data (full resolution needed). +- ``zoom,start`` - Zoom animation started. +- ``zoom,stop`` - Zoom animation stopped. +- ``zoom,change`` - Zoom changed when using an auto zoom mode. +- ``scroll`` - the content has been scrolled (moved) +- ``scroll,anim,start`` - scrolling animation has started +- ``scroll,anim,stop`` - scrolling animation has stopped +- ``scroll,drag,start`` - dragging the contents around has started +- ``scroll,drag,stop`` - dragging the contents around has stopped +- ``download,start`` - remote url download has started +- ``download,progress`` - url download in progress +- ``download,end`` - remote url download has finished +- ``download,error`` - remote url download has finished with errors +- ``focused`` - When the photocam has received focus. (since 1.8) +- ``unfocused`` - When the photocam has lost focus. (since 1.8) + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scrolling behaviour using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.scroller.Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Enumerations +============ + +.. _Elm_Photocam_Zoom_Mode: + +Photocam zoom modes +------------------- + +.. data:: ELM_PHOTOCAM_ZOOM_MODE_MANUAL + + Zoom controlled normally by :py:attr:`~Photocam.zoom` + +.. data:: ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT + + Zoom until photo fits in photocam + +.. data:: ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL + + Zoom until photo fills photocam + +.. data:: ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN + + Zoom in until photo fits in photocam + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Photocam + :parts: 2 + + +.. autoclass:: efl.elementary.Photocam diff --git a/doc/elementary/plug.rst b/doc/elementary/plug.rst index 1c093a1..f7e4169 100644 --- a/doc/elementary/plug.rst +++ b/doc/elementary/plug.rst @@ -1,2 +1,36 @@ +Plug +#### -.. automodule:: efl.elementary.plug + +Widget Description +================== + +An object that allows one to show an image which other process created. +It can be used anywhere like any other elementary widget. + + +Emitted signals +=============== + +- ``clicked`` - the user clicked the image (press/release). +- ``image,deleted`` - the server side was deleted. +- ``image,resized`` - the server side was resized. The ``event_info`` parameter + of the callback will be ``Evas_Coord_Size`` (two integers). + +.. note:: + the event "image,resized" will be sent whenever the server + resized its image and this **always** happen on the first + time. Then it can be used to track when the server-side image + is fully known (client connected to server, retrieved its + image buffer through shared memory and resized the evas + object). + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Plug + :parts: 2 + + +.. autoclass:: efl.elementary.Plug diff --git a/doc/elementary/popup.rst b/doc/elementary/popup.rst index 9ce6823..e26bebf 100644 --- a/doc/elementary/popup.rst +++ b/doc/elementary/popup.rst @@ -1,2 +1,170 @@ +Popup +##### -.. automodule:: efl.elementary.popup +.. image:: /images/popup-preview.png + + +Widget description +================== + +This widget is an enhancement of :py:class:`~efl.elementary.notify.Notify`. +In addition to Content area, there are two optional sections namely Title +area and Action area. + +Popup Widget displays its content with a particular orientation in the +parent area. This orientation can be one among top, center, bottom, +left, top-left, top-right, bottom-left and bottom-right. Content part of +Popup can be an Evas Object set by application or it can be Text set by +application or set of items containing an icon and/or text. The +content/item-list can be removed using elm_object_content_set with second +parameter passed as None. + +Following figures shows the textual layouts of popup in which Title Area +and Action area area are optional ones. Action area can have up to 3 +buttons handled using elm_object common APIs mentioned below. If user +wants to have more than 3 buttons then these buttons can be put inside +the items of a list as content. User needs to handle the clicked signal +of these action buttons if required. No event is processed by the widget +automatically when clicked on these action buttons. + +Figure:: + + |---------------------| |---------------------| |---------------------| + | Title Area | | Title Area | | Title Area | + |Icon| Text | |Icon| Text | |Icon| Text | + |---------------------| |---------------------| |---------------------| + | Item 1 | | | | | + |---------------------| | | | | + | Item 2 | | | | Description | + |---------------------| | Content | | | + | Item 3 | | | | | + |---------------------| | | | | + | . | |---------------------| |---------------------| + | . | | Action Area | | Action Area | + | . | | Btn1 |Btn2|. |Btn3 | | Btn1 |Btn2| |Btn3 | + |---------------------| |---------------------| |---------------------| + | Item N | Content Based Layout Description based Layout + |---------------------| + | Action Area | + | Btn1 |Btn2|. |Btn3 | + |---------------------| + Item Based Layout + +Timeout can be set on expiry of which popup instance hides and sends a +smart signal "timeout" to the user. The visible region of popup is +surrounded by a translucent region called Blocked Event area. By +clicking on Blocked Event area, the signal "block,clicked" is sent to +the application. This block event area can be avoided by using API +elm_popup_allow_events_set. When gets hidden, popup does not get +destroyed automatically, application should destroy the popup instance +after use. To control the maximum height of the internal scroller for +item, we use the height of the action area which is passed by theme +based on the number of buttons currently set to popup. + + +Emitted signals +=============== + +- ``timeout`` - when ever popup is closed as a result of timeout. +- ``block,clicked`` - when ever user taps on Blocked Event area. +- ``focused`` - When the popup has received focus. (since 1.8) +- ``unfocused`` - When the popup has lost focus. (since 1.8) +- ``language,changed`` - the program's language changed (since 1.8) +- ``item,focused`` - the popup item has received focus. (since 1.10) +- ``item,unfocused`` - the popup item has lost focus. (since 1.10) + + +Layout content parts +==================== + +- ``default`` - The content of the popup +- ``title,icon`` - Title area's icon +- ``button1`` - 1st button of the action area +- ``button2`` - 2nd button of the action area +- ``button3`` - 3rd button of the action area +- ``default`` - Item's icon + + +Layout text parts +================= + +- ``title,text`` - This operates on Title area's label +- ``default`` - content-text set in the content area of the widget +- ``default`` - Item's label + + +Enumerations +============ + +.. _Elm_Popup_Orient: + +Popup orientation types +----------------------- + +.. data:: ELM_POPUP_ORIENT_TOP + + Popup should appear in the top of parent, default + +.. data:: ELM_POPUP_ORIENT_CENTER + + Popup should appear in the center of parent + +.. data:: ELM_POPUP_ORIENT_BOTTOM + + Popup should appear in the bottom of parent + +.. data:: ELM_POPUP_ORIENT_LEFT + + Popup should appear in the left of parent + +.. data:: ELM_POPUP_ORIENT_RIGHT + + Popup should appear in the right of parent + +.. data:: ELM_POPUP_ORIENT_TOP_LEFT + + Popup should appear in the top left of parent + +.. data:: ELM_POPUP_ORIENT_TOP_RIGHT + + Popup should appear in the top right of parent + +.. data:: ELM_POPUP_ORIENT_BOTTOM_LEFT + + Popup should appear in the bottom left of parent + +.. data:: ELM_POPUP_ORIENT_BOTTOM_RIGHT + + Popup should appear in the bottom right of parent + + +.. Elm_Wrap_Type: + +Wrap modes +---------- + +.. data:: ELM_WRAP_NONE + + No wrap + +.. data:: ELM_WRAP_CHAR + + Wrap between characters + +.. data:: ELM_WRAP_WORD + + Wrap in allowed wrapping points (as defined in the unicode standard) + +.. data:: ELM_WRAP_MIXED + + Word wrap, and if that fails, char wrap. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Popup + :parts: 2 + + +.. autoclass:: efl.elementary.Popup diff --git a/doc/elementary/progressbar.rst b/doc/elementary/progressbar.rst index 65bd832..9a446af 100644 --- a/doc/elementary/progressbar.rst +++ b/doc/elementary/progressbar.rst @@ -1,2 +1,66 @@ +Progressbar +########### -.. automodule:: efl.elementary.progressbar +.. image:: /images/progressbar-preview.png + + +Widget description +================== + +The progress bar is a widget for visually representing the progress +status of a given job/task. + +A progress bar may be horizontal or vertical. It may display an icon +besides it, as well as primary and **units** labels. The former is meant +to label the widget as a whole, while the latter, which is formatted +with floating point values (and thus accepts a ``printf``-style format +string, like ``"%1.2f units"``), is meant to label the widget's **progress +value**. Label, icon and unit strings/objects are **optional** for +progress bars. + +A progress bar may be **inverted**, in which case it gets its values +inverted, i.e., high values being on the left or top and low values on +the right or bottom, for horizontal and vertical modes respectively. + +The **span** of the progress, as set by :py:attr:`~Progressbar.span_size`, is +its length (horizontally or vertically), unless one puts size hints on the +widget to expand on desired directions, by any container. That length will be +scaled by the object or applications scaling factor. Applications can query the +progress bar for its value with :py:attr:`~Progressbar.value`. + +This widget emits the following signals, besides the ones sent from +:py:class:`~efl.elementary.layout_class.LayoutClass`: + +- ``changed`` - when the value is changed +- ``focused`` - When the progressbar has received focus. (since 1.8) +- ``unfocused`` - When the progressbar has lost focus. (since 1.8) + +This widget has the following styles: + +- ``default`` +- ``wheel`` (simple style, no text, no progression, only "pulse" + effect is available) +- ``double`` (style with two independent progress indicators) + +Default text parts of the progressbar widget that you can use for are: + +- ``default`` - Label of the progressbar + +Default content parts of the progressbar widget that you can use for are: + +- ``icon`` - An icon of the progressbar + +Default part names for the "recording" style: + +- ``elm.cur.progressbar`` - The "main" indicator bar +- ``elm.cur.progressbar1`` - The "secondary" indicator bar + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Progressbar + :parts: 2 + + +.. autoclass:: efl.elementary.Progressbar diff --git a/doc/elementary/radio.rst b/doc/elementary/radio.rst index 6fd95da..b6ac330 100644 --- a/doc/elementary/radio.rst +++ b/doc/elementary/radio.rst @@ -1,2 +1,61 @@ +Radio +##### -.. automodule:: efl.elementary.radio +.. image:: /images/radio-preview.png + + +Widget description +================== + +Radio is a widget that allows for one or more options to be displayed +and have the user choose only one of them. + +A radio object contains an indicator, an optional Label and an optional +icon object. While it's possible to have a group of only one radio they, +are normally used in groups of two or more. + +Radio objects are grouped in a slightly different, compared to other UI +toolkits. There is no separate group name/id to remember or manage. The +members represent the group, there are the group. To make a group, use +:py:meth:`Radio.group_add` and pass existing radio object and the new radio +object. + +The radio object(s) will select from one of a set of integer values, so +any value they are configuring needs to be mapped to a set of integers. +To configure what value that radio object represents, use +:py:attr:`~Radio.state_value` to set the integer it represents. The +value of the whole group (which one is currently selected) is +represented by the property :py:attr:`~Radio.value` on any group member. For +convenience the radio objects are also able to directly set an +integer(int) to the value that is selected. + + +Emitted signals +=============== + +- ``changed`` - This is called whenever the user changes the state of one of + the radio objects within the group of radio objects that work together. +- ``focused`` - When the radio has received focus. (since 1.8) +- ``unfocused`` - When the radio has lost focus. (since 1.8) + + +Layout text parts +================= + +- ``default`` - Label of the radio + + +Layout content parts +==================== + +- ``icon`` - An icon of the radio + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Radio + :parts: 2 + + +.. autoclass:: efl.elementary.Radio diff --git a/doc/elementary/scroller.rst b/doc/elementary/scroller.rst index 903c94d..3b06d18 100644 --- a/doc/elementary/scroller.rst +++ b/doc/elementary/scroller.rst @@ -1,2 +1,134 @@ +Scroller +######## -.. automodule:: efl.elementary.scroller +.. image:: /images/scroller-preview.png + + +Widget description +================== + +A scroller holds a single object and "scrolls it around". + +This means that it allows the user to use a scrollbar (or a finger) to +drag the viewable region around, allowing to move through a much larger +object that is contained in the scroller. The scroller will always have +a small minimum size by default as it won't be limited by the contents +of the scroller. + +This widget inherits from :py:class:`~efl.elementary.layout_class.LayoutClass`, +so that all the functions acting on it also work for scroller objects. + +.. note:: When Elementary is in embedded mode the scrollbars will not be + draggable, they appear merely as indicators of how much has been + scrolled. + +.. note:: When Elementary is in desktop mode the thumbscroll(a.k.a. + fingerscroll) won't work. + +Emitted signals +=============== + +- ``edge,left`` - the left edge of the content has been reached +- ``edge,right`` - the right edge of the content has been reached +- ``edge,top`` - the top edge of the content has been reached +- ``edge,bottom`` - the bottom edge of the content has been reached +- ``scroll`` - the content has been scrolled (moved) +- ``scroll,left`` - the content has been scrolled (moved) leftwards +- ``scroll,right`` - the content has been scrolled (moved) rightwards +- ``scroll,up`` - the content has been scrolled (moved) upwards +- ``scroll,down`` - the content has been scrolled (moved) downwards +- ``scroll,anim,start`` - scrolling animation has started +- ``scroll,anim,stop`` - scrolling animation has stopped +- ``scroll,drag,start`` - dragging the contents around has started +- ``scroll,drag,stop`` - dragging the contents around has stopped +- ``vbar,drag`` - the vertical scroll bar has been dragged +- ``vbar,press`` - the vertical scroll bar has been pressed +- ``vbar,unpress`` - the vertical scroll bar has been unpressed +- ``hbar,drag`` - the horizontal scroll bar has been dragged +- ``hbar,press`` - the horizontal scroll bar has been pressed +- ``hbar,unpress`` - the horizontal scroll bar has been unpressed +- ``scroll,page,changed`` - the visible page has changed +- ``focused`` - When the scroller has received focus. (since 1.8) +- ``unfocused`` - When the scroller has lost focus. (since 1.8) + +.. note:: The "scroll,anim,*" and "scroll,drag,*" signals are only emitted by + user intervention. + + +Layout content parts +==================== + +- ``default`` - A content of the scroller + + +Enumerations +============ + +.. _Elm_Scroller_Policy: + +Scrollbar visibility +-------------------- + +.. data:: ELM_SCROLLER_POLICY_AUTO + + Show scrollbars as needed + +.. data:: ELM_SCROLLER_POLICY_ON + + Always show scrollbars + +.. data:: ELM_SCROLLER_POLICY_OFF + + Never show scrollbars + + +.. _Elm_Scroller_Single_Direction: + +Single direction +---------------- + +Type that controls how the content is scrolled. + +.. data:: ELM_SCROLLER_SINGLE_DIRECTION_NONE + + Scroll every direction + +.. data:: ELM_SCROLLER_SINGLE_DIRECTION_SOFT + + Scroll single direction if the direction is certain + +.. data:: ELM_SCROLLER_SINGLE_DIRECTION_HARD + + Scroll only single direction + + +.. _Elm_Scroller_Movement_Block: + +Movement block +-------------- + +Type that blocks the scroll movement in one or more direction. + +:since: 1.8 + +.. data:: ELM_SCROLLER_MOVEMENT_NO_BLOCK + + Do not block movements + +.. data:: ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL + + Block vertical movements + +.. data:: ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL + + Block horizontal movements + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Scroller + :parts: 2 + + +.. autoclass:: efl.elementary.Scroller diff --git a/doc/elementary/segment_control.rst b/doc/elementary/segment_control.rst index 99f4224..7ce1851 100644 --- a/doc/elementary/segment_control.rst +++ b/doc/elementary/segment_control.rst @@ -1,2 +1,48 @@ +Segment Control +############### -.. automodule:: efl.elementary.segment_control +.. image:: /images/segmentcontrol-preview.png + + +Widget description +================== + +Segment control widget is a horizontal control made of multiple +segment items, each segment item functioning similar to discrete two +state button. A segment control groups the items together and provides +compact single button with multiple equal size segments. + +Segment item size is determined by base widget size and the number of +items added. Only one segment item can be at selected state. A segment +item can display combination of Text and any Evas_Object like Images or +other widget. + + +Emitted signals +=============== + +- ``changed`` - When the user clicks on a segment item which is not + previously selected and get selected. The event_info parameter is the + segment item. + + +Layout content parts +==================== + +- ``icon`` - An icon in a segment control item + + +Layout text parts +================= + +- ``default`` - Title label in a segment control item + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.SegmentControl + :parts: 2 + + +.. autoclass:: efl.elementary.SegmentControl diff --git a/doc/elementary/separator.rst b/doc/elementary/separator.rst index 73edfba..4aa0385 100644 --- a/doc/elementary/separator.rst +++ b/doc/elementary/separator.rst @@ -1,2 +1,22 @@ +Separator +######### -.. automodule:: efl.elementary.separator +.. image:: /images/separator-preview.png + + +Widget description +================== + +Separator is a very thin object used to separate other objects. + +A separator can be vertical or horizontal. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Separator + :parts: 2 + + +.. autoclass:: efl.elementary.Separator diff --git a/doc/elementary/slider.rst b/doc/elementary/slider.rst index 6319441..33845df 100644 --- a/doc/elementary/slider.rst +++ b/doc/elementary/slider.rst @@ -1,2 +1,68 @@ +Slider +###### -.. automodule:: efl.elementary.slider +.. image:: /images/slider-preview.png + + +Widget description +================== + +The slider adds a draggable "slider" widget for selecting the value of +something within a range. + +A slider can be horizontal or vertical. It can contain an Icon and has a +primary label as well as a units label (that is formatted with floating +point values and thus accepts a printf-style format string, like +``"%1.2f units"``. There is also an indicator string that may be somewhere +else (like on the slider itself) that also accepts a format string like +units. Label, Icon Unit and Indicator strings/objects are optional. + +A slider may be inverted which means values invert, with high vales being +on the left or top and low values on the right or bottom (as opposed to +normally being low on the left or top and high on the bottom and right). + +The slider should have its minimum and maximum values set by the +application with :py:attr:`Slider.min_max` and value should also be set by +the application before use with :py:attr:`Slider.value`. The span of the +slider is its length (horizontally or vertically). This will be scaled by +the object or applications scaling factor. At any point code can query the +slider for its value with :py:attr:`Slider.value`. + + +Emitted signals +=============== + +- ``changed`` - Whenever the slider value is changed by the user. +- ``slider,drag,start`` - dragging the slider indicator around has + started. +- ``slider,drag,stop`` - dragging the slider indicator around has + stopped. +- ``delay,changed`` - A short time after the value is changed by + the user. This will be called only when the user stops dragging + for a very short period or when they release their finger/mouse, + so it avoids possibly expensive reactions to the value change. +- ``focused`` - When the slider has received focus. (since 1.8) +- ``unfocused`` - When the slider has lost focus. (since 1.8) + + +Layout content parts +==================== + +- ``icon`` - An icon of the slider +- ``end`` - A end part content of the slider + + +Layout text parts +================= + +- ``default`` - Label of the slider + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Slider + :parts: 2 + + +.. autoclass:: efl.elementary.Slider diff --git a/doc/elementary/slideshow.rst b/doc/elementary/slideshow.rst index 9e3c5d6..3916fc1 100644 --- a/doc/elementary/slideshow.rst +++ b/doc/elementary/slideshow.rst @@ -1,2 +1,72 @@ +Slideshow +######### -.. automodule:: efl.elementary.slideshow +.. image:: /images/slideshow-preview.png + + +Widget description +================== + +This widget, as the name indicates, is a pre-made image +slideshow panel, with API functions acting on (child) image +items presentation. Between those actions, are: + +- advance to next/previous image +- select the style of image transition animation +- set the exhibition time for each image +- start/stop the slideshow + +The transition animations are defined in the widget's theme, +consequently new animations can be added without having to +update the widget's code. + +Slideshow items +=============== + +For slideshow items, just like for :py:class:`~efl.elementary.genlist.Genlist` +ones, the user defines a **classes**, specifying functions that will be called +on the item's creation and deletion times. + +The :py:class:`SlideshowItemClass` class contains the following +members: + +- ``get`` - When an item is displayed, this function is + called, and it's where one should create the item object, de + facto. For example, the object can be a pure Evas image object + or a :py:class:`~efl.elementary.photocam.Photocam` widget. + +- ``delete`` - When an item is no more displayed, this function + is called, where the user must delete any data associated to + the item. + +Slideshow caching +================= + +The slideshow provides facilities to have items adjacent to the +one being displayed **already "realized"** (i.e. loaded) for +you, so that the system does not have to decode image data +anymore at the time it has to actually switch images on its +viewport. The user is able to set the numbers of items to be +cached **before** and **after** the current item, in the widget's +item list. + + +Emitted signals +=============== + +- ``changed`` - when the slideshow switches its view to a new item. + event_info parameter in callback contains the current visible item +- ``transition,end`` - when a slide transition ends. event_info + parameter in callback contains the current visible item +- ``focused`` - When the slideshow has received focus. (since 1.8) +- ``unfocused`` - When the slideshow has lost focus. (since 1.8) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Slideshow + :parts: 2 + + +.. autoclass:: efl.elementary.Slideshow diff --git a/doc/elementary/spinner.rst b/doc/elementary/spinner.rst index 37a41a7..665bead 100644 --- a/doc/elementary/spinner.rst +++ b/doc/elementary/spinner.rst @@ -1,2 +1,51 @@ +Spinner +####### -.. automodule:: efl.elementary.spinner +.. image:: /images/spinner-preview.png + + +Widget description +================== + +A spinner is a widget which allows the user to increase or decrease +numeric values using arrow buttons, or edit values directly, clicking +over it and typing the new value. + +By default the spinner will not wrap and has a label +of ``"%.0f"`` (just showing the integer value of the double). + +A spinner has a label that is formatted with floating +point values and thus accepts a printf-style format string, like +``"%1.2f units"``. + +It also allows specific values to be replaced by pre-defined labels. + + +Emitted signals +=============== + +- ``changed`` - Whenever the spinner value is changed. +- ``delay,changed`` - A short time after the value is changed by + the user. This will be called only when the user stops dragging + for a very short period or when they release their finger/mouse, + so it avoids possibly expensive reactions to the value change. +- ``language,changed`` - the program's language changed +- ``focused`` - When the spinner has received focus. (since 1.8) +- ``unfocused`` - When the spinner has lost focus. (since 1.8) + + +Available styles +================ + +- ``default``: Default style +- ``vertical``: up/down buttons at the right side and text left aligned. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Spinner + :parts: 2 + + +.. autoclass:: efl.elementary.Spinner diff --git a/doc/elementary/systray.rst b/doc/elementary/systray.rst index d0972b1..4f5a377 100644 --- a/doc/elementary/systray.rst +++ b/doc/elementary/systray.rst @@ -1,2 +1,52 @@ +Systray +####### -.. automodule:: efl.elementary.systray +Enumerations +============ + +.. _Elm_Systray_Category: + +Category of the Status Notifier Item. +------------------------------------- + +.. data:: ELM_SYSTRAY_CATEGORY_APP_STATUS + + Indicators of application status + +.. data:: ELM_SYSTRAY_CATEGORY_COMMUNICATIONS + + Communications apps + +.. data:: ELM_SYSTRAY_CATEGORY_SYS_SERVICES + + System Service apps + +.. data:: ELM_SYSTRAY_CATEGORY_HARDWARE + + Hardware indicators + +.. data:: ELM_SYSTRAY_CATEGORY_OTHER + + Undefined category + + +.. _Elm_Systray_Status: + +Application status information. +------------------------------- + +.. data:: ELM_SYSTRAY_STATUS_PASSIVE + + Passive (normal) + +.. data:: ELM_SYSTRAY_STATUS_ACTIVE + + Active + +.. data:: ELM_SYSTRAY_STATUS_ATTENTION + + Needs Attention + + + +.. autoclass:: efl.elementary.Systray diff --git a/doc/elementary/table.rst b/doc/elementary/table.rst index 9948f3e..85233e7 100644 --- a/doc/elementary/table.rst +++ b/doc/elementary/table.rst @@ -1,2 +1,34 @@ +Table +##### -.. automodule:: efl.elementary.table +.. image:: /images/table-preview.png + + +Widget description +================== + +A container widget to arrange other widgets in a table where items can +span multiple columns or rows - even overlap (and then be raised or +lowered accordingly to adjust stacking if they do overlap). + +The row and column count is not fixed. The table widget adjusts itself +when subobjects are added to it dynamically. + +The most common way to use a table is:: + + table = Table(win) + table.show() + table.padding = (space_between_columns, space_between_rows) + table.pack(table_content_object, x_coord, y_coord, colspan, rowspan) + table.pack(table_content_object, x_coord, y_coord, colspan, rowspan) + table.pack(table_content_object, x_coord, y_coord, colspan, rowspan) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Table + :parts: 2 + + +.. autoclass:: efl.elementary.Table diff --git a/doc/elementary/theme.rst b/doc/elementary/theme.rst index b79be2f..0e73b27 100644 --- a/doc/elementary/theme.rst +++ b/doc/elementary/theme.rst @@ -1,2 +1,79 @@ +Theme +##### -.. automodule:: efl.elementary.theme + +Description +=========== + +Elementary uses Edje to theme its widgets, naturally. But for the most +part this is hidden behind a simpler interface that lets the user set +extensions and choose the style of widgets in a much easier way. + +Instead of thinking in terms of paths to Edje files and their groups +each time you want to change the appearance of a widget, Elementary +works so you can add any theme file with extensions or replace the +main theme at one point in the application, and then just set the style +of widgets with +:py:attr:`Object.style` +and related functions. Elementary +will then look in its list of themes for a matching group and apply it, +and when the theme changes midway through the application, all widgets +will be updated accordingly. + +There are three concepts you need to know to understand how Elementary +theming works: default theme, extensions and overlays. + +Default theme, obviously enough, is the one that provides the default +look of all widgets. End users can change the theme used by Elementary +by setting the ``ELM_THEME`` environment variable before running an +application, or globally for all programs using the ``elementary_config`` +utility. Applications can change the default theme using :py:attr:`Theme.order`, +but this can go against the user wishes, so it's not an advised practice. + +Ideally, applications should find everything they need in the already +provided theme, but there may be occasions when that's not enough and +custom styles are required to correctly express the idea. For this +cases, Elementary has extensions. + +Extensions allow the application developer to write styles of its own +to apply to some widgets. This requires knowledge of how each widget +is themed, as extensions will always replace the entire group used by +the widget, so important signals and parts need to be there for the +object to behave properly (see documentation of Edje for details). +Once the theme for the extension is done, the application needs to add +it to the list of themes Elementary will look into, using +:py:func:`Theme.extension_add()`, and set the style of the desired widgets as +he would normally with +:py:attr:`Object.style`. + +Overlays, on the other hand, can replace the look of all widgets by +overriding the default style. Like extensions, it's up to the application +developer to write the theme for the widgets it wants, the difference +being that when looking for the theme, Elementary will check first the +list of overlays, then the set theme and lastly the list of extensions, +so with overlays it's possible to replace the default view and every +widget will be affected. This is very much alike to setting the whole +theme for the application and will probably clash with the end user +options, not to mention the risk of ending up with not matching styles +across the program. Unless there's a very special reason to use them, +overlays should be avoided for the reasons exposed before. + +All these theme lists are handled by :py:class:`Theme` instances. Elementary +keeps one default internally. It's possible to create a new instance of a +:py:class:`Theme` to set other theme for a specific widget (and all of its +children), but this is as discouraged, if not even more so, than using +overlays. Don't use this unless you really know what you are doing. + +.. note:: + + Remember to :py:func:`Theme.free` the instance when you're done with it! + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Theme + :parts: 2 + + +.. autoclass:: efl.elementary.Theme diff --git a/doc/elementary/thumb.rst b/doc/elementary/thumb.rst index af2e664..24b8393 100644 --- a/doc/elementary/thumb.rst +++ b/doc/elementary/thumb.rst @@ -1,2 +1,170 @@ +Thumb +##### -.. automodule:: efl.elementary.thumb +.. image:: /images/thumb-preview.png + + +Widget description +================== + +A thumbnail object is used for displaying the thumbnail of an image +or video. You must have compiled Elementary with ``Ethumb_Client`` +support. Also, Ethumb's DBus service must be present and +auto-activated in order to have thumbnails generated. You must also +have a **session** bus, not a **system** one. + +Once the thumbnail object becomes visible, it will check if there +is a previously generated thumbnail image for the file set on +it. If not, it will start generating this thumbnail. + +Different configuration settings will cause different thumbnails to +be generated even on the same file. + +Generated thumbnails are stored under ``$HOME/.thumbnails/``. Check +Ethumb's documentation to change this path, and to see other +configuration options. + + +Emitted signals +=============== + +- ``clicked`` - This is called when a user has clicked the + thumbnail object without dragging it around. +- ``clicked,double`` - This is called when a user has double-clicked + the thumbnail object. +- ``press`` - This is called when a user has pressed down over the + thumbnail object. +- ``generate,start`` - The thumbnail generation has started. +- ``generate,stop`` - The generation process has stopped. +- ``generate,error`` - The thumbnail generation failed. +- ``load,error`` - The thumbnail image loading failed. + + +Available styles +================ + +- ``default`` +- ``noframe`` + + +Enumerations +============ + +.. _Elm_Thumb_Animation_Setting: + +Thumb animation mode +-------------------- + +.. data:: ELM_THUMB_ANIMATION_START + + Play animation once + +.. data:: ELM_THUMB_ANIMATION_LOOP + + Keep playing animation until stop is requested + +.. data:: ELM_THUMB_ANIMATION_STOP + + Stop playing the animation + + +.. _Ethumb_Thumb_FDO_Size: + +Thumb FDO size +-------------- + +.. data:: ETHUMB_THUMB_NORMAL + + 128x128 as defined by FreeDesktop.Org standard + +.. data:: ETHUMB_THUMB_LARGE + + 256x256 as defined by FreeDesktop.Org standard + + +.. _Ethumb_Thumb_Format: + +Thumb format +------------ + +.. data:: ETHUMB_THUMB_FDO + + PNG as defined by FreeDesktop.Org standard + +.. data:: ETHUMB_THUMB_JPEG + + JPEGs are often smaller and faster to read/write + +.. data:: ETHUMB_THUMB_EET + + EFL's own storage system, supports key parameter + + +.. _Ethumb_Thumb_Aspect: + +Thumb aspect +------------ + +.. data:: ETHUMB_THUMB_KEEP_ASPECT + + keep original proportion between width and height + +.. data:: ETHUMB_THUMB_IGNORE_ASPECT + + ignore aspect and foce it to match thumbnail's width and height + +.. data:: ETHUMB_THUMB_CROP + + keep aspect but crop (cut) the largest dimension + + +.. _Ethumb_Thumb_Orientation: + +Thumb orientation +----------------- + +.. data:: ETHUMB_THUMB_ORIENT_NONE + + keep orientation as pixel data is + +.. data:: ETHUMB_THUMB_ROTATE_90_CW + + rotate 90° clockwise + +.. data:: ETHUMB_THUMB_ROTATE_180 + + rotate 180° + +.. data:: ETHUMB_THUMB_ROTATE_90_CCW + + rotate 90° counter-clockwise + +.. data:: ETHUMB_THUMB_FLIP_HORIZONTAL + + flip horizontally + +.. data:: ETHUMB_THUMB_FLIP_VERTICAL + + flip vertically + +.. data:: ETHUMB_THUMB_FLIP_TRANSPOSE + + transpose + +.. data:: ETHUMB_THUMB_FLIP_TRANSVERSE + + transverse + +.. data:: ETHUMB_THUMB_ORIENT_ORIGINAL + + use orientation from metadata (EXIF-only currently) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Thumb + :parts: 2 + + +.. autoclass:: efl.elementary.Thumb diff --git a/doc/elementary/toolbar.rst b/doc/elementary/toolbar.rst index 4943239..087a6fc 100644 --- a/doc/elementary/toolbar.rst +++ b/doc/elementary/toolbar.rst @@ -1,2 +1,167 @@ +Toolbar +####### -.. automodule:: efl.elementary.toolbar +.. image:: /images/toolbar-preview.png + + +Widget description +================== + +A toolbar is a widget that displays a list of items inside a box. It +can be scrollable, show a menu with items that don't fit to toolbar size +or even crop them. + +Only one item can be selected at a time. + +Items can have multiple states, or show menus when selected by the user. + + +Emitted signals +=============== + +- ``clicked`` - when the user clicks on a toolbar item and becomes selected. +- ``longpressed`` - when the toolbar is pressed for a certain amount of time. +- ``language,changed`` - when the program language changes. +- ``focused`` - When the toolbar has received focus. (since 1.8) +- ``unfocused`` - When the toolbar has lost focus. (since 1.8) +- ``item,focused`` - When the toolbar item has received focus. (since 1.10) +- ``item,unfocused`` - When the toolbar item has lost focus. (since 1.10) + + +Available styles +================ + +- ``default`` +- ``transparent`` - no background or shadow, just show the content + + +Layout text parts +================= + +- ``default`` - label of the toolbar item + + +Scrollable Interface +==================== + +This widget supports the scrollable interface. + +If you wish to control the scrolling behaviour using these functions, +inherit both the widget class and the +:py:class:`~efl.elementary.scroller.Scrollable` class +using multiple inheritance, for example:: + + class ScrollableGenlist(Genlist, Scrollable): + def __init__(self, canvas, *args, **kwargs): + Genlist.__init__(self, canvas) + + +Enumerations +============ + +.. _Elm_Toolbar_Icon_Lookup_Order: + +Icon lookup modes +----------------- + +.. data:: ELM_ICON_LOOKUP_FDO_THEME + + freedesktop, theme + +.. data:: ELM_ICON_LOOKUP_THEME_FDO + + theme, freedesktop + +.. data:: ELM_ICON_LOOKUP_FDO + + freedesktop + +.. data:: ELM_ICON_LOOKUP_THEME + + theme + + +.. _Elm_Toolbar_Object_Select_Mode: + +Selection modes +--------------- + +.. data:: ELM_OBJECT_SELECT_MODE_DEFAULT + + Default select mode + +.. data:: ELM_OBJECT_SELECT_MODE_ALWAYS + + Always select mode + +.. data:: ELM_OBJECT_SELECT_MODE_NONE + + No select mode + +.. data:: ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY + + No select mode with no finger size rule + + +.. _Elm_Toolbar_Shrink_Mode: + +Toolbar shrink modes +-------------------- + +.. data:: ELM_TOOLBAR_SHRINK_NONE + + Set toolbar minimum size to fit all the items + +.. data:: ELM_TOOLBAR_SHRINK_HIDE + + Hide exceeding items + +.. data:: ELM_TOOLBAR_SHRINK_SCROLL + + Allow accessing exceeding items through a scroller + +.. data:: ELM_TOOLBAR_SHRINK_MENU + + Inserts a button to pop up a menu with exceeding items + +.. data:: ELM_TOOLBAR_SHRINK_EXPAND + + Expand all items according the size of the toolbar. + + +.. _Elm_Toolbar_Item_Scrollto_Type: + +Toolbar item scrollto types +--------------------------- + +Where to position the item in the toolbar. + +.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_NONE + + No scrollto + +.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_IN + + To the nearest viewport + +.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_FIRST + + To the first of viewport + +.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE + + To the middle of viewport + +.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_LAST + + To the last of viewport + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Toolbar + :parts: 2 + + +.. autoclass:: efl.elementary.Toolbar diff --git a/doc/elementary/transit.rst b/doc/elementary/transit.rst index 5782be7..785609b 100644 --- a/doc/elementary/transit.rst +++ b/doc/elementary/transit.rst @@ -1,2 +1,164 @@ +Transit +####### -.. automodule:: efl.elementary.transit + +Widget description +================== + +Transit is designed to apply various animated transition effects to +``Evas_Object``, such like translation, rotation, etc. For using these +effects, create a :py:class:`Transit` and add the desired transition effects. + +Once the effects are added into transit, they will be automatically managed +(their callback will be called for the set duration and they will be deleted +upon completion). + +Example:: + + from efl.elementary.transit import Transit, ELM_TRANSIT_TWEEN_MODE_DECELERATE + + t = Transit() + t.object_add(obj) + t.effect_translation_add(0, 0, 280, 280) + t.duration = 1 + t.auto_reverse = True + t.tween_mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE + t.repeat_times = 3 + +Some transition effects are used to change the properties of objects. They +are: + +- :py:func:`~Transit.effect_translation_add` +- :py:func:`~Transit.effect_color_add` +- :py:func:`~Transit.effect_rotation_add` +- :py:func:`~Transit.effect_wipe_add` +- :py:func:`~Transit.effect_zoom_add` +- :py:func:`~Transit.effect_resizing_add` + +Other transition effects are used to make one object disappear and another +object appear on its place. These effects are: + +- :py:func:`~Transit.effect_flip_add` +- :py:func:`~Transit.effect_resizable_flip_add` +- :py:func:`~Transit.effect_fade_add` +- :py:func:`~Transit.effect_blend_add` + +It's also possible to make a transition chain with +:py:func:`~Transit.chain_transit_add`. + +.. warning:: We strongly recommend to use elm_transit just when edje can + not do the trick. Edje is better at handling transitions than + Elm_Transit. Edje has more flexibility and animations can be + manipulated inside the theme. + + +Enumerations +============ + +.. _Elm_Transit_Effect_Flip_Axis: + +Flip effects +------------ + +.. data:: ELM_TRANSIT_EFFECT_FLIP_AXIS_X + + Flip on X axis + +.. data:: ELM_TRANSIT_EFFECT_FLIP_AXIS_Y + + Flip on Y axis + + +.. _Elm_Transit_Effect_Wipe_Dir: + +Wipe effects +------------ + +.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_LEFT + + Wipe to the left + +.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT + + Wipe to the right + +.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_UP + + Wipe up + +.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_DOWN + + Wipe down + + +.. _Elm_Transit_Effect_Wipe_Type: + +Wipe types +---------- + +.. data:: ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE + + Hide the object during the animation. + +.. data:: ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW + + Show the object during the animation. + + +.. _Elm_Transit_Tween_Mode: + +Tween modes +----------- + +.. data:: ELM_TRANSIT_TWEEN_MODE_LINEAR + + Constant speed + +.. data:: ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL + + Starts slow, increase speed over time, then decrease again and stop slowly + +.. data:: ELM_TRANSIT_TWEEN_MODE_DECELERATE + + Starts fast and decrease speed over time + +.. data:: ELM_TRANSIT_TWEEN_MODE_ACCELERATE + + Starts slow and increase speed over time + +.. data:: ELM_TRANSIT_TWEEN_MODE_DIVISOR_INTERP + + Start at gradient v1, interpolated via power of v2 curve + + .. versionadded:: 1.13 + +.. data:: ELM_TRANSIT_TWEEN_MODE_BOUNCE + + Start at 0.0 then "drop" like a ball bouncing to the ground at 1.0, and + bounce v2 times, with decay factor of v1 + + .. versionadded:: 1.13 + +.. data:: ELM_TRANSIT_TWEEN_MODE_SPRING + + Start at 0.0 then "wobble" like a spring rest position 1.0, and wobble + v2 times, with decay factor of v1 + + .. versionadded:: 1.13 + +.. data:: ELM_TRANSIT_TWEEN_MODE_BEZIER_CURVE + + Follow the cubic-bezier curve calculated with the control points (x1, + y1), (x2, y2) + + .. versionadded:: 1.13 + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Transit + :parts: 2 + + +.. autoclass:: efl.elementary.Transit diff --git a/doc/elementary/video.rst b/doc/elementary/video.rst index 514e25b..83bb901 100644 --- a/doc/elementary/video.rst +++ b/doc/elementary/video.rst @@ -1,2 +1,28 @@ +Video +##### -.. automodule:: efl.elementary.video + +Widget description +================== + +Display a video by using Emotion. + +It embeds the video inside an Edje object, so you can do some +animation depending on the video state change. It also implements a +resource management policy to remove this burden from the application. + +These widgets emit the following signals, besides the ones sent from +:py:class:`~efl.elementary.layout_class.LayoutClass`: + +- ``focused`` - When the widget has received focus. (since 1.8) +- ``unfocused`` - When the widget has lost focus. (since 1.8) + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Video + :parts: 2 + + +.. autoclass:: efl.elementary.Video diff --git a/doc/elementary/web.rst b/doc/elementary/web.rst index 70b0f7d..4688da6 100644 --- a/doc/elementary/web.rst +++ b/doc/elementary/web.rst @@ -1,2 +1,139 @@ +Web +### -.. automodule:: efl.elementary.web + +Widget description +================== + +A web widget is used for displaying web pages (HTML/CSS/JS) +using WebKit-EFL. You must have compiled Elementary with +ewebkit support. + + +Emitted signals +=============== + +- ``download,request``: A file download has been requested. Event info is + a WebDownload instance +- ``editorclient,contents,changed``: Editor client's contents changed +- ``editorclient,selection,changed``: Editor client's selection changed +- ``frame,created``: A new frame was created. Event info is an + Evas_Object which can be handled with WebKit's ewk_frame API +- ``icon,received``: An icon was received by the main frame +- ``inputmethod,changed``: Input method changed. Event info is an + Eina_Bool indicating whether it's enabled or not +- ``js,windowobject,clear``: JS window object has been cleared +- ``link,hover,in``: Mouse cursor is hovering over a link. Event info + is a tuple, where the first string contains the URL the link + points to, and the second one the title of the link +- ``link,hover,out``: Mouse cursor left the link +- ``load,document,finished``: Loading of a document finished. Event info + is the frame that finished loading +- ``load,error``: Load failed. Event info is a WebFrameLoadError instance +- ``load,finished``: Load finished. Event info is None on success, on + error it's a WebFrameLoadError instance +- ``load,newwindow,show``: A new window was created and is ready to be + shown +- ``load,progress``: Overall load progress. Event info is + a double containing a value between 0.0 and 1.0 +- ``load,provisional``: Started provisional load +- ``load,started``: Loading of a document started +- ``menubar,visible,get``: Queries if the menubar is visible. Event info + is a bool where the callback should set True if + the menubar is visible, or False in case it's not +- ``menubar,visible,set``: Informs menubar visibility. Event info is + a bool indicating the visibility +- ``popup,created``: A dropdown widget was activated, requesting its + popup menu to be created. Event info is a WebMenu instance +- ``popup,willdelete``: The web object is ready to destroy the popup + object created. Event info is a WebMenu instance +- ``ready``: Page is fully loaded +- ``scrollbars,visible,get``: Queries visibility of scrollbars. Event + info is a bool where the visibility state should be set +- ``scrollbars,visible,set``: Informs scrollbars visibility. Event info + is an Eina_Bool with the visibility state set +- ``statusbar,text,set``: Text of the statusbar changed. Event info is + a string with the new text +- ``statusbar,visible,get``: Queries visibility of the status bar. + Event info is a bool where the visibility state should be + set. +- ``statusbar,visible,set``: Informs statusbar visibility. Event info is + an Eina_Bool with the visibility value +- ``title,changed``: Title of the main frame changed. Event info is a + string with the new title +- ``toolbars,visible,get``: Queries visibility of toolbars. Event info + is a bool where the visibility state should be set +- ``toolbars,visible,set``: Informs the visibility of toolbars. Event + info is an Eina_Bool with the visibility state +- ``tooltip,text,set``: Show and set text of a tooltip. Event info is + a string with the text to show +- ``uri,changed``: URI of the main frame changed. Event info is a string (deprecated. use ``url,changed`` instead) +- ``url,changed``: URL of the main frame changed. Event info is a string + with the new URI +- ``view,resized``: The web object internal's view changed sized +- ``windows,close,request``: A JavaScript request to close the current + window was requested +- ``zoom,animated,end``: Animated zoom finished +- ``focused`` : When the web has received focus. (since 1.8) +- ``unfocused`` : When the web has lost focus. (since 1.8) + + +Enumerations +============ + +.. _Elm_Web_Window_Feature: + +Web window features +------------------- + +.. data:: ELM_WEB_WINDOW_FEATURE_TOOLBAR + + Toolbar + +.. data:: ELM_WEB_WINDOW_FEATURE_STATUSBAR + + Status bar + +.. data:: ELM_WEB_WINDOW_FEATURE_SCROLLBARS + + Scrollbars + +.. data:: ELM_WEB_WINDOW_FEATURE_MENUBAR + + Menu bar + +.. data:: ELM_WEB_WINDOW_FEATURE_LOCATIONBAR + + Location bar + +.. data:: ELM_WEB_WINDOW_FEATURE_FULLSCREEN + + Fullscreen + + +.. _Elm_Web_Zoom_Mode: + +Web zoom modes +-------------- + +.. data:: ELM_WEB_ZOOM_MODE_MANUAL + + Zoom controlled normally by :py:attr:`~Web.zoom` + +.. data:: ELM_WEB_ZOOM_MODE_AUTO_FIT + + Zoom until content fits in web object. + +.. data:: ELM_WEB_ZOOM_MODE_AUTO_FILL + + Zoom until content fills web object. + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Web + :parts: 2 + + +.. autoclass:: efl.elementary.Web diff --git a/doc/elementary/window.rst b/doc/elementary/window.rst index 590baba..db5b2dd 100644 --- a/doc/elementary/window.rst +++ b/doc/elementary/window.rst @@ -1,2 +1,354 @@ +Window +###### -.. automodule:: efl.elementary.window +Widget description +================== + +The window class of Elementary. + +Contains functions to manipulate windows. The Evas engine used to render +the window contents is specified in the system or user elementary config +files (whichever is found last), and can be overridden with the +ELM_ENGINE environment variable for testing. Engines that may be +supported (depending on Evas and Ecore-Evas compilation setup and +modules actually installed at runtime) are (listed in order of best +supported and most likely to be complete and work to lowest quality). + +Note that ELM_ENGINE is really only needed for special cases and debugging. +you should normally use ELM_DISPLAY and ELM_ACCEL environment variables, or +core elementary config. ELM_DISPLAY can be set to "x11" or "wl" to indicate +the target display system (as on Linux systems you may have both display +systems available, so this selects which to use). ELM_ACCEL may also be set +to indicate if you want accelerations and which kind to use. see +:py:attr:`~efl.elementary.configuration.Configuration.accel_preference` for +details on this environment variable values. + +``x11``, ``x``, ``software-x11``, ``software_x11`` + Software rendering in X11 +``gl``, ``opengl``, ``opengl-x11``, ``opengl_x11`` + OpenGL or OpenGL-ES2 rendering in X11 +``shot:...`` + Virtual screenshot renderer - renders to output file and exits +``fb``, ``software-fb``, ``software_fb`` + Linux framebuffer direct software rendering +``sdl``, ``software-sdl``, ``software_sdl`` + SDL software rendering to SDL buffer +``gl-sdl``, ``gl_sdl``, ``opengl-sdl``, ``opengl_sdl`` + OpenGL or OpenGL-ES2 using SDL +``gdi``, ``software-gdi``, ``software_gdi`` + Windows WIN32 rendering via GDI with software +``ews`` + rendering to EWS (Ecore + Evas Single Process Windowing System) +``gl-cocoa``, ``gl_cocoa``, ``opengl-cocoa``, ``opengl_cocoa`` + OpenGL rendering in Cocoa +``wayland_shm`` + Wayland client SHM rendering +``wayland_egl`` + Wayland client OpenGL/EGL rendering +``drm`` + Linux drm/kms etc. direct display + +All engines use a simple string to select the engine to render, EXCEPT +the "shot" engine. This actually encodes the output of the virtual +screenshot and how long to delay in the engine string. The engine string +is encoded in the following way:: + + "shot:[delay=XX][:][repeat=DDD][:][file=XX]" + +Where options are separated by a ``:`` char if more than one option is +given, with delay, if provided being the first option and file the last +(order is important). The delay specifies how long to wait after the +window is shown before doing the virtual "in memory" rendering and then +save the output to the file specified by the file option (and then exit). +If no delay is given, the default is 0.5 seconds. If no file is given the +default output file is "out.png". Repeat option is for continuous +capturing screenshots. Repeat range is from 1 to 999 and filename is +fixed to "out001.png" Some examples of using the shot engine:: + + ELM_ENGINE="shot:delay=1.0:repeat=5:file=elm_test.png" elementary_test + ELM_ENGINE="shot:delay=1.0:file=elm_test.png" elementary_test + ELM_ENGINE="shot:file=elm_test2.png" elementary_test + ELM_ENGINE="shot:delay=2.0" elementary_test + ELM_ENGINE="shot:" elementary_test + + +Emitted signals +=============== + +- ``delete,request``: the user requested to close the window. See + :py:attr:`~Window.autodel`. +- ``focus,in``: window got focus +- ``focus,out``: window lost focus +- ``moved``: window that holds the canvas was moved +- ``withdrawn``: window is still managed normally but removed from view +- ``iconified``: window is minimized (perhaps into an icon or taskbar) +- ``normal``: window is in a normal state (not withdrawn or iconified) +- ``stick``: window has become sticky (shows on all desktops) +- ``unstick``: window has stopped being sticky +- ``fullscreen``: window has become fullscreen +- ``unfullscreen``: window has stopped being fullscreen +- ``maximized``: window has been maximized +- ``unmaximized``: window has stopped being maximized +- ``ioerr``: there has been a low-level I/O error with the display system +- ``indicator,prop,changed``: an indicator's property has been changed +- ``rotation,changed``: window rotation has been changed +- ``profile,changed``: profile of the window has been changed +- ``focused`` - When the window has received focus. (since 1.8) +- ``unfocused`` - When the window has lost focus. (since 1.8) +- ``theme,changed`` - The theme was changed. (since 1.13) + + +Enumerations +============ + +.. _Elm_Win_Type: + +Window types +------------ + +.. data:: ELM_WIN_UNKNOWN + + Unknown window type (since 1.9) + +.. data:: ELM_WIN_BASIC + + A normal window. + + Indicates a normal, top-level window. Almost every window will be + created with this type. + +.. data:: ELM_WIN_DIALOG_BASIC + + Used for simple dialog windows + +.. data:: ELM_WIN_DESKTOP + + For special desktop windows, like a background window holding desktop icons. + +.. data:: ELM_WIN_DOCK + + The window is used as a dock or panel. + + Usually would be kept on top of any other window by the Window Manager. + +.. data:: ELM_WIN_TOOLBAR + + The window is used to hold a floating toolbar, or similar. + +.. data:: ELM_WIN_MENU + + Similar to ELM_WIN_TOOLBAR. + +.. data:: ELM_WIN_UTILITY + + A persistent utility window, like a toolbox or palette. + +.. data:: ELM_WIN_SPLASH + + Splash window for a starting up application. + +.. data:: ELM_WIN_DROPDOWN_MENU + + The window is a dropdown menu, as when an entry in a menubar is clicked. + + Typically used with :py:attr:`~Window.override`. This hint exists for + completion only, as the EFL way of implementing a menu would not + normally use a separate window for its contents. + +.. data:: ELM_WIN_POPUP_MENU + + Like ELM_WIN_DROPDOWN_MENU, but for the menu triggered by right-clicking + an object. + +.. data:: ELM_WIN_TOOLTIP + + The window is a tooltip. + + A short piece of explanatory text that typically appear after the mouse + cursor hovers over an object for a while. Typically used with + :py:attr:`~Window.override` and also not very commonly used in the EFL. + +.. data:: ELM_WIN_NOTIFICATION + + A notification window, like a warning about battery life or a new E-Mail + received. + +.. data:: ELM_WIN_COMBO + + A window holding the contents of a combo box. + + Not usually used in the EFL. + +.. data:: ELM_WIN_DND + + Used to indicate the window is a representation of an object being + dragged across different windows, or even applications. + + Typically used with :py:attr:`~Window.override`. + +.. data:: ELM_WIN_INLINED_IMAGE + + The window is rendered onto an image buffer. + + No actual window is created for this type, instead the window and all of + its contents will be rendered to an image buffer. This allows to have + children window inside a parent one just like any other object would be, + and do other things like applying Evas_Map effects to it. This is the + only type of window that requires the ``parent`` parameter + to be a valid :py:class:`efl.evas.Object`. + +.. data:: ELM_WIN_SOCKET_IMAGE + + The window is rendered onto an image buffer and can be shown other + process's plug image object. + + No actual window is created for this type, instead the window and all of + its contents will be rendered to an image buffer and can be shown other + process's plug image object + + +.. _Elm_Win_Indicator_Mode: + +Indicator states +---------------- + +.. data:: ELM_WIN_INDICATOR_UNKNOWN + + Unknown indicator state. + +.. data:: ELM_WIN_INDICATOR_HIDE + + Hides the indicator. + +.. data:: ELM_WIN_INDICATOR_SHOW + + Shows the indicator. + + +.. _Elm_Win_Indicator_Opacity_Mode: + +Indicator opacity +----------------- + +.. data:: ELM_WIN_INDICATOR_OPACITY_UNKNOWN + + Unknown indicator opacity mode. + +.. data:: ELM_WIN_INDICATOR_OPAQUE + + Opacifies the indicator. + +.. data:: ELM_WIN_INDICATOR_TRANSLUCENT + + Be translucent the indicator. + +.. data:: ELM_WIN_INDICATOR_TRANSPARENT + + Transparentizes the indicator. + + +.. _Elm_Win_Keyboard_Mode: + +Keyboard virtual keyboard modes +------------------------------- + +.. data:: ELM_WIN_KEYBOARD_UNKNOWN + + Unknown keyboard state. + +.. data:: ELM_WIN_KEYBOARD_OFF + + Request to deactivate the keyboard. + +.. data:: ELM_WIN_KEYBOARD_ON + + Enable keyboard with default layout. + +.. data:: ELM_WIN_KEYBOARD_ALPHA + + Alpha (a-z) keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_NUMERIC + + Numeric keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_PIN + + PIN keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_PHONE_NUMBER + + Phone keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_HEX + + Hexadecimal numeric keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_TERMINAL + + Full (QWERTY) keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_PASSWORD + + Password keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_IP + + IP keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_HOST + + Host keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_FILE + + File keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_URL + + URL keyboard layout. + +.. data:: ELM_WIN_KEYBOARD_KEYPAD + + Keypad layout. + +.. data:: ELM_WIN_KEYBOARD_J2ME + + J2ME keyboard layout. + + +.. _Elm_Illume_Command: + +Illume commands +--------------- + +Available commands that can be sent to the Illume manager. + +When running under an Illume session, a window may send commands to the +Illume manager to perform different actions. + +.. data:: ELM_ILLUME_COMMAND_FOCUS_BACK + + Reverts focus to the previous window + +.. data:: ELM_ILLUME_COMMAND_FOCUS_FORWARD + + Sends focus to the next window in the list + +.. data:: ELM_ILLUME_COMMAND_FOCUS_HOME + + Hides all windows to show the Home screen + +.. data:: ELM_ILLUME_COMMAND_CLOSE + + Closes the currently active window + + +Inheritance diagram +=================== + +.. inheritance-diagram:: efl.elementary.Window + :parts: 2 + + +.. autoclass:: efl.elementary.Window diff --git a/efl/elementary/__init__.py b/efl/elementary/__init__.py index 253abb4..0d5881c 100644 --- a/efl/elementary/__init__.py +++ b/efl/elementary/__init__.py @@ -16,10 +16,6 @@ # along with this Python-EFL. If not, see . # -from efl.elementary.general import * -from efl.elementary.need import * - - __all__ = ( #"access", "actionslider", diff --git a/efl/elementary/general.pyx b/efl/elementary/__init__.pyx similarity index 91% rename from efl/elementary/general.pyx rename to efl/elementary/__init__.pyx index f2a6c28..a507226 100644 --- a/efl/elementary/general.pyx +++ b/efl/elementary/__init__.pyx @@ -18,8 +18,8 @@ """ -:mod:`general` Module -##################### +:mod:`elementary` Module +######################## .. _General: @@ -267,17 +267,12 @@ Glob matching bitfiled flags .. versionadded:: 1.11 - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.general - :parts: 2 - """ from cpython cimport PyUnicode_AsUTF8String, PyMem_Malloc, Py_DECREF, Py_INCREF -from libc.string cimport memcpy +from libc.string cimport memcpy, strdup +from libc.stdlib cimport malloc, free +from libc.stdint cimport uintptr_t from efl.evas cimport Object as evasObject @@ -290,14 +285,17 @@ from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \ EINA_LOG_DOM_WARN, EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT from efl.ecore cimport Event, EventHandler, _event_mapping_register -from efl.elementary.need cimport elm_need_sys_notify, elm_need_systray, \ - elm_need_ethumb + import sys import traceback import atexit +include "elementary_cdef.pxi" + + + elm_log = add_logger("efl.elementary") cdef int PY_EFL_ELM_LOG_DOMAIN = elm_log.eina_log_domain @@ -597,7 +595,7 @@ def on_sys_notify_notification_closed(func, *args, **kargs): def on_sys_notify_action_invoked(func, *args, **kargs): return EventHandler( - ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED, func, *args, **kargs + ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED, func, *args, **kargs ) @@ -941,3 +939,93 @@ def sys_notify_send( py_cb_data if cb is not None else NULL ) +from cpython cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, \ + PyObject_CheckBuffer + +from efl.utils.deprecated cimport DEPRECATED +from efl.utils.conversions cimport * +from efl.eo cimport Eo, object_from_instance +from efl.evas cimport SmartObject, EventKeyDown, EventKeyUp, EventMouseWheel + +from datetime import date, datetime + + +cdef object _cb_string_conv(void *addr): + return _ctouni(addr) if addr is not NULL else None + +cdef object _cb_object_item_conv(void *addr): + return _object_item_to_python(addr) + + +#include "access.pxi" +include "actionslider.pxi" +include "background.pxi" +include "box.pxi" +include "bubble.pxi" +include "button.pxi" +include "calendar.pxi" +include "check.pxi" +include "clock.pxi" +include "colorselector.pxi" +include "configuration.pxi" +include "conformant.pxi" +include "ctxpopup.pxi" +include "datetime.pxi" +include "dayselector.pxi" +include "diskselector.pxi" +include "entry.pxi" +include "fileselector.pxi" +include "fileselector_button.pxi" +include "fileselector_entry.pxi" +include "flip.pxi" +include "flipselector.pxi" +include "frame.pxi" +#include "general.pxi" +include "gengrid.pxi" +include "genlist.pxi" +include "gesture_layer.pxi" +#include "glview.pxi" +include "grid.pxi" +include "hover.pxi" +include "hoversel.pxi" +include "icon.pxi" +include "image.pxi" +include "index.pxi" +include "innerwindow.pxi" +include "label.pxi" +#include "layout_class.pxi" +include "layout.pxi" +include "list.pxi" +include "map.pxi" +include "mapbuf.pxi" +include "menu.pxi" +include "multibuttonentry.pxi" +include "naviframe.pxi" +include "need.pxi" +include "notify.pxi" +include "object.pxi" +include "object_item.pxi" +include "panel.pxi" +include "panes.pxi" +include "photo.pxi" +include "photocam.pxi" +include "plug.pxi" +include "popup.pxi" +include "progressbar.pxi" +include "radio.pxi" +include "scroller.pxi" +include "segment_control.pxi" +include "separator.pxi" +include "slider.pxi" +include "slideshow.pxi" +include "spinner.pxi" +#include "store.pxi" +include "systray.pxi" +include "table.pxi" +include "theme.pxi" +include "thumb.pxi" +include "toolbar.pxi" +include "transit.pxi" +include "video.pxi" +include "web.pxi" +include "window.pxi" diff --git a/efl/elementary/actionslider.pyx b/efl/elementary/actionslider.pxi similarity index 69% rename from efl/elementary/actionslider.pyx rename to efl/elementary/actionslider.pxi index 00a74d0..0536dd0 100644 --- a/efl/elementary/actionslider.pyx +++ b/efl/elementary/actionslider.pxi @@ -16,103 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`actionslider` Module -########################## - -.. image:: /images/actionslider-preview.png - - -Widget description -================== - -An actionslider is a switcher for two or three labels with -customizable magnet properties. - -The user drags and releases the indicator, to choose a label. - -Labels can occupy the following positions. - -- Left -- Right -- Center - -Positions can be enabled or disabled. - -Magnets can be set on the above positions. - -When the indicator is released, it will move to its nearest "enabled and -magnetized" position. - - -Emitted signals -=============== - -- ``selected`` - when user selects an enabled position (the label is - passed as event info)". -- ``pos_changed`` - when the indicator reaches any of the - positions("left", "right" or "center"). - - -Layout text parts -================= - -- ``indicator`` - An indicator label of the actionslider -- ``left`` - A left label of the actionslider -- ``right`` - A right label of the actionslider -- ``center`` - A center label of the actionslider - - -Enumerations -============ - -.. _Elm_Actionslider_Pos: - -Actionslider positions ----------------------- - -.. data:: ELM_ACTIONSLIDER_NONE - - No position - -.. data:: ELM_ACTIONSLIDER_LEFT - - Left position - -.. data:: ELM_ACTIONSLIDER_CENTER - - Center position - -.. data:: ELM_ACTIONSLIDER_RIGHT - - Right position - -.. data:: ELM_ACTIONSLIDER_ALL - - All positions - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.actionslider - :parts: 2 - -""" - -from libc.stdint cimport uintptr_t -from cpython cimport PyObject - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - - -cdef object _cb_string_conv(void *addr): - return _ctouni(addr) if addr is not NULL else None - +include "actionslider_cdef.pxi" cdef class Actionslider(LayoutClass): """ diff --git a/efl/elementary/actionslider.py b/efl/elementary/actionslider.py new file mode 100644 index 0000000..c6fb9cb --- /dev/null +++ b/efl/elementary/actionslider.py @@ -0,0 +1,7 @@ +from . import Actionslider + +from . import ELM_ACTIONSLIDER_NONE +from . import ELM_ACTIONSLIDER_LEFT +from . import ELM_ACTIONSLIDER_CENTER +from . import ELM_ACTIONSLIDER_RIGHT +from . import ELM_ACTIONSLIDER_ALL diff --git a/efl/elementary/actionslider.pxd b/efl/elementary/actionslider_cdef.pxi similarity index 96% rename from efl/elementary/actionslider.pxd rename to efl/elementary/actionslider_cdef.pxi index b1dbbc6..df8dddc 100644 --- a/efl/elementary/actionslider.pxd +++ b/efl/elementary/actionslider_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Evas_Object - - cdef extern from "Elementary.h": cpdef enum Elm_Actionslider_Pos: diff --git a/efl/elementary/background.pyx b/efl/elementary/background.pxi similarity index 86% rename from efl/elementary/background.pyx rename to efl/elementary/background.pxi index f3c0141..7f63117 100644 --- a/efl/elementary/background.pyx +++ b/efl/elementary/background.pxi @@ -16,70 +16,8 @@ # along with this Python-EFL. If not, see . # -""" -:mod:`background` Module -######################## - -.. image:: /images/background-preview.png - - -Widget description -================== - -The background widget is used for setting a solid color, image or Edje group -as a background to a window (unless it has transparency enabled) or any -container object. - -It works just like an image, but has some properties useful to a -background, like setting it to tiled, centered, scaled or stretched. - - -Layout content parts -==================== - -- ``overlay`` - overlay of the bg - - -Enumerations -============ - -.. _Elm_Bg_Option: - -Background display modes ------------------------- - -.. data:: ELM_BG_OPTION_CENTER - - Center - -.. data:: ELM_BG_OPTION_SCALE - - Scale - -.. data:: ELM_BG_OPTION_STRETCH - - Stretch - -.. data:: ELM_BG_OPTION_TILE - - Tile - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.background - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register, Eo -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "background_cdef.pxi" cdef class Background(LayoutClass): diff --git a/efl/elementary/background.py b/efl/elementary/background.py new file mode 100644 index 0000000..132b8d1 --- /dev/null +++ b/efl/elementary/background.py @@ -0,0 +1,6 @@ +from . import Background + +from . import ELM_BG_OPTION_CENTER +from . import ELM_BG_OPTION_SCALE +from . import ELM_BG_OPTION_STRETCH +from . import ELM_BG_OPTION_TILE diff --git a/efl/elementary/background.pxd b/efl/elementary/background_cdef.pxi similarity index 94% rename from efl/elementary/background.pxd rename to efl/elementary/background_cdef.pxi index 746f0b4..3fc8f34 100644 --- a/efl/elementary/background.pxd +++ b/efl/elementary/background_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - - cdef extern from "Elementary.h": cpdef enum Elm_Bg_Option: diff --git a/efl/elementary/box.pyx b/efl/elementary/box.pxi similarity index 75% rename from efl/elementary/box.pyx rename to efl/elementary/box.pxi index 3d1b99d..a2a0e8b 100644 --- a/efl/elementary/box.pyx +++ b/efl/elementary/box.pxi @@ -16,131 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`box` Module -################# - -.. image:: /images/box-preview.png - - -Widget description -================== - -A box arranges objects in a linear fashion, governed by a layout function -that defines the details of this arrangement. - -By default, the box will use an internal function to set the layout to -a single row, either vertical or horizontal. This layout is affected -by a number of parameters, such as the homogeneous flag set by -:py:attr:`~Box.homogeneous`, the values given by :py:attr:`~Box.padding` and -:py:attr:`~Box.align` and the hints set to each object in the box. - -For this default layout, it's possible to change the orientation with -:py:attr:`~Box.horizontal`. The box will start in the vertical orientation, -placing its elements ordered from top to bottom. When horizontal is set, -the order will go from left to right. If the box is set to be -homogeneous, every object in it will be assigned the same space, that -of the largest object. Padding can be used to set some spacing between -the cell given to each object. The alignment of the box, set with -:py:attr:`~Box.align`, determines how the bounding box of all the elements -will be placed within the space given to the box widget itself. - -The size hints of each object also affect how they are placed and sized -within the box. :py:attr:`~efl.evas.Object.size_hint_min` will give the minimum -size the object can have, and the box will use it as the basis for all -latter calculations. Elementary widgets set their own minimum size as -needed, so there's rarely any need to use it manually. - -:py:attr:`~efl.evas.Object.size_hint_weight`, when not in homogeneous mode, is -used to tell whether the object will be allocated the minimum size it -needs or if the space given to it should be expanded. It's important -to realize that expanding the size given to the object is not the same -thing as resizing the object. It could very well end being a small -widget floating in a much larger empty space. If not set, the weight -for objects will normally be 0.0 for both axis, meaning the widget will -not be expanded. To take as much space possible, set the weight to -``EVAS_HINT_EXPAND`` (defined to 1.0) for the desired axis to expand. - -Besides how much space each object is allocated, it's possible to control -how the widget will be placed within that space using -:py:attr:`~efl.evas.Object.size_hint_align`. By default, this value will be 0.5 -for both axis, meaning the object will be centered, but any value from -0.0 (left or top, for the ``x`` and ``y`` axis, respectively) to 1.0 -(right or bottom) can be used. The special value *EVAS_HINT_FILL*, which -is -1.0, means the object will be resized to fill the entire space it -was allocated. - -In addition, customized functions to define the layout can be set, which -allow the application developer to organize the objects within the box -in any number of ways. - -The special :py:meth:`Box.layout_transition` function can be used -to switch from one layout to another, animating the motion of the -children of the box. - -.. note:: Objects should not be added to box objects using _add() calls. - - -Enumerations -============ - -.. _Evas_Object_Box_Layout: - -Box layout modes ----------------- - -.. data:: ELM_BOX_LAYOUT_HORIZONTAL - - Horizontal layout - -.. data:: ELM_BOX_LAYOUT_VERTICAL - - Vertical layout - -.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL - - Homogeneous vertical layout - -.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL - - Homogeneous horizontal layout - -.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL - - Homogeneous layout, maximum size on the horizontal axis - -.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL - - Homogeneous layout, maximum size on the horizontal axis - -.. data:: ELM_BOX_LAYOUT_FLOW_HORIZONTAL - - Horizontally flowing layout - -.. data:: ELM_BOX_LAYOUT_FLOW_VERTICAL - - Vertically flowing layout - -.. data:: ELM_BOX_LAYOUT_STACK - - Stacking layout - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.box - :parts: 2 - -""" - -from efl.c_eo cimport Eo as cEo -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.evas cimport Object as evasObject -from object cimport Object - -from efl.utils.conversions cimport eina_list_objects_to_python_list +include "box_cdef.pxi" ELM_BOX_LAYOUT_HORIZONTAL = 0 diff --git a/efl/elementary/box.py b/efl/elementary/box.py new file mode 100644 index 0000000..940e523 --- /dev/null +++ b/efl/elementary/box.py @@ -0,0 +1,11 @@ +from . import Box + +from . import ELM_BOX_LAYOUT_HORIZONTAL +from . import ELM_BOX_LAYOUT_VERTICAL +from . import ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL +from . import ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL +from . import ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL +from . import ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL +from . import ELM_BOX_LAYOUT_FLOW_HORIZONTAL +from . import ELM_BOX_LAYOUT_FLOW_VERTICAL +from . import ELM_BOX_LAYOUT_STACK diff --git a/efl/elementary/box.pxd b/efl/elementary/box_cdef.pxi similarity index 98% rename from efl/elementary/box.pxd rename to efl/elementary/box_cdef.pxi index b4b232a..b56c24b 100644 --- a/efl/elementary/box.pxd +++ b/efl/elementary/box_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Coord - cdef extern from "Ecore.h": ctypedef void (*Ecore_Cb)(void *data) diff --git a/efl/elementary/bubble.pyx b/efl/elementary/bubble.pxi similarity index 58% rename from efl/elementary/bubble.pyx rename to efl/elementary/bubble.pxi index 0de030d..e8662e8 100644 --- a/efl/elementary/bubble.pyx +++ b/efl/elementary/bubble.pxi @@ -16,99 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`bubble` Module -#################### - -.. image:: /images/bubble-preview.png - - -Widget description -================== - -The Bubble is a widget to show text similar to how speech is -represented in comics. - -The bubble widget contains 5 important visual elements: - -- The frame is a rectangle with rounded edjes and an "arrow". -- The ``icon`` is an image to which the frame's arrow points to. -- The ``label`` is a text which appears to the right of the icon if the - corner is **top_left** or **bottom_left** and is right aligned to - the frame otherwise. -- The ``info`` is a text which appears to the right of the label. Info's - font is of a lighter color than label. -- The ``content`` is an evas object that is shown inside the frame. - -The position of the arrow, icon, label and info depends on which corner is -selected. The four available corners are: - -- ``top_left`` - Default -- ``top_right`` -- ``bottom_left`` -- ``bottom_right`` - - -Layout content parts -==================== - -- ``default`` - A content of the bubble -- ``icon`` - An icon of the bubble - - -Layout text parts -================= - -- ``default`` - Label of the bubble -- ``info`` - info of the bubble - - -Emitted signals -=============== - -- ``clicked`` - This is called when a user has clicked the bubble. -- ``focused`` - When the bubble has received focus. (since 1.8) -- ``unfocused`` - When the bubble has lost focus. (since 1.8) - - -Enumerations -============ - -.. _Elm_Bubble_Pos: - -Bubble arrow positions ----------------------- - -.. data:: ELM_BUBBLE_POS_TOP_LEFT - - Top left position - -.. data:: ELM_BUBBLE_POS_TOP_RIGHT - - Top right position - -.. data:: ELM_BUBBLE_POS_BOTTOM_LEFT - - Bottom left position - -.. data:: ELM_BUBBLE_POS_BOTTOM_RIGHT - - Bottom right position - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.bubble - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - +include "bubble_cdef.pxi" cdef class Bubble(LayoutClass): """ diff --git a/efl/elementary/bubble.py b/efl/elementary/bubble.py new file mode 100644 index 0000000..7e06096 --- /dev/null +++ b/efl/elementary/bubble.py @@ -0,0 +1,6 @@ +from . import Bubble + +from . import ELM_BUBBLE_POS_TOP_LEFT +from . import ELM_BUBBLE_POS_TOP_RIGHT +from . import ELM_BUBBLE_POS_BOTTOM_LEFT +from . import ELM_BUBBLE_POS_BOTTOM_RIGHT diff --git a/efl/elementary/bubble.pxd b/efl/elementary/bubble_cdef.pxi similarity index 92% rename from efl/elementary/bubble.pxd rename to efl/elementary/bubble_cdef.pxi index 23e1ae9..314d9a4 100644 --- a/efl/elementary/bubble.pxd +++ b/efl/elementary/bubble_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Evas_Object - - cdef extern from "Elementary.h": cpdef enum Elm_Bubble_Pos: diff --git a/efl/elementary/button.pyx b/efl/elementary/button.pxi similarity index 76% rename from efl/elementary/button.pyx rename to efl/elementary/button.pxi index 65791d5..67955cc 100644 --- a/efl/elementary/button.pyx +++ b/efl/elementary/button.pxi @@ -15,74 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`button` Module -#################### - -.. image:: /images/button-preview.png - - -Widget description -================== - -This is a push-button. Press it and run some function. It can contain -a simple label and icon object and it also has an autorepeat feature. - - -Available styles -================ - -- ``default`` a normal button. -- ``anchor`` Like default, but the button fades away when the mouse is not - over it, leaving only the text or icon. -- ``hoversel_vertical`` Internally used by - :py:class:`~efl.elementary.hoversel.Hoversel` to give a continuous look - across its options. -- ``hoversel_vertical_entry`` Another internal for - :py:class:`~efl.elementary.hoversel.Hoversel`. -- ``naviframe`` Internally used by - :py:class:`~efl.elementary.naviframe.Naviframe` for its back button. -- ``colorselector`` Internally used by - :py:class:`~efl.elementary.colorselector.Colorselector` for its left and - right buttons. - - -Layout content parts -==================== - -- ``icon`` - An icon of the button - - -Layout text parts -================= - -- ``default`` - Label of the button - - -Emitted signals -=============== - -- ``clicked``: the user clicked the button (press/release). -- ``repeated``: the user pressed the button without releasing it. -- ``pressed``: button was pressed. -- ``unpressed``: button was released after being pressed. -- ``focused`` : When the button has received focus. (since 1.8) -- ``unfocused`` : When the button has lost focus. (since 1.8) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.button - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - +include "button_cdef.pxi" cdef class Button(LayoutClass): """ diff --git a/efl/elementary/button.py b/efl/elementary/button.py new file mode 100644 index 0000000..9cb417c --- /dev/null +++ b/efl/elementary/button.py @@ -0,0 +1 @@ +from . import Button diff --git a/efl/elementary/button.pxd b/efl/elementary/button_cdef.pxi similarity index 83% rename from efl/elementary/button.pxd rename to efl/elementary/button_cdef.pxi index cfdfcab..28cd31d 100644 --- a/efl/elementary/button.pxd +++ b/efl/elementary/button_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object -from layout_class cimport LayoutClass - cdef extern from "Elementary.h": Evas_Object *elm_button_add(Evas_Object *parent) @@ -10,7 +7,3 @@ cdef extern from "Elementary.h": double elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj) void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t) double elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj) - - -cdef class Button(LayoutClass): - pass diff --git a/efl/elementary/calendar_elm.pyx b/efl/elementary/calendar.pxi similarity index 80% rename from efl/elementary/calendar_elm.pyx rename to efl/elementary/calendar.pxi index 722e549..6df7765 100644 --- a/efl/elementary/calendar_elm.pyx +++ b/efl/elementary/calendar.pxi @@ -16,178 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`calendar_elm` Module -########################## - -.. image:: /images/calendar-preview.png - - -Widget description -================== - -This is a calendar widget. - -It helps applications to flexibly display a calender with day of the week, -date, year and month. Applications are able to set specific dates to be -reported back, when selected, in the smart callbacks of the calendar widget. -The API of this widget lets the applications perform other functions, like: - -- placing marks on specific dates -- setting the bounds for the calendar (minimum and maximum years) -- setting the day names of the week (e.g. "Thu" or "Thursday") -- setting the year and month format. - - -Emitted signals -=============== - -- ``changed`` - emitted when the date in the calendar is changed. -- ``display,changed`` - emitted when the current month displayed in the - calendar is changed. -- ``focused`` - When the calendar has received focus. (since 1.8) -- ``unfocused`` - When the calendar has lost focus. (since 1.8) - - -Enumerations -============ - -.. _Elm_Calendar_Mark_Repeat_Type: - -Calendar mark repeat types --------------------------- - -.. data:: ELM_CALENDAR_UNIQUE - - Default value. - - Marks will be displayed only on event day. - -.. data:: ELM_CALENDAR_DAILY - - Marks will be displayed every day after event day (inclusive). - -.. data:: ELM_CALENDAR_WEEKLY - - Marks will be displayed every week after event day (inclusive) - i.e. - each seven days. - -.. data:: ELM_CALENDAR_MONTHLY - - Marks will be displayed every month day that coincides to event day. - - E.g.: if an event is set to 30th Jan, no marks will be displayed on Feb, - but will be displayed on 30th Mar - -.. data:: ELM_CALENDAR_ANNUALLY - - Marks will be displayed every year that coincides to event day (and month). - - E.g. an event added to 30th Jan 2012 will be repeated on 30th Jan 2013. - -.. data:: ELM_CALENDAR_LAST_DAY_OF_MONTH - - Marks will be displayed every last day of month after event day - (inclusive). - - -.. _Elm_Calendar_Select_Mode: - -Calendar selection modes ------------------------- - -.. data:: ELM_CALENDAR_SELECT_MODE_DEFAULT - - Default mode - -.. data:: ELM_CALENDAR_SELECT_MODE_ALWAYS - - Select always - -.. data:: ELM_CALENDAR_SELECT_MODE_NONE - - Don't select - -.. data:: ELM_CALENDAR_SELECT_MODE_ONDEMAND - - Select on demand - - -.. _Elm_Calendar_Selectable: - -Selectable ----------- - -.. data:: ELM_CALENDAR_SELECTABLE_NONE - - None selectable - -.. data:: ELM_CALENDAR_SELECTABLE_YEAR - - Year is selectable - -.. data:: ELM_CALENDAR_SELECTABLE_MONTH - - Month is selectable - -.. data:: ELM_CALENDAR_SELECTABLE_DAY - - Day is selectable - - -.. _Elm_Calendar_Weekday: - -Days ----- - -.. data:: ELM_DAY_SUNDAY - - Sunday - -.. data:: ELM_DAY_MONDAY - - Monday - -.. data:: ELM_DAY_TUESDAY - - Tuesday - -.. data:: ELM_DAY_WEDNESDAY - - Wednesday - -.. data:: ELM_DAY_THURSDAY - - Thursday - -.. data:: ELM_DAY_FRIDAY - - Friday - -.. data:: ELM_DAY_SATURDAY - - Saturday - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.calendar_elm - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.utils.conversions cimport array_of_strings_to_python_list, \ - python_list_strings_to_array_of_strings -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - -from datetime import date - +include "calendar_cdef.pxi" cdef class CalendarMark(object): """ diff --git a/efl/elementary/calendar_elm.pxd b/efl/elementary/calendar_cdef.pxi similarity index 95% rename from efl/elementary/calendar_elm.pxd rename to efl/elementary/calendar_cdef.pxi index 3a4ea45..05ae40f 100644 --- a/efl/elementary/calendar_elm.pxd +++ b/efl/elementary/calendar_cdef.pxi @@ -1,11 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object - - -cdef extern from "string.h": - void *memcpy(void *dst, void *src, int n) - char *strdup(char *str) - - cdef extern from "time.h": struct tm: int tm_sec @@ -21,7 +13,6 @@ cdef extern from "time.h": long int tm_gmtoff const char *tm_zone - cdef extern from "Elementary.h": cpdef enum Elm_Calendar_Mark_Repeat_Type: diff --git a/efl/elementary/calendar_elm.py b/efl/elementary/calendar_elm.py new file mode 100644 index 0000000..bd158c8 --- /dev/null +++ b/efl/elementary/calendar_elm.py @@ -0,0 +1,27 @@ +from . import Calendar, CalendarMark + +from . import ELM_CALENDAR_UNIQUE +from . import ELM_CALENDAR_DAILY +from . import ELM_CALENDAR_WEEKLY +from . import ELM_CALENDAR_MONTHLY +from . import ELM_CALENDAR_ANNUALLY +from . import ELM_CALENDAR_LAST_DAY_OF_MONTH + +from . import ELM_CALENDAR_SELECT_MODE_DEFAULT +from . import ELM_CALENDAR_SELECT_MODE_ALWAYS +from . import ELM_CALENDAR_SELECT_MODE_NONE +from . import ELM_CALENDAR_SELECT_MODE_ONDEMAND + +from . import ELM_CALENDAR_SELECTABLE_NONE +from . import ELM_CALENDAR_SELECTABLE_YEAR +from . import ELM_CALENDAR_SELECTABLE_MONTH +from . import ELM_CALENDAR_SELECTABLE_DAY + +from . import ELM_DAY_SUNDAY +from . import ELM_DAY_MONDAY +from . import ELM_DAY_TUESDAY +from . import ELM_DAY_WEDNESDAY +from . import ELM_DAY_THURSDAY +from . import ELM_DAY_FRIDAY +from . import ELM_DAY_SATURDAY +from . import ELM_DAY_LAST diff --git a/efl/elementary/check.pyx b/efl/elementary/check.pxi similarity index 71% rename from efl/elementary/check.pyx rename to efl/elementary/check.pxi index 2ab59cc..3a77f2f 100644 --- a/efl/elementary/check.pyx +++ b/efl/elementary/check.pxi @@ -15,59 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . - -""" - -:mod:`check` Module -################### - -.. image:: /images/check-preview.png - - -Widget description -================== - -The check widget allows for toggling a value between true and false. - -Check objects are a lot like radio objects in layout and functionality, -except they do not work as a group, but independently, and only toggle -the value of a boolean :py:attr:`~Check.state` between false and true. - - -Emitted signals -=============== - -- ``changed`` - This is called whenever the user changes the state of - the check objects. -- ``focused`` - When the check has received focus. (since 1.8) -- ``unfocused`` - When the check has lost focus. (since 1.8) - - -Layout content parts -==================== - -- ``icon`` - An icon of the check - - -Layout text parts -================= - -- ``default`` - A label of the check -- ``on`` - On state label of the check -- ``off`` - Off state label of the check - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.check - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "check_cdef.pxi" cdef class Check(LayoutClass): """ diff --git a/efl/elementary/check.py b/efl/elementary/check.py new file mode 100644 index 0000000..f3302e5 --- /dev/null +++ b/efl/elementary/check.py @@ -0,0 +1 @@ +from . import Check diff --git a/efl/elementary/check.pxd b/efl/elementary/check_cdef.pxi similarity index 84% rename from efl/elementary/check.pxd rename to efl/elementary/check_cdef.pxi index 55f0265..794d76e 100644 --- a/efl/elementary/check.pxd +++ b/efl/elementary/check_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_check_add(Evas_Object *parent) void elm_check_state_set(Evas_Object *obj, Eina_Bool state) diff --git a/efl/elementary/clock.pyx b/efl/elementary/clock.pxi similarity index 77% rename from efl/elementary/clock.pyx rename to efl/elementary/clock.pxi index 1187b8d..6fa5ca8 100644 --- a/efl/elementary/clock.pyx +++ b/efl/elementary/clock.pxi @@ -16,104 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`clock` Module -################### - -.. image:: /images/clock-preview.png - - -Widget description -================== - -This is a digital clock widget. - -In its default theme, it has a vintage "flipping numbers clock" appearance, -which will animate sheets of individual algarisms individually as time goes -by. - -A newly created clock will fetch system's time (already considering -local time adjustments) to start with, and will tick accordingly. It may -or may not show seconds. - -Clocks have an **edition** mode. When in it, the sheets will display -extra arrow indications on the top and bottom and the user may click on -them to raise or lower the time values. After it's told to exit edition -mode, it will keep ticking with that new time set (it keeps the -difference from local time). - -Also, when under edition mode, user clicks on the cited arrows which are -**held** for some time will make the clock to flip the sheet, thus -editing the time, continuously and automatically for the user. The -interval between sheet flips will keep growing in time, so that it helps -the user to reach a time which is distant from the one set. - -The time display is, by default, in military mode (24h), but an am/pm -indicator may be optionally shown, too, when it will switch to 12h. - - -Emitted signals -=============== - -- ``changed`` - the clock's user changed the time -- ``focused`` - When the clock has received focus. (since 1.8) -- ``unfocused`` - When the clock has lost focus. (since 1.8) - - -Enumerations -============ - -.. _Elm_Clock_Edit_Mode: - -Clock edit modes ----------------- - -.. data:: ELM_CLOCK_EDIT_DEFAULT - - Default edit - -.. data:: ELM_CLOCK_EDIT_HOUR_DECIMAL - - Edit hours' decimal - -.. data:: ELM_CLOCK_EDIT_HOUR_UNIT - - Edit hours' unit - -.. data:: ELM_CLOCK_EDIT_MIN_DECIMAL - - Edit minutes' decimal - -.. data:: ELM_CLOCK_EDIT_MIN_UNIT - - Edit minutes' unit - -.. data:: ELM_CLOCK_EDIT_SEC_DECIMAL - - Edit seconds' decimal - -.. data:: ELM_CLOCK_EDIT_SEC_UNIT - - Edit seconds' unit - -.. data:: ELM_CLOCK_EDIT_ALL - - Edit all - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.clock - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - +include "clock_cdef.pxi" cdef class Clock(LayoutClass): """ diff --git a/efl/elementary/clock.py b/efl/elementary/clock.py new file mode 100644 index 0000000..ce7a8c6 --- /dev/null +++ b/efl/elementary/clock.py @@ -0,0 +1,10 @@ +from . import Clock + +from . import ELM_CLOCK_EDIT_DEFAULT +from . import ELM_CLOCK_EDIT_HOUR_DECIMAL +from . import ELM_CLOCK_EDIT_HOUR_UNIT +from . import ELM_CLOCK_EDIT_MIN_DECIMAL +from . import ELM_CLOCK_EDIT_MIN_UNIT +from . import ELM_CLOCK_EDIT_SEC_DECIMAL +from . import ELM_CLOCK_EDIT_SEC_UNIT +from . import ELM_CLOCK_EDIT_ALL diff --git a/efl/elementary/clock.pxd b/efl/elementary/clock_cdef.pxi similarity index 97% rename from efl/elementary/clock.pxd rename to efl/elementary/clock_cdef.pxi index 6a12a21..8ff69aa 100644 --- a/efl/elementary/clock.pxd +++ b/efl/elementary/clock_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Evas_Object, Eina_Bool - - cdef extern from "Elementary.h": cpdef enum Elm_Clock_Edit_Mode: diff --git a/efl/elementary/cnp_callbacks.pxi b/efl/elementary/cnp_callbacks.pxi index b607a06..2e56c95 100644 --- a/efl/elementary/cnp_callbacks.pxi +++ b/efl/elementary/cnp_callbacks.pxi @@ -1,5 +1,3 @@ -from object_item cimport Elm_Object_Item -from efl.elementary.object cimport Elm_Sel_Type, Elm_Sel_Format, Elm_Xdnd_Action from efl.utils.conversions cimport python_list_objects_to_eina_list cdef extern from "Elementary.h": diff --git a/efl/elementary/colorselector.pyx b/efl/elementary/colorselector.pxi similarity index 83% rename from efl/elementary/colorselector.pyx rename to efl/elementary/colorselector.pxi index 2fc507e..db521a2 100644 --- a/efl/elementary/colorselector.pyx +++ b/efl/elementary/colorselector.pxi @@ -16,82 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`colorselector` Module -########################### - -.. image:: /images/colorselector-preview.png - - -Widget description -================== - -A Colorselector is a color selection widget. - -It allows application to set a series of colors. It also allows to -load/save colors from/to config with a unique identifier, by default, -the colors are loaded/saved from/to config using "default" identifier. -The colors can be picked by user from the color set by clicking on -individual color item on the palette or by selecting it from selector. - - -Emitted signals -=============== - -- ``"changed"`` - When the color value changes on selector -- ``"color,item,selected"`` - When user clicks on color item. - The event_info parameter of the callback will be the selected - color item. -- ``"color,item,longpressed"`` - When user long presses on color item. - The event_info parameter of the callback will be the selected - color item. -- ``focused`` - When the colorselector has received focus. (since 1.8) -- ``unfocused`` - When the colorselector has lost focus. (since 1.8) - - -Enumerations -============ - -.. _Elm_Colorselector_Mode: - -Colorselector modes -------------------- - -.. data:: ELM_COLORSELECTOR_PALETTE - - Show palette - -.. data:: ELM_COLORSELECTOR_COMPONENTS - - Show components - -.. data:: ELM_COLORSELECTOR_BOTH - - Show palette and components - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.colorselector - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from object_item cimport ObjectItem, _object_item_to_python -from layout_class cimport LayoutClass - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "colorselector_cdef.pxi" cdef class ColorselectorPaletteItem(ObjectItem): """ diff --git a/efl/elementary/colorselector.py b/efl/elementary/colorselector.py new file mode 100644 index 0000000..6a0fb52 --- /dev/null +++ b/efl/elementary/colorselector.py @@ -0,0 +1,5 @@ +from . import Colorselector, ColorselectorPaletteItem + +from . import ELM_COLORSELECTOR_PALETTE +from . import ELM_COLORSELECTOR_COMPONENTS +from . import ELM_COLORSELECTOR_BOTH diff --git a/efl/elementary/colorselector.pxd b/efl/elementary/colorselector_cdef.pxi similarity index 94% rename from efl/elementary/colorselector.pxd rename to efl/elementary/colorselector_cdef.pxi index b703af5..3f14efd 100644 --- a/efl/elementary/colorselector.pxd +++ b/efl/elementary/colorselector_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Evas_Object, Eina_List, Eina_Bool -from object_item cimport Elm_Object_Item - - cdef extern from "Elementary.h": cpdef enum Elm_Colorselector_Mode: diff --git a/efl/elementary/configuration.pyx b/efl/elementary/configuration.pxi similarity index 91% rename from efl/elementary/configuration.pyx rename to efl/elementary/configuration.pxi index fce8b0d..b0d38d6 100644 --- a/efl/elementary/configuration.pyx +++ b/efl/elementary/configuration.pxi @@ -16,175 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`configuration` Module -########################### - - -Description -=========== - -Elementary configuration is formed by a set options bounded to a -given profile, like theme, "finger size", etc. - -These are functions with which one synchronizes changes made to those -values to the configuration storing files, de facto. You most probably -don't want to use the functions in this group unless you're writing an -elementary configuration manager. - -Profiles -======== - -Profiles are pre-set options that affect the whole look-and-feel of -Elementary-based applications. There are, for example, profiles -aimed at desktop computer applications and others aimed at mobile, -touchscreen-based ones. You most probably don't want to use the -functions in this group unless you're writing an elementary -configuration manager. - -Elementary Scrolling -==================== - -These set how scrollable views in Elementary widgets should behave on -user interaction. - -Password show last -================== - -Show last feature of password mode enables user to view the last input -entered for few seconds before masking it. These functions allow to set -this feature in password mode of entry widget and also allow to -manipulate the duration for which the input has to be visible. - -Elementary Engine -================= - -These are functions setting and querying which rendering engine -Elementary will use for drawing its windows' pixels. - -The following are the available engines: - -- "software_x11" -- "fb" -- "directfb" -- "software_16_x11" -- "software_8_x11" -- "xrender_x11" -- "opengl_x11" -- "software_gdi" -- "software_16_wince_gdi" -- "sdl" -- "software_16_sdl" -- "opengl_sdl" -- "buffer" -- "ews" -- "opengl_cocoa" -- "psl1ght" - - -ATSPI AT-SPI2 Accessibility -=========================== - -Elementary widgets support Linux Accessibility standard. For more -information please visit: -http://www.linuxfoundation.org/collaborate/workgroups/accessibility/atk/at-spi/at-spi_on_d-bus - - -Enumerations -============ - -.. _Elm_Softcursor_Mode: - -Elm_Softcursor_Mode -------------------- - -.. data:: ELM_SOFTCURSOR_MODE_AUTO - - Auto-detect if a software cursor should be used (default) - -.. data:: ELM_SOFTCURSOR_MODE_ON - - Always use a softcursor - -.. data:: ELM_SOFTCURSOR_MODE_OFF - - Never use a softcursor - - -.. _Elm_Slider_Indicator_Visible_Mode: - -Elm_Slider_Indicator_Visible_Mode ---------------------------------- - -.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT - - show indicator on mouse down or change in slider value - -.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS - - Always show the indicator - -.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS - - Show the indicator on focus - -.. data:: ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE - - Never show the indicator - - -.. _Edje_Channel: - -Audio Channels --------------- - -.. data:: EDJE_CHANNEL_EFFECT - - Standard audio effects - -.. data:: EDJE_CHANNEL_BACKGROUND - - Background audio sounds - -.. data:: EDJE_CHANNEL_MUSIC - - Music audio - -.. data:: EDJE_CHANNEL_FOREGROUND - - Foreground audio sounds - -.. data:: EDJE_CHANNEL_INTERFACE - - Sounds related to the interface - -.. data:: EDJE_CHANNEL_INPUT - - Sounds related to regular input - -.. data:: EDJE_CHANNEL_ALERT - - Sounds for major alerts - -.. data:: EDJE_CHANNEL_ALL - - All audio channels (convenience) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.configuration - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list -from efl.utils.deprecated cimport DEPRECATED - +include "configuration_cdef.pxi" cdef class Configuration(object): diff --git a/efl/elementary/configuration.py b/efl/elementary/configuration.py new file mode 100644 index 0000000..ca2082d --- /dev/null +++ b/efl/elementary/configuration.py @@ -0,0 +1,55 @@ +from . import Configuration + +from . import config_finger_size_get +from . import config_finger_size_set + +from . import config_tooltip_delay_get +from . import config_tooltip_delay_set + +from . import focus_highlight_enabled_get +from . import focus_highlight_enabled_set + +from . import focus_highlight_animate_get +from . import focus_highlight_animate_set + +from . import focus_highlight_clip_disabled_get +from . import focus_highlight_clip_disabled_set + +from . import focus_move_policy_get +from . import focus_move_policy_set + +from . import item_select_on_focus_disabled_get +from . import item_select_on_focus_disabled_set + +from . import preferred_engine_get +from . import preferred_engine_set + +from . import accel_preference_get +from . import accel_preference_set + +from . import engine_get +from . import engine_set + +from . import scale_get +from . import scale_set + +from . import cursor_engine_only_get +from . import cursor_engine_only_set + +from . import EDJE_CHANNEL_EFFECT +from . import EDJE_CHANNEL_BACKGROUND +from . import EDJE_CHANNEL_MUSIC +from . import EDJE_CHANNEL_FOREGROUND +from . import EDJE_CHANNEL_INTERFACE +from . import EDJE_CHANNEL_INPUT +from . import EDJE_CHANNEL_ALERT +from . import EDJE_CHANNEL_ALL + +from . import ELM_SOFTCURSOR_MODE_AUTO +from . import ELM_SOFTCURSOR_MODE_ON +from . import ELM_SOFTCURSOR_MODE_OFF + +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE diff --git a/efl/elementary/configuration.pxd b/efl/elementary/configuration_cdef.pxi similarity index 98% rename from efl/elementary/configuration.pxd rename to efl/elementary/configuration_cdef.pxi index 79827b4..b954f98 100644 --- a/efl/elementary/configuration.pxd +++ b/efl/elementary/configuration_cdef.pxi @@ -1,8 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Coord, Evas_Font_Size -from efl.elementary.object cimport Elm_Focus_Move_Policy, \ - Elm_Focus_Autoscroll_Mode - - cdef extern from "Edje.h": cpdef enum Edje_Channel: @@ -178,7 +173,7 @@ cdef extern from "Elementary.h": void elm_config_window_auto_focus_enable_set(Eina_Bool enable) Eina_Bool elm_config_window_auto_focus_animate_get() void elm_config_window_auto_focus_animate_set(Eina_Bool enable) - + Eina_Bool elm_config_mirrored_get() void elm_config_mirrored_set(Eina_Bool mirrored) diff --git a/efl/elementary/conformant.pyx b/efl/elementary/conformant.pxi similarity index 70% rename from efl/elementary/conformant.pyx rename to efl/elementary/conformant.pxi index fbe7f18..a971e7c 100644 --- a/efl/elementary/conformant.pyx +++ b/efl/elementary/conformant.pxi @@ -15,52 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`conformant` Module -######################## - -.. image:: /images/conformant-preview.png - - -Widget description -================== - -The aim is to provide a widget that can be used in elementary apps to -account for space taken up by the indicator, virtual keypad & softkey -windows when running the illume2 module of E17. - -So conformant content will be sized and positioned considering the -space required for such stuff, and when they popup, as a keyboard -shows when an entry is selected, conformant content won't change. - - -Emitted signals -=============== - -- ``virtualkeypad,state,on``: if virtualkeypad state is switched to ``on``. -- ``virtualkeypad,state,off``: if virtualkeypad state is switched to ``off``. -- ``clipboard,state,on``: if clipboard state is switched to ``on``. -- ``clipboard,state,off``: if clipboard state is switched to ``off``. - - -Layout content parts -==================== - -- ``default`` - A content of the conformant - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.conformant - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "conformant_cdef.pxi" cdef class Conformant(LayoutClass): """ diff --git a/efl/elementary/conformant.py b/efl/elementary/conformant.py new file mode 100644 index 0000000..b3905cc --- /dev/null +++ b/efl/elementary/conformant.py @@ -0,0 +1 @@ +from . import Conformant diff --git a/efl/elementary/conformant.pxd b/efl/elementary/conformant_cdef.pxi similarity index 73% rename from efl/elementary/conformant.pxd rename to efl/elementary/conformant_cdef.pxi index 8bf09af..16ff806 100644 --- a/efl/elementary/conformant.pxd +++ b/efl/elementary/conformant_cdef.pxi @@ -1,5 +1,2 @@ -from efl.evas cimport Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_conformant_add(Evas_Object *parent) - diff --git a/efl/elementary/ctxpopup.pyx b/efl/elementary/ctxpopup.pxi similarity index 86% rename from efl/elementary/ctxpopup.pyx rename to efl/elementary/ctxpopup.pxi index 6bb3829..8599369 100644 --- a/efl/elementary/ctxpopup.pyx +++ b/efl/elementary/ctxpopup.pxi @@ -16,98 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`ctxpopup` Module -###################### - -.. image:: /images/ctxpopup-preview.png - - -Widget description -================== - -A ctxpopup is a widget that, when shown, pops up a list of items. It -automatically chooses an area inside its parent object's view to -optimally fit into it. In the default theme, it will also point an arrow -to it's top left position at the time one shows it. Ctxpopup items have -a label and/or an icon. It is intended for a small number of items -(hence the use of list, not genlist). - -.. note:: - - Ctxpopup is a specialization of :py:class:`~efl.elementary.hover.Hover`. - -Emitted signals -=============== - -- ``dismissed`` - This is called when 1. the outside of ctxpopup was clicked - or 2. its parent area is changed or 3. the language is changed and also when - 4. the parent object is resized due to the window rotation. Then ctxpopup is - dismissed. -- ``language,changed`` - This is called when the program's language is - changed. -- ``focused`` - When the ctxpopup has received focus. (since 1.8) -- ``unfocused`` - When the ctxpopup has lost focus. (since 1.8) - -Layout content parts -==================== - -- ``default`` - A content of the ctxpopup -- ``icon`` - An icon in the title area - -Layout text parts -================= - -- ``default`` - Title label in the title area - - -Enumerations -============ - -.. _Elm_Ctxpopup_Direction: - -Ctxpopup arrow directions -------------------------- - -.. data:: ELM_CTXPOPUP_DIRECTION_DOWN - - Arrow is pointing down - -.. data:: ELM_CTXPOPUP_DIRECTION_RIGHT - - Arrow is pointing right - -.. data:: ELM_CTXPOPUP_DIRECTION_LEFT - - Arrow is pointing left - -.. data:: ELM_CTXPOPUP_DIRECTION_UP - - Arrow is pointing up - -.. data:: ELM_CTXPOPUP_DIRECTION_UNKNOWN - - Arrow direction is unknown - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.ctxpopup - :parts: 2 - - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass -from object_item cimport ObjectItem, _object_item_callback, \ - _object_item_callback2, _object_item_to_python, _object_item_list_to_python - +include "ctxpopup_cdef.pxi" cdef class CtxpopupItem(ObjectItem): """ diff --git a/efl/elementary/ctxpopup.py b/efl/elementary/ctxpopup.py new file mode 100644 index 0000000..e5514d7 --- /dev/null +++ b/efl/elementary/ctxpopup.py @@ -0,0 +1,7 @@ +from . import Ctxpopup, CtxpopupItem + +from . import ELM_CTXPOPUP_DIRECTION_DOWN +from . import ELM_CTXPOPUP_DIRECTION_RIGHT +from . import ELM_CTXPOPUP_DIRECTION_LEFT +from . import ELM_CTXPOPUP_DIRECTION_UP +from . import ELM_CTXPOPUP_DIRECTION_UNKNOWN diff --git a/efl/elementary/ctxpopup.pxd b/efl/elementary/ctxpopup_cdef.pxi similarity index 95% rename from efl/elementary/ctxpopup.pxd rename to efl/elementary/ctxpopup_cdef.pxi index c8277cf..02b374f 100644 --- a/efl/elementary/ctxpopup.pxd +++ b/efl/elementary/ctxpopup_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb -from object_item cimport Elm_Object_Item - - cdef extern from "Elementary.h": cpdef enum Elm_Ctxpopup_Direction: @@ -33,4 +29,3 @@ cdef extern from "Elementary.h": Elm_Object_Item *elm_ctxpopup_last_item_get(const Evas_Object *obj) Elm_Object_Item *elm_ctxpopup_item_prev_get(const Elm_Object_Item *it) Elm_Object_Item *elm_ctxpopup_item_next_get(const Elm_Object_Item *it) - diff --git a/efl/elementary/datetime_elm.pyx b/efl/elementary/datetime.pxi similarity index 65% rename from efl/elementary/datetime_elm.pyx rename to efl/elementary/datetime.pxi index 995931c..0fab64b 100644 --- a/efl/elementary/datetime_elm.pyx +++ b/efl/elementary/datetime.pxi @@ -16,237 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`datetime_elm` Module -########################## - - -Widget description -================== - -Datetime widget is used to display and input date & time values. - -This widget displays date and time as per the **system's locale** settings -(Date includes Day, Month & Year along with the defined separators and Time -includes Hour, Minute & AM/PM fields). Separator for AM/PM field is ignored. - -The corresponding Month, AM/PM strings are displayed according to the -system’s language settings. - -Datetime format is a combination of LIBC standard characters like "%%d %%b -%%Y %%I : %%M %%p" which, as a whole represents both Date as well as Time -format. - -Elm_datetime supports only the following sub set of libc date format specifiers: - -**%%Y** The year as a decimal number including the century (example: 2011). - -**%%y** The year as a decimal number without a century (range 00 to 99) - -**%%m** The month as a decimal number (range 01 to 12). - -**%%b** The abbreviated month name according to the current locale. - -**%%B** The full month name according to the current locale. - -**%%h** The abbreviated month name according to the current locale(same as %%b). - -**%%d** The day of the month as a decimal number (range 01 to 31). - -**%%e** The day of the month as a decimal number (range 1 to 31). single - digits are preceded by a blank. - -**%%I** The hour as a decimal number using a 12-hour clock (range 01 to 12). - -**%%H** The hour as a decimal number using a 24-hour clock (range 00 to 23). - -**%%k** The hour (24-hour clock) as a decimal number (range 0 to 23). single - digits are preceded by a blank. - -**%%l** The hour (12-hour clock) as a decimal number (range 1 to 12); single - digits are preceded by a blank. - -**%%M** The minute as a decimal number (range 00 to 59). - -**%%p** Either 'AM' or 'PM' according to the given time value, or the - corresponding strings for the current locale. Noon is treated as 'PM' - and midnight as 'AM' - -**%%P** Like %p but in lower case: 'am' or 'pm' or a corresponding string for - the current locale. - -**%%c** The preferred date and time representation for the current locale. - -**%%x** The preferred date representation for the current locale without the time. - -**%%X** The preferred time representation for the current locale without the date. - -**%%r** The complete calendar time using the AM/PM format of the current locale. - -**%%R** The hour and minute in decimal numbers using the format %H:%M. - -**%%T** The time of day in decimal numbers using the format %H:%M:%S. - -**%%D** The date using the format %%m/%%d/%%y. - -**%%F** The date using the format %%Y-%%m-%%d. - - -(For more reference on the available **LIBC date format specifiers**, -please visit the link: -http://www.gnu.org/s/hello/manual/libc.html#Formatting-Calendar-Time ) - -Datetime widget can provide Unicode **separators** in between its fields -except for AM/PM field. A separator can be any **Unicode character** -other than the LIBC standard date format specifiers. - -Example: In the format:: - - %%b %%d **,** %%y %%H **:** %%M - -comma(,) is separator for date field %%d and colon(:) is separator for -hour field %%H. - -The default format is a predefined one, based on the system Locale. - -Hour format 12hr(1-12) or 24hr(0-23) display can be selected by setting -the corresponding user format. - -Datetime supports six fields: Year, Month, Date, Hour, Minute, AM/PM. -Depending on the Datetime module that is loaded, the user can see -different UI to select the individual field values. - -The individual fields of Datetime can be arranged in any order according -to the format set by application. - -There is a provision to set the visibility of a particular field as TRUE/ -FALSE so that **only time/ only date / only required fields** will be -displayed. - -Each field is having a default minimum and maximum values just like the -daily calendar information. These min/max values can be modified as per -the application usage. - -User can enter the values only in between the range of maximum and -minimum. Apart from these APIs, there is a provision to display only a -limited set of values out of the possible values. APIs to select the -individual field limits are intended for this purpose. - -The whole widget is left aligned and its size grows horizontally -depending on the current format and each field's visible/disabled state. - -Datetime individual field selection is implemented in a modular style. -Module can be implemented as a Ctxpopup based selection or an ISE based -selection or even a spinner like selection etc. - -Datetime Module design -====================== - -The following functions are expected to be implemented in a Datetime module: - -**Field creation**:: - - __________ __________ - | |----- obj_hook() ---------------------->>>| | - | |<<<----------------returns Mod_data ------| | - | Datetime |_______ | | - | widget | |Assign module call backs | Module | - | base |<<<____| | | - | | | | - | |----- field_create() ------------------>>>| | - |__________|<<<----------------returns field_obj -----|__________| - -**Field value setting**:: - - __________ __________ - | | | | - | Datetime |<<<----------elm_datetime_value_set()---| | - | widget | | Module | - | base |----display_field_value()------------>>>| | - |__________| |__________| - -**del_hook**:: - - __________ __________ - | | | | - | Datetime |----obj_unhook()-------------------->>>>| | - | widget | | Module | - | base | <<<-----frees mod_data---------| | - |__________| |__________| - -Any module can use the following shared functions that are implemented in -elm_datetime.c: - -**field_format_get()** - gives the field format. - -**field_limit_get()** - gives the field minimum, maximum limits. - -To enable a module, set the ELM_MODULES environment variable as shown: - -**export ELM_MODULES="datetime_input_ctxpopup>datetime/api"** - - -Emitted signals -=============== - -- ``changed`` - whenever Datetime field value is changed, this signal is sent. -- ``language,changed`` - whenever system locale changes, this signal is sent. -- ``focused`` - When the datetime has received focus. (since 1.8) -- ``unfocused`` - When the datetime has lost focus. (since 1.8) - - -Enumerations -============ - -.. _Elm_Datetime_Field_Type: - -Datetime fields ---------------- - -.. data:: ELM_DATETIME_YEAR - - Year - -.. data:: ELM_DATETIME_MONTH - - Month - -.. data:: ELM_DATETIME_DATE - - Date - -.. data:: ELM_DATETIME_HOUR - - Hour - -.. data:: ELM_DATETIME_MINUTE - - Minute - -.. data:: ELM_DATETIME_AMPM - - Am/Pm - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.datetime_elm - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.utils.deprecated cimport DEPRECATED -from efl.evas cimport Object as evasObject -from object cimport Object - -from datetime import datetime - +include "datetime_cdef.pxi" cdef class Datetime(Object): """ diff --git a/efl/elementary/datetime_elm.pxd b/efl/elementary/datetime_cdef.pxi similarity index 95% rename from efl/elementary/datetime_elm.pxd rename to efl/elementary/datetime_cdef.pxi index 3bff33c..7aab563 100644 --- a/efl/elementary/datetime_elm.pxd +++ b/efl/elementary/datetime_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Evas_Object, Eina_Bool -from general cimport tm - - cdef extern from "Elementary.h": cpdef enum Elm_Datetime_Field_Type: diff --git a/efl/elementary/datetime_elm.py b/efl/elementary/datetime_elm.py new file mode 100644 index 0000000..819e098 --- /dev/null +++ b/efl/elementary/datetime_elm.py @@ -0,0 +1,8 @@ +from . import Datetime + +from . import ELM_DATETIME_YEAR +from . import ELM_DATETIME_MONTH +from . import ELM_DATETIME_DATE +from . import ELM_DATETIME_HOUR +from . import ELM_DATETIME_MINUTE +from . import ELM_DATETIME_AMPM diff --git a/efl/elementary/dayselector.pyx b/efl/elementary/dayselector.pxi similarity index 65% rename from efl/elementary/dayselector.pyx rename to efl/elementary/dayselector.pxi index 29c5a2c..420025c 100644 --- a/efl/elementary/dayselector.pyx +++ b/efl/elementary/dayselector.pxi @@ -16,112 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`dayselector` Module -######################### - -.. image:: /images/dayselector-preview.png - - -Widget description -================== - -Dayselector displays all seven days of the week and allows the user to -select multiple days. - -The selection can be toggle by just clicking on the day. - -Dayselector also provides the functionality to check whether a day is -selected or not. - -First day of the week is taken from config settings by default. It can be -altered by using the API :py:attr:`~Dayselector.week_start` API. - -APIs are provided for setting the duration of weekend -:py:attr:`~Dayselector.weekend_start` and :py:attr:`~Dayselector.weekend_length` -does this job. - -Two styles of weekdays and weekends are supported in Dayselector. -Application can emit signals on individual check objects for setting the -weekday, weekend styles. - -Once the weekend start day or weekend length changes, all the weekday & -weekend styles will be reset to default style. It's the application's -responsibility to set the styles again by sending corresponding signals. - -"day0" indicates Sunday, "day1" indicates Monday etc. continues and so, -"day6" indicates the Saturday part name. - -Application can change individual day display string by using the API -:py:meth:`~efl.elementary.object.Object.part_text_set`. - -:py:meth:`~efl.elementary.object.Object.part_content_set` API sets the -individual day object only if the passed one is a Check widget. - -Check object representing a day can be set/get by the application by using -the elm_object_part_content_set/get APIs thus providing a way to handle -the different check styles for individual days. - - -Emitted signals -=============== - -- ``dayselector,changed`` - when the user changes the state of a day. -- ``language,changed`` - the program's language changed - - -Enumerations -============ - -.. _Elm_Dayselector_Day: - -Dayselector days ----------------- - -.. data:: ELM_DAYSELECTOR_SUN - - Sunday - -.. data:: ELM_DAYSELECTOR_MON - - Monday - -.. data:: ELM_DAYSELECTOR_TUE - - Tuesday - -.. data:: ELM_DAYSELECTOR_WED - - Wednesday - -.. data:: ELM_DAYSELECTOR_THU - - Thursday - -.. data:: ELM_DAYSELECTOR_FRI - - Friday - -.. data:: ELM_DAYSELECTOR_SAT - - Saturday - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.dayselector - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from efl.utils.conversions cimport python_list_strings_to_array_of_strings, \ - eina_list_strings_to_python_list -from layout_class cimport LayoutClass - +include "dayselector_cdef.pxi" cdef class Dayselector(LayoutClass): """ diff --git a/efl/elementary/dayselector.py b/efl/elementary/dayselector.py new file mode 100644 index 0000000..592b50a --- /dev/null +++ b/efl/elementary/dayselector.py @@ -0,0 +1,10 @@ +from . import Dayselector + +from . import ELM_DAYSELECTOR_SUN +from . import ELM_DAYSELECTOR_MON +from . import ELM_DAYSELECTOR_TUE +from . import ELM_DAYSELECTOR_WED +from . import ELM_DAYSELECTOR_THU +from . import ELM_DAYSELECTOR_FRI +from . import ELM_DAYSELECTOR_SAT +from . import ELM_DAYSELECTOR_MAX diff --git a/efl/elementary/dayselector.pxd b/efl/elementary/dayselector_cdef.pxi similarity index 95% rename from efl/elementary/dayselector.pxd rename to efl/elementary/dayselector_cdef.pxi index 1be455c..f2323e6 100644 --- a/efl/elementary/dayselector.pxd +++ b/efl/elementary/dayselector_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Eina_List - - cdef extern from "Elementary.h": cpdef enum Elm_Dayselector_Day: @@ -15,7 +12,7 @@ cdef extern from "Elementary.h": ctypedef enum Elm_Dayselector_Day: pass - + Evas_Object *elm_dayselector_add(Evas_Object *parent) void elm_dayselector_day_selected_set(Evas_Object *obj, Elm_Dayselector_Day day, Eina_Bool selected) Eina_Bool elm_dayselector_day_selected_get(const Evas_Object *obj, Elm_Dayselector_Day day) diff --git a/efl/elementary/diskselector.pyx b/efl/elementary/diskselector.pxi similarity index 86% rename from efl/elementary/diskselector.pyx rename to efl/elementary/diskselector.pxi index ecc6aaf..e6f1fb3 100644 --- a/efl/elementary/diskselector.pyx +++ b/efl/elementary/diskselector.pxi @@ -15,95 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`diskselector` Module -########################## - -.. image:: /images/diskselector-preview.png - - -Widget description -================== - -A diskselector is a kind of list widget. It scrolls horizontally, -and can contain label and icon objects. Three items are displayed -with the selected one in the middle. - -It can act like a circular list with round mode and labels can be -reduced for a defined length for side items. - - -Emitted signals -=============== - -- ``selected`` - when item is selected, i.e. scroller stops. -- ``clicked`` - This is called when a user clicks an item -- ``scroll,anim,start`` - scrolling animation has started -- ``scroll,anim,stop`` - scrolling animation has stopped -- ``scroll,drag,start`` - dragging the diskselector has started -- ``scroll,drag,stop`` - dragging the diskselector has stopped -- ``focused`` - When the diskselector has received focus. (since 1.8) -- ``unfocused`` - When the diskselector has lost focus. (since 1.8) - -.. note:: The ``scroll,anim,*`` and ``scroll,drag,*`` signals are only emitted - by user intervention. - -Layout content parts -==================== - -- ``icon`` - An icon in the diskselector item - - -Layout text parts -================= - -- ``default`` - Label of the diskselector item - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scrolling behaviour using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.scroller.Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.diskselector - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from object cimport Object -from object_item cimport ObjectItem, _object_item_callback, \ - _object_item_to_python, _object_item_list_to_python, _object_item_callback2 - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - -cdef _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - -# def _cb_object_item_conv(uintptr_t addr): -# cdef Elm_Object_Item *it = addr -# return _object_item_to_python(it) - +include "diskselector_cdef.pxi" cdef class DiskselectorItem(ObjectItem): """ diff --git a/efl/elementary/diskselector.py b/efl/elementary/diskselector.py new file mode 100644 index 0000000..d864137 --- /dev/null +++ b/efl/elementary/diskselector.py @@ -0,0 +1 @@ +from . import Diskselector, DiskselectorItem diff --git a/efl/elementary/diskselector.pxd b/efl/elementary/diskselector_cdef.pxi similarity index 92% rename from efl/elementary/diskselector.pxd rename to efl/elementary/diskselector_cdef.pxi index 123d32e..ccd7e6b 100644 --- a/efl/elementary/diskselector.pxd +++ b/efl/elementary/diskselector_cdef.pxi @@ -1,7 +1,3 @@ -from efl.eina cimport Eina_List -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Smart_Cb -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": Evas_Object *elm_diskselector_add(Evas_Object *parent) void elm_diskselector_round_enabled_set(Evas_Object *obj, Eina_Bool enabled) diff --git a/efl/elementary/general.pxd b/efl/elementary/elementary_cdef.pxi similarity index 88% rename from efl/elementary/general.pxd rename to efl/elementary/elementary_cdef.pxi index 134a03d..7be828b 100644 --- a/efl/elementary/general.pxd +++ b/efl/elementary/elementary_cdef.pxi @@ -1,24 +1,13 @@ -# Copyright (C) 2007-2015 various contributors (see AUTHORS) -# -# This file is part of Python-EFL. -# -# Python-EFL 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-EFL 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-EFL. If not, see . -# +from efl.c_eo cimport Eo as cEo, Eo_Class, eo_add, eo_do, eo_do_ret +from efl.eina cimport Eina_Rectangle, Eina_Compare_Cb, \ + eina_list_free, eina_list_append, eina_stringshare_del +from efl.evas cimport Eina_List, Eina_Bool, Evas_Object, Evas_Font_Size, \ + Evas_Coord, Evas_Callback_Type, Evas_Smart_Cb, Evas_Event_Flags, \ + Evas_Load_Error, Evas_Image_Orient, EVAS_EVENT_FLAG_NONE, \ + evas_object_smart_callback_add, EVAS_CALLBACK_KEY_DOWN, \ + EVAS_CALLBACK_KEY_UP, EVAS_CALLBACK_MOUSE_WHEEL -from efl.evas cimport Eina_List, Eina_Bool -from efl.evas cimport Evas_Object, Evas_Font_Size, Evas_Coord -from efl.evas cimport Evas_Callback_Type +from efl.ecore cimport Ecore_Pos_Map cdef extern from "time.h": @@ -225,6 +214,3 @@ cdef extern from "Elementary.h": int timeout, Elm_Sys_Notify_Send_Cb cb, const void *cb_data) - - -cdef int PY_EFL_ELM_LOG_DOMAIN diff --git a/efl/elementary/entry.pyx b/efl/elementary/entry.pxi similarity index 80% rename from efl/elementary/entry.pyx rename to efl/elementary/entry.pxi index 5d49562..3eaa627 100644 --- a/efl/elementary/entry.pyx +++ b/efl/elementary/entry.pxi @@ -16,614 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`entry` Module -################### - -.. image:: /images/entry-preview.png - - -Widget description -================== - -An entry is a convenience widget which shows a box that the user can -enter text into. - -Entries by default don't scroll, so they grow to accommodate the entire text, -resizing the parent window as needed. This can be changed with the property -:py:attr:`~efl.elementary.entry.Entry.scrollable`. - -They can also be single line or multi line (the default) and when set -to multi line mode they support text wrapping in any of the modes -indicated by :ref:`Elm_Entry_Wrap_Type`. - -Other features include password mode, filtering of inserted text with -:py:meth:`~efl.elementary.entry.Entry.markup_filter_append` and related -functions, inline "items" and formatted markup text. - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scolling behaviour using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.scroller.Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Formatted text -============== - -The markup tags supported by the Entry are defined by the theme, but -even when writing new themes or extensions it's a good idea to stick to -a sane default, to maintain coherency and avoid application breakages. -Currently defined by the default theme are the following tags: - -``
`` - Inserts a line break. -```` - Inserts a paragraph separator. This is preferred over line - breaks. -```` - Inserts a tab. -``...`` - Emphasis. Sets the *oblique* style for the - enclosed text. -``...`` - Sets the **bold** style for the enclosed text. -``...`` - Underlines the enclosed text. -``...`` - Highlights the enclosed text. - - -Special markups -=============== - -Besides those used to format text, entries support two special markup -tags used to insert click-able portions of text or items inlined within -the text. - - -Anchors -------- - -Anchors are similar to HTML anchors. Text can be surrounded by and - tags and an event will be generated when this text is clicked, -like this:: - - This text is outside but this one is an anchor - -The ``href`` attribute in the opening tag gives the name that will be -used to identify the anchor and it can be any valid utf8 string. - -When an anchor is clicked, an ``"anchor,clicked"`` signal is emitted with -an :py:class:`EntryAnchorInfo` in the ``event_info`` parameter for the -callback function. The same applies for ``anchor,in`` (mouse in), -``anchor,out`` (mouse out), ``anchor,down`` (mouse down), and ``anchor,up`` -(mouse up) events on an anchor. - - -Items ------ - -Inlined in the text, any other :py:class:`~efl.elementary.object.Object` can -be inserted by using ```` tags this way:: - - - -Just like with anchors, the ``href`` identifies each item, but these need, -in addition, to indicate their size, which is done using any one of -``size``, ``absize`` or ``relsize`` attributes. These attributes take their -value in the WxH format, where W is the width and H the height of the -item. - -- absize: Absolute pixel size for the item. Whatever value is set will - be the item's size regardless of any scale value the object may have - been set to. The final line height will be adjusted to fit larger items. -- size: Similar to *absize*, but it's adjusted to the scale value set - for the object. -- relsize: Size is adjusted for the item to fit within the current - line height. - -Besides their size, items are specified a ``vsize`` value that affects -how their final size and position are calculated. The possible values -are: - -- ``ascent``: Item will be placed within the line's baseline and its - ascent. That is, the height between the line where all characters are - positioned and the highest point in the line. For ``size`` and - ``absize`` items, the descent value will be added to the total line - height to make them fit. ``relsize`` items will be adjusted to fit - within this space. -- ``full``: Items will be placed between the descent and ascent, or the - lowest point in the line and its highest. - -After the size for an item is calculated, the entry will request an object to -place in its space. For this, the functions set with -:py:meth:`~efl.elementary.entry.Entry.item_provider_append` and related -functions will be called in order until one of them returns a non-*None* value. -If no providers are available, or all of them return *None*, then the entry -falls back to one of the internal defaults, provided the name matches with one -of them. - -All of the following are currently supported: - -- emoticon/angry -- emoticon/angry-shout -- emoticon/crazy-laugh -- emoticon/evil-laugh -- emoticon/evil -- emoticon/goggle-smile -- emoticon/grumpy -- emoticon/grumpy-smile -- emoticon/guilty -- emoticon/guilty-smile -- emoticon/haha -- emoticon/half-smile -- emoticon/happy-panting -- emoticon/happy -- emoticon/indifferent -- emoticon/kiss -- emoticon/knowing-grin -- emoticon/laugh -- emoticon/little-bit-sorry -- emoticon/love-lots -- emoticon/love -- emoticon/minimal-smile -- emoticon/not-happy -- emoticon/not-impressed -- emoticon/omg -- emoticon/opensmile -- emoticon/smile -- emoticon/sorry -- emoticon/squint-laugh -- emoticon/surprised -- emoticon/suspicious -- emoticon/tongue-dangling -- emoticon/tongue-poke -- emoticon/uh -- emoticon/unhappy -- emoticon/very-sorry -- emoticon/what -- emoticon/wink -- emoticon/worried -- emoticon/wtf - -Alternatively, an item may reference an image by its path, using -the URI form ``file:///path/to/an/image.png`` and the entry will then -use that image for the item. - - -Setting entry's style -===================== - -There are 2 major ways to change the entry's style: - -- Theme - set the "base" field to the desired style. -- User style - Pushing overrides to the theme style to the textblock object - by using :py:meth:`~efl.elementary.entry.Entry.text_style_user_push`. - -You should modify the theme when you would like to change the style for -aesthetic reasons. While the user style should be changed when you would -like to change the style to something specific defined at run-time, e.g, -setting font or font size in a text editor. - - -Loading and saving files -======================== - -Entries have convenience functions to load text from a file and save changes -back to it after a short delay. The automatic saving is enabled by default, but -can be disabled with :py:attr:`~efl.elementary.entry.Entry.autosave` and files -can be loaded directly as plain text or have any markup in them recognized. See -:py:attr:`~efl.elementary.entry.Entry.file` for more details. - - -Emitted signals -=============== - -- ``changed``: The text within the entry was changed. -- ``changed,user``: The text within the entry was changed because of user - interaction. -- ``activated``: The enter key was pressed on a single line entry. -- ``aborted``: The escape key was pressed on a single line entry. (since 1.7) -- ``press``: A mouse button has been pressed on the entry. -- ``longpressed``: A mouse button has been pressed and held for a couple - seconds. -- ``clicked``: The entry has been clicked (mouse press and release). -- ``clicked,double``: The entry has been double clicked. -- ``clicked,triple``: The entry has been triple clicked. -- ``focused``: The entry has received focus. -- ``unfocused``: The entry has lost focus. -- ``selection,paste``: A paste of the clipboard contents was requested. -- ``selection,copy``: A copy of the selected text into the clipboard was - requested. -- ``selection,cut``: A cut of the selected text into the clipboard was - requested. -- ``selection,start``: A selection has begun and no previous selection - existed. -- ``selection,changed``: The current selection has changed. -- ``selection,cleared``: The current selection has been cleared. -- ``cursor,changed``: The cursor has changed position. -- ``anchor,clicked``: An anchor has been clicked. The event_info - parameter for the callback will be an :py:class:`EntryAnchorInfo`. -- ``anchor,in``: Mouse cursor has moved into an anchor. The event_info - parameter for the callback will be an :py:class:`EntryAnchorInfo`. -- ``anchor,out``: Mouse cursor has moved out of an anchor. The event_info - parameter for the callback will be an :py:class:`EntryAnchorInfo`. -- ``anchor,up``: Mouse button has been unpressed on an anchor. The event_info - parameter for the callback will be an :py:class:`EntryAnchorInfo`. -- ``anchor,down``: Mouse button has been pressed on an anchor. The event_info - parameter for the callback will be an :py:class:`EntryAnchorInfo`. -- ``preedit,changed``: The preedit string has changed. -- ``language,changed``: Program language changed. -- ``text,set,done``: Whole text has been set to the entry. -- ``rejected``: .Called when some of inputs are rejected by the filter. (since 1.9) - - -Layout content parts -==================== - -- ``icon`` - An icon in the entry -- ``end`` - A content in the end of the entry - - -Layout text parts -================= - -- ``default`` - text of the entry -- ``guide`` - placeholder of the entry - - -Enumerations -============ - -.. _Elm_Entry_Autocapital_Type: - -Autocapitalization types ------------------------- - -.. data:: ELM_AUTOCAPITAL_TYPE_NONE - - No auto-capitalization when typing - -.. data:: ELM_AUTOCAPITAL_TYPE_WORD - - Autocapitalize each word typed - -.. data:: ELM_AUTOCAPITAL_TYPE_SENTENCE - - Autocapitalize the start of each sentence - -.. data:: ELM_AUTOCAPITAL_TYPE_ALLCHARACTER - - Autocapitalize all letters - - -.. _Elm_Entry_Cnp_Mode: - -Copy & paste modes ------------------- - -.. data:: ELM_CNP_MODE_MARKUP - - Copy & paste text with markup tags - -.. data:: ELM_CNP_MODE_NO_IMAGE - - Copy & paste text without item (image) tags - -.. data:: ELM_CNP_MODE_PLAINTEXT - - Copy & paste text without markup tags - - -.. _Elm_Input_Hints: - -Input Hints ------------ - -.. data:: ELM_INPUT_HINT_NONE - - No active hints - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_HINT_AUTO_COMPLETE - - Suggest word auto completion - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_HINT_SENSITIVE_DATA - - typed text should not be stored - - .. versionadded:: 1.12 - - -.. _Elm_Entry_Input_Panel_Lang: - -Input panel language sort order -------------------------------- - -.. data:: ELM_INPUT_PANEL_LANG_AUTOMATIC - - Automatic - -.. data:: ELM_INPUT_PANEL_LANG_ALPHABET - - Alphabetic - - -.. _Elm_Entry_Input_Panel_Layout: - -Input panel layouts -------------------- - -.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL - - Default layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBER - - Number layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_EMAIL - - Email layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_URL - - URL layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_PHONENUMBER - - Phone number layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_IP - - IP layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_MONTH - - Month layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY - - Number only layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_INVALID - - Never use this - -.. data:: ELM_INPUT_PANEL_LAYOUT_HEX - - Hexadecimal layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_TERMINAL - - Command-line terminal layout - -.. data:: ELM_INPUT_PANEL_LAYOUT_PASSWORD - - Like normal, but no auto-correct, no auto-capitalization etc. - -.. data:: ELM_INPUT_PANEL_LAYOUT_DATETIME - - Date and time layout - - .. versionadded:: 1.10 - -.. data:: ELM_INPUT_PANEL_LAYOUT_EMOTICON - - Emoticon layout - - .. versionadded:: 1.10 - - -.. _Elm_Input_Panel_Layout_Normal_Variation: - -Input panel normal layout variation ------------------------------------ - -.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL - - The plain normal layout - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME - - Filename layout. Symbols such as '/' should be disabled - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME - - The name of a person - - .. versionadded:: 1.12 - - -.. _Elm_Input_Panel_Layout_Numberonly_Variation: - -Input panel numberonly layout variation ---------------------------------------- - -.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL - - The numberonly normal layout - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED - - The signed number layout - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL - - The decimal number layout - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL - - The signed and decimal number layout - - .. versionadded:: 1.12 - - -.. _Elm_Input_Panel_Layout_Password_Variation: - -Input panel password layout variation -------------------------------------- - -.. data:: ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL - - The normal password layout - - .. versionadded:: 1.12 - -.. data:: ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY - - The password layout to allow only number - - .. versionadded:: 1.12 - - -.. _Elm_Entry_Input_Panel_Return_Key_Type: - -Input panel return key modes ----------------------------- - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT - - Default - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE - - Done - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO - - Go - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN - - Join - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN - - Login - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT - - Next - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH - - Search - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND - - Send - -.. data:: ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN - - Sign-in - - .. versionadded:: 1.10 - - -.. _Elm_Entry_Text_Format: - -Text format ------------ - -.. data:: ELM_TEXT_FORMAT_PLAIN_UTF8 - - Plain UTF-8 type - -.. data:: ELM_TEXT_FORMAT_MARKUP_UTF8 - - UTF-8 with markup - - -.. _Elm_Entry_Wrap_Type: - -Wrap mode ---------- - -.. data:: ELM_WRAP_NONE - - No wrap - -.. data:: ELM_WRAP_CHAR - - Wrap between characters - -.. data:: ELM_WRAP_WORD - - Wrap in allowed wrapping points (as defined in the unicode standard) - -.. data:: ELM_WRAP_MIXED - - Word wrap, and if that fails, char wrap - - -.. _Elm_Entry_Icon_Type: - -Icon types ----------- - -.. data:: ELM_ICON_NONE - - No icon - -.. data:: ELM_ICON_FILE - - Icon is a file - -.. data:: ELM_ICON_STANDARD - - Icon is set with standards names - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.entry - :parts: 2 - -""" - -from libc.string cimport strdup -from libc.stdlib cimport free -from libc.stdint cimport uintptr_t -from cpython cimport PyUnicode_AsUTF8String, Py_INCREF - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _touni, _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - - -import traceback +include "entry_cdef.pxi" cdef void _entry_context_menu_callback(void *data, Evas_Object *obj, void *event_info) with gil: (callback, a, ka) = data diff --git a/efl/elementary/entry.py b/efl/elementary/entry.py new file mode 100644 index 0000000..0d09433 --- /dev/null +++ b/efl/elementary/entry.py @@ -0,0 +1,71 @@ +from . import Entry, Entry_markup_to_utf8, Entry_utf8_to_markup, \ + markup_to_utf8, utf8_to_markup + +from . import ELM_AUTOCAPITAL_TYPE_NONE +from . import ELM_AUTOCAPITAL_TYPE_WORD +from . import ELM_AUTOCAPITAL_TYPE_SENTENCE +from . import ELM_AUTOCAPITAL_TYPE_ALLCHARACTER + +from . import ELM_CNP_MODE_MARKUP +from . import ELM_CNP_MODE_NO_IMAGE +from . import ELM_CNP_MODE_PLAINTEXT + +from . import ELM_INPUT_HINT_NONE +from . import ELM_INPUT_HINT_AUTO_COMPLETE +from . import ELM_INPUT_HINT_SENSITIVE_DATA + +from . import ELM_INPUT_PANEL_LANG_AUTOMATIC +from . import ELM_INPUT_PANEL_LANG_ALPHABET + +from . import ELM_INPUT_PANEL_LAYOUT_NORMAL +from . import ELM_INPUT_PANEL_LAYOUT_NUMBER +from . import ELM_INPUT_PANEL_LAYOUT_EMAIL +from . import ELM_INPUT_PANEL_LAYOUT_URL +from . import ELM_INPUT_PANEL_LAYOUT_PHONENUMBER +from . import ELM_INPUT_PANEL_LAYOUT_IP +from . import ELM_INPUT_PANEL_LAYOUT_MONTH +from . import ELM_INPUT_PANEL_LAYOUT_NUMBERONLY +from . import ELM_INPUT_PANEL_LAYOUT_INVALID +from . import ELM_INPUT_PANEL_LAYOUT_HEX +from . import ELM_INPUT_PANEL_LAYOUT_TERMINAL +from . import ELM_INPUT_PANEL_LAYOUT_PASSWORD +from . import ELM_INPUT_PANEL_LAYOUT_DATETIME +from . import ELM_INPUT_PANEL_LAYOUT_EMOTICON + +from . import ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL +from . import ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME +from . import ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME + +from . import ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL +from . import ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED +from . import ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL +from . import ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL + +from . import ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL +from . import ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY + +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND +from . import ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN + +from . import ELM_SCROLLER_POLICY_AUTO +from . import ELM_SCROLLER_POLICY_ON +from . import ELM_SCROLLER_POLICY_OFF + +from . import ELM_TEXT_FORMAT_PLAIN_UTF8 +from . import ELM_TEXT_FORMAT_MARKUP_UTF8 + +from . import ELM_WRAP_NONE +from . import ELM_WRAP_CHAR +from . import ELM_WRAP_WORD +from . import ELM_WRAP_MIXED + +from . import ELM_ICON_NONE +from . import ELM_ICON_FILE +from . import ELM_ICON_STANDARD diff --git a/efl/elementary/entry.pxd b/efl/elementary/entry_cdef.pxi similarity index 97% rename from efl/elementary/entry.pxd rename to efl/elementary/entry_cdef.pxi index 10efcb6..a46dbb8 100644 --- a/efl/elementary/entry.pxd +++ b/efl/elementary/entry_cdef.pxi @@ -1,8 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_Rectangle, Evas_Object, \ - Evas_Coord, Evas_Smart_Cb -from efl.elementary.object cimport Elm_Sel_Type, Elm_Sel_Format, \ - Elm_Xdnd_Action - cdef extern from "Elementary.h": cpdef enum Elm_Autocapital_Type: @@ -258,5 +253,3 @@ cdef extern from "Elementary.h": const char * elm_entry_context_menu_item_label_get(const Elm_Entry_Context_Menu_Item *item) void elm_entry_context_menu_item_icon_get(const Elm_Entry_Context_Menu_Item *item, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type) - - Eina_Bool elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata) diff --git a/efl/elementary/fileselector.pyx b/efl/elementary/fileselector.pxi similarity index 82% rename from efl/elementary/fileselector.pyx rename to efl/elementary/fileselector.pxi index 7cd090b..80ea7f6 100644 --- a/efl/elementary/fileselector.pyx +++ b/efl/elementary/fileselector.pxi @@ -16,158 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`fileselector` Module -########################## - -.. image:: /images/fileselector-preview.png - - -Widget description -================== - -A file selector is a widget that allows a user to navigate through a -file system, reporting file selections back via its API. - -It contains shortcut buttons for home directory (*~*) and to jump one -directory upwards (..), as well as cancel/ok buttons to confirm/cancel a -given selection. After either one of those two former actions, the file -selector will issue its ``"done"`` smart callback. - -There's a text entry on it, too, showing the name of the current -selection. There's the possibility of making it editable, so it is -useful on file saving dialogs on applications, where one gives a file -name to save contents to, in a given directory in the system. This -custom file name will be reported on the ``"done"`` smart callback -(explained in sequence). - -Finally, it has a view to display file system items into in two possible -forms: - -- list -- grid - -If Elementary is built with support of the Ethumb thumbnailing library, -the second form of view will display preview thumbnails of files which -it supports. - - -Emitted signals -=============== - -- ``activated`` - the user activated a file. This can happen by - double-clicking or pressing Enter key. (**event_info** is a string with the - activated file path) -- ``selected`` - the user has clicked on a file (when not in folders-only - mode) or directory (when in folders-only mode) -- ``directory,open`` - the list has been populated with new content - (*event_info* is the directory's path) -- ``done`` - the user has clicked on the "ok" or "cancel" - buttons (*event_info* is the selection's path) - - -Layout text parts -================= - -- ``ok`` - OK button label if the ok button is set. (since 1.8) -- ``cancel`` - Cancel button label if the cancel button is set. (since 1.8) - - -Enumerations -============ - -.. _Elm_Fileselector_Mode: - -Fileselector modes ------------------- - -.. data:: ELM_FILESELECTOR_LIST - - Layout as a list - -.. data:: ELM_FILESELECTOR_GRID - - Layout as a grid - - -.. _Elm_Fileselector_Sort: - -Fileselector sort method ------------------------- - -.. data:: ELM_FILESELECTOR_SORT_BY_FILENAME_ASC - - Sort by filename in ascending order - - .. versionadded:: 1.9 - -.. data:: ELM_FILESELECTOR_SORT_BY_FILENAME_DESC - - Sort by filename in descending order - - .. versionadded:: 1.9 - -.. data:: ELM_FILESELECTOR_SORT_BY_TYPE_ASC - - Sort by file type in ascending order - - .. versionadded:: 1.9 - -.. data:: ELM_FILESELECTOR_SORT_BY_TYPE_DESC - - Sort by file type in descending order - - .. versionadded:: 1.9 - -.. data:: ELM_FILESELECTOR_SORT_BY_SIZE_ASC - - Sort by file size in ascending order - - .. versionadded:: 1.9 - -.. data:: ELM_FILESELECTOR_SORT_BY_SIZE_DESC - - Sort by file size in descending order - - .. versionadded:: 1.9 - -.. data:: ELM_FILESELECTOR_SORT_BY_MODIFIED_ASC - - Sort by file modification date in ascending order - - .. versionadded:: 1.9 - -.. data:: ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC - - Sort by file modification date in descending order - - .. versionadded:: 1.9 - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.fileselector - :parts: 2 - -""" - - -from cpython cimport PyUnicode_AsUTF8String, Py_INCREF -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - -import traceback - - -cdef _cb_string_conv(void *addr): - return _ctouni(addr) if addr is not NULL else None - +include "fileselector_cdef.pxi" cdef Eina_Bool py_elm_fileselector_custom_filter_cb(const char *path, Eina_Bool is_dir, void *data) with gil: cb_func, cb_data = data diff --git a/efl/elementary/fileselector.py b/efl/elementary/fileselector.py new file mode 100644 index 0000000..185895e --- /dev/null +++ b/efl/elementary/fileselector.py @@ -0,0 +1,14 @@ +from . import Fileselector + +from . import ELM_FILESELECTOR_LIST +from . import ELM_FILESELECTOR_GRID + +from . import ELM_FILESELECTOR_SORT_BY_FILENAME_ASC +from . import ELM_FILESELECTOR_SORT_BY_FILENAME_DESC +from . import ELM_FILESELECTOR_SORT_BY_TYPE_ASC +from . import ELM_FILESELECTOR_SORT_BY_TYPE_DESC +from . import ELM_FILESELECTOR_SORT_BY_SIZE_ASC +from . import ELM_FILESELECTOR_SORT_BY_SIZE_DESC +from . import ELM_FILESELECTOR_SORT_BY_MODIFIED_ASC +from . import ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC +from . import ELM_FILESELECTOR_SORT_LAST diff --git a/efl/elementary/fileselector_button.pyx b/efl/elementary/fileselector_button.pxi similarity index 76% rename from efl/elementary/fileselector_button.pyx rename to efl/elementary/fileselector_button.pxi index 38ea009..4cf9f9e 100644 --- a/efl/elementary/fileselector_button.pyx +++ b/efl/elementary/fileselector_button.pxi @@ -16,102 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`fileselector_button` Module -################################# - -.. image:: /images/fileselector-button-preview.png - - -Widget description -================== - -This is a button that, when clicked, creates an Elementary window (or -inner window) with a :py:class:`~efl.elementary.fileselector.Fileselector` -within. - -When a file is chosen, the (inner) window is closed and the button emits -a signal having the selected file as it's ``event_info``. - -This widget encapsulates operations on its internal file selector on its -own API. There is less control over its file selector than that one -would have instantiating one directly. - - -Available styles -================ - -- ``default`` -- ``anchor`` -- ``hoversel_vertical`` -- ``hoversel_vertical_entry`` - - -Emitted signals -=============== - -- ``file,chosen`` - the user has selected a path which comes as the - ``event_info`` data -- ``language,changed`` - the program's language changed - - -Layout text parts -================= - -- ``default`` - Label of the fileselector_button - - -Layout content parts -==================== - -- ``icon`` - Icon of the fileselector_button - - -Fileselector Interface -====================== - -This widget supports the fileselector interface. - -If you wish to control the fileselector part using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.fileselector.Fileselector` class -using multiple inheritance, for example:: - - class CustomFileselectorButton(Fileselector, FileselectorButton): - def __init__(self, canvas, *args, **kwargs): - FileselectorButton.__init__(self, canvas) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.fileselector_button - :parts: 2 - - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject - -from button cimport Button - -from efl.utils.deprecated cimport DEPRECATED -from fileselector cimport elm_fileselector_path_set, \ - elm_fileselector_path_get, elm_fileselector_expandable_set, \ - elm_fileselector_expandable_get, elm_fileselector_folder_only_set, \ - elm_fileselector_folder_only_get, elm_fileselector_is_save_set, \ - elm_fileselector_is_save_get - - -cdef _cb_string_conv(void *addr): - return _ctouni(addr) if addr is not NULL else None - +include "fileselector_button_cdef.pxi" cdef class FileselectorButton(Button): """ diff --git a/efl/elementary/fileselector_button.py b/efl/elementary/fileselector_button.py new file mode 100644 index 0000000..25f0c9e --- /dev/null +++ b/efl/elementary/fileselector_button.py @@ -0,0 +1 @@ +from . import FileselectorButton diff --git a/efl/elementary/fileselector_button.pxd b/efl/elementary/fileselector_button_cdef.pxi similarity index 92% rename from efl/elementary/fileselector_button.pxd rename to efl/elementary/fileselector_button_cdef.pxi index e10e19d..8575f11 100644 --- a/efl/elementary/fileselector_button.pxd +++ b/efl/elementary/fileselector_button_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - cdef extern from "Elementary.h": Evas_Object * elm_fileselector_button_add(Evas_Object *parent) void elm_fileselector_button_window_title_set(Evas_Object *obj, const char *title) diff --git a/efl/elementary/fileselector.pxd b/efl/elementary/fileselector_cdef.pxi similarity index 97% rename from efl/elementary/fileselector.pxd rename to efl/elementary/fileselector_cdef.pxi index 4749f3e..5aad385 100644 --- a/efl/elementary/fileselector.pxd +++ b/efl/elementary/fileselector_cdef.pxi @@ -1,7 +1,3 @@ -from efl.eina cimport Eina_Bool, Eina_List -from efl.evas cimport Evas_Object, Evas_Coord - - cdef extern from "Elementary.h": cpdef enum Elm_Fileselector_Mode: diff --git a/efl/elementary/fileselector_entry.pyx b/efl/elementary/fileselector_entry.pxi similarity index 77% rename from efl/elementary/fileselector_entry.pyx rename to efl/elementary/fileselector_entry.pxi index ce27d4f..d258897 100644 --- a/efl/elementary/fileselector_entry.pyx +++ b/efl/elementary/fileselector_entry.pxi @@ -16,116 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`fileselector_entry` Module -################################ - -.. image:: /images/fileselector-entry-preview.png - - -Widget description -================== - -This is an entry made to be filled with or display a file -system path string. - -Besides the entry itself, the widget has a -:py:class:`~efl.elementary.fileselector_button.FileselectorButton` on its side, -which will raise an internal -:py:class:`~efl.elementary.fileselector.Fileselector`, when clicked, for path -selection aided by file system navigation. - -This file selector may appear in an Elementary window or in an -inner window. When a file is chosen from it, the (inner) window -is closed and the selected file's path string is exposed both as -a smart event and as the new text on the entry. - -This widget encapsulates operations on its internal file -selector on its own API. There is less control over its file -selector than that one would have instantiating one directly. - - -Emitted signals -=============== - -- ``changed`` - The text within the entry was changed -- ``activated`` - The entry has had editing finished and - changes are to be "committed" -- ``press`` - The entry has been clicked -- ``longpressed`` - The entry has been clicked (and held) for a - couple seconds -- ``clicked`` - The entry has been clicked -- ``clicked,double`` - The entry has been double clicked -- ``focused`` - The entry has received focus -- ``unfocused`` - The entry has lost focus -- ``selection,paste`` - A paste action has occurred on the - entry -- ``selection,copy`` - A copy action has occurred on the entry -- ``selection,cut`` - A cut action has occurred on the entry -- ``unpressed`` - The file selector entry's button was released - after being pressed. -- ``file,chosen`` - The user has selected a path via the file - selector entry's internal file selector, whose string - comes as the ``event_info`` data. -- ``language,changed`` - the program's language changed - - -Layout text parts -================= - -- ``default`` - Label of the fileselector_button - - -Layout content parts -==================== - -- ``button icon`` - Button icon of the fileselector_entry - - -Fileselector Interface -====================== - -This widget supports the fileselector interface. - -If you wish to control the fileselector part using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.fileselector.Fileselector` class -using multiple inheritance, for example:: - - class CustomFileselectorButton(Fileselector, FileselectorButton): - def __init__(self, canvas, *args, **kwargs): - FileselectorButton.__init__(self, canvas) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.fileselector_entry - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - -from efl.utils.deprecated cimport DEPRECATED -from fileselector cimport elm_fileselector_path_set, \ - elm_fileselector_path_get, elm_fileselector_expandable_set, \ - elm_fileselector_expandable_get, elm_fileselector_folder_only_set, \ - elm_fileselector_folder_only_get, elm_fileselector_is_save_set, \ - elm_fileselector_is_save_get, elm_fileselector_selected_set, \ - elm_fileselector_selected_get - - -cdef _cb_string_conv(void *addr): - return _ctouni(addr) if addr is not NULL else None - +include "fileselector_entry_cdef.pxi" cdef class FileselectorEntry(LayoutClass): """ diff --git a/efl/elementary/fileselector_entry.py b/efl/elementary/fileselector_entry.py new file mode 100644 index 0000000..5062ec1 --- /dev/null +++ b/efl/elementary/fileselector_entry.py @@ -0,0 +1 @@ +from . import FileselectorEntry diff --git a/efl/elementary/fileselector_entry.pxd b/efl/elementary/fileselector_entry_cdef.pxi similarity index 92% rename from efl/elementary/fileselector_entry.pxd rename to efl/elementary/fileselector_entry_cdef.pxi index ac71683..e4e1ba4 100644 --- a/efl/elementary/fileselector_entry.pxd +++ b/efl/elementary/fileselector_entry_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - cdef extern from "Elementary.h": Evas_Object * elm_fileselector_entry_add(Evas_Object *parent) void elm_fileselector_entry_window_title_set(Evas_Object *obj, const char *title) diff --git a/efl/elementary/flip.pyx b/efl/elementary/flip.pxi similarity index 63% rename from efl/elementary/flip.pyx rename to efl/elementary/flip.pxi index 4fa9f8d..98b7f4c 100644 --- a/efl/elementary/flip.pyx +++ b/efl/elementary/flip.pxi @@ -16,175 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`flip` Module -################## - -.. image:: /images/flip-preview.png - - -Widget description -================== - -This widget holds two content :py:class:`efl.evas.Object`: one on -the front and one on the back. It allows you to flip from front to back -and vice-versa using various animations. - -If either the front or back contents are not set the flip will treat that -as transparent. So if you were to set the front content but not the back, -and then call :py:meth:`Flip.go` you would see whatever is below the flip. - -For a list of supported animations see :py:meth:`Flip.go`. - - -Emitted signals -=============== - -- ``animate,begin`` - when a flip animation was started -- ``animate,done`` - when a flip animation is finished - - -Layout content parts -==================== - -- ``front`` - A front content of the flip -- ``back`` - A back content of the flip - - -Enumerations -============ - -.. _Elm_Flip_Direction: - -Flip directions ---------------- - -.. data:: ELM_FLIP_DIRECTION_UP - - Allows interaction with the top of the widget. - -.. data:: ELM_FLIP_DIRECTION_DOWN - - Allows interaction with the bottom of the widget. - -.. data:: ELM_FLIP_DIRECTION_LEFT - - Allows interaction with the left portion of - - the widget. -.. data:: ELM_FLIP_DIRECTION_RIGHT - - Allows interaction with the right portion of - - the widget. - - -.. _Elm_Flip_Interaction: - -Flip interaction modes ----------------------- - -.. data:: ELM_FLIP_INTERACTION_NONE - - No interaction is allowed - -.. data:: ELM_FLIP_INTERACTION_ROTATE - - Interaction will cause rotate animation - -.. data:: ELM_FLIP_INTERACTION_CUBE - - Interaction will cause cube animation - -.. data:: ELM_FLIP_INTERACTION_PAGE - - Interaction will cause page animation - - -.. _Elm_Flip_Mode: - -Flip types ----------- - -.. data:: ELM_FLIP_ROTATE_Y_CENTER_AXIS - - Rotate the currently visible content around a vertical axis in the - middle of its width, the other content is shown as the other side of the - flip. - -.. data:: ELM_FLIP_ROTATE_X_CENTER_AXIS - - Rotate the currently visible content around a horizontal axis in the - middle of its height, the other content is shown as the other side of - the flip. - -.. data:: ELM_FLIP_ROTATE_XZ_CENTER_AXIS - - Rotate the currently visible content around a diagonal axis in the - middle of its width, the other content is shown as the other side of the - flip. - -.. data:: ELM_FLIP_ROTATE_YZ_CENTER_AXIS - - Rotate the currently visible content around a diagonal axis in the - middle of its height, the other content is shown as the other side of - the flip. - -.. data:: ELM_FLIP_CUBE_LEFT - - Rotate the currently visible content to the left as if the flip was a - cube, the other content is show as the right face of the cube. - -.. data:: ELM_FLIP_CUBE_RIGHT - - Rotate the currently visible content to the right as if the flip was a - cube, the other content is show as the left face of the cube. - -.. data:: ELM_FLIP_CUBE_UP - - Rotate the currently visible content up as if the flip was a cube, the - other content is show as the bottom face of the cube. - -.. data:: ELM_FLIP_CUBE_DOWN - - Rotate the currently visible content down as if the flip was a cube, the - other content is show as the upper face of the cube. - -.. data:: ELM_FLIP_PAGE_LEFT - - Move the currently visible content to the left as if the flip was a - book, the other content is shown as the page below that. - -.. data:: ELM_FLIP_PAGE_RIGHT - - Move the currently visible content to the right as if the flip was a - book, the other content is shown as the page below that. - -.. data:: ELM_FLIP_PAGE_UP - - Move the currently visible content up as if the flip was a book, the - other content is shown as the page below that. - -.. data:: ELM_FLIP_PAGE_DOWN - - Move the currently visible content down as if the flip was a book, the - other content is shown as the page below that. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.flip - :parts: 2 - - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from object cimport Object - +include "flip_cdef.pxi" cdef class Flip(Object): """ diff --git a/efl/elementary/flip.py b/efl/elementary/flip.py new file mode 100644 index 0000000..c7b1172 --- /dev/null +++ b/efl/elementary/flip.py @@ -0,0 +1,24 @@ +from . import Flip + +from . import ELM_FLIP_DIRECTION_UP +from . import ELM_FLIP_DIRECTION_DOWN +from . import ELM_FLIP_DIRECTION_LEFT +from . import ELM_FLIP_DIRECTION_RIGHT + +from . import ELM_FLIP_INTERACTION_NONE +from . import ELM_FLIP_INTERACTION_ROTATE +from . import ELM_FLIP_INTERACTION_CUBE +from . import ELM_FLIP_INTERACTION_PAGE + +from . import ELM_FLIP_ROTATE_Y_CENTER_AXIS +from . import ELM_FLIP_ROTATE_X_CENTER_AXIS +from . import ELM_FLIP_ROTATE_XZ_CENTER_AXIS +from . import ELM_FLIP_ROTATE_YZ_CENTER_AXIS +from . import ELM_FLIP_CUBE_LEFT +from . import ELM_FLIP_CUBE_RIGHT +from . import ELM_FLIP_CUBE_UP +from . import ELM_FLIP_CUBE_DOWN +from . import ELM_FLIP_PAGE_LEFT +from . import ELM_FLIP_PAGE_RIGHT +from . import ELM_FLIP_PAGE_UP +from . import ELM_FLIP_PAGE_DOWN diff --git a/efl/elementary/flip.pxd b/efl/elementary/flip_cdef.pxi similarity index 97% rename from efl/elementary/flip.pxd rename to efl/elementary/flip_cdef.pxi index 0cc1e1f..ac5eca9 100644 --- a/efl/elementary/flip.pxd +++ b/efl/elementary/flip_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - - cdef extern from "Elementary.h": cpdef enum Elm_Flip_Direction: diff --git a/efl/elementary/flipselector.pyx b/efl/elementary/flipselector.pxi similarity index 87% rename from efl/elementary/flipselector.pyx rename to efl/elementary/flipselector.pxi index 549fa05..77980e5 100644 --- a/efl/elementary/flipselector.pyx +++ b/efl/elementary/flipselector.pxi @@ -16,67 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`flipselector` Module -########################## - -.. image:: /images/flipselector-preview.png - - -Widget description -================== - -A flip selector is a widget to show a set of *text* items, one at a time, with -the same sheet switching style as the :py:class:`~efl.elementary.clock.Clock` -widget, when one changes the current displaying sheet (thus, the "flip" in the -name). - -User clicks to flip sheets which are *held* for some time will -make the flip selector to flip continuously and automatically for -the user. The interval between flips will keep growing in time, -so that it helps the user to reach an item which is distant from -the current selection. - - -Emitted signals -=============== - -- ``selected`` - when the widget's selected text item is changed -- ``overflowed`` - when the widget's current selection is changed - from the first item in its list to the last -- ``underflowed`` - when the widget's current selection is changed - from the last item in its list to the first -- ``focused`` - When the flipselector has received focus. (since 1.8) -- ``unfocused`` - When the flipselector has lost focus. (since 1.8) - - -Layout text parts -================= - -- ``default`` - label of the flipselector item - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.flipselector - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from object cimport Object -from object_item cimport _object_item_to_python, _object_item_callback, \ - _object_item_list_to_python, _object_item_callback2, ObjectItem - -def _cb_object_item_conv(uintptr_t addr): - cdef Elm_Object_Item *it = addr - return _object_item_to_python(it) +include "flipselector_cdef.pxi" cdef class FlipSelectorItem(ObjectItem): """ diff --git a/efl/elementary/flipselector.py b/efl/elementary/flipselector.py new file mode 100644 index 0000000..2fcc32e --- /dev/null +++ b/efl/elementary/flipselector.py @@ -0,0 +1 @@ +from . import Flipselector, FlipselectorItem diff --git a/efl/elementary/flipselector.pxd b/efl/elementary/flipselector_cdef.pxi similarity index 91% rename from efl/elementary/flipselector.pxd rename to efl/elementary/flipselector_cdef.pxi index 9f94245..6d854ec 100644 --- a/efl/elementary/flipselector.pxd +++ b/efl/elementary/flipselector_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Eina_List -from efl.evas cimport Evas_Smart_Cb -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": Evas_Object *elm_flipselector_add(Evas_Object *parent) void elm_flipselector_flip_next(Evas_Object *obj) diff --git a/efl/elementary/frame.pyx b/efl/elementary/frame.pxi similarity index 78% rename from efl/elementary/frame.pyx rename to efl/elementary/frame.pxi index 4b2a0f0..e60ed32 100644 --- a/efl/elementary/frame.pyx +++ b/efl/elementary/frame.pxi @@ -15,64 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . - -""" - -:mod:`frame` Module -################### - -.. image:: /images/frame-preview.png - - -Widget description -================== - -Frame is a widget that holds some content and has a title. - - -Available styles -================ - -- default -- pad_small -- pad_medium -- pad_large -- pad_huge -- outdent_top -- outdent_bottom - -Out of all these styles only default shows the title. - - -Emitted signals -=============== - -- ``clicked`` - The user has clicked the frame's label - - -Layout content parts -==================== - -- ``default`` - A content of the frame - - -Layout text parts -================= - -- ``default`` - Label of the frame - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.frame - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "frame_cdef.pxi" cdef class Frame(LayoutClass): """ diff --git a/efl/elementary/frame.py b/efl/elementary/frame.py new file mode 100644 index 0000000..b6fd165 --- /dev/null +++ b/efl/elementary/frame.py @@ -0,0 +1 @@ +from . import Frame diff --git a/efl/elementary/frame.pxd b/efl/elementary/frame_cdef.pxi similarity index 92% rename from efl/elementary/frame.pxd rename to efl/elementary/frame_cdef.pxi index dd13122..6614f01 100644 --- a/efl/elementary/frame.pxd +++ b/efl/elementary/frame_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_frame_add(Evas_Object *parent) void elm_frame_autocollapse_set(Evas_Object *obj, Eina_Bool autocollapse) diff --git a/efl/elementary/general.py b/efl/elementary/general.py new file mode 100644 index 0000000..a76111a --- /dev/null +++ b/efl/elementary/general.py @@ -0,0 +1,56 @@ +from . import init, shutdown, run, exit, \ + on_ethumb_connect, on_config_all_changed, on_policy_changed, \ + on_process_background, on_process_background, \ + on_sys_notify_notification_closed, on_sys_notify_action_invoked, \ + policy_set, policy_get, process_state_get, coords_finger_size_adjust, \ + language_set, cache_all_flush, font_properties_get, font_properties_free, \ + font_fontconfig_name_get, object_tree_dump, object_tree_dot_dump, \ + sys_notify_close, sys_notify_send + +from . import ELM_ECORE_EVENT_ETHUMB_CONNECT +from . import ELM_EVENT_CONFIG_ALL_CHANGED +from . import ELM_EVENT_POLICY_CHANGED +from . import ELM_EVENT_PROCESS_BACKGROUND +from . import ELM_EVENT_PROCESS_FOREGROUND +from . import ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED +from . import ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED +from . import ELM_EVENT_SYSTRAY_READY + +from . import ELM_OBJECT_LAYER_BACKGROUND +from . import ELM_OBJECT_LAYER_DEFAULT +from . import ELM_OBJECT_LAYER_FOCUS +from . import ELM_OBJECT_LAYER_TOOLTIP +from . import ELM_OBJECT_LAYER_CURSOR +from . import ELM_OBJECT_LAYER_LAST + +from . import ELM_POLICY_QUIT +from . import ELM_POLICY_EXIT +from . import ELM_POLICY_THROTTLE +from . import ELM_POLICY_LAST + +from . import ELM_POLICY_QUIT_NONE +from . import ELM_POLICY_QUIT_LAST_WINDOW_CLOSED + +from . import ELM_POLICY_EXIT_NONE +from . import ELM_POLICY_EXIT_WINDOWS_DEL + +from . import ELM_POLICY_THROTTLE_CONFIG +from . import ELM_POLICY_THROTTLE_HIDDEN_ALWAYS +from . import ELM_POLICY_THROTTLE_NEVER + +from . import ELM_SYS_NOTIFY_CLOSED_EXPIRED +from . import ELM_SYS_NOTIFY_CLOSED_DISMISSED +from . import ELM_SYS_NOTIFY_CLOSED_REQUESTED +from . import ELM_SYS_NOTIFY_CLOSED_UNDEFINED + +from . import ELM_SYS_NOTIFY_URGENCY_LOW +from . import ELM_SYS_NOTIFY_URGENCY_NORMAL +from . import ELM_SYS_NOTIFY_URGENCY_CRITICAL + +from . import ELM_GLOB_MATCH_NO_ESCAPE +from . import ELM_GLOB_MATCH_PATH +from . import ELM_GLOB_MATCH_PERIOD +from . import ELM_GLOB_MATCH_NOCASE + +from . import ELM_PROCESS_STATE_FOREGROUND +from . import ELM_PROCESS_STATE_BACKGROUND diff --git a/efl/elementary/gengrid.pxi b/efl/elementary/gengrid.pxi new file mode 100644 index 0000000..4c8b476 --- /dev/null +++ b/efl/elementary/gengrid.pxi @@ -0,0 +1,142 @@ +# Copyright (C) 2007-2015 various contributors (see AUTHORS) +# +# This file is part of Python-EFL. +# +# Python-EFL 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-EFL 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-EFL. If not, see . +# + +include "gengrid_cdef.pxi" + +cdef char *_py_elm_gengrid_item_text_get(void *data, Evas_Object *obj, const char *part) with gil: + cdef: + GengridItem item = data + unicode u = _ctouni(part) + + func = item.item_class._text_get_func + if func is None: + return NULL + + try: + o = object_from_instance(obj) + ret = func(o, u, item.item_data) + except Exception: + traceback.print_exc() + return NULL + + if ret is not None: + if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret) + return strdup(ret) + else: + return NULL + +cdef Evas_Object *_py_elm_gengrid_item_content_get(void *data, Evas_Object *obj, const char *part) with gil: + cdef: + GengridItem item = data + unicode u = _ctouni(part) + evasObject icon + + func = item.item_class._content_get_func + if func is None: + return NULL + + o = object_from_instance(obj) + + try: + icon = func(o, u, item.item_data) + except Exception: + traceback.print_exc() + return NULL + + if icon is not None: + return icon.obj + else: + return NULL + +cdef Eina_Bool _py_elm_gengrid_item_state_get(void *data, Evas_Object *obj, const char *part) with gil: + cdef: + GengridItem item = data + unicode u = _ctouni(part) + + func = item.item_class._state_get_func + if func is None: + return 0 + + try: + o = object_from_instance(obj) + ret = func(o, part, item.item_data) + except Exception: + traceback.print_exc() + return 0 + + return ret if ret is not None else 0 + +cdef void _py_elm_gengrid_object_item_del(void *data, Evas_Object *obj) with gil: + cdef GengridItem item = data + + if item is None: + return + + func = item.item_class._del_func + + if func is not None: + try: + o = object_from_instance(obj) + func(o, item.item_data) + except Exception: + traceback.print_exc() + + item._unset_obj() + +cdef void _py_elm_gengrid_item_func(void *data, Evas_Object *obj, void *event_info) with gil: + cdef GengridItem item + + assert data != NULL, "data is NULL in Gengrid select cb" + + item = data + + if item.cb_func is not None: + try: + o = object_from_instance(obj) + item.cb_func(item, o, item.func_data) + except Exception: + traceback.print_exc() + +cdef int _gengrid_compare_cb(const void *data1, const void *data2) with gil: + cdef: + Elm_Object_Item *citem1 = data1 + Elm_Object_Item *citem2 = data2 + GengridItem item1 = elm_object_item_data_get(citem1) + GengridItem item2 = elm_object_item_data_get(citem2) + object func + + if item1.comparison_func is not None: + func = item1.comparison_func + elif item2.comparison_func is not None: + func = item2.comparison_func + else: + return 0 + + ret = func(item1, item2) + if ret is not None: + try: + return ret + except Exception: + traceback.print_exc() + return 0 + else: + return 0 + +include "gengrid_widget.pxi" +include "gengrid_item_class.pxi" +include "gengrid_item.pxi" diff --git a/efl/elementary/gengrid.py b/efl/elementary/gengrid.py new file mode 100644 index 0000000..81e57a9 --- /dev/null +++ b/efl/elementary/gengrid.py @@ -0,0 +1,19 @@ +from . import Gengrid, GengridItem, GengridItemClass + +from . import ELM_GENLIST_ITEM_SCROLLTO_NONE +from . import ELM_GENLIST_ITEM_SCROLLTO_IN +from . import ELM_GENLIST_ITEM_SCROLLTO_TOP +from . import ELM_GENLIST_ITEM_SCROLLTO_MIDDLE + +from . import ELM_OBJECT_SELECT_MODE_DEFAULT +from . import ELM_OBJECT_SELECT_MODE_ALWAYS +from . import ELM_OBJECT_SELECT_MODE_NONE +from . import ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY +from . import ELM_OBJECT_SELECT_MODE_MAX + +from . import ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT +from . import ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL +from . import ELM_OBJECT_MULTI_SELECT_MODE_MAX + +from . import ELM_GENGRID_REORDER_TYPE_NORMAL +from . import ELM_GENGRID_REORDER_TYPE_SWAP diff --git a/efl/elementary/gengrid.pyx b/efl/elementary/gengrid.pyx deleted file mode 100644 index 6c3ed3f..0000000 --- a/efl/elementary/gengrid.pyx +++ /dev/null @@ -1,488 +0,0 @@ -# Copyright (C) 2007-2015 various contributors (see AUTHORS) -# -# This file is part of Python-EFL. -# -# Python-EFL 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-EFL 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-EFL. If not, see . -# - -""" - -:mod:`gengrid` Module -##################### - -.. image:: /images/gengrid-preview.png - - -Widget description -================== - -This widget aims to position objects in a grid layout while actually -creating and rendering only the visible ones, using the same idea as the -:py:class:`~efl.elementary.genlist.Genlist`: the user defines a **class** for -each item, specifying functions that will be called at object creation, -deletion, etc. When those items are selected by the user, a callback -function is issued. Users may interact with a gengrid via the mouse (by -clicking on items to select them and clicking on the grid's viewport and -swiping to pan the whole view) or via the keyboard, navigating through -item with the arrow keys. - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scolling behaviour using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.scroller.Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Gengrid layouts -=============== - -Gengrid may layout its items in one of two possible layouts: - -- horizontal or -- vertical. - -When in "horizontal mode", items will be placed in **columns**, from top -to bottom and, when the space for a column is filled, another one is -started on the right, thus expanding the grid horizontally, making for -horizontal scrolling. When in "vertical mode" , though, items will be -placed in **rows**, from left to right and, when the space for a row is -filled, another one is started below, thus expanding the grid vertically -(and making for vertical scrolling). - - -Gengrid items -============= - -An item in a gengrid can have 0 or more texts (they can be regular text -or textblock Evas objects - that's up to the style to determine), 0 or -more contents (which are simply objects swallowed into the gengrid -item's theming Edje object) and 0 or more **boolean states**, which -have the behavior left to the user to define. The Edje part names for -each of these properties will be looked up, in the theme file for the -gengrid, under the Edje (string) data items named ``"texts"``, -``"contents"`` and ``"states"``, respectively. For each of those -properties, if more than one part is provided, they must have names -listed separated by spaces in the data fields. For the default gengrid -item theme, we have **one** text part (``"elm.text"``), **two** content -parts (``"elm.swalllow.icon"`` and ``"elm.swallow.end"``) and **no** -state parts. - -A gengrid item may be at one of several styles. Elementary provides one -by default - "default", but this can be extended by system or -application custom themes/overlays/extensions (see -:py:class:`~efl.elementary.theme.Theme` for more details). - - -Gengrid item classes -==================== - -In order to have the ability to add and delete items on the fly, gengrid -implements a class (callback) system where the application provides a -structure with information about that type of item (gengrid may contain -multiple different items with different classes, states and styles). -Gengrid will call the functions in this struct (methods) when an item is -"realized" (i.e., created dynamically, while the user is scrolling the -grid). All objects will simply be deleted when no longer needed with -:meth:`~efl.eo.Eo.delete`. The :class:`GengridItemClass` class contains the -following attributes and methods: - -- ``item_style`` - This is a constant string and simply defines the name - of the item style. It **must** be specified and the default should be - ``default``. -- ``func.text_get`` - This function is called when an item object is - actually created. The ``data`` parameter will point to the same data - passed to :meth:`~Gengrid.item_append` and related item creation - functions. The ``obj`` parameter is the gengrid object itself, while - the ``part`` one is the name string of one of the existing text parts - in the Edje group implementing the item's theme. - See :py:meth:`GengridItemClass.text_get`. -- ``func.content_get`` - This function is called when an item object is - actually created. The ``data`` parameter will point to the same data - passed to :py:meth:`GengridItem.append_to` and related item creation - functions. The ``obj`` parameter is the gengrid object itself, while - the ``part`` one is the name string of one of the existing (content) - swallow parts in the Edje group implementing the item's theme. It must - return ``None,`` when no content is desired, or a valid object handle, - otherwise. The object will be deleted by the gengrid on its deletion - or when the item is "unrealized". See :py:meth:`GengridItemClass.content_get`. -- ``func.state_get`` - This function is called when an item object is - actually created. The ``data`` parameter will point to the same data - passed to :py:meth:`GengridItem.append_to` and related item creation - functions. The ``obj`` parameter is the gengrid object itself, while - the ``part`` one is the name string of one of the state parts in the - Edje group implementing the item's theme. Return ``False`` for - false/off or ``True`` for true/on. Gengrids will emit a signal to - its theming Edje object with ``"elm,state,xxx,active"`` and ``"elm"`` - as "emission" and "source" arguments, respectively, when the state is - true (the default is false), where ``xxx`` is the name of the (state) - part. See :py:meth:`GengridItemClass.state_get`. -- ``func.del`` - This is called when - :meth:`efl.elementary.object_item.ObjectItem.delete` is called on - an item or :meth:`~Gengrid.clear` is called on the gengrid. This is - intended for use when gengrid items are deleted, so any data attached - to the item (e.g. its data parameter on creation) can be deleted. See - :py:meth:`GengridItemClass.delete`. - - -Usage hints -=========== - -If the user wants to have multiple items selected at the same time, -:attr:`~Gengrid.multi_select` will permit it. If the gengrid is -single-selection only (the default), then :attr:`~Gengrid.selected_item` -will return the selected item or ``None``, if none is selected. If the -gengrid is under multi-selection, then :attr:`~Gengrid.selected_items` -will return a list (that is only valid as long as no items are modified -(added, deleted, selected or unselected) of child items on a gengrid. - -If an item changes (internal (boolean) state, text or content changes), -then use :meth:`~GengridItem.update` to have gengrid update the item with -the new state. A gengrid will re-"realize" the item, thus calling the -functions in the :class:`GengridItemClass` set for that item. - -To programmatically (un)select an item or get the selected state, use -:attr:`GengridItem.selected`. To make an item disabled (unable to be -selected and appear differently) or get the disabled state -use :attr:`GengridItem.disabled`. - -Grid cells will only have their selection smart callbacks called when -firstly getting selected. Any further clicks will do nothing, unless you -enable the "always select mode", with :attr:`~Gengrid.select_mode` as -:attr:`ELM_OBJECT_SELECT_MODE_ALWAYS`, thus making every click to issue -selection callbacks. :attr:`~Gengrid.select_mode` as -:attr:`ELM_OBJECT_SELECT_MODE_NONE` will turn off the ability to select items -entirely in the widget and they will neither appear selected nor call -the selection smart callbacks. - -Remember that you can create new styles and add your own theme -augmentation per application with -:meth:`Theme.extension_add`. If you -absolutely must have a specific style that overrides any theme the user -or system sets up you can use -:meth:`Theme.extension_add` to add such -a file. - - -Emitted signals -=============== - -- ``activated`` - The user has double-clicked or pressed - (enter|return|spacebar) on an item. The ``event_info`` parameter - is the gengrid item that was activated. -- ``clicked,double`` - The user has double-clicked an item. - The ``event_info`` parameter is the gengrid item that was double-clicked. -- ``clicked,right`` - The user has right-clicked an item. The - ``event_info`` parameter is the item that was right-clicked. (since: 1.13) -- ``longpressed`` - This is called when the item is pressed for a certain - amount of time. By default it's 1 second. -- ``selected`` - The user has made an item selected. The - ``event_info`` parameter is the gengrid item that was selected. -- ``unselected`` - The user has made an item unselected. The - ``event_info`` parameter is the gengrid item that was unselected. -- ``realized`` - This is called when the item in the gengrid - has its implementing Evas object instantiated, de facto. - ``event_info`` is the gengrid item that was created. -- ``unrealized`` - This is called when the implementing Evas - object for this item is deleted. ``event_info`` is the gengrid - item that was deleted. -- ``changed`` - Called when an item is added, removed, resized - or moved and when the gengrid is resized or gets "horizontal" - property changes. -- ``scroll,anim,start`` - This is called when scrolling animation has - started. -- ``scroll,anim,stop`` - This is called when scrolling animation has - stopped. -- ``drag,start,up`` - Called when the item in the gengrid has - been dragged (not scrolled) up. -- ``drag,start,down`` - Called when the item in the gengrid has - been dragged (not scrolled) down. -- ``drag,start,left`` - Called when the item in the gengrid has - been dragged (not scrolled) left. -- ``drag,start,right`` - Called when the item in the gengrid has - been dragged (not scrolled) right. -- ``drag,stop`` - Called when the item in the gengrid has - stopped being dragged. -- ``drag`` - Called when the item in the gengrid is being - dragged. -- ``scroll`` - called when the content has been scrolled - (moved). -- ``scroll,drag,start`` - called when dragging the content has - started. -- ``scroll,drag,stop`` - called when dragging the content has - stopped. -- ``edge,top`` - This is called when the gengrid is scrolled until - the top edge. -- ``edge,bottom`` - This is called when the gengrid is scrolled - until the bottom edge. -- ``edge,left`` - This is called when the gengrid is scrolled - until the left edge. -- ``edge,right`` - This is called when the gengrid is scrolled - until the right edge. -- ``moved`` - This is called when a gengrid item is moved by a user - interaction in a reorder mode. The ``event_info`` parameter is the item that - was moved. -- ``index,update`` - This is called when a gengrid item index is changed. - Note that this callback is called while each item is being realized. -- ``highlighted`` - an item in the list is highlighted. This is called when - the user presses an item or keyboard selection is done so the item is - physically highlighted. The ``event_info`` parameter is the item that was - highlighted. -- ``unhighlighted`` - an item in the list is unhighlighted. This is called - when the user releases an item or keyboard selection is moved so the item - is physically unhighlighted. The ``event_info`` parameter is the item that - was unhighlighted. -- ``language,changed`` - This is called when the program's language is - changed. Call :meth:`~Gengrid.realized_items_update` if items text should - be translated. -- ``focused`` - When the gengrid has received focus. (since 1.8) -- ``unfocused`` - When the gengrid has lost focus. (since 1.8) -- ``item,focused`` - When the gengrid item has received focus. (since 1.10) -- ``item,unfocused`` - When the gengrid item has lost focus. (since 1.10) -- ``item,reorder,anim,start`` - This is called when a gengrid item movement - has just started by keys in reorder mode. The parameter is the item that - is going to move. (since 1.10) -- ``item,reorder,anim,stop`` - This is called when a gengrid item movement just - stopped in reorder mode. The parameter is the item that was moved. (since 1.10) - - -Enumerations -============ - -.. _Elm_Gengrid_Item_Scrollto_Type: - -Items' scroll to types ----------------------- - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_NONE - - No scroll to - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_IN - - Scroll to the nearest viewport - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_TOP - - Scroll to the top of viewport - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_MIDDLE - - Scroll to the middle of viewport - - -.. _Elm_Gengrid_Object_Multi_Select_Mode: - -Multi-select mode ------------------ - -.. data:: ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT - - Default multiple select mode - - .. versionadded:: 1.10 - -.. data:: ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL - - Disallow mutiple selection when clicked without control key pressed - - .. versionadded:: 1.10 - -.. data:: ELM_OBJECT_MULTI_SELECT_MODE_MAX - - Value unknown - - .. versionadded:: 1.10 - - -.. _Elm_Gengrid_Reorder_Type: - -Reorder type ------------- - -.. data:: ELM_GENGRID_REORDER_TYPE_NORMAL - - Normal reorder mode - - .. versionadded:: 1.11 - -.. data:: ELM_GENGRID_REORDER_TYPE_SWAP - - Swap reorder mode - - .. versionadded:: 1.11 - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.gengrid - :parts: 2 - -""" - - -from libc.string cimport strdup -from libc.stdint cimport uintptr_t -from cpython cimport Py_INCREF, Py_DECREF, PyUnicode_AsUTF8String -from efl.eo cimport object_from_instance, _object_mapping_register, PY_REFCOUNT -from efl.utils.conversions cimport _ctouni, _touni - -from efl.evas cimport Object as evasObject -from object cimport Object -from object_item cimport ObjectItem, _object_item_to_python, \ - elm_object_item_widget_get, _object_item_from_python, \ - _object_item_list_to_python, elm_object_item_data_get - -import traceback - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - - -cdef char *_py_elm_gengrid_item_text_get(void *data, Evas_Object *obj, const char *part) with gil: - cdef: - GengridItem item = data - unicode u = _ctouni(part) - - func = item.item_class._text_get_func - if func is None: - return NULL - - try: - o = object_from_instance(obj) - ret = func(o, u, item.item_data) - except Exception: - traceback.print_exc() - return NULL - - if ret is not None: - if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret) - return strdup(ret) - else: - return NULL - -cdef Evas_Object *_py_elm_gengrid_item_content_get(void *data, Evas_Object *obj, const char *part) with gil: - cdef: - GengridItem item = data - unicode u = _ctouni(part) - evasObject icon - - func = item.item_class._content_get_func - if func is None: - return NULL - - o = object_from_instance(obj) - - try: - icon = func(o, u, item.item_data) - except Exception: - traceback.print_exc() - return NULL - - if icon is not None: - return icon.obj - else: - return NULL - -cdef Eina_Bool _py_elm_gengrid_item_state_get(void *data, Evas_Object *obj, const char *part) with gil: - cdef: - GengridItem item = data - unicode u = _ctouni(part) - - func = item.item_class._state_get_func - if func is None: - return 0 - - try: - o = object_from_instance(obj) - ret = func(o, part, item.item_data) - except Exception: - traceback.print_exc() - return 0 - - return ret if ret is not None else 0 - -cdef void _py_elm_gengrid_object_item_del(void *data, Evas_Object *obj) with gil: - cdef GengridItem item = data - - if item is None: - return - - func = item.item_class._del_func - - if func is not None: - try: - o = object_from_instance(obj) - func(o, item.item_data) - except Exception: - traceback.print_exc() - - item._unset_obj() - -cdef void _py_elm_gengrid_item_func(void *data, Evas_Object *obj, void *event_info) with gil: - cdef GengridItem item - - assert data != NULL, "data is NULL in Gengrid select cb" - - item = data - - if item.cb_func is not None: - try: - o = object_from_instance(obj) - item.cb_func(item, o, item.func_data) - except Exception: - traceback.print_exc() - -cdef int _gengrid_compare_cb(const void *data1, const void *data2) with gil: - cdef: - Elm_Object_Item *citem1 = data1 - Elm_Object_Item *citem2 = data2 - GengridItem item1 = elm_object_item_data_get(citem1) - GengridItem item2 = elm_object_item_data_get(citem2) - object func - - if item1.comparison_func is not None: - func = item1.comparison_func - elif item2.comparison_func is not None: - func = item2.comparison_func - else: - return 0 - - ret = func(item1, item2) - if ret is not None: - try: - return ret - except Exception: - traceback.print_exc() - return 0 - else: - return 0 - -include "gengrid_widget.pxi" -include "gengrid_item_class.pxi" -include "gengrid_item.pxi" diff --git a/efl/elementary/gengrid.pxd b/efl/elementary/gengrid_cdef.pxi similarity index 90% rename from efl/elementary/gengrid.pxd rename to efl/elementary/gengrid_cdef.pxi index 2ec2634..922a783 100644 --- a/efl/elementary/gengrid.pxd +++ b/efl/elementary/gengrid_cdef.pxi @@ -1,14 +1,7 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb, \ - Evas_Coord, Eina_Compare_Cb -from efl.c_eo cimport Eo -from object_item cimport Elm_Object_Item -from efl.elementary.general cimport Elm_Glob_Match_Flags - -from efl.ecore cimport Ecore_Pos_Map - - cdef extern from "Elementary.h": + ctypedef cEo Elm_Gengrid + cpdef enum Elm_Genlist_Item_Scrollto_Type: ELM_GENLIST_ITEM_SCROLLTO_NONE ELM_GENLIST_ITEM_SCROLLTO_IN @@ -39,7 +32,7 @@ cdef extern from "Elementary.h": ctypedef enum Elm_Gengrid_Reorder_Type: pass - + ctypedef char *(*GengridItemLabelGetFunc) (void *data, Evas_Object *obj, const char *part) ctypedef Evas_Object *(*GengridItemIconGetFunc) (void *data, Evas_Object *obj, const char *part) ctypedef Eina_Bool (*GengridItemStateGetFunc) (void *data, Evas_Object *obj, const char *part) @@ -59,11 +52,11 @@ cdef extern from "Elementary.h": void elm_gengrid_clear(Evas_Object *obj) void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi) Eina_Bool elm_gengrid_multi_select_get(const Evas_Object *obj) - void elm_gengrid_multi_select_mode_set(Eo *obj, Elm_Object_Multi_Select_Mode mode) - Elm_Object_Multi_Select_Mode elm_gengrid_multi_select_mode_get(const Eo *obj) + void elm_gengrid_multi_select_mode_set(Elm_Gengrid *obj, Elm_Object_Multi_Select_Mode mode) + Elm_Object_Multi_Select_Mode elm_gengrid_multi_select_mode_get(const Elm_Gengrid *obj) void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting) Eina_Bool elm_gengrid_horizontal_get(const Evas_Object *obj) - void elm_gengrid_page_size_set(Eo *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize) + void elm_gengrid_page_size_set(Elm_Gengrid *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize) Elm_Object_Item * elm_gengrid_item_append(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data) Elm_Object_Item * elm_gengrid_item_prepend(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data) Elm_Object_Item * elm_gengrid_item_insert_before(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Elm_Object_Item *before, Evas_Smart_Cb func, const void *func_data) @@ -75,8 +68,8 @@ cdef extern from "Elementary.h": void elm_gengrid_realized_items_update(Evas_Object *obj) Elm_Object_Item * elm_gengrid_first_item_get(const Evas_Object *obj) Elm_Object_Item * elm_gengrid_last_item_get(const Evas_Object *obj) - void elm_gengrid_wheel_disabled_set(Eo *obj, Eina_Bool disabled) - Eina_Bool elm_gengrid_wheel_disabled_get(const Eo *obj) + void elm_gengrid_wheel_disabled_set(Elm_Gengrid *obj, Eina_Bool disabled) + Eina_Bool elm_gengrid_wheel_disabled_get(const Elm_Gengrid *obj) unsigned int elm_gengrid_items_count(Evas_Object *obj) void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) void elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) @@ -92,8 +85,8 @@ cdef extern from "Elementary.h": void elm_gengrid_page_show(Evas_Object *obj, int h_pagenum, int v_pagenum) void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill) Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj) - void elm_gengrid_page_relative_set(Eo *obj, double h_pagerel, double v_pagerel) - void elm_gengrid_page_relative_get(const Eo *obj, double *h_pagerel, double *v_pagerel) + void elm_gengrid_page_relative_set(Elm_Gengrid *obj, double h_pagerel, double v_pagerel) + void elm_gengrid_page_relative_get(const Elm_Gengrid *obj, double *h_pagerel, double *v_pagerel) void elm_gengrid_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode) Elm_Object_Select_Mode elm_gengrid_select_mode_get(const Evas_Object *obj) void elm_gengrid_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight) diff --git a/efl/elementary/genlist.pxi b/efl/elementary/genlist.pxi new file mode 100644 index 0000000..71935a0 --- /dev/null +++ b/efl/elementary/genlist.pxi @@ -0,0 +1,167 @@ +# Copyright (C) 2007-2015 various contributors (see AUTHORS) +# +# This file is part of Python-EFL. +# +# Python-EFL 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-EFL 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-EFL. If not, see . + +include "genlist_cdef.pxi" + +cdef char *_py_elm_genlist_item_text_get(void *data, Evas_Object *obj, const char *part) with gil: + cdef: + GenlistItem item = data + unicode u = _ctouni(part) + + func = item.item_class._text_get_func + if func is None: + return NULL + + try: + o = object_from_instance(obj) + ret = func(o, u, item.item_data) + except Exception: + traceback.print_exc() + return NULL + + if ret is not None: + if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret) + return strdup(ret) + else: + return NULL + +cdef Evas_Object *_py_elm_genlist_item_content_get(void *data, Evas_Object *obj, const char *part) with gil: + cdef: + GenlistItem item = data + unicode u = _ctouni(part) + evasObject icon + + func = item.item_class._content_get_func + if func is None: + return NULL + + o = object_from_instance(obj) + + try: + icon = func(o, u, item.item_data) + except Exception: + traceback.print_exc() + return NULL + + if icon is not None: + return icon.obj + else: + return NULL + +cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, Evas_Object *obj, const char *part) with gil: + cdef: + GenlistItem item = data + unicode u = _ctouni(part) + + func = item.item_class._state_get_func + if func is None: + return 0 + + try: + o = object_from_instance(obj) + ret = func(o, u, item.item_data) + except Exception: + traceback.print_exc() + return 0 + + return ret if ret is not None else 0 + +cdef void _py_elm_genlist_object_item_del(void *data, Evas_Object *obj) with gil: + cdef GenlistItem item = data + + if item is None: + return + + func = item.item_class._del_func + + if func is not None: + try: + o = object_from_instance(obj) + func(o, item.item_data) + except Exception: + traceback.print_exc() + + item._unset_obj() + +cdef void _py_elm_genlist_item_func(void *data, Evas_Object *obj, void *event_info) with gil: + cdef GenlistItem item + + assert data != NULL, "data is NULL in Genlist select cb" + + item = data + + if item.cb_func is not None: + try: + o = object_from_instance(obj) + item.cb_func(item, o, item.func_data) + except Exception: + traceback.print_exc() + +cdef int _py_elm_genlist_compare_func(const void *data1, const void *data2) with gil: + cdef: + Elm_Object_Item *citem1 = data1 + Elm_Object_Item *citem2 = data2 + GenlistItem item1 = elm_object_item_data_get(citem1) + GenlistItem item2 = elm_object_item_data_get(citem2) + object func + + if item1.comparison_func is not None: + func = item1.comparison_func + elif item2.comparison_func is not None: + func = item2.comparison_func + else: + return 0 + + ret = func(item1, item2) + if ret is not None: + try: + return ret + except Exception: + traceback.print_exc() + return 0 + else: + return 0 + +cdef class GenlistIterator(object): + cdef: + Elm_Object_Item *current_item + GenlistItem ret + + def __cinit__(self, Genlist gl): + self.current_item = elm_genlist_first_item_get(gl.obj) + + def __next__(self): + if self.current_item == NULL: + raise StopIteration + ret = _object_item_to_python(self.current_item) + self.current_item = elm_genlist_item_next_get(self.current_item) + return ret + +class GenlistItemsCount(int): + def __new__(cls, Object obj, int count): + return int.__new__(cls, count) + + def __init__(self, Object obj, int count): + self.obj = obj + + @DEPRECATED("1.8", "Use items_count instead.") + def __call__(self): + return self.obj._items_count() + +include "genlist_item_class.pxi" +include "genlist_item.pxi" +include "genlist_widget.pxi" diff --git a/efl/elementary/genlist.py b/efl/elementary/genlist.py new file mode 100644 index 0000000..c7b538d --- /dev/null +++ b/efl/elementary/genlist.py @@ -0,0 +1,40 @@ +from . import Genlist, GenlistItem, GenlistItemClass + +from . import ELM_GENLIST_ITEM_NONE +from . import ELM_GENLIST_ITEM_TREE +from . import ELM_GENLIST_ITEM_GROUP +from . import ELM_GENLIST_ITEM_MAX + +from . import ELM_GENLIST_ITEM_FIELD_ALL +from . import ELM_GENLIST_ITEM_FIELD_TEXT +from . import ELM_GENLIST_ITEM_FIELD_CONTENT +from . import ELM_GENLIST_ITEM_FIELD_STATE + +from . import ELM_GENLIST_ITEM_SCROLLTO_NONE +from . import ELM_GENLIST_ITEM_SCROLLTO_IN +from . import ELM_GENLIST_ITEM_SCROLLTO_TOP +from . import ELM_GENLIST_ITEM_SCROLLTO_MIDDLE + +from . import ELM_LIST_COMPRESS +from . import ELM_LIST_SCROLL +from . import ELM_LIST_LIMIT +from . import ELM_LIST_EXPAND + +from . import ELM_OBJECT_SELECT_MODE_DEFAULT +from . import ELM_OBJECT_SELECT_MODE_ALWAYS +from . import ELM_OBJECT_SELECT_MODE_NONE +from . import ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY +from . import ELM_OBJECT_SELECT_MODE_MAX + +from . import ELM_SEL_FORMAT_TARGETS +from . import ELM_SEL_FORMAT_NONE +from . import ELM_SEL_FORMAT_TEXT +from . import ELM_SEL_FORMAT_MARKUP +from . import ELM_SEL_FORMAT_IMAGE +from . import ELM_SEL_FORMAT_VCARD +from . import ELM_SEL_FORMAT_HTML + +from . import ELM_SEL_TYPE_PRIMARY +from . import ELM_SEL_TYPE_SECONDARY +from . import ELM_SEL_TYPE_XDND +from . import ELM_SEL_TYPE_CLIPBOARD diff --git a/efl/elementary/genlist.pyx b/efl/elementary/genlist.pyx deleted file mode 100644 index 495ad43..0000000 --- a/efl/elementary/genlist.pyx +++ /dev/null @@ -1,707 +0,0 @@ -# Copyright (C) 2007-2015 various contributors (see AUTHORS) -# -# This file is part of Python-EFL. -# -# Python-EFL 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-EFL 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-EFL. If not, see . - -""" - -:mod:`genlist` Module -##################### - -.. image:: /images/genlist-preview.png - - -Widget description -================== - -This widget aims to have more expansive list than the simple list in -Elementary that could have more flexible items and allow many more -entries while still being fast and low on memory usage. At the same time -it was also made to be able to do tree structures. But the price to pay -is more complexity when it comes to usage. If all you want is a simple -list with icons and a single text, use the normal -:py:class:`~efl.elementary.list.List` object. - -Genlist has a fairly large API, mostly because it's relatively complex, -trying to be both expansive, powerful and efficient. First we will begin -an overview on the theory behind genlist. - - -Genlist item classes - creating items -===================================== - -In order to have the ability to add and delete items on the fly, genlist -implements a class (callback) system where the application provides a -structure with information about that type of item (genlist may contain -multiple different items with different classes, states and styles). -Genlist will call the functions in this struct (methods) when an item is -"realized" (i.e., created dynamically, while the user is scrolling the -grid). All objects will simply be deleted when no longer needed with -:py:meth:`~efl.evas.Object.delete`. :py:class:`GenlistItemClass` contains the -following members: - -- ``item_style`` - This is a constant string and simply defines the name - of the item style. It **must** be specified and the default should be - ``"default".`` -- ``decorate_item_style`` - This is a constant string and simply defines - the name of the decorate mode item style. It is used to specify - decorate mode item style. It can be used when you call - :py:attr:`GenlistItem.decorate_mode`. -- ``decorate_all_item_style`` - This is a constant string and simply - defines the name of the decorate all item style. It is used to specify - decorate all item style. It can be used to set selection, checking and - deletion mode. This is used when you call - :py:attr:`Genlist.decorate_mode`. -- ``func`` - A struct with pointers to functions that will be called when - an item is going to be actually created. All of them receive a ``data`` - parameter that will point to the same data passed to - :py:meth:`GenlistItem.append_to` and related item creation functions, and an - ``obj`` parameter that points to the genlist object itself. - -The function pointers inside ``func`` are ``text_get``, ``content_get``, -``state_get`` and ``del``. The 3 first functions also receive a ``part`` -parameter described below. A brief description of these functions follows: - -- ``text_get`` - The ``part`` parameter is the name string of one of the - existing text parts in the Edje group implementing the item's theme. - See :py:meth:`GenlistItemClass.text_get`. -- ``content_get`` - The ``part`` parameter is the name string of one of the - existing (content) swallow parts in the Edje group implementing the - item's theme. It must return ``None``, when no content is desired, or - a valid object handle, otherwise. The object will be deleted by the - genlist on its deletion or when the item is "unrealized". See - :py:meth:`GenlistItemClass.content_get`. -- ``func.state_get`` - The ``part`` parameter is the name string of one of - the state parts in the Edje group implementing the item's theme. Return - ``False`` for false/off or ``True`` for true/on. Genlists will - emit a signal to its theming Edje object with ``"elm,state,xxx,active"`` - and ``"elm"`` as "emission" and "source" arguments, respectively, when - the state is true (the default is false), where ``xxx`` is the name of - the (state) part. See :py:meth:`GenlistItemClass.state_get`. -- ``func.del`` - This is intended for use when genlist items are deleted, - so any data attached to the item (e.g. its data parameter on creation) - can be deleted. See :py:meth:`GenlistItemClass.delete`. - - -Available item styles -===================== - -- ``default`` -- ``default_style`` The text part is a textblock -- ``double_label`` Two different text parts -- ``icon_top_text_bottom`` -- ``group_index`` -- ``one_icon`` Only 1 icon (left) (since: 1.1) -- ``end_icon`` Only 1 icon (at end/right) (since: 1.1) -- ``no_icon`` No icon (since: 1.1) -- ``full`` Only one object, elm.swallow.content, which consumes whole area of - the genlist item (since: 1.7) - - -Structure of items -================== - -An item in a genlist can have 0 or more texts (they can be regular text -or textblock Evas objects - that's up to the style to determine), 0 or -more contents (which are simply objects swallowed into the genlist item's -theming Edje object) and 0 or more **boolean states**, which have the -behavior left to the user to define. The Edje part names for each of -these properties will be looked up, in the theme file for the genlist, -under the Edje (string) data items named ``labels``, ``contents`` -and ``states``, respectively. For each of those properties, if more -than one part is provided, they must have names listed separated by -spaces in the data fields. For the default genlist item theme, we have -**one** text part (``elm.text``), **two** content parts -(``elm.swallow.icon`` and ``elm.swallow.end``) and **no** state parts. - -A genlist item may be at one of several styles. Elementary provides one -by default - "default", but this can be extended by system or application -custom themes/overlays/extensions (see :py:mod:`themes`) -for more details). - - -Editing and Navigating -====================== - -Items can be added by several calls. All of them return a -:py:class:`GenlistItem` handle that is an internal member inside the genlist. -They all take a data parameter that is meant to be used for a handle to the -applications internal data (eg. the struct with the original item data). The -parent parameter is the parent genlist item this belongs to if it is a tree or -an indexed group, and None if there is no parent. The flags can be a bitmask of -:attr:`ELM_GENLIST_ITEM_NONE`, :attr:`ELM_GENLIST_ITEM_TREE` and -:attr:`ELM_GENLIST_ITEM_GROUP`. If :attr:`ELM_GENLIST_ITEM_TREE` is set then -this item is displayed as an item that is able to expand and have child items. -If :attr:`ELM_GENLIST_ITEM_GROUP` is set then this item is group index item -that is displayed at the top until the next group comes. The func parameter is -a convenience callback that is called when the item is selected and the data -parameter will be the func_data parameter, ``obj`` be the genlist object and -event_info will be the genlist item. - -:py:meth:`GenlistItem.append_to` adds an item to the end of the list, or if -there is a parent, to the end of all the child items of the parent. -:py:meth:`GenlistItem.prepend_to` is the same but adds to the beginning of -the list or children list. :py:meth:`GenlistItem.insert_before` inserts at -item before another item and :py:meth:`GenlistItem.insert_after` inserts after -the indicated item. - -The application can clear the list with :py:meth:`Genlist.clear` which deletes -all the items in the list and -:py:meth:`~efl.elementary.object_item.ObjectItem.delete` will delete a specific -item. :py:meth:`GenlistItem.subitems_clear` will clear all items that are -children of the indicated parent item. - -To help inspect list items you can jump to the item at the top of the list -with :py:attr:`Genlist.first_item` which will return the item pointer, and -similarly :py:attr:`Genlist.last_item` gets the item at the end of the list. -:py:attr:`GenlistItem.next` and :py:attr:`GenlistItem.prev` get the next -and previous items respectively relative to the indicated item. Using -these calls you can walk the entire item list/tree. Note that as a tree -the items are flattened in the list, so :py:attr:`GenlistItem.parent` will -let you know which item is the parent (and thus know how to skip them if -wanted). - - -Multi-selection -=============== - -If the application wants multiple items to be able to be selected, -:py:attr:`Genlist.multi_select` can enable this. If the list is -single-selection only (the default), then :py:attr:`Genlist.selected_item` -will return the selected item, if any, or None if none is selected. If the -list is multi-select then :py:attr:`Genlist.selected_items` will return a -list (that is only valid as long as no items are modified (added, deleted, -selected or unselected)). - - -Usage hints -=========== - -There are also convenience functions. -:py:attr:`efl.elementary.object_item.ObjectItem.widget` will return the genlist -object the item belongs to. :py:meth:`GenlistItem.show` will make the scroller -scroll to show that specific item so its visible. -:py:attr:`efl.elementary.object_item.ObjectItem.data` returns the data pointer -set by the item creation functions. - -If an item changes (state of boolean changes, text or contents change), -then use :py:meth:`GenlistItem.update` to have genlist update the item with -the new state. Genlist will re-realize the item and thus call the functions -in the _Elm_Genlist_Item_Class for that item. - -Use :py:attr:`GenlistItem.selected` to programmatically (un)select an item or -get its selected state. Similarly to expand/contract an item and get its -expanded state, use :py:attr:`GenlistItem.expanded`. And again to make an item -disabled (unable to be selected and appear differently) use -:py:attr:`GenlistItem.disabled` to set this and get the disabled state. - -In general to indicate how the genlist should expand items horizontally to -fill the list area, use :py:attr:`Genlist.mode`. Valid modes are -ELM_LIST_LIMIT, ELM_LIST_COMPRESS and ELM_LIST_SCROLL. The default is -ELM_LIST_SCROLL. This mode means that if items are too wide to fit, the -scroller will scroll horizontally. Otherwise items are expanded to -fill the width of the viewport of the scroller. If it is -ELM_LIST_LIMIT, items will be expanded to the viewport width -if larger than the item, but genlist widget with is -limited to the largest item. D not use ELM_LIST_LIMIT mode with homogeneous -mode turned on. ELM_LIST_COMPRESS can be combined with a different style -that uses Edje's ellipsis feature (cutting text off like this: "tex..."). - -Items will only call their selection func and callback when first becoming -selected. Any further clicks will do nothing, unless you enable always -select with :py:attr:`Genlist.select_mode` as ELM_OBJECT_SELECT_MODE_ALWAYS. -This means even if selected, every click will make the selected callbacks -be called. :py:attr:`Genlist.select_mode` as ELM_OBJECT_SELECT_MODE_NONE will -turn off the ability to select items entirely and they will neither -appear selected nor call selected callback functions. - -Remember that you can create new styles and add your own theme augmentation per -application with :py:meth:`efl.elementary.theme.Theme.extension_add`. If you -absolutely must have a specific style that overrides any theme the user or -system sets up you can use :py:meth:`efl.elementary.theme.Theme.overlay_add` to -add such a file. - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scrolling behaviour using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.scroller.Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Implementation -============== - -Evas tracks every object you create. Every time it processes an event -(mouse move, down, up etc.) it needs to walk through objects and find out -what event that affects. Even worse every time it renders display updates, -in order to just calculate what to re-draw, it needs to walk through many -many many objects. Thus, the more objects you keep active, the more -overhead Evas has in just doing its work. It is advisable to keep your -active objects to the minimum working set you need. Also remember that -object creation and deletion carries an overhead, so there is a -middle-ground, which is not easily determined. But don't keep massive lists -of objects you can't see or use. Genlist does this with list objects. It -creates and destroys them dynamically as you scroll around. It groups them -into blocks so it can determine the visibility etc. of a whole block at -once as opposed to having to walk the whole list. This 2-level list allows -for very large numbers of items to be in the list (tests have used up to -2,000,000 items). Also genlist employs a queue for adding items. As items -may be different sizes, every item added needs to be calculated as to its -size and thus this presents a lot of overhead on populating the list, this -genlist employs a queue. Any item added is queued and spooled off over -time, actually appearing some time later, so if your list has many members -you may find it takes a while for them to all appear, with your process -consuming a lot of CPU while it is busy spooling. - -Genlist also implements a tree structure, but it does so with callbacks to -the application, with the application filling in tree structures when -requested (allowing for efficient building of a very deep tree that could -even be used for file-management). See the above smart signal callbacks for -details. - - -Emitted signals -=============== - -- ``activated`` - The user has double-clicked or pressed - (enter|return|spacebar) on an item. The ``event_info`` parameter is the - item that was activated. -- ``clicked,double`` - The user has double-clicked an item. The - ``event_info`` parameter is the item that was double-clicked. -- ``clicked,right`` - The user has right-clicked an item. The - ``event_info`` parameter is the item that was right-clicked. (since: 1.13) -- ``selected`` - This is called when a user has made an item selected. - The event_info parameter is the genlist item that was selected. -- ``unselected`` - This is called when a user has made an item - unselected. The event_info parameter is the genlist item that was - unselected. -- ``expanded`` - This is called when :py:attr:`GenlistItem.expanded` is - called and the item is now meant to be expanded. The event_info - parameter is the genlist item that was indicated to expand. It is the - job of this callback to then fill in the child items. -- ``contracted`` - This is called when :py:attr:`GenlistItem.expanded` is - called and the item is now meant to be contracted. The event_info - parameter is the genlist item that was indicated to contract. It is the - job of this callback to then delete the child items. -- ``expand,request`` - This is called when a user has indicated they want - to expand a tree branch item. The callback should decide if the item can - expand (has any children) and then call :py:attr:`GenlistItem.expanded` - appropriately to set the state. The event_info parameter is the genlist - item that was indicated to expand. -- ``contract,request`` - This is called when a user has indicated they - want to contract a tree branch item. The callback should decide if the - item can contract (has any children) and then call - :py:attr:`GenlistItem.expanded` appropriately to set the state. The - event_info parameter is the genlist item that was indicated to contract. -- ``realized`` - This is called when the item in the list is created as a - real evas object. event_info parameter is the genlist item that was - created. -- ``unrealized`` - This is called just before an item is unrealized. - After this call content objects provided will be deleted and the item - object itself delete or be put into a floating cache. -- ``drag,start,up`` - This is called when the item in the list has been - dragged (not scrolled) up. -- ``drag,start,down`` - This is called when the item in the list has been - dragged (not scrolled) down. -- ``drag,start,left`` - This is called when the item in the list has been - dragged (not scrolled) left. -- ``drag,start,right`` - This is called when the item in the list has - been dragged (not scrolled) right. -- ``drag,stop`` - This is called when the item in the list has stopped - being dragged. -- ``drag`` - This is called when the item in the list is being dragged. -- ``longpressed`` - This is called when the item is pressed for a certain - amount of time. By default it's 1 second. The event_info parameter is the - longpressed genlist item. -- ``scroll,anim,start`` - This is called when scrolling animation has - started. -- ``scroll,anim,stop`` - This is called when scrolling animation has - stopped. -- ``scroll,drag,start`` - This is called when dragging the content has - started. -- ``scroll,drag,stop`` - This is called when dragging the content has - stopped. -- ``edge,top`` - This is called when the genlist is scrolled until - the top edge. -- ``edge,bottom`` - This is called when the genlist is scrolled - until the bottom edge. -- ``edge,left`` - This is called when the genlist is scrolled - until the left edge. -- ``edge,right`` - This is called when the genlist is scrolled - until the right edge. -- ``multi,swipe,left`` - This is called when the genlist is multi-touch - swiped left. -- ``multi,swipe,right`` - This is called when the genlist is multi-touch - swiped right. -- ``multi,swipe,up`` - This is called when the genlist is multi-touch - swiped up. -- ``multi,swipe,down`` - This is called when the genlist is multi-touch - swiped down. -- ``multi,pinch,out`` - This is called when the genlist is multi-touch - pinched out. -- ``multi,pinch,in`` - This is called when the genlist is multi-touch - pinched in. -- ``swipe`` - This is called when the genlist is swiped. -- ``moved`` - This is called when a genlist item is moved in reorder mode. -- ``moved,after`` - This is called when a genlist item is moved after - another item in reorder mode. The event_info parameter is the reordered - item. To get the relative previous item, use :py:attr:`GenlistItem.prev`. - This signal is called along with "moved" signal. -- ``moved,before`` - This is called when a genlist item is moved before - another item in reorder mode. The event_info parameter is the reordered - item. To get the relative previous item, use :py:attr:`GenlistItem.next`. - This signal is called along with "moved" signal. -- ``language,changed`` - This is called when the program's language is - changed. -- ``tree,effect,finished`` - This is called when a genlist tree effect - is finished. -- ``highlighted`` - an item in the list is highlighted. This is called when - the user presses an item or keyboard selection is done so the item is - physically highlighted. The ``event_info`` parameter is the item that was - highlighted. -- ``unhighlighted`` - an item in the list is unhighlighted. This is called - when the user releases an item or keyboard selection is moved so the item - is physically unhighlighted. The ``event_info`` parameter is the item that - was unhighlighted. -- ``focused`` - When the genlist has received focus. (since 1.8) -- ``unfocused`` - When the genlist has lost focus. (since 1.8) -- ``item,focused`` - When the genlist item has received focus. (since 1.10) -- ``item,unfocused`` - When the genlist item has lost focus. (since 1.10) - - -Enumerations -============ - -.. _Elm_Genlist_Item_Type: - -Genlist item types ------------------- - -.. data:: ELM_GENLIST_ITEM_NONE - - Simple item - -.. data:: ELM_GENLIST_ITEM_TREE - - The item may be expanded and have child items - -.. data:: ELM_GENLIST_ITEM_GROUP - - An index item of a group of items - - -.. _Elm_Genlist_Item_Field_Type: - -Genlist items' field types --------------------------- - -.. data:: ELM_GENLIST_ITEM_FIELD_ALL - - Match all fields - -.. data:: ELM_GENLIST_ITEM_FIELD_TEXT - - Match text fields - -.. data:: ELM_GENLIST_ITEM_FIELD_CONTENT - - Match content fields - -.. data:: ELM_GENLIST_ITEM_FIELD_STATE - - Match state fields - - -.. _Elm_Genlist_Item_Scrollto_Type: - -Genlist items' scroll-to types ------------------------------- - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_NONE - - No scroll to - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_IN - - Scroll to the nearest viewport - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_TOP - - Scroll to the top of viewport - -.. data:: ELM_GENLIST_ITEM_SCROLLTO_MIDDLE - - Scroll to the middle of viewport - - -.. _Elm_Genlist_List_Mode: - -List sizing ------------ - -.. data:: ELM_LIST_COMPRESS - - The list won't set any of its size hints to inform how a possible container - should resize it. - - Then, if it's not created as a "resize object", it might end with zeroed - dimensions. The list will respect the container's geometry and, if any of - its items won't fit into its transverse axis, one won't be able to scroll it - in that direction. - -.. data:: ELM_LIST_SCROLL - - Default value. - - This is the same as ELM_LIST_COMPRESS, with the exception that if any of - its items won't fit into its transverse axis, one will be able to scroll - it in that direction. - -.. data:: ELM_LIST_LIMIT - - Sets a minimum size hint on the list object, so that containers may - respect it (and resize itself to fit the child properly). - - More specifically, a minimum size hint will be set for its transverse - axis, so that the largest item in that direction fits well. This is - naturally bound by the list object's maximum size hints, set externally. - -.. data:: ELM_LIST_EXPAND - - Besides setting a minimum size on the transverse axis, just like on - ELM_LIST_LIMIT, the list will set a minimum size on the longitudinal - axis, trying to reserve space to all its children to be visible at a time. - - This is naturally bound by the list object's maximum size hints, set - externally. - - -.. _Elm_Genlist_Object_Select_Mode: - -Selection modes ---------------- - -.. data:: ELM_OBJECT_SELECT_MODE_DEFAULT - - Default select mode - -.. data:: ELM_OBJECT_SELECT_MODE_ALWAYS - - Always select mode - -.. data:: ELM_OBJECT_SELECT_MODE_NONE - - No select mode - -.. data:: ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY - - No select mode with no finger size rule - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.genlist - :parts: 2 - -""" - - -from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF -from libc.stdint cimport uintptr_t - -from efl.eo cimport object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - -from object_item cimport ObjectItem, _object_item_to_python, \ - elm_object_item_widget_get, _object_item_from_python, \ - _object_item_list_to_python, elm_object_item_data_get -from libc.string cimport strdup -from object cimport Object - -from general cimport PY_EFL_ELM_LOG_DOMAIN -from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN, \ - EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT - -import traceback -import logging - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - - -cdef char *_py_elm_genlist_item_text_get(void *data, Evas_Object *obj, const char *part) with gil: - cdef: - GenlistItem item = data - unicode u = _ctouni(part) - - func = item.item_class._text_get_func - if func is None: - return NULL - - try: - o = object_from_instance(obj) - ret = func(o, u, item.item_data) - except Exception: - traceback.print_exc() - return NULL - - if ret is not None: - if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret) - return strdup(ret) - else: - return NULL - -cdef Evas_Object *_py_elm_genlist_item_content_get(void *data, Evas_Object *obj, const char *part) with gil: - cdef: - GenlistItem item = data - unicode u = _ctouni(part) - evasObject icon - - func = item.item_class._content_get_func - if func is None: - return NULL - - o = object_from_instance(obj) - - try: - icon = func(o, u, item.item_data) - except Exception: - traceback.print_exc() - return NULL - - if icon is not None: - return icon.obj - else: - return NULL - -cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, Evas_Object *obj, const char *part) with gil: - cdef: - GenlistItem item = data - unicode u = _ctouni(part) - - func = item.item_class._state_get_func - if func is None: - return 0 - - try: - o = object_from_instance(obj) - ret = func(o, u, item.item_data) - except Exception: - traceback.print_exc() - return 0 - - return ret if ret is not None else 0 - -cdef void _py_elm_genlist_object_item_del(void *data, Evas_Object *obj) with gil: - cdef GenlistItem item = data - - if item is None: - return - - func = item.item_class._del_func - - if func is not None: - try: - o = object_from_instance(obj) - func(o, item.item_data) - except Exception: - traceback.print_exc() - - item._unset_obj() - -cdef void _py_elm_genlist_item_func(void *data, Evas_Object *obj, void *event_info) with gil: - cdef GenlistItem item - - assert data != NULL, "data is NULL in Genlist select cb" - - item = data - - if item.cb_func is not None: - try: - o = object_from_instance(obj) - item.cb_func(item, o, item.func_data) - except Exception: - traceback.print_exc() - -cdef int _py_elm_genlist_compare_func(const void *data1, const void *data2) with gil: - cdef: - Elm_Object_Item *citem1 = data1 - Elm_Object_Item *citem2 = data2 - GenlistItem item1 = elm_object_item_data_get(citem1) - GenlistItem item2 = elm_object_item_data_get(citem2) - object func - - if item1.comparison_func is not None: - func = item1.comparison_func - elif item2.comparison_func is not None: - func = item2.comparison_func - else: - return 0 - - ret = func(item1, item2) - if ret is not None: - try: - return ret - except Exception: - traceback.print_exc() - return 0 - else: - return 0 - -cdef class GenlistIterator(object): - cdef: - Elm_Object_Item *current_item - GenlistItem ret - - def __cinit__(self, Genlist gl): - self.current_item = elm_genlist_first_item_get(gl.obj) - - def __next__(self): - if self.current_item == NULL: - raise StopIteration - ret = _object_item_to_python(self.current_item) - self.current_item = elm_genlist_item_next_get(self.current_item) - return ret - -class GenlistItemsCount(int): - def __new__(cls, Object obj, int count): - return int.__new__(cls, count) - - def __init__(self, Object obj, int count): - self.obj = obj - - @DEPRECATED("1.8", "Use items_count instead.") - def __call__(self): - return self.obj._items_count() - -include "genlist_item_class.pxi" -include "genlist_item.pxi" -include "genlist_widget.pxi" diff --git a/efl/elementary/genlist.pxd b/efl/elementary/genlist_cdef.pxi similarity index 95% rename from efl/elementary/genlist.pxd rename to efl/elementary/genlist_cdef.pxi index 0524f37..c990620 100644 --- a/efl/elementary/genlist.pxd +++ b/efl/elementary/genlist_cdef.pxi @@ -1,9 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Eina_Compare_Cb, \ - Evas_Object, Evas_Smart_Cb, Evas_Coord -from object_item cimport Elm_Object_Item -from efl.elementary.general cimport Elm_Glob_Match_Flags - - cdef extern from "Elementary.h": cpdef enum Elm_Genlist_Item_Type: @@ -161,14 +155,3 @@ cdef extern from "Elementary.h": Elm_Object_Item * elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth) void elm_genlist_focus_on_selection_set(Evas_Object *obj, Eina_Bool enabled) Eina_Bool elm_genlist_focus_on_selection_get(const Evas_Object *obj) - -cdef class GenlistItemClass(object): - cdef: - Elm_Genlist_Item_Class *cls - object _text_get_func - object _content_get_func - object _state_get_func - object _del_func - object _item_style - object _decorate_item_style - object _decorate_all_item_style diff --git a/efl/elementary/genlist_item_class.pxi b/efl/elementary/genlist_item_class.pxi index dbada0b..06546ba 100644 --- a/efl/elementary/genlist_item_class.pxi +++ b/efl/elementary/genlist_item_class.pxi @@ -13,10 +13,16 @@ cdef class GenlistItemClass(object): constructor parameters. """ - # In pxd: - # Elm_Genlist_Item_Class *cls - # object _text_get_func, _content_get_func, _state_get_func, _del_func - # object _item_style, _decorate_item_style, _decorate_all_item_style + + cdef: + Elm_Genlist_Item_Class *cls + object _text_get_func + object _content_get_func + object _state_get_func + object _del_func + object _item_style + object _decorate_item_style + object _decorate_all_item_style def __cinit__(self): self.cls = elm_genlist_item_class_new() diff --git a/efl/elementary/gesture_layer.pyx b/efl/elementary/gesture_layer.pxi similarity index 82% rename from efl/elementary/gesture_layer.pyx rename to efl/elementary/gesture_layer.pxi index 9626dac..0157c6d 100644 --- a/efl/elementary/gesture_layer.pyx +++ b/efl/elementary/gesture_layer.pxi @@ -16,168 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`gesture_layer` Module -########################### - -.. image:: /images/gesturelayer-preview.png - - -Widget description -================== - -Use the GestureLayer to detect gestures. The advantage is that you don't -have to implement gesture detection, just set callbacks for gesture states. - -In order to use Gesture Layer you start with instantiating this class -with a parent object parameter. Next 'activate' gesture layer with a -:py:meth:`~GestureLayer.attach` call. Usually with same object as target (2nd -parameter). - -Now you need to tell gesture layer what gestures you follow. This is done with -:py:meth:`~GestureLayer.cb_set` call. By setting the callback you actually -saying to gesture layer: I would like to know when the gesture -:ref:`Elm_Gesture_Type` switches to state :ref:`Elm_Gesture_State`. - -Next, you need to implement the actual action that follows the input in -your callback. - -Note that if you like to stop being reported about a gesture, just set -all callbacks referring this gesture to None. (again with -:py:meth:`~GestureLayer.cb_set`) - -The information reported by gesture layer to your callback is depending -on :ref:`Elm_Gesture_Type`: - -- :class:`GestureTapsInfo` is the info reported for tap gestures: - - - :attr:`ELM_GESTURE_N_TAPS` - - :attr:`ELM_GESTURE_N_LONG_TAPS` - - :attr:`ELM_GESTURE_N_DOUBLE_TAPS` - - :attr:`ELM_GESTURE_N_TRIPLE_TAPS` - -- :class:`GestureMomentumInfo` is info reported for momentum gestures: - - - :attr:`ELM_GESTURE_MOMENTUM` - -- :class:`GestureLineInfo` is the info reported for line gestures - (this also contains :class:`GestureMomentumInfo` internal structure): - - - :attr:`ELM_GESTURE_N_LINES` - - :attr:`ELM_GESTURE_N_FLICKS` - -Note that we consider a flick as a line-gesture that should be completed -in flick-time-limit as defined in -:py:class:`~efl.elementary.configuration.Configuration`. - -:class:`GestureZoomInfo` is the info reported for :attr:`ELM_GESTURE_ZOOM` -gesture. - -:class:`GestureRotateInfo` is the info reported for -:attr:`ELM_GESTURE_ROTATE` gesture. - -Gesture Layer Tweaks: - -Note that line, flick, gestures can start without the need to remove -fingers from surface. When user fingers rests on same-spot gesture is -ended and starts again when fingers moved. - -Setting glayer_continues_enable to false in -:py:class:`~efl.elementary.configuration.Configuration` will change this -behavior so gesture starts when user touches (a *DOWN* event) -touch-surface and ends when no fingers touches surface (a *UP* event). - - -Enumerations -============ - -.. _Elm_Gesture_State: - -Gesture states --------------- - -.. data:: ELM_GESTURE_STATE_UNDEFINED - - Gesture not started - -.. data:: ELM_GESTURE_STATE_START - - Gesture started - -.. data:: ELM_GESTURE_STATE_MOVE - - Gesture is ongoing - -.. data:: ELM_GESTURE_STATE_END - - Gesture completed - -.. data:: ELM_GESTURE_STATE_ABORT - - Ongoing gesture was aborted - - -.. _Elm_Gesture_Type: - -Gesture types -------------- - -.. data:: ELM_GESTURE_N_TAPS - - N fingers single taps - -.. data:: ELM_GESTURE_N_LONG_TAPS - - N fingers single long-taps - -.. data:: ELM_GESTURE_N_DOUBLE_TAPS - - N fingers double-single taps - -.. data:: ELM_GESTURE_N_TRIPLE_TAPS - - N fingers triple-single taps - -.. data:: ELM_GESTURE_MOMENTUM - - Reports momentum in the direction of move - -.. data:: ELM_GESTURE_N_LINES - - N fingers line gesture - -.. data:: ELM_GESTURE_N_FLICKS - - N fingers flick gesture - -.. data:: ELM_GESTURE_ZOOM - - Zoom - -.. data:: ELM_GESTURE_ROTATE - - Rotate - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.gesture_layer - :parts: 2 - -""" - -from cpython cimport Py_INCREF - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from object cimport Object - -import traceback - -from efl.evas import EVAS_EVENT_FLAG_NONE - +include "gesture_layer_cdef.pxi" cdef class GestureTapsInfo(object): """GestureTapsInfo(...) @@ -470,7 +309,7 @@ cdef Evas_Event_Flags _gesture_layer_taps_event_cb(void *data, void *event_info) ei.info = event_info try: ret = callback(ei, *args, **kwargs) - return ret if ret is not None else EVAS_EVENT_FLAG_NONE + return ret if ret is not None else EVAS_EVENT_FLAG_NONE except Exception: traceback.print_exc() @@ -480,7 +319,7 @@ cdef Evas_Event_Flags _gesture_layer_momentum_event_cb(void *data, void *event_i ei.info = event_info try: ret = callback(ei, *args, **kwargs) - return ret if ret is not None else EVAS_EVENT_FLAG_NONE + return ret if ret is not None else EVAS_EVENT_FLAG_NONE except Exception: traceback.print_exc() @@ -490,7 +329,7 @@ cdef Evas_Event_Flags _gesture_layer_line_event_cb(void *data, void *event_info) ei.info = event_info try: ret = callback(ei, *args, **kwargs) - return ret if ret is not None else EVAS_EVENT_FLAG_NONE + return ret if ret is not None else EVAS_EVENT_FLAG_NONE except Exception: traceback.print_exc() @@ -500,7 +339,7 @@ cdef Evas_Event_Flags _gesture_layer_zoom_event_cb(void *data, void *event_info) ei.info = event_info try: ret = callback(ei, *args, **kwargs) - return ret if ret is not None else EVAS_EVENT_FLAG_NONE + return ret if ret is not None else EVAS_EVENT_FLAG_NONE except Exception: traceback.print_exc() @@ -510,7 +349,7 @@ cdef Evas_Event_Flags _gesture_layer_rotate_event_cb(void *data, void *event_inf ei.info = event_info try: ret = callback(ei, *args, **kwargs) - return ret if ret is not None else EVAS_EVENT_FLAG_NONE + return ret if ret is not None else EVAS_EVENT_FLAG_NONE except Exception as e: traceback.print_exc() diff --git a/efl/elementary/gesture_layer.py b/efl/elementary/gesture_layer.py new file mode 100644 index 0000000..f84fa01 --- /dev/null +++ b/efl/elementary/gesture_layer.py @@ -0,0 +1,19 @@ +from . import GestureLayer + +from . import ELM_GESTURE_STATE_UNDEFINED +from . import ELM_GESTURE_STATE_START +from . import ELM_GESTURE_STATE_MOVE +from . import ELM_GESTURE_STATE_END +from . import ELM_GESTURE_STATE_ABORT + +from . import ELM_GESTURE_FIRST +from . import ELM_GESTURE_N_TAPS +from . import ELM_GESTURE_N_LONG_TAPS +from . import ELM_GESTURE_N_DOUBLE_TAPS +from . import ELM_GESTURE_N_TRIPLE_TAPS +from . import ELM_GESTURE_MOMENTUM +from . import ELM_GESTURE_N_LINES +from . import ELM_GESTURE_N_FLICKS +from . import ELM_GESTURE_ZOOM +from . import ELM_GESTURE_ROTATE +from . import ELM_GESTURE_LAST diff --git a/efl/elementary/gesture_layer.pxd b/efl/elementary/gesture_layer_cdef.pxi similarity index 98% rename from efl/elementary/gesture_layer.pxd rename to efl/elementary/gesture_layer_cdef.pxi index da2d250..5a7ef11 100644 --- a/efl/elementary/gesture_layer.pxd +++ b/efl/elementary/gesture_layer_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord, Evas_Event_Flags - - cdef extern from "Elementary.h": cpdef enum Elm_Gesture_State: diff --git a/efl/elementary/grid.pyx b/efl/elementary/grid.pxi similarity index 83% rename from efl/elementary/grid.pyx rename to efl/elementary/grid.pxi index c29c8d3..4e65e6e 100644 --- a/efl/elementary/grid.pyx +++ b/efl/elementary/grid.pxi @@ -15,42 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . - -""" - -:mod:`grid` Module -################## - -.. image:: /images/grid-preview.png - - -Widget description -================== - -A grid layout widget. - -The grid is a grid layout widget that lays out a series of children as a -fixed "grid" of widgets using a given percentage of the grid width and -height each using the child object. - -The Grid uses a "Virtual resolution" that is stretched to fill the grid -widgets size itself. The default is 100 x 100, so that means the -position and sizes of children will effectively be percentages (0 to 100) -of the width or height of the grid widget. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.grid - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from object cimport Object -from efl.utils.conversions cimport eina_list_objects_to_python_list +include "grid_cdef.pxi" cdef class Grid(Object): """ diff --git a/efl/elementary/grid.py b/efl/elementary/grid.py new file mode 100644 index 0000000..1a37ceb --- /dev/null +++ b/efl/elementary/grid.py @@ -0,0 +1 @@ +from . import Grid, grid_pack_set, grid_pack_get diff --git a/efl/elementary/grid.pxd b/efl/elementary/grid_cdef.pxi similarity index 92% rename from efl/elementary/grid.pxd rename to efl/elementary/grid_cdef.pxi index a6a4a9a..07d775a 100644 --- a/efl/elementary/grid.pxd +++ b/efl/elementary/grid_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Coord - cdef extern from "Elementary.h": Evas_Object *elm_grid_add(Evas_Object *parent) void elm_grid_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) @@ -10,4 +8,3 @@ cdef extern from "Elementary.h": void elm_grid_pack_set(Evas_Object *subobj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) void elm_grid_pack_get(const Evas_Object *subobj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) Eina_List *elm_grid_children_get(const Evas_Object *obj) - diff --git a/efl/elementary/hover.pyx b/efl/elementary/hover.pxi similarity index 66% rename from efl/elementary/hover.pyx rename to efl/elementary/hover.pxi index 00bb1ed..17e63fd 100644 --- a/efl/elementary/hover.pyx +++ b/efl/elementary/hover.pxi @@ -16,121 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`hover` Module -################### - -.. image:: /images/hover-preview.png - - -Widget description -================== - -A Hover object will hover over its ``parent`` object at the ``target`` -location. - -Anything in the background will be given a darker coloring to indicate -that the hover object is on top (at the default theme). When the hover -is clicked it is dismissed(hidden), if the contents of the hover are -clicked that **doesn't** cause the hover to be dismissed. - -A Hover object has two parents. One parent that owns it during creation -and the other parent being the one over which the hover object spans. - - -Available styles -================ - -- default -- popout -- menu -- hoversel_vertical - - -Emitted signals -=============== - -- ``clicked`` - the user clicked the empty space in the hover to - dismiss. -- ``dismissed`` - the user clicked the empty space in the hover to dismiss. - (since 1.8) -- ``smart,changed`` - a content object placed under the "smart" - policy was replaced to a new slot direction. -- ``focused`` - When the hover has received focus. (since 1.8) -- ``unfocused`` - When the hover has lost focus. (since 1.8) - - -Layout content parts -==================== - -- ``left`` -- ``top-left`` -- ``top`` -- ``top-right`` -- ``right`` -- ``bottom-right`` -- ``bottom`` -- ``bottom-left`` -- ``middle`` -- ``smart`` - -All directions may have contents at the same time, except for "smart". -This is a special placement hint and its use case depends of the -calculations coming from :py:meth:`~Hover.best_content_location_get`. Its use -is for cases when one desires only one hover content, but with a dynamic -special placement within the hover area. The content's geometry, -whenever it changes, will be used to decide on a best location, not -extrapolating the hover's parent object view to show it in (still being -the hover's target determinant of its medium part -- move and resize it -to simulate finger sizes, for example). If one of the directions other -than "smart" are used, a previously content set using it will be -deleted, and vice-versa. - -.. note:: The hover object will take up the entire space of ``target`` - object. - -.. note:: The content parts listed indicate the direction that the content - will be displayed - - -Enumerations -============ - -.. _Elm_Hover_Axis: - -Hover axis ----------- - -.. data:: ELM_HOVER_AXIS_NONE - - No preferred orientation - -.. data:: ELM_HOVER_AXIS_HORIZONTAL - - Horizontal orientation - -.. data:: ELM_HOVER_AXIS_VERTICAL - - Vertical orientation - -.. data:: ELM_HOVER_AXIS_BOTH - - Both - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.hover - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject - +include "hover_cdef.pxi" cdef class Hover(LayoutClass): """ diff --git a/efl/elementary/hover.py b/efl/elementary/hover.py new file mode 100644 index 0000000..e4685e3 --- /dev/null +++ b/efl/elementary/hover.py @@ -0,0 +1,6 @@ +from . import Hover + +from . import ELM_HOVER_AXIS_NONE +from . import ELM_HOVER_AXIS_HORIZONTAL +from . import ELM_HOVER_AXIS_VERTICAL +from . import ELM_HOVER_AXIS_BOTH diff --git a/efl/elementary/hover.pxd b/efl/elementary/hover_cdef.pxi similarity index 87% rename from efl/elementary/hover.pxd rename to efl/elementary/hover_cdef.pxi index 05edfd8..64fc35f 100644 --- a/efl/elementary/hover.pxd +++ b/efl/elementary/hover_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Evas_Object -from layout_class cimport LayoutClass - - cdef extern from "Elementary.h": cpdef enum Elm_Hover_Axis: @@ -19,6 +15,3 @@ cdef extern from "Elementary.h": Evas_Object *elm_hover_parent_get(const Evas_Object *obj) char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis) void elm_hover_dismiss(Evas_Object *obj) - -cdef class Hover(LayoutClass): - pass diff --git a/efl/elementary/hoversel.pyx b/efl/elementary/hoversel.pxi similarity index 86% rename from efl/elementary/hoversel.pyx rename to efl/elementary/hoversel.pxi index 91504f8..42c380a 100644 --- a/efl/elementary/hoversel.pyx +++ b/efl/elementary/hoversel.pxi @@ -16,94 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`hoversel` Module -###################### - -.. image:: /images/hoversel-preview.png - - -Widget description -================== - -A hoversel is a button that pops up a list of items (automatically -choosing the direction to display) that have a label and, optionally, an -icon to select from. - -It is a convenience widget to avoid the need to do all the piecing -together yourself. It is intended for a small number of items in the -hoversel menu (no more than 8), though is capable of many more. - - -Emitted signals -=============== - -- ``clicked`` - the user clicked the hoversel button and popped up - the sel -- ``selected`` - an item in the hoversel list is selected. event_info - is the item -- ``dismissed`` - the hover is dismissed -- ``expanded`` - the hover is expanded (since 1.9) -- ``item,focused`` - the hoversel item has received focus. (since 1.10) -- ``item,unfocused`` - the hoversel item has lost focus. (since 1.10) - - -Layout content parts -==================== - -- ``icon`` - An icon of the hoversel - - -Layout text parts -================= - -- ``default`` - Label of the hoversel - - -Enumerations -============ - -.. _Elm_Hoversel_Icon_Type: - -Icon types ----------- - -.. data:: ELM_ICON_NONE - - No icon - -.. data:: ELM_ICON_FILE - - Icon is a file - -.. data:: ELM_ICON_STANDARD - - Icon is set with standards names - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.hoversel - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from object_item cimport ObjectItem, _object_item_callback, \ - _object_item_list_to_python, _object_item_to_python, _object_item_callback2 -from button cimport Button - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "hoversel_cdef.pxi" cdef class HoverselItem(ObjectItem): """ diff --git a/efl/elementary/hoversel.py b/efl/elementary/hoversel.py new file mode 100644 index 0000000..1093f5d --- /dev/null +++ b/efl/elementary/hoversel.py @@ -0,0 +1,5 @@ +from . import Hoversel, HoverselItem + +from . import ELM_ICON_NONE +from . import ELM_ICON_FILE +from . import ELM_ICON_STANDARD diff --git a/efl/elementary/hoversel.pxd b/efl/elementary/hoversel_cdef.pxi similarity index 92% rename from efl/elementary/hoversel.pxd rename to efl/elementary/hoversel_cdef.pxi index 8439b72..cae03e0 100644 --- a/efl/elementary/hoversel.pxd +++ b/efl/elementary/hoversel_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb -from object_item cimport Elm_Object_Item - - cdef extern from "Elementary.h": cpdef enum Elm_Icon_Type: diff --git a/efl/elementary/icon.pyx b/efl/elementary/icon.pxi similarity index 57% rename from efl/elementary/icon.pyx rename to efl/elementary/icon.pxi index 9c473ac..bb52162 100644 --- a/efl/elementary/icon.pyx +++ b/efl/elementary/icon.pxi @@ -16,196 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`icon` Module -################## - -.. image:: /images/icon-preview.png - - -Widget description -================== - -An icon object is used to display standard icon images ("delete", -"edit", "arrows", etc.) or images coming from a custom file (PNG, JPG, -EDJE, etc.), on icon contexts. - -The icon image requested can be in the Elementary theme in use, or in -the ``freedesktop.org`` theme paths. It's possible to set the order of -preference from where an image will be fetched. - -This widget inherits from the :py:class:`~efl.elementary.image.Image` one, so -that all the functions acting on it also work for icon objects. - -You should be using an icon, instead of an image, whenever one of the -following apply: - -- you need a **thumbnail** version of an original image -- you need freedesktop.org provided icon images -- you need theme provided icon images (Edje groups) - -Default images provided by Elementary's default theme are described below. - -These are names that follow (more or less) the **Freedesktop** icon naming -specification. Use of these names are **preferred**, at least if you want to -give your user the ability to use other themes. All these icons can be -seen in the elementary_test application, the test is called "Icon Standard". - -- ``folder`` (since 1.13) -- ``user-home`` (since 1.13) -- ``user-trash`` (since 1.13) - -- ``view-close`` (since 1.13) -- ``view-refresh`` (since 1.13) - -- ``window-close`` 1.13) - -- ``document-close`` (since 1.13) -- ``document-edit`` (since 1.13) - -- ``dialog-info`` (since 1.13) -- ``dialog-close`` (since 1.13) - -- ``arrow-up`` (since 1.13) -- ``arrow-down`` (since 1.13) -- ``arrow-left`` (since 1.13) -- ``arrow-right`` (since 1.13) -- ``arrow-up-left`` (since 1.13) -- ``arrow-up-right`` (since 1.13) -- ``arrow-down-left`` (since 1.13) -- ``arrow-down-right`` (since 1.13) - -- ``edit-delete`` (since 1.13) - -- ``application-chat`` (since 1.13) -- ``application-clock`` (since 1.13) - -- ``media-seek-forward`` 1.13) -- ``media-seek-backward`` (since 1.13) -- ``media-skip-forward`` (since 1.13) -- ``media-skip-backward`` (since 1.13) -- ``media-playback-pause`` (since 1.13) -- ``media-playback-start`` (since 1.13) -- ``media-playback-stop`` (since 1.13) -- ``media-eject`` (since 1.13) - -- ``audio-volume`` (since 1.13) -- ``audio-volume-muted`` (since 1.13) - -These are names for icons that were first intended to be used in -toolbars, but can be used in many other places too: - -- ``home`` -- ``close`` -- ``apps`` -- ``arrow_up`` -- ``arrow_down`` -- ``arrow_left`` -- ``arrow_right`` -- ``chat`` -- ``clock`` -- ``delete`` -- ``edit`` -- ``refresh`` -- ``folder`` -- ``file`` - -These are names for icons that were designed to be used in menus -(but again, you can use them anywhere else): - -- ``menu/home`` -- ``menu/close`` -- ``menu/apps`` -- ``menu/arrow_up`` -- ``menu/arrow_down`` -- ``menu/arrow_left`` -- ``menu/arrow_right`` -- ``menu/chat`` -- ``menu/clock`` -- ``menu/delete`` -- ``menu/edit`` -- ``menu/refresh`` -- ``menu/folder`` -- ``menu/file`` - -And these are names for some media player specific icons: - -- ``media_player/forward`` -- ``media_player/info`` -- ``media_player/next`` -- ``media_player/pause`` -- ``media_player/play`` -- ``media_player/prev`` -- ``media_player/rewind`` -- ``media_player/stop`` - - -Emitted signals -=============== - -- ``thumb,done`` - Setting :py:attr:`~Icon.thumb` has completed with success -- ``thumb,error`` - Setting :py:attr:`~Icon.thumb` has failed - - -Enumerations -============ - -.. _Elm_Icon_Lookup_Order: - -Icon lookup modes ------------------ - -.. data:: ELM_ICON_LOOKUP_FDO_THEME - - freedesktop, theme - -.. data:: ELM_ICON_LOOKUP_THEME_FDO - - theme, freedesktop - -.. data:: ELM_ICON_LOOKUP_FDO - - freedesktop - -.. data:: ELM_ICON_LOOKUP_THEME - - theme - - -.. _Elm_Icon_Type: - -Icon type ---------- - -.. data:: ELM_ICON_NONE - - No icon - -.. data:: ELM_ICON_FILE - - Icon is a file - -.. data:: ELM_ICON_STANDARD - - Icon is set with standards name - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.icon - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from image cimport Image - +include "icon_cdef.pxi" cdef class Icon(Image): """ diff --git a/efl/elementary/icon.py b/efl/elementary/icon.py new file mode 100644 index 0000000..c954ae4 --- /dev/null +++ b/efl/elementary/icon.py @@ -0,0 +1,10 @@ +from . import Icon + +from . import ELM_ICON_LOOKUP_FDO_THEME +from . import ELM_ICON_LOOKUP_THEME_FDO +from . import ELM_ICON_LOOKUP_FDO +from . import ELM_ICON_LOOKUP_THEME + +from . import ELM_ICON_NONE +from . import ELM_ICON_FILE +from . import ELM_ICON_STANDARD diff --git a/efl/elementary/icon.pxd b/efl/elementary/icon_cdef.pxi similarity index 95% rename from efl/elementary/icon.pxd rename to efl/elementary/icon_cdef.pxi index d850fd0..11e188e 100644 --- a/efl/elementary/icon.pxd +++ b/efl/elementary/icon_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - - cdef extern from "Elementary.h": cpdef enum Elm_Icon_Lookup_Order: diff --git a/efl/elementary/image.pyx b/efl/elementary/image.pxi similarity index 88% rename from efl/elementary/image.pyx rename to efl/elementary/image.pxi index 08690b1..95eb637 100644 --- a/efl/elementary/image.pyx +++ b/efl/elementary/image.pxi @@ -16,115 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`image` Module -################### - -.. image:: /images/image-preview.png - - -Widget description -================== - -An Elementary image object allows one to load and display an image -file on it, be it from a disk file or from a memory region. - -Exceptionally, one may also load an Edje group as the contents of the -image. In this case, though, most of the functions of the image API will -act as a no-op. - -One can tune various properties of the image, like: - -- pre-scaling, -- smooth scaling, -- orientation, -- aspect ratio during resizes, etc. - -An image object may also be made valid source and destination for drag -and drop actions by setting :py:attr:`~Image.editable`. - - -Emitted signals -=============== - -- ``drop`` - This is called when a user has dropped an image - typed object onto the object in question -- the - event info argument is the path to that image file -- ``clicked`` - This is called when a user has clicked the image -- ``download,start`` - remote url download has started -- ``download,progress`` - url download in progress -- ``download,end`` - remote url download has finished -- ``download,error`` - remote url download has finished with errors - - -Enumerations -============ - -.. _Elm_Image_Orient: - -Image manipulation types ------------------------- - -.. data:: ELM_IMAGE_ORIENT_NONE - - No orientation change - -.. data:: ELM_IMAGE_ORIENT_0 - - No orientation change - -.. data:: ELM_IMAGE_ROTATE_90 - - Rotate 90 degrees clockwise - -.. data:: ELM_IMAGE_ROTATE_180 - - Rotate 180 degrees clockwise - -.. data:: ELM_IMAGE_ROTATE_270 - - Rotate 270 degrees clockwise - -.. data:: ELM_IMAGE_FLIP_HORIZONTAL - - Flip the image horizontally - -.. data:: ELM_IMAGE_FLIP_VERTICAL - - Flip the image vertically - -.. data:: ELM_IMAGE_FLIP_TRANSPOSE - - Flip the image along the y = (width - x) line (bottom-left to top-right) - -.. data:: ELM_IMAGE_FLIP_TRANSVERSE - - Flip the image along the y = x line (top-left to bottom-right) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.image - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from cpython.buffer cimport Py_buffer, PyObject_GetBuffer, PyBuffer_Release, \ - PyBUF_SIMPLE - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject - - -cdef _cb_string_conv(void *addr): - return _ctouni(addr) if addr is not NULL else None - +include "image_cdef.pxi" cdef class ImageProgressInfo(object): """ImageProgressInfo(...) diff --git a/efl/elementary/image.py b/efl/elementary/image.py new file mode 100644 index 0000000..3400de6 --- /dev/null +++ b/efl/elementary/image.py @@ -0,0 +1,11 @@ +from . import Image + +from . import ELM_IMAGE_ORIENT_NONE +from . import ELM_IMAGE_ORIENT_0 +from . import ELM_IMAGE_ROTATE_90 +from . import ELM_IMAGE_ROTATE_180 +from . import ELM_IMAGE_ROTATE_270 +from . import ELM_IMAGE_FLIP_HORIZONTAL +from . import ELM_IMAGE_FLIP_VERTICAL +from . import ELM_IMAGE_FLIP_TRANSPOSE +from . import ELM_IMAGE_FLIP_TRANSVERSE diff --git a/efl/elementary/image.pxd b/efl/elementary/image_cdef.pxi similarity index 96% rename from efl/elementary/image.pxd rename to efl/elementary/image_cdef.pxi index 517be44..87eb5c9 100644 --- a/efl/elementary/image.pxd +++ b/efl/elementary/image_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object -from object cimport Object - - cdef extern from "Elementary.h": cpdef enum Elm_Image_Orient: @@ -16,8 +12,8 @@ cdef extern from "Elementary.h": ELM_IMAGE_FLIP_TRANSVERSE ctypedef enum Elm_Image_Orient: pass - - + + ctypedef struct Elm_Image_Progress: double now double total @@ -54,6 +50,3 @@ cdef extern from "Elementary.h": Eina_Bool elm_image_animated_get(const Evas_Object *obj) void elm_image_animated_play_set(Evas_Object *obj, Eina_Bool play) Eina_Bool elm_image_animated_play_get(const Evas_Object *obj) - -cdef class Image(Object): - pass diff --git a/efl/elementary/index.pyx b/efl/elementary/index.pxi similarity index 88% rename from efl/elementary/index.pyx rename to efl/elementary/index.pxi index 631563a..fdcdb4e 100644 --- a/efl/elementary/index.pyx +++ b/efl/elementary/index.pxi @@ -15,85 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . - -""" - -:mod:`index` Module -################### - -.. image:: /images/index-preview.png - - -Widget description -================== - -An index widget gives you an index for fast access to whichever -group of other UI items one might have. - -It's a list of text items (usually letters, for alphabetically ordered -access). - -Index widgets are by default hidden and just appear when the -user clicks over it's reserved area in the canvas. In its -default theme, it's an area one ``finger`` wide on -the right side of the index widget's container. - -When items on the index are selected, smart callbacks get called, so that its -user can make other container objects to show a given area or child object -depending on the index item selected. You'd probably be using an index together -with :py:class:`~efl.elementary.list.List`, -:py:class:`~efl.elementary.genlist.Genlist` or -:py:class:`~efl.elementary.gengrid.Gengrid`. - - -Emitted signals -=============== - -- ``changed`` - When the selected index item changes. ``event_info`` - is the selected item's data. -- ``delay,changed`` - When the selected index item changes, but - after a small idling period. ``event_info`` is the selected - item's data. -- ``selected`` - When the user releases a mouse button and - selects an item. ``event_info`` is the selected item's data. -- ``level,up`` - when the user moves a finger from the first - level to the second level -- ``level,down`` - when the user moves a finger from the second - level to the first level -- ``language,changed`` - the program's language changed -- ``focused`` - When the index has received focus. (since 1.8) -- ``unfocused`` - When the index has lost focus. (since 1.8) - -The ``delay,changed`` event has a delay on change before the event is actually -reported and moreover just the last event happening on those time frames will -actually be reported. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.index - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.utils.deprecated cimport DEPRECATED -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass -from object_item cimport _object_item_to_python, elm_object_item_data_get, \ - _object_item_callback2, ObjectItem - -import traceback - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "index_cdef.pxi" cdef int _index_compare_func(const void *data1, const void *data2) with gil: """Comparison by IndexItem objects""" diff --git a/efl/elementary/index.py b/efl/elementary/index.py new file mode 100644 index 0000000..e91cdb1 --- /dev/null +++ b/efl/elementary/index.py @@ -0,0 +1 @@ +from . import Index, IndexItem diff --git a/efl/elementary/index.pxd b/efl/elementary/index_cdef.pxi similarity index 95% rename from efl/elementary/index.pxd rename to efl/elementary/index_cdef.pxi index dcf9833..f525ea2 100644 --- a/efl/elementary/index.pxd +++ b/efl/elementary/index_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_Compare_Cb, Evas_Object, Evas_Smart_Cb -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": Evas_Object *elm_index_add(Evas_Object *parent) void elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled) diff --git a/efl/elementary/innerwindow.pyx b/efl/elementary/innerwindow.pxi similarity index 68% rename from efl/elementary/innerwindow.pyx rename to efl/elementary/innerwindow.pxi index 65be64e..bd2d33e 100644 --- a/efl/elementary/innerwindow.pyx +++ b/efl/elementary/innerwindow.pxi @@ -15,52 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`innerwindow` Module -######################### - -.. image:: /images/innerwindow-preview.png - - -Widget description -================== - -An inwin is a window inside a window that is useful for a quick popup. -It does not hover. - -It works by creating an object that will occupy the entire window, so it must be -created using an :py:class:`~efl.elementary.window.Window` as parent only. The -inwin object can be hidden or restacked below every other object if it's needed -to show what's behind it without destroying it. If this is done, the -:py:meth:`~InnerWindow.activate` function can be used to bring it back to full -visibility again. - - -Available styles -================ - -- ``default`` The inwin is sized to take over most of the window it's - placed in. -- ``minimal`` The size of the inwin will be the minimum necessary to show - its contents. -- ``minimal_vertical`` Horizontally, the inwin takes as much space as - possible, but it's sized vertically the most it needs to fit its - contents. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.innerwindow - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.evas cimport Object as evasObject - -from layout_class cimport LayoutClass +include "innerwindow_cdef.pxi" cdef class InnerWindow(LayoutClass): """ diff --git a/efl/elementary/innerwindow.py b/efl/elementary/innerwindow.py new file mode 100644 index 0000000..7e8e4f2 --- /dev/null +++ b/efl/elementary/innerwindow.py @@ -0,0 +1 @@ +from . import InnerWindow diff --git a/efl/elementary/innerwindow.pxd b/efl/elementary/innerwindow_cdef.pxi similarity index 92% rename from efl/elementary/innerwindow.pxd rename to efl/elementary/innerwindow_cdef.pxi index cf4a74e..d6d6d95 100644 --- a/efl/elementary/innerwindow.pxd +++ b/efl/elementary/innerwindow_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_win_inwin_add(Evas_Object *obj) void elm_win_inwin_activate(Evas_Object *obj) diff --git a/efl/elementary/label.pyx b/efl/elementary/label.pxi similarity index 75% rename from efl/elementary/label.pyx rename to efl/elementary/label.pxi index c641797..a39c24a 100644 --- a/efl/elementary/label.pyx +++ b/efl/elementary/label.pxi @@ -16,111 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`label` Module -################### - -.. image:: /images/label-preview.png - - -Widget description -================== - -Widget to display text, with simple html-like markup. - -The Label widget **doesn't** allow text to overflow its boundaries, if the -text doesn't fit the geometry of the label it will be ellipsized or be -cut. - - -Available styles -================ - -``default`` - No animation -``marker`` - Centers the text in the label and makes it bold by default -``slide_long`` - The entire text appears from the right of the screen and - slides until it disappears in the left of the screen(reappearing on - the right again). -``slide_short`` - The text appears in the left of the label and slides to - the right to show the overflow. When all of the text has been shown - the position is reset. -``slide_bounce`` - The text appears in the left of the label and slides to - the right to show the overflow. When all of the text has been shown - the animation reverses, moving the text to the left. - -Custom themes can of course invent new markup tags and style them any way -they like. - - -Emitted signals -=============== - -- ``language,changed`` - The program's language changed. -- ``slide,end`` - The slide is end. - - -Enumerations -============ - -.. _Elm_Label_Wrap_Type: - -Wrap modes ----------- - -.. data:: ELM_WRAP_NONE - - No wrap - -.. data:: ELM_WRAP_CHAR - - Wrap between characters - -.. data:: ELM_WRAP_WORD - - Wrap in allowed wrapping points (as defined in the unicode standard) - -.. data:: ELM_WRAP_MIXED - - Word wrap, and if that fails, char wrap. - - -.. _Elm_Label_Slide_Mode: - -Slide modes ------------ - -.. data:: ELM_LABEL_SLIDE_MODE_NONE - - The label will never slide. - -.. data:: ELM_LABEL_SLIDE_MODE_AUTO - - The label slide if the content is bigger than it's container. - -.. data:: ELM_LABEL_SLIDE_MODE_ALWAYS - - The label will always slide. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.label - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass -from efl.utils.deprecated cimport DEPRECATED - +include "label_cdef.pxi" cdef class Label(LayoutClass): """ diff --git a/efl/elementary/label.py b/efl/elementary/label.py new file mode 100644 index 0000000..1c3f9f7 --- /dev/null +++ b/efl/elementary/label.py @@ -0,0 +1,10 @@ +from . import Label + +from . import ELM_WRAP_NONE +from . import ELM_WRAP_CHAR +from . import ELM_WRAP_WORD +from . import ELM_WRAP_MIXED + +from . import ELM_LABEL_SLIDE_MODE_NONE +from . import ELM_LABEL_SLIDE_MODE_AUTO +from . import ELM_LABEL_SLIDE_MODE_ALWAYS diff --git a/efl/elementary/label.pxd b/efl/elementary/label_cdef.pxi similarity index 96% rename from efl/elementary/label.pxd rename to efl/elementary/label_cdef.pxi index b39b0de..c7b91f3 100644 --- a/efl/elementary/label.pxd +++ b/efl/elementary/label_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - - cdef extern from "Elementary.h": cpdef enum Elm_Wrap_Type: diff --git a/efl/elementary/layout.pxd b/efl/elementary/layout.pxd deleted file mode 100644 index f4ecacf..0000000 --- a/efl/elementary/layout.pxd +++ /dev/null @@ -1,4 +0,0 @@ -from efl.evas cimport Evas_Object - -cdef extern from "Elementary.h": - Evas_Object * elm_layout_add(Evas_Object *parent) diff --git a/efl/elementary/layout_class.pyx b/efl/elementary/layout.pxi similarity index 95% rename from efl/elementary/layout_class.pyx rename to efl/elementary/layout.pxi index e95becb..efb97ab 100644 --- a/efl/elementary/layout_class.pyx +++ b/efl/elementary/layout.pxi @@ -15,55 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`layout_class` Module -########################## - -Description -=========== - -Elementary, besides having the :py:class:`~efl.elementary.layout.Layout` -widget, exposes its foundation -- the Elementary Layout Class -- in -order to create other widgets which are, basically, a certain layout -with some more logic on top. - -The idea is to make the creation of that widgets as easy as possible, -factorizing code on this common base. For example, a button is a layout -(that looks like push button) that happens to react on clicks and keyboard -events in a special manner, calling its user back on those events. That's no -surprise, then, that the :py:class:`~efl.elementary.button.Button` -implementation relies on LayoutClass, if you go to check it. - -Container parts, here, map directly to Edje parts from the layout's Edje -group. Besides that, there's a whole infrastructure around Edje files: - -- interfacing by signals, -- setting/retrieving text part values, -- dealing with table and box parts directly, -- etc. - -Finally, layout objects will do **part aliasing** for you, if you set -it up properly. For that, take a look at -Elm_Layout_Part_Alias_Description, where it's explained in detail. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.layout_class - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject, eina_list_free -from object cimport Object - -import traceback +include "layout_cdef.pxi" cdef void layout_signal_callback(void *data, Evas_Object *obj, const char *emission, const char *source) with gil: @@ -83,6 +35,8 @@ cdef class LayoutClass(Object): """ + cdef dict _elm_layout_signal_cbs + def __cinit__(self): self._elm_layout_signal_cbs = {} @@ -211,7 +165,7 @@ cdef class LayoutClass(Object): const char *file const char *group elm_layout_file_get(self.obj, &file, &group) - return (_ctouni(file), _ctouni(group)) + return (_ctouni(file), _ctouni(group)) def file_set(self, filename, group = None): if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename) @@ -979,3 +933,27 @@ cdef class LayoutClass(Object): def callback_language_changed_del(self, func): self._callback_del("language,changed", func) + + +cdef class Layout(LayoutClass): + """ + + This is the class that actually implements the widget. + + """ + + def __init__(self, evasObject parent, *args, **kwargs): + """Layout(...) + + :param parent: The parent object + :type parent: :py:class:`efl.evas.Object` + :param \**kwargs: All the remaining keyword arguments are interpreted + as properties of the instance + + """ + self._set_obj(elm_layout_add(parent.obj)) + self._set_properties_from_keyword_args(kwargs) + + +_object_mapping_register("Elm_Layout", Layout) + diff --git a/efl/elementary/layout.py b/efl/elementary/layout.py new file mode 100644 index 0000000..09f7e62 --- /dev/null +++ b/efl/elementary/layout.py @@ -0,0 +1 @@ +from . import Layout diff --git a/efl/elementary/layout.pyx b/efl/elementary/layout.pyx deleted file mode 100644 index 5be9794..0000000 --- a/efl/elementary/layout.pyx +++ /dev/null @@ -1,178 +0,0 @@ -# Copyright (C) 2007-2015 various contributors (see AUTHORS) -# -# This file is part of Python-EFL. -# -# Python-EFL 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-EFL 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-EFL. If not, see . - -""" - -:mod:`layout` Module -#################### - -.. image:: /images/layout-preview.png - - -Widget description -================== - -This is a container widget that takes a standard Edje design file and -wraps it very thinly in a widget. - -An Edje design (theme) file has a very wide range of possibilities to -describe the behavior of elements added to the Layout. Check out the Edje -documentation and the EDC reference to get more information about what can -be done with Edje. - -Just like :py:class:`~efl.elementary.list.List`, -:py:class:`~efl.elementary.box.Box`, and other container -widgets, any object added to the Layout will become its child, meaning -that it will be deleted if the Layout is deleted, move if the Layout is -moved, and so on. - -The Layout widget can contain as many Contents, Boxes or Tables as -described in its theme file. For instance, objects can be added to -different Tables by specifying the respective Table part names. The same -is valid for Content and Box. - -The objects added as child of the Layout will behave as described in the -part description where they were added. There are 3 possible types of -parts where a child can be added: - -Content (SWALLOW part) - Only one object can be added to the ``SWALLOW`` part (but you still can - have many ``SWALLOW`` parts and one object on each of them). Use the - ``Object.content_set/get/unset`` functions to set, retrieve and unset - objects as content of the *SWALLOW*. After being set to this part, - the object size, position, visibility, clipping and other description - properties will be totally controlled by the description of the - given part (inside the Edje theme file). - - One can use ``size_hint_`` functions on the child to have some kind of - control over its behavior, but the resulting behavior will still - depend heavily on the ``SWALLOW`` part description. - - The Edje theme also can change the part description, based on - signals or scripts running inside the theme. This change can also be - animated. All of this will affect the child object set as content - accordingly. The object size will be changed if the part size is - changed, it will animate move if the part is moving, and so on. - -Box (BOX part) - An Edje ``BOX`` part is very similar to the Elementary - :py:class:`~efl.elementary.box.Box` widget. It allows one to add objects to - the box and have them distributed along its area, accordingly to the - specified ``layout`` property (now by ``layout`` we mean the chosen - layouting design of the Box, not the Layout widget itself). - - A similar effect for having a box with its position, size and other things - controlled by the Layout theme would be to create an Elementary - :py:class:`~efl.elementary.box.Box` widget and add it as a Content in the - ``SWALLOW`` part. - - The main difference of using the Layout Box is that its behavior, the box - properties like layouting format, padding, align, etc. will be all - controlled by the theme. This means, for example, that a signal could be - sent to the Layout theme (with - :py:meth:`~efl.elementary.object.Object.signal_emit`) and the theme handled - the signal by changing the box padding, or align, or both. Using the - Elementary :py:class:`~efl.elementary.box.Box` widget is not necessarily - harder or easier, it just depends on the circumstances and requirements. - - The Layout Box can be used through the ``box_`` set of functions. - -Table (TABLE part) - Just like the *Box*, the Layout Table is very similar to the Elementary - :py:class:`~efl.elementary.table.Table` widget. It allows one to add objects - to the Table specifying the row and column where the object should be added, - and any column or row span if necessary. - - Again, we could have this design by adding a - :py:class:`~efl.elementary.table.Table` widget to the ``SWALLOW`` part using - :py:func:`~efl.elementary.object.Object.part_content_set`. The same - difference happens here when choosing to use the Layout Table (a ``TABLE`` - part) instead of the :py:class:`~efl.elementary.table.Table` plus - ``SWALLOW`` part. It's just a matter of convenience. - - The Layout Table can be used through the ``table_`` set of functions. - -Another interesting thing about the Layout widget is that it offers some -predefined themes that come with the default Elementary theme. These themes can -be set by :py:attr:`~efl.elementary.layout_class.LayoutClass.theme`, and provide -some basic functionality depending on the theme used. - -Most of them already send some signals, some already provide a toolbar or -back and next buttons. - - -Available styles -================ - -These are available predefined theme layouts. All of them have class = -*layout*, group = *application*, and style = one of the following options: - -- ``toolbar-content`` - application with toolbar and main content area -- ``toolbar-content-back`` - application with toolbar and main content - area with a back button and title area -- ``toolbar-content-back-next`` - application with toolbar and main - content area with a back and next buttons and title area -- ``content-back`` - application with a main content area with a back - button and title area -- ``content-back-next`` - application with a main content area with a - back and next buttons and title area -- ``toolbar-vbox`` - application with toolbar and main content area as a - vertical box -- ``toolbar-table`` - application with toolbar and main content area as a - table - - -Emitted signals -=============== - -- ``theme,changed`` - The theme was changed. -- ``language,changed`` - the program's language changed - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.layout - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - -cdef class Layout(LayoutClass): - """ - - This is the class that actually implements the widget. - - """ - - def __init__(self, evasObject parent, *args, **kwargs): - """Layout(...) - - :param parent: The parent object - :type parent: :py:class:`efl.evas.Object` - :param \**kwargs: All the remaining keyword arguments are interpreted - as properties of the instance - - """ - self._set_obj(elm_layout_add(parent.obj)) - self._set_properties_from_keyword_args(kwargs) - - -_object_mapping_register("Elm_Layout", Layout) diff --git a/efl/elementary/layout_class.pxd b/efl/elementary/layout_cdef.pxi similarity index 81% rename from efl/elementary/layout_class.pxd rename to efl/elementary/layout_cdef.pxi index f9a8a42..7405d5e 100644 --- a/efl/elementary/layout_class.pxd +++ b/efl/elementary/layout_cdef.pxi @@ -1,23 +1,3 @@ -# Copyright (C) 2007-2015 various contributors (see AUTHORS) -# -# This file is part of Python-EFL. -# -# Python-EFL 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-EFL 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-EFL. If not, see . - -from efl.evas cimport Evas_Object, Eina_Bool, Eina_List -from object cimport Object - cdef extern from "Edje.h": ctypedef void (*Edje_Signal_Cb)(void *data, Evas_Object *obj, const char *emission, const char *source) @@ -62,5 +42,4 @@ cdef extern from "Elementary.h": void elm_layout_end_set(Evas_Object *obj, Evas_Object *end) Evas_Object * elm_layout_end_get(const Evas_Object *obj) -cdef class LayoutClass(Object): - cdef object _elm_layout_signal_cbs + Evas_Object * elm_layout_add(Evas_Object *parent) diff --git a/efl/elementary/list.pyx b/efl/elementary/list.pxi similarity index 86% rename from efl/elementary/list.pyx rename to efl/elementary/list.pxi index f33e562..53d80c7 100644 --- a/efl/elementary/list.pyx +++ b/efl/elementary/list.pxi @@ -16,184 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`list` Module -################## - -.. image:: /images/list-preview.png - - -Widget description -================== - -A list widget is a container whose children are displayed vertically or -horizontally, in order, and can be selected. -The list can accept only one or multiple items selection. Also has many -modes of items displaying. - -A list is a very simple type of list widget. For more robust -lists, :py:class:`~efl.elementary.genlist.Genlist` should probably be used. - - -Emitted signals -=============== - -- ``activated`` - The user has double-clicked or pressed - (enter|return|spacebar) on an item. -- ``clicked,double`` - The user has double-clicked an item. -- ``clicked,right`` - The user has right-clicked an item. (since: 1.13) -- ``selected`` - when the user selected an item -- ``unselected`` - when the user unselected an item -- ``longpressed`` - an item in the list is long-pressed -- ``edge,top`` - the list is scrolled until the top edge -- ``edge,bottom`` - the list is scrolled until the bottom edge -- ``edge,left`` - the list is scrolled until the left edge -- ``edge,right`` - the list is scrolled until the right edge -- ``highlighted`` - an item in the list is highlighted. This is called when - the user presses an item or keyboard selection is done so the item is - physically highlighted. -- ``unhighlighted`` - an item in the list is unhighlighted. This is called - when the user releases an item or keyboard selection is moved so the item - is physically unhighlighted. -- ``language,changed`` - the program's language changed -- ``focused`` - When the list has received focus. (since 1.8) -- ``unfocused`` - When the list has lost focus. (since 1.8) -- ``item,focused`` - When the list item has received focus. (since 1.10) -- ``item,unfocused`` - When the list item has lost focus. (since 1.10) - - -Available styles -================ - -- ``default`` - - -Layout content parts -==================== - -- ``start`` - A start position object in the list item -- ``end`` - A end position object in the list item - - -Layout text parts -================= - -- ``default`` - label in the list item - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scolling behaviour using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.scroller.Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Enumerations -============ - -.. _Elm_List_Mode: - -List sizing modes ------------------ - -.. data:: ELM_LIST_COMPRESS - - The list won't set any of its size hints to inform how a possible container - should resize it. - - Then, if it's not created as a "resize object", it might end with zeroed - dimensions. The list will respect the container's geometry and, if any of - its items won't fit into its transverse axis, one won't be able to scroll it - in that direction. - -.. data:: ELM_LIST_SCROLL - - Default value. - - This is the same as ELM_LIST_COMPRESS, with the exception that if any of - its items won't fit into its transverse axis, one will be able to scroll - it in that direction. - -.. data:: ELM_LIST_LIMIT - - Sets a minimum size hint on the list object, so that containers may - respect it (and resize itself to fit the child properly). - - More specifically, a minimum size hint will be set for its transverse - axis, so that the largest item in that direction fits well. This is - naturally bound by the list object's maximum size hints, set externally. - -.. data:: ELM_LIST_EXPAND - - Besides setting a minimum size on the transverse axis, just like on - ELM_LIST_LIMIT, the list will set a minimum size on the longitudinal - axis, trying to reserve space to all its children to be visible at a time. - - This is naturally bound by the list object's maximum size hints, set - externally. - - -.. _Elm_List_Object_Select_Mode: - -Selection modes ---------------- - -.. data:: ELM_OBJECT_SELECT_MODE_DEFAULT - - Items will only call their selection func and callback when - first becoming selected. Any further clicks will do nothing, - unless you set always select mode. - -.. data:: ELM_OBJECT_SELECT_MODE_ALWAYS - - This means that, even if selected, every click will make the - selected callbacks be called. - -.. data:: ELM_OBJECT_SELECT_MODE_NONE - - This will turn off the ability to select items entirely and - they will neither appear selected nor call selected callback - functions. - -.. data:: ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY - - No select mode with no finger size rule - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.list - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT -from efl.evas cimport Object as evasObject -from object cimport Object -from object_item cimport _object_item_callback, _object_item_callback2, \ - _object_item_to_python, _object_item_list_to_python, ObjectItem - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "list_cdef.pxi" cdef class ListItem(ObjectItem): """ diff --git a/efl/elementary/list.py b/efl/elementary/list.py new file mode 100644 index 0000000..10be3e7 --- /dev/null +++ b/efl/elementary/list.py @@ -0,0 +1,16 @@ +from . import List, ListItem + +from . import ELM_LIST_COMPRESS +from . import ELM_LIST_SCROLL +from . import ELM_LIST_LIMIT +from . import ELM_LIST_EXPAND + +from . import ELM_OBJECT_SELECT_MODE_DEFAULT +from . import ELM_OBJECT_SELECT_MODE_ALWAYS +from . import ELM_OBJECT_SELECT_MODE_NONE +from . import ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY +from . import ELM_OBJECT_SELECT_MODE_MAX + +from . import ELM_SCROLLER_POLICY_AUTO +from . import ELM_SCROLLER_POLICY_ON +from . import ELM_SCROLLER_POLICY_OFF diff --git a/efl/elementary/list.pxd b/efl/elementary/list_cdef.pxi similarity index 96% rename from efl/elementary/list.pxd rename to efl/elementary/list_cdef.pxi index bc15c9d..843bb46 100644 --- a/efl/elementary/list.pxd +++ b/efl/elementary/list_cdef.pxi @@ -1,8 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Eina_Compare_Cb, \ - Evas_Object, Evas_Smart_Cb, Evas_Coord -from object_item cimport Elm_Object_Item - - cdef extern from "Elementary.h": cpdef enum Elm_List_Mode: diff --git a/efl/elementary/map.pyx b/efl/elementary/map.pxi similarity index 91% rename from efl/elementary/map.pyx rename to efl/elementary/map.pxi index ef9910a..e02e5e0 100644 --- a/efl/elementary/map.pyx +++ b/efl/elementary/map.pxi @@ -16,223 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`map` Module -################# - -.. image:: /images/map-preview.png - :width: 100% - - -Widget description -================== - -The *Map* is a widget specifically for displaying a geographic map. -It uses `OpenStreetMap `_ as map tile provider, -`YOURS `_ for routing calculation and -`Nominatim `_ to convert geographic -coordinates to/from address names. But custom providers can be added. - -It supports some basic but yet nice features: - -- zooming and scrolling -- markers with content to be displayed when user clicks over them -- automatic grouping of markers based on zoom level -- routes calculation -- names/coordinates conversion (and viceversa) - - -Emitted signals -=============== - -- ``clicked`` - Called when a user has clicked the map without dragging around. -- ``clicked,double`` - Called when a user has double-clicked the map. -- ``press`` - This is called when a user has pressed down on the map. -- ``longpressed`` - This is called when a user has pressed down on the map - for a long time without dragging around. -- ``scroll`` - the content has been scrolled (moved). -- ``scroll,drag,start`` - dragging the contents around has started. -- ``scroll,drag,stop`` - dragging the contents around has stopped. -- ``scroll,anim,start`` - scrolling animation has started. -- ``scroll,anim,stop`` - scrolling animation has stopped. -- ``zoom,start`` - Zoom animation started. -- ``zoom,stop`` - Zoom animation stopped. -- ``zoom,change`` - Zoom changed when using an auto zoom mode. -- ``tile,load`` - A map tile image load begins. -- ``tile,loaded`` - A map tile image load ends. -- ``tile,loaded,fail`` - A map tile image load fails. -- ``route,load`` - Route request begins. -- ``route,loaded`` - Route request ends. -- ``route,loaded,fail`` - Route request fails. -- ``name,load`` - Name request begins. -- ``name,loaded`` - Name request ends. -- ``name,loaded,fail`` - Name request fails. -- ``overlay,clicked`` - A overlay is clicked. -- ``loaded`` - when a map is finally loaded. -- ``language,changed`` - the program's language changed -- ``focused`` - When the map has received focus. (since 1.8) -- ``unfocused`` - When the map has lost focus. (since 1.8) - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scolling behaviour using these functions, -inherit both the widget class and the -:py:class:`Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Enumerations -============ - -.. _Elm_Map_Overlay_Type: - -Map overlay types ------------------ - -.. data:: ELM_MAP_OVERLAY_TYPE_NONE - - None - -.. data:: ELM_MAP_OVERLAY_TYPE_DEFAULT - - The default overlay type. - -.. data:: ELM_MAP_OVERLAY_TYPE_CLASS - - The Class overlay is used to group marker together. - -.. data:: ELM_MAP_OVERLAY_TYPE_GROUP - - A group of overlays. - -.. data:: ELM_MAP_OVERLAY_TYPE_BUBBLE - - This class can *follow* another overlay. - -.. data:: ELM_MAP_OVERLAY_TYPE_ROUTE - - This is used to draw a route result on the map. - -.. data:: ELM_MAP_OVERLAY_TYPE_LINE - - Simply draw a line on the map. - -.. data:: ELM_MAP_OVERLAY_TYPE_POLYGON - - Simply draw a polygon on the map. - -.. data:: ELM_MAP_OVERLAY_TYPE_CIRCLE - - Simply draw a circle on the map. - -.. data:: ELM_MAP_OVERLAY_TYPE_SCALE - - This will draw a dinamic scale on the map. - - -.. _Elm_Map_Route_Method: - -Map route methods ------------------ - -.. data:: ELM_MAP_ROUTE_METHOD_FASTEST - - Route should prioritize time - -.. data:: ELM_MAP_ROUTE_METHOD_SHORTEST - - Route should prioritize distance - - -.. _Elm_Map_Route_Type: - -Map route types ---------------- - -.. data:: ELM_MAP_ROUTE_TYPE_MOTOCAR - - Route should consider an automobile will be used. - -.. data:: ELM_MAP_ROUTE_TYPE_BICYCLE - - Route should consider a bicycle will be used by the user. - -.. data:: ELM_MAP_ROUTE_TYPE_FOOT - - Route should consider user will be walking. - - -.. _Elm_Map_Source_Type: - -Map source types ----------------- - -.. data:: ELM_MAP_SOURCE_TYPE_TILE - - Map tile provider - -.. data:: ELM_MAP_SOURCE_TYPE_ROUTE - - Route service provider - -.. data:: ELM_MAP_SOURCE_TYPE_NAME - - Name service provider - - -.. _Elm_Map_Zoom_Mode: - -Map zoom modes --------------- - -.. data:: ELM_MAP_ZOOM_MODE_MANUAL - - Zoom controlled manually by :py:attr:`~Map.zoom` - - It's set by default. - -.. data:: ELM_MAP_ZOOM_MODE_AUTO_FIT - - Zoom until map fits inside the scroll frame with no pixels outside this - area. - -.. data:: ELM_MAP_ZOOM_MODE_AUTO_FILL - - Zoom until map fills scroll, ensuring no pixels are left unfilled. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.map - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from object cimport Object - -from efl.evas cimport eina_list_free, eina_list_append -import traceback - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - - +include "map_cdef.pxi" cdef object _elm_map_overlay_to_python(Elm_Map_Overlay *ov): cdef void *data diff --git a/efl/elementary/map.py b/efl/elementary/map.py new file mode 100644 index 0000000..cc9dea4 --- /dev/null +++ b/efl/elementary/map.py @@ -0,0 +1,29 @@ +from . import Map, MapRoute, MapName, MapOverlay, MapOverlayClass, \ + MapOverlayBubble, MapOverlayLine, MapOverlayPolygon, MapOverlayCircle, \ + MapOverlayScale, MapOverlayRoute + +from . import ELM_MAP_OVERLAY_TYPE_NONE +from . import ELM_MAP_OVERLAY_TYPE_DEFAULT +from . import ELM_MAP_OVERLAY_TYPE_CLASS +from . import ELM_MAP_OVERLAY_TYPE_GROUP +from . import ELM_MAP_OVERLAY_TYPE_BUBBLE +from . import ELM_MAP_OVERLAY_TYPE_ROUTE +from . import ELM_MAP_OVERLAY_TYPE_LINE +from . import ELM_MAP_OVERLAY_TYPE_POLYGON +from . import ELM_MAP_OVERLAY_TYPE_CIRCLE +from . import ELM_MAP_OVERLAY_TYPE_SCALE + +from . import ELM_MAP_ROUTE_METHOD_FASTEST +from . import ELM_MAP_ROUTE_METHOD_SHORTEST + +from . import ELM_MAP_ROUTE_TYPE_MOTOCAR +from . import ELM_MAP_ROUTE_TYPE_BICYCLE +from . import ELM_MAP_ROUTE_TYPE_FOOT + +from . import ELM_MAP_SOURCE_TYPE_TILE +from . import ELM_MAP_SOURCE_TYPE_ROUTE +from . import ELM_MAP_SOURCE_TYPE_NAME + +from . import ELM_MAP_ZOOM_MODE_MANUAL +from . import ELM_MAP_ZOOM_MODE_AUTO_FIT +from . import ELM_MAP_ZOOM_MODE_AUTO_FILL diff --git a/efl/elementary/map.pxd b/efl/elementary/map_cdef.pxi similarity index 99% rename from efl/elementary/map.pxd rename to efl/elementary/map_cdef.pxi index 1110f2a..8d7c0c6 100644 --- a/efl/elementary/map.pxd +++ b/efl/elementary/map_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Coord - - cdef extern from "Elementary.h": cpdef enum Elm_Map_Overlay_Type: diff --git a/efl/elementary/mapbuf.pyx b/efl/elementary/mapbuf.pxi similarity index 86% rename from efl/elementary/mapbuf.pyx rename to efl/elementary/mapbuf.pxi index a504a72..8311d63 100644 --- a/efl/elementary/mapbuf.pyx +++ b/efl/elementary/mapbuf.pxi @@ -15,42 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`mapbuf` Module -#################### - -.. image:: /images/mapbuf-preview.png - - -Widget description -================== - -This holds one content object and uses an Evas Map of transformation -points to be later used with this content. So the content will be -moved, resized, etc as a single image. So it will improve performance -when you have a complex interface, with a lot of elements, and will -need to resize or move it frequently (the content object and its -children). - - -Layout content parts -==================== - -- ``default`` - The main content of the mapbuf - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.mapbuf - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from object cimport Object +include "mapbuf_cdef.pxi" cdef class Mapbuf(Object): """ @@ -174,7 +139,7 @@ cdef class Mapbuf(Object): """ elm_mapbuf_point_color_set(self.obj, idx, r, g, b, a) - + def point_color_get(self, int idx): """Get the color on a vertex in the mapbuf. diff --git a/efl/elementary/mapbuf.py b/efl/elementary/mapbuf.py new file mode 100644 index 0000000..7a2c9ca --- /dev/null +++ b/efl/elementary/mapbuf.py @@ -0,0 +1 @@ +from . import Mapbuf diff --git a/efl/elementary/mapbuf.pxd b/efl/elementary/mapbuf_cdef.pxi similarity index 95% rename from efl/elementary/mapbuf.pxd rename to efl/elementary/mapbuf_cdef.pxi index 11f6166..66f9faf 100644 --- a/efl/elementary/mapbuf.pxd +++ b/efl/elementary/mapbuf_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_mapbuf_add(Evas_Object *parent) void elm_mapbuf_enabled_set(Evas_Object *obj, Eina_Bool enabled) diff --git a/efl/elementary/menu.pyx b/efl/elementary/menu.pxi similarity index 91% rename from efl/elementary/menu.pyx rename to efl/elementary/menu.pxi index 8b29ae0..1c2e9ea 100644 --- a/efl/elementary/menu.pyx +++ b/efl/elementary/menu.pxi @@ -15,59 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . - -""" - -:mod:`menu` Module -################## - -.. image:: /images/menu-preview.png - - -Widget description -================== - -A menu is a list of items displayed above its parent. - -When the menu is showing its parent is darkened. Each item can have a -sub-menu. The menu object can be used to display a menu on a right click -event, in a toolbar, anywhere. - - -Emitted signals -=============== - -- ``clicked`` - the user clicked the empty space in the menu to dismiss. -- ``dismissed`` - the user clicked the empty space in the menu to dismiss (since 1.8) - - -Layout content parts -==================== - -- ``default`` - A main content of the menu item - - -Layout text parts -================= - -- ``default`` - label in the menu item - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.menu - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from object_item cimport _object_item_callback, _object_item_list_to_python, \ - _object_item_to_python, _object_item_callback2, ObjectItem +include "menu_cdef.pxi" cdef class MenuItem(ObjectItem): """ diff --git a/efl/elementary/menu.py b/efl/elementary/menu.py new file mode 100644 index 0000000..c2ca88e --- /dev/null +++ b/efl/elementary/menu.py @@ -0,0 +1 @@ +from . import Menu, MenuItem, MenuSeparatorItem diff --git a/efl/elementary/menu.pxd b/efl/elementary/menu_cdef.pxi similarity index 90% rename from efl/elementary/menu.pxd rename to efl/elementary/menu_cdef.pxi index 7676800..bf734ee 100644 --- a/efl/elementary/menu.pxd +++ b/efl/elementary/menu_cdef.pxi @@ -1,8 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Coord, \ - Evas_Smart_Cb -from object cimport Object -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": Evas_Object *elm_menu_add(Evas_Object *parent) void elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent) @@ -26,6 +21,3 @@ cdef extern from "Elementary.h": Elm_Object_Item *elm_menu_first_item_get(const Evas_Object *obj) Elm_Object_Item *elm_menu_item_next_get(const Elm_Object_Item *it) Elm_Object_Item *elm_menu_item_prev_get(const Elm_Object_Item *it) - -cdef class Menu(Object): - pass diff --git a/efl/elementary/multibuttonentry.pyx b/efl/elementary/multibuttonentry.pxi similarity index 86% rename from efl/elementary/multibuttonentry.pyx rename to efl/elementary/multibuttonentry.pxi index ea2fe89..16686b7 100644 --- a/efl/elementary/multibuttonentry.pyx +++ b/efl/elementary/multibuttonentry.pxi @@ -15,84 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`multibuttonentry` Module -############################## - -.. image:: /images/multibuttonentry-preview.png - - -Widget description -================== - -A Multibuttonentry is a widget to allow a user enter text and manage -it as a number of buttons. Each text button is inserted by pressing the -"return" key. If there is no space in the current row, a new button is -added to the next row. When a text button is pressed, it will become -focused. Backspace removes the focus. When the Multibuttonentry loses -focus items longer than one line are shrunk to one line. - -Typical use case of multibuttonentry is, composing emails/messages to a -group of addresses, each of which is an item that can be clicked for -further actions. - - -Emitted signals -=============== - -- ``item,selected`` - this is called when an item is selected by - api, user interaction, and etc. this is also called when a - user press back space while cursor is on the first field of - entry. event_info contains the item. -- ``item,added`` - when a new multi-button entry item is added. - event_info contains the item. -- ``item,deleted`` - when a multi-button entry item is deleted. - event_info contains the item. -- ``item,clicked`` - this is called when an item is clicked by user - interaction. Both "item,selected" and "item,clicked" are needed. - event_info contains the item. -- ``clicked`` - when multi-button entry is clicked. -- ``focused`` - when multi-button entry is focused. -- ``unfocused`` - when multi-button entry is unfocused. -- ``expanded`` - when multi-button entry is expanded. -- ``contracted`` - when multi-button entry is contracted. -- ``expand,state,changed`` - when shrink mode state of - multi-button entry is changed. - -Layout text parts -================= - -- ``default`` - A label of the multibuttonentry -- ``default`` - A label of the multibuttonentry item - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.multibuttonentry - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String, Py_INCREF -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject, evas_object_smart_callback_add - -from libc.string cimport strdup -from object cimport Object -import traceback -from object_item cimport _object_item_callback, _object_item_callback2, \ - _object_item_to_python, _object_item_list_to_python, ObjectItem, \ - elm_object_item_data_get - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "multibuttonentry_cdef.pxi" cdef Eina_Bool _multibuttonentry_filter_callback(Evas_Object *obj, \ const char *item_label, void *item_data, void *data) with gil: diff --git a/efl/elementary/multibuttonentry.py b/efl/elementary/multibuttonentry.py new file mode 100644 index 0000000..c4b3931 --- /dev/null +++ b/efl/elementary/multibuttonentry.py @@ -0,0 +1 @@ +from . import MultiButtonEntry, MultiButtonEntryItem diff --git a/efl/elementary/multibuttonentry.pxd b/efl/elementary/multibuttonentry_cdef.pxi similarity index 96% rename from efl/elementary/multibuttonentry.pxd rename to efl/elementary/multibuttonentry_cdef.pxi index 14693d5..1168b48 100644 --- a/efl/elementary/multibuttonentry.pxd +++ b/efl/elementary/multibuttonentry_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": ctypedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_Cb)(Evas_Object *obj, const char *item_label, void *item_data, void *data) diff --git a/efl/elementary/naviframe.pyx b/efl/elementary/naviframe.pxi similarity index 84% rename from efl/elementary/naviframe.pyx rename to efl/elementary/naviframe.pxi index 394dad5..16bf1ce 100644 --- a/efl/elementary/naviframe.pyx +++ b/efl/elementary/naviframe.pxi @@ -15,116 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`naviframe` Module -####################### - -.. image:: /images/naviframe-preview.png - - -Widget description -================== - -Naviframe stands for navigation frame. It's a views manager -for applications. - -A naviframe holds views (or pages) as its items. Those items are -organized in a stack, so that new items get pushed on top of the -old, and only the topmost view is displayed at one time. The -transition between views is animated, depending on the theme -applied to the widget. - -Naviframe views hold spaces to various elements, which are: - -- back button, used to navigate to previous views, -- next button, used to navigate to next views in the stack, -- title label, -- sub-title label, -- title icon and -- content area. - - -Layout content parts -==================== - -- ``default`` - The main content of the current page -- ``icon`` - An icon in the title area of the current page -- ``prev_btn`` - A button of the current page to go to the previous page -- ``next_btn`` - A button of the current page to go to the next page - - -Layout text parts -================= - -- ``default`` - Title label in the title area of the current page -- ``subtitle`` - Sub-title label in the title area of the current page - -Most of those content objects can be passed at the time of an item -creation (see :py:meth:`~NaviframeItem.push_to`). - - -Available styles -================ - -Naviframe items can have different styles, which affect the -transition between views, for example. On the default theme, two of -them are supported: - -- ``basic`` - views are switched sliding horizontally, one after the other -- ``overlap`` - like the previous one, but the previous view stays at its place - and is overlapped by the new - - -Emitted signals -=============== - -- ``transition,finished`` - When the transition is finished in changing the item -- ``title,transition,finished`` - When the title area's transition is finished -- ``title,clicked`` - User clicked title area -- ``focused`` - When the naviframe has received focus. (since 1.8) -- ``unfocused`` - When the naviframe has lost focus. (since 1.8) - -All the parts, for content and text, described here will also be -reachable by naviframe **items** direct calls: - -- :py:meth:`~efl.elementary.object_item.ObjectItem.delete` -- :py:meth:`~efl.elementary.object_item.ObjectItem.part_text_set` -- :py:meth:`~efl.elementary.object_item.ObjectItem.part_text_get` -- :py:meth:`~efl.elementary.object_item.ObjectItem.part_content_set` -- :py:meth:`~efl.elementary.object_item.ObjectItem.part_content_get` -- :py:meth:`~efl.elementary.object_item.ObjectItem.part_content_unset` -- :py:meth:`~efl.elementary.object_item.ObjectItem.signal_emit` - -What happens is that the topmost item of a naviframe will be the -widget's target layout, when accessed directly. Items lying below -the top one can be interacted with this way. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.naviframe - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - -from object_item cimport _object_item_to_python, _object_item_list_to_python, \ - ObjectItem - -from efl.utils.deprecated cimport DEPRECATED - -import traceback - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) +include "naviframe_cdef.pxi" cdef Eina_Bool py_elm_naviframe_item_pop_cb(void *data, Elm_Object_Item *it): cdef: diff --git a/efl/elementary/naviframe.py b/efl/elementary/naviframe.py new file mode 100644 index 0000000..68d5eec --- /dev/null +++ b/efl/elementary/naviframe.py @@ -0,0 +1 @@ +from . import Naviframe, NaviframeItem diff --git a/efl/elementary/naviframe.pxd b/efl/elementary/naviframe_cdef.pxi similarity index 96% rename from efl/elementary/naviframe.pxd rename to efl/elementary/naviframe_cdef.pxi index a88495b..2b4324b 100644 --- a/efl/elementary/naviframe.pxd +++ b/efl/elementary/naviframe_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Evas_Object, Eina_Bool, Eina_List -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": ctypedef Eina_Bool (*Elm_Naviframe_Item_Pop_Cb)(void *data, Elm_Object_Item *it) diff --git a/efl/elementary/need.pyx b/efl/elementary/need.pxi similarity index 95% rename from efl/elementary/need.pyx rename to efl/elementary/need.pxi index 52eeea0..aff5765 100644 --- a/efl/elementary/need.pyx +++ b/efl/elementary/need.pxi @@ -15,21 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`need` Module -################## - -Description -=========== - -This functions are used to tell elementary of optionals modules usage. - -""" - - -from efl.utils.deprecated cimport DEPRECATED - +include "need_cdef.pxi" def need_efreet(): """Request that your elementary application needs Efreet diff --git a/efl/elementary/need.py b/efl/elementary/need.py new file mode 100644 index 0000000..9ffc185 --- /dev/null +++ b/efl/elementary/need.py @@ -0,0 +1,7 @@ +from . import need_efreet +from . import need_systray +from . import need_sys_notify +from . import need_eldbus +from . import need_elocation +from . import need_ethumb +from . import need_web diff --git a/efl/elementary/need.pxd b/efl/elementary/need_cdef.pxi similarity index 91% rename from efl/elementary/need.pxd rename to efl/elementary/need_cdef.pxi index 555be87..b8aef99 100644 --- a/efl/elementary/need.pxd +++ b/efl/elementary/need_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool - cdef extern from "Elementary.h": Eina_Bool elm_need_efreet() Eina_Bool elm_need_systray() diff --git a/efl/elementary/notify.pyx b/efl/elementary/notify.pxi similarity index 83% rename from efl/elementary/notify.pyx rename to efl/elementary/notify.pxi index 07cb56b..f9659d7 100644 --- a/efl/elementary/notify.pyx +++ b/efl/elementary/notify.pxi @@ -15,66 +15,9 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`notify` Module -#################### - -.. image:: /images/notify-preview.png - - -Widget description -================== - -Display a container in a particular region of the parent. - -A timeout can be set to automatically hide the notify. This is so that, after an -:py:meth:`~efl.evas.Object.show` on a notify object, if a timeout -was set on it, it will **automatically** get hidden after that time. - - -Emitted signals -=============== - -- ``timeout`` - when timeout happens on notify and it's hidden -- ``block,clicked`` - when a click outside of the notify happens - - -Layout content parts -==================== - -- ``default`` - The main content of the notify - - -Enumerations -============ - -.. _ELM_NOTIFY_ALIGN_FILL: - -ELM_NOTIFY_ALIGN_FILL ---------------------- - -.. data:: ELM_NOTIFY_ALIGN_FILL - - Use with :py:attr:`Notify.align` - - .. versionadded:: 1.8 - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.notify - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.evas cimport Object as evasObject -from object cimport Object -from efl.utils.deprecated cimport DEPRECATED - +include "notify_cdef.pxi" +# FIXME: cdef extern this ELM_NOTIFY_ALIGN_FILL = -1.0 cdef class Notify(Object): diff --git a/efl/elementary/notify.py b/efl/elementary/notify.py new file mode 100644 index 0000000..330429b --- /dev/null +++ b/efl/elementary/notify.py @@ -0,0 +1,14 @@ +from . import Notify + +from . import ELM_NOTIFY_ALIGN_FILL + +from . import ELM_NOTIFY_ORIENT_TOP +from . import ELM_NOTIFY_ORIENT_CENTER +from . import ELM_NOTIFY_ORIENT_BOTTOM +from . import ELM_NOTIFY_ORIENT_LEFT +from . import ELM_NOTIFY_ORIENT_RIGHT +from . import ELM_NOTIFY_ORIENT_TOP_LEFT +from . import ELM_NOTIFY_ORIENT_TOP_RIGHT +from . import ELM_NOTIFY_ORIENT_BOTTOM_LEFT +from . import ELM_NOTIFY_ORIENT_BOTTOM_RIGHT +from . import ELM_NOTIFY_ORIENT_LAST diff --git a/efl/elementary/notify.pxd b/efl/elementary/notify_cdef.pxi similarity index 96% rename from efl/elementary/notify.pxd rename to efl/elementary/notify_cdef.pxi index d4e3f93..acc31ec 100644 --- a/efl/elementary/notify.pxd +++ b/efl/elementary/notify_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": cpdef enum Elm_Notify_Orient: diff --git a/efl/elementary/object.pyx b/efl/elementary/object.pxi similarity index 91% rename from efl/elementary/object.pyx rename to efl/elementary/object.pxi index aba168e..f03f775 100644 --- a/efl/elementary/object.pyx +++ b/efl/elementary/object.pxi @@ -16,284 +16,23 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`object` Module -#################### - - -Copy and Paste -============== - -Implements the following functionality - -a. select, copy/cut and paste -b. clipboard -c. drag and drop - -in order to share data across application windows. - -Contains functions to select text or a portion of data, -send it to a buffer, and paste the data into a target. - -elm_cnp provides a generic copy and paste facility based on its windowing -system. -It is not necessary to know the details of each windowing system, -but some terms and behavior are common. -Currently the X11 window system is widely used, and only X11 functionality is -implemented. - -In X11R6 window system, CopyPaste works like a peer-to-peer communication. -Copying is an operation on an object in an X server. -X11 calls those objects 'selections' which have names. -Generally, two selection types are needed for copy and paste: -The Primary selection and the Clipboard selection. -Primary selection is for selecting text (that means highlighted text). -Clipboard selection is for explicit copying behavior -(such as ctrl+c, or 'copy' in a menu). -Thus, in applications most cases only use the clipboard selection. -As stated before, taking ownership of a selection doesn't move any actual data. -Copying and Pasting is described as follows: - -1. Copy text in Program A : Program A takes ownership of the selection -2. Paste text in Program B : Program B notes that Program A owns the selection -3. Program B asks A for the text -4. Program A responds and sends the text to program B -5. Program B pastes the response - -More information is on - - http://www.jwz.org/doc/x-cut-and-paste.html - - X11R6 Inter-Client Communication Conventions Manual, section 2 - - -Enumerations -============ - -.. _Elm_Object_Focus_Direction: - -Focus direction ---------------- - -.. data:: ELM_FOCUS_PREVIOUS - - Focus previous - -.. data:: ELM_FOCUS_NEXT - - Focus next - -.. data:: ELM_FOCUS_UP - - Focus up - - .. versionadded:: 1.8.1 - -.. data:: ELM_FOCUS_DOWN - - Focus down - - .. versionadded:: 1.8.1 - -.. data:: ELM_FOCUS_RIGHT - - Focus right - - .. versionadded:: 1.8.1 - -.. data:: ELM_FOCUS_LEFT - - Focus left - - .. versionadded:: 1.8.1 - - -.. _Elm_Focus_Move_Policy: - -Focus move policy ------------------ - -.. data:: ELM_FOCUS_MOVE_POLICY_CLICK - - Give focus to object when they are clicked - - .. versionadded:: 1.10 - -.. data:: ELM_FOCUS_MOVE_POLICY_IN - - Give focus to object on mouse-in - - .. versionadded:: 1.10 - - -.. _Elm_Focus_Autoscroll_Mode: - -Focus autoscroll mode ---------------------- - -.. data:: ELM_FOCUS_AUTOSCROLL_MODE_SHOW - - Directly show the focused region or item automatically. - - .. versionadded:: 1.10 - -.. data:: ELM_FOCUS_AUTOSCROLL_MODE_NONE - - Do not show the focused region or item automatically. - - .. versionadded:: 1.10 - -.. data:: ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN - - Bring_in the focused region or item automatically which might - invole the scrolling - - .. versionadded:: 1.10 - - -.. _Elm_Input_Event_Type: - -Input event types ------------------ - -.. data:: EVAS_CALLBACK_KEY_DOWN -.. data:: EVAS_CALLBACK_KEY_UP -.. data:: EVAS_CALLBACK_MOUSE_WHEEL - - -.. _Elm_Object_Sel_Type: - -Selection type --------------- - -Defines the types of selection property names. - -:see: http://www.x.org/docs/X11/xlib.pdf for more details. - -.. data:: ELM_SEL_TYPE_PRIMARY - - Primary text selection (highlighted or selected text) - -.. data:: ELM_SEL_TYPE_SECONDARY - - Used when primary selection is in use - -.. data:: ELM_SEL_TYPE_XDND - - Drag 'n' Drop - -.. data:: ELM_SEL_TYPE_CLIPBOARD - - Clipboard selection (ctrl+C) - - -.. _Elm_Object_Sel_Format: - -Selection format ----------------- - -Defines the types of content. - -.. data:: ELM_SEL_FORMAT_TARGETS - - For matching every possible atom - -.. data:: ELM_SEL_FORMAT_NONE - - Content is from outside of Elementary - -.. data:: ELM_SEL_FORMAT_TEXT - - Plain unformatted text: Used for things that don't want rich markup - -.. data:: ELM_SEL_FORMAT_MARKUP - - Edje textblock markup, including inline images - -.. data:: ELM_SEL_FORMAT_IMAGE - - Images - -.. data:: ELM_SEL_FORMAT_VCARD - - Vcards - -.. data:: ELM_SEL_FORMAT_HTML - - Raw HTML-like data (eg. webkit) - - -.. _Elm_Object_Xdnd_Action: - -XDND action ------------ - -Defines the kind of action associated with the drop data if for XDND - -.. versionadded:: 1.8 - -.. data:: ELM_XDND_ACTION_UNKNOWN - - Action type is unknown - -.. data:: ELM_XDND_ACTION_COPY - - Copy the data - -.. data:: ELM_XDND_ACTION_MOVE - - Move the data - -.. data:: ELM_XDND_ACTION_PRIVATE - - Private action type - -.. data:: ELM_XDND_ACTION_ASK - - Ask the user what to do - -.. data:: ELM_XDND_ACTION_LIST - - List the data - -.. data:: ELM_XDND_ACTION_LINK - - Link the data - -.. data:: ELM_XDND_ACTION_DESCRIPTION - - Describe the data - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.object - :parts: 2 - -""" - -from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyObject_GetAttr, \ - PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyObject_CheckBuffer, \ - PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni, eina_list_objects_to_python_list -from efl.utils.deprecated cimport DEPRECATED -from efl.evas cimport Object as evasObject, SmartObject, \ - EventKeyDown, EventKeyUp, EventMouseWheel, \ - evas_object_smart_callback_add, evas_object_smart_callback_del, \ - Evas_Callback_Type, EVAS_CALLBACK_KEY_DOWN, EVAS_CALLBACK_KEY_UP, \ - EVAS_CALLBACK_MOUSE_WHEEL +include "object_cdef.pxi" include "cnp_callbacks.pxi" -include "tooltips.pxi" -from theme cimport Theme +cdef Evas_Object *_tooltip_content_create(void *data, Evas_Object *o, Evas_Object *t) with gil: + cdef Object ret, obj, tooltip -import logging -log = logging.getLogger("elementary") -import traceback + obj = object_from_instance(o) + tooltip = object_from_instance(t) + (func, args, kargs) = 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(data) cdef bint _event_dispatcher(Object obj, Object src, Evas_Callback_Type t, @@ -335,7 +74,8 @@ cdef Eina_Bool _event_callback(void *data, Evas_Object *o, \ ret = _event_dispatcher(obj, src_obj, t, wheel_event) wheel_event._unset_obj() else: - log.debug("Unhandled elm input event of type %i" % (t)) + EINA_LOG_DOM_DBG( + PY_EFL_ELM_LOG_DOMAIN, "Unhandled elm input event of type %i", t) return ret @@ -359,6 +99,11 @@ cdef class Object(SmartObject): """ + cdef: + list _elm_event_cbs, _elm_signal_cbs + object cnp_drop_cb, cnp_drop_data + object cnp_selection_loss_cb, cnp_selection_loss_data + def __init__(self, *args, **kwargs): if type(self) is Object: raise TypeError("Must not instantiate Object, but subclasses") diff --git a/efl/elementary/object.py b/efl/elementary/object.py new file mode 100644 index 0000000..d0fc55d --- /dev/null +++ b/efl/elementary/object.py @@ -0,0 +1,35 @@ +from . import ELM_FOCUS_PREVIOUS +from . import ELM_FOCUS_NEXT +from . import ELM_FOCUS_UP +from . import ELM_FOCUS_DOWN +from . import ELM_FOCUS_RIGHT +from . import ELM_FOCUS_LEFT + +from . import ELM_FOCUS_MOVE_POLICY_CLICK +from . import ELM_FOCUS_MOVE_POLICY_IN + +from . import ELM_FOCUS_AUTOSCROLL_MODE_SHOW +from . import ELM_FOCUS_AUTOSCROLL_MODE_NONE +from . import ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN + +from . import ELM_SEL_TYPE_PRIMARY +from . import ELM_SEL_TYPE_SECONDARY +from . import ELM_SEL_TYPE_XDND +from . import ELM_SEL_TYPE_CLIPBOARD + +from . import ELM_SEL_FORMAT_TARGETS +from . import ELM_SEL_FORMAT_NONE +from . import ELM_SEL_FORMAT_TEXT +from . import ELM_SEL_FORMAT_MARKUP +from . import ELM_SEL_FORMAT_IMAGE +from . import ELM_SEL_FORMAT_VCARD +from . import ELM_SEL_FORMAT_HTML + +from . import ELM_XDND_ACTION_UNKNOWN +from . import ELM_XDND_ACTION_COPY +from . import ELM_XDND_ACTION_MOVE +from . import ELM_XDND_ACTION_PRIVATE +from . import ELM_XDND_ACTION_ASK +from . import ELM_XDND_ACTION_LIST +from . import ELM_XDND_ACTION_LINK +from . import ELM_XDND_ACTION_DESCRIPTION diff --git a/efl/elementary/object.pxd b/efl/elementary/object_cdef.pxi similarity index 97% rename from efl/elementary/object.pxd rename to efl/elementary/object_cdef.pxi index 3804eb9..8558f45 100644 --- a/efl/elementary/object.pxd +++ b/efl/elementary/object_cdef.pxi @@ -15,10 +15,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb, \ - Evas_Coord, Evas_Callback_Type, Object as evasObject, SmartObject, \ - Canvas as evasCanvas - cdef extern from "Edje.h": ctypedef void (*Edje_Signal_Cb)(void *data, Evas_Object *obj, const char *emission, const char *source) @@ -220,10 +216,3 @@ cdef extern from "Elementary.h": #TODO: Evas_Object * elm_access_object_get(const Evas_Object *obj) #TODO: void elm_access_highlight_set(Evas_Object* obj) #TODO: void elm_access_object_unregister(Evas_Object *obj) - - -cdef class Object(SmartObject): - cdef: - list _elm_event_cbs, _elm_signal_cbs - object cnp_drop_cb, cnp_drop_data - object cnp_selection_loss_cb, cnp_selection_loss_data diff --git a/efl/elementary/object_item.pyx b/efl/elementary/object_item.pxi similarity index 97% rename from efl/elementary/object_item.pyx rename to efl/elementary/object_item.pxi index 99bb770..a0bd9ed 100644 --- a/efl/elementary/object_item.pyx +++ b/efl/elementary/object_item.pxi @@ -15,39 +15,25 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" +include "object_item_cdef.pxi" -:mod:`object_item` Module -######################### +cdef Evas_Object *_tooltip_item_content_create(void *data, Evas_Object *o, Evas_Object *t, void *it) with gil: + cdef: + Object ret, obj, tooltip + ObjectItem item -Inheritance diagram -=================== + obj = object_from_instance(o) + tooltip = object_from_instance(t) + item = _object_item_to_python(it) + (func, args, kargs) = data + ret = func(obj, item, tooltip, *args, **kargs) + if not ret: + return NULL + return ret.obj -.. inheritance-diagram:: efl.elementary.object_item - :parts: 2 +cdef void _tooltip_item_data_del_cb(void *data, Evas_Object *o, void *event_info) with gil: + Py_DECREF(data) -""" - - -from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF -from libc.stdint cimport uintptr_t - -from efl.eo cimport PY_REFCOUNT -from efl.utils.conversions cimport _ctouni -from efl.utils.deprecated cimport DEPRECATED -from efl.evas cimport Object as evasObject - -from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN, \ - EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT -from efl.elementary.general cimport PY_EFL_ELM_LOG_DOMAIN - -include "tooltips.pxi" - -# cdef void _tooltip_item_data_del_cb(void *data, Evas_Object *o, void *event_info) with gil: -# Py_DECREF(data) - -from object cimport Object -import traceback cdef Elm_Object_Item * _object_item_from_python(ObjectItem item) except NULL: if item is None or item.item is NULL: @@ -125,6 +111,15 @@ cdef class ObjectItem(object): """ + cdef: + Elm_Object_Item *item + object cb_func + object cb_data + tuple args + dict kwargs + readonly dict data + int _set_obj(self, Elm_Object_Item *item) except 0 + # Notes to bindings' developers: # ============================== # diff --git a/efl/elementary/object_item.pxd b/efl/elementary/object_item_cdef.pxi similarity index 84% rename from efl/elementary/object_item.pxd rename to efl/elementary/object_item_cdef.pxi index 539bb58..70dce68 100644 --- a/efl/elementary/object_item.pxd +++ b/efl/elementary/object_item_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Smart_Cb, Eina_List - cdef extern from "Elementary.h": ctypedef struct Elm_Object_Item @@ -61,23 +59,3 @@ cdef extern from "Elementary.h": void elm_object_item_style_set(Elm_Object_Item *it, const char *part) const char * elm_object_item_style_get(Elm_Object_Item *it) - - -cdef _object_item_to_python(Elm_Object_Item *it) -cdef Elm_Object_Item * _object_item_from_python(ObjectItem item) except NULL -cdef _object_item_list_to_python(const Eina_List *lst) -cdef void _object_item_del_cb(void *data, Evas_Object *o, void *event_info) with gil -cdef void _object_item_callback(void *data, Evas_Object *obj, void *event_info) with gil -cdef void _object_item_callback2(void *data, Evas_Object *obj, void *event_info) with gil - -cdef class ObjectItem(object): - cdef: - Elm_Object_Item *item - object cb_func - object cb_data - tuple args - dict kwargs - readonly dict data - int _set_obj(self, Elm_Object_Item *item) except 0 - - cdef int _set_properties_from_keyword_args(self, dict kwargs) except 0 diff --git a/efl/elementary/panel.pyx b/efl/elementary/panel.pxi similarity index 77% rename from efl/elementary/panel.pyx rename to efl/elementary/panel.pxi index 668fb96..c3351ef 100644 --- a/efl/elementary/panel.pyx +++ b/efl/elementary/panel.pxi @@ -16,72 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`panel` Module -################### - -.. image:: /images/panel-preview.png - - -Widget description -================== - -A panel is a type of animated container that contains subobjects. - -It can be expanded or contracted by clicking the button on it's edge. - - -Emitted signals -=============== - -- ``focused`` - When the panel has received focus. (since 1.8) -- ``unfocused`` - When the panel has lost focus. (since 1.8) - - -Layout content parts -==================== - -- ``default`` - A content of the panel - - -Enumerations -============ - -.. _Elm_Panel_Orient: - -Panel orientation types ------------------------ - -.. data:: ELM_PANEL_ORIENT_TOP - - Panel (dis)appears from the top - -.. data:: ELM_PANEL_ORIENT_BOTTOM - - Panel (dis)appears from the bottom - -.. data:: ELM_PANEL_ORIENT_LEFT - - Panel (dis)appears from the left - -.. data:: ELM_PANEL_ORIENT_RIGHT - - Panel (dis)appears from the right - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.panel - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - +include "panel_cdef.pxi" cdef class Panel(LayoutClass): """ diff --git a/efl/elementary/panel.py b/efl/elementary/panel.py new file mode 100644 index 0000000..f917509 --- /dev/null +++ b/efl/elementary/panel.py @@ -0,0 +1,6 @@ +from . import Panel + +from . import ELM_PANEL_ORIENT_TOP +from . import ELM_PANEL_ORIENT_BOTTOM +from . import ELM_PANEL_ORIENT_LEFT +from . import ELM_PANEL_ORIENT_RIGHT diff --git a/efl/elementary/panel.pxd b/efl/elementary/panel_cdef.pxi similarity index 95% rename from efl/elementary/panel.pxd rename to efl/elementary/panel_cdef.pxi index 0b1ac43..b8fbcb2 100644 --- a/efl/elementary/panel.pxd +++ b/efl/elementary/panel_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - - cdef extern from "Elementary.h": cpdef enum Elm_Panel_Orient: diff --git a/efl/elementary/panes.pyx b/efl/elementary/panes.pxi similarity index 85% rename from efl/elementary/panes.pyx rename to efl/elementary/panes.pxi index e6cc541..a0717fb 100644 --- a/efl/elementary/panes.pyx +++ b/efl/elementary/panes.pxi @@ -15,55 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`panes` Module -################### - -.. image:: /images/panes-preview.png - - -Widget description -================== - -The panes widget adds a draggable bar between two contents. When -dragged this bar will resize contents' size. - -Panes can be displayed vertically or horizontally, and contents size -proportion can be customized (homogeneous by default). - - -Emitted signals -=============== - -- ``press`` - The panes has been pressed (button wasn't released yet). -- ``unpressed`` - The panes was released after being pressed. -- ``clicked`` - The panes has been clicked. -- ``clicked,double`` - The panes has been double clicked. - - -Layout content parts -==================== - -- ``left`` - A leftside content of the panes -- ``right`` - A rightside content of the panes -- ``top`` - A top content of the vertical panes -- ``bottom`` - A bottom content of the vertical panes - -If panes are displayed vertically, left content will be displayed on top. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.panes - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "panes_cdef.pxi" cdef class Panes(LayoutClass): """ diff --git a/efl/elementary/panes.py b/efl/elementary/panes.py new file mode 100644 index 0000000..3f55875 --- /dev/null +++ b/efl/elementary/panes.py @@ -0,0 +1 @@ +from . import Panes diff --git a/efl/elementary/panes.pxd b/efl/elementary/panes_cdef.pxi similarity index 96% rename from efl/elementary/panes.pxd rename to efl/elementary/panes_cdef.pxi index 71a89e1..e43e6ab 100644 --- a/efl/elementary/panes.pxd +++ b/efl/elementary/panes_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - cdef extern from "Elementary.h": Evas_Object *elm_panes_add(Evas_Object *parent) void elm_panes_fixed_set(Evas_Object *obj, Eina_Bool fixed) diff --git a/efl/elementary/photo.pyx b/efl/elementary/photo.pxi similarity index 85% rename from efl/elementary/photo.pyx rename to efl/elementary/photo.pxi index ab2f918..9b80d05 100644 --- a/efl/elementary/photo.pyx +++ b/efl/elementary/photo.pxi @@ -15,50 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`photo` Module -################### - -.. image:: /images/photo-preview.png - - -Widget description -================== - -An Elementary photo widget is intended for displaying a photo, for -ex., a person's image (contact). - -Simple, yet with a very specific purpose. It has a decorative frame -around the inner image itself, on the default theme. - -This widget relies on an internal :py:class:`~efl.elementary.icon.Icon`, so -that the APIs of these two widgets are similar (drag and drop is also possible -here, for example). - - -Emitted signals -=============== - -- ``clicked`` - This is called when a user has clicked the photo -- ``drag,start`` - One has started dragging the inner image out of the photo's - frame -- ``drag,end`` - One has dropped the dragged image somewhere - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.photo - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from object cimport Object +include "photo_cdef.pxi" cdef class Photo(Object): """ diff --git a/efl/elementary/photo.py b/efl/elementary/photo.py new file mode 100644 index 0000000..8166f6d --- /dev/null +++ b/efl/elementary/photo.py @@ -0,0 +1 @@ +from . import Photo diff --git a/efl/elementary/photo.pxd b/efl/elementary/photo_cdef.pxi similarity index 93% rename from efl/elementary/photo.pxd rename to efl/elementary/photo_cdef.pxi index e154b03..86c07ec 100644 --- a/efl/elementary/photo.pxd +++ b/efl/elementary/photo_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_photo_add(Evas_Object *parent) Eina_Bool elm_photo_file_set(Evas_Object *obj, const char *file) diff --git a/efl/elementary/photocam.pyx b/efl/elementary/photocam.pxi similarity index 84% rename from efl/elementary/photocam.pyx rename to efl/elementary/photocam.pxi index a71e393..c6dd88b 100644 --- a/efl/elementary/photocam.pyx +++ b/efl/elementary/photocam.pxi @@ -16,114 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`photocam` Module -###################### - - -Widget description -================== - -This is a widget specifically for displaying high-resolution digital -camera photos giving speedy feedback (fast load), low memory footprint -and zooming and panning as well as fitting logic. It is entirely focused -on jpeg images, and takes advantage of properties of the jpeg format (via -evas loader features in the jpeg loader). - - -Emitted signals -=============== - -- ``clicked`` - This is called when a user has clicked the photo without - dragging around. -- ``press`` - This is called when a user has pressed down on the photo. -- ``longpressed`` - This is called when a user has pressed down on the - photo for a long time without dragging around. -- ``clicked,double`` - This is called when a user has double-clicked the - photo. -- ``load`` - Photo load begins. -- ``loaded`` - This is called when the image file load is complete for - the first view (low resolution blurry version). -- ``load,detail`` - Photo detailed data load begins. -- ``loaded,detail`` - This is called when the image file load is - complete for the detailed image data (full resolution needed). -- ``zoom,start`` - Zoom animation started. -- ``zoom,stop`` - Zoom animation stopped. -- ``zoom,change`` - Zoom changed when using an auto zoom mode. -- ``scroll`` - the content has been scrolled (moved) -- ``scroll,anim,start`` - scrolling animation has started -- ``scroll,anim,stop`` - scrolling animation has stopped -- ``scroll,drag,start`` - dragging the contents around has started -- ``scroll,drag,stop`` - dragging the contents around has stopped -- ``download,start`` - remote url download has started -- ``download,progress`` - url download in progress -- ``download,end`` - remote url download has finished -- ``download,error`` - remote url download has finished with errors -- ``focused`` - When the photocam has received focus. (since 1.8) -- ``unfocused`` - When the photocam has lost focus. (since 1.8) - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scrolling behaviour using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.scroller.Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Enumerations -============ - -.. _Elm_Photocam_Zoom_Mode: - -Photocam zoom modes -------------------- - -.. data:: ELM_PHOTOCAM_ZOOM_MODE_MANUAL - - Zoom controlled normally by :py:attr:`~Photocam.zoom` - -.. data:: ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT - - Zoom until photo fits in photocam - -.. data:: ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL - - Zoom until photo fills photocam - -.. data:: ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN - - Zoom in until photo fits in photocam - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.photocam - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from object cimport Object - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - +include "photocam_cdef.pxi" cdef class PhotocamProgressInfo(object): """PhotocamProgressInfo(...) diff --git a/efl/elementary/photocam.py b/efl/elementary/photocam.py new file mode 100644 index 0000000..624d202 --- /dev/null +++ b/efl/elementary/photocam.py @@ -0,0 +1,7 @@ +from . import Photocam + +from . import ELM_PHOTOCAM_ZOOM_MODE_MANUAL +from . import ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT +from . import ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL +from . import ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN +from . import ELM_PHOTOCAM_ZOOM_MODE_LAST diff --git a/efl/elementary/photocam.pxd b/efl/elementary/photocam_cdef.pxi similarity index 96% rename from efl/elementary/photocam.pxd rename to efl/elementary/photocam_cdef.pxi index 5cd2121..ff17a47 100644 --- a/efl/elementary/photocam.pxd +++ b/efl/elementary/photocam_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Load_Error, Evas_Image_Orient - - cdef extern from "Elementary.h": cpdef enum Elm_Photocam_Zoom_Mode: diff --git a/efl/elementary/plug.pyx b/efl/elementary/plug.pxi similarity index 77% rename from efl/elementary/plug.pyx rename to efl/elementary/plug.pxi index f806cec..51dbe0a 100644 --- a/efl/elementary/plug.pyx +++ b/efl/elementary/plug.pxi @@ -16,49 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`plug` Module -################## - - -Widget Description -================== - -An object that allows one to show an image which other process created. -It can be used anywhere like any other elementary widget. - - -Emitted signals -=============== - -- ``clicked`` - the user clicked the image (press/release). -- ``image,deleted`` - the server side was deleted. -- ``image,resized`` - the server side was resized. The ``event_info`` parameter - of the callback will be ``Evas_Coord_Size`` (two integers). - -.. note:: - the event "image,resized" will be sent whenever the server - resized its image and this **always** happen on the first - time. Then it can be used to track when the server-side image - is fully known (client connected to server, retrieved its - image buffer through shared memory and resized the evas - object). - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.plug - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.evas cimport Object as evasObject -from object cimport Object +include "plug_cdef.pxi" cdef class Plug(Object): """ diff --git a/efl/elementary/plug.py b/efl/elementary/plug.py new file mode 100644 index 0000000..96b4bca --- /dev/null +++ b/efl/elementary/plug.py @@ -0,0 +1 @@ +from . import Plug diff --git a/efl/elementary/plug.pxd b/efl/elementary/plug_cdef.pxi similarity index 86% rename from efl/elementary/plug.pxd rename to efl/elementary/plug_cdef.pxi index a420e40..d66dff6 100644 --- a/efl/elementary/plug.pxd +++ b/efl/elementary/plug_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_plug_add(Evas_Object *parent) Eina_Bool elm_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys) diff --git a/efl/elementary/popup.pyx b/efl/elementary/popup.pxi similarity index 60% rename from efl/elementary/popup.pyx rename to efl/elementary/popup.pxi index 887ede2..3757965 100644 --- a/efl/elementary/popup.pyx +++ b/efl/elementary/popup.pxi @@ -16,191 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`popup` Module -################### - -.. image:: /images/popup-preview.png - - -Widget description -================== - -This widget is an enhancement of :py:class:`~efl.elementary.notify.Notify`. -In addition to Content area, there are two optional sections namely Title -area and Action area. - -Popup Widget displays its content with a particular orientation in the -parent area. This orientation can be one among top, center, bottom, -left, top-left, top-right, bottom-left and bottom-right. Content part of -Popup can be an Evas Object set by application or it can be Text set by -application or set of items containing an icon and/or text. The -content/item-list can be removed using elm_object_content_set with second -parameter passed as None. - -Following figures shows the textual layouts of popup in which Title Area -and Action area area are optional ones. Action area can have up to 3 -buttons handled using elm_object common APIs mentioned below. If user -wants to have more than 3 buttons then these buttons can be put inside -the items of a list as content. User needs to handle the clicked signal -of these action buttons if required. No event is processed by the widget -automatically when clicked on these action buttons. - -Figure:: - - |---------------------| |---------------------| |---------------------| - | Title Area | | Title Area | | Title Area | - |Icon| Text | |Icon| Text | |Icon| Text | - |---------------------| |---------------------| |---------------------| - | Item 1 | | | | | - |---------------------| | | | | - | Item 2 | | | | Description | - |---------------------| | Content | | | - | Item 3 | | | | | - |---------------------| | | | | - | . | |---------------------| |---------------------| - | . | | Action Area | | Action Area | - | . | | Btn1 |Btn2|. |Btn3 | | Btn1 |Btn2| |Btn3 | - |---------------------| |---------------------| |---------------------| - | Item N | Content Based Layout Description based Layout - |---------------------| - | Action Area | - | Btn1 |Btn2|. |Btn3 | - |---------------------| - Item Based Layout - -Timeout can be set on expiry of which popup instance hides and sends a -smart signal "timeout" to the user. The visible region of popup is -surrounded by a translucent region called Blocked Event area. By -clicking on Blocked Event area, the signal "block,clicked" is sent to -the application. This block event area can be avoided by using API -elm_popup_allow_events_set. When gets hidden, popup does not get -destroyed automatically, application should destroy the popup instance -after use. To control the maximum height of the internal scroller for -item, we use the height of the action area which is passed by theme -based on the number of buttons currently set to popup. - - -Emitted signals -=============== - -- ``timeout`` - when ever popup is closed as a result of timeout. -- ``block,clicked`` - when ever user taps on Blocked Event area. -- ``focused`` - When the popup has received focus. (since 1.8) -- ``unfocused`` - When the popup has lost focus. (since 1.8) -- ``language,changed`` - the program's language changed (since 1.8) -- ``item,focused`` - the popup item has received focus. (since 1.10) -- ``item,unfocused`` - the popup item has lost focus. (since 1.10) - - -Layout content parts -==================== - -- ``default`` - The content of the popup -- ``title,icon`` - Title area's icon -- ``button1`` - 1st button of the action area -- ``button2`` - 2nd button of the action area -- ``button3`` - 3rd button of the action area -- ``default`` - Item's icon - - -Layout text parts -================= - -- ``title,text`` - This operates on Title area's label -- ``default`` - content-text set in the content area of the widget -- ``default`` - Item's label - - -Enumerations -============ - -.. _Elm_Popup_Orient: - -Popup orientation types ------------------------ - -.. data:: ELM_POPUP_ORIENT_TOP - - Popup should appear in the top of parent, default - -.. data:: ELM_POPUP_ORIENT_CENTER - - Popup should appear in the center of parent - -.. data:: ELM_POPUP_ORIENT_BOTTOM - - Popup should appear in the bottom of parent - -.. data:: ELM_POPUP_ORIENT_LEFT - - Popup should appear in the left of parent - -.. data:: ELM_POPUP_ORIENT_RIGHT - - Popup should appear in the right of parent - -.. data:: ELM_POPUP_ORIENT_TOP_LEFT - - Popup should appear in the top left of parent - -.. data:: ELM_POPUP_ORIENT_TOP_RIGHT - - Popup should appear in the top right of parent - -.. data:: ELM_POPUP_ORIENT_BOTTOM_LEFT - - Popup should appear in the bottom left of parent - -.. data:: ELM_POPUP_ORIENT_BOTTOM_RIGHT - - Popup should appear in the bottom right of parent - - -.. Elm_Wrap_Type: - -Wrap modes ----------- - -.. data:: ELM_WRAP_NONE - - No wrap - -.. data:: ELM_WRAP_CHAR - - Wrap between characters - -.. data:: ELM_WRAP_WORD - - Wrap in allowed wrapping points (as defined in the unicode standard) - -.. data:: ELM_WRAP_MIXED - - Word wrap, and if that fails, char wrap. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.popup - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, PY_REFCOUNT -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass -from object_item cimport _object_item_callback, _object_item_callback2, \ - ObjectItem, _object_item_to_python - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "popup_cdef.pxi" cdef class PopupItem(ObjectItem): """ diff --git a/efl/elementary/popup.py b/efl/elementary/popup.py new file mode 100644 index 0000000..bd2e786 --- /dev/null +++ b/efl/elementary/popup.py @@ -0,0 +1,17 @@ +from . import Popup, PopupItem + +from . import ELM_POPUP_ORIENT_TOP +from . import ELM_POPUP_ORIENT_CENTER +from . import ELM_POPUP_ORIENT_BOTTOM +from . import ELM_POPUP_ORIENT_LEFT +from . import ELM_POPUP_ORIENT_RIGHT +from . import ELM_POPUP_ORIENT_TOP_LEFT +from . import ELM_POPUP_ORIENT_TOP_RIGHT +from . import ELM_POPUP_ORIENT_BOTTOM_LEFT +from . import ELM_POPUP_ORIENT_BOTTOM_RIGHT +from . import ELM_POPUP_ORIENT_LAST + +from . import ELM_WRAP_NONE +from . import ELM_WRAP_CHAR +from . import ELM_WRAP_WORD +from . import ELM_WRAP_MIXED diff --git a/efl/elementary/popup.pxd b/efl/elementary/popup_cdef.pxi similarity index 93% rename from efl/elementary/popup.pxd rename to efl/elementary/popup_cdef.pxi index bc9c215..2216f5c 100644 --- a/efl/elementary/popup.pxd +++ b/efl/elementary/popup_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Smart_Cb -from object_item cimport Elm_Object_Item - - cdef extern from "Elementary.h": cpdef enum Elm_Popup_Orient: diff --git a/efl/elementary/progressbar.pyx b/efl/elementary/progressbar.pxi similarity index 79% rename from efl/elementary/progressbar.pyx rename to efl/elementary/progressbar.pxi index 528468f..11519bb 100644 --- a/efl/elementary/progressbar.pyx +++ b/efl/elementary/progressbar.pxi @@ -16,80 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`progressbar` Module -######################### - -.. image:: /images/progressbar-preview.png - - -Widget description -================== - -The progress bar is a widget for visually representing the progress -status of a given job/task. - -A progress bar may be horizontal or vertical. It may display an icon -besides it, as well as primary and **units** labels. The former is meant -to label the widget as a whole, while the latter, which is formatted -with floating point values (and thus accepts a ``printf``-style format -string, like ``"%1.2f units"``), is meant to label the widget's **progress -value**. Label, icon and unit strings/objects are **optional** for -progress bars. - -A progress bar may be **inverted**, in which case it gets its values -inverted, i.e., high values being on the left or top and low values on -the right or bottom, for horizontal and vertical modes respectively. - -The **span** of the progress, as set by :py:attr:`~Progressbar.span_size`, is -its length (horizontally or vertically), unless one puts size hints on the -widget to expand on desired directions, by any container. That length will be -scaled by the object or applications scaling factor. Applications can query the -progress bar for its value with :py:attr:`~Progressbar.value`. - -This widget emits the following signals, besides the ones sent from -:py:class:`~efl.elementary.layout_class.LayoutClass`: - -- ``changed`` - when the value is changed -- ``focused`` - When the progressbar has received focus. (since 1.8) -- ``unfocused`` - When the progressbar has lost focus. (since 1.8) - -This widget has the following styles: - -- ``default`` -- ``wheel`` (simple style, no text, no progression, only "pulse" - effect is available) -- ``double`` (style with two independent progress indicators) - -Default text parts of the progressbar widget that you can use for are: - -- ``default`` - Label of the progressbar - -Default content parts of the progressbar widget that you can use for are: - -- ``icon`` - An icon of the progressbar - -Default part names for the "recording" style: - -- ``elm.cur.progressbar`` - The "main" indicator bar -- ``elm.cur.progressbar1`` - The "secondary" indicator bar - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.progressbar - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "progressbar_cdef.pxi" cdef class Progressbar(LayoutClass): """ diff --git a/efl/elementary/progressbar.py b/efl/elementary/progressbar.py new file mode 100644 index 0000000..959dc55 --- /dev/null +++ b/efl/elementary/progressbar.py @@ -0,0 +1 @@ +from . import Progressbar diff --git a/efl/elementary/progressbar.pxd b/efl/elementary/progressbar_cdef.pxi similarity index 96% rename from efl/elementary/progressbar.pxd rename to efl/elementary/progressbar_cdef.pxi index 1284aa8..5a2f1f5 100644 --- a/efl/elementary/progressbar.pxd +++ b/efl/elementary/progressbar_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - cdef extern from "Elementary.h": Evas_Object *elm_progressbar_add(Evas_Object *parent) void elm_progressbar_pulse_set(Evas_Object *obj, Eina_Bool pulse) diff --git a/efl/elementary/radio.pyx b/efl/elementary/radio.pxi similarity index 71% rename from efl/elementary/radio.pyx rename to efl/elementary/radio.pxi index 589dd49..70f82bb 100644 --- a/efl/elementary/radio.pyx +++ b/efl/elementary/radio.pxi @@ -15,73 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`radio` Module -################### - -.. image:: /images/radio-preview.png - - -Widget description -================== - -Radio is a widget that allows for one or more options to be displayed -and have the user choose only one of them. - -A radio object contains an indicator, an optional Label and an optional -icon object. While it's possible to have a group of only one radio they, -are normally used in groups of two or more. - -Radio objects are grouped in a slightly different, compared to other UI -toolkits. There is no separate group name/id to remember or manage. The -members represent the group, there are the group. To make a group, use -:py:meth:`Radio.group_add` and pass existing radio object and the new radio -object. - -The radio object(s) will select from one of a set of integer values, so -any value they are configuring needs to be mapped to a set of integers. -To configure what value that radio object represents, use -:py:attr:`~Radio.state_value` to set the integer it represents. The -value of the whole group (which one is currently selected) is -represented by the property :py:attr:`~Radio.value` on any group member. For -convenience the radio objects are also able to directly set an -integer(int) to the value that is selected. - - -Emitted signals -=============== - -- ``changed`` - This is called whenever the user changes the state of one of - the radio objects within the group of radio objects that work together. -- ``focused`` - When the radio has received focus. (since 1.8) -- ``unfocused`` - When the radio has lost focus. (since 1.8) - - -Layout text parts -================= - -- ``default`` - Label of the radio - - -Layout content parts -==================== - -- ``icon`` - An icon of the radio - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.radio - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.deprecated cimport DEPRECATED -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "radio_cdef.pxi" cdef class Radio(LayoutClass): """ diff --git a/efl/elementary/radio.py b/efl/elementary/radio.py new file mode 100644 index 0000000..bc1e714 --- /dev/null +++ b/efl/elementary/radio.py @@ -0,0 +1 @@ +from . import Radio diff --git a/efl/elementary/radio.pxd b/efl/elementary/radio_cdef.pxi similarity index 94% rename from efl/elementary/radio.pxd rename to efl/elementary/radio_cdef.pxi index 608fd8e..14707a8 100644 --- a/efl/elementary/radio.pxd +++ b/efl/elementary/radio_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_radio_add(Evas_Object *parent) void elm_radio_group_add(Evas_Object *obj, Evas_Object *group) @@ -9,4 +7,3 @@ cdef extern from "Elementary.h": int elm_radio_value_get(const Evas_Object *obj) void elm_radio_value_pointer_set(Evas_Object *obj, int *valuep) Evas_Object *elm_radio_selected_object_get(const Evas_Object *obj) - diff --git a/efl/elementary/scroller.pyx b/efl/elementary/scroller.pxi similarity index 87% rename from efl/elementary/scroller.pyx rename to efl/elementary/scroller.pxi index 8efff31..887a722 100644 --- a/efl/elementary/scroller.pyx +++ b/efl/elementary/scroller.pxi @@ -16,151 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`scroller` Module -###################### - -.. image:: /images/scroller-preview.png - - -Widget description -================== - -A scroller holds a single object and "scrolls it around". - -This means that it allows the user to use a scrollbar (or a finger) to -drag the viewable region around, allowing to move through a much larger -object that is contained in the scroller. The scroller will always have -a small minimum size by default as it won't be limited by the contents -of the scroller. - -This widget inherits from :py:class:`~efl.elementary.layout_class.LayoutClass`, -so that all the functions acting on it also work for scroller objects. - -.. note:: When Elementary is in embedded mode the scrollbars will not be - draggable, they appear merely as indicators of how much has been - scrolled. - -.. note:: When Elementary is in desktop mode the thumbscroll(a.k.a. - fingerscroll) won't work. - -Emitted signals -=============== - -- ``edge,left`` - the left edge of the content has been reached -- ``edge,right`` - the right edge of the content has been reached -- ``edge,top`` - the top edge of the content has been reached -- ``edge,bottom`` - the bottom edge of the content has been reached -- ``scroll`` - the content has been scrolled (moved) -- ``scroll,left`` - the content has been scrolled (moved) leftwards -- ``scroll,right`` - the content has been scrolled (moved) rightwards -- ``scroll,up`` - the content has been scrolled (moved) upwards -- ``scroll,down`` - the content has been scrolled (moved) downwards -- ``scroll,anim,start`` - scrolling animation has started -- ``scroll,anim,stop`` - scrolling animation has stopped -- ``scroll,drag,start`` - dragging the contents around has started -- ``scroll,drag,stop`` - dragging the contents around has stopped -- ``vbar,drag`` - the vertical scroll bar has been dragged -- ``vbar,press`` - the vertical scroll bar has been pressed -- ``vbar,unpress`` - the vertical scroll bar has been unpressed -- ``hbar,drag`` - the horizontal scroll bar has been dragged -- ``hbar,press`` - the horizontal scroll bar has been pressed -- ``hbar,unpress`` - the horizontal scroll bar has been unpressed -- ``scroll,page,changed`` - the visible page has changed -- ``focused`` - When the scroller has received focus. (since 1.8) -- ``unfocused`` - When the scroller has lost focus. (since 1.8) - -.. note:: The "scroll,anim,*" and "scroll,drag,*" signals are only emitted by - user intervention. - - -Layout content parts -==================== - -- ``default`` - A content of the scroller - - -Enumerations -============ - -.. _Elm_Scroller_Policy: - -Scrollbar visibility --------------------- - -.. data:: ELM_SCROLLER_POLICY_AUTO - - Show scrollbars as needed - -.. data:: ELM_SCROLLER_POLICY_ON - - Always show scrollbars - -.. data:: ELM_SCROLLER_POLICY_OFF - - Never show scrollbars - - -.. _Elm_Scroller_Single_Direction: - -Single direction ----------------- - -Type that controls how the content is scrolled. - -.. data:: ELM_SCROLLER_SINGLE_DIRECTION_NONE - - Scroll every direction - -.. data:: ELM_SCROLLER_SINGLE_DIRECTION_SOFT - - Scroll single direction if the direction is certain - -.. data:: ELM_SCROLLER_SINGLE_DIRECTION_HARD - - Scroll only single direction - - -.. _Elm_Scroller_Movement_Block: - -Movement block --------------- - -Type that blocks the scroll movement in one or more direction. - -:since: 1.8 - -.. data:: ELM_SCROLLER_MOVEMENT_NO_BLOCK - - Do not block movements - -.. data:: ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL - - Block vertical movements - -.. data:: ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL - - Block horizontal movements - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.scroller - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.evas cimport Object as evasObject -from efl.eo cimport _object_mapping_register - -from object cimport Object -from layout_class cimport LayoutClass -from efl.utils.deprecated cimport DEPRECATED - +include "scroller_cdef.pxi" cdef class Scrollable(Object): """Scrollable(..) diff --git a/efl/elementary/scroller.py b/efl/elementary/scroller.py new file mode 100644 index 0000000..212ab45 --- /dev/null +++ b/efl/elementary/scroller.py @@ -0,0 +1,14 @@ +from . import Scrollable, Scroller + +from . import ELM_SCROLLER_POLICY_AUTO +from . import ELM_SCROLLER_POLICY_ON +from . import ELM_SCROLLER_POLICY_OFF + +from . import ELM_SCROLLER_SINGLE_DIRECTION_NONE +from . import ELM_SCROLLER_SINGLE_DIRECTION_SOFT +from . import ELM_SCROLLER_SINGLE_DIRECTION_HARD +from . import ELM_SCROLLER_SINGLE_DIRECTION_LAST + +from . import ELM_SCROLLER_MOVEMENT_NO_BLOCK +from . import ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL +from . import ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL diff --git a/efl/elementary/scroller.pxd b/efl/elementary/scroller_cdef.pxi similarity index 97% rename from efl/elementary/scroller.pxd rename to efl/elementary/scroller_cdef.pxi index 7de1f39..6be91e2 100644 --- a/efl/elementary/scroller.pxd +++ b/efl/elementary/scroller_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord -from object cimport Object - - cdef extern from "Elementary.h": cpdef enum Elm_Scroller_Policy: @@ -62,6 +58,3 @@ cdef extern from "Elementary.h": Elm_Scroller_Movement_Block elm_scroller_movement_block_get(const Evas_Object *obj) void elm_scroller_loop_set(Evas_Object *obj, Eina_Bool loop_h, Eina_Bool loop_v) void elm_scroller_loop_get(const Evas_Object *obj, Eina_Bool *loop_h, Eina_Bool *loop_v) - -cdef class Scrollable(Object): - pass diff --git a/efl/elementary/segment_control.pyx b/efl/elementary/segment_control.pxi similarity index 90% rename from efl/elementary/segment_control.pyx rename to efl/elementary/segment_control.pxi index bd987d6..c559f7e 100644 --- a/efl/elementary/segment_control.pyx +++ b/efl/elementary/segment_control.pxi @@ -15,70 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`segment_control` Module -############################# - -.. image:: /images/segmentcontrol-preview.png - - -Widget description -================== - -Segment control widget is a horizontal control made of multiple -segment items, each segment item functioning similar to discrete two -state button. A segment control groups the items together and provides -compact single button with multiple equal size segments. - -Segment item size is determined by base widget size and the number of -items added. Only one segment item can be at selected state. A segment -item can display combination of Text and any Evas_Object like Images or -other widget. - - -Emitted signals -=============== - -- ``changed`` - When the user clicks on a segment item which is not - previously selected and get selected. The event_info parameter is the - segment item. - - -Layout content parts -==================== - -- ``icon`` - An icon in a segment control item - - -Layout text parts -================= - -- ``default`` - Title label in a segment control item - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.segment_control - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass - -from object_item cimport _object_item_to_python, ObjectItem - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "segment_control_cdef.pxi" cdef class SegmentControlItem(ObjectItem): """ diff --git a/efl/elementary/segment_control.py b/efl/elementary/segment_control.py new file mode 100644 index 0000000..0f5823a --- /dev/null +++ b/efl/elementary/segment_control.py @@ -0,0 +1 @@ +from . import SegmentControl, SegmentControlItem diff --git a/efl/elementary/segment_control.pxd b/efl/elementary/segment_control_cdef.pxi similarity index 93% rename from efl/elementary/segment_control.pxd rename to efl/elementary/segment_control_cdef.pxi index 88dbee7..5eb92fe 100644 --- a/efl/elementary/segment_control.pxd +++ b/efl/elementary/segment_control_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": Evas_Object *elm_segment_control_add(Evas_Object *parent) Elm_Object_Item *elm_segment_control_item_add(Evas_Object *obj, Evas_Object *icon, const char *label) diff --git a/efl/elementary/separator.pyx b/efl/elementary/separator.pxi similarity index 79% rename from efl/elementary/separator.pyx rename to efl/elementary/separator.pxi index 8bb452e..fd133c9 100644 --- a/efl/elementary/separator.pyx +++ b/efl/elementary/separator.pxi @@ -15,33 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`separator` Module -####################### - -.. image:: /images/separator-preview.png - - -Widget description -================== - -Separator is a very thin object used to separate other objects. - -A separator can be vertical or horizontal. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.separator - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "separator_cdef.pxi" cdef class Separator(LayoutClass): """ diff --git a/efl/elementary/separator.py b/efl/elementary/separator.py new file mode 100644 index 0000000..5395d5b --- /dev/null +++ b/efl/elementary/separator.py @@ -0,0 +1 @@ +from . import Separator diff --git a/efl/elementary/separator.pxd b/efl/elementary/separator_cdef.pxi similarity index 85% rename from efl/elementary/separator.pxd rename to efl/elementary/separator_cdef.pxi index 080a143..c9ab273 100644 --- a/efl/elementary/separator.pxd +++ b/efl/elementary/separator_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_separator_add(Evas_Object *parent) void elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) diff --git a/efl/elementary/slider.pyx b/efl/elementary/slider.pxi similarity index 85% rename from efl/elementary/slider.pyx rename to efl/elementary/slider.pxi index 4f49453..d9c409e 100644 --- a/efl/elementary/slider.pyx +++ b/efl/elementary/slider.pxi @@ -15,82 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`slider` Module -#################### - -.. image:: /images/slider-preview.png - - -Widget description -================== - -The slider adds a draggable "slider" widget for selecting the value of -something within a range. - -A slider can be horizontal or vertical. It can contain an Icon and has a -primary label as well as a units label (that is formatted with floating -point values and thus accepts a printf-style format string, like -``"%1.2f units"``. There is also an indicator string that may be somewhere -else (like on the slider itself) that also accepts a format string like -units. Label, Icon Unit and Indicator strings/objects are optional. - -A slider may be inverted which means values invert, with high vales being -on the left or top and low values on the right or bottom (as opposed to -normally being low on the left or top and high on the bottom and right). - -The slider should have its minimum and maximum values set by the -application with :py:attr:`Slider.min_max` and value should also be set by -the application before use with :py:attr:`Slider.value`. The span of the -slider is its length (horizontally or vertically). This will be scaled by -the object or applications scaling factor. At any point code can query the -slider for its value with :py:attr:`Slider.value`. - - -Emitted signals -=============== - -- ``changed`` - Whenever the slider value is changed by the user. -- ``slider,drag,start`` - dragging the slider indicator around has - started. -- ``slider,drag,stop`` - dragging the slider indicator around has - stopped. -- ``delay,changed`` - A short time after the value is changed by - the user. This will be called only when the user stops dragging - for a very short period or when they release their finger/mouse, - so it avoids possibly expensive reactions to the value change. -- ``focused`` - When the slider has received focus. (since 1.8) -- ``unfocused`` - When the slider has lost focus. (since 1.8) - - -Layout content parts -==================== - -- ``icon`` - An icon of the slider -- ``end`` - A end part content of the slider - - -Layout text parts -================= - -- ``default`` - Label of the slider - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.slider - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "slider_cdef.pxi" cdef class Slider(LayoutClass): """ diff --git a/efl/elementary/slider.py b/efl/elementary/slider.py new file mode 100644 index 0000000..97ab64f --- /dev/null +++ b/efl/elementary/slider.py @@ -0,0 +1,6 @@ +from . import Slider + +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS +from . import ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE diff --git a/efl/elementary/slider.pxd b/efl/elementary/slider_cdef.pxi similarity index 97% rename from efl/elementary/slider.pxd rename to efl/elementary/slider_cdef.pxi index 6f4915e..920f720 100644 --- a/efl/elementary/slider.pxd +++ b/efl/elementary/slider_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - cdef extern from "Elementary.h": cpdef enum Elm_Slider_Indicator_Visible_Mode: diff --git a/efl/elementary/slideshow.pyx b/efl/elementary/slideshow.pxi similarity index 89% rename from efl/elementary/slideshow.pyx rename to efl/elementary/slideshow.pxi index 19249a7..b94caab 100644 --- a/efl/elementary/slideshow.pyx +++ b/efl/elementary/slideshow.pxi @@ -16,98 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`slideshow` Module -####################### - -.. image:: /images/slideshow-preview.png - - -Widget description -================== - -This widget, as the name indicates, is a pre-made image -slideshow panel, with API functions acting on (child) image -items presentation. Between those actions, are: - -- advance to next/previous image -- select the style of image transition animation -- set the exhibition time for each image -- start/stop the slideshow - -The transition animations are defined in the widget's theme, -consequently new animations can be added without having to -update the widget's code. - -Slideshow items -=============== - -For slideshow items, just like for :py:class:`~efl.elementary.genlist.Genlist` -ones, the user defines a **classes**, specifying functions that will be called -on the item's creation and deletion times. - -The :py:class:`SlideshowItemClass` class contains the following -members: - -- ``get`` - When an item is displayed, this function is - called, and it's where one should create the item object, de - facto. For example, the object can be a pure Evas image object - or a :py:class:`~efl.elementary.photocam.Photocam` widget. - -- ``delete`` - When an item is no more displayed, this function - is called, where the user must delete any data associated to - the item. - -Slideshow caching -================= - -The slideshow provides facilities to have items adjacent to the -one being displayed **already "realized"** (i.e. loaded) for -you, so that the system does not have to decode image data -anymore at the time it has to actually switch images on its -viewport. The user is able to set the numbers of items to be -cached **before** and **after** the current item, in the widget's -item list. - - -Emitted signals -=============== - -- ``changed`` - when the slideshow switches its view to a new item. - event_info parameter in callback contains the current visible item -- ``transition,end`` - when a slide transition ends. event_info - parameter in callback contains the current visible item -- ``focused`` - When the slideshow has received focus. (since 1.8) -- ``unfocused`` - When the slideshow has lost focus. (since 1.8) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.slideshow - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String, Py_INCREF -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from efl.utils.conversions cimport eina_list_strings_to_python_list - -from layout_class cimport LayoutClass - -import traceback -from object_item cimport _object_item_to_python, _object_item_list_to_python, \ - ObjectItem - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "slideshow_cdef.pxi" cdef Evas_Object *_py_elm_slideshow_item_get(void *data, Evas_Object *obj) with gil: cdef SlideshowItem item = data diff --git a/efl/elementary/slideshow.py b/efl/elementary/slideshow.py new file mode 100644 index 0000000..d7d3a29 --- /dev/null +++ b/efl/elementary/slideshow.py @@ -0,0 +1 @@ +from . import Slideshow, SlideshowItem, SlideshowItemClass diff --git a/efl/elementary/slideshow.pxd b/efl/elementary/slideshow_cdef.pxi similarity index 95% rename from efl/elementary/slideshow.pxd rename to efl/elementary/slideshow_cdef.pxi index 9a92ec2..0ed66da 100644 --- a/efl/elementary/slideshow.pxd +++ b/efl/elementary/slideshow_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_Compare_Cb, Eina_List, Evas_Object -from object_item cimport Elm_Object_Item - cdef extern from "Elementary.h": ctypedef Evas_Object *(*SlideshowItemGetFunc) (void *data, Evas_Object *obj) diff --git a/efl/elementary/spinner.pyx b/efl/elementary/spinner.pxi similarity index 89% rename from efl/elementary/spinner.pyx rename to efl/elementary/spinner.pxi index 2bf6adf..bfeaf6a 100644 --- a/efl/elementary/spinner.pyx +++ b/efl/elementary/spinner.pxi @@ -15,65 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`spinner` Module -##################### - -.. image:: /images/spinner-preview.png - - -Widget description -================== - -A spinner is a widget which allows the user to increase or decrease -numeric values using arrow buttons, or edit values directly, clicking -over it and typing the new value. - -By default the spinner will not wrap and has a label -of ``"%.0f"`` (just showing the integer value of the double). - -A spinner has a label that is formatted with floating -point values and thus accepts a printf-style format string, like -``"%1.2f units"``. - -It also allows specific values to be replaced by pre-defined labels. - - -Emitted signals -=============== - -- ``changed`` - Whenever the spinner value is changed. -- ``delay,changed`` - A short time after the value is changed by - the user. This will be called only when the user stops dragging - for a very short period or when they release their finger/mouse, - so it avoids possibly expensive reactions to the value change. -- ``language,changed`` - the program's language changed -- ``focused`` - When the spinner has received focus. (since 1.8) -- ``unfocused`` - When the spinner has lost focus. (since 1.8) - - -Available styles -================ - -- ``default``: Default style -- ``vertical``: up/down buttons at the right side and text left aligned. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.spinner - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "spinner_cdef.pxi" cdef class Spinner(LayoutClass): """ diff --git a/efl/elementary/spinner.py b/efl/elementary/spinner.py new file mode 100644 index 0000000..ff7f45b --- /dev/null +++ b/efl/elementary/spinner.py @@ -0,0 +1 @@ +from . import Spinner diff --git a/efl/elementary/spinner.pxd b/efl/elementary/spinner_cdef.pxi similarity index 97% rename from efl/elementary/spinner.pxd rename to efl/elementary/spinner_cdef.pxi index c2fae91..a6432d3 100644 --- a/efl/elementary/spinner.pxd +++ b/efl/elementary/spinner_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_spinner_add(Evas_Object *parent) void elm_spinner_label_format_set(Evas_Object *obj, const char *format) diff --git a/efl/elementary/systray.pyx b/efl/elementary/systray.pxi similarity index 88% rename from efl/elementary/systray.pyx rename to efl/elementary/systray.pxi index 7368e9e..7bf021b 100644 --- a/efl/elementary/systray.pyx +++ b/efl/elementary/systray.pxi @@ -15,74 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" -:mod:`systray` Module -########################## - -.. versionadded:: 1.14 - - -Enumerations -============ - -.. _Elm_Systray_Category: - -Category of the Status Notifier Item. -------------------------------------- - -.. data:: ELM_SYSTRAY_CATEGORY_APP_STATUS - - Indicators of application status - -.. data:: ELM_SYSTRAY_CATEGORY_COMMUNICATIONS - - Communications apps - -.. data:: ELM_SYSTRAY_CATEGORY_SYS_SERVICES - - System Service apps - -.. data:: ELM_SYSTRAY_CATEGORY_HARDWARE - - Hardware indicators - -.. data:: ELM_SYSTRAY_CATEGORY_OTHER - - Undefined category - - -.. _Elm_Systray_Status: - -Application status information. -------------------------------- - -.. data:: ELM_SYSTRAY_STATUS_PASSIVE - - Passive (normal) - -.. data:: ELM_SYSTRAY_STATUS_ACTIVE - - Active - -.. data:: ELM_SYSTRAY_STATUS_ATTENTION - - Needs Attention - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.systray - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String, Py_INCREF - -from efl.c_eo cimport eo_do, eo_do_ret, eo_add, Eo as cEo -from efl.eo cimport Eo, object_from_instance -from efl.ecore cimport Event, EventHandler, _event_mapping_register -from efl.utils.conversions cimport _ctouni - +include "systray_cdef.pxi" cdef class Systray(Eo): diff --git a/efl/elementary/systray.py b/efl/elementary/systray.py new file mode 100644 index 0000000..cb61236 --- /dev/null +++ b/efl/elementary/systray.py @@ -0,0 +1,13 @@ +from . import Systray, on_systray_ready + +from . import ELM_EVENT_SYSTRAY_READY + +from . import ELM_SYSTRAY_CATEGORY_APP_STATUS +from . import ELM_SYSTRAY_CATEGORY_COMMUNICATIONS +from . import ELM_SYSTRAY_CATEGORY_SYS_SERVICES +from . import ELM_SYSTRAY_CATEGORY_HARDWARE +from . import ELM_SYSTRAY_CATEGORY_OTHER + +from . import ELM_SYSTRAY_STATUS_PASSIVE +from . import ELM_SYSTRAY_STATUS_ACTIVE +from . import ELM_SYSTRAY_STATUS_ATTENTION diff --git a/efl/elementary/systray.pxd b/efl/elementary/systray_cdef.pxi similarity index 85% rename from efl/elementary/systray.pxd rename to efl/elementary/systray_cdef.pxi index f5b9f83..f4b558f 100644 --- a/efl/elementary/systray.pxd +++ b/efl/elementary/systray_cdef.pxi @@ -1,10 +1,6 @@ -from efl.eina cimport Eina_Bool, Eina_List -from efl.evas cimport Evas_Object, Evas_Coord -from efl.c_eo cimport Eo, Eo_Class - cdef extern from "Elementary.h": - ctypedef Eo Elm_Systray + ctypedef cEo Elm_Systray cpdef enum: ELM_EVENT_SYSTRAY_READY @@ -31,8 +27,8 @@ cdef extern from "Elementary.h": Elm_Systray_Category elm_obj_systray_category_get() void elm_obj_systray_icon_theme_path_set(const char *icon_theme_path) const char * elm_obj_systray_icon_theme_path_get() - void elm_obj_systray_menu_set(const Eo *menu) - const Eo * elm_obj_systray_menu_get() + void elm_obj_systray_menu_set(const cEo *menu) + const cEo * elm_obj_systray_menu_get() void elm_obj_systray_att_icon_name_set(const char *att_icon_name) const char * elm_obj_systray_att_icon_name_get() void elm_obj_systray_status_set(Elm_Systray_Status st) diff --git a/efl/elementary/table.pyx b/efl/elementary/table.pxi similarity index 85% rename from efl/elementary/table.pyx rename to efl/elementary/table.pxi index e0356b6..cd53e6f 100644 --- a/efl/elementary/table.pyx +++ b/efl/elementary/table.pxi @@ -15,45 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`table` Module -################### - -.. image:: /images/table-preview.png - - -Widget description -================== - -A container widget to arrange other widgets in a table where items can -span multiple columns or rows - even overlap (and then be raised or -lowered accordingly to adjust stacking if they do overlap). - -The row and column count is not fixed. The table widget adjusts itself -when subobjects are added to it dynamically. - -The most common way to use a table is:: - - table = Table(win) - table.show() - table.padding = (space_between_columns, space_between_rows) - table.pack(table_content_object, x_coord, y_coord, colspan, rowspan) - table.pack(table_content_object, x_coord, y_coord, colspan, rowspan) - table.pack(table_content_object, x_coord, y_coord, colspan, rowspan) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.table - :parts: 2 - -""" - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.evas cimport Object as evasObject -from object cimport Object +include "table_cdef.pxi" cdef class Table(Object): """ diff --git a/efl/elementary/table.py b/efl/elementary/table.py new file mode 100644 index 0000000..1dd9d7f --- /dev/null +++ b/efl/elementary/table.py @@ -0,0 +1 @@ +from . import Table, table_pack_set, table_pack_get diff --git a/efl/elementary/table.pxd b/efl/elementary/table_cdef.pxi similarity index 95% rename from efl/elementary/table.pxd rename to efl/elementary/table_cdef.pxi index 8bb0177..2e45d2e 100644 --- a/efl/elementary/table.pxd +++ b/efl/elementary/table_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord - cdef extern from "Elementary.h": Evas_Object *elm_table_add(Evas_Object *parent) void elm_table_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous) diff --git a/efl/elementary/theme.pyx b/efl/elementary/theme.pxi similarity index 78% rename from efl/elementary/theme.pyx rename to efl/elementary/theme.pxi index 253531b..c13e911 100644 --- a/efl/elementary/theme.pyx +++ b/efl/elementary/theme.pxi @@ -15,93 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`theme` Module -################### - - -Description -=========== - -Elementary uses Edje to theme its widgets, naturally. But for the most -part this is hidden behind a simpler interface that lets the user set -extensions and choose the style of widgets in a much easier way. - -Instead of thinking in terms of paths to Edje files and their groups -each time you want to change the appearance of a widget, Elementary -works so you can add any theme file with extensions or replace the -main theme at one point in the application, and then just set the style -of widgets with -:py:attr:`Object.style` -and related functions. Elementary -will then look in its list of themes for a matching group and apply it, -and when the theme changes midway through the application, all widgets -will be updated accordingly. - -There are three concepts you need to know to understand how Elementary -theming works: default theme, extensions and overlays. - -Default theme, obviously enough, is the one that provides the default -look of all widgets. End users can change the theme used by Elementary -by setting the ``ELM_THEME`` environment variable before running an -application, or globally for all programs using the ``elementary_config`` -utility. Applications can change the default theme using :py:attr:`Theme.order`, -but this can go against the user wishes, so it's not an advised practice. - -Ideally, applications should find everything they need in the already -provided theme, but there may be occasions when that's not enough and -custom styles are required to correctly express the idea. For this -cases, Elementary has extensions. - -Extensions allow the application developer to write styles of its own -to apply to some widgets. This requires knowledge of how each widget -is themed, as extensions will always replace the entire group used by -the widget, so important signals and parts need to be there for the -object to behave properly (see documentation of Edje for details). -Once the theme for the extension is done, the application needs to add -it to the list of themes Elementary will look into, using -:py:func:`Theme.extension_add()`, and set the style of the desired widgets as -he would normally with -:py:attr:`Object.style`. - -Overlays, on the other hand, can replace the look of all widgets by -overriding the default style. Like extensions, it's up to the application -developer to write the theme for the widgets it wants, the difference -being that when looking for the theme, Elementary will check first the -list of overlays, then the set theme and lastly the list of extensions, -so with overlays it's possible to replace the default view and every -widget will be affected. This is very much alike to setting the whole -theme for the application and will probably clash with the end user -options, not to mention the risk of ending up with not matching styles -across the program. Unless there's a very special reason to use them, -overlays should be avoided for the reasons exposed before. - -All these theme lists are handled by :py:class:`Theme` instances. Elementary -keeps one default internally. It's possible to create a new instance of a -:py:class:`Theme` to set other theme for a specific widget (and all of its -children), but this is as discouraged, if not even more so, than using -overlays. Don't use this unless you really know what you are doing. - -.. note:: - - Remember to :py:func:`Theme.free` the instance when you're done with it! - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.theme - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport PY_REFCOUNT -from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list -from efl.eina cimport eina_list_free, eina_stringshare_del +include "theme_cdef.pxi" cdef class Theme(object): """ @@ -110,6 +24,8 @@ cdef class Theme(object): """ + cdef Elm_Theme *th + def __repr__(self): return "<%s object at %#x (refcount=%d, order=%s, overlay_list=%s, extension_list=%s)>" % ( type(self).__name__, diff --git a/efl/elementary/theme.py b/efl/elementary/theme.py new file mode 100644 index 0000000..6048471 --- /dev/null +++ b/efl/elementary/theme.py @@ -0,0 +1,2 @@ +from . import Theme, theme_list_item_path_get, theme_full_flush, \ + theme_name_available_list, theme_overlay_add, theme_extension_add diff --git a/efl/elementary/theme.pxd b/efl/elementary/theme_cdef.pxi similarity index 65% rename from efl/elementary/theme.pxd rename to efl/elementary/theme_cdef.pxi index a57e08f..411f651 100644 --- a/efl/elementary/theme.pxd +++ b/efl/elementary/theme_cdef.pxi @@ -1,23 +1,3 @@ -# Copyright 2012 Kai Huuhko -# -# 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 . -# - -from efl.evas cimport Eina_Bool, Eina_List - cdef extern from "Elementary.h": ctypedef struct Elm_Theme @@ -44,6 +24,3 @@ cdef extern from "Elementary.h": void elm_theme_name_available_list_free(Eina_List *list) char *elm_theme_data_get(Elm_Theme *th, const char *key) Eina_List *elm_theme_group_base_list(Elm_Theme *th, const char *base) - -cdef class Theme(object): - cdef Elm_Theme *th diff --git a/efl/elementary/thumb.pyx b/efl/elementary/thumb.pxi similarity index 76% rename from efl/elementary/thumb.pyx rename to efl/elementary/thumb.pxi index 0760ac0..4e3f3ea 100644 --- a/efl/elementary/thumb.pyx +++ b/efl/elementary/thumb.pxi @@ -15,185 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`thumb` Module -################### - -.. image:: /images/thumb-preview.png - - -Widget description -================== - -A thumbnail object is used for displaying the thumbnail of an image -or video. You must have compiled Elementary with ``Ethumb_Client`` -support. Also, Ethumb's DBus service must be present and -auto-activated in order to have thumbnails generated. You must also -have a **session** bus, not a **system** one. - -Once the thumbnail object becomes visible, it will check if there -is a previously generated thumbnail image for the file set on -it. If not, it will start generating this thumbnail. - -Different configuration settings will cause different thumbnails to -be generated even on the same file. - -Generated thumbnails are stored under ``$HOME/.thumbnails/``. Check -Ethumb's documentation to change this path, and to see other -configuration options. - - -Emitted signals -=============== - -- ``clicked`` - This is called when a user has clicked the - thumbnail object without dragging it around. -- ``clicked,double`` - This is called when a user has double-clicked - the thumbnail object. -- ``press`` - This is called when a user has pressed down over the - thumbnail object. -- ``generate,start`` - The thumbnail generation has started. -- ``generate,stop`` - The generation process has stopped. -- ``generate,error`` - The thumbnail generation failed. -- ``load,error`` - The thumbnail image loading failed. - - -Available styles -================ - -- ``default`` -- ``noframe`` - - -Enumerations -============ - -.. _Elm_Thumb_Animation_Setting: - -Thumb animation mode --------------------- - -.. data:: ELM_THUMB_ANIMATION_START - - Play animation once - -.. data:: ELM_THUMB_ANIMATION_LOOP - - Keep playing animation until stop is requested - -.. data:: ELM_THUMB_ANIMATION_STOP - - Stop playing the animation - - -.. _Ethumb_Thumb_FDO_Size: - -Thumb FDO size --------------- - -.. data:: ETHUMB_THUMB_NORMAL - - 128x128 as defined by FreeDesktop.Org standard - -.. data:: ETHUMB_THUMB_LARGE - - 256x256 as defined by FreeDesktop.Org standard - - -.. _Ethumb_Thumb_Format: - -Thumb format ------------- - -.. data:: ETHUMB_THUMB_FDO - - PNG as defined by FreeDesktop.Org standard - -.. data:: ETHUMB_THUMB_JPEG - - JPEGs are often smaller and faster to read/write - -.. data:: ETHUMB_THUMB_EET - - EFL's own storage system, supports key parameter - - -.. _Ethumb_Thumb_Aspect: - -Thumb aspect ------------- - -.. data:: ETHUMB_THUMB_KEEP_ASPECT - - keep original proportion between width and height - -.. data:: ETHUMB_THUMB_IGNORE_ASPECT - - ignore aspect and foce it to match thumbnail's width and height - -.. data:: ETHUMB_THUMB_CROP - - keep aspect but crop (cut) the largest dimension - - -.. _Ethumb_Thumb_Orientation: - -Thumb orientation ------------------ - -.. data:: ETHUMB_THUMB_ORIENT_NONE - - keep orientation as pixel data is - -.. data:: ETHUMB_THUMB_ROTATE_90_CW - - rotate 90° clockwise - -.. data:: ETHUMB_THUMB_ROTATE_180 - - rotate 180° - -.. data:: ETHUMB_THUMB_ROTATE_90_CCW - - rotate 90° counter-clockwise - -.. data:: ETHUMB_THUMB_FLIP_HORIZONTAL - - flip horizontally - -.. data:: ETHUMB_THUMB_FLIP_VERTICAL - - flip vertically - -.. data:: ETHUMB_THUMB_FLIP_TRANSPOSE - - transpose - -.. data:: ETHUMB_THUMB_FLIP_TRANSVERSE - - transverse - -.. data:: ETHUMB_THUMB_ORIENT_ORIGINAL - - use orientation from metadata (EXIF-only currently) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.thumb - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from object cimport Object - +include "thumb_cdef.pxi" cdef class Thumb(Object): """ diff --git a/efl/elementary/thumb.py b/efl/elementary/thumb.py new file mode 100644 index 0000000..f1dba53 --- /dev/null +++ b/efl/elementary/thumb.py @@ -0,0 +1,26 @@ +from . import Thumb + +from . import ELM_THUMB_ANIMATION_START +from . import ELM_THUMB_ANIMATION_LOOP +from . import ELM_THUMB_ANIMATION_STOP + +from . import ETHUMB_THUMB_NORMAL +from . import ETHUMB_THUMB_LARGE + +from . import ETHUMB_THUMB_FDO +from . import ETHUMB_THUMB_JPEG +from . import ETHUMB_THUMB_EET + +from . import ETHUMB_THUMB_KEEP_ASPECT +from . import ETHUMB_THUMB_IGNORE_ASPECT +from . import ETHUMB_THUMB_CROP + +from . import ETHUMB_THUMB_ORIENT_NONE +from . import ETHUMB_THUMB_ROTATE_90_CW +from . import ETHUMB_THUMB_ROTATE_180 +from . import ETHUMB_THUMB_ROTATE_90_CCW +from . import ETHUMB_THUMB_FLIP_HORIZONTAL +from . import ETHUMB_THUMB_FLIP_VERTICAL +from . import ETHUMB_THUMB_FLIP_TRANSPOSE +from . import ETHUMB_THUMB_FLIP_TRANSVERSE +from . import ETHUMB_THUMB_ORIENT_ORIGINAL diff --git a/efl/elementary/thumb.pxd b/efl/elementary/thumb_cdef.pxi similarity index 98% rename from efl/elementary/thumb.pxd rename to efl/elementary/thumb_cdef.pxi index 5d0bf2a..2f8684f 100644 --- a/efl/elementary/thumb.pxd +++ b/efl/elementary/thumb_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - - cdef extern from "Elementary.h": cpdef enum Elm_Thumb_Animation_Setting: diff --git a/efl/elementary/toolbar.pyx b/efl/elementary/toolbar.pxi similarity index 89% rename from efl/elementary/toolbar.pyx rename to efl/elementary/toolbar.pxi index a89f6ea..7fcc76f 100644 --- a/efl/elementary/toolbar.pyx +++ b/efl/elementary/toolbar.pxi @@ -16,195 +16,7 @@ # along with python-elementary. If not, see . # -""" - -:mod:`toolbar` Module -##################### - -.. image:: /images/toolbar-preview.png - - -Widget description -================== - -A toolbar is a widget that displays a list of items inside a box. It -can be scrollable, show a menu with items that don't fit to toolbar size -or even crop them. - -Only one item can be selected at a time. - -Items can have multiple states, or show menus when selected by the user. - - -Emitted signals -=============== - -- ``clicked`` - when the user clicks on a toolbar item and becomes selected. -- ``longpressed`` - when the toolbar is pressed for a certain amount of time. -- ``language,changed`` - when the program language changes. -- ``focused`` - When the toolbar has received focus. (since 1.8) -- ``unfocused`` - When the toolbar has lost focus. (since 1.8) -- ``item,focused`` - When the toolbar item has received focus. (since 1.10) -- ``item,unfocused`` - When the toolbar item has lost focus. (since 1.10) - - -Available styles -================ - -- ``default`` -- ``transparent`` - no background or shadow, just show the content - - -Layout text parts -================= - -- ``default`` - label of the toolbar item - - -Scrollable Interface -==================== - -This widget supports the scrollable interface. - -If you wish to control the scrolling behaviour using these functions, -inherit both the widget class and the -:py:class:`~efl.elementary.scroller.Scrollable` class -using multiple inheritance, for example:: - - class ScrollableGenlist(Genlist, Scrollable): - def __init__(self, canvas, *args, **kwargs): - Genlist.__init__(self, canvas) - - -Enumerations -============ - -.. _Elm_Toolbar_Icon_Lookup_Order: - -Icon lookup modes ------------------ - -.. data:: ELM_ICON_LOOKUP_FDO_THEME - - freedesktop, theme - -.. data:: ELM_ICON_LOOKUP_THEME_FDO - - theme, freedesktop - -.. data:: ELM_ICON_LOOKUP_FDO - - freedesktop - -.. data:: ELM_ICON_LOOKUP_THEME - - theme - - -.. _Elm_Toolbar_Object_Select_Mode: - -Selection modes ---------------- - -.. data:: ELM_OBJECT_SELECT_MODE_DEFAULT - - Default select mode - -.. data:: ELM_OBJECT_SELECT_MODE_ALWAYS - - Always select mode - -.. data:: ELM_OBJECT_SELECT_MODE_NONE - - No select mode - -.. data:: ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY - - No select mode with no finger size rule - - -.. _Elm_Toolbar_Shrink_Mode: - -Toolbar shrink modes --------------------- - -.. data:: ELM_TOOLBAR_SHRINK_NONE - - Set toolbar minimum size to fit all the items - -.. data:: ELM_TOOLBAR_SHRINK_HIDE - - Hide exceeding items - -.. data:: ELM_TOOLBAR_SHRINK_SCROLL - - Allow accessing exceeding items through a scroller - -.. data:: ELM_TOOLBAR_SHRINK_MENU - - Inserts a button to pop up a menu with exceeding items - -.. data:: ELM_TOOLBAR_SHRINK_EXPAND - - Expand all items according the size of the toolbar. - - -.. _Elm_Toolbar_Item_Scrollto_Type: - -Toolbar item scrollto types ---------------------------- - -Where to position the item in the toolbar. - -.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_NONE - - No scrollto - -.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_IN - - To the nearest viewport - -.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_FIRST - - To the first of viewport - -.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE - - To the middle of viewport - -.. data:: ELM_TOOLBAR_ITEM_SCROLLTO_LAST - - To the last of viewport - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.toolbar - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass -from object_item cimport _object_item_callback, _object_item_to_python, \ - _object_item_callback2, ObjectItem - -from efl.utils.deprecated cimport DEPRECATED -from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \ - elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy - -import traceback - - -cdef object _cb_object_item_conv(void *addr): - return _object_item_to_python(addr) - +include "toolbar_cdef.pxi" cdef void _toolbar_item_state_callback(void *data, Evas_Object *obj, void *event_info) with gil: cdef ToolbarItemState state = data diff --git a/efl/elementary/toolbar.py b/efl/elementary/toolbar.py new file mode 100644 index 0000000..9cb1b10 --- /dev/null +++ b/efl/elementary/toolbar.py @@ -0,0 +1,25 @@ +from . import Toolbar, ToolbarItem, ToolbarItemState + +from . import ELM_ICON_LOOKUP_FDO_THEME +from . import ELM_ICON_LOOKUP_THEME_FDO +from . import ELM_ICON_LOOKUP_FDO +from . import ELM_ICON_LOOKUP_THEME + +from . import ELM_OBJECT_SELECT_MODE_DEFAULT +from . import ELM_OBJECT_SELECT_MODE_ALWAYS +from . import ELM_OBJECT_SELECT_MODE_NONE +from . import ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY +from . import ELM_OBJECT_SELECT_MODE_MAX + +from . import ELM_TOOLBAR_ITEM_SCROLLTO_NONE +from . import ELM_TOOLBAR_ITEM_SCROLLTO_IN +from . import ELM_TOOLBAR_ITEM_SCROLLTO_FIRST +from . import ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE +from . import ELM_TOOLBAR_ITEM_SCROLLTO_LAST + +from . import ELM_TOOLBAR_SHRINK_NONE +from . import ELM_TOOLBAR_SHRINK_HIDE +from . import ELM_TOOLBAR_SHRINK_SCROLL +from . import ELM_TOOLBAR_SHRINK_MENU +from . import ELM_TOOLBAR_SHRINK_EXPAND +from . import ELM_TOOLBAR_SHRINK_LAST diff --git a/efl/elementary/toolbar.pxd b/efl/elementary/toolbar_cdef.pxi similarity index 98% rename from efl/elementary/toolbar.pxd rename to efl/elementary/toolbar_cdef.pxi index a70b6f6..2c32ebd 100644 --- a/efl/elementary/toolbar.pxd +++ b/efl/elementary/toolbar_cdef.pxi @@ -1,7 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object, Evas_Smart_Cb -from object_item cimport Elm_Object_Item - - cdef extern from "Elementary.h": cpdef enum Elm_Icon_Lookup_Order: diff --git a/efl/elementary/tooltips.pxi b/efl/elementary/tooltips.pxi deleted file mode 100644 index ea57ed0..0000000 --- a/efl/elementary/tooltips.pxi +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2012 Kai Huuhko -# -# 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 . -# - -from efl.eo cimport object_from_instance -from object_item cimport ObjectItem, _object_item_to_python, Elm_Object_Item - -cdef Evas_Object *_tooltip_content_create(void *data, Evas_Object *o, Evas_Object *t) with gil: - cdef Object ret, obj, tooltip - - obj = object_from_instance(o) - tooltip = object_from_instance(t) - (func, args, kargs) = 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(data) - -cdef Evas_Object *_tooltip_item_content_create(void *data, Evas_Object *o, Evas_Object *t, void *it) with gil: - cdef: - Object ret, obj, tooltip - ObjectItem item - - obj = object_from_instance(o) - tooltip = object_from_instance(t) - item = _object_item_to_python(it) - (func, args, kargs) = data - ret = func(obj, item, tooltip, *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(data) - diff --git a/efl/elementary/transit.pyx b/efl/elementary/transit.pxi similarity index 88% rename from efl/elementary/transit.pyx rename to efl/elementary/transit.pxi index 0cd6035..4eb40ed 100644 --- a/efl/elementary/transit.pyx +++ b/efl/elementary/transit.pxi @@ -16,181 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`transit` Module -##################### - - -Widget description -================== - -Transit is designed to apply various animated transition effects to -``Evas_Object``, such like translation, rotation, etc. For using these -effects, create a :py:class:`Transit` and add the desired transition effects. - -Once the effects are added into transit, they will be automatically managed -(their callback will be called for the set duration and they will be deleted -upon completion). - -Example:: - - from efl.elementary.transit import Transit, ELM_TRANSIT_TWEEN_MODE_DECELERATE - - t = Transit() - t.object_add(obj) - t.effect_translation_add(0, 0, 280, 280) - t.duration = 1 - t.auto_reverse = True - t.tween_mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE - t.repeat_times = 3 - -Some transition effects are used to change the properties of objects. They -are: - -- :py:func:`~Transit.effect_translation_add` -- :py:func:`~Transit.effect_color_add` -- :py:func:`~Transit.effect_rotation_add` -- :py:func:`~Transit.effect_wipe_add` -- :py:func:`~Transit.effect_zoom_add` -- :py:func:`~Transit.effect_resizing_add` - -Other transition effects are used to make one object disappear and another -object appear on its place. These effects are: - -- :py:func:`~Transit.effect_flip_add` -- :py:func:`~Transit.effect_resizable_flip_add` -- :py:func:`~Transit.effect_fade_add` -- :py:func:`~Transit.effect_blend_add` - -It's also possible to make a transition chain with -:py:func:`~Transit.chain_transit_add`. - -.. warning:: We strongly recommend to use elm_transit just when edje can - not do the trick. Edje is better at handling transitions than - Elm_Transit. Edje has more flexibility and animations can be - manipulated inside the theme. - - -Enumerations -============ - -.. _Elm_Transit_Effect_Flip_Axis: - -Flip effects ------------- - -.. data:: ELM_TRANSIT_EFFECT_FLIP_AXIS_X - - Flip on X axis - -.. data:: ELM_TRANSIT_EFFECT_FLIP_AXIS_Y - - Flip on Y axis - - -.. _Elm_Transit_Effect_Wipe_Dir: - -Wipe effects ------------- - -.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_LEFT - - Wipe to the left - -.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT - - Wipe to the right - -.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_UP - - Wipe up - -.. data:: ELM_TRANSIT_EFFECT_WIPE_DIR_DOWN - - Wipe down - - -.. _Elm_Transit_Effect_Wipe_Type: - -Wipe types ----------- - -.. data:: ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE - - Hide the object during the animation. - -.. data:: ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW - - Show the object during the animation. - - -.. _Elm_Transit_Tween_Mode: - -Tween modes ------------ - -.. data:: ELM_TRANSIT_TWEEN_MODE_LINEAR - - Constant speed - -.. data:: ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL - - Starts slow, increase speed over time, then decrease again and stop slowly - -.. data:: ELM_TRANSIT_TWEEN_MODE_DECELERATE - - Starts fast and decrease speed over time - -.. data:: ELM_TRANSIT_TWEEN_MODE_ACCELERATE - - Starts slow and increase speed over time - -.. data:: ELM_TRANSIT_TWEEN_MODE_DIVISOR_INTERP - - Start at gradient v1, interpolated via power of v2 curve - - .. versionadded:: 1.13 - -.. data:: ELM_TRANSIT_TWEEN_MODE_BOUNCE - - Start at 0.0 then "drop" like a ball bouncing to the ground at 1.0, and - bounce v2 times, with decay factor of v1 - - .. versionadded:: 1.13 - -.. data:: ELM_TRANSIT_TWEEN_MODE_SPRING - - Start at 0.0 then "wobble" like a spring rest position 1.0, and wobble - v2 times, with decay factor of v1 - - .. versionadded:: 1.13 - -.. data:: ELM_TRANSIT_TWEEN_MODE_BEZIER_CURVE - - Follow the cubic-bezier curve calculated with the control points (x1, - y1), (x2, y2) - - .. versionadded:: 1.13 - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.transit - :parts: 2 - -""" - -from libc.stdlib cimport free -from cpython cimport Py_INCREF, Py_DECREF - -from efl.evas cimport Object as evasObject -from efl.utils.conversions cimport eina_list_objects_to_python_list, \ - python_list_strings_to_eina_list, python_list_doubles_to_array_of_doubles - -import traceback - +include "transit_cdef.pxi" cdef class TransitCustomEffect(object): """TransitCustomEffect(...) @@ -588,7 +414,7 @@ cdef class Transit(object): :type: list of doubles .. seealso:: :py:attr:`tween_mode_factor` - + .. versionadded:: 1.13 """ diff --git a/efl/elementary/transit.py b/efl/elementary/transit.py new file mode 100644 index 0000000..6b9aa33 --- /dev/null +++ b/efl/elementary/transit.py @@ -0,0 +1,21 @@ +from . import Transit, TransitCustomEffect + +from . import ELM_TRANSIT_EFFECT_FLIP_AXIS_X +from . import ELM_TRANSIT_EFFECT_FLIP_AXIS_Y + +from . import ELM_TRANSIT_EFFECT_WIPE_DIR_LEFT +from . import ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT +from . import ELM_TRANSIT_EFFECT_WIPE_DIR_UP +from . import ELM_TRANSIT_EFFECT_WIPE_DIR_DOWN + +from . import ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE +from . import ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW + +from . import ELM_TRANSIT_TWEEN_MODE_LINEAR +from . import ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL +from . import ELM_TRANSIT_TWEEN_MODE_DECELERATE +from . import ELM_TRANSIT_TWEEN_MODE_ACCELERATE +from . import ELM_TRANSIT_TWEEN_MODE_DIVISOR_INTERP +from . import ELM_TRANSIT_TWEEN_MODE_BOUNCE +from . import ELM_TRANSIT_TWEEN_MODE_SPRING +from . import ELM_TRANSIT_TWEEN_MODE_BEZIER_CURVE diff --git a/efl/elementary/transit.pxd b/efl/elementary/transit_cdef.pxi similarity index 98% rename from efl/elementary/transit.pxd rename to efl/elementary/transit_cdef.pxi index 3866b8a..57fe735 100644 --- a/efl/elementary/transit.pxd +++ b/efl/elementary/transit_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Coord - - cdef extern from "Elementary.h": cpdef enum Elm_Transit_Effect_Flip_Axis: diff --git a/efl/elementary/video.pyx b/efl/elementary/video.pxi similarity index 92% rename from efl/elementary/video.pyx rename to efl/elementary/video.pxi index 151fe2e..5330ba7 100644 --- a/efl/elementary/video.pyx +++ b/efl/elementary/video.pxi @@ -15,42 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -""" - -:mod:`video` Module -################### - - -Widget description -================== - -Display a video by using Emotion. - -It embeds the video inside an Edje object, so you can do some -animation depending on the video state change. It also implements a -resource management policy to remove this burden from the application. - -These widgets emit the following signals, besides the ones sent from -:py:class:`~efl.elementary.layout_class.LayoutClass`: - -- ``focused`` - When the widget has received focus. (since 1.8) -- ``unfocused`` - When the widget has lost focus. (since 1.8) - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.video - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from layout_class cimport LayoutClass +include "video_cdef.pxi" cdef class Video(LayoutClass): """ diff --git a/efl/elementary/video.py b/efl/elementary/video.py new file mode 100644 index 0000000..1bc9546 --- /dev/null +++ b/efl/elementary/video.py @@ -0,0 +1 @@ +from . import Video, Player diff --git a/efl/elementary/video.pxd b/efl/elementary/video_cdef.pxi similarity index 97% rename from efl/elementary/video.pxd rename to efl/elementary/video_cdef.pxi index 1c2c1eb..c9bf50c 100644 --- a/efl/elementary/video.pxd +++ b/efl/elementary/video_cdef.pxi @@ -1,5 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - cdef extern from "Elementary.h": Evas_Object *elm_player_add(Evas_Object *parent) Evas_Object *elm_video_add(Evas_Object *parent) @@ -21,4 +19,3 @@ cdef extern from "Elementary.h": void elm_video_remember_position_set(Evas_Object *video, Eina_Bool remember) Eina_Bool elm_video_remember_position_get(const Evas_Object *video) const char * elm_video_title_get(const Evas_Object *video) - diff --git a/efl/elementary/web.pyx b/efl/elementary/web.pxi similarity index 87% rename from efl/elementary/web.pyx rename to efl/elementary/web.pxi index c25b517..19c2c19 100644 --- a/efl/elementary/web.pyx +++ b/efl/elementary/web.pxi @@ -16,178 +16,23 @@ # along with this Python-EFL. If not, see . # -""" +include "web_cdef.pxi" -:mod:`web` Module -################# - - -Widget description -================== - -A web widget is used for displaying web pages (HTML/CSS/JS) -using WebKit-EFL. You must have compiled Elementary with -ewebkit support. - - -Emitted signals -=============== - -- ``download,request``: A file download has been requested. Event info is - a WebDownload instance -- ``editorclient,contents,changed``: Editor client's contents changed -- ``editorclient,selection,changed``: Editor client's selection changed -- ``frame,created``: A new frame was created. Event info is an - Evas_Object which can be handled with WebKit's ewk_frame API -- ``icon,received``: An icon was received by the main frame -- ``inputmethod,changed``: Input method changed. Event info is an - Eina_Bool indicating whether it's enabled or not -- ``js,windowobject,clear``: JS window object has been cleared -- ``link,hover,in``: Mouse cursor is hovering over a link. Event info - is a tuple, where the first string contains the URL the link - points to, and the second one the title of the link -- ``link,hover,out``: Mouse cursor left the link -- ``load,document,finished``: Loading of a document finished. Event info - is the frame that finished loading -- ``load,error``: Load failed. Event info is a WebFrameLoadError instance -- ``load,finished``: Load finished. Event info is None on success, on - error it's a WebFrameLoadError instance -- ``load,newwindow,show``: A new window was created and is ready to be - shown -- ``load,progress``: Overall load progress. Event info is - a double containing a value between 0.0 and 1.0 -- ``load,provisional``: Started provisional load -- ``load,started``: Loading of a document started -- ``menubar,visible,get``: Queries if the menubar is visible. Event info - is a bool where the callback should set True if - the menubar is visible, or False in case it's not -- ``menubar,visible,set``: Informs menubar visibility. Event info is - a bool indicating the visibility -- ``popup,created``: A dropdown widget was activated, requesting its - popup menu to be created. Event info is a WebMenu instance -- ``popup,willdelete``: The web object is ready to destroy the popup - object created. Event info is a WebMenu instance -- ``ready``: Page is fully loaded -- ``scrollbars,visible,get``: Queries visibility of scrollbars. Event - info is a bool where the visibility state should be set -- ``scrollbars,visible,set``: Informs scrollbars visibility. Event info - is an Eina_Bool with the visibility state set -- ``statusbar,text,set``: Text of the statusbar changed. Event info is - a string with the new text -- ``statusbar,visible,get``: Queries visibility of the status bar. - Event info is a bool where the visibility state should be - set. -- ``statusbar,visible,set``: Informs statusbar visibility. Event info is - an Eina_Bool with the visibility value -- ``title,changed``: Title of the main frame changed. Event info is a - string with the new title -- ``toolbars,visible,get``: Queries visibility of toolbars. Event info - is a bool where the visibility state should be set -- ``toolbars,visible,set``: Informs the visibility of toolbars. Event - info is an Eina_Bool with the visibility state -- ``tooltip,text,set``: Show and set text of a tooltip. Event info is - a string with the text to show -- ``uri,changed``: URI of the main frame changed. Event info is a string (deprecated. use ``url,changed`` instead) -- ``url,changed``: URL of the main frame changed. Event info is a string - with the new URI -- ``view,resized``: The web object internal's view changed sized -- ``windows,close,request``: A JavaScript request to close the current - window was requested -- ``zoom,animated,end``: Animated zoom finished -- ``focused`` : When the web has received focus. (since 1.8) -- ``unfocused`` : When the web has lost focus. (since 1.8) - - -Enumerations -============ - -.. _Elm_Web_Window_Feature: - -Web window features -------------------- - -.. data:: ELM_WEB_WINDOW_FEATURE_TOOLBAR - - Toolbar - -.. data:: ELM_WEB_WINDOW_FEATURE_STATUSBAR - - Status bar - -.. data:: ELM_WEB_WINDOW_FEATURE_SCROLLBARS - - Scrollbars - -.. data:: ELM_WEB_WINDOW_FEATURE_MENUBAR - - Menu bar - -.. data:: ELM_WEB_WINDOW_FEATURE_LOCATIONBAR - - Location bar - -.. data:: ELM_WEB_WINDOW_FEATURE_FULLSCREEN - - Fullscreen - - -.. _Elm_Web_Zoom_Mode: - -Web zoom modes --------------- - -.. data:: ELM_WEB_ZOOM_MODE_MANUAL - - Zoom controlled normally by :py:attr:`~Web.zoom` - -.. data:: ELM_WEB_ZOOM_MODE_AUTO_FIT - - Zoom until content fits in web object. - -.. data:: ELM_WEB_ZOOM_MODE_AUTO_FILL - - Zoom until content fills web object. - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.web - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String -from libc.stdint cimport uintptr_t - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.deprecated cimport DEPRECATED -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject -from object cimport Object - -import traceback - - -cdef _cb_string_conv(void *addr): - return _ctouni(addr) if addr is not NULL else None - - -cdef _cb_bool_conv(void *addr): +cdef object _cb_bool_conv(void *addr): if addr == NULL: return None cdef Eina_Bool *ret = addr return ret[0] -cdef _web_double_conv(void *addr): +cdef object _web_double_conv(void *addr): if addr == NULL: return None cdef double *ret = addr return ret[0] -cdef _web_load_frame_error_conv(void *addr): +cdef object _web_load_frame_error_conv(void *addr): cdef Elm_Web_Frame_Load_Error *err if addr == NULL: return None @@ -199,7 +44,7 @@ cdef _web_load_frame_error_conv(void *addr): "frame": object_from_instance(err.frame) if err.frame else None} -cdef _web_link_hover_in_conv(void *addr): +cdef object _web_link_hover_in_conv(void *addr): cdef char **info if addr == NULL: url = title = None diff --git a/efl/elementary/web.py b/efl/elementary/web.py new file mode 100644 index 0000000..4a42419 --- /dev/null +++ b/efl/elementary/web.py @@ -0,0 +1,12 @@ +from . import Web + +from . import ELM_WEB_WINDOW_FEATURE_TOOLBAR +from . import ELM_WEB_WINDOW_FEATURE_STATUSBAR +from . import ELM_WEB_WINDOW_FEATURE_SCROLLBARS +from . import ELM_WEB_WINDOW_FEATURE_MENUBAR +from . import ELM_WEB_WINDOW_FEATURE_LOCATIONBAR +from . import ELM_WEB_WINDOW_FEATURE_FULLSCREEN + +from . import ELM_WEB_ZOOM_MODE_MANUAL +from . import ELM_WEB_ZOOM_MODE_AUTO_FIT +from . import ELM_WEB_ZOOM_MODE_AUTO_FILL diff --git a/efl/elementary/web.pxd b/efl/elementary/web_cdef.pxi similarity index 98% rename from efl/elementary/web.pxd rename to efl/elementary/web_cdef.pxi index 5d2e422..b99a9c6 100644 --- a/efl/elementary/web.pxd +++ b/efl/elementary/web_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Coord - - cdef extern from "Elementary.h": cpdef enum Elm_Web_Window_Feature_Flag: @@ -99,5 +96,3 @@ cdef extern from "Elementary.h": void elm_web_region_bring_in(Evas_Object *obj, int x, int y, int w, int h) void elm_web_inwin_mode_set(Evas_Object *obj, Eina_Bool value) Eina_Bool elm_web_inwin_mode_get(const Evas_Object *obj) - - diff --git a/efl/elementary/window.pyx b/efl/elementary/window.pxi similarity index 83% rename from efl/elementary/window.pyx rename to efl/elementary/window.pxi index 9dba758..e57e84c 100644 --- a/efl/elementary/window.pyx +++ b/efl/elementary/window.pxi @@ -16,377 +16,7 @@ # along with this Python-EFL. If not, see . # -""" - -:mod:`window` Module -#################### - - -Widget description -================== - -The window class of Elementary. - -Contains functions to manipulate windows. The Evas engine used to render -the window contents is specified in the system or user elementary config -files (whichever is found last), and can be overridden with the -ELM_ENGINE environment variable for testing. Engines that may be -supported (depending on Evas and Ecore-Evas compilation setup and -modules actually installed at runtime) are (listed in order of best -supported and most likely to be complete and work to lowest quality). - -Note that ELM_ENGINE is really only needed for special cases and debugging. -you should normally use ELM_DISPLAY and ELM_ACCEL environment variables, or -core elementary config. ELM_DISPLAY can be set to "x11" or "wl" to indicate -the target display system (as on Linux systems you may have both display -systems available, so this selects which to use). ELM_ACCEL may also be set -to indicate if you want accelerations and which kind to use. see -:py:attr:`~efl.elementary.configuration.Configuration.accel_preference` for -details on this environment variable values. - -``x11``, ``x``, ``software-x11``, ``software_x11`` - Software rendering in X11 -``gl``, ``opengl``, ``opengl-x11``, ``opengl_x11`` - OpenGL or OpenGL-ES2 rendering in X11 -``shot:...`` - Virtual screenshot renderer - renders to output file and exits -``fb``, ``software-fb``, ``software_fb`` - Linux framebuffer direct software rendering -``sdl``, ``software-sdl``, ``software_sdl`` - SDL software rendering to SDL buffer -``gl-sdl``, ``gl_sdl``, ``opengl-sdl``, ``opengl_sdl`` - OpenGL or OpenGL-ES2 using SDL -``gdi``, ``software-gdi``, ``software_gdi`` - Windows WIN32 rendering via GDI with software -``ews`` - rendering to EWS (Ecore + Evas Single Process Windowing System) -``gl-cocoa``, ``gl_cocoa``, ``opengl-cocoa``, ``opengl_cocoa`` - OpenGL rendering in Cocoa -``wayland_shm`` - Wayland client SHM rendering -``wayland_egl`` - Wayland client OpenGL/EGL rendering -``drm`` - Linux drm/kms etc. direct display - -All engines use a simple string to select the engine to render, EXCEPT -the "shot" engine. This actually encodes the output of the virtual -screenshot and how long to delay in the engine string. The engine string -is encoded in the following way:: - - "shot:[delay=XX][:][repeat=DDD][:][file=XX]" - -Where options are separated by a ``:`` char if more than one option is -given, with delay, if provided being the first option and file the last -(order is important). The delay specifies how long to wait after the -window is shown before doing the virtual "in memory" rendering and then -save the output to the file specified by the file option (and then exit). -If no delay is given, the default is 0.5 seconds. If no file is given the -default output file is "out.png". Repeat option is for continuous -capturing screenshots. Repeat range is from 1 to 999 and filename is -fixed to "out001.png" Some examples of using the shot engine:: - - ELM_ENGINE="shot:delay=1.0:repeat=5:file=elm_test.png" elementary_test - ELM_ENGINE="shot:delay=1.0:file=elm_test.png" elementary_test - ELM_ENGINE="shot:file=elm_test2.png" elementary_test - ELM_ENGINE="shot:delay=2.0" elementary_test - ELM_ENGINE="shot:" elementary_test - - -Emitted signals -=============== - -- ``delete,request``: the user requested to close the window. See - :py:attr:`~Window.autodel`. -- ``focus,in``: window got focus -- ``focus,out``: window lost focus -- ``moved``: window that holds the canvas was moved -- ``withdrawn``: window is still managed normally but removed from view -- ``iconified``: window is minimized (perhaps into an icon or taskbar) -- ``normal``: window is in a normal state (not withdrawn or iconified) -- ``stick``: window has become sticky (shows on all desktops) -- ``unstick``: window has stopped being sticky -- ``fullscreen``: window has become fullscreen -- ``unfullscreen``: window has stopped being fullscreen -- ``maximized``: window has been maximized -- ``unmaximized``: window has stopped being maximized -- ``ioerr``: there has been a low-level I/O error with the display system -- ``indicator,prop,changed``: an indicator's property has been changed -- ``rotation,changed``: window rotation has been changed -- ``profile,changed``: profile of the window has been changed -- ``focused`` - When the window has received focus. (since 1.8) -- ``unfocused`` - When the window has lost focus. (since 1.8) -- ``theme,changed`` - The theme was changed. (since 1.13) - - -Enumerations -============ - -.. _Elm_Win_Type: - -Window types ------------- - -.. data:: ELM_WIN_UNKNOWN - - Unknown window type (since 1.9) - -.. data:: ELM_WIN_BASIC - - A normal window. - - Indicates a normal, top-level window. Almost every window will be - created with this type. - -.. data:: ELM_WIN_DIALOG_BASIC - - Used for simple dialog windows - -.. data:: ELM_WIN_DESKTOP - - For special desktop windows, like a background window holding desktop icons. - -.. data:: ELM_WIN_DOCK - - The window is used as a dock or panel. - - Usually would be kept on top of any other window by the Window Manager. - -.. data:: ELM_WIN_TOOLBAR - - The window is used to hold a floating toolbar, or similar. - -.. data:: ELM_WIN_MENU - - Similar to ELM_WIN_TOOLBAR. - -.. data:: ELM_WIN_UTILITY - - A persistent utility window, like a toolbox or palette. - -.. data:: ELM_WIN_SPLASH - - Splash window for a starting up application. - -.. data:: ELM_WIN_DROPDOWN_MENU - - The window is a dropdown menu, as when an entry in a menubar is clicked. - - Typically used with :py:attr:`~Window.override`. This hint exists for - completion only, as the EFL way of implementing a menu would not - normally use a separate window for its contents. - -.. data:: ELM_WIN_POPUP_MENU - - Like ELM_WIN_DROPDOWN_MENU, but for the menu triggered by right-clicking - an object. - -.. data:: ELM_WIN_TOOLTIP - - The window is a tooltip. - - A short piece of explanatory text that typically appear after the mouse - cursor hovers over an object for a while. Typically used with - :py:attr:`~Window.override` and also not very commonly used in the EFL. - -.. data:: ELM_WIN_NOTIFICATION - - A notification window, like a warning about battery life or a new E-Mail - received. - -.. data:: ELM_WIN_COMBO - - A window holding the contents of a combo box. - - Not usually used in the EFL. - -.. data:: ELM_WIN_DND - - Used to indicate the window is a representation of an object being - dragged across different windows, or even applications. - - Typically used with :py:attr:`~Window.override`. - -.. data:: ELM_WIN_INLINED_IMAGE - - The window is rendered onto an image buffer. - - No actual window is created for this type, instead the window and all of - its contents will be rendered to an image buffer. This allows to have - children window inside a parent one just like any other object would be, - and do other things like applying Evas_Map effects to it. This is the - only type of window that requires the ``parent`` parameter - to be a valid :py:class:`efl.evas.Object`. - -.. data:: ELM_WIN_SOCKET_IMAGE - - The window is rendered onto an image buffer and can be shown other - process's plug image object. - - No actual window is created for this type, instead the window and all of - its contents will be rendered to an image buffer and can be shown other - process's plug image object - - -.. _Elm_Win_Indicator_Mode: - -Indicator states ----------------- - -.. data:: ELM_WIN_INDICATOR_UNKNOWN - - Unknown indicator state. - -.. data:: ELM_WIN_INDICATOR_HIDE - - Hides the indicator. - -.. data:: ELM_WIN_INDICATOR_SHOW - - Shows the indicator. - - -.. _Elm_Win_Indicator_Opacity_Mode: - -Indicator opacity ------------------ - -.. data:: ELM_WIN_INDICATOR_OPACITY_UNKNOWN - - Unknown indicator opacity mode. - -.. data:: ELM_WIN_INDICATOR_OPAQUE - - Opacifies the indicator. - -.. data:: ELM_WIN_INDICATOR_TRANSLUCENT - - Be translucent the indicator. - -.. data:: ELM_WIN_INDICATOR_TRANSPARENT - - Transparentizes the indicator. - - -.. _Elm_Win_Keyboard_Mode: - -Keyboard virtual keyboard modes -------------------------------- - -.. data:: ELM_WIN_KEYBOARD_UNKNOWN - - Unknown keyboard state. - -.. data:: ELM_WIN_KEYBOARD_OFF - - Request to deactivate the keyboard. - -.. data:: ELM_WIN_KEYBOARD_ON - - Enable keyboard with default layout. - -.. data:: ELM_WIN_KEYBOARD_ALPHA - - Alpha (a-z) keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_NUMERIC - - Numeric keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_PIN - - PIN keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_PHONE_NUMBER - - Phone keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_HEX - - Hexadecimal numeric keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_TERMINAL - - Full (QWERTY) keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_PASSWORD - - Password keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_IP - - IP keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_HOST - - Host keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_FILE - - File keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_URL - - URL keyboard layout. - -.. data:: ELM_WIN_KEYBOARD_KEYPAD - - Keypad layout. - -.. data:: ELM_WIN_KEYBOARD_J2ME - - J2ME keyboard layout. - - -.. _Elm_Illume_Command: - -Illume commands ---------------- - -Available commands that can be sent to the Illume manager. - -When running under an Illume session, a window may send commands to the -Illume manager to perform different actions. - -.. data:: ELM_ILLUME_COMMAND_FOCUS_BACK - - Reverts focus to the previous window - -.. data:: ELM_ILLUME_COMMAND_FOCUS_FORWARD - - Sends focus to the next window in the list - -.. data:: ELM_ILLUME_COMMAND_FOCUS_HOME - - Hides all windows to show the Home screen - -.. data:: ELM_ILLUME_COMMAND_CLOSE - - Closes the currently active window - - -Inheritance diagram -=================== - -.. inheritance-diagram:: efl.elementary.window - :parts: 2 - -""" - -from cpython cimport PyUnicode_AsUTF8String - -from efl.eo cimport _object_mapping_register, object_from_instance -from efl.utils.conversions cimport _ctouni -from efl.evas cimport Object as evasObject - -from libc.stdlib cimport free - -from object cimport Object -from efl.utils.conversions cimport python_list_strings_to_array_of_strings, \ - array_of_strings_to_python_list, python_list_ints_to_array_of_ints, \ - array_of_ints_to_python_list - - +include "window_cdef.pxi" cdef class Window(Object): """ diff --git a/efl/elementary/window.py b/efl/elementary/window.py new file mode 100644 index 0000000..04c63a0 --- /dev/null +++ b/efl/elementary/window.py @@ -0,0 +1,50 @@ +from . import Window, StandardWindow, DialogWindow + +from . import ELM_WIN_UNKNOWN +from . import ELM_WIN_BASIC +from . import ELM_WIN_DIALOG_BASIC +from . import ELM_WIN_DESKTOP +from . import ELM_WIN_DOCK +from . import ELM_WIN_TOOLBAR +from . import ELM_WIN_MENU +from . import ELM_WIN_UTILITY +from . import ELM_WIN_SPLASH +from . import ELM_WIN_DROPDOWN_MENU +from . import ELM_WIN_POPUP_MENU +from . import ELM_WIN_TOOLTIP +from . import ELM_WIN_NOTIFICATION +from . import ELM_WIN_COMBO +from . import ELM_WIN_DND +from . import ELM_WIN_INLINED_IMAGE +from . import ELM_WIN_SOCKET_IMAGE + +from . import ELM_WIN_INDICATOR_UNKNOWN +from . import ELM_WIN_INDICATOR_HIDE +from . import ELM_WIN_INDICATOR_SHOW + +from . import ELM_WIN_INDICATOR_OPACITY_UNKNOWN +from . import ELM_WIN_INDICATOR_OPAQUE +from . import ELM_WIN_INDICATOR_TRANSLUCENT +from . import ELM_WIN_INDICATOR_TRANSPARENT + +from . import ELM_WIN_KEYBOARD_UNKNOWN +from . import ELM_WIN_KEYBOARD_OFF +from . import ELM_WIN_KEYBOARD_ON +from . import ELM_WIN_KEYBOARD_ALPHA +from . import ELM_WIN_KEYBOARD_NUMERIC +from . import ELM_WIN_KEYBOARD_PIN +from . import ELM_WIN_KEYBOARD_PHONE_NUMBER +from . import ELM_WIN_KEYBOARD_HEX +from . import ELM_WIN_KEYBOARD_TERMINAL +from . import ELM_WIN_KEYBOARD_PASSWORD +from . import ELM_WIN_KEYBOARD_IP +from . import ELM_WIN_KEYBOARD_HOST +from . import ELM_WIN_KEYBOARD_FILE +from . import ELM_WIN_KEYBOARD_URL +from . import ELM_WIN_KEYBOARD_KEYPAD +from . import ELM_WIN_KEYBOARD_J2ME + +from . import ELM_ILLUME_COMMAND_FOCUS_BACK +from . import ELM_ILLUME_COMMAND_FOCUS_FORWARD +from . import ELM_ILLUME_COMMAND_FOCUS_HOME +from . import ELM_ILLUME_COMMAND_CLOSE diff --git a/efl/elementary/window.pxd b/efl/elementary/window_cdef.pxi similarity index 99% rename from efl/elementary/window.pxd rename to efl/elementary/window_cdef.pxi index 5747189..bc9caee 100644 --- a/efl/elementary/window.pxd +++ b/efl/elementary/window_cdef.pxi @@ -1,6 +1,3 @@ -from efl.evas cimport Eina_Bool, Evas_Object - - cdef extern from "Elementary.h": cpdef enum Elm_Win_Type: diff --git a/include/efl.elementary.pxd b/include/efl.elementary.pxd new file mode 100644 index 0000000..57980b2 --- /dev/null +++ b/include/efl.elementary.pxd @@ -0,0 +1,20 @@ +# Copyright (C) 2007-2015 various contributors (see AUTHORS) +# +# This file is part of Python-EFL. +# +# Python-EFL 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-EFL 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-EFL. If not, see . +# + + +cdef int PY_EFL_ELM_LOG_DOMAIN diff --git a/setup.py b/setup.py index 9aaa607..9c7a3ca 100755 --- a/setup.py +++ b/setup.py @@ -381,93 +381,17 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv): ext_modules.append(dbus_ml_ext) # === Elementary === - elm_mods = ( - #"access", - "actionslider", - "background", - "box", - "bubble", - "button", - "calendar_elm", - "check", - "clock", - "colorselector", - "configuration", - "conformant", - "ctxpopup", - "datetime_elm", - "dayselector", - "diskselector", - "entry", - "fileselector_button", - "fileselector_entry", - "fileselector", - "flip", - "flipselector", - "frame", - "general", - "gengrid", - "genlist", - "gesture_layer", - #"glview", - "grid", - "hover", - "hoversel", - "icon", - "image", - "index", - "innerwindow", - "label", - "layout_class", - "layout", - "list", - "mapbuf", - "map", - "menu", - "multibuttonentry", - "naviframe", - "need", - "notify", - "object_item", - "object", - "panel", - "panes", - "photocam", - "photo", - "plug", - "popup", - "progressbar", - "radio", - "scroller", - "segment_control", - "separator", - "slider", - "slideshow", - "spinner", - #"store", - "systray", - "table", - "theme", - "thumb", - "toolbar", - "transit", - "video", - "web", - "window", - ) - elm_cflags, elm_libs = pkg_config('Elementary', 'elementary', ELM_MIN_VER) - for m in elm_mods: - e = Extension("elementary." + m, - ["efl/elementary/" + m + module_suffix], - define_macros=[ - ('EFL_BETA_API_SUPPORT', 1), - ('EFL_EO_API_SUPPORT', 1) - ], - include_dirs=["include/"], - extra_compile_args=elm_cflags, - extra_link_args=elm_libs + eina_libs + eo_libs + evas_libs) - ext_modules.append(e) + e = Extension("elementary.__init__", + ["efl/elementary/__init__" + module_suffix], + define_macros=[ + ('EFL_BETA_API_SUPPORT', 1), + ('EFL_EO_API_SUPPORT', 1) + ], + include_dirs=["include/"], + extra_compile_args=elm_cflags, + extra_link_args=elm_libs + eina_libs + eo_libs + evas_libs) + ext_modules.append(e) packages.append("efl.elementary")