2013-02-13 11:16:02 -08:00
|
|
|
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
#
|
2013-02-13 11:16:02 -08:00
|
|
|
# This file is part of Python-EFL.
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
#
|
2013-02-13 11:16:02 -08:00
|
|
|
# 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
|
2013-12-07 08:54:58 -08:00
|
|
|
# version 3 of the License, or (at your option) any later version.
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
#
|
2013-02-13 11:16:02 -08:00
|
|
|
# Python-EFL is distributed in the hope that it will be useful,
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2013-02-13 11:16:02 -08:00
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
2013-02-13 11:16:02 -08:00
|
|
|
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
2013-02-17 11:35:20 -08:00
|
|
|
#
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2013-12-04 22:29:55 -08:00
|
|
|
.. _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.
|
|
|
|
|
|
|
|
|
2013-05-01 05:34:45 -07:00
|
|
|
Enumerations
|
2013-12-04 22:29:55 -08:00
|
|
|
============
|
2013-05-01 05:34:45 -07:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
|
2013-04-17 06:57:57 -07:00
|
|
|
.. _Elm_Policy:
|
|
|
|
|
2013-04-27 07:43:22 -07:00
|
|
|
Policy types
|
2013-12-04 22:29:55 -08:00
|
|
|
------------
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
.. data:: ELM_POLICY_QUIT
|
|
|
|
|
|
|
|
Under which circumstances the application should quit automatically.
|
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
.. data:: ELM_POLICY_EXIT
|
|
|
|
|
|
|
|
Defines elm_exit() behaviour. (since 1.8)
|
|
|
|
|
|
|
|
.. data:: ELM_POLICY_THROTTLE
|
|
|
|
|
|
|
|
Defines how throttling should work (since 1.8)
|
|
|
|
|
2013-02-17 11:35:20 -08:00
|
|
|
|
2013-04-17 06:57:57 -07:00
|
|
|
.. _Elm_Policy_Quit:
|
|
|
|
|
2013-04-27 07:43:22 -07:00
|
|
|
Quit policy types
|
2013-12-04 22:29:55 -08:00
|
|
|
-----------------
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
.. 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
|
|
|
|
|
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
.. _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.
|
|
|
|
|
|
|
|
|
2013-02-17 11:35:20 -08:00
|
|
|
"""
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-04-18 12:43:32 -07:00
|
|
|
from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyUnicode_AsUTF8String, \
|
|
|
|
PyMem_Malloc, PyMem_Free
|
2013-12-15 05:08:57 -08:00
|
|
|
from libc.stdint cimport uintptr_t
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-10-03 23:29:45 -07:00
|
|
|
from efl.evas cimport Object as evasObject
|
|
|
|
|
2013-09-30 18:56:28 -07:00
|
|
|
from efl.utils.conversions cimport _touni, _ctouni, \
|
|
|
|
python_list_strings_to_eina_list, \
|
|
|
|
eina_list_strings_to_python_list
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-11-11 03:06:38 -08:00
|
|
|
from efl.utils.logger cimport add_logger
|
|
|
|
|
|
|
|
from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \
|
|
|
|
EINA_LOG_DOM_WARN, EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT
|
|
|
|
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
import sys
|
|
|
|
import traceback
|
|
|
|
|
2013-02-17 11:35:20 -08:00
|
|
|
cimport enums
|
|
|
|
|
|
|
|
ELM_POLICY_QUIT = enums.ELM_POLICY_QUIT
|
2013-12-09 20:55:36 -08:00
|
|
|
ELM_POLICY_EXIT = enums.ELM_POLICY_EXIT
|
|
|
|
ELM_POLICY_THROTTLE = enums.ELM_POLICY_THROTTLE
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
ELM_POLICY_QUIT_NONE = enums.ELM_POLICY_QUIT_NONE
|
|
|
|
ELM_POLICY_QUIT_LAST_WINDOW_CLOSED = enums.ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-12-09 20:55:36 -08:00
|
|
|
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
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-04-17 06:57:57 -07:00
|
|
|
cdef class FontProperties(object):
|
|
|
|
|
2013-04-27 07:43:22 -07:00
|
|
|
"""Elementary font properties"""
|
2013-04-17 06:57:57 -07:00
|
|
|
|
|
|
|
cdef Elm_Font_Properties *efp
|
|
|
|
|
|
|
|
property name:
|
|
|
|
""":type: unicode"""
|
|
|
|
def __set__(self, value):
|
2013-04-18 12:43:32 -07:00
|
|
|
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
2013-04-17 06:57:57 -07:00
|
|
|
self.efp.name = value
|
|
|
|
|
|
|
|
def __get__(self):
|
|
|
|
return _ctouni(self.efp.name)
|
|
|
|
|
|
|
|
property styles:
|
|
|
|
""":type: list of strings"""
|
|
|
|
def __set__(self, value):
|
2013-09-30 18:56:28 -07:00
|
|
|
self.efp.styles = python_list_strings_to_eina_list(value)
|
2013-04-17 06:57:57 -07:00
|
|
|
|
|
|
|
def __get__(self):
|
2013-09-30 18:56:28 -07:00
|
|
|
return eina_list_strings_to_python_list(self.efp.styles)
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-11-11 03:06:38 -08:00
|
|
|
elm_log = add_logger("efl.elementary")
|
|
|
|
cdef int PY_EFL_ELM_LOG_DOMAIN = elm_log.eina_log_domain
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
|
|
|
def init():
|
2013-12-06 07:39:13 -08:00
|
|
|
"""init() -> int
|
|
|
|
|
|
|
|
Initialize Elementary
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
:return int: The init counter value.
|
2013-02-21 09:24:13 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
This function initializes Elementary and increments a counter of the number
|
|
|
|
of calls to it. It returns the new counter's value.
|
|
|
|
|
|
|
|
"""
|
2013-11-11 03:06:38 -08:00
|
|
|
EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
|
|
|
|
"Initializing efl.elementary", NULL)
|
2013-12-06 07:39:13 -08:00
|
|
|
|
|
|
|
# FIXME: Why are we passing the cl args to elm_init here?
|
|
|
|
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
cdef int argc, i, arg_len
|
|
|
|
cdef char **argv, *arg
|
2013-04-02 10:12:56 -07:00
|
|
|
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
argc = len(sys.argv)
|
|
|
|
argv = <char **>PyMem_Malloc(argc * sizeof(char *))
|
2013-04-02 10:12:56 -07:00
|
|
|
for i in range(argc):
|
|
|
|
t = sys.argv[i]
|
2013-04-18 12:43:32 -07:00
|
|
|
if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
|
2013-04-02 10:12:56 -07:00
|
|
|
arg = t
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
arg_len = len(arg)
|
|
|
|
argv[i] = <char *>PyMem_Malloc(arg_len + 1)
|
|
|
|
memcpy(argv[i], arg, arg_len + 1)
|
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
return elm_init(argc, argv)
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
|
|
|
def shutdown():
|
2013-12-06 07:39:13 -08:00
|
|
|
"""shutdown() -> int
|
|
|
|
|
|
|
|
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.
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
.. note::
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
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()
|
|
|
|
|
|
|
|
"""
|
2013-11-11 03:06:38 -08:00
|
|
|
EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
|
|
|
|
"Shutting down efl.elementary", NULL)
|
2013-12-06 07:39:13 -08:00
|
|
|
return elm_shutdown()
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
|
|
|
def run():
|
2013-12-06 07:39:13 -08:00
|
|
|
"""run()
|
|
|
|
|
|
|
|
Run Elementary's main loop
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
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.
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
"""
|
2013-11-11 03:06:38 -08:00
|
|
|
EINA_LOG_DOM_DBG(PY_EFL_ELM_LOG_DOMAIN,
|
|
|
|
"Starting up main loop.", NULL)
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
with nogil:
|
|
|
|
elm_run()
|
|
|
|
|
|
|
|
def exit():
|
2013-12-06 07:39:13 -08:00
|
|
|
"""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::
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
By using the appropriate #ELM_POLICY_QUIT on your Elementary
|
|
|
|
applications, you'll be able to get this function called automatically
|
|
|
|
for you.
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-12-06 07:39:13 -08:00
|
|
|
"""
|
2013-11-11 03:06:38 -08:00
|
|
|
EINA_LOG_DOM_DBG(PY_EFL_ELM_LOG_DOMAIN,
|
|
|
|
"Ending main loop.", NULL)
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
elm_exit()
|
|
|
|
|
2013-04-17 06:57:57 -07:00
|
|
|
def policy_set(Elm_Policy policy, value):
|
|
|
|
"""policy_set(Elm_Policy policy, value) -> bool
|
|
|
|
|
|
|
|
Set new policy value.
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
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.
|
2013-04-27 07:43:22 -07:00
|
|
|
:type policy: :ref:`Elm_Policy`
|
2013-02-17 11:35:20 -08:00
|
|
|
: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).
|
2013-04-27 07:43:22 -07:00
|
|
|
:type value: :ref:`Elm_Policy_Quit`
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
:return: True on success or False on error (right
|
|
|
|
now just invalid policy identifier, but in future policy
|
|
|
|
value might be enforced).
|
|
|
|
|
|
|
|
"""
|
2013-04-17 06:57:57 -07:00
|
|
|
return bool(elm_policy_set(policy, value))
|
|
|
|
|
|
|
|
def policy_get(Elm_Policy policy):
|
|
|
|
"""policy_get(Elm_Policy policy) -> value
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-04-17 06:57:57 -07:00
|
|
|
Gets the policy value set for given identifier.
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
:param policy: policy identifier as in Elm_Policy.
|
2013-04-27 07:43:22 -07:00
|
|
|
:type policy: :ref:`Elm_Policy`
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
:return: policy value. Will be 0 if policy identifier is invalid.
|
2013-04-27 07:43:22 -07:00
|
|
|
:rtype: :ref:`Elm_Policy_Quit`
|
2013-02-17 11:35:20 -08:00
|
|
|
|
|
|
|
"""
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
return elm_policy_get(policy)
|
|
|
|
|
2013-04-17 06:57:57 -07:00
|
|
|
def coords_finger_size_adjust(int times_w, int w, int times_h, int h):
|
|
|
|
"""coords_finger_size_adjust(int times_w, int w, int times_h, int h) -> tuple
|
|
|
|
|
|
|
|
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
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
elm_coords_finger_size_adjust(times_w, &width, times_h, &height)
|
2013-04-17 06:57:57 -07:00
|
|
|
return (width, height)
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
def language_set(lang not None):
|
|
|
|
"""language_set(unicode lang)
|
2013-11-11 03:06:38 -08:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
Change the language of the current application
|
|
|
|
|
2013-11-11 03:06:38 -08:00
|
|
|
The ``lang`` passed must be the full name of the locale to use, for
|
|
|
|
example ``en_US.utf8`` or ``es_ES@euro``.
|
2013-10-02 14:30:23 -07:00
|
|
|
|
|
|
|
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)
|
2013-10-07 12:18:44 -07:00
|
|
|
elm_language_set(<const_char *>lang)
|
2013-10-02 14:30:23 -07:00
|
|
|
|
2013-03-05 14:17:24 -08:00
|
|
|
def cache_all_flush():
|
|
|
|
"""cache_all_flush()
|
2013-04-02 04:35:20 -07:00
|
|
|
|
2013-03-05 14:17:24 -08:00
|
|
|
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.
|
|
|
|
|
2013-12-06 17:34:19 -08:00
|
|
|
.. versionadded:: 1.8
|
|
|
|
|
2013-03-05 14:17:24 -08:00
|
|
|
"""
|
2013-04-02 04:35:20 -07:00
|
|
|
elm_cache_all_flush()
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
def font_properties_get(font not None):
|
|
|
|
"""font_properties_get(unicode font) -> FontProperties
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
Translate a font (family) name string in fontconfig's font names
|
|
|
|
syntax into a FontProperties object.
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
:param font: The font name and styles string
|
|
|
|
:return: the font properties object
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
.. note:: The reverse translation can be achieved with
|
|
|
|
:py:func:`font_fontconfig_name_get`, for one style only (single font
|
|
|
|
instance, not family).
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-12-06 17:34:19 -08:00
|
|
|
.. versionadded:: 1.8
|
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
"""
|
|
|
|
if isinstance(font, unicode): font = PyUnicode_AsUTF8String(font)
|
|
|
|
cdef FontProperties ret = FontProperties.__new__()
|
|
|
|
|
2013-10-07 12:18:44 -07:00
|
|
|
ret.efp = elm_font_properties_get(<const_char *>font)
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
return ret
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
def font_properties_free(FontProperties fp):
|
|
|
|
"""Free font properties return by font_properties_get().
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
:param fp: the font properties struct
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-12-06 17:34:19 -08:00
|
|
|
.. versionadded:: 1.8
|
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
"""
|
|
|
|
elm_font_properties_free(fp.efp)
|
|
|
|
Py_DECREF(fp)
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
def font_fontconfig_name_get(font_name, style = None):
|
|
|
|
"""font_fontconfig_name_get(unicode font_name, unicode style = None) -> unicode
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
Translate a font name, bound to a style, into fontconfig's font names
|
|
|
|
syntax.
|
2013-04-17 06:57:57 -07:00
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
: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).
|
|
|
|
|
2013-12-06 17:34:19 -08:00
|
|
|
.. versionadded:: 1.8
|
|
|
|
|
2013-10-02 14:30:23 -07:00
|
|
|
"""
|
|
|
|
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(
|
2013-10-07 12:18:44 -07:00
|
|
|
<const_char *>font_name,
|
|
|
|
<const_char *>style if style is not None else NULL
|
2013-10-02 14:30:23 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
ret = _touni(fc_name)
|
|
|
|
elm_font_fontconfig_name_free(fc_name)
|
|
|
|
return ret
|
2013-04-17 06:57:57 -07:00
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2013-08-09 22:34:46 -07:00
|
|
|
# One must call it with ``list`` being the return value of
|
2013-04-17 06:57:57 -07:00
|
|
|
# evas_font_available_list(). The hash will be indexed by font
|
2013-08-09 22:34:46 -07:00
|
|
|
# (family) names, being its values ``Elm_Font_Properties`` blobs.
|
2013-04-17 06:57:57 -07:00
|
|
|
|
|
|
|
# :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)
|
|
|
|
|
2013-10-03 23:29:45 -07:00
|
|
|
def object_tree_dump(evasObject top):
|
|
|
|
"""object_tree_dump(Object top)
|
|
|
|
|
|
|
|
Print Tree object hierarchy in stdout
|
|
|
|
|
|
|
|
:param top: The root object
|
|
|
|
|
2013-12-06 17:34:19 -08:00
|
|
|
.. versionadded:: 1.8
|
|
|
|
|
2013-10-03 23:29:45 -07:00
|
|
|
"""
|
|
|
|
elm_object_tree_dump(top.obj)
|
|
|
|
|
|
|
|
def object_tree_dot_dump(evasObject top, path):
|
|
|
|
"""object_tree_dot_dump(Object top, unicode path)
|
|
|
|
|
|
|
|
Print Elm Objects tree hierarchy in file as dot(graphviz) syntax.
|
|
|
|
|
|
|
|
:param top: The root object
|
|
|
|
:param path: The path of output file
|
|
|
|
|
2013-12-06 17:34:19 -08:00
|
|
|
.. versionadded:: 1.8
|
|
|
|
|
2013-10-03 23:29:45 -07:00
|
|
|
"""
|
|
|
|
if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
|
|
|
|
elm_object_tree_dot_dump(top.obj, <const_char *>path)
|