Compare commits
293 Commits
python-efl
...
master
Author | SHA1 | Date |
---|---|---|
|
c8d7bddb47 | |
|
4bb6d9fa9f | |
|
0b089a5623 | |
|
a7464e66e6 | |
|
d1b4512e52 | |
|
9896656574 | |
|
fb649f30e7 | |
|
f0ab762e16 | |
|
4548c5a01b | |
|
cadc757e7e | |
|
ed959b59af | |
|
ec2b95ceab | |
|
dcf362b03f | |
|
d420f60e0d | |
|
0848286409 | |
|
3ca71a067e | |
|
9dce9ccad4 | |
|
7141f21f0b | |
|
fabcef1278 | |
|
a0a6d756b5 | |
|
e467b3e871 | |
|
69cfc2c7fc | |
|
f70d7c949f | |
|
838d4b38c5 | |
|
b821107688 | |
|
e7545e3185 | |
|
5ac4f71131 | |
|
7e4116335a | |
|
26e2b89a9d | |
|
2d0668c548 | |
|
a83da00bc7 | |
|
31a147fc7c | |
|
1f441a18c8 | |
|
d7275844f1 | |
|
f3c99eeafa | |
|
3dfacc01ab | |
|
22274ae81d | |
|
25ed1cc567 | |
|
22203c0838 | |
|
0253f9e178 | |
|
55e9e51f69 | |
|
5a81c2c944 | |
|
5a02f13210 | |
|
22cc200a61 | |
|
09e016bdbd | |
|
bd81c36cd0 | |
|
81c48dd2d9 | |
|
b9117cb590 | |
|
32aec52918 | |
|
a7e86793c3 | |
|
a1eeae15f8 | |
|
9ba5210a6a | |
|
d61c596278 | |
|
e2ce1b49a3 | |
|
8ff30f9edd | |
|
d544412cd1 | |
|
3b0552259d | |
|
4fa39916ee | |
|
42ee207c16 | |
|
c9f5b53e28 | |
|
8cc259ca26 | |
|
d25784cca8 | |
|
7c555cc9da | |
|
3e198f7294 | |
|
b855a82160 | |
|
583f42b131 | |
|
2991a6683e | |
|
fb9b06931e | |
|
48d9c26945 | |
|
4721842b1e | |
|
6aa3501136 | |
|
18ca98e66f | |
|
006052543f | |
|
30c9c60b5d | |
|
26607a0986 | |
|
ffc3c337dc | |
|
4b8ddcff7d | |
|
00d92cbebe | |
|
f81fc890bb | |
|
28c9775898 | |
|
344da31ceb | |
|
bc9d5648e7 | |
|
58ab1d26f7 | |
|
fe144b8f96 | |
|
efcebb52bf | |
|
7d3799d7fa | |
|
85e23f2851 | |
|
c5759b6d67 | |
|
5bbaba2a6e | |
|
74ed9e86a4 | |
|
3ef64e685c | |
|
6e2b444712 | |
|
7d8049b0c5 | |
|
741000d423 | |
|
fecc0c2604 | |
|
9d5efd8aef | |
|
25f620ef19 | |
|
6e80968778 | |
|
64584362b7 | |
|
8ad73b3e69 | |
|
5b9ba62e8f | |
|
26a4c38d67 | |
|
15b29e3ce8 | |
|
6bd7daa883 | |
|
5864a9dd2d | |
|
a475ecba44 | |
|
eace418f9b | |
|
bb2a45f013 | |
|
8c7ad9f31f | |
|
d9f06e72a2 | |
|
df221788f0 | |
|
6a7e698368 | |
|
4557daa602 | |
|
a70c42e681 | |
|
d87e0a5484 | |
|
89bb6a1998 | |
|
b06c3151f7 | |
|
add166fb62 | |
|
7aec398ede | |
|
da9258f474 | |
|
9c00cbb0fe | |
|
18e2d9c102 | |
|
71354b3bb8 | |
|
a293b4e124 | |
|
e3224c882a | |
|
dccd0ed62f | |
|
9231e530bf | |
|
6f92607ba4 | |
|
f76e272990 | |
|
3e0dbeb7f7 | |
|
98b7b2408f | |
|
ac7013064f | |
|
f2f8906968 | |
|
032750af77 | |
|
16fa850f24 | |
|
0b03f8b2f3 | |
|
810623dbe4 | |
|
01220931fc | |
|
924f291660 | |
|
2e5e96a8dd | |
|
ea4bc8790d | |
|
9e25d34920 | |
|
953f468229 | |
|
f872e7b8c6 | |
|
e0d892ecaa | |
|
cb062511b2 | |
|
fa5b944f31 | |
|
99c618fc2b | |
|
1a2b8e64f8 | |
|
6ad9bb3521 | |
|
0217da6c1f | |
|
f7e96cf0af | |
|
58cfedf5af | |
|
818e7db2e6 | |
|
6fa2d3ff95 | |
|
212eca4321 | |
|
cca359974a | |
|
f652b6e18f | |
|
fdab8ed5b6 | |
|
b2af779d7d | |
|
4bd421562d | |
|
d6fc38ea59 | |
|
380e7a58ff | |
|
939cd71702 | |
|
0ef56b3a58 | |
|
c955d488f9 | |
|
a575effa6b | |
|
3d31901da7 | |
|
79979d9d2d | |
|
a8c1486aad | |
|
54adcd9970 | |
|
96ae57ed6a | |
|
eaa09b6b16 | |
|
6ff9589e83 | |
|
222f32eaf2 | |
|
5258779d41 | |
|
5342d77d60 | |
|
7066070992 | |
|
cfb967333d | |
|
78d90dd467 | |
|
30c2ce90c3 | |
|
55039295f2 | |
|
ad2ead12f7 | |
|
ecd93319ee | |
|
187ca5249b | |
|
a1bef554e0 | |
|
23c6ffc8cf | |
|
71946bffb3 | |
|
bc411cd774 | |
|
aeeee73fda | |
|
9fb954433e | |
|
4e57019e1e | |
|
f59e7c0c18 | |
|
e47f403a0b | |
|
2f1aff95c5 | |
|
01d334b5f6 | |
|
105743d304 | |
|
c11a7cf227 | |
|
99113cd990 | |
|
9381d46765 | |
|
83656bff33 | |
|
48eec126bb | |
|
b37c970587 | |
|
5a3c19b521 | |
|
02f7eb07dd | |
|
4a0310140a | |
|
d87b3bb9d0 | |
|
a19f0ad434 | |
|
11d23a94f1 | |
|
f287a1f98c | |
|
ffb294b82f | |
|
78c9fe21af | |
|
13ea0cbe1d | |
|
f86234dd25 | |
|
fbabb111d8 | |
|
283efd1a28 | |
|
12217e9c2a | |
|
bc8bac1f1a | |
|
0916eae9ff | |
|
d6bad7a838 | |
|
2ebc0dcf74 | |
|
e2edab7b1c | |
|
11c7d38a56 | |
|
9b5b526620 | |
|
8f23c26d89 | |
|
5680c76a49 | |
|
082456600a | |
|
be3069b280 | |
|
36ca39e015 | |
|
243664d738 | |
|
e0456df2a2 | |
|
51946aaf8b | |
|
cadf409404 | |
|
7fd0f973ca | |
|
c2c09d4dc9 | |
|
bae6125061 | |
|
5bbbed95c0 | |
|
eca2dfaa0b | |
|
aba5250634 | |
|
41c1779e81 | |
|
77d023dfe1 | |
|
05c19962dc | |
|
fea03a787c | |
|
b6f729dc3a | |
|
6668176720 | |
|
9a3d441f1c | |
|
d5656fdd3d | |
|
ba7bf818d8 | |
|
1189e17fe0 | |
|
fc987411da | |
|
523fe8ad4d | |
|
3661a78c96 | |
|
caef23bb34 | |
|
684ad779dc | |
|
625500bffc | |
|
0ecf04eba9 | |
|
11d3007f02 | |
|
cab804e69b | |
|
190d0aa7b6 | |
|
24318c8d33 | |
|
6980ffb0e4 | |
|
fa69908d71 | |
|
86aa8c5138 | |
|
9809eb2739 | |
|
4f8dfc195f | |
|
078d440e05 | |
|
e087d0d918 | |
|
920a8891e6 | |
|
f03f83fba9 | |
|
926c325de8 | |
|
005dd26f73 | |
|
90595ffdca | |
|
fc68b43317 | |
|
458121f6be | |
|
f3e6315413 | |
|
592467c7bd | |
|
1599140196 | |
|
0021e4a186 | |
|
17df9e69aa | |
|
93d2c01002 | |
|
e963e6d061 | |
|
8af35d3f56 | |
|
8f2baa86b5 | |
|
6c16e2f746 | |
|
16f7cb1a24 | |
|
06cb7ad598 | |
|
75fa5ff256 | |
|
5d73c59088 | |
|
453c2a123c | |
|
8e7616c1b3 | |
|
76e94bcbf8 | |
|
eaf3110089 | |
|
f01ac0788e |
|
@ -28,4 +28,9 @@ pip-log.txt
|
|||
# Cython generated files
|
||||
efl/*/*.c
|
||||
efl/*/*.h
|
||||
!efl/dbus_mainloop/e_dbus.*
|
||||
efl/*/*.html
|
||||
|
||||
# Various editors trash
|
||||
.idea/
|
||||
.vscode/
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
[MESSAGES CONTROL]
|
||||
|
||||
#enable=
|
||||
|
||||
disable=consider-using-f-string, # for older python we still support
|
||||
redundant-u-string-prefix, # for older python we still support
|
||||
invalid-name, # seems too pedantic to me
|
||||
missing-function-docstring,
|
||||
missing-class-docstring,
|
||||
missing-module-docstring,
|
119
CODING
119
CODING
|
@ -1,3 +1,28 @@
|
|||
TODO
|
||||
====
|
||||
* Automatically build and publish binary wheels on pypi
|
||||
- for py: 36,37,38,39,310
|
||||
- for linux x86 and rpi
|
||||
- see https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
|
||||
- see https://github.com/pypa/manylinux
|
||||
- also include efl itsef in the wheels? PySide is doing this
|
||||
|
||||
* Drop python 2 compatibility
|
||||
- Switch to cython3
|
||||
- remove all the workarounds for py2 (see strings and enums)
|
||||
|
||||
* Improved editors support, at least on VSCode and PyCharm
|
||||
|
||||
* Try to implement better the elementary module, removing
|
||||
the __init__ module hack (that create problems in the docs)
|
||||
|
||||
* Make the examples a first citizen!
|
||||
- install them with python efl
|
||||
- make them easily runnable
|
||||
- show them in the docs
|
||||
- show the code inside the examples themself?
|
||||
- make the code editable on the fly?
|
||||
|
||||
|
||||
Style
|
||||
=====
|
||||
|
@ -32,6 +57,7 @@ Documentation cheatsheet
|
|||
:func:`elm_list_go` (for functions)
|
||||
:attr:`homogeneous` (for properties)
|
||||
:ref:`Elm_List_Mode` (for enums)
|
||||
:data:`ELM_LIST_LIMIT` (for enum values)
|
||||
|
||||
:func:`efl.evas.Object.delete` (for items not in current scope)
|
||||
:func:`~efl.evas.Object.delete` (will show it short, just "delete")
|
||||
|
@ -97,65 +123,54 @@ Tips
|
|||
Release process instructions
|
||||
============================
|
||||
|
||||
* Announce at enlightenment-release@lists.sourceforge.net and
|
||||
enlightenment-devel@lists.sourceforge.net that you are planning for the release
|
||||
* Change versions in efl/__init__.py (ex: 1.9.0)
|
||||
* use "api_coverage.py --python elementary" to see the missing bindings
|
||||
|
||||
* Version:
|
||||
- change versions in efl/__init__.py (ex: 1.9.0)
|
||||
- update EFL_MIN_VER in setup.py (if needed)
|
||||
|
||||
* Update the ChangeLog file:
|
||||
setup.py build_doc -b changes ...and manually merge from the html file
|
||||
* Git push and wait jenkins to generate the 2 tarballs
|
||||
* Test the generated tarballs
|
||||
* scp tarballs & md5sums to:
|
||||
download.enlightenment.org:/srv/web/download.enlightenment.org/public_html/pre-releases/
|
||||
* Announce at enlightenment-release@lists.sourceforge.net and
|
||||
enlightenment-devel@lists.sourceforge.net that tarballs are ready for testing
|
||||
- setup.py build_doc -b changes ...and manually merge from the html file
|
||||
|
||||
... wait 24 hours, fix any issues found. In the mean time you can prepare the
|
||||
release announcement for phame/ml.
|
||||
* Generate the source (tar) and binary (wheel) distributions:
|
||||
- make maintainer-clean (just to be sure nothing is cached)
|
||||
- make dist
|
||||
|
||||
* Test the generated tarball and wheel:
|
||||
- the targz must work by extracting and running: python setup.py install [--user]
|
||||
- the targz must be installable using: pip install python-efl-1.9.0.tar.gz
|
||||
- the wheel must be installable using: pip install python_efl-1.9.0-xxxx.whl
|
||||
|
||||
* Publish the 2 tar archive on e.org:
|
||||
- scp tarballs & md5sums to:
|
||||
download.enlightenment.org:/srv/web/download.enlightenment.org/rel/bindings/python/
|
||||
- update download link on the wiki (www.enlightenment.org/download)
|
||||
|
||||
* Publish the .tar.gz archive on pypi:
|
||||
- twine upload python-efl-1.9.0.tar.gz [--repository testpypy]
|
||||
- TODO: also upload binary wheels for linux py36,37,38,39,310 (see manylinux on pypa)
|
||||
|
||||
* Documentation:
|
||||
- make doc (check that inheritance graphs are there)
|
||||
- scp the generated html documentation to:
|
||||
download.enlightenment.org:/srv/web/docs.enlightenment.org/python-efl/1.9.0/
|
||||
- update the 'current' link on the server (ssh)
|
||||
|
||||
* ssh to download.enlightenment.org and mv tarballs & md5sums to:
|
||||
/srv/web/download.enlightenment.org/public_html/rel/bindings/python/
|
||||
* Upload the .tar.gz archive to pypi:
|
||||
- first upload the PKG-INFO file from the "edit" section on pypi
|
||||
- then upload the tarball from the "files" section
|
||||
* Create and push the tag for the release
|
||||
git tag -a v1.9.0 && git push origin v1.9.0
|
||||
- git tag -a v1.9.0 && git push origin v1.9.0
|
||||
|
||||
* Create and push the branch for stable backporting
|
||||
git branch python-efl-1.9 && git push origin python-efl-1.9
|
||||
* scp the generated html documentation to:
|
||||
download.enlightenment.org:/srv/web/docs.enlightenment.org/public_html/python-efl/1.XX.0/
|
||||
and update the 'current' link on the server (ssh)
|
||||
* Update download and docs link on the website wiki
|
||||
* Publish the blog post on phame (Official Announcements)
|
||||
* Announce the release to release@lists.enlightenment.org
|
||||
|
||||
* Announce the release to release@lists.enlightenment.org and
|
||||
enlightenment-release@lists.sourceforge.net
|
||||
|
||||
* Change versions again in efl/__init__.py (ex: 1.9.99)
|
||||
|
||||
more info at:
|
||||
phab.enlightenment.org/w/release_procedure/
|
||||
for more info:
|
||||
--------------
|
||||
* packaging.python.org
|
||||
* phab.enlightenment.org/w/release_procedure/
|
||||
* phab.enlightenment.org/w/hosting/ssh/
|
||||
|
||||
|
||||
Discussion
|
||||
==========
|
||||
|
||||
* Internal utility functions used in the bindings must start with an
|
||||
underscore and must have the shortest name as possible.
|
||||
^
|
||||
This needs further discussion/expansion.
|
||||
|
||||
When we define a function with cdef it is not exposed to Python API.
|
||||
This should be explicit enough to not need the underscore prefix, which
|
||||
at best looks ugly, and at worst just plain confusing.
|
||||
|
||||
A function name should summarize its functionality in one clear text,
|
||||
short sentence. We have both too long and too short names. And I admit to
|
||||
being guilty of adding many of both.
|
||||
|
||||
Let's build up a short review so we can see where we stand with this and
|
||||
make necessary corrections.
|
||||
|
||||
/ kuuko
|
||||
|
||||
|
||||
The underscore usage is a coding standard in all the EFL, we should try
|
||||
to follow the efl style also here (where is possible and make sense)
|
||||
|
||||
/ davemds
|
||||
|
|
243
ChangeLog
243
ChangeLog
|
@ -1,3 +1,246 @@
|
|||
===================
|
||||
2023-10-08 v1.26.1
|
||||
===================
|
||||
|
||||
Maintenance release:
|
||||
* rebuilt using Cython 0.29.34 to fix install on python 3.11
|
||||
|
||||
|
||||
===================
|
||||
2022-02-27 v1.26.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to setuptools for the build system (can now install from pip again)
|
||||
* Dropped py2.6 support, minimum is now 2.7
|
||||
* Deprecated python2 support, with a big-fat-slow warning
|
||||
* Improved documentation
|
||||
|
||||
Fixes:
|
||||
* Fixed a memory allocation error in EvasSmart
|
||||
|
||||
|
||||
===================
|
||||
2020-09-24 v1.25.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.21 for the tarball generation
|
||||
|
||||
|
||||
===================
|
||||
2020-04-30 v1.24.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.16 for the tarball generation
|
||||
* No more pypi packages uploaded, you must install from tarball
|
||||
|
||||
|
||||
===================
|
||||
2019-10-06 v1.23.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.13 for the tarball generation
|
||||
|
||||
|
||||
===================
|
||||
2019-04-23 v1.22.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.7 for the tarball generation
|
||||
|
||||
|
||||
===================
|
||||
2018-08-24 v1.21.0
|
||||
===================
|
||||
|
||||
BREAKS:
|
||||
* systray.pxi do not work anymore as the widget has been removed from efl.
|
||||
The widget has been completly removed and the function elm_need_systray
|
||||
now always return False that means systray is not available.
|
||||
Apologies for the inconvenient.
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.28.4 for the tarball generation, should fix build
|
||||
issues with python3.7
|
||||
|
||||
Additions:
|
||||
* ecore.ECORE_EXE_ISOLATE_IO
|
||||
* edje.part_text_prediction_hint_hash_del
|
||||
* edje.part_text_prediction_hint_hash_set
|
||||
* elm.Entry.prediction_hint_hash_del
|
||||
* elm.Entry.prediction_hint_hash_set
|
||||
* elm.Ctxpopup.item_insert_after
|
||||
* elm.Ctxpopup.item_insert_before
|
||||
|
||||
|
||||
===================
|
||||
2017-05-06 v1.20.0
|
||||
===================
|
||||
|
||||
Fixes:
|
||||
* ecore.input and ecore.x can now coexsist
|
||||
|
||||
Changes:
|
||||
* ecore.Poller is no more an Eo object in C (nothing should be changed in py)
|
||||
* removed edje.Object custom __repr__ implementation
|
||||
* Use Cython 23.5 to generate the C source in dist tarball (see T5589)
|
||||
|
||||
Additions:
|
||||
* elm.Entry.prediction_hint
|
||||
* elm.Genlist.multi_select_mode
|
||||
* elm.Menu.open()
|
||||
* elm.Spinner.callback_max_reached_add()
|
||||
* elm.Spinner.callback_max_reached_del()
|
||||
* edje.part_text_prediction_hint_set()
|
||||
* evas.Map.coords_get()
|
||||
|
||||
|
||||
===================
|
||||
2017-04-18 v1.19.0
|
||||
===================
|
||||
|
||||
Fixes:
|
||||
* Fixes for cython 0.25 compatibility
|
||||
* elm.font_properties_get
|
||||
* elm.Gengrid.item_insert_after now work as expected
|
||||
|
||||
Changes:
|
||||
* Removed ecore warning about subprocess incompatibility, with test to prove it
|
||||
* Emotion: changed default module_name to "gstreamer1"
|
||||
* elm.font_properties_free: Changed to no-op as we now do the free
|
||||
automatically when there are no more references to the FontProperties object
|
||||
* elm.Panel.scrollable_content_size is now also readable
|
||||
* EcoreConUrl is no more an Eo object in C
|
||||
|
||||
Additions:
|
||||
* evas.Image.load_head_skip
|
||||
* elm.ELM_INPUT_PANEL_LAYOUT_VOICE
|
||||
* elm.ELM_CALENDAR_REVERSE_DAILY
|
||||
* elm.Calendar.date_max
|
||||
* elm.Calendar.date_min
|
||||
* elm.GengridItem.custom_size
|
||||
* elm.Image.async_open
|
||||
* elm.Image.callback_load_cancel_add
|
||||
* elm.Image.callback_load_error_add
|
||||
* elm.Image.callback_load_open_add
|
||||
* elm.Image.callback_load_ready_add
|
||||
* elm.Naviframe.callback_item_activated_add
|
||||
* elm.Panel.callback_toggled_add
|
||||
* elm.Progressbar.is_pulsing
|
||||
* elm.Spinner.callback_drag_start_add
|
||||
* elm.Spinner.callback_drag_stop_add
|
||||
|
||||
|
||||
===================
|
||||
2016-08-22 v1.18.0
|
||||
===================
|
||||
|
||||
Fixes:
|
||||
* Fixed (workaround) dbus crash on python >= 3.5
|
||||
* Fixed Logger module to not fail on unicode error messages
|
||||
|
||||
Changes:
|
||||
* Changed enums implementation to gain compatibility with Cython > 0.22
|
||||
* Docs: Allow to skip last_updated and sphinx_version
|
||||
* elm.Combobox: The combobox widget has been deprecated.
|
||||
* elm.Photo.editable property is now also readable
|
||||
* elm.Photo.fill_inside property is now also readable
|
||||
* elm.Photo.size property is now also readable
|
||||
|
||||
Additions:
|
||||
* ecore.Exe.is_deleted
|
||||
* ecore.FdHandler.is_deleted
|
||||
* edje.Edje.part_box_insert_after
|
||||
* elm.Configuration.accel_preference_override
|
||||
* elm.Configuration.first_item_focus_on_first_focusin
|
||||
* elm.Configuration.font_hint_type
|
||||
* elm.Configuration.icon_theme
|
||||
* elm.Configuration.popup_scrollable
|
||||
* elm.Configuration.scroll_accel_factor
|
||||
* elm.Configuration.scroll_animation_disabled
|
||||
* elm.Configuration.vsync
|
||||
* elm.Configuration.web_backend
|
||||
* elm.Entry.file_text_format
|
||||
* elm.Entry.select_allow
|
||||
* elm.Entry.select_region
|
||||
* elm.GengridItem.all_contents_unset
|
||||
* elm.Genlist.filtered_items_count
|
||||
* elm.GenlistItem.all_contents_unset
|
||||
* elm.List.multi_select_mode (and the Elm_Object_Multi_Select_Mode enum)
|
||||
* elm.Object.focus_move_policy_automatic
|
||||
* elm.Popup.align
|
||||
* elm.Popup.scrollable
|
||||
* elm.Slider.range
|
||||
* elm.Slider.range_enabled
|
||||
* elm.Slider.indicator_show_on_focus
|
||||
* elm.Transit.revert
|
||||
* elm.Window.noblank
|
||||
|
||||
|
||||
==================
|
||||
2016-01-7 v1.17.0
|
||||
==================
|
||||
|
||||
Fixes:
|
||||
* Fixed compatibility with python 3.5 (utils.deprecated was broken)
|
||||
* Various ref leaks fixed in elementary
|
||||
* Multibuttonentry filter callback
|
||||
|
||||
Additions:
|
||||
* ecore_input Module
|
||||
* ecore_con Module
|
||||
* ecore_con.Url Class
|
||||
* ecore_con.Lookup Class
|
||||
* evas.Object.paragraph_direction
|
||||
* evas.EVAS_BIDI_DIRECTION_INHERIT
|
||||
* edje.Edje.color_class_clear
|
||||
* edje.Edje.size_class_del
|
||||
* edje.Edje.size_class_get
|
||||
* edje.Edje.size_class_set
|
||||
* edje.Edje.text_class_del
|
||||
* edje.size_class_del
|
||||
* edje.size_class_get
|
||||
* edje.size_class_list
|
||||
* edje.size_class_set
|
||||
* ethumb Module
|
||||
* ethumb.Ethumb Class
|
||||
* ethumb_client Module
|
||||
* ethumb_client.EthumbClient Class
|
||||
* elm.Combobox Class
|
||||
* elm.Configuration.context_menu_disabled
|
||||
* elm.Configuration.profile_derived_add
|
||||
* elm.Configuration.profile_derived_del
|
||||
* elm.Configuration.profile_exists
|
||||
* elm.Configuration.profile_list_full
|
||||
* elm.Configuration.profile_save
|
||||
* elm.Ctxpopup.callback_geometry_update_add
|
||||
* elm.ELM_GENGRID_ITEM_SCROLLTO_BOTTOM
|
||||
* elm.Gengrid.drag_item_container_add
|
||||
* elm.Gengrid.drag_item_container_del
|
||||
* elm.Gengrid.drop_item_container_add
|
||||
* elm.Gengrid.drop_item_container_del
|
||||
* elm.ELM_GENLIST_ITEM_SCROLLTO_BOTTTOM
|
||||
* elm.Genlist.callback_filter_done_add
|
||||
* elm.Genlist.drag_item_container_add
|
||||
* elm.Genlist.drag_item_container_del
|
||||
* elm.Genlist.drop_item_container_add
|
||||
* elm.Genlist.drop_item_container_del
|
||||
* elm.Genlist.filter
|
||||
* elm.MultiButtonEntry.filter_remove
|
||||
* elm.Notify.callback_dismissed_add
|
||||
* elm.Notify.dismiss
|
||||
* elm.Object.callback_moved_add
|
||||
* elm.Object.drag_action_set
|
||||
* elm.Object.drag_start
|
||||
* elm.Object.drop_target_add
|
||||
* elm.Object.drop_target_del
|
||||
* elm.Popup.callback_dismissed_add
|
||||
* elm.Popup.dismiss
|
||||
|
||||
|
||||
===================
|
||||
2015-11-14 v1.16.0
|
||||
|
|
18
INSTALL
18
INSTALL
|
@ -3,22 +3,19 @@
|
|||
===============
|
||||
|
||||
* Python 2.6 or higher, 3.2 or higher (http://www.python.org/)
|
||||
- Tested with Python 2.7 / 3.3 / 3.4
|
||||
- Tested with Python 3.8
|
||||
|
||||
* Cython 0.21 or higher (http://cython.org/)
|
||||
- Tested with Cython 0.21.2
|
||||
- Tested with Cython 0.29.16
|
||||
|
||||
* EFL core library
|
||||
- eo, evas, ecore, edje, emotion and elementary
|
||||
|
||||
* pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config)
|
||||
- Windows executable (and GLib dependency) can be downloaded from
|
||||
http://www.gtk.org/download/win32.php
|
||||
* EFL must be the same minor version of the bindings,
|
||||
es. python-efl 1.24 need efl 1.24
|
||||
|
||||
* To build the DOCS you will also need:
|
||||
- python-sphinx
|
||||
- [optional] graphviz
|
||||
|
||||
* At least 4GB of free RAM to build
|
||||
|
||||
|
||||
2. BUILDING PYTHON-EFL
|
||||
|
@ -29,6 +26,11 @@
|
|||
|
||||
python setup.py build
|
||||
|
||||
IMPORTANT NOTE:
|
||||
To build the bindings you will need at least 4GB of free ram!
|
||||
Otherwise the build process will badly fail.
|
||||
|
||||
|
||||
Distribution tarballs include pre-generated C source files, so
|
||||
cython usage is disabled by default, while is enabled in development git
|
||||
versions. You can always force the usage of cython using two environment
|
||||
|
|
25
Makefile
25
Makefile
|
@ -16,7 +16,7 @@
|
|||
#
|
||||
|
||||
|
||||
PY = python
|
||||
PY = python3
|
||||
|
||||
|
||||
.PHONY: build
|
||||
|
@ -29,6 +29,11 @@ install:
|
|||
$(PY) setup.py install
|
||||
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
$(PY) setup.py uninstall
|
||||
|
||||
|
||||
.PHONY: doc
|
||||
doc:
|
||||
$(PY) setup.py build build_doc
|
||||
|
@ -44,12 +49,20 @@ clean:
|
|||
$(PY) setup.py clean --all
|
||||
|
||||
|
||||
.PHONY: maintaner-clean
|
||||
maintaner-clean:
|
||||
.PHONY: maintainer-clean
|
||||
maintainer-clean:
|
||||
$(PY) setup.py clean --all clean_generated_files
|
||||
rm -rf build/
|
||||
rm -rf dist/
|
||||
rm -rf python_efl.egg-info/
|
||||
rm -f installed_files-*.txt
|
||||
|
||||
|
||||
.PHONY: dist
|
||||
dist:
|
||||
$(PY) setup.py sdist --formats=gztar,bztar
|
||||
|
||||
|
||||
$(PY) setup.py sdist --formats=gztar,xztar
|
||||
$(PY) setup.py bdist_wheel
|
||||
@cd dist/; for f in `ls *.tar.*` ; do \
|
||||
echo Generating sha256 for: $$f ; \
|
||||
sha256sum $$f > $$f.sha256; \
|
||||
done
|
||||
|
|
7
README
7
README
|
@ -1,7 +0,0 @@
|
|||
|
||||
EFL is a collection of libraries for handling many common tasks a
|
||||
developer man have such as data structures, communication, rendering,
|
||||
widgets and more.
|
||||
|
||||
PYTHON-EFL are the python bindings for the whole EFL stack (eo, evas, ecore,
|
||||
edje, emotion, ethumb and elementary)
|
|
@ -0,0 +1,92 @@
|
|||
# Python bindings for the EFL
|
||||
|
||||
EFL, or the *Enlightenment Foundation Libraries*, is a collection of libraries for handling many common tasks such as data structures, communication, rendering, widgets and more. Read more on the [efl web site](https://www.enlightenment.org/about-efl).
|
||||
|
||||
Python-EFL are the python bindings for the whole EFL stack (evas, ecore, edje, emotion, ethumb and elementary). You can use Python-EFL to build a portable GUI application in minutes.
|
||||
|
||||
The documentation for Python-EFL is available [here](https://docs.enlightenment.org/python-efl/current/).
|
||||
|
||||
## Install from pypi
|
||||
|
||||
The last stable release is always available on pypi, and pip is the raccomanded way to install Python-EFL:
|
||||
```
|
||||
pip install python-efl
|
||||
```
|
||||
The only requirement is to have the EFL already installed on your machine, see [here](https://www.enlightenment.org/docs/distros/start) for install instructions for various linux distro or for building EFL from sources.
|
||||
|
||||
NOTE: Currently only sources packages are available on pip, this means that the installation will be quite long as it need to compile all the modules, and that you need a C compiler for installation to work (we highly suggest to use clang as your C compiler). For the next release we have plans to also upload binary packages on pypi, so the installation will be blazing fast and will have zero dependencies!
|
||||
|
||||
|
||||
## Install from released tarballs
|
||||
|
||||
All the stable releases of python-efl can always be found at:
|
||||
https://download.enlightenment.org/rel/bindings/python/
|
||||
|
||||
To install download and unpack a tarball and run:
|
||||
```
|
||||
python setup.py build
|
||||
python setup.py install --user
|
||||
or
|
||||
sudo python setup.py install (for sistem-wide installation)
|
||||
```
|
||||
|
||||
NOTE: due to strange cython+gcc behaviour we highly suggest to build python-efl using clang. If you experience issues using gcc (like memory exhausted or strange compile errors) just use clang in this way:
|
||||
|
||||
```
|
||||
CC=clang python setup.py build
|
||||
```
|
||||
|
||||
## Source repository
|
||||
|
||||
If you would like to contribute to Python-EFL and make changes to the Python-EFL code you need to build from **git**. Development take place in the **master** branch, while we backport bugfixes in the release branches. You will find a branch for each released version, branches are named as **python-efl-X.X**.
|
||||
|
||||
To build from git you also need to have [Cython](https://cython.org/) installed.
|
||||
|
||||
### Main repository
|
||||
https://git.enlightenment.org/bindings/python/python-efl.git/
|
||||
|
||||
### GitHub repository
|
||||
https://github.com/DaveMDS/python-efl
|
||||
|
||||
The GitHub repo has been created to simplify the workflow for people that do
|
||||
not have a git account in the E repo, and thus improving collaboration.
|
||||
Feel free to make pull requests on GitHub.
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for the last stable release can be found [here](https://docs.enlightenment.org/python-efl/current/).
|
||||
Additionally you can generate the documentation yourself from the source code using the following command:
|
||||
```
|
||||
python setup.py build build_doc
|
||||
```
|
||||
The HTML generated documentation will be available in the folder: `build/sphinx/html/`
|
||||
|
||||
## Some of the projects using Python-EFL (in random order)
|
||||
|
||||
| **Project** | **Website** |
|
||||
|-------------------------------------|------------------------------------------------------|
|
||||
| **EpyMC** - Media Center | https://github.com/DaveMDS/epymc |
|
||||
| **Espionage** - D-Bus inspector | https://phab.enlightenment.org/w/projects/espionage/ |
|
||||
| **Epour** - BitTorrent Client | https://phab.enlightenment.org/w/projects/epour/ |
|
||||
| **Eluminance** - Fast photo browser | https://github.com/DaveMDS/eluminance |
|
||||
| **Egitu** - Git User Interface | https://github.com/DaveMDS/egitu |
|
||||
| **Edone** - GettingThingsDone | https://github.com/DaveMDS/edone |
|
||||
| **Epack** - Archive extractor | https://github.com/wfx/epack |
|
||||
|
||||
... and many more that cannot fit in this short list. If have some code and want it in this list just let us know.
|
||||
|
||||
|
||||
## A short history of Python-EFL
|
||||
|
||||
Python-EFL was begun in 2007 by work of Gustavo Sverzut Barbieri and others while working for Nokia on the software project Canola Media Player. The language bindings were initially developed for the individual components of EFL, until merged together in 2013.
|
||||
|
||||
He was later joined by Ulisses Furquim Freire da Silva, who together formed the company ProFUSION embedded systems where the developement continued and a new software project called Editje was created, which uses the Python bindings for most of its functionality.
|
||||
|
||||
Python-EFL gained many more developers, also at this time an independent application project called EpyMC was created by Davide Andreoli.
|
||||
|
||||
In the beginning of the year 2011 the developement was practically halted. In 2012 Davide Andreoli picked up the developement and Kai Huuhko (@kuuko) joined him shortly after. Work at this time was focused on finishing the Python bindings for Elementary, the toolkit library.
|
||||
|
||||
In 2013 the individual components were merged together and a new documentation system was implemented, enabling easier access for the end-user developers.
|
||||
|
||||
Currently (as in 2022) the bindings are still actively maintained and improved by Davide Andreoli, in his effort to bring to python a powerfull and attractive UI toolkit.
|
45
TODO
45
TODO
|
@ -1,45 +0,0 @@
|
|||
|
||||
BUGS
|
||||
====
|
||||
* EdjeEdit: PartState API does not work
|
||||
* Elm.Map: overlays_show segfaults, scrollers in examples are jumpy
|
||||
* Elementary: when we use custom function callbacks we usually leak some
|
||||
reference around, some examples:
|
||||
- Fileselector.custom_filter_append()
|
||||
- Multibuttonentry.format_function_set()
|
||||
- Multibuttonentry.filter_append()
|
||||
- Multibuttonentry.filterprepend()
|
||||
|
||||
Failing unit tests
|
||||
------------------
|
||||
* tests.edje.test_04_edit: testPartEffect (marked as known failure)
|
||||
* tests.edje.test_04_edit: testGroupDel (skipped, segfault)
|
||||
* tests.edje.test_04_edit: testExternal (skipped, TODO)
|
||||
|
||||
TODO
|
||||
====
|
||||
* update links and text on:
|
||||
http://www.freedesktop.org/wiki/Software/DBusBindings
|
||||
(requires fd.org shell account?)
|
||||
* Review the internal functions and name them consistently
|
||||
* Evas: SmartObject needs testing
|
||||
* Improve ethumb
|
||||
* edje: complete the unit tests
|
||||
* Initial Evas GL support (for Elm)
|
||||
* Add more documentation for callbacks, events, etc.
|
||||
* Check for missing Eo type mappings
|
||||
|
||||
Elm
|
||||
---
|
||||
* Drag-n-Drop
|
||||
* Automate compilation of the example edje files.
|
||||
* Add more examples
|
||||
* Prefs (only supports simple types, not so great for us)
|
||||
* GLView
|
||||
* Unit tests
|
||||
* Images missing in the documentation:
|
||||
- datetime
|
||||
- systray
|
||||
- video
|
||||
- web
|
||||
- window ?
|
|
@ -24,6 +24,12 @@ c_exclude_list = [
|
|||
"elm_access", # Access disabled until 1.9
|
||||
"elm_config_access", # Access disabled until 1.9
|
||||
"elm_object_item_access", # Access disabled until 1.9
|
||||
"elm_systray", # We currently have this in using Eo API
|
||||
"elm_code_", # The code widget is still in beta
|
||||
"elm_need_e_dbus", # has been deprecated long time ago
|
||||
"elm_check_selected_get", # We already provide state_get
|
||||
"elm_check_selected_set", # We already provide state_set
|
||||
|
||||
]
|
||||
c_excludes = "|".join(c_exclude_list)
|
||||
|
||||
|
@ -163,7 +169,9 @@ def get_pyapis(pxd_path, header_name, prefix):
|
|||
|
||||
for path, dirs, files in os.walk(pxd_path):
|
||||
for f in files:
|
||||
if not f.endswith(".pxd"):
|
||||
# if not f.endswith(".pxd"):
|
||||
# continue
|
||||
if f.endswith(".pyc"):
|
||||
continue
|
||||
open_args = (os.path.join(path, f),)
|
||||
open_kwargs = dict(mode="r")
|
||||
|
|
153
doc/Makefile
153
doc/Makefile
|
@ -1,153 +0,0 @@
|
|||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PythonBindingsforEnlightenmentFoundationLibraries.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PythonBindingsforEnlightenmentFoundationLibraries.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/PythonBindingsforEnlightenmentFoundationLibraries"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PythonBindingsforEnlightenmentFoundationLibraries"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
307
doc/conf.py
307
doc/conf.py
|
@ -1,40 +1,47 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Python Bindings for EFL Elementary documentation build configuration file, created by
|
||||
# sphinx-quickstart on Thu Jun 28 09:21:25 2012.
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
import sys, os, platform
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
|
||||
d = "lib.%s-%s-%d.%d" % (
|
||||
platform.system().lower(),
|
||||
platform.machine(),
|
||||
sys.version_info[0],
|
||||
sys.version_info[1]
|
||||
)
|
||||
sys.path.insert(0, os.path.abspath("../build/"+d))
|
||||
#sys.path.insert(0, os.path.abspath('../build/lib.linux-i686-3.2'))
|
||||
# add these directories to sys.path here.
|
||||
d = 'lib.%s-%s-%d.%d' % (
|
||||
platform.system().lower(),
|
||||
platform.machine(),
|
||||
sys.version_info[0],
|
||||
sys.version_info[1]
|
||||
)
|
||||
sys.path.insert(0, os.path.abspath('../build/' + d))
|
||||
# sys.path.insert(0, os.path.abspath('../build/lib.linux-i686-3.2'))
|
||||
|
||||
# Delete any previously imported efl package
|
||||
if "efl" in sys.modules:
|
||||
del sys.modules["efl"]
|
||||
if 'efl' in sys.modules:
|
||||
del sys.modules['efl']
|
||||
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'Python EFL'
|
||||
author = 'The Python-EFL community (see AUTHORS)'
|
||||
copyright = '2008-2022, ' + author # pylint: disable=redefined-builtin
|
||||
|
||||
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
needs_sphinx = '1.1'
|
||||
needs_sphinx = '3.1'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
|
@ -46,113 +53,36 @@ extensions = [
|
|||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Python EFL'
|
||||
copyright = u'2008-2015, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
# version = 'X.Y'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
# release = 'X.Y.Z'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
# master_doc = 'index'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'monokai'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# Setting this True will show missing references as warnings.
|
||||
#nitpicky = True
|
||||
|
||||
# nitpick_ignore = [
|
||||
# ('py:obj', 'int'),
|
||||
# ('py:obj', 'float'),
|
||||
# ('py:obj', 'double'),
|
||||
# ('py:obj', 'callable'),
|
||||
# ('py:obj', 'function'),
|
||||
# ('py:obj', 'str'),
|
||||
# ('py:exc', 'RuntimeError'),
|
||||
# ('py:exc', 'RuntimeWarning'),
|
||||
# ('py:exc', 'ValueError'),
|
||||
# ('py:exc', 'TypeError'),
|
||||
# ('py:obj', 'Evas_Coord (int)'),
|
||||
# ('py:obj', 'string'),
|
||||
# ('py:obj', 'list'),
|
||||
# ('py:class', 'object'),
|
||||
# ('py:obj', 'unicode'),
|
||||
# ('py:obj', 'bool'),
|
||||
# ('py:obj', 'tuple of ints'),
|
||||
# ('py:class', 'efl.eo.Eo'),
|
||||
# ('py:attr', 'efl.eo.Eo.data'),
|
||||
# ('py:obj', 'datetime.date'),
|
||||
# ]
|
||||
|
||||
|
||||
# -- Autodoc configuration -----------------------------------------------------
|
||||
|
||||
autodoc_default_flags = [
|
||||
'members',
|
||||
'show-inheritance',
|
||||
# 'inherited-members',
|
||||
# 'undoc-members',
|
||||
]
|
||||
autoclass_content = "both"
|
||||
autodoc_docstring_signature = True
|
||||
# autodoc_member_order = "bysource"
|
||||
autodoc_default_options = {
|
||||
'members': True, # show methods for classes
|
||||
'show-inheritance': True, # show bases class
|
||||
'member-order': 'alphabetical', # bysource, alphabetical, groupwise
|
||||
'no-undoc-members': True, # dont show members without docstring
|
||||
'no-inherited-members': True, # dont show members from parent classes
|
||||
}
|
||||
# both the class’ and the __init__ method’s docstring are concatenated
|
||||
autoclass_content = 'both'
|
||||
|
||||
def setup(app):
|
||||
from sphinx.ext.autodoc import cut_lines
|
||||
app.connect('autodoc-process-signature', autodoc_process_signature)
|
||||
app.connect('autodoc-process-docstring', cut_lines(1, what=['class']))
|
||||
|
||||
def autodoc_process_signature(app, what, name, obj, options, signature, return_annotation):
|
||||
def autodoc_process_signature(_app, what, _name, _obj, _options, signature, return_annotation):
|
||||
"""Cleanup params: remove the 'self' param and all the cython types"""
|
||||
|
||||
if what not in ('function', 'method'):
|
||||
return
|
||||
return None
|
||||
|
||||
params = list()
|
||||
params = []
|
||||
for param in (p.strip() for p in signature[1:-1].split(',')):
|
||||
if param != 'self':
|
||||
params.append(param.rpartition(' ')[2])
|
||||
|
@ -163,28 +93,28 @@ def autodoc_process_signature(app, what, name, obj, options, signature, return_a
|
|||
# -- Inheritance Diagram ------------------------------------------------------
|
||||
|
||||
try:
|
||||
import gv
|
||||
import gv # pylint: disable=unused-import
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
extensions.append('sphinx.ext.inheritance_diagram')
|
||||
# svg scale better (look at the full elm dia)
|
||||
# but svg links are broken :(
|
||||
graphviz_output_format = "svg" # png (default) or svg
|
||||
graphviz_output_format = 'png' # png (default) or svg
|
||||
inheritance_graph_attrs = dict(
|
||||
bgcolor = 'gray25', #404040
|
||||
bgcolor = 'gray25', #404040
|
||||
)
|
||||
inheritance_node_attrs = dict(
|
||||
style = 'rounded', # or 'filled',
|
||||
# fillcolor = "gray20", # bg color (should be #CCCCCC)
|
||||
color = 'gray10', # border color (should be #202020)
|
||||
style = 'rounded', # or 'filled',
|
||||
# fillcolor = 'gray20', # bg color (should be #CCCCCC)
|
||||
color = 'gray10', # border color (should be #202020)
|
||||
fontcolor = 'white',
|
||||
font = 'sans',
|
||||
|
||||
)
|
||||
inheritance_edge_attrs = dict(
|
||||
color = 'dodgerblue3', # arrow color (should be #4399FF)
|
||||
dir = 'none', # arrow direction (back, forward, both or none)
|
||||
color = 'dodgerblue3', # arrow color (should be #4399FF)
|
||||
dir = 'none', # arrow direction (back, forward, both or none)
|
||||
)
|
||||
|
||||
|
||||
|
@ -193,10 +123,11 @@ else:
|
|||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
# html_theme = 'alabaster' # Default sphinx theme
|
||||
# html_theme = 'default' # Classic python style
|
||||
# html_theme = 'sphinxdoc' # Much modern sphinx style
|
||||
# html_theme = 'sphinx13' # The latest one from the sphinx site
|
||||
html_theme = 'efldoc' # EFL dark style
|
||||
html_theme = 'efldoc' # Our custom EFL dark style
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
|
@ -211,16 +142,16 @@ html_theme_path = ['themes']
|
|||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
html_short_title = "Python EFL"
|
||||
html_short_title = 'Python EFL'
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
html_logo = "images/logo.png"
|
||||
html_logo = 'images/logo.png'
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
html_favicon = "images/logo.ico"
|
||||
html_favicon = 'images/logo.ico'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
|
@ -231,10 +162,6 @@ html_static_path = ['images']
|
|||
# using the given strftime format.
|
||||
html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
|
@ -270,121 +197,3 @@ html_show_sourcelink = False
|
|||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'PythonEFLdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'PythonEFL.tex', u'Python Bindings for EFL Documentation',
|
||||
u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output --------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'python-efl', u'Python Bindings for EFL Documentation',
|
||||
[u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output ------------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'PythonBindingsforEFLElementary', u'Python Bindings for EFL Elementary Documentation',
|
||||
u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko', 'PythonBindingsforEFLElementary', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
|
||||
# -- Options for Epub output ---------------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = u'Python Bindings for EFL'
|
||||
epub_author = u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
epub_publisher = u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
epub_copyright = u'2008-2015, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
|
||||
# The language of the text. It defaults to the language option
|
||||
# or en if the language is not set.
|
||||
#epub_language = ''
|
||||
|
||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||
#epub_scheme = ''
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#epub_uid = ''
|
||||
|
||||
# A tuple containing the cover image and cover page html template filenames.
|
||||
#epub_cover = ()
|
||||
|
||||
# HTML files that should be inserted before the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_pre_files = []
|
||||
|
||||
# HTML files shat should be inserted after the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_post_files = []
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
#epub_exclude_files = []
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
#epub_tocdup = True
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
.. currentmodule:: efl.ecore_con
|
||||
|
||||
:class:`efl.ecore_con.Lookup` Class
|
||||
===================================
|
||||
|
||||
.. autoclass:: efl.ecore_con.Lookup
|
|
@ -0,0 +1,9 @@
|
|||
.. currentmodule:: efl.ecore_con
|
||||
|
||||
:class:`efl.ecore_con.Url` Class
|
||||
===================================
|
||||
|
||||
.. autoclass:: efl.ecore_con.Url
|
||||
.. autoclass:: efl.ecore_con.EventUrlComplete
|
||||
.. autoclass:: efl.ecore_con.EventUrlProgress
|
||||
.. autoclass:: efl.ecore_con.EventUrlData
|
|
@ -15,8 +15,8 @@ great responsiveness without the need for threads(or any other concurrency).
|
|||
Timers
|
||||
------
|
||||
|
||||
:py:class:`Timers<efl.ecore.Timer>` serve two main purposes: doing something at a specified time and
|
||||
repeatedly doing something with a set interval.
|
||||
:py:class:`Timers<efl.ecore.Timer>` serve two main purposes: doing something at
|
||||
a specified time and repeatedly doing something with a set interval.
|
||||
|
||||
|
||||
Animators
|
||||
|
@ -73,14 +73,6 @@ error. Any valid file descriptor can be used with this API, regardless of if
|
|||
was gotten with an OS specific API or from ecore.
|
||||
see :py:class:`FdHandler<efl.ecore.FdHandler>`
|
||||
|
||||
File download
|
||||
-------------
|
||||
|
||||
Ecore provide the :py:class:`FileDownload<efl.ecore.FileDownload>` class
|
||||
to perform asyncronous download of files from the net. Two callbacks are
|
||||
used to inform the user while progress occurs and when the download has
|
||||
finished.
|
||||
|
||||
|
||||
File monitor
|
||||
------------
|
||||
|
@ -91,6 +83,25 @@ Events will be generatd everytime a file or directory (that live in the
|
|||
give path) is created/deleted/modified.
|
||||
|
||||
|
||||
File download
|
||||
-------------
|
||||
|
||||
Ecore provide the :py:class:`FileDownload<efl.ecore.FileDownload>` class
|
||||
to perform asyncronous download of files from the net. Two callbacks are
|
||||
used to inform the user while progress occurs and when the download has
|
||||
finished.
|
||||
|
||||
|
||||
Ecore Con
|
||||
---------
|
||||
|
||||
The ecore_con module provide various utilities to perform different network
|
||||
related tasks. Everything provided in a fully async way. Most notable are the
|
||||
:class:`efl.ecore_con.Lookup` class to perform DNS requests, the
|
||||
:class:`efl.ecore_con.Url` class to perform HTTP requests and the
|
||||
:class:`efl.ecore_con.Server` class to implement your own server.
|
||||
|
||||
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
@ -99,6 +110,8 @@ API Reference
|
|||
:titlesonly:
|
||||
|
||||
module-ecore
|
||||
module-ecore_input
|
||||
module-ecore_con
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
.. automodule:: efl.ecore_con
|
||||
:exclude-members: Url, EventUrlComplete, EventUrlProgress, EventUrlData,
|
||||
Lookup, ConEventFilter
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. automodule:: efl.ecore_input
|
||||
|
22
doc/efl.rst
22
doc/efl.rst
|
@ -6,10 +6,30 @@
|
|||
.. versionadded:: 1.8
|
||||
|
||||
|
||||
Object lifetime
|
||||
---------------
|
||||
|
||||
Eo objects (and any which have the delete() method) get their reference count
|
||||
internally increased by one at object creation. This means that these objects
|
||||
will not get freed when you release all references to them in your application.
|
||||
You must call the objects' delete() method to decrease the internal reference
|
||||
count. This will usually also trigger some kind of action to destroy
|
||||
the object gracefully, i.e. hiding the graphical object etc, and will set the
|
||||
C object pointer to NULL, which will prevent you from calling methods on the
|
||||
object.
|
||||
|
||||
If you can't keep track of when your application calls the delete method, you
|
||||
can check that your object is still valid with either the is_deleted() method,
|
||||
or with a non-zero check::
|
||||
|
||||
if eo_obj:
|
||||
print(repr(eo_obj))
|
||||
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
||||
PyEFL provides `logging <http://docs.python.org/2/library/logging.html>`_
|
||||
PyEFL provides `logging <https://docs.python.org/library/logging.html>`_
|
||||
to loggers which are usually named after their equivalent module,
|
||||
f.e. *efl.eo*. There is a root logger called *efl* which also receives
|
||||
any messages coming from the underlying C libraries.
|
||||
|
|
|
@ -50,8 +50,6 @@ 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
|
||||
|
|
|
@ -50,8 +50,6 @@ Emitted signals
|
|||
- ``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
|
||||
|
|
|
@ -28,8 +28,6 @@ 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
|
||||
|
@ -73,6 +71,12 @@ Calendar mark repeat types
|
|||
Marks will be displayed every last day of month after event day
|
||||
(inclusive).
|
||||
|
||||
.. data:: ELM_CALENDAR_REVERSE_DAILY
|
||||
|
||||
Marks will be displayed every day before event day.
|
||||
|
||||
.. versionadded:: 1.19
|
||||
|
||||
|
||||
.. _Elm_Calendar_Select_Mode:
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ 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
|
||||
|
|
|
@ -39,8 +39,6 @@ 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
|
||||
|
|
|
@ -28,8 +28,6 @@ Emitted signals
|
|||
- ``"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
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
.. currentmodule:: efl.elementary
|
||||
|
||||
Combobox
|
||||
########
|
||||
|
||||
.. warning::
|
||||
**THE COMBOBOX IS BROKEN AND DEPRECATED, DO NOT USE IN ANY CASE !!**
|
||||
|
||||
The behaviour and the API of the Combobox will change in future release.
|
||||
|
||||
If you are already using this we really encourage you to switch
|
||||
to other widgets.
|
||||
|
||||
We are really sorry about this breakage, but there is nothing we can do
|
||||
to avoid this :(
|
||||
|
||||
.. image:: /images/combobox-preview.png
|
||||
|
||||
Widget description
|
||||
==================
|
||||
|
||||
This is a the classic combobox widget, it is the composition of a
|
||||
:class:`Button`, an :class:`Entry`, a :class:`Genlist` and an :class:`Hover`.
|
||||
Thus you can use all the functionality of the base classes on the
|
||||
:class:`Combobox` itself.
|
||||
|
||||
|
||||
Available styles
|
||||
================
|
||||
|
||||
- ``default`` a normal combobox.
|
||||
|
||||
|
||||
Emitted signals
|
||||
===============
|
||||
|
||||
- ``dismissed``: The combobox hover has been dismissed.
|
||||
- ``expanded``: The combobox hover has been expanded.
|
||||
- ``clicked``: The combobox button has been clicked.
|
||||
- ``item,selected``: An item has been selected (highlighted).
|
||||
- ``item,pressed``: An item has been pressed (clicked).
|
||||
- ``filter,done``: Item filtering on genlist is completed.
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
===================
|
||||
|
||||
.. inheritance-diagram:: Combobox
|
||||
:parts: 2
|
||||
|
||||
|
||||
.. autoclass:: _Combobox
|
||||
.. autoclass:: Combobox
|
||||
|
|
@ -27,10 +27,8 @@ Emitted signals
|
|||
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)
|
||||
|
||||
- ``geometry,update`` - The geometry has changed (since 1.17)
|
||||
|
||||
Layout content parts
|
||||
====================
|
||||
|
|
|
@ -172,9 +172,6 @@ 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
|
||||
|
|
|
@ -50,7 +50,6 @@ Emitted signals
|
|||
===============
|
||||
|
||||
- ``dayselector,changed`` - when the user changes the state of a day.
|
||||
- ``language,changed`` - the program's language changed
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -26,8 +26,6 @@ Emitted signals
|
|||
- ``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.
|
||||
|
|
|
@ -118,7 +118,7 @@ Quit policy types
|
|||
.. data:: ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN
|
||||
|
||||
Quit when the application's last window is hidden
|
||||
|
||||
|
||||
.. versionadded:: 1.15
|
||||
|
||||
|
||||
|
@ -158,6 +158,24 @@ Possible values for the #ELM_POLICY_THROTTLE policy.
|
|||
Never throttle when windows are all hidden, regardless of config settings.
|
||||
|
||||
|
||||
.. _Elm_Object_Multi_Select_Mode:
|
||||
|
||||
Object multi select policy values
|
||||
---------------------------------
|
||||
|
||||
Possible values for the #ELM_OBJECT_MULTI_SELECT_MODE policy.
|
||||
|
||||
.. versionadded:: 1.18
|
||||
|
||||
.. data:: ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT
|
||||
|
||||
Default multiple select mode.
|
||||
|
||||
.. data:: ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL
|
||||
|
||||
Disallow mutiple selection when clicked without control key pressed.
|
||||
|
||||
|
||||
.. _Elm_Process_State:
|
||||
|
||||
Elm_Process_State
|
||||
|
@ -402,6 +420,7 @@ Inheritance diagram
|
|||
efl.elementary.Check
|
||||
efl.elementary.Clock
|
||||
efl.elementary.Colorselector
|
||||
efl.elementary.Combobox
|
||||
efl.elementary.Configuration
|
||||
efl.elementary.Conformant
|
||||
efl.elementary.Ctxpopup
|
||||
|
@ -450,7 +469,6 @@ Inheritance diagram
|
|||
efl.elementary.Slider
|
||||
efl.elementary.Slideshow
|
||||
efl.elementary.Spinner
|
||||
efl.elementary.Systray
|
||||
efl.elementary.Table
|
||||
efl.elementary.Theme
|
||||
efl.elementary.Thumb
|
||||
|
|
|
@ -223,8 +223,6 @@ Emitted signals
|
|||
- ``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.
|
||||
|
@ -246,7 +244,6 @@ Emitted signals
|
|||
- ``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)
|
||||
|
||||
|
@ -411,6 +408,12 @@ Input panel layouts
|
|||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
.. data:: ELM_INPUT_PANEL_LAYOUT_VOICE
|
||||
|
||||
Voice layout, but if the IME does not support voice, then normal layout will be shown
|
||||
|
||||
.. versionadded:: 1.19
|
||||
|
||||
|
||||
.. _Elm_Input_Panel_Layout_Normal_Variation:
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ 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
|
||||
|
|
|
@ -39,8 +39,6 @@ Emitted signals
|
|||
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
|
||||
|
@ -50,7 +48,6 @@ Emitted signals
|
|||
- ``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
|
||||
|
|
|
@ -29,8 +29,6 @@ Emitted signals
|
|||
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
|
||||
|
|
|
@ -233,11 +233,6 @@ Emitted signals
|
|||
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
|
||||
|
@ -271,6 +266,12 @@ Items' scroll to types
|
|||
|
||||
Scroll to the middle of viewport
|
||||
|
||||
.. data:: ELM_GENGRID_ITEM_SCROLLTO_BOTTOM
|
||||
|
||||
Scroll to the bottom of viewport
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
|
||||
.. _Elm_Gengrid_Object_Multi_Select_Mode:
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ Available item styles
|
|||
- ``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)
|
||||
- ``indent`` Has indentation to match tree group items (since: 1.19)
|
||||
|
||||
|
||||
Structure of items
|
||||
|
@ -344,12 +345,11 @@ Emitted signals
|
|||
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)
|
||||
- ``changed`` - Genlist is now changed their items and properties and all
|
||||
calculation is finished. (since 1.16)
|
||||
- ``filter,done`` - Genlist filter operation is completed.. (since 1.17)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
@ -416,6 +416,12 @@ Genlist items' scroll-to types
|
|||
|
||||
Scroll to the middle of viewport
|
||||
|
||||
.. data:: ELM_GENLIST_ITEM_SCROLLTO_BOTTTOM
|
||||
|
||||
Scroll to the bottom of viewport
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
===================
|
||||
|
|
|
@ -39,8 +39,6 @@ Emitted signals
|
|||
(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
|
||||
|
|
|
@ -38,6 +38,13 @@ Emitted signals
|
|||
- ``download,progress`` - url download in progress
|
||||
- ``download,end`` - remote url download has finished
|
||||
- ``download,error`` - remote url download has finished with errors
|
||||
- ``load,open`` - Triggered when the file has been opened, if async open is
|
||||
enabled (image size is known). (since 1.19)
|
||||
- ``load,ready`` - Triggered when the image file is ready for display, if
|
||||
preload is enabled. (since 1.19)
|
||||
- ``load,error`` - Triggered if an async I/O or decoding error occurred, if
|
||||
async open or preload is enabled (since 1.19)
|
||||
- ``load,cancel`` - Triggered whenener async I/O was cancelled. (since 1.19)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -42,9 +42,6 @@ Emitted signals
|
|||
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
|
||||
|
|
|
@ -20,9 +20,17 @@ Available styles
|
|||
================
|
||||
|
||||
``default``
|
||||
No animation
|
||||
The default style
|
||||
``default/left``
|
||||
Left aligned label (since 1.18)
|
||||
``default/right``
|
||||
Right aligned label (since 1.18)
|
||||
``marker``
|
||||
Centers the text in the label and makes it bold by default
|
||||
``marker/left``
|
||||
Like marker but left aligned (since 1.18)
|
||||
``marker/right``
|
||||
Like marker but right aligned (since 1.18)
|
||||
``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
|
||||
|
@ -43,7 +51,6 @@ they like.
|
|||
Emitted signals
|
||||
===============
|
||||
|
||||
- ``language,changed`` - The program's language changed.
|
||||
- ``slide,end`` - The slide is end.
|
||||
|
||||
|
||||
|
|
|
@ -151,7 +151,6 @@ Emitted signals
|
|||
===============
|
||||
|
||||
- ``theme,changed`` - The theme was changed.
|
||||
- ``language,changed`` - the program's language changed
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
|
|
|
@ -38,9 +38,6 @@ Emitted signals
|
|||
- ``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)
|
||||
|
||||
|
|
|
@ -52,9 +52,6 @@ Emitted signals
|
|||
- ``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
|
||||
|
|
|
@ -36,13 +36,12 @@ Emitted signals
|
|||
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
|
||||
=================
|
||||
|
||||
|
|
|
@ -65,8 +65,7 @@ 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)
|
||||
- ``item,activated`` - Naviframe item was activated (since 1.19)
|
||||
|
||||
All the parts, for content and text, described here will also be
|
||||
reachable by naviframe **items** direct calls:
|
||||
|
|
|
@ -21,6 +21,7 @@ Emitted signals
|
|||
|
||||
- ``timeout`` - when timeout happens on notify and it's hidden
|
||||
- ``block,clicked`` - when a click outside of the notify happens
|
||||
- ``dismissed`` - When notify is closed as a result of a dismiss (since 1.17)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -47,6 +47,15 @@ More information is on
|
|||
- X11R6 Inter-Client Communication Conventions Manual, section 2
|
||||
|
||||
|
||||
Emitted smart events
|
||||
====================
|
||||
|
||||
- ``moved`` - When the object change position. (since 1.17)
|
||||
- ``focus`` - When the object has received focus. (since 1.8)
|
||||
- ``unfocus`` - When the object has lost focus. (since 1.8)
|
||||
- ``language,changed`` - Whenever system locale changes.
|
||||
|
||||
|
||||
Enumerations
|
||||
============
|
||||
|
||||
|
|
|
@ -17,8 +17,7 @@ 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)
|
||||
- ``toggled`` - Emitted when the panel has been toggled. (since 1.19)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -41,8 +41,6 @@ Emitted signals
|
|||
- ``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
|
||||
|
|
|
@ -69,11 +69,9 @@ 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)
|
||||
- ``dismissed`` - the popup has been dismissed. (since 1.17)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -34,8 +34,7 @@ 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:
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ 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
|
||||
|
|
|
@ -50,8 +50,6 @@ Emitted signals
|
|||
- ``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.
|
||||
|
|
|
@ -43,8 +43,6 @@ Emitted signals
|
|||
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
|
||||
|
|
|
@ -60,8 +60,6 @@ Emitted signals
|
|||
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
|
||||
|
|
|
@ -31,9 +31,10 @@ Emitted signals
|
|||
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)
|
||||
- ``spinner,drag,start`` - When dragging has started.
|
||||
- ``spinner,drag,stop`` - When dragging has stopped.
|
||||
- ``min,reached`` - Called when spinner value reached min (since 1.20)
|
||||
- ``max,reached`` - Called when spinner value reached max (since 1.20)
|
||||
|
||||
|
||||
Available styles
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
.. currentmodule:: 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:: Systray
|
||||
.. autofunction:: on_systray_ready
|
||||
|
||||
.. autoclass:: EventSystrayReady
|
|
@ -23,9 +23,6 @@ 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)
|
||||
|
||||
|
|
|
@ -13,12 +13,6 @@ 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
|
||||
===================
|
||||
|
|
|
@ -76,8 +76,6 @@ Emitted signals
|
|||
- ``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
|
||||
|
|
|
@ -95,8 +95,6 @@ Emitted signals
|
|||
- ``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)
|
||||
|
||||
|
||||
|
|
|
@ -47,9 +47,20 @@ loaded file.
|
|||
|
||||
There will be a delay between an API being called and it being really
|
||||
executed, since this request will be done in the main thread, and it needs to
|
||||
be sent to the decoding thread. For this reason, always call functions like
|
||||
emotion_object_size_get() or emotion_object_length_get() after some signal
|
||||
being sent, like "playback_started" or "open_done".
|
||||
be sent to the decoding thread. For this reason, never access properties or
|
||||
call methods before a start up signal being sent, such "playback_started" or
|
||||
"open_done".
|
||||
|
||||
|
||||
Supported module names
|
||||
======================
|
||||
|
||||
- **gstreamer1** (default)
|
||||
- **xine**
|
||||
- **libvlc**
|
||||
- generic modules (launched in a separate process)
|
||||
|
||||
- **vlc**
|
||||
|
||||
|
||||
Emitted signals
|
||||
|
@ -70,7 +81,7 @@ interesting signals:
|
|||
- ``length_change`` Emitted if the media change it's size
|
||||
- ``channels_change`` Emitted when the number of channels change
|
||||
- ``title_change`` Emitted when the title change (?)
|
||||
- ``progress_change``
|
||||
- ``progress_change``
|
||||
- ``ref_change``
|
||||
- ``button_num_change``
|
||||
- ``button_change``
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
.. currentmodule:: efl.ethumb
|
||||
|
||||
:class:`efl.ethumb.Ethumb` Class
|
||||
================================
|
||||
|
||||
.. autoclass:: efl.ethumb.Ethumb
|
|
@ -0,0 +1,6 @@
|
|||
.. currentmodule:: efl.ethumb_client
|
||||
|
||||
:class:`efl.ethumb_client.EthumbClient` Class
|
||||
=============================================
|
||||
|
||||
.. autoclass:: efl.ethumb_client.EthumbClient
|
|
@ -1,28 +1,55 @@
|
|||
|
||||
.. _ethumb_main_intro:
|
||||
|
||||
|
||||
What is Ethumb?
|
||||
----------------
|
||||
===============
|
||||
|
||||
Ethumb will use Evas to generate thumbnail images of given files. The API
|
||||
allows great customization of the generated files and also helps compling to
|
||||
FreeDesktop.Org Thumbnail Specification.
|
||||
|
||||
How to use the Ethumb object
|
||||
-----------------------------
|
||||
(http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html)
|
||||
|
||||
However, thumbnailing can be an expensive process that will impact your
|
||||
application experience, blocking animations and user interaction during the
|
||||
generation. Another problem is that one should try to cache the thumbnails in
|
||||
a place that other applications can benefit from the file.
|
||||
|
||||
:class:`~efl.ethumb_client.EthumbClient` exists to solve this. It will
|
||||
communicate with a server using standard D-Bus protocol. The server will use
|
||||
:class:`~efl.ethumb.Ethumb` itself to generate the thumbnail images and cache
|
||||
them using FreeDesktop.Org standard. It is recommended that most applications
|
||||
use :class:`~efl.ethumb_client.EthumbClient` instead of
|
||||
:class:`~efl.ethumb.Ethumb` directly.
|
||||
|
||||
Another difference is that one :class:`~efl.ethumb.Ethumb` instance
|
||||
can only generate a single thumbnail at a given time, so you must implement
|
||||
some sort of queue mechanism if you need more than one. Instead
|
||||
:class:`~efl.ethumb_client.EthumbClient` is a able to receive more than one
|
||||
request at the same time.
|
||||
|
||||
Recommended reading:
|
||||
|
||||
:class:`~efl.ethumb.Ethumb` to generate thumbnails in the local process.
|
||||
|
||||
:class:`~efl.ethumb_client.EthumbClient` to generate thumbnails using a
|
||||
server (recommended).
|
||||
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
:titlesonly:
|
||||
|
||||
ethumb_module
|
||||
pyethumb
|
||||
ethumb_client
|
||||
module-ethumb.rst
|
||||
module-ethumb_client.rst
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
-------------------
|
||||
===================
|
||||
|
||||
.. inheritance-diagram::
|
||||
efl.ethumb
|
||||
efl.ethumb_client
|
||||
.. inheritance-diagram:: efl.ethumb
|
||||
:parts: 2
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
.. currentmodule:: efl.ethumb
|
||||
|
||||
|
||||
:class:`efl.ethumb_client.Client` Class
|
||||
========================================
|
||||
|
||||
.. autoclass:: efl.ethumb_client.Client
|
|
@ -1,5 +0,0 @@
|
|||
:mod:`efl.ethumb` Module
|
||||
========================
|
||||
|
||||
.. automodule:: efl.ethumb
|
||||
:exclude-members: PyEthumb
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. automodule:: efl.ethumb
|
||||
:exclude-members: Ethumb
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. automodule:: efl.ethumb_client
|
||||
:exclude-members: EthumbClient
|
|
@ -1,9 +0,0 @@
|
|||
.. currentmodule:: efl.ethumb
|
||||
|
||||
:class:`efl.ethumb.PyEthumb` Class
|
||||
==================================
|
||||
|
||||
.. autoclass:: efl.ethumb.PyEthumb
|
||||
|
||||
.. currentmodule:: efl.ethumb
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
|
@ -1,36 +1,7 @@
|
|||
|
||||
Python Bindings for Enlightenment Foundation Libraries' documentation
|
||||
Python-EFL
|
||||
#####################################################################
|
||||
|
||||
EFL is a collection of libraries that are independent or may build on top of
|
||||
each-other to provide useful features that complement an OS's existing
|
||||
environment, rather than wrap and abstract it, trying to be their own
|
||||
environment and OS in its entirety. This means that it expects you to use
|
||||
other system libraries and API's in conjunction with EFL libraries, to provide
|
||||
a whole working application or library, simply using EFL as a set of
|
||||
convenient pre-made libraries to accomplish a whole host of complex
|
||||
or painful tasks for you.
|
||||
|
||||
One thing that has been important to EFL is efficiency. That is in both
|
||||
speed and size. The core EFL libraries even with Elementary are about half
|
||||
the size of the equivalent "small stack" of GTK+ that things like GNOME
|
||||
use. It is in the realm of one quarter the size of Qt. Of course these
|
||||
are numbers that can be argued over as to what constitutes an equivalent
|
||||
measurement. EFL is low on actual memory usage at runtime with memory
|
||||
footprints a fraction the size of those in the GTK+ and Qt worlds. In
|
||||
addition EFL is fast. For what it does. Some libraries claim to be very
|
||||
fast - but then they also don't "do much". It's easy to be fast when you
|
||||
don't tackle the more complex rendering problems involving alpha blending,
|
||||
interpolated scaling and transforms with dithering etc. EFL tackles these,
|
||||
and more.
|
||||
|
||||
.. seealso::
|
||||
|
||||
- `EFL Overview <http://trac.enlightenment.org/e/wiki/EFLOverview>`_
|
||||
- `EFL Documentation <http://web.enlightenment.org/p.php?p=docs>`_
|
||||
- `EDC Reference <https://build.enlightenment.org/job/nightly_efl_gcc_x86_64/lastSuccessful Buil d/artifact/doc/html/edcref.html>`_
|
||||
- `EFL Big Picture <http://docs.enlightenment.org/books/efl-big-picture/efl_big_picture.pdf>`_
|
||||
|
||||
|
||||
EFL
|
||||
===
|
||||
|
@ -62,6 +33,7 @@ Ethumb
|
|||
======
|
||||
|
||||
.. toctree:: ethumb/ethumb.rst
|
||||
:titlesonly:
|
||||
|
||||
|
||||
Edje
|
||||
|
@ -91,29 +63,25 @@ DBus integration
|
|||
.. toctree:: dbus/dbus
|
||||
|
||||
|
||||
Tutorials
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
tutorials/01-window.rst
|
||||
tutorials/02-sizehints.rst
|
||||
|
||||
|
||||
Acknowledgements
|
||||
================
|
||||
|
||||
:Copyright:
|
||||
Python Bindings for EFL are Copyright (C) 2008-2015 Simon Busch
|
||||
and various contributors (see AUTHORS).
|
||||
2008-2022 The Python-EFL community (see AUTHORS)
|
||||
|
||||
:License:
|
||||
Python Bindings for EFL are licensed LGPL-3 (see COPYING).
|
||||
Python Bindings for EFL are licensed LGPL-3 (see COPYING)
|
||||
|
||||
:Authors:
|
||||
- `Gustavo Sverzut Barbieri <mailto:barbieri@gmail.com>`_
|
||||
- `Simon Busch <mailto:morphis@gravedo.de>`_
|
||||
- `Boris 'billiob' Faure <mailto:billiob@gmail.com>`_
|
||||
- `Davide 'davemds' Andreoli <mailto:dave@gurumeditation.it>`_
|
||||
- `Fabiano Fidêncio <mailto:fidencio@profusion.mobi>`_
|
||||
- `Bruno Dilly <mailto:bdilly@profusion.mobi>`_
|
||||
- `Tiago Falcão <mailto:tiago@profusion.mobi>`_
|
||||
- `Joost Albers <mailto:joost.albers@nomadrail.com>`_
|
||||
- `Kai Huuhko <mailto:kai.huuhko@gmail.com>`_
|
||||
- `Ulisses Furquim <ulissesf@gmail.com>`_
|
||||
|
||||
:Contact: `Enlightenment developer mailing list <mailto:enlightenment-devel@lists.sourceforge.net>`_
|
||||
:Contact:
|
||||
`Enlightenment developer mailing list <mailto:enlightenment-devel@lists.sourceforge.net>`_
|
||||
|
||||
|
||||
Indices and tables
|
||||
|
|
190
doc/make.bat
190
doc/make.bat
|
@ -1,190 +0,0 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PythonBindingsforEnlightenmentFoundationLibraries.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PythonBindingsforEnlightenmentFoundationLibraries.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Sphinx layout template for the sphinxdoc theme.
|
||||
|
||||
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- extends "basic/layout.html" %}
|
||||
|
@ -12,7 +12,7 @@
|
|||
|
||||
|
||||
{% block extrahead %}
|
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
rel='stylesheet' type='text/css'>
|
||||
{{ super() }}
|
||||
|
||||
|
@ -20,46 +20,15 @@
|
|||
<style type="text/css">
|
||||
table.right { float: right; margin-left: 20px; }
|
||||
table.right td { border: 1px solid #ccc; }
|
||||
{% if pagename == 'index' %}
|
||||
.related { display: none; }
|
||||
{% endif %}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
// intelligent scrolling of the sidebar content
|
||||
$(window).scroll(function() {
|
||||
var sb = $('.sphinxsidebarwrapper');
|
||||
var win = $(window);
|
||||
var sbh = sb.height();
|
||||
var offset = $('.sphinxsidebar').position()['top'];
|
||||
var wintop = win.scrollTop();
|
||||
var winbot = wintop + win.innerHeight();
|
||||
var curtop = sb.position()['top'];
|
||||
var curbot = curtop + sbh;
|
||||
// does sidebar fit in window?
|
||||
if (sbh < win.innerHeight()) {
|
||||
// yes: easy case -- always keep at the top
|
||||
sb.css('top', $u.min([$u.max([0, wintop - offset - 10]),
|
||||
$(document).height() - sbh - 200]));
|
||||
} else {
|
||||
// no: only scroll if top/bottom edge of sidebar is at
|
||||
// top/bottom edge of window
|
||||
if (curtop > wintop && curbot > winbot) {
|
||||
sb.css('top', $u.max([wintop - offset - 10, 0]));
|
||||
} else if (curtop < wintop && curbot < winbot) {
|
||||
sb.css('top', $u.min([winbot - sbh - offset - 20,
|
||||
$(document).height() - sbh - 200]));
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{%- endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block rootrellink %}
|
||||
<li><a href="{{ pathto('index') }}">Home</a> |</li>
|
||||
<!-- <li><a href="{{ pathto('contents') }}">Documentation</a> »</li>-->
|
||||
<li><a href="{{ pathto('index') }}">Home</a> |</li>
|
||||
<!-- <li><a href="{{ pathto('contents') }}">Documentation</a> »</li>-->
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
|
@ -68,8 +37,8 @@
|
|||
<li class="index"><a href="{{ pathto('index') }}"><span></span></a></li>
|
||||
<li class="maintitle">{{ project }} - {{ version }}</li>
|
||||
<li class="current"><a href="{{ pathto('index') }}"><span>python docs</span></a></li>
|
||||
<li><a href="http://enlightenment.org/p.php?p=docs"><span>other docs</span></a></li>
|
||||
<li><a href="http://enlightenment.org/p.php?p=about"><span>EFL</span></a></li>
|
||||
<li><a href="https://www.enlightenment.org/docs"><span>other docs</span></a></li>
|
||||
<li><a href="https://www.enlightenment.org/about-efl"><span>EFL</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -77,20 +46,17 @@
|
|||
{%- block content %}
|
||||
<div class="document">
|
||||
{%- block document %}
|
||||
{{ sidebar() }}
|
||||
<div class="documentwrapper">
|
||||
{%- if render_sidebar %}
|
||||
<div class="bodywrapper">
|
||||
{%- endif %}
|
||||
<div class="body">
|
||||
{% block body %} {% endblock %}
|
||||
</div>
|
||||
{%- if render_sidebar %}
|
||||
<div id="layout">
|
||||
<div id="content">
|
||||
<div class="body">
|
||||
{% block body %} {% endblock %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- if render_sidebar %}
|
||||
<div id="sidebar">{{ sidebar() }}</div>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endblock %}
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
|
@ -98,7 +64,11 @@
|
|||
<div class="footer">
|
||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||
<br>
|
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
|
||||
{%- if last_updated %}
|
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- if show_sphinx %}
|
||||
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
|
|
@ -6,19 +6,27 @@
|
|||
*
|
||||
* Originally based on sphinx13 theme.
|
||||
*
|
||||
* All the modification done from the s13 theme are marked with the original
|
||||
* value in a comment, new tags are marked with an empty comment, removed tags
|
||||
* are just commented out.
|
||||
* This is usefull when something looks not so good as the original one to
|
||||
* understand the reason.
|
||||
*
|
||||
* :copyright: Copyright 2013-2015 by the Python-EFL team, see AUTHORS.
|
||||
* :copyright: Copyright 2013-2022 by the Python-EFL team, see AUTHORS.
|
||||
* :license: LGPL, see COPYING for details.
|
||||
*
|
||||
*/
|
||||
|
||||
@import url("basic.css");
|
||||
|
||||
/* -- main flex layout ----------------------------------------------------- */
|
||||
|
||||
#layout {
|
||||
display: flex;
|
||||
}
|
||||
#content {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#sidebar {
|
||||
flex-grow: 0;
|
||||
width: 230px;
|
||||
border-left: 1px solid rgb(111,111,111);
|
||||
}
|
||||
|
||||
/* -- page layout ----------------------------------------------------------- */
|
||||
|
||||
body {
|
||||
|
@ -26,9 +34,8 @@ body {
|
|||
'Verdana', sans-serif;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
/* background-image: url(bodybg.png); */
|
||||
background-color: rgb(64,64,64); /* */
|
||||
color: white; /*black*/
|
||||
background-color: rgb(64,64,64);
|
||||
color: white;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
@ -48,7 +55,6 @@ body {
|
|||
height: 63px;
|
||||
padding-right: 18px;
|
||||
background: url("header_menu_background_last.png") no-repeat scroll right center transparent;
|
||||
|
||||
}
|
||||
|
||||
.pageheader li {
|
||||
|
@ -92,7 +98,6 @@ body {
|
|||
}
|
||||
|
||||
div.document {
|
||||
/* background-color: white; */
|
||||
text-align: left;
|
||||
border: 1px solid rgb(111,111,111);
|
||||
width: 90%;
|
||||
|
@ -101,11 +106,6 @@ div.document {
|
|||
max-width: 1080px;
|
||||
}
|
||||
|
||||
div.bodywrapper {
|
||||
margin-right: 240px;
|
||||
border-right: 1px solid rgb(111,111,111); /*#0a507a*/
|
||||
}
|
||||
|
||||
div.body {
|
||||
padding: 0.5em 20px 20px 20px;
|
||||
}
|
||||
|
@ -120,10 +120,10 @@ div.related {
|
|||
}
|
||||
|
||||
div.related ul {
|
||||
background-image: url(rel_background.png); /*url(relbg.png)*/
|
||||
background-image: url(rel_background.png);
|
||||
height: 1.9em;
|
||||
border-top: 1px solid rgb(32,32,32); /*#002e50*/
|
||||
border-bottom: 1px solid rgb(32,32,32); /*#002e50*/
|
||||
border-top: 1px solid rgb(32,32,32);
|
||||
border-bottom: 1px solid rgb(32,32,32);
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
@ -144,44 +144,49 @@ div.related ul li a {
|
|||
padding: 0 5px 0 5px;
|
||||
line-height: 1.75em;
|
||||
color: rgb(249,249,240);
|
||||
/* text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5); */
|
||||
}
|
||||
|
||||
div.related ul li a:hover {
|
||||
color: white;
|
||||
/*text-decoration: underline;*/
|
||||
/* text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.5); */
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
/* Avoid the buggy moving sidebar
|
||||
position: relative;
|
||||
top: 0px;
|
||||
*/
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
/* -- sidebar ------------------------------------------------------------- */
|
||||
|
||||
div.sphinxsidebar {
|
||||
margin: 0;
|
||||
padding: 0 15px 15px 0;
|
||||
width: 210px;
|
||||
float: right;
|
||||
padding: 0;
|
||||
float: none;
|
||||
font-size: 1em;
|
||||
text-align: left;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
margin: 0;
|
||||
padding: 15px 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .logo {
|
||||
font-size: 1.8em;
|
||||
color: rgb(10,80,122);
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .logo img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .download a img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.subscribeformwrapper {
|
||||
display: block;
|
||||
overflow: auto;
|
||||
margin-bottom: 1.2em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid rgb(170,170,170);
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
|
@ -189,9 +194,30 @@ div.sphinxsidebar input {
|
|||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input {
|
||||
border: 1px solid #aaa;
|
||||
font-size: 0.9em;
|
||||
float: left;
|
||||
padding: 0.25em 0.5em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="text"] {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="submit"] {
|
||||
width: 40%;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 {
|
||||
font-size: 1.5em;
|
||||
border-top: 1px solid rgb(111,111,111); /*#0a507a;*/
|
||||
border-top: 1px solid rgb(111,111,111);
|
||||
margin-top: 1em;
|
||||
margin-bottom: 0.5em;
|
||||
padding-top: 0.5em;
|
||||
|
@ -202,14 +228,11 @@ div.sphinxsidebar h4 {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3, div.sphinxsidebar h4 {
|
||||
margin-right: -15px;
|
||||
margin-left: -15px;
|
||||
padding-right: 14px;
|
||||
padding-left: 14px;
|
||||
color: rgb(51, 153, 255); /*#333*/
|
||||
div.sphinxsidebar h3,
|
||||
div.sphinxsidebar h4
|
||||
{
|
||||
color: rgb(51, 153, 255);
|
||||
font-weight: 300;
|
||||
/*text-shadow: 0px 0px 0.5px rgba(0, 0, 0, 0.4);*/
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper > h3:first-child {
|
||||
|
@ -218,7 +241,7 @@ div.sphinxsidebarwrapper > h3:first-child {
|
|||
}
|
||||
|
||||
div.sphinxsidebar h3 a {
|
||||
color: rgb(51, 153, 255); /*#333*/
|
||||
color: rgb(51, 153, 255);
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
|
@ -233,15 +256,18 @@ div.sphinxsidebar ul ul {
|
|||
list-style-image: url(listitem.png);
|
||||
}
|
||||
|
||||
|
||||
/* -- footer ----------------------------------------------------------- */
|
||||
|
||||
div.footer {
|
||||
background-image: url(footer_background.png); /*url(footerbg.png)*/
|
||||
background-image: url(footer_background.png);
|
||||
color: rgb(204,204,204);
|
||||
text-shadow: 0 0 .2px rgba(255, 255, 255, 0.8);
|
||||
padding: 6px; /*3px 8px 3px 0*/
|
||||
padding: 6px;
|
||||
clear: both;
|
||||
font-size: 0.8em;
|
||||
text-align: center; /*right*/
|
||||
height: 50px; /*3em*/
|
||||
text-align: center;
|
||||
height: 50px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
|
@ -250,6 +276,7 @@ div.footer a {
|
|||
color: rgb(204,204,204);
|
||||
}
|
||||
|
||||
|
||||
/* -- body styles ----------------------------------------------------------- */
|
||||
|
||||
p {
|
||||
|
@ -263,7 +290,7 @@ a {
|
|||
|
||||
a:hover {
|
||||
color: rgb(200,200,210);
|
||||
text-shadow: rgb(51, 153, 255) 0px 0px 6px; /* */
|
||||
text-shadow: rgb(51, 153, 255) 0px 0px 6px;
|
||||
}
|
||||
|
||||
div.body a {
|
||||
|
@ -271,19 +298,18 @@ div.body a {
|
|||
}
|
||||
|
||||
h1 {
|
||||
margin: 10px 0 0 0;
|
||||
margin: 0.3em 0;
|
||||
font-size: 2.4em;
|
||||
color: rgb(51, 153, 255); /*#0A507A*/
|
||||
color: rgb(51, 153, 255);
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 1.em 0 0.2em 0;
|
||||
margin: 0.8em 0 0 0;
|
||||
font-size: 1.5em;
|
||||
font-weight: 300;
|
||||
padding: 0;
|
||||
color: rgb(51, 153, 255); /*#174967*/
|
||||
text-shadow: rgb(51, 153, 255) 0px 0px 10px; /* */
|
||||
color: rgb(51, 153, 255);
|
||||
}
|
||||
|
||||
h3 {
|
||||
|
@ -297,7 +323,7 @@ div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.b
|
|||
}
|
||||
|
||||
div.body h1 a tt, div.body h2 a tt, div.body h3 a tt, div.body h4 a tt, div.body h5 a tt, div.body h6 a tt {
|
||||
color: rgb(51, 153, 255) !important; /*#0A507A*/
|
||||
color: rgb(51, 153, 255) !important;
|
||||
font-size: inherit !important;
|
||||
}
|
||||
|
||||
|
@ -315,6 +341,11 @@ a.headerlink:hover {
|
|||
color: white!important;
|
||||
}
|
||||
|
||||
/* avoid font-size when :mod: role in headings */
|
||||
h1 code, h2 code, h3 code, h4 code {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
cite, code, tt {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
|
@ -322,12 +353,16 @@ cite, code, tt {
|
|||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
table.deprecated code.literal {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
code, tt {
|
||||
background-color: rgb(51,51,51); /*#f2f2f2*/
|
||||
border: 1px solid rgb(32,32,32); /*#ddd*/
|
||||
background-color: rgb(51,51,51);
|
||||
border: 1px solid rgb(32,32,32);
|
||||
border-radius: 3px;
|
||||
color: white; /*#333*/
|
||||
padding: 1px;
|
||||
color: white;
|
||||
padding: 1px 0.2em;
|
||||
}
|
||||
|
||||
.descname, .descclassname, .xref {
|
||||
|
@ -342,10 +377,6 @@ code, tt {
|
|||
color: rgb(160,160,255);
|
||||
}
|
||||
|
||||
/*tt.xref {
|
||||
color: rgb(200,200,255);
|
||||
}*/
|
||||
|
||||
hr {
|
||||
border: 1px solid rgb(170,187,204);
|
||||
margin: 2em;
|
||||
|
@ -361,15 +392,14 @@ a tt:hover, a code:hover{
|
|||
}
|
||||
|
||||
pre {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
font-family: 'Consolas', 'Courier New', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.015em;
|
||||
line-height: 120%;
|
||||
padding: 0.5em;
|
||||
border-radius: 4px; /*2px*/
|
||||
background-color: rgb(51,51,51); /*#f8f8f8*/
|
||||
border: 1px solid rgb(32,32,32);/*#ccc*/
|
||||
border-radius: 6px;
|
||||
background-color: rgb(51,51,51);
|
||||
}
|
||||
|
||||
pre a {
|
||||
|
@ -399,49 +429,41 @@ table {
|
|||
margin: 0 -0.5em 0 -0.5em;
|
||||
}
|
||||
|
||||
table td, table th {
|
||||
table td,
|
||||
table th
|
||||
{
|
||||
padding: 0.2em 0.5em 0.2em 0.5em;
|
||||
}
|
||||
|
||||
div.admonition, div.warning {
|
||||
font-size: 0.9em;
|
||||
margin: 1em 0 1em 0;
|
||||
border: 1px dashed rgb(32,32,32); /*#86989B*/
|
||||
border-radius: 12px;
|
||||
background-color: rgb(51,51,51); /*#f7f7f7*/
|
||||
padding: 0;
|
||||
div.admonition,
|
||||
div.warning
|
||||
{
|
||||
background-color: rgb(51,51,51);
|
||||
}
|
||||
|
||||
div.admonition p, div.warning p {
|
||||
margin: 0.5em 1em 0.5em 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition pre, div.warning pre {
|
||||
div.admonition > pre,
|
||||
div.warning > pre
|
||||
{
|
||||
margin: 0.4em 1em 0.4em 1em;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title,
|
||||
div.warning p.admonition-title {
|
||||
margin-top: 1em;
|
||||
padding-top: 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
border-color: rgb(101,16,16); /*#940000*/
|
||||
background-color: rgb(101,51,51); /*#FFCCCF*/
|
||||
border-color: rgb(101,16,16);
|
||||
/* background-color: rgb(101,51,51); /*#FFCCCF*/
|
||||
}
|
||||
|
||||
div.warning p.admonition-title {
|
||||
}
|
||||
|
||||
div.admonition ul, div.admonition ol,
|
||||
div.warning ul, div.warning ol {
|
||||
div.admonition > ul,
|
||||
div.admonition > ol,
|
||||
div.warning > ul,
|
||||
div.warning > ol {
|
||||
margin: 0.1em 0.5em 0.5em 3em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition div.highlight {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.viewcode-back {
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
'Verdana', sans-serif;
|
||||
|
@ -453,7 +475,13 @@ div.viewcode-block:target {
|
|||
border-bottom: 1px solid rgb(170,204,153);
|
||||
}
|
||||
|
||||
dt:target, .highlighted { /* */
|
||||
.contentstable {
|
||||
margin-left: 30px;
|
||||
margin: 0 auto;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
dt:target, .highlighted {
|
||||
background-color: rgb(251,229,78);
|
||||
background-image: url(hilight_background.png);
|
||||
border-top: 1px solid rgb(32,32,32);
|
||||
|
@ -475,57 +503,96 @@ div.deprecated span.versionmodified {
|
|||
text-shadow: 0px 0px 3px rgba(180,60,20,0.6);
|
||||
}
|
||||
|
||||
|
||||
/* Toc tree */
|
||||
div.toctree-wrapper ul {
|
||||
padding-left: 1.5em;
|
||||
list-style-type: disc;
|
||||
margin-top: 0.2em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
div.toctree-wrapper a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/* box for enumerations */
|
||||
div#enumerations > div.section {
|
||||
div#enumerations > div.section, /* older sphinx */
|
||||
section#enumerations > section /* newer sphinx */
|
||||
{
|
||||
border: 1px solid #202020;
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
div#enumerations > div.section h3 {
|
||||
div#enumerations > div.section h3, /* older sphinx */
|
||||
section#enumerations > section h3 /* newer sphinx */
|
||||
{
|
||||
background-color: #333;
|
||||
margin-top: 0;
|
||||
padding: 3px;
|
||||
padding: 2px 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div#enumerations > div.section dl,
|
||||
div#enumerations > div.section p {
|
||||
padding-left: 3px;
|
||||
div#enumerations > div.section > dl, /* older sphinx */
|
||||
div#enumerations > div.section > p,
|
||||
section#enumerations > section > dl, /* newer sphinx */
|
||||
section#enumerations > section > p
|
||||
{
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* box for classes */
|
||||
dd {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
dl.class {
|
||||
border: 1px solid #202020;
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
dl.class > dt {
|
||||
font-size: 1.2em;
|
||||
background-color: #333;
|
||||
padding: 2px;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
dl.class > dt em {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
dl.class dt{
|
||||
dl.class > dd {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* attributes/properties/methods/etc. */
|
||||
dl.attribute > dt,
|
||||
dl.method > dt,
|
||||
dl.function > dt,
|
||||
dl.data > dt
|
||||
{
|
||||
border-bottom: 1px solid #333;
|
||||
}
|
||||
|
||||
/* attributes/properties/methods/etc. */
|
||||
dl.attribute dd, dl.method dd, dl.data dd {
|
||||
padding-left: 6px;
|
||||
border-left: 1px solid rgba(200,200,255,0.4);
|
||||
dl.attribute > dd,
|
||||
dl.method > dd,
|
||||
dl.function > dd,
|
||||
dl.data > dd
|
||||
{
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
dl.field-list > dt {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
/* -- pygments fix ---------------------------------------------------------- */
|
||||
.highlight {
|
||||
background: none;
|
||||
}
|
||||
.highlight .go {
|
||||
color: white !important;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[theme]
|
||||
inherit = basic
|
||||
stylesheet = efl.css
|
||||
pygments_style = trac
|
||||
pygments_style = monokai
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Sphinx layout template for the sphinxdoc theme.
|
||||
|
||||
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- extends "basic/layout.html" %}
|
||||
|
@ -14,8 +14,8 @@
|
|||
{% block sidebar2 %}{% endblock %}
|
||||
|
||||
{% block extrahead %}
|
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
rel='stylesheet' type='text/css'>
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
rel='stylesheet' type='text/css' />
|
||||
{{ super() }}
|
||||
{%- if not embedded %}
|
||||
<style type="text/css">
|
||||
|
@ -25,7 +25,7 @@
|
|||
.related { display: none; }
|
||||
{% endif %}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
// intelligent scrolling of the sidebar content
|
||||
$(window).scroll(function() {
|
||||
var sb = $('.sphinxsidebarwrapper');
|
||||
|
@ -57,17 +57,17 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block rootrellink %}
|
||||
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
||||
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
||||
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
||||
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<div class="pageheader">
|
||||
<ul>
|
||||
<li><a href="{{ pathto('index') }}">Home</a></li>
|
||||
<li><a href="{{ pathto('install') }}">Get it</a></li>
|
||||
<li><a href="{{ pathto('usage/installation') }}">Get it</a></li>
|
||||
<li><a href="{{ pathto('contents') }}">Docs</a></li>
|
||||
<li><a href="{{ pathto('develop') }}">Extend/Develop</a></li>
|
||||
<li><a href="{{ pathto('development/index') }}">Extend</a></li>
|
||||
</ul>
|
||||
<div>
|
||||
<a href="{{ pathto('index') }}">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Sphinx stylesheet -- sphinx13 theme.
|
||||
*
|
||||
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
@ -127,6 +127,7 @@ div.sphinxsidebar {
|
|||
float: right;
|
||||
font-size: 1em;
|
||||
text-align: left;
|
||||
max-height: 0px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .logo {
|
||||
|
@ -140,11 +141,41 @@ div.sphinxsidebar .logo img {
|
|||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .download a img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.subscribeformwrapper {
|
||||
display: block;
|
||||
overflow: auto;
|
||||
margin-bottom: 1.2em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid #aaa;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
'Verdana', sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input {
|
||||
border: 1px solid #aaa;
|
||||
font-size: 0.9em;
|
||||
float: left;
|
||||
padding: 0.25em 0.5em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="text"] {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="submit"] {
|
||||
width: 40%;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 {
|
||||
|
@ -208,7 +239,7 @@ div.footer a {
|
|||
|
||||
/* -- body styles ----------------------------------------------------------- */
|
||||
|
||||
p {
|
||||
p {
|
||||
margin: 0.8em 0 0.5em 0;
|
||||
}
|
||||
|
||||
|
@ -269,6 +300,11 @@ a.headerlink:hover {
|
|||
color: white!important;
|
||||
}
|
||||
|
||||
/* avoid font-size when :mod: role in headings */
|
||||
h1 code, h2 code, h3 code, h4 code {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
cite, code, tt {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
|
@ -276,12 +312,16 @@ cite, code, tt {
|
|||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
table.deprecated code.literal {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
tt {
|
||||
background-color: #f2f2f2;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 2px;
|
||||
color: #333;
|
||||
padding: 1px;
|
||||
padding: 1px 0.2em;
|
||||
}
|
||||
|
||||
tt.descname, tt.descclassname, tt.xref {
|
||||
|
@ -303,7 +343,7 @@ a tt:hover {
|
|||
}
|
||||
|
||||
pre {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
font-family: 'Consolas', 'Courier New', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.015em;
|
||||
|
@ -354,36 +394,37 @@ div.admonition, div.warning {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition p, div.warning p {
|
||||
div.admonition > p, div.warning > p {
|
||||
margin: 0.5em 1em 0.5em 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition pre, div.warning pre {
|
||||
div.admonition > pre, div.warning > pre {
|
||||
margin: 0.4em 1em 0.4em 1em;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title,
|
||||
div.warning p.admonition-title {
|
||||
margin-top: 1em;
|
||||
padding-top: 0.5em;
|
||||
div.admonition > p.admonition-title,
|
||||
div.warning > p.admonition-title {
|
||||
margin-top: 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
border: 1px solid #940000;
|
||||
/* background-color: #FFCCCF;*/
|
||||
}
|
||||
|
||||
div.warning p.admonition-title {
|
||||
}
|
||||
|
||||
div.admonition ul, div.admonition ol,
|
||||
div.warning ul, div.warning ol {
|
||||
div.admonition > ul,
|
||||
div.admonition > ol,
|
||||
div.warning > ul,
|
||||
div.warning > ol {
|
||||
margin: 0.1em 0.5em 0.5em 3em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition div.highlight {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.viewcode-back {
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
'Verdana', sans-serif;
|
||||
|
@ -394,3 +435,9 @@ div.viewcode-block:target {
|
|||
border-top: 1px solid #ac9;
|
||||
border-bottom: 1px solid #ac9;
|
||||
}
|
||||
|
||||
.contentstable {
|
||||
margin-left: 30px;
|
||||
margin: 0 auto;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
Tutorial 1 - Window
|
||||
===================
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mattis id dui
|
||||
vitae lobortis. Fusce et tempus ipsum. Nulla non luctus urna. Pellentesque et
|
||||
luctus diam. Etiam fermentum vestibulum nisi, eget vestibulum turpis aliquet vitae.
|
||||
Integer interdum enim eu lacus pulvinar malesuada. Ut urna mi, congue non
|
||||
pellentesque id, varius eget diam. Ut placerat neque sed orci tincidunt consequat.
|
||||
Cras fermentum fringilla pulvinar. Ut tempor turpis odio.
|
||||
|
||||
Vivamus sed magna tempor orci pharetra dapibus. Phasellus est elit, rhoncus
|
||||
vitae consequat id, semper at ligula. Sed vitae odio tempor, maximus mi placerat,
|
||||
faucibus metus. Quisque eget mauris quis ex gravida iaculis finibus vitae arcu.
|
||||
Morbi non porttitor velit. Nullam pretium ex neque, ac malesuada felis dapibus
|
||||
sodales. Pellentesque tristique est vel accumsan lobortis. Curabitur viverra
|
||||
diam sit amet odio tincidunt pellentesque. Vestibulum non eros orci. Aliquam
|
||||
accumsan convallis ullamcorper. Donec tristique massa nec massa venenatis tempus.
|
||||
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
||||
himenaeos. Aliquam augue nibh, viverra at urna in, lacinia maximus leo.
|
||||
Nullam vestibulum lobortis elementum.
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
Tutorial 2 - Size Hints
|
||||
=======================
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mattis id dui
|
||||
vitae lobortis. Fusce et tempus ipsum. Nulla non luctus urna. Pellentesque et
|
||||
luctus diam. Etiam fermentum vestibulum nisi, eget vestibulum turpis aliquet vitae.
|
||||
Integer interdum enim eu lacus pulvinar malesuada. Ut urna mi, congue non
|
||||
pellentesque id, varius eget diam. Ut placerat neque sed orci tincidunt consequat.
|
||||
Cras fermentum fringilla pulvinar. Ut tempor turpis odio.
|
||||
|
||||
Vivamus sed magna tempor orci pharetra dapibus. Phasellus est elit, rhoncus
|
||||
vitae consequat id, semper at ligula. Sed vitae odio tempor, maximus mi placerat,
|
||||
faucibus metus. Quisque eget mauris quis ex gravida iaculis finibus vitae arcu.
|
||||
Morbi non porttitor velit. Nullam pretium ex neque, ac malesuada felis dapibus
|
||||
sodales. Pellentesque tristique est vel accumsan lobortis. Curabitur viverra
|
||||
diam sit amet odio tincidunt pellentesque. Vestibulum non eros orci. Aliquam
|
||||
accumsan convallis ullamcorper. Donec tristique massa nec massa venenatis tempus.
|
||||
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
||||
himenaeos. Aliquam augue nibh, viverra at urna in, lacinia maximus leo.
|
||||
Nullam vestibulum lobortis elementum.
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -16,9 +16,26 @@
|
|||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# semver examples:
|
||||
# development: "1.12.99" ( 1, 12, 99 )
|
||||
# pre-release: "1.13.0-beta1" ( 1, 13, 0 )
|
||||
# release: "1.13.0" ( 1, 13, 0 )
|
||||
# development: '1.12.99' ( 1, 12, 99 )
|
||||
# pre-release: '1.13.0-beta1' ( 1, 13, 0 )
|
||||
# release: '1.13.0' ( 1, 13, 0 )
|
||||
|
||||
__version__ = "1.16.0"
|
||||
__version_info__ = ( 1, 16, 0 )
|
||||
__version__ = '1.26.99'
|
||||
__version_info__ = (1, 26, 99)
|
||||
|
||||
|
||||
__all__ = [
|
||||
'dbus_mainloop',
|
||||
'ecore',
|
||||
'ecore_con',
|
||||
'ecore_input',
|
||||
'ecore_x',
|
||||
'edje',
|
||||
'edje_edit',
|
||||
'elementary',
|
||||
'emotion',
|
||||
'eo',
|
||||
'ethumb',
|
||||
'evas',
|
||||
'utils',
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
* Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
*
|
||||
* This file is part of Python-EFL.
|
||||
*
|
||||
|
@ -30,9 +30,9 @@ static int _e_dbus_log_dom = -1;
|
|||
#define WARN(...) EINA_LOG_DOM_WARN(_e_dbus_log_dom, __VA_ARGS__)
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_e_dbus_log_dom, __VA_ARGS__)
|
||||
|
||||
static int connection_slot = -1;
|
||||
static int e_dbus_idler_active = 0;
|
||||
static int close_connection = 0;
|
||||
static int _edbus_connection_slot = -1;
|
||||
static int _edbus_idler_active = 0;
|
||||
static int _edbus_close_connection = 0;
|
||||
static int _edbus_init_count = 0;
|
||||
|
||||
// change this define for extra debug
|
||||
|
@ -43,8 +43,7 @@ static int _edbus_init_count = 0;
|
|||
static Eina_Bool
|
||||
e_dbus_idler(void *data)
|
||||
{
|
||||
E_DBus_Connection *cd;
|
||||
cd = data;
|
||||
E_DBus_Connection *cd = data;
|
||||
|
||||
if (DBUS_DISPATCH_COMPLETE == dbus_connection_get_dispatch_status(cd->conn))
|
||||
{
|
||||
|
@ -52,18 +51,18 @@ e_dbus_idler(void *data)
|
|||
cd->idler = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
e_dbus_idler_active++;
|
||||
_edbus_idler_active++;
|
||||
dbus_connection_ref(cd->conn);
|
||||
DBG("dispatch()");
|
||||
dbus_connection_dispatch(cd->conn);
|
||||
dbus_connection_unref(cd->conn);
|
||||
e_dbus_idler_active--;
|
||||
if (!e_dbus_idler_active && close_connection)
|
||||
_edbus_idler_active--;
|
||||
if (!_edbus_idler_active && _edbus_close_connection)
|
||||
{
|
||||
do
|
||||
{
|
||||
e_dbus_connection_close(cd);
|
||||
} while (--close_connection);
|
||||
} while (--_edbus_close_connection);
|
||||
}
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
@ -71,10 +70,12 @@ e_dbus_idler(void *data)
|
|||
static void
|
||||
cb_dispatch_status(DBusConnection *conn, DBusDispatchStatus new_status, void *data)
|
||||
{
|
||||
E_DBus_Connection *cd;
|
||||
E_DBus_Connection *cd = data;
|
||||
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
DBG("dispatch status: %d!", new_status);
|
||||
cd = data;
|
||||
|
||||
if (new_status == DBUS_DISPATCH_DATA_REMAINS && !cd->idler)
|
||||
cd->idler = ecore_idler_add(e_dbus_idler, cd);
|
||||
|
@ -192,6 +193,9 @@ cb_watch_del(DBusWatch *watch, void *data)
|
|||
{
|
||||
E_DBus_Handler_Data *hd;
|
||||
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
DDBG("Watch del on fd: %d (flags: %d)", dbus_watch_get_unix_fd(watch),
|
||||
dbus_watch_get_flags(watch));
|
||||
|
||||
|
@ -212,6 +216,9 @@ cb_watch_toggle(DBusWatch *watch, void *data)
|
|||
{
|
||||
E_DBus_Handler_Data *hd;
|
||||
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
DDBG("Watch toggle on fd: %d (flags: %d) enable: %d",
|
||||
dbus_watch_get_unix_fd(watch), dbus_watch_get_flags(watch),
|
||||
dbus_watch_get_enabled(watch));
|
||||
|
@ -225,19 +232,15 @@ cb_watch_toggle(DBusWatch *watch, void *data)
|
|||
static Eina_Bool
|
||||
e_dbus_timeout_handler(void *data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td;
|
||||
E_DBus_Timeout_Data *td = data;
|
||||
|
||||
td = data;
|
||||
DBG("timeout expired!");
|
||||
|
||||
if (!dbus_timeout_get_enabled(td->timeout))
|
||||
{
|
||||
DBG("timeout_handler (not enabled, ending)");
|
||||
td->handler = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
if (dbus_timeout_get_enabled(td->timeout))
|
||||
dbus_timeout_handle(td->timeout);
|
||||
|
||||
DBG("timeout handler!");
|
||||
dbus_timeout_handle(td->timeout);
|
||||
td->cd->timeouts = eina_list_remove(td->cd->timeouts, td->handler);
|
||||
td->handler = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
|
@ -245,7 +248,8 @@ static void
|
|||
e_dbus_timeout_data_free(void *timeout_data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td = timeout_data;
|
||||
DBG("e_dbus_timeout_data_free");
|
||||
|
||||
DBG("timeout data free!");
|
||||
if (td->handler) ecore_timer_del(td->handler);
|
||||
free(td);
|
||||
}
|
||||
|
@ -253,21 +257,23 @@ e_dbus_timeout_data_free(void *timeout_data)
|
|||
static dbus_bool_t
|
||||
cb_timeout_add(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
E_DBus_Connection *cd;
|
||||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Timeout_Data *td;
|
||||
double interval = (double)dbus_timeout_get_interval(timeout) / 1000;
|
||||
|
||||
DBG("timeout add! enabled: %d, interval: %.2f secs",
|
||||
dbus_timeout_get_enabled(timeout), interval);
|
||||
|
||||
cd = data;
|
||||
DBG("timeout add!");
|
||||
td = calloc(1, sizeof(E_DBus_Timeout_Data));
|
||||
td->cd = cd;
|
||||
td->timeout = timeout;
|
||||
dbus_timeout_set_data(timeout, (void *)td, e_dbus_timeout_data_free);
|
||||
|
||||
td->interval = dbus_timeout_get_interval(timeout);
|
||||
td->timeout = timeout;
|
||||
|
||||
if (dbus_timeout_get_enabled(timeout))
|
||||
td->handler = ecore_timer_add(td->interval, e_dbus_timeout_handler, td);
|
||||
td->cd->timeouts = eina_list_append(td->cd->timeouts, td->handler);
|
||||
{
|
||||
td->handler = ecore_timer_add(interval, e_dbus_timeout_handler, td);
|
||||
cd->timeouts = eina_list_append(cd->timeouts, td->handler);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -275,14 +281,14 @@ cb_timeout_add(DBusTimeout *timeout, void *data)
|
|||
static void
|
||||
cb_timeout_del(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td;
|
||||
DBG("timeout del!");
|
||||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Timeout_Data *td = dbus_timeout_get_data(timeout);
|
||||
|
||||
td = (E_DBus_Timeout_Data *)dbus_timeout_get_data(timeout);
|
||||
DBG("timeout del!");
|
||||
|
||||
if (td->handler)
|
||||
{
|
||||
td->cd->timeouts = eina_list_remove(td->cd->timeouts, td->handler);
|
||||
cd->timeouts = eina_list_remove(cd->timeouts, td->handler);
|
||||
ecore_timer_del(td->handler);
|
||||
td->handler = NULL;
|
||||
}
|
||||
|
@ -293,18 +299,20 @@ cb_timeout_del(DBusTimeout *timeout, void *data)
|
|||
static void
|
||||
cb_timeout_toggle(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td;
|
||||
DBG("timeout toggle!");
|
||||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Timeout_Data *td = dbus_timeout_get_data(timeout);
|
||||
double interval = (double)dbus_timeout_get_interval(timeout) / 1000;
|
||||
|
||||
td = (E_DBus_Timeout_Data *)dbus_timeout_get_data(timeout);
|
||||
DBG("timeout toggle!");
|
||||
|
||||
if (dbus_timeout_get_enabled(td->timeout))
|
||||
{
|
||||
td->interval = dbus_timeout_get_interval(timeout);
|
||||
td->handler = ecore_timer_add(td->interval, e_dbus_timeout_handler, td);
|
||||
td->handler = ecore_timer_add(interval, e_dbus_timeout_handler, td);
|
||||
cd->timeouts = eina_list_append(cd->timeouts, td->handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
cd->timeouts = eina_list_remove(cd->timeouts, td->handler);
|
||||
ecore_timer_del(td->handler);
|
||||
td->handler = NULL;
|
||||
}
|
||||
|
@ -330,9 +338,12 @@ e_dbus_connection_free(void *data)
|
|||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Handler_Data *hd;
|
||||
Ecore_Timer *timer;
|
||||
DBG("e_dbus_connection free!");
|
||||
Eina_List *l, *ll;
|
||||
|
||||
EINA_LIST_FREE(cd->fd_handlers, hd)
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(cd->fd_handlers, l, ll, hd)
|
||||
e_dbus_fd_handler_del(hd);
|
||||
|
||||
EINA_LIST_FREE(cd->timeouts, timer)
|
||||
|
@ -404,9 +415,9 @@ e_dbus_connection_setup(DBusConnection *conn)
|
|||
|
||||
/* connection_setup */
|
||||
dbus_connection_set_exit_on_disconnect(cd->conn, EINA_FALSE);
|
||||
dbus_connection_allocate_data_slot(&connection_slot);
|
||||
dbus_connection_allocate_data_slot(&_edbus_connection_slot);
|
||||
|
||||
dbus_connection_set_data(cd->conn, connection_slot, (void *)cd,
|
||||
dbus_connection_set_data(cd->conn, _edbus_connection_slot, (void *)cd,
|
||||
e_dbus_connection_free);
|
||||
dbus_connection_set_watch_functions(cd->conn,
|
||||
cb_watch_add,
|
||||
|
@ -434,14 +445,13 @@ e_dbus_connection_close(E_DBus_Connection *conn)
|
|||
if (!conn) return;
|
||||
DBG("e_dbus_connection_close");
|
||||
|
||||
if (e_dbus_idler_active)
|
||||
if (_edbus_idler_active)
|
||||
{
|
||||
close_connection++;
|
||||
_edbus_close_connection++;
|
||||
return;
|
||||
}
|
||||
if (--(conn->refcount) != 0) return;
|
||||
|
||||
dbus_connection_free_data_slot(&connection_slot);
|
||||
dbus_connection_free_data_slot(&_edbus_connection_slot);
|
||||
dbus_connection_set_watch_functions(conn->conn,
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
* Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
*
|
||||
* This file is part of Python-EFL.
|
||||
*
|
||||
|
@ -35,7 +35,6 @@ struct E_DBus_Connection
|
|||
Eina_List *fd_handlers;
|
||||
Eina_List *timeouts;
|
||||
Ecore_Idler *idler;
|
||||
int refcount;
|
||||
};
|
||||
|
||||
struct E_DBus_Handler_Data
|
||||
|
@ -52,7 +51,6 @@ struct E_DBus_Timeout_Data
|
|||
Ecore_Timer *handler;
|
||||
DBusTimeout *timeout;
|
||||
E_DBus_Connection *cd;
|
||||
int interval;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -114,6 +114,8 @@ Flags for executing a child with its stdin and/or stdout piped back.
|
|||
Makes child receive SIGTERM when parent dies
|
||||
|
||||
|
||||
.. _Ecore_Callback_Returns:
|
||||
|
||||
Callback return values
|
||||
----------------------
|
||||
|
||||
|
@ -126,6 +128,8 @@ Callback return values
|
|||
Return value to keep a callback
|
||||
|
||||
|
||||
.. _Ecore_Event_Returns:
|
||||
|
||||
Event return values
|
||||
-------------------
|
||||
|
||||
|
@ -253,10 +257,85 @@ from cpython cimport Py_INCREF, Py_DECREF
|
|||
import traceback
|
||||
import atexit
|
||||
|
||||
cimport efl.ecore.enums as enums
|
||||
|
||||
ECORE_EVENT_NONE = enums.ECORE_EVENT_NONE
|
||||
ECORE_EVENT_SIGNAL_USER = enums.ECORE_EVENT_SIGNAL_USER
|
||||
ECORE_EVENT_SIGNAL_HUP = enums.ECORE_EVENT_SIGNAL_HUP
|
||||
ECORE_EVENT_SIGNAL_EXIT = enums.ECORE_EVENT_SIGNAL_EXIT
|
||||
ECORE_EVENT_SIGNAL_POWER = enums.ECORE_EVENT_SIGNAL_POWER
|
||||
ECORE_EVENT_SIGNAL_REALTIME = enums.ECORE_EVENT_SIGNAL_REALTIME
|
||||
ECORE_EVENT_MEMORY_STATE = enums.ECORE_EVENT_MEMORY_STATE
|
||||
ECORE_EVENT_POWER_STATE = enums.ECORE_EVENT_POWER_STATE
|
||||
ECORE_EVENT_LOCALE_CHANGED = enums.ECORE_EVENT_LOCALE_CHANGED
|
||||
ECORE_EVENT_HOSTNAME_CHANGED = enums.ECORE_EVENT_HOSTNAME_CHANGED
|
||||
ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED = enums.ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED
|
||||
ECORE_EVENT_COUNT = enums.ECORE_EVENT_COUNT
|
||||
|
||||
ECORE_CALLBACK_CANCEL = enums.ECORE_CALLBACK_CANCEL
|
||||
ECORE_CALLBACK_RENEW = enums.ECORE_CALLBACK_RENEW
|
||||
|
||||
ECORE_CALLBACK_PASS_ON = enums.ECORE_CALLBACK_PASS_ON
|
||||
ECORE_CALLBACK_DONE = enums.ECORE_CALLBACK_DONE
|
||||
|
||||
ECORE_EXE_PRIORITY_INHERIT = enums.ECORE_EXE_PRIORITY_INHERIT
|
||||
|
||||
ECORE_EXE_EVENT_ADD = enums.ECORE_EXE_EVENT_ADD
|
||||
ECORE_EXE_EVENT_DEL = enums.ECORE_EXE_EVENT_DEL
|
||||
ECORE_EXE_EVENT_DATA = enums.ECORE_EXE_EVENT_DATA
|
||||
ECORE_EXE_EVENT_ERROR = enums.ECORE_EXE_EVENT_ERROR
|
||||
|
||||
ECORE_FD_READ = enums.ECORE_FD_READ
|
||||
ECORE_FD_WRITE = enums.ECORE_FD_WRITE
|
||||
ECORE_FD_ERROR = enums.ECORE_FD_ERROR
|
||||
|
||||
ECORE_EXE_NONE = enums.ECORE_EXE_NONE
|
||||
ECORE_EXE_PIPE_READ = enums.ECORE_EXE_PIPE_READ
|
||||
ECORE_EXE_PIPE_WRITE = enums.ECORE_EXE_PIPE_WRITE
|
||||
ECORE_EXE_PIPE_ERROR = enums.ECORE_EXE_PIPE_ERROR
|
||||
ECORE_EXE_PIPE_READ_LINE_BUFFERED = enums.ECORE_EXE_PIPE_READ_LINE_BUFFERED
|
||||
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = enums.ECORE_EXE_PIPE_ERROR_LINE_BUFFERED
|
||||
ECORE_EXE_PIPE_AUTO = enums.ECORE_EXE_PIPE_AUTO
|
||||
ECORE_EXE_RESPAWN = enums.ECORE_EXE_RESPAWN
|
||||
ECORE_EXE_USE_SH = enums.ECORE_EXE_USE_SH
|
||||
ECORE_EXE_NOT_LEADER = enums.ECORE_EXE_NOT_LEADER
|
||||
ECORE_EXE_TERM_WITH_PARENT = enums.ECORE_EXE_TERM_WITH_PARENT
|
||||
|
||||
ECORE_POS_MAP_LINEAR = enums.ECORE_POS_MAP_LINEAR
|
||||
ECORE_POS_MAP_ACCELERATE = enums.ECORE_POS_MAP_ACCELERATE
|
||||
ECORE_POS_MAP_DECELERATE = enums.ECORE_POS_MAP_DECELERATE
|
||||
ECORE_POS_MAP_SINUSOIDAL = enums.ECORE_POS_MAP_SINUSOIDAL
|
||||
ECORE_POS_MAP_ACCELERATE_FACTOR = enums.ECORE_POS_MAP_ACCELERATE_FACTOR
|
||||
ECORE_POS_MAP_DECELERATE_FACTOR = enums.ECORE_POS_MAP_DECELERATE_FACTOR
|
||||
ECORE_POS_MAP_SINUSOIDAL_FACTOR = enums.ECORE_POS_MAP_SINUSOIDAL_FACTOR
|
||||
ECORE_POS_MAP_DIVISOR_INTERP = enums.ECORE_POS_MAP_DIVISOR_INTERP
|
||||
ECORE_POS_MAP_BOUNCE = enums.ECORE_POS_MAP_BOUNCE
|
||||
ECORE_POS_MAP_SPRING = enums.ECORE_POS_MAP_SPRING
|
||||
ECORE_POS_MAP_CUBIC_BEZIER = enums.ECORE_POS_MAP_CUBIC_BEZIER
|
||||
|
||||
ECORE_ANIMATOR_SOURCE_TIMER = enums.ECORE_ANIMATOR_SOURCE_TIMER
|
||||
ECORE_ANIMATOR_SOURCE_CUSTOM = enums.ECORE_ANIMATOR_SOURCE_CUSTOM
|
||||
|
||||
ECORE_POLLER_CORE = enums.ECORE_POLLER_CORE
|
||||
|
||||
|
||||
ECORE_FILE_EVENT_NONE = enums.ECORE_FILE_EVENT_NONE
|
||||
ECORE_FILE_EVENT_CREATED_FILE = enums.ECORE_FILE_EVENT_CREATED_FILE
|
||||
ECORE_FILE_EVENT_CREATED_DIRECTORY = enums.ECORE_FILE_EVENT_CREATED_DIRECTORY
|
||||
ECORE_FILE_EVENT_DELETED_FILE = enums.ECORE_FILE_EVENT_DELETED_FILE
|
||||
ECORE_FILE_EVENT_DELETED_DIRECTORY = enums.ECORE_FILE_EVENT_DELETED_DIRECTORY
|
||||
ECORE_FILE_EVENT_DELETED_SELF = enums.ECORE_FILE_EVENT_DELETED_SELF
|
||||
ECORE_FILE_EVENT_MODIFIED = enums.ECORE_FILE_EVENT_MODIFIED
|
||||
ECORE_FILE_EVENT_CLOSED = enums.ECORE_FILE_EVENT_CLOSED
|
||||
|
||||
ECORE_FILE_PROGRESS_CONTINUE = enums.ECORE_FILE_PROGRESS_CONTINUE
|
||||
ECORE_FILE_PROGRESS_ABORT = enums.ECORE_FILE_PROGRESS_ABORT
|
||||
|
||||
|
||||
cdef Eina_Bool _ecore_task_cb(void *data) with gil:
|
||||
cdef Eo obj = <Eo>data
|
||||
cdef Eina_Bool ret
|
||||
cdef:
|
||||
Eo obj = <Eo>data
|
||||
Eina_Bool ret
|
||||
|
||||
try:
|
||||
ret = obj._task_exec()
|
||||
|
@ -283,15 +362,15 @@ def init():
|
|||
|
||||
global _event_type_mapping
|
||||
_event_type_mapping = {
|
||||
ECORE_EVENT_SIGNAL_USER: EventSignalUser,
|
||||
ECORE_EVENT_SIGNAL_HUP: EventSignalHup,
|
||||
ECORE_EVENT_SIGNAL_EXIT: EventSignalExit,
|
||||
ECORE_EVENT_SIGNAL_POWER: EventSignalPower,
|
||||
ECORE_EVENT_SIGNAL_REALTIME: EventSignalRealtime,
|
||||
ECORE_EXE_EVENT_ADD: EventExeAdd,
|
||||
ECORE_EXE_EVENT_DEL: EventExeDel,
|
||||
ECORE_EXE_EVENT_DATA: EventExeData,
|
||||
ECORE_EXE_EVENT_ERROR: EventExeData,
|
||||
enums.ECORE_EVENT_SIGNAL_USER: EventSignalUser,
|
||||
enums.ECORE_EVENT_SIGNAL_HUP: EventSignalHup,
|
||||
enums.ECORE_EVENT_SIGNAL_EXIT: EventSignalExit,
|
||||
enums.ECORE_EVENT_SIGNAL_POWER: EventSignalPower,
|
||||
enums.ECORE_EVENT_SIGNAL_REALTIME: EventSignalRealtime,
|
||||
enums.ECORE_EXE_EVENT_ADD: EventExeAdd,
|
||||
enums.ECORE_EXE_EVENT_DEL: EventExeDel,
|
||||
enums.ECORE_EXE_EVENT_DATA: EventExeData,
|
||||
enums.ECORE_EXE_EVENT_ERROR: EventExeData,
|
||||
}
|
||||
|
||||
ecore_file_init()
|
||||
|
@ -346,27 +425,30 @@ init()
|
|||
atexit.register(shutdown)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# This conflict seems to not exists anymore, see tests/ecore/test_08_exe.py
|
||||
#---------------------------------------------------------------------------
|
||||
# let's try to warn users that ecore conflicts with subprocess module
|
||||
import subprocess
|
||||
|
||||
_orig_subprocess = None
|
||||
|
||||
def subprocess_warning(*a, **ka):
|
||||
print(""" DEVELOPER WARNING:
|
||||
Using subprocess (Popen and derivatives) with Ecore is a bad idea.
|
||||
|
||||
Ecore will set some signal handlers subprocess module depends and this
|
||||
may cause this module to operate unexpectedly.
|
||||
|
||||
Instead of using subprocess.Popen(), please consider using Ecore's
|
||||
Exe() class.
|
||||
""")
|
||||
return _orig_subprocess(*a, **ka)
|
||||
|
||||
if subprocess.Popen is not subprocess_warning:
|
||||
_orig_subprocess = subprocess.Popen
|
||||
subprocess.Popen = subprocess_warning
|
||||
# import subprocess
|
||||
#
|
||||
# _orig_subprocess = None
|
||||
#
|
||||
# def subprocess_warning(*a, **ka):
|
||||
# print(""" DEVELOPER WARNING:
|
||||
# Using subprocess (Popen and derivatives) with Ecore is a bad idea.
|
||||
#
|
||||
# Ecore will set some signal handlers subprocess module depends and this
|
||||
# may cause this module to operate unexpectedly.
|
||||
#
|
||||
# Instead of using subprocess.Popen(), please consider using Ecore's
|
||||
# Exe() class.
|
||||
# """)
|
||||
# traceback.print_stack()
|
||||
# return _orig_subprocess(*a, **ka)
|
||||
#
|
||||
# if subprocess.Popen is not subprocess_warning:
|
||||
# _orig_subprocess = subprocess.Popen
|
||||
# subprocess.Popen = subprocess_warning
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -40,7 +40,7 @@ cdef class Animator(Eo):
|
|||
|
||||
"""
|
||||
def __init__(self, func, *args, **kargs):
|
||||
"""Animator(...)
|
||||
"""
|
||||
|
||||
:param func: function to call at every frame.
|
||||
:type func: callable
|
||||
|
@ -60,27 +60,44 @@ cdef class Animator(Eo):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_animator_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 animators are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_animator_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_animator_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return "%s Animator(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Animator(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s Animator(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Animator(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_animator_del(self.obj)
|
||||
ecore_animator_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
def stop(self):
|
||||
"""Alias for delete()."""
|
||||
self.delete()
|
||||
|
||||
|
||||
cdef Eina_Bool _ecore_timeline_cb(void *data, double pos) with gil:
|
||||
assert data != NULL
|
||||
cdef:
|
||||
|
@ -124,7 +141,7 @@ cdef class AnimatorTimeline(Animator):
|
|||
"""
|
||||
|
||||
def __init__(self, func, double runtime, *args, **kargs):
|
||||
"""AnimatorTimeline(...)
|
||||
"""
|
||||
|
||||
:param func: The function to call when it ticks off
|
||||
:type func: callable
|
||||
|
@ -146,11 +163,17 @@ cdef class AnimatorTimeline(Animator):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_animator_timeline_add(runtime, _ecore_timeline_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 animators are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_animator_timeline_add(runtime, _ecore_timeline_cb, <void *>self))
|
||||
self.obj2 = ecore_animator_timeline_add(runtime, _ecore_timeline_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
|
||||
def animator_add(func, *args, **kargs):
|
||||
"""Animator factory, for C-api compatibility.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -29,6 +29,11 @@ cdef object _event_mapping_register(int type, cls):
|
|||
cdef object _event_mapping_unregister(int type):
|
||||
_event_type_mapping.pop(type)
|
||||
|
||||
cdef object _event_mapping_get(int type):
|
||||
if not type in _event_type_mapping:
|
||||
raise ValueError("event type '%d' not registered." % type)
|
||||
return _event_type_mapping.get(type)
|
||||
|
||||
|
||||
cdef Eina_Bool event_handler_cb(void *data, int type, void *event) with gil:
|
||||
cdef EventHandler handler
|
||||
|
@ -65,6 +70,9 @@ cdef class Event(object):
|
|||
cdef int _set_obj(self, void *obj) except 0:
|
||||
raise NotImplementedError("Event._set_obj() not implemented.")
|
||||
|
||||
cdef object _get_obj(self):
|
||||
raise NotImplementedError("Event._get_obj() not implemented.")
|
||||
|
||||
|
||||
cdef class EventHandler(object):
|
||||
def __init__(self, int type, func, *args, **kargs):
|
||||
|
@ -73,7 +81,7 @@ cdef class EventHandler(object):
|
|||
raise TypeError("Parameter 'func' must be callable")
|
||||
event_cls = _event_type_mapping.get(type, None)
|
||||
if event_cls is None:
|
||||
raise ValueError("Unknow Ecore_Event type %d" % type)
|
||||
raise ValueError("Unknown Ecore_Event type %d" % type)
|
||||
self.type = type
|
||||
self.event_cls = event_cls
|
||||
self.func = func
|
||||
|
@ -166,7 +174,7 @@ cdef class EventSignalUser2(EventSignalUser):
|
|||
|
||||
cdef class EventHandlerSignalUser(EventHandler):
|
||||
def __init__(self, func, *args, **kargs):
|
||||
EventHandler.__init__(self, ECORE_EVENT_SIGNAL_USER,
|
||||
EventHandler.__init__(self, enums.ECORE_EVENT_SIGNAL_USER,
|
||||
func, *args, **kargs)
|
||||
|
||||
cdef Eina_Bool _exec(self, void *event) except 2:
|
||||
|
@ -198,7 +206,7 @@ cdef class EventSignalHup(Event):
|
|||
|
||||
|
||||
def on_signal_hup(func, *args, **kargs):
|
||||
return EventHandler(ECORE_EVENT_SIGNAL_HUP, func, *args, **kargs)
|
||||
return EventHandler(enums.ECORE_EVENT_SIGNAL_HUP, func, *args, **kargs)
|
||||
|
||||
|
||||
cdef class EventSignalExit(Event):
|
||||
|
@ -245,7 +253,7 @@ cdef class EventSignalTerminate(EventSignalExit):
|
|||
|
||||
cdef class EventHandlerSignalExit(EventHandler):
|
||||
def __init__(self, func, *args, **kargs):
|
||||
EventHandler.__init__(self, ECORE_EVENT_SIGNAL_EXIT,
|
||||
EventHandler.__init__(self, enums.ECORE_EVENT_SIGNAL_EXIT,
|
||||
func, *args, **kargs)
|
||||
|
||||
cdef Eina_Bool _exec(self, void *event) except 2:
|
||||
|
@ -279,7 +287,7 @@ cdef class EventSignalPower(Event):
|
|||
|
||||
|
||||
def on_signal_power(func, *args, **kargs):
|
||||
return EventHandler(ECORE_EVENT_SIGNAL_POWER, func, *args, **kargs)
|
||||
return EventHandler(enums.ECORE_EVENT_SIGNAL_POWER, func, *args, **kargs)
|
||||
|
||||
|
||||
cdef class EventSignalRealtime(Event):
|
||||
|
@ -297,7 +305,7 @@ cdef class EventSignalRealtime(Event):
|
|||
|
||||
|
||||
def on_signal_realtime(func, *args, **kargs):
|
||||
return EventHandler(ECORE_EVENT_SIGNAL_REALTIME, func, *args, **kargs)
|
||||
return EventHandler(enums.ECORE_EVENT_SIGNAL_REALTIME, func, *args, **kargs)
|
||||
|
||||
|
||||
cdef class CustomEvent(Event):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -25,24 +25,28 @@ cdef extern from "Python.h":
|
|||
|
||||
cdef exe_flags2str(int value):
|
||||
flags = []
|
||||
if value & ECORE_EXE_PIPE_READ:
|
||||
if value & enums.ECORE_EXE_PIPE_READ:
|
||||
flags.append("PIPE_READ")
|
||||
if value & ECORE_EXE_PIPE_WRITE:
|
||||
if value & enums.ECORE_EXE_PIPE_WRITE:
|
||||
flags.append("PIPE_WRITE")
|
||||
if value & ECORE_EXE_PIPE_ERROR:
|
||||
if value & enums.ECORE_EXE_PIPE_ERROR:
|
||||
flags.append("PIPE_ERROR")
|
||||
if value & ECORE_EXE_PIPE_READ_LINE_BUFFERED:
|
||||
if value & enums.ECORE_EXE_PIPE_READ_LINE_BUFFERED:
|
||||
flags.append("PIPE_READ_LINE_BUFFERED")
|
||||
if value & ECORE_EXE_PIPE_ERROR_LINE_BUFFERED:
|
||||
if value & enums.ECORE_EXE_PIPE_ERROR_LINE_BUFFERED:
|
||||
flags.append("PIPE_ERROR_LINE_BUFFERED")
|
||||
if value & ECORE_EXE_PIPE_AUTO:
|
||||
if value & enums.ECORE_EXE_PIPE_AUTO:
|
||||
flags.append("PIPE_AUTO")
|
||||
if value & ECORE_EXE_RESPAWN:
|
||||
if value & enums.ECORE_EXE_RESPAWN:
|
||||
flags.append("RESPAWN")
|
||||
if value & ECORE_EXE_USE_SH:
|
||||
if value & enums.ECORE_EXE_USE_SH:
|
||||
flags.append("USE_SH")
|
||||
if value & ECORE_EXE_NOT_LEADER:
|
||||
if value & enums.ECORE_EXE_NOT_LEADER:
|
||||
flags.append("NOT_LEADER")
|
||||
if value & enums.ECORE_EXE_TERM_WITH_PARENT:
|
||||
flags.append("ECORE_EXE_TERM_WITH_PARENT")
|
||||
if value & enums.ECORE_EXE_ISOLATE_IO:
|
||||
flags.append("ECORE_EXE_ISOLATE_IO")
|
||||
return ", ".join(flags)
|
||||
|
||||
|
||||
|
@ -58,17 +62,17 @@ cdef Eina_Bool _exe_event_filter_cb(void *data, int type, void *event) with gil:
|
|||
|
||||
try:
|
||||
assert self.event_type == type, "event is not what we asked? impossible"
|
||||
if type == ECORE_EXE_EVENT_ADD:
|
||||
if type == enums.ECORE_EXE_EVENT_ADD:
|
||||
e_add = <Ecore_Exe_Event_Add *>event
|
||||
if e_add.exe != self.exe:
|
||||
return 1
|
||||
e = EventExeAdd()
|
||||
elif type == ECORE_EXE_EVENT_DEL:
|
||||
elif type == enums.ECORE_EXE_EVENT_DEL:
|
||||
e_del = <Ecore_Exe_Event_Del *>event
|
||||
if e_del.exe != self.exe:
|
||||
return 1
|
||||
e = EventExeDel()
|
||||
elif type == ECORE_EXE_EVENT_DATA or type == ECORE_EXE_EVENT_ERROR:
|
||||
elif type == enums.ECORE_EXE_EVENT_DATA or type == enums.ECORE_EXE_EVENT_ERROR:
|
||||
e_data = <Ecore_Exe_Event_Data *>event
|
||||
if e_data.exe != self.exe:
|
||||
return 1
|
||||
|
@ -298,6 +302,13 @@ cdef class Exe(object):
|
|||
Do not use setsid() to have the executed process be its own
|
||||
session leader
|
||||
|
||||
ECORE_EXE_TERM_WITH_PARENT
|
||||
Makes child receive SIGTERM when parent dies
|
||||
|
||||
ECORE_EXE_ISOLATE_IO
|
||||
Try and isolate stdin/out and err of the process so it isn't
|
||||
shared with the parent. Since 1.21
|
||||
|
||||
:type flags: int
|
||||
:param data: extra data to be associated and available with ``data_get()``
|
||||
|
||||
|
@ -363,6 +374,17 @@ cdef class Exe(object):
|
|||
<uintptr_t>self.exe, PY_REFCOUNT(self),
|
||||
pid, cmd, flags, data)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
.. versionadded:: 1.18
|
||||
|
||||
"""
|
||||
return bool(self.exe == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Forcefully frees the given process handle.
|
||||
|
||||
|
@ -536,6 +558,10 @@ cdef class Exe(object):
|
|||
- ECORE_EXE_USE_SH: Use /bin/sh to run the command.
|
||||
- ECORE_EXE_NOT_LEADER Do not use setsid() to have the
|
||||
executed process be its own session leader
|
||||
- ECORE_EXE_TERM_WITH_PARENT Makes child receive SIGTERM when
|
||||
parent dies
|
||||
- ECORE_EXE_ISOLATE_IO Try and isolate stdin/out and err of the
|
||||
process so it isn't shared with the parent
|
||||
|
||||
:return: set of masks, ORed.
|
||||
|
||||
|
@ -632,10 +658,10 @@ cdef class Exe(object):
|
|||
:see: on_exe_add_event_add()
|
||||
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ADD)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_ADD)
|
||||
self.__callbacks[ECORE_EXE_EVENT_ADD] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_ADD)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_ADD] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_add_event_del(self, func, *args, **kargs):
|
||||
|
@ -646,7 +672,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ADD)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -668,10 +694,10 @@ cdef class Exe(object):
|
|||
:see: on_del_event_del()
|
||||
:see: on_exe_del_event_add()
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DEL)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_DEL)
|
||||
self.__callbacks[ECORE_EXE_EVENT_DEL] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_DEL)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_DEL] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_del_event_del(self, func, *args, **kargs):
|
||||
|
@ -682,7 +708,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DEL)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -704,10 +730,10 @@ cdef class Exe(object):
|
|||
:see: on_data_event_del()
|
||||
:see: on_exe_data_event_add()
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DATA)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_DATA)
|
||||
self.__callbacks[ECORE_EXE_EVENT_DATA] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_DATA)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_DATA] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_data_event_del(self, func, *args, **kargs):
|
||||
|
@ -718,7 +744,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DATA)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -740,10 +766,10 @@ cdef class Exe(object):
|
|||
:see: on_error_event_del()
|
||||
:see: on_exe_error_event_add()
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ERROR)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_ERROR)
|
||||
self.__callbacks[ECORE_EXE_EVENT_ERROR] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_ERROR)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_ERROR] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_error_event_del(self, func, *args, **kargs):
|
||||
|
@ -754,7 +780,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ERROR)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -774,9 +800,9 @@ def exe_pipe_run(exe_cmd, int flags=0, data=None):
|
|||
cdef class EventExeAdd(Event):
|
||||
"""Represents Ecore_Exe_Event_Add event from C-api.
|
||||
|
||||
This event notifies the process created with :py:class:`Exe` was started.
|
||||
This event notifies that the process created with :py:class:`Exe` has been started.
|
||||
|
||||
See property ``exe`` for ``Exe`` instance.
|
||||
:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Exe_Event_Add *obj
|
||||
|
@ -793,9 +819,14 @@ cdef class EventExeAdd(Event):
|
|||
cdef class EventExeDel(Event):
|
||||
"""Represents Ecore_Exe_Event_Del from C-api.
|
||||
|
||||
This event notifies the process created with ``Exe`` is now dead.
|
||||
This event notifies that the process created with ``Exe`` is now dead.
|
||||
|
||||
See property ``exe`` for ``Exe`` instance.
|
||||
:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
|
||||
:ivar int pid: Process ID
|
||||
:ivar int exit_code: Exit code
|
||||
:ivar int exit_signal: Exit signal
|
||||
:ivar bool exited: Has process exited
|
||||
:ivar bool signalled: Has process been signalled
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Exe_Event_Del *obj
|
||||
|
@ -823,12 +854,10 @@ cdef class EventExeData(Event):
|
|||
This event is issued by :py:class:`Exe` instances created with flags that
|
||||
allow reading from either stdout or stderr.
|
||||
|
||||
See properties:
|
||||
|
||||
- **exe** instance of :py:class:`Exe` that created this event.
|
||||
- **data** the raw string buffer with binary data from child process.
|
||||
- **size** the size of **data** (same as ``len(data)``)
|
||||
- **lines** list of strings with all text lines
|
||||
:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
|
||||
:ivar string ~EventExeData.data: The raw string buffer with binary data from child process.
|
||||
:ivar int ~EventExeData.size: The size of **data** (same as ``len(data)``)
|
||||
:ivar list lines: List of strings with all text lines
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Exe_Event_Data *obj
|
||||
|
@ -880,7 +909,7 @@ def on_exe_add_event_add(func, *args, **kargs):
|
|||
:see: EventHandler
|
||||
:see: EventHandlerExe
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_ADD, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_ADD, func, *args, **kargs)
|
||||
|
||||
|
||||
def on_exe_del_event_add(func, *args, **kargs):
|
||||
|
@ -889,7 +918,7 @@ def on_exe_del_event_add(func, *args, **kargs):
|
|||
:see: EventHandler
|
||||
:see: EventHandlerExe
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_DEL, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_DEL, func, *args, **kargs)
|
||||
|
||||
|
||||
def on_exe_data_event_add(func, *args, **kargs):
|
||||
|
@ -898,7 +927,7 @@ def on_exe_data_event_add(func, *args, **kargs):
|
|||
:see: EventHandler
|
||||
:see: EventHandlerExe
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_DATA, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_DATA, func, *args, **kargs)
|
||||
|
||||
|
||||
def on_exe_error_event_add(func, *args, **kargs):
|
||||
|
@ -907,4 +936,4 @@ def on_exe_error_event_add(func, *args, **kargs):
|
|||
:see: :py:class:`EventHandler`
|
||||
:see: :py:class:`EventHandlerExe`
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_ERROR, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_ERROR, func, *args, **kargs)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -31,11 +31,11 @@ cdef void fd_handler_prepare_cb(void *data, Ecore_Fd_Handler *fdh) with gil:
|
|||
|
||||
cdef flags2str(int value):
|
||||
flags = []
|
||||
if value & <int>ECORE_FD_READ:
|
||||
if value & <int>enums.ECORE_FD_READ:
|
||||
flags.append("READ")
|
||||
if value & <int>ECORE_FD_WRITE:
|
||||
if value & <int>enums.ECORE_FD_WRITE:
|
||||
flags.append("WRITE")
|
||||
if value & <int>ECORE_FD_ERROR:
|
||||
if value & <int>enums.ECORE_FD_ERROR:
|
||||
flags.append("ERROR")
|
||||
return ", ".join(flags)
|
||||
|
||||
|
@ -78,7 +78,7 @@ cdef class FdHandler(object):
|
|||
|
||||
"""
|
||||
def __init__(self, fd, int flags, func, *args, **kargs):
|
||||
"""FdHandler(...)
|
||||
"""
|
||||
|
||||
:param fd: file descriptor or object with fileno() method.
|
||||
:param flags: bitwise OR of ECORE_FD_READ, ECORE_FD_WRITE...
|
||||
|
@ -144,6 +144,17 @@ cdef class FdHandler(object):
|
|||
cdef object _exec(self):
|
||||
return self.func(self, *self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
.. versionadded:: 1.18
|
||||
|
||||
"""
|
||||
return bool(self.obj == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
if self.obj != NULL:
|
||||
|
@ -193,15 +204,15 @@ cdef class FdHandler(object):
|
|||
|
||||
def can_read(self):
|
||||
""":rtype: bool"""
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_READ))
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, enums.ECORE_FD_READ))
|
||||
|
||||
def can_write(self):
|
||||
""":rtype: bool"""
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_WRITE))
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, enums.ECORE_FD_WRITE))
|
||||
|
||||
def has_error(self):
|
||||
""":rtype: bool"""
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_ERROR))
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, enums.ECORE_FD_ERROR))
|
||||
|
||||
def prepare_callback_set(self, func, *args, **kargs):
|
||||
"""Set a function to call before doing the select() on the fd.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -73,7 +73,7 @@ cdef class FileDownload(object):
|
|||
|
||||
"""
|
||||
def __init__(self, url, dst, completion_cb, progress_cb, *args, **kargs):
|
||||
"""FileDownload(...)
|
||||
"""
|
||||
|
||||
:param url: The complete url to download
|
||||
:param dst: Where to download the file
|
||||
|
@ -99,7 +99,7 @@ cdef class FileDownload(object):
|
|||
if not ecore_file_download(
|
||||
<const char *>url if url is not None else NULL,
|
||||
<const char *>dst if dst is not None else NULL,
|
||||
_completion_cb, _progress_cb,
|
||||
_completion_cb, _progress_cb, # TODO really connect everytime? or check if cb given?
|
||||
<void *>self, &job):
|
||||
raise SystemError("could not download '%s' to %s" % (url, dst))
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -60,7 +60,7 @@ cdef class FileMonitor(object):
|
|||
|
||||
"""
|
||||
def __init__(self, path, monitor_cb, *args, **kargs):
|
||||
"""FileMonitor(...)
|
||||
"""
|
||||
|
||||
:param path: The complete path of the folder you want to monitor.
|
||||
:type path: str
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -40,7 +40,7 @@ cdef class Idler(Eo):
|
|||
|
||||
"""
|
||||
def __init__(self, func, *args, **kargs):
|
||||
"""Idler(...)
|
||||
"""
|
||||
|
||||
:param func: Function to call when system is idle.
|
||||
:type func: callable
|
||||
|
@ -59,22 +59,38 @@ cdef class Idler(Eo):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_idler_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 idlers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_idler_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_idler_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return "%s Idler(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Idler(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s Idler(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Idler(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_idler_del(self.obj)
|
||||
ecore_idler_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
def stop(self):
|
||||
"""Alias for stop()."""
|
||||
|
@ -107,7 +123,7 @@ cdef class IdleEnterer(Idler):
|
|||
|
||||
"""
|
||||
def __init__(self, func, *args, **kargs):
|
||||
"""IdleEnterer(...)
|
||||
"""
|
||||
|
||||
:param func: Function to call when system enters idle.
|
||||
:type func: callable
|
||||
|
@ -126,11 +142,18 @@ cdef class IdleEnterer(Idler):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_idle_enterer_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 idlers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_idle_enterer_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_idle_enterer_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_idle_enterer_del(self.obj)
|
||||
ecore_idle_enterer_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
cdef class IdleExiter(Idler):
|
||||
|
@ -173,11 +196,18 @@ cdef class IdleExiter(Idler):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_idle_exiter_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 idlers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_idle_exiter_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_idle_exiter_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_idle_exiter_del(self.obj)
|
||||
ecore_idle_exiter_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
def idler_add(func, *args, **kargs):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -60,7 +60,7 @@ cdef class Poller(Eo):
|
|||
|
||||
"""
|
||||
def __init__(self, int interval, func, pol_type=0, *args, **kargs):
|
||||
"""Poller(...)
|
||||
"""
|
||||
|
||||
:param interval: The poll interval
|
||||
:type interval: int
|
||||
|
@ -83,24 +83,39 @@ cdef class Poller(Eo):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_poller_add(pol_type, interval, _ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.20 pollers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_poller_add(pol_type, interval, _ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_poller_add(pol_type, interval, _ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return "%s Poller(func=%s, args=%s, kargs=%s)" % (Eo.__str__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Poller(func=%s, args=%s, kargs=%s)" % (
|
||||
self.func, self.args, self.kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s Poller(interval=%d, func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.interval if self.obj else -1,
|
||||
return "Poller(interval=%d, func=%s, args=%s, kargs=%s)" % (
|
||||
self.interval if self.obj2 else -1,
|
||||
self.func, self.args, self.kargs)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
def delete(self):
|
||||
""" Stop callback emission and free internal resources. """
|
||||
ecore_poller_del(self.obj)
|
||||
|
||||
ecore_poller_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
property interval:
|
||||
""" The interval (in ticks) between each call of the poller
|
||||
|
@ -109,15 +124,15 @@ cdef class Poller(Eo):
|
|||
|
||||
"""
|
||||
def __get__(self):
|
||||
return ecore_poller_poller_interval_get(self.obj)
|
||||
return ecore_poller_poller_interval_get(self.obj2)
|
||||
|
||||
def __set__(self, int t):
|
||||
ecore_poller_poller_interval_set(self.obj, t)
|
||||
ecore_poller_poller_interval_set(self.obj2, t)
|
||||
|
||||
def interval_set(self, int t):
|
||||
ecore_poller_poller_interval_set(self.obj, t)
|
||||
ecore_poller_poller_interval_set(self.obj2, t)
|
||||
def interval_get(self):
|
||||
return ecore_poller_poller_interval_get(self.obj)
|
||||
return ecore_poller_poller_interval_get(self.obj2)
|
||||
|
||||
|
||||
def poller_add(int t, func, *args, **kargs):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -36,9 +36,13 @@ cdef class Timer(Eo):
|
|||
returning *False* from ``func``, otherwise they'll continue alive, even
|
||||
if the current python context delete it's reference to it.
|
||||
|
||||
For convenience and readability callback can also return one of the
|
||||
:ref:`Ecore_Callback_Returns`. That is ``ECORE_CALLBACK_RENEW`` (like
|
||||
returning True) or ``ECORE_CALLBACK_CANCEL`` (like returning False).
|
||||
|
||||
"""
|
||||
def __init__(self, double interval, func, *args, **kargs):
|
||||
"""Timer(...)
|
||||
"""
|
||||
|
||||
:param interval: interval in seconds.
|
||||
:type interval: float
|
||||
|
|
|
@ -0,0 +1,347 @@
|
|||
# Copyright (C) 2007-2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
||||
:mod:`efl.ecore_con` Module
|
||||
###########################
|
||||
|
||||
The ecore_con module provide various utilities to perform different network
|
||||
related tasks. Everything in a full async ecore way. Most notable are the
|
||||
:class:`Lookup` class to perform DNS requests, the :class:`Url` class to
|
||||
perform HTTP requests and the :class:`Server` class to implement your own
|
||||
server.
|
||||
|
||||
Don't forget about the :class:`efl.ecore.FileDownload` class if what you need
|
||||
is just to fetch some data to file.
|
||||
|
||||
|
||||
Classes
|
||||
=======
|
||||
|
||||
.. toctree::
|
||||
|
||||
class-lookup.rst
|
||||
class-url.rst
|
||||
|
||||
|
||||
|
||||
Enumerations
|
||||
============
|
||||
|
||||
.. _Ecore_Con_Type:
|
||||
|
||||
Ecore Con Type
|
||||
--------------
|
||||
|
||||
Types for an ecore_con client/server object.
|
||||
|
||||
A correct way to set this type is with an ECORE_CON_$TYPE, optionally OR'ed
|
||||
with an ECORE_CON_$USE if encryption is desired, and LOAD_CERT if the
|
||||
previously loaded certificate should be used.
|
||||
|
||||
.. data:: ECORE_CON_LOCAL_USER
|
||||
|
||||
Socket in ~/.ecore.
|
||||
|
||||
.. data:: ECORE_CON_LOCAL_SYSTEM
|
||||
|
||||
Socket in /tmp.
|
||||
|
||||
.. data:: ECORE_CON_LOCAL_ABSTRACT
|
||||
|
||||
Abstract socket.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_TCP
|
||||
|
||||
Remote server using TCP.
|
||||
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_MCAST
|
||||
|
||||
Remote multicast server.
|
||||
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_UDP
|
||||
|
||||
Remote server using UDP.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_BROADCAST
|
||||
|
||||
Remote broadcast using UDP.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_NODELAY
|
||||
|
||||
Remote connection sending packets immediately.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_CORK
|
||||
|
||||
Remote connection sending data in large chunks. (only on linux)
|
||||
|
||||
.. data:: ECORE_CON_USE_SSL2
|
||||
|
||||
Use SSL2: UNSUPPORTED.
|
||||
|
||||
.. data:: ECORE_CON_USE_SSL3
|
||||
|
||||
Use SSL3: UNSUPPORTED.
|
||||
|
||||
.. data:: ECORE_CON_USE_TLS
|
||||
|
||||
Use TLS.
|
||||
|
||||
.. data:: ECORE_CON_USE_MIXED
|
||||
|
||||
Use both TLS and SSL3.
|
||||
|
||||
.. data:: ECORE_CON_LOAD_CERT
|
||||
|
||||
Attempt to use the loaded certificate.
|
||||
|
||||
.. data:: ECORE_CON_NO_PROXY
|
||||
|
||||
Disable all types of proxy on the server.
|
||||
|
||||
|
||||
.. _Ecore_Con_Url_Time:
|
||||
|
||||
Ecore Con Url Time
|
||||
------------------
|
||||
|
||||
The type of condition to use when making an HTTP request dependent on time, so
|
||||
that headers such as "If-Modified-Since" are used.
|
||||
|
||||
.. data:: ECORE_CON_URL_TIME_NONE
|
||||
|
||||
Do not place time restrictions on the HTTP requests.
|
||||
|
||||
.. data:: ECORE_CON_URL_TIME_IFMODSINCE
|
||||
|
||||
Add the "If-Modified-Since" HTTP header, so that the request is performed by
|
||||
the server only if the target has been modified since the time value passed
|
||||
to it in the request.
|
||||
|
||||
.. data:: ECORE_CON_URL_TIME_IFUNMODSINCE
|
||||
|
||||
Add the "If-Unmodified-Since" HTTP header, so that the request is performed
|
||||
by the server only if the target has NOT been modified since the time value
|
||||
passed to it in the request.
|
||||
|
||||
|
||||
.. _Ecore_Con_Url_Http_Version:
|
||||
|
||||
Ecore Con Url Http Version
|
||||
--------------------------
|
||||
|
||||
The http version to use.
|
||||
|
||||
.. data:: ECORE_CON_URL_HTTP_VERSION_1_0
|
||||
|
||||
HTTP version 1.0.
|
||||
|
||||
.. data:: ECORE_CON_URL_HTTP_VERSION_1_1
|
||||
|
||||
HTTP version 1.1 (default)
|
||||
|
||||
|
||||
Module level functions
|
||||
======================
|
||||
|
||||
"""
|
||||
|
||||
from libc.stdint cimport uintptr_t
|
||||
from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF
|
||||
|
||||
import traceback
|
||||
import atexit
|
||||
|
||||
|
||||
from efl.ecore cimport _event_mapping_register, _event_mapping_get, \
|
||||
ecore_event_handler_add, ecore_event_handler_del
|
||||
|
||||
cimport efl.ecore_con.enums as enums
|
||||
|
||||
ECORE_CON_LOCAL_USER = enums.ECORE_CON_LOCAL_USER
|
||||
ECORE_CON_LOCAL_SYSTEM = enums.ECORE_CON_LOCAL_SYSTEM
|
||||
ECORE_CON_LOCAL_ABSTRACT = enums.ECORE_CON_LOCAL_ABSTRACT
|
||||
ECORE_CON_REMOTE_TCP = enums.ECORE_CON_REMOTE_TCP
|
||||
ECORE_CON_REMOTE_MCAST = enums.ECORE_CON_REMOTE_MCAST
|
||||
ECORE_CON_REMOTE_UDP = enums.ECORE_CON_REMOTE_UDP
|
||||
ECORE_CON_REMOTE_BROADCAST = enums.ECORE_CON_REMOTE_BROADCAST
|
||||
ECORE_CON_REMOTE_NODELAY = enums.ECORE_CON_REMOTE_NODELAY
|
||||
ECORE_CON_REMOTE_CORK = enums.ECORE_CON_REMOTE_CORK
|
||||
ECORE_CON_USE_SSL2 = enums.ECORE_CON_USE_SSL2
|
||||
ECORE_CON_USE_SSL3 = enums.ECORE_CON_USE_SSL3
|
||||
ECORE_CON_USE_TLS = enums.ECORE_CON_USE_TLS
|
||||
ECORE_CON_USE_MIXED = enums.ECORE_CON_USE_MIXED
|
||||
ECORE_CON_LOAD_CERT = enums.ECORE_CON_LOAD_CERT
|
||||
ECORE_CON_NO_PROXY = enums.ECORE_CON_NO_PROXY
|
||||
ECORE_CON_SOCKET_ACTIVATE = enums.ECORE_CON_SOCKET_ACTIVATE
|
||||
|
||||
ECORE_CON_URL_TIME_NONE = enums.ECORE_CON_URL_TIME_NONE
|
||||
ECORE_CON_URL_TIME_IFMODSINCE = enums.ECORE_CON_URL_TIME_IFMODSINCE
|
||||
ECORE_CON_URL_TIME_IFUNMODSINCE = enums.ECORE_CON_URL_TIME_IFUNMODSINCE
|
||||
|
||||
ECORE_CON_URL_HTTP_VERSION_1_0 = enums.ECORE_CON_URL_HTTP_VERSION_1_0
|
||||
ECORE_CON_URL_HTTP_VERSION_1_1 = enums.ECORE_CON_URL_HTTP_VERSION_1_1
|
||||
|
||||
|
||||
cdef int _con_events_registered = 0
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the Ecore Con library
|
||||
|
||||
.. note::
|
||||
You never need to call this function, it is automatically called when
|
||||
the module is imported.
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
|
||||
ecore_con_init()
|
||||
ecore_con_url_init()
|
||||
|
||||
global _con_events_registered
|
||||
if _con_events_registered == 0:
|
||||
_event_mapping_register(ECORE_CON_EVENT_URL_COMPLETE, EventUrlComplete)
|
||||
_event_mapping_register(ECORE_CON_EVENT_URL_PROGRESS, EventUrlProgress)
|
||||
_event_mapping_register(ECORE_CON_EVENT_URL_DATA, EventUrlData)
|
||||
_con_events_registered = 1
|
||||
|
||||
|
||||
def shutdown():
|
||||
"""Shuts down the Ecore Con library.
|
||||
|
||||
.. note::
|
||||
You never need to call this function, it is automatically called atexit.
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
ecore_con_url_shutdown()
|
||||
ecore_con_shutdown()
|
||||
|
||||
|
||||
cdef Eina_Bool _con_event_filter_cb(void *data, int ev_type, void *ev) with gil:
|
||||
cdef:
|
||||
ConEventFilter filter = <ConEventFilter>data
|
||||
object event_cls
|
||||
Event py_event
|
||||
list cbs
|
||||
Eo obj
|
||||
object func
|
||||
tuple args
|
||||
dict kargs
|
||||
|
||||
# create correct "EventAbc" python object, using the global mapping
|
||||
event_cls = _event_mapping_get(ev_type)
|
||||
if event_cls:
|
||||
py_event = event_cls()
|
||||
|
||||
# object_from_instance can fail in _set_obj if the event is
|
||||
# generated from an object not managed by us, so just ignore it.
|
||||
try:
|
||||
py_event._set_obj(ev)
|
||||
except:
|
||||
return 1
|
||||
|
||||
# do we have callbacks for this object/event ?
|
||||
try:
|
||||
obj = py_event._get_obj()
|
||||
cbs = filter.callbacks.get(ev_type).get(obj)
|
||||
except:
|
||||
cbs = None
|
||||
|
||||
if cbs:
|
||||
cbs = cbs[:] # copy, so we can change filter.callbacks
|
||||
for func, args, kargs in cbs:
|
||||
try:
|
||||
func(py_event, *args, **kargs)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
return 1 # always return true, no matter what
|
||||
|
||||
cdef class ConEventFilter(object):
|
||||
|
||||
"""
|
||||
self.callbacks = {
|
||||
EV_TYPE: {
|
||||
objX: [(cb,args,kargs), ... ]
|
||||
objY: [(cb,args,kargs), ... ]
|
||||
},
|
||||
...
|
||||
}
|
||||
"""
|
||||
|
||||
def __cinit__(self):
|
||||
self.callbacks = {}
|
||||
self.handlers = {}
|
||||
|
||||
cdef callback_add(self, int ev_type, Eo obj, object func, tuple args, dict kargs):
|
||||
# store the function in the callbacks dict
|
||||
if not ev_type in self.callbacks:
|
||||
self.callbacks[ev_type] = {}
|
||||
if not obj in self.callbacks[ev_type]:
|
||||
self.callbacks[ev_type][obj] = []
|
||||
self.callbacks[ev_type][obj].append((func,args,kargs))
|
||||
|
||||
# connect a single ecore signal, one per event_type
|
||||
cdef Ecore_Event_Handler* ee
|
||||
if not ev_type in self.handlers:
|
||||
ee = ecore_event_handler_add(ev_type, _con_event_filter_cb,
|
||||
<void *>self)
|
||||
self.handlers[ev_type] = <uintptr_t><void *>ee
|
||||
|
||||
cdef callback_del(self, int ev_type, Eo obj, object func, tuple args, dict kargs):
|
||||
try:
|
||||
self.callbacks[ev_type][obj].remove((func, args, kargs))
|
||||
except ValueError:
|
||||
raise ValueError(
|
||||
"callback is not registered: %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
||||
# can delete the ecore handler?
|
||||
if self.callbacks.get(ev_type) and self.callbacks.get(ev_type).get(obj):
|
||||
return
|
||||
if ev_type in self.handlers:
|
||||
handler = self.handlers.pop(ev_type)
|
||||
ecore_event_handler_del(<Ecore_Event_Handler *><uintptr_t>handler)
|
||||
|
||||
cdef callback_del_full(self, Eo obj):
|
||||
for ev_type in self.callbacks:
|
||||
if obj in self.callbacks[ev_type]:
|
||||
# remove all the cbs for the obj
|
||||
self.callbacks[ev_type].pop(obj, None)
|
||||
|
||||
# can delete the ecore handler?
|
||||
if len(self.callbacks[ev_type]) < 1 and ev_type in self.handlers:
|
||||
handler = self.handlers.pop(ev_type)
|
||||
ecore_event_handler_del(<Ecore_Event_Handler *><uintptr_t>handler)
|
||||
|
||||
# name suggestions are welcome for this unusual "singleton" instance
|
||||
cdef ConEventFilter GEF = ConEventFilter()
|
||||
|
||||
|
||||
include "efl.ecore_con_lookup.pxi"
|
||||
include "efl.ecore_con_url.pxi"
|
||||
|
||||
|
||||
init()
|
||||
atexit.register(shutdown)
|
|
@ -0,0 +1,88 @@
|
|||
# Copyright (C) 2007-2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef void _con_dns_lookup_cb(const char *canonname, const char *ip, sockaddr *sockaddr, int addrlen, void *data) with gil:
|
||||
cdef Lookup self = <Lookup>data
|
||||
|
||||
try:
|
||||
# TODO read sockaddr and replace the placeholder None with something
|
||||
# more usefull from the sockaddr struct.
|
||||
self.done_cb(_ctouni(canonname), _ctouni(ip), None, *self.args, **self.kargs)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
cdef class Lookup(object):
|
||||
def __init__(self, name, done_cb, *args, **kargs):
|
||||
"""
|
||||
|
||||
A simple class to perform asynchronous DNS lookups.
|
||||
|
||||
:param string name: The hostname to query
|
||||
:param callable done_cb: The function to call when done
|
||||
:param \*args: Any other arguments will be passed back in ``done_cb``
|
||||
:param \**kargs: Any other keywords arguments will be passed back in ``done_cb``
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
Just create an instance and give a callback function to be called
|
||||
when the operation is complete.
|
||||
|
||||
This class performs a DNS lookup on the hostname specified by
|
||||
`name`, then calls `done_cb` with the result and the data given as
|
||||
parameter. The result will be given to the done_cb as follows:
|
||||
|
||||
**expected `done_cb` signature**::
|
||||
|
||||
func(canonname, ip, sockaddr)
|
||||
|
||||
where:
|
||||
* **canonname** (string) is the canonical domain name
|
||||
* **ip** (string) is the recolved ip address
|
||||
* **sockaddr** (None) is a placeholder for future expansion
|
||||
|
||||
|
||||
|
||||
**Usage example**::
|
||||
|
||||
import ecore_con
|
||||
|
||||
def done_cb(canonname, ip, sockaddr):
|
||||
print(canonname)
|
||||
print(ip)
|
||||
|
||||
ecore_con.Lookup('example.com', done_cb)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
if not callable(done_cb):
|
||||
raise TypeError("Parameter 'done_cb' must be callable")
|
||||
|
||||
self.done_cb = done_cb
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
|
||||
if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
|
||||
ecore_con_lookup(<const char *>name if name is not None else NULL,
|
||||
_con_dns_lookup_cb, <void*>self)
|
||||
|
||||
Py_INCREF(self)
|
||||
|
|
@ -0,0 +1,845 @@
|
|||
# Copyright (C) 2007-2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
# from efl.ecore cimport EventHandler
|
||||
# from efl.utils.conversions cimport _ctouni as _charp_to_str
|
||||
|
||||
|
||||
|
||||
cdef class EventUrlProgress(Event):
|
||||
"""Represents Ecore_Con_Event_Url_Progress event from C-api.
|
||||
|
||||
This event notifies the progress of the current operation.
|
||||
|
||||
attributes:
|
||||
* url (:class:`Url`): the object that generate the event
|
||||
* down_total(double): total size of the downloading data (in bytes)
|
||||
* down_now(double): current size of the downloading data (in bytes)
|
||||
* up_total(double): total size of the uploading data (in bytes)
|
||||
* up_now(double): current size of the uploading data (in bytes)
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *ev) except 0:
|
||||
cdef Ecore_Con_Event_Url_Progress *event
|
||||
event = <Ecore_Con_Event_Url_Progress*>ev
|
||||
|
||||
self.url = <Url>ecore_con_url_data_get(event.url_con)
|
||||
self.down_total = event.down.total
|
||||
self.down_now = event.down.now
|
||||
self.up_total = event.up.total
|
||||
self.up_now = event.up.now
|
||||
return 1
|
||||
|
||||
cdef object _get_obj(self):
|
||||
return self.url
|
||||
|
||||
cdef class EventUrlComplete(Event):
|
||||
"""Represents Ecore_Con_Event_Url_Complete event from C-api.
|
||||
|
||||
This event notifies the operation is completed.
|
||||
|
||||
attributes:
|
||||
* url (:class:`Url`): the object that generate the event
|
||||
* status(int): HTTP status code of the operation (200, 404, 401, etc.)
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *ev) except 0:
|
||||
cdef Ecore_Con_Event_Url_Complete *event
|
||||
event = <Ecore_Con_Event_Url_Complete*>ev
|
||||
|
||||
self.url = <Url>ecore_con_url_data_get(event.url_con)
|
||||
self.status = event.status
|
||||
return 1
|
||||
|
||||
cdef object _get_obj(self):
|
||||
return self.url
|
||||
|
||||
cdef class EventUrlData(Event):
|
||||
"""Represents Ecore_Con_Event_Url_Data event from C-api.
|
||||
|
||||
This event hold the data while the are received.
|
||||
|
||||
.. note::
|
||||
The data attribute is a raw series of bytes, map to ``str`` in python2
|
||||
and ``bytes`` in python3.
|
||||
|
||||
attributes:
|
||||
* url (:class:`Url`): the object that generate the event
|
||||
* size(int): the size of the current received data (in bytes)
|
||||
* data(bytes): the data received on this event
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *ev) except 0:
|
||||
cdef Ecore_Con_Event_Url_Data *event
|
||||
event = <Ecore_Con_Event_Url_Data*>ev
|
||||
|
||||
self.url = <Url>ecore_con_url_data_get(event.url_con)
|
||||
self.size = event.size
|
||||
self.data = event.data[:event.size] #raw string copy
|
||||
return 1
|
||||
|
||||
cdef object _get_obj(self):
|
||||
return self.url
|
||||
|
||||
|
||||
cdef class Url(Eo):
|
||||
"""
|
||||
|
||||
Utility class to make it easy to perform http requests (POST, GET, etc).
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
Brief usage:
|
||||
1. Create an :class:`Url` object with ecore_con.Url('myurl')
|
||||
2. Register object callbacks using :func:`on_complete_event_add`,
|
||||
:func:`on_progress_event_add` and :func:`on_data_event_add` to
|
||||
receive the response, e.g. for HTTP/FTP downloads.
|
||||
3. Perform the operation with :func:`get`, :func:`head` and :func:`post`
|
||||
|
||||
If it's necessary use the :attr:`url` property. to change the object url.
|
||||
|
||||
.. note::
|
||||
It is good practice to reuse :class:`Url` objects wherever possible,
|
||||
but bear in mind that each one can only perform one operation at a
|
||||
time. You need to wait for the complete event before re-using or
|
||||
destroying the object.
|
||||
|
||||
.. warning::
|
||||
It is **really important** to call the :func:`delete()` method as soon
|
||||
as you have finished with your object, as it automatically remove all
|
||||
the registered events for you, that will otherwise continue to use
|
||||
resources.
|
||||
|
||||
Basic usage examples::
|
||||
|
||||
# HTTP GET
|
||||
u = ecore.Url("http://www.google.com")
|
||||
u.get()
|
||||
|
||||
# HTTP POST
|
||||
u = ecore.Url('https://httpbin.org/post')
|
||||
u.post(b'my data to post', 'text/txt')
|
||||
|
||||
# FTP download
|
||||
u = ecore.Url("ftp://ftp.example.com/pub/myfile")
|
||||
u.get()
|
||||
|
||||
# FTP upload as ftp://ftp.example.com/file
|
||||
u = ecore.Url("ftp://ftp.example.com")
|
||||
u.ftp_upload("/tmp/file", "user", "pass", None)
|
||||
|
||||
# FTP upload as ftp://ftp.example.com/dir/file
|
||||
u = ecore.Url("ftp://ftp.example.com")
|
||||
u.ftp_upload("/tmp/file", "user", "pass", "dir")
|
||||
|
||||
To actually make something usefull with your request you will need to
|
||||
connect the :class:`EventUrlComplete`, :class:`EventUrlProgress` and
|
||||
:class:`EventUrlData` events using the :func:`on_complete_event_add` and
|
||||
friends functions.
|
||||
|
||||
A more complete example::
|
||||
|
||||
from efl import ecore
|
||||
|
||||
def on_data(event):
|
||||
print("data: " + str(event.data[:80]))
|
||||
# do something here with the received data
|
||||
|
||||
def on_progress(event):
|
||||
# print(event)
|
||||
print("received %d on a total of %d bytes" % (
|
||||
event.down_now, event.down_total))
|
||||
|
||||
def on_complete(event):
|
||||
# print(event)
|
||||
print("http result: %d" % event.status)
|
||||
print("Total received bytes: %d" % event.url.received_bytes)
|
||||
|
||||
u.delete() # don't forget to delete !!
|
||||
|
||||
u = ecore.Url('http://www.google.com', verbose=False)
|
||||
u.on_data_event_add(on_data)
|
||||
u.on_progress_event_add(on_progress)
|
||||
u.on_complete_event_add(on_complete)
|
||||
u.get()
|
||||
|
||||
ecore.main_loop_begin()
|
||||
|
||||
If you need to save the received data to a file use the :attr:`fd`
|
||||
property, as::
|
||||
|
||||
fd = open('/tmp/tmpMxBtta', 'w')
|
||||
u = ecore.Url('http://example.com', fd=fd.fileno())
|
||||
u.get()
|
||||
|
||||
.. seealso::
|
||||
If you just need to download a file please consider using the
|
||||
simpler :class:`efl.ecore.FileDownload` class instead.
|
||||
|
||||
.. seealso::
|
||||
The ecore module level functions :func:`url_pipeline_set` and
|
||||
:func:`url_pipeline_get` to enable HTTP 1.1 pipelining.
|
||||
|
||||
"""
|
||||
def __init__(self, url, custom_request=None, **kargs):
|
||||
"""
|
||||
|
||||
:param url: URL that will receive requests.
|
||||
:type url: string
|
||||
:param custom_request: Custom request (e.g. GET, POST, HEAD, PUT, HEAD,
|
||||
SUBSCRIBE and other obscure HTTP requests)
|
||||
:type custom_request: string
|
||||
:param \**kwargs: All the remaining keyword arguments are interpreted
|
||||
as properties of the instance
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
||||
if custom_request is None:
|
||||
# From efl 1.19 url are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_con_url_new(
|
||||
# <const char *>url if url is not None else NULL))
|
||||
self.obj2 = ecore_con_url_new(
|
||||
<const char *>url if url is not None else NULL)
|
||||
|
||||
else:
|
||||
if isinstance(custom_request, unicode):
|
||||
custom_request = PyUnicode_AsUTF8String(custom_request)
|
||||
self.obj2 = ecore_con_url_custom_new(
|
||||
<const char *>url if url is not None else NULL,
|
||||
<const char *>custom_request if custom_request is not None else NULL)
|
||||
|
||||
ecore_con_url_data_set(self.obj2, <void *>self)
|
||||
Py_INCREF(self)
|
||||
self._set_properties_from_keyword_args(kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(url=%s)" % (self.__class__.__name__, self.url)
|
||||
|
||||
def delete(self):
|
||||
"""Delete the :class:`Url` object and free all used resources.
|
||||
|
||||
.. note::
|
||||
This is **really important** to call as soon as you have finished
|
||||
with your object, as it automatically remove all the registered
|
||||
events. That will otherwise continue to use resources.
|
||||
|
||||
"""
|
||||
GEF.callback_del_full(self)
|
||||
ecore_con_url_free(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
property fd:
|
||||
"""Set up a file to have response data written into.
|
||||
|
||||
This attr can be used to easily setup a file where the downloaded data
|
||||
will be saved.
|
||||
|
||||
Note that :class:`EventUrlData` events will not be emitted if a file
|
||||
has been set to receive the response data.
|
||||
|
||||
.. seealso::
|
||||
If you just need to download a file please consider using the
|
||||
simpler :class:`efl.ecore.FileDownload` class instead.
|
||||
|
||||
:type: int (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, int fd):
|
||||
ecore_con_url_fd_set(self.obj2, fd)
|
||||
|
||||
def get(self):
|
||||
"""Send a GET request.
|
||||
|
||||
The request is performed immediately, but you need to setup event
|
||||
handlers with :func:`on_complete_event_add` or
|
||||
:func:`on_complete_event_add` to get more information about its result.
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
|
||||
"""
|
||||
return bool(ecore_con_url_get(self.obj2))
|
||||
|
||||
def head(self):
|
||||
"""Send a HEAD request.
|
||||
|
||||
The request is performed immediately, but you need to setup event
|
||||
handlers with :func:`on_complete_event_add` or
|
||||
:func:`on_complete_event_add` to get more information about its result.
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
|
||||
"""
|
||||
return bool(ecore_con_url_head(self.obj2))
|
||||
|
||||
def post(self, bytes data, content_type):
|
||||
"""Send a post request.
|
||||
|
||||
The request is performed immediately, but you need to setup event
|
||||
handlers with :func:`on_complete_event_add` or
|
||||
:func:`on_complete_event_add` to get more information about its result.
|
||||
|
||||
:param data: Payload (data sent on the request). Can be ``None``.
|
||||
:type data: bytes
|
||||
:param content_type: Content type of the payload (e.g. `text/xml`).
|
||||
Can be ``None``.
|
||||
:type content_type: string
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
|
||||
"""
|
||||
if isinstance(content_type, unicode):
|
||||
content_type = PyUnicode_AsUTF8String(content_type)
|
||||
return bool(ecore_con_url_post(self.obj2,
|
||||
<const void*><const char *>data if data is not None else NULL,
|
||||
len(data),
|
||||
<const char *>content_type if content_type is not None else NULL))
|
||||
|
||||
def time(self, Ecore_Con_Url_Time time_condition, double timestamp):
|
||||
"""Whether HTTP requests should be conditional, dependent on
|
||||
modification time.
|
||||
|
||||
This function may set the header `If-Modified-Since` or
|
||||
`If-Unmodified-Since`, depending on the value of time_condition, with
|
||||
the value timestamp.
|
||||
|
||||
:param time_condition: Condition to use for HTTP requests.
|
||||
:type time_condition: :ref:`Ecore_Con_Url_Time`
|
||||
:param timestamp: Time since 1 Jan 1970 to use in the condition.
|
||||
:type timestamp: double
|
||||
|
||||
"""
|
||||
ecore_con_url_time(self.obj2, time_condition, timestamp)
|
||||
|
||||
def ftp_upload(self, filename, user, passwd, upload_dir):
|
||||
"""Upload a file to an ftp site.
|
||||
|
||||
:param string filename: The path to the file to send
|
||||
:param string user: The username to log in with
|
||||
:param string passwd: The password to log in with
|
||||
:param string upload_dir: The directory to which the file will upload
|
||||
|
||||
:return: ``True`` on success, ``False`` otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
|
||||
if isinstance(user, unicode): user = PyUnicode_AsUTF8String(user)
|
||||
if isinstance(passwd, unicode): passwd = PyUnicode_AsUTF8String(passwd)
|
||||
if isinstance(upload_dir, unicode): upload_dir = PyUnicode_AsUTF8String(upload_dir)
|
||||
return bool(ecore_con_url_ftp_upload(self.obj2,
|
||||
<const char *>filename if filename is not None else NULL,
|
||||
<const char *>user if user is not None else NULL,
|
||||
<const char *>passwd if passwd is not None else NULL,
|
||||
<const char *>upload_dir if upload_dir is not None else NULL))
|
||||
|
||||
property ftp_use_epsv:
|
||||
"""Enable or disable EPSV extension.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint use_epsv):
|
||||
ecore_con_url_ftp_use_epsv_set(self.obj2, use_epsv)
|
||||
|
||||
def cookies_init(self):
|
||||
"""Enable the cookie engine for subsequent HTTP requests.
|
||||
|
||||
After this function is called, cookies set by the server in HTTP
|
||||
responses will be parsed and stored, as well as sent back to the server
|
||||
in new HTTP requests.
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_init(self.obj2)
|
||||
|
||||
def cookies_clear(self):
|
||||
"""Clear currently loaded cookies.
|
||||
|
||||
The cleared cookies are removed and will not be sent in subsequent HTTP
|
||||
requests, nor will they be written to the cookiejar file set via
|
||||
:attr:`cookies_jar_file`.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet. The cookie files set by
|
||||
:func:`cookies_file_add` aren't loaded immediately, just
|
||||
when the request is started. Thus, if you ask to clear the cookies,
|
||||
but has a file already set by that function, the cookies will then
|
||||
be loaded and you will have old cookies set. In order to don't have
|
||||
any old cookie set, you need to don't call
|
||||
:func:`cookies_file_add` ever on the :class:`Url` class, and
|
||||
call this function to clear any cookie set by a previous request on
|
||||
this handler.
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_clear(self.obj2)
|
||||
|
||||
def cookies_session_clear(self):
|
||||
"""Clear currently loaded session cookies.
|
||||
|
||||
Session cookies are cookies with no expire date set, which usually
|
||||
means they are removed after the current session is closed.
|
||||
|
||||
The cleared cookies are removed and will not be sent in subsequent HTTP
|
||||
requests, nor will they be written to the cookiejar file set via
|
||||
:attr:`cookies_jar_file`.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet. The cookie files set by
|
||||
:func:`cookies_file_add` aren't loaded immediately, just
|
||||
when the request is started. Thus, if you ask to clear the session
|
||||
cookies, but has a file already set by that function, the session
|
||||
cookies will then be loaded and you will have old cookies set. In
|
||||
order to don't have any old session cookie set, you need to don't
|
||||
call :func:`cookies_file_add` ever on the :class:`Url` class, and
|
||||
call this function to clear any session cookie set by a previous
|
||||
request on this handler. An easier way to don't use old session
|
||||
cookies is by using the function
|
||||
:attr:`cookies_ignore_old_session`.
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_session_clear(self.obj2)
|
||||
|
||||
def cookies_file_add(self, file_name):
|
||||
"""Add a file to the list of files from which to load cookies.
|
||||
|
||||
Files must contain cookies defined according to two possible formats:
|
||||
* HTTP-style header ("Set-Cookie: ...").
|
||||
* Netscape/Mozilla cookie data format.
|
||||
|
||||
Cookies will only be read from this file. If you want to save cookies
|
||||
to a file, use :attr:`cookies_jar_file`. Also notice that
|
||||
this function supports the both types of cookie file cited above, while
|
||||
:attr:`cookies_jar_file` will save only in the Netscape/Mozilla's
|
||||
format.
|
||||
|
||||
Please notice that the file will not be read immediately, but rather
|
||||
added to a list of files that will be loaded and parsed at a later
|
||||
time.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet.
|
||||
|
||||
:param string file_name: Name of the file that will be added to the list.
|
||||
|
||||
"""
|
||||
if isinstance(file_name, unicode):
|
||||
file_name = PyUnicode_AsUTF8String(file_name)
|
||||
ecore_con_url_cookies_file_add(self.obj2,
|
||||
<const char *>file_name if file_name is not None else NULL)
|
||||
|
||||
property cookies_jar_file:
|
||||
"""The name of the file to which all current cookies will be written
|
||||
when either cookies are flushed or Ecore_Con is shut down.
|
||||
|
||||
Cookies are written following Netscape/Mozilla's data format, also
|
||||
known as cookie-jar.
|
||||
|
||||
Cookies will only be saved to this file. If you need to read cookies
|
||||
from a file, use ecore_con_url_cookies_file_add() instead.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet.
|
||||
|
||||
.. seealso:: :func:`cookies_jar_write`
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, cookiejar_file):
|
||||
if isinstance(cookiejar_file, unicode):
|
||||
cookiejar_file = PyUnicode_AsUTF8String(cookiejar_file)
|
||||
ecore_con_url_cookies_jar_file_set(self.obj2,
|
||||
<const char *>cookiejar_file if cookiejar_file is not None else NULL)
|
||||
if isinstance(cookiejar_file, unicode):
|
||||
cookiejar_file = PyUnicode_AsUTF8String(cookiejar_file)
|
||||
ecore_con_url_cookies_jar_file_set(self.obj2,
|
||||
<const char *>cookiejar_file if cookiejar_file is not None else NULL)
|
||||
|
||||
def cookies_jar_write(self):
|
||||
"""Write all current cookies to the cookie jar immediately.
|
||||
|
||||
A cookie-jar file must have been previously set by
|
||||
:attr:`cookies_jar_file`, otherwise nothing will be done.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet.
|
||||
|
||||
.. seealso:: :attr:`cookies_jar_file`
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_jar_write(self.obj2)
|
||||
|
||||
property cookies_ignore_old_session:
|
||||
"""Control whether session cookies from previous sessions shall be loaded.
|
||||
|
||||
Session cookies are cookies with no expire date set, which usually
|
||||
means they are removed after the current session is closed.
|
||||
|
||||
By default, when Ecore_Con_Url loads cookies from a file, all cookies
|
||||
are loaded, including session cookies, which, most of the time, were
|
||||
supposed to be loaded and valid only for that session.
|
||||
|
||||
If ignore is set to ``True``, when Ecore_Con_Url loads cookies from
|
||||
the files passed to :func:`cookies_file_add`, session cookies
|
||||
will not be loaded.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint ignore):
|
||||
ecore_con_url_cookies_ignore_old_session_set(self.obj2, ignore)
|
||||
|
||||
property ssl_verify_peer:
|
||||
"""Toggle libcurl's verify peer's certificate option.
|
||||
|
||||
If this is ``True``, libcurl will verify the authenticity of the
|
||||
peer's certificate, otherwise it will not. Default behavior of libcurl
|
||||
is to check peer's certificate.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint verify):
|
||||
ecore_con_url_ssl_verify_peer_set(self.obj2, verify)
|
||||
|
||||
property ssl_ca:
|
||||
"""Set a custom CA to trust for SSL/TLS connections.
|
||||
|
||||
Specify the path of a file (in PEM format) containing one or more CA
|
||||
certificate(s) to use for the validation of the server certificate.
|
||||
|
||||
This can also disable CA validation if set to ``None``.
|
||||
However, the server certificate still needs to be valid for the
|
||||
connection to succeed (i.e., the certificate must concern the server
|
||||
the connection is made to).
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, ca_path):
|
||||
if isinstance(ca_path, unicode):
|
||||
ca_path = PyUnicode_AsUTF8String(ca_path)
|
||||
ecore_con_url_ssl_ca_set(self.obj2,
|
||||
<const char *>ca_path if ca_path is not None else NULL)
|
||||
|
||||
property proxy:
|
||||
"""Set the HTTP proxy to use.
|
||||
|
||||
The parameter is the host name or dotted IP address. To specify port
|
||||
number in this string, append :[port] to the end of the host name. The
|
||||
proxy string may be prefixed with [protocol]:// since any such prefix
|
||||
will be ignored. The proxy's port number may optionally be specified
|
||||
with the separate option. If not specified, libcurl will default to
|
||||
using port 1080 for proxies.
|
||||
|
||||
Set this to ``None`` to disable the usage of proxy.
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, proxy):
|
||||
if isinstance(proxy, unicode): proxy = PyUnicode_AsUTF8String(proxy)
|
||||
ecore_con_url_proxy_set(self.obj2,
|
||||
<const char *>proxy if proxy is not None else NULL)
|
||||
|
||||
property proxy_username:
|
||||
"""Username to use for proxy.
|
||||
|
||||
If socks protocol is used for proxy, protocol should be socks5 and
|
||||
above.
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, user):
|
||||
if isinstance(user, unicode): user = PyUnicode_AsUTF8String(user)
|
||||
ecore_con_url_proxy_username_set(self.obj2,
|
||||
<const char *>user if user is not None else NULL)
|
||||
|
||||
property proxy_password:
|
||||
"""Password to use for proxy.
|
||||
|
||||
If socks protocol is used for proxy, protocol should be socks5 and
|
||||
above.
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, passwd):
|
||||
if isinstance(passwd, unicode): passwd = PyUnicode_AsUTF8String(passwd)
|
||||
ecore_con_url_proxy_username_set(self.obj2,
|
||||
<const char *>passwd if passwd is not None else NULL)
|
||||
|
||||
property timeout:
|
||||
"""transfer timeout in seconds.
|
||||
|
||||
The maximum time in seconds that you allow the :class:`Url` class
|
||||
transfer operation to take. Normally, name lookups can take a
|
||||
considerable time and limiting operations to less than a few minutes
|
||||
risk aborting perfectly normal operations.
|
||||
|
||||
:type: double (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, double timeout):
|
||||
ecore_con_url_timeout_set(self.obj2, timeout)
|
||||
|
||||
property http_version:
|
||||
"""The HTTP version used for the request.
|
||||
|
||||
Can be :data:`ECORE_CON_URL_HTTP_VERSION_1_0` or
|
||||
:data:`ECORE_CON_URL_HTTP_VERSION_1_1`
|
||||
|
||||
:type: :ref:`Ecore_Con_Url_Http_Version` (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, Ecore_Con_Url_Http_Version version):
|
||||
ecore_con_url_http_version_set(self.obj2, version)
|
||||
|
||||
property status_code:
|
||||
"""The returned HTTP STATUS code.
|
||||
|
||||
This is used to, at any time, try to return the status code for a
|
||||
transmission.
|
||||
|
||||
:type: int (**readonly**)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return ecore_con_url_status_code_get(self.obj2)
|
||||
|
||||
property url:
|
||||
"""Controls the URL to send the request to.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(ecore_con_url_url_get(self.obj2))
|
||||
|
||||
def __set__(self, url):
|
||||
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
||||
ecore_con_url_url_set(self.obj2, <const char *>url if url is not None else NULL)
|
||||
|
||||
property verbose:
|
||||
"""Toggle libcurl's verbose output.
|
||||
|
||||
If set to ``True``, libcurl will output a lot of verbose
|
||||
information about its operations, which is useful for debugging. The
|
||||
verbose information will be sent to stderr.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint verbose):
|
||||
ecore_con_url_verbose_set(self.obj2, verbose)
|
||||
|
||||
def additional_header_add(self, key, value):
|
||||
"""Add an additional header to the request connection object.
|
||||
|
||||
Add an additional header (User-Agent, Content-Type, etc.) to the
|
||||
request connection object. This addition will be valid for only one
|
||||
:func:`get` or :func:`post` call.
|
||||
|
||||
:param string key: Header key
|
||||
:param string value: Header value
|
||||
|
||||
Some functions like :func:`time` also add headers to the request.
|
||||
|
||||
"""
|
||||
if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key)
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
ecore_con_url_additional_header_add(self.obj2,
|
||||
<const char *>key if key is not None else NULL,
|
||||
<const char *>value if value is not None else NULL)
|
||||
|
||||
def additional_headers_clear(self):
|
||||
"""Clean additional headers.
|
||||
|
||||
Clean additional headers associated with a connection object
|
||||
(previously added with :func:additional_header_add`).
|
||||
|
||||
"""
|
||||
ecore_con_url_additional_headers_clear(self.obj2)
|
||||
|
||||
property response_headers:
|
||||
"""The headers from last request sent.
|
||||
|
||||
Retrieve a list containing the response headers. This function should
|
||||
be used after an :class:`EventUrlComplete` event (headers should
|
||||
normally be ready at that time).
|
||||
|
||||
:type: list of strings (**readonly**)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return eina_list_strings_to_python_list(
|
||||
ecore_con_url_response_headers_get(self.obj2))
|
||||
|
||||
property received_bytes:
|
||||
"""The number of bytes received.
|
||||
|
||||
Retrieve the number of bytes received on the last request of the
|
||||
:class:`Url` object.
|
||||
|
||||
:type: int (**readonly**)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return ecore_con_url_received_bytes_get(self.obj2)
|
||||
|
||||
def httpauth_set(self, username, password, bint safe):
|
||||
"""Set to use http auth, with given username and password
|
||||
|
||||
:param string username: Username to use in authentication
|
||||
:param string password: Password to use in authentication
|
||||
:param bool safe: Whether to use "safer" methods (eg, NOT http basic auth)
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
:rtype: bool
|
||||
|
||||
.. warning:: Require libcurl >= 7.19.1 to work, otherwise will
|
||||
always return ``False``.
|
||||
|
||||
"""
|
||||
if isinstance(username, unicode):
|
||||
username = PyUnicode_AsUTF8String(username)
|
||||
if isinstance(password, unicode):
|
||||
password = PyUnicode_AsUTF8String(password)
|
||||
return bool(ecore_con_url_httpauth_set(self.obj2,
|
||||
<const char *>username if username is not None else NULL,
|
||||
<const char *>password if password is not None else NULL,
|
||||
safe))
|
||||
|
||||
def on_complete_event_add(self, func, *args, **kargs):
|
||||
"""Adds event listener to know when the Url operation is completed.
|
||||
|
||||
The given function will be called with the following signature::
|
||||
|
||||
func(event, *args, **kargs)
|
||||
|
||||
The ``event`` parameter is an :class:`EventUrlComplete` instance.
|
||||
|
||||
:see: :func:`on_complete_event_del`
|
||||
|
||||
"""
|
||||
GEF.callback_add(ECORE_CON_EVENT_URL_COMPLETE, self, func, args, kargs)
|
||||
|
||||
def on_complete_event_del(self, func, *args, **kargs):
|
||||
"""Removes an event listener previously registered
|
||||
|
||||
Parameters must match exactly the ones given in the
|
||||
:func:`on_complete_event_add` call
|
||||
|
||||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
GEF.callback_del(ECORE_CON_EVENT_URL_COMPLETE, self, func, args, kargs)
|
||||
|
||||
def on_progress_event_add(self, func, *args, **kargs):
|
||||
"""Adds event listener to know the operation status progress.
|
||||
|
||||
The given function will be called with the following signature::
|
||||
|
||||
func(event, *args, **kargs)
|
||||
|
||||
The ``event`` parameter is an :class:`EventUrlProgress` instance.
|
||||
|
||||
:see: :func:`on_progress_event_del`
|
||||
|
||||
"""
|
||||
GEF.callback_add(ECORE_CON_EVENT_URL_PROGRESS, self, func, args, kargs)
|
||||
|
||||
def on_progress_event_del(self, func, *args, **kargs):
|
||||
"""Removes an event listener previously registered
|
||||
|
||||
Parameters must match exactly the ones given in the
|
||||
:func:`on_progress_event_add` call
|
||||
|
||||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
GEF.callback_del(ECORE_CON_EVENT_URL_PROGRESS, self, func, args, kargs)
|
||||
|
||||
def on_data_event_add(self, func, *args, **kargs):
|
||||
"""Adds event listener to collect the data while they are received.
|
||||
|
||||
The given function will be called with the following signature::
|
||||
|
||||
func(event, *args, **kargs)
|
||||
|
||||
The ``event`` parameter is an :class:`EventUrlData` instance.
|
||||
|
||||
:see: :func:`on_data_event_del`
|
||||
|
||||
"""
|
||||
GEF.callback_add(ECORE_CON_EVENT_URL_DATA, self, func, args, kargs)
|
||||
|
||||
def on_data_event_del(self, func, *args, **kargs):
|
||||
"""Removes an event listener previously registered
|
||||
|
||||
Parameters must match exactly the ones given in the
|
||||
:func:`on_data_event_add` call
|
||||
|
||||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
GEF.callback_del(ECORE_CON_EVENT_URL_DATA, self, func, args, kargs)
|
||||
|
||||
|
||||
def url_pipeline_set(bint enable):
|
||||
"""Enable or disable HTTP 1.1 pipelining.
|
||||
|
||||
Pipelining allows to send one request after another one, without having to
|
||||
wait for the reply of the first request. The respective replies are
|
||||
received in the order that the requests were sent.
|
||||
|
||||
.. warning:: Enabling this feature will be valid for all requests done
|
||||
using ecore_con_url.
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
ecore_con_url_pipeline_set(enable)
|
||||
|
||||
def url_pipeline_get():
|
||||
"""Is HTTP 1.1 pipelining enable ?
|
||||
|
||||
:return: ``True`` if enable
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
return bool(ecore_con_url_pipeline_get())
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
# Copyright (C) 2007-2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
||||
:mod:`efl.ecore_input` Module
|
||||
#############################
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
This module provide access to the low-level input events, you usually
|
||||
don't need to use this stuff, unless you need some sort of custom event
|
||||
handling.
|
||||
|
||||
To be informed about specific events just use one of the
|
||||
on_*_add(func, \*args, \**kargs) functions, the callback given will be fired
|
||||
when events occur.
|
||||
|
||||
Callback signature is::
|
||||
|
||||
func(event, *args, **kargs) → int
|
||||
|
||||
Where ``event`` will be a class relative to the specific event (such as
|
||||
:class:`EventKey`) All the additional arguments and keyword arguments passed
|
||||
in the \*_add function will be passed back in the callback.
|
||||
|
||||
In some events (EventKey at least) the callback function may return
|
||||
ecore.ECORE_CALLBACK_DONE or ecore.ECORE_CALLBACK_PASS_ON to block the
|
||||
event propagation down the chain or not.
|
||||
|
||||
To stop receiving event use :func:`efl.ecore.EventHandler.delete`
|
||||
|
||||
|
||||
Enumerations
|
||||
============
|
||||
|
||||
.. _Ecore_Event_Modifier:
|
||||
|
||||
Ecore_Event_Modifier
|
||||
--------------------
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_SHIFT
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_CTRL
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_ALT
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_WIN
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_SCROLL
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_NUM
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_CAPS
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_SCROLL
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_NUM
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_CAPS
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_SHIFT
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_ALTGR
|
||||
|
||||
|
||||
Classes and Functions
|
||||
=====================
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import atexit
|
||||
import traceback
|
||||
|
||||
cimport efl.ecore_input.enums as enums
|
||||
|
||||
def init():
|
||||
""" Initialize the Ecore Input library
|
||||
|
||||
.. note:: You never need to call this, it is automatically called at module
|
||||
import
|
||||
"""
|
||||
ecore_event_init()
|
||||
_ecore_input_events_register()
|
||||
|
||||
def shutdown():
|
||||
""" Shutdown the Ecore Input library.
|
||||
|
||||
.. note:: You never need to call this, it is automatically called at exit
|
||||
|
||||
"""
|
||||
ecore_event_shutdown()
|
||||
|
||||
|
||||
include "efl.ecore_input_events.pxi"
|
||||
|
||||
init()
|
||||
atexit.register(shutdown)
|
|
@ -0,0 +1,394 @@
|
|||
# Copyright (C) 2007-2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from efl.utils.conversions cimport _ctouni
|
||||
|
||||
|
||||
ECORE_EVENT_MODIFIER_SHIFT = enums.ECORE_EVENT_MODIFIER_SHIFT
|
||||
ECORE_EVENT_MODIFIER_CTRL = enums.ECORE_EVENT_MODIFIER_CTRL
|
||||
ECORE_EVENT_MODIFIER_ALT = enums.ECORE_EVENT_MODIFIER_ALT
|
||||
ECORE_EVENT_MODIFIER_WIN = enums.ECORE_EVENT_MODIFIER_WIN
|
||||
ECORE_EVENT_MODIFIER_SCROLL = enums.ECORE_EVENT_MODIFIER_SCROLL
|
||||
ECORE_EVENT_MODIFIER_NUM = enums.ECORE_EVENT_MODIFIER_NUM
|
||||
ECORE_EVENT_MODIFIER_CAPS = enums.ECORE_EVENT_MODIFIER_CAPS
|
||||
ECORE_EVENT_LOCK_SCROLL = enums.ECORE_EVENT_LOCK_SCROLL
|
||||
ECORE_EVENT_LOCK_NUM = enums.ECORE_EVENT_LOCK_NUM
|
||||
ECORE_EVENT_LOCK_CAPS = enums.ECORE_EVENT_LOCK_CAPS
|
||||
ECORE_EVENT_LOCK_SHIFT = enums.ECORE_EVENT_LOCK_SHIFT
|
||||
ECORE_EVENT_MODIFIER_ALTGR = enums.ECORE_EVENT_MODIFIER_ALTGR
|
||||
|
||||
|
||||
# NOTE: Cannot use ecore._event_mapping_register helper here
|
||||
# because ECORE_EVENT_* are already registered by ecore.x
|
||||
# Thus we need a separate mapping to not conflict.
|
||||
cdef object _input_event_type_mapping = None
|
||||
|
||||
cdef int _ecore_input_events_register() except 0:
|
||||
global _input_event_type_mapping
|
||||
|
||||
if not _input_event_type_mapping:
|
||||
_input_event_type_mapping = {
|
||||
ECORE_EVENT_KEY_DOWN: EventKey,
|
||||
ECORE_EVENT_KEY_UP: EventKey,
|
||||
ECORE_EVENT_MOUSE_BUTTON_DOWN: EventMouseButton,
|
||||
ECORE_EVENT_MOUSE_BUTTON_UP: EventMouseButton,
|
||||
ECORE_EVENT_MOUSE_MOVE: EventMouseMove,
|
||||
ECORE_EVENT_MOUSE_IN: EventMouseIO,
|
||||
ECORE_EVENT_MOUSE_OUT: EventMouseIO,
|
||||
ECORE_EVENT_MOUSE_WHEEL: EventMouseWheel,
|
||||
}
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
cdef Eina_Bool _input_event_handler_cb(void *data, int type, void *event) with gil:
|
||||
cdef EventHandler handler
|
||||
cdef Eina_Bool r
|
||||
|
||||
assert event != NULL
|
||||
assert data != NULL, "data should not be NULL!"
|
||||
handler = <EventHandler>data
|
||||
assert type == handler.type, "handler type isn't the same as event type!"
|
||||
|
||||
try:
|
||||
r = handler._exec(event)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
r = 0
|
||||
|
||||
return r
|
||||
|
||||
|
||||
cdef class InputEventHandler(EventHandler):
|
||||
"""
|
||||
The event handler class
|
||||
|
||||
You never instantiate this class directly, instead use one of the
|
||||
on_*_add() functions.
|
||||
"""
|
||||
def __init__(self, int type, func, *args, **kargs):
|
||||
|
||||
if not callable(func):
|
||||
raise TypeError("Parameter 'func' must be callable")
|
||||
|
||||
event_cls = _input_event_type_mapping.get(type)
|
||||
if event_cls is None:
|
||||
raise ValueError("Unknow Ecore_Event type %d" % type)
|
||||
|
||||
self.type = type
|
||||
self.event_cls = event_cls
|
||||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_event_handler_add(type, _input_event_handler_cb,
|
||||
<void *>self))
|
||||
|
||||
|
||||
cdef class EventKey(Event):
|
||||
""" EventKey()
|
||||
|
||||
Contains information about an Ecore keyboard event.
|
||||
|
||||
.. seealso :: :func:`on_key_down_add`, :func:`on_key_up_add`
|
||||
|
||||
:ivar str keyname: The key name
|
||||
:ivar str key: The key symbol
|
||||
:ivar str string:
|
||||
:ivar int compose: Final string corresponding to the key symbol composed
|
||||
:ivar int timestamp: Time when the event occurred.
|
||||
:ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
|
||||
:ivar bool same_screen: Same screen flag
|
||||
:ivar int keycode: Key scan code numeric value
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Event_Key *obj
|
||||
obj = <Ecore_Event_Key*>o
|
||||
self.keyname = _ctouni(obj.keyname)
|
||||
self.key = _ctouni(obj.key)
|
||||
self.string = _ctouni(obj.string)
|
||||
self.compose = _ctouni(obj.compose)
|
||||
## Can we do something with this Window opaque struct ?
|
||||
# self.window = Window(<unsigned long><void*>obj.window)
|
||||
# self.root_window = Window(<unsigned long><void*>obj.root_window)
|
||||
# self.event_window = Window(<unsigned long><void*>obj.event_window)
|
||||
self.timestamp = obj.timestamp
|
||||
self.modifiers = obj.modifiers
|
||||
self.same_screen = bool(obj.same_screen)
|
||||
self.keycode = obj.keycode
|
||||
return 1
|
||||
|
||||
|
||||
cdef class EventPoint:
|
||||
"""
|
||||
:ivar int x: x coordinate
|
||||
:ivar int y: y coordinate
|
||||
"""
|
||||
def __init__(self, int x, int y):
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
def __repr__(self):
|
||||
return "<EventPoint x=%d y=%d>" % (self.x, self.y)
|
||||
|
||||
|
||||
cdef class EventMulti:
|
||||
"""
|
||||
:ivar int device: 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers)
|
||||
:ivar double radius: radius of press point - radius_x and y if its an ellipse (radius is the average of the 2)
|
||||
:ivar double radius_x:
|
||||
:ivar double radius_y:
|
||||
:ivar double pressure: 1.0 == normal, > 1.0 == more, 0.0 == none
|
||||
:ivar double angle: relative to perpendicular (0.0 == perpendicular), in degrees
|
||||
:ivar double x: with sub-pixel precision, if available
|
||||
:ivar double y: with sub-pixel precision, if available
|
||||
:ivar double root_x: with sub-pixel precision, if available
|
||||
:ivar double root_y: with sub-pixel precision, if available
|
||||
"""
|
||||
def __init__(self, int device, double radius, double radius_x, double radius_y,
|
||||
double pressure, double angle, double x, double y,
|
||||
double root_x, double root_y):
|
||||
self.device = device
|
||||
self.radius = radius
|
||||
self.radius_x = radius_x
|
||||
self.radius_y = radius_y
|
||||
self.pressure = pressure
|
||||
self.angle = angle
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.root_x = root_x
|
||||
self.root_y = root_y
|
||||
|
||||
def __repr__(self):
|
||||
return "<EventMulti>"
|
||||
|
||||
|
||||
cdef class EventMouseButton(Event):
|
||||
""" EventMouseButton()
|
||||
|
||||
Contains information about an Ecore mouse button event.
|
||||
|
||||
.. seealso :: :func:`on_mouse_button_down_add`, :func:`on_mouse_button_up_add`
|
||||
|
||||
:ivar int timestamp: Time when the event occurred
|
||||
:ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
|
||||
:ivar int buttons: The button that was used
|
||||
:ivar bool double_click: Double click event
|
||||
:ivar bool triple_click: Triple click event
|
||||
:ivar bool same_screen: Same screen flag
|
||||
:ivar int x: x coordinate relative to window where event happened
|
||||
:ivar int y: y coordinate relative to window where event happened
|
||||
:ivar EventPoint root: :class:`EventPoint` Coordinates relative to root window
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Event_Mouse_Button *obj
|
||||
obj = <Ecore_Event_Mouse_Button*>o
|
||||
# self.window = Window(<unsigned long><void*>obj.window)
|
||||
# self.root_window = Window(<unsigned long><void*>obj.root_window)
|
||||
# self.event_window = Window(<unsigned long><void*>obj.event_window)
|
||||
self.timestamp = obj.timestamp
|
||||
self.modifiers = obj.modifiers
|
||||
self.buttons = obj.buttons
|
||||
self.double_click = bool(obj.double_click)
|
||||
self.triple_click = bool(obj.triple_click)
|
||||
self.same_screen = bool(obj.same_screen)
|
||||
self.x = obj.x
|
||||
self.y = obj.y
|
||||
self.root = EventPoint(obj.root.x, obj.root.y)
|
||||
self.multi = EventMulti(obj.multi.device, obj.multi.radius,
|
||||
obj.multi.radius_x, obj.multi.radius_y,
|
||||
obj.multi.pressure, obj.multi.angle,
|
||||
obj.multi.x, obj.multi.y,
|
||||
obj.multi.root.x, obj.multi.root.y)
|
||||
return 1
|
||||
|
||||
|
||||
cdef class EventMouseMove(Event):
|
||||
""" EventMouseMove()
|
||||
|
||||
Contains information about an Ecore mouse move event.
|
||||
|
||||
.. seealso :: :func:`on_mouse_move_add`
|
||||
|
||||
:ivar int timestamp: Time when the event occurred
|
||||
:ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
|
||||
:ivar bool same_screen: Same screen flag
|
||||
:ivar int x: x coordinate relative to window where event happened
|
||||
:ivar int y: y coordinate relative to window where event happened
|
||||
:ivar EventPoint root: Coordinates relative to root window
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Event_Mouse_Move *obj
|
||||
obj = <Ecore_Event_Mouse_Move *>o
|
||||
# self.window = Window(<unsigned long><void*>obj.window)
|
||||
# self.root_window = Window(<unsigned long><void*>obj.root_window)
|
||||
# self.event_window = Window(<unsigned long><void*>obj.event_window)
|
||||
self.timestamp = obj.timestamp
|
||||
self.modifiers = obj.modifiers
|
||||
self.same_screen = bool(obj.same_screen)
|
||||
self.x = obj.x
|
||||
self.y = obj.y
|
||||
self.root = EventPoint(obj.root.x, obj.root.y)
|
||||
self.multi = EventMulti(obj.multi.device, obj.multi.radius,
|
||||
obj.multi.radius_x, obj.multi.radius_y,
|
||||
obj.multi.pressure, obj.multi.angle,
|
||||
obj.multi.x, obj.multi.y,
|
||||
obj.multi.root.x, obj.multi.root.y)
|
||||
return 1
|
||||
|
||||
|
||||
cdef class EventMouseIO(Event):
|
||||
""" EventMouseIO()
|
||||
|
||||
Contains information about an Ecore mouse input/output event.
|
||||
|
||||
.. seealso :: :func:`on_mouse_in_add`, :func:`on_mouse_out_add`
|
||||
|
||||
:ivar int timestamp: Time when the event occurred
|
||||
:ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
|
||||
:ivar int x: x coordinate relative to window where event happened
|
||||
:ivar int y: y coordinate relative to window where event happened
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Event_Mouse_IO *obj
|
||||
obj = <Ecore_Event_Mouse_IO *>o
|
||||
# self.window = Window(<unsigned long><void*>obj.window)
|
||||
# self.event_window = Window(<unsigned long><void*>obj.event_window)
|
||||
self.timestamp = obj.timestamp
|
||||
self.modifiers = obj.modifiers
|
||||
self.x = obj.x
|
||||
self.y = obj.y
|
||||
return 1
|
||||
|
||||
|
||||
cdef class EventMouseWheel(Event):
|
||||
""" EventMouseWheel()
|
||||
|
||||
Contains information about an Ecore mouse wheel event.
|
||||
|
||||
.. seealso :: :func:`on_mouse_wheel_add`
|
||||
|
||||
:ivar int timestamp: Time when the event occurred
|
||||
:ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
|
||||
:ivar bool same_screen: Same screen flag
|
||||
:ivar int direction: Orientation of the wheel (horizontal/vertical)
|
||||
:ivar int z: Value of the wheel event (+1/-1)
|
||||
:ivar int x: x coordinate relative to window where event happened
|
||||
:ivar int y: y coordinate relative to window where event happened
|
||||
:ivar EventPoint root: Coordinates relative to root window.
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Event_Mouse_Wheel *obj
|
||||
obj = <Ecore_Event_Mouse_Wheel *>o
|
||||
# self.window = Window(<unsigned long><void*>obj.window)
|
||||
# self.root_window = Window(<unsigned long><void*>obj.root_window)
|
||||
# self.event_window = Window(<unsigned long><void*>obj.event_window)
|
||||
self.timestamp = obj.timestamp
|
||||
self.modifiers = obj.modifiers
|
||||
self.same_screen = bool(obj.same_screen)
|
||||
self.direction = obj.direction
|
||||
self.z = obj.z
|
||||
self.x = obj.x
|
||||
self.y = obj.y
|
||||
self.root = EventPoint(obj.root.x, obj.root.y)
|
||||
return 1
|
||||
|
||||
|
||||
def on_key_down_add(func, *args, **kargs):
|
||||
"""
|
||||
Creates an ecore event handler for the ECORE_EVENT_KEY_DOWN event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventKey`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_KEY_DOWN, func, *args, **kargs)
|
||||
|
||||
def on_key_up_add(func, *args, **kargs):
|
||||
"""
|
||||
Creates an ecore event handler for the ECORE_EVENT_KEY_UP event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventKey`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_KEY_UP, func, *args, **kargs)
|
||||
|
||||
def on_mouse_button_down_add(func, *args, **kargs):
|
||||
"""
|
||||
Creates an ecore event handler for the ECORE_EVENT_MOUSE_BUTTON_DOWN event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventMouseButton`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_MOUSE_BUTTON_DOWN, func, *args, **kargs)
|
||||
|
||||
def on_mouse_button_up_add(func, *args, **kargs):
|
||||
"""
|
||||
Create an ecore event handler for the ECORE_EVENT_MOUSE_BUTTON_UP event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventMouseButton`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_MOUSE_BUTTON_UP, func, *args, **kargs)
|
||||
|
||||
def on_mouse_move_add(func, *args, **kargs):
|
||||
"""
|
||||
Create an ecore event handler for the ECORE_EVENT_MOUSE_MOVE event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventMouseMove`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_MOUSE_MOVE, func, *args, **kargs)
|
||||
|
||||
def on_mouse_in_add(func, *args, **kargs):
|
||||
"""
|
||||
Create an ecore event handler for the ECORE_EVENT_MOUSE_IN event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventMouseIO`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_MOUSE_IN, func, *args, **kargs)
|
||||
|
||||
def on_mouse_out_add(func, *args, **kargs):
|
||||
"""
|
||||
Create an ecore event handler for the ECORE_EVENT_MOUSE_OUT event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventMouseIO`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_MOUSE_OUT, func, *args, **kargs)
|
||||
|
||||
def on_mouse_wheel_add(func, *args, **kargs):
|
||||
"""
|
||||
Create an ecore event handler for the ECORE_EVENT_MOUSE_WHEEL event.
|
||||
|
||||
:return: :class:`InputEventHandler`
|
||||
|
||||
.. seealso:: :class:`EventMouseWheel`
|
||||
"""
|
||||
return InputEventHandler(ECORE_EVENT_MOUSE_WHEEL, func, *args, **kargs)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue