Compare commits

...

21 Commits

Author SHA1 Message Date
Kai Huuhko be81cc12af Elementary.thumb: Add missing enums. 2014-03-27 11:38:14 +02:00
Davide Andreoli a54bd1a126 Python-EFL: fix Fileselector.mime_types_filter_append() to work with py3 2014-02-26 21:46:31 +01:00
Kai Huuhko e7a5e594a4 utils.deprecated: Handle docstring indentation when modifying it. 2014-01-25 03:53:38 +02:00
Kai Huuhko a2c5090e29 Silence warnings in Cython 0.20 2014-01-24 22:49:18 +02:00
Kai Huuhko 1d16ec2590 Bump versions/years for release. 2014-01-18 14:24:01 +02:00
Davide Andreoli 763a591361 fix imports in elm tooltip example 2014-01-06 14:37:16 +01:00
Davide Andreoli 1ee169d918 Try to fix evas SmartObject
* implemented a test for smart obj
* remove comments from factories methods
* install the metaclass also for the Clipped one

Smart object implementation is still broken :(
Every object segfault on delete, the reason is
the eo del callback called BEFORE the smart
delete function. need to investigate better.
2014-01-06 12:45:50 +01:00
Kai Huuhko 0fb28e75a9 Update TODO 2013-12-30 14:08:48 +02:00
Kai Huuhko 33b6053987 Edje: Re-enable edje-edit. 2013-12-30 14:08:39 +02:00
Kai Huuhko a6864075af Tests: Removed expected failure from a test that now works 2013-12-30 14:08:13 +02:00
Kai Huuhko 6fb611e522 Add Python 2.6 compatibility, disabled one API method in evas.Image
Image.image_data_memoryview_get was disabled.

This method can be added back once we figure out how to do conditional
compilation using Python version.

Using an evas.Image instance as a memoryview object should do the same
thing as the disabled method.
2013-12-28 18:44:19 +02:00
Davide Andreoli bb84e1dcfb unbroke the emotion example
* copy the theme edj in source, instead of searching for an installed
one from the c example, that is not installed by default enymore.
* fix usage/import of enums
* add the 'p' key to toggle pause state
2013-12-23 21:37:48 +01:00
Kai Huuhko bd208f2233 Elementary: Add missing smart callbacks. 2013-12-22 10:30:36 +02:00
Kai Huuhko 4da99fd7ce Documentation: Add missed versionadded entries, fix formatting. 2013-12-22 10:25:40 +02:00
Kai Huuhko db5854dc07 setup.py: os.environ.has_key -> os.getenv
For some reason the former fails on the build bot
2013-12-19 22:50:58 +02:00
Kai Huuhko 70fead80f8 Force default visibility in CFLAGS.
Fixes T504
2013-12-19 19:23:58 +02:00
Kai Huuhko f9b7f0d96a Tests: Simple beginnings for Elm unit tests, enabled Eo tests. 2013-12-18 20:07:29 +02:00
Kai Huuhko ea9496e2e8 Tests: Decrease verbosity and buffer the output when running full suite. 2013-12-18 16:49:07 +02:00
Davide Andreoli e45f41b936 Python-EFL: 5 new tests about Focus.
Also add some missed values to Elm_Object_Focus_Direction enum.
2013-12-16 21:46:26 +01:00
Kai Huuhko 87bc96db44 Use uintptr_t instead of long or unsigned long for handling pointers. 2013-12-15 15:09:44 +02:00
Kai Huuhko a86d6cdab8 Elementary.web: updates to work with the new webkit-efl snapshot.
Commented out tab_propagate which doesn't seem to be implemented in
ewebkit2, and uncommented load finished signal.
2013-12-12 21:33:58 +02:00
113 changed files with 2619 additions and 1034 deletions

View File

@ -2,8 +2,8 @@
1. REQUIREMENTS:
----------------
* Python 2.7 or higher (http://www.python.org/)
- Tested with Python 2.7 / 3.2
* Python 2.6 or higher (http://www.python.org/)
- Tested with Python 2.6 / 2.7 / 3.2 / 3.3
* Cython 0.17.0 or higher (http://cython.org/)
- Tested with Cython 0.17.1
@ -89,6 +89,8 @@
tests or use the 00_run_all_tests.py in each folder or even in the tests/ base
dir to run all the tests at once.
Python 2.7 is required for running the tests.
The scripts in examples/ folder must be run by the user as they require
user interaction.

4
README
View File

@ -1,6 +1,6 @@
----------------
PYTHON-EFL 1.8.0
PYTHON-EFL 1.8.1
----------------
EFL is a collection of libraries for handling many common tasks a
@ -16,6 +16,8 @@ For installation instruction see the INSTALL file.
CHANGES FROM 1.7 to 1.8
=======================
See also changes.html.
* added efl container package
* ecore.file.Download => efl.ecore.FileDownload
* edje.edit.EdjeEdit => efl.edje_edit.EdjeEdit

11
TODO
View File

@ -1,16 +1,17 @@
BUGS
====
* EdjeEdit: PartState API does not work (edje edit is disabled for now)
* Edje.External: The unit test fails (marked as known failure in unittest)
* EdjeEdit: PartState API does not work
* Elm.Map: overlays_show segfaults, scrollers in examples are jumpy
* Bad binaries produced when build environment is invalid (T504)
Failing unit tests
------------------
* tests.edje.test_04_edit: testPartEffect (marked as known failure)
* tests.edje.test_04_edit: testGroupDel (skipped, segfault)
* tests.edje.test_04_edit: testExternal (skipped, TODO)
TODO (after 1.8)
================
* update links and text on:
http://www.freedesktop.org/wiki/Software/DBusBindings
(requires fd.org shell account?)

View File

@ -77,7 +77,7 @@ master_doc = 'index'
# General information about the project.
project = u'Python Bindings for Enlightenment Foundation Libraries'
copyright = u'2008-2013, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
copyright = u'2008-2014, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -86,7 +86,7 @@ copyright = u'2008-2013, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim,
# The short X.Y version.
version = '1.8'
# The full version, including alpha/beta/rc tags.
release = '1.8.0'
release = '1.8.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -313,7 +313,7 @@ texinfo_documents = [
epub_title = u'Python Bindings for EFL'
epub_author = u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
epub_publisher = u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
epub_copyright = u'2008-2013, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
epub_copyright = u'2008-2014, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
# The language of the text. It defaults to the language option
# or en if the language is not set.

View File

@ -4,3 +4,4 @@
==============================
.. autoclass:: efl.edje.Edje

View File

@ -0,0 +1,7 @@
.. currentmodule:: efl.edje_edit
:class:`efl.edje_edit.EdjeEdit` Class
=======================================
.. autoclass:: efl.edje_edit.EdjeEdit
:undoc-members:

View File

@ -72,6 +72,7 @@ Reference
:maxdepth: 4
class-edje
class-edje_edit
Inheritance diagram

View File

@ -200,6 +200,7 @@ File monitor events
"""
from libc.stdint cimport uintptr_t
import traceback
from efl.eo cimport Eo, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni

View File

@ -90,9 +90,9 @@ cdef class EventHandler(object):
def __repr__(self):
return ("%s(%#x, type=%d, func=%s, args=%s, kargs=%s, event_cls=%s, "
"Ecore_Event_Handler=%#x, refcount=%d)") % \
(self.__class__.__name__, <unsigned long><void *>self,
(self.__class__.__name__, <uintptr_t><void *>self,
self.type, self.func, self.args, self.kargs, self.event_cls,
<unsigned long>self.obj, PY_REFCOUNT(self))
<uintptr_t>self.obj, PY_REFCOUNT(self))
def __dealloc__(self):
if self.obj != NULL:

View File

@ -330,7 +330,7 @@ cdef class Exe(object):
Py_INCREF(self)
self.exe = exe
ecore_exe_callback_pre_free_set(exe, _ecore_exe_pre_free_cb)
_ecore_exe_event_mapping[<long><void *>exe] = self
_ecore_exe_event_mapping[<uintptr_t><void *>exe] = self
return 1
cdef int _unset_obj(self) except 0:
@ -339,7 +339,7 @@ cdef class Exe(object):
filter.delete()
self.__callbacks = None
_ecore_exe_event_mapping.pop(<long><void *>self.exe)
_ecore_exe_event_mapping.pop(<uintptr_t><void *>self.exe)
self.exe = NULL
Py_DECREF(self)
return 1
@ -357,8 +357,8 @@ cdef class Exe(object):
data = None
return ("<%s(%#x, Ecore_Exe=%#x, refcount=%d, pid=%s, cmd=%r, "
"flags=[%s], data=%r)>") % \
(self.__class__.__name__, <unsigned long><void *>self,
<unsigned long>self.exe, PY_REFCOUNT(self),
(self.__class__.__name__, <uintptr_t><void *>self,
<uintptr_t>self.exe, PY_REFCOUNT(self),
pid, cmd, flags, data)
def delete(self):
@ -779,7 +779,7 @@ cdef class EventExeAdd(Event):
cdef int _set_obj(self, void *o) except 0:
cdef Ecore_Exe_Event_Add *obj
obj = <Ecore_Exe_Event_Add*>o
self.exe = _ecore_exe_event_mapping.get(<long>obj.exe)
self.exe = _ecore_exe_event_mapping.get(<uintptr_t>obj.exe)
if self.exe is None:
return -1
return 1
@ -801,7 +801,7 @@ cdef class EventExeDel(Event):
cdef int _set_obj(self, void *o) except 0:
cdef Ecore_Exe_Event_Del *obj
obj = <Ecore_Exe_Event_Del*>o
self.exe = _ecore_exe_event_mapping.get(<long>obj.exe)
self.exe = _ecore_exe_event_mapping.get(<uintptr_t>obj.exe)
if self.exe is None:
return -1
self.pid = obj.pid
@ -841,7 +841,7 @@ cdef class EventExeData(Event):
cdef Ecore_Exe_Event_Data *obj
cdef int i
obj = <Ecore_Exe_Event_Data*>o
self.exe = _ecore_exe_event_mapping.get(<long>obj.exe)
self.exe = _ecore_exe_event_mapping.get(<uintptr_t>obj.exe)
if self.exe is None:
return -1
self.data = PyUnicode_FromStringAndSize(<char*>obj.data, obj.size)

View File

@ -124,9 +124,9 @@ cdef class FdHandler(object):
flags = flags2str(self.active_get(7))
return ("%s(%#x, func=%s, args=%s, kargs=%s, fd=%s, flags=[%s], "
"Ecore_Fd_Handler=%#x, refcount=%d)") % \
(self.__class__.__name__, <unsigned long><void *>self,
(self.__class__.__name__, <uintptr_t><void *>self,
self.func, self.args, self.kargs, fd, flags,
<unsigned long>self.obj, PY_REFCOUNT(self))
<uintptr_t>self.obj, PY_REFCOUNT(self))
def __dealloc__(self):
if self.obj != NULL:

View File

@ -109,9 +109,9 @@ cdef class FileDownload(object):
def __repr__(self):
return ("%s(%#x, completion_cb=%s, progress_cb=%s, args=%s, kargs=%s, "
"Ecore_File_Download_Job=%#x, refcount=%d)") % \
(self.__class__.__name__, <unsigned long><void *>self,
(self.__class__.__name__, <uintptr_t><void *>self,
self.completion_cb, self.progress_cb, self.args, self.kargs,
<unsigned long>self.job, PY_REFCOUNT(self))
<uintptr_t>self.job, PY_REFCOUNT(self))
def __dealloc__(self):
if self.job != NULL:

View File

@ -95,7 +95,7 @@ cdef class FileMonitor(object):
def __repr__(self):
return ("%s(%#x, monitor_cb=%s, args=%s, kargs=%s, refcount=%d)") % \
(self.__class__.__name__, <unsigned long><void *>self,
(self.__class__.__name__, <uintptr_t><void *>self,
self.monitor_cb, self.args, self.kargs, PY_REFCOUNT(self))
cdef object _exec_monitor(self, Ecore_File_Event event, const_char *path):

View File

@ -20,6 +20,7 @@ import warnings
from cpython cimport PyMem_Malloc, PyMem_Free, PyUnicode_AsUTF8String
cimport libc.stdlib
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance, \
_register_decorated_callbacks
@ -259,7 +260,9 @@ def color_class_del(color_class):
def color_class_list():
cdef Eina_List *lst, *itr
cdef:
Eina_List *lst
Eina_List *itr
ret = []
lst = edje_color_class_list()
itr = lst
@ -289,7 +292,9 @@ def text_class_del(text_class):
def text_class_list():
cdef Eina_List *lst, *itr
cdef:
Eina_List *lst
Eina_List *itr
ret = []
lst = edje_text_class_list()
itr = lst

View File

@ -17,6 +17,7 @@
from efl.utils.conversions cimport _touni, _ctouni, \
eina_list_strings_to_python_list
from efl.eo cimport _register_decorated_callbacks
from efl.edje cimport Edje_Part_Type
from efl.edje import EDJE_PART_TYPE_EXTERNAL
@ -30,9 +31,20 @@ EDJE_EDIT_IMAGE_COMP_LOSSY = 3
cdef class EdjeEdit(Edje):
def __init__(self, Canvas canvas not None, **kargs):
def __init__(self, Canvas canvas not None, file=None, group=None, size=None,
geometry=None, **kwargs):
self._set_obj(edje_edit_object_add(canvas.obj))
self._set_common_params(**kargs)
_register_decorated_callbacks(self)
if file:
self.file_set(file, group)
self._set_properties_from_keyword_args(kwargs)
if not size and not geometry:
w, h = self.size_min_get()
self.size_set(w, h)
# General
def compiler_get(self):

View File

@ -64,7 +64,10 @@ cdef class State:
self.value))
"""
def rel1_to_get(self):
cdef const_char *tx, *ty
cdef:
const_char *tx
const_char *ty
tx = edje_edit_state_rel1_to_x_get(self.edje.obj, self.part, self.name,
self.value)
ty = edje_edit_state_rel1_to_y_get(self.edje.obj, self.part, self.name,
@ -525,7 +528,7 @@ cdef class State:
lst = edje_edit_state_external_params_list_get(self.edje.obj, self.part,
self.name, self.value)
while lst:
p = c_edje._ExternalParam_from_ptr(<long>lst.data)
p = c_edje._ExternalParam_from_ptr(<uintptr_t>lst.data)
if p is not None:
ret.append(p)
lst = lst.next

View File

@ -78,7 +78,7 @@ cdef ExternalParam ExternalParam_from_ptr(Edje_External_Param *param):
# XXX: this should be C-only, but it would require edje_edit
# XXX: being able to use it.
def _ExternalParam_from_ptr(long ptr):
def _ExternalParam_from_ptr(uintptr_t ptr):
return ExternalParam_from_ptr(<Edje_External_Param *>ptr)

View File

@ -213,7 +213,9 @@ cdef class Edje(Object):
:rtype: tuple of str
"""
cdef const_char *file, *group
cdef:
const_char *file
const_char *group
edje_object_file_get(self.obj, &file, &group)
return (_ctouni(file), _ctouni(group))

View File

@ -42,19 +42,19 @@ When the indicator is released, it will move to its nearest "enabled and
magnetized" position.
This widget emits the following signals, besides the ones sent from
:py:class:`efl.elementary.layout_class.LayoutClass`:
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- **selected** - when user selects an enabled position (the label is
- ``selected`` - when user selects an enabled position (the label is
passed as event info)".
- **pos_changed** - when the indicator reaches any of the
- ``pos_changed`` - when the indicator reaches any of the
positions("left", "right" or "center").
Default text parts of the actionslider widget that you can use for are:
- **indicator** - An indicator label of the actionslider
- **left** - A left label of the actionslider
- **right** - A right label of the actionslider
- **center** - A center label of the actionslider
- ``indicator`` - An indicator label of the actionslider
- ``left`` - A left label of the actionslider
- ``right`` - A right label of the actionslider
- ``center`` - A center label of the actionslider
Enumerations
@ -88,6 +88,7 @@ Actionslider positions
from cpython cimport PyUnicode_AsUTF8String
from libc.string cimport const_char
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -102,7 +103,7 @@ ELM_ACTIONSLIDER_CENTER = enums.ELM_ACTIONSLIDER_CENTER
ELM_ACTIONSLIDER_RIGHT = enums.ELM_ACTIONSLIDER_RIGHT
ELM_ACTIONSLIDER_ALL = enums.ELM_ACTIONSLIDER_ALL
def _cb_string_conv(long addr):
def _cb_string_conv(uintptr_t addr):
cdef const_char *s = <const_char *>addr
return _ctouni(s) if s is not NULL else None

View File

@ -34,7 +34,7 @@ background, like setting it to tiled, centered, scaled or stretched.
Default content parts of the bg widget that you can use for are:
- **overlay** - overlay of the bg
- ``overlay`` - overlay of the bg
Enumerations
@ -115,7 +115,10 @@ cdef class Background(LayoutClass):
"""
def __get__(self):
cdef const_char *filename, *group
cdef:
const_char *filename
const_char *group
elm_bg_file_get(self.obj, &filename, &group)
return (_ctouni(filename), _ctouni(group))
@ -141,7 +144,10 @@ cdef class Background(LayoutClass):
<const_char *>group if group is not None else NULL):
raise RuntimeError("Could not set background file.")
def file_get(self):
cdef const_char *filename, *group
cdef:
const_char *filename
const_char *group
elm_bg_file_get(self.obj, &filename, &group)
return (_ctouni(filename), _ctouni(group))

View File

@ -40,13 +40,13 @@ The bubble widget contains 5 important visual elements:
The position of the arrow, icon, label and info depends on which corner is
selected. The four available corners are:
- **top_left** - Default
- **top_right**
- **bottom_left**
- **bottom_right**
- ``top_left`` - Default
- ``top_right``
- ``bottom_left``
- ``bottom_right``
This widget emits the following signals, besides the ones sent from
:py:class:`efl.elementary.layout_class.LayoutClass`:
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``clicked`` - This is called when a user has clicked the bubble.
- ``focused`` - When the bubble has received focus. (since 1.8)
@ -54,13 +54,13 @@ This widget emits the following signals, besides the ones sent from
Default content parts of the bubble that you can use for are:
- **default** - A content of the bubble
- **icon** - An icon of the bubble
- ``default`` - A content of the bubble
- ``icon`` - An icon of the bubble
Default text parts of the button widget that you can use for are:
- **default** - Label of the bubble
- **info** - info of the bubble
- ``default`` - Label of the bubble
- ``info`` - info of the bubble
Enumerations

View File

@ -39,27 +39,27 @@ This widget emits the following signals, besides the ones sent from
Also, defined in the default theme, the button has the following styles
available:
- default: a normal button.
- anchor: Like default, but the button fades away when the mouse is not
- ``default``: a normal button.
- ``anchor``: Like default, but the button fades away when the mouse is not
over it, leaving only the text or icon.
- hoversel_vertical: Internally used by
- ``hoversel_vertical``: Internally used by
:py:class:`~efl.elementary.hoversel.Hoversel` to give a continuous look
across its options.
- hoversel_vertical_entry: Another internal for
- ``hoversel_vertical_entry``: Another internal for
:py:class:`~efl.elementary.hoversel.Hoversel`.
- naviframe: Internally used by
- ``naviframe``: Internally used by
:py:class:`~efl.elementary.naviframe.Naviframe` for its back button.
- colorselector: Internally used by
- ``colorselector``: Internally used by
:py:class:`~efl.elementary.colorselector.Colorselector` for its left and
right buttons.
Default content parts of the button widget that you can use for are:
- "icon" - An icon of the button
- ``icon`` - An icon of the button
Default text parts of the button widget that you can use for are:
- "default" - Label of the button
- ``default`` - Label of the button
"""

View File

@ -37,7 +37,7 @@ The API of this widget lets the applications perform other functions, like:
- setting the year and month format.
This widget emits the following signals, besides the ones sent from
:py:class:`efl.elementary.layout_class.LayoutClass`:
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``changed`` - emitted when the date in the calendar is changed.
- ``display,changed`` - emitted when the current month displayed in the

View File

@ -40,13 +40,13 @@ This widget emits the following signals, besides the ones sent from
Default content parts of the check widget that you can use for are:
- "icon" - An icon of the check
- ``icon`` - An icon of the check
Default text parts of the check widget that you can use for are:
- "default" - A label of the check
- "on" - On state label of the check
- "off" - Off state label of the check
- ``default`` - A label of the check
- ``on`` - On state label of the check
- ``off`` - Off state label of the check
"""

View File

@ -18,11 +18,12 @@
"""
.. image:: /images/colorselector-preview.png
Widget description
------------------
.. image:: /images/colorselector-preview.png
:align: left
A Colorselector is a color selection widget.
It allows application to set a series of colors. It also allows to
@ -68,6 +69,7 @@ Colorselector modes
"""
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -81,7 +83,7 @@ ELM_COLORSELECTOR_PALETTE = enums.ELM_COLORSELECTOR_PALETTE
ELM_COLORSELECTOR_COMPONENTS = enums.ELM_COLORSELECTOR_COMPONENTS
ELM_COLORSELECTOR_BOTH = enums.ELM_COLORSELECTOR_BOTH
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -590,9 +590,12 @@ cdef class Configuration(object):
"""
def __get__(self):
cdef Eina_List *lst
cdef Elm_Text_Class *data
cdef const_char *name, *desc
cdef:
Eina_List *lst
Elm_Text_Class *data
const_char *name
const_char *desc
ret = []
lst = elm_config_text_classes_list_get()
while lst:
@ -617,10 +620,13 @@ cdef class Configuration(object):
"""
def __get__(self):
cdef const_Eina_List *lst
cdef Elm_Font_Overlay *data
cdef const_char *text_class, *font
cdef Evas_Font_Size size
cdef:
const_Eina_List *lst
Elm_Font_Overlay *data
const_char *text_class
const_char *font
Evas_Font_Size size
ret = []
lst = elm_config_font_overlay_list_get()
while lst:

View File

@ -31,20 +31,20 @@ space required for such stuff, and when they popup, as a keyboard
shows when an entry is selected, conformant content won't change.
This widget emits the following signals, besides the ones sent from
:py:class:`efl.elementary.layout_class.LayoutClass`:
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- "virtualkeypad,state,on": if virtualkeypad state is switched to "on".
- "virtualkeypad,state,off": if virtualkeypad state is switched to "off".
- "clipboard,state,on": if clipboard state is switched to "on".
- "clipboard,state,off": if clipboard state is switched to "off".
- ``virtualkeypad,state,on``: if virtualkeypad state is switched to ``on``.
- ``virtualkeypad,state,off``: if virtualkeypad state is switched to ``off``.
- ``clipboard,state,on``: if clipboard state is switched to ``on``.
- ``clipboard,state,off``: if clipboard state is switched to ``off``.
In all cases, the ``event`` parameter of the callback will be None.
Available styles for it:
- ``"default"``
- ``default``
Default content parts of the conformant widget that you can use for are:
- "default" - A content of the conformant
- ``default`` - A content of the conformant
"""

View File

@ -44,15 +44,15 @@ Signals that you can add callbacks for are:
Default content parts of the ctxpopup widget that you can use for are:
- "default" - A content of the ctxpopup
- ``default`` - A content of the ctxpopup
Default content parts of the ctxpopup items that you can use for are:
- "icon" - An icon in the title area
- ``icon`` - An icon in the title area
Default text parts of the ctxpopup items that you can use for are:
- "default" - Title label in the title area
- ``default`` - Title label in the title area
.. note::

View File

@ -62,12 +62,12 @@ the different check styles for individual days.
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"dayselector,changed"`` - when the user changes the state of a day.
- ``"language,changed"`` - the program's language changed
- ``dayselector,changed`` - when the user changes the state of a day.
- ``language,changed`` - the program's language changed
Available styles for dayselector are:
- default
- ``default``
Enumerations

View File

@ -42,17 +42,17 @@ Smart callbacks one can listen to:
Available styles for it:
- ``"default"``
- ``default``
Default content parts of the diskselector items that you can use for are:
- "icon" - An icon in the diskselector item
- ``icon`` - An icon in the diskselector item
Default text parts of the diskselector items that you can use for are:
- "default" - Label of the diskselector item
- ``default`` - Label of the diskselector item
.. note:: The "scroll,anim,*" and "scroll,drag,*" signals are only emitted
.. note:: The ``scroll,anim,*`` and ``scroll,drag,*`` signals are only emitted
by user intervention.
Scrollable Interface
@ -72,6 +72,7 @@ using multiple inheritance, for example::
"""
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -84,7 +85,7 @@ from efl.utils.deprecated cimport DEPRECATED
from scroller cimport elm_scroller_policy_get, elm_scroller_policy_set, \
elm_scroller_bounce_get, elm_scroller_bounce_set, Elm_Scroller_Policy
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -214,51 +214,52 @@ Emitted signals
This widget emits the following signals:
- "changed": The text within the entry was changed.
- "changed,user": The text within the entry was changed because of user
- ``changed``: The text within the entry was changed.
- ``changed,user``: The text within the entry was changed because of user
interaction.
- "activated": The enter key was pressed on a single line entry.
- "aborted": The escape key was pressed on a single line entry. (since 1.7)
- "press": A mouse button has been pressed on the entry.
- "longpressed": A mouse button has been pressed and held for a couple
- ``activated``: The enter key was pressed on a single line entry.
- ``aborted``: The escape key was pressed on a single line entry. (since 1.7)
- ``press``: A mouse button has been pressed on the entry.
- ``longpressed``: A mouse button has been pressed and held for a couple
seconds.
- "clicked": The entry has been clicked (mouse press and release).
- "clicked,double": The entry has been double clicked.
- "clicked,triple": The entry has been triple clicked.
- "focused": The entry has received focus.
- "unfocused": The entry has lost focus.
- "selection,paste": A paste of the clipboard contents was requested.
- "selection,copy": A copy of the selected text into the clipboard was
- ``clicked``: The entry has been clicked (mouse press and release).
- ``clicked,double``: The entry has been double clicked.
- ``clicked,triple``: The entry has been triple clicked.
- ``focused``: The entry has received focus.
- ``unfocused``: The entry has lost focus.
- ``selection,paste``: A paste of the clipboard contents was requested.
- ``selection,copy``: A copy of the selected text into the clipboard was
requested.
- "selection,cut": A cut of the selected text into the clipboard was
- ``selection,cut``: A cut of the selected text into the clipboard was
requested.
- "selection,start": A selection has begun and no previous selection
- ``selection,start``: A selection has begun and no previous selection
existed.
- "selection,changed": The current selection has changed.
- "selection,cleared": The current selection has been cleared.
- "cursor,changed": The cursor has changed position.
- "anchor,clicked": An anchor has been clicked. The event_info
- ``selection,changed``: The current selection has changed.
- ``selection,cleared``: The current selection has been cleared.
- ``cursor,changed``: The cursor has changed position.
- ``anchor,clicked``: An anchor has been clicked. The event_info
parameter for the callback will be an :py:class:`EntryAnchorInfo`.
- "anchor,in": Mouse cursor has moved into an anchor. The event_info
- ``anchor,in``: Mouse cursor has moved into an anchor. The event_info
parameter for the callback will be an :py:class:`EntryAnchorInfo`.
- "anchor,out": Mouse cursor has moved out of an anchor. The event_info
- ``anchor,out``: Mouse cursor has moved out of an anchor. The event_info
parameter for the callback will be an :py:class:`EntryAnchorInfo`.
- "anchor,up": Mouse button has been unpressed on an anchor. The event_info
- ``anchor,up``: Mouse button has been unpressed on an anchor. The event_info
parameter for the callback will be an :py:class:`EntryAnchorInfo`.
- "anchor,down": Mouse button has been pressed on an anchor. The event_info
- ``anchor,down``: Mouse button has been pressed on an anchor. The event_info
parameter for the callback will be an :py:class:`EntryAnchorInfo`.
- "preedit,changed": The preedit string has changed.
- "language,changed": Program language changed.
- "text,set,done": Whole text has been set to the entry.
- ``preedit,changed``: The preedit string has changed.
- ``language,changed``: Program language changed.
- ``text,set,done``: Whole text has been set to the entry.
Default content parts of the entry items that you can use for are:
- "icon" - An icon in the entry
- "end" - A content in the end of the entry
- ``icon`` - An icon in the entry
- ``end`` - A content in the end of the entry
Default text parts of the entry that you can use for are:
- "default" - text of the entry
- ``default`` - text of the entry
- ``guide`` - placeholder of the entry
Enumerations
@ -468,6 +469,7 @@ Icon types
from libc.string cimport strdup
from libc.stdlib cimport free
from libc.stdint cimport uintptr_t
from cpython cimport PyUnicode_AsUTF8String, Py_INCREF
from efl.eo cimport _object_mapping_register, object_from_instance
@ -602,7 +604,8 @@ cdef class EntryContextMenuItem(object):
"""
def __get__(self):
cdef:
const_char *icon_file, *icon_group
const_char *icon_file
const_char *icon_group
Elm_Icon_Type icon_type
elm_entry_context_menu_item_icon_get(self.item,
&icon_file,
@ -753,7 +756,7 @@ class EntryAnchorHoverInfo(object):
self.hover_top = False
self.hover_bottom = False
def _entryanchor_conv(long addr):
def _entryanchor_conv(uintptr_t addr):
cdef Elm_Entry_Anchor_Info *ei = <Elm_Entry_Anchor_Info *>addr
eai = EntryAnchorInfo()
eai.name = _ctouni(ei.name)
@ -764,10 +767,10 @@ def _entryanchor_conv(long addr):
eai.h = ei.h
return eai
def _entryanchorhover_conv(long addr):
def _entryanchorhover_conv(uintptr_t addr):
cdef Elm_Entry_Anchor_Hover_Info *ehi = <Elm_Entry_Anchor_Hover_Info *>addr
eahi = EntryAnchorHoverInfo()
eahi.anchor_info = _entryanchor_conv(<long><void *>ehi.anchor_info)
eahi.anchor_info = _entryanchor_conv(<uintptr_t><void *>ehi.anchor_info)
eahi.hover = object_from_instance(ehi.hover)
eahi.hover_parent = (ehi.hover_parent.x, ehi.hover_parent.y,
ehi.hover_parent.w, ehi.hover_parent.h)

View File

@ -145,6 +145,10 @@ cdef extern from "Elementary.h":
ctypedef enum Elm_Focus_Direction:
ELM_FOCUS_PREVIOUS
ELM_FOCUS_NEXT
ELM_FOCUS_UP
ELM_FOCUS_DOWN
ELM_FOCUS_RIGHT
ELM_FOCUS_LEFT
ctypedef enum Elm_Genlist_Item_Type:
ELM_GENLIST_ITEM_NONE

View File

@ -85,6 +85,7 @@ Fileselector modes
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list
@ -96,7 +97,7 @@ cimport enums
ELM_FILESELECTOR_LIST = enums.ELM_FILESELECTOR_LIST
ELM_FILESELECTOR_GRID = enums.ELM_FILESELECTOR_GRID
def _cb_string_conv(long addr):
def _cb_string_conv(uintptr_t addr):
cdef const_char *s = <const_char *>addr
return _ctouni(s) if s is not NULL else None
@ -347,7 +348,7 @@ cdef class Fileselector(LayoutClass):
"""
mime_types_s = ",".join(mime_types)
if isinstance(mime_types_s, unicode): mime_types_s = PyUnicode_AsUTF8String(mime_types)
if isinstance(mime_types_s, unicode): mime_types_s = PyUnicode_AsUTF8String(mime_types_s)
if isinstance(filter_name, unicode): filter_name = PyUnicode_AsUTF8String(filter_name)
if not elm_fileselector_mime_types_filter_append(self.obj, mime_types_s,
<const_char *>filter_name if filter_name is not None else NULL):

View File

@ -36,31 +36,33 @@ would have instantiating one directly.
The following styles are available for this button:
- ``"default"``
- ``"anchor"``
- ``"hoversel_vertical"``
- ``"hoversel_vertical_entry"``
- ``default``
- ``anchor``
- ``hoversel_vertical``
- ``hoversel_vertical_entry``
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.button.Button`:
- ``"file,chosen"`` - the user has selected a path which comes as the
- ``file,chosen`` - the user has selected a path which comes as the
``event_info`` data
- ``language,changed`` - the program's language changed
Default text parts of the fileselector_button widget that you can use for
are:
- "default" - Label of the fileselector_button
- ``default`` - Label of the fileselector_button
Default content parts of the fileselector_button widget that you can use
for are:
- "icon" - Icon of the fileselector_button
- ``icon`` - Icon of the fileselector_button
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -68,7 +70,7 @@ from efl.evas cimport Object as evasObject
cimport enums
def _cb_string_conv(long addr):
def _cb_string_conv(uintptr_t addr):
cdef const_char *s = <const_char *>addr
return _ctouni(s) if s is not NULL else None
@ -269,5 +271,15 @@ cdef class FileselectorButton(Button):
def callback_file_chosen_del(self, func):
self._callback_del_full("file,chosen", _cb_string_conv, func)
def callback_language_changed_add(self, func, *args, **kwargs):
"""The program's language changed.
.. versionadded:: 1.8.1
"""
self._callback_add("language,changed", func, *args, **kwargs)
def callback_language_changed_del(self, func):
self._callback_del("language,changed", func)
_object_mapping_register("Elm_Fileselector_Button", FileselectorButton)

View File

@ -43,40 +43,42 @@ selector than that one would have instantiating one directly.
Smart callbacks one can register to:
- ``"changed"`` - The text within the entry was changed
- ``"activated"`` - The entry has had editing finished and
- ``changed`` - The text within the entry was changed
- ``activated`` - The entry has had editing finished and
changes are to be "committed"
- ``"press"`` - The entry has been clicked
- ``"longpressed"`` - The entry has been clicked (and held) for a
- ``press`` - The entry has been clicked
- ``longpressed`` - The entry has been clicked (and held) for a
couple seconds
- ``"clicked"`` - The entry has been clicked
- ``"clicked,double"`` - The entry has been double clicked
- ``"focused"`` - The entry has received focus
- ``"unfocused"`` - The entry has lost focus
- ``"selection,paste"`` - A paste action has occurred on the
- ``clicked`` - The entry has been clicked
- ``clicked,double`` - The entry has been double clicked
- ``focused`` - The entry has received focus
- ``unfocused`` - The entry has lost focus
- ``selection,paste`` - A paste action has occurred on the
entry
- ``"selection,copy"`` - A copy action has occurred on the entry
- ``"selection,cut"`` - A cut action has occurred on the entry
- ``"unpressed"`` - The file selector entry's button was released
- ``selection,copy`` - A copy action has occurred on the entry
- ``selection,cut`` - A cut action has occurred on the entry
- ``unpressed`` - The file selector entry's button was released
after being pressed.
- ``"file,chosen"`` - The user has selected a path via the file
- ``file,chosen`` - The user has selected a path via the file
selector entry's internal file selector, whose string
comes as the ``event_info`` data.
- ``language,changed`` - the program's language changed
Default text parts of the fileselector_button widget that you can use for
are:
- "default" - Label of the fileselector_button
- ``default`` - Label of the fileselector_button
Default content parts of the fileselector_entry widget that you can use for
are:
- "button icon" - Button icon of the fileselector_entry
- ``button icon`` - Button icon of the fileselector_entry
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -85,7 +87,7 @@ from layout_class cimport LayoutClass
cimport enums
def _cb_string_conv(long addr):
def _cb_string_conv(uintptr_t addr):
cdef const_char *s = <const_char *>addr
return _ctouni(s) if s is not NULL else None
@ -403,5 +405,15 @@ cdef class FileselectorEntry(LayoutClass):
def callback_file_chosen_del(self, func):
self._callback_del_full("file,chosen", _cb_string_conv, func)
def callback_language_changed_add(self, func, *args, **kwargs):
"""The program's language changed.
.. versionadded:: 1.8.1
"""
self._callback_add("language,changed", func, *args, **kwargs)
def callback_language_changed_del(self, func):
self._callback_del("language,changed", func)
_object_mapping_register("Elm_Fileselector_Entry", FileselectorEntry)

View File

@ -35,13 +35,13 @@ For a list of supported animations see :py:meth:`Flip.go`.
Signals that you can add callbacks for are:
- "animate,begin" - when a flip animation was started
- "animate,done" - when a flip animation is finished
- ``animate,begin`` - when a flip animation was started
- ``animate,done`` - when a flip animation is finished
Default content parts of the flip widget that you can use for are:
- "front" - A front content of the flip
- "back" - A back content of the flip
- ``front`` - A front content of the flip
- ``back`` - A back content of the flip
Enumerations

View File

@ -38,25 +38,26 @@ the current selection.
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"selected"`` - when the widget's selected text item is changed
- ``"overflowed"`` - when the widget's current selection is changed
- ``selected`` - when the widget's selected text item is changed
- ``overflowed`` - when the widget's current selection is changed
from the first item in its list to the last
- ``"underflowed"`` - when the widget's current selection is changed
- ``underflowed`` - when the widget's current selection is changed
from the last item in its list to the first
- ``focused`` - When the flipselector has received focus. (since 1.8)
- ``unfocused`` - When the flipselector has lost focus. (since 1.8)
Available styles for it:
- ``"default"``
- ``default``
Default text parts of the flipselector items that you can use for are:
- "default" - label of the flipselector item
- ``default`` - label of the flipselector item
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -65,7 +66,7 @@ from object cimport Object
from object_item cimport _object_item_to_python, _object_item_callback, \
_object_item_list_to_python, _object_item_callback2
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -36,20 +36,20 @@ styles:
- outdent_top
- outdent_bottom
Of all this styles only default shows the title.
Out of all these styles only default shows the title.
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"clicked"`` - The user has clicked the frame's label
- ``clicked`` - The user has clicked the frame's label
Default content parts of the frame widget that you can use for are:
- "default" - A content of the frame
- ``default`` - A content of the frame
Default text parts of the frame widget that you can use for are:
- "default" - Label of the frame
- ``default`` - Label of the frame
"""

View File

@ -121,6 +121,7 @@ Possible values for the #ELM_POLICY_THROTTLE policy.
from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyUnicode_AsUTF8String, \
PyMem_Malloc, PyMem_Free
from libc.stdint cimport uintptr_t
from efl.evas cimport Object as evasObject
@ -194,8 +195,10 @@ def init():
# FIXME: Why are we passing the cl args to elm_init here?
cdef int argc, i, arg_len
cdef char **argv, *arg
cdef:
int argc, i, arg_len
char **argv
char *arg
argc = len(sys.argv)
argv = <char **>PyMem_Malloc(argc * sizeof(char *))

View File

@ -279,6 +279,7 @@ Items' scroll to types
include "tooltips.pxi"
from libc.string cimport strdup
from libc.stdint cimport uintptr_t
from cpython cimport Py_INCREF, Py_DECREF, PyUnicode_AsUTF8String
from efl.eo cimport object_from_instance, _object_mapping_register, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni, _touni
@ -302,7 +303,7 @@ ELM_GENLIST_ITEM_SCROLLTO_IN = enums.ELM_GENLIST_ITEM_SCROLLTO_IN
ELM_GENLIST_ITEM_SCROLLTO_TOP = enums.ELM_GENLIST_ITEM_SCROLLTO_TOP
ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = enums.ELM_GENLIST_ITEM_SCROLLTO_MIDDLE
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -55,9 +55,9 @@ cdef class GengridItem(ObjectItem):
return ("<%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
"item_class=%s, func=%s, item_data=%r)>") % \
(type(self).__name__,
<unsigned long><void*>self,
<uintptr_t><void*>self,
PY_REFCOUNT(self),
<unsigned long>self.item,
<uintptr_t>self.item,
type(self.item_class).__name__,
self.cb_func,
self.item_data)

View File

@ -119,9 +119,9 @@ cdef class GengridItemClass:
"item_style=%r, text_get_func=%s, content_get_func=%s, "
"state_get_func=%s, del_func=%s)>") % \
(type(self).__name__,
<unsigned long><void *>self,
<uintptr_t><void *>self,
PY_REFCOUNT(self),
<unsigned long>self.cls,
<uintptr_t>self.cls,
_ctouni(self.cls.item_style),
self._text_get_func,
self._content_get_func,

View File

@ -271,95 +271,95 @@ Genlist smart events
Signals that you can add callbacks for are:
- ``"activated"`` - The user has double-clicked or pressed
- ``activated`` - The user has double-clicked or pressed
(enter|return|spacebar) on an item. The ``event_info`` parameter is the
item that was activated.
- ``"clicked,double"`` - The user has double-clicked an item. The
- ``clicked,double`` - The user has double-clicked an item. The
``event_info`` parameter is the item that was double-clicked.
- ``"selected"`` - This is called when a user has made an item selected.
- ``selected`` - This is called when a user has made an item selected.
The event_info parameter is the genlist item that was selected.
- ``"unselected"`` - This is called when a user has made an item
- ``unselected`` - This is called when a user has made an item
unselected. The event_info parameter is the genlist item that was
unselected.
- ``"expanded"`` - This is called when :py:attr:`GenlistItem.expanded` is
- ``expanded`` - This is called when :py:attr:`GenlistItem.expanded` is
called and the item is now meant to be expanded. The event_info
parameter is the genlist item that was indicated to expand. It is the
job of this callback to then fill in the child items.
- ``"contracted"`` - This is called when :py:attr:`GenlistItem.expanded` is
- ``contracted`` - This is called when :py:attr:`GenlistItem.expanded` is
called and the item is now meant to be contracted. The event_info
parameter is the genlist item that was indicated to contract. It is the
job of this callback to then delete the child items.
- ``"expand,request"`` - This is called when a user has indicated they want
- ``expand,request`` - This is called when a user has indicated they want
to expand a tree branch item. The callback should decide if the item can
expand (has any children) and then call :py:attr:`GenlistItem.expanded`
appropriately to set the state. The event_info parameter is the genlist
item that was indicated to expand.
- ``"contract,request"`` - This is called when a user has indicated they
- ``contract,request`` - This is called when a user has indicated they
want to contract a tree branch item. The callback should decide if the
item can contract (has any children) and then call
:py:attr:`GenlistItem.expanded` appropriately to set the state. The
event_info parameter is the genlist item that was indicated to contract.
- ``"realized"`` - This is called when the item in the list is created as a
- ``realized`` - This is called when the item in the list is created as a
real evas object. event_info parameter is the genlist item that was
created.
- ``"unrealized"`` - This is called just before an item is unrealized.
- ``unrealized`` - This is called just before an item is unrealized.
After this call content objects provided will be deleted and the item
object itself delete or be put into a floating cache.
- ``"drag,start,up"`` - This is called when the item in the list has been
- ``drag,start,up`` - This is called when the item in the list has been
dragged (not scrolled) up.
- ``"drag,start,down"`` - This is called when the item in the list has been
- ``drag,start,down`` - This is called when the item in the list has been
dragged (not scrolled) down.
- ``"drag,start,left"`` - This is called when the item in the list has been
- ``drag,start,left`` - This is called when the item in the list has been
dragged (not scrolled) left.
- ``"drag,start,right"`` - This is called when the item in the list has
- ``drag,start,right`` - This is called when the item in the list has
been dragged (not scrolled) right.
- ``"drag,stop"`` - This is called when the item in the list has stopped
- ``drag,stop`` - This is called when the item in the list has stopped
being dragged.
- ``"drag"`` - This is called when the item in the list is being dragged.
- ``"longpressed"`` - This is called when the item is pressed for a certain
- ``drag`` - This is called when the item in the list is being dragged.
- ``longpressed`` - This is called when the item is pressed for a certain
amount of time. By default it's 1 second. The event_info parameter is the
longpressed genlist item.
- ``"scroll,anim,start"`` - This is called when scrolling animation has
- ``scroll,anim,start`` - This is called when scrolling animation has
started.
- ``"scroll,anim,stop"`` - This is called when scrolling animation has
- ``scroll,anim,stop`` - This is called when scrolling animation has
stopped.
- ``"scroll,drag,start"`` - This is called when dragging the content has
- ``scroll,drag,start`` - This is called when dragging the content has
started.
- ``"scroll,drag,stop"`` - This is called when dragging the content has
- ``scroll,drag,stop`` - This is called when dragging the content has
stopped.
- ``"edge,top"`` - This is called when the genlist is scrolled until
- ``edge,top`` - This is called when the genlist is scrolled until
the top edge.
- ``"edge,bottom"`` - This is called when the genlist is scrolled
- ``edge,bottom`` - This is called when the genlist is scrolled
until the bottom edge.
- ``"edge,left"`` - This is called when the genlist is scrolled
- ``edge,left`` - This is called when the genlist is scrolled
until the left edge.
- ``"edge,right"`` - This is called when the genlist is scrolled
- ``edge,right`` - This is called when the genlist is scrolled
until the right edge.
- ``"multi,swipe,left"`` - This is called when the genlist is multi-touch
- ``multi,swipe,left`` - This is called when the genlist is multi-touch
swiped left.
- ``"multi,swipe,right"`` - This is called when the genlist is multi-touch
- ``multi,swipe,right`` - This is called when the genlist is multi-touch
swiped right.
- ``"multi,swipe,up"`` - This is called when the genlist is multi-touch
- ``multi,swipe,up`` - This is called when the genlist is multi-touch
swiped up.
- ``"multi,swipe,down"`` - This is called when the genlist is multi-touch
- ``multi,swipe,down`` - This is called when the genlist is multi-touch
swiped down.
- ``"multi,pinch,out"`` - This is called when the genlist is multi-touch
- ``multi,pinch,out`` - This is called when the genlist is multi-touch
pinched out.
- ``multi,pinch,in"`` - This is called when the genlist is multi-touch
- ``multi,pinch,in`` - This is called when the genlist is multi-touch
pinched in.
- ``"swipe"`` - This is called when the genlist is swiped.
- ``"moved"`` - This is called when a genlist item is moved in reorder mode.
- ``"moved,after"`` - This is called when a genlist item is moved after
- ``swipe`` - This is called when the genlist is swiped.
- ``moved`` - This is called when a genlist item is moved in reorder mode.
- ``moved,after`` - This is called when a genlist item is moved after
another item in reorder mode. The event_info parameter is the reordered
item. To get the relative previous item, use :py:attr:`GenlistItem.prev`.
This signal is called along with "moved" signal.
- ``"moved,before"`` - This is called when a genlist item is moved before
- ``moved,before`` - This is called when a genlist item is moved before
another item in reorder mode. The event_info parameter is the reordered
item. To get the relative previous item, use :py:attr:`GenlistItem.next`.
This signal is called along with "moved" signal.
- ``"language,changed"`` - This is called when the program's language is
- ``language,changed`` - This is called when the program's language is
changed.
- ``"tree,effect,finished"`` - This is called when a genlist tree effect
- ``tree,effect,finished`` - This is called when a genlist tree effect
is finished.
- ``highlighted`` - an item in the list is highlighted. This is called when
the user presses an item or keyboard selection is done so the item is
@ -507,6 +507,7 @@ Selection modes
include "tooltips.pxi"
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni
@ -569,7 +570,7 @@ ELM_SEL_TYPE_SECONDARY = enums.ELM_SEL_TYPE_SECONDARY
ELM_SEL_TYPE_XDND = enums.ELM_SEL_TYPE_XDND
ELM_SEL_TYPE_CLIPBOARD = enums.ELM_SEL_TYPE_CLIPBOARD
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -81,9 +81,9 @@ cdef class GenlistItem(ObjectItem):
return ("<%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
"item_class=%s, func=%s, item_data=%r)>") % (
type(self).__name__,
<unsigned long><void*>self,
<uintptr_t><void*>self,
PY_REFCOUNT(self),
<unsigned long>self.item,
<uintptr_t>self.item,
type(self.item_class).__name__,
self.cb_func,
self.item_data
@ -161,7 +161,8 @@ cdef class GenlistItem(ObjectItem):
"""
cdef:
Elm_Object_Item *item, *before
Elm_Object_Item *item
Elm_Object_Item *before
Genlist genlist = before_item.widget
Evas_Smart_Cb cb = NULL
@ -195,7 +196,8 @@ cdef class GenlistItem(ObjectItem):
"""
cdef:
Elm_Object_Item *item, *after
Elm_Object_Item *item
Elm_Object_Item *after
Genlist genlist = after_item.widget
Evas_Smart_Cb cb = NULL

View File

@ -132,9 +132,9 @@ cdef class GenlistItemClass(object):
"item_style=%r, text_get_func=%s, content_get_func=%s, "
"state_get_func=%s, del_func=%s)>") % \
(type(self).__name__,
<unsigned long><void *>self,
<uintptr_t><void *>self,
PY_REFCOUNT(self),
<unsigned long>self.cls,
<uintptr_t>self.cls,
_ctouni(self.cls.item_style),
self._text_get_func,
self._content_get_func,

View File

@ -45,25 +45,27 @@ Elementary has the following styles for the hover widget:
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"clicked"`` - the user clicked the empty space in the hover to
dismiss
- ``"smart,changed"`` - a content object placed under the "smart"
policy was replaced to a new slot direction.
- ``clicked`` - the user clicked the empty space in the hover to
dismiss.
- ``dismissed`` - the user clicked the empty space in the hover to dismiss.
(since 1.8)
- ``smart,changed`` - a content object placed under the "smart"
policy was replaced to a new slot direction.
- ``focused`` - When the hover has received focus. (since 1.8)
- ``unfocused`` - When the hover has lost focus. (since 1.8)
Default content parts of the hover widget that you can use for are:
- ``"left"``
- ``"top-left"``
- ``"top"``
- ``"top-right"``
- ``"right"``
- ``"bottom-right"``
- ``"bottom"``
- ``"bottom-left"``
- ``"middle"``
- ``"smart"``
- ``left``
- ``top-left``
- ``top``
- ``top-right``
- ``right``
- ``bottom-right``
- ``bottom``
- ``bottom-left``
- ``middle``
- ``smart``
All directions may have contents at the same time, except for "smart".
This is a special placement hint and its use case depends of the
@ -222,6 +224,17 @@ cdef class Hover(LayoutClass):
def callback_clicked_del(self, func):
self._callback_del("clicked", func)
def callback_dismissed_add(self, func, *args, **kwargs):
"""the user clicked the empty space in the hover to dismiss
.. versionadded:: 1.8.1
"""
self._callback_add("dismissed", func, *args, **kwargs)
def callback_dismissed_del(self, func):
self._callback_del("dismissed", func)
def callback_smart_changed_add(self, func, *args, **kwargs):
"""a content object placed under the "smart" policy was replaced to a
new slot direction."""

View File

@ -35,19 +35,19 @@ hoversel menu (no more than 8), though is capable of many more.
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.button.Button`:
- ``"clicked"`` - the user clicked the hoversel button and popped up
the sel
- ``"selected"`` - an item in the hoversel list is selected. event_info
is the item
- ``"dismissed"`` - the hover is dismissed
- ``clicked`` - the user clicked the hoversel button and popped up
the sel
- ``selected`` - an item in the hoversel list is selected. event_info
is the item
- ``dismissed`` - the hover is dismissed
Default content parts of the hoversel widget that you can use for are:
- "icon" - An icon of the hoversel
- ``icon`` - An icon of the hoversel
Default text parts of the hoversel widget that you can use for are:
- "default" - Label of the hoversel
- ``default`` - Label of the hoversel
Enumerations
@ -73,6 +73,7 @@ Icon types
"""
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance
from efl.utils.conversions cimport _ctouni
@ -87,7 +88,7 @@ ELM_ICON_NONE = enums.ELM_ICON_NONE
ELM_ICON_FILE = enums.ELM_ICON_FILE
ELM_ICON_STANDARD = enums.ELM_ICON_STANDARD
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)
@ -192,8 +193,11 @@ cdef class HoverselItem(ObjectItem):
a3)
def __get__(self):
cdef const_char *icon_file, *icon_group
cdef Elm_Icon_Type icon_type
cdef:
const_char *icon_file
const_char *icon_group
Elm_Icon_Type icon_type
if self.item == NULL:
a1 = self.icon_file.decode("UTF-8")
a2 = self.icon_group.decode("UTF-8")
@ -217,8 +221,11 @@ cdef class HoverselItem(ObjectItem):
<const_char *>a2 if a2 is not None else NULL,
a3)
def icon_get(self):
cdef const_char *icon_file, *icon_group
cdef Elm_Icon_Type icon_type
cdef:
const_char *icon_file
const_char *icon_group
Elm_Icon_Type icon_type
if self.item == NULL:
a1 = self.icon_file.decode("UTF-8")
a2 = self.icon_group.decode("UTF-8")

View File

@ -46,55 +46,55 @@ Default images provided by Elementary's default theme are described below.
These are names for icons that were first intended to be used in
toolbars, but can be used in many other places too:
- ``"home"``
- ``"close"``
- ``"apps"``
- ``"arrow_up"``
- ``"arrow_down"``
- ``"arrow_left"``
- ``"arrow_right"``
- ``"chat"``
- ``"clock"``
- ``"delete"``
- ``"edit"``
- ``"refresh"``
- ``"folder"``
- ``"file"``
- ``home``
- ``close``
- ``apps``
- ``arrow_up``
- ``arrow_down``
- ``arrow_left``
- ``arrow_right``
- ``chat``
- ``clock``
- ``delete``
- ``edit``
- ``refresh``
- ``folder``
- ``file``
These are names for icons that were designed to be used in menus
(but again, you can use them anywhere else):
- ``"menu/home"``
- ``"menu/close"``
- ``"menu/apps"``
- ``"menu/arrow_up"``
- ``"menu/arrow_down"``
- ``"menu/arrow_left"``
- ``"menu/arrow_right"``
- ``"menu/chat"``
- ``"menu/clock"``
- ``"menu/delete"``
- ``"menu/edit"``
- ``"menu/refresh"``
- ``"menu/folder"``
- ``"menu/file"``
- ``menu/home``
- ``menu/close``
- ``menu/apps``
- ``menu/arrow_up``
- ``menu/arrow_down``
- ``menu/arrow_left``
- ``menu/arrow_right``
- ``menu/chat``
- ``menu/clock``
- ``menu/delete``
- ``menu/edit``
- ``menu/refresh``
- ``menu/folder``
- ``menu/file``
And these are names for some media player specific icons:
- ``"media_player/forward"``
- ``"media_player/info"``
- ``"media_player/next"``
- ``"media_player/pause"``
- ``"media_player/play"``
- ``"media_player/prev"``
- ``"media_player/rewind"``
- ``"media_player/stop"``
- ``media_player/forward``
- ``media_player/info``
- ``media_player/next``
- ``media_player/pause``
- ``media_player/play``
- ``media_player/prev``
- ``media_player/rewind``
- ``media_player/stop``
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.image.Image`:
- ``"thumb,done"`` - Setting :py:attr:`~Icon.thumb` has completed with success
- ``"thumb,error"`` - Setting :py:attr:`~Icon.thumb` has failed
- ``thumb,done`` - Setting :py:attr:`~Icon.thumb` has completed with success
- ``thumb,error`` - Setting :py:attr:`~Icon.thumb` has failed
Enumerations

View File

@ -43,14 +43,14 @@ and drop actions by setting :py:attr:`~Image.editable`.
Signals that you can add callbacks for are:
- ``"drop"`` - This is called when a user has dropped an image
typed object onto the object in question -- the
event info argument is the path to that image file
- ``"clicked"`` - This is called when a user has clicked the image
- ``"download,start"`` - remote url download has started
- ``"download,progress"`` - url download in progress
- ``"download,end"`` - remote url download has finished
- ``"download,error"`` - remote url download has finished with errors
- ``drop`` - This is called when a user has dropped an image
typed object onto the object in question -- the
event info argument is the path to that image file
- ``clicked`` - This is called when a user has clicked the image
- ``download,start`` - remote url download has started
- ``download,progress`` - url download in progress
- ``download,end`` - remote url download has finished
- ``download,error`` - remote url download has finished with errors
Enumerations
------------
@ -95,6 +95,7 @@ Image manipulation types
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance
from efl.utils.conversions cimport _ctouni
@ -111,7 +112,7 @@ ELM_IMAGE_FLIP_VERTICAL = enums.ELM_IMAGE_FLIP_VERTICAL
ELM_IMAGE_FLIP_TRANSPOSE = enums.ELM_IMAGE_FLIP_TRANSPOSE
ELM_IMAGE_FLIP_TRANSVERSE = enums.ELM_IMAGE_FLIP_TRANSVERSE
def _cb_string_conv(long addr):
def _cb_string_conv(uintptr_t addr):
cdef const_char *s = <const_char *>addr
return _ctouni(s) if s is not NULL else None
@ -131,7 +132,7 @@ class ImageProgressInfo(object):
self.now = 0
self.total = 0
def _image_download_progress_conv(long addr):
def _image_download_progress_conv(uintptr_t addr):
cdef Elm_Image_Progress *ip = <Elm_Image_Progress *>addr
ipi = ImageProgressInfo()
ipi.now = ip.now
@ -154,7 +155,7 @@ class ImageErrorInfo(object):
self.status = 0
self.open_error = False
def _image_download_error_conv(long addr):
def _image_download_error_conv(uintptr_t addr):
cdef Elm_Image_Error *ie = <Elm_Image_Error *>addr
iei = ImageErrorInfo()
iei.status = ie.status
@ -205,7 +206,10 @@ cdef class Image(Object):
raise RuntimeError("Could not set file.")
def __get__(self):
cdef const_char *filename, *group
cdef:
const_char *filename
const_char *group
elm_image_file_get(self.obj, &filename, &group)
return (_ctouni(filename), _ctouni(group))
@ -217,7 +221,10 @@ cdef class Image(Object):
<const_char *>group if group is not None else NULL):
raise RuntimeError("Could not set file.")
def file_get(self):
cdef const_char *filename, *group
cdef:
const_char *filename
const_char *group
elm_image_file_get(self.obj, &filename, &group)
return (_ctouni(filename), _ctouni(group))
@ -550,28 +557,44 @@ cdef class Image(Object):
self._callback_del_full("drop", _cb_string_conv, func)
def callback_download_start_add(self, func, *args, **kwargs):
"""This is called when you set a remote url and the download start"""
"""This is called when you set a remote url and the download start
.. versionadded:: 1.8
"""
self._callback_add("download,start", func, *args, **kwargs)
def callback_download_start_del(self, func):
self._callback_del("download,start", func)
def callback_download_progress_add(self, func, *args, **kwargs):
"""This is called while a remote image download is in progress"""
"""This is called while a remote image download is in progress
.. versionadded:: 1.8
"""
self._callback_add_full("download,progress", _image_download_progress_conv, func, *args, **kwargs)
def callback_download_progress_del(self, func):
self._callback_del_full("download,progress", _image_download_progress_conv, func)
def callback_download_done_add(self, func, *args, **kwargs):
"""This is called when you set a remote url and the download finish"""
"""This is called when you set a remote url and the download finish
.. versionadded:: 1.8
"""
self._callback_add("download,done", func, *args, **kwargs)
def callback_download_done_del(self, func):
self._callback_del("download,end", func)
def callback_download_error_add(self, func, *args, **kwargs):
"""This is called in case a download has errors"""
"""This is called in case a download has errors
.. versionadded:: 1.8
"""
self._callback_add_full("download,error", _image_download_error_conv, func, *args, **kwargs)
def callback_download_error_del(self, func):

View File

@ -44,29 +44,29 @@ with :py:class:`~efl.elementary.list.List`,
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"changed"`` - When the selected index item changes. ``event_info``
- ``changed`` - When the selected index item changes. ``event_info``
is the selected item's data.
- ``"delay,changed"`` - When the selected index item changes, but
- ``delay,changed`` - When the selected index item changes, but
after a small idling period. ``event_info`` is the selected
item's data.
- ``"selected"`` - When the user releases a mouse button and
- ``selected`` - When the user releases a mouse button and
selects an item. ``event_info`` is the selected item's data.
- ``"level,up"`` - when the user moves a finger from the first
- ``level,up`` - when the user moves a finger from the first
level to the second level
- ``"level,down"`` - when the user moves a finger from the second
- ``level,down`` - when the user moves a finger from the second
level to the first level
- ``"language,changed"`` - the program's language changed
- ``language,changed`` - the program's language changed
- ``focused`` - When the index has received focus. (since 1.8)
- ``unfocused`` - When the index has lost focus. (since 1.8)
The ``"delay,changed"`` event is so that it'll wait a small time
before actually reporting those events and, moreover, just the
last event happening on those time frames will actually be
reported.
The ``delay,changed`` event has a delay on change before the event is actually
reported and moreover just the last event happening on those time frames will
actually be reported.
"""
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -78,7 +78,7 @@ from object_item cimport _object_item_callback, _object_item_to_python, \
import traceback
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -34,13 +34,14 @@ to show what's behind it without destroying it. If this is done, the
visibility again.
There are three styles available in the default theme. These are:
- default: The inwin is sized to take over most of the window it's
placed in.
- minimal: The size of the inwin will be the minimum necessary to show
its contents.
- minimal_vertical: Horizontally, the inwin takes as much space as
possible, but it's sized vertically the most it needs to fit its
contents.
- default: The inwin is sized to take over most of the window it's
placed in.
- minimal: The size of the inwin will be the minimum necessary to show
its contents.
- minimal_vertical: Horizontally, the inwin takes as much space as
possible, but it's sized vertically the most it needs to fit its
contents.
"""

View File

@ -32,14 +32,14 @@ cut. Elementary provides several styles for this widget:
- default - No animation
- marker - Centers the text in the label and makes it bold by default
- slide_long - The entire text appears from the right of the screen and
slides until it disappears in the left of the screen(reappearing on
the right again).
slides until it disappears in the left of the screen(reappearing on
the right again).
- slide_short - The text appears in the left of the label and slides to
the right to show the overflow. When all of the text has been shown
the position is reset.
the right to show the overflow. When all of the text has been shown
the position is reset.
- slide_bounce - The text appears in the left of the label and slides to
the right to show the overflow. When all of the text has been shown
the animation reverses, moving the text to the left.
the right to show the overflow. When all of the text has been shown
the animation reverses, moving the text to the left.
Custom themes can of course invent new markup tags and style them any way
they like.

View File

@ -59,16 +59,16 @@ Smart callbacks one can listen to:
Available styles for it:
- ``"default"``
- ``default``
Default content parts of the list items that you can use for are:
- "start" - A start position object in the list item
- "end" - A end position object in the list item
- ``start`` - A start position object in the list item
- ``end`` - A end position object in the list item
Default text parts of the list items that you can use for are:
- "default" - label in the list item
- ``default`` - label in the list item
Scrollable Interface
====================
@ -159,6 +159,7 @@ Selection modes
"""
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni
@ -188,7 +189,7 @@ ELM_SCROLLER_POLICY_AUTO = enums.ELM_SCROLLER_POLICY_AUTO
ELM_SCROLLER_POLICY_ON = enums.ELM_SCROLLER_POLICY_ON
ELM_SCROLLER_POLICY_OFF = enums.ELM_SCROLLER_POLICY_OFF
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)
@ -197,7 +198,8 @@ cdef class ListItem(ObjectItem):
"""An item for the list widget."""
cdef:
object label
Evas_Object *icon_obj, *end_obj
Evas_Object *icon_obj
Evas_Object *end_obj
def __init__(self, label = None, evasObject icon = None,
evasObject end = None, callback = None, cb_data = None, *args, **kargs):
@ -238,9 +240,9 @@ cdef class ListItem(ObjectItem):
"callback=%r, cb_data=%r, "
"args=%r, kargs=%r)>") % (
type(self).__name__,
<unsigned long><void *>self,
<uintptr_t><void *>self,
PY_REFCOUNT(self),
<unsigned long><void *>self.item,
<uintptr_t><void *>self.item,
self.text,
getattr(self.part_content_get("icon"), "file", None),
getattr(self.part_content_get("end"), "file", None),

View File

@ -42,31 +42,31 @@ It supports some basic but yet nice features:
Signals you can listen to
=========================
- "clicked" - Called when a user has clicked the map without dragging around.
- "clicked,double" - Called when a user has double-clicked the map.
- "press" - This is called when a user has pressed down on the map.
- "longpressed" - This is called when a user has pressed down on the map
- ``clicked`` - Called when a user has clicked the map without dragging around.
- ``clicked,double`` - Called when a user has double-clicked the map.
- ``press`` - This is called when a user has pressed down on the map.
- ``longpressed`` - This is called when a user has pressed down on the map
for a long time without dragging around.
- "scroll" - the content has been scrolled (moved).
- "scroll,drag,start" - dragging the contents around has started.
- "scroll,drag,stop" - dragging the contents around has stopped.
- "scroll,anim,start" - scrolling animation has started.
- "scroll,anim,stop" - scrolling animation has stopped.
- "zoom,start" - Zoom animation started.
- "zoom,stop" - Zoom animation stopped.
- "zoom,change" - Zoom changed when using an auto zoom mode.
- "tile,load" - A map tile image load begins.
- "tile,loaded" - A map tile image load ends.
- "tile,loaded,fail" - A map tile image load fails.
- "route,load" - Route request begins.
- "route,loaded" - Route request ends.
- "route,loaded,fail" - Route request fails.
- "name,load" - Name request begins.
- "name,loaded" - Name request ends.
- "name,loaded,fail" - Name request fails.
- "overlay,clicked" - A overlay is clicked.
- "loaded" - when a map is finally loaded.
- "language,changed" - the program's language changed
- ``scroll`` - the content has been scrolled (moved).
- ``scroll,drag,start`` - dragging the contents around has started.
- ``scroll,drag,stop`` - dragging the contents around has stopped.
- ``scroll,anim,start`` - scrolling animation has started.
- ``scroll,anim,stop`` - scrolling animation has stopped.
- ``zoom,start`` - Zoom animation started.
- ``zoom,stop`` - Zoom animation stopped.
- ``zoom,change`` - Zoom changed when using an auto zoom mode.
- ``tile,load`` - A map tile image load begins.
- ``tile,loaded`` - A map tile image load ends.
- ``tile,loaded,fail`` - A map tile image load fails.
- ``route,load`` - Route request begins.
- ``route,loaded`` - Route request ends.
- ``route,loaded,fail`` - Route request fails.
- ``name,load`` - Name request begins.
- ``name,loaded`` - Name request ends.
- ``name,loaded,fail`` - Name request fails.
- ``overlay,clicked`` - A overlay is clicked.
- ``loaded`` - when a map is finally loaded.
- ``language,changed`` - the program's language changed
- ``focused`` - When the map has received focus. (since 1.8)
- ``unfocused`` - When the map has lost focus. (since 1.8)

View File

@ -30,6 +30,10 @@ when you have a complex interface, with a lot of elements, and will
need to resize or move it frequently (the content object and its
children).
Default content parts of the mapbuf widget that you can use are:
- ``default`` - The main content of the mapbuf
"""
from efl.eo cimport _object_mapping_register

View File

@ -36,11 +36,11 @@ Signals that you can add callbacks for are:
Default content parts of the menu items that you can use for are:
- "default" - A main content of the menu item
- ``default`` - A main content of the menu item
Default text parts of the menu items that you can use for are:
- "default" - label in the menu item
- ``default`` - label in the menu item
"""
@ -79,8 +79,10 @@ cdef class MenuItem(ObjectItem):
def add_to(self, Menu menu not None):
# TODO: document this
cdef Elm_Object_Item *item, *parent_obj = NULL
cdef Evas_Smart_Cb cb = NULL
cdef:
Elm_Object_Item *item
Elm_Object_Item *parent_obj = NULL
Evas_Smart_Cb cb = NULL
if self.cb_func is not None:
cb = _object_item_callback2

View File

@ -34,33 +34,36 @@ group of addresses, each of which is an item that can be clicked for
further actions.
This widget emits the following signals, besides the ones sent from
:py:class:`LayoutClass<efl.elementary.layout_class.LayoutClass>`:
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``item,selected`` - this is called when an item is selected by
api, user interaction, and etc. this is also called when a
user press back space while cursor is on the first field of
entry.
api, user interaction, and etc. this is also called when a
user press back space while cursor is on the first field of
entry.
- ``item,added`` - when a new multi-button entry item is added.
- ``item,deleted`` - when a multi-button entry item is deleted.
- ``item,clicked`` - this is called when an item is clicked by user
interaction. Both "item,selected" and "item,clicked" are needed.
interaction. Both "item,selected" and "item,clicked" are needed.
- ``clicked`` - when multi-button entry is clicked.
- ``focused`` - when multi-button entry is focused.
- ``unfocused`` - when multi-button entry is unfocused.
- ``expanded`` - when multi-button entry is expanded.
- ``contracted`` - when multi-button entry is contracted.
- ``expand,state,changed`` - when shrink mode state of
multi-button entry is changed.
multi-button entry is changed.
Default text parts of the multibuttonentry widget that you can use for are:
- "default" - A label of the multibuttonentry
- ``default`` - A label of the multibuttonentry
Default text parts of the multibuttonentry items that you can use for are:
- "default" - A label of the multibuttonentry item
- ``default`` - A label of the multibuttonentry item
"""
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni
@ -113,8 +116,8 @@ cdef class MultiButtonEntryItem(ObjectItem):
def __repr__(self):
return ("<%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
"label=%r, callback=%r, args=%r, kargs=%s)>") % \
(self.__class__.__name__, <unsigned long><void *>self,
PY_REFCOUNT(self), <unsigned long><void *>self.item,
(self.__class__.__name__, <uintptr_t><void *>self,
PY_REFCOUNT(self), <uintptr_t><void *>self.item,
self.text_get(), self.cb_func, self.args, self.kwargs)
def append_to(self, MultiButtonEntry mbe not None):

View File

@ -44,20 +44,16 @@ Becase this widget is a layout, one places content on those areas by using
:py:func:`~efl.elementary.object.Object.part_content_set` on the right swallow
part names expected for each, which are:
- ``"default"`` - The main content of the current page
- ``"icon"`` - An icon in the title area of the current page
- ``"prev_btn"`` - A button of the current page to go to the
previous page
- ``"next_btn"`` - A button of the current page to go to the next
page
- ``default`` - The main content of the current page
- ``icon`` - An icon in the title area of the current page
- ``prev_btn`` - A button of the current page to go to the previous page
- ``next_btn`` - A button of the current page to go to the next page
For text, :py:func:`~efl.elementary.object.Object.part_text_set` will work here
on:
- ``"default"`` - Title label in the title area of the current
page
- ``"subtitle"`` - Sub-title label in the title area of the
current page
- ``default`` - Title label in the title area of the current page
- ``subtitle`` - Sub-title label in the title area of the current page
Most of those content objects can be passed at the time of an item
creation (see :py:meth:`~NaviframeItem.push_to`).
@ -66,17 +62,16 @@ Naviframe items can have different styles, which affect the
transition between views, for example. On the default theme, two of
them are supported:
- ``"basic"`` - views are switched sliding horizontally, one after
the other
- ``"overlap"`` - like the previous one, but the previous view stays
at its place and is ovelapped by the new
- ``basic`` - views are switched sliding horizontally, one after the other
- ``overlap`` - like the previous one, but the previous view stays at its place
and is ovelapped by the new
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``transition,finished`` - When the transition is finished in
changing the item
- ``transition,finished`` - When the transition is finished in changing the
item
- ``title,clicked`` - User clicked title area
- ``focused`` - When the naviframe has received focus. (since 1.8)
- ``unfocused`` - When the naviframe has lost focus. (since 1.8)
@ -114,8 +109,11 @@ cdef class NaviframeItem(ObjectItem):
"""An item for the Naviframe widget."""
cdef object label, item_style
cdef Evas_Object *prev_btn, *next_btn, *item_content
cdef:
object label, item_style
Evas_Object *prev_btn
Evas_Object *next_btn
Evas_Object *item_content
def __cinit__(self):
self.prev_btn = NULL

View File

@ -30,12 +30,12 @@ was set on it, it will **automatically** get hidden after that time.
Signals that you can add callbacks for are:
- "timeout" - when timeout happens on notify and it's hidden
- "block,clicked" - when a click outside of the notify happens
- ``timeout`` - when timeout happens on notify and it's hidden
- ``block,clicked`` - when a click outside of the notify happens
Default content parts of the notify widget that you can use are:
- ``"default"`` - The main content of the notify
- ``default`` - The main content of the notify
Enumerations

View File

@ -78,6 +78,29 @@ Focus direction
Focus next
.. data:: ELM_FOCUS_UP
Focus up
.. versionadded:: 1.8.1
.. data:: ELM_FOCUS_DOWN
Focus down
.. versionadded:: 1.8.1
.. data:: ELM_FOCUS_RIGHT
Focus right
.. versionadded:: 1.8.1
.. data:: ELM_FOCUS_LEFT
Focus left
.. versionadded:: 1.8.1
.. _Elm_Input_Event_Type:
@ -158,7 +181,7 @@ XDND action
Defines the kind of action associated with the drop data if for XDND
:since: 1.8
.. versionadded:: 1.8
.. data:: ELM_XDND_ACTION_UNKNOWN
@ -198,6 +221,7 @@ Defines the kind of action associated with the drop data if for XDND
from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyObject_GetAttr, \
PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyObject_CheckBuffer, \
PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni, eina_list_objects_to_python_list
@ -220,6 +244,10 @@ cimport enums
ELM_FOCUS_PREVIOUS = enums.ELM_FOCUS_PREVIOUS
ELM_FOCUS_NEXT = enums.ELM_FOCUS_NEXT
ELM_FOCUS_UP = enums.ELM_FOCUS_UP
ELM_FOCUS_DOWN = enums.ELM_FOCUS_DOWN
ELM_FOCUS_RIGHT = enums.ELM_FOCUS_RIGHT
ELM_FOCUS_LEFT = enums.ELM_FOCUS_LEFT
EVAS_CALLBACK_KEY_DOWN = evasenums.EVAS_CALLBACK_KEY_DOWN
EVAS_CALLBACK_KEY_UP = evasenums.EVAS_CALLBACK_KEY_UP
@ -263,7 +291,7 @@ cdef void _object_callback(void *data,
if event_conv is None:
func(obj, *args, **kargs)
else:
ei = event_conv(<long>event_info)
ei = event_conv(<uintptr_t>event_info)
func(obj, ei, *args, **kargs)
except:
traceback.print_exc()
@ -1757,7 +1785,7 @@ cdef class Object(evasObject):
:return: Address of saved Evas_Object
"""
return <long>self.obj
return <uintptr_t>self.obj
#
# Copy and Paste

View File

@ -16,6 +16,7 @@
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni
@ -144,8 +145,8 @@ cdef class ObjectItem(object):
def __repr__(self):
return ("<%s object (ObjectItem) at %#x (obj=%#x, refcount=%d, widget=%s)>") % (
type(self).__name__,
<unsigned long><void *>self,
<unsigned long>self.item,
<uintptr_t><void *>self,
<uintptr_t>self.item,
PY_REFCOUNT(self),
repr(object_from_instance(elm_object_item_widget_get(self.item)))
)

View File

@ -35,13 +35,14 @@ Orientations are as follows:
- ELM_PANEL_ORIENT_BOTTOM
This widget emits the following signals, besides the ones sent from
:py:class:`LayoutClass<efl.elementary.layout_class.LayoutClass>`:
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``focused`` - When the panel has received focus. (since 1.8)
- ``unfocused`` - When the panel has lost focus. (since 1.8)
Default content parts of the panel widget that you can use for are:
- "default" - A content of the panel
- ``default`` - A content of the panel
Enumerations

View File

@ -32,19 +32,21 @@ proportion can be customized (homogeneous by default).
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"press"`` - The panes has been pressed (button wasn't released yet).
- ``"unpressed"`` - The panes was released after being pressed.
- ``"clicked"`` - The panes has been clicked.
- ``"clicked,double"`` - The panes has been double clicked.
- ``press`` - The panes has been pressed (button wasn't released yet).
- ``unpressed`` - The panes was released after being pressed.
- ``clicked`` - The panes has been clicked.
- ``clicked,double`` - The panes has been double clicked.
Available styles for it:
- ``"default"``
- ``default``
Default content parts of the panes widget that you can use are:
- "left" - A leftside content of the panes
- "right" - A rightside content of the panes
- ``left`` - A leftside content of the panes
- ``right`` - A rightside content of the panes
- ``top`` - A top content of the vertical panes
- ``bottom`` - A bottom content of the vertical panes
If panes are displayed vertically, left content will be displayed on top.

View File

@ -28,16 +28,16 @@ ex., a person's image (contact).
Simple, yet with a very specific purpose. It has a decorative frame
around the inner image itself, on the default theme.
This widget relies on an internal :py:class:`~efl.elementary.icon.Icon`, so that
the APIs of these two widgets are similar (drag and drop is also possible here,
for example).
This widget relies on an internal :py:class:`~efl.elementary.icon.Icon`, so
that the APIs of these two widgets are similar (drag and drop is also possible
here, for example).
Signals that you can add callbacks for are:
- ``"clicked"`` - This is called when a user has clicked the photo
- ``"drag,start"`` - One has started dragging the inner image out of the
photo's frame
- ``"drag,end"`` - One has dropped the dragged image somewhere
- ``clicked`` - This is called when a user has clicked the photo
- ``drag,start`` - One has started dragging the inner image out of the photo's
frame
- ``drag,end`` - One has dropped the dragged image somewhere
"""

View File

@ -29,31 +29,31 @@ evas loader features in the jpeg loader).
Signals that you can add callbacks for are:
- "clicked" - This is called when a user has clicked the photo without
dragging around.
- "press" - This is called when a user has pressed down on the photo.
- "longpressed" - This is called when a user has pressed down on the
photo for a long time without dragging around.
- "clicked,double" - This is called when a user has double-clicked the
photo.
- "load" - Photo load begins.
- "loaded" - This is called when the image file load is complete for
the first view (low resolution blurry version).
- "load,detail" - Photo detailed data load begins.
- "loaded,detail" - This is called when the image file load is
complete for the detailed image data (full resolution needed).
- "zoom,start" - Zoom animation started.
- "zoom,stop" - Zoom animation stopped.
- "zoom,change" - Zoom changed when using an auto zoom mode.
- "scroll" - the content has been scrolled (moved)
- "scroll,anim,start" - scrolling animation has started
- "scroll,anim,stop" - scrolling animation has stopped
- "scroll,drag,start" - dragging the contents around has started
- "scroll,drag,stop" - dragging the contents around has stopped
- "download,start" - remote url download has started
- "download,progress" - url download in progress
- "download,end" - remote url download has finished
- "download,error" - remote url download has finished with errors
- ``clicked`` - This is called when a user has clicked the photo without
dragging around.
- ``press`` - This is called when a user has pressed down on the photo.
- ``longpressed`` - This is called when a user has pressed down on the
photo for a long time without dragging around.
- ``clicked,double`` - This is called when a user has double-clicked the
photo.
- ``load`` - Photo load begins.
- ``loaded`` - This is called when the image file load is complete for
the first view (low resolution blurry version).
- ``load,detail`` - Photo detailed data load begins.
- ``loaded,detail`` - This is called when the image file load is
complete for the detailed image data (full resolution needed).
- ``zoom,start`` - Zoom animation started.
- ``zoom,stop`` - Zoom animation stopped.
- ``zoom,change`` - Zoom changed when using an auto zoom mode.
- ``scroll`` - the content has been scrolled (moved)
- ``scroll,anim,start`` - scrolling animation has started
- ``scroll,anim,stop`` - scrolling animation has stopped
- ``scroll,drag,start`` - dragging the contents around has started
- ``scroll,drag,stop`` - dragging the contents around has stopped
- ``download,start`` - remote url download has started
- ``download,progress`` - url download in progress
- ``download,end`` - remote url download has finished
- ``download,error`` - remote url download has finished with errors
- ``focused`` - When the photocam has received focus. (since 1.8)
- ``unfocused`` - When the photocam has lost focus. (since 1.8)
@ -98,6 +98,7 @@ Photocam zoom modes
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register
from efl.utils.conversions cimport _ctouni
@ -135,7 +136,7 @@ class PhotocamProgressInfo(object):
self.now = 0
self.total = 0
def _photocam_download_progress_conv(long addr):
def _photocam_download_progress_conv(uintptr_t addr):
cdef Elm_Photocam_Progress *pp = <Elm_Photocam_Progress *>addr
ppi = PhotocamProgressInfo()
ppi.now = pp.now
@ -158,7 +159,7 @@ class PhotocamErrorInfo(object):
self.status = 0
self.open_error = False
def _photocam_download_error_conv(long addr):
def _photocam_download_error_conv(uintptr_t addr):
cdef Elm_Photocam_Error *pe = <Elm_Photocam_Error *>addr
pei = PhotocamErrorInfo()
pei.status = pe.status
@ -511,28 +512,44 @@ cdef class Photocam(Object):
self._callback_del("scroll,drag,stop", func)
def callback_download_start_add(self, func, *args, **kwargs):
"""This is called when you set a remote url and the download start"""
"""This is called when you set a remote url and the download start
.. versionadded:: 1.8
"""
self._callback_add("download,start", func, *args, **kwargs)
def callback_download_start_del(self, func):
self._callback_del("download,start", func)
def callback_download_progress_add(self, func, *args, **kwargs):
"""This is called while a remote image download is in progress"""
"""This is called while a remote image download is in progress
.. versionadded:: 1.8
"""
self._callback_add_full("download,progress", _photocam_download_progress_conv, func, *args, **kwargs)
def callback_download_progress_del(self, func):
self._callback_del_full("download,progress", _photocam_download_progress_conv, func)
def callback_download_done_add(self, func, *args, **kwargs):
"""This is called when you set a remote url and the download finish"""
"""This is called when you set a remote url and the download finish
.. versionadded:: 1.8
"""
self._callback_add("download,done", func, *args, **kwargs)
def callback_download_done_del(self, func):
self._callback_del("download,end", func)
def callback_download_error_add(self, func, *args, **kwargs):
"""This is called in case a download has errors"""
"""This is called in case a download has errors
.. versionadded:: 1.8
"""
self._callback_add_full("download,error", _photocam_download_error_conv, func, *args, **kwargs)
def callback_download_error_del(self, func):

View File

@ -26,7 +26,7 @@ This widget emits the following signals:
- ``clicked`` - the user clicked the image (press/release).
- ``image,deleted`` - the server side was deleted.
- ``image,resized`` - the server side was resized. The ``event_info`` parameter
of the callback will be ``Evas_Coord_Size`` (two integers).
of the callback will be ``Evas_Coord_Size`` (two integers).
.. note::

View File

@ -87,20 +87,28 @@ Signals that you can add callbacks for are:
Styles available for Popup
- "default"
- ``default``
Default contents parts of the popup items that you can use are:
- ``default`` -Item's icon
Default text parts of the popup items that you can use are:
- ``default`` - Item's label
Default contents parts of the popup widget that you can use for are:
- "default" - The content of the popup
- "title,icon" - Title area's icon
- "button1" - 1st button of the action area
- "button2" - 2nd button of the action area
- "button3" - 3rd button of the action area
- ``default`` - The content of the popup
- ``title,icon`` - Title area's icon
- ``button1`` - 1st button of the action area
- ``button2`` - 2nd button of the action area
- ``button3`` - 3rd button of the action area
Default text parts of the popup widget that you can use for are:
- "title,text" - This operates on Title area's label
- "default" - content-text set in the content area of the widget
- ``title,text`` - This operates on Title area's label
- ``default`` - content-text set in the content area of the widget
Enumerations
@ -172,6 +180,7 @@ Wrap modes
"""
from cpython cimport PyUnicode_AsUTF8String, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni
@ -255,9 +264,9 @@ cdef class PopupItem(ObjectItem):
return ("<%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
"item_class=%s, func=%s, item_data=%r)>") % \
(self.__class__.__name__,
<unsigned long><void*>self,
<uintptr_t><void*>self,
PY_REFCOUNT(self),
<unsigned long>self.item,
<uintptr_t>self.item,
self.cb_func,
self.args)

View File

@ -54,23 +54,23 @@ This widget emits the following signals, besides the ones sent from
This widget has the following styles:
- ``default``
- ``wheel`` (simple style, no text, no progression, only "pulse"
effect is available)
- ``double`` (style with two independent progress indicators)
- ``default``
- ``wheel`` (simple style, no text, no progression, only "pulse"
effect is available)
- ``double`` (style with two independent progress indicators)
Default text parts of the progressbar widget that you can use for are:
- ``default`` - Label of the progressbar
- ``default`` - Label of the progressbar
Default content parts of the progressbar widget that you can use for are:
- ``icon`` - An icon of the progressbar
- ``icon`` - An icon of the progressbar
Default part names for the "recording" style:
- ``elm.cur.progressbar`` - The "main" indicator bar
- ``elm.cur.progressbar1`` - The "secondary" indicator bar
- ``elm.cur.progressbar`` - The "main" indicator bar
- ``elm.cur.progressbar1`` - The "secondary" indicator bar
"""

View File

@ -55,11 +55,11 @@ This widget emits the following signals, besides the ones sent from
Default text parts of the radio widget that you can use for are:
- "default" - Label of the radio
- ``default`` - Label of the radio
Default content parts of the radio widget that you can use for are:
- "icon" - An icon of the radio
- ``icon`` - An icon of the radio
"""

View File

@ -31,38 +31,38 @@ object that is contained in the scroller. The scroller will always have
a small minimum size by default as it won't be limited by the contents
of the scroller.
This widget inherits from :py:class:`efl.elementary.layout_class.LayoutClass`,
This widget inherits from :py:class:`~efl.elementary.layout_class.LayoutClass`,
so that all the functions acting on it also work for scroller objects.
This widget emits the following signals, besides the ones sent from
:py:class:`efl.elementary.layout_class.LayoutClass`
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- "edge,left" - the left edge of the content has been reached
- "edge,right" - the right edge of the content has been reached
- "edge,top" - the top edge of the content has been reached
- "edge,bottom" - the bottom edge of the content has been reached
- "scroll" - the content has been scrolled (moved)
- "scroll,left" - the content has been scrolled (moved) leftwards
- "scroll,right" - the content has been scrolled (moved) rightwards
- "scroll,up" - the content has been scrolled (moved) upwards
- "scroll,down" - the content has been scrolled (moved) downwards
- "scroll,anim,start" - scrolling animation has started
- "scroll,anim,stop" - scrolling animation has stopped
- "scroll,drag,start" - dragging the contents around has started
- "scroll,drag,stop" - dragging the contents around has stopped
- "vbar,drag" - the vertical scroll bar has been dragged
- "vbar,press" - the vertical scroll bar has been pressed
- "vbar,unpress" - the vertical scroll bar has been unpressed
- "hbar,drag" - the horizontal scroll bar has been dragged
- "hbar,press" - the horizontal scroll bar has been pressed
- "hbar,unpress" - the horizontal scroll bar has been unpressed
- ``edge,left`` - the left edge of the content has been reached
- ``edge,right`` - the right edge of the content has been reached
- ``edge,top`` - the top edge of the content has been reached
- ``edge,bottom`` - the bottom edge of the content has been reached
- ``scroll`` - the content has been scrolled (moved)
- ``scroll,left`` - the content has been scrolled (moved) leftwards
- ``scroll,right`` - the content has been scrolled (moved) rightwards
- ``scroll,up`` - the content has been scrolled (moved) upwards
- ``scroll,down`` - the content has been scrolled (moved) downwards
- ``scroll,anim,start`` - scrolling animation has started
- ``scroll,anim,stop`` - scrolling animation has stopped
- ``scroll,drag,start`` - dragging the contents around has started
- ``scroll,drag,stop`` - dragging the contents around has stopped
- ``vbar,drag`` - the vertical scroll bar has been dragged
- ``vbar,press`` - the vertical scroll bar has been pressed
- ``vbar,unpress`` - the vertical scroll bar has been unpressed
- ``hbar,drag`` - the horizontal scroll bar has been dragged
- ``hbar,press`` - the horizontal scroll bar has been pressed
- ``hbar,unpress`` - the horizontal scroll bar has been unpressed
- ``scroll,page,changed`` - the visible page has changed
- ``focused`` - When the scroller has received focus. (since 1.8)
- ``unfocused`` - When the scroller has lost focus. (since 1.8)
Default content parts of the scroller widget that you can use for are:
- "default" - A content of the scroller
- ``default`` - A content of the scroller
.. note:: The "scroll,anim,*" and "scroll,drag,*" signals are only emitted by
user intervention.

View File

@ -35,25 +35,26 @@ other widget.
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"changed"`` - When the user clicks on a segment item which is not
- ``changed`` - When the user clicks on a segment item which is not
previously selected and get selected. The event_info parameter is the
segment item.
Available styles for it:
- ``"default"``
- ``default``
Default content parts of the segment control items that you can use for are:
- "icon" - An icon in a segment control item
- ``icon`` - An icon in a segment control item
Default text parts of the segment control items that you can use for are:
- "default" - Title label in a segment control item
- ``default`` - Title label in a segment control item
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance
from efl.utils.conversions cimport _ctouni
@ -62,7 +63,7 @@ from layout_class cimport LayoutClass
from object_item cimport _object_item_to_python
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -48,28 +48,28 @@ This widget emits the following signals, besides the ones sent from
- ``changed`` - Whenever the slider value is changed by the user.
- ``slider,drag,start`` - dragging the slider indicator around has
started.
started.
- ``slider,drag,stop`` - dragging the slider indicator around has
stopped.
stopped.
- ``delay,changed`` - A short time after the value is changed by
the user. This will be called only when the user stops dragging
for a very short period or when they release their finger/mouse,
so it avoids possibly expensive reactions to the value change.
the user. This will be called only when the user stops dragging
for a very short period or when they release their finger/mouse,
so it avoids possibly expensive reactions to the value change.
- ``focused`` - When the slider has received focus. (since 1.8)
- ``unfocused`` - When the slider has lost focus. (since 1.8)
Available styles for it:
- ``"default"``
- ``default``
Default content parts of the slider widget that you can use for are:
- "icon" - An icon of the slider
- "end" - A end part content of the slider
- ``icon`` - An icon of the slider
- ``end`` - A end part content of the slider
Default text parts of the slider widget that you can use for are:
- "default" - Label of the slider
- ``default`` - Label of the slider
"""

View File

@ -67,18 +67,19 @@ cached **before** and **after** the current item, in the widget's
item list.
This widget emits the following signals, besides the ones sent from
:py:class:`efl.elementary.layout_class.LayoutClass`:
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"changed"`` - when the slideshow switches its view to a new item.
event_info parameter in callback contains the current visible item
- ``"transition,end"`` - when a slide transition ends. event_info
parameter in callback contains the current visible item
- ``changed`` - when the slideshow switches its view to a new item.
event_info parameter in callback contains the current visible item
- ``transition,end`` - when a slide transition ends. event_info
parameter in callback contains the current visible item
- ``focused`` - When the slideshow has received focus. (since 1.8)
- ``unfocused`` - When the slideshow has lost focus. (since 1.8)
"""
from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT
from efl.utils.conversions cimport _ctouni
@ -90,7 +91,7 @@ from layout_class cimport LayoutClass
import traceback
from object_item cimport _object_item_to_python, _object_item_list_to_python
def _cb_object_item_conv(long addr):
def _cb_object_item_conv(uintptr_t addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)
@ -211,9 +212,9 @@ cdef class SlideshowItemClass (object):
return ("<%s(%#x, refcount=%d, Elm_Slideshow_Item_Class=%#x, "
"get_func=%s, del_func=%s)>") % \
(type(self).__name__,
<unsigned long><void *>self,
<uintptr_t><void *>self,
PY_REFCOUNT(self),
<unsigned long>&self.obj,
<uintptr_t>&self.obj,
self._get_func,
self._del_func)
@ -255,9 +256,9 @@ cdef class SlideshowItem(ObjectItem):
return ("<%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
"item_class=%s, item_data=%r)>") % \
(type(self).__name__,
<unsigned long><void*>self,
<uintptr_t><void*>self,
PY_REFCOUNT(self),
<unsigned long>self.obj,
<uintptr_t>self.obj,
type(self.cls).__name__,
self.args)

View File

@ -39,19 +39,19 @@ It also allows specific values to be replaced by pre-defined labels.
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"changed"`` - Whenever the spinner value is changed.
- ``"delay,changed"`` - A short time after the value is changed by
the user. This will be called only when the user stops dragging
for a very short period or when they release their finger/mouse,
so it avoids possibly expensive reactions to the value change.
- ``changed`` - Whenever the spinner value is changed.
- ``delay,changed`` - A short time after the value is changed by
the user. This will be called only when the user stops dragging
for a very short period or when they release their finger/mouse,
so it avoids possibly expensive reactions to the value change.
- ``language,changed`` - the program's language changed
- ``focused`` - When the spinner has received focus. (since 1.8)
- ``unfocused`` - When the spinner has lost focus. (since 1.8)
Available styles for it:
- ``"default"``: Default style
- ``"vertical"``: up/down buttons at the right side and text left aligned.
- ``default``: Default style
- ``vertical``: up/down buttons at the right side and text left aligned.
"""

View File

@ -86,6 +86,7 @@ overlays. Don't use this unless you really know what you are doing.
"""
from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF
from libc.stdint cimport uintptr_t
from efl.eo cimport PY_REFCOUNT
from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list
@ -101,7 +102,7 @@ cdef class Theme(object):
def __repr__(self):
return "<%s object at %#x (refcount=%d, order=%s, overlay_list=%s, extension_list=%s)>" % (
type(self).__name__,
<unsigned long>self.th,
<uintptr_t>self.th,
PY_REFCOUNT(self),
_ctouni(elm_theme_get(self.th)),
eina_list_strings_to_python_list(elm_theme_overlay_list_get(self.th)),

View File

@ -41,21 +41,21 @@ configuration options.
This widget emits the following signals:
- ``"clicked"`` - This is called when a user has clicked the
thumbnail object without dragging it around.
- ``"clicked,double"`` - This is called when a user has double-clicked
the thumbnail object.
- ``"press"`` - This is called when a user has pressed down over the
thumbnail object.
- ``"generate,start"`` - The thumbnail generation has started.
- ``"generate,stop"`` - The generation process has stopped.
- ``"generate,error"`` - The thumbnail generation failed.
- ``"load,error"`` - The thumbnail image loading failed.
- ``clicked`` - This is called when a user has clicked the
thumbnail object without dragging it around.
- ``clicked,double`` - This is called when a user has double-clicked
the thumbnail object.
- ``press`` - This is called when a user has pressed down over the
thumbnail object.
- ``generate,start`` - The thumbnail generation has started.
- ``generate,stop`` - The generation process has stopped.
- ``generate,error`` - The thumbnail generation failed.
- ``load,error`` - The thumbnail image loading failed.
Available styles:
- ``"default"``
- ``"noframe"``
- ``default``
- ``noframe``
Enumerations
@ -187,6 +187,28 @@ ELM_THUMB_ANIMATION_LOOP = enums.ELM_THUMB_ANIMATION_LOOP
ELM_THUMB_ANIMATION_STOP = enums.ELM_THUMB_ANIMATION_STOP
ELM_THUMB_ANIMATION_LAST = enums.ELM_THUMB_ANIMATION_LAST
ETHUMB_THUMB_NORMAL = enums.ETHUMB_THUMB_NORMAL
ETHUMB_THUMB_LARGE = enums.ETHUMB_THUMB_LARGE
ETHUMB_THUMB_FDO = enums.ETHUMB_THUMB_FDO
ETHUMB_THUMB_JPEG = enums.ETHUMB_THUMB_JPEG
ETHUMB_THUMB_EET = enums.ETHUMB_THUMB_EET
ETHUMB_THUMB_KEEP_ASPECT = enums.ETHUMB_THUMB_KEEP_ASPECT
ETHUMB_THUMB_IGNORE_ASPECT = enums.ETHUMB_THUMB_IGNORE_ASPECT
ETHUMB_THUMB_CROP = enums.ETHUMB_THUMB_CROP
ETHUMB_THUMB_ORIENT_NONE = enums.ETHUMB_THUMB_ORIENT_NONE
ETHUMB_THUMB_ROTATE_90_CW = enums.ETHUMB_THUMB_ROTATE_90_CW
ETHUMB_THUMB_ROTATE_180 = enums.ETHUMB_THUMB_ROTATE_180
ETHUMB_THUMB_ROTATE_90_CCW = enums.ETHUMB_THUMB_ROTATE_90_CCW
ETHUMB_THUMB_FLIP_HORIZONTAL = enums.ETHUMB_THUMB_FLIP_HORIZONTAL
ETHUMB_THUMB_FLIP_VERTICAL = enums.ETHUMB_THUMB_FLIP_VERTICAL
ETHUMB_THUMB_FLIP_TRANSPOSE = enums.ETHUMB_THUMB_FLIP_TRANSPOSE
ETHUMB_THUMB_FLIP_TRANSVERSE = enums.ETHUMB_THUMB_FLIP_TRANSVERSE
ETHUMB_THUMB_ORIENT_ORIGINAL = enums.ETHUMB_THUMB_ORIENT_ORIGINAL
cdef class Thumb(Object):
"""This is the class that actually implements the widget."""
@ -236,7 +258,10 @@ cdef class Thumb(Object):
<const_char *>file_name if file_name is not None else NULL,
<const_char *>key if key is not None else NULL)
def __get__(self):
cdef const_char *file_name, *key
cdef:
const_char *file_name
const_char *key
elm_thumb_file_get(self.obj, &file_name, &key)
return(_ctouni(file_name), _ctouni(key))
@ -255,7 +280,10 @@ cdef class Thumb(Object):
"""
def __get__(self):
cdef const_char *path, *key
cdef:
const_char *path
const_char *key
elm_thumb_path_get(self.obj, &path, &key)
return(_ctouni(path), _ctouni(key))

View File

@ -33,20 +33,20 @@ Items can have multiple states, or show menus when selected by the user.
Smart callbacks one can listen to:
- "clicked" - when the user clicks on a toolbar item and becomes selected.
- "longpressed" - when the toolbar is pressed for a certain amount of time.
- "language,changed" - when the program language changes.
- ``clicked`` - when the user clicks on a toolbar item and becomes selected.
- ``longpressed`` - when the toolbar is pressed for a certain amount of time.
- ``language,changed`` - when the program language changes.
- ``focused`` - When the toolbar has received focus. (since 1.8)
- ``unfocused`` - When the toolbar has lost focus. (since 1.8)
Available styles for it:
- ``"default"``
- ``"transparent"`` - no background or shadow, just show the content
- ``default``
- ``transparent`` - no background or shadow, just show the content
Default text parts of the toolbar items that you can use for are:
- "default" - label of the toolbar item
- ``default`` - label of the toolbar item
Scrollable Interface
====================

View File

@ -274,18 +274,18 @@ cdef class Player(LayoutClass):
The player widget emits the following signals, besides the ones
sent from :py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``"forward,clicked"`` - the user clicked the forward button.
- ``"info,clicked"`` - the user clicked the info button.
- ``"next,clicked"`` - the user clicked the next button.
- ``"pause,clicked"`` - the user clicked the pause button.
- ``"play,clicked"`` - the user clicked the play button.
- ``"prev,clicked"`` - the user clicked the prev button.
- ``"rewind,clicked"`` - the user clicked the rewind button.
- ``"stop,clicked"`` - the user clicked the stop button.
- ``forward,clicked`` - the user clicked the forward button.
- ``info,clicked`` - the user clicked the info button.
- ``next,clicked`` - the user clicked the next button.
- ``pause,clicked`` - the user clicked the pause button.
- ``play,clicked`` - the user clicked the play button.
- ``prev,clicked`` - the user clicked the prev button.
- ``rewind,clicked`` - the user clicked the rewind button.
- ``stop,clicked`` - the user clicked the stop button.
Default content parts of the player widget that you can use for are:
- "video" - A video of the player
- ``video`` - A video of the player
"""

View File

@ -41,8 +41,8 @@ cdef extern from "Elementary.h":
# TODO: void elm_web_dialog_file_selector_hook_set(Evas_Object *obj, Elm_Web_Dialog_File_Selector func, void *data)
void elm_web_console_message_hook_set(Evas_Object *obj, Elm_Web_Console_Message func, void *data)
Eina_Bool elm_web_tab_propagate_get(Evas_Object *obj)
void elm_web_tab_propagate_set(Evas_Object *obj, Eina_Bool propagate)
# TODO: Eina_Bool elm_web_tab_propagate_get(Evas_Object *obj)
# TODO: void elm_web_tab_propagate_set(Evas_Object *obj, Eina_Bool propagate)
Eina_Bool elm_web_url_set(Evas_Object *obj,char *url)
const_char * elm_web_url_get(Evas_Object *obj)

View File

@ -24,73 +24,73 @@ ewebkit support.
Signals that you can add callbacks for are:
- "download,request": A file download has been requested. Event info is
- ``download,request``: A file download has been requested. Event info is
a WebDownload instance
- "editorclient,contents,changed": Editor client's contents changed
- "editorclient,selection,changed": Editor client's selection changed
- "frame,created": A new frame was created. Event info is an
- ``editorclient,contents,changed``: Editor client's contents changed
- ``editorclient,selection,changed``: Editor client's selection changed
- ``frame,created``: A new frame was created. Event info is an
Evas_Object which can be handled with WebKit's ewk_frame API
- "icon,received": An icon was received by the main frame
- "inputmethod,changed": Input method changed. Event info is an
- ``icon,received``: An icon was received by the main frame
- ``inputmethod,changed``: Input method changed. Event info is an
Eina_Bool indicating whether it's enabled or not
- "js,windowobject,clear": JS window object has been cleared
- "link,hover,in": Mouse cursor is hovering over a link. Event info
- ``js,windowobject,clear``: JS window object has been cleared
- ``link,hover,in``: Mouse cursor is hovering over a link. Event info
is a tuple, where the first string contains the URL the link
points to, and the second one the title of the link
- "link,hover,out": Mouse cursor left the link
- "load,document,finished": Loading of a document finished. Event info
- ``link,hover,out``: Mouse cursor left the link
- ``load,document,finished``: Loading of a document finished. Event info
is the frame that finished loading
- "load,error": Load failed. Event info is a WebFrameLoadError instance
- "load,finished": Load finished. Event info is None on success, on
- ``load,error``: Load failed. Event info is a WebFrameLoadError instance
- ``load,finished``: Load finished. Event info is None on success, on
error it's a WebFrameLoadError instance
- "load,newwindow,show": A new window was created and is ready to be
- ``load,newwindow,show``: A new window was created and is ready to be
shown
- "load,progress": Overall load progress. Event info is
- ``load,progress``: Overall load progress. Event info is
a double containing a value between 0.0 and 1.0
- "load,provisional": Started provisional load
- "load,started": Loading of a document started
- "menubar,visible,get": Queries if the menubar is visible. Event info
- ``load,provisional``: Started provisional load
- ``load,started``: Loading of a document started
- ``menubar,visible,get``: Queries if the menubar is visible. Event info
is a bool where the callback should set True if
the menubar is visible, or False in case it's not
- "menubar,visible,set": Informs menubar visibility. Event info is
- ``menubar,visible,set``: Informs menubar visibility. Event info is
a bool indicating the visibility
- "popup,created": A dropdown widget was activated, requesting its
- ``popup,created``: A dropdown widget was activated, requesting its
popup menu to be created. Event info is a WebMenu instance
- "popup,willdelete": The web object is ready to destroy the popup
- ``popup,willdelete``: The web object is ready to destroy the popup
object created. Event info is a WebMenu instance
- "ready": Page is fully loaded
- "scrollbars,visible,get": Queries visibility of scrollbars. Event
- ``ready``: Page is fully loaded
- ``scrollbars,visible,get``: Queries visibility of scrollbars. Event
info is a bool where the visibility state should be set
- "scrollbars,visible,set": Informs scrollbars visibility. Event info
- ``scrollbars,visible,set``: Informs scrollbars visibility. Event info
is an Eina_Bool with the visibility state set
- "statusbar,text,set": Text of the statusbar changed. Event info is
- ``statusbar,text,set``: Text of the statusbar changed. Event info is
a string with the new text
- "statusbar,visible,get": Queries visibility of the status bar.
- ``statusbar,visible,get``: Queries visibility of the status bar.
Event info is a bool where the visibility state should be
set.
- "statusbar,visible,set": Informs statusbar visibility. Event info is
- ``statusbar,visible,set``: Informs statusbar visibility. Event info is
an Eina_Bool with the visibility value
- "title,changed": Title of the main frame changed. Event info is a
- ``title,changed``: Title of the main frame changed. Event info is a
string with the new title
- "toolbars,visible,get": Queries visibility of toolbars. Event info
- ``toolbars,visible,get``: Queries visibility of toolbars. Event info
is a bool where the visibility state should be set
- "toolbars,visible,set": Informs the visibility of toolbars. Event
- ``toolbars,visible,set``: Informs the visibility of toolbars. Event
info is an Eina_Bool with the visibility state
- "tooltip,text,set": Show and set text of a tooltip. Event info is
- ``tooltip,text,set``: Show and set text of a tooltip. Event info is
a string with the text to show
- "uri,changed": URI of the main frame changed. Event info is a string (deprecated. use "url,changed" instead)
- "url,changed": URL of the main frame changed. Event info is a string
- ``uri,changed``: URI of the main frame changed. Event info is a string (deprecated. use ``url,changed`` instead)
- ``url,changed``: URL of the main frame changed. Event info is a string
with the new URI
- "view,resized": The web object internal's view changed sized
- "windows,close,request": A JavaScript request to close the current
- ``view,resized``: The web object internal's view changed sized
- ``windows,close,request``: A JavaScript request to close the current
window was requested
- "zoom,animated,end": Animated zoom finished
- "focused" : When the web has received focus. (since 1.8)
- "unfocused" : When the web has lost focus. (since 1.8)
- ``zoom,animated,end``: Animated zoom finished
- ``focused`` : When the web has received focus. (since 1.8)
- ``unfocused`` : When the web has lost focus. (since 1.8)
available styles:
- default
- ``default``
Enumerations
@ -146,6 +146,7 @@ Web zoom modes
"""
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport _object_mapping_register, object_from_instance
from efl.utils.deprecated cimport DEPRECATED
@ -168,23 +169,23 @@ ELM_WEB_ZOOM_MODE_MANUAL = enums.ELM_WEB_ZOOM_MODE_MANUAL
ELM_WEB_ZOOM_MODE_AUTO_FIT = enums.ELM_WEB_ZOOM_MODE_AUTO_FIT
ELM_WEB_ZOOM_MODE_AUTO_FILL = enums.ELM_WEB_ZOOM_MODE_AUTO_FILL
def _cb_string_conv(long addr):
def _cb_string_conv(uintptr_t addr):
cdef const_char *s = <const_char *>addr
return _ctouni(s) if s is not NULL else None
def _cb_bool_conv(long addr):
def _cb_bool_conv(uintptr_t addr):
cdef Eina_Bool *info = <Eina_Bool *>addr
if info == NULL:
return None
return info[0]
def _web_double_conv(long addr):
def _web_double_conv(uintptr_t addr):
cdef double *info = <double *>addr
if info == NULL:
return None
return info[0]
def _web_load_frame_error_conv(long addr):
def _web_load_frame_error_conv(uintptr_t addr):
cdef Elm_Web_Frame_Load_Error *err = <Elm_Web_Frame_Load_Error *>addr
if err == NULL:
return None
@ -200,7 +201,7 @@ def _web_load_frame_error_conv(long addr):
return ret
def _web_link_hover_in_conv(long addr):
def _web_link_hover_in_conv(uintptr_t addr):
cdef char **info = <char **>addr
if info == NULL:
url = title = None
@ -315,11 +316,11 @@ cdef class Web(Object):
# return the internal reference. Be careful using it as it may
# interfere with elm_web behavior.
# @return The internal ewk_view object or @c NULL if it does not
# :return: The internal ewk_view object or **None** if it does not
# exist. (Failure to create or Elementary compiled without
# ewebkit)
# @see elm_web_add()
# :see: elm_web_add()
# """
# def __get__(self):
@ -338,11 +339,11 @@ cdef class Web(Object):
# This hook will be called when a request to create a new window is
# issued from the web page loaded.
# There is no default implementation for this feature, so leaving this
# unset or passing @c NULL in @p func will prevent new windows from
# unset or passing **None** in @p func will prevent new windows from
# opening.
# @param func The hook function to be called when a window is requested
# @param data User data
# :param func: The hook function to be called when a window is requested
# :param data: User data
# """
# elm_web_window_create_hook_set(self.obj,
@ -355,13 +356,13 @@ cdef class Web(Object):
# Sets the function to call when an alert dialog
# This hook will be called when a JavaScript alert dialog is requested.
# If no function is set or @c NULL is passed in @p func, the default
# If no function is set or **None** is passed in @p func, the default
# implementation will take place.
# @param func The callback function to be used
# @param data User data
# :param func: The callback function to be used
# :param data: User data
# @see elm_web_inwin_mode_set()
# :see: elm_web_inwin_mode_set()
# """
# elm_web_dialog_alert_hook_set(self.obj,
@ -374,13 +375,13 @@ cdef class Web(Object):
# Sets the function to call when an confirm dialog
# This hook will be called when a JavaScript confirm dialog is requested.
# If no function is set or @c NULL is passed in @p func, the default
# If no function is set or **None** is passed in @p func, the default
# implementation will take place.
# @param func The callback function to be used
# @param data User data
# :param func: The callback function to be used
# :param data: User data
# @see elm_web_inwin_mode_set()
# :see: elm_web_inwin_mode_set()
# """
# elm_web_dialog_confirm_hook_set(self.obj,
@ -393,13 +394,13 @@ cdef class Web(Object):
# Sets the function to call when an prompt dialog
# This hook will be called when a JavaScript prompt dialog is requested.
# If no function is set or @c NULL is passed in @p func, the default
# If no function is set or **None** is passed in @p func, the default
# implementation will take place.
# @param func The callback function to be used
# @param data User data
# :param func: The callback function to be used
# :param data: User data
# @see elm_web_inwin_mode_set()
# :see: elm_web_inwin_mode_set()
# """
# elm_web_dialog_prompt_hook_set(self.obj,
@ -413,13 +414,13 @@ cdef class Web(Object):
# This hook will be called when a JavaScript file selector dialog is
# requested.
# If no function is set or @c NULL is passed in @p func, the default
# If no function is set or **None** is passed in @p func, the default
# implementation will take place.
# @param func The callback function to be used
# @param data User data
# :param func: The callback function to be used
# :param data: User data
# @see elm_web_inwin_mode_set()
# :see: elm_web_inwin_mode_set()
# """
# elm_web_dialog_file_selector_hook_set(self.obj,
@ -434,8 +435,8 @@ cdef class Web(Object):
This hook will be called when a console message is emitted from
JavaScript. There is no default implementation for this feature.
@param func The callback function to be used
@param data User data
:param func: The callback function to be used
:param data: User data
"""
self._console_message_hook = func
@ -470,24 +471,24 @@ cdef class Web(Object):
def useragent_get(self):
return _ctouni(elm_web_useragent_get(self.obj))
# TODO: Not implemented in ewebkit2 backend (yet?)
# property tab_propagate:
# """Whether to use tab propagation
property tab_propagate:
"""Whether to use tab propagation
# If tab propagation is enabled, whenever the user presses the Tab key,
# Elementary will handle it and switch focus to the next widget.
# The default value is disabled, where WebKit will handle the Tab key to
# cycle focus though its internal objects, jumping to the next widget
# only when that cycle ends.
If tab propagation is enabled, whenever the user presses the Tab key,
Elementary will handle it and switch focus to the next widget.
The default value is disabled, where WebKit will handle the Tab key to
cycle focus though its internal objects, jumping to the next widget
only when that cycle ends.
# :type: bool
:type: bool
# """
# def __get__(self):
# return bool(elm_web_tab_propagate_get(self.obj))
"""
def __get__(self):
return bool(elm_web_tab_propagate_get(self.obj))
def __set__(self, bint propagate):
elm_web_tab_propagate_set(self.obj, propagate)
# def __set__(self, bint propagate):
# elm_web_tab_propagate_set(self.obj, propagate)
property url:
"""
@ -566,10 +567,10 @@ cdef class Web(Object):
This is the color that will be used by default when the loaded page
does not set it's own. Color values are pre-multiplied.
@param r Red component
@param g Green component
@param b Blue component
@param a Alpha component
:param r: Red component
:param g: Green component
:param b: Blue component
:param a: Alpha component
"""
def __set__(self, value):
@ -589,8 +590,8 @@ cdef class Web(Object):
The string returned must be freed by the user when it's done with it.
@return A newly allocated string, or @c NULL if nothing is selected or an
error occurred
:return: A newly allocated string, or **None** if nothing is selected or an
error occurred
"""
def __get__(self):
@ -605,9 +606,9 @@ cdef class Web(Object):
it needs to tell the web object which item was selected by calling this
function with the index corresponding to the item.
@param index The index selected
:param index: The index selected
@see elm_web_popup_destroy()
:see: elm_web_popup_destroy()
"""
elm_web_popup_selected_set(self.obj, index)
@ -622,8 +623,8 @@ cdef class Web(Object):
will later emit an "popup,willdelete" signal to notify the user that
any memory and objects related to this popup can be freed.
@return @c EINA_TRUE if the menu was successfully destroyed, or @c EINA_FALSE
if there was no menu to destroy
:return: **True** if the menu was successfully destroyed, or **False**
if there was no menu to destroy
"""
return bool(elm_web_popup_destroy(self.obj))
@ -633,13 +634,13 @@ cdef class Web(Object):
Searches the given string in a document.
@param string String to search
@param case_sensitive If search should be case sensitive or not
@param forward If search is from cursor and on or backwards
@param wrap If search should wrap at the end
:param string: String to search
:param case_sensitive: If search should be case sensitive or not
:param forward: If search is from cursor and on or backwards
:param wrap: If search should wrap at the end
@return @c EINA_TRUE if the given string was found, @c EINA_FALSE if not
or failure
:return: **True** if the given string was found, **False** if not
or failure
"""
if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
@ -652,12 +653,12 @@ cdef class Web(Object):
Marks matches of the given string in a document.
@param string String to match
@param case_sensitive If match should be case sensitive or not
@param highlight If matches should be highlighted
@param limit Maximum amount of matches, or zero to unlimited
:param string: String to match
:param case_sensitive: If match should be case sensitive or not
:param highlight: If matches should be highlighted
:param limit: Maximum amount of matches, or zero to unlimited
@return number of matched @a string
:return: number of matched @a string
"""
if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
@ -668,7 +669,7 @@ cdef class Web(Object):
Clears all marked matches in the document
@return @c EINA_TRUE on success, @c EINA_FALSE otherwise
:return: **True** on success, **False** otherwise
"""
if not elm_web_text_matches_unmark_all(self.obj):
@ -697,12 +698,12 @@ cdef class Web(Object):
Get the overall loading progress of the page
Returns the estimated loading progress of the page, with a value between
0.0 and 1.0. This is an estimated progress accounting for all the frames
included in the page.
Returns the estimated loading progress of the page, with a value
between 0.0 and 1.0. This is an estimated progress accounting for all
the frames included in the page.
@return A value between 0.0 and 1.0 indicating the progress, or -1.0 on
failure
:return: A value between 0.0 and 1.0 indicating the progress, or -1.0
on failure
"""
def __get__(self):
@ -715,9 +716,9 @@ cdef class Web(Object):
Cancels the loading of the current page in the web object. This will
cause a "load,error" signal to be emitted, with the is_cancellation
flag set to @c EINA_TRUE.
flag set to **True**.
@return @c EINA_TRUE if the cancel was successful, @c EINA_FALSE otherwise
:return: **True** if the cancel was successful, **False** otherwise
"""
if not elm_web_stop(self.obj):
@ -728,7 +729,7 @@ cdef class Web(Object):
Requests a reload of the current document in the object
@return @c EINA_TRUE on success, @c EINA_FALSE otherwise
:return: **True** on success, **False** otherwise
"""
if not elm_web_reload(self.obj):
@ -739,7 +740,7 @@ cdef class Web(Object):
Requests a reload of the current document, avoiding any existing caches
@return @c EINA_TRUE on success, @c EINA_FALSE otherwise
:return: **True** on success, **False** otherwise
"""
if not elm_web_reload_full(self.obj):
@ -752,12 +753,12 @@ cdef class Web(Object):
This is equivalent to calling elm_web_object_navigate(obj, -1);
@return @c EINA_TRUE on success, @c EINA_FALSE otherwise
:return: **True** on success, **False** otherwise
@see elm_web_history_enabled_set()
@see elm_web_back_possible()
@see elm_web_forward()
@see elm_web_navigate()
:see: elm_web_history_enabled_set()
:see: elm_web_back_possible()
:see: elm_web_forward()
:see: elm_web_navigate()
"""
if not elm_web_back(self.obj):
@ -770,12 +771,12 @@ cdef class Web(Object):
This is equivalent to calling elm_web_object_navigate(obj, 1);
@return @c EINA_TRUE on success, @c EINA_FALSE otherwise
:return: **True** on success, **False** otherwise
@see elm_web_history_enabled_set()
@see elm_web_forward_possible_get()
@see elm_web_back()
@see elm_web_navigate()
:see: elm_web_history_enabled_set()
:see: elm_web_forward_possible_get()
:see: elm_web_back()
:see: elm_web_navigate()
"""
if not elm_web_forward(self.obj):
@ -789,14 +790,14 @@ cdef class Web(Object):
The @p steps value can be a negative integer to back in history, or a
positive to move forward.
@param steps The number of steps to jump
:param steps: The number of steps to jump
@return @c EINA_TRUE on success, @c EINA_FALSE on error or if not enough
history exists to jump the given number of steps
:return: **True** on success, **False** on error or if not enough
history exists to jump the given number of steps
@see elm_web_history_enabled_set()
@see elm_web_back()
@see elm_web_forward()
:see: elm_web_history_enabled_set()
:see: elm_web_back()
:see: elm_web_forward()
"""
return bool(elm_web_navigate(self.obj, steps))
@ -806,8 +807,8 @@ cdef class Web(Object):
Queries whether it's possible to go back in history
@return @c EINA_TRUE if it's possible to back in history, @c EINA_FALSE
otherwise
:return: **True** if it's possible to back in history, **False**
otherwise
"""
def __get__(self):
@ -818,8 +819,8 @@ cdef class Web(Object):
Queries whether it's possible to go forward in history
@return @c EINA_TRUE if it's possible to forward in history, @c EINA_FALSE
otherwise
:return: **True** if it's possible to forward in history, **False**
otherwise
"""
def __get__(self):
@ -832,10 +833,10 @@ cdef class Web(Object):
The @p steps value can be a negative integer to back in history, or a
positive to move forward.
@param steps The number of steps to check for
:param steps: The number of steps to check for
@return @c EINA_TRUE if enough history exists to perform the given jump,
@c EINA_FALSE otherwise
:return: **True** if enough history exists to perform the given jump,
**False** otherwise
"""
return bool(elm_web_navigate_possible_get(self.obj, steps))
@ -896,10 +897,10 @@ cdef class Web(Object):
Shows the given region in the web object
@param x The x coordinate of the region to show
@param y The y coordinate of the region to show
@param w The width of the region to show
@param h The height of the region to show
:param x: The x coordinate of the region to show
:param y: The y coordinate of the region to show
:param w: The width of the region to show
:param h: The height of the region to show
"""
elm_web_region_show(self.obj, x, y, w, h)
@ -912,10 +913,10 @@ cdef class Web(Object):
Like elm_web_region_show(), but it animates the scrolling of the object
to show the area
@param x The x coordinate of the region to show
@param y The y coordinate of the region to show
@param w The width of the region to show
@param h The height of the region to show
:param x: The x coordinate of the region to show
:param y: The y coordinate of the region to show
:param w: The width of the region to show
:param h: The height of the region to show
"""
elm_web_region_bring_in(self.obj, x, y, w, h)
@ -1029,14 +1030,13 @@ cdef class Web(Object):
def callback_load_error_del(self, func):
self._callback_del_full("load,error", _web_load_frame_error_conv, func)
# TODO:
# def callback_load_finished_add(self, func, *args, **kwargs):
# """Load finished. Event info is None on success, on error it's
# a pointer to Elm_Web_Frame_Load_Error."""
# self._callback_add("load,finished", func, *args, **kwargs)
def callback_load_finished_add(self, func, *args, **kwargs):
"""Load finished. Event info is None on success, on error it's
a pointer to Elm_Web_Frame_Load_Error."""
self._callback_add_full("load,finished", _web_load_frame_error_conv, func, *args, **kwargs)
# def callback_load_finished_del(self, func):
# self._callback_del("load,finished", func)
def callback_load_finished_del(self, func):
self._callback_del_full("load,finished", _web_load_frame_error_conv, func)
def callback_load_newwindow_show_add(self, func, *args, **kwargs):
"""A new window was created and is ready to be shown."""

View File

@ -31,33 +31,29 @@ supported (depending on Evas and Ecore-Evas compilation setup and
modules actually installed at runtime) are (listed in order of best
supported and most likely to be complete and work to lowest quality).
- "x11", "x", "software-x11", "software_x11" (Software rendering in
X11)
- "gl", "opengl", "opengl-x11", "opengl_x11" (OpenGL or OpenGL-ES2
rendering in X11)
- "shot:..." (Virtual screenshot renderer - renders to output file
and exits)
- "fb", "software-fb", "software_fb" (Linux framebuffer direct
software rendering)
- "sdl", "software-sdl", "software_sdl" (SDL software rendering to
SDL buffer)
- "gl-sdl", "gl_sdl", "opengl-sdl", "opengl_sdl" (OpenGL or
OpenGL-ES2 rendering using SDL as the buffer)
- "gdi", "software-gdi", "software_gdi" (Windows WIN32 rendering via
GDI with software)
- "x11", "x", "software-x11", "software_x11" (Software rendering in X11)
- "gl", "opengl", "opengl-x11", "opengl_x11" (OpenGL or OpenGL-ES2 rendering in
X11)
- "shot:..." (Virtual screenshot renderer - renders to output file and exits)
- "fb", "software-fb", "software_fb" (Linux framebuffer direct software
rendering)
- "sdl", "software-sdl", "software_sdl" (SDL software rendering to SDL buffer)
- "gl-sdl", "gl_sdl", "opengl-sdl", "opengl_sdl" (OpenGL or OpenGL-ES2
rendering using SDL as the buffer)
- "gdi", "software-gdi", "software_gdi" (Windows WIN32 rendering via GDI with
software)
- "dfb", "directfb" (Rendering to a DirectFB window)
- "x11-8", "x8", "software-8-x11", "software_8_x11" (Rendering in
grayscale using dedicated 8bit software engine in X11)
- "x11-16", "x16", "software-16-x11", "software_16_x11" (Rendering in
X11 using 16bit software engine)
- "x11-8", "x8", "software-8-x11", "software_8_x11" (Rendering in grayscale
using dedicated 8bit software engine in X11)
- "x11-16", "x16", "software-16-x11", "software_16_x11" (Rendering in X11 using
16bit software engine)
- "wince-gdi", "software-16-wince-gdi", "software_16_wince_gdi"
(Windows CE rendering via GDI with 16bit software renderer)
- "sdl-16", "software-16-sdl", "software_16_sdl" (Rendering to SDL
buffer with 16bit software renderer)
- "ews" (rendering to EWS - Ecore + Evas Single Process Windowing
System)
- "gl-cocoa", "gl_cocoa", "opengl-cocoa", "opengl_cocoa" (OpenGL
rendering in Cocoa)
(Windows CE rendering via GDI with 16bit software renderer)
- "sdl-16", "software-16-sdl", "software_16_sdl" (Rendering to SDL buffer with
16bit software renderer)
- "ews" (rendering to EWS - Ecore + Evas Single Process Windowing System)
- "gl-cocoa", "gl_cocoa", "opengl-cocoa", "opengl_cocoa" (OpenGL rendering in
Cocoa)
- "psl1ght" (PS3 rendering using PSL1GHT)
All engines use a simple string to select the engine to render, EXCEPT
@ -85,24 +81,24 @@ fixed to "out001.png" Some examples of using the shot engine::
Signals that you can add callbacks for are:
- "delete,request": the user requested to close the window. See
:py:attr:`~Window.autodel`.
- "focus,in": window got focus
- "focus,out": window lost focus
- "moved": window that holds the canvas was moved
- "withdrawn": window is still managed normally but removed from view
- "iconified": window is minimized (perhaps into an icon or taskbar)
- "normal": window is in a normal state (not withdrawn or iconified)
- "stick": window has become sticky (shows on all desktops)
- "unstick": window has stopped being sticky
- "fullscreen": window has become fullscreen
- "unfullscreen": window has stopped being fullscreen
- "maximized": window has been maximized
- "unmaximized": window has stopped being maximized
- "ioerr": there has been a low-level I/O error with the display system
- "indicator,prop,changed": an indicator's property has been changed
- "rotation,changed": window rotation has been changed
- "profile,changed": profile of the window has been changed
- ``delete,request``: the user requested to close the window. See
:py:attr:`~Window.autodel`.
- ``focus,in``: window got focus
- ``focus,out``: window lost focus
- ``moved``: window that holds the canvas was moved
- ``withdrawn``: window is still managed normally but removed from view
- ``iconified``: window is minimized (perhaps into an icon or taskbar)
- ``normal``: window is in a normal state (not withdrawn or iconified)
- ``stick``: window has become sticky (shows on all desktops)
- ``unstick``: window has stopped being sticky
- ``fullscreen``: window has become fullscreen
- ``unfullscreen``: window has stopped being fullscreen
- ``maximized``: window has been maximized
- ``unmaximized``: window has stopped being maximized
- ``ioerr``: there has been a low-level I/O error with the display system
- ``indicator,prop,changed``: an indicator's property has been changed
- ``rotation,changed``: window rotation has been changed
- ``profile,changed``: profile of the window has been changed
- ``focused`` - When the window has received focus. (since 1.8)
- ``unfocused`` - When the window has lost focus. (since 1.8)

View File

@ -16,6 +16,7 @@
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
from efl.eo cimport object_from_instance, _object_mapping_register, \
_register_decorated_callbacks
@ -140,9 +141,12 @@ def webcams_get():
.. versionadded:: 1.8
"""
cdef const_Eina_List *lst, *itr
cdef Emotion_Webcam *cam
cdef const_char *name, *device
cdef:
const_Eina_List *lst
const_Eina_List *itr
Emotion_Webcam *cam
const_char *name
const_char *device
ret = []
lst = emotion_webcams_get()
@ -226,7 +230,7 @@ cdef class Emotion(evasObject):
return ("<%s(%#x, type=%r, name=%r, "
"file=%r, geometry=(%d, %d, %d, %d), "
"color=(%d, %d, %d, %d), layer=%s, clip=%r, visible=%s) %s>") % \
(self.__class__.__name__, <unsigned long><void *>self,
(self.__class__.__name__, <uintptr_t><void *>self,
self.type_get(), self.name_get(), self.file_get(),
x, y, w, h, r, g, b, a,
self.layer_get(), self.clip_get(), self.visible_get(),

View File

@ -18,6 +18,7 @@
from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyUnicode_AsUTF8String
from libc.stdlib cimport malloc, free
from libc.string cimport memcpy, strdup
from libc.stdint cimport uintptr_t
from efl.eina cimport Eina_Bool, const_Eina_List, eina_list_append, const_void, \
Eina_Hash, eina_hash_string_superfast_new, eina_hash_add, eina_hash_del, \
eina_hash_find, EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO
@ -122,7 +123,7 @@ cdef object object_from_instance(cEo *obj):
if cls_name == NULL:
raise ValueError(
"Eo object at %#x does not have a type!" % <unsigned long>obj)
"Eo object at %#x does not have a type!" % <uintptr_t>obj)
cls_ret = eina_hash_find(object_mapping, cls_name)
@ -130,7 +131,7 @@ cdef object object_from_instance(cEo *obj):
# TODO: Add here a last ditch effort to import the class from a module
raise ValueError(
"Eo object at %#x of type %s does not have a mapping!" % (
<unsigned long>obj, cls_name)
<uintptr_t>obj, cls_name)
)
cls = <type>cls_ret
@ -138,7 +139,7 @@ cdef object object_from_instance(cEo *obj):
if cls is None:
raise ValueError(
"Mapping for Eo object at %#x, type %s, contains None!" % (
<unsigned long>obj, cls_name))
<uintptr_t>obj, cls_name))
EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN,
"Constructing a Python object from Eo of type %s.", cls_name)
@ -219,9 +220,9 @@ cdef class Eo(object):
eo_do(self.obj, eo_parent_get(&parent))
return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") % (
type(self).__name__,
<unsigned long><void *>self,
<unsigned long>self.obj,
<unsigned long>parent,
<uintptr_t><void *>self,
<uintptr_t>self.obj,
<uintptr_t>parent,
PY_REFCOUNT(self))
def __nonzero__(self):

View File

@ -17,6 +17,7 @@
import traceback
from cpython cimport PyUnicode_AsUTF8String
from libc.stdint cimport uintptr_t
#from efl.eina cimport *
from efl.eo cimport Eo, object_from_instance, _object_mapping_register
from efl.utils.conversions cimport _ctouni, _touni

View File

@ -154,7 +154,7 @@ cdef class Canvas(Eo):
def __get__(self):
return self.output_method_get()
def engine_info_set(self, unsigned long ptr):
def engine_info_set(self, uintptr_t ptr):
"""Set the engine information pointer.
Note that given value is a pointer, usually acquired with
@ -182,10 +182,10 @@ cdef class Canvas(Eo):
If in doubt, don't mess with it.
:return: pointer as integer (unsigned long).
:return: pointer as integer (uintptr_t).
"""
return <unsigned long><void *>evas_engine_info_get(self.obj)
return <uintptr_t><void *>evas_engine_info_get(self.obj)
property engine_info:
def __set__(self, ptr):
@ -389,9 +389,12 @@ cdef class Canvas(Eo):
:return: children objects.
:rtype: List of :py:class:`efl.evas.Object`
"""
cdef Eina_List *objs, *itr
cdef int ip, ih
cdef Evas_Object *o
cdef:
Eina_List *objs
Eina_List *itr
int ip, ih
Evas_Object *o
ip = include_pass_events_objects
ih = include_hidden_objects
objs = evas_objects_at_xy_get(self.obj, x, y, ip, ih)
@ -419,9 +422,12 @@ cdef class Canvas(Eo):
:return: children objects.
:rtype: List of :py:class:`efl.evas.Object`
"""
cdef Eina_List *objs, *itr
cdef int ip, ih
cdef Evas_Object *o
cdef:
Eina_List *objs
Eina_List *itr
int ip, ih
Evas_Object *o
ip = include_pass_events_objects
ih = include_hidden_objects
objs = evas_objects_in_rectangle_get(self.obj, x, y, w, h, ip, ih)
@ -554,8 +560,11 @@ cdef class Canvas(Eo):
def font_available_list(self):
""":rtype: list of str"""
# TODO: use list conv func
cdef void *p
cdef Eina_List *itr, *head
cdef:
void *p
Eina_List *itr
Eina_List *head
lst = []
p = <void*>evas_font_available_list(self.obj) # avoid warning
head = <Eina_List*>p

View File

@ -192,7 +192,10 @@ cdef class Image(Object):
"""
def __get__(self):
cdef const_char *file, *key
cdef:
const_char *file
const_char *key
evas_object_image_file_get(self.obj, &file, &key)
return (_ctouni(file), _ctouni(key))
@ -223,7 +226,10 @@ cdef class Image(Object):
raise EvasLoadError(err, filename, key)
def file_get(self):
cdef const_char *file, *key
cdef:
const_char *file
const_char *key
evas_object_image_file_get(self.obj, &file, &key)
return (_ctouni(file), _ctouni(key))
@ -497,99 +503,99 @@ cdef class Image(Object):
PyBuffer_Release(&view)
def image_data_memoryview_get(self, bint for_writing=False, bint simple=True):
"""image_data_memoryview_get(bool for_writing) -> MemoryView
# def image_data_memoryview_get(self, bint for_writing=False, bint simple=True):
# """image_data_memoryview_get(bool for_writing) -> MemoryView
Get a MemoryView object to the raw image data of the given image object.
# Get a MemoryView object to the raw image data of the given image object.
:param bool for_writing: Whether the data being retrieved will be
modified or not.
:param bool simple: Whether the MemoryView is 1D or 2D
:return MemoryView: The raw image data.
# :param bool for_writing: Whether the data being retrieved will be
# modified or not.
# :param bool simple: Whether the MemoryView is 1D or 2D
# :return MemoryView: The raw image data.
This method returns a MemoryView object to an image object's internal pixel
buffer, for reading only or read/write. If you request it for
writing, the image will be marked dirty so that it gets redrawn at
the next update.
# This method returns a MemoryView object to an image object's internal pixel
# buffer, for reading only or read/write. If you request it for
# writing, the image will be marked dirty so that it gets redrawn at
# the next update.
Each time you call this method on an image object, its data
buffer will have an internal reference counter
incremented. Decrement it back by using
:py:func:`image_data_set`.
# Each time you call this method on an image object, its data
# buffer will have an internal reference counter
# incremented. Decrement it back by using
# :py:func:`image_data_set`.
This is best suited for when you want to modify an existing image,
without changing its dimensions.
# This is best suited for when you want to modify an existing image,
# without changing its dimensions.
.. note::
The contents' format returned by it depend on the color
space of the given image object.
# .. note::
# The contents' format returned by it depend on the color
# space of the given image object.
.. note::
You may want to use :py:func:`image_data_update_add` to
inform data changes, if you did any.
# .. note::
# You may want to use :py:func:`image_data_update_add` to
# inform data changes, if you did any.
"""
cdef int stride, h, bpp, cspace, have_alpha, img_size
# """
# cdef int stride, h, bpp, cspace, have_alpha, img_size
stride = evas_object_image_stride_get(self.obj)
evas_object_image_size_get(self.obj, NULL, &h)
cspace = evas_object_image_colorspace_get(self.obj)
have_alpha = evas_object_image_alpha_get(self.obj)
# stride = evas_object_image_stride_get(self.obj)
# evas_object_image_size_get(self.obj, NULL, &h)
# cspace = evas_object_image_colorspace_get(self.obj)
# have_alpha = evas_object_image_alpha_get(self.obj)
bpp = 0
if cspace == EVAS_COLORSPACE_ARGB8888:
bpp = 4
format = "L"
elif cspace == EVAS_COLORSPACE_RGB565_A5P:
if have_alpha == 0:
bpp = 2
format = "H"
else:
pass #bpp = 3
# XXX: There's no type that has three bytes.
# Is the format string actually used?
if bpp == 0:
raise ValueError("Unsupported colorspace")
# bpp = 0
# if cspace == EVAS_COLORSPACE_ARGB8888:
# bpp = 4
# format = "L"
# elif cspace == EVAS_COLORSPACE_RGB565_A5P:
# if have_alpha == 0:
# bpp = 2
# format = "H"
# else:
# pass #bpp = 3
# # XXX: There's no type that has three bytes.
# # Is the format string actually used?
# if bpp == 0:
# raise ValueError("Unsupported colorspace")
img_size = stride * h * bpp
# img_size = stride * h * bpp
cdef Py_buffer *img_buf = <Py_buffer *>PyMem_Malloc(sizeof(Py_buffer))
if img_buf == NULL:
raise MemoryError
# cdef Py_buffer *img_buf = <Py_buffer *>PyMem_Malloc(sizeof(Py_buffer))
# if img_buf == NULL:
# raise MemoryError
cdef:
Py_ssize_t simple_shape[1]
Py_ssize_t shape[2]
Py_ssize_t strides[2]
Py_ssize_t suboffsets[2]
# cdef:
# Py_ssize_t simple_shape[1]
# Py_ssize_t shape[2]
# Py_ssize_t strides[2]
# Py_ssize_t suboffsets[2]
if simple:
simple_shape[0] = img_size
else:
shape[0] = stride / bpp
shape[1] = h
strides[0] = stride
strides[1] = h * bpp
suboffsets[0] = -1
suboffsets[1] = -1
# if simple:
# simple_shape[0] = img_size
# else:
# shape[0] = stride / bpp
# shape[1] = h
# strides[0] = stride
# strides[1] = h * bpp
# suboffsets[0] = -1
# suboffsets[1] = -1
img_buf.buf = evas_object_image_data_get(self.obj, for_writing)
img_buf.len = img_size
img_buf.readonly = not for_writing
img_buf.format = format
if simple:
img_buf.ndim = 1
img_buf.shape = simple_shape
img_buf.strides = NULL
img_buf.suboffsets = NULL
else:
img_buf.ndim = 2
img_buf.shape = shape
img_buf.strides = strides
img_buf.suboffsets = suboffsets
img_buf.itemsize = bpp
# img_buf.buf = evas_object_image_data_get(self.obj, for_writing)
# img_buf.len = img_size
# img_buf.readonly = not for_writing
# img_buf.format = format
# if simple:
# img_buf.ndim = 1
# img_buf.shape = simple_shape
# img_buf.strides = NULL
# img_buf.suboffsets = NULL
# else:
# img_buf.ndim = 2
# img_buf.shape = shape
# img_buf.strides = strides
# img_buf.suboffsets = suboffsets
# img_buf.itemsize = bpp
return <object>PyMemoryView_FromBuffer(img_buf)
# return <object>PyMemoryView_FromBuffer(img_buf)
# TODO:

View File

@ -1,4 +1,4 @@
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
# Copyright (C) 2007-2014 various contributors (see AUTHORS)
#
# This file is part of Python-EFL.
#
@ -26,7 +26,7 @@ import types
include "smart_object_metaclass.pxi"
_install_metaclass(EvasSmartObjectMeta, SmartObject)
_install_metaclass(EvasSmartObjectMeta, ClippedSmartObject)
cdef void _smart_object_delete(Evas_Object *o) with gil:
@ -396,12 +396,11 @@ cdef class SmartObject(Object):
self._smart_callbacks = None
def __init__(self, Canvas canvas not None, **kwargs):
cdef long addr
cdef uintptr_t addr
if type(self) is SmartObject:
raise TypeError("Must not instantiate SmartObject, but subclasses")
if self.obj == NULL:
addr = self.__evas_smart_class__
# self._add_obj(evas_object_smart_class_get(), self.evas.obj)
self._set_obj(evas_object_smart_add(canvas.obj, <Evas_Smart*>addr))
self._set_properties_from_keyword_args(kwargs)
@ -538,7 +537,10 @@ cdef class SmartObject(Object):
Default implementation to delete all children.
"""
cdef Eina_List *lst, *itr
cdef:
Eina_List *lst
Eina_List *itr
lst = evas_object_smart_members_get(self.obj)
itr = lst
while itr:
@ -705,51 +707,58 @@ cdef class SmartObject(Object):
self.member_add(obj)
return obj
# def Image(self, **kargs):
# """Factory of children :py:class:`evas.Image`.
# :rtype: :py:class:`Image<evas.Image>`
# """
# obj = Image(self.evas, **kargs)
# self.member_add(obj)
# return obj
def Image(self, **kargs):
"""Factory of children :py:class:`evas.Image`.
# def FilledImage(self, **kargs):
# """Factory of :py:class:`evas.FilledImage` associated with this canvas.
# :rtype: :py:class:`FilledImage<evas.FilledImage>`
# """
# obj = FilledImage(self.evas, **kargs)
# self.member_add(obj)
# return obj
#
# def Polygon(self, **kargs):
# """Factory of children :py:class:`evas.Polygon`.
# :rtype: :py:class:`Polygon<evas.Polygon>`
# """
# obj = Polygon(self.evas, **kargs)
# self.member_add(obj)
# return obj
#
# def Text(self, **kargs):
# """Factory of children :py:class:`evas.Text`.
# :rtype: :py:class:`Text<evas.Text>`
# """
# obj = Text(self.evas, **kargs)
# self.member_add(obj)
# return obj
#
# def Textblock(self, **kargs):
# """Factory of children :py:class:`evas.Textblock`.
# :rtype: :py:class:`Textblock<evas.Textblock>`
# """
# obj = Textblock(self.evas, **kargs)
# self.member_add(obj)
# return obj
:rtype: :py:class:`Image<evas.Image>`
"""
obj = Image(self.evas, **kargs)
self.member_add(obj)
return obj
def FilledImage(self, **kargs):
"""Factory of :py:class:`evas.FilledImage` associated with this canvas.
:rtype: :py:class:`FilledImage<evas.FilledImage>`
"""
obj = FilledImage(self.evas, **kargs)
self.member_add(obj)
return obj
def Polygon(self, **kargs):
"""Factory of children :py:class:`evas.Polygon`.
:rtype: :py:class:`Polygon<evas.Polygon>`
"""
obj = Polygon(self.evas, **kargs)
self.member_add(obj)
return obj
def Text(self, **kargs):
"""Factory of children :py:class:`evas.Text`.
:rtype: :py:class:`Text<evas.Text>`
"""
obj = Text(self.evas, **kargs)
self.member_add(obj)
return obj
def Textblock(self, **kargs):
"""Factory of children :py:class:`evas.Textblock`.
:rtype: :py:class:`Textblock<evas.Textblock>`
"""
obj = Textblock(self.evas, **kargs)
self.member_add(obj)
return obj
_object_mapping_register("Evas_Smart", SmartObject)
# cdef extern from "Evas.h": # hack to force type to be known
# cdef PyTypeObject PyEvasSmartObject_Type # hack to install metaclass
# _install_metaclass(&PyEvasSmartObject_Type, EvasSmartObjectMeta)
cdef class ClippedSmartObject(SmartObject):
@ -839,6 +848,3 @@ cdef class ClippedSmartObject(SmartObject):
_object_mapping_register("Evas_Smart_Clipped", ClippedSmartObject)
# cdef extern from "Evas.h": # hack to force type to be known
# cdef PyTypeObject PyEvasClippedSmartObject_Type # hack to install metaclass
# _install_metaclass(&PyEvasClippedSmartObject_Type, EvasSmartObjectMeta)

View File

@ -16,8 +16,9 @@
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
from cpython cimport PyMem_Malloc
from libc.stdint cimport uintptr_t
cdef long _smart_object_class_new(name) except 0:
cdef uintptr_t _smart_object_class_new(name) except 0:
cdef Evas_Smart_Class *cls_def
cdef Evas_Smart *cls
@ -27,7 +28,7 @@ cdef long _smart_object_class_new(name) except 0:
if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
#_smart_classes.append(<long>cls_def)
#_smart_classes.append(<uintptr_t>cls_def)
cls_def.name = name
cls_def.version = EVAS_SMART_CLASS_VERSION
cls_def.add = NULL # use python constructor
@ -48,7 +49,7 @@ cdef long _smart_object_class_new(name) except 0:
cls_def.data = NULL
cls = evas_smart_class_new(cls_def);
return <long>cls
return <uintptr_t>cls
#class EvasSmartObjectMeta(EvasObjectMeta):
class EvasSmartObjectMeta(type):
@ -61,7 +62,7 @@ class EvasSmartObjectMeta(type):
if "__evas_smart_class__" in cls.__dict__:
return
cdef long addr
cdef uintptr_t addr
addr = _smart_object_class_new(cls.__name__)
cls.__evas_smart_class__ = addr

View File

@ -39,8 +39,25 @@ cdef class DEPRECATED(object):
update_wrapper(wrapper, f, assigned=assignments)
# Version is required for the deprecated directive
if wrapper.__doc__ is not None and self.version is not None:
wrapper.__doc__ += "\n\n.. deprecated:: %s\n %s\n" % (self.version, self.message)
doc = wrapper.__doc__
if doc is not None and self.version is not None:
lines = doc.expandtabs().splitlines()
indent = 0
if len(lines) >= 2:
for line in lines[1:]:
stripped = line.lstrip()
if stripped:
indent = len(line) - len(stripped)
break
wrapper.__doc__ += "\n\n"
wrapper.__doc__ += indent * " " + ".. deprecated:: %s\n" % (self.version,)
wrapper.__doc__ += (indent + 4) * " " + "%s\n" % (self.message,)
return wrapper

View File

@ -110,7 +110,9 @@ cdef object add_logger(object name):
else:
log.propagate = True
log.setLevel(logging.WARNING)
log.addHandler(logging.NullHandler())
if PY_VERSION_HEX >= 0x02070000:
log.addHandler(logging.NullHandler())
logging.setLoggerClass(logging.Logger)

View File

@ -42,6 +42,7 @@ items = [
("Evas Canvas Callbacks", "test_core_evas_canvas_callbacks", "core_evas_canvas_callbacks_clicked"),
("Evas Object Callbacks", "test_core_evas_object_callbacks", "core_evas_object_callbacks_clicked"),
("Evas Textgrid", "test_evas_textgrid", "evas_textgrid_clicked"),
("Evas Smart Object", "test_core_evas_smart", "core_evas_smart_clicked"),
]),
("3D", [
("Evas Map 3D", "test_3d", "evas3d_clicked"),
@ -113,6 +114,13 @@ items = [
("Entry Scrolled", "test_entry", "entry_scrolled_clicked"),
("Entry Anchor", "test_entry", "entry_anchor_clicked"),
("MultiButtonEntry", "test_multibuttonentry", "multibuttonentry_clicked"),
]),
("Focus", [
("Focus", "test_focus", "focus_clicked"),
("Focus 2", "test_focus", "focus2_clicked"),
("Focus 3", "test_focus", "focus3_clicked"),
("Focus 4", "test_focus", "focus4_clicked"),
("Focus Custom", "test_focus", "focus5_clicked"),
]),
("Geographic", [
("Map", "test_map", "map_clicked"),

View File

@ -0,0 +1,171 @@
#!/usr/bin/env python
# encoding: utf-8
import os
from random import randint
from efl.evas import SmartObject, EVAS_HINT_EXPAND, EVAS_HINT_FILL
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
from efl.elementary.button import Button
EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
script_path = os.path.dirname(os.path.abspath(__file__))
ic_file = os.path.join(script_path, "images", "logo.png")
objects = []
def random_color():
return (randint(0,255), randint(0,255), randint(0,255), 255)
class MySmartObj(SmartObject):
def __init__(self, canvas):
SmartObject.__init__(self, canvas)
# gray background
self.bg = self.Rectangle(color=(128,128,128,128))
# green dragbar to move the obj
self.dragpos = self.Rectangle(color=(0,128,0,128))
self.dragpos.on_mouse_down_add(self.start_drag_move)
self.dragpos.on_mouse_up_add(self.stop_drag_move)
# blue rect to resize the obj
self.dragsize = self.Rectangle(color=(0,0,128,128))
self.dragsize.on_mouse_down_add(self.start_drag_resize)
self.dragsize.on_mouse_up_add(self.stop_drag_resize)
# testing factories
self.obj_rect = self.Rectangle(size=(15,15), color=random_color())
self.obj_rect.on_mouse_down_add(lambda o,e: self.hide())
self.obj_line = self.Line(color=random_color())
self.obj_image = self.FilledImage(file=ic_file, size=(20,20))
self.obj_poly = self.Polygon(color=random_color())
self.obj_text = self.Text(color=(0,0,0,255), font="Sans",
pass_events=True, text="Drag me")
def resize(self, w, h):
print("RESIZE", w, h)
self.bg.size = w, h
self.obj_text.size = w, 15
self.dragpos.size = w, 15
self.dragsize.size = 15, 15
self.dragsize.pos = self.bg.pos[0] + w - 15, self.bg.pos[1] + h - 15
def move(self, x, y):
print("MOVE", x, y)
self.bg.pos = x, y
self.obj_text.pos = x,y
self.dragpos.pos = x, y
self.dragsize.pos = x + self.bg.size[0] - 15, y + self.bg.size[1] - 15
self.obj_rect.pos = x + 5, y + 20
self.obj_line.geometry = x + 30, y + 20, 15, 15
self.obj_image.pos = x + 30, y + 45
self.obj_poly.points_clear()
self.obj_poly.point_add(x + 5 + 0, y + 45 + 0)
self.obj_poly.point_add(x + 5 + 15, y + 45 + 15)
self.obj_poly.point_add(x + 5 + 0, y + 45 + 15)
def delete(sef):
print("my delete")
def show(self):
print("my show")
for o in self.members:
o.show()
def hide(self):
print("my hide")
for o in self.members:
o.hide()
def clip_set(self, o):
pass
def clip_unset(self):
pass
# dragpos (move obj)
def start_drag_move(self, obj, event):
self.on_mouse_move_add(self.mouse_move_cb)
def stop_drag_move(self, obj, event):
self.on_mouse_move_del(self.mouse_move_cb)
def mouse_move_cb(self, obj, event):
x, y = event.position.canvas
self.pos = x - self.bg.size[0] / 2, y
# dragsize (resize obj)
def start_drag_resize(self, obj, event):
self.on_mouse_move_add(self.mouse_move_resize_cb)
def stop_drag_resize(self, obj, event):
self.on_mouse_move_del(self.mouse_move_resize_cb)
def mouse_move_resize_cb(self, obj, event):
x, y = event.position.canvas
self.size = x - self.bg.pos[0], y - self.bg.pos[1]
def btn_add_cb(b):
sm = MySmartObj(b.evas)
sm.size = 100, 100
sm.pos = 100, 100
sm.show()
objects.append(sm)
def btn_del_cb(b):
objects.pop().delete()
def btn_hide_cb(b):
for o in objects:
o.hide()
def btn_show_cb(b):
for o in objects:
o.show()
def core_evas_smart_clicked(obj, item=None):
win = StandardWindow("evassmart", "Evas Smart Object Test", autodel=True)
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
box = Box(win, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box.show()
win.resize_object_add(box)
b = Button(win, text="Add one", size_hint_align=(0.0,0.0))
b.callback_clicked_add(btn_add_cb)
box.pack_end(b)
b.show()
b = Button(win, text="Del last", size_hint_align=(0.0,0.0))
b.callback_clicked_add(btn_del_cb)
box.pack_end(b)
b.show()
b = Button(win, text="Hide all", size_hint_align=(0.0,0.0))
b.callback_clicked_add(btn_hide_cb)
box.pack_end(b)
b.show()
b = Button(win, text="Show all", size_hint_align=(0.0,0.0))
b.callback_clicked_add(btn_show_cb)
box.pack_end(b)
b.show()
win.resize(320, 320)
win.show()
if __name__ == "__main__":
elementary.init()
core_evas_smart_clicked(None)
elementary.run()
elementary.shutdown()

View File

@ -0,0 +1,596 @@
#!/usr/bin/env python
# encoding: utf-8
import os
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
from efl import elementary
from efl import edje
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
from efl.elementary.bubble import Bubble
from efl.elementary.button import Button
from efl.elementary.label import Label
from efl.elementary.layout import Layout
from efl.elementary.list import List
from efl.elementary.frame import Frame
from efl.elementary.separator import Separator
from efl.elementary.scroller import Scroller
from efl.elementary.spinner import Spinner
from efl.elementary.check import Check
from efl.elementary.entry import Entry
from efl.elementary.table import Table
from efl.elementary.toolbar import Toolbar, ELM_TOOLBAR_SHRINK_MENU
from efl.elementary.object import ELM_FOCUS_DOWN, ELM_FOCUS_UP
from efl.elementary.configuration import Configuration
from efl.elementary.theme import theme_overlay_add
EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
EXPAND_HORIZ = EVAS_HINT_EXPAND, 0.0
FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
FILL_HORIZ = EVAS_HINT_FILL, 0.5
script_path = os.path.dirname(os.path.abspath(__file__))
edj_file = os.path.join(script_path, "test.edj")
conf = Configuration()
# Focus
def _tb_sel(tb, item):
print(item)
print(item.text)
def focus_clicked(obj, item=None):
win = StandardWindow("focus", "Focus", autodel=True, size=(800,600))
win.focus_highlight_enabled = True
tbx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(tbx)
tbx.show()
### Toolbar
tbar = Toolbar(win, shrink_mode=ELM_TOOLBAR_SHRINK_MENU,
size_hint_align=(EVAS_HINT_FILL,0.0))
tb_it = tbar.item_append("document-print", "Hello", _tb_sel)
tb_it.disabled = True
tb_it = tbar.item_append("folder-new", "World", _tb_sel)
tb_it = tbar.item_append("object-rotate-right", "H", _tb_sel)
tb_it = tbar.item_append("mail-send", "Comes", _tb_sel)
tb_it = tbar.item_append("clock", "Elementary", _tb_sel)
tb_it = tbar.item_append("refresh", "Menu", _tb_sel)
tb_it.menu = True
tbar.menu_parent = win
menu = tb_it.menu
menu.item_add(None, "Shrink", "edit-cut", _tb_sel)
menu_it = menu.item_add(None, "Mode", "edit-copy", _tb_sel)
menu.item_add(menu_it, "is set to", "edit-paste", _tb_sel)
menu.item_add(menu_it, "or to", "edit-paste", _tb_sel)
menu.item_add(None, "Menu", "edit-delete", _tb_sel)
tbx.pack_end(tbar)
tbar.show()
mainbx = Box(win, horizontal=True, size_hint_weight=EXPAND_BOTH)
tbx.pack_end(mainbx)
mainbx.show()
## First Col
bx = Box(win, size_hint_weight=EXPAND_BOTH)
mainbx.pack_end(bx)
bx.show()
lb = Label(win, text="<b>Use Tab or Shift+Tab<br/>or Arrow keys</b>",
size_hint_align=FILL_BOTH)
bx.pack_end(lb)
lb.show()
tg = Check(win, style="toggle")
tg.part_text_set("on", "Yes")
tg.part_text_set("off", "No")
bx.pack_end(tg)
tg.show()
en = Entry(win, scrollable=True, single_line=True, text="This is a single line",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bx.pack_end(en)
en.show()
#
bx2 = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
for i in range(2):
bt = Button(win, text="Box", size_hint_align=FILL_BOTH, disabled=(i % 2))
bx2.pack_end(bt)
bt.show()
sc = Scroller(win, bounce=(True,True), content_min_limit=(1,1),
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(sc)
sc.show()
bt = Button(win, text="Scroller", size_hint_align=FILL_BOTH)
sc.content = bt
bt.show()
#
bt = Button(win, text="Box", size_hint_align=FILL_BOTH)
bx.pack_end(bt)
bt.show()
#
bx2 = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
for i in range(2):
bx3 = Box(win, size_hint_align=FILL_BOTH)
bx2.pack_end(bx3)
bx3.show()
for j in range(3):
bt = Button(win, text="Box", size_hint_align=FILL_BOTH)
bx3.pack_end(bt)
bt.show()
sc = Scroller(win, bounce=(False, True), content_min_limit=(1,0),
size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
sc.content_min_limit=(1,1)
bx2.pack_end(sc)
sc.show()
bx3 = Box(win, size_hint_align=FILL_BOTH)
sc.content = bx3
bx3.show()
for i in range(5):
bt = Button(win, text="BX Scroller", size_hint_align=FILL_BOTH)
bx3.pack_end(bt)
bt.show()
## Second Col
ly = Layout(win, size_hint_weight=EXPAND_BOTH)
ly.file = edj_file, "twolines"
mainbx.pack_end(ly)
ly.show()
bx2 = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
ly.part_content_set("element1", bx2)
bx2.show()
for i in range(3):
bt = Button(win, text="Layout", size_hint_align=FILL_BOTH)
bx2.pack_end(bt)
bt.show()
bx2.focus_custom_chain_prepend(bt)
bx2 = Box(win, size_hint_align=FILL_BOTH)
ly.part_content_set("element2", bx2)
bx2.show()
bt = Button(win, text="Disable", size_hint_align=FILL_BOTH)
bt.callback_clicked_add(lambda b: b.disabled_set(True))
bx2.pack_end(bt)
bt.show()
bx2.focus_custom_chain_prepend(bt)
bt2 = Button(win, text="Enable", size_hint_align=FILL_BOTH)
bt2.callback_clicked_add(lambda b, b1: b1.disabled_set(False), bt)
bx2.pack_end(bt2)
bt2.show()
bx2.focus_custom_chain_append(bt2)
## Third Col
bx = Box(win, size_hint_weight=EXPAND_BOTH)
mainbx.pack_end(bx)
bx.show()
fr = Frame(win, text="Frame", )
bx.pack_end(fr)
fr.show()
tb = Table(win, size_hint_weight=EXPAND_BOTH)
fr.content = tb
tb.show()
for j in range(1):
for i in range(2):
bt = Button(win, text="Table", size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
tb.pack(bt, i, j, 1, 1)
bt.show()
#
fr = Bubble(win, text="Bubble", size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
bx.pack_end(fr)
fr.show()
tb = Table(win, size_hint_weight=EXPAND_BOTH)
fr.content = tb
tb.show()
for j in range(2):
for i in range(1):
bt = Button(win, text="Table", size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
tb.pack(bt, i, j, 1, 1)
bt.show()
win.show()
# Focus 2
def _focus_obj(bt, newfocus):
print newfocus
newfocus.focus = True
def _focus_layout_part(bt, layout):
newfocus = layout.edje.part_object_get("sky")
print newfocus
newfocus.focus = True
def focus2_clicked(obj, item=None):
win = StandardWindow("focus2", "Focus 2", autodel=True, size=(400, 400))
win.focus_highlight_enabled = True
bx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(bx)
bx.show()
PARENT = bx
en = Entry(PARENT, scrollable=True, single_line=True,
text="Entry that should get focus",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bx.pack_end(en)
en.show()
bt = Button(PARENT, text="Give focus to entry")
bt.callback_clicked_add(_focus_obj, en)
bx.pack_end(bt)
bt.show()
ly = Layout(PARENT, size_hint_weight=EXPAND_BOTH)
ly.file = edj_file, "layout"
bx.pack_end(ly)
ly.show()
bt1 = bt = Button(ly, text="Button 1")
ly.part_content_set("element1", bt)
en1 = Entry(ly, scrollable=True, single_line=True,
text="Scrolled Entry that should get focus",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ )
ly.part_content_set("element2", en1)
bt = Button(ly, text="Button 2")
ly.part_content_set("element3", bt)
bt = Button(PARENT, text="Give focus to layout",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(_focus_obj, ly)
bx.pack_end(bt)
bt.show()
bt = Button(PARENT, text="Give focus to layout part",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(_focus_layout_part, ly)
bx.pack_end(bt)
bt.show()
bt = Button(PARENT, text="Give focus to layout 'Button 1'",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(_focus_obj, bt1)
bx.pack_end(bt)
bt.show()
bt = Button(PARENT, text="Give focus to layout 'Entry'",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(_focus_obj, en1)
bx.pack_end(bt)
bt.show()
bt.focus_next_object_set(en, ELM_FOCUS_DOWN)
en.focus_next_object_set(bt, ELM_FOCUS_UP)
win.show()
# Focus 3
focused = None
def _focused_cb(obj):
global focused
print obj
focused = obj
def _unfocused_cb(obj):
global focused
print obj
focused = None
def _add_cb(bt, win, bx):
en = Entry(win, scrollable=True, single_line=True, text="An entry",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
en.callback_focused_add(_focused_cb)
en.callback_unfocused_add(_unfocused_cb)
bx.pack_start(en)
en.show()
def _del_cb(bt, bx):
if focused:
focused.delete()
def _hide_cb(bt):
if focused:
focused.hide()
def focus3_clicked(obj, item=None):
win = StandardWindow("focus3", "Focus 3", autodel=True, size=(320, 480))
win.focus_highlight_enabled = True
bx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(bx)
bx.show()
en = Entry(win, scrollable=True, single_line=True, text="An entry",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
en.callback_focused_add(_focused_cb)
en.callback_unfocused_add(_unfocused_cb)
bx.pack_end(en)
en.show()
bt = Button(win, text="Add", focus_allow=False,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(_add_cb, win, bx)
bx.pack_end(bt)
bt.show()
bt = Button(win, text="Del", focus_allow=False,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(_del_cb, bx)
bx.pack_end(bt)
bt.show()
bt = Button(win, text="hide", focus_allow=False,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(_hide_cb)
bx.pack_end(bt)
bt.show()
win.show()
# Focus 4
def _highlight_enabled_cb(chk, win):
conf.focus_highlight_enabled = chk.state
def _highlight_animate_cb(chk, win):
conf.focus_highlight_animate = chk.state
def _win_highlight_enabled_cb(chk, win):
win.focus_highlight_enabled = chk.state
def _win_highlight_animate_cb(chk, win):
win.focus_highlight_animate = chk.state
def _custom_chain_cb(chk, bx):
print chk.state
if chk.state is True:
i = 0
custom_chain = []
for child in bx.children:
print child
if i == 0:
c = child
custom_chain.append(child)
bx.focus_custom_chain_set(custom_chain)
elif i == 1:
bx.focus_custom_chain_prepend(child, c)
elif i == 2:
bx.focus_custom_chain_append(child, c)
c = child
elif i == 3:
bx.focus_custom_chain_prepend(child, c);
i += 1
else:
bx.focus_custom_chain_unset()
def focus4_clicked(obj, item=None):
win = StandardWindow("focus4", "Focus 4", autodel=True, size=(320, 320))
win.focus_highlight_enabled = True
win.focus_highlight_animate = True
fr = Frame(win, style="pad_large",
size_hint_weight=EXPAND_BOTH);
win.resize_object_add(fr)
fr.show()
# First Example - Using Focus Highlight
bx = Box(fr)
fr.content = bx
bx.show()
tg = Check(bx, text="Focus Highlight Enabled (Config)", state=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
tg.callback_changed_add(_highlight_enabled_cb, win)
bx.pack_end(tg)
tg.show()
tg = Check(bx, text="Focus Highlight Animate (Config)", state=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
tg.callback_changed_add(_highlight_animate_cb, win)
bx.pack_end(tg)
tg.show()
tg = Check(bx, text="Focus Highlight Enabled (Win)", state=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
tg.callback_changed_add(_win_highlight_enabled_cb, win)
bx.pack_end(tg)
tg.show()
tg = Check(bx, text="Focus Highlight Animate (Win)", state=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
tg.callback_changed_add(_win_highlight_animate_cb, win)
bx.pack_end(tg)
tg.show()
sp = Separator(win, horizontal=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(sp)
sp.show()
# Second Example - Using Custom Chain
lb = Label(bx, text="Custom Chain: Please use tab key to check",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(lb)
lb.show()
bx2 = Box(bx, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
bt1 = Button(bx2, text="Button 1",
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(bt1)
bt1.show()
bt2 = Button(bx2, text="Button 2",
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(bt2)
bt2.show()
bt3 = Button(bx2, text="Button 3",
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(bt3)
bt3.show()
bt4 = Button(bx2, text="Button 4",
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(bt4)
bt4.show()
bx2.focus_custom_chain = [bt2, bt1, bt4, bt3]
tg = Check(bx, text="Custom Chain", state=False,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
tg.callback_changed_add(_custom_chain_cb, bx)
bx.pack_end(tg)
tg.show()
win.show()
# Focus 5 (custom)
def _glow_effect_on_cb(btn, win, chk):
if chk.state:
win.focus_highlight_style = "glow_effect"
def _glow_effect_off_cb(btn, win, chk):
if chk.state:
win.focus_highlight_style = "glow"
def focus5_clicked(obj, item=None):
theme_overlay_add(os.path.join(script_path, "test_focus_custom.edj"))
win = StandardWindow("focus5", "Focus Custom", autodel=True, size=(320, 320))
win.focus_highlight_enabled = True
win.focus_highlight_animate = True
win.focus_highlight_style = "glow"
fr = Frame(win, style="pad_large",
size_hint_weight=EXPAND_BOTH);
win.resize_object_add(fr)
fr.show()
bx = Box(fr)
fr.content = bx
bx.show()
chk = Check(bx, text='Enable glow effect on "Glow" Button', state=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(chk)
chk.show()
spinner = Spinner(bx, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(spinner)
spinner.show()
bt = Button(bx, text="Glow Button",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bt.callback_focused_add(_glow_effect_on_cb, win, chk)
bt.callback_unfocused_add(_glow_effect_off_cb, win, chk)
bx.pack_end(bt)
bt.show()
sp = Separator(bx, horizontal=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(sp)
sp.show()
bx2 = Box(bx, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
for i in range (1, 5):
bt = Button(bx2, text="Button %d" % i,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(bt)
bt.show()
win.show()
if __name__ == "__main__":
elementary.init()
win = StandardWindow("test", "python-elementary test application",
size=(320,520))
win.callback_delete_request_add(lambda o: elementary.exit())
box0 = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(box0)
box0.show()
lb = Label(win)
lb.text_set("Please select a test from the list below<br>"
"by clicking the test button to show the<br>"
"test window.")
lb.show()
fr = Frame(win, text="Information", content=lb)
box0.pack_end(fr)
fr.show()
items = [("Focus", focus_clicked),
("Focus 2", focus2_clicked),
("Focus 3", focus3_clicked),
("Focus 4", focus4_clicked),
("Focus Custom", focus5_clicked)]
li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box0.pack_end(li)
li.show()
for item in items:
li.item_append(item[0], callback=item[1])
li.go()
win.show()
elementary.run()
elementary.shutdown()

View File

@ -0,0 +1,389 @@
// c1 - c4
// |base|
// | |
// c3 - c2
#define OUTER_BASE_PARTS(w, h) \
part { name: "base"; type: SPACER; \
description { \
state: "default" 0.0; } } \
part { name: "c1"; type: SPACER; \
description { state: "default" 0.0; \
rel1.to: "base"; \
rel2.to: "base"; \
rel2.relative: 0 0; \
align: 1 1; \
min: w h; \
max: w h; } } \
part { name: "c3"; type: SPACER; \
description { state: "default" 0.0; \
rel1.to: "base"; \
rel2.to: "base"; \
rel1.relative: 0 1; \
rel2.relative: 0 1; \
align: 1 0; \
min: w h; \
max: w h; } } \
part { name: "c4"; type: SPACER; \
description { state: "default" 0.0; \
rel1.to: "base"; \
rel2.to: "base"; \
rel1.relative: 1 0; \
rel2.relative: 1 0; \
min: w h; \
max: w h; } } \
part { name: "c2"; type: SPACER; \
mouse_events: 0; \
description { state: "default" 0.0; \
rel1.to: "base"; \
rel1.relative: 1 1; \
rel2.to: "base"; \
rel2.relative: 1 1; \
align: 0 0; \
min: w h; \
max: w h; } }
collections {
group { name: "elm/focus_highlight/top/glow";
images {
image: "border6.png" COMP;
}
data.item: "animate" "on";
script {
public src_x, src_y, src_w, src_h;
public diffx, diffy, diffw, diffh;
public anim_highlight(val, Float:pos) {
new x, y, w, h, dx, dy, dw, dh;
dx = round(float_mul(float(get_int(diffx)), pos));
x = get_int(src_x) + dx;
dy = round(float_mul(float(get_int(diffy)), pos));
y = get_int(src_y) + dy;
dw = round(float_mul(float(get_int(diffw)), pos));
w = get_int(src_w) + dw;
dh = round(float_mul(float(get_int(diffh)), pos));
h = get_int(src_h) + dh;
update_offset(x, y, w, h);
if(pos >= 1.0) {
emit("elm,action,focus,anim,end", "");
set_state(PART:"highlight", "default", 0.0);
}
}
public update_offset(x, y, w, h) {
set_state_val(PART:"base", STATE_REL1_OFFSET, x, y);
set_state_val(PART:"base", STATE_REL2_OFFSET, x + w, y + h);
}
public message(Msg_Type:type, id, ...) {
if((type == MSG_INT_SET) && (id == 1)) {
new x1, y1, w1, h1, x2, y2, w2, h2;
x1 = getarg(2);
y1 = getarg(3);
w1 = getarg(4);
h1 = getarg(5);
x2 = getarg(6);
y2 = getarg(7);
w2 = getarg(8);
h2 = getarg(9);
set_int(src_x, x1);
set_int(src_y, y1);
set_int(src_w, w1);
set_int(src_h, h1);
set_int(diffx, x2 - x1);
set_int(diffy, y2 - y1);
set_int(diffw, w2 - w1);
set_int(diffh, h2 - h1);
custom_state(PART:"base", "default", 0.0);
set_state_val(PART:"base", STATE_REL1, 0.0, 0.0);
set_state_val(PART:"base", STATE_REL2, 0.0, 0.0);
update_offset(x1, y1, w1, h1);
set_state(PART:"base", "custom", 0.0);
anim(0.2, "anim_highlight", 0);
}
}
} //script ends
parts {
OUTER_BASE_PARTS(12, 12);
part { name: "highlight"; type: IMAGE;
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "border6.png";
image.border: 20 20 20 20;
rel1.to: "c1";
rel2.to: "c2";
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
}
description { state: "invisible" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
} //parts ends
programs {
program { name: "show";
signal: "elm,action,focus,show";
source: "elm";
action: ACTION_STOP;
target: "hide";
target: "hide_start";
target: "hide_end";
after: "show_start";
}
program { name: "show_start";
action: STATE_SET "visible" 0.0;
transition: SIN 0.2;
target: "highlight";
after: "show_end";
}
program { name: "show_end";
action: SIGNAL_EMIT "elm,action,focus,show,end" "";
}
program { name: "hide";
signal: "elm,action,focus,hide";
source: "elm";
action: ACTION_STOP;
target: "show";
target: "show_start";
target: "show_end";
after: "hide_start";
}
program { name: "hide_start";
action: STATE_SET "invisible" 0.0;
transition: SIN 0.2;
target: "highlight";
after: "hide_end";
}
program { name: "hide_end";
action: SIGNAL_EMIT "elm,action,focus,hide,end" "";
}
} //programs ends
} //group ends
group { name: "elm/focus_highlight/top/glow_effect";
inherit: "elm/focus_highlight/top/glow";
images {
image: "border.png" COMP;
image: "border2.png" COMP;
image: "border3.png" COMP;
image: "border4.png" COMP;
image: "border5.png" COMP;
image: "border6.png" COMP;
}
data.item: "animate" "on";
script {
public src_x, src_y, src_w, src_h;
public diffx, diffy, diffw, diffh;
public anim_highlight(val, Float:pos) {
new x, y, w, h, dx, dy, dw, dh, Float:p;
p = 1.0 - ((1.0 - pos) * (1.0 - pos) * (1.0 - pos));
dx = round(float_mul(float(get_int(diffx)), p));
x = get_int(src_x) + dx;
dy = round(float_mul(float(get_int(diffy)), p));
y = get_int(src_y) + dy;
dw = round(float_mul(float(get_int(diffw)), p));
w = get_int(src_w) + dw;
dh = round(float_mul(float(get_int(diffh)), p));
h = get_int(src_h) + dh;
update_offset(x, y, w, h);
if(pos >= 1.0) {
emit("elm,action,focus,anim,end", "");
set_state(PART:"highlight", "default", 0.0);
emit("dim", "");
}
}
public update_offset(x, y, w, h) {
set_state_val(PART:"base", STATE_REL1_OFFSET, x, y);
set_state_val(PART:"base", STATE_REL2_OFFSET, x + w, y + h);
}
public message(Msg_Type:type, id, ...) {
if((type == MSG_INT_SET) && (id == 1)) {
new x1, y1, w1, h1, x2, y2, w2, h2;
x1 = getarg(2);
y1 = getarg(3);
w1 = getarg(4);
h1 = getarg(5);
x2 = getarg(6);
y2 = getarg(7);
w2 = getarg(8);
h2 = getarg(9);
set_int(src_x, x1);
set_int(src_y, y1);
set_int(src_w, w1);
set_int(src_h, h1);
set_int(diffx, x2 - x1);
set_int(diffy, y2 - y1);
set_int(diffw, w2 - w1);
set_int(diffh, h2 - h1);
custom_state(PART:"base", "default", 0.0);
set_state_val(PART:"base", STATE_REL1, 0.0, 0.0);
set_state_val(PART:"base", STATE_REL2, 0.0, 0.0);
update_offset(x1, y1, w1, h1);
set_state(PART:"base", "custom", 0.0);
anim(0.2, "anim_highlight", 0);
}
}
} //script ends
parts {
part { name: "highlight"; type: IMAGE;
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "border6.png";
image.border: 16 16 16 16;
rel1.to: "c1";
rel2.to: "c2";
visible: 1;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
}
description { state: "visible" 0.1;
inherit: "visible" 0.0;
image.normal: "border2.png";
image.border: 18 18 18 18;
}
description { state: "visible" 0.2;
inherit: "visible" 0.0;
image.normal: "border3.png";
image.border: 19 19 19 19;
}
description { state: "visible" 0.3;
inherit: "visible" 0.0;
image.normal: "border4.png";
image.border: 20 20 20 20;
}
description { state: "visible" 0.4;
inherit: "visible" 0.0;
image.normal: "border5.png";
image.border: 21 21 21 21;
}
description { state: "visible" 0.5;
inherit: "visible" 0.0;
image.normal: "border6.png";
image.border: 25 25 25 25;
}
description { state: "invisible" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
}//parts ends
programs {
program { name: "show";
signal: "elm,action,focus,show";
source: "elm";
action: ACTION_STOP;
target: "hide";
target: "hide_start";
target: "hide_end";
after: "show_start";
}
program { name: "show_start";
action: SIGNAL_EMIT "dim" "";
after: "show_end";
}
program { name: "dim_start";
signal: "dim";
in: 2 0.4;
source: "";
action: STATE_SET "visible" 0.4;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "dim1";
}
program { name: "dim1";
action: STATE_SET "visible" 0.3;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "dim2";
}
program { name: "dim2";
action: STATE_SET "visible" 0.2;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "dim3";
}
program { name: "dim3";
action: STATE_SET "visible" 0.1;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "dim_end";
}
program { name: "dim_end";
action: SIGNAL_EMIT "glow" "";
}
program { name: "glow_start";
signal: "glow";
source: "";
in: 1 0.4;
action: STATE_SET "visible" 0.0;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "glow1";
}
program { name: "glow1";
action: STATE_SET "visible" 0.1;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "glow2";
}
program { name: "glow2";
action: STATE_SET "visible" 0.2;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "glow3";
}
program { name: "glow3";
action: STATE_SET "visible" 0.3;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "glow4";
}
program { name: "glow4";
action: STATE_SET "visible" 0.4;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "glow5";
}
program { name: "glow5";
action: STATE_SET "visible" 0.5;
transition: SINUSOIDAL 0.2;
target: "highlight";
after: "glow1";
}
program { name: "show_end";
action: SIGNAL_EMIT "elm,action,focus,show,end" "";
}
program { name: "hide";
signal: "elm,action,focus,hide";
source: "elm";
action: ACTION_STOP;
target: "show";
target: "show_start";
target: "show_end";
after: "hide_start";
}
program { name: "hide_start";
action: STATE_SET "invisible" 0.0;
transition: LIN 0.2;
target: "highlight";
after: "hide_end";
}
program { name: "hide_end";
action: SIGNAL_EMIT "elm,action,focus,hide,end" "";
}
} //programs ends
} //group ends
}

Binary file not shown.

View File

@ -4,7 +4,7 @@
import time
import sys
import os
if sys.version_info < (3,): range = xrange
#if sys.version_info < (3,): range = xrange
from efl import evas
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, \

View File

@ -4,7 +4,7 @@
import os
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
from efl.ecore import Timer
from efl.ecore import Timer, timer_add
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
@ -126,8 +126,7 @@ def tooltip_clicked(obj):
del data["timer"]
obj.text_set("Icon tooltip, click to start changed timed")
return
data["timer"] = ecore.timer_add(1.5, _tt_icon_replace_timer_cb, obj,
data)
data["timer"] = timer_add(1.5, _tt_icon_replace_timer_cb, obj, data)
obj.text_set("Icon tooltip, click to stop changed timed")
bt = Button(win, text="Icon tooltip, click to start changed timed")
@ -160,8 +159,7 @@ def tooltip_clicked(obj):
del data["timer"]
obj.text_set("Icon tooltip style, click to start changed timed")
return
data["timer"] = ecore.timer_add(1.5, _tt_style_replace_timer_cb, obj,
data)
data["timer"] = timer_add(1.5, _tt_style_replace_timer_cb, obj, data)
obj.text_set("Icon tooltip, click to stop changed timed")
bt = Button(win, text="Icon tooltip style, click to start changed timed")

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python
import os
import optparse
import subprocess
@ -8,17 +9,11 @@ from efl import edje
from efl import emotion
from efl.emotion import Emotion
from efl import elementary
from efl.elementary.window import Window
from efl.elementary.window import Window, ELM_WIN_BASIC
def pkgconfig_variable(pkg, var):
output = subprocess.check_output(["pkg-config", "--variable=" + var, pkg])
return output.decode("utf-8").strip()
prefix_dir = pkgconfig_variable("emotion", "prefix")
data_dir = prefix_dir + "/share/emotion/data"
theme_file = data_dir + "/theme.edj"
script_path = os.path.dirname(os.path.abspath(__file__))
theme_file = os.path.join(script_path, "theme.edj")
class MyDecoratedEmotion(Emotion):
@ -201,7 +196,7 @@ class MovieWindow(edje.Edje):
print("spu button num: %d" % vid.spu_button_count)
def vid_button_change_cb(self, vid):
print ("spu button: %s" % vid.spu_button)
print("spu button: %s" % vid.spu_button)
class AppKeyboardEvents(object):
@ -237,6 +232,11 @@ class AppKeyboardEvents(object):
print("\tspu channels: %d" % mw.vid.spu_channel_count())
print("\tseekable: %s" % mw.vid.seekable)
def toggle_pause(win):
for mw in win.data["movie_windows"]:
mw.vid.play = not mw.vid.play
print("play is now %s" % mw.vid.play)
def fullscreen_change(win):
win.fullscreen = not win.fullscreen
print("fullscreen is now %s" % win.fullscreen)
@ -288,6 +288,7 @@ class AppKeyboardEvents(object):
"s": (shaped_change,),
"b": (bordless_change,),
"q": (main_delete_request,),
"p": (toggle_pause,),
}
def __call__(self, win, info):
try:
@ -338,12 +339,11 @@ if __name__ == "__main__"or True:
elementary.init()
# elementary window
win = Window("test-emotion", elementary.ELM_WIN_BASIC)
win = Window("test-emotion", ELM_WIN_BASIC)
win.title_set("python-emotion test application")
win.callback_delete_request_add(lambda o: elementary.exit())
win.on_key_down_add(AppKeyboardEvents())
# edje main scene object
scene = edje.Edje(win.evas, file=theme_file, group="background")
win.resize_object_add(scene)

BIN
examples/emotion/theme.edj Normal file

Binary file not shown.

View File

@ -111,14 +111,18 @@ cdef extern from "Edje.h":
double default "def", min, max, step
ctypedef struct aux_external_param_info_string:
char *default "def", *accept_fmt, *deny_fmt
char *default "def"
char *accept_fmt
char *deny_fmt
ctypedef struct aux_external_param_info_bool:
unsigned int default "def"
char *false_str, *true_str
char *false_str
char *true_str
ctypedef struct aux_external_param_info_choice:
char *default "def", **choices
char *default "def"
char **choices
ctypedef union aux_external_param_info:
aux_external_param_info_int i

Some files were not shown because too many files have changed in this diff Show More