Compare commits
94 Commits
master
...
devs/kuuko
Author | SHA1 | Date |
---|---|---|
Kai Huuhko | 02fa82441f | |
Kai Huuhko | 8ba060b80f | |
Kai Huuhko | 0f905b18e9 | |
Davide Andreoli | ded193fb75 | |
Kai Huuhko | ec4f6dd7ed | |
Kai Huuhko | b4b2f904dd | |
Tom Hacohen | ae10c15fb8 | |
Kai Huuhko | 9f08f3beea | |
Kai Huuhko | 336548178a | |
Kai Huuhko | 46e5b7edd1 | |
Kai Huuhko | 8f33ffdc40 | |
Kai Huuhko | 545e974bd4 | |
Kai Huuhko | 98a3a400de | |
Kai Huuhko | c18d8880a0 | |
Kai Huuhko | 0c930094cb | |
Kai Huuhko | 1a05ad0192 | |
Kai Huuhko | 8ed37421c6 | |
Kai Huuhko | f84fef0415 | |
Kai Huuhko | 2ba244d263 | |
Kai Huuhko | a795ec8c10 | |
Kai Huuhko | 6b45d3429d | |
Kai Huuhko | 8d116e2822 | |
Kai Huuhko | 60ebcabd1e | |
Kai Huuhko | 5fcb8fa569 | |
Kai Huuhko | 0faee7c36e | |
Kai Huuhko | 6de7432e28 | |
Kai Huuhko | 81d00a496a | |
Kai Huuhko | 2543fa6a17 | |
Kai Huuhko | fe16722cbe | |
Kai Huuhko | 9af2bbe472 | |
Kai Huuhko | 99d5ccd87b | |
Kai Huuhko | f2148fe743 | |
Kai Huuhko | 60f0f6b814 | |
Kai Huuhko | abbf6eceaa | |
Kai Huuhko | eba1a05bca | |
Kai Huuhko | 5e74c720a9 | |
Kai Huuhko | e46e109cab | |
Kai Huuhko | edc2be0113 | |
Kai Huuhko | 3324f92276 | |
Kai Huuhko | 9acfcf842e | |
Kai Huuhko | 4073498434 | |
Kai Huuhko | 53a8742878 | |
Kai Huuhko | 6b6788c12c | |
Kai Huuhko | 71371c00e0 | |
Kai Huuhko | 9b70139a7f | |
Kai Huuhko | c0f64781ed | |
Kai Huuhko | 00eaaead83 | |
Kai Huuhko | 7a3081d12d | |
Kai Huuhko | da444abce5 | |
Kai Huuhko | 39e7a7a2fd | |
Kai Huuhko | 7810bcb216 | |
Kai Huuhko | 7222158dfd | |
Kai Huuhko | 7a0f756ba8 | |
Kai Huuhko | 45e43df37c | |
Kai Huuhko | 1c6f42b395 | |
Kai Huuhko | d4c47203e2 | |
Kai Huuhko | 67d9128089 | |
Kai Huuhko | 8bd6c3e778 | |
Kai Huuhko | 8e9827e8f2 | |
Kai Huuhko | c1be409a9c | |
Kai Huuhko | 3a0ef786dc | |
Kai Huuhko | e62205769f | |
Kai Huuhko | 0fa41e652d | |
Kai Huuhko | 9687624f47 | |
Kai Huuhko | 7ba7bef479 | |
Kai Huuhko | 0ee569672b | |
Kai Huuhko | a9e0bb6f4d | |
Kai Huuhko | 5416e1dadc | |
Kai Huuhko | 0a3671579a | |
Kai Huuhko | dfb0a7f078 | |
Kai Huuhko | bb9a64aa71 | |
Kai Huuhko | 06088c23e0 | |
Kai Huuhko | 5795f762dc | |
Kai Huuhko | 137e6b7e21 | |
Kai Huuhko | 8b59680eec | |
Kai Huuhko | bcac382354 | |
Kai Huuhko | 99f9220fea | |
Kai Huuhko | 11bc1b64a5 | |
Kai Huuhko | 9734b81fd1 | |
Kai Huuhko | 5bd82c2883 | |
Kai Huuhko | 7e4838fe5b | |
Kai Huuhko | 19ecd9af2e | |
Kai Huuhko | 3ef8626ba4 | |
Kai Huuhko | abefe9eb89 | |
Kai Huuhko | e5c82e08d6 | |
Kai Huuhko | 3d196ef231 | |
Kai Huuhko | 10c60e812b | |
Kai Huuhko | 1ac4c41179 | |
Kai Huuhko | 0baba91e0a | |
Kai Huuhko | a4fa686a27 | |
Kai Huuhko | db8f8ff2f6 | |
Kai Huuhko | cb7c2bf07b | |
Kai Huuhko | 38a1d15016 | |
Kai Huuhko | 4e700fe0d3 |
|
@ -25,6 +25,12 @@ pip-log.txt
|
||||||
*.mo
|
*.mo
|
||||||
|
|
||||||
# Cython generated files
|
# Cython generated files
|
||||||
efl/*/*.c
|
efl2/*/*.c
|
||||||
efl/*/*.h
|
efl2/*/*.h
|
||||||
efl/*/*.html
|
efl2/*/*.html
|
||||||
|
eolian/*.c
|
||||||
|
eolian/*.h
|
||||||
|
eolian/*.html
|
||||||
|
|
||||||
|
#Eolian generated files
|
||||||
|
generated_*.pxi
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Kai Huuhko <kai.huuhko@gmail.com> Kai Huuhko <k.huuhko@partner.samsung.com>
|
4
INSTALL
4
INSTALL
|
@ -30,6 +30,10 @@
|
||||||
sources by setting the environment variable DISABLE_CYTHON to 1.
|
sources by setting the environment variable DISABLE_CYTHON to 1.
|
||||||
|
|
||||||
|
|
||||||
|
* BUILDING THE EOLIAN BINDINGS (system installation not required)
|
||||||
|
|
||||||
|
python setup_eolian.py build
|
||||||
|
|
||||||
* BUILDING WITH GCC/G++ (Linux, OS X, etc.)
|
* BUILDING WITH GCC/G++ (Linux, OS X, etc.)
|
||||||
|
|
||||||
python setup.py build
|
python setup.py build
|
||||||
|
|
|
@ -47,12 +47,13 @@ py_excludes = "|".join(py_exclude_list)
|
||||||
params = {
|
params = {
|
||||||
"eo": ("include", "Eo", "eo"),
|
"eo": ("include", "Eo", "eo"),
|
||||||
"evas": ("include", "Evas", "evas"),
|
"evas": ("include", "Evas", "evas"),
|
||||||
"ecore": ("efl/ecore", "Ecore", "ecore"),
|
"ecore": ("efl2/ecore", "Ecore", "ecore"),
|
||||||
"ecore-file": ("efl/ecore", "Ecore_File", "ecore_file"),
|
"ecore-file": ("efl2/ecore", "Ecore_File", "ecore_file"),
|
||||||
"ecore-x": ("efl/ecore", "Ecore_X", "ecore_x"),
|
"ecore-x": ("efl2/ecore", "Ecore_X", "ecore_x"),
|
||||||
"edje": ("include", "Edje", "edje"),
|
"edje": ("include", "Edje", "edje"),
|
||||||
"emotion": ("include", "Emotion", "emotion"),
|
"emotion": ("include", "Emotion", "emotion"),
|
||||||
"elementary": ("efl/elementary", "Elementary", "elm"),
|
"elementary": ("efl2/elementary", "Elementary", "elm"),
|
||||||
|
"eolian": ("eolian", "Eolian", "eolian")
|
||||||
}
|
}
|
||||||
|
|
||||||
EFL_MIN_VERSION = "1.9.99"
|
EFL_MIN_VERSION = "1.9.99"
|
||||||
|
@ -113,12 +114,14 @@ def pkg_config(require, min_vers=None):
|
||||||
|
|
||||||
|
|
||||||
def get_capis(inc_path, prefix):
|
def get_capis(inc_path, prefix):
|
||||||
|
capirets = []
|
||||||
capis = []
|
capis = []
|
||||||
capilns = []
|
capilns = []
|
||||||
capi_pattern = re.compile(
|
capi_pattern = re.compile(
|
||||||
"^ *EAPI [A-Za-z_ *\n]+ *\**\n?(?!" +
|
"^ *EAPI " +
|
||||||
c_excludes + ")(" + prefix +
|
"([A-Za-z_ *\n]+)[ *]*\n?" +
|
||||||
"_\w+) *\(",
|
"(?!" + c_excludes + ")" +
|
||||||
|
"(" + prefix + "_\w+)" + " *\(",
|
||||||
flags=re.S | re.M
|
flags=re.S | re.M
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -142,24 +145,29 @@ def get_capis(inc_path, prefix):
|
||||||
i += len(line)
|
i += len(line)
|
||||||
matches = re.finditer(capi_pattern, capi)
|
matches = re.finditer(capi_pattern, capi)
|
||||||
for match in matches:
|
for match in matches:
|
||||||
func = match.group(1)
|
funcret = match.group(1).replace("\n", "")
|
||||||
|
funcname = match.group(2)
|
||||||
start = match.start()
|
start = match.start()
|
||||||
line_n = line_starts.index(start) + 1
|
line_n = line_starts.index(start) + 1
|
||||||
capilns.append((f, line_n))
|
capilns.append((f, line_n))
|
||||||
capis.append(func)
|
capirets.append(funcret)
|
||||||
|
capis.append(funcname)
|
||||||
|
|
||||||
return capilns, capis
|
return capilns, capirets, capis
|
||||||
|
|
||||||
|
|
||||||
def get_pyapis(pxd_path, header_name, prefix):
|
def get_pyapis(pxd_path, header_name, prefix):
|
||||||
pyapilns = []
|
pyapilns = []
|
||||||
|
pyapirets = []
|
||||||
pyapis = []
|
pyapis = []
|
||||||
pyapi_pattern1 = re.compile(
|
pyapi_pattern1 = re.compile(
|
||||||
'cdef extern from "' + header_name + '\.h":\n(.+)',
|
'cdef extern from "' + header_name + '\.h":\n(.+)',
|
||||||
flags=re.S
|
flags=re.S
|
||||||
)
|
)
|
||||||
pyapi_pattern2 = re.compile(
|
pyapi_pattern2 = re.compile(
|
||||||
"^ +[a-zA-Z _*]+?(?!" + py_excludes + ")(" + prefix + "_\w+)\(",
|
"^ +([a-zA-Z _*]+?)" +
|
||||||
|
"(?!" + py_excludes + ")" +
|
||||||
|
"(" + prefix + "_\w+)" + "\(",
|
||||||
flags=re.M
|
flags=re.M
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -185,13 +193,15 @@ def get_pyapis(pxd_path, header_name, prefix):
|
||||||
i += len(line)
|
i += len(line)
|
||||||
matches = re.finditer(pyapi_pattern2, cdef.group(1))
|
matches = re.finditer(pyapi_pattern2, cdef.group(1))
|
||||||
for match in matches:
|
for match in matches:
|
||||||
func = match.group(1)
|
funcret = match.group(1)
|
||||||
|
func = match.group(2)
|
||||||
start = match.start() + offset
|
start = match.start() + offset
|
||||||
line_n = line_starts.index(start) + 1
|
line_n = line_starts.index(start) + 1
|
||||||
pyapilns.append((f, line_n))
|
pyapilns.append((f, line_n))
|
||||||
|
pyapirets.append(funcret)
|
||||||
pyapis.append(func)
|
pyapis.append(func)
|
||||||
|
|
||||||
return pyapilns, pyapis
|
return pyapilns, pyapirets, pyapis
|
||||||
|
|
||||||
|
|
||||||
rows, columns = os.popen('stty size', 'r').read().split()
|
rows, columns = os.popen('stty size', 'r').read().split()
|
||||||
|
@ -217,8 +227,13 @@ for lib in args.libs:
|
||||||
|
|
||||||
pxd_path, header_name, prefix = params[lib]
|
pxd_path, header_name, prefix = params[lib]
|
||||||
|
|
||||||
c_api_line_ns, c_apis = get_capis(inc_path, prefix)
|
c_api_line_ns, c_api_rets, c_apis = get_capis(inc_path, prefix)
|
||||||
py_api_line_ns, py_apis = get_pyapis(pxd_path, header_name, prefix)
|
py_api_line_ns, py_api_rets, py_apis = get_pyapis(pxd_path, header_name, prefix)
|
||||||
|
|
||||||
|
rets = zip(c_api_line_ns, c_api_rets, py_api_line_ns, py_api_rets)
|
||||||
|
for cln, cret, pyln, pyret in rets:
|
||||||
|
if cret != pyret:
|
||||||
|
print("SIGNATURE DIFFERS BETWEEN %s: %s AND %s: %s !!!" % (cln, cret, pyln, pyret))
|
||||||
|
|
||||||
capis = set(c_apis)
|
capis = set(c_apis)
|
||||||
pyapis = set(py_apis)
|
pyapis = set(py_apis)
|
||||||
|
|
|
@ -0,0 +1,119 @@
|
||||||
|
:mod:`eolian` Module
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. automodule:: efl.eolian.__init__
|
||||||
|
:exclude-members: FunctionType, ParameterDir, ClassType, FunctionScope
|
||||||
|
|
||||||
|
.. autoclass:: FunctionType
|
||||||
|
|
||||||
|
.. attribute:: UNRESOLVED
|
||||||
|
.. attribute:: PROPERTY
|
||||||
|
.. attribute:: PROP_SET
|
||||||
|
.. attribute:: PROP_GET
|
||||||
|
.. attribute:: METHOD
|
||||||
|
|
||||||
|
.. autoclass:: ParameterDir
|
||||||
|
|
||||||
|
.. attribute:: IN
|
||||||
|
.. attribute:: OUT
|
||||||
|
.. attribute:: INOUT
|
||||||
|
|
||||||
|
.. autoclass:: ClassType
|
||||||
|
|
||||||
|
.. attribute:: UNKNOWN
|
||||||
|
.. attribute:: REGULAR
|
||||||
|
.. attribute:: ABSTRACT
|
||||||
|
.. attribute:: MIXIN
|
||||||
|
.. attribute:: INTERFACE
|
||||||
|
|
||||||
|
.. autoclass:: ObjectScope
|
||||||
|
|
||||||
|
.. attribute:: PUBLIC
|
||||||
|
.. attribute:: PRIVATE
|
||||||
|
.. attribute:: PROTECTED
|
||||||
|
|
||||||
|
.. autoclass:: TypeType
|
||||||
|
|
||||||
|
.. attribute:: UNKNOWN
|
||||||
|
.. attribute:: VOID
|
||||||
|
.. attribute:: REGULAR
|
||||||
|
.. attribute:: REGULAR_STRUCT
|
||||||
|
.. attribute:: REGULAR_ENUM
|
||||||
|
.. attribute:: COMPLEX
|
||||||
|
.. attribute:: POINTER
|
||||||
|
.. attribute:: FUNCTION
|
||||||
|
.. attribute:: STRUCT
|
||||||
|
.. attribute:: STRUCT_OPAQUE
|
||||||
|
.. attribute:: ENUM
|
||||||
|
.. attribute:: ALIAS
|
||||||
|
.. attribute:: CLASS
|
||||||
|
|
||||||
|
.. autoclass:: ExpressionType
|
||||||
|
|
||||||
|
.. attribute:: UNKNOWN
|
||||||
|
.. attribute:: INT
|
||||||
|
.. attribute:: UINT
|
||||||
|
.. attribute:: LONG
|
||||||
|
.. attribute:: ULONG
|
||||||
|
.. attribute:: LLONG
|
||||||
|
.. attribute:: ULLONG
|
||||||
|
.. attribute:: FLOAT
|
||||||
|
.. attribute:: DOUBLE
|
||||||
|
.. attribute:: STRING
|
||||||
|
.. attribute:: CHAR
|
||||||
|
.. attribute:: NULL_
|
||||||
|
.. attribute:: BOOL
|
||||||
|
.. attribute:: NAME
|
||||||
|
.. attribute:: ENUM
|
||||||
|
.. attribute:: UNARY
|
||||||
|
.. attribute:: BINARY
|
||||||
|
|
||||||
|
.. autoclass:: ExpressionMask
|
||||||
|
|
||||||
|
.. attribute:: SINT
|
||||||
|
.. attribute:: UINT
|
||||||
|
.. attribute:: INT
|
||||||
|
.. attribute:: FLOAT
|
||||||
|
.. attribute:: BOOL
|
||||||
|
.. attribute:: STRING
|
||||||
|
.. attribute:: CHAR
|
||||||
|
.. attribute:: NULL_
|
||||||
|
.. attribute:: NUMBER
|
||||||
|
.. attribute:: ALL
|
||||||
|
|
||||||
|
.. autoclass:: VariableType
|
||||||
|
|
||||||
|
.. attribute:: UNKNOWN
|
||||||
|
.. attribute:: CONSTANT
|
||||||
|
.. attribute:: GLOBAL
|
||||||
|
|
||||||
|
.. autoclass:: BinaryOperator
|
||||||
|
|
||||||
|
.. attribute:: INVALID
|
||||||
|
|
||||||
|
.. attribute:: ADD
|
||||||
|
.. attribute:: SUB
|
||||||
|
.. attribute:: MUL
|
||||||
|
.. attribute:: DIV
|
||||||
|
.. attribute:: MOD
|
||||||
|
.. attribute:: EQ
|
||||||
|
.. attribute:: NQ
|
||||||
|
.. attribute:: GT
|
||||||
|
.. attribute:: LT
|
||||||
|
.. attribute:: GE
|
||||||
|
.. attribute:: LE
|
||||||
|
.. attribute:: AND
|
||||||
|
.. attribute:: OR
|
||||||
|
.. attribute:: BAND
|
||||||
|
.. attribute:: BOR
|
||||||
|
.. attribute:: BXOR
|
||||||
|
.. attribute:: LSH
|
||||||
|
.. attribute:: RSH
|
||||||
|
|
||||||
|
.. autoclass:: UnaryOperator
|
||||||
|
|
||||||
|
.. attribute:: INVALID
|
||||||
|
.. attribute:: UNM
|
||||||
|
.. attribute:: UNP
|
||||||
|
.. attribute:: NOT
|
||||||
|
.. attribute:: BNOT
|
|
@ -41,6 +41,11 @@ EO
|
||||||
|
|
||||||
.. toctree:: eo/eo.rst
|
.. toctree:: eo/eo.rst
|
||||||
|
|
||||||
|
Eolian
|
||||||
|
------
|
||||||
|
|
||||||
|
.. toctree:: eolian/eolian
|
||||||
|
|
||||||
|
|
||||||
Ecore
|
Ecore
|
||||||
-----
|
-----
|
||||||
|
|
|
@ -0,0 +1,154 @@
|
||||||
|
./ecore_audio/ecore_audio_in.eo
|
||||||
|
./ecore_audio/ecore_audio_out.eo
|
||||||
|
./ecore_audio/ecore_audio.eo
|
||||||
|
./ecore_audio/ecore_audio_out_sndfile.eo
|
||||||
|
./ecore_audio/ecore_audio_in_sndfile.eo
|
||||||
|
./ecore_audio/ecore_audio_in_tone.eo
|
||||||
|
./ecore_audio/ecore_audio_out_pulse.eo
|
||||||
|
./ecore_con/ecore_con_client.eo
|
||||||
|
./ecore_con/ecore_con_connector.eo
|
||||||
|
./ecore_con/ecore_con_base.eo
|
||||||
|
./ecore_con/ecore_con_server.eo
|
||||||
|
./ecore_con/ecore_con_url.eo
|
||||||
|
./efl/interfaces/efl_control.eo
|
||||||
|
./efl/interfaces/efl_image.eo
|
||||||
|
./efl/interfaces/efl_text.eo
|
||||||
|
./efl/interfaces/efl_text_properties.eo
|
||||||
|
./efl/interfaces/efl_player.eo
|
||||||
|
./efl/interfaces/efl_file.eo
|
||||||
|
./emotion/emotion_object.eo
|
||||||
|
./ecore/ecore_parent.eo
|
||||||
|
./ecore/ecore_mainloop.eo
|
||||||
|
./ecore/ecore_exe.eo
|
||||||
|
./ecore/ecore_poller.eo
|
||||||
|
./ecore/ecore_idle_enterer.eo
|
||||||
|
./ecore/ecore_idle_exiter.eo
|
||||||
|
./ecore/ecore_idler.eo
|
||||||
|
./ecore/ecore_timer.eo
|
||||||
|
./ecore/ecore_job.eo
|
||||||
|
./ecore/ecore_animator.eo
|
||||||
|
./eo/eo_abstract_class.eo
|
||||||
|
./eo/eo_base.eo
|
||||||
|
./evas/canvas/evas_textblock.eo
|
||||||
|
./evas/canvas/evas_line.eo
|
||||||
|
#./evas/canvas/evas_3d_scene.eo
|
||||||
|
./evas/canvas/evas_text.eo
|
||||||
|
./evas/canvas/evas_draggable_interface.eo
|
||||||
|
./evas/canvas/evas_object.eo
|
||||||
|
#./evas/canvas/evas_3d_light.eo
|
||||||
|
#./evas/canvas/evas_3d_mesh.eo
|
||||||
|
./evas/canvas/evas_scrollable_interface.eo
|
||||||
|
#./evas/canvas/evas_image.eo
|
||||||
|
./evas/canvas/evas_clickable_interface.eo
|
||||||
|
./evas/canvas/evas_rectangle.eo
|
||||||
|
./evas/canvas/evas_signal_interface.eo
|
||||||
|
./evas/canvas/evas_smart_clipped.eo
|
||||||
|
#./evas/canvas/evas_3d_object.eo
|
||||||
|
#./evas/canvas/evas_3d_node.eo
|
||||||
|
./evas/canvas/evas_canvas.eo
|
||||||
|
#./evas/canvas/evas_3d_texture.eo
|
||||||
|
./evas/canvas/evas_common_interface.eo
|
||||||
|
./evas/canvas/evas_object_smart.eo
|
||||||
|
./evas/canvas/evas_out.eo
|
||||||
|
#./evas/canvas/evas_table.eo
|
||||||
|
#./evas/canvas/evas_polygon.eo
|
||||||
|
#./evas/canvas/evas_3d_camera.eo
|
||||||
|
#./evas/canvas/evas_box.eo
|
||||||
|
#./evas/canvas/evas_3d_material.eo
|
||||||
|
./evas/canvas/evas_selectable_interface.eo
|
||||||
|
#./evas/canvas/evas_grid.eo
|
||||||
|
./evas/canvas/evas_zoomable_interface.eo
|
||||||
|
#./evas/canvas/evas_textgrid.eo
|
||||||
|
./edje/edje_object.eo
|
||||||
|
./edje/edje_edit.eo
|
||||||
|
#./elm_multibuttonentry.eo
|
||||||
|
#./elm_map.eo
|
||||||
|
#./elm_genlist.eo
|
||||||
|
#./elm_pan.eo
|
||||||
|
#./elm_grid.eo
|
||||||
|
#./elm_app_server_view.eo
|
||||||
|
#./elm_popup.eo
|
||||||
|
./elm_container.eo
|
||||||
|
#./elm_entry.eo
|
||||||
|
#./elm_interface_atspi_value.eo
|
||||||
|
#./elm_interface_atspi_editable_text.eo
|
||||||
|
#./elm_actionslider.eo
|
||||||
|
#./elm_plug.eo
|
||||||
|
#./elm_icon.eo
|
||||||
|
#./elm_interface_atspi_image.eo
|
||||||
|
#./elm_diskselector.eo
|
||||||
|
#./elm_slider.eo
|
||||||
|
#./elm_interface_atspi_selection.eo
|
||||||
|
./elm_label.eo
|
||||||
|
#./elm_prefs.eo
|
||||||
|
#./elm_dayselector.eo
|
||||||
|
./elm_radio.eo
|
||||||
|
#./elm_interface_atspi_accessible.eo
|
||||||
|
#./elm_route.eo
|
||||||
|
#./elm_list.eo
|
||||||
|
#./elm_clock.eo
|
||||||
|
#./elm_ctxpopup.eo
|
||||||
|
#./elm_app_client_view.eo
|
||||||
|
#./elm_flipselector.eo
|
||||||
|
#./elm_colorselector.eo
|
||||||
|
#./elm_interface_atspi_text.eo
|
||||||
|
#./elm_mapbuf.eo
|
||||||
|
#./elm_player.eo
|
||||||
|
#./elm_index.eo
|
||||||
|
#./elm_photocam_pan.eo
|
||||||
|
#./elm_table.eo
|
||||||
|
#./elm_interface_fileselector.eo
|
||||||
|
#./elm_scroller.eo
|
||||||
|
#./elm_systray.eo
|
||||||
|
#./elm_hoversel.eo
|
||||||
|
#./elm_fileselector.eo
|
||||||
|
./elm_widget.eo
|
||||||
|
#./elm_frame.eo
|
||||||
|
#./elm_panes.eo
|
||||||
|
#./elm_interface_atspi_action.eo
|
||||||
|
#./elm_web.eo
|
||||||
|
#./elm_toolbar.eo
|
||||||
|
#./elm_menu.eo
|
||||||
|
#./elm_fileselector_entry.eo
|
||||||
|
#./elm_datetime.eo
|
||||||
|
./elm_win.eo
|
||||||
|
#./elm_separator.eo
|
||||||
|
#./elm_glview.eo
|
||||||
|
#./elm_panel.eo
|
||||||
|
#./elm_interface_atspi_window.eo
|
||||||
|
./elm_button.eo
|
||||||
|
./elm_check.eo
|
||||||
|
#./elm_interface_atspi_widget.eo
|
||||||
|
#./elm_inwin.eo
|
||||||
|
#./elm_gesture_layer.eo
|
||||||
|
#./elm_hover.eo
|
||||||
|
#./elm_photocam.eo
|
||||||
|
#./elm_interface_atspi_widget_action.eo
|
||||||
|
#./elm_conformant.eo
|
||||||
|
#./elm_segment_control.eo
|
||||||
|
#./elm_slideshow.eo
|
||||||
|
#./elm_gengrid.eo
|
||||||
|
#./elm_app_server.eo
|
||||||
|
#./elm_progressbar.eo
|
||||||
|
#./elm_atspi_app_object.eo
|
||||||
|
./elm_bg.eo
|
||||||
|
#./elm_photo.eo
|
||||||
|
#./elm_bubble.eo
|
||||||
|
#./elm_interface_scrollable.eo
|
||||||
|
#./elm_app_client.eo
|
||||||
|
#./elm_notify.eo
|
||||||
|
#./elm_access.eo
|
||||||
|
#./elm_flip.eo
|
||||||
|
#./elm_video.eo
|
||||||
|
#./elm_gengrid_pan.eo
|
||||||
|
./elm_image.eo
|
||||||
|
#./elm_calendar.eo
|
||||||
|
#./elm_naviframe.eo
|
||||||
|
./elm_layout.eo
|
||||||
|
#./elm_map_pan.eo
|
||||||
|
#./elm_genlist_pan.eo
|
||||||
|
#./elm_interface_atspi_component.eo
|
||||||
|
#./elm_spinner.eo
|
||||||
|
#./elm_thumb.eo
|
||||||
|
#./elm_fileselector_button.eo
|
||||||
|
./elm_box.eo
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,11 @@
|
||||||
|
from cpython cimport PyUnicode_AsUTF8String
|
||||||
|
|
||||||
|
from efl2.c_eo cimport eo_add_ref, Eo_Class, _eo_do_start, _eo_do_end, \
|
||||||
|
CFILE, CFUNC, CLINE, Eo_Event_Description
|
||||||
|
from efl2.eo cimport object_from_instance, _object_mapping_register, \
|
||||||
|
Eo, _Eo
|
||||||
|
from efl2.utils.conversions cimport _ctouni
|
||||||
|
|
||||||
|
from efl2.eina cimport eina_hash_add, eina_hash_del, EINA_FALSE, Eina_Bool
|
||||||
|
|
||||||
|
include "generated_classes.pxi"
|
|
@ -0,0 +1,790 @@
|
||||||
|
# Copyright (C) 2007-2014 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/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
.. _General:
|
||||||
|
|
||||||
|
General
|
||||||
|
=======
|
||||||
|
|
||||||
|
General Elementary API. Functions that don't relate to
|
||||||
|
Elementary objects specifically.
|
||||||
|
|
||||||
|
Here are documented functions which init/shutdown the library,
|
||||||
|
that apply to generic Elementary objects, that deal with
|
||||||
|
configuration, et cetera.
|
||||||
|
|
||||||
|
|
||||||
|
.. _Fingers:
|
||||||
|
|
||||||
|
Fingers
|
||||||
|
=======
|
||||||
|
|
||||||
|
Elementary is designed to be finger-friendly for touchscreens,
|
||||||
|
and so in addition to scaling for display resolution, it can
|
||||||
|
also scale based on finger "resolution" (or size). You can then
|
||||||
|
customize the granularity of the areas meant to receive clicks
|
||||||
|
on touchscreens.
|
||||||
|
|
||||||
|
Different profiles may have pre-set values for finger sizes.
|
||||||
|
|
||||||
|
|
||||||
|
Enumerations
|
||||||
|
============
|
||||||
|
|
||||||
|
|
||||||
|
.. _Elm_Policy:
|
||||||
|
|
||||||
|
Policy types
|
||||||
|
------------
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_QUIT
|
||||||
|
|
||||||
|
Under which circumstances the application should quit automatically.
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_EXIT
|
||||||
|
|
||||||
|
Defines elm_exit() behaviour. (since 1.8)
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_THROTTLE
|
||||||
|
|
||||||
|
Defines how throttling should work (since 1.8)
|
||||||
|
|
||||||
|
|
||||||
|
.. _Elm_Policy_Quit:
|
||||||
|
|
||||||
|
Quit policy types
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_QUIT_NONE
|
||||||
|
|
||||||
|
Never quit the application automatically
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
|
||||||
|
|
||||||
|
Quit when the application's last window is closed
|
||||||
|
|
||||||
|
|
||||||
|
.. _Elm_Policy_Exit:
|
||||||
|
|
||||||
|
Exit policy types
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Possible values for the ELM_POLICY_EXIT policy.
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_EXIT_NONE
|
||||||
|
|
||||||
|
Just quit the main loop on exit().
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_EXIT_WINDOWS_DEL
|
||||||
|
|
||||||
|
Delete all the windows after quitting the main loop.
|
||||||
|
|
||||||
|
|
||||||
|
.. _Elm_Policy_Throttle:
|
||||||
|
|
||||||
|
Throttle policy types
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Possible values for the #ELM_POLICY_THROTTLE policy.
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_THROTTLE_CONFIG
|
||||||
|
|
||||||
|
Do whatever elementary config is configured to do.
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_THROTTLE_HIDDEN_ALWAYS
|
||||||
|
|
||||||
|
Always throttle when all windows are no longer visible.
|
||||||
|
|
||||||
|
.. data:: ELM_POLICY_THROTTLE_NEVER
|
||||||
|
|
||||||
|
Never throttle when windows are all hidden, regardless of config settings.
|
||||||
|
|
||||||
|
|
||||||
|
.. _Elm_Sys_Notify_Closed_Reason:
|
||||||
|
|
||||||
|
Notify close reasons
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
The reason the notification was closed
|
||||||
|
|
||||||
|
.. data:: ELM_SYS_NOTIFY_CLOSED_EXPIRED
|
||||||
|
|
||||||
|
The notification expired.
|
||||||
|
|
||||||
|
.. versionadded:: 1.10
|
||||||
|
|
||||||
|
.. data:: ELM_SYS_NOTIFY_CLOSED_DISMISSED
|
||||||
|
|
||||||
|
The notification was dismissed by the user.
|
||||||
|
|
||||||
|
.. versionadded:: 1.10
|
||||||
|
|
||||||
|
.. data:: ELM_SYS_NOTIFY_CLOSED_REQUESTED
|
||||||
|
|
||||||
|
The notification was closed by a call to CloseNotification method.
|
||||||
|
|
||||||
|
.. versionadded:: 1.10
|
||||||
|
|
||||||
|
.. data:: ELM_SYS_NOTIFY_CLOSED_UNDEFINED
|
||||||
|
|
||||||
|
Undefined/reserved reasons.
|
||||||
|
|
||||||
|
.. versionadded:: 1.10
|
||||||
|
|
||||||
|
|
||||||
|
.. _Elm_Sys_Notify_Urgency:
|
||||||
|
|
||||||
|
Notify urgency levels
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Urgency levels of a notification
|
||||||
|
|
||||||
|
:see: :py:func:`sys_notify_send`
|
||||||
|
|
||||||
|
.. data:: ELM_SYS_NOTIFY_URGENCY_LOW
|
||||||
|
|
||||||
|
Low
|
||||||
|
|
||||||
|
.. versionadded:: 1.10
|
||||||
|
|
||||||
|
.. data:: ELM_SYS_NOTIFY_URGENCY_NORMAL
|
||||||
|
|
||||||
|
Normal
|
||||||
|
|
||||||
|
.. versionadded:: 1.10
|
||||||
|
|
||||||
|
.. data:: ELM_SYS_NOTIFY_URGENCY_CRITICAL
|
||||||
|
|
||||||
|
Critical
|
||||||
|
|
||||||
|
.. versionadded:: 1.10
|
||||||
|
|
||||||
|
|
||||||
|
.. _Elm_Glob_Match_Flags:
|
||||||
|
|
||||||
|
Glob matching
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Glob matching bitfiled flags
|
||||||
|
|
||||||
|
.. data:: ELM_GLOB_MATCH_NO_ESCAPE
|
||||||
|
|
||||||
|
Treat backslash as an ordinary character instead of escape.
|
||||||
|
|
||||||
|
.. versionadded:: 1.11
|
||||||
|
|
||||||
|
.. data:: ELM_GLOB_MATCH_PATH
|
||||||
|
|
||||||
|
Match a slash in string only with a slash in pattern and not by an
|
||||||
|
asterisk (*) or a question mark (?) metacharacter, nor by a bracket
|
||||||
|
expression ([]) containing a slash.
|
||||||
|
|
||||||
|
.. versionadded:: 1.11
|
||||||
|
|
||||||
|
.. data:: ELM_GLOB_MATCH_PERIOD
|
||||||
|
|
||||||
|
Leading period in string has to be matched exactly by a period in
|
||||||
|
pattern. A period is considered to be leading if it is the first
|
||||||
|
character in string, or if both ELM_GLOB_MATCH_PATH is set and the
|
||||||
|
period immediately follows a slash.
|
||||||
|
|
||||||
|
.. versionadded:: 1.11
|
||||||
|
|
||||||
|
.. data:: ELM_GLOB_MATCH_NOCASE
|
||||||
|
|
||||||
|
The pattern is matched case-insensitively.
|
||||||
|
|
||||||
|
.. versionadded:: 1.11
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
from cpython cimport PyUnicode_AsUTF8String, PyMem_Malloc, Py_DECREF, Py_INCREF
|
||||||
|
from libc.stdint cimport uintptr_t
|
||||||
|
|
||||||
|
from efl2.c_eo cimport eo_add_ref, Eo, Eo_Class, _eo_do_start, _eo_do_end, \
|
||||||
|
CFILE, CFUNC, CLINE, Eo_Event_Description
|
||||||
|
from efl2.eo cimport object_from_instance, _object_mapping_register, \
|
||||||
|
_register_decorated_callbacks, _Eo, instance_from_object
|
||||||
|
from efl2.utils.conversions cimport _ctouni
|
||||||
|
|
||||||
|
from efl2.eina cimport eina_hash_add, eina_hash_del, EINA_FALSE
|
||||||
|
|
||||||
|
|
||||||
|
from libc.string cimport memcpy
|
||||||
|
|
||||||
|
from efl2.evas cimport _Object, _Object_Smart
|
||||||
|
|
||||||
|
from efl2.utils.conversions cimport _touni, _ctouni, \
|
||||||
|
python_list_strings_to_eina_list, \
|
||||||
|
eina_list_strings_to_python_list
|
||||||
|
|
||||||
|
from efl2.utils.logger cimport add_logger
|
||||||
|
|
||||||
|
from efl2.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \
|
||||||
|
EINA_LOG_DOM_WARN, EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT
|
||||||
|
|
||||||
|
#from efl2.ecore cimport Event, EventHandler, _event_mapping_register
|
||||||
|
|
||||||
|
from efl2.elementary.need cimport elm_need_sys_notify
|
||||||
|
|
||||||
|
cimport efl2.elementary.enums as enums
|
||||||
|
|
||||||
|
from efl2.elementary.enums cimport Elm_Sys_Notify_Closed_Reason, \
|
||||||
|
Elm_Sys_Notify_Urgency, Elm_Focus_Direction, Elm_Win_Type, \
|
||||||
|
Elm_Illume_Command, Elm_Win_Keyboard_Mode, Elm_Policy, \
|
||||||
|
Elm_Win_Indicator_Opacity_Mode, Elm_Win_Indicator_Mode, \
|
||||||
|
Elm_Scroller_Movement_Block, Elm_Scroller_Policy, \
|
||||||
|
Elm_Scroller_Single_Direction, Elm_Bg_Option, Elm_Image_Orient, \
|
||||||
|
Elm_Label_Slide_Mode, Elm_Wrap_Type
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# cdef class _Object_Item(object)
|
||||||
|
|
||||||
|
# cdef Elm_Object_Item * object_item_from_python(_Object_Item item) except NULL:
|
||||||
|
# if item is None or item.item is NULL:
|
||||||
|
# raise TypeError("Invalid item!")
|
||||||
|
# return item.item
|
||||||
|
|
||||||
|
# cdef object_item_to_python(Elm_Object_Item *it):
|
||||||
|
# cdef:
|
||||||
|
# void *data
|
||||||
|
# ObjectItem item
|
||||||
|
|
||||||
|
# if it == NULL:
|
||||||
|
# return None
|
||||||
|
|
||||||
|
# data = elm_object_item_data_get(it)
|
||||||
|
|
||||||
|
# if data == NULL:
|
||||||
|
# # Create a dummy object item.
|
||||||
|
# EINA_LOG_DOM_WARN(PY_EFL_ELM_LOG_DOMAIN,
|
||||||
|
# "Creating an incomplete ObjectItem.", NULL)
|
||||||
|
# item = ObjectItem.__new__(ObjectItem)
|
||||||
|
# item._set_obj(it)
|
||||||
|
# else:
|
||||||
|
# item = <object>data
|
||||||
|
|
||||||
|
# return item
|
||||||
|
|
||||||
|
|
||||||
|
ELM_POLICY_QUIT = enums.ELM_POLICY_QUIT
|
||||||
|
ELM_POLICY_EXIT = enums.ELM_POLICY_EXIT
|
||||||
|
ELM_POLICY_THROTTLE = enums.ELM_POLICY_THROTTLE
|
||||||
|
|
||||||
|
ELM_POLICY_QUIT_NONE = enums.ELM_POLICY_QUIT_NONE
|
||||||
|
ELM_POLICY_QUIT_LAST_WINDOW_CLOSED = enums.ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
|
||||||
|
|
||||||
|
ELM_POLICY_EXIT_NONE = enums.ELM_POLICY_EXIT_NONE
|
||||||
|
ELM_POLICY_EXIT_WINDOWS_DEL = enums.ELM_POLICY_EXIT_WINDOWS_DEL
|
||||||
|
|
||||||
|
ELM_POLICY_THROTTLE_CONFIG = enums.ELM_POLICY_THROTTLE_CONFIG
|
||||||
|
ELM_POLICY_THROTTLE_HIDDEN_ALWAYS = enums.ELM_POLICY_THROTTLE_HIDDEN_ALWAYS
|
||||||
|
ELM_POLICY_THROTTLE_NEVER = enums.ELM_POLICY_THROTTLE_NEVER
|
||||||
|
|
||||||
|
ELM_SYS_NOTIFY_CLOSED_EXPIRED = enums.ELM_SYS_NOTIFY_CLOSED_EXPIRED
|
||||||
|
ELM_SYS_NOTIFY_CLOSED_DISMISSED = enums.ELM_SYS_NOTIFY_CLOSED_DISMISSED
|
||||||
|
ELM_SYS_NOTIFY_CLOSED_REQUESTED = enums.ELM_SYS_NOTIFY_CLOSED_REQUESTED
|
||||||
|
ELM_SYS_NOTIFY_CLOSED_UNDEFINED = enums.ELM_SYS_NOTIFY_CLOSED_UNDEFINED
|
||||||
|
|
||||||
|
ELM_SYS_NOTIFY_URGENCY_LOW = enums.ELM_SYS_NOTIFY_URGENCY_LOW
|
||||||
|
ELM_SYS_NOTIFY_URGENCY_NORMAL = enums.ELM_SYS_NOTIFY_URGENCY_NORMAL
|
||||||
|
ELM_SYS_NOTIFY_URGENCY_CRITICAL = enums.ELM_SYS_NOTIFY_URGENCY_CRITICAL
|
||||||
|
|
||||||
|
ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED = enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
|
||||||
|
ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED = enums.ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
|
||||||
|
|
||||||
|
ELM_GLOB_MATCH_NO_ESCAPE = enums.ELM_GLOB_MATCH_NO_ESCAPE
|
||||||
|
ELM_GLOB_MATCH_PATH = enums.ELM_GLOB_MATCH_PATH
|
||||||
|
ELM_GLOB_MATCH_PERIOD = enums.ELM_GLOB_MATCH_PERIOD
|
||||||
|
ELM_GLOB_MATCH_NOCASE = enums.ELM_GLOB_MATCH_NOCASE
|
||||||
|
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
# cdef void py_elm_sys_notify_send_cb(void *data, unsigned int id):
|
||||||
|
# cdef object func, func_data
|
||||||
|
# func, func_data = <object>data
|
||||||
|
# # FIXME: Is this cb called more than once? Py_DECREF if not.
|
||||||
|
# try:
|
||||||
|
# func(func_data, id)
|
||||||
|
# except Exception:
|
||||||
|
# traceback.print_exc()
|
||||||
|
|
||||||
|
# cdef class SysNotifyNotificationClosed(Event):
|
||||||
|
|
||||||
|
# cdef Elm_Sys_Notify_Notification_Closed *obj
|
||||||
|
|
||||||
|
# cdef int _set_obj(self, void *o) except 0:
|
||||||
|
# self.obj = <Elm_Sys_Notify_Notification_Closed*>o
|
||||||
|
# return 1
|
||||||
|
|
||||||
|
# def __repr__(self):
|
||||||
|
# # TODO: int -> string for 'reason'
|
||||||
|
# return "<%s(id=%d, reason=%s)>" % \
|
||||||
|
# (type(self).__name__, self.id, self.reason)
|
||||||
|
|
||||||
|
# property id:
|
||||||
|
# """ID of the notification.
|
||||||
|
|
||||||
|
# :type: int
|
||||||
|
|
||||||
|
# """
|
||||||
|
# def __get__(self):
|
||||||
|
# return self.obj.id
|
||||||
|
|
||||||
|
# property reason:
|
||||||
|
# """The Reason the notification was closed.
|
||||||
|
|
||||||
|
# :type: :ref:`Elm_Sys_Notify_Closed_Reason`
|
||||||
|
|
||||||
|
# """
|
||||||
|
# def __get__(self):
|
||||||
|
# return self.obj.reason
|
||||||
|
|
||||||
|
# cdef class SysNotifyActionInvoked(Event):
|
||||||
|
|
||||||
|
# cdef Elm_Sys_Notify_Action_Invoked *obj
|
||||||
|
|
||||||
|
# cdef int _set_obj(self, void *o) except 0:
|
||||||
|
# self.obj = <Elm_Sys_Notify_Action_Invoked*>o
|
||||||
|
# return 1
|
||||||
|
|
||||||
|
# def __repr__(self):
|
||||||
|
# return "<%s(id=%d, action_key=%s)>" % \
|
||||||
|
# (type(self).__name__, self.id, self.action_key)
|
||||||
|
|
||||||
|
# property id:
|
||||||
|
# """ID of the notification.
|
||||||
|
|
||||||
|
# :type: int
|
||||||
|
|
||||||
|
# """
|
||||||
|
# def __get__(self):
|
||||||
|
# return self.obj.id
|
||||||
|
|
||||||
|
# property action_key:
|
||||||
|
# """The key of the action invoked. These match the keys sent over in the
|
||||||
|
# list of actions.
|
||||||
|
|
||||||
|
# :type: string
|
||||||
|
|
||||||
|
# """
|
||||||
|
# def __get__(self):
|
||||||
|
# return _touni(self.obj.action_key)
|
||||||
|
|
||||||
|
# if elm_need_sys_notify():
|
||||||
|
# _event_mapping_register(
|
||||||
|
# enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED,
|
||||||
|
# SysNotifyNotificationClosed
|
||||||
|
# )
|
||||||
|
|
||||||
|
# def on_sys_notify_notification_closed(func, *args, **kargs):
|
||||||
|
# return EventHandler(
|
||||||
|
# enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED, func, *args, **kargs
|
||||||
|
# )
|
||||||
|
|
||||||
|
# _event_mapping_register(
|
||||||
|
# enums.ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED,
|
||||||
|
# SysNotifyActionInvoked
|
||||||
|
# )
|
||||||
|
|
||||||
|
# def on_sys_notify_action_invoked(func, *args, **kargs):
|
||||||
|
# return EventHandler(
|
||||||
|
# enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED, func, *args, **kargs
|
||||||
|
# )
|
||||||
|
|
||||||
|
cdef class FontProperties(object):
|
||||||
|
|
||||||
|
"""Elementary font properties"""
|
||||||
|
|
||||||
|
cdef Elm_Font_Properties *efp
|
||||||
|
|
||||||
|
property name:
|
||||||
|
""":type: unicode"""
|
||||||
|
def __set__(self, value):
|
||||||
|
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||||
|
self.efp.name = value
|
||||||
|
|
||||||
|
def __get__(self):
|
||||||
|
return _ctouni(self.efp.name)
|
||||||
|
|
||||||
|
property styles:
|
||||||
|
""":type: list of strings"""
|
||||||
|
def __set__(self, value):
|
||||||
|
self.efp.styles = python_list_strings_to_eina_list(value)
|
||||||
|
|
||||||
|
def __get__(self):
|
||||||
|
return eina_list_strings_to_python_list(self.efp.styles)
|
||||||
|
|
||||||
|
elm_log = add_logger("efl.elementary")
|
||||||
|
cdef int PY_EFL_ELM_LOG_DOMAIN = elm_log.eina_log_domain
|
||||||
|
|
||||||
|
def init():
|
||||||
|
"""Initialize Elementary
|
||||||
|
|
||||||
|
:return int: The init counter value.
|
||||||
|
|
||||||
|
This function initializes Elementary and increments a counter of the number
|
||||||
|
of calls to it. It returns the new counter's value.
|
||||||
|
|
||||||
|
"""
|
||||||
|
EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
|
||||||
|
"Initializing efl2.elementary", NULL)
|
||||||
|
|
||||||
|
# FIXME: Why are we passing the cl args to elm_init here?
|
||||||
|
|
||||||
|
cdef:
|
||||||
|
int argc, i, arg_len
|
||||||
|
char **argv
|
||||||
|
char *arg
|
||||||
|
|
||||||
|
argc = len(sys.argv)
|
||||||
|
argv = <char **>PyMem_Malloc(argc * sizeof(char *))
|
||||||
|
for i in range(argc):
|
||||||
|
t = sys.argv[i]
|
||||||
|
if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
|
||||||
|
arg = t
|
||||||
|
arg_len = len(arg)
|
||||||
|
argv[i] = <char *>PyMem_Malloc(arg_len + 1)
|
||||||
|
memcpy(argv[i], arg, arg_len + 1)
|
||||||
|
|
||||||
|
return elm_init(argc, argv)
|
||||||
|
|
||||||
|
def shutdown():
|
||||||
|
"""Shut down Elementary
|
||||||
|
|
||||||
|
:return int: The init counter value.
|
||||||
|
|
||||||
|
This should be called at the end of your application, just before it ceases
|
||||||
|
to do any more processing. This will clean up any permanent resources your
|
||||||
|
application may have allocated via Elementary that would otherwise persist.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
shutdown() will iterate main loop until all ecore_evas are freed. There
|
||||||
|
is a possibility to call your ecore callbacks(timer, animator, event,
|
||||||
|
job, and etc.) in shutdown()
|
||||||
|
|
||||||
|
"""
|
||||||
|
EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
|
||||||
|
"Shutting down efl2.elementary", NULL)
|
||||||
|
return elm_shutdown()
|
||||||
|
|
||||||
|
def run():
|
||||||
|
"""Run Elementary's main loop
|
||||||
|
|
||||||
|
This call should be issued just after all initialization is completed. This
|
||||||
|
function will not return until exit() is called. It will keep looping,
|
||||||
|
running the main (event/processing) loop for Elementary.
|
||||||
|
|
||||||
|
"""
|
||||||
|
EINA_LOG_DOM_DBG(PY_EFL_ELM_LOG_DOMAIN,
|
||||||
|
"Starting up main loop.", NULL)
|
||||||
|
with nogil:
|
||||||
|
elm_run()
|
||||||
|
|
||||||
|
def exit():
|
||||||
|
"""Ask to exit Elementary's main loop
|
||||||
|
|
||||||
|
If this call is issued, it will flag the main loop to cease processing and
|
||||||
|
return back to its parent function (usually your elm_main() function). This
|
||||||
|
does not mean the main loop instantly quits. So your ecore callbacks(timer,
|
||||||
|
animator, event, job, and etc.) have chances to be called even after
|
||||||
|
exit().
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
By using the appropriate #ELM_POLICY_QUIT on your Elementary
|
||||||
|
applications, you'll be able to get this function called automatically
|
||||||
|
for you.
|
||||||
|
|
||||||
|
"""
|
||||||
|
EINA_LOG_DOM_DBG(PY_EFL_ELM_LOG_DOMAIN,
|
||||||
|
"Ending main loop.", NULL)
|
||||||
|
elm_exit()
|
||||||
|
|
||||||
|
def policy_set(Elm_Policy policy, value):
|
||||||
|
"""Set new policy value.
|
||||||
|
|
||||||
|
This will emit the ecore event ELM_EVENT_POLICY_CHANGED in the main
|
||||||
|
loop giving the event information Elm_Event_Policy_Changed with
|
||||||
|
policy identifier, new and old values.
|
||||||
|
|
||||||
|
:param policy: policy identifier as in Elm_Policy.
|
||||||
|
:type policy: :ref:`Elm_Policy`
|
||||||
|
:param value: policy value, depends on identifiers, usually there is
|
||||||
|
an enumeration with the same prefix as the policy name, for
|
||||||
|
example: ELM_POLICY_QUIT and Elm_Policy_Quit
|
||||||
|
(ELM_POLICY_QUIT_NONE, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED).
|
||||||
|
:type value: :ref:`Elm_Policy_Quit`
|
||||||
|
|
||||||
|
:return: True on success or False on error (right
|
||||||
|
now just invalid policy identifier, but in future policy
|
||||||
|
value might be enforced).
|
||||||
|
|
||||||
|
"""
|
||||||
|
return bool(elm_policy_set(policy, value))
|
||||||
|
|
||||||
|
def policy_get(Elm_Policy policy):
|
||||||
|
"""Gets the policy value set for given identifier.
|
||||||
|
|
||||||
|
:param policy: policy identifier as in Elm_Policy.
|
||||||
|
:type policy: :ref:`Elm_Policy`
|
||||||
|
|
||||||
|
:return: policy value. Will be 0 if policy identifier is invalid.
|
||||||
|
:rtype: :ref:`Elm_Policy_Quit`
|
||||||
|
|
||||||
|
"""
|
||||||
|
return elm_policy_get(policy)
|
||||||
|
|
||||||
|
def coords_finger_size_adjust(int times_w, int w, int times_h, int h):
|
||||||
|
"""Adjust size of an element for finger usage.
|
||||||
|
|
||||||
|
:param times_w: How many fingers should fit horizontally
|
||||||
|
:type times_w: int
|
||||||
|
:param w: Width size to adjust
|
||||||
|
:type w: int
|
||||||
|
:param times_h: How many fingers should fit vertically
|
||||||
|
:type times_h: int
|
||||||
|
:param h: Height size to adjust
|
||||||
|
:type h: int
|
||||||
|
|
||||||
|
:return: The adjusted width and height
|
||||||
|
:rtype: (int **w**, int **h**)
|
||||||
|
|
||||||
|
This takes width and height sizes (in pixels) as input and a
|
||||||
|
size multiple (which is how many fingers you want to place
|
||||||
|
within the area, being "finger" the size set by
|
||||||
|
elm_config_finger_size_set()), and adjusts the size to be large enough
|
||||||
|
to accommodate the resulting size -- if it doesn't already
|
||||||
|
accommodate it.
|
||||||
|
|
||||||
|
.. note:: This is kind of low level Elementary call, most useful
|
||||||
|
on size evaluation times for widgets. An external user wouldn't
|
||||||
|
be calling, most of the time.
|
||||||
|
|
||||||
|
"""
|
||||||
|
cdef Evas_Coord width = w, height = h
|
||||||
|
elm_coords_finger_size_adjust(times_w, &width, times_h, &height)
|
||||||
|
return (width, height)
|
||||||
|
|
||||||
|
def language_set(lang not None):
|
||||||
|
"""Change the language of the current application
|
||||||
|
|
||||||
|
The ``lang`` passed must be the full name of the locale to use, for
|
||||||
|
example ``en_US.utf8`` or ``es_ES@euro``.
|
||||||
|
|
||||||
|
Changing language with this function will make Elementary run through
|
||||||
|
all its widgets, translating strings set with
|
||||||
|
elm_object_domain_translatable_part_text_set(). This way, an entire
|
||||||
|
UI can have its language changed without having to restart the program.
|
||||||
|
|
||||||
|
For more complex cases, like having formatted strings that need
|
||||||
|
translation, widgets will also emit a "language,changed" signal that
|
||||||
|
the user can listen to and manually translate the text.
|
||||||
|
|
||||||
|
:param lang: Language to set, must be the full name of the locale
|
||||||
|
|
||||||
|
"""
|
||||||
|
if isinstance(lang, unicode): lang = PyUnicode_AsUTF8String(lang)
|
||||||
|
elm_language_set(<const char *>lang)
|
||||||
|
|
||||||
|
def cache_all_flush():
|
||||||
|
"""Frees all data that was in cache and is not currently being used to reduce
|
||||||
|
memory usage. This frees Edje's, Evas' and Eet's cache.
|
||||||
|
|
||||||
|
.. note:: Evas caches are flushed for every canvas associated with a window.
|
||||||
|
|
||||||
|
.. versionadded:: 1.8
|
||||||
|
|
||||||
|
"""
|
||||||
|
elm_cache_all_flush()
|
||||||
|
|
||||||
|
def font_properties_get(font not None):
|
||||||
|
"""Translate a font (family) name string in fontconfig's font names
|
||||||
|
syntax into a FontProperties object.
|
||||||
|
|
||||||
|
:param font: The font name and styles string
|
||||||
|
:return: the font properties object
|
||||||
|
|
||||||
|
.. note:: The reverse translation can be achieved with
|
||||||
|
:py:func:`font_fontconfig_name_get`, for one style only (single font
|
||||||
|
instance, not family).
|
||||||
|
|
||||||
|
.. versionadded:: 1.8
|
||||||
|
|
||||||
|
"""
|
||||||
|
if isinstance(font, unicode): font = PyUnicode_AsUTF8String(font)
|
||||||
|
cdef FontProperties ret = FontProperties.__new__()
|
||||||
|
|
||||||
|
ret.efp = elm_font_properties_get(<const char *>font)
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def font_properties_free(FontProperties fp):
|
||||||
|
"""Free font properties return by font_properties_get().
|
||||||
|
|
||||||
|
:param fp: the font properties struct
|
||||||
|
|
||||||
|
.. versionadded:: 1.8
|
||||||
|
|
||||||
|
"""
|
||||||
|
elm_font_properties_free(fp.efp)
|
||||||
|
Py_DECREF(fp)
|
||||||
|
|
||||||
|
def font_fontconfig_name_get(font_name, style = None):
|
||||||
|
"""Translate a font name, bound to a style, into fontconfig's font names
|
||||||
|
syntax.
|
||||||
|
|
||||||
|
:param font_name: The font (family) name
|
||||||
|
:param style: The given style (may be None)
|
||||||
|
|
||||||
|
:return: the font name and style string
|
||||||
|
|
||||||
|
.. note:: The reverse translation can be achieved with
|
||||||
|
:py:func:`font_properties_get`, for one style only (single font
|
||||||
|
instance, not family).
|
||||||
|
|
||||||
|
.. versionadded:: 1.8
|
||||||
|
|
||||||
|
"""
|
||||||
|
cdef:
|
||||||
|
unicode ret
|
||||||
|
char *fc_name
|
||||||
|
if isinstance(font_name, unicode): font_name = PyUnicode_AsUTF8String(font_name)
|
||||||
|
if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
|
||||||
|
fc_name = elm_font_fontconfig_name_get(
|
||||||
|
<const char *>font_name,
|
||||||
|
<const char *>style if style is not None else NULL
|
||||||
|
)
|
||||||
|
|
||||||
|
ret = _touni(fc_name)
|
||||||
|
elm_font_fontconfig_name_free(fc_name)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
# TODO: Create an Eina_Hash -> dict conversion function for this
|
||||||
|
# def font_available_hash_add(list):
|
||||||
|
# """Create a font hash table of available system fonts.
|
||||||
|
|
||||||
|
# One must call it with ``list`` being the return value of
|
||||||
|
# evas_font_available_list(). The hash will be indexed by font
|
||||||
|
# (family) names, being its values ``Elm_Font_Properties`` blobs.
|
||||||
|
|
||||||
|
# :param list: The list of available system fonts, as returned by
|
||||||
|
# evas_font_available_list().
|
||||||
|
# :return: the font hash.
|
||||||
|
|
||||||
|
# .. note:: The user is supposed to get it populated at least with 3
|
||||||
|
# default font families (Sans, Serif, Monospace), which should be
|
||||||
|
# present on most systems.
|
||||||
|
|
||||||
|
# """
|
||||||
|
# EAPI Eina_Hash *elm_font_available_hash_add(Eina_List *list)
|
||||||
|
|
||||||
|
|
||||||
|
# """Free the hash returned by elm_font_available_hash_add().
|
||||||
|
|
||||||
|
# :param hash: the hash to be freed.
|
||||||
|
|
||||||
|
# """
|
||||||
|
# elm_font_available_hash_del(Eina_Hash *hash)
|
||||||
|
|
||||||
|
def object_tree_dump(_Object top):
|
||||||
|
"""Print Tree object hierarchy in stdout
|
||||||
|
|
||||||
|
:param top: The root object
|
||||||
|
|
||||||
|
.. versionadded:: 1.8
|
||||||
|
|
||||||
|
"""
|
||||||
|
elm_object_tree_dump(top.obj)
|
||||||
|
|
||||||
|
def object_tree_dot_dump(_Object top, path):
|
||||||
|
"""Print Elm Objects tree hierarchy in file as dot(graphviz) syntax.
|
||||||
|
|
||||||
|
:param top: The root object
|
||||||
|
:param path: The path of output file
|
||||||
|
|
||||||
|
.. versionadded:: 1.8
|
||||||
|
|
||||||
|
"""
|
||||||
|
if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
|
||||||
|
elm_object_tree_dot_dump(top.obj, <const char *>path)
|
||||||
|
|
||||||
|
# def sys_notify_close(unsigned int id):
|
||||||
|
# """Causes a notification to be forcefully closed and removed from the user's
|
||||||
|
# view. It can be used, for example, in the event that what the notification
|
||||||
|
# pertains to is no longer relevant, or to cancel a notification * with no
|
||||||
|
# expiration time.
|
||||||
|
|
||||||
|
# :param id: Notification id
|
||||||
|
|
||||||
|
# .. note:: If the notification no longer exists,
|
||||||
|
# an empty D-BUS Error message is sent back.
|
||||||
|
|
||||||
|
# .. versionadded:: 1.10
|
||||||
|
|
||||||
|
# """
|
||||||
|
# elm_sys_notify_close(id)
|
||||||
|
|
||||||
|
# def sys_notify_send(
|
||||||
|
# unsigned int replaces_id=0,
|
||||||
|
# icon=None, summary=None, body=None,
|
||||||
|
# Elm_Sys_Notify_Urgency urgency=enums.ELM_SYS_NOTIFY_URGENCY_NORMAL,
|
||||||
|
# int timeout=-1, cb=None, cb_data=None
|
||||||
|
# ):
|
||||||
|
# """Sends a notification to the notification server.
|
||||||
|
|
||||||
|
# :param replaces_id: Notification ID that this notification replaces.
|
||||||
|
# The value 0 means a new notification.
|
||||||
|
# :param icon: The optional program icon of the calling application.
|
||||||
|
# :param summary: The summary text briefly describing the notification.
|
||||||
|
# :param body: The optional detailed body text. Can be empty.
|
||||||
|
# :param urgency: The urgency level.
|
||||||
|
# :param timeout: Timeout display in milliseconds.
|
||||||
|
# :param cb: Callback used to retrieve the notification id
|
||||||
|
# return by the Notification Server.
|
||||||
|
# :param cb_data: Optional context data
|
||||||
|
|
||||||
|
# .. versionadded:: 1.10
|
||||||
|
|
||||||
|
# """
|
||||||
|
# if cb is not None:
|
||||||
|
# if not callable(cb):
|
||||||
|
# raise TypeError("cb must be callable")
|
||||||
|
# py_cb_data = (cb, cb_data)
|
||||||
|
# Py_INCREF(py_cb_data)
|
||||||
|
|
||||||
|
# if isinstance(icon, unicode): icon = PyUnicode_AsUTF8String(icon)
|
||||||
|
# if isinstance(summary, unicode): summary = PyUnicode_AsUTF8String(summary)
|
||||||
|
# if isinstance(body, unicode): body = PyUnicode_AsUTF8String(body)
|
||||||
|
# elm_sys_notify_send(
|
||||||
|
# replaces_id,
|
||||||
|
# <const char *>icon if icon is not None else NULL,
|
||||||
|
# <const char *>summary if summary is not None else NULL,
|
||||||
|
# <const char *>body if body is not None else NULL,
|
||||||
|
# urgency,
|
||||||
|
# timeout,
|
||||||
|
# <Elm_Sys_Notify_Send_Cb>py_elm_sys_notify_send_cb if cb is not None else NULL,
|
||||||
|
# <const void *>py_cb_data if cb is not None else NULL
|
||||||
|
# )
|
||||||
|
|
||||||
|
include "generated_classes.pxi"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue